@swap-coffee/ui-sdk
Version:
User Interface SDK of swap.coffee DEX aggregator for integration in web applications
530 lines (529 loc) • 29 kB
JavaScript
import { S as k, T as N, M as V, a as L, c as w, t as O, u as A, b as D, d as G, e as X, R, p as q, _ as U, r as d, o as g, f as B, w as _, g as s, h as p, i as m, v as x, n as r, j as u, k as C, l as M, m as S, q as c, s as W, F, x as Y } from "./main-DEOEaMc1.js";
const Z = {
name: "DexSettings",
components: {
SwitchToggle: k,
TooltipWrapper: N,
ModalWrapper: V,
MevSettings: L
},
mixins: [w, O],
inject: ["updateSettingsModalVisible", "liquiditySourcesList"],
data() {
return {
cashback: !1,
slippage: 0,
priceImpact: 0,
maxPoolVolatility: 0,
maxIntermediateTokens: 0,
maxSplits: 0,
isV5: !1,
showTooltip: !1,
liquiditySources: [
{
name: "dedust",
enabled: !0
},
{
name: "stonfi",
enabled: !0
},
{
name: "stonfi_v2",
enabled: !0
},
{
name: "coffee",
enabled: !0
},
{
name: "tonco",
enabled: !0
},
{
name: "tonstakers",
enabled: !0
},
{
name: "colossus",
enabled: !0
},
{
name: "torch_finance",
enabled: !0
}
]
};
},
computed: {
dexSettingsStore() {
return A();
},
settingsStore() {
return D();
},
dexStore() {
return G();
},
activeSlippageConditions() {
let e = Number(this.slippage);
return e > 0 && e !== 1 && e !== 5 && e !== 10;
},
activePriceImpactConditions() {
let e = Number(this.priceImpact);
return e > 0 && e !== 5 && e !== 10 && e !== 30;
},
getExpertMode() {
return this.dexSettingsStore.GET_EXPERT_MODE_VALUE;
},
activeMaxSplitsConditions() {
return Number(this.priceImpact) === 0;
}
},
methods: {
switchExpertMode() {
const e = !this.getExpertMode;
this.dexSettingsStore.DEX_EXPERT_MODE(e), this.saveToStorage("expertMode", e), this.toggleExpertsSettingsValues(e);
},
// switchCashback(value, notSave) {
// // console.log(value, 'CASHBACK VALUE')
// typeof value === 'boolean' ? this.cashback = value : this.cashback = !this.cashback
// this.DEX_CASHBACK(this.cashback)
// if (!notSave) {
// this.saveToStorage('cashback', this.cashback)
// }
// },
changeSlippage(e, t) {
this.slippage = e, this.dexSettingsStore.DEX_SLIPPAGE(Number(e)), t || this.saveToStorage("slippage", this.slippage);
},
changeSlippageInput(e) {
let t = e.target.value;
t = t.replace(",", "."), this.slippage = t.replace(/[^0-9.]/g, "");
let a = Number(this.slippage);
a > 100 ? this.slippage = 100 : a < 0 && (this.slippage = 1), this.dexSettingsStore.DEX_SLIPPAGE(this.slippage), this.saveToStorage("slippage", this.slippage);
},
blurSlippageInput() {
this.slippage = String(this.slippage).replace(",", "."), this.slippage = Number(this.slippage), (isNaN(this.slippage) || this.slippage === 0) && (this.slippage = 1), this.dexSettingsStore.DEX_SLIPPAGE(this.slippage), this.saveToStorage("slippage", this.slippage);
},
changePriceImpactInput(e) {
let t = e.target.value;
t = t.replace(",", "."), this.priceImpact = t.replace(/[^0-9.]/g, "");
let a = Number(this.priceImpact);
a < 0 ? this.priceImpact = "" : a > 100 && (this.priceImpact = 100), this.dexSettingsStore.DEX_PRICE_IMPACT(this.priceImpact), this.saveToStorage("priceImpact", this.priceImpact);
},
blurPriceImpactInput() {
this.priceImpact = String(this.priceImpact).replace(",", "."), this.priceImpact = Number(this.priceImpact), this.priceImpact.length === 0 || isNaN(Number(this.priceImpact)) ? this.priceImpact = 10 : Number(this.priceImpact) === 0 && (this.priceImpact = 10), this.dexSettingsStore.DEX_PRICE_IMPACT(this.priceImpact), this.saveToStorage("priceImpact", this.priceImpact);
},
changePriceImpact(e, t) {
this.priceImpact = e, this.dexSettingsStore.DEX_PRICE_IMPACT(e), t || this.saveToStorage("priceImpact", e);
},
changeMaxPoolVolatility(e, t) {
this.maxPoolVolatility = e, this.dexSettingsStore.DEX_MAX_POOL_VOLATILITY(e), t || this.saveToStorage("maxPoolVolatility", e);
},
changeMaxIntermediateTokens(e, t) {
this.maxIntermediateTokens = e, this.dexSettingsStore.DEX_MAX_INTERMEDIATE_TOKENS(e), t || this.saveToStorage("maxIntermediateTokens", e);
},
changeMaxSplits(e, t) {
this.maxSplits = e, this.dexSettingsStore.DEX_MAX_SPLITS(e), t || this.saveToStorage("maxSplits", e);
},
changeLiquiditySources(e, t) {
var o;
if (((o = this.liquiditySourcesList) == null ? void 0 : o.length) > 0) return;
this.liquiditySources = this.liquiditySources.map(
(i) => i.name === e ? { ...i, enabled: !i.enabled } : i
);
const a = this.liquiditySources.filter((i) => i.enabled).map((i) => i.name);
this.dexSettingsStore.DEX_LIQUIDITY_SOURCES(a), t || this.saveToStorage("liquiditySources", a);
},
changeMaxSplitsInput() {
let e = this.maxSplits.toString();
if (!/^\d+$/.test(e)) {
this.maxSplits = "";
return;
}
let t = parseInt(e);
this.isV5 ? t > 20 ? this.maxSplits = 20 : t < 1 && (this.maxSplits = 1) : t > 4 ? this.maxSplits = 4 : t < 1 && (this.maxSplits = 1), this.dexSettingsStore.DEX_MAX_SPLITS(this.maxSplits), this.saveToStorage("maxSplits", this.maxSplits);
},
async saveToStorage(e, t) {
var a;
try {
let o = this.settingsStore.GET_USER_SETTINGS;
if (!o) {
let i = JSON.parse(localStorage.getItem("dexSettings"));
i ? o = i : o = {};
}
o.hasOwnProperty("dexSettings") || (o.dexSettings = {}), o.dexSettings[e] = t, localStorage.removeItem("dexSettings"), localStorage.setItem("dexSettings", JSON.stringify(o)), this.dexStore.GET_PROOF_VERIFICATION && this.dexStore.GET_DEX_WALLET && (X(R.SWAP_SETTINGS_UPDATED, o), await q.writeStorage(
(a = this.dexStore.GET_DEX_WALLET) == null ? void 0 : a.address,
this.dexStore.GET_PROOF_VERIFICATION,
o
));
} catch (o) {
console.error(o);
}
},
async checkStorageSettings() {
var e, t;
try {
let a = (e = this.settingsStore.GET_USER_SETTINGS) == null ? void 0 : e.dexSettings;
if (!a) {
let o = (t = JSON.parse(localStorage.getItem("dexSettings"))) == null ? void 0 : t.dexSettings;
o ? a = o : a = {};
}
a.hasOwnProperty("expertMode") && this.dexSettingsStore.DEX_EXPERT_MODE(a.expertMode), a.hasOwnProperty("slippage") ? this.changeSlippage(a.slippage, !0) : this.slippage = this.dexSettingsStore.GET_SLIPPAGE, a.hasOwnProperty("cashback") && delete a.cashback, this.getExpertMode && (a.hasOwnProperty("priceImpact") ? this.changePriceImpact(a.priceImpact, !0) : this.priceImpact = this.dexSettingsStore.GET_PRICE_IMPACT, a.hasOwnProperty("maxPoolVolatility") ? this.changeMaxPoolVolatility(a.maxPoolVolatility, !0) : this.maxPoolVolatility = this.dexSettingsStore.GET_MAX_POOL_VOLATILITY, a.hasOwnProperty("maxIntermediateTokens") ? this.changeMaxIntermediateTokens(a.maxIntermediateTokens, !0) : this.maxIntermediateTokens = this.dexSettingsStore.GET_MAX_INTERMEDIATE_TOKENS, a.hasOwnProperty("maxSplits") ? this.changeMaxSplits(a.maxSplits, !0) : this.maxSplits = this.dexSettingsStore.GET_MAX_SPLITS, a.hasOwnProperty("liquiditySources") ? this.liquiditySources = this.liquiditySources.map((o) => ({
name: o == null ? void 0 : o.name,
enabled: a.liquiditySources.some((i) => i === (o == null ? void 0 : o.name))
})) : this.liquiditySources = this.dexSettingsStore.GET_LIQUIDITY_SOURCES.map((o) => ({
name: o,
enabled: this.liquiditySources.some((i) => i.name === o)
})));
} catch (a) {
console.error(a);
}
},
toggleExpertsSettingsValues(e) {
var a, o;
let t = (a = this.settingsStore.GET_USER_SETTINGS) == null ? void 0 : a.dexSettings;
if (!t) {
let i = (o = JSON.parse(localStorage.getItem("dexSettings"))) == null ? void 0 : o.dexSettings;
i ? t = i : t = {};
}
e ? (t.hasOwnProperty("priceImpact") ? this.changePriceImpact(t.priceImpact, !0) : this.changePriceImpact(this.dexSettingsStore.GET_PRICE_IMPACT), t.hasOwnProperty("maxPoolVolatility") ? this.changeMaxPoolVolatility(t.maxPoolVolatility, !0) : this.changeMaxPoolVolatility(this.dexSettingsStore.GET_MAX_POOL_VOLATILITY), t.hasOwnProperty("maxIntermediateTokens") ? this.changeMaxIntermediateTokens(t.maxIntermediateTokens, !0) : this.changeMaxIntermediateTokens(this.dexSettingsStore.GET_MAX_INTERMEDIATE_TOKENS), t.hasOwnProperty("maxSplits") ? this.changeMaxSplits(t.maxSplits, !0) : this.maxSplits = this.dexSettingsStore.GET_MAX_SPLITS, t.hasOwnProperty("liquiditySources") ? this.changeLiquiditySources(t.liquiditySources, !0) : this.liquiditySources = this.dexSettingsStore.GET_LIQUIDITY_SOURCES.map((i) => ({
name: i,
enabled: this.liquiditySources.some((l) => l.name === i)
}))) : (this.dexSettingsStore.CLEAR_DEX_EXPERTS_SETTINGS(), this.priceImpact = this.dexSettingsStore.GET_PRICE_IMPACT, this.maxPoolVolatility = this.dexSettingsStore.GET_MAX_POOL_VOLATILITY, this.maxIntermediateTokens = this.dexSettingsStore.GET_MAX_INTERMEDIATE_TOKENS, this.maxSplits = this.dexSettingsStore.GET_MAX_SPLITS);
},
blurMaxSplitsInput() {
this.maxSplits.length === 0 ? this.isV5 ? this.maxSplits = 20 : this.maxSplits = 4 : Number(this.maxSplits) === 0 && (this.isV5 ? this.maxSplits = 20 : this.maxSplits = 4), this.dexSettingsStore.DEX_MAX_SPLITS(this.maxSplits), this.saveToStorage("maxSplits", this.maxSplits);
},
isV5WalletChecker() {
return this.isV5 = this.dexStore.GET_DEX_WALLET_VERSION >= 5, this.isV5;
},
closeTooltip() {
this.showTooltip = !1;
},
isActiveSource(e) {
return this.liquiditySources.some((t) => t.name === e && t.enabled);
}
},
watch: {
"dexStore.GET_DEX_WALLET_VERSION": {
handler() {
var t;
this.isV5WalletChecker();
let e = this.settingsStore.GET_USER_SETTINGS;
e || (e = JSON.parse(localStorage.getItem("dexSettings"))), !(((t = e == null ? void 0 : e.dexSettings) == null ? void 0 : t.maxSplits) >= 0) && (this.isV5 === !0 ? this.changeMaxSplits(20) : this.isV5 === !1 && this.changeMaxSplits(4), this.dexSettingsStore.DEX_MAX_SPLITS(this.maxSplits));
}
},
"settingsStore.GET_USER_SETTINGS": {
handler() {
this.checkStorageSettings();
}
}
},
mounted() {
this.checkStorageSettings();
}
}, J = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%3e%3cpath%20d='M13.75%2016.1906C14.1811%2016.0208%2014.599%2015.8189%2015%2015.5867V18.75C15%2018.9158%2014.9341%2019.0748%2014.8169%2019.192C14.6997%2019.3092%2014.5407%2019.375%2014.375%2019.375C14.2092%2019.375%2014.0503%2019.3092%2013.933%2019.192C13.8158%2019.0748%2013.75%2018.9158%2013.75%2018.75V16.1906ZM14.6687%209.28205L10.2937%206.94846C10.1478%206.8739%209.97836%206.85967%209.822%206.90882C9.66564%206.95798%209.53485%207.06659%209.4578%207.21126C9.38075%207.35593%209.36362%207.52507%209.41009%207.68225C9.45656%207.83943%209.56291%207.97207%209.70624%208.05158L13.3594%2010L14.6875%209.29221L14.6687%209.28205ZM19.6687%206.94846L10.2937%201.94846C10.2033%201.90031%2010.1024%201.87512%209.99999%201.87512C9.89754%201.87512%209.79666%201.90031%209.70624%201.94846L0.331238%206.94846C0.231241%207.00175%200.147613%207.08122%200.0893003%207.17838C0.0309873%207.27553%200.000183105%207.38671%200.000183105%207.50002C0.000183105%207.61333%200.0309873%207.72451%200.0893003%207.82166C0.147613%207.91882%200.231241%207.99829%200.331238%208.05158L2.49999%209.20861V12.9914C2.49934%2013.2984%202.61232%2013.5948%202.81718%2013.8235C3.84061%2014.9633%206.13358%2016.875%209.99999%2016.875C11.282%2016.8856%2012.5544%2016.6534%2013.75%2016.1906V10.2086L13.3594%2010L9.99999%2011.7914L3.42421%208.28127L1.95311%207.50002L9.99999%203.20861L18.0469%207.50002L16.5797%208.28127H16.575L14.6875%209.29221C14.7825%209.34707%2014.8614%209.42599%2014.9163%209.52103C14.9711%209.61607%2015%209.72388%2015%209.83361V15.5867C15.815%2015.1163%2016.5515%2014.5213%2017.1828%2013.8235C17.3877%2013.5948%2017.5006%2013.2984%2017.5%2012.9914V9.20861L19.6687%208.05158C19.7687%207.99829%2019.8524%207.91882%2019.9107%207.82166C19.969%207.72451%2019.9998%207.61333%2019.9998%207.50002C19.9998%207.38671%2019.969%207.27553%2019.9107%207.17838C19.8524%207.08122%2019.7687%207.00175%2019.6687%206.94846Z'%20fill='url(%23paint0_linear_3204_3036)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_3204_3036'%20x1='0.000183105'%20y1='10.6251'%20x2='19.9998'%20y2='10.6251'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23E04A29'/%3e%3cstop%20offset='1'%20stop-color='%23FD754A'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", K = { class: "settings__text" }, H = { class: "settings__description" }, Q = {
for: "",
class: "settings__label"
}, j = { class: "block-slippage" }, z = { class: "settings__item-mode" }, $ = { class: "settings__group" }, tt = { class: "settings__info" }, et = { class: "settings__name" }, st = { class: "settings__text-info" }, it = { class: "settings__show-more" }, nt = { class: "settings__text" }, lt = { class: "settings__description" }, at = {
for: "",
class: "settings__label"
}, ot = { class: "settings__button-block" }, rt = { class: "settings__text" }, pt = { class: "settings__description" }, gt = { class: "settings__button-column intermediate-token" }, St = { class: "settings__button-group" }, ct = { class: "settings__text" }, mt = { class: "settings__description" }, ut = { class: "settings__button-column intermediate-token" }, dt = { class: "settings__button-group" }, ht = { class: "settings__text" }, _t = { class: "settings__description" }, xt = { key: 0 }, It = { class: "description-color" }, Tt = { class: "word-wrap" }, bt = {
key: 0,
for: "",
class: "settings__label"
}, Et = { class: "settings__button-column intermediate-token" }, vt = {
key: 0,
class: "settings__button-group"
}, Ct = {
key: 1,
class: "settings__button-group"
}, Mt = {
key: 1,
class: "settings__text"
}, ft = {
key: 2,
class: "settings__description"
}, yt = {
key: 3,
class: "settings__block"
}, Pt = { class: "settings__block-list" }, kt = { class: "block-item__left" }, Nt = ["src", "alt"], Vt = { class: "block-item__title" };
function Lt(e, t, a, o, i, l) {
const f = d("MevSettings"), I = d("switch-toggle"), y = d("tooltip-wrapper"), P = d("modal-wrapper");
return g(), B(P, {
class: "modal",
title: e.$t("dexSettings.caption"),
"padding-zero": !0,
onCloseModal: t[33] || (t[33] = (h) => e.$emit("closeSettings"))
}, {
default: _(() => {
var h, T, b;
return [
s("div", {
class: r(["settings__content custom-scroll", { show_expert: l.getExpertMode }])
}, [
s("div", null, [
s("p", K, p(e.$t("dexSettings.slippage.title")), 1),
s("p", H, p(e.$t("dexSettings.slippage.text")), 1),
s("label", Q, [
m(s("input", {
"onUpdate:modelValue": t[0] || (t[0] = (n) => i.slippage = n),
type: "text",
class: r(["settings__input", { active_input: l.activeSlippageConditions }]),
inputmode: "decimal",
step: "any",
lang: "en",
onBlur: t[1] || (t[1] = (...n) => l.blurSlippageInput && l.blurSlippageInput(...n)),
onInput: t[2] || (t[2] = (...n) => l.changeSlippageInput && l.changeSlippageInput(...n))
}, null, 34), [
[x, i.slippage]
])
]),
s("div", j, [
s("button", {
class: r(["settings__button", { active: Number(i.slippage) === 1 }]),
onClick: t[3] || (t[3] = (n) => l.changeSlippage(1))
}, " 1% ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.slippage) === 5 }]),
onClick: t[4] || (t[4] = (n) => l.changeSlippage(5))
}, " 5% ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.slippage) === 10 }]),
onClick: t[5] || (t[5] = (n) => l.changeSlippage(10))
}, " 10% ", 2)
])
]),
u(f, {
"is-hidden": !0,
class: "block-settings"
}),
s("div", z, [
s("div", $, [
s("div", tt, [
t[34] || (t[34] = s("img", {
src: J,
alt: "gift icon",
class: "settings__icon"
}, null, -1)),
s("p", et, p(e.$t("dexSettings.expert.title")), 1)
]),
s("p", st, p(e.$t("dexSettings.expert.text")), 1)
]),
u(I, {
class: r({ active_switch: l.getExpertMode }),
onClick: l.switchExpertMode
}, null, 8, ["class", "onClick"])
]),
m(s("div", it, [
s("p", nt, p(e.$t("dexSettings.priceImpact.title")), 1),
s("p", lt, p(e.$t("dexSettings.priceImpact.text")), 1),
s("label", at, [
m(s("input", {
"onUpdate:modelValue": t[6] || (t[6] = (n) => i.priceImpact = n),
type: "text",
class: r(["settings__input", { active_input: l.activePriceImpactConditions }]),
inputmode: "decimal",
step: "any",
lang: "en",
autocomplete: "off",
onInput: t[7] || (t[7] = (...n) => l.changePriceImpactInput && l.changePriceImpactInput(...n)),
onBlur: t[8] || (t[8] = (...n) => l.blurPriceImpactInput && l.blurPriceImpactInput(...n))
}, null, 34), [
[x, i.priceImpact]
])
]),
s("div", ot, [
s("button", {
class: r(["settings__button", { active: Number(i.priceImpact) === 5 }]),
onClick: t[9] || (t[9] = (n) => l.changePriceImpact(5))
}, " 5% ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.priceImpact) === 10 }]),
onClick: t[10] || (t[10] = (n) => l.changePriceImpact(10))
}, " 10% ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.priceImpact) === 30 }]),
onClick: t[11] || (t[11] = (n) => l.changePriceImpact(30))
}, " 30% ", 2)
]),
s("p", rt, p(e.$t("dexSettings.intermediate.title")), 1),
s("p", pt, p(e.$t("dexSettings.intermediate.text")), 1),
s("div", gt, [
s("div", St, [
s("button", {
class: r(["settings__button", { active: Number(i.maxIntermediateTokens) === 0 }]),
onClick: t[12] || (t[12] = (n) => l.changeMaxIntermediateTokens(0))
}, " 0 ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.maxIntermediateTokens) === 1 }]),
onClick: t[13] || (t[13] = (n) => l.changeMaxIntermediateTokens(1))
}, " 1 ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.maxIntermediateTokens) === 2 }]),
onClick: t[14] || (t[14] = (n) => l.changeMaxIntermediateTokens(2))
}, " 2 ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.maxIntermediateTokens) === 3 }]),
onClick: t[15] || (t[15] = (n) => l.changeMaxIntermediateTokens(3))
}, " 3 ", 2)
])
]),
s("p", ct, p(e.$t("dexSettings.volatility.title")), 1),
s("p", mt, p(e.$t("dexSettings.volatility.text")), 1),
s("div", ut, [
s("div", dt, [
s("button", {
class: r(["settings__button", { active: Number(i.maxPoolVolatility) === 5 }]),
onClick: t[16] || (t[16] = (n) => l.changeMaxPoolVolatility(5))
}, " 5% ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.maxPoolVolatility) === 15 }]),
onClick: t[17] || (t[17] = (n) => l.changeMaxPoolVolatility(15))
}, " 15% ", 2),
s("button", {
class: r(["settings__button yellow_status", { active: Number(i.maxPoolVolatility) === 30 }]),
onClick: t[18] || (t[18] = (n) => l.changeMaxPoolVolatility(30))
}, " 30% ", 2),
s("button", {
class: r(["settings__button red_status", { active: Number(i.maxPoolVolatility) === -1 }]),
onClick: t[19] || (t[19] = (n) => l.changeMaxPoolVolatility(-1))
}, " Ignore ", 2)
])
]),
s("p", ht, p(e.$t("dexSettings.parallel.title")), 1),
s("p", _t, [
M(p(e.$t("dexSettings.parallel.text")) + " ", 1),
i.isV5 ? c("", !0) : (g(), S("span", xt, [
M(p(e.$t("dexSettings.parallel.textW5")) + " ", 1),
s("strong", It, p(e.$t("dexSettings.parallel.colorText")), 1)
])),
s("span", {
class: "info-wrapper",
onMouseenter: t[20] || (t[20] = (n) => i.showTooltip = !0),
onMouseleave: t[21] || (t[21] = (n) => i.showTooltip = !1)
}, [
u(W, { name: "tooltip" }, {
default: _(() => [
m(u(y, {
class: "btn-tooltip",
onHiddenTooltip: l.closeTooltip
}, {
default: _(() => [
s("span", Tt, p(e.$t("dexSettings.parallel.tooltip")), 1)
]),
_: 1
}, 8, ["onHiddenTooltip"]), [
[C, i.showTooltip]
])
]),
_: 1
}),
t[35] || (t[35] = s("svg", {
class: "tooltip-icon",
xmlns: "http://www.w3.org/2000/svg",
width: "16",
height: "16",
viewBox: "0 0 16 16",
fill: "none"
}, [
s("g", { opacity: "0.5" }, [
s("path", {
d: "M8 1.5C6.71442 1.5 5.45772 1.88122 4.3888 2.59545C3.31988 3.30968 2.48676 4.32484 1.99479 5.51256C1.50282 6.70028 1.37409 8.00721 1.6249 9.26809C1.8757 10.529 2.49477 11.6872 3.40381 12.5962C4.31285 13.5052 5.47104 14.1243 6.73192 14.3751C7.99279 14.6259 9.29973 14.4972 10.4874 14.0052C11.6752 13.5132 12.6903 12.6801 13.4046 11.6112C14.1188 10.5423 14.5 9.28558 14.5 8C14.4982 6.27665 13.8128 4.62441 12.5942 3.40582C11.3756 2.18722 9.72335 1.50182 8 1.5ZM7.75 4.5C7.89834 4.5 8.04334 4.54399 8.16668 4.6264C8.29002 4.70881 8.38615 4.82594 8.44291 4.96299C8.49968 5.10003 8.51453 5.25083 8.48559 5.39632C8.45665 5.5418 8.38522 5.67544 8.28033 5.78033C8.17544 5.88522 8.04181 5.95665 7.89632 5.98559C7.75083 6.01453 7.60003 5.99968 7.46299 5.94291C7.32595 5.88614 7.20881 5.79001 7.1264 5.66668C7.04399 5.54334 7 5.39834 7 5.25C7 5.05109 7.07902 4.86032 7.21967 4.71967C7.36032 4.57902 7.55109 4.5 7.75 4.5ZM8.5 11.5C8.23479 11.5 7.98043 11.3946 7.7929 11.2071C7.60536 11.0196 7.5 10.7652 7.5 10.5V8C7.36739 8 7.24022 7.94732 7.14645 7.85355C7.05268 7.75979 7 7.63261 7 7.5C7 7.36739 7.05268 7.24021 7.14645 7.14645C7.24022 7.05268 7.36739 7 7.5 7C7.76522 7 8.01957 7.10536 8.20711 7.29289C8.39465 7.48043 8.5 7.73478 8.5 8V10.5C8.63261 10.5 8.75979 10.5527 8.85356 10.6464C8.94732 10.7402 9 10.8674 9 11C9 11.1326 8.94732 11.2598 8.85356 11.3536C8.75979 11.4473 8.63261 11.5 8.5 11.5Z",
fill: "white"
})
])
], -1))
], 32)
]),
i.isV5 ? (g(), S("label", bt, [
m(s("input", {
"onUpdate:modelValue": t[22] || (t[22] = (n) => i.maxSplits = n),
type: "number",
class: r(["settings__input", { active_input: l.activeMaxSplitsConditions }]),
inputmode: "decimal",
autocomplete: "off",
onInput: t[23] || (t[23] = (...n) => l.changeMaxSplitsInput && l.changeMaxSplitsInput(...n)),
onBlur: t[24] || (t[24] = (...n) => l.blurMaxSplitsInput && l.blurMaxSplitsInput(...n))
}, null, 34), [
[x, i.maxSplits]
])
])) : c("", !0),
s("div", Et, [
i.isV5 ? c("", !0) : (g(), S("div", vt, [
s("button", {
class: r(["settings__button", { active: Number(i.maxSplits) === 1 }]),
onClick: t[25] || (t[25] = (n) => l.changeMaxSplits(1))
}, " 1 ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.maxSplits) === 2 }]),
onClick: t[26] || (t[26] = (n) => l.changeMaxSplits(2))
}, " 2 ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.maxSplits) === 3 }]),
onClick: t[27] || (t[27] = (n) => l.changeMaxSplits(3))
}, " 3 ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.maxSplits) === 4 }]),
onClick: t[28] || (t[28] = (n) => l.changeMaxSplits(4))
}, " 4 ", 2)
])),
i.isV5 ? (g(), S("div", Ct, [
s("button", {
class: r(["settings__button", { active: Number(i.maxSplits) === 1 }]),
onClick: t[29] || (t[29] = (n) => l.changeMaxSplits(1))
}, " 1 ", 2),
s("button", {
class: r(["settings__button", { active: Number(i.maxSplits) === 5 }]),
onClick: t[30] || (t[30] = (n) => l.changeMaxSplits(5))
}, " 5 ", 2),
s("button", {
class: r(["settings__button yellow_status", { active: Number(i.maxSplits) === 10 }]),
onClick: t[31] || (t[31] = (n) => l.changeMaxSplits(10))
}, " 10 ", 2),
s("button", {
class: r(["settings__button yellow_status", { active: Number(i.maxSplits) === 20 }]),
onClick: t[32] || (t[32] = (n) => l.changeMaxSplits(20))
}, " 20 ", 2)
])) : c("", !0)
]),
!((h = l.liquiditySourcesList) != null && h.length) > 0 ? (g(), S("p", Mt, p(e.$t("dexSettings.sources.title")), 1)) : c("", !0),
!((T = l.liquiditySourcesList) != null && T.length) > 0 ? (g(), S("p", ft, p(e.$t("dexSettings.sources.text")), 1)) : c("", !0),
!((b = l.liquiditySourcesList) != null && b.length) > 0 ? (g(), S("div", yt, [
s("ul", Pt, [
(g(!0), S(F, null, Y(i.liquiditySources, (n) => {
var E, v;
return g(), S("li", {
key: n,
class: "settings__block-item block-item"
}, [
s("div", kt, [
s("img", {
src: (E = e.getDexSourceDataByName(n == null ? void 0 : n.name)) == null ? void 0 : E.imageUrl,
alt: n == null ? void 0 : n.name,
class: "block-item__img"
}, null, 8, Nt),
s("p", Vt, p((v = e.getDexSourceDataByName(n == null ? void 0 : n.name)) == null ? void 0 : v.name), 1)
]),
u(I, {
class: r({ active_switch: l.isActiveSource(n == null ? void 0 : n.name) }),
onClick: (wt) => l.changeLiquiditySources(n == null ? void 0 : n.name)
}, null, 8, ["class", "onClick"])
]);
}), 128))
])
])) : c("", !0)
], 512), [
[C, l.getExpertMode]
])
], 2)
];
}),
_: 1
}, 8, ["title"]);
}
const At = /* @__PURE__ */ U(Z, [["render", Lt], ["__scopeId", "data-v-89227daf"]]);
export {
At as default
};