const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/aurora-background-Bmt5zK_6.js","assets/vendor-react-AgJGJ0jt.js","assets/useAnimationLoop-Cge4NX5g.js","assets/vendor-query-dla6Kdnt.js","assets/vendor-utils-C7cmyrLN.js","assets/vendor-telegram-C5PD3ObK.js","assets/vendor-twemoji-B4az2Xeq.js","assets/vendor-i18n-BWSetEAU.js","assets/vendor-motion-BREfXbUG.js","assets/vendor-radix-cON_i81f.js","assets/vendor-cmdk-C-NfIlBF.js","assets/sparkles-BB4yBOB0.js","assets/vortex-BRV30I9d.js","assets/simplex-noise-CDaaleer.js","assets/shooting-stars-BgxzuuU6.js","assets/background-beams-78V_nRkh.js","assets/background-beams-collision-eT8yvIJN.js","assets/background-gradient-animation-NYBiaKyi.js","assets/wavy-background-C3IQPUX9.js","assets/background-lines-CebaKYSj.js","assets/background-boxes-CSZ10lO6.js","assets/meteors-8S_FHLEs.js","assets/grid-background-JW_DNfGs.js","assets/spotlight-bg-cqMzhhtr.js","assets/background-ripple-_zHj-ZVo.js","assets/fireflies-C30dOUiQ.js","assets/snowfall-D-I5q1Tc.js","assets/starfield-DrSS7KDi.js","assets/matrix-rain-BldCrq-y.js","assets/liquid-gradient-B7I1tzDG.js","assets/constellation-oAD2uwgJ.js","assets/Subscriptions-B1l_KFAe.js","assets/Subscription-aPqJNW-H.js","assets/devices-XzzlYnkF.js","assets/InsufficientBalancePrompt-BEz5PGVm.js","assets/connectionLink-CWEUW8S5.js","assets/vendor-crypto-C22YYRe_.js","assets/openPaymentUrl-DX-GkMmz.js","assets/PageSkeleton-2bKP2jLR.js","assets/SubscriptionPurchase-InU64qR_.js","assets/pricing-Dv8mrOly.js","assets/Balance-BStRmkzG.js","assets/Card-C3cGTP4o.js","assets/paymentStatus-B5eSUKuL.js","assets/SavedCards-DxWZ4zFO.js","assets/Referral-C-4IyI08.js","assets/partners-431ECbuV.js","assets/withdrawals-BvDde8VY.js","assets/PeriodComparison-CXWq-ehq.js","assets/useChartColors-B_GMXonS.js","assets/vendor-recharts-DmFT4vxU.js","assets/charts-Nc8BvLed.js","assets/Support-Bf1hEX6y.js","assets/linkify-DmdjRDf9.js","assets/logger-BhDZ_aQg.js","assets/rateLimit-DJbwOcZP.js","assets/Profile-DX-vdRV5.js","assets/Contests-6iLPin6O.js","assets/Polls-DJC3LFvx.js","assets/Info-DiJY_50y.js","assets/infoPages-trKn7rIZ.js","assets/Wheel-CeGJh_zD.js","assets/FortuneWheel-DTpqkjyw.js","assets/useNotify-DaZlncFQ.js","assets/GiftSubscription-BSQ7Nfji.js","assets/qrScanner-k3qwZE5c.js","assets/GiftResult-Hy15tSBy.js","assets/Spinner-Dq6bqBxq.js","assets/AnimatedCheckmark-BtzbIVNs.js","assets/AnimatedCrossmark-pC31OPJT.js","assets/Connection-CYEQhywl.js","assets/ConnectionQR-CUDBEGbq.js","assets/AdminBackButton-CntYEpAG.js","assets/QuickPurchase-DtGvtzIH.js","assets/landings-DQ7B1Q_L.js","assets/PurchaseSuccess-DV-KwyyG.js","assets/GiftClaim-DA-GtGae.js","assets/RenewSubscription-BBcpQhaL.js","assets/AutoLogin-DcsuLUvC.js","assets/TopUpMethodSelect-C3my6L4m.js","assets/PaymentMethodIcon-CErtdnEV.js","assets/TopUpAmount-DoWe6LbJ.js","assets/topUpStorage-B4dMJ8Pj.js","assets/TopUpResult-efQIFAqP.js","assets/ConnectedAccounts-BqTEGz1k.js","assets/ProviderIcon-BGrU6hhx.js","assets/LinkTelegramCallback-D9vGXEmz.js","assets/MergeAccounts-ARcuEgY4.js","assets/AdminPanel-6H3ptBtW.js","assets/admin-CaxM9Rod.js","assets/AdminTickets-CQdWW5mq.js","assets/AdminTicketSettings-C1q0hTYp.js","assets/inputHelpers-DlK6C_dX.js","assets/AdminSettings-CxU_N7IW.js","assets/adminSettings-BNJLuA18.js","assets/Toggle-C2t6OxTL.js","assets/BackgroundConfigEditor-T5cxnclP.js","assets/ColorPicker-DfHALa4e.js","assets/vendor-dnd-DUB25O5Y.js","assets/AdminGraceAccess-CYOZ78-s.js","assets/AdminApps-CY-C4bAN.js","assets/AdminWheel-CMVBL2bC.js","assets/adminPaymentMethods-CWLBoThK.js","assets/BreakdownList-DkBnm3A_.js","assets/AdminTariffs-B4fh9sGP.js","assets/tariffs-BO1gH-Mg.js","assets/AdminTariffCreate-Cim-JBRd.js","assets/AdminServers-AMbGoF_k.js","assets/servers-w6KIRFEw.js","assets/AdminServerEdit-DBIBHHIo.js","assets/AdminDashboard-CxRnfpxJ.js","assets/AdminBanSystem-C6PSKSn8.js","assets/AdminBroadcasts-wZS-S4mp.js","assets/adminBroadcasts-logjEzOZ.js","assets/AdminBroadcastCreate-B9Gi_xjA.js","assets/AdminPromocodes-DZgTSG5l.js","assets/promocodes-BSeO5LxS.js","assets/AdminPromocodeCreate-JFc7fPCQ.js","assets/DateField-ejPl-_dn.js","assets/DateField-xiMy4gMA.css","assets/AdminCoupons-PuFTP5SK.js","assets/coupons-Bnwk1aaD.js","assets/AdminCouponCreate-BT6Okqos.js","assets/AdminCouponDetail-Cttj8PRI.js","assets/PermissionGate-BUaDcaaW.js","assets/CouponStatus-CY673iUN.js","assets/AdminPromocodeStats-B0_P520_.js","assets/AdminPromoGroups-CAF0Tm9D.js","assets/AdminPromoGroupCreate-CYF-RrPA.js","assets/AdminCampaigns-B8g5qPrC.js","assets/campaigns-DxvSRR8T.js","assets/AdminCampaignCreate-Bqw2aSt7.js","assets/AdminCampaignStats-BRBLdp_d.js","assets/AdminCampaignEdit-D2evrRdE.js","assets/AdminPartners-CZa5VChT.js","assets/AdminPartnerSettings-rRnTrlko.js","assets/AdminReferralLevels-2RVl_8hv.js","assets/AdminPartnerDetail-Dy6ZOP_d.js","assets/AdminApplicationReview-CMhuK7A1.js","assets/AdminPartnerCommission-CdjV0V1t.js","assets/AdminPartnerRevoke-B1dIejpy.js","assets/AdminPartnerCampaignAssign-oFxD6MiS.js","assets/AdminWithdrawals-D9y-VdcI.js","assets/withdrawalUtils-BtTOIUxV.js","assets/AdminWithdrawalDetail-BSiwY8j6.js","assets/AdminWithdrawalReject-B0IikEMP.js","assets/ReferralPartnerApply-DX7BNN7p.js","assets/ReferralWithdrawalRequest-DGBBCAIh.js","assets/AdminUsers-1dfznmxJ.js","assets/adminUsers-B95qP_s-.js","assets/AdminPayments-FYWyAT1A.js","assets/AdminPaymentMethods-D_9MW5DJ.js","assets/AdminPaymentMethodEdit-D9_Yrr51.js","assets/paymentMethods-DgfqNZez.js","assets/AdminPromoOffers-CINSPGUD.js","assets/promoOffers-BrtRa0bV.js","assets/AdminPromoOfferTemplateEdit-BdCUSRPM.js","assets/AdminPromoOfferSend-a25kRI3p.js","assets/BroadcastDeliveryStats-DAkIavb1.js","assets/AdminRemnawave-DZeroctB.js","assets/adminRemnawave-CAojmuGe.js","assets/AdminRemnawaveSquadDetail-D891Iz0R.js","assets/AdminEmailTemplates-BOhmhDJA.js","assets/AdminTrafficUsage-a8xpMIZR.js","assets/vendor-table-C319f1La.js","assets/AdminBulkActions-wp7yrELH.js","assets/AdminSalesStats-CKa5khfi.js","assets/DonutChart-EXNqdkPj.js","assets/AdminUpdates-Dxq6ekSR.js","assets/AdminUserDetail-BbFBTt5D.js","assets/AdminBroadcastDetail-mlZSf4YV.js","assets/AdminPinnedMessages-u6fjCHEF.js","assets/adminPinnedMessages-DWvKd_iX.js","assets/AdminPinnedMessageCreate-B61OnBEZ.js","assets/AdminChannelSubscriptions-BQLt4V-H.js","assets/AdminRoles-DaH1UKTy.js","assets/rbac-CK3XSak3.js","assets/AdminRoleEdit-BBEHj3Eh.js","assets/AdminRoleAssign-D6J8a4l9.js","assets/AdminPolicies-ZjlRi8eL.js","assets/AdminPolicyEdit-g1jqofRN.js","assets/AdminAuditLog-CkUt79EK.js","assets/AdminLandings-C48b92Pj.js","assets/LandingIcons-C2sk6HHy.js","assets/AdminLandingEditor-M2U6kFEa.js","assets/AdminLandingStats-CDR2cQxK.js","assets/index-DCq6pg9O.js","assets/NewsArticle-4exmZcT2.js","assets/AdminNews-C5Rzp2w4.js","assets/ListRowSkeleton-TeN78TcC.js","assets/AdminNewsCreate-DOmhePhA.js","assets/vendor-tiptap-CRPx8iU6.js","assets/tiptap-video-CplLer9O.js","assets/InfoPageView-tCS55nYB.js","assets/AdminInfoPages-y59Ssr3l.js","assets/AdminInfoPageEditor-Bo8VhLYS.js","assets/AdminLegalPages-DGBXWkXl.js"])))=>i.map(i=>d[i]); import{r as l,j as t,R as se,n as He,p as ye,d as gt,L as de,N as $e,q as xt,t as Yi,v as _,w as Xi,B as Ji,x as eo,y as to}from"./vendor-react-AgJGJ0jt.js";import{u as W,a as Ye,b as st,c as ao,Q as no,d as so}from"./vendor-query-dla6Kdnt.js";import{a as bt,b as Ue,p as ro,d as io,t as oo,c as co,u as ha,e as lo,i as La,f as uo,A as un}from"./vendor-utils-C7cmyrLN.js";import{B as mo,S as Dt,h as Vs,i as po,s as dt,G as Hs,z as ho,H as Bs,E as Os,a as fo,K as Zs,W as go,b as xo,Y as Fs,$ as bo,c as yo,U as vo,v as $s,y as Us,d as Ks,C as wo,e as qs,M as ko,r as jo,f as _o,Z as No,g as Co,T as Ao,k as Eo,j as Ia,O as To,l as So,m as Lo,n as zs,R as Ws,F as za,x as Io,o as Wa,p as Ro,q as Po,t as Mo,u as Do,w as Vo,A as Ho,D as Bo,L as Oo,I as Zo,N as Fo,J as $o}from"./vendor-telegram-C5PD3ObK.js";import{T as Uo}from"./vendor-twemoji-B4az2Xeq.js";import{i as Le,u as U,B as Ko,a as qo}from"./vendor-i18n-BWSetEAU.js";import{m as ge,A as Gs,u as zo}from"./vendor-motion-BREfXbUG.js";import{S as Wo,b as Qs,a as Ys,c as Xs,e as Js,f as er,g as tr,h as Go,i as Qo,j as Yo,C as Xo,I as Jo,k as ec,l as ar,R as tc,L as ac,m as nc,n as sc,o as rc,p as ic,A as oc,q as cc,r as lc,s as dc,t as uc,v as mc,w as pc,x as hc,y as fc,z as gc,B as xc,E as bc,F as yc,G as vc,H as wc,J as kc,K as jc}from"./vendor-radix-cON_i81f.js";import{_ as Xe}from"./vendor-cmdk-C-NfIlBF.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function mn(){if(typeof window>"u")return null;const e=[_c(),Nc()].filter(a=>!!a);return e.length===0?null:e.reduce((a,n)=>$n(n)>$n(a)?n:a)}function _c(){return window.Telegram?.WebApp?.initData||null}function Nc(){try{return mo()||null}catch{return null}}function $n(e){try{const a=new URLSearchParams(e).get("auth_date"),n=Number(a);return a&&Number.isFinite(n)?n:0}catch{return 0}}const nr="cabinet_fullscreen_enabled",Cc=()=>{try{return localStorage.getItem(nr)==="true"}catch{return!1}},Ac=e=>{try{localStorage.setItem(nr,String(e))}catch{}};let Wt=null;function fa(){if(Wt===null)try{Dt(),Wt=!0}catch{Wt=!1}return Wt}function Ee(){return fa()}function Ec(){try{const e=window.Telegram?.WebApp;if(e?.close){e.close();return}}catch{}try{Vs();return}catch{}try{po("web_app_close")}catch{}}function Tc(){try{const{tgWebAppPlatform:e}=Dt();return e==="ios"||e==="android"}catch{return!1}}function sr(){return mn()}function Sc(e){const a=e.replace("#",""),n=a.length===3?a.replace(/(.)/g,"$1$1"):a;if(n.length!==6)return!1;const s=parseInt(n.slice(0,2),16),r=parseInt(n.slice(2,4),16),o=parseInt(n.slice(4,6),16);return(.299*s+.587*r+.114*o)/255<.5}function Lc(){if(!fa())return null;try{const e=Zs()?.bgColor;return e?Sc(e)?"dark":"light":null}catch{return null}}function Ic(){if(!fa())return null;try{const a=Dt().tgWebAppData?.user?.languageCode;return a?a.split("-")[0].toLowerCase():null}catch{return null}}const Un={top:0,bottom:0,left:0,right:0};function Vt(){const e=fa(),a=l.useMemo(()=>{try{return Dt().tgWebAppPlatform}catch{return}},[]),n=a==="ios"||a==="android",s=dt(Fs),r=dt(vo),o=dt(yo),d=dt(bo),p=dt(go),i=dt(xo),c=e?s??!1:!1,u=e?r??0:0,m=e?o??0:0,h=e?d??!0:!0,f=l.useMemo(()=>!e||!p?Un:{top:p.top||0,bottom:p.bottom||0,left:p.left||0,right:p.right||0},[e,p]),g=l.useMemo(()=>!e||!i?Un:{top:i.top||0,bottom:i.bottom||0,left:i.left||0,right:i.right||0},[e,i]),y=l.useCallback(()=>{if(e)try{Hs()}catch{}},[e]),w=l.useCallback(()=>{if(e)try{ho()}catch{}},[e]),A=l.useCallback(()=>{c?w():y()},[c,y,w]),T=l.useCallback(()=>{if(e)try{Bs()}catch{}},[e]),N=l.useCallback(()=>{if(e)try{Os()}catch{}},[e]),v=l.useCallback(()=>{if(e)try{fo()}catch{}},[e]);return{isTelegramWebApp:e,isFullscreen:c,isFullscreenSupported:e,safeAreaInset:f,contentSafeAreaInset:g,viewportHeight:u,viewportStableHeight:m,viewportWidth:0,isExpanded:h,platform:a,isMobile:n,requestFullscreen:y,exitFullscreen:w,toggleFullscreen:A,expand:T,disableVerticalSwipes:N,enableVerticalSwipes:v,viewport:null,miniApp:null}}const rr={THEME:"cabinet-theme",ENABLED_THEMES:"cabinet-enabled-themes",FAVORITE_SETTINGS:"admin_favorite_settings"},Ra={MAX_RECONNECT_ATTEMPTS:5,PING_INTERVAL_MS:25e3,MAX_RECONNECT_DELAY_MS:3e4},kt={RESEND_COOLDOWN_SEC:60,TELEGRAM_HEADER_ANDROID_PX:48,TELEGRAM_HEADER_IOS_PX:45,MOBILE_HEADER_HEIGHT_PX:64,DESKTOP_HEADER_HEIGHT_PX:56},at={TIMEOUT_MS:3e4,BALANCE_STALE_TIME_MS:3e4,TRAFFIC_CACHE_MS:3e4,TRAFFIC_WARN_PERCENT:70,TRAFFIC_CRITICAL_PERCENT:90},Tt={PROBE_TIMEOUT_MS:12e3,CONFIRM_RETRIES:1,CONFIRM_RETRY_DELAY_MS:1500,RECOVERY_POLL_INTERVAL_MS:5e3},me=bt(e=>({blockingType:null,maintenanceInfo:null,channelInfo:null,blacklistedInfo:null,accountDeletedInfo:null,setMaintenance:a=>e({blockingType:"maintenance",maintenanceInfo:a,channelInfo:null,blacklistedInfo:null,accountDeletedInfo:null}),setChannelSubscription:a=>e({blockingType:"channel_subscription",channelInfo:a,maintenanceInfo:null,blacklistedInfo:null,accountDeletedInfo:null}),setBlacklisted:a=>e({blockingType:"blacklisted",blacklistedInfo:a,maintenanceInfo:null,channelInfo:null,accountDeletedInfo:null}),setAccountDeleted:a=>e({blockingType:"account_deleted",accountDeletedInfo:a,maintenanceInfo:null,channelInfo:null,blacklistedInfo:null}),setBackendUnavailable:()=>e({blockingType:"backend_unavailable",maintenanceInfo:null,channelInfo:null,blacklistedInfo:null,accountDeletedInfo:null}),clearBlocking:()=>e({blockingType:null,maintenanceInfo:null,channelInfo:null,blacklistedInfo:null,accountDeletedInfo:null})}));function Rc(){const e="/api".trim();if(e.startsWith("http://")||e.startsWith("https://"))try{return`${new URL(e).origin}/health/unified`}catch{}return"/health/unified"}const Pc=Rc(),Mc=new Set([502,503,504]);async function Ga(e=Tt.PROBE_TIMEOUT_MS){try{return await Ue.get(Pc,{timeout:e}),!0}catch(a){return Ue.isAxiosError(a)&&a.response?!Mc.has(a.response.status):!1}}async function ir(){for(let e=0;e<=Tt.CONFIRM_RETRIES;e++){if(await Ga())return!1;esetTimeout(a,Tt.CONFIRM_RETRY_DELAY_MS))}return!0}let It=!1;function Dc(){It=!0}function Vc(){return It}let Pa=!1;async function or(){if(me.getState().blockingType!=="backend_unavailable"){if(!It){me.getState().setBackendUnavailable();return}if(!Pa){Pa=!0;try{await ir()&&me.getState().blockingType!=="backend_unavailable"&&me.getState().setBackendUnavailable()}finally{Pa=!1}}}}async function Hc(){It||me.getState().blockingType===null&&await ir()&&!It&&me.getState().blockingType===null&&me.getState().setBackendUnavailable()}const Bc={local:new Map,session:new Map};function Ma(e){try{return(e==="local"?globalThis.localStorage:globalThis.sessionStorage)??null}catch{return null}}function cr(e){const a=Bc[e];function n(p){const i=a.get(p);if(i!==void 0)return i;const c=Ma(e);if(!c)return null;try{return c.getItem(p)}catch{return null}}function s(p,i){const c=Ma(e);if(c)try{return c.setItem(p,i),a.delete(p),!0}catch{}return a.set(p,i),!1}function r(p){a.delete(p);const i=Ma(e);if(i)try{i.removeItem(p)}catch{}}function o(p,i){const c=n(p);if(c===null)return i;try{return JSON.parse(c)}catch{return i}}function d(p,i){try{return s(p,JSON.stringify(i))}catch{return!1}}return{getItem:n,setItem:s,removeItem:r,getJson:o,setJson:d}}const fe=cr("local"),ee=cr("session"),te={ACCESS:"access_token",REFRESH:"refresh_token",USER:"user",TELEGRAM_INIT:"telegram_init_data"},pn=te.REFRESH;function Oc(e){if(Ee())try{Us(pn,e).catch(()=>{})}catch{}}function Zc(){if(Ee())try{Ks(pn).catch(()=>{})}catch{}}async function Fc(){if(!Ee())return null;try{const a=await $s(pn)||null;if(a)try{localStorage.setItem(te.REFRESH,a)}catch{}return a}catch{return null}}function $c(e){try{const a=e.split(".");if(a.length!==3)return null;const n=a[1],s=atob(n.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(s)}catch{return null}}function lr(e,a=30){if(!e)return!0;const n=$c(e);if(!n?.exp)return!0;const s=Math.floor(Date.now()/1e3);return n.exp<=s+a}function Kn(e){return e?!lr(e):!1}const oe={getAccessToken(){try{return sessionStorage.getItem(te.ACCESS)}catch{return null}},getRefreshToken(){try{return localStorage.getItem(te.REFRESH)||sessionStorage.getItem(te.REFRESH)}catch{return null}},setTokens(e,a){try{sessionStorage.setItem(te.ACCESS,e),localStorage.setItem(te.REFRESH,a),sessionStorage.removeItem(te.REFRESH),Oc(a)}catch{}},setAccessToken(e){try{sessionStorage.setItem(te.ACCESS,e)}catch{console.error("Failed to save access token to sessionStorage")}},clearTokens(){try{sessionStorage.removeItem(te.ACCESS),sessionStorage.removeItem(te.REFRESH),sessionStorage.removeItem(te.USER),localStorage.removeItem(te.ACCESS),localStorage.removeItem(te.REFRESH),localStorage.removeItem(te.USER),Zc()}catch{}},migrateFromLocalStorage(){try{const e=localStorage.getItem(te.ACCESS);e&&!sessionStorage.getItem(te.ACCESS)&&sessionStorage.setItem(te.ACCESS,e),localStorage.removeItem(te.ACCESS);const a=sessionStorage.getItem(te.REFRESH);a&&!localStorage.getItem(te.REFRESH)&&localStorage.setItem(te.REFRESH,a),sessionStorage.removeItem(te.REFRESH)}catch{}},getTelegramInitData(){try{return sessionStorage.getItem(te.TELEGRAM_INIT)}catch{return null}},setTelegramInitData(e){try{sessionStorage.setItem(te.TELEGRAM_INIT,e)}catch{}}};function Uc(e){try{const n=new URLSearchParams(e).get("user");if(!n)return null;const s=JSON.parse(n);return s.id!=null?String(s.id):null}catch{return null}}const qn="tg_user_id";function zn(e){if(e)try{const a=Uc(e),n=localStorage.getItem(qn);n&&a&&n!==a&&(sessionStorage.removeItem(te.ACCESS),sessionStorage.removeItem(te.REFRESH),sessionStorage.removeItem(te.USER),localStorage.removeItem(te.REFRESH),fe.removeItem("cabinet-auth")),a&&localStorage.setItem(qn,a),sessionStorage.setItem(te.TELEGRAM_INIT,e),localStorage.removeItem(te.TELEGRAM_INIT)}catch{}}class Kc{isRefreshing=!1;refreshPromise=null;subscribers=[];refreshEndpoint="/api/cabinet/auth/refresh";lastFailureWasTransport=!1;setRefreshEndpoint(a){this.refreshEndpoint=a}async refreshAccessToken(){if(this.isRefreshing&&this.refreshPromise)return this.refreshPromise;this.lastFailureWasTransport=!1;const a=oe.getRefreshToken();if(!a)return null;this.isRefreshing=!0,this.refreshPromise=this.doRefresh(a);try{const n=await this.refreshPromise;return this.notifySubscribers(n),n}finally{this.isRefreshing=!1,this.refreshPromise=null}}async doRefresh(a){try{const s=(await Ue.post(this.refreshEndpoint,{refresh_token:a},{headers:{"Content-Type":"application/json"},timeout:at.TIMEOUT_MS})).data.access_token;return s?(oe.setAccessToken(s),s):null}catch(n){return Ue.isAxiosError(n)&&!n.response&&(this.lastFailureWasTransport=!0,or()),null}}subscribe(a){return this.subscribers.push(a),()=>{this.subscribers=this.subscribers.filter(n=>n!==a)}}notifySubscribers(a){this.subscribers.forEach(n=>n(a)),this.subscribers=[]}get isRefreshInProgress(){return this.isRefreshing}async waitForRefresh(){return this.refreshPromise?this.refreshPromise:oe.getAccessToken()}}const Ve=new Kc,Qa="auth_return_url";function ga(){if(typeof window<"u"){const e=window.location.pathname+window.location.search;e&&e!=="/login"&&ee.setItem(Qa,e)}}function qc(){if(typeof window<"u"){const e=ee.getItem(Qa);return ee.removeItem(Qa),e}return null}function dr(){if(typeof window<"u"){if(window.location.pathname==="/login")return;ga(),window.location.href="/login"}}const zc=/[\uD800-\uDFFF]/;function Wn(e){if(!zc.test(e))return e;let a="";for(let n=0;n=55296&&s<=56319){const r=e.charCodeAt(n+1);r>=56320&&r<=57343?(a+=e[n]+e[n+1],n++):a+="�"}else s>=56320&&s<=57343?a+="�":a+=e[n]}return a}function Wc(){const e="__surrogateEncoderGuardInstalled",a=globalThis;if(a[e])return;a[e]=!0;const n=globalThis.encodeURI,s=globalThis.encodeURIComponent,r=globalThis.decodeURI,o=globalThis.decodeURIComponent;globalThis.encodeURI=d=>n(Wn(String(d))),globalThis.encodeURIComponent=d=>s(Wn(String(d))),globalThis.decodeURI=d=>{const p=String(d);try{return r(p)}catch{return Qn(p)}},globalThis.decodeURIComponent=d=>{const p=String(d);try{return o(p)}catch{return Qn(p)}}}const Gn=/^[0-9a-fA-F]{2}$/;function Qn(e){const a=[],n=new TextEncoder;let s=0;for(;s"u")return null;const e=document.cookie.match(new RegExp(`(^| )${mr}=([^;]+)`));return e?e[2]:null}function Yc(){const e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,a=>a.toString(16).padStart(2,"0")).join("")}function Xc(){let e=Qc();return e||(e=Yc(),document.cookie=`${mr}=${e}; path=/; SameSite=Strict; Secure`),e}const Jc=()=>{if(typeof window>"u")return null;const e=mn();return e?(oe.setTelegramInitData(e),e):oe.getTelegramInitData()},b=Ue.create({baseURL:ur,timeout:at.TIMEOUT_MS,headers:{"Content-Type":"application/json"}}),el=["/cabinet/auth/telegram","/cabinet/auth/telegram/widget","/cabinet/auth/email/login","/cabinet/auth/email/register/standalone","/cabinet/auth/email/verify","/cabinet/auth/refresh","/cabinet/auth/password/forgot","/cabinet/auth/password/reset","/cabinet/auth/oauth/","/cabinet/auth/account/link/server-complete","/cabinet/auth/deeplink/","/cabinet/auth/login/auto","/cabinet/landing/"];function pr(e){return e?el.some(a=>e.startsWith(a)):!1}b.interceptors.request.use(async e=>{if(e.data instanceof FormData&&e.headers&&delete e.headers["Content-Type"],!pr(e.url)){let s=oe.getAccessToken();if(s&&lr(s)){const r=await Ve.refreshAccessToken();if(r)s=r;else return Ve.lastFailureWasTransport||(oe.clearTokens(),dr()),e}else if(!s&&oe.getRefreshToken()){const r=await Ve.refreshAccessToken();r&&(s=r)}s&&e.headers&&(e.headers.Authorization=`Bearer ${s}`)}if(e.url?.startsWith("/cabinet/auth/telegram")||e.url?.startsWith("/cabinet/auth/account/link/telegram")){const s=Jc();s&&e.headers&&(e.headers["X-Telegram-Init-Data"]=s)}const n=e.method?.toUpperCase();return n&&["POST","PUT","DELETE","PATCH"].includes(n)&&e.headers&&(e.headers[Gc]=Xc()),e});function tl(e){if(!e||typeof e!="object")return!1;const a=e;return a.response?.status===503&&a.response?.data?.detail?.code==="maintenance"}function hr(e){if(!e||typeof e!="object")return!1;const a=e;return a.response?.status===403&&a.response?.data?.detail?.code==="channel_subscription_required"}function al(e){if(!e||typeof e!="object")return!1;const a=e;return a.response?.status===403&&a.response?.data?.detail?.code==="blacklisted"}function nl(e){if(!e||typeof e!="object")return!1;const a=e;return a.response?.status===403&&a.response?.data?.detail?.code==="account_deleted"}b.interceptors.response.use(e=>(Dc(),e),async e=>{const a=e.config;if(!e.response&&e.code!=="ERR_CANCELED")return or(),Promise.reject(e);if(tl(e)){const n=(e.response?.data).detail;return me.getState().setMaintenance({message:n.message,reason:n.reason}),Promise.reject(e)}if(hr(e)){const n=(e.response?.data).detail;return me.getState().setChannelSubscription({message:n.message,channel_link:n.channel_link,channels:n.channels}),Promise.reject(e)}if(al(e)){const n=(e.response?.data).detail;return me.getState().setBlacklisted({message:n.message}),Promise.reject(e)}if(nl(e)){const n=(e.response?.data).detail;return me.getState().setAccountDeleted({message:n.message,bot_username:n.bot_username,telegram_deep_link:n.telegram_deep_link}),Promise.reject(e)}if(e.response?.status===401&&!a._retry){const n=a.url||"";if(pr(n))return Promise.reject(e);a._retry=!0;const s=await Ve.refreshAccessToken();if(s)return a.headers&&(a.headers.Authorization=`Bearer ${s}`),b(a);Ve.lastFailureWasTransport||(oe.clearTokens(),dr())}return Promise.reject(e)});const fr="ym_client_id";function je(){try{return localStorage.getItem(fr)}catch{return null}}function gr(e){try{localStorage.setItem(fr,e)}catch{}}const pe={loginTelegram:async(e,a,n,s)=>(await b.post("/cabinet/auth/telegram",{init_data:e,campaign_slug:a||void 0,referral_code:n||void 0,yandex_cid:je()||void 0,accepted_legal_documents:s})).data,loginTelegramWidget:async(e,a,n,s)=>(await b.post("/cabinet/auth/telegram/widget",{...e,campaign_slug:a||void 0,referral_code:n||void 0,yandex_cid:je()||void 0,accepted_legal_documents:s})).data,loginTelegramOIDC:async(e,a,n,s)=>(await b.post("/cabinet/auth/telegram/oidc",{id_token:e,campaign_slug:a||void 0,referral_code:n||void 0,yandex_cid:je()||void 0,accepted_legal_documents:s})).data,loginEmail:async(e,a,n,s)=>(await b.post("/cabinet/auth/email/login",{email:e,password:a,campaign_slug:n||void 0,referral_code:s||void 0,yandex_cid:je()||void 0})).data,registerEmail:async(e,a)=>(await b.post("/cabinet/auth/email/register",{email:e,password:a,yandex_cid:je()||void 0})).data,verifyEmailMerge:async e=>(await b.post("/cabinet/auth/email/merge/verify",{code:e})).data,registerEmailStandalone:async e=>(await b.post("/cabinet/auth/email/register/standalone",{...e,yandex_cid:je()||void 0})).data,verifyEmail:async(e,a)=>(await b.post("/cabinet/auth/email/verify",{token:e,campaign_slug:a||void 0})).data,resendVerification:async()=>(await b.post("/cabinet/auth/email/resend")).data,refreshToken:async e=>(await b.post("/cabinet/auth/refresh",{refresh_token:e})).data,logout:async e=>{await b.post("/cabinet/auth/logout",{refresh_token:e})},forgotPassword:async e=>(await b.post("/cabinet/auth/password/forgot",{email:e})).data,resetPassword:async(e,a)=>(await b.post("/cabinet/auth/password/reset",{token:e,password:a})).data,getMe:async()=>(await b.get("/cabinet/auth/me")).data,requestEmailChange:async e=>(await b.post("/cabinet/auth/email/change",{new_email:e})).data,verifyEmailChange:async e=>(await b.post("/cabinet/auth/email/change/verify",{code:e})).data,getOAuthProviders:async()=>(await b.get("/cabinet/auth/oauth/providers")).data,getOAuthAuthorizeUrl:async e=>(await b.get(`/cabinet/auth/oauth/${encodeURIComponent(e)}/authorize`)).data,oauthCallback:async(e,a,n,s,r,o)=>(await b.post(`/cabinet/auth/oauth/${encodeURIComponent(e)}/callback`,{code:a,state:n,device_id:s||void 0,campaign_slug:r||void 0,referral_code:o||void 0,yandex_cid:je()||void 0})).data,getLinkedProviders:async()=>(await b.get("/cabinet/auth/account/linked-providers")).data,linkProviderInit:async e=>(await b.get(`/cabinet/auth/account/link/${encodeURIComponent(e)}/init`)).data,linkProviderCallback:async(e,a,n,s)=>(await b.post(`/cabinet/auth/account/link/${encodeURIComponent(e)}/callback`,{code:a,state:n,device_id:s})).data,linkTelegram:async e=>(await b.post("/cabinet/auth/account/link/telegram",e)).data,linkServerComplete:async(e,a,n)=>(await b.post("/cabinet/auth/account/link/server-complete",{code:e,state:a,device_id:n})).data,unlinkProvider:async e=>(await b.post(`/cabinet/auth/account/unlink/${encodeURIComponent(e)}`)).data,autoLogin:async e=>(await b.post("/cabinet/auth/login/auto",{token:e})).data,requestDeepLinkToken:async()=>(await b.post("/cabinet/auth/deeplink/request")).data,pollDeepLinkToken:async(e,a)=>(await b.post("/cabinet/auth/deeplink/poll",{token:e,campaign_slug:a||void 0},{validateStatus:s=>s===200})).data,getMergePreview:async e=>(await b.get(`/cabinet/auth/merge/${encodeURIComponent(e)}`)).data,executeMerge:async(e,a)=>(await b.post(`/cabinet/auth/merge/${encodeURIComponent(e)}`,{keep_subscription_from:a})).data},aa="campaign_slug",na="campaign_slug_ttl",sl=1440*60*1e3,rl=/^[a-zA-Z0-9_-]{1,64}$/;function xr(){try{const e=localStorage.getItem(aa);if(!e)return null;const a=localStorage.getItem(na);return!a||Number.isNaN(Number(a))||Date.now()>Number(a)?(localStorage.removeItem(aa),localStorage.removeItem(na),null):e}catch{return null}}function il(){try{localStorage.removeItem(aa),localStorage.removeItem(na)}catch{}}function ol(){try{const e=new URLSearchParams(window.location.search),a=e.get("campaign");if(!a||!rl.test(a))return;localStorage.setItem(aa,a),localStorage.setItem(na,String(Date.now()+sl)),e.delete("campaign");const n=e.toString(),s=window.location.pathname+(n?`?${n}`:"")+window.location.hash;window.history.replaceState(null,"",s)}catch{}}function mt(){const e=xr();return e&&il(),e}function Qe(){return xr()}const sa="referral_code",ra="referral_code_ttl",cl=1440*60*1e3,ll=/^[a-zA-Z0-9_-]{1,64}$/;function br(){try{const e=localStorage.getItem(sa);if(!e)return null;const a=localStorage.getItem(ra);return!a||Number.isNaN(Number(a))||Date.now()>Number(a)?(localStorage.removeItem(sa),localStorage.removeItem(ra),null):e}catch{return null}}function dl(){try{localStorage.removeItem(sa),localStorage.removeItem(ra)}catch{}}function ul(){try{const e=new URLSearchParams(window.location.search),a=e.get("ref");if(!a||!ll.test(a))return;localStorage.setItem(sa,a),localStorage.setItem(ra,String(Date.now()+cl)),e.delete("ref");const n=e.toString(),s=window.location.pathname+(n?`?${n}`:"")+window.location.hash;window.history.replaceState(null,"",s)}catch{}}function ut(){const e=br();return e&&dl(),e}function tt(){return br()}function ml(e,a){if(e==="*:*")return!0;if(e.endsWith(":*")){const n=e.indexOf(":"),s=a.indexOf(":");if(n===-1||s===-1)return!1;const r=e.slice(0,n),o=a.slice(0,s);return r===o}return e===a}const Fe=bt((e,a)=>({permissions:[],roles:[],roleLevel:0,isLoaded:!1,fetchPermissions:async()=>{try{const n=await b.get("/cabinet/auth/me/permissions");e({permissions:n.data.permissions,roles:n.data.roles,roleLevel:n.data.role_level,isLoaded:!0})}catch{e({permissions:[],roles:[],roleLevel:0,isLoaded:!0})}},hasPermission:n=>{const{permissions:s}=a();return s.some(r=>ml(r,n))},hasAnyPermission:(...n)=>{const{hasPermission:s}=a();return n.some(r=>s(r))},hasAllPermissions:(...n)=>{const{hasPermission:s}=a();return n.every(r=>s(r))},canManageRole:n=>{const{roleLevel:s}=a();return s>n},reset:()=>{e({permissions:[],roles:[],roleLevel:0,isLoaded:!1})}})),Me={promise:null,isInitializing:!1,isInitialized:!1},J=bt()(ro((e,a)=>({accessToken:null,refreshToken:null,user:null,isAuthenticated:!1,isLoading:!0,isAdmin:!1,pendingCampaignBonus:null,clearCampaignBonus:()=>e({pendingCampaignBonus:null}),setTokens:(n,s)=>{if(!n||!s)throw new Error("Invalid tokens: cannot store empty credentials");oe.setTokens(n,s),e({accessToken:n,refreshToken:s,isAuthenticated:!0})},setUser:n=>{e({user:n})},setIsAdmin:n=>{e({isAdmin:n})},logout:()=>{const n=oe.getRefreshToken();n&&pe.logout(n).catch(()=>{}),oe.clearTokens(),Fe.getState().reset(),e({accessToken:null,refreshToken:null,user:null,isAuthenticated:!1,isAdmin:!1})},checkAdminStatus:async()=>{try{const n=oe.getAccessToken();if(!n||!Kn(n)){e({isAdmin:!1}),Fe.getState().reset();return}const s=await b.get("/cabinet/auth/me/is-admin");e({isAdmin:s.data.is_admin}),s.data.is_admin?await Fe.getState().fetchPermissions():Fe.getState().reset()}catch{e({isAdmin:!1}),Fe.getState().reset()}},refreshUser:async()=>{try{const n=await pe.getMe();e({user:n})}catch{}},initialize:async()=>{if(Me.isInitialized)return;if(Me.isInitializing&&Me.promise)return Me.promise;const n=(r,o,d)=>{e({accessToken:r,refreshToken:o,user:d,isAuthenticated:!0,isLoading:!1})},s=()=>{oe.clearTokens(),e({accessToken:null,refreshToken:null,user:null,isAuthenticated:!1,isLoading:!1})};return Me.isInitializing=!0,Me.promise=(async()=>{try{e({isLoading:!0}),oe.migrateFromLocalStorage();const r=oe.getAccessToken();let o=oe.getRefreshToken();if(!o&&(o=await Fc(),!o)){e({isLoading:!1,isAuthenticated:!1});return}if(!Kn(r)){const d=await Ve.refreshAccessToken();if(d){const p=await pe.getMe();await a().checkAdminStatus(),n(d,o,p)}else Ve.lastFailureWasTransport?e({isLoading:!1}):s();return}try{const d=await pe.getMe();await a().checkAdminStatus(),n(r,o,d)}catch{const d=await Ve.refreshAccessToken();if(d)try{const p=await pe.getMe();await a().checkAdminStatus(),n(d,o,p)}catch{s()}else Ve.lastFailureWasTransport?e({isLoading:!1}):s()}}finally{Me.isInitializing=!1,Me.isInitialized=!0,Me.promise=null}})(),Me.promise},loginWithTelegram:async(n,s)=>{const r=Qe(),o=tt(),d=await pe.loginTelegram(n,r,o,s);mt(),ut(),oe.setTokens(d.access_token,d.refresh_token),e({accessToken:d.access_token,refreshToken:d.refresh_token,user:d.user,isAuthenticated:!0,pendingCampaignBonus:d.campaign_bonus||null}),await a().checkAdminStatus()},loginWithTelegramWidget:async(n,s)=>{const r=Qe(),o=tt(),d=await pe.loginTelegramWidget(n,r,o,s);mt(),ut(),oe.setTokens(d.access_token,d.refresh_token),e({accessToken:d.access_token,refreshToken:d.refresh_token,user:d.user,isAuthenticated:!0,pendingCampaignBonus:d.campaign_bonus||null}),await a().checkAdminStatus()},loginWithTelegramOIDC:async(n,s)=>{const r=Qe(),o=tt(),d=await pe.loginTelegramOIDC(n,r,o,s);mt(),ut(),oe.setTokens(d.access_token,d.refresh_token),e({accessToken:d.access_token,refreshToken:d.refresh_token,user:d.user,isAuthenticated:!0,pendingCampaignBonus:d.campaign_bonus||null}),await a().checkAdminStatus()},loginWithEmail:async(n,s)=>{const r=Qe(),o=tt(),d=await pe.loginEmail(n,s,r,o);mt(),ut(),oe.setTokens(d.access_token,d.refresh_token),e({accessToken:d.access_token,refreshToken:d.refresh_token,user:d.user,isAuthenticated:!0,pendingCampaignBonus:d.campaign_bonus||null}),await a().checkAdminStatus()},loginWithOAuth:async(n,s,r,o)=>{const d=Qe(),p=tt(),i=await pe.oauthCallback(n,s,r,o,d,p);mt(),ut(),oe.setTokens(i.access_token,i.refresh_token),e({accessToken:i.access_token,refreshToken:i.refresh_token,user:i.user,isAuthenticated:!0,pendingCampaignBonus:i.campaign_bonus||null}),await a().checkAdminStatus()},loginWithDeepLink:async(n,s)=>{const r=await pe.pollDeepLinkToken(n,s);if(!r.access_token||!r.refresh_token)throw new Error("Invalid auth response: missing tokens");oe.setTokens(r.access_token,r.refresh_token),e({accessToken:r.access_token,refreshToken:r.refresh_token,user:r.user,isAuthenticated:!0,pendingCampaignBonus:r.campaign_bonus||null}),await a().checkAdminStatus()},registerWithEmail:async(n,s,r,o,d)=>{const p=o||tt()||void 0,i=Qe()||void 0,c=await pe.registerEmailStandalone({email:n,password:s,first_name:r,language:navigator.language.split("-")[0]||"ru",referral_code:p,campaign_slug:i,accepted_legal_documents:d});return ut(),c}}),{name:"cabinet-auth",storage:io(()=>({getItem:e=>fe.getItem(e),setItem:(e,a)=>{fe.setItem(e,a)},removeItem:e=>{fe.removeItem(e)}})),partialize:e=>({user:e.user})}));ol();ul();const pl="modulepreload",hl=function(e){return"/"+e},Yn={},k=function(a,n,s){let r=Promise.resolve();if(n&&n.length>0){let i=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),p=d?.nonce||d?.getAttribute("nonce");r=i(n.map(c=>{if(c=hl(c),c in Yn)return;Yn[c]=!0;const u=c.endsWith(".css"),m=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${m}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":pl,u||(h.as="script"),h.crossOrigin="",h.href=c,p&&h.setAttribute("nonce",p),document.head.appendChild(h),u)return new Promise((f,g)=>{h.addEventListener("load",f),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return r.then(d=>{for(const p of d||[])p.status==="rejected"&&o(p.reason);return a().catch(o)})},hn=l.createContext(null);hn.displayName="PlatformContext";function fl(){const e=Ee();return{hasBackButton:e,hasHapticFeedback:e,hasNativeDialogs:e,hasThemeSync:e,hasInvoice:e,hasCloudStorage:e,hasShare:!0,version:void 0}}function gl(){const e=Ee();let a=null;return{get isVisible(){if(!e)return!1;try{return Io()}catch{return!1}},show(n){if(e){if(a)try{Wa(a)}catch{}a=n;try{Ws(n),za()}catch{}}},hide(){if(e){if(a){try{Wa(a)}catch{}a=null}try{zs()}catch{}}}}}function xl(){const e=Ee();return{impact(a="medium"){if(e)try{Lo(a)}catch{}},notification(a){if(e)try{So(a)}catch{}},selection(){if(e)try{To()}catch{}}}}function bl(){const e=Ee();return{async alert(a,n){if(!e){window.alert(a);return}try{await Ia({message:a,buttons:[{type:"ok",id:"ok"}]})}catch{window.alert(a)}},async confirm(a,n){if(!e)return window.confirm(a);try{return await Ia({message:a,buttons:[{type:"ok",id:"ok"},{type:"cancel",id:"cancel"}]})==="ok"}catch{return window.confirm(a)}},async popup(a){if(!e)return window.confirm(a.message)?"ok":null;try{const n=a.buttons?.map(r=>r.type==="ok"||r.type==="close"||r.type==="cancel"?{type:r.type,id:r.id}:{type:r.type??"default",id:r.id,text:r.text});return await Ia({title:a.title,message:a.message,buttons:n})||null}catch{return window.confirm(a.message)?"ok":null}}}}function yl(){const e=Ee();return{setHeaderColor(a){if(e)try{Eo(a)}catch{}},setBottomBarColor(a){if(e)try{Ao(a)}catch{}},getThemeParams(){if(!e)return null;try{const a=Zs();return a?{bg_color:a.bgColor,text_color:a.textColor,hint_color:a.hintColor,link_color:a.linkColor,button_color:a.buttonColor,button_text_color:a.buttonTextColor,secondary_bg_color:a.secondaryBgColor,header_bg_color:a.headerBgColor,bottom_bar_bg_color:a.bottomBarBgColor,accent_text_color:a.accentTextColor,section_bg_color:a.sectionBgColor,section_header_text_color:a.sectionHeaderTextColor,subtitle_text_color:a.subtitleTextColor,destructive_text_color:a.destructiveTextColor}:null}catch{return null}}}}function vl(){return Ee()?{async getItem(a){try{const n=await $s(a);return n===""?null:n}catch{return null}},async setItem(a,n){await Us(a,n)},async removeItem(a){await Ks(a)},async getKeys(){try{return await Co()}catch{return[]}}}:null}function wl(){return{platform:"telegram",capabilities:fl(),backButton:gl(),haptic:xl(),dialog:bl(),theme:yl(),cloudStorage:vl(),openInvoice(e){try{return No(e,"url")}catch{return window.open(e,"_blank"),Promise.resolve("pending")}},openLink(e,a){try{_o(e,{tryInstantView:a?.tryInstantView})}catch{window.open(e,"_blank")}},openTelegramLink(e){try{jo(e)}catch{window.open(e,"_blank")}},async share(e,a){const n=a?`${e} ${a}`:e;if(navigator.share)try{return await navigator.share({text:n,url:a}),!0}catch{}try{return ko(a||n,e),!0}catch{return!1}},setClosingConfirmation(e){try{e?wo():qs()}catch{}}}}const jt="bedolaga_";function kl(){return{hasBackButton:!1,hasHapticFeedback:"vibrate"in navigator,hasNativeDialogs:!1,hasThemeSync:!1,hasInvoice:!1,hasCloudStorage:!0,hasShare:"share"in navigator,version:void 0}}function jl(){return{isVisible:!1,show(e){},hide(){}}}function _l(){const e="vibrate"in navigator,a={light:[10],medium:[20],heavy:[30],rigid:[15,10,15],soft:[5,5,5]},n={success:[10,50,10],warning:[20,50,20],error:[30,30,30,30,30]};return{impact(s="medium"){e&&navigator.vibrate(a[s])},notification(s){e&&navigator.vibrate(n[s])},selection(){e&&navigator.vibrate(5)}}}function Nl(){return{alert(e,a){return new Promise(n=>{window.alert(e),n()})},confirm(e,a){return new Promise(n=>{n(window.confirm(e))})},popup(e){return new Promise(a=>{if(window.confirm(e.message)&&e.buttons?.length){const s=e.buttons.find(r=>r.type!=="cancel"&&r.type!=="close");a(s?.id??"ok")}else a(null)})}}}function Cl(){return{setHeaderColor(e){const a=document.querySelector('meta[name="theme-color"]');a&&a.setAttribute("content",e)},setBottomBarColor(e){},getThemeParams(){return null}}}function Al(){return{async getItem(e){try{return localStorage.getItem(jt+e)}catch{return null}},async setItem(e,a){try{localStorage.setItem(jt+e,a)}catch{console.warn("Failed to save to localStorage:",e)}},async removeItem(e){try{localStorage.removeItem(jt+e)}catch{}},async getKeys(){try{const e=[];for(let a=0;a(a.preventDefault(),""):window.onbeforeunload=null}}}function Tl(){return Ee()?"telegram":"web"}function Sl(){return Tl()==="telegram"?wl():El()}function Ll({children:e}){const a=l.useMemo(()=>Sl(),[]);return t.jsx(hn.Provider,{value:a,children:e})}function Te(){const e=l.useContext(hn);if(!e)throw new Error("usePlatform must be used within a PlatformProvider");return e}function K2(){const{platform:e}=Te();return e==="telegram"}function yt(){const{haptic:e,capabilities:a}=Te(),n=l.useCallback((o="medium")=>{e.impact(o)},[e]),s=l.useCallback(o=>{e.notification(o)},[e]),r=l.useCallback(()=>{e.selection()},[e]);return{impact:n,notification:s,selection:r,isAvailable:a.hasHapticFeedback}}function fn(){const e=yt();return{buttonPress:l.useCallback(()=>e.impact("light"),[e]),buttonPressHeavy:l.useCallback(()=>e.impact("medium"),[e]),toggle:l.useCallback(()=>e.impact("rigid"),[e]),success:l.useCallback(()=>e.notification("success"),[e]),warning:l.useCallback(()=>e.notification("warning"),[e]),error:l.useCallback(()=>e.notification("error"),[e]),selectionChanged:l.useCallback(()=>e.selection(),[e]),impact:e.impact,notification:e.notification,selection:e.selection}}function Il(){const{dialog:e,capabilities:a}=Te(),n=l.useCallback(async(o,d)=>{await e.alert(o,d)},[e]),s=l.useCallback(async(o,d)=>e.confirm(o,d),[e]),r=l.useCallback(async o=>e.popup(o),[e]);return{alert:n,confirm:s,popup:r,isNative:a.hasNativeDialogs}}const Xn={ok:(e="OK")=>({id:"ok",type:"ok",text:e}),cancel:(e="Cancel")=>({id:"cancel",type:"cancel",text:e}),close:(e="Close")=>({id:"close",type:"close",text:e}),destructive:(e,a)=>({id:e,type:"destructive",text:a}),default:(e,a)=>({id:e,type:"default",text:a})};function Rl(){const e=Il();return l.useCallback(async(a,n="Delete",s)=>e.isNative?await e.popup({title:s,message:a,buttons:[Xn.cancel(),Xn.destructive("confirm",n)]})==="confirm":e.confirm(a,s),[e])}var yr={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Jn=se.createContext&&se.createContext(yr),Pl=["attr","size","title"];function Ml(e,a){if(e==null)return{};var n,s,r=Dl(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;sse.createElement(a.tag,oa({key:n},a.attr),vr(a.child)))}function j(e){return a=>se.createElement(Ol,ia({attr:oa({},e.attr)},a),vr(e.child))}function Ol(e){var a=n=>{var s=e.attr,r=e.size,o=e.title,d=Ml(e,Pl),p=r||n.size||"1em",i;return n.className&&(i=n.className),e.className&&(i=(i?i+" ":"")+e.className),se.createElement("svg",ia({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,s,d,{className:i,style:oa(oa({color:e.color||n.color},n.style),e.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),o&&se.createElement("title",null,o),e.children)};return Jn!==void 0?se.createElement(Jn.Consumer,null,n=>a(n)):a(yr)}function xa(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"},child:[]}]})(e)}function Zl(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"},child:[]}]})(e)}function Fl(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z"},child:[]}]})(e)}function wr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"},child:[]}]})(e)}function $l(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"},child:[]}]})(e)}function Ul(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm0,128H56a8,8,0,0,1-8-8V78.63A23.84,23.84,0,0,0,56,80H216Zm-48-60a12,12,0,1,1,12,12A12,12,0,0,1,168,132Z"},child:[]}]})(e)}function Kl(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"},child:[]}]})(e)}function ql(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M117.25,157.92a60,60,0,1,0-66.5,0A95.83,95.83,0,0,0,3.53,195.63a8,8,0,1,0,13.4,8.74,80,80,0,0,1,134.14,0,8,8,0,0,0,13.4-8.74A95.83,95.83,0,0,0,117.25,157.92ZM40,108a44,44,0,1,1,44,44A44.05,44.05,0,0,1,40,108Zm210.14,98.7a8,8,0,0,1-11.07-2.33A79.83,79.83,0,0,0,172,168a8,8,0,0,1,0-16,44,44,0,1,0-16.34-84.87,8,8,0,1,1-5.94-14.85,60,60,0,0,1,55.53,105.64,95.83,95.83,0,0,1,47.22,37.71A8,8,0,0,1,250.14,206.7Z"},child:[]}]})(e)}function zl(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M244.8,150.4a8,8,0,0,1-11.2-1.6A51.6,51.6,0,0,0,192,128a8,8,0,0,1-7.37-4.89,8,8,0,0,1,0-6.22A8,8,0,0,1,192,112a24,24,0,1,0-23.24-30,8,8,0,1,1-15.5-4A40,40,0,1,1,219,117.51a67.94,67.94,0,0,1,27.43,21.68A8,8,0,0,1,244.8,150.4ZM190.92,212a8,8,0,1,1-13.84,8,57,57,0,0,0-98.16,0,8,8,0,1,1-13.84-8,72.06,72.06,0,0,1,33.74-29.92,48,48,0,1,1,58.36,0A72.06,72.06,0,0,1,190.92,212ZM128,176a32,32,0,1,0-32-32A32,32,0,0,0,128,176ZM72,120a8,8,0,0,0-8-8A24,24,0,1,1,87.24,82a8,8,0,1,0,15.5-4A40,40,0,1,0,37,117.51,67.94,67.94,0,0,0,9.6,139.19a8,8,0,1,0,12.8,9.61A51.6,51.6,0,0,1,64,128,8,8,0,0,0,72,120Z"},child:[]}]})(e)}function Wl(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"},child:[]}]})(e)}function Gl(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z"},child:[]}]})(e)}function Ql(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"},child:[]}]})(e)}function Yl(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232,64H208V48a8,8,0,0,0-8-8H56a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8Zm144-8.9c0,35.52-29,64.64-64,64.9a64,64,0,0,1-64-64V56H192ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"},child:[]}]})(e)}function Xl(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.69A15.86,15.86,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.31A15.86,15.86,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z"},child:[]}]})(e)}function kr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"},child:[]}]})(e)}function Jl(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z"},child:[]}]})(e)}function e0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232,104a8,8,0,0,0,8-8V64a16,16,0,0,0-16-16H32A16,16,0,0,0,16,64V96a8,8,0,0,0,8,8,24,24,0,0,1,0,48,8,8,0,0,0-8,8v32a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V160a8,8,0,0,0-8-8,24,24,0,0,1,0-48ZM32,167.2a40,40,0,0,0,0-78.4V64H88V192H32Zm192,0V192H104V64H224V88.8a40,40,0,0,0,0,78.4Z"},child:[]}]})(e)}function q2(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M200,224a8,8,0,0,1-8,8H64a8,8,0,0,1,0-16H192A8,8,0,0,1,200,224Zm-72-24a64.07,64.07,0,0,0,64-64V56a8,8,0,0,0-16,0v80a48,48,0,0,1-96,0V56a8,8,0,0,0-16,0v80A64.07,64.07,0,0,0,128,200Z"},child:[]}]})(e)}function z2(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,128a8,8,0,0,1-8,8H175.93c9.19,7.11,16.07,17.2,16.07,32,0,13.34-7,25.7-19.75,34.79C160.33,211.31,144.61,216,128,216s-32.33-4.69-44.25-13.21C71,193.7,64,181.34,64,168a8,8,0,0,1,16,0c0,17.35,22,32,48,32s48-14.65,48-32c0-14.85-10.54-23.58-38.77-32H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM76.33,104a8,8,0,0,0,7.61-10.49A17.3,17.3,0,0,1,83.11,88c0-18.24,19.3-32,44.89-32,18.84,0,34.16,7.42,41,19.85a8,8,0,0,0,14-7.7C173.33,50.52,152.77,40,128,40,93.29,40,67.11,60.63,67.11,88a33.73,33.73,0,0,0,1.62,10.49A8,8,0,0,0,76.33,104Z"},child:[]}]})(e)}function W2(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M200,56a8,8,0,0,1-8,8H157.77L115.1,192H144a8,8,0,0,1,0,16H64a8,8,0,0,1,0-16H98.23L140.9,64H112a8,8,0,0,1,0-16h80A8,8,0,0,1,200,56Z"},child:[]}]})(e)}function G2(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm88,144H208l33.55-44.74a32,32,0,1,0-55.73-29.93,8,8,0,1,0,15.08,5.34,16.28,16.28,0,0,1,2.32-4.3,16,16,0,1,1,25.54,19.27L185.6,203.2A8,8,0,0,0,192,216h48a8,8,0,0,0,0-16Z"},child:[]}]})(e)}function Q2(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm73.52,90.63,21-30A8,8,0,0,0,240,104H192a8,8,0,0,0,0,16h32.63l-19.18,27.41A8,8,0,0,0,212,160a20,20,0,1,1-14.29,34,8,8,0,1,0-11.42,11.19A36,36,0,0,0,248,180,36.07,36.07,0,0,0,225.52,146.63Z"},child:[]}]})(e)}function Y2(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm75.77,49a8,8,0,0,0-8.21.39l-24,16a8,8,0,1,0,8.88,13.32L216,127V208a8,8,0,0,0,16,0V112A8,8,0,0,0,227.77,105Z"},child:[]}]})(e)}function X2(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M178.48,115.7A44,44,0,0,0,148,40H80a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8h80a48,48,0,0,0,18.48-92.3ZM88,56h60a28,28,0,0,1,0,56H88Zm72,136H88V128h72a32,32,0,0,1,0,64Z"},child:[]}]})(e)}function J2(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,48H168a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm176,24H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm-48,40H40a8,8,0,0,0,0,16H168a8,8,0,0,0,0-16Z"},child:[]}]})(e)}function ef(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM64,96a8,8,0,0,0,0,16H192a8,8,0,0,0,0-16Zm152,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm-24,40H64a8,8,0,0,0,0,16H192a8,8,0,0,0,0-16Z"},child:[]}]})(e)}function jr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228.88,26.19a9,9,0,0,0-9.16-1.57L17.06,103.93a14.22,14.22,0,0,0,2.43,27.21L72,141.45V200a15.92,15.92,0,0,0,10,14.83,15.91,15.91,0,0,0,17.51-3.73l25.32-26.26L165,220a15.88,15.88,0,0,0,10.51,4,16.3,16.3,0,0,0,5-.79,15.85,15.85,0,0,0,10.67-11.63L231.77,35A9,9,0,0,0,228.88,26.19Zm-61.14,36L78.15,126.35l-49.6-9.73ZM88,200V152.52l24.79,21.74Zm87.53,8L92.85,135.5l119-85.29Z"},child:[]}]})(e)}function t0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63Zm-96,96L48,132.69V48h84.69L232,147.31ZM96,84A12,12,0,1,1,84,72,12,12,0,0,1,96,84Z"},child:[]}]})(e)}function a0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"},child:[]}]})(e)}function n0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"},child:[]}]})(e)}function s0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"},child:[]}]})(e)}function _r(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"},child:[]}]})(e)}function r0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z"},child:[]}]})(e)}function i0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"},child:[]}]})(e)}function o0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0Z"},child:[]}]})(e)}function c0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M176,160a39.89,39.89,0,0,0-28.62,12.09l-46.1-29.63a39.8,39.8,0,0,0,0-28.92l46.1-29.63a40,40,0,1,0-8.66-13.45l-46.1,29.63a40,40,0,1,0,0,55.82l46.1,29.63A40,40,0,1,0,176,160Zm0-128a24,24,0,1,1-24,24A24,24,0,0,1,176,32ZM64,152a24,24,0,1,1,24-24A24,24,0,0,1,64,152Zm112,72a24,24,0,1,1,24-24A24,24,0,0,1,176,224Z"},child:[]}]})(e)}function l0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M152,224a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,224ZM128,112a12,12,0,1,0-12-12A12,12,0,0,0,128,112Zm95.62,43.83-12.36,55.63a16,16,0,0,1-25.51,9.11L158.51,200h-61L70.25,220.57a16,16,0,0,1-25.51-9.11L32.38,155.83a16.09,16.09,0,0,1,3.32-13.71l28.56-34.26a123.07,123.07,0,0,1,8.57-36.67c12.9-32.34,36-52.63,45.37-59.85a16,16,0,0,1,19.6,0c9.34,7.22,32.47,27.51,45.37,59.85a123.07,123.07,0,0,1,8.57,36.67l28.56,34.26A16.09,16.09,0,0,1,223.62,155.83ZM99.43,184h57.14c21.12-37.54,25.07-73.48,11.74-106.88C156.55,47.64,134.49,29,128,24c-6.51,5-28.57,23.64-40.33,53.12C74.36,110.52,78.31,146.46,99.43,184Zm-15,5.85Q68.28,160.5,64.83,132.16L48,152.36,60.36,208l.18-.13ZM208,152.36l-16.83-20.2q-3.42,28.28-19.56,57.69l23.85,18,.18.13Z"},child:[]}]})(e)}function Nr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M200,48H136V16a8,8,0,0,0-16,0V48H56A32,32,0,0,0,24,80V192a32,32,0,0,0,32,32H200a32,32,0,0,0,32-32V80A32,32,0,0,0,200,48Zm16,144a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V80A16,16,0,0,1,56,64H200a16,16,0,0,1,16,16Zm-52-56H92a28,28,0,0,0,0,56h72a28,28,0,0,0,0-56Zm-24,16v24H116V152ZM80,164a12,12,0,0,1,12-12h8v24H92A12,12,0,0,1,80,164Zm84,12h-8V152h8a12,12,0,0,1,0,24ZM72,108a12,12,0,1,1,12,12A12,12,0,0,1,72,108Zm88,0a12,12,0,1,1,12,12A12,12,0,0,1,160,108Z"},child:[]}]})(e)}function d0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M24,128A72.08,72.08,0,0,1,96,56H204.69L194.34,45.66a8,8,0,0,1,11.32-11.32l24,24a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L204.69,72H96a56.06,56.06,0,0,0-56,56,8,8,0,0,1-16,0Zm200-8a8,8,0,0,0-8,8,56.06,56.06,0,0,1-56,56H51.31l10.35-10.34a8,8,0,0,0-11.32-11.32l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L51.31,200H160a72.08,72.08,0,0,0,72-72A8,8,0,0,0,224,120Z"},child:[]}]})(e)}function tf(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M100,56H40A16,16,0,0,0,24,72v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,100,56Zm0,80H40V72h60ZM216,56H156a16,16,0,0,0-16,16v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,216,56Zm0,80H156V72h60Z"},child:[]}]})(e)}function u0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"},child:[]}]})(e)}function m0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"},child:[]}]})(e)}function p0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M53.92,34.62A8,8,0,1,0,42.08,45.38L67.37,73.2A69.82,69.82,0,0,0,38,87.63a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33,89.75,89.75,0,0,0,11.58-20.27l21.84,24a8,8,0,1,0,11.84-10.76ZM155.9,208,48,100.08C58.23,91.83,69.2,87.72,80.66,87.81l87.16,95.88C165.59,193.56,160.24,202.23,155.9,208Zm79.42-104-44.64,44.79a8,8,0,1,1-11.33-11.3L224,92.7,163.32,32,122.1,73.35a8,8,0,0,1-11.33-11.29L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.32,104Z"},child:[]}]})(e)}function h0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z"},child:[]}]})(e)}function f0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.56,87.56,0,0,1-20.41,56.28L71.72,60.4A88,88,0,0,1,216,128ZM40,128A87.56,87.56,0,0,1,60.41,71.72L184.28,195.6A88,88,0,0,1,40,128Z"},child:[]}]})(e)}function g0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"},child:[]}]})(e)}function Cr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"},child:[]}]})(e)}function x0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"},child:[]}]})(e)}function b0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M205.66,61.64l-144,144a8,8,0,0,1-11.32-11.32l144-144a8,8,0,0,1,11.32,11.31ZM50.54,101.44a36,36,0,0,1,50.92-50.91h0a36,36,0,0,1-50.92,50.91ZM56,76A20,20,0,1,0,90.14,61.84h0A20,20,0,0,0,56,76ZM216,180a36,36,0,1,1-10.54-25.46h0A35.76,35.76,0,0,1,216,180Zm-16,0a20,20,0,1,0-5.86,14.14A19.87,19.87,0,0,0,200,180Z"},child:[]}]})(e)}function y0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM51.31,160,136,75.31,152.69,92,68,176.68ZM48,179.31,76.69,208H48Zm48,25.38L79.31,188,164,103.31,180.69,120Zm96-96L147.31,64l24-24L216,84.68Z"},child:[]}]})(e)}function v0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"},child:[]}]})(e)}function w0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM112,96v64a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0Z"},child:[]}]})(e)}function k0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"},child:[]}]})(e)}function j0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M88,112a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm8,40h80a8,8,0,0,0,0-16H96a8,8,0,0,0,0,16ZM232,64V184a24,24,0,0,1-24,24H32A24,24,0,0,1,8,184.11V88a8,8,0,0,1,16,0v96a8,8,0,0,0,16,0V64A16,16,0,0,1,56,48H216A16,16,0,0,1,232,64Zm-16,0H56V184a23.84,23.84,0,0,1-1.37,8H208a8,8,0,0,0,8-8Z"},child:[]}]})(e)}function _0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232,112H136V88h8a16,16,0,0,0,16-16V40a16,16,0,0,0-16-16H112A16,16,0,0,0,96,40V72a16,16,0,0,0,16,16h8v24H24a8,8,0,0,0,0,16H56v32H48a16,16,0,0,0-16,16v32a16,16,0,0,0,16,16H80a16,16,0,0,0,16-16V176a16,16,0,0,0-16-16H72V128H184v32h-8a16,16,0,0,0-16,16v32a16,16,0,0,0,16,16h32a16,16,0,0,0,16-16V176a16,16,0,0,0-16-16h-8V128h32a8,8,0,0,0,0-16ZM112,40h32V72H112ZM80,208H48V176H80Zm128,0H176V176h32Z"},child:[]}]})(e)}function N0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"},child:[]}]})(e)}function Ar(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,88a40,40,0,1,0,40,40A40,40,0,0,0,128,88Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,152ZM240,56H16a8,8,0,0,0-8,8V192a8,8,0,0,0,8,8H240a8,8,0,0,0,8-8V64A8,8,0,0,0,240,56ZM193.65,184H62.35A56.78,56.78,0,0,0,24,145.65v-35.3A56.78,56.78,0,0,0,62.35,72h131.3A56.78,56.78,0,0,0,232,110.35v35.3A56.78,56.78,0,0,0,193.65,184ZM232,93.37A40.81,40.81,0,0,1,210.63,72H232ZM45.37,72A40.81,40.81,0,0,1,24,93.37V72ZM24,162.63A40.81,40.81,0,0,1,45.37,184H24ZM210.63,184A40.81,40.81,0,0,1,232,162.63V184Z"},child:[]}]})(e)}function C0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"},child:[]}]})(e)}function A0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232,56H24A16,16,0,0,0,8,72V200a8,8,0,0,0,16,0V184H40v16a8,8,0,0,0,16,0V184H72v16a8,8,0,0,0,16,0V184h16v16a8,8,0,0,0,16,0V184h16v16a8,8,0,0,0,16,0V184h16v16a8,8,0,0,0,16,0V184h16v16a8,8,0,0,0,16,0V184h16v16a8,8,0,0,0,16,0V72A16,16,0,0,0,232,56ZM24,72H232v96H24Zm88,80a8,8,0,0,0,8-8V96a8,8,0,0,0-8-8H48a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8ZM56,104h48v32H56Zm88,48h64a8,8,0,0,0,8-8V96a8,8,0,0,0-8-8H144a8,8,0,0,0-8,8v48A8,8,0,0,0,144,152Zm8-48h48v32H152Z"},child:[]}]})(e)}function Er(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M248,120a48.05,48.05,0,0,0-48-48H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48.07,48.07,0,0,0,248,120ZM48,199.93V40h0c42.81,35.91,86.63,45,104,47.24v65.48C134.65,155,90.84,164.07,48,199.93Zm131,8,0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"},child:[]}]})(e)}function E0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228.92,49.69a8,8,0,0,0-6.86-1.45L160.93,63.52,99.58,32.84a8,8,0,0,0-5.52-.6l-64,16A8,8,0,0,0,24,56V200a8,8,0,0,0,9.94,7.76l61.13-15.28,61.35,30.68A8.15,8.15,0,0,0,160,224a8,8,0,0,0,1.94-.24l64-16A8,8,0,0,0,232,200V56A8,8,0,0,0,228.92,49.69ZM104,52.94l48,24V203.06l-48-24ZM40,62.25l48-12v127.5l-48,12Zm176,131.5-48,12V78.25l48-12Z"},child:[]}]})(e)}function T0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"},child:[]}]})(e)}function S0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Zm-68-56a12,12,0,1,1-12-12A12,12,0,0,1,140,152Z"},child:[]}]})(e)}function L0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM40,72H216a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"},child:[]}]})(e)}function af(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,128a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM104,72H216a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16ZM216,184H104a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM43.58,55.16,48,52.94V104a8,8,0,0,0,16,0V40a8,8,0,0,0-11.58-7.16l-16,8a8,8,0,0,0,7.16,14.32ZM79.77,156.72a23.73,23.73,0,0,0-9.6-15.95,24.86,24.86,0,0,0-34.11,4.7,23.63,23.63,0,0,0-3.57,6.46,8,8,0,1,0,15,5.47,7.84,7.84,0,0,1,1.18-2.13,8.76,8.76,0,0,1,12-1.59A7.91,7.91,0,0,1,63.93,159a7.64,7.64,0,0,1-1.57,5.78,1,1,0,0,0-.08.11L33.59,203.21A8,8,0,0,0,40,216H72a8,8,0,0,0,0-16H56l19.08-25.53A23.47,23.47,0,0,0,79.77,156.72Z"},child:[]}]})(e)}function nf(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"},child:[]}]})(e)}function I0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"},child:[]}]})(e)}function R0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"},child:[]}]})(e)}function P0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm39.1,131.79a47.84,47.84,0,0,0,0-55.58l28.5-28.49a87.83,87.83,0,0,1,0,112.56ZM96,128a32,32,0,1,1,32,32A32,32,0,0,1,96,128Zm88.28-67.6L155.79,88.9a47.84,47.84,0,0,0-55.58,0L71.72,60.4a87.83,87.83,0,0,1,112.56,0ZM60.4,71.72l28.5,28.49a47.84,47.84,0,0,0,0,55.58L60.4,184.28a87.83,87.83,0,0,1,0-112.56ZM71.72,195.6l28.49-28.5a47.84,47.84,0,0,0,55.58,0l28.49,28.5a87.83,87.83,0,0,1-112.56,0Z"},child:[]}]})(e)}function M0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"},child:[]}]})(e)}function D0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"},child:[]}]})(e)}function V0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M248,128a56,56,0,0,1-95.6,39.6l-.33-.35L92.12,99.55a40,40,0,1,0,0,56.9l8.52-9.62a8,8,0,1,1,12,10.61l-8.69,9.81-.33.35a56,56,0,1,1,0-79.2l.33.35,59.95,67.7a40,40,0,1,0,0-56.9l-8.52,9.62a8,8,0,1,1-12-10.61l8.69-9.81.33-.35A56,56,0,0,1,248,128Z"},child:[]}]})(e)}function Tr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"},child:[]}]})(e)}function H0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"},child:[]}]})(e)}function sf(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M253.66,106.34a8,8,0,0,0-11.32,0L192,156.69,107.31,72l50.35-50.34a8,8,0,1,0-11.32-11.32L96,60.69A16,16,0,0,0,93.18,79.5L72,100.69a16,16,0,0,0,0,22.62L76.69,128,18.34,186.34a8,8,0,0,0,3.13,13.25l72,24A7.88,7.88,0,0,0,96,224a8,8,0,0,0,5.66-2.34L136,187.31l4.69,4.69a16,16,0,0,0,22.62,0l21.19-21.18A16,16,0,0,0,203.31,168l50.35-50.34A8,8,0,0,0,253.66,106.34ZM93.84,206.85l-55-18.35L88,139.31,124.69,176ZM152,180.69,83.31,112,104,91.31,172.69,160Z"},child:[]}]})(e)}function Sr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M72,144H32a8,8,0,0,1,0-16H67.72l13.62-20.44a8,8,0,0,1,13.32,0l25.34,38,9.34-14A8,8,0,0,1,136,128h24a8,8,0,0,1,0,16H140.28l-13.62,20.44a8,8,0,0,1-13.32,0L88,126.42l-9.34,14A8,8,0,0,1,72,144ZM178,40c-20.65,0-38.73,8.88-50,23.89C116.73,48.88,98.65,40,78,40a62.07,62.07,0,0,0-62,62c0,.75,0,1.5,0,2.25a8,8,0,1,0,16-.5c0-.58,0-1.17,0-1.75A46.06,46.06,0,0,1,78,56c19.45,0,35.78,10.36,42.6,27a8,8,0,0,0,14.8,0c6.82-16.67,23.15-27,42.6-27a46.06,46.06,0,0,1,46,46c0,53.61-77.76,102.15-96,112.8-10.83-6.31-42.63-26-66.68-52.21a8,8,0,1,0-11.8,10.82c31.17,34,72.93,56.68,74.69,57.63a8,8,0,0,0,7.58,0C136.21,228.66,240,172,240,102A62.07,62.07,0,0,0,178,40Z"},child:[]}]})(e)}function B0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M201.89,54.66A103.43,103.43,0,0,0,128.79,24H128A104,104,0,0,0,24,128v56a24,24,0,0,0,24,24H64a24,24,0,0,0,24-24V144a24,24,0,0,0-24-24H40.36A88.12,88.12,0,0,1,190.54,65.93,87.39,87.39,0,0,1,215.65,120H192a24,24,0,0,0-24,24v40a24,24,0,0,0,24,24h24a24,24,0,0,1-24,24H136a8,8,0,0,0,0,16h56a40,40,0,0,0,40-40V128A103.41,103.41,0,0,0,201.89,54.66ZM64,136a8,8,0,0,1,8,8v40a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V136Zm128,56a8,8,0,0,1-8-8V144a8,8,0,0,1,8-8h24v56Z"},child:[]}]})(e)}function Lr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,136H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,64H48V152H208v48Zm0-160H48A16,16,0,0,0,32,56v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V56A16,16,0,0,0,208,40Zm0,64H48V56H208v48ZM192,80a12,12,0,1,1-12-12A12,12,0,0,1,192,80Zm0,96a12,12,0,1,1-12-12A12,12,0,0,1,192,176Z"},child:[]}]})(e)}function O0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M254.3,107.91,228.78,56.85a16,16,0,0,0-21.47-7.15L182.44,62.13,130.05,48.27a8.14,8.14,0,0,0-4.1,0L73.56,62.13,48.69,49.7a16,16,0,0,0-21.47,7.15L1.7,107.9a16,16,0,0,0,7.15,21.47l27,13.51,55.49,39.63a8.06,8.06,0,0,0,2.71,1.25l64,16a8,8,0,0,0,7.6-2.1l55.07-55.08,26.42-13.21a16,16,0,0,0,7.15-21.46Zm-54.89,33.37L165,113.72a8,8,0,0,0-10.68.61C136.51,132.27,116.66,130,104,122L147.24,80h31.81l27.21,54.41ZM41.53,64,62,74.22,36.43,125.27,16,115.06Zm116,119.13L99.42,168.61l-49.2-35.14,28-56L128,64.28l9.8,2.59-45,43.68-.08.09a16,16,0,0,0,2.72,24.81c20.56,13.13,45.37,11,64.91-5L188,152.66Zm62-57.87-25.52-51L214.47,64,240,115.06Zm-87.75,92.67a8,8,0,0,1-7.75,6.06,8.13,8.13,0,0,1-1.95-.24L80.41,213.33a7.89,7.89,0,0,1-2.71-1.25L51.35,193.26a8,8,0,0,1,9.3-13l25.11,17.94L126,208.24A8,8,0,0,1,131.82,217.94Z"},child:[]}]})(e)}function Z0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"},child:[]}]})(e)}function Ir(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"},child:[]}]})(e)}function Rr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A112.1,112.1,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.62a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.08,8.08,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8.08,8.08,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"},child:[]}]})(e)}function F0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"},child:[]}]})(e)}function $0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M176,112H152a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16ZM104,96H96V88a8,8,0,0,0-16,0v8H72a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0v-8h8a8,8,0,0,0,0-16ZM241.48,200.65a36,36,0,0,1-54.94,4.81c-.12-.12-.24-.24-.35-.37L146.48,160h-37L69.81,205.09l-.35.37A36.08,36.08,0,0,1,44,216,36,36,0,0,1,8.56,173.75a.68.68,0,0,1,0-.14L24.93,89.52A59.88,59.88,0,0,1,83.89,40H172a60.08,60.08,0,0,1,59,49.25c0,.06,0,.12,0,.18l16.37,84.17a.68.68,0,0,1,0,.14A35.74,35.74,0,0,1,241.48,200.65ZM172,144a44,44,0,0,0,0-88H83.89A43.9,43.9,0,0,0,40.68,92.37l0,.13L24.3,176.59A20,20,0,0,0,58,194.3l41.92-47.59a8,8,0,0,1,6-2.71Zm59.7,32.59-8.74-45A60,60,0,0,1,172,160h-4.2L198,194.31a20.09,20.09,0,0,0,17.46,5.39,20,20,0,0,0,16.23-23.11Z"},child:[]}]})(e)}function U0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"},child:[]}]})(e)}function K0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M219.31,72,184,36.69A15.86,15.86,0,0,0,172.69,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V83.31A15.86,15.86,0,0,0,219.31,72ZM168,208H88V152h80Zm40,0H184V152a16,16,0,0,0-16-16H88a16,16,0,0,0-16,16v56H48V48H172.69L208,83.31ZM160,72a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h56A8,8,0,0,1,160,72Z"},child:[]}]})(e)}function q0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M42.76,50A8,8,0,0,0,40,56V224a8,8,0,0,0,16,0V179.77c26.79-21.16,49.87-9.75,76.45,3.41,16.4,8.11,34.06,16.85,53,16.85,13.93,0,28.54-4.75,43.82-18a8,8,0,0,0,2.76-6V56A8,8,0,0,0,218.76,50c-28,24.23-51.72,12.49-79.21-1.12C111.07,34.76,78.78,18.79,42.76,50ZM216,172.25c-26.79,21.16-49.87,9.74-76.45-3.41-25-12.35-52.81-26.13-83.55-8.4V59.79c26.79-21.16,49.87-9.75,76.45,3.4,25,12.35,52.82,26.13,83.55,8.4Z"},child:[]}]})(e)}function Pr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"},child:[]}]})(e)}function z0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"},child:[]}]})(e)}function W0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,112v96a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V112A16,16,0,0,1,56,96H80a8,8,0,0,1,0,16H56v96H200V112H176a8,8,0,0,1,0-16h24A16,16,0,0,1,216,112ZM93.66,69.66,120,43.31V136a8,8,0,0,0,16,0V43.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,69.66Z"},child:[]}]})(e)}function Mr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48Zm-96,85.15L52.57,64H203.43ZM98.71,128,40,181.81V74.19Zm11.84,10.85,12,11.05a8,8,0,0,0,10.82,0l12-11.05,58,53.15H52.57ZM157.29,128,216,74.18V181.82Z"},child:[]}]})(e)}function G0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"},child:[]}]})(e)}function Q0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M72,92A12,12,0,1,1,60,80,12,12,0,0,1,72,92Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,128,80Zm68,24a12,12,0,1,0-12-12A12,12,0,0,0,196,104ZM60,152a12,12,0,1,0,12,12A12,12,0,0,0,60,152Zm68,0a12,12,0,1,0,12,12A12,12,0,0,0,128,152Zm68,0a12,12,0,1,0,12,12A12,12,0,0,0,196,152Z"},child:[]}]})(e)}function Y0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"},child:[]}]})(e)}function X0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M192,32H64A32,32,0,0,0,32,64V192a32,32,0,0,0,32,32H192a32,32,0,0,0,32-32V64A32,32,0,0,0,192,32Zm16,160a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V64A16,16,0,0,1,64,48H192a16,16,0,0,1,16,16ZM104,92A12,12,0,1,1,92,80,12,12,0,0,1,104,92Zm72,0a12,12,0,1,1-12-12A12,12,0,0,1,176,92Zm-72,72a12,12,0,1,1-12-12A12,12,0,0,1,104,164Zm36-36a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm36,36a12,12,0,1,1-12-12A12,12,0,0,1,176,164Z"},child:[]}]})(e)}function J0(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,72H208V64a24,24,0,0,0-24-24H40A24,24,0,0,0,16,64v96a24,24,0,0,0,24,24H152v8a24,24,0,0,0,24,24h48a24,24,0,0,0,24-24V96A24,24,0,0,0,224,72ZM40,168a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H184a8,8,0,0,1,8,8v8H176a24,24,0,0,0-24,24v72Zm192,24a8,8,0,0,1-8,8H176a8,8,0,0,1-8-8V96a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Zm-96,16a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h40A8,8,0,0,1,136,208Zm80-96a8,8,0,0,1-8,8H192a8,8,0,0,1,0-16h16A8,8,0,0,1,216,112Z"},child:[]}]})(e)}function ed(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M178.48,115.7A44,44,0,0,0,152,40.19V24a8,8,0,0,0-16,0V40H120V24a8,8,0,0,0-16,0V40H72a8,8,0,0,0,0,16h8V192H72a8,8,0,0,0,0,16h32v16a8,8,0,0,0,16,0V208h16v16a8,8,0,0,0,16,0V208h8a48,48,0,0,0,18.48-92.3ZM176,84a28,28,0,0,1-28,28H96V56h52A28,28,0,0,1,176,84ZM160,192H96V128h64a32,32,0,0,1,0,64Z"},child:[]}]})(e)}function Dr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"},child:[]}]})(e)}function td(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M152,96H104a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V104A8,8,0,0,0,152,96Zm-8,48H112V112h32Zm88,0H216V112h16a8,8,0,0,0,0-16H216V56a16,16,0,0,0-16-16H160V24a8,8,0,0,0-16,0V40H112V24a8,8,0,0,0-16,0V40H56A16,16,0,0,0,40,56V96H24a8,8,0,0,0,0,16H40v32H24a8,8,0,0,0,0,16H40v40a16,16,0,0,0,16,16H96v16a8,8,0,0,0,16,0V216h32v16a8,8,0,0,0,16,0V216h40a16,16,0,0,0,16-16V160h16a8,8,0,0,0,0-16Zm-32,56H56V56H200v95.87s0,.09,0,.13,0,.09,0,.13V200Z"},child:[]}]})(e)}function ad(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"},child:[]}]})(e)}function nd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"},child:[]}]})(e)}function rf(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"},child:[]}]})(e)}function sd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M160,40A88.09,88.09,0,0,0,81.29,88.67,64,64,0,1,0,72,216h88a88,88,0,0,0,0-176Zm0,160H72a48,48,0,0,1,0-96c1.1,0,2.2,0,3.29.11A88,88,0,0,0,72,128a8,8,0,0,0,16,0,72,72,0,1,1,72,72Zm-8-72V88a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,172,164Z"},child:[]}]})(e)}function rd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"},child:[]}]})(e)}function id(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"},child:[]}]})(e)}function od(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M168,152a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,152Zm-8-40H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm56-64V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V48A16,16,0,0,1,56,32H92.26a47.92,47.92,0,0,1,71.48,0H200A16,16,0,0,1,216,48ZM96,64h64a32,32,0,0,0-64,0ZM200,48H173.25A47.93,47.93,0,0,1,176,64v8a8,8,0,0,1-8,8H88a8,8,0,0,1-8-8V64a47.93,47.93,0,0,1,2.75-16H56V216H200Z"},child:[]}]})(e)}function cd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"},child:[]}]})(e)}function ld(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},child:[]}]})(e)}function dd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"},child:[]}]})(e)}function ud(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"},child:[]}]})(e)}function md(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm71.87,53.27L136,114.14V40.37A88,88,0,0,1,199.87,77.27ZM120,40.37v83l-71.89,41.5A88,88,0,0,1,120,40.37ZM128,216a88,88,0,0,1-71.87-37.27L207.89,91.12A88,88,0,0,1,128,216Z"},child:[]}]})(e)}function pd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V48a8,8,0,0,1,16,0v94.37L90.73,98a8,8,0,0,1,10.07-.38l58.81,44.11L218.73,90a8,8,0,1,1,10.54,12l-64,56a8,8,0,0,1-10.07.38L96.39,114.29,40,163.63V200H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function hd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24a8,8,0,0,0-8,8V88a8,8,0,0,0,8,8,32,32,0,1,1-27.72,16,8,8,0,0,0-2.93-10.93l-48.5-28A8,8,0,0,0,37.92,76,104,104,0,1,0,128,24ZM48.09,91.1,83,111.26A48.09,48.09,0,0,0,80,128c0,1.53.08,3,.22,4.52L41.28,143A88.16,88.16,0,0,1,48.09,91.1Zm-2.67,67.31,39-10.44A48.1,48.1,0,0,0,120,175.32v40.31A88.2,88.2,0,0,1,45.42,158.41ZM136,215.63V175.32a48,48,0,0,0,0-94.65V40.36a88,88,0,0,1,0,175.27Z"},child:[]}]})(e)}function Vr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"},child:[]}]})(e)}function fd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"},child:[]}]})(e)}function of(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M181.66,170.34a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32,0l-48-48a8,8,0,0,1,11.32-11.32L128,212.69l42.34-42.35A8,8,0,0,1,181.66,170.34Zm-96-84.68L128,43.31l42.34,42.35a8,8,0,0,0,11.32-11.32l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,85.66,85.66Z"},child:[]}]})(e)}function gd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"},child:[]}]})(e)}function xd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"},child:[]}]})(e)}function Hr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"},child:[]}]})(e)}function bd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V208Zm-31.38-94.36-29.84-2.31-11.43-26.5a8,8,0,0,0-14.7,0l-11.43,26.5-29.84,2.31a8,8,0,0,0-4.47,14.14l22.52,18.59-6.86,27.71a8,8,0,0,0,11.82,8.81L128,167.82l25.61,15.07a8,8,0,0,0,11.82-8.81l-6.86-27.71,22.52-18.59a8,8,0,0,0-4.47-14.14Zm-32.11,23.6a8,8,0,0,0-2.68,8.09l3.5,14.12-13.27-7.81a8,8,0,0,0-8.12,0l-13.27,7.81,3.5-14.12a8,8,0,0,0-2.68-8.09l-11.11-9.18,14.89-1.15a8,8,0,0,0,6.73-4.8l6-13.92,6,13.92a8,8,0,0,0,6.73,4.8l14.89,1.15Z"},child:[]}]})(e)}function yd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-68-76a12,12,0,1,1-12-12A12,12,0,0,1,140,132Zm44,0a12,12,0,1,1-12-12A12,12,0,0,1,184,132ZM96,172a12,12,0,1,1-12-12A12,12,0,0,1,96,172Zm44,0a12,12,0,1,1-12-12A12,12,0,0,1,140,172Zm44,0a12,12,0,1,1-12-12A12,12,0,0,1,184,172Z"},child:[]}]})(e)}function vd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z"},child:[]}]})(e)}function Br(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,88a40,40,0,1,0,40,40A40,40,0,0,0,128,88Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,152Zm73.71,7.14a80,80,0,0,1-14.08,22.2,8,8,0,0,1-11.92-10.67,63.95,63.95,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67,80.08,80.08,0,0,1,14.08,84.47ZM69,103.09a64,64,0,0,0,11.26,67.58,8,8,0,0,1-11.92,10.67,79.93,79.93,0,0,1,0-106.67A8,8,0,1,1,80.29,85.34,63.77,63.77,0,0,0,69,103.09ZM248,128a119.58,119.58,0,0,1-34.29,84,8,8,0,1,1-11.42-11.2,103.9,103.9,0,0,0,0-145.56A8,8,0,1,1,213.71,44,119.58,119.58,0,0,1,248,128ZM53.71,200.78A8,8,0,1,1,42.29,212a119.87,119.87,0,0,1,0-168,8,8,0,1,1,11.42,11.2,103.9,103.9,0,0,0,0,145.56Z"},child:[]}]})(e)}function wd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"},child:[]}]})(e)}function kd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"},child:[]}]})(e)}function jd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"},child:[]}]})(e)}function _d(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"},child:[]}]})(e)}function gn(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"},child:[]}]})(e)}function Nd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"},child:[]}]})(e)}function Cd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"},child:[]}]})(e)}function Or(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"},child:[]}]})(e)}function Ad(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"},child:[]}]})(e)}function Ed(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"},child:[]}]})(e)}function Td(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"},child:[]}]})(e)}function Sd(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"},child:[]}]})(e)}function Zr(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H40V56H216V200ZM80,84A12,12,0,1,1,68,72,12,12,0,0,1,80,84Zm40,0a12,12,0,1,1-12-12A12,12,0,0,1,120,84Z"},child:[]}]})(e)}function Ld(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z"},child:[]}]})(e)}function Id(e){return j({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z"},child:[]}]})(e)}function x(...e){return oo(co(e))}const cf=({className:e})=>t.jsx(r0,{className:x("h-5 w-5",e)}),Rd=({className:e})=>t.jsx(Fl,{className:x("h-5 w-5",e)}),lf=({className:e})=>t.jsx(wd,{className:x("h-5 w-5",e)}),df=({className:e})=>t.jsx(B0,{className:x("h-5 w-5",e)}),uf=({className:e})=>t.jsx(Ed,{className:x("h-5 w-5",e)}),Pd=({className:e})=>t.jsx(Or,{className:x("h-5 w-5",e)}),mf=({className:e})=>t.jsx(Nd,{className:x("h-5 w-5",e)}),Md=({className:e})=>t.jsx(f0,{className:x("h-5 w-5",e)}),pf=({className:e})=>t.jsx(M0,{className:x("h-5 w-5",e)}),hf=({className:e})=>t.jsx(Xl,{className:x("h-5 w-5",e)}),ff=({className:e})=>t.jsx(W0,{className:x("h-5 w-5",e)}),gf=({className:e})=>t.jsx($l,{className:x("h-5 w-5",e)}),xf=({className:e})=>t.jsx(Sr,{className:x("h-5 w-5",e)}),bf=({className:e})=>t.jsx(vd,{className:x("h-5 w-5",e)}),yf=({className:e})=>t.jsx(bd,{className:x("h-5 w-5",e)}),vf=({className:e})=>t.jsx(md,{className:x("h-5 w-5",e)}),wf=({className:e})=>t.jsx(hd,{className:x("h-5 w-5",e)}),kf=({className:e})=>t.jsx(td,{className:x("h-5 w-5",e)}),jf=({className:e})=>t.jsx(A0,{className:x("h-5 w-5",e)}),_f=({className:e})=>t.jsx(h0,{className:x("h-5 w-5",e)}),Nf=({className:e})=>t.jsx(Ar,{className:x("h-5 w-5",e)}),ts=({className:e})=>t.jsx(kd,{className:x("h-5 w-5",e)}),Dd=({className:e})=>t.jsx(R0,{className:x("h-5 w-5",e)}),Cf=({className:e})=>t.jsx(Nr,{className:x("h-5 w-5",e)}),Af=({className:e})=>t.jsx(Br,{className:x("h-5 w-5",e)}),Ef=({className:e})=>t.jsx(Zr,{className:x("h-5 w-5",e)}),Fr=({className:e})=>t.jsx(yd,{className:x("h-5 w-5",e)}),Vd=({className:e})=>t.jsx(Dr,{className:x("h-5 w-5",e)}),Tf=({className:e})=>t.jsx(Br,{className:x("h-5 w-5",e)}),Sf=({className:e})=>t.jsx(Vr,{className:x("h-5 w-5",e)}),Hd=({className:e})=>t.jsx(dd,{className:x("h-5 w-5",e)}),Lf=({className:e})=>t.jsx(Hr,{className:x("h-5 w-5",e)}),If=({className:e})=>t.jsx(xd,{className:x("h-5 w-5",e)}),Rf=({className:e})=>t.jsx(fd,{className:x("h-5 w-5",e)}),Pf=({className:e})=>t.jsx(ed,{className:x("h-5 w-5",e)}),Rt=({className:e})=>t.jsx(J0,{className:x("h-5 w-5",e)}),Mf=({className:e})=>t.jsx(Pr,{className:x("h-5 w-5",e)}),Bd=({className:e})=>t.jsx(Id,{className:x("h-2 w-2",e)}),Da=({className:e})=>t.jsx(Mr,{className:x("h-5 w-5",e)}),Ht=({className:e})=>t.jsx(wr,{className:x("h-5 w-5",e)}),as=({className:e})=>t.jsx(Cd,{className:x("h-5 w-5",e)}),Df=({className:e})=>t.jsx(nd,{className:x("h-5 w-5",e)}),Vf=({className:e})=>t.jsx(_d,{className:x("h-5 w-5",e)}),Hf=({className:e})=>t.jsx(jd,{className:x("h-5 w-5",e)}),Bf=({className:e})=>t.jsx(E0,{className:x("h-5 w-5",e)}),Of=({className:e})=>t.jsx(_0,{className:x("h-5 w-5",e)}),Zf=({className:e})=>t.jsx(z0,{className:x("h-5 w-5",e)}),Ff=({className:e})=>t.jsx(Pr,{className:x("h-5 w-5",e)}),$f=({className:e})=>t.jsx(U0,{className:x("h-5 w-5",e)}),Uf=({className:e})=>t.jsx(Q0,{className:x("h-5 w-5",e)}),Kf=({className:e})=>t.jsx(Y0,{className:x("h-5 w-5",e)}),qf=({className:e})=>t.jsx(Sr,{className:x("h-5 w-5",e)}),zf=({className:e})=>t.jsx(id,{className:x("h-5 w-5",e)}),Wf=({className:e})=>t.jsx(P0,{className:x("h-5 w-5",e)}),Gf=({className:e})=>t.jsx(Tr,{className:x("h-5 w-5",e)}),Qf=({className:e})=>t.jsx(V0,{className:x("h-5 w-5",e)}),Od=({className:e})=>t.jsx(I0,{className:x("h-5 w-5",e)}),Yf=({className:e})=>t.jsx(Mr,{className:x("h-5 w-5",e)}),Xf=({className:e})=>t.jsx(Er,{className:x("h-5 w-5",e)}),Jf=({className:e})=>t.jsx(C0,{className:x("h-5 w-5",e)}),Zd=({className:e})=>t.jsx(j0,{className:x("h-5 w-5",e)}),e8=({className:e})=>t.jsx(O0,{className:x("h-5 w-5",e)}),t8=({className:e})=>t.jsx(Tr,{className:x("h-5 w-5",e)}),a8=({className:e})=>t.jsx(b0,{className:x("h-5 w-5",e)}),n8=({className:e})=>t.jsx(m0,{className:x("h-5 w-5",e)}),s8=({className:e})=>t.jsx(Cr,{className:x("h-4 w-4",e)}),r8=({className:e})=>t.jsx(g0,{className:x("h-5 w-5",e)}),i8=({className:e})=>t.jsx(u0,{className:x("h-5 w-5",e)}),o8=({className:e})=>t.jsx(d0,{className:x("h-5 w-5",e)}),c8=({className:e})=>t.jsx(q0,{className:x("h-5 w-5",e)}),l8=({className:e})=>t.jsx(Td,{className:x("h-5 w-5",e)}),$r=({className:e})=>t.jsx(Sd,{className:x("h-5 w-5",e)}),Fd=({className:e})=>t.jsx(sd,{className:x("h-5 w-5",e)}),Gt=({className:e})=>t.jsx(l0,{className:x("h-5 w-5",e)}),d8=({className:e})=>t.jsx(K0,{className:x("h-5 w-5",e)}),u8=({className:e})=>t.jsx(k0,{className:x("h-5 w-5",e)}),m8=({className:e})=>t.jsx(Lr,{className:x("h-4 w-4",e)}),p8=({className:e})=>t.jsx(Rr,{className:x("h-5 w-5",e)}),h8=({className:e})=>t.jsx(c0,{className:x("h-5 w-5",e)}),$d=({className:e})=>t.jsx(_r,{className:x("h-5 w-5",e)}),f8=({className:e})=>t.jsx(Nr,{className:x("h-5 w-5",e)}),g8=({className:e})=>t.jsx(Zr,{className:x("h-5 w-5",e)}),x8=({className:e})=>t.jsx(Ar,{className:x("h-5 w-5",e)}),b8=({className:e})=>t.jsx(pd,{className:x("h-5 w-5",e)}),y8=({className:e})=>t.jsx(Ir,{className:x("h-5 w-5",e)}),v8=({className:e})=>t.jsx(Jl,{className:x("h-5 w-5",e)}),w8=({className:e})=>t.jsx(cd,{className:x("h-5 w-5",e)}),k8=({className:e})=>t.jsx(t0,{className:x("h-5 w-5",e)}),Ud=({className:e})=>t.jsx(jr,{className:x("h-5 w-5",e)}),j8=({className:e})=>t.jsx(jr,{className:x("h-4 w-4",e)}),_8=({className:e})=>t.jsx(e0,{className:x("h-5 w-5",e)}),ns=({className:e})=>t.jsx(F0,{className:x("h-5 w-5",e)}),N8=({className:e})=>t.jsx(kr,{className:x("h-4 w-4",e)}),C8=({className:e})=>t.jsx(Yl,{className:x("h-5 w-5",e)}),A8=({className:e})=>t.jsx(p0,{className:x("h-5 w-5",e)}),E8=({className:e})=>t.jsx(Gl,{className:x("h-5 w-5",e)}),T8=({className:e})=>t.jsx(zl,{className:x("h-5 w-5",e)}),S8=({className:e})=>t.jsx(Kl,{className:x("h-5 w-5",e)}),Ur=({className:e})=>t.jsx(wr,{className:x("h-5 w-5",e)}),Kd=({className:e})=>t.jsx(Zl,{className:x("h-5 w-5",e)}),qd=({className:e})=>t.jsx(xa,{className:x("h-5 w-5",e)}),L8=({className:e})=>t.jsx(xa,{className:x("h-5 w-5",e)}),xn=({className:e})=>t.jsx(H0,{className:x("h-5 w-5",e)}),I8=({className:e})=>t.jsx(Ad,{className:x("h-5 w-5",e)}),Bt=({className:e})=>t.jsx(gd,{className:x("h-5 w-5",e)}),zd=({className:e})=>t.jsx(L0,{className:x("h-5 w-5",e)}),Ot=({className:e})=>t.jsx(xa,{className:x("h-5 w-5",e)}),bn=({className:e})=>t.jsx(Hr,{className:x("h-5 w-5",e)}),R8=({className:e})=>t.jsx(Or,{className:x("h-5 w-5",e)}),Kr=({className:e})=>t.jsx(T0,{className:x("h-5 w-5",e)}),Ya=({className:e})=>t.jsx(Cr,{className:x("h-5 w-5",e)}),P8=({className:e})=>t.jsx(v0,{className:x("h-4 w-4",e)}),M8=({className:e})=>t.jsx(y0,{className:x("h-4 w-4",e)}),Wd=({className:e})=>t.jsx(kr,{className:x("h-5 w-5",e)}),D8=({className:e})=>t.jsx(Ql,{className:x("h-5 w-5",e)}),V8=({className:e})=>t.jsx(G0,{className:x("h-5 w-5",e)}),qr=({className:e,spinning:a=!1})=>t.jsx(gn,{className:x("h-4 w-4",a&&"animate-spin",e)}),H8=({className:e})=>t.jsx(gn,{className:x("h-5 w-5",e)}),Pe=({className:e})=>t.jsx(ld,{className:x("h-4 w-4",e)}),Gd=({className:e})=>t.jsx(ad,{className:x("h-4 w-4",e)}),zr=({className:e})=>t.jsx(xa,{className:x("h-4 w-4",e)}),B8=({className:e})=>t.jsx(S0,{className:x("h-4 w-4",e)}),ba=({className:e})=>t.jsx(D0,{className:x("h-5 w-5",e)}),Xa=({className:e})=>t.jsx(Wl,{className:x("h-5 w-5",e)}),Zt=({className:e})=>t.jsx(ql,{className:x("h-5 w-5",e)}),Wr=({className:e})=>t.jsx(i0,{className:x("h-5 w-5",e)}),Gr=({className:e})=>t.jsx(a0,{className:x("h-5 w-5",e)}),Qr=({className:e})=>t.jsx(N0,{className:x("h-5 w-5",e)}),ya=({className:e})=>t.jsx(_r,{className:x("h-5 w-5",e)}),ca=({className:e})=>t.jsx(Ul,{className:x("h-5 w-5",e)}),yn=({className:e})=>t.jsx(ud,{className:x("h-5 w-5",e)}),vn=({className:e})=>t.jsx(Ir,{className:x("h-4 w-4",e)}),la=({className:e})=>t.jsx(rd,{className:x("h-5 w-5",e)}),Qd=({className:e,filled:a})=>a?t.jsx(Ld,{className:x("h-5 w-5",e)}):t.jsx(s0,{className:x("h-5 w-5",e)}),Yd=({className:e})=>t.jsx($0,{className:x("h-5 w-5",e)}),Xd=({className:e})=>t.jsx(od,{className:x("h-5 w-5",e)}),Jd=({className:e})=>t.jsx(Rr,{className:x("h-5 w-5",e)}),Yr=({className:e})=>t.jsx(X0,{className:x("h-5 w-5",e)}),eu=({className:e})=>t.jsx(o0,{className:x("h-5 w-5",e)}),O8=({className:e})=>t.jsx(Lr,{className:x("h-5 w-5",e)}),Z8=({className:e})=>t.jsx(Er,{className:x("h-5 w-5",e)}),F8=({className:e})=>t.jsx("svg",{className:x("h-5 w-5",e),fill:"none",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{clipRule:"evenodd",d:"M8 1a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-1.5 0V1.75A.75.75 0 0 1 8 1Zm6 2a.75.75 0 0 1 .75.75v8.5a.75.75 0 0 1-1.5 0v-8.5A.75.75 0 0 1 14 3ZM5 4a.75.75 0 0 1 .75.75v6.5a.75.75 0 0 1-1.5 0v-6.5A.75.75 0 0 1 5 4Zm6 1a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 11 5ZM2 6a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5A.75.75 0 0 1 2 6Z",fill:"currentColor",fillRule:"evenodd"})}),$8=({className:e})=>t.jsx(Vr,{className:x("h-4 w-4",e)}),U8=({className:e})=>t.jsxs("svg",{className:x("h-5 w-5",e),fill:"currentColor",viewBox:"0 0 35 35",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M16.6961 15.2606L16.5825 3.49701C16.5718 2.38439 15.025 2.11843 14.6433 3.16356L11.7279 11.1447C11.6384 11.3898 11.4566 11.5902 11.2213 11.7031L5.66765 14.3687C4.70841 14.8291 5.03635 16.2703 6.10036 16.2703H15.6962C16.2522 16.2703 16.7015 15.8166 16.6961 15.2606Z"}),t.jsx("path",{d:"M18.6471 15.2703V5.88936C18.6471 4.84679 20.0428 4.49998 20.5308 5.4213L23.5833 11.1845C23.7 11.4049 23.8948 11.5737 24.1296 11.6578L31.5829 14.3289C32.6388 14.7073 32.3671 16.2703 31.2455 16.2703H19.6471C19.0948 16.2703 18.6471 15.8226 18.6471 15.2703Z"}),t.jsx("path",{d:"M18.6471 31.4643V19.3784C18.6471 18.8261 19.0948 18.3784 19.6471 18.3784H29.2853C30.3376 18.3784 30.676 19.7947 29.7374 20.2704L24.1129 23.1208C23.889 23.2343 23.716 23.4278 23.6281 23.663L20.5839 31.8141C20.1941 32.8578 18.6471 32.5783 18.6471 31.4643Z"}),t.jsx("path",{d:"M16.7059 28.9873V19.3784C16.7059 18.8261 16.2582 18.3784 15.7059 18.3784H3.83963C2.71522 18.3784 2.44656 19.9473 3.50691 20.3214L11.5457 23.1578C11.7987 23.247 12.0052 23.4342 12.1188 23.6772L14.8 29.4109C15.2531 30.3797 16.7059 30.0568 16.7059 28.9873Z"})]}),K8=({className:e})=>t.jsx(Z0,{className:x("h-5 w-5",e)}),q8=({className:e})=>t.jsx(x0,{className:x("h-4 w-4",e)}),z8=({className:e})=>t.jsx(n0,{className:x("h-4 w-4",e)}),W8=({className:e})=>t.jsx(gn,{className:x("h-4 w-4",e)}),G8=({className:e,style:a})=>t.jsx(w0,{className:x("h-5 w-5",e),style:a}),tu=({className:e})=>t.jsx(Dr,{className:x("h-5 w-5",e)}),Xr=l.createContext(null),Va=3;function wn(){const e=l.useContext(Xr);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function au({children:e}){const[a,n]=l.useState([]),s=l.useRef(new Map),r=l.useCallback(d=>{const p=s.current.get(d);p&&(clearTimeout(p),s.current.delete(d)),n(i=>i.filter(c=>c.id!==d))},[]),o=l.useCallback(d=>{const p=Date.now()+Math.random(),i={id:p,duration:5e3,type:"info",...d};n(u=>{const m=[...u,i];if(m.length>Va){const h=m.slice(0,m.length-Va);for(const f of h){const g=s.current.get(f.id);g&&(clearTimeout(g),s.current.delete(f.id))}return m.slice(-Va)}return m});const c=setTimeout(()=>{r(p)},i.duration);s.current.set(p,c)},[r]);return l.useEffect(()=>{const d=s.current;return()=>{d.forEach(p=>clearTimeout(p)),d.clear()}},[]),t.jsxs(Xr.Provider,{value:{showToast:o},children:[e,t.jsx("div",{role:"region","aria-label":"Notifications","aria-live":"polite",className:"pointer-events-none fixed left-4 right-4 top-[calc(1rem+env(safe-area-inset-top,0px))] z-[100] flex flex-col gap-3 sm:left-auto sm:right-[calc(1rem+env(safe-area-inset-right,0px))]",children:a.map(d=>t.jsx(nu,{toast:d,onClose:()=>r(d.id)},d.id))})]})}function nu({toast:e,onClose:a}){const n=()=>{e.onClick?.(),a()},r={success:{border:"border-success-500/40",icon:"text-success-400",iconBg:"bg-success-500/15",progress:"bg-success-500"},error:{border:"border-error-500/40",icon:"text-error-400",iconBg:"bg-error-500/15",progress:"bg-error-500"},warning:{border:"border-warning-500/40",icon:"text-warning-400",iconBg:"bg-warning-500/15",progress:"bg-warning-500"},info:{border:"border-accent-500/40",icon:"text-accent-400",iconBg:"bg-accent-500/15",progress:"bg-accent-500"}}[e.type||"info"],o=e.type==="error"?"alert":"status",d=i=>{i.key==="Enter"||i.key===" "?(i.preventDefault(),n()):i.key==="Escape"&&(i.preventDefault(),a())},p={success:t.jsx(Pe,{className:"h-5 w-5"}),error:t.jsx(zr,{className:"h-5 w-5"}),warning:t.jsx(Ht,{className:"h-5 w-5"}),info:t.jsx(ba,{className:"h-5 w-5"})};return t.jsx("div",{role:o,tabIndex:0,onClick:n,onKeyDown:d,className:`pointer-events-auto w-full cursor-pointer overflow-hidden rounded-2xl border bg-dark-900 shadow-xl shadow-black/30 backdrop-blur-xl ${r.border} animate-slide-in-right transition-transform duration-200 hover:scale-[1.01] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500/60 focus-visible:ring-offset-2 focus-visible:ring-offset-dark-950 active:scale-[0.99] sm:max-w-sm`,children:t.jsxs("div",{className:"relative p-4",children:[t.jsxs("div",{className:"flex gap-3",children:[t.jsx("div",{"aria-hidden":"true",className:`flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl ${r.iconBg} ${r.icon}`,children:e.icon||p[e.type||"info"]}),t.jsxs("div",{className:"min-w-0 flex-1 pt-0.5",children:[e.title&&t.jsx("p",{className:"mb-0.5 text-sm font-semibold text-dark-100",children:e.title}),t.jsx("p",{className:"text-sm leading-relaxed text-dark-300",children:e.message})]})]}),t.jsx("div",{"aria-hidden":"true",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-dark-800/50",children:t.jsx("div",{className:`h-full w-full ${r.progress} opacity-70`,style:{animation:`shrink ${e.duration}ms linear forwards`,transformOrigin:"left"}})})]})})}function Jr(){const{isFullscreen:e,safeAreaInset:a,contentSafeAreaInset:n,platform:s,isMobile:r}=Vt(),o=e&&r,d=s==="android"?kt.TELEGRAM_HEADER_ANDROID_PX:kt.TELEGRAM_HEADER_IOS_PX,p=o?kt.MOBILE_HEADER_HEIGHT_PX+Math.max(a.top,n.top)+d:kt.MOBILE_HEADER_HEIGHT_PX,i=o?Math.max(a.bottom,n.bottom):0;return{mobile:p,desktop:kt.DESKTOP_HEADER_HEIGHT_PX,bottomSafeArea:i,isMobileFullscreen:o}}const ei={dark:!0,light:!0},ft={accent:"#3b82f6",darkBackground:"#0a0f1a",darkSurface:"#0f172a",darkText:"#f1f5f9",darkTextSecondary:"#94a3b8",lightBackground:"#F7E7CE",lightSurface:"#FEF9F0",lightText:"#1F1A12",lightTextSecondary:"#7D6B48",success:"#22c55e",warning:"#f59e0b",error:"#ef4444"},ti=[50,100,200,300,400,500,600,700,800,900,950],Ft={getColors:async()=>{try{return(await b.get("/cabinet/branding/colors")).data}catch{return ft}},updateColors:async e=>(await b.patch("/cabinet/branding/colors",e)).data,resetColors:async()=>(await b.post("/cabinet/branding/colors/reset")).data,getEnabledThemes:async()=>{try{return(await b.get("/cabinet/branding/themes")).data}catch{return ei}},updateEnabledThemes:async e=>(await b.patch("/cabinet/branding/themes",e)).data},Ha=rr.THEME,va=rr.ENABLED_THEMES;async function ss(){try{const e=await Ft.getEnabledThemes();return fe.setJson(va,e),e}catch{}return Ja()}function Ja(){return fe.getJson(va,ei)}const en="enabledThemesChanged",Ba="themeChanged";function Q8(e){fe.setJson(va,e),window.dispatchEvent(new CustomEvent(en,{detail:e}))}function Ke(){const[e,a]=l.useState(Ja),[n,s]=l.useState(!0),[r,o]=l.useState(()=>{const f=Ja();if(typeof window<"u"){const g=fe.getItem(Ha);if(g==="light"&&f.light)return"light";if(g==="dark"&&f.dark)return"dark";if(g&&!f[g])return f.dark?"dark":"light";if(!g){const y=Lc();if(y&&f[y])return y}if(window.matchMedia("(prefers-color-scheme: light)").matches&&f.light)return"light"}return f.dark?"dark":"light"}),d=l.useRef(r);d.current=r,l.useEffect(()=>{ss().then(f=>{if(a(f),s(!1),!f[d.current]){const g=f.dark?"dark":"light";o(g)}})},[]),l.useEffect(()=>{const f=g=>{if(g.key===va&&g.newValue)try{const y=JSON.parse(g.newValue);if(a(y),!y[r]){const w=y.dark?"dark":"light";o(w)}}catch{}};return window.addEventListener("storage",f),()=>window.removeEventListener("storage",f)},[r]),l.useEffect(()=>{const f=g=>{const y=g.detail;if(a(y),!y[r]){const w=y.dark?"dark":"light";o(w)}};return window.addEventListener(en,f),()=>window.removeEventListener(en,f)},[r]),l.useEffect(()=>{const f=document.documentElement;if(!e[r]){const g=e.dark?"dark":"light";if(g!==r){o(g);return}}r==="light"?(f.classList.remove("dark"),f.classList.add("light")):(f.classList.remove("light"),f.classList.add("dark")),fe.setItem(Ha,r),window.dispatchEvent(new CustomEvent(Ba,{detail:r}))},[r,e]),l.useEffect(()=>{const f=g=>{o(g.detail)};return window.addEventListener(Ba,f),()=>window.removeEventListener(Ba,f)},[]),l.useEffect(()=>{const f=window.matchMedia("(prefers-color-scheme: light)"),g=y=>{if(!fe.getItem(Ha)){const A=y.matches?"light":"dark";e[A]&&o(A)}};return f.addEventListener("change",g),()=>f.removeEventListener("change",g)},[e]);const p=l.useCallback(f=>{e[f]&&o(f)},[e]),i=l.useCallback(()=>{o(f=>{const g=f==="dark"?"light":"dark";return e[g]?g:f})},[e]),c=r==="dark",u=r==="light",m=!n&&e.dark&&e.light,h=l.useCallback(()=>{ss().then(f=>{if(a(f),!f[r]){const g=f.dark?"dark":"light";o(g)}})},[r]);return{theme:r,setTheme:p,toggleTheme:i,isDark:c,isLight:u,enabledThemes:e,canToggle:m,isLoading:n,refreshEnabledThemes:h}}function ai(e){return Ue.isAxiosError(e)&&e.response?.status===404}function Nt(e,a){if(Ue.isAxiosError(e)){const n=e.response?.data?.detail;return typeof n=="string"?n:Array.isArray(n)&&n.length>0?n.map(s=>{const r=s.loc?.filter(o=>o!=="body").join(".")??"";return r?`${r}: ${s.msg}`:s.msg??""}).join("; "):a}return a}const tn={enabled:!0,type:"aurora",settings:{},opacity:1,blur:0,reducedOnMobile:!0};function Y8(e,a){if(typeof e!="string")return a;const n=e.trim();return/^#[0-9a-fA-F]{3,8}$/.test(n)||/^(rgb|hsl)a?\([0-9,.\s/%]+\)$/.test(n)||/^[a-zA-Z]{3,30}$/.test(n)&&!su.has(n.toLowerCase())?n:a}function X8(e,a,n,s){const r=typeof e=="number"&&Number.isFinite(e)?e:s;return Math.max(a,Math.min(n,r))}function J8(e,a){return typeof e=="boolean"?e:a}function eg(e,a,n){return typeof e=="string"&&a.includes(e)?e:n}const su=new Set(["inherit","initial","unset","revert","revert-layer"]),Ct="cabinet_branding",Pt="cabinet_logo_preloaded";let Ae=null;const Mt=()=>{try{if(Ae)return!0;const e=$t();return!e?.has_custom_logo||!e?.logo_url?!1:ee.getItem(Pt)===e.logo_url}catch{return!1}},$t=()=>{try{const e=sessionStorage.getItem(Ct);if(e)return JSON.parse(e);const a=localStorage.getItem(Ct);if(a)return localStorage.removeItem(Ct),sessionStorage.setItem(Ct,a),JSON.parse(a)}catch{}return null},kn=e=>{try{sessionStorage.setItem(Ct,JSON.stringify(e))}catch{}},wa=async e=>{if(!(!e.has_custom_logo||!e.logo_url||Ae||ee.getItem(Pt)===e.logo_url&&Ae))try{const n=`/api${e.logo_url}`,s=await fetch(n);if(!s.ok)return;const r=await s.blob();Ae&&URL.revokeObjectURL(Ae),Ae=URL.createObjectURL(r),ee.setItem(Pt,e.logo_url)}catch{}},tg=()=>Ae,rs=()=>{const e=$t();e&&wa(e)},be={getBranding:async()=>(await b.get("/cabinet/branding")).data,updateName:async e=>(await b.put("/cabinet/branding/name",{name:e})).data,uploadLogo:async e=>{const a=new FormData;a.append("file",e);const n=await b.post("/cabinet/branding/logo",a);return Ae&&(URL.revokeObjectURL(Ae),Ae=null),ee.removeItem(Pt),n.data},getBotStartVideo:async()=>(await b.get("/cabinet/branding/bot-start-video")).data,uploadBotStartVideo:async e=>{const a=new FormData;return a.append("file",e),(await b.post("/cabinet/branding/bot-start-video",a)).data},deleteBotStartVideo:async()=>(await b.delete("/cabinet/branding/bot-start-video")).data,deleteLogo:async()=>{const e=await b.delete("/cabinet/branding/logo");return Ae&&(URL.revokeObjectURL(Ae),Ae=null),ee.removeItem(Pt),e.data},getLogoUrl:e=>Ae,getAnimationEnabled:async()=>(await b.get("/cabinet/branding/animation")).data,updateAnimationEnabled:async e=>(await b.patch("/cabinet/branding/animation",{enabled:e})).data,getAnimationConfig:async()=>{try{return(await b.get("/cabinet/branding/animation-config")).data}catch{return tn}},updateAnimationConfig:async e=>(await b.patch("/cabinet/branding/animation-config",e)).data,getFullscreenEnabled:async()=>{try{return(await b.get("/cabinet/branding/fullscreen")).data}catch{return{enabled:!1}}},updateFullscreenEnabled:async e=>(await b.patch("/cabinet/branding/fullscreen",{enabled:e})).data,getFooterEnabled:async()=>{try{return(await b.get("/cabinet/branding/footer-enabled")).data.enabled}catch{return!1}},updateFooterEnabled:async e=>(await b.patch("/cabinet/branding/footer-enabled",{enabled:e})).data.enabled,getEmailAuthEnabled:async()=>{try{return(await b.get("/cabinet/branding/email-auth")).data}catch{return{enabled:!0}}},updateEmailAuthEnabled:async e=>(await b.patch("/cabinet/branding/email-auth",{enabled:e})).data,getGiftEnabled:async()=>{try{return(await b.get("/cabinet/branding/gift-enabled")).data}catch{return{enabled:!1}}},updateGiftEnabled:async e=>(await b.patch("/cabinet/branding/gift-enabled",{enabled:e})).data,getAnalyticsCounters:async()=>{try{return(await b.get("/cabinet/branding/analytics")).data}catch{return{yandex_metrika_id:"",google_ads_id:"",google_ads_label:"",offline_conv_enabled:!1,offline_conv_counter_id:"",offline_conv_goals:[]}}},getTelegramWidgetConfig:async()=>{try{return(await b.get("/cabinet/branding/telegram-widget")).data}catch(e){return{bot_username:"",size:"large",radius:8,userpic:!0,request_access:!0,oidc_enabled:!1,oidc_client_id:"",endpoint_missing:ai(e)}}},updateAnalyticsCounters:async e=>(await b.patch("/cabinet/branding/analytics",e)).data,storeYandexCid:async e=>{await b.post("/cabinet/branding/analytics/yandex-cid",{cid:e})}};function is(e){if(!e)return;let a=document.querySelector("link[rel*='icon']");a||(a=document.createElement("link"),a.rel="icon",document.head.appendChild(a)),a.href=e}function ru(e){const n=`${(e||"V").trim().charAt(0).toUpperCase()||"V"}`;return`data:image/svg+xml,${encodeURIComponent(n)}`}async function iu(e,a=64,n=.3){if(!e)return null;try{const s=await ou(e),r=document.createElement("canvas");r.width=a,r.height=a;const o=r.getContext("2d");if(!o)return null;cu(o,a,a*n),o.clip();const d=Math.max(a/s.width,a/s.height),p=s.width*d,i=s.height*d;return o.drawImage(s,(a-p)/2,(a-i)/2,p,i),r.toDataURL("image/png")}catch{return null}}function ou(e){return new Promise((a,n)=>{const s=new Image;s.onload=()=>a(s),s.onerror=n,s.src=e})}function cu(e,a,n){const s=Math.min(n,a/2);e.beginPath(),e.moveTo(s,0),e.arcTo(a,0,a,a,s),e.arcTo(a,a,0,a,s),e.arcTo(0,a,0,0,s),e.arcTo(0,0,a,0,s),e.closePath()}const lu="Cabinet",du="V";function uu(){const e=J(m=>m.isAuthenticated),{isTelegramWebApp:a,requestFullscreen:n,isMobile:s}=Vt(),{data:r}=W({queryKey:["branding"],queryFn:async()=>{const m=await be.getBranding();return kn(m),await wa(m),m},initialData:$t()??void 0,initialDataUpdatedAt:0,staleTime:6e4,enabled:e}),o=r?r.name:lu,d=r?.logo_letter||du,p=r?.has_custom_logo||!1,i=r?be.getLogoUrl(r):null;l.useEffect(()=>{document.title=o||"VPN"},[o]),l.useEffect(()=>{if(!i){is(ru(d));return}let m=!1;return iu(i).then(h=>{m||is(h||i)}),()=>{m=!0}},[i,d]);const{data:c}=W({queryKey:["fullscreen-enabled"],queryFn:be.getFullscreenEnabled,staleTime:6e4}),u=l.useRef(!1);return l.useEffect(()=>{!c||!a||(Ac(c.enabled),c.enabled&&s&&!u.current&&(u.current=!0,n()))},[c,a,n,s]),{appName:o,logoLetter:d,hasCustomLogo:p,logoUrl:i,isLogoPreloaded:Mt}}const ni={getReferralInfo:async()=>(await b.get("/cabinet/referral")).data,getReferralList:async e=>(await b.get("/cabinet/referral/list",{params:e})).data,getReferralEarnings:async e=>(await b.get("/cabinet/referral/earnings",{params:e})).data,updateRewardChoice:async e=>(await b.patch("/cabinet/referral/reward-choice",e)).data,getReferralTerms:async()=>(await b.get("/cabinet/referral/terms")).data},si={getConfig:async()=>(await b.get("/cabinet/wheel/config")).data,checkAvailability:async()=>(await b.get("/cabinet/wheel/availability")).data,spin:async(e,a)=>(await b.post("/cabinet/wheel/spin",{payment_type:e,...a!=null&&{subscription_id:a}})).data,getHistory:async(e=1,a=20)=>(await b.get("/cabinet/wheel/history",{params:{page:e,per_page:a}})).data,createStarsInvoice:async()=>(await b.post("/cabinet/wheel/stars-invoice")).data},ag={getConfig:async()=>(await b.get("/cabinet/admin/wheel/config")).data,updateConfig:async e=>(await b.put("/cabinet/admin/wheel/config",e)).data,getPrizes:async()=>(await b.get("/cabinet/admin/wheel/prizes")).data,createPrize:async e=>(await b.post("/cabinet/admin/wheel/prizes",e)).data,updatePrize:async(e,a)=>(await b.put(`/cabinet/admin/wheel/prizes/${e}`,a)).data,deletePrize:async e=>{await b.delete(`/cabinet/admin/wheel/prizes/${e}`)},reorderPrizes:async e=>{await b.post("/cabinet/admin/wheel/prizes/reorder",{prize_ids:e})},getStatistics:async(e,a)=>(await b.get("/cabinet/admin/wheel/statistics",{params:{date_from:e,date_to:a}})).data,getSpins:async e=>(await b.get("/cabinet/admin/wheel/spins",{params:e})).data},mu={getCount:async()=>(await b.get("/cabinet/contests/count")).data,getContests:async()=>(await b.get("/cabinet/contests")).data,getContestGame:async e=>(await b.get(`/cabinet/contests/${e}`)).data,submitAnswer:async(e,a)=>(await b.post(`/cabinet/contests/${e}/answer`,{round_id:e,answer:a})).data},pu={getCount:async()=>(await b.get("/cabinet/polls/count")).data,getPolls:async()=>(await b.get("/cabinet/polls")).data,getPollDetails:async e=>(await b.get(`/cabinet/polls/${e}`)).data,startPoll:async e=>(await b.post(`/cabinet/polls/${e}/start`)).data,answerQuestion:async(e,a,n)=>(await b.post(`/cabinet/polls/${e}/questions/${a}/answer`,{option_id:n})).data},ri="cabinet-feature-flags";function hu(){try{return JSON.parse(localStorage.getItem(ri)||"{}")}catch{return{}}}function fu(){const e=J(i=>i.isAuthenticated),a=hu(),{data:n}=W({queryKey:["referral-terms"],queryFn:ni.getReferralTerms,enabled:e,staleTime:6e4,retry:!1}),{data:s}=W({queryKey:["wheel-config"],queryFn:si.getConfig,enabled:e,staleTime:6e4,retry:!1}),{data:r}=W({queryKey:["contests-count"],queryFn:mu.getCount,enabled:e,staleTime:6e4,retry:!1}),{data:o}=W({queryKey:["polls-count"],queryFn:pu.getCount,enabled:e,staleTime:6e4,retry:!1}),{data:d}=W({queryKey:["gift-enabled"],queryFn:be.getGiftEnabled,enabled:e,staleTime:6e4,retry:!1}),p={referralEnabled:n?n.is_enabled:a.referralEnabled,wheelEnabled:s?s.is_enabled:a.wheelEnabled,hasContests:r?r.count>0:a.hasContests,hasPolls:o?o.count>0:a.hasPolls,giftEnabled:d?d.enabled:a.giftEnabled};return l.useEffect(()=>{if(!(!n&&!s&&!r&&!o&&!d))try{localStorage.setItem(ri,JSON.stringify(p))}catch{}},[p.referralEnabled,p.wheelEnabled,p.hasContests,p.hasPolls,p.giftEnabled]),p}function gu(){const e=He(),a=l.useRef({});l.useEffect(()=>{"scrollRestoration"in history&&(history.scrollRestoration="manual")},[]),l.useEffect(()=>{const n=e.pathname;if(!n.startsWith("/admin"))return;const s=()=>{a.current[n]=window.scrollY};window.addEventListener("scroll",s,{passive:!0});const r=a.current[n];return r!==void 0&&r>0&&window.scrollTo({top:r,behavior:"instant"}),()=>{window.removeEventListener("scroll",s)}},[e.pathname])}const ii=l.createContext(null);function xu(){const e=l.useContext(ii);if(!e)throw new Error("useWebSocketContext must be used within a WebSocketProvider");return e}function oi(e={}){const{isConnected:a,subscribe:n}=xu(),s=l.useRef(e),r=l.useRef(!1);return l.useEffect(()=>{s.current=e},[e]),l.useEffect(()=>{a&&!r.current?(r.current=!0,s.current.onConnect?.()):!a&&r.current&&(r.current=!1,s.current.onDisconnect?.())},[a]),l.useEffect(()=>s.current.onMessage?n(p=>{s.current.onMessage?.(p)}):void 0,[n]),{isConnected:a}}const bu=3600*1e3,De={USD:100,CNY:14,IRR:.0024};let _t=null;const At={getExchangeRates:async()=>{if(_t&&Date.now()-_t.timestamp{const s=n[a];return!s||s<=0?e/De[a]:e/s},convertToRub:(e,a,n)=>{const s=n[a];return!s||s<=0?e*De[a]:e*s}},yu={ru:"ru-RU",en:"en-US",zh:"zh-CN",fa:"fa-IR"};function Ut(){const e=(Le.language||"").split("-")[0];return yu[e]||"ru-RU"}const vu=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function wu(e){const a=Math.floor(e/86400),n=Math.floor(e%86400/3600),s=Math.floor(e%3600/60);return a>0?`${a}d ${n}h`:n>0?`${n}h ${s}m`:`${s}m`}const ku={ru:{currency:"RUB",locale:"ru-RU",symbol:"₽"},en:{currency:"USD",locale:"en-US",symbol:"$",key:"USD"},zh:{currency:"CNY",locale:"zh-CN",symbol:"¥",key:"CNY"},fa:{currency:"IRR",locale:"fa-IR",symbol:"﷼",key:"IRR"}},ju={currency:"RUB",locale:"ru-RU",symbol:"₽"};let an=null;function ci(e){an=e}function _u(e,a){const n=a||Le.language||"ru",s=ku[n]||ju;let r=e/100;s.key&&an&&(r=At.convertFromRub(r,s.key,an));const o=s.currency==="IRR"?0:2;try{return new Intl.NumberFormat(s.locale,{style:"currency",currency:s.currency,maximumFractionDigits:o}).format(r)}catch{return`${o===0?Math.round(r):Math.round(r*100)/100} ${s.symbol}`}}function Nu(e){return e?new Date(e).toLocaleDateString(Ut(),{day:"2-digit",month:"2-digit",year:"numeric"}):"-"}const ng=Object.freeze(Object.defineProperty({__proto__:null,USER_TIMEZONE:vu,formatPrice:_u,formatShortDate:Nu,formatUptime:wu,setExchangeRates:ci},Symbol.toStringTag,{value:"Module"})),Cu={ru:"RUB",en:"USD",zh:"CNY",fa:"IRR"},Au={USD:100,CNY:14,IRR:.0024};function Kt(){const{i18n:e,t:a}=U(),{data:n=Au}=W({queryKey:["exchange-rates"],queryFn:At.getExchangeRates,staleTime:3600*1e3,refetchOnWindowFocus:!1,retry:2});l.useEffect(()=>{ci(n)},[n]);const s=e.language,r=Cu[s]||"USD",o=s==="ru",d=a("common.currency"),p=l.useCallback((h,f=2)=>{if(o)return h.toFixed(f);const g=At.convertFromRub(h,r,n);return r==="IRR"?Math.round(g).toLocaleString("fa-IR"):g.toFixed(f)},[o,r,n]),i=l.useCallback((h,f=2)=>`${p(h,f)} ${d}`,[p,d]),c=l.useCallback((h,f=2)=>`+${p(h,f)} ${d}`,[p,d]),u=l.useCallback(h=>o?h:At.convertFromRub(h,r,n),[o,r,n]),m=l.useCallback(h=>o?h:At.convertToRub(h,r,n),[o,r,n]);return l.useMemo(()=>({exchangeRates:n,targetCurrency:r,isRussian:o,currencySymbol:d,formatAmount:p,formatWithCurrency:i,formatPositive:c,convertAmount:u,convertToRub:m}),[n,r,o,d,p,i,c,u,m])}const St=bt(e=>({isOpen:!1,data:null,closeOthersSignal:0,show:a=>e(n=>({isOpen:!0,data:a,closeOthersSignal:n.closeOthersSignal+1})),hide:()=>e({isOpen:!1,data:null})}));function sg(e){const a=St(r=>r.closeOthersSignal),n=l.useRef(e);n.current=e;const s=l.useRef(a);l.useEffect(()=>{a!==s.current&&n.current()},[a])}function Eu(){const{t:e}=U(),a=ye(),n=Ye(),{showToast:s}=wn(),r=J(c=>c.refreshUser),{formatAmount:o,currencySymbol:d}=Kt(),p=St(c=>c.show),i=l.useCallback(c=>{const{type:u}=c;if(!u.startsWith("ticket.")){if(u==="balance.topup"){p({type:"balance_topup",amountKopeks:c.amount_kopeks,newBalanceKopeks:c.new_balance_kopeks}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),n.invalidateQueries({queryKey:["transactions"]}),r();return}if(u==="balance.change"){const m=c.amount_rubles??(c.amount_kopeks??0)/100,h=m>=0;s({type:h?"success":"info",title:e("wsNotifications.balance.changeTitle","Balance updated"),message:c.description||e("wsNotifications.balance.changeMessage","Your balance has changed by {{amount}} {{currency}}",{amount:(h?"+":"")+o(m),currency:d}),icon:t.jsx("span",{className:"text-lg",children:h?"💵":"💸"}),onClick:()=>a("/balance"),duration:5e3}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),n.invalidateQueries({queryKey:["transactions"]}),r();return}if(u==="subscription.activated"){p({type:"subscription_activated",expiresAt:c.expires_at,tariffName:c.tariff_name}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({queryKey:["subscriptions-list"]}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),r();return}if(u==="subscription.renewed"){p({type:"subscription_renewed",amountKopeks:c.amount_kopeks,expiresAt:c.new_expires_at}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({queryKey:["subscriptions-list"]}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),r();return}if(u==="subscription.expiring"){s({type:"warning",title:e("wsNotifications.subscription.expiringTitle","Subscription expiring soon"),message:e("wsNotifications.subscription.expiringMessage","Your subscription expires in {{days}} days",{days:c.days_left??0}),icon:t.jsx("span",{className:"text-lg",children:"⏰"}),onClick:()=>a("/subscriptions"),duration:1e4});return}if(u==="subscription.expired"){s({type:"error",title:e("wsNotifications.subscription.expiredTitle","Subscription expired"),message:e("wsNotifications.subscription.expiredMessage","Your subscription has expired. Renew to continue using the service."),icon:t.jsx("span",{className:"text-lg",children:"😢"}),onClick:()=>a("/subscriptions"),duration:1e4}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({queryKey:["subscriptions-list"]}),r();return}if(u==="subscription.daily_debit"){const m=c.amount_rubles??(c.amount_kopeks??0)/100;s({type:"info",title:e("wsNotifications.subscription.dailyDebitTitle","Daily charge"),message:e("wsNotifications.subscription.dailyDebitMessage","Daily subscription fee: {{amount}} {{currency}}",{amount:o(m),currency:d}),icon:t.jsx("span",{className:"text-lg",children:"📅"}),duration:5e3}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),r();return}if(u==="subscription.traffic_reset"){s({type:"info",title:e("wsNotifications.subscription.trafficResetTitle","Traffic reset"),message:e("wsNotifications.subscription.trafficResetMessage","Your traffic limit has been reset"),icon:t.jsx("span",{className:"text-lg",children:"🔄"}),duration:5e3}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({queryKey:["subscriptions-list"]});return}if(u==="subscription.devices_purchased"){p({type:"devices_purchased",amountKopeks:c.amount_kopeks,devicesAdded:c.devices_added,newDeviceLimit:c.new_device_limit}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({queryKey:["subscriptions-list"]}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),n.invalidateQueries({queryKey:["transactions"]}),r();return}if(u==="subscription.traffic_purchased"){p({type:"traffic_purchased",amountKopeks:c.amount_kopeks,trafficGbAdded:c.traffic_gb_added,newTrafficLimitGb:c.new_traffic_limit_gb}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({queryKey:["subscriptions-list"]}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),n.invalidateQueries({queryKey:["transactions"]}),r();return}if(u==="autopay.success"){const m=c.amount_rubles??(c.amount_kopeks??0)/100;s({type:"success",title:e("wsNotifications.autopay.successTitle","Auto-renewal successful"),message:e("wsNotifications.autopay.successMessage","Your subscription was auto-renewed for {{amount}} {{currency}}",{amount:o(m),currency:d}),icon:t.jsx("span",{className:"text-lg",children:"🔁"}),onClick:()=>a("/subscriptions"),duration:8e3}),n.invalidateQueries({predicate:h=>Array.isArray(h.queryKey)&&h.queryKey[0]==="subscription"}),n.invalidateQueries({queryKey:["subscriptions-list"]}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),r();return}if(u==="autopay.failed"){s({type:"error",title:e("wsNotifications.autopay.failedTitle","Auto-renewal failed"),message:c.reason||e("wsNotifications.autopay.failedMessage","Failed to auto-renew your subscription"),icon:t.jsx("span",{className:"text-lg",children:"❌"}),onClick:()=>a("/subscriptions"),duration:1e4});return}if(u==="autopay.insufficient_funds"){const m=c.required_rubles??(c.required_kopeks??0)/100,h=c.balance_rubles??(c.balance_kopeks??0)/100;s({type:"warning",title:e("wsNotifications.autopay.insufficientTitle","Insufficient funds"),message:e("wsNotifications.autopay.insufficientMessage","Need {{required}} {{currency}} for renewal, but balance is {{balance}} {{currency}}",{required:o(m),balance:o(h),currency:d}),icon:t.jsx("span",{className:"text-lg",children:"💳"}),onClick:()=>a("/balance"),duration:1e4});return}if(u==="sbp_recurring.confirmed"){const m=c.amount_rubles??(c.amount_kopeks??0)/100;s({type:"success",title:e("wsNotifications.sbpRecurring.confirmedTitle","SBP payment confirmed"),message:e("wsNotifications.sbpRecurring.confirmedMessage","Payment of {{amount}} {{currency}} was charged successfully",{amount:o(m),currency:d}),icon:t.jsx("span",{className:"text-lg",children:"🔁"}),onClick:()=>a("/subscriptions"),duration:8e3}),n.invalidateQueries({predicate:h=>Array.isArray(h.queryKey)&&h.queryKey[0]==="subscription"}),n.invalidateQueries({predicate:h=>Array.isArray(h.queryKey)&&h.queryKey[0]==="sbp-recurring"}),n.invalidateQueries({queryKey:["subscriptions-list"]}),r();return}if(u==="sbp_recurring.activated"){s({type:"success",title:e("wsNotifications.sbpRecurring.activatedTitle","SBP auto-payment connected"),message:e("wsNotifications.sbpRecurring.activatedMessage","SBP auto-payment has been successfully connected"),icon:t.jsx("span",{className:"text-lg",children:"🔁"}),onClick:()=>a("/subscriptions"),duration:8e3}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="sbp-recurring"}),n.invalidateQueries({queryKey:["subscriptions-list"]}),r();return}if(u==="sbp_recurring.failed"){s({type:"error",title:e("wsNotifications.sbpRecurring.failedTitle","SBP payment failed"),message:e("wsNotifications.sbpRecurring.failedMessage","Failed to charge your SBP auto-payment"),icon:t.jsx("span",{className:"text-lg",children:"❌"}),onClick:()=>a("/subscriptions"),duration:1e4}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="sbp-recurring"});return}if(u==="sbp_recurring.past_due"){s({type:"warning",title:e("wsNotifications.sbpRecurring.pastDueTitle","SBP payment overdue"),message:e("wsNotifications.sbpRecurring.pastDueMessage","Your SBP auto-payment is overdue. Please check your banking app."),icon:t.jsx("span",{className:"text-lg",children:"⚠️"}),onClick:()=>a("/subscriptions"),duration:1e4}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="sbp-recurring"});return}if(u==="sbp_recurring.cancelled"){s({type:"warning",title:e("wsNotifications.sbpRecurring.cancelledTitle","SBP auto-payment disabled"),message:e("wsNotifications.sbpRecurring.cancelledMessage","SBP auto-payment has been disabled"),icon:t.jsx("span",{className:"text-lg",children:"🔕"}),onClick:()=>a("/subscriptions"),duration:8e3}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="subscription"}),n.invalidateQueries({predicate:m=>Array.isArray(m.queryKey)&&m.queryKey[0]==="sbp-recurring"});return}if(u==="account.banned"){s({type:"error",title:e("wsNotifications.account.bannedTitle","Account blocked"),message:c.reason||e("wsNotifications.account.bannedMessage","Your account has been blocked"),icon:t.jsx("span",{className:"text-lg",children:"🚫"}),duration:15e3}),r();return}if(u==="account.unbanned"){s({type:"success",title:e("wsNotifications.account.unbannedTitle","Account unblocked"),message:e("wsNotifications.account.unbannedMessage","Your account has been unblocked"),icon:t.jsx("span",{className:"text-lg",children:"✅"}),duration:8e3}),r();return}if(u==="account.warning"){s({type:"warning",title:e("wsNotifications.account.warningTitle","Warning"),message:c.message||e("wsNotifications.account.warningMessage","You have received a warning"),icon:t.jsx("span",{className:"text-lg",children:"⚠️"}),duration:1e4});return}if(u==="referral.bonus"){const m=c.bonus_rubles??(c.bonus_kopeks??0)/100;s({type:"success",title:e("wsNotifications.referral.bonusTitle","Referral bonus"),message:c.referral_name?e("wsNotifications.referral.bonusWithName","You received {{amount}} {{currency}} bonus from {{name}}!",{amount:o(m),currency:d,name:c.referral_name}):e("wsNotifications.referral.bonusMessage","You received {{amount}} {{currency}} referral bonus!",{amount:o(m),currency:d}),icon:t.jsx("span",{className:"text-lg",children:"🎁"}),onClick:()=>a("/referral"),duration:8e3}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),n.invalidateQueries({queryKey:["referral-stats"]}),r();return}if(u==="referral.registered"){s({type:"success",title:e("wsNotifications.referral.registeredTitle","New referral"),message:c.referral_name?e("wsNotifications.referral.registeredWithName","{{name}} joined using your referral link!",{name:c.referral_name}):e("wsNotifications.referral.registeredMessage","Someone joined using your referral link!"),icon:t.jsx("span",{className:"text-lg",children:"👤"}),onClick:()=>a("/referral"),duration:6e3}),n.invalidateQueries({queryKey:["referral-stats"]});return}if(u==="payment.received"){const m=c.amount_rubles??(c.amount_kopeks??0)/100;s({type:"success",title:e("wsNotifications.payment.receivedTitle","Payment received"),message:e("wsNotifications.payment.receivedMessage","Payment of {{amount}} {{currency}} received",{amount:o(m),currency:d}),icon:t.jsx("span",{className:"text-lg",children:"💳"}),onClick:()=>a("/balance"),duration:6e3}),n.invalidateQueries({queryKey:["balance"]}),n.invalidateQueries({queryKey:["purchase-options"]}),n.invalidateQueries({queryKey:["transactions"]}),r();return}}},[e,s,p,a,n,r,o,d]);return oi({onMessage:i}),null}function Tu(){const{t:e}=U(),{showToast:a}=wn(),n=J(r=>r.pendingCampaignBonus),s=J(r=>r.clearCampaignBonus);return l.useEffect(()=>{if(!n)return;let r=null;n.bonus_type==="balance"&&n.balance_kopeks>0?r=e("campaignBonus.balance",{amount:(n.balance_kopeks/100).toFixed(0),name:n.campaign_name}):n.bonus_type==="subscription"&&n.subscription_days?r=e("campaignBonus.subscription",{days:n.subscription_days,name:n.campaign_name}):n.bonus_type==="tariff"&&n.tariff_name&&(r=e("campaignBonus.tariff",{tariff:n.tariff_name,name:n.campaign_name})),r&&a({type:"success",title:e("campaignBonus.title"),message:r,duration:8e3}),s()},[n,s,a,e]),null}const Su=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function qe(e,a={}){const{lockScroll:n=!0}=a,s=l.useRef(null),r=l.useRef(a.onEscape);return r.current=a.onEscape,l.useEffect(()=>{if(!e)return;const o=s.current;if(!o)return;const d=document.activeElement,p=()=>Array.from(o.querySelectorAll(Su)).filter(m=>m.getClientRects().length>0);(p()[0]??o).focus();const c=m=>{if(m.key==="Escape"&&r.current){m.preventDefault(),r.current();return}if(m.key!=="Tab")return;const h=p();if(h.length===0){m.preventDefault(),o.focus();return}const f=h[0],g=h[h.length-1],y=document.activeElement;m.shiftKey?(y===f||!o.contains(y))&&(m.preventDefault(),g.focus()):(y===g||!o.contains(y))&&(m.preventDefault(),f.focus())};document.addEventListener("keydown",c);let u;return n&&(u=document.body.style.overflow,document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",c),n&&(document.body.style.overflow=u??""),d?.focus?.()}},[e,n]),s}function Lu(){const{t:e}=U(),a=ye(),n=St($=>$.isOpen),s=St($=>$.data),r=St($=>$.hide),{formatAmount:o,currencySymbol:d}=Kt(),{safeAreaInset:p,contentSafeAreaInset:i,isTelegramWebApp:c}=Vt(),u=yt(),m=c?Math.max(p.bottom,i.bottom):0,h=l.useCallback(()=>{r()},[r]),f=qe(n,{lockScroll:!1});if(l.useEffect(()=>{if(!n)return;const $=X=>{X.key==="Escape"&&(X.preventDefault(),h())};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[n,h]),l.useEffect(()=>{n&&u.notification("success")},[n,u]),l.useEffect(()=>{if(n)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[n]),!n||!s)return null;const g=s.type==="balance_topup",y=s.type==="subscription_activated"||s.type==="subscription_renewed"||s.type==="subscription_purchased",w=s.type==="devices_purchased",A=s.type==="traffic_purchased",T=s.amountKopeks?`${o(s.amountKopeks/100)} ${d}`:null,N=s.newBalanceKopeks!==void 0?`${o(s.newBalanceKopeks/100)} ${d}`:null,v=s.expiresAt?new Date(s.expiresAt).toLocaleDateString(Ut(),{day:"numeric",month:"long",year:"numeric"}):null;let S=s.title;const L=s.message;let V=t.jsx(Hd,{className:"h-16 w-16"}),O="from-success-500 to-success-600";S||(g?(S=e("successNotification.balanceTopup.title","Balance topped up!"),V=t.jsx(ca,{className:"h-8 w-8"}),O="from-success-500 to-success-600"):s.type==="subscription_activated"?(S=e("successNotification.subscriptionActivated.title","Subscription activated!"),V=t.jsx(Gt,{className:"h-8 w-8"}),O="from-accent-500 to-purple-600"):s.type==="subscription_renewed"?(S=e("successNotification.subscriptionRenewed.title","Subscription renewed!"),V=t.jsx(Gt,{className:"h-8 w-8"}),O="from-accent-500 to-purple-600"):s.type==="subscription_purchased"?(S=e("successNotification.subscriptionPurchased.title","Subscription purchased!"),V=t.jsx(Gt,{className:"h-8 w-8"}),O="from-accent-500 to-purple-600"):s.type==="devices_purchased"?(S=e("successNotification.devicesPurchased.title","Devices added!"),V=t.jsx(Rt,{className:"h-8 w-8"}),O="from-blue-500 to-cyan-600"):s.type==="traffic_purchased"&&(S=e("successNotification.trafficPurchased.title","Traffic added!"),V=t.jsx(ns,{className:"h-8 w-8"}),O="from-success-500 to-success-600"));const I=()=>{r(),a("/subscriptions")},M=()=>{r(),a("/balance")},P=t.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",children:[t.jsx("div",{className:"absolute inset-0 bg-dark-950/80 backdrop-blur-sm",onClick:h}),t.jsxs("div",{ref:f,role:"dialog","aria-modal":"true","aria-labelledby":"success-modal-title",tabIndex:-1,className:"relative mx-4 w-full max-w-sm overflow-hidden rounded-3xl border border-dark-700/50 bg-dark-900 shadow-2xl",style:{marginBottom:m?`${m}px`:void 0},onClick:$=>$.stopPropagation(),children:[t.jsx("button",{onClick:h,"aria-label":e("common.close"),className:"absolute right-3 top-3 z-10 rounded-xl p-2 text-dark-400 transition-colors hover:bg-dark-800 hover:text-dark-200",children:t.jsx(Ot,{})}),t.jsxs("div",{className:`flex flex-col items-center bg-gradient-to-br ${O} px-6 pb-8 pt-10`,children:[t.jsx("div",{className:"mb-4 animate-pulse text-white",children:V}),t.jsx("h2",{id:"success-modal-title",className:"text-center text-2xl font-bold text-white",children:S}),L&&t.jsx("p",{className:"mt-2 text-center text-white/80",children:L})]}),t.jsxs("div",{className:"space-y-4 p-6",children:[T&&t.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-dark-800/50 px-4 py-3",children:[t.jsx("span",{className:"text-dark-400",children:g?e("successNotification.amount","Amount"):e("successNotification.price","Price")}),t.jsxs("span",{className:`text-lg font-bold ${w||A?"text-dark-100":"text-success-400"}`,children:[w||A?"":"+",T]})]}),w&&s.devicesAdded&&t.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-dark-800/50 px-4 py-3",children:[t.jsx("span",{className:"text-dark-400",children:e("successNotification.devicesAdded","Devices added")}),t.jsxs("span",{className:"text-lg font-bold text-blue-400",children:["+",s.devicesAdded]})]}),w&&s.newDeviceLimit&&t.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-dark-800/50 px-4 py-3",children:[t.jsx("span",{className:"text-dark-400",children:e("successNotification.totalDevices","Total devices")}),t.jsx("span",{className:"font-semibold text-dark-100",children:s.newDeviceLimit})]}),A&&s.trafficGbAdded&&t.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-dark-800/50 px-4 py-3",children:[t.jsx("span",{className:"text-dark-400",children:e("successNotification.trafficAdded","Traffic added")}),t.jsxs("span",{className:"text-lg font-bold text-success-400",children:["+",s.trafficGbAdded," GB"]})]}),A&&s.newTrafficLimitGb&&t.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-dark-800/50 px-4 py-3",children:[t.jsx("span",{className:"text-dark-400",children:e("successNotification.totalTraffic","Total traffic")}),t.jsxs("span",{className:"font-semibold text-dark-100",children:[s.newTrafficLimitGb," GB"]})]}),g&&N&&t.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-dark-800/50 px-4 py-3",children:[t.jsx("span",{className:"text-dark-400",children:e("successNotification.newBalance","New balance")}),t.jsx("span",{className:"text-lg font-bold text-dark-100",children:N})]}),s.tariffName&&t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl bg-dark-800/50 px-4 py-3",children:[t.jsx("span",{className:"shrink-0 text-dark-400",children:e("successNotification.tariff","Tariff")}),t.jsx("span",{className:"min-w-0 truncate font-semibold text-dark-100",children:s.tariffName})]}),v&&t.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-dark-800/50 px-4 py-3",children:[t.jsx("span",{className:"text-dark-400",children:e("successNotification.validUntil","Valid until")}),t.jsx("span",{className:"font-semibold text-dark-100",children:v})]}),t.jsxs("div",{className:"space-y-2 pt-2",children:[y&&t.jsxs("button",{onClick:I,className:"flex w-full items-center justify-center gap-2 rounded-xl bg-accent-500 py-3.5 font-bold text-on-accent shadow-lg shadow-accent-500/25 transition-colors hover:bg-accent-400 active:bg-accent-600",children:[t.jsx(Gt,{className:"h-8 w-8"}),t.jsx("span",{children:e("successNotification.goToSubscription","Go to Subscription")})]}),g&&t.jsxs("button",{onClick:M,className:"flex w-full items-center justify-center gap-2 rounded-xl bg-success-500 py-3.5 font-bold text-white shadow-lg shadow-success-500/25 transition-colors hover:bg-success-400 active:bg-success-600",children:[t.jsx(ca,{className:"h-8 w-8"}),t.jsx("span",{children:e("successNotification.goToBalance","Go to Balance")})]}),w&&t.jsxs("button",{onClick:I,className:"flex w-full items-center justify-center gap-2 rounded-xl bg-accent-500 py-3.5 font-bold text-on-accent shadow-lg shadow-accent-500/25 transition-colors hover:bg-accent-400 active:bg-accent-600",children:[t.jsx(Rt,{className:"h-8 w-8"}),t.jsx("span",{children:e("successNotification.goToSubscription","Go to Subscription")})]}),A&&t.jsxs("button",{onClick:I,className:"flex w-full items-center justify-center gap-2 rounded-xl bg-success-500 py-3.5 font-bold text-white shadow-lg shadow-success-500/25 transition-colors hover:bg-success-400 active:bg-success-600",children:[t.jsx(ns,{className:"h-8 w-8"}),t.jsx("span",{children:e("successNotification.goToSubscription","Go to Subscription")})]}),t.jsx("button",{onClick:h,className:"w-full rounded-xl bg-dark-800 py-3 font-semibold text-dark-300 transition-colors hover:bg-dark-700 hover:text-dark-100",children:e("common.close","Close")})]})]})]})]});return typeof document<"u"?gt.createPortal(P,document.body):P}const ta=bt((e,a)=>({request:null,prompt:n=>new Promise(s=>{const r=a().request;r&&r.resolve(null),e({request:{...n,resolve:s}})}),submit:n=>{const s=a().request;s&&(s.resolve(n),e({request:null}))},cancel:()=>{const n=a().request;n&&(n.resolve(null),e({request:null}))}}));function rg(){return ta(e=>e.prompt)}function Iu(){const e=ta(c=>c.request),a=ta(c=>c.submit),n=ta(c=>c.cancel),{t:s}=U(),[r,o]=l.useState(""),p=qe(e!==null,{onEscape:n});if(l.useEffect(()=>{e&&o(e.initialValue??"")},[e]),!e)return null;const i=c=>{c.preventDefault();const u=r.trim();if(!u){n();return}a(u)};return gt.createPortal(t.jsxs("div",{className:"fixed inset-0 z-[120] flex items-center justify-center p-4",children:[t.jsx("div",{className:"absolute inset-0 bg-dark-950/60",onClick:n,"aria-hidden":"true"}),t.jsxs("form",{ref:p,role:"dialog","aria-modal":"true","aria-label":e.title??e.label,onSubmit:i,className:"card relative w-full max-w-sm space-y-4",children:[e.title&&t.jsx("h2",{className:"text-lg font-semibold text-dark-50",children:e.title}),t.jsxs("label",{className:"block",children:[t.jsx("span",{className:"label",children:e.label}),t.jsx("input",{type:e.inputType??"text",value:r,onChange:c=>o(c.target.value),placeholder:e.placeholder,className:"input"})]}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",onClick:n,className:"btn-secondary",children:e.cancelLabel??s("common.cancel")}),t.jsx("button",{type:"submit",className:"btn-primary",children:e.submitLabel??s("common.ok","OK")})]})]})]}),document.body)}const Lt={getFaqPages:async()=>(await b.get("/cabinet/info/faq")).data,getFaqPage:async e=>(await b.get(`/cabinet/info/faq/${e}`)).data,getRules:async()=>(await b.get("/cabinet/info/rules")).data,getPrivacyPolicy:async()=>(await b.get("/cabinet/info/privacy-policy")).data,getPublicOffer:async()=>(await b.get("/cabinet/info/public-offer")).data,getRecurrentPayments:async()=>(await b.get("/cabinet/info/recurrent-payments")).data,getServiceInfo:async()=>(await b.get("/cabinet/info/service")).data,getLanguages:async()=>(await b.get("/cabinet/info/languages")).data,getUserLanguage:async()=>(await b.get("/cabinet/info/user/language")).data,updateUserLanguage:async e=>(await b.patch("/cabinet/info/user/language",{language:e})).data,getSupportConfig:async()=>(await b.get("/cabinet/info/support-config")).data,getVisibility:async()=>(await b.get("/cabinet/info/visibility")).data,getLegalConsentConfig:async e=>(await b.get("/cabinet/info/legal-consent",{params:e?{language:e}:void 0})).data};function rt(){const{i18n:e}=U(),[a,n]=l.useState(!1),s=l.useRef(null),{data:r}=W({queryKey:["languages"],queryFn:Lt.getLanguages,staleTime:1e3*60*5}),o=r?.languages??[],d=o.find(i=>i.code===e.language)||o[0]||{code:"ru",flag:"🇷🇺"};l.useEffect(()=>{function i(c){s.current&&!s.current.contains(c.target)&&n(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]);const p=i=>{e.changeLanguage(i),n(!1)};return o.length<=1?null:t.jsxs("div",{className:"relative",ref:s,children:[t.jsxs("button",{onClick:()=>n(!a),className:`flex items-center gap-1.5 rounded-xl border px-2.5 py-2 text-sm transition-all ${a?"border-dark-600 bg-dark-700":"border-dark-700/50 bg-dark-800/50 hover:border-dark-600 hover:bg-dark-700"}`,"aria-label":"Change language",children:[t.jsx("span",{children:d.flag}),t.jsx("span",{className:"font-medium text-dark-200",children:d.code.toUpperCase()}),t.jsx(bn,{className:`h-3.5 w-3.5 text-dark-400 transition-transform ${a?"rotate-180":""}`})]}),a&&t.jsx("div",{className:"absolute right-0 z-50 mt-2 w-40 animate-fade-in rounded-xl border border-dark-700/50 bg-dark-800 py-1 shadow-lg",children:o.map(i=>t.jsxs("button",{onClick:()=>p(i.code),className:`flex w-full items-center gap-3 px-4 py-2.5 text-sm transition-colors ${i.code===e.language?"bg-accent-500/10 text-accent-400":"text-dark-300 hover:bg-dark-700/50"}`,children:[t.jsx("span",{children:i.flag}),t.jsx("span",{children:i.name})]},i.code))})]})}const We={getNotifications:async(e=!1,a=50,n=0)=>(await b.get("/cabinet/tickets/notifications",{params:{unread_only:e,limit:a,offset:n}})).data,getUnreadCount:async()=>(await b.get("/cabinet/tickets/notifications/unread-count")).data,markAsRead:async e=>(await b.post(`/cabinet/tickets/notifications/${e}/read`)).data,markAllAsRead:async()=>(await b.post("/cabinet/tickets/notifications/read-all")).data,markTicketAsRead:async e=>(await b.post(`/cabinet/tickets/notifications/ticket/${e}/read`)).data,getAdminNotifications:async(e=!1,a=50,n=0)=>{const s={limit:a,offset:n};return e&&(s.unread_only=!0),(await b.get("/cabinet/admin/tickets/notifications",{params:s})).data},getAdminUnreadCount:async()=>(await b.get("/cabinet/admin/tickets/notifications/unread-count")).data,markAdminAsRead:async e=>(await b.post(`/cabinet/admin/tickets/notifications/${e}/read`)).data,markAllAdminAsRead:async()=>(await b.post("/cabinet/admin/tickets/notifications/read-all")).data,markAdminTicketAsRead:async e=>(await b.post(`/cabinet/admin/tickets/notifications/ticket/${e}/read`)).data},Ru={line:"bg-dark-500/40",card:"border border-dark-500/40 bg-dark-500/25"},Pu={line:"rounded-lg",card:"rounded-2xl"};function Mu({variant:e="line",circle:a=!1,animate:n=!0,className:s}={}){return x("block","h-[1em] w-full",Ru[e],a?"rounded-full":Pu[e],n&&"animate-pulse",s)}function _e({variant:e="line",circle:a=!1,animate:n=!0,count:s=1,className:r,style:o}){const d=Mu({variant:e,circle:a,animate:n,className:r});return s===1?t.jsx("span",{className:d,style:o}):t.jsx(t.Fragment,{children:Array.from({length:s},(p,i)=>t.jsx("span",{className:d,style:o},i))})}function ka({className:e,children:a}){const{t:n}=U();return t.jsx("div",{role:"status","aria-busy":"true","aria-label":n("common.loading"),className:e,children:a})}function li({isAdmin:e=!1}){const{t:a}=U(),n=ye(),s=Ye(),r=J(L=>L.isAuthenticated),{showToast:o}=wn(),[d,p]=l.useState(!1),i=l.useRef(null),{mobile:c,isMobileFullscreen:u}=Jr(),m=l.useCallback(L=>{const V=L.type==="ticket.new",O=L.type==="ticket.admin_reply",I=L.type==="ticket.user_reply",M=V?t.jsx("span",{className:"text-lg",children:"🎫"}):O?t.jsx("span",{className:"text-lg",children:"💬"}):t.jsx("span",{className:"text-lg",children:"📨"}),P=L.title||"";let $,X;V?($=a("notifications.newTicketTitle","New Ticket"),X=L.message||a("notifications.newTicket","New ticket: {{title}}",{title:P})):I?($=a("notifications.newUserReplyTitle","User Reply"),X=L.message||a("notifications.newUserReply","User replied in ticket: {{title}}",{title:P})):($=a("notifications.newReplyTitle","New Reply"),X=L.message||a("notifications.newReply","New reply in ticket: {{title}}",{title:P})),o({type:"info",title:$,message:X,icon:M,onClick:()=>{n(e?`/admin/tickets?ticket=${L.ticket_id}`:`/support?ticket=${L.ticket_id}`)},duration:8e3})},[o,n,e,a]),h=l.useCallback(L=>{const V=L.type==="ticket.new"||L.type==="ticket.user_reply",O=L.type==="ticket.admin_reply";(e&&V||!e&&O)&&(m(L),s.invalidateQueries({queryKey:e?["admin-ticket-notifications-count"]:["ticket-notifications-count"]}),s.invalidateQueries({queryKey:e?["admin-ticket-notifications"]:["ticket-notifications"]}))},[e,m,s]);oi({onMessage:h});const{data:f}=W({queryKey:e?["admin-ticket-notifications-count"]:["ticket-notifications-count"],queryFn:e?We.getAdminUnreadCount:We.getUnreadCount,enabled:r,refetchInterval:6e4,staleTime:3e4}),{data:g,isLoading:y}=W({queryKey:e?["admin-ticket-notifications"]:["ticket-notifications"],queryFn:()=>e?We.getAdminNotifications(!1,10):We.getNotifications(!1,10),enabled:r&&d,staleTime:5e3}),w=st({mutationFn:e?We.markAllAdminAsRead:We.markAllAsRead,onSuccess:()=>{s.invalidateQueries({queryKey:e?["admin-ticket-notifications"]:["ticket-notifications"]}),s.invalidateQueries({queryKey:e?["admin-ticket-notifications-count"]:["ticket-notifications-count"]})}}),A=st({mutationFn:e?We.markAdminAsRead:We.markAsRead,onSuccess:()=>{s.invalidateQueries({queryKey:e?["admin-ticket-notifications"]:["ticket-notifications"]}),s.invalidateQueries({queryKey:e?["admin-ticket-notifications-count"]:["ticket-notifications-count"]})}});l.useEffect(()=>{const L=V=>{i.current&&!i.current.contains(V.target)&&p(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);const T=L=>{L.is_read||A.mutate(L.id),p(!1),n(e?`/admin/tickets?ticket=${L.ticket_id}`:`/support?ticket=${L.ticket_id}`)},N=L=>{const V=new Date(L),I=new Date().getTime()-V.getTime(),M=Math.floor(I/6e4),P=Math.floor(M/60),$=Math.floor(P/24);return M<1?a("notifications.justNow","Just now"):M<60?a("notifications.minutesAgo","{{count}} min ago",{count:M}):P<24?a("notifications.hoursAgo","{{count}} h ago",{count:P}):a("notifications.daysAgo","{{count}} d ago",{count:$})},v=L=>{switch(L){case"new_ticket":return t.jsx("span",{className:"text-lg",children:"🎫"});case"admin_reply":return t.jsx("span",{className:"text-lg",children:"💬"});case"user_reply":return t.jsx("span",{className:"text-lg",children:"📨"});default:return t.jsx("span",{className:"text-lg",children:"🔔"})}},S=f?.unread_count||0;return t.jsxs("div",{className:"relative",ref:i,children:[t.jsxs("button",{onClick:()=>p(!d),className:`relative rounded-xl border p-2 transition-all duration-200 ${d?"border-dark-600 bg-dark-700 text-accent-400":"border-dark-700/50 bg-dark-800/50 text-dark-400 hover:bg-dark-700 hover:text-accent-400"}`,title:a("notifications.ticketNotifications","Ticket notifications"),children:[t.jsx(ts,{}),S>0&&t.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-[18px] min-w-[18px] animate-scale-in-bounce items-center justify-center rounded-full bg-error-500 px-1 text-xs font-bold text-white",children:S>99?"99+":S})]}),d&&t.jsxs("div",{className:"fixed left-4 right-4 z-50 mt-0 w-auto animate-scale-in overflow-hidden rounded-2xl border border-dark-700/50 bg-dark-900/95 shadow-2xl shadow-black/30 backdrop-blur-xl sm:absolute sm:left-auto sm:right-0 sm:top-auto sm:mt-2 sm:w-96",style:u?{top:c}:void 0,children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-dark-700/50 bg-dark-800/30 px-4 py-3",children:[t.jsx("h3",{className:"text-sm font-semibold text-dark-100",children:a("notifications.ticketNotifications","Ticket Notifications")}),S>0&&t.jsxs("button",{onClick:()=>w.mutate(),disabled:w.isPending,className:"flex items-center gap-1.5 text-xs text-accent-400 transition-colors hover:text-accent-300 disabled:opacity-50",children:[t.jsx(Pe,{}),a("notifications.markAllRead","Mark all read")]})]}),t.jsx("div",{className:"max-h-80 overflow-y-auto",children:y?t.jsx(ka,{className:"space-y-3",children:t.jsx(_e,{variant:"card",count:3,className:"h-16"})}):g?.items&&g.items.length>0?g.items.map(L=>t.jsx("button",{onClick:()=>T(L),className:`w-full border-b border-dark-800/50 px-4 py-3 text-left transition-all duration-200 last:border-b-0 hover:bg-dark-800/50 ${L.is_read?"":"bg-accent-500/5"}`,children:t.jsxs("div",{className:"flex gap-3",children:[t.jsx("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl bg-dark-800/50",children:v(L.notification_type)}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:`text-sm leading-relaxed ${L.is_read?"text-dark-300":"font-medium text-dark-100"}`,children:L.message}),t.jsx("p",{className:"mt-1 text-xs text-dark-500",children:N(L.created_at)})]}),!L.is_read&&t.jsx("div",{className:"flex-shrink-0 pt-1",children:t.jsx("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent-500 shadow-lg shadow-accent-500/50"})})]})},L.id)):t.jsxs("div",{className:"p-8 text-center",children:[t.jsx("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-2xl bg-dark-800/50 text-dark-500",children:t.jsx(ts,{})}),t.jsx("p",{className:"text-sm text-dark-500",children:a("notifications.noNotifications","No notifications")})]})}),g?.items&&g.items.length>0&&t.jsx("div",{className:"border-t border-dark-700/50 bg-dark-800/30 px-4 py-3",children:t.jsx("button",{onClick:()=>{p(!1),n(e?"/admin/tickets":"/support")},className:"w-full py-1 text-center text-sm text-accent-400 transition-colors hover:text-accent-300",children:a("notifications.viewAll","View all tickets")})})]})]})}function Du({isKeyboardOpen:e,referralEnabled:a,wheelEnabled:n}){const{t:s}=U(),r=He(),{haptic:o}=Te(),d=c=>c==="/"?r.pathname==="/":r.pathname.startsWith(c),p=[{path:"/",label:s("nav.dashboard"),icon:xn},{path:"/subscriptions",label:s("nav.subscription"),icon:ya},{path:"/balance",label:s("nav.balance"),icon:ca},...n?[{path:"/wheel",label:s("nav.wheel"),icon:Yr}]:a?[{path:"/referral",label:s("nav.referral"),icon:Zt}]:[],{path:"/support",label:s("nav.support"),icon:yn}],i=()=>{o.impact("light")};return t.jsx("nav",{className:x("fixed z-50 transition-all duration-200 lg:hidden","bg-dark-900/95 backdrop-blur-linear","border border-dark-700/30",e?"pointer-events-none opacity-0":"opacity-100"),style:{bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:"16px",right:"16px",borderRadius:"var(--bento-radius, 24px)",padding:"8px 4px",boxShadow:"0 4px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset"},children:t.jsx("div",{className:"flex justify-around",children:p.map(c=>t.jsxs(de,{to:c.path,onClick:i,className:x("relative flex min-w-[56px] flex-1 shrink-0 flex-col items-center justify-center rounded-2xl px-3 py-2.5 transition-all duration-200",d(c.path)?"text-accent-400":"text-dark-400 hover:text-dark-200"),children:[d(c.path)&&t.jsx(ge.div,{layoutId:"bottom-nav-active",className:"absolute inset-0 rounded-2xl bg-accent-500/15",transition:{type:"spring",stiffness:500,damping:30}}),t.jsx(c.icon,{className:"relative z-10 h-5 w-5"}),t.jsx("span",{className:"relative z-10 mt-1 whitespace-nowrap text-2xs",children:c.label})]},c.path))})})}function di(e){if(!e)return"";const a=[e.first_name,e.last_name].filter(s=>!!s?.trim()).join(" ");if(a)return a;if(e.username)return e.username;if(e.telegram_id)return`#${e.telegram_id}`;const n=e.email?.trim().split("@")[0];return n||""}const Vu="Cabinet",Hu="V";function Bu({mobileMenuOpen:e,setMobileMenuOpen:a,onCommandPaletteOpen:n,headerHeight:s,isFullscreen:r,safeAreaInset:o,contentSafeAreaInset:d,telegramPlatform:p,wheelEnabled:i,referralEnabled:c,hasContests:u,hasPolls:m,giftEnabled:h}){const{t:f}=U(),g=He(),{user:y,logout:w,isAdmin:A}=J(ha(D=>({user:D.user,logout:D.logout,isAdmin:D.isAdmin}))),{toggleTheme:T,isDark:N}=Ke(),{haptic:v,platform:S}=Te(),[L,V]=l.useState(null),[O,I]=l.useState(()=>Mt()),{data:M}=W({queryKey:["branding"],queryFn:async()=>{const D=await be.getBranding();return kn(D),await wa(D),D},initialData:$t()??void 0,initialDataUpdatedAt:0,staleTime:6e4,refetchOnWindowFocus:!0,retry:1}),P=M?M.name:Vu,$=M?.logo_letter||Hu,X=M?.has_custom_logo||!1,ce=M?be.getLogoUrl(M):null,{data:re}=W({queryKey:["enabled-themes"],queryFn:Ft.getEnabledThemes,staleTime:1e3*60*5}),he=re?.dark&&re?.light;l.useEffect(()=>{try{const D=Ro();D?.photo_url&&V(D.photo_url)}catch{}},[]),l.useEffect(()=>{if(!e)return;const D=Z=>{Z.target.closest(".mobile-menu-content")||Z.preventDefault()};return document.addEventListener("touchmove",D,{passive:!1}),document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",()=>{document.removeEventListener("touchmove",D),document.body.style.overflow="",document.documentElement.style.overflow=""}},[e]);const G=D=>D==="/"?g.pathname==="/":g.pathname.startsWith(D),K=()=>g.pathname.startsWith("/admin"),B=[{path:"/",label:f("nav.dashboard"),icon:xn},{path:"/subscriptions",label:f("nav.subscription"),icon:ya},{path:"/balance",label:f("nav.balance"),icon:ca},...c?[{path:"/referral",label:f("nav.referral"),icon:Zt}]:[],{path:"/support",label:f("nav.support"),icon:yn},...u?[{path:"/contests",label:f("nav.contests"),icon:Yd}]:[],...m?[{path:"/polls",label:f("nav.polls"),icon:Xd}]:[],...i?[{path:"/wheel",label:f("nav.wheel"),icon:Yr}]:[],...h?[{path:"/gift",label:f("nav.gift"),icon:vn}]:[],{path:"/info",label:f("nav.info"),icon:ba}];return t.jsxs(t.Fragment,{children:[t.jsx("header",{className:"glass fixed left-0 right-0 top-0 z-50 shadow-lg shadow-black/10 lg:hidden",style:{paddingTop:r?`${Math.max(o.top,d.top)+(p==="android"?48:45)}px`:void 0},children:t.jsx("div",{className:"mx-auto w-full px-4",onClick:()=>e&&a(!1),children:t.jsxs("div",{className:"flex h-16 items-center justify-between",children:[t.jsxs(de,{to:"/",onClick:()=>a(!1),className:x("flex flex-shrink-0 items-center gap-2.5",!P&&"mr-4"),children:[t.jsxs("div",{className:"relative flex h-10 w-10 flex-shrink-0 items-center justify-center overflow-hidden rounded-linear-lg border border-dark-700/50 bg-dark-800/80 shadow-md",children:[t.jsx("span",{className:x("absolute text-lg font-bold text-accent-400 transition-opacity duration-200",X&&O?"opacity-0":"opacity-100"),children:$}),X&&ce&&t.jsx("img",{src:ce,alt:P||"Logo",className:x("absolute h-full w-full object-contain transition-opacity duration-200",O?"opacity-100":"opacity-0"),onLoad:()=>I(!0)})]}),P&&t.jsx("span",{className:"whitespace-nowrap text-base font-semibold text-dark-100",children:P})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[S!=="telegram"&&t.jsx("button",{onClick:()=>{v.impact("light"),n()},className:"btn-icon hidden sm:flex",title:"Search (⌘K)",children:t.jsx(Kr,{className:"h-5 w-5"})}),he&&t.jsx("button",{onClick:()=>{v.impact("light"),T(),a(!1)},className:"relative rounded-linear-lg border border-dark-700/50 bg-dark-800/50 p-2 text-dark-400 transition-all duration-200 hover:bg-dark-700 hover:text-accent-400",title:N?f("theme.light")||"Light mode":f("theme.dark")||"Dark mode",children:t.jsxs("div",{className:"relative h-5 w-5",children:[t.jsx("div",{className:x("absolute inset-0 transition-all duration-300",N?"rotate-0 opacity-100":"rotate-90 opacity-0"),children:t.jsx(Qr,{className:"h-5 w-5"})}),t.jsx("div",{className:x("absolute inset-0 transition-all duration-300",N?"-rotate-90 opacity-0":"rotate-0 opacity-100"),children:t.jsx(Gr,{className:"h-5 w-5"})})]})}),t.jsx("div",{onClick:()=>a(!1),children:t.jsx(li,{isAdmin:K()})}),t.jsx("div",{onClick:()=>a(!1),children:t.jsx(rt,{})}),t.jsx("button",{onClick:D=>{D.stopPropagation(),v.impact("light"),a(!e)},className:`rounded-xl p-2.5 transition-all duration-200 ${e?"bg-dark-700 text-dark-100":"text-dark-400 hover:bg-dark-800 hover:text-dark-100"}`,"aria-label":e?"Close menu":"Open menu","aria-expanded":e,children:e?t.jsx(Ot,{className:"h-6 w-6"}):t.jsx(zd,{className:"h-6 w-6"})})]})]})})}),e&&t.jsxs("div",{className:"fixed inset-x-0 bottom-0 z-40 animate-fade-in lg:hidden",style:{top:s},children:[t.jsx("div",{className:"absolute inset-0 bg-dark-950/60",onClick:()=>a(!1)}),t.jsx("div",{className:"mobile-menu-content absolute inset-x-0 bottom-0 top-0 overflow-y-auto overscroll-contain border-t border-dark-800/50 bg-dark-900/95 pb-[calc(5rem+env(safe-area-inset-bottom,0px))]",style:{WebkitOverflowScrolling:"touch"},children:t.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-4",children:[t.jsx("div",{className:"mb-4 flex items-center justify-between border-b border-dark-800/50 pb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[L?t.jsx("img",{src:L,alt:"Avatar",className:"h-10 w-10 rounded-full object-cover",onError:D=>{D.currentTarget.style.display="none",D.currentTarget.nextElementSibling?.classList.remove("hidden")}}):null,t.jsx("div",{className:x("flex h-10 w-10 items-center justify-center rounded-full bg-dark-700",L?"hidden":""),children:t.jsx(Xa,{className:"h-5 w-5"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"truncate text-sm font-medium text-dark-100",children:di(y)}),t.jsxs("div",{className:"truncate text-xs text-dark-500",children:["@",y?.username||`ID: ${y?.telegram_id}`]})]})]})}),t.jsxs("nav",{className:"space-y-1",children:[B.map(D=>t.jsxs(de,{to:D.path,onClick:()=>a(!1),className:G(D.path)?"nav-item-active":"nav-item",children:[t.jsx(D.icon,{className:"h-5 w-5"}),D.label]},D.path)),A&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"divider my-3"}),t.jsx("div",{className:"px-4 py-1 text-xs font-medium uppercase tracking-wider text-dark-500",children:f("admin.nav.title")}),t.jsxs(de,{to:"/admin",onClick:()=>a(!1),className:x("nav-item",K()?"bg-warning-500/10 text-warning-400":"text-warning-500/70"),children:[t.jsx(Jd,{className:"h-5 w-5"}),f("admin.nav.title")]})]}),t.jsx("div",{className:"divider my-3"}),t.jsxs(de,{to:"/profile",onClick:()=>a(!1),className:G("/profile")?"nav-item-active":"nav-item",children:[t.jsx(Xa,{className:"h-5 w-5"}),f("nav.profile")]}),t.jsxs("button",{onClick:()=>{a(!1),w()},className:"nav-item w-full text-error-400",children:[t.jsx(Wr,{className:"h-5 w-5"}),f("nav.logout")]})]})]})})]})]})}const os={aurora:()=>k(()=>import("./aurora-background-Bmt5zK_6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),sparkles:()=>k(()=>import("./sparkles-BB4yBOB0.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10])),vortex:()=>k(()=>import("./vortex-BRV30I9d.js"),__vite__mapDeps([12,1,13,2,3,4,5,6,7,8,9,10])),"shooting-stars":()=>k(()=>import("./shooting-stars-BgxzuuU6.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10])),"background-beams":()=>k(()=>import("./background-beams-78V_nRkh.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9,10])),"background-beams-collision":()=>k(()=>import("./background-beams-collision-eT8yvIJN.js"),__vite__mapDeps([16,1,2,8,3,4,5,6,7,9,10])),"gradient-animation":()=>k(()=>import("./background-gradient-animation-NYBiaKyi.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10])),wavy:()=>k(()=>import("./wavy-background-C3IQPUX9.js"),__vite__mapDeps([18,1,13,2,3,4,5,6,7,8,9,10])),"background-lines":()=>k(()=>import("./background-lines-CebaKYSj.js"),__vite__mapDeps([19,1,13,2,3,4,5,6,7,8,9,10])),boxes:()=>k(()=>import("./background-boxes-CSZ10lO6.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10])),meteors:()=>k(()=>import("./meteors-8S_FHLEs.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10])),grid:()=>k(()=>import("./grid-background-JW_DNfGs.js"),__vite__mapDeps([22,1,3,4,5,6,7,8,9,10])),dots:()=>k(()=>import("./grid-background-JW_DNfGs.js"),__vite__mapDeps([22,1,3,4,5,6,7,8,9,10])),spotlight:()=>k(()=>import("./spotlight-bg-cqMzhhtr.js"),__vite__mapDeps([23,1,2,8,3,4,5,6,7,9,10])),ripple:()=>k(()=>import("./background-ripple-_zHj-ZVo.js"),__vite__mapDeps([24,1,2,3,4,5,6,7,8,9,10])),fireflies:()=>k(()=>import("./fireflies-C30dOUiQ.js"),__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10])),snowfall:()=>k(()=>import("./snowfall-D-I5q1Tc.js"),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10])),starfield:()=>k(()=>import("./starfield-DrSS7KDi.js"),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10])),"matrix-rain":()=>k(()=>import("./matrix-rain-BldCrq-y.js"),__vite__mapDeps([28,1,2,3,4,5,6,7,8,9,10])),"liquid-gradient":()=>k(()=>import("./liquid-gradient-B7I1tzDG.js"),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10])),constellation:()=>k(()=>import("./constellation-oAD2uwgJ.js"),__vite__mapDeps([30,1,2,3,4,5,6,7,8,9,10]))};function Ou(e){e!=="none"&&os[e]&&os[e]()}const Zu={aurora:l.lazy(()=>k(()=>import("./aurora-background-Bmt5zK_6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),sparkles:l.lazy(()=>k(()=>import("./sparkles-BB4yBOB0.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10]))),vortex:l.lazy(()=>k(()=>import("./vortex-BRV30I9d.js"),__vite__mapDeps([12,1,13,2,3,4,5,6,7,8,9,10]))),"shooting-stars":l.lazy(()=>k(()=>import("./shooting-stars-BgxzuuU6.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10]))),"background-beams":l.lazy(()=>k(()=>import("./background-beams-78V_nRkh.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9,10]))),"background-beams-collision":l.lazy(()=>k(()=>import("./background-beams-collision-eT8yvIJN.js"),__vite__mapDeps([16,1,2,8,3,4,5,6,7,9,10]))),"gradient-animation":l.lazy(()=>k(()=>import("./background-gradient-animation-NYBiaKyi.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10]))),wavy:l.lazy(()=>k(()=>import("./wavy-background-C3IQPUX9.js"),__vite__mapDeps([18,1,13,2,3,4,5,6,7,8,9,10]))),"background-lines":l.lazy(()=>k(()=>import("./background-lines-CebaKYSj.js"),__vite__mapDeps([19,1,13,2,3,4,5,6,7,8,9,10]))),boxes:l.lazy(()=>k(()=>import("./background-boxes-CSZ10lO6.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10]))),meteors:l.lazy(()=>k(()=>import("./meteors-8S_FHLEs.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10]))),grid:l.lazy(()=>k(()=>import("./grid-background-JW_DNfGs.js"),__vite__mapDeps([22,1,3,4,5,6,7,8,9,10]))),dots:l.lazy(()=>k(()=>import("./grid-background-JW_DNfGs.js"),__vite__mapDeps([22,1,3,4,5,6,7,8,9,10]))),spotlight:l.lazy(()=>k(()=>import("./spotlight-bg-cqMzhhtr.js"),__vite__mapDeps([23,1,2,8,3,4,5,6,7,9,10]))),ripple:l.lazy(()=>k(()=>import("./background-ripple-_zHj-ZVo.js"),__vite__mapDeps([24,1,2,3,4,5,6,7,8,9,10]))),fireflies:l.lazy(()=>k(()=>import("./fireflies-C30dOUiQ.js"),__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10]))),snowfall:l.lazy(()=>k(()=>import("./snowfall-D-I5q1Tc.js"),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10]))),starfield:l.lazy(()=>k(()=>import("./starfield-DrSS7KDi.js"),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10]))),"matrix-rain":l.lazy(()=>k(()=>import("./matrix-rain-BldCrq-y.js"),__vite__mapDeps([28,1,2,3,4,5,6,7,8,9,10]))),"liquid-gradient":l.lazy(()=>k(()=>import("./liquid-gradient-B7I1tzDG.js"),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10]))),constellation:l.lazy(()=>k(()=>import("./constellation-oAD2uwgJ.js"),__vite__mapDeps([30,1,2,3,4,5,6,7,8,9,10])))},ig=[{type:"aurora",labelKey:"admin.backgrounds.aurora",descriptionKey:"admin.backgrounds.auroraDesc",category:"css",settings:[{key:"firstColor",label:"admin.backgrounds.color1",type:"color",default:"#3b82f6"},{key:"secondColor",label:"admin.backgrounds.color2",type:"color",default:"#a5b4fc"},{key:"thirdColor",label:"admin.backgrounds.color3",type:"color",default:"#93c5fd"},{key:"showRadialGradient",label:"admin.backgrounds.radialGradient",type:"boolean",default:!0},{key:"speed",label:"admin.backgrounds.speed",type:"select",default:"normal",options:[{label:"admin.backgrounds.slow",value:"slow"},{label:"admin.backgrounds.normal",value:"normal"},{label:"admin.backgrounds.fast",value:"fast"}]}]},{type:"sparkles",labelKey:"admin.backgrounds.sparkles",descriptionKey:"admin.backgrounds.sparklesDesc",category:"canvas",settings:[{key:"particleDensity",label:"admin.backgrounds.density",type:"number",min:10,max:200,step:10,default:80},{key:"particleColor",label:"admin.backgrounds.particleColor",type:"color",default:"#ffffff"},{key:"minSize",label:"admin.backgrounds.minSize",type:"number",min:.2,max:3,step:.1,default:.4},{key:"maxSize",label:"admin.backgrounds.maxSize",type:"number",min:1,max:5,step:.1,default:1.4},{key:"speed",label:"admin.backgrounds.speed",type:"number",min:.1,max:3,step:.1,default:.6}]},{type:"vortex",labelKey:"admin.backgrounds.vortex",descriptionKey:"admin.backgrounds.vortexDesc",category:"canvas",settings:[{key:"particleCount",label:"admin.backgrounds.particles",type:"number",min:50,max:1e3,step:50,default:300},{key:"rangeY",label:"admin.backgrounds.rangeY",type:"number",min:50,max:300,step:10,default:100},{key:"baseHue",label:"admin.backgrounds.hue",type:"number",min:0,max:360,step:10,default:220},{key:"rangeSpeed",label:"admin.backgrounds.speed",type:"number",min:.5,max:5,step:.5,default:1.5},{key:"backgroundColor",label:"admin.backgrounds.bgColor",type:"color",default:"#000000"}]},{type:"shooting-stars",labelKey:"admin.backgrounds.shootingStars",descriptionKey:"admin.backgrounds.shootingStarsDesc",category:"canvas",settings:[{key:"starColor",label:"admin.backgrounds.starColor",type:"color",default:"#9E00FF"},{key:"trailColor",label:"admin.backgrounds.trailColor",type:"color",default:"#2EB9DF"},{key:"bgStarColor",label:"admin.backgrounds.bgStarColor",type:"color",default:"#ffffff"},{key:"starDensity",label:"admin.backgrounds.density",type:"number",min:5e-5,max:5e-4,step:5e-5,default:15e-5},{key:"minSpeed",label:"admin.backgrounds.minSpeed",type:"number",min:5,max:30,step:1,default:10},{key:"maxSpeed",label:"admin.backgrounds.maxSpeed",type:"number",min:15,max:60,step:1,default:30}]},{type:"background-beams",labelKey:"admin.backgrounds.beams",descriptionKey:"admin.backgrounds.beamsDesc",category:"svg",settings:[{key:"gradientStart",label:"admin.backgrounds.color1",type:"color",default:"#18CCFC"},{key:"gradientMid",label:"admin.backgrounds.color2",type:"color",default:"#6344F5"},{key:"gradientEnd",label:"admin.backgrounds.color3",type:"color",default:"#AE48FF"},{key:"staticColor",label:"admin.backgrounds.fillColor",type:"color",default:"#d4d4d4"}]},{type:"background-beams-collision",labelKey:"admin.backgrounds.beamsCollision",descriptionKey:"admin.backgrounds.beamsCollisionDesc",category:"svg",settings:[{key:"beamColor",label:"admin.backgrounds.beamColor",type:"color",default:"#6366f1"},{key:"explosionColor",label:"admin.backgrounds.explosionColor",type:"color",default:"#a855f7"}]},{type:"gradient-animation",labelKey:"admin.backgrounds.gradientAnimation",descriptionKey:"admin.backgrounds.gradientAnimationDesc",category:"css",settings:[{key:"firstColor",label:"admin.backgrounds.color1",type:"color",default:"#1271FF"},{key:"secondColor",label:"admin.backgrounds.color2",type:"color",default:"#DD4AFF"},{key:"thirdColor",label:"admin.backgrounds.color3",type:"color",default:"#64DCFF"},{key:"fourthColor",label:"admin.backgrounds.color4",type:"color",default:"#C83232"},{key:"fifthColor",label:"admin.backgrounds.color5",type:"color",default:"#B4B432"},{key:"pointerColor",label:"admin.backgrounds.pointerColor",type:"color",default:"#8C64FF"},{key:"interactive",label:"admin.backgrounds.interactive",type:"boolean",default:!0},{key:"size",label:"admin.backgrounds.size",type:"select",default:"80%",options:[{label:"60%",value:"60%"},{label:"80%",value:"80%"},{label:"100%",value:"100%"}]}]},{type:"wavy",labelKey:"admin.backgrounds.wavy",descriptionKey:"admin.backgrounds.wavyDesc",category:"canvas",settings:[{key:"speed",label:"admin.backgrounds.speed",type:"select",default:"fast",options:[{label:"admin.backgrounds.slow",value:"slow"},{label:"admin.backgrounds.fast",value:"fast"}]},{key:"waveWidth",label:"admin.backgrounds.waveWidth",type:"number",min:10,max:100,step:5,default:50},{key:"blur",label:"admin.backgrounds.blurAmount",type:"number",min:0,max:30,step:1,default:10},{key:"waveOpacity",label:"admin.backgrounds.waveOpacity",type:"number",min:.1,max:1,step:.05,default:.5},{key:"backgroundFill",label:"admin.backgrounds.bgColor",type:"color",default:"#000000"},{key:"waveColor1",label:"admin.backgrounds.color1",type:"color",default:"#38bdf8"},{key:"waveColor2",label:"admin.backgrounds.color2",type:"color",default:"#818cf8"},{key:"waveColor3",label:"admin.backgrounds.color3",type:"color",default:"#c084fc"},{key:"waveColor4",label:"admin.backgrounds.color4",type:"color",default:"#e879f9"},{key:"waveColor5",label:"admin.backgrounds.color5",type:"color",default:"#22d3ee"}]},{type:"background-lines",labelKey:"admin.backgrounds.lines",descriptionKey:"admin.backgrounds.linesDesc",category:"canvas",settings:[{key:"lineCount",label:"admin.backgrounds.count",type:"number",min:10,max:80,step:5,default:40},{key:"lineColor",label:"admin.backgrounds.particleColor",type:"color",default:"#818cf8"},{key:"speed",label:"admin.backgrounds.speed",type:"number",min:.001,max:.01,step:.001,default:.002},{key:"strokeWidth",label:"admin.backgrounds.waveWidth",type:"number",min:.5,max:3,step:.5,default:1}]},{type:"boxes",labelKey:"admin.backgrounds.boxes",descriptionKey:"admin.backgrounds.boxesDesc",category:"css",settings:[{key:"rows",label:"admin.backgrounds.rows",type:"number",min:10,max:40,step:5,default:20},{key:"cols",label:"admin.backgrounds.cols",type:"number",min:5,max:25,step:1,default:12},{key:"boxColor",label:"admin.backgrounds.fillColor",type:"color",default:"#818cf8"},{key:"multicolor",label:"admin.backgrounds.multicolor",type:"boolean",default:!0},{key:"lineColor",label:"admin.backgrounds.lineColor",type:"color",default:"#334155"}]},{type:"meteors",labelKey:"admin.backgrounds.meteors",descriptionKey:"admin.backgrounds.meteorsDesc",category:"css",settings:[{key:"count",label:"admin.backgrounds.count",type:"number",min:5,max:50,step:5,default:20},{key:"meteorColor",label:"admin.backgrounds.particleColor",type:"color",default:"#ffffff"}]},{type:"grid",labelKey:"admin.backgrounds.grid",descriptionKey:"admin.backgrounds.gridDesc",category:"css",settings:[{key:"gridColor",label:"admin.backgrounds.fillColor",type:"color",default:"rgba(255,255,255,0.05)"},{key:"gridSize",label:"admin.backgrounds.gridSize",type:"number",min:10,max:80,step:5,default:40}]},{type:"dots",labelKey:"admin.backgrounds.dots",descriptionKey:"admin.backgrounds.dotsDesc",category:"css",settings:[{key:"variant",label:"admin.backgrounds.size",type:"select",default:"dots",options:[{label:"admin.backgrounds.dots",value:"dots"}]},{key:"gridColor",label:"admin.backgrounds.fillColor",type:"color",default:"rgba(255,255,255,0.1)"},{key:"gridSize",label:"admin.backgrounds.gridSize",type:"number",min:10,max:60,step:5,default:20},{key:"dotSize",label:"admin.backgrounds.size",type:"number",min:.5,max:4,step:.5,default:1.5}]},{type:"spotlight",labelKey:"admin.backgrounds.spotlight",descriptionKey:"admin.backgrounds.spotlightDesc",category:"css",settings:[{key:"spotlightColor",label:"admin.backgrounds.particleColor",type:"color",default:"#818cf8"},{key:"spotlightSize",label:"admin.backgrounds.size",type:"number",min:200,max:800,step:50,default:400}]},{type:"ripple",labelKey:"admin.backgrounds.ripple",descriptionKey:"admin.backgrounds.rippleDesc",category:"canvas",settings:[{key:"rippleColor",label:"admin.backgrounds.particleColor",type:"color",default:"#818cf8"},{key:"rippleCount",label:"admin.backgrounds.count",type:"number",min:3,max:10,step:1,default:5},{key:"speed",label:"admin.backgrounds.speed",type:"number",min:.1,max:2,step:.1,default:.5}]},{type:"fireflies",labelKey:"admin.backgrounds.fireflies",descriptionKey:"admin.backgrounds.firefliesDesc",category:"canvas",settings:[{key:"color",label:"admin.backgrounds.particleColor",type:"color",default:"#ffd166"},{key:"count",label:"admin.backgrounds.count",type:"number",min:5,max:200,step:5,default:40},{key:"speed",label:"admin.backgrounds.speed",type:"number",min:.1,max:3,step:.1,default:1},{key:"size",label:"admin.backgrounds.size",type:"number",min:.5,max:6,step:.5,default:2}]},{type:"snowfall",labelKey:"admin.backgrounds.snowfall",descriptionKey:"admin.backgrounds.snowfallDesc",category:"canvas",settings:[{key:"color",label:"admin.backgrounds.particleColor",type:"color",default:"#ffffff"},{key:"density",label:"admin.backgrounds.density",type:"number",min:20,max:400,step:10,default:150},{key:"speed",label:"admin.backgrounds.speed",type:"number",min:.1,max:3,step:.1,default:1},{key:"wind",label:"admin.backgrounds.wind",type:"number",min:-3,max:3,step:.5,default:.5}]},{type:"starfield",labelKey:"admin.backgrounds.starfield",descriptionKey:"admin.backgrounds.starfieldDesc",category:"canvas",settings:[{key:"color",label:"admin.backgrounds.starColor",type:"color",default:"#ffffff"},{key:"starCount",label:"admin.backgrounds.particles",type:"number",min:50,max:800,step:25,default:200},{key:"speed",label:"admin.backgrounds.speed",type:"number",min:.1,max:5,step:.1,default:1}]},{type:"matrix-rain",labelKey:"admin.backgrounds.matrixRain",descriptionKey:"admin.backgrounds.matrixRainDesc",category:"canvas",settings:[{key:"color",label:"admin.backgrounds.particleColor",type:"color",default:"#00ff41"},{key:"density",label:"admin.backgrounds.density",type:"number",min:10,max:100,step:5,default:70},{key:"speed",label:"admin.backgrounds.speed",type:"number",min:.2,max:3,step:.1,default:1},{key:"charset",label:"admin.backgrounds.charset",type:"select",default:"katakana",options:[{label:"Katakana",value:"katakana"},{label:"Latin",value:"latin"},{label:"Binary",value:"binary"}]}]},{type:"liquid-gradient",labelKey:"admin.backgrounds.liquidGradient",descriptionKey:"admin.backgrounds.liquidGradientDesc",category:"css",settings:[{key:"color1",label:"admin.backgrounds.color1",type:"color",default:"#6366f1"},{key:"color2",label:"admin.backgrounds.color2",type:"color",default:"#ec4899"},{key:"color3",label:"admin.backgrounds.color3",type:"color",default:"#22d3ee"},{key:"color4",label:"admin.backgrounds.color4",type:"color",default:"#a855f7"},{key:"speed",label:"admin.backgrounds.speed",type:"select",default:"normal",options:[{label:"admin.backgrounds.slow",value:"slow"},{label:"admin.backgrounds.normal",value:"normal"},{label:"admin.backgrounds.fast",value:"fast"}]},{key:"blurAmount",label:"admin.backgrounds.blurAmount",type:"number",min:10,max:120,step:5,default:60}]},{type:"constellation",labelKey:"admin.backgrounds.constellation",descriptionKey:"admin.backgrounds.constellationDesc",category:"canvas",settings:[{key:"particleColor",label:"admin.backgrounds.particleColor",type:"color",default:"#818cf8"},{key:"lineColor",label:"admin.backgrounds.lineColor",type:"color",default:"#818cf8"},{key:"count",label:"admin.backgrounds.count",type:"number",min:10,max:200,step:5,default:60},{key:"linkDistance",label:"admin.backgrounds.linkDistance",type:"number",min:40,max:300,step:10,default:120}]}],ui="cabinet_animation_config",Fu=1e4,$u=new Set(["aurora","sparkles","vortex","shooting-stars","background-beams","background-beams-collision","gradient-animation","wavy","background-lines","boxes","meteors","grid","dots","spotlight","ripple","fireflies","snowfall","starfield","matrix-rain","liquid-gradient","constellation","none"]);function ja(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const a=e;return typeof a.enabled!="boolean"||typeof a.type!="string"||!$u.has(a.type)||typeof a.opacity!="number"||typeof a.blur!="number"||a.settings!=null&&(typeof a.settings!="object"||Array.isArray(a.settings))?null:{enabled:a.enabled,type:a.type,opacity:Math.max(0,Math.min(1,a.opacity)),blur:Math.max(0,Math.min(50,a.blur)),settings:a.settings??{},reducedOnMobile:typeof a.reducedOnMobile=="boolean"?a.reducedOnMobile:!0}}function mi(){try{const e=localStorage.getItem(ui);return!e||e.length>Fu?null:ja(JSON.parse(e))}catch{return null}}function pi(e){try{localStorage.setItem(ui,JSON.stringify(e))}catch{}}function og(e){const a=ja(e);a&&pi(a)}const Qt=mi();Qt?.enabled&&Qt.type&&Qt.type!=="none"&&Ou(Qt.type);function Uu(e){const a={...e};return typeof a.particleCount=="number"&&(a.particleCount=Math.max(20,Math.floor(a.particleCount/4))),typeof a.particleDensity=="number"&&(a.particleDensity=Math.max(50,Math.floor(a.particleDensity/4))),typeof a.density=="number"&&(a.density=Math.max(20,Math.floor(a.density/2))),typeof a.starCount=="number"&&(a.starCount=Math.max(50,Math.floor(a.starCount/4))),typeof a.number=="number"&&(a.number=Math.max(5,Math.floor(a.number/4))),"interactive"in a&&(a.interactive=!1),typeof a.lineCount=="number"&&(a.lineCount=Math.max(5,Math.floor(a.lineCount/2))),typeof a.rippleCount=="number"&&(a.rippleCount=Math.max(2,Math.floor(a.rippleCount/2))),typeof a.count=="number"&&(a.count=Math.max(3,Math.floor(a.count/2))),typeof a.rows=="number"&&(a.rows=Math.max(4,Math.floor(a.rows*.6))),typeof a.cols=="number"&&(a.cols=Math.max(4,Math.floor(a.cols*.6))),a}function hi({config:e}){const a=l.useMemo(()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]);if(!e.enabled||e.type==="none"||a)return null;const n=e.type,s=Zu[n];if(!s)return null;const r=window.innerWidth<768,o=e.reducedOnMobile&&r?Uu(e.settings):e.settings,d=r?Math.min(e.blur,4):e.blur;return gt.createPortal(t.jsx("div",{className:"pointer-events-none fixed inset-0",style:{zIndex:-2,opacity:e.opacity,filter:d>0?`blur(${d}px)`:void 0,contain:"strict",backfaceVisibility:"hidden"},children:t.jsx(l.Suspense,{fallback:null,children:t.jsx(s,{settings:o})})}),document.body)}function Ku(){const{data:e}=W({queryKey:["animation-config"],queryFn:async()=>{const n=await be.getAnimationConfig(),s=ja(n)??tn;return pi(s),s},initialData:mi()??void 0,initialDataUpdatedAt:0,staleTime:3e4}),a=e??tn;return t.jsx(hi,{config:a})}function cg({config:e}){const a=l.useMemo(()=>ja(e),[e]);return a?t.jsx(hi,{config:a}):null}const nn=bt(()=>({count:0}));function qu(){l.useEffect(()=>(nn.setState(e=>({count:e.count+1})),()=>nn.setState(e=>({count:e.count-1}))),[])}function zu(){const e=nn(s=>s.count>0),[a,n]=l.useState(e);return l.useEffect(()=>{if(e){n(!0);return}const s=setTimeout(()=>n(!1),300);return()=>clearTimeout(s)},[e]),a?t.jsx(Ku,{}):null}function Wu({children:e}){const{t:a}=U(),n=He(),s=J(K=>K.isAdmin),r=J(K=>K.logout),{isFullscreen:o,safeAreaInset:d,contentSafeAreaInset:p,platform:i,isMobile:c}=Vt(),{mobile:u}=Jr(),m=yt(),{toggleTheme:h,isDark:f}=Ke(),{appName:g,logoLetter:y,hasCustomLogo:w,logoUrl:A}=uu(),{referralEnabled:T,wheelEnabled:N,hasContests:v,hasPolls:S,giftEnabled:L}=fu();gu(),qu();const{data:V}=W({queryKey:["enabled-themes"],queryFn:Ft.getEnabledThemes,staleTime:1e3*60*5}),O=V?.dark&&V?.light,I=o&&c,[M,P]=l.useState(!1),[$,X]=l.useState(!1);l.useEffect(()=>{X(!1)},[n.pathname]),l.useEffect(()=>{const K=D=>{const Z=D.target;(Z.tagName==="INPUT"||Z.tagName==="TEXTAREA"||Z.isContentEditable)&&X(!0)},B=D=>{const Z=D.relatedTarget;(!Z||Z.tagName!=="INPUT"&&Z.tagName!=="TEXTAREA"&&!Z.isContentEditable)&&X(!1)};return document.addEventListener("focusin",K),document.addEventListener("focusout",B),()=>{document.removeEventListener("focusin",K),document.removeEventListener("focusout",B)}},[]);const ce=[{path:"/",label:a("nav.dashboard"),icon:xn},{path:"/subscriptions",label:a("nav.subscription"),icon:ya},{path:"/balance",label:a("nav.balance"),icon:tu},...T?[{path:"/referral",label:a("nav.referral"),icon:Zt}]:[],...L?[{path:"/gift",label:a("nav.gift"),icon:vn}]:[],{path:"/support",label:a("nav.support"),icon:yn},{path:"/info",label:a("nav.info"),icon:ba},{path:"/profile",label:a("nav.profile"),icon:Xa}],re=K=>K==="/"?n.pathname==="/":n.pathname.startsWith(K),he=()=>{m.impact("light")},G=(K,B,D,Z=!1)=>{const le=Z?n.pathname.startsWith("/admin"):re(K);return t.jsxs(de,{to:K,onClick:he,"aria-label":B,className:x("relative flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1.5 text-[13px] font-medium transition-colors duration-200",le?Z?"text-warning-300":"text-dark-50":Z?"text-warning-500/70 hover:bg-warning-500/10 hover:text-warning-300":"text-dark-400 hover:bg-dark-800/60 hover:text-dark-100"),children:[le&&t.jsx(ge.span,{layoutId:"desktop-nav-active",className:x("absolute inset-0 rounded-full shadow-sm",Z?"bg-warning-500/15 ring-1 ring-warning-500/20":"bg-dark-700/80 ring-1 ring-dark-600/40"),transition:{type:"spring",stiffness:500,damping:35}}),t.jsx(D,{className:"relative h-4 w-4 shrink-0"}),t.jsx("span",{className:"relative whitespace-nowrap",children:B})]},K)};return t.jsxs("div",{className:"min-h-viewport",children:[t.jsx(Eu,{}),t.jsx(Tu,{}),t.jsx(Lu,{}),t.jsx(Iu,{}),t.jsx("header",{className:"fixed left-0 top-0 z-50 hidden w-screen border-b border-dark-800/50 bg-dark-950/95 lg:block",children:t.jsxs("div",{className:"mx-auto grid h-14 max-w-[1600px] grid-cols-[1fr_auto_1fr] items-center gap-4 px-6",children:[t.jsxs(de,{to:"/",className:"flex shrink-0 items-center gap-2.5 justify-self-start",onClick:he,children:[t.jsxs("div",{className:"relative flex h-8 w-8 flex-shrink-0 items-center justify-center overflow-hidden rounded-lg bg-dark-800",children:[t.jsx("span",{className:x("absolute text-sm font-bold text-accent-400 transition-opacity duration-200",w&&Mt()?"opacity-0":"opacity-100"),children:y}),w&&A&&t.jsx("img",{src:A,alt:g||"Logo",className:x("absolute h-full w-full object-contain transition-opacity duration-200",Mt()?"opacity-100":"opacity-0")})]}),t.jsx("span",{className:"text-base font-semibold text-dark-100",children:g})]}),t.jsxs("nav",{className:"flex items-center gap-0.5 justify-self-center rounded-full border border-dark-800/70 bg-dark-900/50 p-1 shadow-sm backdrop-blur-sm",children:[ce.map(K=>G(K.path,K.label,K.icon)),s&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"mx-1 h-5 w-px shrink-0 bg-dark-700/60"}),G("/admin",a("admin.nav.title"),eu,!0)]})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-2 justify-self-end",children:[t.jsx("button",{onClick:()=>{m.impact("light"),h()},className:x("rounded-xl border border-dark-700/50 bg-dark-800/50 p-2 text-dark-400 transition-colors duration-200 hover:bg-dark-700 hover:text-accent-400",!O&&"hidden"),"aria-label":f?a("theme.light")||"Light mode":a("theme.dark")||"Dark mode",title:f?a("theme.light")||"Light mode":a("theme.dark")||"Dark mode",children:f?t.jsx(Qr,{className:"h-5 w-5"}):t.jsx(Gr,{className:"h-5 w-5"})}),t.jsx(li,{isAdmin:n.pathname.startsWith("/admin")}),t.jsx(rt,{}),t.jsx("button",{onClick:()=>{m.impact("light"),r()},className:"rounded-xl border border-dark-700/50 bg-dark-800/50 p-2 text-dark-400 transition-colors duration-200 hover:bg-dark-700 hover:text-accent-400",title:a("nav.logout"),children:t.jsx(Wr,{className:"h-5 w-5"})})]})]})}),t.jsx(Bu,{mobileMenuOpen:M,setMobileMenuOpen:P,onCommandPaletteOpen:()=>{},headerHeight:u,isFullscreen:I,safeAreaInset:d,contentSafeAreaInset:p,telegramPlatform:i,wheelEnabled:N,referralEnabled:T,hasContests:v,hasPolls:S,giftEnabled:L}),t.jsx("div",{className:"hidden h-14 lg:block"}),t.jsx("div",{className:"lg:hidden",style:{height:u}}),t.jsx("main",{className:"mx-auto max-w-6xl px-4 py-6 pb-28 lg:px-6 lg:pb-8",children:e}),t.jsx(Du,{isKeyboardOpen:$,referralEnabled:T,wheelEnabled:N})]})}function jn({children:e}){return t.jsx(Wu,{children:e})}function _a({variant:e="dark"}){return t.jsx("div",{className:"min-h-viewport flex items-center justify-center",children:t.jsx("div",{className:"h-10 w-10 border-[3px] border-accent-500 animate-spin rounded-full border-t-transparent"})})}const Gu={type:"spring",stiffness:500,damping:30},Na=[.16,1,.3,1],Qu={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,transition:{duration:0}}},Yu={duration:.2,ease:Na},fi={initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95}},gi={duration:.2,ease:Na},lg={initial:{},animate:{transition:{staggerChildren:.05,delayChildren:.02}},exit:{transition:{staggerChildren:.02,staggerDirection:-1}}},dg={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,transition:{duration:0}}},xi={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},bi={duration:.15},Xu={scale:.98},Ju={scale:1.02},e1={initial:{y:"100%"},animate:{y:0},exit:{y:"100%"}},t1={type:"spring",damping:30,stiffness:400},a1={initial:{opacity:0,scale:.96,y:2},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:2}},n1={duration:.15,ease:Na},Ca={initial:{opacity:0,scale:.96,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:-4}},Aa={duration:.15,ease:Na},s1={warning:{glow:"bg-warning-500/10",medallion:"bg-warning-500/10 ring-warning-500/30 shadow-[0_0_44px_-8px_rgba(var(--color-warning-500),0.5)]",sheen:"from-warning-500/25",iconColor:"text-warning-400",dot:"bg-warning-500",hairline:"via-warning-500/40"},error:{glow:"bg-error-500/10",medallion:"bg-error-500/10 ring-error-500/30 shadow-[0_0_44px_-8px_rgba(var(--color-error-500),0.5)]",sheen:"from-error-500/25",iconColor:"text-error-400",dot:"bg-error-500",hairline:"via-error-500/40"},info:{glow:"bg-accent-500/10",medallion:"bg-accent-500/10 ring-accent-500/30 shadow-glow-lg",sheen:"from-accent-500/25",iconColor:"text-accent-400",dot:"bg-accent-500",hairline:"via-accent-500/40"}};function qt({titleId:e,accent:a,icon:n,title:s,description:r,children:o,actions:d,footer:p,pulse:i=!1,ariaLive:c="off",screenRef:u}){const m=s1[a];return t.jsxs("div",{ref:u,role:"alertdialog","aria-modal":"true","aria-labelledby":e,tabIndex:-1,className:"fixed inset-0 z-[100] overflow-y-auto bg-dark-950",children:[t.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0 overflow-hidden",children:[t.jsx("div",{className:x("absolute left-1/2 top-1/2 h-[30rem] w-[30rem] -translate-x-1/2 -translate-y-[58%] rounded-full blur-[130px]",m.glow)}),t.jsx("div",{className:"absolute -bottom-24 left-1/2 h-72 w-[22rem] -translate-x-1/2 rounded-full bg-dark-800/30 blur-[120px]"})]}),t.jsx("div",{className:"relative flex min-h-full items-center justify-center p-6",children:t.jsxs(ge.div,{variants:fi,initial:"initial",animate:"animate",transition:gi,"aria-live":c==="polite"?"polite":void 0,"aria-atomic":c==="polite"?!0:void 0,className:"relative w-full max-w-md overflow-hidden rounded-[var(--bento-radius)] border border-dark-700/40 bg-dark-900/80 p-8 text-center shadow-[0_4px_24px_-4px_rgba(0,0,0,0.4),inset_0_1px_0_0_rgba(255,255,255,0.05)] backdrop-blur-xl sm:p-10",children:[t.jsx("div",{"aria-hidden":!0,className:x("pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent to-transparent",m.hairline)}),t.jsx(ge.div,{variants:Qu,initial:"initial",animate:"animate",transition:Yu,className:"mb-6 flex justify-center",children:t.jsxs("span",{className:x("relative flex h-20 w-20 items-center justify-center rounded-full ring-1",m.medallion),children:[t.jsx("span",{"aria-hidden":!0,className:x("absolute inset-0 rounded-full bg-gradient-to-br to-transparent",m.sheen)}),t.jsx("span",{className:x("relative",m.iconColor),children:n})]})}),t.jsx("h1",{id:e,className:"font-display text-2xl font-bold tracking-tight text-dark-50",children:s}),r&&t.jsx("p",{className:"mt-3 text-base leading-relaxed text-dark-400",children:r}),o&&t.jsx("div",{className:"mt-6 space-y-3 text-left",children:o}),d&&t.jsx("div",{className:"mt-7 flex flex-col gap-3",children:d}),i&&t.jsxs("div",{"aria-hidden":!0,className:"mt-7 flex items-center justify-center gap-1.5",children:[t.jsx("span",{className:x("h-1.5 w-1.5 animate-pulse rounded-full",m.dot),style:{animationDelay:"0ms"}}),t.jsx("span",{className:x("h-1.5 w-1.5 animate-pulse rounded-full",m.dot),style:{animationDelay:"300ms"}}),t.jsx("span",{className:x("h-1.5 w-1.5 animate-pulse rounded-full",m.dot),style:{animationDelay:"600ms"}})]}),p&&t.jsx("p",{className:"mt-6 text-sm text-dark-500",children:p})]})})]})}function r1(){const{t:e}=U(),a=me(s=>s.maintenanceInfo),n=qe(!0,{lockScroll:!1});return t.jsx(qt,{screenRef:n,titleId:"maintenance-title",accent:"warning",icon:t.jsx(Rd,{className:"h-9 w-9"}),title:e("blocking.maintenance.title"),description:a?.message||e("blocking.maintenance.defaultMessage"),pulse:!0,footer:e("blocking.maintenance.waitMessage"),children:a?.reason&&t.jsxs("div",{className:"rounded-xl border border-dark-700/30 bg-dark-800/50 p-4",children:[t.jsxs("p",{className:"mb-1 text-xs font-medium uppercase tracking-wide text-dark-500",children:[e("blocking.maintenance.reason"),":"]}),t.jsx("p",{className:"text-sm text-dark-300",children:a.reason})]})})}const i1=new Set(["Please subscribe to the required channels to continue"]);function o1(e){const a=e?.trim();return!a||i1.has(a)?null:a}const c1=lo(["inline-flex items-center justify-center gap-2","font-medium transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500/50 focus-visible:ring-offset-2 focus-visible:ring-offset-dark-950","disabled:pointer-events-none disabled:opacity-50","select-none"],{variants:{variant:{primary:["bg-accent-500 text-on-accent","hover:bg-accent-600","active:bg-accent-700","shadow-linear-sm hover:shadow-linear"],secondary:["bg-dark-800/80 text-dark-100","border border-dark-700/50","hover:bg-dark-700/80 hover:border-dark-600/50","active:bg-dark-800"],ghost:["text-dark-300","hover:text-dark-100 hover:bg-dark-800/50","active:bg-dark-800"],destructive:["bg-error-500/10 text-error-400","border border-error-500/20","hover:bg-error-500/20 hover:border-error-500/30","active:bg-error-500/30"],outline:["border border-dark-700/50 text-dark-200","hover:bg-dark-800/50 hover:border-dark-600/50 hover:text-dark-100","active:bg-dark-800"],link:["text-accent-400","hover:text-accent-300 hover:underline","active:text-accent-500"]},size:{sm:"h-8 px-3 text-sm rounded-linear",md:"h-10 px-4 text-sm rounded-linear",lg:"h-12 px-6 text-base rounded-linear-lg",icon:"h-10 w-10 rounded-linear","icon-sm":"h-8 w-8 rounded-linear","icon-lg":"h-12 w-12 rounded-linear-lg"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"primary",size:"md"}}),nt=l.forwardRef(({children:e,className:a,variant:n,size:s,fullWidth:r,asChild:o=!1,disabled:d=!1,loading:p=!1,leftIcon:i,rightIcon:c,haptic:u=!0,onClick:m,...h},f)=>{const{haptic:g}=Te(),y=d||p,w=T=>{u&&!y&&g.impact("light"),m?.(T)},A=x(c1({variant:n,size:s,fullWidth:r}),a);return o?t.jsx(Wo,{ref:f,className:A,...h,children:e}):t.jsx(ge.button,{ref:f,className:A,disabled:y,onClick:w,whileHover:y?void 0:Ju,whileTap:y?void 0:Xu,transition:Gu,...h,children:p?t.jsx(l1,{}):t.jsxs(t.Fragment,{children:[i&&t.jsx("span",{className:"shrink-0",children:i}),e,c&&t.jsx("span",{className:"shrink-0",children:c})]})})});nt.displayName="Button";function l1(){return t.jsxs("svg",{className:"h-4 w-4 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}const d1=l.forwardRef(({className:e,...a},n)=>t.jsx(Xe,{ref:n,className:x("flex h-full w-full flex-col overflow-hidden rounded-linear-lg","bg-dark-900/95 text-dark-100 backdrop-blur-linear",e),...a}));d1.displayName="Command";const u1=l.forwardRef(({className:e,...a},n)=>t.jsxs("div",{className:"flex items-center border-b border-dark-700/50 px-3","cmdk-input-wrapper":"",children:[t.jsx(Kr,{}),t.jsx(Xe.Input,{ref:n,className:x("flex h-12 w-full bg-transparent py-3 pl-2 text-sm text-dark-100","placeholder:text-dark-400","focus:outline-none","disabled:cursor-not-allowed disabled:opacity-50",e),...a})]}));u1.displayName="CommandInput";const m1=l.forwardRef(({className:e,...a},n)=>t.jsx(Xe.List,{ref:n,className:x("max-h-[300px] overflow-y-auto overflow-x-hidden","scrollbar-thin scrollbar-track-transparent scrollbar-thumb-dark-700",e),...a}));m1.displayName="CommandList";const p1=l.forwardRef(({className:e,...a},n)=>t.jsx(Xe.Empty,{ref:n,className:x("py-6 text-center text-sm text-dark-400",e),...a}));p1.displayName="CommandEmpty";const h1=l.forwardRef(({className:e,...a},n)=>t.jsx(Xe.Group,{ref:n,className:x("overflow-hidden p-1 text-dark-100","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5","[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-dark-400",e),...a}));h1.displayName="CommandGroup";const f1=l.forwardRef(({className:e,...a},n)=>t.jsx(Xe.Separator,{ref:n,className:x("-mx-1 h-px bg-dark-700/50",e),...a}));f1.displayName="CommandSeparator";const g1=l.forwardRef(({className:e,...a},n)=>t.jsx(Xe.Item,{ref:n,className:x("relative flex cursor-pointer select-none items-center gap-2 rounded-linear px-2 py-2","text-sm text-dark-200 outline-none","aria-selected:bg-dark-800/80 aria-selected:text-dark-100","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","transition-colors duration-150",e),...a}));g1.displayName="CommandItem";const x1=l.forwardRef(({className:e,...a},n)=>t.jsx(Xe.Loading,{ref:n,className:x("py-6 text-center text-sm text-dark-400",e),...a}));x1.displayName="CommandLoading";const b1=l.createContext({open:!1}),yi=l.forwardRef(({className:e,...a},n)=>t.jsx(Qs,{ref:n,className:x("fixed inset-0 z-50 bg-dark-950/60 backdrop-blur-sm",e),asChild:!0,...a,children:t.jsx(ge.div,{variants:xi,initial:"initial",animate:"animate",exit:"exit",transition:bi})}));yi.displayName="DialogOverlay";const y1=l.forwardRef(({className:e,children:a,showCloseButton:n=!0,...s},r)=>{const{open:o}=l.useContext(b1);return t.jsx(Ys,{forceMount:!0,children:t.jsx(Gs,{mode:"wait",children:o&&t.jsxs(t.Fragment,{children:[t.jsx(yi,{}),t.jsx(Xs,{ref:r,className:x("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","max-h-[85vh] w-full max-w-lg","grid gap-4 overflow-auto","rounded-linear-lg border border-dark-700/50 bg-dark-900/95 backdrop-blur-linear","p-6 shadow-linear-lg","focus:outline-none",e),asChild:!0,...s,children:t.jsxs(ge.div,{variants:fi,initial:"initial",animate:"animate",exit:"exit",transition:gi,children:[a,n&&t.jsxs(Js,{className:x("absolute right-4 top-4 rounded-linear p-1.5","text-dark-400 opacity-70 transition-all","hover:bg-dark-800/80 hover:opacity-100","focus:outline-none focus:ring-2 focus:ring-accent-500/50"),children:[t.jsx(Ot,{}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})})]})})})});y1.displayName="DialogContent";const v1=l.forwardRef(({className:e,...a},n)=>t.jsx(er,{ref:n,className:x("text-lg font-semibold text-dark-100",e),...a}));v1.displayName="DialogTitle";const w1=l.forwardRef(({className:e,...a},n)=>t.jsx(tr,{ref:n,className:x("text-sm text-dark-400",e),...a}));w1.displayName="DialogDescription";const k1=l.forwardRef(({className:e,inset:a,children:n,...s},r)=>t.jsxs(Go,{ref:r,className:x("flex cursor-pointer select-none items-center gap-2 rounded-linear px-2 py-2","text-sm text-dark-200 outline-none","focus:bg-dark-800/80 focus:text-dark-100","data-[state=open]:bg-dark-800/80",a&&"pl-8",e),...s,children:[n,t.jsx(Bt,{})]}));k1.displayName="DropdownMenuSubTrigger";const j1=l.forwardRef(({className:e,...a},n)=>t.jsx(Qo,{ref:n,className:x("z-50 min-w-[8rem] overflow-hidden","rounded-linear-lg border border-dark-700/50 bg-dark-900/95 backdrop-blur-linear","p-1 text-dark-100 shadow-linear-lg",e),asChild:!0,...a,children:t.jsx(ge.div,{variants:Ca,initial:"initial",animate:"animate",exit:"exit",transition:Aa})}));j1.displayName="DropdownMenuSubContent";const _1=l.forwardRef(({className:e,sideOffset:a=4,...n},s)=>{const{haptic:r}=Te();return t.jsx(Yo,{children:t.jsx(Xo,{ref:s,sideOffset:a,className:x("z-50 min-w-[8rem] overflow-hidden","rounded-linear-lg border border-dark-700/50 bg-dark-900/95 backdrop-blur-linear","p-1 text-dark-100 shadow-linear-lg",e),onCloseAutoFocus:()=>r.impact("light"),asChild:!0,...n,children:t.jsx(ge.div,{variants:Ca,initial:"initial",animate:"animate",exit:"exit",transition:Aa})})})});_1.displayName="DropdownMenuContent";const N1=l.forwardRef(({className:e,inset:a,destructive:n,...s},r)=>{const{haptic:o}=Te();return t.jsx(Jo,{ref:r,className:x("relative flex cursor-pointer select-none items-center gap-2 rounded-linear px-2 py-2","text-sm outline-none transition-colors duration-150",n?"text-error-400 focus:bg-error-500/10 focus:text-error-300":"text-dark-200 focus:bg-dark-800/80 focus:text-dark-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",e),onClick:()=>o.impact("light"),...s})});N1.displayName="DropdownMenuItem";const C1=l.forwardRef(({className:e,children:a,checked:n,...s},r)=>t.jsxs(ec,{ref:r,className:x("relative flex cursor-pointer select-none items-center rounded-linear py-2 pl-8 pr-2","text-sm text-dark-200 outline-none transition-colors duration-150","focus:bg-dark-800/80 focus:text-dark-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...s,children:[t.jsx("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:t.jsx(ar,{children:t.jsx(Pe,{})})}),a]}));C1.displayName="DropdownMenuCheckboxItem";const A1=l.forwardRef(({className:e,children:a,...n},s)=>t.jsxs(tc,{ref:s,className:x("relative flex cursor-pointer select-none items-center rounded-linear py-2 pl-8 pr-2","text-sm text-dark-200 outline-none transition-colors duration-150","focus:bg-dark-800/80 focus:text-dark-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:t.jsx(ar,{children:t.jsx(Bd,{})})}),a]}));A1.displayName="DropdownMenuRadioItem";const E1=l.forwardRef(({className:e,inset:a,...n},s)=>t.jsx(ac,{ref:s,className:x("px-2 py-1.5 text-xs font-medium text-dark-400",a&&"pl-8",e),...n}));E1.displayName="DropdownMenuLabel";const T1=l.forwardRef(({className:e,...a},n)=>t.jsx(nc,{ref:n,className:x("-mx-1 my-1 h-px bg-dark-700/50",e),...a}));T1.displayName="DropdownMenuSeparator";const S1=l.forwardRef(({className:e,children:a,align:n="center",sideOffset:s=4,showCloseButton:r=!1,...o},d)=>t.jsx(sc,{children:t.jsx(rc,{ref:d,align:n,sideOffset:s,className:x("z-50 w-72 overflow-hidden","rounded-linear-lg border border-dark-700/50 bg-dark-900/95 backdrop-blur-linear","p-4 text-dark-100 shadow-linear-lg outline-none",e),asChild:!0,...o,children:t.jsxs(ge.div,{variants:Ca,initial:"initial",animate:"animate",exit:"exit",transition:Aa,children:[a,r&&t.jsxs(ic,{className:x("absolute right-2 top-2 rounded-linear p-1.5","text-dark-400 opacity-70 transition-all","hover:bg-dark-800/80 hover:opacity-100","focus:outline-none focus:ring-2 focus:ring-accent-500/50"),children:[t.jsx(Ot,{}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})})}));S1.displayName="PopoverContent";const L1=l.forwardRef(({className:e,...a},n)=>t.jsx(oc,{ref:n,className:x("fill-dark-800",e),...a}));L1.displayName="PopoverArrow";const I1=l.forwardRef(({className:e,placeholder:a,...n},s)=>{const{haptic:r}=Te();return t.jsxs(cc,{ref:s,className:x("flex h-10 w-full items-center justify-between gap-2 rounded-linear px-3","border border-dark-700/50 bg-dark-800/80","text-sm text-dark-100 placeholder:text-dark-400","hover:border-dark-600/50 hover:bg-dark-700/80","focus:outline-none focus:ring-2 focus:ring-accent-500/50 focus:ring-offset-2 focus:ring-offset-dark-950","disabled:cursor-not-allowed disabled:opacity-50","transition-all duration-200","[&>span]:line-clamp-1",e),onClick:()=>r.impact("light"),...n,children:[t.jsx(lc,{placeholder:a}),t.jsx(dc,{children:t.jsx(bn,{})})]})});I1.displayName="SelectTrigger";const R1=l.forwardRef(({className:e,children:a,position:n="popper",...s},r)=>t.jsx(uc,{children:t.jsx(mc,{ref:r,className:x("relative z-50 max-h-80 min-w-[8rem] overflow-hidden","rounded-linear-lg border border-dark-700/50 bg-dark-900/95 backdrop-blur-linear","text-dark-100 shadow-linear-lg",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,asChild:!0,...s,children:t.jsx(ge.div,{variants:Ca,initial:"initial",animate:"animate",exit:"exit",transition:Aa,children:t.jsx(pc,{className:x("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})})}));R1.displayName="SelectContent";const P1=l.forwardRef(({className:e,children:a,...n},s)=>t.jsxs(hc,{ref:s,className:x("relative flex w-full cursor-pointer select-none items-center rounded-linear py-2 pl-3 pr-8","text-sm text-dark-200 outline-none","hover:bg-dark-800/80 hover:text-dark-100","focus:bg-dark-800/80 focus:text-dark-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","data-[state=checked]:text-accent-400","transition-colors duration-150",e),...n,children:[t.jsx(fc,{children:a}),t.jsx("span",{className:"absolute right-2 flex h-4 w-4 items-center justify-center",children:t.jsx(gc,{children:t.jsx(Pe,{})})})]}));P1.displayName="SelectItem";const M1=l.forwardRef(({className:e,...a},n)=>t.jsx(xc,{ref:n,className:x("px-3 py-1.5 text-xs font-medium text-dark-400",e),...a}));M1.displayName="SelectLabel";const D1=l.forwardRef(({className:e,...a},n)=>t.jsx(bc,{ref:n,className:x("-mx-1 my-1 h-px bg-dark-700/50",e),...a}));D1.displayName="SelectSeparator";const V1=l.createContext({open:!1,onClose:()=>{}}),vi=l.forwardRef(({className:e,...a},n)=>t.jsx(Qs,{ref:n,className:x("fixed inset-0 z-50 bg-dark-950/60 backdrop-blur-sm",e),asChild:!0,...a,children:t.jsx(ge.div,{variants:xi,initial:"initial",animate:"animate",exit:"exit",transition:bi})}));vi.displayName="SheetOverlay";const H1=l.forwardRef(({className:e,children:a,showDragHandle:n=!0,showCloseButton:s=!1,enableDragToClose:r=!0,closeThreshold:o=.3,...d},p)=>{const{open:i,onClose:c}=l.useContext(V1),{haptic:u}=Te(),m=zo(),h=l.useCallback((f,g)=>{const y=g.velocity.y,w=g.offset.y,A=window.innerHeight;(y>500||w>A*o)&&(u.impact("light"),c())},[o,u,c]);return t.jsx(Ys,{forceMount:!0,children:t.jsx(Gs,{mode:"wait",children:i&&t.jsxs(t.Fragment,{children:[t.jsx(vi,{}),t.jsx(Xs,{ref:p,className:x("fixed inset-x-0 bottom-0 z-50","flex flex-col","max-h-[85vh]","rounded-t-2xl border-t border-dark-700/50 bg-dark-900/95 backdrop-blur-linear","shadow-linear-lg","focus:outline-none","pb-[env(safe-area-inset-bottom,0px)]",e),asChild:!0,...d,children:t.jsxs(ge.div,{variants:e1,initial:"initial",animate:"animate",exit:"exit",transition:t1,drag:r?"y":!1,dragControls:m,dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:.6},onDragEnd:h,children:[n&&t.jsx("div",{className:"flex cursor-grab justify-center pb-2 pt-3 active:cursor-grabbing",onPointerDown:f=>m.start(f),children:t.jsx("div",{className:"h-1 w-10 rounded-full bg-dark-600"})}),s&&t.jsxs(Js,{className:x("absolute right-4 top-4 rounded-linear p-1.5","text-dark-400 opacity-70 transition-all","hover:bg-dark-800/80 hover:opacity-100","focus:outline-none focus:ring-2 focus:ring-accent-500/50"),children:[t.jsx(Ot,{}),t.jsx("span",{className:"sr-only",children:"Close"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:a})]})})]})})})});H1.displayName="SheetContent";const B1=l.forwardRef(({className:e,...a},n)=>t.jsx(er,{ref:n,className:x("text-lg font-semibold text-dark-100",e),...a}));B1.displayName="SheetTitle";const O1=l.forwardRef(({className:e,...a},n)=>t.jsx(tr,{ref:n,className:x("text-sm text-dark-400",e),...a}));O1.displayName="SheetDescription";const Z1=l.forwardRef(({className:e,label:a,description:n,onChange:s,onCheckedChange:r,haptic:o=!0,...d},p)=>{const{haptic:i}=Te(),c=m=>{o&&i.impact("light"),r?.(m),s?.(m)},u=t.jsx(yc,{ref:p,className:x("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full","border-2 border-transparent transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500/50 focus-visible:ring-offset-2 focus-visible:ring-offset-dark-950","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-accent-500 data-[state=unchecked]:bg-dark-700",e),onCheckedChange:c,...d,children:t.jsx(vc,{asChild:!0,children:t.jsx("span",{className:x("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform duration-200","data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});return a?t.jsxs("label",{className:"flex cursor-pointer items-center justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block text-sm font-medium text-dark-100",children:a}),n&&t.jsx("span",{className:"mt-0.5 block text-sm text-dark-400",children:n})]}),u]}):u});Z1.displayName="Switch";const F1=l.forwardRef(({className:e,sideOffset:a=4,children:n,...s},r)=>t.jsx(wc,{children:t.jsx(kc,{ref:r,sideOffset:a,className:x("z-50 overflow-hidden","rounded-linear px-3 py-1.5","border border-dark-700/50 bg-dark-800","text-xs text-dark-100 shadow-linear",e),asChild:!0,...s,children:t.jsx(ge.div,{variants:a1,initial:"initial",animate:"animate",exit:"exit",transition:n1,children:n})})}));F1.displayName="TooltipContent";const $1=5;function U1(){const{t:e}=U(),a=me(N=>N.channelInfo),n=me(N=>N.clearBlocking),[s,r]=l.useState(!1),[o,d]=l.useState(0),[p,i]=l.useState(null),c=l.useRef(!1),{openLink:u,openTelegramLink:m}=Te(),h=l.useCallback(N=>{if(N)try{const v=new URL(N);if(v.protocol!=="https:"&&v.protocol!=="http:")return;v.hostname==="t.me"||v.hostname.endsWith(".t.me")?m(N):u(N)}catch{}},[u,m]);l.useEffect(()=>{if(o<=0)return;const N=setInterval(()=>{d(v=>v<=1?(clearInterval(N),0):v-1)},1e3);return()=>clearInterval(N)},[o]);const g=(a?.channels??[]).filter(N=>!N.is_subscribed),y=l.useCallback(async()=>{if(!c.current){c.current=!0,r(!0),i(null);try{await b.get("/cabinet/auth/me"),n(),window.location.reload()}catch(N){hr(N)?i(e("blocking.channel.notSubscribed")):i(e("blocking.channel.checkError"))}finally{c.current=!1,r(!1),d($1)}}},[n,e]),w=qe(!0,{lockScroll:!1});let A,T;return s?(A=t.jsx($r,{className:"h-5 w-5 animate-spin"}),T=e("blocking.channel.checking")):o>0?(A=t.jsx(la,{className:"h-5 w-5"}),T=e("blocking.channel.waitSeconds",{seconds:o})):(A=t.jsx(Pe,{className:"h-5 w-5"}),T=e("blocking.channel.checkSubscription")),t.jsxs(qt,{screenRef:w,titleId:"channel-sub-title",accent:"info",ariaLive:"polite",icon:t.jsx(Ud,{className:"h-9 w-9"}),title:e("blocking.channel.title"),description:o1(a?.message)??e("blocking.channel.defaultMessage"),footer:e("blocking.channel.hint"),actions:t.jsx(nt,{variant:"secondary",size:"lg",fullWidth:!0,onClick:y,disabled:s||o>0,leftIcon:A,children:T}),children:[g.length>0&&t.jsx("div",{className:"space-y-2",children:g.map(N=>t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-error-500/30 bg-error-500/10 p-3",children:[t.jsx("span",{className:"truncate text-sm font-medium text-dark-50",children:N.title||N.channel_id}),N.channel_link&&t.jsx(nt,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>h(N.channel_link),children:e("blocking.channel.openChannel")})]},N.channel_id))}),g.length===0&&a?.channel_link&&t.jsx(nt,{variant:"primary",size:"lg",fullWidth:!0,onClick:()=>h(a.channel_link),children:e("blocking.channel.openChannel")}),p&&t.jsx("div",{className:"rounded-xl border border-error-500/30 bg-error-500/10 p-3",children:t.jsx("p",{className:"text-sm text-error-400",children:p})})]})}function K1(){const{t:e}=U(),a=me(s=>s.blacklistedInfo),n=qe(!0,{lockScroll:!1});return t.jsx(qt,{screenRef:n,titleId:"blacklisted-title",accent:"error",icon:t.jsx(Md,{className:"h-9 w-9"}),title:e("blocking.blacklisted.title"),description:e("blocking.blacklisted.defaultMessage"),footer:e("blocking.blacklisted.contactSupport"),children:a?.message&&t.jsxs("div",{className:"rounded-xl border border-dark-700/30 bg-dark-800/50 p-4",children:[t.jsxs("p",{className:"mb-1 text-xs font-medium uppercase tracking-wide text-dark-500",children:[e("blocking.blacklisted.reason"),":"]}),t.jsx("p",{className:"text-sm text-dark-300",children:a.message})]})})}function q1(){const{t:e}=U(),{openTelegramLink:a}=Te(),n=me(p=>p.accountDeletedInfo),s=qe(!0,{lockScroll:!1}),r=n?.telegram_deep_link?.trim()||null,o=()=>{r&&a(r)},d=()=>{me.getState().clearBlocking(),window.location.reload()};return t.jsx(qt,{screenRef:s,titleId:"account-deleted-title",accent:"warning",icon:t.jsx(ba,{className:"h-9 w-9"}),title:e("blocking.accountDeleted.title"),description:e("blocking.accountDeleted.description"),footer:e("blocking.accountDeleted.hint"),actions:t.jsxs(t.Fragment,{children:[r&&t.jsx(nt,{variant:"primary",size:"lg",fullWidth:!0,onClick:o,children:e("blocking.accountDeleted.openBot")}),t.jsx(nt,{variant:"secondary",size:"lg",fullWidth:!0,onClick:d,children:e("blocking.accountDeleted.retry")})]})})}function z1(){const{t:e}=U(),a=me(c=>c.clearBlocking),n=Ye(),[s,r]=l.useState(!1),o=l.useRef(!1),d=l.useCallback(()=>{a(),Vc()?n.invalidateQueries():window.location.reload()},[a,n]),p=l.useCallback(async()=>{if(!o.current){o.current=!0,r(!0);try{await Ga()&&d()}finally{o.current=!1,r(!1)}}},[d]);l.useEffect(()=>{let c=!1,u;const m=async()=>{if(!c){if(await Ga()){c||d();return}c||(u=setTimeout(m,Tt.RECOVERY_POLL_INTERVAL_MS))}};return m(),()=>{c=!0,u&&clearTimeout(u)}},[d]);const i=qe(!0,{lockScroll:!1});return t.jsx(qt,{screenRef:i,titleId:"service-unavailable-title",accent:"warning",ariaLive:"polite",icon:t.jsx(Fd,{className:"h-9 w-9"}),title:e("blocking.serviceUnavailable.title"),description:e("blocking.serviceUnavailable.description"),pulse:!0,footer:e("blocking.serviceUnavailable.hint"),actions:t.jsx(nt,{variant:"secondary",size:"lg",fullWidth:!0,onClick:p,disabled:s,leftIcon:t.jsx($r,{className:x("h-5 w-5",s&&"animate-spin")}),children:e(s?"blocking.serviceUnavailable.checking":"blocking.serviceUnavailable.retry")})})}function cs(e){const a=e.message||"";return a.includes("dynamically imported module")||a.includes("Importing a module script failed")||a.includes("Failed to fetch dynamically imported module")||a.includes("Loading chunk")||a.includes("ChunkLoadError")||e.name==="ChunkLoadError"}class _n extends l.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,n){if(console.error("[ErrorBoundary]",a,n),cs(a)){const s="chunk_reload_ts",r=Number(ee.getItem(s)||"0"),o=Date.now();if(o-r>3e4&&ee.setItem(s,String(o))){window.location.reload();return}}}handleReset=()=>{this.setState({hasError:!1,error:null}),this.props.onReset?.()};render(){if(!this.state.hasError)return this.props.children;const{level:a="page"}=this.props,n=this.state.error?cs(this.state.error):!1;return a==="app"?t.jsx("div",{className:"min-h-viewport flex items-center justify-center bg-dark-900 p-4",children:t.jsxs("div",{className:"max-w-md text-center",children:[t.jsx("div",{className:"mb-4 text-4xl",children:"⚠️"}),t.jsx("h1",{className:"mb-2 text-xl font-bold text-dark-50",children:"Something went wrong"}),t.jsx("p",{className:"mb-6 text-dark-400",children:"An unexpected error occurred. Please try reloading the page."}),t.jsx("button",{onClick:()=>window.location.reload(),className:"rounded-xl bg-accent-500 px-6 py-3 font-medium text-on-accent transition-colors hover:bg-accent-600",children:"Reload page"})]})}):a==="widget"?t.jsxs("div",{className:"rounded-xl border border-error-500/30 bg-error-500/10 p-4 text-center",children:[t.jsx("p",{className:"text-sm text-error-400",children:"Failed to load this section"}),t.jsx("button",{onClick:this.handleReset,className:"mt-2 text-sm text-accent-400 hover:text-accent-300",children:"Try again"})]}):t.jsx("div",{className:"flex min-h-[50vh] items-center justify-center p-4",children:t.jsxs("div",{className:"max-w-md text-center",children:[t.jsx("div",{className:"mb-4 text-4xl",children:"⚠️"}),t.jsx("h1",{className:"mb-2 text-xl font-bold text-dark-50",children:"Something went wrong"}),t.jsx("p",{className:"mb-6 text-sm text-dark-400",children:n?"App was updated. Reloading...":this.state.error?.message||"An unexpected error occurred"}),t.jsx("button",{onClick:()=>window.location.reload(),className:"rounded-xl bg-accent-500 px-6 py-3 font-medium text-on-accent transition-colors hover:bg-accent-600",children:n?"Reload":"Try again"})]})})}}function R({children:e,permission:a,permissions:n,requireAll:s=!1}){const r=J(f=>f.isAuthenticated),o=J(f=>f.isLoading),d=J(f=>f.isAdmin),p=He(),i=Fe(f=>f.isLoaded),c=Fe(f=>f.hasPermission),u=Fe(f=>f.hasAnyPermission),m=Fe(f=>f.hasAllPermissions);if(o||d&&!i)return t.jsx(_a,{variant:"light"});if(!r)return ga(),t.jsx($e,{to:"/login",replace:!0,state:{from:p.pathname}});if(!d)return t.jsx($e,{to:"/",replace:!0});if(a||n&&n.length>0){let f=!1;if(a?f=c(a):n&&n.length>0&&(f=s?m(...n):u(...n)),!f){const g=p.pathname==="/admin"?"/":"/admin";return t.jsx($e,{to:g,replace:!0})}}return t.jsx(jn,{children:e})}const sn="ym-counter-script",rn="gtag-loader-script",wi="gtag-init-script";function Oa(e){document.getElementById(e)?.remove()}function W1(e){if(!/^\d{1,15}$/.test(e))return;try{localStorage.setItem("ym_counter_id",e)}catch{}if(document.getElementById(sn))return;const a=document.createElement("script");a.id=sn,a.type="text/javascript",a.textContent=` (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(${e}, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); `,document.head.appendChild(a)}function G1(e){if(!/^[A-Za-z0-9_-]{1,30}$/.test(e)||document.getElementById(rn))return;const a=document.createElement("script");a.id=rn,a.async=!0,a.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,document.head.appendChild(a);const n=document.createElement("script");n.id=wi,n.textContent=` window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '${e}'); `,document.head.appendChild(n)}function Q1(){const{data:e}=W({queryKey:["analytics-counters"],queryFn:be.getAnalyticsCounters,staleTime:3e5});l.useEffect(()=>{e&&(e.yandex_metrika_id?(W1(e.yandex_metrika_id),Y1(e.yandex_metrika_id),X1(e.yandex_metrika_id)):Oa(sn),e.google_ads_id?G1(e.google_ads_id):(Oa(rn),Oa(wi)))},[e])}function Y1(e){const a=window;typeof a.ym=="function"&&setTimeout(()=>{try{a.ym(Number(e),"getClientID",s=>{s&&gr(s)})}catch{}},2e3)}function X1(e){const a="ym_cid_sent";try{if(localStorage.getItem(a))return}catch{return}const n=window;typeof n.ym=="function"&&setTimeout(()=>{try{n.ym(Number(e),"getClientID",r=>{if(!r)return;gr(r);let o=null;try{o=localStorage.getItem("access_token")}catch{}o&&be.storeYandexCid(r).then(()=>{try{localStorage.setItem(a,"1")}catch{}}).catch(()=>{})})}catch{}},3e3)}function ug(e,a){const s=window.ym;if(typeof s=="function")try{const r=localStorage.getItem("ym_counter_id");r&&/^\d{1,15}$/.test(r)&&s(Number(r),"reachGoal",e,a)}catch{}}const J1={async get(){const{data:e}=await b.get("/cabinet/public/site-verification");return e}};function em(){l.useEffect(()=>{let e=!1;return J1.get().then(a=>{e||(a.apay_tag?tm("apay-tag",a.apay_tag):am("apay-tag"))}).catch(()=>{}),()=>{e=!0}},[])}function tm(e,a){let n=document.head.querySelector(`meta[name="${e}"]`);n||(n=document.createElement("meta"),n.setAttribute("name",e),document.head.appendChild(n)),n.setAttribute("content",a)}function am(e){const a=document.head.querySelector(`meta[name="${e}"]`);a&&a.remove()}const nm=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function ls(e){return nm.test(e)}var sm=Object.defineProperty,da=Object.getOwnPropertySymbols,ki=Object.prototype.hasOwnProperty,ji=Object.prototype.propertyIsEnumerable,ds=(e,a,n)=>a in e?sm(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,on=(e,a)=>{for(var n in a||(a={}))ki.call(a,n)&&ds(e,n,a[n]);if(da)for(var n of da(a))ji.call(a,n)&&ds(e,n,a[n]);return e},cn=(e,a)=>{var n={};for(var s in e)ki.call(e,s)&&a.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&da)for(var s of da(e))a.indexOf(s)<0&&ji.call(e,s)&&(n[s]=e[s]);return n};var it;(e=>{const a=class Q{constructor(i,c,u,m){if(this.version=i,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],iQ.MAX_VERSION)throw new RangeError("Version value out of range");if(m<-1||m>7)throw new RangeError("Mask value out of range");this.size=i*4+17;let h=[];for(let g=0;g7)throw new RangeError("Invalid value");let g,y;for(g=u;;g++){const N=Q.getNumDataCodewords(g,c)*8,v=d.getTotalBits(i,g);if(v<=N){y=v;break}if(g>=m)throw new RangeError("Data too long")}for(const N of[Q.Ecc.MEDIUM,Q.Ecc.QUARTILE,Q.Ecc.HIGH])f&&y<=Q.getNumDataCodewords(g,N)*8&&(c=N);let w=[];for(const N of i){n(N.mode.modeBits,4,w),n(N.numChars,N.mode.numCharCountBits(g),w);for(const v of N.getData())w.push(v)}r(w.length==y);const A=Q.getNumDataCodewords(g,c)*8;r(w.length<=A),n(0,Math.min(4,A-w.length),w),n(0,(8-w.length%8)%8,w),r(w.length%8==0);for(let N=236;w.lengthT[v>>>3]|=N<<7-(v&7)),new Q(g,c,T,h)}getModule(i,c){return 0<=i&&i>>9)*1335;const m=(c<<10|u)^21522;r(m>>>15==0);for(let h=0;h<=5;h++)this.setFunctionModule(8,h,s(m,h));this.setFunctionModule(8,7,s(m,6)),this.setFunctionModule(8,8,s(m,7)),this.setFunctionModule(7,8,s(m,8));for(let h=9;h<15;h++)this.setFunctionModule(14-h,8,s(m,h));for(let h=0;h<8;h++)this.setFunctionModule(this.size-1-h,8,s(m,h));for(let h=8;h<15;h++)this.setFunctionModule(8,this.size-15+h,s(m,h));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let u=0;u<12;u++)i=i<<1^(i>>>11)*7973;const c=this.version<<12|i;r(c>>>18==0);for(let u=0;u<18;u++){const m=s(c,u),h=this.size-11+u%3,f=Math.floor(u/3);this.setFunctionModule(h,f,m),this.setFunctionModule(f,h,m)}}drawFinderPattern(i,c){for(let u=-4;u<=4;u++)for(let m=-4;m<=4;m++){const h=Math.max(Math.abs(m),Math.abs(u)),f=i+m,g=c+u;0<=f&&f{(N!=y-h||S>=g)&&T.push(v[N])});return r(T.length==f),T}drawCodewords(i){if(i.length!=Math.floor(Q.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let m=0;m>>3],7-(c&7)),c++)}}r(c==i.length*8)}applyMask(i){if(i<0||i>7)throw new RangeError("Mask value out of range");for(let c=0;c5&&i++):(this.finderPenaltyAddHistory(g,y),f||(i+=this.finderPenaltyCountPatterns(y)*Q.PENALTY_N3),f=this.modules[h][w],g=1);i+=this.finderPenaltyTerminateAndCount(f,g,y)*Q.PENALTY_N3}for(let h=0;h5&&i++):(this.finderPenaltyAddHistory(g,y),f||(i+=this.finderPenaltyCountPatterns(y)*Q.PENALTY_N3),f=this.modules[w][h],g=1);i+=this.finderPenaltyTerminateAndCount(f,g,y)*Q.PENALTY_N3}for(let h=0;hf+(g?1:0),c);const u=this.size*this.size,m=Math.ceil(Math.abs(c*20-u*10)/u)-1;return r(0<=m&&m<=9),i+=m*Q.PENALTY_N4,r(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{const i=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(i*2-2))*2;let u=[6];for(let m=this.size-7;u.lengthQ.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*i+128)*i+64;if(i>=2){const u=Math.floor(i/7)+2;c-=(25*u-10)*u-55,i>=7&&(c-=36)}return r(208<=c&&c<=29648),c}static getNumDataCodewords(i,c){return Math.floor(Q.getNumRawDataModules(i)/8)-Q.ECC_CODEWORDS_PER_BLOCK[c.ordinal][i]*Q.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>255)throw new RangeError("Degree out of range");let c=[];for(let m=0;m0);for(const m of i){const h=m^u.shift();u.push(0),c.forEach((f,g)=>u[g]^=Q.reedSolomonMultiply(f,h))}return u}static reedSolomonMultiply(i,c){if(i>>>8||c>>>8)throw new RangeError("Byte out of range");let u=0;for(let m=7;m>=0;m--)u=u<<1^(u>>>7)*285,u^=(c>>>m&1)*i;return r(u>>>8==0),u}finderPenaltyCountPatterns(i){const c=i[1];r(c<=this.size*3);const u=c>0&&i[2]==c&&i[3]==c*3&&i[4]==c&&i[5]==c;return(u&&i[0]>=c*4&&i[6]>=c?1:0)+(u&&i[6]>=c*4&&i[0]>=c?1:0)}finderPenaltyTerminateAndCount(i,c,u){return i&&(this.finderPenaltyAddHistory(c,u),c=0),c+=this.size,this.finderPenaltyAddHistory(c,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(i,c){c[0]==0&&(i+=this.size),c.pop(),c.unshift(i)}};a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],a.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=a;function n(p,i,c){if(i<0||i>31||p>>>i)throw new RangeError("Value out of range");for(let u=i-1;u>=0;u--)c.push(p>>>u&1)}function s(p,i){return(p>>>i&1)!=0}function r(p){if(!p)throw new Error("Assertion error")}const o=class ue{constructor(i,c,u){if(this.mode=i,this.numChars=c,this.bitData=u,c<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(i){let c=[];for(const u of i)n(u,8,c);return new ue(ue.Mode.BYTE,i.length,c)}static makeNumeric(i){if(!ue.isNumeric(i))throw new RangeError("String contains non-numeric characters");let c=[];for(let u=0;u=1<{(a=>{const n=class{constructor(r,o){this.ordinal=r,this.formatBits=o}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),a.Ecc=n})(e.QrCode||(e.QrCode={}))})(it||(it={}));(e=>{(a=>{const n=class{constructor(r,o){this.modeBits=r,this.numBitsCharCount=o}numCharCountBits(r){return this.numBitsCharCount[Math.floor((r+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),a.Mode=n})(e.QrSegment||(e.QrSegment={}))})(it||(it={}));var ht=it;var rm={L:ht.QrCode.Ecc.LOW,M:ht.QrCode.Ecc.MEDIUM,Q:ht.QrCode.Ecc.QUARTILE,H:ht.QrCode.Ecc.HIGH},_i=128,Ni="L",Ci="#FFFFFF",Ai="#000000",Ei=!1,Ti=1,im=4,om=0,cm=.1;function Si(e,a=0){const n=[];return e.forEach(function(s,r){let o=null;s.forEach(function(d,p){if(!d&&o!==null){n.push(`M${o+a} ${r+a}h${p-o}v1H${o+a}z`),o=null;return}if(p===s.length-1){if(!d)return;o===null?n.push(`M${p+a},${r+a} h1v1H${p+a}z`):n.push(`M${o+a},${r+a} h${p+1-o}v1H${o+a}z`);return}d&&o===null&&(o=p)})}),n.join("")}function Li(e,a){return e.slice().map((n,s)=>s=a.y+a.h?n:n.map((r,o)=>o=a.x+a.w?r:!1))}function lm(e,a,n,s){if(s==null)return null;const r=e.length+n*2,o=Math.floor(a*cm),d=r/a,p=(s.width||o)*d,i=(s.height||o)*d,c=s.x==null?e.length/2-p/2:s.x*d,u=s.y==null?e.length/2-i/2:s.y*d,m=s.opacity==null?1:s.opacity;let h=null;if(s.excavate){let g=Math.floor(c),y=Math.floor(u),w=Math.ceil(p+c-g),A=Math.ceil(i+u-y);h={x:g,y,w,h:A}}const f=s.crossOrigin;return{x:c,y:u,h:i,w:p,excavation:h,opacity:m,crossOrigin:f}}function dm(e,a){return a!=null?Math.max(Math.floor(a),0):e?im:om}function Ii({value:e,level:a,minVersion:n,includeMargin:s,marginSize:r,imageSettings:o,size:d,boostLevel:p}){let i=se.useMemo(()=>{const g=(Array.isArray(e)?e:[e]).reduce((y,w)=>(y.push(...ht.QrSegment.makeSegments(w)),y),[]);return ht.QrCode.encodeSegments(g,rm[a],n,void 0,void 0,p)},[e,a,n,p]);const{cells:c,margin:u,numCells:m,calculatedImageSettings:h}=se.useMemo(()=>{let f=i.getModules();const g=dm(s,r),y=f.length+g*2,w=lm(f,d,g,o);return{cells:f,margin:g,numCells:y,calculatedImageSettings:w}},[i,d,o,s,r]);return{qrcode:i,margin:u,cells:c,numCells:m,calculatedImageSettings:h}}var um=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),mm=se.forwardRef(function(a,n){const s=a,{value:r,size:o=_i,level:d=Ni,bgColor:p=Ci,fgColor:i=Ai,includeMargin:c=Ei,minVersion:u=Ti,boostLevel:m,marginSize:h,imageSettings:f}=s,y=cn(s,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=y,A=cn(y,["style"]),T=f?.src,N=se.useRef(null),v=se.useRef(null),S=se.useCallback(ce=>{N.current=ce,typeof n=="function"?n(ce):n&&(n.current=ce)},[n]),[L,V]=se.useState(!1),{margin:O,cells:I,numCells:M,calculatedImageSettings:P}=Ii({value:r,level:d,minVersion:u,boostLevel:m,includeMargin:c,marginSize:h,imageSettings:f,size:o});se.useEffect(()=>{if(N.current!=null){const ce=N.current,re=ce.getContext("2d");if(!re)return;let he=I;const G=v.current,K=P!=null&&G!==null&&G.complete&&G.naturalHeight!==0&&G.naturalWidth!==0;K&&P.excavation!=null&&(he=Li(I,P.excavation));const B=window.devicePixelRatio||1;ce.height=ce.width=o*B;const D=o/M*B;re.scale(D,D),re.fillStyle=p,re.fillRect(0,0,M,M),re.fillStyle=i,um?re.fill(new Path2D(Si(he,O))):I.forEach(function(Z,le){Z.forEach(function(ve,we){ve&&re.fillRect(we+O,le+O,1,1)})}),P&&(re.globalAlpha=P.opacity),K&&re.drawImage(G,P.x+O,P.y+O,P.w,P.h)}}),se.useEffect(()=>{V(!1)},[T]);const $=on({height:o,width:o},w);let X=null;return T!=null&&(X=se.createElement("img",{src:T,key:T,style:{display:"none"},onLoad:()=>{V(!0)},ref:v,crossOrigin:P?.crossOrigin})),se.createElement(se.Fragment,null,se.createElement("canvas",on({style:$,height:o,width:o,ref:S,role:"img"},A)),X)});mm.displayName="QRCodeCanvas";var Ri=se.forwardRef(function(a,n){const s=a,{value:r,size:o=_i,level:d=Ni,bgColor:p=Ci,fgColor:i=Ai,includeMargin:c=Ei,minVersion:u=Ti,boostLevel:m,title:h,marginSize:f,imageSettings:g}=s,y=cn(s,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:A,numCells:T,calculatedImageSettings:N}=Ii({value:r,level:d,minVersion:u,boostLevel:m,includeMargin:c,marginSize:f,imageSettings:g,size:o});let v=A,S=null;g!=null&&N!=null&&(N.excavation!=null&&(v=Li(A,N.excavation)),S=se.createElement("image",{href:g.src,height:N.h,width:N.w,x:N.x+w,y:N.y+w,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const L=Si(v,w);return se.createElement("svg",on({height:o,width:o,viewBox:`0 0 ${T} ${T}`,ref:n,role:"img"},y),!!h&&se.createElement("title",null,h),se.createElement("path",{fill:p,d:`M0,0 h${T}v${T}H0z`,shapeRendering:"crispEdges"}),se.createElement("path",{fill:i,d:L,shapeRendering:"crispEdges"}),S)});Ri.displayName="QRCodeSVG";async function Pi(e){try{await navigator.clipboard.writeText(e)}catch{const a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.opacity="0",a.style.left="-9999px",document.body.appendChild(a);try{if(a.select(),!document.execCommand("copy"))throw new Error("execCommand copy failed")}finally{document.body.removeChild(a)}}}const us=2e3,Za=2500;function pm({referralCode:e}){const{t:a}=U(),n=ye(),s=l.useRef(null),[r,o]=l.useState(!1),[d,p]=l.useState(""),[i,c]=l.useState(!1),[u,m]=l.useState(!1),[h,f]=l.useState(!1),g=u||h,y=J(q=>q.loginWithTelegramOIDC),[w,A]=l.useState(null),[T,N]=l.useState(""),[v,S]=l.useState(!1),[L,V]=l.useState(""),[O,I]=l.useState(!1),M=l.useRef(null),P=l.useRef(null),$=l.useRef(null),X=l.useRef(!1),ce=J(q=>q.loginWithDeepLink),re=l.useRef(null),he=l.useRef(!1),{data:G}=W({queryKey:["telegram-widget-config"],queryFn:be.getTelegramWidgetConfig,staleTime:6e4}),K=G?.bot_username||""||"",B=!!(G?.oidc_enabled&&G?.oidc_client_id),D=l.useRef(void 0),Z=l.useRef(!0);l.useEffect(()=>(Z.current=!0,()=>{Z.current=!1}),[]),l.useEffect(()=>()=>{M.current&&clearTimeout(M.current),P.current&&clearTimeout(P.current),$.current&&clearTimeout($.current)},[]),D.current=async q=>{if(Z.current){if(q.error||!q.id_token){p(q.error||a("auth.loginFailed")),o(!1);return}try{o(!0),p(""),await y(q.id_token),Z.current&&n("/")}catch(Y){if(!Z.current)return;let z=a("common.error");La(Y)&&Y.response?.data?.detail&&(z=Y.response.data.detail),p(z)}finally{Z.current&&o(!1)}}};const le=l.useCallback(()=>{!Z.current||i||(m(!0),p(""))},[i]);l.useEffect(()=>{if(!B||!G?.oidc_client_id)return;const q="telegram-login-oidc-script";let Y=document.getElementById(q);const z=()=>{window.Telegram?.Login&&window.Telegram.Login.init({client_id:Number(G.oidc_client_id)||G.oidc_client_id,request_access:G.request_access?["write"]:void 0,lang:document.documentElement.lang||"en"},ne=>D.current?.(ne))},H=setTimeout(()=>{i||le()},us);return Y?(clearTimeout(H),c(!0),z()):(Y=document.createElement("script"),Y.id=q,Y.src="https://oauth.telegram.org/js/telegram-login.js?3",Y.async=!0,Y.onload=()=>{clearTimeout(H),c(!0),z()},Y.onerror=()=>{clearTimeout(H),le()},document.head.appendChild(Y)),()=>clearTimeout(H)},[B,G?.oidc_client_id,G?.request_access,i,le]);const ve=J(q=>q.loginWithTelegramWidget);l.useEffect(()=>{if(g||B||!s.current||!K||!G)return;const q=s.current;for(;q.firstChild;)q.removeChild(q.firstChild);const Y="__onTelegramWidgetAuth";window[Y]=async ne=>{try{await ve({id:ne.id,first_name:ne.first_name,last_name:ne.last_name||void 0,username:ne.username||void 0,photo_url:ne.photo_url||void 0,auth_date:ne.auth_date,hash:ne.hash}),n("/")}catch{}};const z=document.createElement("script");z.src="https://telegram.org/js/telegram-widget.js?23",z.setAttribute("data-telegram-login",K),z.setAttribute("data-size",G.size),z.setAttribute("data-radius",String(G.radius)),z.setAttribute("data-userpic",String(G.userpic)),z.setAttribute("data-onauth",`${Y}(user)`),G.request_access&&z.setAttribute("data-request-access","write"),z.async=!0;const H=setTimeout(()=>{q&&!q.querySelector("iframe")&&le()},us);return z.onerror=()=>{clearTimeout(H),le()},q.appendChild(z),()=>{for(clearTimeout(H),delete window[Y];q.firstChild;)q.removeChild(q.firstChild)}},[g,B,K,G,ve,n,le]);const we=l.useCallback(async()=>{V(""),M.current&&(clearTimeout(M.current),M.current=null),P.current&&(clearTimeout(P.current),P.current=null),X.current=!1;try{he.current||(re.current=Qe(),he.current=!0);const q=re.current,Y=await pe.requestDeepLinkToken(),{token:z,bot_username:H,expires_in:ne}=Y;A(z),N(H||K),S(!0);const ze=async()=>{if(!(!Z.current||X.current)){X.current=!0;try{await ce(z,q),P.current&&(clearTimeout(P.current),P.current=null),Z.current&&(S(!1),n("/"))}catch(Be){if(!Z.current)return;if(La(Be)){if(Be.response?.status===202){M.current=setTimeout(ze,Za);return}if(Be.response?.status===410){P.current&&(clearTimeout(P.current),P.current=null),S(!1),A(null),V(a("auth.deepLinkExpired"));return}}P.current&&(clearTimeout(P.current),P.current=null),S(!1),V(a("common.error"))}finally{X.current=!1}}};M.current=setTimeout(ze,Za),P.current=setTimeout(()=>{M.current&&(clearTimeout(M.current),M.current=null),Z.current&&!J.getState().isAuthenticated&&(S(!1),A(null),V(a("auth.deepLinkExpired")))},(ne||300)*1e3)}catch(q){V(a(ai(q)?"auth.botOutdated":"common.error"))}},[K,ce,n,a]);if(l.useEffect(()=>{if(g&&!w&&!v){let q=!1;return(async()=>q||await we())(),()=>{q=!0}}},[g,w,v,we]),l.useEffect(()=>{if(!v||!w)return;const q=()=>{if(document.visibilityState==="visible"&&Z.current){if(M.current&&(clearTimeout(M.current),M.current=null),X.current)return;const Y=re.current,z=async()=>{if(!(!Z.current||X.current)){X.current=!0;try{await ce(w,Y),P.current&&(clearTimeout(P.current),P.current=null),Z.current&&(S(!1),n("/"))}catch(H){if(!Z.current)return;if(La(H)){if(H.response?.status===202){M.current=setTimeout(z,Za);return}if(H.response?.status===410){P.current&&(clearTimeout(P.current),P.current=null),S(!1),A(null),V(a("auth.deepLinkExpired"));return}}P.current&&(clearTimeout(P.current),P.current=null),S(!1),V(a("common.error"))}finally{X.current=!1}}};z()}};return document.addEventListener("visibilitychange",q),()=>{document.removeEventListener("visibilitychange",q),M.current&&(clearTimeout(M.current),M.current=null)}},[v,w,ce,n,a]),!K||K==="your_bot")return t.jsx("div",{className:"py-4 text-center text-sm text-dark-400",children:a(G?.endpoint_missing?"auth.botOutdated":"auth.telegramNotConfigured")});if(g){const Y=w?`https://t.me/${T||K}?start=webauth_${w}`:"",z=w?`/start webauth_${w}`:"";return t.jsxs("div",{className:"flex flex-col items-center space-y-5",children:[t.jsx("p",{className:"max-w-xs text-center text-xs text-dark-400",children:a(u?"auth.telegramWidgetBlocked":"auth.deepLinkIntro")}),w&&Y?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[t.jsx("div",{className:"rounded-2xl bg-white p-4",children:t.jsx(Ri,{value:Y,size:180,level:"M",includeMargin:!1})}),t.jsx("p",{className:"text-[11px] text-dark-500",children:a("auth.scanQrToLogin")})]}),t.jsxs("a",{href:Y,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-lg bg-[#54a9eb] px-6 py-3 text-sm font-medium text-white shadow-sm transition-colors hover:bg-[#4a96d2]",children:[t.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),a("auth.openBotToLogin")]}),t.jsxs("div",{className:"flex w-full max-w-xs flex-col items-center space-y-1.5",children:[t.jsx("p",{className:"text-[11px] text-dark-500",children:a("auth.orSendCommand")}),t.jsxs("button",{type:"button",onClick:()=>{Pi(z).then(()=>{I(!0),$.current&&clearTimeout($.current),$.current=setTimeout(()=>I(!1),2e3)}).catch(()=>{})},className:"group flex w-full items-center justify-between rounded-lg border border-dark-700 bg-dark-800/50 px-3 py-2 transition-colors hover:border-dark-600",children:[t.jsx("code",{className:"truncate text-xs text-dark-300",children:z}),t.jsx("span",{className:"ml-2 flex-shrink-0 text-[10px] text-dark-500 transition-colors group-hover:text-dark-300",children:a(O?"auth.commandCopied":"common.copy")})]})]}),v&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-dark-400",children:[t.jsx("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-accent-500 border-t-transparent"}),a("auth.waitingForConfirmation")]})]}):L?t.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[t.jsx("p",{className:"text-xs text-error-500",children:L}),t.jsx("button",{type:"button",onClick:we,className:"text-sm text-accent-400 transition-colors hover:text-accent-300",children:a("auth.tryAgain")})]}):t.jsxs("div",{className:"flex items-center gap-2 text-xs text-dark-400",children:[t.jsx("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-accent-500 border-t-transparent"}),a("common.loading")]}),!u&&t.jsx("button",{type:"button",onClick:()=>{M.current&&clearTimeout(M.current),P.current&&clearTimeout(P.current),M.current=null,P.current=null,A(null),S(!1),V(""),f(!1)},className:"text-xs text-dark-400 underline decoration-dotted transition-colors hover:text-dark-300",children:a("auth.backToWidget")})]})}return t.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[B?t.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[t.jsxs("button",{type:"button",onClick:()=>{p(""),o(!0),window.Telegram?.Login?window.Telegram.Login.open():o(!1)},disabled:r||!i,className:"inline-flex items-center gap-2 rounded-lg bg-[#54a9eb] px-6 py-3 text-sm font-medium text-white shadow-sm transition-colors hover:bg-[#4a96d2] disabled:opacity-50",children:[t.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),a(r?"common.loading":"auth.loginWithTelegram")]}),d&&t.jsx("p",{className:"text-xs text-error-500",children:d})]}):t.jsx("div",{ref:s,className:"flex justify-center"}),e&&t.jsxs("a",{href:`https://t.me/${K}?start=${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",className:"text-telegram-blue inline-flex items-center text-xs hover:underline",children:[a("auth.orOpenInApp")," @",K]}),t.jsxs("div",{className:"flex w-full max-w-xs items-center gap-3",children:[t.jsx("div",{className:"h-px flex-1 bg-dark-700"}),t.jsx("span",{className:"text-[11px] text-dark-500",children:a("common.or")}),t.jsx("div",{className:"h-px flex-1 bg-dark-700"})]}),t.jsxs("button",{type:"button",onClick:()=>f(!0),className:"inline-flex items-center gap-2 rounded-lg border border-dark-700 bg-dark-800/50 px-6 py-3 text-sm font-medium text-dark-200 transition-colors hover:border-dark-600 hover:bg-dark-800",children:[t.jsx("svg",{className:"h-5 w-5 text-telegram-blue",viewBox:"0 0 24 24",fill:"currentColor",children:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),a("auth.loginWithBot")]})]})}function hm({provider:e,className:a="h-5 w-5"}){switch(e){case"google":return t.jsxs("svg",{className:a,viewBox:"0 0 24 24","aria-hidden":"true",children:[t.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),t.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),t.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),t.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]});case"yandex":return t.jsxs("svg",{className:a,viewBox:"0 0 24 24","aria-hidden":"true",children:[t.jsx("path",{d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12z",fill:"#FC3F1D"}),t.jsx("path",{d:"M13.63 7.56c-.7 0-1.2.18-1.6.52-.4.34-.6.85-.6 1.5 0 .5.13.92.38 1.26.25.34.68.73 1.29 1.16l.55.4-2.45 5.1H9.6l2.12-4.32c-.83-.57-1.43-1.12-1.8-1.66-.37-.54-.56-1.2-.56-1.96 0-1.03.35-1.85 1.04-2.47.7-.62 1.65-.93 2.87-.93H15.4V17.5h-1.77V7.56z",fill:"#fff"})]});case"discord":return t.jsx("svg",{className:a,viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 00.031.057 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028 14.09 14.09 0 001.226-1.994.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128 10.2 10.2 0 00.372-.292.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.01c.12.098.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z",fill:"#5865F2"})});case"vk":return t.jsxs("svg",{className:a,viewBox:"0 0 24 24","aria-hidden":"true",children:[t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2z",fill:"#0077FF"}),t.jsx("path",{d:"M12.76 16.42h.86s.26-.03.39-.17c.12-.13.12-.37.12-.37s-.02-1.14.51-1.31c.53-.16 1.2 1.08 1.92 1.56.54.36.96.28.96.28l1.93-.03s1.01-.06.53-.84c-.04-.06-.28-.58-1.45-1.64-1.22-1.1-1.06-.93.41-2.84.9-1.16 1.26-1.87 1.15-2.17-.1-.29-.76-.21-.76-.21l-2.17.01s-.16-.02-.28.05c-.12.07-.19.23-.19.23s-.35.93-.81 1.72c-.98 1.67-1.37 1.76-1.53 1.65-.37-.24-.28-1-.28-1.53 0-1.66.25-2.35-.49-2.53-.25-.06-.43-.1-1.06-.1-.81-.01-1.5 0-1.89.19-.26.13-.46.42-.34.44.15.02.5.09.68.34.24.32.23 1.04.23 1.04s.14 1.96-.32 2.2c-.31.17-.74-.17-1.66-1.7-.47-.78-.83-1.65-.83-1.65s-.07-.17-.19-.26c-.15-.11-.36-.14-.36-.14l-2.06.01s-.31.01-.42.14c-.1.12-.01.36-.01.36s1.63 3.81 3.47 5.74c1.69 1.77 3.61 1.65 3.61 1.65z",fill:"#fff"})]});default:return null}}const Nn="link_oauth_state",Cn="link_oauth_provider",An="oauth_state",En="oauth_provider";function fm(e,a){const n=ee.setItem(An,e),s=ee.setItem(En,a);return n&&s}function hg(e,a){const n=ee.setItem(Nn,e),s=ee.setItem(Cn,a);return n&&s}function gm(){const e=ee.getItem(An),a=ee.getItem(En);return!e||!a?null:{state:e,provider:a}}function xm(){ee.removeItem(An),ee.removeItem(En)}function bm(){const e=ee.getItem(Nn),a=ee.getItem(Cn);return!e||!a?null:{state:e,provider:a}}function ym(){ee.removeItem(Nn),ee.removeItem(Cn)}function Fa(e){if(e&&typeof e=="object"&&"response"in e){const n=e.response?.data?.detail;if(typeof n=="string")return n;if(n&&typeof n=="object"&&"message"in n){const s=n.message;if(typeof s=="string")return s}}return e instanceof Error?e.message:null}const vm=[{href:"/offer",labelKey:"footer.offer",fallback:"Публичная оферта"},{href:"/privacy",labelKey:"footer.privacy",fallback:"Политика конфиденциальности"},{href:"/recurrent-payments",labelKey:"footer.recurrent",fallback:"Рекуррентные платежи"}];function wm({className:e=""}){const{t:a}=U();return t.jsx("footer",{className:`flex flex-wrap items-center justify-center gap-x-2.5 gap-y-1 text-center text-[11px] leading-relaxed text-dark-500 ${e}`,children:vm.map((n,s)=>t.jsxs(l.Fragment,{children:[s>0&&t.jsx("span",{className:"text-dark-700","aria-hidden":"true",children:"·"}),t.jsx("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"transition-colors hover:text-accent-400",children:a(n.labelKey,n.fallback)})]},n.href))})}const km={public_offer:"/offer",privacy_policy:"/privacy"},jm={public_offer:{key:"footer.offer",fallback:"Публичная оферта"},privacy_policy:{key:"footer.privacy",fallback:"Политика конфиденциальности"}};function ms({documents:e,accepted:a,onChange:n,disabled:s=!1,className:r=""}){const{t:o}=U();return e.length===0?null:t.jsx("div",{className:`space-y-2.5 ${r}`,children:e.map(d=>{const p=jm[d],i=km[d],c=p?o(p.key,p.fallback):d,u=`legal-consent-${d}`;return t.jsxs("label",{htmlFor:u,className:"flex cursor-pointer items-start gap-2.5 text-xs leading-relaxed text-dark-400",children:[t.jsx("input",{id:u,type:"checkbox",checked:!!a[d],disabled:s,onChange:m=>n(d,m.target.checked),className:"mt-0.5 h-4 w-4 shrink-0 cursor-pointer rounded border-dark-600 bg-dark-800 text-accent-500 focus:ring-accent-500"}),t.jsxs("span",{children:[o("auth.legalConsentPrefix","Я ознакомлен(а) с документом")," ",i?t.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-accent-400 underline underline-offset-2 transition-colors hover:text-accent-300",onClick:m=>m.stopPropagation(),children:c}):t.jsx("span",{className:"text-dark-200",children:c})]})]},d)})})}function _m(){const{t:e,i18n:a}=U(),n=ye(),s=He(),{isAuthenticated:r,isLoading:o,loginWithTelegram:d,loginWithEmail:p,registerWithEmail:i}=J(ha(F=>({isAuthenticated:F.isAuthenticated,isLoading:F.isLoading,loginWithTelegram:F.loginWithTelegram,loginWithEmail:F.loginWithEmail,registerWithEmail:F.registerWithEmail}))),c=tt()||"",[u,m]=l.useState(()=>c?"register":"login"),[h,f]=l.useState(""),[g,y]=l.useState(""),[w,A]=l.useState(""),[T,N]=l.useState(""),[v,S]=l.useState(""),[L,V]=l.useState(!1),[O,I]=l.useState(!1),[M,P]=l.useState(()=>Mt()),[$,X]=l.useState(null),[ce,re]=l.useState(!1),[he,G]=l.useState(""),[K,B]=l.useState(!1),[D,Z]=l.useState(!1),[le,ve]=l.useState(""),[we,q]=l.useState(!0),{data:Y}=W({queryKey:["legal-consent-config",a.language],queryFn:()=>Lt.getLegalConsentConfig(a.language),staleTime:300*1e3,retry:!1}),z=l.useMemo(()=>Y?.documents??[],[Y]),[H,ne]=l.useState({}),[ze,Be]=l.useState(null);l.useEffect(()=>{!Y?.prechecked||z.length===0||ne(F=>{const ie={...F};for(const Se of z)ie[Se]===void 0&&(ie[Se]=!0);return ie})},[Y?.prechecked,z]);const ot=l.useMemo(()=>z.filter(F=>H[F]),[z,H]),Ln=z.length===0||ot.length===z.length,In=l.useCallback((F,ie)=>{ne(Se=>({...Se,[F]:ie}))},[]),Ea=l.useCallback((F,ie)=>{const Se=F;if(Se.response?.status!==428)return!1;const Ne=Se.response?.data?.detail;if(Ne?.documents?.length){const Oe=Ne.documents;ne(Ta=>{const et={...Ta};for(const lt of Oe)et[lt]===void 0&&(et[lt]=!!Ne.prechecked);return et})}return Be(()=>ie),!0},[]),{safeAreaInset:Rn,contentSafeAreaInset:Pn}=Vt(),zt=Math.max(Rn.top,Pn.top),Mn=Math.max(Rn.bottom,Pn.bottom),ct=l.useCallback(()=>{const F=s.state?.from;if(F&&F!=="/login")return F;const ie=qc();return ie&&ie!=="/login"?ie:"/"},[s.state]),$i=l.useMemo(()=>$t(),[]),{data:Je}=W({queryKey:["branding"],queryFn:async()=>{const F=await be.getBranding();return kn(F),await wa(F),F},staleTime:6e4,initialData:$i??void 0,initialDataUpdatedAt:0}),{data:Ui}=W({queryKey:["email-auth-enabled"],queryFn:be.getEmailAuthEnabled,staleTime:6e4}),Dn=Ui?.enabled??!0,{data:Ki}=W({queryKey:["footer-enabled"],queryFn:be.getFooterEnabled,staleTime:6e4}),{data:Vn}=W({queryKey:["oauth-providers"],queryFn:pe.getOAuthProviders,staleTime:6e4}),Hn=Array.isArray(Vn?.providers)?Vn.providers:[],[Bn,On]=l.useState(null),qi=async F=>{S(""),On(F);try{const{authorize_url:ie,state:Se}=await pe.getOAuthAuthorizeUrl(F);let Ne;try{Ne=new URL(ie)}catch{throw new Error("Invalid OAuth redirect URL")}if(Ne.protocol!=="https:")throw new Error("Invalid OAuth redirect URL");if(!fm(Se,F))throw new Error("OAuth state is not persistable");window.location.href=ie}catch{S(e("auth.oauthError","Authorization was denied or failed")),On(null)}},wt=Je?Je.name:"Cabinet",zi=Je?.logo_letter||"V",Zn=Je?be.getLogoUrl(Je):null;l.useEffect(()=>{document.title=wt||"VPN"},[wt]),l.useEffect(()=>{r&&n(ct(),{replace:!0})},[r,n,ct]),l.useEffect(()=>{if(o)return;(async()=>{const ie=sr();if(!Ee()||!ie)return;I(!0),V(!0);const Se=1;for(let Ne=0;Ne<=Se;Ne++)try{await d(ie),n(ct(),{replace:!0});return}catch(Oe){const et=Oe.response?.status,lt=Nt(Oe,"");if(Ea(Oe,async Sa=>{await d(ie,Sa),n(ct(),{replace:!0})})){V(!1);return}if(et===401&&NesetTimeout(Sa,1500));continue}S(lt||e("auth.telegramRequired"))}V(!1)})()},[o,d,n,e,ct,Ea]);const Wi=()=>{oe.clearTokens(),ee.removeItem("tapps/launchParams"),ee.removeItem("telegram_init_data"),fe.removeItem("cabinet-auth"),fe.removeItem("tg_user_id");try{Vs()}catch{window.location.reload()}},Gi=async F=>{if(F.preventDefault(),S(""),!h.trim()||!ls(h.trim())){S(e("auth.invalidEmail","Please enter a valid email address"));return}if(u==="register"){if(g!==w){S(e("auth.passwordMismatch","Passwords do not match"));return}if(g.length<8){S(e("auth.passwordTooShort","Password must be at least 8 characters"));return}}V(!0);try{if(u==="login")await p(h,g),n(ct(),{replace:!0});else{const ie=await i(h,g,T||void 0,c||void 0,ot);X(ie.email)}}catch(ie){const Ne=ie.response?.status,Oe=Nt(ie,"");if(Ea(ie,async et=>{const lt=await i(h,g,T||void 0,c||void 0,et);Be(null),X(lt.email)})){V(!1);return}Ne===400&&Oe.includes("already registered")?S(e("auth.emailAlreadyRegistered","This email is already registered")):Ne===401||Ne===403?Oe.includes("verify your email")?S(e("auth.emailNotVerified","Please verify your email first")):S(e("auth.invalidCredentials","Invalid email or password")):S(Ne===429?e("auth.tooManyAttempts","Too many attempts. Please try again later"):Oe||e("common.error"))}finally{V(!1)}},Qi=async F=>{if(F.preventDefault(),ve(""),!he.trim()||!ls(he.trim())){ve(e("auth.invalidEmail","Please enter a valid email address"));return}Z(!0);try{await pe.forgotPassword(he.trim()),B(!0)}catch(ie){ve(Nt(ie,e("common.error")))}finally{Z(!1)}},Fn=()=>{re(!1),G(""),B(!1),ve("")};return t.jsxs("div",{className:"flex min-h-[100dvh] items-center justify-center px-4 sm:px-6 lg:px-8",style:{paddingTop:zt>0?`${zt+16}px`:"calc(1rem + env(safe-area-inset-top, 0px))",paddingBottom:Mn>0?`${Mn+16}px`:"calc(1rem + env(safe-area-inset-bottom, 0px))"},children:[t.jsx("div",{className:"fixed right-3 z-50",style:{top:zt>0?`${zt+12}px`:"calc(12px + env(safe-area-inset-top, 0px))"},children:t.jsx(rt,{})}),t.jsxs("div",{className:"relative w-full max-w-md space-y-5",children:[t.jsxs("div",{className:"text-center",children:[t.jsxs("div",{className:"relative mx-auto mb-3 flex h-12 w-12 items-center justify-center overflow-hidden rounded-xl border border-dark-700/50 bg-dark-800/80 shadow-md",children:[t.jsx("span",{className:`absolute text-lg font-bold text-accent-400 transition-opacity duration-200 ${Je?.has_custom_logo&&M?"opacity-0":"opacity-100"}`,children:zi}),Je?.has_custom_logo&&Zn&&t.jsx("img",{src:Zn,alt:wt||"Logo",className:`absolute h-full w-full object-contain transition-opacity duration-200 ${M?"opacity-100":"opacity-0"}`,onLoad:()=>P(!0)})]}),wt&&t.jsx("h1",{className:"text-2xl font-bold text-dark-50",children:wt}),c&&Dn&&t.jsx("div",{className:"mt-3 rounded-xl border border-accent-500/30 bg-accent-500/10 p-2.5",children:t.jsxs("div",{className:"flex items-center justify-center gap-2 text-accent-400",children:[t.jsx(Zt,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e("auth.referralInvite")})]})})]}),ze?t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"mb-2 text-lg font-bold text-dark-50",children:e("auth.legalConsentTitle","Ещё один шаг")}),t.jsx("p",{className:"mb-4 text-sm text-dark-400",children:e("auth.legalConsentSubtitle","Чтобы создать аккаунт, подтвердите, что ознакомились с документами.")}),t.jsx(ms,{documents:z,accepted:H,onChange:In,disabled:L}),v&&t.jsx("p",{className:"mt-4 text-sm text-error-400",role:"alert",children:v}),t.jsx("button",{type:"button",className:"btn-primary mt-5 w-full",disabled:!Ln||L,onClick:async()=>{S(""),V(!0);try{await ze(ot),Be(null)}catch(F){S(Nt(F,e("common.error")))}finally{V(!1)}},children:L?e("common.loading","Загрузка..."):e("auth.legalConsentContinue","Продолжить")})]}):$?t.jsxs("div",{className:"card text-center",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-success-500/20",children:t.jsx(Da,{className:"h-7 w-7 text-success-400"})}),t.jsx("h2",{className:"mb-2 text-lg font-bold text-dark-50",children:e("auth.checkEmail","Check your email")}),t.jsx("p",{className:"mb-3 text-sm text-dark-400",children:e("auth.verificationSent","We sent a verification link to:")}),t.jsx("p",{className:"mb-4 text-sm font-medium text-accent-400",children:$}),t.jsx("p",{className:"mb-5 text-xs text-dark-500",children:e("auth.clickLinkToVerify","Click the link in the email to verify your account and log in.")}),t.jsx("button",{onClick:()=>{X(null),m("login")},className:"btn-secondary w-full",children:e("auth.backToLogin","Back to login")})]}):t.jsxs("div",{className:"card",children:[v&&t.jsx("div",{role:"alert",className:"mb-4 rounded-xl border border-error-500/30 bg-error-500/10 px-4 py-2.5 text-sm text-error-400",children:v}),t.jsx("div",{className:"space-y-3",children:L&&O?t.jsxs("div",{className:"py-6 text-center",children:[t.jsx("div",{className:"mx-auto mb-3 h-8 w-8 animate-spin rounded-full border-2 border-accent-500 border-t-transparent"}),t.jsx("p",{className:"text-sm text-dark-400",children:e("auth.authenticating")})]}):O&&v?t.jsxs("div",{className:"space-y-3 text-center",children:[t.jsxs("button",{onClick:Wi,className:"btn-primary mx-auto flex items-center gap-2 px-5 py-2.5",children:[t.jsx(qr,{className:"h-4 w-4"}),e("auth.tryAgain")]}),t.jsx("p",{className:"text-xs text-dark-500",children:e("auth.telegramReopenHint","If the problem persists, close and reopen the app")})]}):t.jsx(pm,{referralCode:c||void 0})}),Hn.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"my-4 flex items-center gap-3",children:[t.jsx("div",{className:"h-px flex-1 bg-dark-700"}),t.jsx("span",{className:"text-xs text-dark-500",children:e("auth.or","or")}),t.jsx("div",{className:"h-px flex-1 bg-dark-700"})]}),t.jsx("div",{className:"flex items-stretch gap-2",children:Hn.map(F=>t.jsxs("button",{type:"button",onClick:()=>qi(F.name),disabled:Bn!==null,className:"flex flex-1 flex-col items-center justify-center gap-1.5 rounded-xl border border-dark-700 bg-dark-800/80 py-2.5 transition-all hover:border-dark-600 hover:bg-dark-700 disabled:opacity-50",title:F.display_name,children:[Bn===F.name?t.jsx("span",{className:"h-5 w-5 animate-spin rounded-full border-2 border-dark-400 border-t-white"}):t.jsx(hm,{provider:F.name,className:"h-5 w-5"}),t.jsx("span",{className:"text-[10px] leading-none text-dark-500",children:F.display_name})]},F.name))})]}),Dn&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"my-4 flex items-center gap-3",children:[t.jsx("div",{className:"h-px flex-1 bg-dark-700"}),t.jsxs("button",{type:"button",onClick:()=>q(!we),className:"flex items-center gap-1.5 rounded-full border border-dark-700 bg-dark-800/60 px-3.5 py-1.5 text-xs font-medium text-dark-300 transition-all hover:border-dark-600 hover:bg-dark-700 hover:text-dark-200",children:[t.jsx(Da,{className:"h-3.5 w-3.5 text-dark-400"}),t.jsx("span",{children:e("auth.loginWithEmail")}),t.jsx(bn,{className:`h-3 w-3 text-dark-400 transition-transform duration-300 ${we?"rotate-180":""}`})]}),t.jsx("div",{className:"h-px flex-1 bg-dark-700"})]}),t.jsx("div",{className:`grid transition-[grid-template-rows] duration-300 ease-in-out ${we?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,style:{transform:"translateZ(0)"},children:t.jsx("div",{className:"overflow-hidden",children:t.jsx("div",{className:"space-y-4 pb-1 pt-1",children:ce?K?t.jsxs("div",{className:"space-y-4 text-center",children:[t.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-2xl bg-success-500/20",children:t.jsx(Da,{className:"h-6 w-6 text-success-400"})}),t.jsx("p",{className:"text-sm font-medium text-dark-100",children:e("auth.checkEmail","Check your email")}),t.jsx("p",{className:"text-xs text-dark-400",children:e("auth.passwordResetSent","If an account exists with this email, we sent password reset instructions.")}),t.jsx("button",{type:"button",onClick:Fn,className:"text-sm text-accent-400 transition-colors hover:text-accent-300",children:e("common.back","Back")})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("p",{className:"text-center text-sm text-dark-400",children:e("auth.forgotPasswordHint","Enter your email and we will send you instructions to reset your password.")}),t.jsxs("form",{onSubmit:Qi,className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:"forgotEmail",className:"label",children:"Email"}),t.jsx("input",{id:"forgotEmail",type:"email",value:he,onChange:F=>G(F.target.value),placeholder:"you@example.com",className:"input",autoFocus:!0})]}),le&&t.jsx("p",{className:"text-sm text-error-400",children:le}),t.jsx("button",{type:"submit",disabled:D,className:"btn-primary w-full py-2.5",children:D?t.jsxs("span",{className:"flex items-center justify-center gap-2",children:[t.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white"}),e("common.loading")]}):e("auth.sendResetLink","Send reset link")})]}),t.jsx("div",{className:"text-center",children:t.jsx("button",{type:"button",onClick:Fn,className:"text-sm text-dark-400 transition-colors hover:text-dark-200",children:e("common.back","Back")})})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex rounded-lg bg-dark-800 p-1",children:[t.jsx("button",{type:"button",className:`flex-1 rounded-md py-2 text-sm font-medium transition-all ${u==="login"?"bg-accent-500 text-on-accent":"text-dark-400 hover:text-dark-200"}`,onClick:()=>m("login"),children:e("auth.login")}),t.jsx("button",{type:"button",className:`flex-1 rounded-md py-2 text-sm font-medium transition-all ${u==="register"?"bg-accent-500 text-on-accent":"text-dark-400 hover:text-dark-200"}`,onClick:()=>m("register"),children:e("auth.register","Register")})]}),t.jsxs("form",{className:"space-y-3",onSubmit:Gi,children:[u==="register"&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:"firstName",className:"label",children:e("auth.firstName","First Name")}),t.jsx("input",{id:"firstName",name:"firstName",type:"text",autoComplete:"given-name",className:"input",placeholder:e("auth.firstNamePlaceholder","Your name (optional)"),value:T,onChange:F=>N(F.target.value)})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"email",className:"label",children:e("auth.email")}),t.jsx("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,className:"input",placeholder:"you@example.com",value:h,onChange:F=>f(F.target.value)})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"password",className:"label",children:e("auth.password")}),t.jsx("input",{id:"password",name:"password",type:"password",autoComplete:u==="login"?"current-password":"new-password",required:!0,className:"input",placeholder:"••••••••",value:g,onChange:F=>y(F.target.value)}),u==="register"&&g.length>0&&g.length<8&&t.jsx("p",{className:"mt-1.5 text-xs text-error-400",children:e("auth.passwordTooShort","Password must be at least 8 characters")})]}),u==="register"&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:"confirmPassword",className:"label",children:e("auth.confirmPassword","Confirm Password")}),t.jsx("input",{id:"confirmPassword",name:"confirmPassword",type:"password",autoComplete:"new-password",required:!0,className:"input",placeholder:"••••••••",value:w,onChange:F=>A(F.target.value)})]}),u==="register"&&t.jsx(ms,{documents:z,accepted:H,onChange:In,disabled:L,className:"pt-1"}),t.jsx("button",{type:"submit",disabled:L||u==="register"&&!Ln,className:"btn-primary w-full py-2.5",children:L?t.jsxs("span",{className:"flex items-center justify-center gap-2",children:[t.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white"}),e("common.loading")]}):u==="login"?e("auth.login"):e("auth.register","Register")})]}),u==="register"&&t.jsx("p",{className:"text-center text-xs text-dark-500",children:e("auth.verificationEmailNotice","After registration, a verification email will be sent to your address")}),u==="login"&&t.jsx("div",{className:"text-center",children:t.jsx("button",{type:"button",onClick:()=>re(!0),className:"text-sm text-accent-400 transition-colors hover:text-accent-300",children:e("auth.forgotPassword","Forgot password?")})})]})})})})]})]}),Ki&&t.jsx(wm,{className:"pt-1"})]})]})}function Nm(){const{t:e}=U(),a=ye(),[n]=xt(),[s,r]=l.useState(""),o=J(p=>p.loginWithTelegramWidget),d=J(p=>p.isAuthenticated);return l.useEffect(()=>{if(d){a("/");return}(async()=>{const i=n.get("id"),c=n.get("first_name"),u=n.get("last_name"),m=n.get("username"),h=n.get("photo_url"),f=n.get("auth_date"),g=n.get("hash");if(!i||!c||!f||!g){r(e("auth.telegramRequired"));return}const y=parseInt(i,10),w=parseInt(f,10);if(Number.isNaN(y)||Number.isNaN(w)){r(e("auth.telegramRequired"));return}try{await o({id:y,first_name:c,last_name:u||void 0,username:m||void 0,photo_url:h||void 0,auth_date:w,hash:g}),a("/")}catch(A){r(A.response?.data?.detail||e("common.error"))}})()},[n,o,a,d,e]),s?t.jsx("div",{className:"min-h-viewport flex items-center justify-center bg-dark-950 px-4 py-8",children:t.jsxs("div",{className:"w-full max-w-md text-center",children:[t.jsx("div",{className:"mb-4 text-5xl text-error-500",children:"✗"}),t.jsx("h2",{className:"mb-2 text-lg font-semibold text-dark-50",children:e("auth.loginFailed")}),t.jsx("p",{className:"mb-6 text-sm text-dark-400",children:s}),t.jsx("button",{onClick:()=>a("/login"),className:"btn-primary",children:e("auth.tryAgain")})]})}):t.jsx("div",{className:"min-h-viewport flex items-center justify-center bg-dark-950",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-2 border-accent-500 border-t-transparent"}),t.jsx("h2",{className:"text-lg font-semibold text-dark-50",children:e("auth.authenticating")}),t.jsx("p",{className:"mt-2 text-sm text-dark-400",children:e("common.loading")})]})})}function Cm(e){if(!e||!e.startsWith("/")||e.startsWith("//"))return"/";try{const a=decodeURIComponent(e);if(!a.startsWith("/")||a.startsWith("//")||a.includes("://"))return"/"}catch{return"/"}return e}const Am=3,Yt="telegram_redirect_retry_count";function ps(){const{t:e}=U(),a=ye(),[n]=xt(),{loginWithTelegram:s,isAuthenticated:r,isLoading:o}=J(ha(T=>({loginWithTelegram:T.loginWithTelegram,isAuthenticated:T.isAuthenticated,isLoading:T.isLoading}))),[d,p]=l.useState("loading"),[i,c]=l.useState(""),[u,m]=l.useState(()=>{const T=ee.getItem(Yt);return T?parseInt(T,10):0}),{data:h}=W({queryKey:["branding"],queryFn:be.getBranding,staleTime:6e4}),f=h?h.name:"Cabinet",g=h?.logo_letter||"V",y=h?be.getLogoUrl(h):null,w=Cm(n.get("redirect"));l.useEffect(()=>{const T=[],N=(S,L)=>{T.push(setTimeout(S,L))};return r&&!o?(p("success"),N(()=>a(w),500),()=>T.forEach(clearTimeout)):(N(async()=>{const S=sr();if(!Ee()||!S){p("not-telegram"),N(()=>a("/login"),2e3);return}try{await s(S),p("success"),N(()=>a(w),800)}catch(L){console.error("Telegram auth failed:",L),c(L.response?.data?.detail||e("auth.telegramRequired")),p("error")}},300),()=>T.forEach(clearTimeout))},[s,a,r,o,w,e]);const A=()=>{if(u>=Am){c(e("telegramRedirect.maxRetries")),ee.removeItem(Yt);return}const T=u+1;if(m(T),!ee.setItem(Yt,String(T))){c(e("telegramRedirect.maxRetries"));return}oe.clearTokens(),ee.removeItem("tapps/launchParams"),ee.removeItem("telegram_init_data"),fe.removeItem("cabinet-auth"),fe.removeItem("tg_user_id"),p("loading"),c(""),window.location.reload()};return l.useEffect(()=>{d==="success"&&ee.removeItem(Yt)},[d]),t.jsxs("div",{className:"min-h-viewport flex items-center justify-center p-4",children:[t.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-dark-950 via-dark-900 to-dark-950"}),t.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-accent-500/10 via-transparent to-transparent"}),t.jsxs("div",{className:"relative w-full max-w-sm text-center",children:[t.jsx("div",{className:"mx-auto mb-6 flex h-20 w-20 items-center justify-center overflow-hidden rounded-2xl bg-gradient-to-br from-accent-400 to-accent-600 shadow-lg shadow-accent-500/30",children:h?.has_custom_logo&&y?t.jsx("img",{src:y,alt:f,className:"h-full w-full object-cover"}):t.jsx("span",{className:"text-3xl font-bold text-white",children:g})}),t.jsx("h1",{className:"mb-2 text-2xl font-bold text-dark-50",children:f}),d==="loading"&&t.jsxs("div",{className:"mt-8",children:[t.jsx("div",{className:"border-3 mx-auto mb-4 h-10 w-10 animate-spin rounded-full border-accent-500 border-t-transparent"}),t.jsx("p",{className:"text-dark-400",children:e("auth.authenticating")}),t.jsx("p",{className:"mt-2 text-sm text-dark-500",children:e("common.loading")})]}),d==="success"&&t.jsxs("div",{className:"mt-8",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-success-500/20",children:t.jsx(Pe,{className:"h-8 w-8 text-success-400"})}),t.jsx("p",{className:"text-dark-200",children:e("auth.loginSuccess")}),t.jsx("p",{className:"mt-2 text-sm text-dark-500",children:e("telegramRedirect.redirecting")})]}),d==="error"&&t.jsxs("div",{className:"mt-8",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-error-500/20",children:t.jsx(zr,{className:"h-8 w-8 text-error-400"})}),t.jsx("p",{className:"mb-2 text-dark-200",children:e("auth.loginFailed")}),t.jsx("p",{className:"mb-6 text-sm text-error-400",children:i}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("button",{onClick:A,className:"btn-primary w-full",children:e("auth.tryAgain")}),t.jsx("button",{onClick:()=>a("/login"),className:"btn-secondary w-full",children:e("telegramRedirect.loginAlternative")})]})]}),d==="not-telegram"&&t.jsxs("div",{className:"mt-8",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-warning-500/20",children:t.jsx(Ht,{className:"h-8 w-8 text-warning-400"})}),t.jsx("p",{className:"mb-2 text-dark-200",children:e("telegramRedirect.openInTelegram")}),t.jsx("p",{className:"mb-6 text-sm text-dark-400",children:e("telegramRedirect.openInTelegramDesc")}),t.jsx("p",{className:"text-sm text-dark-500",children:e("telegramRedirect.redirectToLogin")})]}),t.jsxs("div",{className:"mt-12 flex items-center justify-center gap-2 text-dark-600",children:[t.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),t.jsx("span",{className:"text-xs",children:"Telegram Mini App"})]})]})]})}function Em(){if(typeof navigator>"u")return!1;const e=navigator.userAgent||"";return/iP(ad|hone|od)/.test(e)?!0:navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1}function Tm(e){if(!/^[a-z][a-z0-9+.-]*:\/\//i.test(e)||/^(javascript|data|vbscript|file|blob|about|intent|content|filesystem):/i.test(e))return;if(/^https?:\/\//i.test(e)){window.location.href=e;return}if(Em()){window.location.href=e;return}try{const n=document.createElement("iframe");n.style.display="none",n.src=e,document.body.appendChild(n),window.setTimeout(()=>{try{n.remove()}catch{}},2e3)}catch{window.location.href=e}}const Mi=[{scheme:"happ://",icon:"H",name:"Happ"},{scheme:"incy://",icon:"I",name:"INCY"},{scheme:"flclash://",icon:"F",name:"FlClash"},{scheme:"clash://",icon:"C",name:"Clash Meta"},{scheme:"sing-box://",icon:"S",name:"sing-box"},{scheme:"v2rayng://",icon:"V",name:"v2rayNG"},{scheme:"sub://",icon:"R",name:"Shadowrocket"},{scheme:"shadowrocket://",icon:"R",name:"Shadowrocket"},{scheme:"hiddify://",icon:"H",name:"Hiddify"},{scheme:"streisand://",icon:"S",name:"Streisand"},{scheme:"quantumult://",icon:"Q",name:"Quantumult X"},{scheme:"surge://",icon:"S",name:"Surge"},{scheme:"loon://",icon:"L",name:"Loon"},{scheme:"nekobox://",icon:"N",name:"NekoBox"},{scheme:"v2box://",icon:"V",name:"V2Box"}],$a=5,hs=e=>{if(!e)return!1;const a=e.toLowerCase().trim();return["javascript:","data:","vbscript:","file:"].some(s=>a.startsWith(s))?!1:Mi.some(s=>a.startsWith(s.scheme))};function fs(){const{t:e}=U(),a=ye(),[n]=xt(),[s,r]=l.useState("countdown"),[o,d]=l.useState($a),[p,i]=l.useState(!1),c=l.useRef(null),u=l.useRef(null),{data:m}=W({queryKey:["branding"],queryFn:be.getBranding,staleTime:6e4}),h=m?m.name:"Cabinet",f=m?.logo_letter||"V",g=m?be.getLogoUrl(m):null,y=I=>{const M=window.location.search.substring(1);for(const P of M.split("&")){const $=P.indexOf("=");if($!==-1&&decodeURIComponent(P.substring(0,$))===I)return decodeURIComponent(P.substring($+1))}return""},w=y("url")||y("deeplink")||"",A=y("sub")||"",T=n.get("app")||"",N=w?Mi.find(I=>w.toLowerCase().startsWith(I.scheme)):null,v=N?.name||T||"VPN",S=N?.icon||v[0]?.toUpperCase()||"V",L=l.useCallback(()=>{!w||!hs(w)||Tm(w)},[w]);l.useEffect(()=>{if(!w||!hs(w)){r("error");return}if(s!=="countdown")return;const I=setInterval(()=>{d(M=>M<=1?(clearInterval(I),L(),c.current=setTimeout(()=>r("fallback"),2e3),0):M-1)},1e3);return()=>{clearInterval(I),c.current&&(clearTimeout(c.current),c.current=null)}},[w,s,L]);const V=async()=>{const I=A||w;u.current&&clearTimeout(u.current),await Pi(I),i(!0),u.current=setTimeout(()=>i(!1),2e3)};l.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const O=($a-o)/$a*100;return t.jsxs("div",{className:"min-h-viewport flex items-center justify-center p-4",children:[t.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-dark-950 via-dark-900 to-dark-950"}),t.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-accent-500/10 via-transparent to-transparent"}),t.jsxs("div",{className:"relative w-full max-w-sm text-center",children:[t.jsx("div",{className:"mx-auto mb-6 flex h-20 w-20 animate-pulse items-center justify-center overflow-hidden rounded-2xl bg-gradient-to-br from-accent-400 to-accent-600 shadow-lg shadow-accent-500/30",children:m?.has_custom_logo&&g?t.jsx("img",{src:g,alt:h||"Logo",className:"h-full w-full object-cover"}):t.jsx("span",{className:"text-3xl font-bold text-white",children:f})}),t.jsx("h1",{className:"mb-1 text-2xl font-bold text-dark-50",children:h||"VPN"}),s!=="error"&&t.jsxs("p",{className:"mb-6 text-dark-400",children:[e("deepLink.connecting")," ",v,"..."]}),s==="countdown"&&t.jsxs("div",{className:"card !bg-dark-800/80 p-6 backdrop-blur-sm",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-accent-500/20",children:t.jsx("span",{className:"text-2xl font-bold text-accent-400",children:S})}),t.jsx("div",{className:"border-3 mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-dark-700 border-t-accent-500"}),t.jsxs("div",{className:"mb-4",children:[t.jsx("p",{className:"mb-2 text-sm text-dark-500",children:e("deepLink.redirecting")}),t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx("span",{className:"text-4xl font-bold text-accent-400",children:o}),t.jsx("span",{className:"text-dark-400",children:e("deepLink.seconds")})]})]}),t.jsx("div",{className:"mb-4 h-1.5 w-full overflow-hidden rounded-full bg-dark-700",children:t.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-accent-400 to-accent-600 transition-all duration-1000 ease-linear",style:{width:`${O}%`}})}),t.jsx("p",{className:"mb-4 text-sm text-dark-500",children:e("deepLink.manual")}),t.jsxs("button",{onClick:L,className:"btn-primary flex w-full items-center justify-center gap-2 py-3",children:[t.jsx(as,{className:"h-5 w-5"}),e("deepLink.openApp")]})]}),s==="fallback"&&t.jsxs("div",{className:"card !bg-dark-800/80 p-6 backdrop-blur-sm",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-accent-500/20",children:t.jsx("span",{className:"text-2xl font-bold text-accent-400",children:S})}),t.jsxs("div",{className:"space-y-3",children:[t.jsx("button",{onClick:V,className:"btn-primary flex w-full items-center justify-center gap-2 py-3",children:p?t.jsxs(t.Fragment,{children:[t.jsx(Pe,{className:"h-5 w-5"}),e("deepLink.copied")]}):t.jsxs(t.Fragment,{children:[t.jsx(Gd,{className:"h-5 w-5"}),e("deepLink.copyLink")]})}),t.jsxs("button",{onClick:L,className:"btn-secondary flex w-full items-center justify-center gap-2",children:[t.jsx(as,{className:"h-5 w-5"}),e("deepLink.tryAgain")]}),t.jsx("button",{onClick:()=>a("/subscriptions"),className:"w-full py-2 text-sm text-dark-500 transition-colors hover:text-dark-300",children:e("deepLink.backToCabinet")})]}),t.jsxs("div",{className:"mt-6 rounded-xl border border-dark-700 bg-dark-900/50 p-4 text-left",children:[t.jsx("h3",{className:"mb-2 text-sm font-medium text-dark-200",children:e("deepLink.howToAdd")}),t.jsxs("ol",{className:"list-inside list-decimal space-y-1.5 text-xs text-dark-400",children:[t.jsx("li",{children:e("deepLink.step1")}),t.jsxs("li",{children:[e("deepLink.step2")," ",v]}),t.jsx("li",{children:e("deepLink.step3")}),t.jsx("li",{children:e("deepLink.step4")})]})]})]}),s==="error"&&t.jsxs("div",{className:"card !bg-dark-800/80 p-6 backdrop-blur-sm",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-error-500/20",children:t.jsx(Ht,{className:"h-8 w-8 text-error-400"})}),t.jsx("p",{className:"mb-2 font-medium text-dark-200",children:e("deepLink.errorTitle")}),t.jsx("p",{className:"mb-6 text-sm text-dark-400",children:e("deepLink.errorDesc")}),t.jsx("button",{onClick:()=>a("/subscriptions"),className:"btn-primary w-full",children:e("deepLink.goToSubscription")})]}),t.jsxs("div",{className:"mt-8 flex items-center justify-center gap-2 text-dark-600",children:[t.jsx(Od,{className:"h-4 w-4"}),t.jsx("span",{className:"text-xs",children:"VPN Config Redirect"})]})]})]})}function Sm(){const{t:e}=U(),a=ye(),[n]=xt(),[s,r]=l.useState("loading"),[o,d]=l.useState(""),{setTokens:p,setUser:i,checkAdminStatus:c}=J(ha(m=>({setTokens:m.setTokens,setUser:m.setUser,checkAdminStatus:m.checkAdminStatus}))),u=l.useRef(!1);return l.useEffect(()=>{if(u.current)return;const m=n.get("token");if(!m){r("error"),d(e("common.error"));return}u.current=!0;let h;return(async()=>{try{const g=Qe(),y=await pe.verifyEmail(m,g);mt(),oe.setTokens(y.access_token,y.refresh_token),p(y.access_token,y.refresh_token),i(y.user),y.campaign_bonus&&J.setState({pendingCampaignBonus:y.campaign_bonus}),c(),r("success"),h=setTimeout(()=>a("/",{replace:!0}),1500)}catch(g){r("error"),d(g.response?.data?.detail||e("emailVerification.failed"))}})(),()=>clearTimeout(h)},[n,e,a,p,i,c]),t.jsxs("div",{className:"min-h-viewport flex items-center justify-center bg-dark-950 px-4 py-8 sm:py-12",children:[t.jsx("div",{className:"fixed right-4 top-4 z-50",children:t.jsx(rt,{})}),t.jsxs("div",{className:"w-full max-w-md text-center",children:[s==="loading"&&t.jsxs("div",{children:[t.jsx("div",{className:"mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-2 border-accent-500 border-t-transparent"}),t.jsx("h2",{className:"text-lg font-semibold text-dark-50 sm:text-xl",children:e("emailVerification.verifying")}),t.jsx("p",{className:"mt-2 text-sm text-dark-400 sm:text-base",children:e("emailVerification.pleaseWait")})]}),s==="success"&&t.jsxs("div",{children:[t.jsx("div",{className:"mb-4 text-5xl text-success-500 sm:text-6xl",children:"✓"}),t.jsx("h2",{className:"text-lg font-semibold text-dark-50 sm:text-xl",children:e("emailVerification.success")}),t.jsx("p",{className:"mt-2 text-sm text-dark-400 sm:text-base",children:e("emailVerification.redirecting","Redirecting to dashboard...")}),t.jsx("div",{className:"mt-4",children:t.jsx("div",{className:"mx-auto h-6 w-6 animate-spin rounded-full border-2 border-accent-500 border-t-transparent"})})]}),s==="error"&&t.jsxs("div",{children:[t.jsx("div",{className:"mb-4 text-5xl text-error-500 sm:text-6xl",children:"✗"}),t.jsx("h2",{className:"text-lg font-semibold text-dark-50 sm:text-xl",children:e("emailVerification.failed")}),t.jsx("p",{className:"mt-2 text-sm text-dark-400 sm:text-base",children:o}),t.jsx("div",{className:"mt-6",children:t.jsx(de,{to:"/login",className:"btn-secondary",children:e("emailVerification.goToLogin")})})]})]})]})}function Lm(){const{t:e}=U(),a=ye(),[n]=xt(),s=n.get("token"),[r,o]=l.useState(""),[d,p]=l.useState(""),[i,c]=l.useState("form"),[u,m]=l.useState(""),h=l.useRef(void 0);l.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=async g=>{if(g.preventDefault(),m(""),!s){m(e("resetPassword.invalidToken","Invalid or missing reset token"));return}if(r.length<8){m(e("auth.passwordTooShort","Password must be at least 8 characters"));return}if(r!==d){m(e("auth.passwordMismatch","Passwords do not match"));return}c("loading");try{await pe.resetPassword(s,r),c("success"),h.current=setTimeout(()=>a("/login",{replace:!0}),2e3)}catch(y){c("error"),m(y.response?.data?.detail||e("common.error"))}};return s?t.jsxs("div",{className:"min-h-viewport flex items-center justify-center px-4 py-8 sm:py-12",children:[t.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-dark-950 via-dark-900 to-dark-950"}),t.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-accent-500/10 via-transparent to-transparent"}),t.jsx("div",{className:"fixed right-4 top-4 z-50",children:t.jsx(rt,{})}),t.jsx("div",{className:"relative w-full max-w-md",children:t.jsx("div",{className:"card",children:i==="success"?t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-success-500/20",children:t.jsx(Pe,{className:"h-8 w-8 text-success-400"})}),t.jsx("h2",{className:"mb-2 text-xl font-bold text-dark-50",children:e("resetPassword.success","Password changed!")}),t.jsx("p",{className:"mb-4 text-dark-400",children:e("resetPassword.redirectingToLogin","Redirecting to login...")}),t.jsx("div",{className:"mx-auto h-6 w-6 animate-spin rounded-full border-2 border-accent-500 border-t-transparent"})]}):t.jsxs(t.Fragment,{children:[t.jsx("h2",{className:"mb-2 text-center text-xl font-bold text-dark-50",children:e("resetPassword.title","Set new password")}),t.jsx("p",{className:"mb-6 text-center text-dark-400",children:e("resetPassword.enterNewPassword","Enter your new password below.")}),t.jsxs("form",{onSubmit:f,className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:"password",className:"label",children:e("auth.password","Password")}),t.jsx("input",{id:"password",type:"password",value:r,onChange:g=>o(g.target.value),placeholder:"••••••••",className:"input",autoComplete:"new-password",disabled:i==="loading"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"confirmPassword",className:"label",children:e("auth.confirmPassword","Confirm Password")}),t.jsx("input",{id:"confirmPassword",type:"password",value:d,onChange:g=>p(g.target.value),placeholder:"••••••••",className:"input",autoComplete:"new-password",disabled:i==="loading"})]}),u&&t.jsx("div",{role:"alert",className:"rounded-xl border border-error-500/30 bg-error-500/10 px-4 py-3 text-sm text-error-400",children:u}),t.jsx("button",{type:"submit",disabled:i==="loading",className:"btn-primary w-full",children:i==="loading"?t.jsxs("span",{className:"flex items-center justify-center gap-2",children:[t.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white"}),e("common.loading")]}):e("resetPassword.setPassword","Set new password")})]}),t.jsx("div",{className:"mt-4 text-center",children:t.jsx(de,{to:"/login",className:"text-sm text-dark-400 transition-colors hover:text-dark-200",children:e("auth.backToLogin","Back to login")})})]})})})]}):t.jsxs("div",{className:"min-h-viewport flex items-center justify-center px-4 py-8 sm:py-12",children:[t.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-dark-950 via-dark-900 to-dark-950"}),t.jsx("div",{className:"fixed right-4 top-4 z-50",children:t.jsx(rt,{})}),t.jsx("div",{className:"relative w-full max-w-md text-center",children:t.jsxs("div",{className:"card",children:[t.jsx("div",{className:"mb-4 text-5xl text-error-400",children:"!"}),t.jsx("h2",{className:"mb-2 text-xl font-semibold text-dark-50",children:e("resetPassword.invalidToken","Invalid reset link")}),t.jsx("p",{className:"mb-6 text-dark-400",children:e("resetPassword.tokenExpiredOrInvalid","This password reset link is invalid or has expired.")}),t.jsx(de,{to:"/login",className:"btn-primary inline-block w-full",children:e("auth.backToLogin","Back to login")})]})})]})}const gs=e=>uo.sanitize(e,{ALLOWED_TAGS:["p","br","b","i","u","strong","em","a","ul","ol","li","h1","h2","h3","h4","h5","h6","blockquote","code","pre","s","del","ins","span","div","tg-spoiler"],ALLOWED_ATTR:["href","target","rel","class","start"],ALLOW_DATA_ATTR:!1}),Im=e=>{if(!e)return"";if(/<(p|div|h[1-6]|ul|ol|blockquote)\b/i.test(e))return gs(e);const n=e.split(/\n\n+/).map(s=>{const r=s.trim();if(!r)return"";if(/^#{1,4}\s/.test(r)){const d=r.match(/^(#{1,4})/)?.[1].length||1,p=r.replace(/^#{1,4}\s*/,"");return`${p}`}if(/^[-•]\s/.test(r)||/^\d+[.)]\s/.test(r)){const d=r.split(` `),p=/^\d+[.)]\s/.test(d[0]),i=p?parseInt(d[0].match(/^(\d+)/)?.[1]||"1",10):1,c=d.map(u=>u.replace(/^[-•]\s*/,"").replace(/^\d+[.)]\s*/,"")).filter(u=>u.trim()).map(u=>`
  • ${u}
  • `).join("");return p?`
      ${c}
    `:`
      ${c}
    `}return`

    ${r.split(` `).join("
    ")}

    `}).filter(Boolean).join("");return gs(n)},Rm={offer:{queryKey:"public-offer",titleKey:"footer.offer",titleFallback:"Публичная оферта",fetch:Lt.getPublicOffer},privacy:{queryKey:"privacy-policy",titleKey:"footer.privacy",titleFallback:"Политика конфиденциальности",fetch:Lt.getPrivacyPolicy},recurrent:{queryKey:"recurrent-payments",titleKey:"footer.recurrent",titleFallback:"Рекуррентные платежи",fetch:Lt.getRecurrentPayments}};function Ua({doc:e}){const{t:a}=U(),n=Rm[e],{data:s,isLoading:r,isError:o}=W({queryKey:["public-legal",n.queryKey],queryFn:n.fetch,staleTime:300*1e3}),d=a(n.titleKey,n.titleFallback);return t.jsxs("div",{className:"min-h-viewport bg-dark-950 px-4 py-8 sm:py-12",children:[t.jsx("div",{className:"fixed right-4 top-4 z-50",children:t.jsx(rt,{})}),t.jsxs("div",{className:"mx-auto w-full max-w-3xl",children:[t.jsx("h1",{className:"mb-6 text-2xl font-semibold text-dark-100",children:d}),r?t.jsx(ka,{className:"space-y-3",children:t.jsx(_e,{variant:"card",count:3,className:"h-16"})}):o||!s?.content?t.jsx("div",{className:"bento-card text-dark-400",children:a("info.documentUnavailable","Документ пока недоступен.")}):t.jsxs("div",{className:"bento-card prose prose-invert max-w-none",children:[t.jsx("div",{dangerouslySetInnerHTML:{__html:Im(s.content)}}),s.updated_at&&t.jsxs("p",{className:"mt-4 text-xs text-dark-500",children:[a("info.updatedAt","Обновлено"),":"," ",new Date(s.updated_at).toLocaleDateString(Ut())]})]}),t.jsx("div",{className:"mt-6",children:t.jsx(de,{to:"/login",className:"btn-secondary",children:a("auth.backToLogin","Вернуться ко входу")})})]})]})}function Pm(){const{t:e}=U(),a=ye(),[n]=xt(),[s,r]=l.useState(""),[o,d]=l.useState("login"),[p,i]=l.useState(null),c=J(h=>h.loginWithOAuth),u=J(h=>h.isAuthenticated),m=l.useRef(!1);if(l.useEffect(()=>{p?.merge_required&&p.merge_token&&a(`/merge/${p.merge_token}`,{replace:!0})},[p,a]),l.useEffect(()=>{if(m.current)return;m.current=!0;const h=n.get("code"),f=n.get("state"),g=n.get("device_id");if(!h||!f){r(e("auth.oauthError","Authorization was denied or failed"));return}let y="link-server",w,A;const T=bm();if(T&&T.state===f)ym(),y="link-browser",w=T.provider,A=T.state;else{const v=gm();v&&v.state===f&&(xm(),y="login",w=v.provider,A=v.state)}(async()=>{if(window.history.replaceState({},"","/auth/oauth/callback"),y==="link-browser"&&w&&A){try{const v=await pe.linkProviderCallback(w,h,A,g??void 0);v.merge_required&&v.merge_token?a(`/merge/${v.merge_token}`,{replace:!0}):a("/profile/accounts",{replace:!0})}catch(v){d("link-browser"),r(Fa(v)||e("profile.accounts.linkError"))}return}if(y==="login"&&w&&A){if(u){a("/",{replace:!0});return}try{await c(w,h,A,g),a("/",{replace:!0})}catch(v){const S=Fa(v);r(S||e("auth.oauthError","Authorization was denied or failed"))}return}try{const v=await pe.linkServerComplete(h,f,g??void 0);i(v)}catch(v){d("link-server"),r(Fa(v)||e("profile.accounts.linkError"))}})()},[n,c,a,u,e]),p&&p.success&&!(p.merge_required&&p.merge_token))return t.jsxs("div",{className:"min-h-viewport flex items-center justify-center px-4 py-8",children:[t.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-dark-950 via-dark-900 to-dark-950"}),t.jsx("div",{className:"relative w-full max-w-md text-center",children:t.jsxs("div",{className:"card",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-success-500/20",children:t.jsx(Pe,{className:"h-8 w-8 text-success-400"})}),t.jsx("h2",{className:"mb-2 text-lg font-semibold text-dark-50",children:e("profile.accounts.linkSuccess")}),t.jsx("p",{className:"mb-6 text-sm text-dark-400",children:e("profile.accounts.returnToTelegram")}),""]})})]});if(s){const f=o==="link-browser"?t.jsx("button",{onClick:()=>a("/profile/accounts",{replace:!0}),className:"btn-primary w-full",children:e("profile.accounts.backToAccounts","Back to accounts")}):t.jsx("button",{onClick:()=>a("/login",{replace:!0}),className:"btn-primary w-full",children:e("auth.backToLogin","Back to login")});return t.jsxs("div",{className:"min-h-viewport flex items-center justify-center px-4 py-8",children:[t.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-dark-950 via-dark-900 to-dark-950"}),t.jsx("div",{className:"relative w-full max-w-md text-center",children:t.jsxs("div",{className:"card",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-error-500/20",children:t.jsx(Ht,{className:"h-8 w-8 text-error-400"})}),t.jsx("h2",{className:"mb-2 text-lg font-semibold text-dark-50",children:e("auth.loginFailed")}),t.jsx("p",{className:"mb-6 text-sm text-dark-400",children:s}),f]})})]})}return t.jsxs("div",{className:"min-h-viewport flex items-center justify-center",children:[t.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-dark-950 via-dark-900 to-dark-950"}),t.jsxs("div",{className:"relative text-center",children:[t.jsx("div",{className:"mx-auto mb-4 h-10 w-10 animate-spin rounded-full border-2 border-accent-500 border-t-transparent"}),t.jsx("h2",{className:"text-lg font-semibold text-dark-50",children:e("auth.authenticating")}),t.jsx("p",{className:"mt-2 text-sm text-dark-400",children:e("common.loading")})]})]})}const xe=(e,a)=>({params:{...e!=null&&{subscription_id:e},...a}}),ke=(e,a)=>[e,a!=null?{params:{subscription_id:a}}:{}],Ie={getSubscriptions:async()=>(await b.get("/cabinet/subscriptions")).data,getSubscriptionById:async e=>(await b.get(`/cabinet/subscriptions/${e}`)).data,deleteSubscription:async e=>(await b.delete(`/cabinet/subscriptions/${e}`)).data,getSubscription:async e=>(await b.get("/cabinet/subscription",xe(e))).data,getRenewalOptions:async e=>(await b.get("/cabinet/subscription/renewal-options",xe(e))).data,renewSubscription:async(e,a)=>(await b.post("/cabinet/subscription/renew",...ke({period_days:e,yandex_cid:je()||void 0},a))).data,getTrafficPackages:async e=>(await b.get("/cabinet/subscription/traffic-packages",xe(e))).data,purchaseTraffic:async(e,a)=>(await b.post("/cabinet/subscription/traffic",...ke({gb:e,yandex_cid:je()||void 0},a))).data,switchTraffic:async(e,a)=>(await b.put("/cabinet/subscription/traffic",...ke({gb:e,yandex_cid:je()||void 0},a))).data,saveTrafficCart:async(e,a)=>{await b.post("/cabinet/subscription/traffic/save-cart",...ke({gb:e},a))},refreshTraffic:async e=>(await b.post("/cabinet/subscription/refresh-traffic",{},xe(e))).data,purchaseDevices:async(e,a)=>(await b.post("/cabinet/subscription/devices/purchase",...ke({devices:e,yandex_cid:je()||void 0},a))).data,getDevicePrice:async(e=1,a)=>(await b.get("/cabinet/subscription/devices/price",{params:{devices:e,...a!=null&&{subscription_id:a}}})).data,saveDevicesCart:async(e,a)=>{await b.post("/cabinet/subscription/devices/save-cart",...ke({devices:e},a))},getDeviceReductionInfo:async e=>(await b.get("/cabinet/subscription/devices/reduction-info",xe(e))).data,reduceDevices:async(e,a)=>(await b.post("/cabinet/subscription/devices/reduce",...ke({new_device_limit:e},a))).data,getDevices:async e=>(await b.get("/cabinet/subscription/devices",xe(e))).data,renameDevice:async(e,a,n)=>(await b.patch(`/cabinet/subscription/devices/${encodeURIComponent(e)}/name`,{name:a},xe(n))).data,deleteDevice:async(e,a)=>(await b.delete(`/cabinet/subscription/devices/${encodeURIComponent(e)}`,xe(a))).data,deleteAllDevices:async e=>(await b.delete("/cabinet/subscription/devices",xe(e))).data,updateAutopay:async(e,a,n)=>(await b.patch("/cabinet/subscription/autopay",{enabled:e,days_before:a},xe(n))).data,getSbpRecurring:async e=>(await b.get("/cabinet/subscription/platega-recurrent",xe(e))).data,enableSbpRecurring:async e=>(await b.post("/cabinet/subscription/platega-recurrent/enable",...ke({},e))).data,cancelSbpRecurring:async e=>(await b.post("/cabinet/subscription/platega-recurrent/cancel",...ke({},e))).data,purchaseWithSbpRecurring:async e=>(await b.post("/cabinet/subscription/platega-recurrent/purchase",{},{params:{tariff_id:e}})).data,getLavaRecurring:async e=>(await b.get("/cabinet/subscription/lava-recurrent",xe(e))).data,enableLavaRecurring:async e=>(await b.post("/cabinet/subscription/lava-recurrent/enable",...ke({},e))).data,cancelLavaRecurring:async e=>(await b.post("/cabinet/subscription/lava-recurrent/cancel",...ke({},e))).data,purchaseWithLavaRecurring:async e=>(await b.post("/cabinet/subscription/lava-recurrent/purchase",{},{params:{tariff_id:e}})).data,getTrialInfo:async()=>(await b.get("/cabinet/subscription/trial")).data,activateTrial:async()=>(await b.post("/cabinet/subscription/trial",{yandex_cid:je()||void 0})).data,getPurchaseOptions:async e=>(await b.get("/cabinet/subscription/purchase-options",xe(e))).data,previewPurchase:async(e,a)=>(await b.post("/cabinet/subscription/purchase-preview",...ke({selection:e},a))).data,submitPurchase:async(e,a)=>(await b.post("/cabinet/subscription/purchase",...ke({selection:e,yandex_cid:je()||void 0},a))).data,purchaseTariff:async(e,a,n,s)=>(await b.post("/cabinet/subscription/purchase-tariff",{tariff_id:e,period_days:a,traffic_gb:n,subscription_id:s,yandex_cid:je()||void 0})).data,getCountries:async e=>(await b.get("/cabinet/subscription/countries",xe(e))).data,updateCountries:async(e,a)=>(await b.post("/cabinet/subscription/countries",...ke({countries:e,yandex_cid:je()||void 0},a))).data,getConnectionLink:async e=>(await b.get("/cabinet/subscription/connection-link",xe(e))).data,getHappDownloads:async()=>(await b.get("/cabinet/subscription/happ-downloads")).data,getAppConfig:async e=>(await b.get("/cabinet/subscription/app-config",xe(e))).data,previewTariffSwitch:async(e,a)=>(await b.post("/cabinet/subscription/tariff/switch/preview",...ke({tariff_id:e,period_days:30},a))).data,switchTariff:async(e,a)=>(await b.post("/cabinet/subscription/tariff/switch",...ke({tariff_id:e,period_days:30,yandex_cid:je()||void 0},a))).data,revokeSubscription:async e=>(await b.post("/cabinet/subscription/revoke",void 0,xe(e))).data,togglePause:async e=>(await b.post("/cabinet/subscription/pause",void 0,xe(e))).data},Di={ru:()=>k(()=>import("./ru-Bvlpot5Y.js"),[]),en:()=>k(()=>import("./en-ClzdFkqB.js"),[]),zh:()=>k(()=>import("./zh-Bb-4E-gv.js"),[]),fa:()=>k(()=>import("./fa-jipKNG6p.js"),[])},Vi=Object.keys(Di),ua="ru",Mm="cabinet_language",xs=new Set;async function Hi(e){if(xs.has(e))return;const a=Di[e];if(!a)return;const n=await a();Le.addResourceBundle(e,"translation",n.default,!0,!0),xs.add(e)}Le.use(Ko).use(qo).init({fallbackLng:ua,supportedLngs:Vi,partialBundledLanguages:!0,detection:{order:["localStorage","navigator"],caches:["localStorage"],lookupLocalStorage:"cabinet_language"},interpolation:{escapeValue:!1},react:{useSuspense:!1},showSupportNotice:!1});const ln=Le.language?.split("-")[0]||ua,Dm=[ua,...ln!==ua?[ln]:[]];Promise.all(Dm.map(Hi));const Vm=new Set(["fa","ar","he","ur"]);function Bi(e){const a=e.split("-")[0];if(typeof document>"u")return;document.documentElement.lang!==a&&(document.documentElement.lang=a);const n=Vm.has(a)?"rtl":"ltr";document.documentElement.dir!==n&&(document.documentElement.dir=n)}Bi(ln);Le.on("languageChanged",e=>{const a=e.split("-")[0];Hi(a),Bi(a)});function Hm(){try{if(localStorage.getItem(Mm))return}catch{return}const e=Ic();e&&Vi.includes(e)&&Le.language?.split("-")[0]!==e&&Le.changeLanguage(e)}const Bm={getBalance:async()=>(await b.get("/cabinet/balance")).data,getTransactions:async e=>(await b.get("/cabinet/balance/transactions",{params:e})).data,getPaymentMethods:async()=>(await b.get("/cabinet/balance/payment-methods")).data,createTopUp:async(e,a,n)=>{const s={amount_kopeks:e,payment_method:a};return n&&(s.payment_option=n),s.language=Le.language||"ru",(await b.post("/cabinet/balance/topup",s)).data},activatePromocode:async(e,a)=>(await b.post("/cabinet/promocode/activate",{code:e,...a?{subscription_id:a}:{}})).data,createStarsInvoice:async e=>(await b.post("/cabinet/balance/stars-invoice",{amount_kopeks:e})).data,getPendingPayments:async e=>(await b.get("/cabinet/balance/pending-payments",{params:e})).data,getPendingPayment:async(e,a)=>(await b.get(`/cabinet/balance/pending-payments/${encodeURIComponent(e)}/${encodeURIComponent(a)}`)).data,getLatestPayment:async e=>(await b.get(`/cabinet/balance/pending-payments/${encodeURIComponent(e)}/latest`)).data,checkPaymentStatus:async(e,a)=>(await b.post(`/cabinet/balance/pending-payments/${encodeURIComponent(e)}/${encodeURIComponent(a)}/check`)).data,getSavedCards:async()=>(await b.get("/cabinet/balance/saved-cards")).data,deleteSavedCard:async e=>{await b.delete(`/cabinet/balance/saved-cards/${e}`)}},Ka="onboarding_completed";function Om(){const[e,a]=l.useState(()=>fe.getItem(Ka)==="true"),n=l.useCallback(()=>{fe.setItem(Ka,"true"),a(!0)},[]),s=l.useCallback(()=>{fe.removeItem(Ka),a(!1)},[]);return{isCompleted:e,complete:n,reset:s}}function Zm({steps:e,onComplete:a,onSkip:n}){const{t:s}=U(),[r,o]=l.useState(0),[d,p]=l.useState(null),[i,c]=l.useState(!1),u=l.useRef(null),m=l.useRef(a);l.useEffect(()=>{m.current=a},[a]);const h=e[r];l.useEffect(()=>{let v=!1,S=0;const L=6,V=r===e.length-1;c(!1),p(null);const O=()=>{if(v)return;const M=document.querySelector(`[data-onboarding="${h.target}"]`);if(M){const P=M.getBoundingClientRect();p(P),M.scrollIntoView({behavior:"smooth",block:"center"}),window.setTimeout(()=>{v||c(!0)},100);return}if(S+=1,SMath.min(P+1,e.length-1))},I=window.setTimeout(O,300);return()=>{v=!0,window.clearTimeout(I)}},[h.target]),l.useEffect(()=>{const v=()=>{const S=document.querySelector(`[data-onboarding="${h.target}"]`);S&&p(S.getBoundingClientRect())};return window.addEventListener("resize",v),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",v),window.removeEventListener("scroll",v,!0)}},[h.target]);const f=()=>{r{r>0&&o(r-1)},y=()=>{n()},w=qe(!0,{onEscape:y,lockScroll:!1}),A=l.useCallback(v=>{u.current=v,w.current=v},[w]),T=()=>{if(!d)return{opacity:0};const v=16,S=320,L=u.current?.offsetHeight||150;let V=0,O=0;switch(h.placement){case"bottom":V=d.bottom+v,O=d.left+d.width/2-S/2;break;case"top":V=d.top-L-v,O=d.left+d.width/2-S/2;break;case"left":V=d.top+d.height/2-L/2,O=d.left-S-v;break;case"right":V=d.top+d.height/2-L/2,O=d.right+v;break}const I=window.innerWidth,M=window.innerHeight;return OI-v&&(O=I-S-v),VM-v&&(V=M-L-v),{top:V,left:O,width:S,opacity:i?1:0,transform:i?"scale(1)":"scale(0.95)"}},N=()=>{if(!d)return{opacity:0};const v=8;return{top:d.top-v,left:d.left-v,width:d.width+v*2,height:d.height+v*2,opacity:i?1:0}};return gt.createPortal(t.jsxs("div",{className:"onboarding-overlay",style:{opacity:i?1:0},children:[t.jsx("div",{className:"onboarding-spotlight",style:{...N(),pointerEvents:i?"auto":"none"}}),t.jsxs("div",{ref:A,role:"dialog","aria-modal":"true","aria-labelledby":"onboarding-title","aria-describedby":"onboarding-desc",className:`onboarding-tooltip tooltip-${h.placement}`,style:{...T(),pointerEvents:i?"auto":"none"},children:[t.jsx("div",{className:"mb-4 flex items-center gap-1.5",children:e.map((v,S)=>t.jsx("div",{className:`h-1 rounded-full transition-all duration-300 ${S===r?"w-6 bg-accent-500":S0&&t.jsx("button",{onClick:g,className:"btn-ghost px-3 py-1.5 text-sm",children:s("common.back","Back")}),t.jsx("button",{onClick:f,className:"btn-primary px-4 py-1.5 text-sm",children:r===e.length-1?s("onboarding.finish","Finish"):s("common.next","Next")})]})]})]}),d&&i&&t.jsx("div",{"aria-hidden":"true",className:"absolute cursor-pointer",style:{top:d.top,left:d.left,width:d.width,height:d.height},onClick:f})]}),document.body)}const pt={getOffers:async()=>(await b.get("/cabinet/promo/offers")).data,getActiveDiscount:async()=>(await b.get("/cabinet/promo/active-discount")).data,getGroupDiscounts:async()=>(await b.get("/cabinet/promo/group-discounts")).data,getLoyaltyTiers:async()=>(await b.get("/cabinet/promo/loyalty-tiers")).data,claimOffer:async e=>(await b.post("/cabinet/promo/claim",{offer_id:e})).data,clearActiveDiscount:async()=>(await b.delete("/cabinet/promo/active-discount")).data,deactivateDiscount:async()=>(await b.post("/cabinet/promocode/deactivate-discount")).data},bs=(e,a)=>{const n=new Date;let s;e.includes("Z")||e.includes("+")||e.includes("-",10)?s=new Date(e):s=new Date(e+"Z");const r=s.getTime()-n.getTime();if(r<=0)return a("promo.offers.expired");const o=Math.floor(r/(1e3*60*60)),d=Math.floor(r%(1e3*60*60)/(1e3*60));return o>24?`${Math.floor(o/24)} ${a("promo.time.days")}`:o>0?`${o}${a("promo.time.hours")} ${d}${a("promo.time.minutes")}`:`${d}${a("promo.time.minutes")}`},Fm=(e,a)=>e==="test_access"?t.jsx("span",{className:"text-2xl",children:"🚀"}):a?t.jsx("span",{className:"text-2xl",children:"🏷️"}):t.jsx("span",{className:"text-2xl",children:"🎁"}),$m=(e,a)=>e.effect_type==="test_access"?a("promo.offers.testAccess"):e.discount_percent?a("promo.offers.discountPercent",{percent:e.discount_percent}):a("promo.offers.specialOffer"),Um=(e,a)=>{if(e.effect_type==="test_access"){const n=e.extra_data?.test_squad_uuids?.length||0;return n>0?a("promo.offers.serverAccess",{count:n}):a("promo.offers.additionalServers")}return a("promo.offers.activateDiscountHint")};function Km({className:e=""}){const{t:a}=U(),n=ye(),s=Ye(),r=Rl(),[o,d]=l.useState(null),[p,i]=l.useState(null),[c,u]=l.useState(null),{data:m=[],isLoading:h}=W({queryKey:["promo-offers"],queryFn:pt.getOffers,staleTime:3e4}),{data:f}=W({queryKey:["active-discount"],queryFn:pt.getActiveDiscount,staleTime:3e4}),g=st({mutationFn:pt.claimOffer,onSuccess:v=>{s.invalidateQueries({queryKey:["promo-offers"]}),s.invalidateQueries({queryKey:["active-discount"]}),s.invalidateQueries({queryKey:["subscription"]}),s.invalidateQueries({queryKey:["subscriptions-list"]}),s.invalidateQueries({queryKey:["purchase-options"]}),s.invalidateQueries({queryKey:["balance"]}),i(v.message),d(null),setTimeout(()=>i(null),5e3)},onError:v=>{u(v.response?.data?.detail||a("promo.offers.activationFailed")),d(null),setTimeout(()=>u(null),5e3)}}),y=st({mutationFn:async()=>{(f?.source??"").startsWith("promocode:")?await pt.deactivateDiscount():await pt.clearActiveDiscount()},onSuccess:()=>{s.invalidateQueries({queryKey:["active-discount"]}),s.invalidateQueries({queryKey:["promo-offers"]}),s.invalidateQueries({queryKey:["subscription"]}),s.invalidateQueries({queryKey:["purchase-options"]}),i(a("promo.deactivate.success")),setTimeout(()=>i(null),5e3)},onError:v=>{const L=v.response?.data?.detail,V=typeof L=="string"?L:L?.message;u(V||a("promo.deactivate.error")),setTimeout(()=>u(null),5e3)}}),w=v=>{d(v),u(null),i(null),g.mutate(v)},A=()=>{n("/subscription/purchase")},T=async()=>{u(null),i(null),await r(a("promo.deactivate.confirmDescription",{percent:f?.discount_percent||0}),a("promo.deactivate.confirm"),a("promo.deactivate.confirmTitle"))&&y.mutate()},N=m.filter(v=>v.is_active&&!v.is_claimed);return!h&&N.length===0&&(!f||!f.is_active)?null:t.jsxs("div",{className:`space-y-4 ${e}`,children:[f&&f.is_active&&f.discount_percent>0&&t.jsx("div",{className:"card border-success-500/30 bg-gradient-to-br from-success-500/10 to-accent-500/5",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-xl bg-success-500/20 text-success-400",children:t.jsx("span",{className:"text-2xl",children:"🏷️"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[t.jsx("h3",{className:"font-semibold text-dark-100",children:a("promo.offers.discountActiveTitle",{percent:f.discount_percent})}),t.jsxs("span",{className:"rounded bg-success-500/20 px-2 py-0.5 text-xs font-bold text-success-400",children:["-",f.discount_percent,"%"]})]}),t.jsx("div",{className:"flex items-center gap-4 text-sm text-dark-400",children:f.expires_at&&t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(la,{}),t.jsx("span",{children:a("promo.offers.expires",{time:bs(f.expires_at,a)})})]})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[t.jsx("button",{onClick:A,className:"flex-1 rounded-xl bg-gradient-to-r from-success-500 to-success-600 px-4 py-2.5 font-semibold text-white shadow-lg shadow-success-500/25 transition-all hover:from-success-400 hover:to-success-500 active:from-success-600 active:to-success-700",children:a("promo.useNow")}),t.jsxs("button",{onClick:T,className:"flex items-center justify-center gap-1.5 rounded-xl border border-dark-600/50 bg-dark-900/50 px-4 py-2.5 text-sm text-dark-400 transition-colors hover:border-error-500/30 hover:bg-error-500/10 hover:text-error-400",children:[t.jsx(Kd,{className:"h-4 w-4"}),t.jsx("span",{children:a("promo.deactivate.button")})]})]})]})}),p&&t.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-success-500/30 bg-success-500/10 p-4 text-success-400",children:[t.jsx(Pe,{}),t.jsx("span",{children:p})]}),c&&t.jsx("div",{className:"rounded-xl border border-error-500/30 bg-error-500/10 p-4 text-error-400",children:c}),N.length>0&&t.jsx("div",{className:"space-y-3",children:N.map(v=>t.jsx("div",{className:"card border-warning-500/30 bg-gradient-to-br from-warning-500/5 to-transparent transition-colors hover:border-warning-500/50",children:t.jsxs("div",{className:"flex items-start gap-4",children:[t.jsx("div",{className:"flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-warning-500/30 to-warning-500/20",children:Fm(v.effect_type,v.discount_percent)}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[t.jsx("h3",{className:"font-semibold text-dark-100",children:$m(v,a)}),v.effect_type==="test_access"&&t.jsx("span",{className:"rounded bg-purple-500/20 px-2 py-0.5 text-xs text-purple-400",children:a("promo.offers.test")})]}),t.jsx("p",{className:"mb-3 text-sm text-dark-400",children:Um(v,a)}),t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("div",{className:"flex items-center gap-1 text-xs text-dark-500",children:[t.jsx(la,{}),t.jsx("span",{children:a("promo.offers.remaining",{time:bs(v.expires_at,a)})})]}),t.jsxs("button",{onClick:()=>w(v.id),disabled:o===v.id,className:"group relative flex w-full items-center justify-center gap-2 overflow-hidden rounded-lg bg-gradient-to-r from-warning-500 to-warning-500 px-5 py-2.5 text-sm font-semibold text-white shadow-lg shadow-warning-500/25 transition-all hover:scale-105 hover:shadow-xl hover:shadow-warning-500/30 active:scale-100 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100 sm:w-auto",children:[t.jsx("span",{className:"absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-white/20 to-transparent transition-transform duration-1000 group-hover:translate-x-full"}),o===v.id?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),t.jsx("span",{children:a("promo.offers.activating")})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-lg",children:"🎁"}),t.jsx("span",{children:a("promo.offers.activate")})]})]})]})]})]})},v.id))}),h&&t.jsx("div",{className:"card",children:t.jsxs(ka,{className:"flex items-center gap-4",children:[t.jsx(_e,{className:"h-12 w-12 shrink-0 rounded-xl"}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsx(_e,{className:"h-5 w-32"}),t.jsx(_e,{className:"h-4 w-48"})]})]})})]})}const qm={getNews:async e=>(await b.get("/cabinet/news",{params:e})).data,getArticle:async e=>(await b.get(`/cabinet/news/${encodeURIComponent(e)}`)).data,getAdminNews:async e=>(await b.get("/cabinet/admin/news",{params:e})).data,getAdminArticle:async e=>(await b.get(`/cabinet/admin/news/${e}`)).data,createArticle:async e=>(await b.post("/cabinet/admin/news",e)).data,updateArticle:async(e,a)=>(await b.put(`/cabinet/admin/news/${e}`,a)).data,deleteArticle:async e=>{await b.delete(`/cabinet/admin/news/${e}`)},togglePublish:async e=>(await b.post(`/cabinet/admin/news/${e}/publish`)).data,toggleFeatured:async e=>(await b.post(`/cabinet/admin/news/${e}/feature`)).data,uploadMedia:async(e,a)=>{const n=new FormData;return n.append("file",e),(await b.post("/cabinet/admin/news/media/upload",n,{signal:a})).data},deleteMedia:async e=>{await b.delete(`/cabinet/admin/news/media/${encodeURIComponent(e)}`)},getCategories:async()=>(await b.get("/cabinet/admin/news/categories")).data,createCategory:async e=>(await b.post("/cabinet/admin/news/categories",e)).data,updateCategory:async(e,a)=>(await b.put(`/cabinet/admin/news/categories/${e}`,a)).data,deleteCategory:async e=>{await b.delete(`/cabinet/admin/news/categories/${e}`)},getTags:async()=>(await b.get("/cabinet/admin/news/tags")).data,createTag:async e=>(await b.post("/cabinet/admin/news/tags",e)).data,updateTag:async(e,a)=>(await b.put(`/cabinet/admin/news/tags/${e}`,a)).data,deleteTag:async e=>{await b.delete(`/cabinet/admin/news/tags/${e}`)}},zm=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function Tn(e,a="#888888"){return!e||!zm.test(e)?a:e}const Wm=[.23,1,.32,1],ma={hidden:{opacity:0,y:24},visible:e=>({opacity:1,y:0,transition:{delay:e*.1,duration:.6,ease:Wm}})},Gm=l.memo(function({category:a,color:n,className:s}){const r=Tn(n);return t.jsxs("span",{className:x("inline-flex items-center gap-1.5 rounded-md px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-widest",s),style:{color:r,background:`${r}15`,border:`1px solid ${r}30`},children:[t.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full",style:{background:r,boxShadow:`0 0 8px ${r}`}}),a]})}),Oi=l.memo(function({text:a,color:n}){const s=Tn(n);return t.jsx("span",{className:"inline-block rounded px-2 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wider",style:{color:s,border:`1px solid ${s}33`,background:`${s}11`},children:a})}),Qm=l.memo(function({categories:a,active:n,onChange:s}){const{t:r}=U(),o=fn();return t.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"tablist","aria-label":r("news.title"),children:[t.jsx("button",{role:"tab","aria-selected":n==="",onClick:()=>{o.selectionChanged(),s("")},className:x("min-h-[44px] rounded-lg px-4 py-2.5 text-xs font-semibold tracking-wide transition-all duration-300",n===""?"border border-accent-400 bg-accent-400 text-dark-950":"border border-dark-700 bg-dark-800 text-dark-400 hover:border-accent-400/30 hover:text-accent-400"),children:r("news.filterAll")}),a.map(d=>{const p=n===d;return t.jsx("button",{role:"tab","aria-selected":p,onClick:()=>{o.selectionChanged(),s(d)},className:x("min-h-[44px] rounded-lg px-4 py-2.5 text-xs font-semibold tracking-wide transition-all duration-300",p?"border border-accent-400 bg-accent-400 text-dark-950":"border border-dark-700 bg-dark-800 text-dark-400 hover:border-accent-400/30 hover:text-accent-400"),children:d},d)})]})}),Ym=l.memo(function({item:a,onClick:n}){const{t:s,i18n:r}=U();return t.jsx(ge.article,{custom:0,variants:ma,initial:"hidden",animate:"visible",role:"link",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())},className:"group col-span-full cursor-pointer rounded-2xl p-px transition-all duration-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-400 focus-visible:ring-offset-2 focus-visible:ring-offset-dark-950",style:{background:"linear-gradient(135deg, rgba(var(--color-accent-400), 0.2), rgba(var(--color-dark-900), 0.2), rgba(var(--color-accent-400), 0.2))"},whileHover:{background:"linear-gradient(135deg, rgba(var(--color-accent-400), 0.4), rgba(var(--color-accent-500), 0.4), rgba(var(--color-accent-400), 0.4))"},onClick:n,children:t.jsxs("div",{className:"relative flex min-h-[220px] flex-col justify-between overflow-hidden rounded-[15px] bg-dark-900 p-7 sm:p-10",children:[t.jsx("div",{className:"pointer-events-none absolute right-0 top-0 h-[200px] w-[200px]",style:{background:"radial-gradient(circle at top right, rgba(var(--color-accent-400), 0.08), transparent 70%)"}}),t.jsx("div",{className:"absolute -top-px left-[20%] right-[20%] h-px",style:{background:"linear-gradient(90deg, transparent, rgba(var(--color-accent-400), 0.4), transparent)",animation:"newsShimmer 3s ease-in-out infinite"}}),t.jsxs("div",{children:[t.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-3",children:[t.jsx(Gm,{category:a.category,color:a.category_color}),a.tag&&t.jsx(Oi,{text:a.tag,color:a.category_color}),t.jsxs("span",{className:"ml-auto font-mono text-[11px] text-dark-500",children:[a.read_time_minutes," ",s("news.readTime")]})]}),t.jsx("h2",{className:"mb-3 max-w-[700px] break-words text-2xl font-extrabold leading-tight text-dark-50 transition-colors duration-300 group-hover:text-white sm:text-[28px]",children:a.title}),a.excerpt&&t.jsx("p",{className:"max-w-[600px] text-[15px] leading-relaxed text-dark-400",children:a.excerpt})]}),t.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[t.jsx("span",{className:"font-mono text-xs text-dark-600",children:a.published_at?new Date(a.published_at).toLocaleDateString(r.language):""}),t.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[13px] font-semibold text-accent-400 transition-all duration-300 group-hover:gap-2.5",children:[s("news.readMore"),t.jsx(Pd,{})]})]})]})})}),Xm=l.memo(function({item:a,index:n,onClick:s}){const{t:r,i18n:o}=U(),d=Tn(a.category_color);return t.jsx(ge.article,{custom:n+1,variants:ma,initial:"hidden",animate:"visible",role:"link",tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),s())},className:"group cursor-pointer rounded-[14px] p-px transition-all duration-[450ms] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-400 focus-visible:ring-offset-2 focus-visible:ring-offset-dark-950",style:{background:"linear-gradient(160deg, rgba(var(--color-dark-700), 0.25), rgba(var(--color-dark-900), 0.25))"},whileHover:{y:-4,background:`linear-gradient(160deg, ${d}55, transparent 60%)`},onClick:s,children:t.jsxs("div",{className:"relative flex h-full min-h-[210px] flex-col justify-between overflow-hidden rounded-[13px] bg-dark-900 p-7",children:[t.jsx("div",{className:"pointer-events-none absolute -bottom-5 -right-5 h-[100px] w-[100px] opacity-0 transition-opacity duration-500 group-hover:opacity-100",style:{background:`radial-gradient(circle, ${d}08, transparent 70%)`}}),t.jsxs("div",{children:[t.jsxs("div",{className:"mb-3.5 flex items-center gap-2.5",children:[t.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10px] font-bold uppercase tracking-widest",style:{color:d},children:[t.jsx("span",{className:"h-[5px] w-[5px] rounded-full",style:{background:d,boxShadow:`0 0 6px ${d}80`}}),a.category]}),a.tag&&t.jsx(Oi,{text:a.tag,color:d})]}),t.jsx("h3",{className:"mb-2.5 break-words text-[17px] font-bold leading-snug text-dark-100 transition-colors duration-300 group-hover:text-white",children:a.title}),a.excerpt&&t.jsx("p",{className:"text-[13px] leading-relaxed text-dark-400",children:a.excerpt})]}),t.jsxs("div",{className:"mt-5 flex items-center justify-between border-t border-dark-700/50 pt-3.5",children:[t.jsx("span",{className:"font-mono text-[11px] text-dark-600",children:a.published_at?new Date(a.published_at).toLocaleDateString(o.language):""}),t.jsxs("span",{className:"font-mono text-[11px] text-dark-500",children:[a.read_time_minutes," ",r("news.readTime")]})]})]})})}),Jm=l.memo(function({item:a,index:n,onCardClick:s}){const r=l.useCallback(()=>s(a.slug),[a.slug,s]);return t.jsx(Xm,{item:a,index:n,onClick:r})}),qa=6;function ep(){const{t:e}=U(),a=ye(),n=fn(),[s,r]=l.useState(""),[o,d]=l.useState(qa),p=s||void 0,{data:i,isLoading:c}=W({queryKey:["news","list",p,o],queryFn:()=>qm.getNews({category:p,limit:o,offset:0}),staleTime:2*6e4,gcTime:10*6e4}),u=l.useMemo(()=>i?.items??[],[i?.items]),m=i?.total??0,h=i?.categories??[],{featured:f,regular:g}=l.useMemo(()=>({featured:u.find(v=>v.is_featured),regular:u.filter(v=>!v.is_featured)}),[u]),y=l.useCallback(v=>{n.buttonPress(),a(`/news/${v}`)},[n,a]),w=l.useCallback(()=>{n.buttonPress(),d(v=>v+qa)},[n]),A=l.useCallback(v=>{r(v),d(qa)},[]),T=f?.slug,N=l.useCallback(()=>{T&&y(T)},[T,y]);return u.length===0?null:t.jsx("section",{className:"relative overflow-hidden rounded-2xl bg-dark-850/80 backdrop-blur-xl",children:t.jsxs("div",{className:"px-5 py-8 sm:px-6 sm:py-10",children:[t.jsxs(ge.div,{variants:ma,custom:0,initial:"hidden",animate:"visible",className:"mb-8",children:[t.jsxs("div",{className:"mb-2 flex items-center gap-2.5",children:[t.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-gradient-to-br from-accent-400 to-accent-600",children:t.jsx(Zd,{className:"h-[18px] w-[18px] text-dark-950"})}),t.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-[0.18em] text-dark-500",children:e("news.title")})]}),h.length>0&&t.jsx(Qm,{categories:h,active:s,onChange:A})]}),u.length>0&&t.jsxs("div",{className:"space-y-4",children:[f&&t.jsx(Ym,{item:f,onClick:N}),g.length>0&&t.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 sm:[&>*:last-child:nth-child(odd)]:col-span-2",children:g.map((v,S)=>t.jsx(Jm,{item:v,index:S,onCardClick:y},v.id))})]}),!c&&u.length=90?a="critical":e>=75?a="danger":e>=50?a="warning":a="normal",{zone:a,...tp[a]}}function Ze(e){e.length===4&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const a=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),s=parseInt(e.slice(5,7),16);return{r:a,g:n,b:s}}function fg(e,a,n){return"#"+[e,a,n].map(s=>{const r=Math.round(Math.max(0,Math.min(255,s))).toString(16);return r.length===1?"0"+r:r}).join("")}function np(e){const{r:a,g:n,b:s}=Ze(e),r=a/255,o=n/255,d=s/255,p=Math.max(r,o,d),i=Math.min(r,o,d);let c=0,u=0;const m=(p+i)/2;if(p!==i){const h=p-i;switch(u=m>.5?h/(2-p-i):h/(p+i),p){case r:c=((o-d)/h+(o{const i=(p+e/30)%12,c=r-o*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*c)};return{r:d(0),g:d(8),b:d(4)}}function Ce(e,a,n){return`${e}, ${a}, ${n}`}function Xt(e){const{h:a,s:n}=np(e),s={50:97,100:94,200:86,300:76,400:64,500:50,600:42,700:34,800:26,900:18,950:10},r={};for(const o of ti){const d=s[o],p=o<=100?n*.7:o>=900?n*.8:n,{r:i,g:c,b:u}=sp(a,p,d);r[o]=Ce(i,c,u)}return r}function Re(e,a,n){return Ce(Math.round(e.r+(a.r-e.r)*n),Math.round(e.g+(a.g-e.g)*n),Math.round(e.b+(a.b-e.b)*n))}function dn(e,a,n){return{r:Math.round(e.r+(a.r-e.r)*n),g:Math.round(e.g+(a.g-e.g)*n),b:Math.round(e.b+(a.b-e.b)*n)}}function ys({r:e,g:a,b:n}){const s=r=>{const o=r/255;return o<=.04045?o/12.92:Math.pow((o+.055)/1.055,2.4)};return .2126*s(e)+.7152*s(a)+.0722*s(n)}function pa(e,a){const n=ys(e),s=ys(a);return(Math.max(n,s)+.05)/(Math.min(n,s)+.05)}function Jt(e,a,n,s){if(pa(e,n)>=s)return e;for(let r=.1;r<=1;r+=.1){const o=dn(e,a,r);if(pa(o,n)>=s)return o}return a}function ea(e){const[a,n,s]=e.split(",").map(p=>Number(p.trim())),r={r:a,g:n,b:s},o={r:255,g:255,b:255},d={r:15,g:23,b:42};return pa(o,r)>=pa(d,r)?"255, 255, 255":"15, 23, 42"}function Zi(e){const a={...ft,...e},n=document.documentElement,s=Xt(a.accent),r=Xt(a.success),o=Xt(a.warning),d=Xt(a.error),p=Ze(a.darkBackground),i=Ze(a.darkSurface),c=Ze(a.darkText),u=Ze(a.darkTextSecondary),m=Jt(u,c,i,5),h=Jt(dn(u,i,.4),c,i,3.8);n.style.setProperty("--color-dark-50",Ce(c.r,c.g,c.b)),n.style.setProperty("--color-dark-100",Ce(c.r,c.g,c.b)),n.style.setProperty("--color-dark-200",Re(c,u,.33)),n.style.setProperty("--color-dark-300",Re(c,u,.66)),n.style.setProperty("--color-dark-400",Ce(m.r,m.g,m.b)),n.style.setProperty("--color-dark-500",Ce(h.r,h.g,h.b)),n.style.setProperty("--color-dark-600",Re(u,i,.6)),n.style.setProperty("--color-dark-700",Re(u,i,.8)),n.style.setProperty("--color-dark-800",Ce(i.r,i.g,i.b)),n.style.setProperty("--color-dark-850",Re(i,p,.5)),n.style.setProperty("--color-dark-900",Re(i,p,.7)),n.style.setProperty("--color-dark-950",Ce(p.r,p.g,p.b));const f=Ze(a.lightBackground),g=Ze(a.lightSurface),y=Ze(a.lightText),w=Ze(a.lightTextSecondary);n.style.setProperty("--color-champagne-50",Ce(g.r,g.g,g.b)),n.style.setProperty("--color-champagne-100",Re(g,f,.3)),n.style.setProperty("--color-champagne-200",Ce(f.r,f.g,f.b)),n.style.setProperty("--color-champagne-300",Re(f,w,.2)),n.style.setProperty("--color-champagne-400",Re(f,w,.4));const A=Jt(dn(f,w,.6),y,g,3.8),T=Jt(w,y,g,5);n.style.setProperty("--color-champagne-500",Ce(A.r,A.g,A.b)),n.style.setProperty("--color-champagne-600",Ce(T.r,T.g,T.b)),n.style.setProperty("--color-champagne-700",Re(w,y,.33)),n.style.setProperty("--color-champagne-800",Re(w,y,.66)),n.style.setProperty("--color-champagne-900",Ce(y.r,y.g,y.b)),n.style.setProperty("--color-champagne-950",Ce(y.r,y.g,y.b));for(const N of ti)n.style.setProperty(`--color-accent-${N}`,s[N]),n.style.setProperty(`--color-success-${N}`,r[N]),n.style.setProperty(`--color-warning-${N}`,o[N]),n.style.setProperty(`--color-error-${N}`,d[N]);n.style.setProperty("--color-on-accent",ea(s[500])),n.style.setProperty("--color-on-success",ea(r[500])),n.style.setProperty("--color-on-warning",ea(o[500])),n.style.setProperty("--color-on-error",ea(d[500])),n.style.setProperty("--color-dark-bg",a.darkBackground),n.style.setProperty("--color-dark-surface",a.darkSurface),n.style.setProperty("--color-dark-text",a.darkText),n.style.setProperty("--color-dark-text-secondary",a.darkTextSecondary),n.style.setProperty("--color-light-bg",a.lightBackground),n.style.setProperty("--color-light-surface",a.lightSurface),n.style.setProperty("--color-light-text",a.lightText),n.style.setProperty("--color-light-text-secondary",a.lightTextSecondary)}function rp(){const e=Ye(),{data:a,isLoading:n,error:s}=W({queryKey:["theme-colors"],queryFn:Ft.getColors,staleTime:300*1e3,refetchOnWindowFocus:!1,retry:1});return l.useEffect(()=>{Zi(a||ft)},[a]),{colors:a||ft,isLoading:n,error:s,invalidateColors:()=>{e.invalidateQueries({queryKey:["theme-colors"]})}}}const ip={accent:"#3b82f6",warning:"rgb(var(--color-urgent-400))",error:"rgb(var(--color-critical-500))"},op={accent:"accent",warning:"warning",error:"error"};function Sn(e){const{colors:a}=rp(),n=l.useMemo(()=>ap(e),[e]),s=l.useMemo(()=>{const r=n.colorKey;return a[op[r]]||ip[r]},[n.colorKey,a]);return{...n,mainHex:s,colors:a}}function Et(e){return e>=1e3?`${(e/1e3).toFixed(1)} ${Le.t("common.units.tb","TB")}`:e>=1?`${e.toFixed(1)} ${Le.t("common.units.gb","GB")}`:`${(e*1024).toFixed(0)} ${Le.t("common.units.mb","MB")}`}function vt(e){return{cardBg:e?"linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)":"linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.88) 100%)",cardBorder:e?"rgba(255,255,255,0.07)":"rgba(0,0,0,0.1)",innerBg:e?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.03)",innerBorder:e?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.06)",hoverBg:e?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)",hoverBorder:e?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.1)",text:e?"#fff":"#1a1a2e",textSecondary:e?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.5)",textMuted:e?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.35)",textFaint:e?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)",textGhost:e?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",trackBg:e?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",trackBorder:e?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.06)",codeBg:e?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.04)",codeBorder:e?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.06)",glowAlpha:e?"15":"08",shadow:e?"none":"0 2px 16px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03)"}}const cp=[50,75,90];function lp({usedGb:e,limitGb:a,percent:n,isUnlimited:s,compact:r=!1}){const{t:o}=U(),{isDark:d}=Ke(),p=vt(d),i=Sn(n),c="rgb(var(--color-accent-400))",u=Math.min(n,100),m=r?8:14,h=l.useMemo(()=>n<50?`linear-gradient(90deg, ${c}, ${i.mainVar})`:n<75?`linear-gradient(90deg, ${c}, rgb(var(--color-warning-400)), ${i.mainVar})`:n<90?`linear-gradient(90deg, ${c}, rgb(var(--color-warning-400)), rgb(var(--color-warning-300)), ${i.mainVar})`:`linear-gradient(90deg, ${c}, rgb(var(--color-warning-400)), rgb(var(--color-warning-300)), rgb(var(--color-error-400)))`,[n,i.mainVar,c]);return s?t.jsx("div",{role:"progressbar","aria-label":o("dashboard.unlimited"),children:t.jsxs("div",{className:"relative overflow-hidden",style:{height:m,borderRadius:10,background:p.trackBg,border:`1px solid rgba(${i.mainVarRaw}, 0.12)`},children:[t.jsx("div",{className:"absolute inset-0 animate-unlimited-flow",style:{background:`linear-gradient(90deg, rgba(${i.mainVarRaw}, 0.31), ${i.mainVar}, rgba(${i.mainVarRaw}, 0.31))`,backgroundSize:"200% 100%"}}),t.jsx("div",{className:"absolute inset-0 animate-traffic-shimmer",style:{background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%)"},"aria-hidden":"true"}),t.jsx("div",{className:"absolute left-0 right-0 top-0",style:{height:"50%",background:"linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%)",borderRadius:"10px 10px 0 0"},"aria-hidden":"true"})]})}):t.jsxs("div",{role:"progressbar","aria-valuenow":Math.round(u),"aria-valuemin":0,"aria-valuemax":100,"aria-label":`${o("subscription.traffic")}: ${u.toFixed(1)}%`,children:[t.jsxs("div",{className:"relative overflow-hidden",style:{height:m,borderRadius:10,background:p.trackBg,border:`1px solid ${p.trackBorder}`},children:[t.jsxs("div",{className:"absolute inset-0 flex","aria-hidden":"true",children:[t.jsx("div",{style:{flex:"50 0 0",background:"transparent"}}),t.jsx("div",{style:{flex:"25 0 0",background:"rgba(var(--color-warning-400), 0.03)"}}),t.jsx("div",{style:{flex:"15 0 0",background:"rgba(var(--color-warning-300), 0.04)"}}),t.jsx("div",{style:{flex:"10 0 0",background:"rgba(var(--color-error-400), 0.05)"}})]}),t.jsxs("div",{className:"absolute bottom-0 left-0 top-0 w-full origin-left overflow-hidden",style:{transform:`scaleX(${u/100})`,borderRadius:10,transition:"transform 1.2s cubic-bezier(0.16, 1, 0.3, 1)"},children:[t.jsx("div",{className:"absolute inset-0",style:{background:h,transition:"background 0.8s ease"}}),t.jsx("div",{className:"absolute inset-0 animate-traffic-shimmer",style:{background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%)"},"aria-hidden":"true"}),t.jsx("div",{className:"absolute left-0 right-0 top-0",style:{height:"50%",background:"linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 100%)",borderRadius:"10px 10px 0 0"},"aria-hidden":"true"})]}),cp.map(f=>t.jsx("div",{className:"absolute bottom-0 top-0",style:{left:`${f}%`,width:1,background:p.textGhost},"aria-hidden":"true"},f)),u>2&&t.jsx("div",{className:"pointer-events-none absolute",style:{top:-4,bottom:-4,left:`calc(${u}% - 8px)`,width:16,borderRadius:"50%",background:`radial-gradient(circle, rgba(${i.mainVarRaw}, 0.38), transparent)`,filter:"blur(4px)",transition:"left 1.2s cubic-bezier(0.16, 1, 0.3, 1)"},"aria-hidden":"true"})]}),!r&&a>0&&t.jsx("div",{className:"mt-1.5 flex justify-between px-0.5 font-mono text-[10px] font-medium text-dark-50/20","aria-hidden":"true",children:[0,25,50,75,100].map(f=>t.jsx("span",{children:Et(a*f/100)},f))})]})}function dp({data:e,width:a=200,height:n=40,color:s,className:r=""}){const o=l.useId();if(e.length<2)return null;const d=Math.max(...e,1),p=e.map((f,g)=>{const y=g/(e.length-1)*a,w=n-f/d*n*.85-2;return`${y},${w}`}),i=p.join(" "),c=p[p.length-1].split(","),u=parseFloat(c[0]),m=parseFloat(c[1]),h=`M${p[0]} ${p.slice(1).join(" ")} L${a},${n} L0,${n} Z`;return t.jsxs("svg",{width:a,height:n,viewBox:`0 0 ${a} ${n}`,className:r,style:{overflow:"visible"},fill:"none","aria-hidden":"true",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:s,stopOpacity:"0.25"}),t.jsx("stop",{offset:"100%",stopColor:s,stopOpacity:"0"})]})}),t.jsx("path",{d:h,fill:`url(#${o})`}),t.jsx("polyline",{points:i,stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("circle",{cx:u,cy:m,r:"3",fill:s,style:{filter:`drop-shadow(0 0 4px ${s})`}})]})}function up({children:e,className:a,as:n="div",accentColor:s,duration:r,style:o,...d}){const p={};return s&&(p["--accent-color"]=s,p["--accent-glow"]=s+"4D"),r!==void 0&&(p["--border-duration"]=`${r}s`),t.jsx(n,{className:x("hover-border-gradient",a),style:{...p,...o},...d,children:e})}function mp({subscription:e,connectedDevices:a,usedPercent:n=0}){const{t:s}=U(),r=ye(),o=yt(),{isDark:d}=Ke(),p=vt(d),i=Sn(n),c=e.device_limit>0&&a>=e.device_limit;return e.subscription_url?t.jsxs(up,{as:"button",accentColor:i.mainHex,disabled:c,onClick:()=>{if(c){o.notification("error");return}r(`/connection?sub=${e.id}`)},className:`mb-2.5 flex w-full items-center gap-3.5 rounded-[14px] p-3.5 text-left transition-shadow duration-300 ${c?"cursor-not-allowed opacity-50":""}`,"data-onboarding":"connect-devices",style:{fontFamily:"inherit"},children:[t.jsx("div",{className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-[10px] transition-colors duration-500",style:{background:`rgba(${i.mainVarRaw}, 0.07)`},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:i.mainVar,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),t.jsx("path",{d:"M12 17v4M8 21h8"}),t.jsx("path",{d:"M12 8v4M10 10h4",opacity:"0.7"})]})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-sm font-semibold tracking-tight text-dark-50",children:s("dashboard.connectDevice")}),t.jsx("div",{className:"mt-0.5 text-[11px] text-dark-50/30",children:e.device_limit===0?s("dashboard.devicesConnectedUnlimited",{used:a}):s("dashboard.devicesOfMax",{used:a,max:e.device_limit})}),c&&t.jsx("div",{className:"mt-1 text-[10px] font-medium",style:{color:"rgb(var(--color-warning-400))"},children:s("dashboard.deviceLimitReached")})]}),e.device_limit===0?t.jsx("div",{className:"flex flex-shrink-0 items-center text-lg text-dark-50/40","aria-hidden":"true",children:"∞"}):e.device_limit<=10?t.jsx("div",{className:"flex flex-shrink-0 gap-1.5","aria-hidden":"true",children:Array.from({length:e.device_limit},(u,m)=>t.jsx("div",{className:"h-[7px] w-[7px] rounded-full transition-all duration-300",style:{background:m0?"4px":"0px"}})})})]}):null}function pp(e,a=1200){const[n,s]=l.useState(0),r=l.useRef(0),o=l.useRef(0);return l.useEffect(()=>{const d=r.current,p=performance.now(),i=c=>{const u=c-p,m=Math.min(u/a,1),h=m===1?1:1-Math.pow(2,-10*m),f=d+(e-d)*h;r.current=f,s(f),m<1&&(o.current=requestAnimationFrame(i))};return o.current=requestAnimationFrame(i),()=>cancelAnimationFrame(o.current)},[e,a]),n}function hp({subscription:e,trafficData:a,refreshTrafficMutation:n,trafficRefreshCooldown:s,connectedDevices:r}){const{t:o}=U(),{isDark:d}=Ke(),p=vt(d),i=a?.traffic_used_percent??e.traffic_used_percent,c=a?.traffic_used_gb??e.traffic_used_gb,u=a?.is_unlimited??e.traffic_limit_gb===0,m=Sn(i),h=pp(i),f=new Date(e.end_date).toLocaleDateString(Ut()),g=e.days_left,y=[];return t.jsxs("div",{className:"relative overflow-hidden rounded-3xl lg:backdrop-blur-xl",style:{background:p.cardBg,border:e.is_trial?"1px solid rgba(var(--color-accent-400), 0.15)":d?`1px solid ${p.cardBorder}`:`1px solid rgba(${m.mainVarRaw}, 0.14)`,padding:"28px 28px 24px",boxShadow:d?p.shadow:`0 2px 16px rgba(${m.mainVarRaw}, 0.07), 0 0 0 1px rgba(${m.mainVarRaw}, 0.03)`},children:[t.jsxs("div",{className:"mb-7 flex items-start justify-between",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[t.jsx("div",{className:"h-2 w-2 rounded-full",style:{background:m.mainVar,transition:"background 0.6s ease"},"aria-hidden":"true"}),t.jsx("span",{className:"font-mono text-[11px] font-semibold uppercase tracking-widest",style:{color:m.mainVar,transition:"color 0.6s ease"},children:o(u?"dashboard.unlimited":m.labelKey)}),e.is_trial&&t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-accent-400/25 bg-accent-400/10 px-2 py-0.5 font-mono text-[9px] font-bold uppercase tracking-widest text-accent-400",children:[t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:t.jsx("path",{d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z",strokeLinecap:"round",strokeLinejoin:"round"})}),o("subscription.trialStatus")]})]}),t.jsx("h2",{className:"text-lg font-bold tracking-tight text-dark-50",children:o("dashboard.trafficUsageTitle")})]}),t.jsx("div",{className:"text-right",children:u?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"font-display text-[28px] font-extrabold leading-none tracking-tight",style:{color:m.mainVar},children:"∞"}),t.jsxs("div",{className:"mt-1 font-mono text-[11px] text-dark-50/30",children:[Et(c)," ",o("dashboard.usedSuffix")]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"font-display text-[38px] font-extrabold leading-none tracking-tight text-dark-50",children:[h.toFixed(0),t.jsx("span",{className:"ml-px text-lg font-medium text-dark-50/35",children:"%"})]}),t.jsxs("div",{className:"mt-0.5 font-mono text-[11px] text-dark-50/30",children:[Et(c)," / ",Et(e.traffic_limit_gb)]})]})})]}),t.jsx("div",{className:"mb-6",children:t.jsx(lp,{usedGb:c,limitGb:e.traffic_limit_gb,percent:i,isUnlimited:u})}),t.jsx(mp,{subscription:e,connectedDevices:r,usedPercent:i}),t.jsxs("div",{className:"mb-5 flex gap-2.5",children:[t.jsxs(de,{to:`/subscriptions/${e.id}`,className:"flex-1 rounded-[14px] p-3.5 transition-colors",style:{background:p.innerBg,border:`1px solid ${p.innerBorder}`},children:[t.jsx("div",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wider",style:{color:p.textFaint},children:o("dashboard.tariff")}),t.jsx("div",{className:"min-w-0 truncate text-base font-bold leading-tight tracking-tight text-dark-50",children:e.tariff_name||o("subscription.currentPlan")}),t.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-dark-50/30",children:o("dashboard.validUntil",{date:f})})]}),t.jsxs("div",{className:"flex-1 rounded-[14px] p-3.5 transition-colors duration-300",style:{background:p.innerBg,border:g<=3?"1px solid rgba(var(--color-warning-400), 0.2)":`1px solid ${p.innerBorder}`},children:[t.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-dark-50/35",children:[t.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[7px] transition-colors duration-300",style:{background:g<=3?"rgba(var(--color-warning-400), 0.1)":p.hoverBg},children:t.jsx("span",{style:{color:g<=3?"rgb(var(--color-warning-400))":p.textSecondary},"aria-hidden":"true",children:t.jsx(Fr,{className:"h-[13px] w-[13px]"})})}),o("dashboard.remaining")]}),t.jsxs("div",{className:"flex items-baseline gap-1",children:[t.jsx("span",{className:"text-[22px] font-bold tracking-tight transition-colors duration-300",style:{color:g<=3?"rgb(var(--color-warning-400))":p.text},children:g}),t.jsx("span",{className:"text-xs font-medium text-dark-50/25",children:o("subscription.daysShort")})]})]})]}),t.jsxs("div",{className:"mb-5 flex items-center justify-between px-0.5",children:[t.jsxs("button",{onClick:()=>n.mutate(),disabled:n.isPending||s>0,className:"flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-medium text-dark-50/35 transition-colors hover:bg-dark-50/[0.05] hover:text-dark-50/50 disabled:cursor-not-allowed disabled:opacity-50","aria-label":o("common.refresh"),children:[t.jsx(qr,{className:`h-3 w-3 ${n.isPending?"animate-spin":""}`}),s>0?`${s}s`:o("common.refresh")]}),t.jsxs(de,{to:`/subscriptions/${e.id}`,className:"text-[11px] font-medium text-dark-50/25 transition-colors hover:text-dark-50/40",children:[o("dashboard.viewSubscription")," →"]})]}),y.length>=2&&t.jsxs("div",{className:"rounded-[14px] p-3.5 pb-3",style:{background:p.innerBg,border:`1px solid ${p.innerBorder}`},children:[t.jsxs("div",{className:"mb-2.5 flex items-center justify-between",children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider text-dark-50/40",children:o("dashboard.usageLast14Days")}),t.jsx("span",{className:"font-mono text-[11px] text-dark-50/25",children:o("dashboard.maxUsage",{amount:Et(Math.max(...y))})})]}),t.jsx(dp,{data:y,width:440,height:44,color:m.mainVar})]})]})}const gg=e=>{if(e instanceof un){const a=e.response?.data?.detail;if(typeof a=="string")return a;if(typeof a=="object"&&a?.message)return a.message}return e instanceof Error?e.message:Le.t("common.error")},fp=e=>{if(e instanceof un){const a=e.response?.data?.detail;if(typeof a=="object"&&(a?.code==="insufficient_balance"||a?.code==="insufficient_funds"))return{required:a.required||a.total_price||0,balance:a.balance||0,missingAmount:a.missing_amount||a.missingAmount||0}}return null},xg=e=>{const a=(e??"").trim();if(a.length!==2||!/^[A-Za-z]{2}$/.test(a))return"";const n=a.toUpperCase().split("").map(s=>127397+s.charCodeAt(0));return String.fromCodePoint(...n)};function gp({subscription:e,balanceKopeks:a=0,balanceRubles:n=0,className:s}){const{t:r}=U(),{isDark:o}=Ke(),d=vt(o),p=Ye(),i=ye(),c=He(),{formatAmount:u,currencySymbol:m}=Kt(),h=fn(),[f,g]=l.useState(!1),[y,w]=l.useState(null),A=new Date(e.end_date).toLocaleDateString(Ut()),T=e.is_limited,N=e.is_daily,v=e.status==="disabled"&&N,S=e.daily_price_kopeks??0,L=N?a>=S&&S>0:a>=100,V=async()=>{g(!0),w(null),h.buttonPressHeavy();try{v?await Ie.togglePause(e.id):N&&e.tariff_id?await Ie.purchaseTariff(e.tariff_id,1,void 0,e.id):await Ie.renewSubscription(30,e.id),h.success(),p.invalidateQueries({predicate:M=>Array.isArray(M.queryKey)&&M.queryKey[0]==="subscription"}),p.invalidateQueries({queryKey:["subscriptions-list"]}),p.invalidateQueries({queryKey:["balance"]}),p.invalidateQueries({queryKey:["purchase-options"]})}catch(M){if(h.error(),fp(M))w(r("dashboard.expired.insufficientFunds"));else if(M instanceof un){const $=M.response?.data?.detail;w(typeof $=="string"?$:r("dashboard.expired.renewError"))}else w(r("dashboard.expired.renewError"))}finally{g(!1)}},O=()=>{h.buttonPress();const M=new URLSearchParams;M.set("returnTo",c.pathname),i(`/balance/top-up?${M.toString()}`)},I=T?{r:255,g:184,b:0,hex:"rgb(var(--color-urgent-400))",gradient:"linear-gradient(135deg, #FFB800, #FF8C00)"}:{r:255,g:59,b:92,hex:"rgb(var(--color-critical-500))",gradient:"linear-gradient(135deg, #FF3B5C, #FF6B35)"};return t.jsxs("div",{className:`relative overflow-hidden rounded-3xl ${s??""}`,style:{background:d.cardBg,border:o?`1px solid rgba(${I.r},${I.g},${I.b},0.12)`:`1px solid rgba(${I.r},${I.g},${I.b},0.2)`,boxShadow:o?d.shadow:`0 2px 16px rgba(${I.r},${I.g},${I.b},0.1), 0 0 0 1px rgba(${I.r},${I.g},${I.b},0.06)`,padding:"28px 28px 24px"},children:[t.jsx("div",{className:"pointer-events-none absolute",style:{top:-60,right:-60,width:200,height:200,borderRadius:"50%",background:`radial-gradient(circle, rgba(${I.r},${I.g},${I.b},0.08) 0%, transparent 70%)`},"aria-hidden":"true"}),t.jsx("div",{className:"pointer-events-none absolute inset-0",style:{opacity:o?.02:.04,backgroundImage:o?`linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px)`:`linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px)`,backgroundSize:"40px 40px"},"aria-hidden":"true"}),t.jsxs("div",{className:"mb-5 flex items-center gap-3",children:[t.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-[14px]",style:{background:`rgba(${I.r},${I.g},${I.b},0.1)`,border:`1px solid rgba(${I.r},${I.g},${I.b},0.15)`,color:I.hex},children:T?t.jsx(Ht,{className:"h-[22px] w-[22px]"}):t.jsx(la,{className:"h-[22px] w-[22px]"})}),t.jsx("h2",{className:"text-lg font-bold tracking-tight text-dark-50",children:T?r("subscription.trafficLimitedTitle"):v?r("dashboard.suspended.title"):e.is_trial?r("dashboard.expired.trialTitle"):r("dashboard.expired.title")})]}),T&&t.jsx("p",{className:"mb-4 text-sm text-dark-50/60",children:r("subscription.trafficLimitedDescription")}),t.jsxs("div",{className:"mb-5 flex items-center justify-between rounded-[14px]",style:{background:`rgba(${I.r},${I.g},${I.b},0.04)`,border:`1px solid rgba(${I.r},${I.g},${I.b},0.08)`,padding:"14px 18px"},children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"mb-0.5 font-mono text-[10px] font-medium uppercase tracking-wider text-dark-50/30",children:T?r("dashboard.expired.activeUntil"):r("dashboard.expired.expiredDate",{context:e.is_trial?"trial":""})}),t.jsx("div",{className:"ml-3 text-base font-bold tracking-tight text-dark-50/50",children:A})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-dark-50/30",children:r("dashboard.expired.balance")}),t.jsxs("span",{className:`text-sm font-semibold ${L?"text-success-400":"text-dark-50/30"}`,children:[u(n)," ",m]})]})]}),y&&t.jsx("div",{className:"mb-4 rounded-xl border border-error-500/30 bg-error-500/10 p-3 text-center text-sm text-error-400",role:"alert",children:y}),t.jsx("div",{className:"flex gap-2.5",children:T?t.jsxs(de,{to:`/subscriptions/${e.id}`,className:"flex flex-1 items-center justify-center gap-2 rounded-[14px] py-3.5 text-[15px] font-semibold tracking-tight text-white transition-all duration-300",style:{background:I.gradient,boxShadow:`0 4px 20px rgba(${I.r},${I.g},${I.b},0.2)`},children:[t.jsx(Ya,{className:"h-4 w-4"}),r("subscription.buyTraffic")]}):t.jsxs(t.Fragment,{children:[!e.is_trial&&t.jsx(t.Fragment,{children:L?t.jsxs("button",{type:"button",onClick:V,disabled:f,className:"flex flex-1 items-center justify-center gap-2 rounded-[14px] py-3.5 text-[15px] font-semibold tracking-tight text-white transition-all duration-300 disabled:opacity-50",style:{background:I.gradient,boxShadow:`0 4px 20px rgba(${I.r},${I.g},${I.b},0.2)`},children:[f?t.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white","aria-hidden":"true"}):t.jsx(ya,{className:"h-4 w-4"}),r(f?"common.loading":v?"dashboard.suspended.resume":"dashboard.expired.quickRenew")]}):t.jsxs("button",{type:"button",onClick:O,className:"flex flex-1 items-center justify-center gap-2 rounded-[14px] py-3.5 text-[15px] font-semibold tracking-tight text-white transition-all duration-300",style:{background:I.gradient,boxShadow:`0 4px 20px rgba(${I.r},${I.g},${I.b},0.2)`},children:[t.jsx(Ya,{className:"h-4 w-4"}),r("dashboard.expired.topUp")]})}),t.jsx(de,{to:"/subscription/purchase",className:`flex items-center justify-center rounded-[14px] px-5 py-3.5 text-[15px] font-semibold tracking-tight transition-colors duration-200 ${e.is_trial?"flex-1 text-white":"text-dark-50/50"}`,style:e.is_trial?{background:I.gradient,boxShadow:`0 4px 20px rgba(${I.r},${I.g},${I.b},0.2)`}:{background:d.innerBg,border:`1px solid ${d.innerBorder}`},children:r("dashboard.expired.tariffs")})]})})]})}function xp({trialInfo:e,balanceKopeks:a,balanceRubles:n,activateTrialMutation:s,trialError:r}){const{t:o}=U(),{formatAmount:d,currencySymbol:p}=Kt(),{isDark:i}=Ke(),c=vt(i),u=!e.requires_payment,m=a>=e.price_kopeks;return t.jsxs("div",{className:"relative overflow-hidden rounded-3xl text-center",style:{background:c.cardBg,border:i?`1px solid ${c.cardBorder}`:u?"1px solid rgba(var(--color-accent-400), 0.2)":"1px solid rgba(255,184,0,0.2)",boxShadow:i?c.shadow:u?"0 2px 16px rgba(var(--color-accent-400), 0.12), 0 0 0 1px rgba(var(--color-accent-400), 0.06)":"0 2px 16px rgba(255,184,0,0.12), 0 0 0 1px rgba(255,184,0,0.06)",padding:"32px 28px 28px"},children:[t.jsx("div",{className:"pointer-events-none absolute left-1/2 -translate-x-1/2",style:{top:-100,width:300,height:300,borderRadius:"50%",background:u?"radial-gradient(circle, rgba(var(--color-accent-400), 0.08) 0%, transparent 70%)":"radial-gradient(circle, rgba(255,184,0,0.07) 0%, transparent 70%)",transition:"background 0.5s ease"},"aria-hidden":"true"}),t.jsx("div",{className:"pointer-events-none absolute inset-0",style:{opacity:i?.025:.04,backgroundImage:i?`linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px)`:`linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px)`,backgroundSize:"40px 40px"},"aria-hidden":"true"}),t.jsxs("div",{className:"relative mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-2xl",style:{background:i?u?"linear-gradient(135deg, rgba(var(--color-accent-900), 0.5), rgba(var(--color-accent-950), 0.6))":"linear-gradient(135deg, #3a3020, #282418)":u?"linear-gradient(135deg, rgba(var(--color-accent-400), 0.15), rgba(var(--color-accent-400), 0.08))":"linear-gradient(135deg, rgba(255,184,0,0.15), rgba(255,184,0,0.08))",border:u?"1px solid rgba(var(--color-accent-400), 0.25)":"1px solid rgba(255,184,0,0.25)",transition:"all 0.5s ease"},children:[u?t.jsx("span",{className:"flex",style:{color:"rgb(var(--color-accent-400))"},"aria-hidden":"true",children:t.jsx($d,{className:"h-[26px] w-[26px]"})}):t.jsx("span",{className:"flex",style:{color:"rgb(var(--color-urgent-400))"},"aria-hidden":"true",children:t.jsx(Dd,{className:"h-[26px] w-[26px]"})}),t.jsx("div",{className:"absolute inset-[-1px] animate-trial-glow rounded-2xl",style:{boxShadow:u?"0 0 20px rgba(var(--color-accent-400), 0.15)":"0 0 20px rgba(255,184,0,0.12)"},"aria-hidden":"true"})]}),t.jsx("h2",{className:"mb-1.5 text-[22px] font-bold tracking-tight text-dark-50",children:o(u?"dashboard.trialOffer.freeTitle":"dashboard.trialOffer.paidTitle")}),t.jsx("p",{className:"mb-5 text-sm text-dark-50/40",children:o(u?"dashboard.trialOffer.freeDesc":"dashboard.trialOffer.paidDesc")}),!u&&e.price_rubles>0&&t.jsxs("div",{className:"mb-5 inline-flex items-baseline gap-1 rounded-xl px-5 py-2",style:{background:"rgba(255,184,0,0.08)",border:"1px solid rgba(255,184,0,0.15)"},children:[t.jsx("span",{className:"text-[32px] font-extrabold leading-none tracking-tight",style:{color:"rgb(var(--color-urgent-400))"},children:e.price_rubles.toFixed(0)}),t.jsx("span",{className:"text-base font-semibold opacity-70",style:{color:"rgb(var(--color-urgent-400))"},children:p})]}),t.jsx("div",{className:"mb-7 flex justify-center gap-8",children:[{value:String(e.duration_days),label:o("subscription.trial.days")},{value:e.traffic_limit_gb===0?"∞":String(e.traffic_limit_gb),label:o("common.units.gb")},{value:e.device_limit===0?"∞":String(e.device_limit),label:o("subscription.trial.devices")}].map((h,f)=>t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-4xl font-extrabold leading-none tracking-tight text-dark-50",children:h.value}),t.jsx("div",{className:"mt-1 text-xs font-medium text-dark-50/30",children:h.label})]},f))}),!u&&e.price_rubles>0&&t.jsxs("div",{className:"mb-4 space-y-2 rounded-xl p-4 text-left",style:{background:c.innerBg,border:`1px solid ${c.innerBorder}`},children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm text-dark-50/40",children:o("balance.currentBalance")}),t.jsxs("span",{className:`font-display text-sm font-semibold ${m?"text-success-400":"text-warning-400"}`,children:[d(n)," ",p]})]}),!m&&t.jsx("div",{className:"text-xs text-warning-400",children:o("subscription.trial.insufficientBalance")})]}),r&&t.jsx("div",{className:"mb-4 rounded-xl border border-error-500/30 bg-error-500/10 p-3 text-center text-sm text-error-400",children:r}),!u&&e.price_kopeks>0?m?t.jsx("button",{onClick:()=>!s.isPending&&s.mutate(),disabled:s.isPending,className:"w-full rounded-[14px] py-4 text-base font-bold tracking-tight transition-all duration-300 disabled:opacity-50",style:{background:"linear-gradient(135deg, #FFB800, #FF8C42)",color:"#1a1200",boxShadow:"0 4px 20px rgba(255,184,0,0.2)"},children:s.isPending?o("common.loading"):o("subscription.trial.payAndActivate")}):t.jsx(de,{to:"/balance",className:"block w-full rounded-[14px] py-4 text-center text-base font-bold tracking-tight transition-all duration-300",style:{background:"linear-gradient(135deg, #FFB800, #FF8C42)",color:"#1a1200",boxShadow:"0 4px 20px rgba(255,184,0,0.2)"},children:o("subscription.trial.topUpToActivate")}):t.jsx("button",{onClick:()=>!s.isPending&&s.mutate(),disabled:s.isPending,className:"w-full rounded-[14px] py-4 text-base font-bold tracking-tight transition-all duration-300 disabled:opacity-50",style:i?{background:"linear-gradient(135deg, rgba(var(--color-accent-400), 0.12) 0%, rgba(var(--color-accent-400), 0.04) 100%)",border:"1px solid rgba(var(--color-accent-400), 0.25)",color:"#fff"}:{background:"linear-gradient(135deg, rgb(var(--color-accent-400)), rgb(var(--color-accent-500)))",color:"#0a2a1e",boxShadow:"0 4px 20px rgba(var(--color-accent-400), 0.25)"},children:s.isPending?o("common.loading"):o("subscription.trial.activate")})]})}const vs={up:{arrow:"↑",className:"text-success-400"},down:{arrow:"↓",className:"text-error-400"},stable:{arrow:"→",className:"text-dark-400"}},bp={neutral:{chip:"bg-dark-700/60 text-dark-300",value:"text-dark-100"},success:{chip:"bg-success-500/15 text-success-400",value:"text-success-400"},accent:{chip:"bg-accent-500/15 text-accent-400",value:"text-accent-400"},warning:{chip:"bg-warning-500/15 text-warning-400",value:"text-warning-400"},error:{chip:"bg-error-500/15 text-error-400",value:"text-error-400"}};function ws({label:e,value:a,icon:n,tone:s="neutral",valueClassName:r,subValue:o,loading:d,trailing:p,delta:i}){const c=bp[s],u=r??c.value,m=i?vs[i.trend]??vs.stable:null;return t.jsxs("div",{className:"h-full rounded-xl bg-dark-800/30 p-3 transition-colors hover:bg-dark-800/50",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d&&!e?t.jsx(_e,{className:"h-[15px] w-24 sm:h-5"}):t.jsx("span",{className:"line-clamp-2 text-xs leading-tight text-dark-500 sm:text-sm",children:e}),p]}),t.jsxs("div",{className:"mt-1.5 flex items-center gap-2.5",children:[n&&t.jsx("span",{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg [&>svg]:h-5 [&>svg]:w-5 ${c.chip}`,children:n}),t.jsx("div",{className:"min-w-0 flex-1",children:d?t.jsx(_e,{className:"h-7 w-20 rounded"}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`truncate text-lg font-semibold sm:text-xl ${u}`,children:a}),o&&t.jsx("div",{className:"truncate text-xs text-dark-500",children:o})]})})]}),m&&t.jsxs("div",{className:`mt-1.5 text-xs font-medium ${m.className}`,children:[m.arrow," ",Math.abs(i.percent),"%"]})]})}function yp({balanceRubles:e,referralCount:a,earningsRubles:n,refLoading:s}){const{t:r}=U(),{formatAmount:o,currencySymbol:d}=Kt(),p=t.jsx(Bt,{className:"h-4 w-4 shrink-0 text-dark-500"});return t.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[t.jsx(de,{to:"/balance",className:"block h-full","data-onboarding":"balance",children:t.jsx(ws,{label:r("dashboard.stats.balance"),value:`${o(e)} ${d}`,icon:t.jsx(Vd,{className:"h-5 w-5"}),tone:"accent",trailing:p})}),t.jsx(de,{to:"/referral",className:"block h-full",children:t.jsx(ws,{label:r("dashboard.stats.referrals"),value:`${a}`,subValue:`+${o(n)} ${d}`,icon:t.jsx(Zt,{className:"h-5 w-5"}),tone:"neutral",loading:s,trailing:p})})]})}const vp={getConfig:async()=>{const{data:e}=await b.get("/cabinet/gift/config");return e},createPurchase:async e=>{const{data:a}=await b.post("/cabinet/gift/purchase",e);return a},getPurchaseStatus:async e=>{const{data:a}=await b.get(`/cabinet/gift/purchase/${e}`);return a},getPendingGifts:async()=>{const{data:e}=await b.get("/cabinet/gift/pending");return e},getSentGifts:async()=>{const{data:e}=await b.get("/cabinet/gift/sent");return e},getReceivedGifts:async()=>{const{data:e}=await b.get("/cabinet/gift/received");return e},activateGiftCode:async e=>{const{data:a}=await b.post("/cabinet/gift/activate",{code:e});return a}};function wp({gifts:e,className:a}){const{t:n}=U();return e.length===0?null:t.jsx("div",{className:a??"space-y-3",children:e.map(s=>t.jsxs(ge.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"relative overflow-hidden rounded-2xl border border-accent-500/30 bg-gradient-to-r from-accent-500/10 via-purple-500/10 to-accent-500/10 p-5",children:[t.jsx("div",{className:"absolute -right-8 -top-8 h-24 w-24 rounded-full bg-accent-500/10 blur-2xl"}),t.jsxs("div",{className:"relative flex items-start gap-4",children:[t.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-xl bg-accent-500/20",children:t.jsx(vn,{className:"h-6 w-6 text-accent-400"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h3",{className:"text-sm font-semibold text-dark-50",children:n("gift.pending.title")}),t.jsxs("p",{className:"mt-0.5 text-xs text-dark-300",children:[s.tariff_name&&t.jsxs("span",{children:[s.tariff_name," — ",s.period_days," ",n("gift.days")]}),s.sender_display&&t.jsx("span",{className:"ml-1 text-dark-400",children:n("gift.pending.from",{sender:s.sender_display})})]}),s.gift_message&&t.jsxs("p",{className:"mt-1.5 line-clamp-2 text-xs italic text-dark-400",children:["“",s.gift_message,"”"]})]}),t.jsx(de,{to:`/gift?tab=activate&code=${s.token}`,className:"shrink-0 rounded-xl bg-accent-500 px-4 py-2 text-sm font-medium text-on-accent transition-colors hover:bg-accent-400",children:n("gift.pending.activate")})]})]},s.token))})}const kp=new Set(["active","trial","limited"]);function jp({status:e,subscriptionUrl:a,deviceLimit:n,connected:s}){if(!a||!kp.has(e))return{kind:"hidden"};if(s===void 0)return{kind:"loading"};const r=n===0;return!r&&s>=n?{kind:"full",used:s,limit:n}:{kind:"connect",used:s,limit:n,unlimited:r,highlight:s===0}}function _p({state:e,borderColor:a,mutedColor:n,onConnect:s,onManage:r}){const{t:o}=U();if(e.kind==="hidden")return null;if(e.kind==="loading")return t.jsx("div",{className:"flex items-center gap-2.5 border-t px-4 py-2.5",style:{borderColor:a},role:"status","aria-busy":"true","aria-label":o("common.loading"),children:t.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[t.jsx(_e,{className:"h-4 w-4 shrink-0"}),t.jsx(_e,{className:"h-3.5 w-40"}),t.jsx(_e,{className:"ml-auto h-3 w-10"}),t.jsx("span",{"aria-hidden":!0,className:"w-0 overflow-hidden text-[13px] font-medium",children:" "})]})});const d=e.kind==="full",p=e.kind==="connect"&&e.highlight,i=e.kind==="connect"&&e.unlimited?`${e.used} · ∞`:`${e.used} / ${e.limit}`;return t.jsxs("button",{type:"button",onClick:d?r:s,className:"flex w-full items-center gap-2.5 border-t px-4 py-2.5 text-left transition-colors active:bg-accent-500/10",style:{borderColor:a},children:[d?t.jsx(Ur,{className:"h-4 w-4 shrink-0 text-warning-400/80"}):t.jsx(Rt,{className:x("h-4 w-4 shrink-0",p?"text-accent-400":"opacity-40")}),t.jsx("span",{className:x("text-[13px] font-medium",p&&"text-accent-400"),style:p?void 0:{color:n},children:d?o("subscription.connectFooter.full","Все слоты заняты"):o("subscription.connectFooter.connect","Подключить устройство")}),t.jsx("span",{className:x("ml-auto text-[11px] tabular-nums",d&&"text-warning-400/80"),style:d?void 0:{color:n},children:i}),t.jsx(Bt,{className:"h-3.5 w-3.5 shrink-0 opacity-30"})]})}function Np(e,a){if(!e)return"—";try{return new Date(e).toLocaleDateString(a??void 0,{day:"2-digit",month:"2-digit",year:"numeric"})}catch{return"—"}}function Cp({status:e,isTrial:a,t:n}){const s=e==="active"||e==="trial",r=e==="limited",o=e==="expired"||e==="disabled";if(a)return t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-warning-400/25 bg-warning-400/10 px-2 py-0.5 text-[10px] font-semibold text-warning-400",children:[t.jsx("svg",{className:"h-2.5 w-2.5",viewBox:"0 0 24 24",fill:"currentColor",children:t.jsx("path",{d:"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"})}),n("subscription.statusTrial","Тестовая")]});const d=s?"bg-success-400/15 text-success-400 border-success-400/20":r?"bg-warning-400/15 text-warning-400 border-warning-400/20":"bg-error-400/15 text-error-400 border-error-400/20",p=s?n("subscription.statusActive","Активна"):r?n("subscription.statusLimited","Ограничена"):o?n("subscription.statusExpired","Истекла"):e;return t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-semibold ${d}`,children:p})}function Ap({subscription:e,onClick:a,connect:n}){const{t:s,i18n:r}=U(),{isDark:o}=Ke(),d=vt(o),{impact:p}=yt(),i=()=>{p("light"),a()},c=e.is_trial,u=e.status==="active"||e.status==="trial"||e.status==="limited",m=e.status==="expired"||e.status==="disabled",h=e.traffic_limit_gb,f=e.traffic_used_gb,g=h===0,y=g?0:h>0?Math.min(100,f/h*100):0,w=y>=90?"bg-error-400":y>=70?"bg-warning-400":"bg-success-400",A=e.status==="limited",T=c||A?"rgba(251,191,36,0.2)":m?"rgba(255,59,92,0.15)":d.cardBorder,N=c||A?o?"rgba(251,191,36,0.04)":"rgba(251,191,36,0.03)":m?o?"rgba(255,59,92,0.04)":"rgba(255,59,92,0.03)":d.cardBg,v=n?jp({status:e.status,subscriptionUrl:e.subscription_url,deviceLimit:e.device_limit,connected:n.connectedDevices}):{kind:"hidden"};return t.jsxs("div",{className:"overflow-hidden rounded-2xl border transition-all duration-200 hover:scale-[1.01] active:scale-[0.99]",style:{background:N,borderColor:T},children:[t.jsxs("button",{onClick:i,className:"w-full p-4 text-left",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"truncate text-base font-semibold",style:{color:d.text},children:e.tariff_name||s("subscription.defaultName","Подписка")}),t.jsx(Cp,{status:e.status,isTrial:c,t:s})]}),t.jsx(Bt,{className:"h-4 w-4 shrink-0 opacity-30"})]}),u&&t.jsxs("div",{className:"mt-3",children:[t.jsxs("div",{className:"mb-1 flex items-baseline justify-between",children:[t.jsx("span",{className:"text-[11px] font-medium",style:{color:d.textSecondary},children:s("subscription.traffic","Трафик")}),t.jsx("span",{className:"text-[11px] tabular-nums",style:{color:d.textSecondary},children:g?"∞":`${f.toFixed(1)} / ${h} ${s("common.units.gb","ГБ")}`})]}),!g&&t.jsx("div",{className:"h-1.5 overflow-hidden rounded-full",style:{background:d.innerBg},children:t.jsx("div",{className:`h-full rounded-full transition-all ${w}`,style:{width:`${Math.max(1,y)}%`}})})]}),t.jsxs("div",{className:"mt-2.5 flex items-center gap-4 text-[12px]",style:{color:d.textSecondary},children:[v.kind==="hidden"&&t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Rt,{className:"h-3.5 w-3.5 opacity-50"}),e.device_limit]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Fr,{className:"h-3.5 w-3.5 opacity-50"}),Np(e.end_date,r.language)]}),!c&&(()=>{const S=e.is_daily,L=S?!e.is_daily_paused:e.autopay_enabled,V=S?s("subscription.dailyAutoCharge","Автосписание"):s("subscription.autopay","Автопродление");return t.jsxs("span",{className:`flex items-center gap-1 ${L?"text-success-400/70":"text-error-400/50"}`,children:[L?t.jsx(Pe,{className:"h-3 w-3"}):t.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),V]})})()]})]}),t.jsx(_p,{state:v,borderColor:T,mutedColor:d.textSecondary,onConnect:()=>n?.onConnect(),onManage:()=>n?.onManage()})]})}const Ep=.5,ks=300;function Tp({isOpen:e,onClose:a,snapPoints:n=[1],initialSnap:s=0,closeOnDragDown:r=!0,closeThreshold:o=.3,showHandle:d=!0,closeOnBackdropClick:p=!0,closeOnEscape:i=!0,className:c="",contentClassName:u="",title:m,children:h}){const f=l.useRef(null),g=l.useRef({startY:0,currentY:0,startHeight:0,isDragging:!1,velocity:0,lastY:0,lastTime:0}),[y,w]=l.useState(s),[A,T]=l.useState(!1),[N,v]=l.useState(0),[S,L]=l.useState(!1),V=yt(),O=`${n[y]*100}vh`;l.useEffect(()=>{if(!e||!i)return;const B=D=>{D.key==="Escape"&&(D.preventDefault(),a())};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[e,i,a]),l.useEffect(()=>{if(e){const B=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${B}px`,document.body.style.width="100%",()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.width="",window.scrollTo(0,B)}}},[e]),l.useEffect(()=>{e?requestAnimationFrame(()=>{L(!0)}):L(!1)},[e]);const I=l.useCallback((B,D)=>{const Z=window.innerHeight,le=f.current?.offsetHeight??Z;if(Math.abs(D)>Ep)return D>0?r&&B>le*.1?-1:Math.min(y+1,n.length-1):Math.max(y-1,0);const ve=B/Z;if(r&&ve>o)return-1;let we=y,q=1/0;return n.forEach((Y,z)=>{const H=(1-Y)*Z,ne=Math.abs(B-H);ne{if(A)return;const D=g.current;D.startY=B,D.currentY=B,D.startHeight=f.current?.offsetHeight??0,D.isDragging=!0,D.velocity=0,D.lastY=B,D.lastTime=Date.now()},[A]),P=l.useCallback(B=>{const D=g.current;if(!D.isDragging)return;const Z=B-D.startY,le=Date.now(),ve=le-D.lastTime;ve>0&&(D.velocity=(B-D.lastY)/ve),D.lastY=B,D.lastTime=le,D.currentY=B;const we=Math.max(0,Z);v(we)},[]),$=l.useCallback(()=>{const B=g.current;if(!B.isDragging)return;B.isDragging=!1,T(!0);const D=I(N,B.velocity);D===-1?(V.notification("warning"),v(window.innerHeight),setTimeout(()=>{a(),v(0),T(!1)},ks)):(D!==y&&V.impact("light"),w(D),v(0),setTimeout(()=>{T(!1)},ks))},[N,I,y,V,a]),X=l.useCallback(B=>{M(B.touches[0].clientY)},[M]),ce=l.useCallback(B=>{P(B.touches[0].clientY)},[P]),re=l.useCallback(()=>{$()},[$]),he=l.useCallback(B=>{M(B.clientY);const D=le=>{P(le.clientY)},Z=()=>{$(),document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",Z)};document.addEventListener("mousemove",D),document.addEventListener("mouseup",Z)},[M,P,$]),G=l.useCallback(B=>{p&&B.target===B.currentTarget&&(V.impact("light"),a())},[p,V,a]);if(!e)return null;const K=t.jsxs("div",{className:`fixed inset-0 z-50 flex items-end justify-center ${S?"opacity-100":"opacity-0"} transition-opacity duration-300`,onClick:G,children:[t.jsx("div",{className:`absolute inset-0 bg-dark-950/60 backdrop-blur-sm transition-opacity duration-300 ${S?"opacity-100":"opacity-0"}`}),t.jsxs("div",{ref:f,className:`relative w-full max-w-lg overflow-hidden rounded-t-3xl bg-dark-900 shadow-2xl ${A?"transition-transform duration-300 ease-out":""} ${S?"translate-y-0":"translate-y-full"} ${c}`,style:{maxHeight:O,transform:`translateY(${S?N:"100%"}px)`,paddingBottom:"env(safe-area-inset-bottom)"},children:[d&&t.jsx("div",{className:"flex cursor-grab touch-none items-center justify-center py-3 active:cursor-grabbing",onTouchStart:X,onTouchMove:ce,onTouchEnd:re,onMouseDown:he,children:t.jsx("div",{className:"h-1 w-10 rounded-full bg-dark-600"})}),m&&t.jsx("div",{className:"border-b border-dark-700/50 px-6 pb-4",children:t.jsx("h2",{className:"text-lg font-semibold text-dark-100",children:m})}),t.jsx("div",{className:`overflow-y-auto overscroll-contain ${u}`,style:{maxHeight:`calc(${O} - ${d?"44px":"0px"} - ${m?"60px":"0px"})`},children:h})]})]});return gt.createPortal(K,document.body)}const js="(min-width: 640px)";function Sp(){const[e,a]=l.useState(()=>typeof window<"u"&&window.matchMedia(js).matches);return l.useEffect(()=>{const n=window.matchMedia(js),s=r=>a(r.matches);return n.addEventListener("change",s),a(n.matches),()=>n.removeEventListener("change",s)},[]),e}function Lp({isOpen:e,onClose:a,title:n,children:s}){const{t:r}=U(),o=Sp(),d=qe(e&&o,{onEscape:a});return e?o?gt.createPortal(t.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[t.jsx("div",{className:"absolute inset-0 bg-dark-950/70 backdrop-blur-sm",onClick:a,"aria-hidden":!0}),t.jsxs("div",{ref:d,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,className:"relative flex max-h-[calc(100dvh-2rem)] w-full max-w-md flex-col overflow-hidden rounded-2xl border border-dark-700 bg-dark-900 shadow-2xl",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 pb-3 pt-5",children:[t.jsx("h3",{className:"text-lg font-semibold text-dark-50",children:n}),t.jsx("button",{type:"button",onClick:a,"aria-label":r("common.close","Закрыть"),className:"-mr-1.5 flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded-lg text-dark-400 transition-colors hover:bg-dark-800 hover:text-dark-200",children:t.jsx(qd,{})})]}),t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s})]})]}),document.body):t.jsx(Tp,{isOpen:!0,onClose:a,title:n,children:s}):null}function Ip({isOpen:e,onClose:a,subscriptionId:n,subscriptionName:s,deviceLimit:r,isTrial:o,devices:d,onOpenSubscription:p}){const{t:i}=U(),c=Ye(),[u,m]=l.useState(null),h=!o&&r!==0,f=st({mutationFn:g=>Ie.deleteDevice(g,n),onSuccess:()=>{m(null),c.invalidateQueries({queryKey:["devices",n]}),a()},onError:g=>m(Nt(g,i("common.error","Не удалось выполнить действие")))});return t.jsx(Lp,{isOpen:e,onClose:a,title:i("subscription.connectFooter.full","Все слоты заняты"),children:t.jsxs("div",{className:"space-y-4 px-4 pb-6 sm:px-5",children:[t.jsxs("div",{className:"flex items-start gap-3 rounded-2xl bg-warning-400/10 p-3.5",children:[t.jsx(Ur,{className:"mt-0.5 h-5 w-5 shrink-0 text-warning-400"}),t.jsx("p",{className:"text-[13px] leading-snug text-dark-200",children:h?i("subscription.connectFooter.limitExplained",{defaultValue:"Тариф «{{name}}» даёт {{count}} слота, и все заняты. Освободите слот или добавьте ещё.",name:s,count:r}):i("subscription.connectFooter.limitExplainedNoTopup",{defaultValue:"Тариф «{{name}}» даёт {{count}} слота, и все заняты. Освободите занятый слот.",name:s,count:r})})]}),t.jsxs("div",{children:[t.jsx("div",{className:"mb-2 text-[11px] uppercase tracking-wider text-dark-500",children:i("subscription.connectFooter.connectedDevices","Подключённые устройства")}),t.jsx("div",{className:"space-y-2",children:d.map(g=>t.jsxs("div",{className:"flex items-center gap-3 rounded-xl bg-dark-800/60 px-3 py-2.5",children:[t.jsx(Rt,{className:"h-4 w-4 shrink-0 opacity-40"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"truncate text-[13px] text-dark-100",children:g.local_name||g.device_model||g.platform}),t.jsx("div",{className:"text-[11px] text-dark-500",children:g.platform})]}),t.jsxs("button",{type:"button",disabled:f.isPending,onClick:()=>f.mutate(g.hwid),className:"flex min-h-[36px] shrink-0 items-center gap-1.5 rounded-lg bg-error-500/10 px-2.5 text-[12px] font-medium text-error-400 transition-colors hover:bg-error-500/20 disabled:opacity-50",children:[t.jsx(Wd,{className:"h-3.5 w-3.5"}),i("subscription.connectFooter.disconnect","Отключить")]})]},g.hwid))})]}),u&&t.jsx("p",{className:"rounded-xl bg-error-500/10 px-3 py-2 text-[12px] text-error-400",children:u}),h?t.jsxs("button",{type:"button",onClick:p,className:"btn-primary w-full",children:[t.jsx(Ya,{className:"h-4 w-4"}),i("subscription.connectFooter.addSlots","Добавить слоты")]}):t.jsx("p",{className:"rounded-xl bg-dark-800/60 px-3 py-2.5 text-[12px] leading-snug text-dark-400",children:i("subscription.connectFooter.noTopupHint","На тестовой подписке слоты докупить нельзя — освободите занятый или оформите платный тариф.")})]})})}function Rp(){const{t:e}=U(),a=ye(),n=J(H=>H.user),s=J(H=>H.refreshUser),r=Ye(),{isCompleted:o,complete:d}=Om(),[p,i]=l.useState(!1),c=me(H=>H.blockingType),[u,m]=l.useState(null);l.useEffect(()=>{s()},[s]);const{data:h}=W({queryKey:["balance"],queryFn:Bm.getBalance,staleTime:at.BALANCE_STALE_TIME_MS,refetchOnMount:"always"}),{data:f}=W({queryKey:["subscriptions-list"],queryFn:()=>Ie.getSubscriptions(),staleTime:6e4}),g=f?.multi_tariff_enabled??!1,{data:y,isLoading:w}=W({queryKey:["subscription"],queryFn:()=>Ie.getSubscription(),retry:!1,staleTime:at.BALANCE_STALE_TIME_MS,refetchOnMount:"always",enabled:!g}),A=y?.subscription??null,{data:T,isLoading:N}=W({queryKey:["trial-info"],queryFn:()=>Ie.getTrialInfo(),enabled:!A&&!w}),{data:v}=W({queryKey:["devices"],queryFn:()=>Ie.getDevices(),enabled:!!A&&!g,staleTime:at.BALANCE_STALE_TIME_MS}),S=l.useMemo(()=>f?.subscriptions?.slice(0,3)??[],[f]),L=ao({queries:S.map(H=>({queryKey:["devices",H.id],queryFn:()=>Ie.getDevices(H.id),staleTime:at.BALANCE_STALE_TIME_MS}))}),[V,O]=l.useState(null),I=S.find(H=>H.id===V)??null,M=L[S.findIndex(H=>H.id===V)]?.data,{data:P,isLoading:$}=W({queryKey:["referral-info"],queryFn:ni.getReferralInfo}),{data:X}=W({queryKey:["wheel-config"],queryFn:si.getConfig,staleTime:6e4,retry:!1}),{data:ce}=W({queryKey:["pending-gifts"],queryFn:vp.getPendingGifts,staleTime:3e4,retry:!1}),{data:re}=W({queryKey:["promo-group-discounts"],queryFn:pt.getGroupDiscounts,staleTime:6e4,retry:!1}),he=st({mutationFn:()=>Ie.activateTrial(),onSuccess:()=>{m(null),r.invalidateQueries({queryKey:["subscription"]}),r.invalidateQueries({queryKey:["subscriptions-list"]}),r.invalidateQueries({queryKey:["trial-info"]}),r.invalidateQueries({queryKey:["balance"]}),r.invalidateQueries({queryKey:["purchase-options"]}),s()},onError:H=>{m(H.response?.data?.detail||e("common.error"))}}),[G,K]=l.useState(0),[B,D]=l.useState(null),Z=st({mutationFn:()=>Ie.refreshTraffic(A?.id),onSuccess:H=>{D({traffic_used_gb:H.traffic_used_gb,traffic_used_percent:H.traffic_used_percent,is_unlimited:H.is_unlimited}),fe.setItem(`traffic_refresh_ts_${A?.id??"default"}`,Date.now().toString()),H.rate_limited&&H.retry_after_seconds?K(H.retry_after_seconds):K(30),r.invalidateQueries({queryKey:["subscription",A?.id]})},onError:H=>{if(H.response?.status===429){const ne=H.response.headers?.get?.("Retry-After");K(ne?parseInt(ne,10):30)}}});l.useEffect(()=>{if(G<=0)return;const H=setInterval(()=>{K(ne=>Math.max(0,ne-1))},1e3);return()=>clearInterval(H)},[G]);const le=l.useRef(!1);l.useEffect(()=>{if(!A||le.current)return;le.current=!0;const H=fe.getItem(`traffic_refresh_ts_${A?.id??"default"}`),ne=Date.now(),ze=at.TRAFFIC_CACHE_MS;if(H&&ne-parseInt(H,10)0&&K(ot);return}Z.mutate()},[A,Z]);const ve=g?f!==void 0&&(f.subscriptions?.length??0)===0:y?.has_subscription===!1&&!w,we=(f?.subscriptions??[]).some(H=>!H.is_trial&&(H.status==="active"||H.status==="limited"));l.useEffect(()=>{if(!o&&!w&&!$&&!c){const H=setTimeout(()=>i(!0),500);return()=>clearTimeout(H)}},[o,w,$,c]);const q=l.useMemo(()=>{const H=[{target:"welcome",title:e("onboarding.steps.welcome.title"),description:e("onboarding.steps.welcome.description"),placement:"bottom"},{target:"balance",title:e("onboarding.steps.balance.title"),description:e("onboarding.steps.balance.description"),placement:"bottom"}];return A?.subscription_url&&H.splice(1,0,{target:"connect-devices",title:e("onboarding.steps.connectDevices.title"),description:e("onboarding.steps.connectDevices.description"),placement:"bottom"}),H},[e,A]),Y=()=>{d(),i(!1)},z=di(n);return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{"data-onboarding":"welcome",children:[t.jsx("h1",{className:"text-2xl font-bold text-dark-50 sm:text-3xl",children:z?e("dashboard.welcome",{name:z}):e("dashboard.welcomeNoName")}),t.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[t.jsx("p",{className:"text-dark-400",children:e("dashboard.yourSubscription")}),re?.group_name&&t.jsxs("span",{className:"inline-flex max-w-[160px] items-center gap-1 rounded-full px-2.5 py-0.5 text-[11px] font-semibold",style:{background:"rgba(var(--color-accent-400), 0.1)",border:"1px solid rgba(var(--color-accent-400), 0.2)",color:"rgb(var(--color-accent-400))"},children:[t.jsx(Qd,{filled:!0,className:"h-2.5 w-2.5 shrink-0"}),t.jsx("span",{className:"truncate",children:re.group_name})]})]})]}),ce&&ce.length>0&&t.jsx(wp,{gifts:ce}),g&&f?.subscriptions&&f.subscriptions.length>0&&t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between px-1",children:[t.jsx("span",{className:"text-sm font-medium opacity-60",children:e("dashboard.subscriptions","Подписки")}),t.jsxs(de,{to:"/subscriptions",className:"text-xs text-accent-400 hover:underline",children:[e("dashboard.manageAll","Управление")," →"]})]}),S.map((H,ne)=>t.jsx(Ap,{subscription:H,onClick:()=>a(`/subscriptions/${H.id}`),connect:{connectedDevices:L[ne]?.data?.total,onConnect:()=>a(`/connection?sub=${H.id}`),onManage:()=>O(H.id)}},H.id)),f.subscriptions.length>3&&t.jsxs(de,{to:"/subscriptions",className:"flex w-full items-center justify-center rounded-2xl border border-dashed border-white/15 p-3 text-xs opacity-50 transition-opacity hover:opacity-80",children:[e("dashboard.showAll","Показать все")," (",f.subscriptions.length,")"]}),we?t.jsxs(de,{to:"/subscription/purchase",className:"flex w-full items-center justify-center gap-2 rounded-2xl bg-accent-500/15 p-3.5 text-sm font-medium text-accent-400 transition-all hover:bg-accent-500/25",children:[t.jsx("span",{className:"text-base",children:"+"})," ",e("subscriptions.buyAnother","Купить ещё тариф")]}):t.jsxs(de,{to:"/subscription/purchase",className:"flex w-full items-center justify-center gap-2 rounded-2xl bg-accent-500 p-3.5 text-sm font-semibold text-on-accent transition-colors hover:bg-accent-600",children:[t.jsx("span",{className:"text-base",children:"+"})," ",e("subscriptions.browsePlans","Посмотреть тарифы и купить подписку")]})]}),!g&&(w?t.jsxs(ka,{className:"bento-card",children:[t.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[t.jsx(_e,{className:"h-5 w-20"}),t.jsx(_e,{className:"h-6 w-16 rounded-full"})]}),t.jsx(_e,{className:"mb-3 h-10 w-32"}),t.jsx(_e,{className:"mb-3 h-4 w-40"}),t.jsx(_e,{className:"h-3 w-full rounded-full"}),t.jsx("div",{className:"mt-5",children:t.jsx(_e,{className:"h-12 w-full rounded-xl"})})]}):A?.is_expired||A?.status==="disabled"||A?.is_limited?t.jsx(gp,{subscription:A,balanceKopeks:h?.balance_kopeks??0,balanceRubles:h?.balance_rubles??0}):A?t.jsx(hp,{subscription:A,trafficData:B,refreshTrafficMutation:Z,trafficRefreshCooldown:G,connectedDevices:v?.total??0}):null),ve&&!N&&t.jsxs("div",{className:"space-y-3",children:[T?.is_available&&t.jsx(xp,{trialInfo:T,balanceKopeks:h?.balance_kopeks||0,balanceRubles:h?.balance_rubles||0,activateTrialMutation:he,trialError:u}),t.jsxs(de,{to:"/subscription/purchase",className:"flex w-full items-center justify-center gap-2 rounded-2xl bg-accent-500 p-3.5 text-sm font-semibold text-on-accent transition-colors hover:bg-accent-600",children:[t.jsx("span",{className:"text-base",children:"+"})," ",e("subscriptions.browsePlans","Посмотреть тарифы и купить подписку")]})]}),t.jsx(Km,{}),t.jsx(yp,{balanceRubles:h?.balance_rubles||0,referralCount:P?.total_referrals||0,earningsRubles:P?.available_balance_rubles||0,refLoading:$}),X?.is_enabled&&t.jsxs(de,{to:"/wheel",className:"bento-card-hover group flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("span",{className:"text-3xl",children:"🎰"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h3",{className:"text-base font-semibold text-dark-100",children:e("wheel.banner.title")}),t.jsx("p",{className:"text-sm text-dark-400",children:e("wheel.banner.description")})]})]}),t.jsx("div",{className:"flex-shrink-0 text-dark-500 transition-all duration-300 group-hover:translate-x-1 group-hover:text-accent-400",children:t.jsx(Bt,{})})]}),t.jsx(ep,{}),p&&t.jsx(Zm,{steps:q,onComplete:Y,onSkip:Y}),I&&t.jsx(Ip,{isOpen:!0,onClose:()=>O(null),subscriptionId:I.id,subscriptionName:I.tariff_name||e("subscription.defaultName","Подписка"),deviceLimit:I.device_limit,isTrial:I.is_trial,devices:M?.devices??[],onOpenSubscription:()=>{O(null),a(`/subscriptions/${I.id}`)}})]})}function E(e){return l.lazy(()=>e().catch(()=>{const a="chunk_reload_ts",n=Number(ee.getItem(a)||"0");return Date.now()-n>3e4&&ee.setItem(a,String(Date.now()))&&window.location.reload(),e()}))}const Pp=E(()=>k(()=>import("./Subscriptions-B1l_KFAe.js"),__vite__mapDeps([31,1,3,7,4,5,6,8,9,10]))),Mp=E(()=>k(()=>import("./Subscription-aPqJNW-H.js"),__vite__mapDeps([32,1,3,33,34,7,35,36,37,6,38,4,5,8,9,10]))),Dp=E(()=>k(()=>import("./SubscriptionPurchase-InU64qR_.js"),__vite__mapDeps([39,1,3,34,7,4,37,40,6,38,5,8,9,10]))),Vp=E(()=>k(()=>import("./Balance-BStRmkzG.js"),__vite__mapDeps([41,1,3,42,9,4,8,43,7,5,6,10]))),Hp=E(()=>k(()=>import("./SavedCards-DxWZ4zFO.js"),__vite__mapDeps([44,1,3,42,9,4,8,7,5,6,10]))),Bp=E(()=>k(()=>import("./Referral-C-4IyI08.js"),__vite__mapDeps([45,1,3,46,47,48,49,7,50,4,51,38,5,6,8,9,10]))),Op=E(()=>k(()=>import("./Support-Bf1hEX6y.js"),__vite__mapDeps([52,1,3,53,4,54,55,42,9,8,7,5,6,10]))),Zp=E(()=>k(()=>import("./Profile-DX-vdRV5.js"),__vite__mapDeps([56,1,3,42,9,4,8,7,5,6,10]))),Fp=E(()=>k(()=>import("./Contests-6iLPin6O.js"),__vite__mapDeps([57,1,3,38,7,4,5,6,8,9,10]))),$p=E(()=>k(()=>import("./Polls-DJC3LFvx.js"),__vite__mapDeps([58,1,3,38,7,4,5,6,8,9,10]))),Up=E(()=>k(()=>import("./Info-DiJY_50y.js"),__vite__mapDeps([59,1,3,4,60,7,5,6,8,9,10]))),Kp=E(()=>k(()=>import("./Wheel-CeGJh_zD.js"),__vite__mapDeps([61,1,3,62,63,42,9,4,8,38,7,5,6,10]))),qp=E(()=>k(()=>import("./GiftSubscription-BSQ7Nfji.js"),__vite__mapDeps([64,1,3,65,5,37,7,8,4,6,9,10]))),zp=E(()=>k(()=>import("./GiftResult-Hy15tSBy.js"),__vite__mapDeps([66,1,3,67,7,68,8,69,4,5,6,9,10]))),Wp=E(()=>k(()=>import("./Connection-CYEQhywl.js"),__vite__mapDeps([70,1,3,36,35,4,7,65,5,6,8,9,10]))),Gp=E(()=>k(()=>import("./ConnectionQR-CUDBEGbq.js"),__vite__mapDeps([71,1,72,7,3,4,5,6,8,9,10]))),Qp=E(()=>k(()=>import("./QuickPurchase-DtGvtzIH.js"),__vite__mapDeps([73,1,3,4,74,7,8,5,6,9,10]))),Yp=E(()=>k(()=>import("./PurchaseSuccess-DV-KwyyG.js"),__vite__mapDeps([75,1,3,74,67,7,68,8,69,4,5,6,9,10]))),Xp=E(()=>k(()=>import("./GiftClaim-DA-GtGae.js"),__vite__mapDeps([76,1,3,74,67,7,68,8,4,5,6,9,10]))),Jp=E(()=>k(()=>import("./RenewSubscription-BBcpQhaL.js"),__vite__mapDeps([77,1,3,40,34,7,38,4,5,6,8,9,10]))),eh=E(()=>k(()=>import("./AutoLogin-DcsuLUvC.js"),__vite__mapDeps([78,1,7,3,4,5,6,8,9,10]))),th=E(()=>k(()=>import("./TopUpMethodSelect-C3my6L4m.js"),__vite__mapDeps([79,1,3,42,9,4,8,80,7,5,6,10]))),ah=E(()=>k(()=>import("./TopUpAmount-DoWe6LbJ.js"),__vite__mapDeps([81,1,3,55,82,37,7,8,4,5,6,9,10]))),_s=E(()=>k(()=>import("./TopUpResult-efQIFAqP.js"),__vite__mapDeps([83,1,3,67,7,68,8,69,82,43,4,5,6,9,10]))),nh=E(()=>k(()=>import("./ConnectedAccounts-BqTEGz1k.js"),__vite__mapDeps([84,1,3,42,9,4,8,85,7,5,6,10]))),sh=E(()=>k(()=>import("./LinkTelegramCallback-D9vGXEmz.js"),__vite__mapDeps([86,1,84,3,42,9,4,8,85,7,5,6,10]))),rh=E(()=>k(()=>import("./MergeAccounts-ARcuEgY4.js"),__vite__mapDeps([87,1,3,42,9,4,8,85,7,5,6,10]))),ih=E(()=>k(()=>import("./AdminPanel-6H3ptBtW.js"),__vite__mapDeps([88,1,3,89,7,4,5,6,8,9,10]))),Ns=E(()=>k(()=>import("./AdminTickets-CQdWW5mq.js"),__vite__mapDeps([90,1,54,53,4,3,89,7,5,6,8,9,10]))),oh=E(()=>k(()=>import("./AdminTicketSettings-C1q0hTYp.js"),__vite__mapDeps([91,1,3,89,72,92,38,7,4,5,6,8,9,10]))),ch=E(()=>k(()=>import("./AdminSettings-CxU_N7IW.js"),__vite__mapDeps([93,1,3,94,7,95,96,97,98,63,4,5,6,8,9,10]))),lh=E(()=>k(()=>import("./AdminGraceAccess-CYOZ78-s.js"),__vite__mapDeps([99,1,3,72,95,38,7,4,5,6,8,9,10]))),dh=E(()=>k(()=>import("./AdminApps-CY-C4bAN.js"),__vite__mapDeps([100,1,3,7,4,5,6,8,9,10]))),uh=E(()=>k(()=>import("./AdminWheel-CMVBL2bC.js"),__vite__mapDeps([101,1,3,98,102,63,62,97,103,51,7,92,38,4,5,6,8,9,10]))),mh=E(()=>k(()=>import("./AdminTariffs-B4fh9sGP.js"),__vite__mapDeps([104,1,3,105,63,98,7,4,5,6,8,9,10]))),Cs=E(()=>k(()=>import("./AdminTariffCreate-Cim-JBRd.js"),__vite__mapDeps([106,1,3,105,72,92,6,38,7,4,5,8,9,10]))),ph=E(()=>k(()=>import("./AdminServers-AMbGoF_k.js"),__vite__mapDeps([107,1,3,108,6,7,4,5,8,9,10]))),hh=E(()=>k(()=>import("./AdminServerEdit-DBIBHHIo.js"),__vite__mapDeps([109,1,3,108,72,92,6,38,7,4,5,8,9,10]))),fh=E(()=>k(()=>import("./AdminDashboard-CxRnfpxJ.js"),__vite__mapDeps([110,1,3,89,38,7,4,5,6,8,9,10]))),gh=E(()=>k(()=>import("./AdminBanSystem-C6PSKSn8.js"),__vite__mapDeps([111,1,3,72,38,7,4,5,6,8,9,10]))),xh=E(()=>k(()=>import("./AdminBroadcasts-wZS-S4mp.js"),__vite__mapDeps([112,1,3,113,7,4,5,6,8,9,10]))),bh=E(()=>k(()=>import("./AdminBroadcastCreate-B9Gi_xjA.js"),__vite__mapDeps([114,1,3,113,72,7,4,5,6,8,9,10]))),yh=E(()=>k(()=>import("./AdminPromocodes-DZgTSG5l.js"),__vite__mapDeps([115,1,3,116,7,4,5,6,8,9,10]))),As=E(()=>k(()=>import("./AdminPromocodeCreate-JFc7fPCQ.js"),__vite__mapDeps([117,1,3,118,9,7,119,92,116,105,38,4,5,6,8,10]))),vh=E(()=>k(()=>import("./AdminCoupons-PuFTP5SK.js"),__vite__mapDeps([120,1,3,121,7,4,5,6,8,9,10]))),wh=E(()=>k(()=>import("./AdminCouponCreate-BT6Okqos.js"),__vite__mapDeps([122,1,3,92,121,105,7,4,5,6,8,9,10]))),kh=E(()=>k(()=>import("./AdminCouponDetail-Cttj8PRI.js"),__vite__mapDeps([123,1,3,121,124,38,7,4,5,6,8,9,10]))),jh=E(()=>k(()=>import("./CouponStatus-CY673iUN.js"),__vite__mapDeps([125,1,3,4,121,68,8,7,5,6,9,10]))),_h=E(()=>k(()=>import("./AdminPromocodeStats-B0_P520_.js"),__vite__mapDeps([126,1,3,116,72,38,7,4,5,6,8,9,10]))),Nh=E(()=>k(()=>import("./AdminPromoGroups-CAF0Tm9D.js"),__vite__mapDeps([127,1,3,116,7,4,5,6,8,9,10]))),Es=E(()=>k(()=>import("./AdminPromoGroupCreate-CYF-RrPA.js"),__vite__mapDeps([128,1,3,116,72,38,7,4,5,6,8,9,10]))),Ch=E(()=>k(()=>import("./AdminCampaigns-B8g5qPrC.js"),__vite__mapDeps([129,1,3,130,7,4,5,6,8,9,10]))),Ah=E(()=>k(()=>import("./AdminCampaignCreate-Bqw2aSt7.js"),__vite__mapDeps([131,1,3,130,46,72,92,6,7,4,5,8,9,10]))),Eh=E(()=>k(()=>import("./AdminCampaignStats-BRBLdp_d.js"),__vite__mapDeps([132,1,3,130,72,48,49,7,50,4,51,38,5,6,8,9,10]))),Th=E(()=>k(()=>import("./AdminCampaignEdit-D2evrRdE.js"),__vite__mapDeps([133,1,3,130,72,92,6,38,7,4,5,8,9,10]))),Sh=E(()=>k(()=>import("./AdminPartners-CZa5VChT.js"),__vite__mapDeps([134,1,3,46,72,7,4,5,6,8,9,10]))),Lh=E(()=>k(()=>import("./AdminPartnerSettings-rRnTrlko.js"),__vite__mapDeps([135,1,3,46,72,92,38,7,4,5,6,8,9,10]))),Ih=E(()=>k(()=>import("./AdminReferralLevels-2RVl_8hv.js"),__vite__mapDeps([136,1,3,46,72,38,7,4,5,6,8,9,10]))),Rh=E(()=>k(()=>import("./AdminPartnerDetail-Dy6ZOP_d.js"),__vite__mapDeps([137,1,3,46,72,38,7,4,5,6,8,9,10]))),Ph=E(()=>k(()=>import("./AdminApplicationReview-CMhuK7A1.js"),__vite__mapDeps([138,1,3,46,72,7,4,5,6,8,9,10]))),Mh=E(()=>k(()=>import("./AdminPartnerCommission-CdjV0V1t.js"),__vite__mapDeps([139,1,3,46,72,7,4,5,6,8,9,10]))),Dh=E(()=>k(()=>import("./AdminPartnerRevoke-B1dIejpy.js"),__vite__mapDeps([140,1,3,46,72,7,4,5,6,8,9,10]))),Vh=E(()=>k(()=>import("./AdminPartnerCampaignAssign-oFxD6MiS.js"),__vite__mapDeps([141,1,3,46,130,72,7,4,5,6,8,9,10]))),Hh=E(()=>k(()=>import("./AdminWithdrawals-D9y-VdcI.js"),__vite__mapDeps([142,1,3,47,72,143,7,4,5,6,8,9,10]))),Bh=E(()=>k(()=>import("./AdminWithdrawalDetail-BSiwY8j6.js"),__vite__mapDeps([144,1,3,47,72,38,143,7,4,5,6,8,9,10]))),Oh=E(()=>k(()=>import("./AdminWithdrawalReject-B0IikEMP.js"),__vite__mapDeps([145,1,3,47,72,7,4,5,6,8,9,10]))),Zh=E(()=>k(()=>import("./ReferralPartnerApply-DX7BNN7p.js"),__vite__mapDeps([146,1,3,46,7,4,5,6,8,9,10]))),Fh=E(()=>k(()=>import("./ReferralWithdrawalRequest-DGBBCAIh.js"),__vite__mapDeps([147,1,3,47,7,4,5,6,8,9,10]))),$h=E(()=>k(()=>import("./AdminUsers-1dfznmxJ.js"),__vite__mapDeps([148,1,3,149,7,4,5,6,8,9,10]))),Uh=E(()=>k(()=>import("./AdminPayments-FYWyAT1A.js"),__vite__mapDeps([150,1,3,118,9,7,119,4,5,6,8,10]))),Kh=E(()=>k(()=>import("./AdminPaymentMethods-D_9MW5DJ.js"),__vite__mapDeps([151,1,3,63,98,102,7,4,5,6,8,9,10]))),qh=E(()=>k(()=>import("./AdminPaymentMethodEdit-D9_Yrr51.js"),__vite__mapDeps([152,1,3,102,153,92,143,7,124,38,4,5,6,8,9,10]))),zh=E(()=>k(()=>import("./AdminPromoOffers-CINSPGUD.js"),__vite__mapDeps([154,1,3,155,7,4,5,6,8,9,10]))),Wh=E(()=>k(()=>import("./AdminPromoOfferTemplateEdit-BdCUSRPM.js"),__vite__mapDeps([156,1,3,155,108,72,92,6,38,7,4,5,8,9,10]))),Gh=E(()=>k(()=>import("./AdminPromoOfferSend-a25kRI3p.js"),__vite__mapDeps([157,1,3,155,113,149,72,158,7,38,4,5,6,8,9,10]))),Qh=E(()=>k(()=>import("./AdminRemnawave-DZeroctB.js"),__vite__mapDeps([159,1,3,160,6,67,7,4,5,8,9,10]))),Yh=E(()=>k(()=>import("./AdminRemnawaveSquadDetail-D891Iz0R.js"),__vite__mapDeps([161,1,3,160,72,6,38,7,4,5,8,9,10]))),Xh=E(()=>k(()=>import("./AdminEmailTemplates-BOhmhDJA.js"),__vite__mapDeps([162,1,3,72,63,7,4,5,6,8,9,10]))),Jh=E(()=>k(()=>import("./AdminTrafficUsage-a8xpMIZR.js"),__vite__mapDeps([163,1,3,164,118,9,7,119,4,5,6,8,10]))),e2=E(()=>k(()=>import("./AdminBulkActions-wp7yrELH.js"),__vite__mapDeps([165,1,3,164,149,105,116,130,46,7,4,5,6,8,9,10]))),t2=E(()=>k(()=>import("./AdminSalesStats-CKa5khfi.js"),__vite__mapDeps([166,1,3,103,51,7,72,49,50,4,153,80,167,118,9,119,5,6,8,10]))),a2=E(()=>k(()=>import("./AdminUpdates-Dxq6ekSR.js"),__vite__mapDeps([168,1,3,4,7,5,6,8,9,10]))),n2=E(()=>k(()=>import("./AdminUserDetail-BbFBTt5D.js"),__vite__mapDeps([169,1,3,63,149,116,72,7,155,92,89,53,4,33,38,5,6,8,9,10]))),s2=E(()=>k(()=>import("./AdminBroadcastDetail-mlZSf4YV.js"),__vite__mapDeps([170,1,3,113,72,158,7,38,4,5,6,8,9,10]))),r2=E(()=>k(()=>import("./AdminPinnedMessages-u6fjCHEF.js"),__vite__mapDeps([171,1,3,172,72,7,4,5,6,8,9,10]))),Ts=E(()=>k(()=>import("./AdminPinnedMessageCreate-B61OnBEZ.js"),__vite__mapDeps([173,1,3,172,72,95,7,4,5,6,8,9,10]))),i2=E(()=>k(()=>import("./AdminChannelSubscriptions-BQLt4V-H.js"),__vite__mapDeps([174,1,3,63,94,72,95,38,7,4,5,6,8,9,10]))),o2=E(()=>k(()=>import("./AdminRoles-DaH1UKTy.js"),__vite__mapDeps([175,1,3,176,124,7,4,5,6,8,9,10]))),Ss=E(()=>k(()=>import("./AdminRoleEdit-BBEHj3Eh.js"),__vite__mapDeps([177,1,3,176,72,38,7,4,5,6,8,9,10]))),c2=E(()=>k(()=>import("./AdminRoleAssign-D6J8a4l9.js"),__vite__mapDeps([178,1,3,176,149,124,7,4,5,6,8,9,10]))),l2=E(()=>k(()=>import("./AdminPolicies-ZjlRi8eL.js"),__vite__mapDeps([179,1,3,176,124,7,4,5,6,8,9,10]))),Ls=E(()=>k(()=>import("./AdminPolicyEdit-g1jqofRN.js"),__vite__mapDeps([180,1,3,176,72,38,7,4,5,6,8,9,10]))),d2=E(()=>k(()=>import("./AdminAuditLog-CkUt79EK.js"),__vite__mapDeps([181,1,3,176,124,118,9,7,119,4,5,6,8,10]))),u2=E(()=>k(()=>import("./AdminLandings-C48b92Pj.js"),__vite__mapDeps([182,1,3,74,63,183,98,7,4,5,6,8,9,10]))),Is=E(()=>k(()=>import("./AdminLandingEditor-M2U6kFEa.js"),__vite__mapDeps([184,1,3,74,105,102,63,95,96,7,98,183,4,5,6,8,9,10]))),m2=E(()=>k(()=>import("./AdminLandingStats-CDR2cQxK.js"),__vite__mapDeps([185,1,3,74,51,72,103,7,167,49,50,4,38,5,6,8,9,10]))),p2=E(()=>k(()=>import("./index-DCq6pg9O.js"),__vite__mapDeps([186,1,3,4,72,7,5,6,8,9,10]))),h2=E(()=>k(()=>import("./NewsArticle-4exmZcT2.js"),__vite__mapDeps([187,1,3,4,7,8,5,6,9,10]))),f2=E(()=>k(()=>import("./AdminNews-C5Rzp2w4.js"),__vite__mapDeps([188,1,3,72,95,189,7,4,5,6,8,9,10]))),Rs=E(()=>k(()=>import("./AdminNewsCreate-DOmhePhA.js"),__vite__mapDeps([190,1,3,191,7,50,4,192,72,95,5,6,8,9,10]))),g2=E(()=>k(()=>import("./InfoPageView-tCS55nYB.js"),__vite__mapDeps([193,1,3,4,60,7,5,6,8,9,10]))),x2=E(()=>k(()=>import("./AdminInfoPages-y59Ssr3l.js"),__vite__mapDeps([194,1,3,60,72,95,189,7,4,5,6,8,9,10]))),Ps=E(()=>k(()=>import("./AdminInfoPageEditor-Bo8VhLYS.js"),__vite__mapDeps([195,1,3,191,7,50,4,192,60,72,95,5,6,8,9,10]))),b2=E(()=>k(()=>import("./AdminLegalPages-DGBXWkXl.js"),__vite__mapDeps([196,1,3,72,95,7,4,5,6,8,9,10])));function ae({children:e,withLayout:a=!0}){const n=J(o=>o.isAuthenticated),s=J(o=>o.isLoading),r=He();return s?t.jsx(_a,{variant:"dark"}):n?a?t.jsx(jn,{children:e}):t.jsx(t.Fragment,{children:e}):(ga(),t.jsx($e,{to:"/login",replace:!0,state:{from:r.pathname}}))}function y2({children:e}){const a=J(o=>o.isAuthenticated),n=J(o=>o.isLoading),s=J(o=>o.isAdmin),r=He();return n?t.jsx(_a,{variant:"light"}):a?s?t.jsx(jn,{children:e}):t.jsx($e,{to:"/",replace:!0}):(ga(),t.jsx($e,{to:"/login",replace:!0,state:{from:r.pathname}}))}function C({children:e}){return t.jsx(_n,{level:"page",children:t.jsx(l.Suspense,{fallback:t.jsx(_a,{variant:"dark"}),children:e})})}function v2(){const e=me(a=>a.blockingType);return e==="maintenance"?t.jsx(r1,{}):e==="channel_subscription"?t.jsx(U1,{}):e==="blacklisted"?t.jsx(K1,{}):e==="account_deleted"?t.jsx(q1,{}):e==="backend_unavailable"?t.jsx(z1,{}):null}function w2(){const{subscriptionId:e}=Xi();return t.jsx($e,{to:`/subscriptions/${e}`,replace:!0})}function k2(){return Q1(),em(),t.jsxs(t.Fragment,{children:[t.jsx(zu,{}),t.jsx(v2,{}),t.jsxs(Yi,{children:[t.jsx(_,{path:"/login",element:t.jsx(_m,{})}),t.jsx(_,{path:"/auth/telegram/callback",element:t.jsx(Nm,{})}),t.jsx(_,{path:"/auth/telegram",element:t.jsx(ps,{})}),t.jsx(_,{path:"/tg",element:t.jsx(ps,{})}),t.jsx(_,{path:"/connect",element:t.jsx(fs,{})}),t.jsx(_,{path:"/add",element:t.jsx(fs,{})}),t.jsx(_,{path:"/auth/oauth/callback",element:t.jsx(Pm,{})}),t.jsx(_,{path:"/verify-email",element:t.jsx(Sm,{})}),t.jsx(_,{path:"/reset-password",element:t.jsx(Lm,{})}),t.jsx(_,{path:"/offer",element:t.jsx(Ua,{doc:"offer"})}),t.jsx(_,{path:"/privacy",element:t.jsx(Ua,{doc:"privacy"})}),t.jsx(_,{path:"/recurrent-payments",element:t.jsx(Ua,{doc:"recurrent"})}),t.jsx(_,{path:"/merge/:mergeToken",element:t.jsx(C,{children:t.jsx(rh,{})})}),t.jsx(_,{path:"/buy/success/:token",element:t.jsx(C,{children:t.jsx(Yp,{})})}),t.jsx(_,{path:"/buy/gift/:token",element:t.jsx(C,{children:t.jsx(Xp,{})})}),t.jsx(_,{path:"/coupon/:token",element:t.jsx(C,{children:t.jsx(jh,{})})}),t.jsx(_,{path:"/buy/:slug",element:t.jsx(C,{children:t.jsx(Qp,{})})}),t.jsx(_,{path:"/auto-login",element:t.jsx(C,{children:t.jsx(eh,{})})}),t.jsx(_,{path:"/",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Rp,{})})})}),t.jsx(_,{path:"/subscriptions",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Pp,{})})})}),t.jsx(_,{path:"/subscriptions/:subscriptionId",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Mp,{})})})}),t.jsx(_,{path:"/subscriptions/:subscriptionId/renew",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Jp,{})})})}),t.jsx(_,{path:"/subscription/:subscriptionId",element:t.jsx(w2,{})}),t.jsx(_,{path:"/subscription",element:t.jsx(ae,{children:t.jsx($e,{to:"/subscriptions",replace:!0})})}),t.jsx(_,{path:"/subscription/purchase",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Dp,{})})})}),t.jsx(_,{path:"/balance",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Vp,{})})})}),t.jsx(_,{path:"/balance/saved-cards",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Hp,{})})})}),t.jsx(_,{path:"/balance/top-up",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(th,{})})})}),t.jsx(_,{path:"/balance/top-up/result",element:t.jsx(ae,{withLayout:!1,children:t.jsx(C,{children:t.jsx(_s,{})})})}),t.jsx(_,{path:"/balance/top-up/result/:method",element:t.jsx(ae,{withLayout:!1,children:t.jsx(C,{children:t.jsx(_s,{})})})}),t.jsx(_,{path:"/balance/top-up/:methodId",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(ah,{})})})}),t.jsx(_,{path:"/referral",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Bp,{})})})}),t.jsx(_,{path:"/referral/partner/apply",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Zh,{})})})}),t.jsx(_,{path:"/referral/withdrawal/request",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Fh,{})})})}),t.jsx(_,{path:"/support",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Op,{})})})}),t.jsx(_,{path:"/profile",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Zp,{})})})}),t.jsx(_,{path:"/profile/accounts",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(nh,{})})})}),t.jsx(_,{path:"/auth/link/telegram/callback",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(sh,{})})})}),t.jsx(_,{path:"/contests",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Fp,{})})})}),t.jsx(_,{path:"/polls",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx($p,{})})})}),t.jsx(_,{path:"/info",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Up,{})})})}),t.jsx(_,{path:"/wheel",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Kp,{})})})}),t.jsx(_,{path:"/gift",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(qp,{})})})}),t.jsx(_,{path:"/gift/result",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(zp,{})})})}),t.jsx(_,{path:"/connection/qr",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Gp,{})})})}),t.jsx(_,{path:"/connection",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(Wp,{})})})}),t.jsx(_,{path:"/news/:slug",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(h2,{})})})}),t.jsx(_,{path:"/info/:slug",element:t.jsx(ae,{children:t.jsx(C,{children:t.jsx(g2,{})})})}),t.jsx(_,{path:"/admin",element:t.jsx(y2,{children:t.jsx(C,{children:t.jsx(ih,{})})})}),t.jsx(_,{path:"/admin/tickets",element:t.jsx(R,{permission:"tickets:read",children:t.jsx(C,{children:t.jsx(Ns,{})})})}),t.jsx(_,{path:"/admin/tickets/settings",element:t.jsx(R,{permission:"tickets:settings",children:t.jsx(C,{children:t.jsx(oh,{})})})}),t.jsx(_,{path:"/admin/tickets/:ticketId",element:t.jsx(R,{permission:"tickets:read",children:t.jsx(C,{children:t.jsx(Ns,{})})})}),t.jsx(_,{path:"/admin/settings",element:t.jsx(R,{permission:"settings:read",children:t.jsx(C,{children:t.jsx(ch,{})})})}),t.jsx(_,{path:"/admin/grace-access",element:t.jsx(R,{permission:"settings:read",children:t.jsx(C,{children:t.jsx(lh,{})})})}),t.jsx(_,{path:"/admin/apps",element:t.jsx(R,{permission:"apps:read",children:t.jsx(C,{children:t.jsx(dh,{})})})}),t.jsx(_,{path:"/admin/wheel",element:t.jsx(R,{permission:"wheel:read",children:t.jsx(C,{children:t.jsx(uh,{})})})}),t.jsx(_,{path:"/admin/tariffs",element:t.jsx(R,{permission:"tariffs:read",children:t.jsx(C,{children:t.jsx(mh,{})})})}),t.jsx(_,{path:"/admin/tariffs/create",element:t.jsx(R,{permission:"tariffs:read",children:t.jsx(C,{children:t.jsx(Cs,{})})})}),t.jsx(_,{path:"/admin/tariffs/:id/edit",element:t.jsx(R,{permission:"tariffs:read",children:t.jsx(C,{children:t.jsx(Cs,{})})})}),t.jsx(_,{path:"/admin/landings",element:t.jsx(R,{permission:"landings:read",children:t.jsx(C,{children:t.jsx(u2,{})})})}),t.jsx(_,{path:"/admin/landings/create",element:t.jsx(R,{permission:"landings:create",children:t.jsx(C,{children:t.jsx(Is,{})})})}),t.jsx(_,{path:"/admin/landings/:id/edit",element:t.jsx(R,{permission:"landings:edit",children:t.jsx(C,{children:t.jsx(Is,{})})})}),t.jsx(_,{path:"/admin/landings/:id/stats",element:t.jsx(R,{permission:"landings:read",children:t.jsx(C,{children:t.jsx(m2,{})})})}),t.jsx(_,{path:"/admin/servers",element:t.jsx(R,{permission:"servers:read",children:t.jsx(C,{children:t.jsx(ph,{})})})}),t.jsx(_,{path:"/admin/servers/:id/edit",element:t.jsx(R,{permission:"servers:read",children:t.jsx(C,{children:t.jsx(hh,{})})})}),t.jsx(_,{path:"/admin/dashboard",element:t.jsx(R,{permission:"stats:read",children:t.jsx(C,{children:t.jsx(fh,{})})})}),t.jsx(_,{path:"/admin/ban-system",element:t.jsx(R,{permission:"ban_system:read",children:t.jsx(C,{children:t.jsx(gh,{})})})}),t.jsx(_,{path:"/admin/broadcasts",element:t.jsx(R,{permission:"broadcasts:read",children:t.jsx(C,{children:t.jsx(xh,{})})})}),t.jsx(_,{path:"/admin/broadcasts/create",element:t.jsx(R,{permission:"broadcasts:read",children:t.jsx(C,{children:t.jsx(bh,{})})})}),t.jsx(_,{path:"/admin/promocodes",element:t.jsx(R,{permission:"promocodes:read",children:t.jsx(C,{children:t.jsx(yh,{})})})}),t.jsx(_,{path:"/admin/promocodes/create",element:t.jsx(R,{permission:"promocodes:read",children:t.jsx(C,{children:t.jsx(As,{})})})}),t.jsx(_,{path:"/admin/promocodes/:id/edit",element:t.jsx(R,{permission:"promocodes:read",children:t.jsx(C,{children:t.jsx(As,{})})})}),t.jsx(_,{path:"/admin/coupons",element:t.jsx(R,{permission:"coupons:read",children:t.jsx(C,{children:t.jsx(vh,{})})})}),t.jsx(_,{path:"/admin/coupons/create",element:t.jsx(R,{permission:"coupons:create",children:t.jsx(C,{children:t.jsx(wh,{})})})}),t.jsx(_,{path:"/admin/coupons/:id",element:t.jsx(R,{permission:"coupons:read",children:t.jsx(C,{children:t.jsx(kh,{})})})}),t.jsx(_,{path:"/admin/promocodes/:id/stats",element:t.jsx(R,{permission:"promocodes:read",children:t.jsx(C,{children:t.jsx(_h,{})})})}),t.jsx(_,{path:"/admin/promo-groups",element:t.jsx(R,{permission:"promo_groups:read",children:t.jsx(C,{children:t.jsx(Nh,{})})})}),t.jsx(_,{path:"/admin/promo-groups/create",element:t.jsx(R,{permission:"promo_groups:read",children:t.jsx(C,{children:t.jsx(Es,{})})})}),t.jsx(_,{path:"/admin/promo-groups/:id/edit",element:t.jsx(R,{permission:"promo_groups:read",children:t.jsx(C,{children:t.jsx(Es,{})})})}),t.jsx(_,{path:"/admin/campaigns",element:t.jsx(R,{permission:"campaigns:read",children:t.jsx(C,{children:t.jsx(Ch,{})})})}),t.jsx(_,{path:"/admin/campaigns/create",element:t.jsx(R,{permission:"campaigns:read",children:t.jsx(C,{children:t.jsx(Ah,{})})})}),t.jsx(_,{path:"/admin/campaigns/:id/stats",element:t.jsx(R,{permission:"campaigns:read",children:t.jsx(C,{children:t.jsx(Eh,{})})})}),t.jsx(_,{path:"/admin/campaigns/:id/edit",element:t.jsx(R,{permission:"campaigns:read",children:t.jsx(C,{children:t.jsx(Th,{})})})}),t.jsx(_,{path:"/admin/partners",element:t.jsx(R,{permission:"partners:read",children:t.jsx(C,{children:t.jsx(Sh,{})})})}),t.jsx(_,{path:"/admin/partners/settings",element:t.jsx(R,{permission:"partners:read",children:t.jsx(C,{children:t.jsx(Lh,{})})})}),t.jsx(_,{path:"/admin/partners/referral-levels",element:t.jsx(R,{permission:"partners:settings",children:t.jsx(C,{children:t.jsx(Ih,{})})})}),t.jsx(_,{path:"/admin/partners/applications/:id/review",element:t.jsx(R,{permission:"partners:read",children:t.jsx(C,{children:t.jsx(Ph,{})})})}),t.jsx(_,{path:"/admin/partners/:userId/commission",element:t.jsx(R,{permission:"partners:read",children:t.jsx(C,{children:t.jsx(Mh,{})})})}),t.jsx(_,{path:"/admin/partners/:userId/revoke",element:t.jsx(R,{permission:"partners:read",children:t.jsx(C,{children:t.jsx(Dh,{})})})}),t.jsx(_,{path:"/admin/partners/:userId/campaigns/assign",element:t.jsx(R,{permission:"partners:read",children:t.jsx(C,{children:t.jsx(Vh,{})})})}),t.jsx(_,{path:"/admin/partners/:userId",element:t.jsx(R,{permission:"partners:read",children:t.jsx(C,{children:t.jsx(Rh,{})})})}),t.jsx(_,{path:"/admin/withdrawals",element:t.jsx(R,{permission:"withdrawals:read",children:t.jsx(C,{children:t.jsx(Hh,{})})})}),t.jsx(_,{path:"/admin/withdrawals/:id/reject",element:t.jsx(R,{permission:"withdrawals:read",children:t.jsx(C,{children:t.jsx(Oh,{})})})}),t.jsx(_,{path:"/admin/withdrawals/:id",element:t.jsx(R,{permission:"withdrawals:read",children:t.jsx(C,{children:t.jsx(Bh,{})})})}),t.jsx(_,{path:"/admin/users",element:t.jsx(R,{permission:"users:read",children:t.jsx(C,{children:t.jsx($h,{})})})}),t.jsx(_,{path:"/admin/bulk-actions",element:t.jsx(R,{permission:"bulk_actions:read",children:t.jsx(C,{children:t.jsx(e2,{})})})}),t.jsx(_,{path:"/admin/payments",element:t.jsx(R,{permission:"payments:read",children:t.jsx(C,{children:t.jsx(Uh,{})})})}),t.jsx(_,{path:"/admin/traffic-usage",element:t.jsx(R,{permission:"traffic:read",children:t.jsx(C,{children:t.jsx(Jh,{})})})}),t.jsx(_,{path:"/admin/sales-stats",element:t.jsx(R,{permission:"sales_stats:read",children:t.jsx(C,{children:t.jsx(t2,{})})})}),t.jsx(_,{path:"/admin/referral-network",element:t.jsx(R,{permission:"stats:read",children:t.jsx(C,{children:t.jsx(p2,{})})})}),t.jsx(_,{path:"/admin/payment-methods",element:t.jsx(R,{permission:"payment_methods:read",children:t.jsx(C,{children:t.jsx(Kh,{})})})}),t.jsx(_,{path:"/admin/payment-methods/:methodId/edit",element:t.jsx(R,{permission:"payment_methods:read",children:t.jsx(C,{children:t.jsx(qh,{})})})}),t.jsx(_,{path:"/admin/promo-offers",element:t.jsx(R,{permission:"promo_offers:read",children:t.jsx(C,{children:t.jsx(zh,{})})})}),t.jsx(_,{path:"/admin/promo-offers/templates/:id/edit",element:t.jsx(R,{permission:"promo_offers:read",children:t.jsx(C,{children:t.jsx(Wh,{})})})}),t.jsx(_,{path:"/admin/promo-offers/send",element:t.jsx(R,{permission:"promo_offers:read",children:t.jsx(C,{children:t.jsx(Gh,{})})})}),t.jsx(_,{path:"/admin/remnawave",element:t.jsx(R,{permission:"remnawave:read",children:t.jsx(C,{children:t.jsx(Qh,{})})})}),t.jsx(_,{path:"/admin/remnawave/squads/:uuid",element:t.jsx(R,{permission:"remnawave:read",children:t.jsx(C,{children:t.jsx(Yh,{})})})}),t.jsx(_,{path:"/admin/email-templates",element:t.jsx(R,{permission:"email_templates:read",children:t.jsx(C,{children:t.jsx(Xh,{})})})}),t.jsx(_,{path:"/admin/updates",element:t.jsx(R,{permission:"updates:read",children:t.jsx(C,{children:t.jsx(a2,{})})})}),t.jsx(_,{path:"/admin/users/:id",element:t.jsx(R,{permission:"users:read",children:t.jsx(C,{children:t.jsx(n2,{})})})}),t.jsx(_,{path:"/admin/broadcasts/:id",element:t.jsx(R,{permission:"broadcasts:read",children:t.jsx(C,{children:t.jsx(s2,{})})})}),t.jsx(_,{path:"/admin/pinned-messages",element:t.jsx(R,{permission:"pinned_messages:read",children:t.jsx(C,{children:t.jsx(r2,{})})})}),t.jsx(_,{path:"/admin/pinned-messages/create",element:t.jsx(R,{permission:"pinned_messages:read",children:t.jsx(C,{children:t.jsx(Ts,{})})})}),t.jsx(_,{path:"/admin/pinned-messages/:id/edit",element:t.jsx(R,{permission:"pinned_messages:read",children:t.jsx(C,{children:t.jsx(Ts,{})})})}),t.jsx(_,{path:"/admin/channel-subscriptions",element:t.jsx(R,{permission:"channels:read",children:t.jsx(C,{children:t.jsx(i2,{})})})}),t.jsx(_,{path:"/admin/roles",element:t.jsx(R,{permission:"roles:read",children:t.jsx(C,{children:t.jsx(o2,{})})})}),t.jsx(_,{path:"/admin/roles/create",element:t.jsx(R,{permission:"roles:create",children:t.jsx(C,{children:t.jsx(Ss,{})})})}),t.jsx(_,{path:"/admin/roles/:id/edit",element:t.jsx(R,{permission:"roles:edit",children:t.jsx(C,{children:t.jsx(Ss,{})})})}),t.jsx(_,{path:"/admin/roles/assign",element:t.jsx(R,{permission:"roles:assign",children:t.jsx(C,{children:t.jsx(c2,{})})})}),t.jsx(_,{path:"/admin/policies",element:t.jsx(R,{permission:"roles:read",children:t.jsx(C,{children:t.jsx(l2,{})})})}),t.jsx(_,{path:"/admin/policies/create",element:t.jsx(R,{permission:"roles:create",children:t.jsx(C,{children:t.jsx(Ls,{})})})}),t.jsx(_,{path:"/admin/policies/:id/edit",element:t.jsx(R,{permission:"roles:edit",children:t.jsx(C,{children:t.jsx(Ls,{})})})}),t.jsx(_,{path:"/admin/news",element:t.jsx(R,{permission:"news:read",children:t.jsx(C,{children:t.jsx(f2,{})})})}),t.jsx(_,{path:"/admin/news/create",element:t.jsx(R,{permission:"news:create",children:t.jsx(C,{children:t.jsx(Rs,{})})})}),t.jsx(_,{path:"/admin/news/:id/edit",element:t.jsx(R,{permission:"news:edit",children:t.jsx(C,{children:t.jsx(Rs,{})})})}),t.jsx(_,{path:"/admin/info-pages",element:t.jsx(R,{permission:"info_pages:read",children:t.jsx(C,{children:t.jsx(x2,{})})})}),t.jsx(_,{path:"/admin/info-pages/create",element:t.jsx(R,{permission:"info_pages:edit",children:t.jsx(C,{children:t.jsx(Ps,{})})})}),t.jsx(_,{path:"/admin/info-pages/:id/edit",element:t.jsx(R,{permission:"info_pages:edit",children:t.jsx(C,{children:t.jsx(Ps,{})})})}),t.jsx(_,{path:"/admin/legal-pages",element:t.jsx(R,{permission:"info_pages:read",children:t.jsx(C,{children:t.jsx(b2,{})})})}),t.jsx(_,{path:"/admin/audit-log",element:t.jsx(R,{permission:"audit_log:read",children:t.jsx(C,{children:t.jsx(d2,{})})})}),t.jsx(_,{path:"*",element:t.jsx($e,{to:"/",replace:!0})})]})]})}function j2({children:e}){const{data:a}=W({queryKey:["theme-colors"],queryFn:Ft.getColors,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}),{theme:n,capabilities:s}=Te(),{isDark:r}=Ke();l.useEffect(()=>{Zi(a||ft)},[a]);const o=l.useCallback(()=>{if(!s.hasThemeSync)return;const d=a||ft,p=r?d.darkSurface:d.lightSurface;n.setHeaderColor(p),n.setBottomBarColor(p)},[s.hasThemeSync,a,r,n]);return l.useEffect(()=>{o()},[o]),t.jsx(t.Fragment,{children:e})}const Ge=!1;function _2(e){const a="/api".trim(),n=window.location.protocol==="https:"?"wss:":"ws:",s=d=>`${d}?token=${encodeURIComponent(e)}`;if(a.startsWith("http://")||a.startsWith("https://"))try{const d=new URL(a),p=d.protocol==="https:"?"wss:":"ws:",i=d.pathname.replace(/\/+$/,""),c=i.endsWith("/cabinet")?`${i}/ws`:`${i}/cabinet/ws`;return s(`${p}//${d.host}${c}`)}catch{}const r=`/${a}`.replace(/\/{2,}/g,"/").replace(/\/+$/,""),o=r.endsWith("/cabinet")?`${r}/ws`:`${r}/cabinet/ws`;return s(`${n}//${window.location.host}${o}`)}function N2({children:e}){const a=J(g=>g.accessToken),n=J(g=>g.isAuthenticated),s=l.useRef(null),r=l.useRef(null),o=l.useRef(null),[d,p]=l.useState(!1),i=l.useRef(0),c=Ra.MAX_RECONNECT_ATTEMPTS,u=l.useRef(new Set),m=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),o.current&&(clearInterval(o.current),o.current=null),s.current&&(s.current.close(),s.current=null)},[]),h=l.useCallback(()=>{if(!a||!n||s.current?.readyState===WebSocket.OPEN)return;m();const g=_2(a);try{const y=new WebSocket(g);s.current=y,y.onopen=()=>{p(!0),i.current=0,o.current=setInterval(()=>{y.readyState===WebSocket.OPEN&&y.send(JSON.stringify({type:"ping"}))},Ra.PING_INTERVAL_MS)},y.onmessage=w=>{try{const A=JSON.parse(w.data);if(!A||typeof A!="object"||typeof A.type!="string")return;const T=A;if(T.type==="pong"||T.type==="connected")return;u.current.forEach(N=>{try{N(T)}catch{}})}catch{}},y.onclose=w=>{if(p(!1),o.current&&(clearInterval(o.current),o.current=null),w.code!==1008&&w.code!==1e3&&i.current{i.current++,h()},A)}},y.onerror=w=>{}}catch{}},[a,n,m,c]);l.useEffect(()=>(n&&a?h():(m(),p(!1)),m),[n,a,h,m]);const f=l.useCallback(g=>(u.current.add(g),()=>{u.current.delete(g)}),[]);return t.jsx(ii.Provider,{value:{isConnected:d,subscribe:f},children:e})}function C2(e){const n=e.replace(/\/+$/,"").split("/").filter(Boolean).slice(0,-1);return n.length?"/"+n.join("/"):"/"}const A2={className:"twemoji",folder:"svg",ext:".svg"},E2=["/","/subscriptions","/balance","/referral","/support","/wheel"],Ms=/^\/subscriptions\/\d+\/?$/;function T2(){const e=He(),a=ye(),n=eo(),s=l.useRef(a);s.current=a;const r=l.useRef(e.pathname);r.current=e.pathname;const o=me(w=>w.blockingType),d=l.useRef(o);d.current=o;const p=l.useRef(0),i=l.useRef(null);l.useEffect(()=>{i.current!==e.key&&(i.current=e.key,n==="PUSH"?p.current+=1:n==="POP"&&(p.current=Math.max(0,p.current-1)))},[e.key,n]);const{data:c}=W({queryKey:["subscriptions-list"],queryFn:()=>Ie.getSubscriptions(),staleTime:3e4,enabled:Ee()}),u=c?.multi_tariff_enabled??!1,m=c?.subscriptions?.length??0,h=!u&&m<=1,f=l.useRef(u);f.current=u;const g=l.useRef(m);g.current=m,l.useEffect(()=>{if(o){try{za()}catch{}return}const w=e.pathname===""||E2.includes(e.pathname),A=h&&Ms.test(e.pathname);try{w||A?zs():za()}catch{}},[e,h,o]);const y=l.useCallback(()=>{if(d.current){Ec();return}if(p.current>0){s.current(-1);return}const w=r.current,A=f.current||g.current>1,T=Ms.test(w)&&!A?"/":C2(r.current);s.current(T,{replace:!0})},[]);return l.useEffect(()=>{try{Ws(y)}catch{}return()=>{try{Wa(y)}catch{}}},[y]),null}const S2=[{re:/^admin_ticket_(\d+)$/,to:e=>`/admin/tickets/${e[1]}`},{re:/^renew_(\d+)$/,to:e=>`/subscriptions/${e[1]}/renew`},{re:/^subscriptions$/,to:()=>"/subscriptions"},{re:/^trial$/,to:()=>"/"}];function L2(){const e=ye(),a=l.useRef(!1);return l.useEffect(()=>{if(a.current)return;a.current=!0;let n;try{n=Dt().tgWebAppStartParam}catch{return}if(n)for(const{re:s,to:r}of S2){const o=s.exec(n);if(o){e(r(o),{replace:!0});return}}},[e]),null}function I2(){const e=Ee();return t.jsxs(Ji,{children:[e&&t.jsx(T2,{}),e&&t.jsx(L2,{}),t.jsx(_n,{level:"page",children:t.jsx(Ll,{children:t.jsx(j2,{children:t.jsx(jc,{children:t.jsx(au,{children:t.jsx(N2,{children:t.jsx(Uo,{options:A2,children:t.jsx(k2,{})})})})})})})})]})}Wc();typeof Object.hasOwn!="function"&&(Object.hasOwn=(e,a)=>Object.prototype.hasOwnProperty.call(e,a));const Ds=!!window.TelegramWebviewProxy||location.hash.includes("tgWebApp")||location.search.includes("tgWebApp"),Fi="__tg_sdk_initialized",R2=window[Fi]===!0;if(Ds&&!R2){window[Fi]=!0;try{Po(),Mo(),zn(mn()),Hm();try{Do()}catch{}try{Vo()}catch{}try{Ho(),Os()}catch{}try{Bo(),qs()}catch{}try{Oo()}catch{}Zo().then(()=>{Fo(),Bs(),Cc()&&Tc()&&(Fs()||Hs())}).catch(()=>{}),$o()}catch{}}else Ds||zn(null);J.getState().initialize();Hc();"requestIdleCallback"in window?requestIdleCallback(()=>rs()):setTimeout(rs,100);const P2=new no({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});to.createRoot(document.getElementById("root")).render(t.jsx(se.StrictMode,{children:t.jsx(_n,{level:"app",children:t.jsx(so,{client:P2,children:t.jsx(I2,{})})})}));export{a8 as $,fp as A,G8 as B,Xd as C,Rt as D,Pi as E,Fr as F,pt as G,up as H,uf as I,$r as J,$d as K,Ht as L,lg as M,dg as N,nt as O,Ya as P,bn as Q,qr as R,ka as S,xp as T,tu as U,at as V,ca as W,I8 as X,ws as Y,Hr as Z,ni as _,J as a,tg as a$,Nf as a0,vn as a1,E8 as a2,Zt as a3,Ud as a4,Od as a5,h8 as a6,e8 as a7,la as a8,mf as a9,ba as aA,Im as aB,si as aC,zf as aD,x as aE,gf as aF,Md as aG,vp as aH,_u as aI,Hd as aJ,pf as aK,hf as aL,ff as aM,Gu as aN,Xu as aO,Ju as aP,vs as aQ,fg as aR,If as aS,Ri as aT,Lf as aU,lf as aV,Vt as aW,Tm as aX,p8 as aY,uu as aZ,$t as a_,Vd as aa,be as ab,Nt as ac,yn as ad,Gf as ae,u8 as af,Ot as ag,Lt as ah,b as ai,pe as aj,kt as ak,di as al,R8 as am,M8 as an,Z1 as ao,ls as ap,mu as aq,Yd as ar,zr as as,C8 as at,pu as au,qe as av,i8 as aw,Mf as ax,eu as ay,Qd as az,_e as b,Zu as b$,is as b0,ru as b1,iu as b2,ee as b3,cg as b4,Ku as b5,rt as b6,ug as b7,je as b8,Qe as b9,O8 as bA,Ef as bB,Af as bC,Yr as bD,n8 as bE,Xf as bF,Zd as bG,k8 as bH,_8 as bI,b8 as bJ,ns as bK,Sf as bL,Kd as bM,P8 as bN,og as bO,tn as bP,Ac as bQ,D8 as bR,ft as bS,Ft as bT,Zi as bU,Q8 as bV,Qr as bW,Gr as bX,rr as bY,Il as bZ,Uf as b_,kn as ba,wa as bb,k as bc,Cm as bd,as as be,Pf as bf,K2 as bg,sr as bh,Fa as bi,hg as bj,hm as bk,Da as bl,v8 as bm,f8 as bn,y8 as bo,x8 as bp,g8 as bq,Kr as br,Fe as bs,pp as bt,Ff as bu,B8 as bv,Wf as bw,H8 as bx,Yf as by,F8 as bz,Ap as c,W2 as c$,ig as c0,Ur as c1,Dd as c2,Zf as c3,ag as c4,Jd as c5,$8 as c6,cf as c7,L8 as c8,Kf as c9,Bf as cA,qd as cB,q8 as cC,kf as cD,jf as cE,wf as cF,vf as cG,_f as cH,xf as cI,W8 as cJ,z8 as cK,U8 as cL,fd as cM,of as cN,$f as cO,m8 as cP,oe as cQ,o8 as cR,Gt as cS,Cf as cT,zd as cU,A8 as cV,Tf as cW,Jr as cX,qm as cY,rg as cZ,X2 as c_,Rf as ca,d8 as cb,Qf as cc,T8 as cd,bf as ce,wu as cf,r8 as cg,df as ch,c8 as ci,qf as cj,w8 as ck,t8 as cl,S8 as cm,Nu as cn,Xa as co,Z8 as cp,yf as cq,j8 as cr,fn as cs,Jf as ct,l8 as cu,Df as cv,Vf as cw,Hf as cx,K8 as cy,Of as cz,Bm as d,q2 as d0,z2 as d1,Y2 as d2,G2 as d3,Q2 as d4,nf as d5,af as d6,tf as d7,rf as d8,J2 as d9,ef as da,sf as db,N8 as dc,s8 as dd,Y8 as de,eg as df,J8 as dg,X8 as dh,ng as di,ya as e,Bt as f,vt as g,gg as h,xg as i,Te as j,Rl as k,Wd as l,Kt as m,yt as n,wn as o,Sn as p,sg as q,fe as r,Ie as s,Et as t,Ke as u,lp as v,Pe as w,Gd as x,V8 as y,Ut as z};