PageSourceSearch

https://apexchange.org/_next/static/chunks/8326-bb02082b2aa84bfe.js

js apexchange.org collected 2026-10-04 14:20:37 UTC 14,053 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8326],{98326:function(e,t,s){s.d(t,{Calculator:function(){return _}});var n,a=s(57437),r=s(2265),o=s(27648),c=s(41041),l=s(22053),i=s(32037),d=s(35019),m=s(9006),x=s(94508);let u={crypto:"sheet.group.crypto",card:"sheet.group.card",sbp:"sheet.group.sbp",cash:"sheet.group.cash"},p=["crypto","card","sbp","cash"];function h(e){let{open:t,onClose:s,title:n,options:o,selectedId:c,onSelect:h}=e,f=(0,l.NT)(),[v,b]=(0,r.useState)(""),g=(0,r.useMemo)(()=>{let e=v.trim().toLowerCase(),t=e?o.filter(t=>{var s;return[t.name,t.short,t.code,null!==(s=t.network)&&void 0!==s?s:""].join(" ").toLowerCase().includes(e)}):o;return p.map(e=>({group:e,items:t.filter(t=>t.group===e)})).filter(e=>e.items.length>0)},[o,v]);return(0,a.jsxs)(i.y,{open:t,onClose:s,title:n,children:[(0,a.jsx)("div",{className:"sticky top-0 z-10 border-b bg-overlay px-5 pb-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md border bg-surface-2 px-3",children:[(0,a.jsx)(m.J,{name:"search",size:18,className:"text-text-muted"}),(0,a.jsx)("input",{autoFocus:!0,value:v,onChange:e=>b(e.target.value),placeholder:f("sheet.search"),"aria-label":f("sheet.search"),className:"h-11 w-full bg-transparent text-sm outline-none placeholder:text-text-muted"})]})}),(0,a.jsxs)("div",{className:"px-3 pb-4 pt-2",children:[0===g.length&&(0,a.jsx)("p",{className:"px-2 py-8 text-center text-sm text-text-muted",children:f("sheet.notFound")}),g.map(e=>(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsx)("p",{className:"px-2 py-2 text-xs font-medium uppercase tracking-wider text-text-muted",children:f(u[e.group])}),(0,a.jsx)("div",{className:"flex flex-col",children:e.items.map(e=>{let t=e.id===c;return(0,a.jsxs)("button",{onClick:()=>{h(e),s()},className:(0,x.cn)("flex min-h-[52px] items-center gap-3 rounded-md px-2 text-left transition-colors",t?"bg-[var(--accent-soft)]":"hover:bg-surface-2"),children:[(0,a.jsx)(d.C,{asset:e,size:"md"}),(0,a.jsxs)("span",{className:"flex-1",children:[(0,a.jsx)("span",{className:"block text-sm font-medium",children:e.name}),(0,a.jsx)("span",{className:"block text-xs text-text-muted",children:e.network?"".concat(e.short," \xb7 ").concat(e.network):e.short})]}),t&&(0,a.jsx)(m.J,{name:"check",size:18,className:"text-accent"})]},e.id)})})]},e.group))]})]})}var f=s(86419),v=s(30326),b=s(4974),g=s(21017),j=s(24425),N=s(6989),y=s(92575),w=s(25312),k=s(81175),C=s(46039),z=s(59530),E=s(82446),S=s(74238);let F=e=>{let t=Number(e.replace(/\s/g,"").replace(",","."));return Number.isFinite(t)?t:0},I=(e,t)=>0===e?"":String(Math.round(e*10**t)/10**t),T=g.qF.filter(e=>"ACTIVE"===e.status),M=null!==(n=T.find(e=>e.slug===z.U.anchorDirectionSlug))&&void 0!==n?n:T[0];function _(){var e,t,s,n,i,d,u,p;let{initialSlug:_,initialFromId:L,initialToId:q,initialAmount:A,layout:P="vertical"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},R=(0,l.NT)(),U=(0,l.bU)(),B="horizontal"===P,D=(0,j.rg)(),H=(0,r.useMemo)(()=>D.filter(e=>"ACTIVE"===e.status),[D]),K=(0,r.useMemo)(()=>g.Ll.filter(e=>H.some(t=>t.fromId===e.id)),[H]),V=e=>g.Ll.filter(t=>H.some(s=>s.fromId===e&&s.toId===t.id)),$=(e,t)=>H.find(s=>s.fromId===e&&s.toId===t),G=null!==(t=null!==(e=H.find(e=>e.slug===z.U.anchorDirectionSlug))&&void 0!==e?e:H[0])&&void 0!==t?t:M,O=(L&&q?T.find(e=>e.fromId===L&&e.toId===q):void 0)||_&&T.find(e=>e.slug===_)||M,W=A&&A>0?A:1e3,[Y,Q]=(0,r.useState)(O.fromId),[X,Z]=(0,r.useState)(O.toId),[ee,et]=(0,r.useState)("from"),[es,en]=(0,r.useState)(W),[ea,er]=(0,r.useState)(String(W)),[eo,ec]=(0,r.useState)(0),[el,ei]=(0,r.useState)(null),ed=(0,g.Hk)(Y),em=(0,g.Hk)(X),ex=null!==(s=$(Y,X))&&void 0!==s?s:G,eu=(0,k.PG)(ex.id,ex.rate),ep=(0,k.m9)(ex.id),eh=ex.networkFee,ef=(0,N.K)(ex,"from"===ee?{amountFrom:es}:{amountTo:es}),ev="from"===ee?es:ef.amountFrom,eb="to"===ee?es:ef.amountTo,eg=(0,N.K)(ex,{amountFrom:ev}),ej=ef.reserve,{minFrom:eN,maxFrom:ey}=ex.limits,ew=(0,y.Y)(ex,{amountFrom:ev}),ek=ev>0&&ev<eN,eC=ev>ey,ez=eb>ej,eE=ev>0&&!ek&&!eC&&!ez&&ew.ok,eS=ek?"".concat(R("calc.minError")," ").concat((0,C.dN)(eN,ed.precision)," ").concat(null!==(n=ed.symbol)&&void 0!==n?n:ed.short):eC?"".concat(R("calc.maxError")," ").concat((0,C.dN)(ey,ed.precision)," ").concat(null!==(i=ed.symbol)&&void 0!==i?i:ed.short):ez?R("calc.noReserve"):ew.ok?null:null!==(d=ew.reason)&&void 0!==d?d:R("calc.unavailable");function eF(e){if(ee===e)return;let t="from"===e?ev:eb;et(e),en(t),er(I(t,("from"===e?ed:em).precision))}let eI="from"===ee?ea:(0,C.dN)(ev,ed.precision),eT="to"===ee?ea:(0,C.dN)(eb,em.precision);return(0,a.jsxs)("div",{className:"panel relative overflow-hidden p-4 shadow-lg sm:p-5",children:[(0,a.jsx)("div",{className:"blueprint pointer-events-none absolute inset-0 opacity-60"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-text-muted",children:R("calc.title")}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-text-dim",children:[(0,a.jsx)(f.z,{tone:"accent"})," ",R("calc.live")]})]}),(0,a.jsxs)("div",{className:(0,x.cn)(B&&"md:flex md:items-center"),children:[(0,a.jsx)(J,{label:R("calc.give"),asset:ed,value:eI,active:"from"===ee,onF
1ocus:()=>eF("from"),onChange:function(e){et("from"),er(e),en(F(e))},onPick:()=>ei("from"),className:(0,x.cn)(B&&"md:min-w-0 md:flex-1")}),(0,a.jsx)("div",{className:(0,x.cn)("relative z-10 my-[-10px] flex justify-center",B&&"md:mx-[-10px] md:my-0"),children:(0,a.jsx)(c.E.button,{onClick:function(){var e,t;ec(e=>e+1),Q(X),Z($(X,Y)?Y:null!==(t=null===(e=V(X)[0])||void 0===e?void 0:e.id)&&void 0!==t?t:Y),et("from"),en(eb),er(I(eb,(0,g.Hk)(X).precision))},"aria-label":R("calc.swap"),animate:{rotate:180*eo},transition:{type:"spring",stiffness:380,damping:22},className:"grid h-10 w-10 place-items-center rounded-pill border border-strong bg-surface-2 text-accent shadow-md hover:border-accent",children:(0,a.jsx)(m.J,{name:"swap",size:18})})}),(0,a.jsx)(J,{label:R("calc.get"),asset:em,value:eT,active:"to"===ee,onFocus:()=>eF("to"),onChange:function(e){et("to"),er(e),en(F(e))},onPick:()=>ei("to"),className:(0,x.cn)(B&&"md:min-w-0 md:flex-1")})]}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-y-2 rounded-md border bg-surface-2/60 px-3 py-2 text-sm",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-dim",children:[(0,a.jsxs)("span",{className:"num text-text",children:["1 ",ed.short]}),(0,a.jsx)(m.J,{name:"arrow-right",size:14,className:"text-text-faint"}),(0,a.jsx)(b.z,{value:eu,format:e=>{var t;return"".concat((0,C.og)(e)," ").concat(null!==(t=em.symbol)&&void 0!==t?t:em.short)},className:"text-text"}),(0,a.jsx)(v.O,{dir:null!==(u=null==ep?void 0:ep.dir)&&void 0!==u?u:"flat"})]}),(0,a.jsxs)("span",{className:"num text-xs text-text-muted",children:[R("calc.limit")," ",(0,C.dN)(eN,ed.precision),"–",(0,C.dN)(ey,ed.precision)," ",ed.short]})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between px-1 text-xs",children:[(0,a.jsxs)("span",{className:"text-text-muted",children:[R("calc.reserve"),":"," ",(0,a.jsxs)("span",{className:"num text-text-dim",children:[(0,C.dN)(ej,em.precision)," ",null!==(p=em.symbol)&&void 0!==p?p:em.short]})]}),eh>0&&(0,a.jsxs)("span",{className:"text-text-muted",children:[R("calc.network"),":"," ",(0,a.jsxs)("span",{className:"num text-text-dim",children:[(0,C.dN)(eh,em.precision)," ",em.short]})]})]}),ev>0&&(0,a.jsx)("div",{className:"calc-aux mt-3",children:(0,a.jsx)(w.$,{lq:eg,from:ed,to:em})}),(0,a.jsxs)("div",{className:"mt-4",children:[eS&&(0,a.jsx)("p",{className:"mb-2 text-center text-xs text-neg",role:"alert",children:eS}),eE?(0,a.jsxs)(o.default,{href:"/order/new?slug=".concat(ex.slug,"&amount=").concat(Math.round(ev*10**ed.precision)/10**ed.precision),className:"flex h-[52px] w-full items-center justify-center gap-2 rounded-md bg-accent text-base font-semibold text-[color:var(--accent-ink)] shadow-[0_8px_24px_-10px_var(--accent-glow)] transition-all hover:bg-accent-bright active:scale-[0.99]",children:[R("cta.exchange"),(0,a.jsx)(m.J,{name:"arrow-right",size:18})]}):"login"===ew.requirement?(0,a.jsxs)(o.default,{href:"/login",className:"flex h-[52px] w-full items-center justify-center gap-2 rounded-md border border-accent text-base font-semibold text-accent transition-colors hover:bg-[var(--accent-soft)]",children:[R("calc.loginToExchange")," ",(0,a.jsx)(m.J,{name:"arrow-right",size:18})]}):"kyc"===ew.requirement?(0,a.jsxs)(o.default,{href:"/account/kyc",className:"flex h-[52px] w-full items-center justify-center gap-2 rounded-md border border-accent text-base font-semibold text-accent transition-colors hover:bg-[var(--accent-soft)]",children:[R("calc.passKyc")," ",(0,a.jsx)(m.J,{name:"arrow-right",size:18})]}):(0,a.jsx)("div",{className:"flex h-[52px] w-full cursor-not-allowed items-center justify-center rounded-md border bg-surface-2 text-base font-semibold text-text-muted",children:R("cta.exchange")}),eE&&(0,a.jsxs)("a",{href:"https://t.me/".concat(z.U.contacts.telegramBot.replace("@",""),"?start=ex_").concat(ex.slug,"_").concat(Math.round(ev*10**ed.precision)/10**ed.precision),target:"_blank",rel:"noreferrer",className:"calc-aux mt-2 flex items-center justify-center gap-1.5 text-xs text-text-muted transition-colors hover:text-accent",children:[(0,a.jsx)(m.J,{name:"telegram",size:14}),"ru"===U?"Продолжить в Telegram-боте":"Continue in the Telegram bot"]}),eE&&(0,a.jsxs)("button",{type:"button",onClick:()=>{var e;let t=Math.round(ev*10**ed.precision)/10**ed.precision,s=(0,E.w)("/").replace(/\/$/,""),n="".concat(window.location.origin).concat(s,"?from=").concat(Y,"&to=").concat(X,"&amount=").concat(t);
1null===(e=navigator.clipboard)||void 0===e||e.writeText(n).then(()=>(0,S.Am)("success","ru"===U?"Ссылка на расчёт скопирована":"Calculation link copied")).catch(()=>(0,S.Am)("info",n))},className:"calc-aux mt-2 flex w-full items-center justify-center gap-1.5 text-xs text-text-muted transition-colors hover:text-accent",children:[(0,a.jsx)(m.J,{name:"copy",size:14}),"ru"===U?"Поделиться расчётом":"Share this calculation"]})]})]}),(0,a.jsx)(h,{open:"from"===el,onClose:()=>ei(null),title:R("calc.give"),options:K,selectedId:Y,onSelect:function(e){if(Q(e.id),!$(e.id,X)){let t=V(e.id)[0];t&&Z(t.id)}et("from")}}),(0,a.jsx)(h,{open:"to"===el,onClose:()=>ei(null),title:R("calc.get"),options:V(Y),selectedId:X,onSelect:function(e){Z(e.id),et("from")}})]})}function J(e){let{label:t,asset:s,value:n,active:r,onFocus:o,onChange:c,onPick:l,className:i}=e;return s?(0,a.jsxs)("div",{className:(0,x.cn)("rounded-md border bg-surface-2 px-3 py-2.5 transition-colors",r?"border-accent":"border-[color:var(--line)]",i),children:[(0,a.jsx)("div",{className:"mb-1 text-xs text-text-muted",children:t}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("input",{inputMode:"decimal",value:n,onFocus:o,onChange:e=>c(e.target.value),placeholder:"0","aria-label":"".concat(t," — сумма"),className:"num min-w-0 flex-1 bg-transparent text-2xl font-semibold tabular-nums outline-none placeholder:text-text-faint"}),(0,a.jsxs)("button",{onClick:l,className:"flex shrink-0 items-center gap-2 rounded-md border bg-surface-3 py-1.5 pl-1.5 pr-2.5 transition-colors hover:border-accent",children:[(0,a.jsx)(d.C,{asset:s,size:"sm"}),(0,a.jsx)("span",{className:"text-sm font-medium",children:s.short}),(0,a.jsx)(m.J,{name:"chevron",size:14,className:"rotate-90 text-text-muted"})]})]})]}):null}},32037:function(e,t,s){s.d(t,{y:function(){return i}});var n=s(57437),a=s(48614),r=s(41041),o=s(2265),c=s(54887),l=s(81175);function i(e){let{open:t,onClose:s,title:i,children:d,wide:m}=e,x=(0,l.s4)(),u=(0,l.ac)("(min-width: 768px)");return((0,o.useEffect)(()=>{if(!t)return;let e=e=>"Escape"===e.key&&s();document.addEventListener("keydown",e);let n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=n}},[t,s]),x)?(0,c.createPortal)((0,n.jsx)(a.M,{children:t&&(0,n.jsxs)("div",{className:"fixed inset-0 z-[90] flex items-end justify-center md:items-center",children:[(0,n.jsx)(r.E.div,{className:"absolute inset-0",style:{background:"var(--bg-scrim)",backdropFilter:"blur(6px)"},initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:s}),(0,n.jsxs)(r.E.div,{role:"dialog","aria-modal":"true","aria-label":i,className:"relative flex max-h-[88vh] w-full flex-col overflow-hidden border border-strong bg-overlay shadow-sheet md:rounded-xl ".concat(m?"md:max-w-2xl":"md:max-w-md"),style:{borderTopLeftRadius:"var(--r-xl)",borderTopRightRadius:"var(--r-xl)",paddingBottom:u?0:"var(--safe-bottom)"},initial:u?{opacity:0,scale:.96}:{y:"100%"},animate:u?{opacity:1,scale:1}:{y:0},exit:u?{opacity:0,scale:.96}:{y:"100%"},transition:{type:"spring",damping:30,stiffness:320},drag:!u&&"y",dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:.6},onDragEnd:(e,t)=>{(t.offset.y>120||t.velocity.y>700)&&s()},children:[(0,n.jsx)("div",{className:"flex shrink-0 items-center justify-center pt-3 md:hidden",children:(0,n.jsx)("span",{className:"h-1 w-10 rounded-pill bg-[var(--line-strong)]"})}),i&&(0,n.jsxs)("div",{className:"flex shrink-0 items-center justify-between px-5 pb-3 pt-4",children:[(0,n.jsx)("h3",{className:"text-base font-semibold text-text",children:i}),(0,n.jsx)("button",{onClick:s,"aria-label":"Закрыть",className:"grid h-9 w-9 place-items-center rounded-md text-text-muted hover:bg-surface-2 hover:text-text",children:(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:(0,n.jsx)("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})})]}),(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto no-scrollbar",children:d})]})]})}),document.body):null}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.