PageSourceSearch

https://dreamdares.com/assets/index-zrxxX9HU.js

js dreamdares.com collected 2026-10-04 07:49:29 UTC 783,865 bytes, 1,092 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Stream-C1h4Mhsg.js","assets/react-C6gyPH_o.js","assets/utility-BvT2Ru6D.js","assets/ui-CGJYnFCc.js","assets/icons-Bp_Q0nCr.js","assets/animation-CYIQ_KhU.js","assets/cat-DUFGbbAu.js","assets/Stream-BjpQanpC.css","assets/Browse-DRYkUbFO.js","assets/Browse-AhTqXuVU.css","assets/PublicChat-DaE8zzYc.js","assets/PublicChat-CHbwySLl.css","assets/Argus-BxQIWQME.js","assets/Argus-Cw8PPIxE.css"])))=>i.map(i=>d[i]);
2var Sd=e=>{throw TypeError(e)};var Go=(e,t,r)=>t.has(e)||Sd("Cannot "+r);var D=(e,t,r)=>(Go(e,t,"read from private field"),r?r.call(e):t.get(e)),me=(e,t,r)=>t.has(e)?Sd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ie=(e,t,r,i)=>(Go(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),Ae=(e,t,r)=>(Go(e,t,"access private method"),r);var Ys=(e,t,r,i)=>({set _(s){ie(e,t,s,r)},get _(){return D(e,t,i)}});import{e as Ug,g as $s,r as _,R as Ni,u as gt,f as qr,h as bn,L as xe,N as Bg,O as qg,i as Bn,j as jg,F as Hg,k as Wg,l as fr,m as or,n as Yg,o as Qg}from"./react-C6gyPH_o.js";import{j as n,n as Ee,o as tn,p as Ge,a as u,M as Oe,q as j,s as v,t as Ie,G as $,B as G,v as pe,D as je,w as Ye,x as Le,y as Lt,k as V,F as ke,z as bt,N as pt,E as Vg,H as vt,P as ni,h as Te,A as Ne,L as Xe,U as Mt,I as pn,J as Kg,K as Gg,O as dp,c as Xg,f as Qe,u as Ve,Q as Jg,R as up,m as _n,V as Zg,W as kl,r as we,X as ey,Y as ty,Z as Zr,_ as vc,$ as hp,a0 as pp,a1 as qt,a2 as wc,a3 as re,a4 as Ze,a5 as _a,d as _t,a6 as Ha,a7 as Wa,a8 as Xo,a9 as ce,i as Se,aa as cs,ab as ue,T as wt,ac as it,ad as g,ae as mp,af as Be,ag as ct,ah as ds,ai as mt,aj as us,S as mn,ak as Sc,al as ri,am as ny,an as $r,ao as jr,ap as Cc,l as ry,aq as gr,ar as fp,as as rn,at as dn,au as iy,av as sy,aw as yt,ax as gp,ay as Li,az as yp,aA as ay,aB as sr,aC as oy,aD as Rr,aE as va,g as Oi,aF as bp,aG as Rs,aH as Ya,aI as ly,aJ as Qa,aK as Cd,aL as cy,aM as dy,aN as uy,aO as zs,aP as hy,aQ as ii,aR as py,aS as Qs,aT as es,aU as Td,aV as Vs,aW as Kt,aX as Va,aY as El,aZ as my,a_ as fy,a$ as gy}from"./ui-CGJYnFCc.js";import{i as vr,a as yy,B as by,t as x,u as Fe,T as _p,N as nn,w as hs,m as Rt,M as Ka,b as Ei,c as Pi,P as Ga,d as Tc,e as si,f as Pl,S as ps,g as _y,E as Xa,k as vy,F as xd,h as vp,j as xc,D as wy,l as Sy,n as Cy,o as Ty,p as xy,q as ky,r as Ey,s as Py,R as qe,v as My,L as Ay}from"./utility-BvT2Ru6D.js";import{I as zt,a as wa,b as kc,c as wp,d as Mi,e as Ml,f as Sp,g as kd,h as ms,i as Sa,j as Dy,k as Iy,l as Ec,m as Cp,n as Ja,o as ht,p as Ot,q as fn,r as Jo,s as Tp,t as xp,u as Xt,v as kp,w as Ep,x as Pp,y as Za,z as ai,A as Mp,B as Ap,C as Dp,D as Al,E as Dl,F as $y,G as Ry,H as Ed,J as zy,K as Ip,L as Il,M as Pd,N as Ny,O as Ly,P as eo,Q as to,R as Ke,S as $p,T as fs,U as Ca,V as sa,W as Oy,X as Ta,Y as xa,Z as Fy,_ as aa,$ as Zo,a0 as Uy,a1 as Rp,a2 as By,a3 as qy,a4 as jy,a5 as Hy,a6 as Wy,a7 as Ks,a8 as el,a9 as zp,aa as no,ab as Ns,ac as Pc,ad as Yy,ae as Np,af as ro,ag as io,ah as Qy,ai as Lp,aj as $l,ak as Vy,al as Ky,am as Gy,an as Op,ao as Xy,ap as Jy,aq as Zy,ar as eb,as as so,at as tb,au as nb,av as rb,aw as ib,ax as sb,ay as Fp,az as ab,aA as Up,aB as tl,aC as Bp,aD as Fi,aE as zr,aF as ob,aG as gs,aH as nl,aI as lb,aJ as cb,aK as db,aL as Ai,aM as gn,aN as Md,aO as ub,aP as Ad,aQ as ao,aR as oo,aS as lo,aT as qp,aU as jp,aV as hb,aW as pb,aX as Dd,aY as mb,aZ as fb,a_ as gb,a$ as Hp,b0 as yb,b1 as bb,b2 as Wp,b3 as _b,b4 as Yp,b5 as Mc,b6 as Rl,b7 as vb,b8 as ka,b9 as Qp,ba as Vp,bb as rl,bc as wb,bd as Sb,be as Id,bf as Cb,bg as Kp,bh as Tb,bi as xb,bj as Ac,bk as kb,bl as Eb,bm as Pb,bn as Mb,bo as $d,bp as Ab,bq as Db,br as Ib}from"./icons-Bp_Q0nCr.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}
vendor: 17,238 bytes, line 2
2function i(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();var Gs={},Rd;function $b(){if(Rd)return Gs;Rd=1;var e=Ug();return Gs.createRoot=e.createRoot,Gs.hydrateRoot=e.hydrateRoot,Gs}var Rb=$b();const zb=$s(Rb);var Ui=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Nr=typeof window>"u"||"Deno"in globalThis;function Bt(){}function Nb(e,t){return typeof e=="function"?e(t):e}function zl(e){return typeof e=="number"&&e>=0&&e!==1/0}function Gp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function oi(e,t){return typeof e=="function"?e(t):e}function Vt(e,t){return typeof e=="function"?e(t):e}function zd(e,t){const{type:r="all",exact:i,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(i){if(t.queryHash!==Dc(o,t.options))return!1}else if(!ys(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function Nd(e,t){const{exact:r,status:i,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Lr(t.options.mutationKey)!==Lr(a))return!1}else if(!ys(t.options.mutationKey,a))return!1}return!(i&&t.state.status!==i||s&&!s(t))}function Dc(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lr)(e)}function Lr(e){return JSON.stringify(e,(t,r)=>Nl(r)?Object.keys(r).sort().reduce((i,s)=>(i[s]=r[s],i),{}):r)}function ys(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ys(e[r],t[r])):!1}function Xp(e,t){if(e===t)return e;const r=Ld(e)&&Ld(t);if(r||Nl(e)&&Nl(t)){const i=r?e:Object.keys(e),s=i.length,a=r?t:Object.keys(t),o=a.length,l=r?[]:{};let c=0;for(let d=0;d<o;d++){const p=r?d:a[d];(!r&&i.includes(p)||r)&&e[p]===void 0&&t[p]===void 0?(l[p]=void 0,c++):(l[p]=Xp(e[p],t[p]),l[p]===e[p]&&e[p]!==void 0&&c++)}return s===o&&c===s?e:l}return t}function Ea(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Ld(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Nl(e){if(!Od(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Od(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Od(e){return Object.prototype.toString.call(e)==="[object Object]"}function Lb(e){return new Promise(t=>{setTimeout(t,e)})}function Ll(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Xp(e,t):t}function Fd(e){return e}function Ob(e,t,r=0){const i=[...e,t];return r&&i.length>r?i.slice(1):i}function Fb(e,t,r=0){const i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var Ic=Symbol();function Jp(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ic?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var wr,Kn,mi,ep,Ub=(ep=class extends Ui{constructor(){super();me(this,wr);me(this,Kn);me(this,mi);ie(this,mi,t=>{if(!Nr&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){D(this,Kn)||this.setEventListener(D(this,mi))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,Kn))==null||t.call(this),ie(this,Kn,void 0))}setEventListener(t){var r;ie(this,mi,t),(r=D(this,Kn))==null||r.call(this),ie(this,Kn,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){D(this,wr)!==t&&(ie(this,wr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof D(this,wr)=="boolean"?D(this,wr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},wr=new WeakMap,Kn=new WeakMap,mi=new WeakMap,ep),$c=new Ub,fi,Gn,gi,tp,Bb=(tp=class extends Ui{constructor(){super();me(this,fi,!0);me(this,Gn);me(this,gi);ie(this,gi,t=>{if(!Nr&&window.addEventListener){const r=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}}})}onSubscribe(){D(this,Gn)||this.setEventListener(D(this,gi))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,Gn))==null||t.call(this),ie(this,Gn,void 0))}setEventListener(t){var r;ie(this,gi,t),(r=D(this,Gn))==null||r.call(this),ie(this,Gn,t(this.setOnline.bind(this)))}setOnline(t){D(this,fi)!==t&&(ie(this,fi,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return D(this,fi)}},fi=new WeakMap,Gn=new WeakMap,gi=new WeakMap,tp),Pa=new Bb;function Ol(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function i(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},r.reject=s=>{i({status:"rejected",reason:s}),t(s)},r}function qb(e){return Math.min(1e3*2**e,3e4)}function Zp(e){return(e??"online")==="online"?Pa.isOnline():!0}var em=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function il(e){return e instanceof em}function tm(e){let t=!1,r=0,i=!1,s;const a=Ol(),o=b=>{var S;i||(f(new em(b)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>$c.isFocused()&&(e.networkMode==="always"||Pa.isOnline())&&e.canRun(),p=()=>Zp(e.networkMode)&&e.canRun(),h=b=>{var S;i||(i=!0,(S=e.onSuccess)==null||S.call(e,b),s==null||s(),a.resolve(b))},f=b=>{var S;i||(i=!0,(S=e.onError)==null||S.call(e,b),s==null||s(),a.reject(b))},m=()=>new Promise(b=>{var S;s=k=>{(i||d())&&b(k)},(S=e.onPause)==null||S.call(e)}).then(()=>{var b;s=void 0,i||(b=e.onContinue)==null||b.call(e)}),y=()=>{if(i)return;let b;const S=r===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(k){b=Promise.reject(k)}Promise.resolve(b).then(h).catch(k=>{var E;if(i)return;const w=e.retry??(Nr?0:3),T=e.retryDelay??qb,A=typeof T=="function"?T(r,k):T,R=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,k);if(t||!R){f(k);return}r++,(E=e.onFail)==null||E.call(e,r,k),Lb(A).then(()=>d()?void 0:m()).then(()=>{t?f(k):y()})})};return{promise:a,cancel:o,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:p,start:()=>(p()?y():m().then(y),a)}}var jb=e=>setTimeout(e,0);function Hb(){let e=[],t=0,r=l=>{l()},i=l=>{l()},s=jb;const a=l=>{t?e.push(l):s(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{i(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{i=l},setScheduler:l=>{s=l}}}var ut=Hb(),Sr,np,nm=(np=class{constructor(){me(this,Sr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zl(this.gcTime)&&ie(this,Sr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nr?1/0:5*60*1e3))}clearGcTimeout(){D(this,Sr)&&(clearTimeout(D(this,Sr)),ie(this,Sr,void 0))}},Sr=new WeakMap,np),yi,bi,Ut,Cr,St,Ms,Tr,Yt,Pn,rp,Wb=(rp=class extends nm{constructor(t){super();me(this,Yt);me(this,yi);me(this,bi);me(this,Ut);me(this,Cr);me(this,St);me(this,Ms);me(this,Tr);ie(this,Tr,!1),ie(this,Ms,t.defaultOptions),this.setOptions(t.options),this.observers=[],ie(this,Cr,t.client),ie(this,Ut,D(this,Cr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ie(this,yi,Yb(this.options)),this.state=t.state??D(this,yi),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=D(this,St))==null?void 0:t.promise}setOptions(t){this.options={...D(this,Ms),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,Ut).remove(this)}setData(t,r){const i=Ll(this.state.data,t,this.options);return Ae(this,Yt,Pn).call(this,{data:i,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),i}setState(t,r){Ae(this,Yt,Pn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var i,s;const r=(i=D(this,St))==null?void 0:i.promise;return(s=D(this,St))==null||s.cancel(t),r?r.then(Bt).catch(Bt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(D(this,yi))}isActive(){return this.observers.some(t=>Vt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ic||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Gp(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=D(this,St))==null||r.continue()}onOnline(){var r;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=D(this,St))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,Ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(D(this,St)&&(D(this,Tr)?D(this,St).cancel({revert:!0}):D(this,St).cancelRetry()),this.scheduleGc()),D(this,Ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ae(this,Yt,Pn).call(this,{type:"invalidate"})}fetch(t,r){var c,d,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(D(this,St))return D(this,St).continueRetry(),D(this,St).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(ie(this,Tr,!0),i.signal)})},a=()=>{const h=Jp(this.options,r),f={client:D(this,Cr),queryKey:this.queryKey,meta:this.meta};return s(f),ie(this,Tr,!1),this.options.persister?this.options.persister(h,f,this):h(f)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:D(this,Cr),state:this.state,fetchFn:a};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),ie(this,bi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ae(this,Yt,Pn).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=h=>{var f,m,y,b;il(h)&&h.silent||Ae(this,Yt,Pn).call(this,{type:"error",error:h}),il(h)||((m=(f=D(this,Ut).config).onError)==null||m.call(f,h,this),(b=(y=D(this,Ut).config).onSettled)==null||b.call(y,this.state.data,h,this)),this.scheduleGc()};return ie(this,St,tm({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:i.abort.bind(i),onSuccess:h=>{var f,m,y,b;if(h===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(S){l(S);return}(m=(f=D(this,Ut).config).onSuccess)==null||m.call(f,h,this),(b=(y=D(this,Ut).config).onSettled)==null||b.call(y,h,this.state.error,this),this.scheduleGc()},onError:l,onFail:(h,f)=>{Ae(this,Yt,Pn).call(this,{type:"failed",failureCount:h,error:f})},onPause:()=>{Ae(this,Yt,Pn).call(this,{type:"pause"})},onContinue:()=>{Ae(this,Yt,Pn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),D(this,St).start()}},yi=new WeakMap,bi=new WeakMap,Ut=new WeakMap,Cr=new WeakMap,St=new WeakMap,Ms=new WeakMap,Tr=new WeakMap,Yt=new WeakSet,Pn=function(t){const r=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...rm(i.data,this.options),fetchMeta:t.meta??null};case"success":return{...i,data:t.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return il(s)&&s.revert&&D(this,bi)?{...D(this,bi),fetchStatus:"idle"}:{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=r(this.state),ut.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),D(this,Ut).notify({query:this,type:"updated",action:t})})},rp);function rm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Yb(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var on,ip,Qb=(ip=class extends Ui{constructor(t={}){super();me(this,on);this.config=t,ie(this,on,new Map)}build(t,r,i){const s=r.queryKey,a=r.queryHash??Dc(s,r);let o=this.get(a);return o||(o=new Wb({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:i,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){D(this,on).has(t.queryHash)||(D(this,on).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=D(this,on).get(t.queryHash);r&&(t.destroy(),r===t&&D(this,on).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,on).get(t)}getAll(){return[...D(this,on).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(i=>zd(r,i))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(i=>zd(t,i)):r}notify(t){ut.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},on=new WeakMap,ip),ln,kt,xr,cn,Wn,sp,Vb=(sp=class extends nm{constructor(t){super();me(this,cn);me(this,ln);me(this,kt);me(this,xr);this.mutationId=t.mutationId,ie(this,kt,t.mutationCache),ie(this,ln,[]),this.state=t.state||im(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,ln).includes(t)||(D(this,ln).push(t),this.clearGcTimeout(),D(this,kt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ie(this,ln,D(this,ln).filter(r=>r!==t)),this.scheduleGc(),D(this,kt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,ln).length||(this.state.status==="pending"?this.scheduleGc():D(this,kt).remove(this))}continue(){var t;return((t=D(this,xr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,c,d,p,h,f,m,y,b,S,k,w,T,A,R,E,z,N;const r=()=>{Ae(this,cn,Wn).call(this,{type:"continue"})};ie(this,xr,tm({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(C,M)=>{Ae(this,cn,Wn).call(this,{type:"failed",failureCount:C,error:M})},onPause:()=>{Ae(this,cn,Wn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,kt).canRun(this)}));const i=this.state.status==="pending",s=!D(this,xr).canStart();try{if(i)r();else{Ae(this,cn,Wn).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=D(this,kt).config).onMutate)==null?void 0:o.call(a,t,this));const M=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));M!==this.state.context&&Ae(this,cn,Wn).call(this,{type:"pending",context:M,variables:t,isPaused:s})}const C=await D(this,xr).start();return await((p=(d=D(this,kt).config).onSuccess)==null?void 0:p.call(d,C,t,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,C,t,this.state.context)),await((y=(m=D(this,kt).config).onSettled)==null?void 0:y.call(m,C,null,this.state.variables,this.state.context,this)),await((S=(b=this.options).onSettled)==null?void 0:S.call(b,C,null,t,this.state.context)),Ae(this,cn,Wn).call(this,{type:"success",data:C}),C}catch(C){try{throw await((w=(k=D(this,kt).config).onError)==null?void 0:w.call(k,C,t,this.state.context,this)),await((A=(T=this.options).onError)==null?void 0:A.call(T,C,t,this.state.context)),await((E=(R=D(this,kt).config).onSettled)==null?void 0:E.
2call(R,void 0,C,this.state.variables,this.state.context,this)),await((N=(z=this.options).onSettled)==null?void 0:N.call(z,void 0,C,t,this.state.context)),C}finally{Ae(this,cn,Wn).call(this,{type:"error",error:C})}}finally{D(this,kt).runNext(this)}}},ln=new WeakMap,kt=new WeakMap,xr=new WeakMap,cn=new WeakSet,Wn=function(t){const r=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ut.batch(()=>{D(this,ln).forEach(i=>{i.onMutationUpdate(t)}),D(this,kt).notify({mutation:this,type:"updated",action:t})})},sp);function im(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Dn,Qt,As,ap,Kb=(ap=class extends Ui{constructor(t={}){super();me(this,Dn);me(this,Qt);me(this,As);this.config=t,ie(this,Dn,new Set),ie(this,Qt,new Map),ie(this,As,0)}build(t,r,i){const s=new Vb({mutationCache:this,mutationId:++Ys(this,As)._,options:t.defaultMutationOptions(r),state:i});return this.add(s),s}add(t){D(this,Dn).add(t);const r=Xs(t);if(typeof r=="string"){const i=D(this,Qt).get(r);i?i.push(t):D(this,Qt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,Dn).delete(t)){const r=Xs(t);if(typeof r=="string"){const i=D(this,Qt).get(r);if(i)if(i.length>1){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}else i[0]===t&&D(this,Qt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Xs(t);if(typeof r=="string"){const i=D(this,Qt).get(r),s=i==null?void 0:i.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var i;const r=Xs(t);if(typeof r=="string"){const s=(i=D(this,Qt).get(r))==null?void 0:i.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ut.batch(()=>
2{D(this,Dn).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,Dn).clear(),D(this,Qt).clear()})}getAll(){return Array.from(D(this,Dn))}find(t){const r={exact:!0,...t};return this.getAll().find(i=>Nd(r,i))}findAll(t={}){return this.getAll().filter(r=>Nd(t,r))}notify(t){ut.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return ut.batch(()=>Promise.all(t.map(r=>r.continue().catch(Bt))))}},Dn=new WeakMap,Qt=new WeakMap,As=new WeakMap,ap);function Xs(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Ma(e){return{onFetch:(t,r)=>{var p,h,f,m,y;const i=t.options,s=(f=(h=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let b=!1;const S=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},k=Jp(t.options,t.fetchOptions),w=async(T,A,R)=>{if(b)return Promise.reject();if(A==null&&T.pages.length)return Promise.resolve(T);const E={client:t.client,queryKey:t.queryKey,pageParam:A,direction:R?"backward":"forward",meta:t.options.meta};S(E);const z=await k(E),{maxPages:N}=t.options,C=R?Fb:Ob;return{pages:C(T.pages,z,N),pageParams:C(T.pageParams,A,N)}};if(s&&a.length){const T=s==="backward",A=T?sm:Fl,R={pages:a,pageParams:o},E=A(i,R);l=await w(R,E,T)}else{const T=e??a.length;do{const A=c===0?o[0]??i.initialPageParam:Fl(i,l);if(c>0&&A==null)break;l=await w(l,A),c++}while(c<T)}return l};t.options.persister?t.fetchFn=()=>{var b,S;return(S=(b=t.options).persister)==null?void 0:S.call(b,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function Fl(e,{pages:t,pageParams:r}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}function sm(e,{pages:t,pageParams:r}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,r[0],r):void 0}function Gb(e,t){return t?Fl(e,t)!=null:!1}function Xb(e,t){return!t||!e.getPreviousPageParam?!1:sm(e,t)!=null}var tt,Xn,Jn,_i,vi,Zn,wi,Si,op,Jb=(op=class{constructor(e={}){me(this,tt);me(this,Xn);me(this,Jn);me(this,_i);me(this,vi);me(this,Zn);me(this,wi);me(this,Si);ie(this,tt,e.queryCache||new Qb),ie(this,Xn,e.mutationCache||new Kb),ie(this,Jn,e.defaultOptions||{}),ie(this,_i,new Map),ie(this,vi,new Map),ie(this,Zn,0)}mount(){Ys(this,Zn)._++,D(this,Zn)===1&&(ie(this,wi,$c.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,tt).onFocus())})),ie(this,Si,Pa.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,tt).onOnline())})))}unmount(){var e,t;Ys(this,Zn)._--,D(this,Zn)===0&&((e=D(this,wi))==null||e.call(this),ie(this,wi,void 0),(t=D(this,Si))==null||t.call(this),ie(this,Si,void 0))}isFetching(e){return D(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,Xn).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=D(this,tt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=D(this,tt).build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(oi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return D(this,tt).findAll(e).map(({queryKey:t,state:r})=>{const i=r.data;return[t,i]})}setQueryData(e,t,r){const i=this.defaultQueryOptions({queryKey:e}),s=D(this,tt).get(i.queryHash),a=s==null?void 0:s.state.data,o=Nb(t,a);if(o!==void 0)return D(this,tt).build(this,i).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return ut.batch(()=>D(this,tt).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=D(this,tt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=D(this,tt);ut.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=D(this,tt);return ut.batch(()=>(r.findAll(e).forEach(i=>
vendor: 10,989 bytes, line 2
2{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},i=ut.batch(()=>D(this,tt).findAll(e).map(s=>s.cancel(r)));return Promise.all(i).then(Bt).catch(Bt)}invalidateQueries(e,t={}){return ut.batch(()=>(D(this,tt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},i=ut.batch(()=>D(this,tt).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(Bt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(Bt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=D(this,tt).build(this,t);return r.isStaleByTime(oi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Bt).catch(Bt)}fetchInfiniteQuery(e){return e.behavior=Ma(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Bt).catch(Bt)}ensureInfiniteQueryData(e){return e.behavior=Ma(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Pa.isOnline()?D(this,Xn).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,tt)}getMutationCache(){return D(this,Xn)}getDefaultOptions(){return D(this,Jn)}setDefaultOptions(e){ie(this,Jn,e)}setQueryDefaults(e,t){D(this,_i).set(Lr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,_i).values()],r={};return t.forEach(i=>{ys(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,t){D(this,vi).set(Lr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,vi).values()],r={};return t.forEach(i=>{ys(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,Jn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Dc(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ic&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,Jn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,tt).clear(),D(this,Xn).clear()}},tt=new WeakMap,Xn=new WeakMap,Jn=new WeakMap,_i=new WeakMap,vi=new WeakMap,Zn=new WeakMap,wi=new WeakMap,Si=new WeakMap,op),It,ze,Ds,Et,kr,Ci,er,tr,Is,Ti,xi,Er,Pr,nr,ki,He,ss,Ul,Bl,ql,jl,Hl,Wl,Yl,om,lp,am=(lp=class extends Ui{constructor(t,r){super();me(this,He);me(this,It);me(this,ze);me(this,Ds);me(this,Et);me(this,kr);me(this,Ci);me(this,er);me(this,tr);me(this,Is);me(this,Ti);me(this,xi);me(this,Er);me(this,Pr);me(this,nr);me(this,ki,new Set);this.options=r,ie(this,It,t),ie(this,tr,null),ie(this,er,Ol()),this.options.experimental_prefetchInRender||D(this,er).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(D(this,ze).addObserver(this),Ud(D(this,ze),this.options)?Ae(this,He,ss).call(this):this.updateResult(),Ae(this,He,jl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ql(D(this,ze),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ql(D(this,ze),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ae(this,He,Hl).call(this),Ae(this,He,Wl).call(this),D(this,ze).removeObserver(this)}setOptions(t){const r=this.options,i=D(this,ze);if(this.options=D(this,It).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Vt(this.options.enabled,D(this,ze))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ae(this,He,Yl).call(this),D(this,ze).setOptions(this.options),r._defaulted&&!Ea(this.options,r)&&D(this,It).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,ze),observer:this});const s=this.hasListeners();s&&Bd(D(this,ze),i,this.options,r)&&Ae(this,He,ss).call(this),this.updateResult(),s&&(D(this,ze)!==i||Vt(this.options.enabled,D(this,ze))!==Vt(r.enabled,D(this,ze))||oi(this.options.staleTime,D(this,ze))!==oi(r.staleTime,D(this,ze)))&&Ae(this,He,Ul).call(this);const a=Ae(this,He,Bl).call(this);s&&(D(this,ze)!==i||Vt(this.options.enabled,D(this,ze))!==Vt(r.enabled,D(this,ze))||a!==D(this,nr))&&Ae(this,He,ql).call(this,a)}getOptimisticResult(t){const r=D(this,It).getQueryCache().build(D(this,It),t),i=this.createResult(r,t);return e_(this,i)&&(ie(this,Et,i),ie(this,Ci,this.options),ie(this,kr,D(this,ze).state)),i}getCurrentResult(){return D(this,Et)}trackResult(t,r){return new Proxy(t,{get:(i,s)=>(this.trackProp(s),r==null||r(s),Reflect.get(i,s))})}trackProp(t){D(this,ki).add(t)}getCurrentQuery(){return D(this,ze)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=D(this,It).defaultQueryOptions(t),i=D(this,It).getQueryCache().build(D(this,It),r);return i.fetch().then(()=>this.createResult(i,r))}fetch(t){return Ae(this,He,ss).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,Et)))}createResult(t,r){var C;const i=D(this,ze),s=this.options,a=D(this,Et),o=D(this,kr),l=D(this,Ci),d=t!==i?t.state:D(this,Ds),{state:p}=t;let h={...p},f=!1,m;if(r._optimisticResults){const M=this.hasListeners(),P=!M&&Ud(t,r),I=M&&Bd(t,i,r,s);(P||I)&&(h={...h,...rm(p.data,t.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:S}=h;m=h.data;let k=!1;if(r.placeholderData!==void 0&&m===void 0&&S==="pending"){let M;a!=null&&a.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(M=a.data,k=!0):M=typeof r.placeholderData=="function"?r.placeholderData((C=D(this,xi))==null?void 0:C.state.data,D(this,xi)):r.placeholderData,M!==void 0&&(S="success",m=Ll(a==null?void 0:a.data,M,r),f=!0)}if(r.select&&m!==void 0&&!k)if(a&&m===(o==null?void 0:o.data)&&r.select===D(this,Is))m=D(this,Ti);else try{ie(this,Is,r.select),m=r.select(m),m=Ll(a==null?void 0:a.data,m,r),ie(this,Ti,m),ie(this,tr,null)}catch(M){ie(this,tr,M)}D(this,tr)&&(y=D(this,tr),m=D(this,Ti),b=Date.now(),S="error");const w=h.fetchStatus==="fetching",T=S==="pending",A=S==="error",R=T&&w,E=m!==void 0,N={status:S,fetchStatus:h.fetchStatus,isPending:T,isSuccess:S==="success",isError:A,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:h.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:w,isRefetching:w&&!T,isLoadingError:A&&!E,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:A&&E,isStale:Rc(t,r),refetch:this.refetch,promise:D(this,er)};if(this.options.experimental_prefetchInRender){const M=L=>{N.status==="error"?L.reject(N.error):N.data!==void 0&&L.resolve(N.data)},P=()=>{const L=ie(this,er,N.promise=Ol());M(L)},I=D(this,er);switch(I.status){case"pending":t.queryHash===i.queryHash&&M(I);break;case"fulfilled":(N.status==="error"||N.data!==I.value)&&P();break;case"rejected":(N.status!=="error"||N.error!==I.reason)&&P();break}}return N}updateResult(){const t=D(this,Et),r=this.createResult(D(this,ze),this.options);if(ie(this,kr,D(this,ze).state),ie(this,Ci,this.options),D(this,kr).data!==void 0&&ie(this,xi,D(this,ze)),Ea(r,t))return;ie(this,Et,r);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!D(this,ki).size)return!0;const o=new Set(a??D(this,ki));return this.options.throwOnError&&o.add("error"),Object.keys(D(this,Et)).some(l=>{const c=l;return D(this,Et)[c]!==t[c]&&o.has(c)})};Ae(this,He,om).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ae(this,He,jl).call(this)}},It=new WeakMap,ze=new WeakMap,Ds=new WeakMap,Et=new WeakMap,kr=new WeakMap,Ci=new WeakMap,er=new WeakMap,tr=new WeakMap,Is=new WeakMap,Ti=new WeakMap,xi=new WeakMap,Er=new WeakMap,Pr=new WeakMap,nr=new WeakMap,ki=new WeakMap,He=new WeakSet,ss=function(t){Ae(this,He,Yl).call(this);let r=D(this,ze).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Bt)),r},Ul=function(){Ae(this,He,Hl).call(this);const t=oi(this.options.staleTime,D(this,ze));if(Nr||D(this,Et).isStale||!zl(t))return;const i=Gp(D(this,Et).dataUpdatedAt,t)+1;ie(this,Er,setTimeout(()=>{D(this,Et).isStale||this.updateResult()},i))},Bl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,ze)):this.options.refetchInterval)??!1},ql=function(t){Ae(this,He,Wl).call(this),ie(this,nr,t),!(Nr||Vt(this.options.enabled,D(this,ze))===!1||!zl(D(this,nr))||D(this,nr)===0)&&ie(this,Pr,setInterval(()=>{(this.options.refetchIntervalInBackground||$c.isFocused())&&Ae(this,He,ss).call(this)},D(this,nr)))},jl=function(){Ae(this,He,Ul).call(this),Ae(this,He,ql).call(this,Ae(this,He,Bl).call(this))},Hl=function(){D(this,Er)&&(clearTimeout(D(this,Er)),ie(this,Er,void 0))},Wl=function(){D(this,Pr)&&(clearInterval(D(this,Pr)),ie(this,Pr,void 0))},Yl=function(){const t=D(this,It).getQueryCache().build(D(this,It),this.options);if(t===D(this,ze))return;const r=D(this,ze);ie(this,ze,t),ie(this,Ds,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},om=function(t){ut.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(D(this,Et))}),D(this,It).getQueryCache().notify({query:D(this,ze),type:"observerResultsUpdated"})})},lp);function Zb(e,t){return Vt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ud(e,t){return Zb(e,t)||e.state.data!==void 0&&Ql(e,t,t.refetchOnMount)}function Ql(e,t,r){if(Vt(t.enabled,e)!==!1){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&Rc(e,t)}return!1}function Bd(e,t,r,i){return(e!==t||Vt(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Rc(e,r)}function Rc(e,t){return Vt(t.enabled,e)!==!1&&e.isStaleByTime(oi(t.staleTime,e))}function e_(e,t){return!Ea(e.getCurrentResult(),t)}var t_=class extends am{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Ma()})}getOptimisticResult(e){return e.behavior=Ma(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}
2fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var y,b;const{state:r}=e,i=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:o,isRefetchError:l}=i,c=(b=(y=r.fetchMeta)==null?void 0:y.fetchMore)==null?void 0:b.direction,d=o&&c==="forward",p=s&&c==="forward",h=o&&c==="backward",f=s&&c==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Gb(t,r.data),hasPreviousPage:Xb(t,r.data),isFetchNextPageError:d,isFetchingNextPage:p,isFetchPreviousPageError:h,isFetchingPreviousPage:f,isRefetchError:l&&!d&&!h,isRefetching:a&&!p&&!f}}},rr,ir,$t,In,Ln,oa,Vl,cp,n_=(cp=class extends Ui{constructor(r,i){super();me(this,Ln);me(this,rr);me(this,ir);me(this,$t);me(this,In);ie(this,rr,r),this.setOptions(i),this.bindMethods(),Ae(this,Ln,oa).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const i=this.options;this.options=D(this,rr).defaultMutationOptions(r),Ea(this.options,i)||D(this,rr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,$t),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&Lr(i.mutationKey)!==Lr(this.options.mutationKey)?this.reset():((s=D(this,$t))==null?void 0:s.state.status)==="pending"&&D(this,$t).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=D(this,$t))==null||r.removeObserver(this)}onMutationUpdate(r){Ae(this,Ln,oa).call(this),Ae(this,Ln,Vl).call(this,r)}getCurrentResult(){return D(this,ir)}reset(){var r;(r=D(this,$t))==null||r.removeObserver(this),ie(this,$t,void 0),Ae(this,Ln,oa).call(this),Ae(this,Ln,Vl).call(this)}mutate(r,i){var s;return ie(this,In,i),(s=D(this,$t))==null||s.removeObserver(this),ie(this,$t,D(this,rr).getMutationCache().build(D(this,rr),this.options)),D(this,$t).addObserver(this),D(this,$t).execute(r)}},rr=new WeakMap,ir=new WeakMap,$t=new WeakMap,In=new WeakMap,Ln=new WeakSet,oa=function(){var i;const r=((i=D(this,$t))==null?void 0:i.state)??im();ie(this,ir,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Vl=function(r){ut.batch(()=>{var i,s,a,o,l,c,d,p;if(D(this,In)&&this.hasListeners()){const h=D(this,ir).variables,f=D(this,ir).context;(r==null?void 0:r.type)==="success"?((s=(i=D(this,In)).onSuccess)==null||s.call(i,r.data,h,f),(o=(a=D(this,In)).onSettled)==null||o.call(a,r.data,null,h,f)):(r==null?void 0:r.type)==="error"&&((c=(l=D(this,In)).onError)==null||c.call(l,r.error,h,f),(p=(d=D(this,In)).onSettled)==null||p.call(d,void 0,r.error,h,f))}this.listeners.forEach(h=>{h(D(this,ir))})})},cp),lm=_.createContext(void 0),at=e=>{const t=_.useContext(lm);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},r_=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),n(lm.Provider,{value:e,children:t})),cm=_.createContext(!1),i_=()=>_.useContext(cm);cm.Provider;function s_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var a_=_.createContext(s_()),o_=()=>_.useContext(a_);function dm(e,t){return typeof e=="function"?e(...t):!!e}function Kl(){}var l_=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},c_=e=>{_.useEffect(()=>{e.clearReset()},[e])},d_=({result:e,errorResetBoundary:t,throwOnError:r,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||dm(r,[e.error,i])),u_=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...r)=>Math.max(t(...r),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},h_=(e,t)=>e.isLoading&&e.isFetching&&!t,p_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,qd=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function um(e,t,r){var h,f,m,y,b;const i=at(),s=i_(),a=o_(),o=i.defaultQueryOptions(e);(f=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||f.call(h,o),o._optimisticResults=s?"isRestoring":"optimistic",u_(o),l_(o,a),c_(a);const l=!i.getQueryCache().get(o.queryHash),[c]=_.useState(()=>new t(i,o)),d=c.getOptimisticResult(o),p=!s&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(S=>{const k=p?c.subscribe(ut.batchCalls(S)):Kl;return c.updateResult(),k},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),_.useEffect(()=>{c.setOptions(o)},[o,c]),p_(o,d))throw qd(o,c,a);if(d_({result:d,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw d.error;if((y=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,d),o.experimental_prefetchInRender&&!Nr&&h_(d,s)){const S=l?qd(o,c,a):(b=i.getQueryCache().get(o.queryHash))==null?void 0:b.promise;S==null||S.catch(Kl).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function oe(e,t){return um(e,am)}function J(e,t){const r=at(),[i]=_.useState(()=>new n_(r,e));_.useEffect(()=>{i.setOptions(e)},[i,e]);const s=_.useSyncExternalStore(_.useCallback(o=>i.subscribe(ut.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=_.useCallback((o,l)=>{i.mutate(o,l).catch(Kl)},[i]);if(s.error&&dm(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function zc(e,t){return um(e,t_)}const m_="modulepreload",f_=function(e){return"/"+e},jd={},co=function(t,r,i){let s=Promise.resolve();if(r&&r.length>0){let o=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(h=>({status:"fulfilled",value:h}),h=>
2({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(r.map(d=>{if(d=f_(d),d in jd)return;jd[d]=!0;const p=d.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const f=document.createElement("link");if(f.rel=p?"stylesheet":m_,p||(f.as="script"),f.crossOrigin="",f.href=d,c&&f.setAttribute("nonce",c),document.head.appendChild(f),p)return new Promise((m,y)=>{f.addEventListener("load",m),f.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},Pe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,We=globalThis,Mr="10.32.0";function uo(){return ho(We),We}function ho(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Mr,t[Mr]=t[Mr]||{}}function Bi(e,t,r=We){const i=r.__SENTRY__=r.__SENTRY__||{},s=i[Mr]=i[Mr]||{};return s[e]||(s[e]=t())}const g_=["debug","info","warn","error","log","assert","trace"],y_="Sentry Logger ",Aa={};function qi(e){if(!("console"in We))return e();const t=We.console,r={},i=Object.keys(Aa);i.forEach(s=>{const a=Aa[s];r[s]=t[s],t[s]=a});try{return e()}finally{i.forEach(s=>{t[s]=r[s]})}}function b_(){Lc().enabled=!0}function __(){Lc().enabled=!1}function hm(){return Lc().enabled}function v_(...e){Nc("log",...e)}function w_(...e){Nc("warn",...e)}function S_(...e){Nc("error",...e)}function Nc(e,...t){Pe&&hm()&&qi(()=>{We.console[e](`${y_}[${e}]:`,...t)})}function Lc(){return Pe?Bi("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const ve={enable:b_,disable:__,isEnabled:hm,log:v_,warn:w_,error:S_},pm=50,Or="?",Hd=/\(error: (.*)\)/,Wd=/captureMessage|captureException/;function mm(...e){const t=e.sort((r,i)=>r[0]-i[0]).map(r=>r[1]);return(r,i=0,s=0)=>{const a=[],o=r.split(`
3`);for(let l=i;l<o.length;l++){let c=o[l];c.length>1024&&(c=c.slice(0,1024));const d=Hd.test(c)?c.replace(Hd,"$1"):c;if(!d.match(/\S*Error: /)){for(const p of t){const h=p(d);if(h){a.push(h);break}}if(a.length>=pm+s)break}}return T_(a.slice(s))}}function C_(e){return Array.isArray(e)?mm(...e):e}function T_(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Js(t).function||"")&&t.pop(),t.reverse(),Wd.test(Js(t).function||"")&&(t.pop(),Wd.test(Js(t).function||"")&&t.pop()),t.slice(0,pm).map(r=>({...r,filename:r.filename||Js(t).filename,function:r.function||Or}))}function Js(e){return e[e.length-1]||{}}const sl="<anonymous>";function lr(e){try{return!e||typeof e!="function"?sl:e.name||sl}catch{return sl}}function Yd(e){const t=e.exception;if(t){const r=[];try{return t.values.forEach(i=>{i.stacktrace.frames&&r.push(...i.stacktrace.frames)}),r}catch{return}}}function fm(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const la={},Qd={};function Hr(e,t){la[e]=la[e]||[],la[e].push(t)}function Wr(e,t){if(!Qd[e]){Qd[e]=!0;try{t()}catch(r){Pe&&ve.error(`Error while instrumenting ${e}`,r)}}}function Jt(e,t){const r=e&&la[e];if(r)for(const i of r)try{i(t)}catch(s){Pe&&ve.error(`Error while triggering instrumentation handler.
4Type: ${e}
5Name: ${lr(i)}
6Error:`,s)}}let al=null;function x_(e){const t="error";Hr(t,e),Wr(t,k_)}function k_(){al=We.onerror,We.onerror=function(e,t,r,i,s){return Jt("error",{column:i,error:s,line:r,msg:e,url:t}),al?al.apply(this,arguments):!1},We.onerror.__SENTRY_INSTRUMENTED__=!0}let ol=null;function E_(e){const t="unhandledrejection";Hr(t,e),Wr(t,P_)}function P_(){ol=We.onunhandledrejection,We.onunhandledrejection=function(e){return Jt("unhandledrejection",e),ol?ol.apply(this,arguments):!0},We.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const gm=Object.prototype.toString;function Oc(e){switch(gm.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return cr(e,Error)}}function ji(e,t){return gm.call(e)===`[object ${t}]`}function ym(e){return ji(e,"ErrorEvent")}function Vd(e){return ji(e,"DOMError")}function M_(e){return ji(e,"DOMException")}function $n(e){return ji(e,"String")}function Fc(e){return typeof e=="object"&&e!==null&&"__sentry_template_str
6ing__"in e&&"__sentry_template_values__"in e}function po(e){return e===null||Fc(e)||typeof e!="object"&&typeof e!="function"}function bs(e){return ji(e,"Object")}function mo(e){return typeof Event<"u"&&cr(e,Event)}function A_(e){return typeof Element<"u"&&cr(e,Element)}function D_(e){return ji(e,"RegExp")}function Ls(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function I_(e){return bs(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function cr(e,t){try{return e instanceof t}catch{return!1}}function bm(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function _m(e){return typeof Request<"u"&&cr(e,Request)}const Uc=We,$_=80;function vm(e,t={}){if(!e)return"<unknown>";try{let r=e;const i=5,s=[];let a=0,o=0;const l=" > ",c=l.length;let d;const p=Array.isArray(t)?t:t.keyAttrs,h=!Array.isArray(t)&&t.maxStringLength||$_;for(;r&&a++<i&&(d=R_(r,p),!(d==="html"||a>1&&o+s.length*c+d.length>=h));)s.push(d),o+=d.length,r=r.parentNode;return s.reverse().join(l)}catch{return"<unknown>"}}function R_(e,t){const r=e,i=[];if(!(r!=null&&r.tagName))return"";if(Uc.HTMLElement&&r instanceof HTMLElement&&r.dataset){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}i.push(r.tagName.toLowerCase());const s=t!=null&&t.length?t.filter(o=>r.getAttribute(o)).map(o=>[o,r.getAttribute(o)]):null;if(s!=null&&s.length)s.forEach(o=>{i.push(`[${o[0]}="${o[1]}"]`)});else{r.id&&i.push(`#${r.id}`);const o=r.className;if(o&&$n(o)){const l=o.split(/\s+/);for(const c of l)i.push(`.${c}`)}}const a=["aria-label","type","name","title","alt"];for(const o of a){const l=r.getAttribute(o);l&&i.push(`[${o}="${l}"]`)}return i.join("")}function Bc(){try{return Uc.document.location.href}catch{return""}}function z_(e){if(!Uc.HTMLElement)return null;let t=e;const r=5;for(let i=0;i<r;i++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function Nt(e,t,r){if(!(t in e))return;const i=e[t];if(typeof i!="function")return;const s=r(i);typeof s=="function"&&wm(s,i);try{e[t]=s}catch{Pe&&ve.log(`Failed to replace method "${t}" in object`,e)}}function Fr(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{Pe&&ve.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function wm(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,Fr(e,"__sentry_original__",t)}catch{}}function qc(e){return e.__sentry_original__}function Sm(e){if(Oc(e))return{message:e.message,name:e.name,stack:e.stack,...Gd(e)};if(mo(e)){const t={type:e.type,target:Kd(e.target),currentTarget:Kd(e.currentTarget),...Gd(e)};return typeof CustomEvent<"u"&&cr(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Kd(e){try{return A_(e)?vm(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Gd(e){if(typeof e=="object"&&e!==null){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function N_(e){const t=Object.keys(Sm(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}function Gl(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Xd(e,t){if(!Array.isArray(e))return"";const r=[];for(let i=0;i<e.length;i++){const s=e[i];try{bm(s)?r.push(fm(s)):r.push(String(s))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function ca(e,t,r=!1){return $n(e)?D_(t)?t.test(e):$n(t)?r?e===t:e.includes(t):!1:!1}function fo(e,t=[],r=!1){return t.some(i=>ca(e,i,r))}function L_(){const e=We;return e.crypto||e.msCrypto}let ll;function O_(){return Math.random()*16}function jt(e=L_()){try{if(e!=null&&e.randomUUID)return e.randomUUID().replace(/-/g,"")}catch{}return ll||(ll="10000000100040008000"+1e11),ll.replace(/[018]/g,t=>(t^(O_()&15)>>t/4).toString(16))}function Cm(e){var t,r;return(r=(t=e.exception)==null?void 0:t.values)==null?void 0:r[0]}function br(e){const{message:t,event_id:r}=e;if(t)return t;const i=Cm(e);return i?i.type&&i.value?`${i.type}: ${i.value}`:i.type||i.value||r||"<unknown>":r||"<unknown>"}function Xl(e,t,r){const i=e.exception=e.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function Di(e,t){const r=Cm(e);if(!r)return;const i={type:"generic",handled:!0},s=r.mechanism;if(r.mechanism={...i,...s,...t},t&&"data"in t){const a={...s==null?void 0:s.data,...t.data};r.mechanism.data=a}}function Jd(e){if(F_(e))return!0;try{Fr(e,"__sentry_captured__",!0)}catch{}return!1}function F_(e){try{return e.__sentry_captured__}catch{}}const Tm=1e3;function Os(){return Date.now()/Tm}function U_(){const{performance:e}=We;if(!(e!=null&&e.now)||!e.timeOrigin)return Os;const t=e.timeOrigin;return()=>(t+e.now())/Tm}let Zd;function Rn(){return(Zd??(Zd=U_()))()}function B_(e){const t=Rn(),r={sid:jt(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>j_(r)};return e&&Ii(r,e),r}function Ii(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Rn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:jt()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),t
vendor: 6,515 bytes, line 6
6ypeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function q_(e,t){let r={};e.status==="ok"&&(r={status:"exited"}),Ii(e,r)}function j_(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Fs(e,t,r=2){if(!t||typeof t!="object"||r<=0)return t;if(e&&Object.keys(t).length===0)return e;const i={...e};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=Fs(i[s],t[s],r-1));return i}function eu(){return jt()}function xm(){return jt().substring(16)}const Jl="_sentrySpan";function tu(e,t){t?Fr(e,Jl,t):delete e[Jl]}function nu(e){return e[Jl]}const H_=100;class On{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:eu(),sampleRand:Math.random()}}clone(){const t=new On;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,tu(t,nu(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ii(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,r){return this.setTags({[t]:r})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,r){return this.setAttributes({[t]:r})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,r){return this._extra={...this._extra,[t]:r},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,r){return r===null?delete this._contexts[t]:this._contexts[t]=r,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const r=typeof t=="function"?t(this):t,i=r instanceof On?r.getScopeData():bs(r)?t:void 0,{tags:s,attributes:a,extra:o,user:l,contexts:c,level:d,fingerprint:p=[],propagationContext:h}=i||{};return this._tags={...this._tags,...s},this._attributes={...this._attributes,...a},this._extra={...this._extra,...o},this._contexts={...this._contexts,...c},l&&Object.keys(l).length&&(this._user=l),d&&(this._level=d),p.length&&(this._fingerprint=p),h&&(this._propagationContext=h),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,tu(this,void 0),this._attachments=[],this.setPropagationContext({traceId:eu(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(t,r){var a;const i=typeof r=="number"?r:H_;if(i<=0)return this;const s={timestamp:Os(),...t,message:t.message?Gl(t.message,2048):t.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>i&&(this._breadcrumbs=this._breadcrumbs.slice(-i),(a=this._client)==null||a.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:nu(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Fs(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,r){const i=(r==null?void 0:r.event_id)||jt();if(!this._client)return Pe&&ve.warn("No client configured on scope - will not capture exception!"),i;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...r,event_id:i},this),i}captureMessage(t,r,i){const s=(i==null?void 0:i.event_id)||jt();if(!this._client)return Pe&&ve.warn("No client configured on scope - will not capture message!"),s;const a=(i==null?void 0:i.syntheticException)??new Error(t);return this._client.captureMessage(t,r,{originalException:t,syntheticException:a,...i,event_id:s},this),s}captureEvent(t,r){const i=(r==null?void 0:r.event_id)||jt();return this._client?(this._client.captureEvent(t,{...r,event_id:i},this),i):(Pe&&ve.warn("No client configured on scope - will not capture event!"),i)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEac
6h(t=>{t(this)}),this._notifyingListeners=!1)}}function W_(){return Bi("defaultCurrentScope",()=>new On)}function Y_(){return Bi("defaultIsolationScope",()=>new On)}class Q_{constructor(t,r){let i;t?i=t:i=new On;let s;r?s=r:s=new On,this._stack=[{scope:i}],this._isolationScope=s}withScope(t){const r=this._pushScope();let i;try{i=t(r)}catch(s){throw this._popScope(),s}return Ls(i)?i.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(this._popScope(),i)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function $i(){const e=uo(),t=ho(e);return t.stack=t.stack||new Q_(W_(),Y_())}function V_(e){return $i().withScope(e)}function K_(e,t){const r=$i();return r.withScope(()=>(r.getStackTop().scope=e,t(e)))}function ru(e){return $i().withScope(()=>e($i().getIsolationScope()))}function G_(){return{withIsolationScope:ru,withScope:V_,withSetScope:K_,withSetIsolationScope:(e,t)=>ru(t),getCurrentScope:()=>$i().getScope(),getIsolationScope:()=>$i().getIsolationScope()}}function jc(e){const t=ho(e);return t.acs?t.acs:G_()}function ur(){const e=uo();return jc(e).getCurrentScope()}function Hi(){const e=uo();return jc(e).getIsolationScope()}function X_(){return Bi("globalScope",()=>new On)}function J_(...e){const t=uo(),r=jc(t);if(e.length===2){const[i,s]=e;return i?r.withSetScope(i,s):r.withScope(s)}return r.withScope(e[0])}function At(){return ur().getClient()}function Z_(e){const t=e.getPropagationContext(),{traceId:r,parentSpanId:i,propagationSpanId:s}=t,a={trace_id:r,span_id:s||xm()};return i&&(a.parent_span_id=i),a}const ev="sentry.source",tv="sentry.sample_rate",nv="sentry.previous_trace_sample_rate",rv="sentry.op",iv="sentry.origin",km="sentry.profile_id",Em="sentry.exclusive_time",sv=0,av=1,ov="_sentryScope",lv="_sentryIsolationScope";function cv(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function Pm(e){const t=e;return{scope:t[ov],isolationScope:cv(t[lv])}}const dv="sentry-",uv=/^sentry-/;function hv(e){const t=pv(e);if(!t)return;const r=Object.entries(t).reduce((i,[s,a])=>{if(s.match(uv)){const o=s.slice(dv.length);i[o]=a}return i},{});if(Object.keys(r).length>0)return r}function pv(e){if(!(!e||!$n(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,r)=>{const i=iu(r);return Object.entries(i).forEach(([s,a])=>{t[s]=a}),t},{}):iu(e)}function iu(e){return e.split(",").map(t=>{const r=t.indexOf("=");if(r===-1)return[];const i=t.slice(0,r),s=t.slice(r+1);return[i,s].map(a=>{try{return decodeURIComponent(a.trim())}catch{return}})}).reduce((t,[r,i])=>(r&&i&&(t[r]=i),t),{})}const mv=/^o(\d+)\./,fv=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function gv(e){return e==="http"||e==="https"}function Us(e,t=!1){const{host:r,path:i,pass:s,port:a,projectId:o,protocol:l,publicKey:c}=e;return`${l}://${c}${t&&s?`:${s}`:""}@${r}${a?`:${a}`:""}/${i&&`${i}/`}${o}`}function yv(e){const t=fv.exec(e);if(!t){qi(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[r,i,s="",a="",o="",l=""]=t.slice(1);let c="",d=l;const p=d.split("/");if(p.length>1&&(c=p.slice(0,-1).join("/"),d=p.pop()),d){const h=d.match(/^\d+/);h&&(d=h[0])}return Mm({host:a,pass:s,path:c,projectId:d,port:o,protocol:r,publicKey:i})}function Mm(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function bv(e){if(!Pe)return!0;const{port:t,projectId:r,protocol:i}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(ve.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:r.match(/^\d+$/)?gv(i)?t&&isNaN(parseInt(t,10))?(ve.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(ve.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(ve.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function _v(e){const t=e.match(mv);return t==null?void 0:t[1]}function vv(e){const t=e.getOptions(),{host:r}=e.getDsn()||{};let i;
6return t.orgId?i=String(t.orgId):r&&(i=_v(r)),i}function wv(e){const t=typeof e=="string"?yv(e):Mm(e);if(!(!t||!bv(t)))return t}function Sv(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const Am=1;let su=!1;function Cv(e){const{spanId:t,traceId:r,isRemote:i}=e.spanContext(),s=i?t:Hc(e).parent_span_id,a=Pm(e).scope,o=i?(a==null?void 0:a.getPropagationContext().propagationSpanId)||xm():t;return{parent_span_id:s,span_id:o,trace_id:r}}function Tv(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:r,traceFlags:i,...s},attributes:a})=>({span_id:t,trace_id:r,sampled:i===Am,attributes:a,...s}))}function au(e){return typeof e=="number"?ou(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?ou(e.getTime()):Rn()}function ou(e){return e>9999999999?e/1e3:e}function Hc(e){var i;if(kv(e))return e.getSpanJSON();const{spanId:t,traceId:r}=e.spanContext();if(xv(e)){const{attributes:s,startTime:a,name:o,endTime:l,status:c,links:d}=e,p="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(i=e.parentSpanContext)==null?void 0:i.spanId:void 0;return{span_id:t,trace_id:r,data:s,description:o,parent_span_id:p,start_timestamp:au(a),timestamp:au(l)||void 0,status:Pv(c),op:s[rv],origin:s[iv],links:Tv(d)}}return{span_id:t,trace_id:r,start_timestamp:0,data:{}}}function xv(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function kv(e){return typeof e.getSpanJSON=="function"}function Ev(e){const{traceFlags:t}=e.spanContext();return t===Am}function Pv(e){if(!(!e||e.code===sv))return e.code===av?"ok":e.message||"internal_error"}const Mv="_sentryRootSpan";function Dm(e){return e[Mv]||e}function lu(){su||(qi(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),su=!0)}function Av(e){var r;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=(r=At())==null?void 0:r.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function cu(e){ve.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function du(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const r of t){if(Iv(r)){if(ca(e.description,r))return Pe&&cu(e),!0;continue}if(!r.name&&!r.op)continue;const i=r.name?ca(e.description,r.name):!0,s=r.op?e.op&&ca(e.op,r.op):!0;if(i&&s)return Pe&&cu(e),!0}return!1}function Dv(e,t){const r=t.parent_span_id,i=t.span_id;if(r)for(const s of e)s.parent_span_id===i&&(s.parent_span_id=r)}function Iv(e){return typeof e=="string"||e instanceof RegExp}const Wc="production",$v="_frozenDsc";function Im(e,t){const r=t.getOptions(),{publicKey:i}=t.getDsn()||{},s={environment:r.environment||Wc,release:r.release,public_key:i,trace_id:e,org_id:vv(t)};return t.emit("createDsc",s),s}function Rv(e,t){const r=t.getPropagationContext();return r.dsc||Im(r.traceId,e)}function zv(e){var y;const t=At();if(!t)return{};const r=Dm(e),i=Hc(r),s=i.data,a=r.spanContext().traceState,o=(a==null?void 0:a.get("sentry.sample_rate"))??s[tv]??s[nv];function l(b){return(typeof o=="number"||typeof o=="string")&&(b.sample_rate=`${o}`),b}const c=r[$v];if(c)return l(c);const d=a==null?void 0:a.get("sentry.dsc"),p=d&&hv(d);if(p)return l(p);const h=Im(e.spanContext().traceId,t),f=s[ev],m=i.description;return f!=="url"&&m&&(h.transaction=m),Av()&&(h.sampled=String(Ev(r)),h.sample_rand=(a==null?void 0:a.get("sentry.sample_rand"))??((y=Pm(r).scope)==null?void 0:y.getPropagationContext().sampleRand.toString())),l(h),t.emit("createDsc",h,r),h}function Mn(e,t=100,r=1/0){try{return Zl("",e,t,r)}catch(i){return{ERROR:`**non-serializable** (${i})`}}}function $m(e,t=3,r=100*1024){const i=Mn(e,t);return Fv(i)>r?$m(e,t-1,r):i}function Zl(e,t,r=1/0,i=1/0,s=Uv()){const[a,o]=s;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const l=Nv(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:r;if(c===0)return l.replace("object ","");if(a(t))return"[Circular ~]";const d=t;if(d&&typeof d.toJSON=="function")try{const m=d.toJSON();return Zl("",m,c-1,i,s)}catch{}const p=Array.isArray(t)?[]:{};let h=0;const f=Sm(t);for(const m in f){if(!Object.prototype.hasOwnProperty.call(f,m))continue;if(h>=i){p[m]="[MaxProperties ~]";break}const y=f[m];p[m]=Zl(m,y,c-1,i,s),h++}return o(t),p}function Nv(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(bm(t))return fm(t);if(I_(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${lr(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const r=Lv(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function Lv(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function Ov(e){return~-encodeURI(e).split(/%..|./).length}function Fv(e){return Ov(JSON.stringify(e))}function Uv(){const e=new WeakSet;function t(i){return e.has(i)?!0:(e.add(i),!1)}function r(i){e.delete(i)}return[t,r]}function Wi(e,t=[]){return[e,t]}function Bv(e,t){const[r,i]=e;return[r,[...i,t]]}function uu(e,t){const r=e[1];for(const i of r){const s=i[0].type;if(t(i,s))return!0}return!1}function ec(e){const t=ho(We);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function qv(e){const[t,r]=e;let i=JSON.stringify(t);
6function s(a){typeof i=="string"?i=typeof a=="string"?i+a:[ec(i),a]:i.push(typeof a=="string"?ec(a):a)}for(const a of r){const[o,l]=a;if(s(`
7${JSON.stringify(o)}
8`),typeof l=="string"||l instanceof Uint8Array)s(l);else{let c;try{c=JSON.stringify(l)}catch{c=JSON.stringify(Mn(l))}s(c)}}return typeof i=="string"?i:jv(i)}function jv(e){const t=e.reduce((s,a)=>s+a.length,0),r=new Uint8Array(t);let i=0;for(const s of e)r.set(s,i),i+=s.length;return r}function Hv(e){const t=typeof e.data=="string"?ec(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Wv={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function hu(e){return Wv[e]}function Rm(e){if(!(e!=null&&e.sdk))return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function Yv(e,t,r,i){var a;const s=(a=e.sdkProcessingMetadata)==null?void 0:a.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!r&&i&&{dsn:Us(i)},...s&&{trace:s}}}function Qv(e,t){var i,s,a,o;if(!t)return e;const r=e.sdk||{};return e.sdk={...r,name:r.name||t.name,version:r.version||t.version,integrations:[...((i=e.sdk)==null?void 0:i.integrations)||[],...t.integrations||[]],packages:[...((s=e.sdk)==null?void 0:s.packages)||[],...t.packages||[]],settings:(a=e.sdk)!=null&&a.settings||t.settings?{...(o=e.sdk)==null?void 0:o.settings,...t.settings}:void 0},e}function Vv(e,t,r,i){const s=Rm(r),a={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!i&&t&&{dsn:Us(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Wi(a,[o])}function Kv(e,t,r,i){const s=Rm(r),a=e.type&&e.type!=="replay_event"?e.type:"event";Qv(e,r==null?void 0:r.sdk);const o=Yv(e,s,i,t);return delete e.sdkProcessingMetadata,Wi(o,[[{type:a},e]])}const cl=0,pu=1,mu=2;function go(e){return new _s(t=>{t(e)})}function Yc(e){return new _s((t,r)=>{r(e)})}class _s{constructor(t){this._state=cl,this._handlers=[],this._runExecutor(t)}then(t,r){return new _s((i,s)=>{this._handlers.push([!1,a=>{if(!t)i(a);else try{i(t(a))}catch(o){s(o)}},a=>{if(!r)s(a);else try{i(r(a))}catch(o){s(o)}}]),this._executeHandlers()})}catch(t){return this.then(r=>r,t)}finally(t){return new _s((r,i)=>{let s,a;return this.then(o=>{a=!1,s=o,t&&t()},o=>{a=!0,s=o,t&&t()}).then(()=>{if(a){i(s);return}r(s)})})}_executeHandlers(){if(this._state===cl)return;const t=this._handlers.slice();this._handlers=[],t.forEach(r=>{r[0]||(this._state===pu&&r[1](this._value),this._state===mu&&r[2](this._value),r[0]=!0)})}_runExecutor(t){const r=(a,o)=>{if(this._state===cl){if(Ls(o)){o.then(i,s);return}this._state=a,this._value=o,this._executeHandlers()}},i=a=>{r(pu,a)},s=a=>{r(mu,a)};try{t(i,s)}catch(a){s(a)}}}function Gv(e,t,r,i=0){try{const s=tc(t,r,e,i);return Ls(s)?s:go(s)}catch(s){return Yc(s)}}function tc(e,t,r,i){const s=r[i];if(!e||!s)return e;const a=s({...e},t);return Pe&&a===null&&ve.log(`Event processor "${s.id||"?"}" dropped event`),Ls(a)?a.then(o=>tc(o,t,r,i+1)):tc(a,t,r,i+1)}function Xv(e,t){const{fingerprint:r,span:i,breadcrumbs:s,sdkProcessingMetadata:a}=t;Jv(e,t),i&&t0(e,i),n0(e,r),Zv(e,s),e0(e,a)}function fu(e,t){const{extra:r,tags:i,attributes:s,user:a,contexts:o,level:l,sdkProcessingMetadata:c,breadcrumbs:d,fingerprint:p,eventProcessors:h,attachments:f,propagationContext:m,transactionName:y,span:b}=t;ts(e,"extra",r),ts(e,"tags",i),ts(e,"attributes",s),ts(e,"user",a),ts(e,"contexts",o),e.sdkProcessingMetadata=Fs(e.sdkProcessingMetadata,c,2),l&&(e.level=l),y&&(e.transactionName=y),b&&(e.span=b),d.length&&(e.breadcrumbs=[...e.breadcrumbs,...d]),p.length&&(e.fingerprint=[...e.fingerprint,...p]),h.length&&(e.eventProcessors=[...e.eventProcessors,...h]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...m}}function ts(e,t,r){e[t]=Fs(e[t],r,1)}function Jv(e,t){const{extra:r,tags:i,user:s,contexts:a,level:o,transactionName:l}=t;
8Object.keys(r).length&&(e.extra={...r,...e.extra}),Object.keys(i).length&&(e.tags={...i,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),l&&e.type!=="transaction"&&(e.transaction=l)}function Zv(e,t){const r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function e0(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function t0(e,t){e.contexts={trace:Cv(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:zv(t),...e.sdkProcessingMetadata};const r=Dm(t),i=Hc(r).description;i&&!e.transaction&&e.type==="transaction"&&(e.transaction=i)}function n0(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}let xn,gu,yu,Hn;function r0(e){const t=We._sentryDebugIds,r=We._debugIds;if(!t&&!r)return{};const i=t?Object.keys(t):[],s=r?Object.keys(r):[];if(Hn&&i.length===gu&&s.length===yu)return Hn;gu=i.length,yu=s.length,Hn={},xn||(xn={});const a=(o,l)=>{for(const c of o){const d=l[c],p=xn==null?void 0:xn[c];if(p&&Hn&&d)Hn[p[0]]=d,xn&&(xn[c]=[p[0],d]);else if(d){const h=e(c);for(let f=h.length-1;f>=0;f--){const m=h[f],y=m==null?void 0:m.filename;if(y&&Hn&&xn){Hn[y]=d,xn[c]=[y,d];break}}}}};return t&&a(i,t),r&&a(s,r),Hn}function i0(e,t,r,i,s,a){const{normalizeDepth:o=3,normalizeMaxBreadth:l=1e3}=e,c={...t,event_id:t.event_id||r.event_id||jt(),timestamp:t.timestamp||Os()},d=r.integrations||e.integrations.map(S=>S.name);s0(c,e),l0(c,d),s&&s.emit("applyFrameMetadata",t),t.type===void 0&&a0(c,e.stackParser);const p=d0(i,r.captureContext);r.mechanism&&Di(c,r.mechanism);const h=s?s.getEventProcessors():[],f=X_().getScopeData();if(a){const S=a.getScopeData();fu(f,S)}if(p){const S=p.getScopeData();fu(f,S)}const m=[...r.attachments||[],...f.attachments];m.length&&(r.attachments=m),Xv(c,f);const y=[...h,...f.eventProcessors];return Gv(y,c,r).then(S=>(S&&o0(S),typeof o=="number"&&o>0?c0(S,o,l):S))}function s0(e,t){var l,c;const{environment:r,release:i,dist:s,maxValueLength:a}=t;e.environment=e.environment||r||Wc,!e.release&&i&&(e.release=i),!e.dist&&s&&(e.dist=s);const o=e.request;o!=null&&o.url&&a&&(o.url=Gl(o.url,a)),a&&((c=(l=e.exception)==null?void 0:l.values)==null||c.forEach(d=>{d.value&&(d.value=Gl(d.value,a))}))}function a0(e,t){var i,s;const r=r0(t);(s=(i=e.exception)==null?void 0:i.values)==null||s.forEach(a=>{var o,l;(l=(o=a.stacktrace)==null?void 0:o.frames)==null||l.forEach(c=>{c.filename&&(c.debug_id=r[c.filename])})})}function o0(e){var i,s;const t={};if((s=(i=e.exception)==null?void 0:i.values)==null||s.forEach(a=>{var o,l;(l=(o=a.stacktrace)==null?void 0:o.frames)==null||l.forEach(c=>{c.debug_id&&(c.abs_path?t[c.abs_path]=c.debug_id:c.filename&&(t[c.filename]=c.debug_id),delete c.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const r=e.debug_meta.images;Object.entries(t).forEach(([a,o])=>{r.push({type:"sourcemap",code_file:a,debug_id:o})})}function l0(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function c0(e,t,r){var s,a;if(!e)return null;const i={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Mn(o.data,t,r)}}))},...e.user&&{user:Mn(e.user,t,r)},...e.contexts&&{contexts:Mn(e.contexts,t,r)},...e.extra&&{extra:Mn(e.extra,t,r)}};return(s=e.contexts)!=null&&s.trace&&i.contexts&&(i.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(i.contexts.trace.data=Mn(e.contexts.trace.data,t,r))),e.spans&&(i.spans=e.spans.map(o=>({...o,...o.data&&{data:Mn(o.data,t,r)}}))),(a=e.contexts)!=null&&a.flags&&i.contexts&&(i.contexts.flags=Mn(e.contexts.flags,3,r)),i}function d0(e,t){if(!t)return e;const r=e?e.clone():new On;return r.update(t),r}function u0(e,t){return ur().captureException(e,void 0)}function zm(e,t){return ur().captureEvent(e,t)}function h0(e,t){Hi().setContext(e,t)}function bu(e){const t=Hi(),r=ur(),{userAgent:i}=We.navigator||{},s=B_({user:r.getUser()||t.getUser(),...i&&{userAgent:i},...e}),a=t.getSession();return(a==null?void 0:a.status)==="ok"&&Ii(a,{status:"exited"}),Nm(),t.setSession(s),s}function Nm(){const e=Hi(),r=ur().getSession()||e.getSession();r&&q_(r),Lm(),e.setSession()}function Lm(){const e=Hi(),t=At(),r=e.getSession();r&&t&&t.captureSession(r)}function _u(e=!1){if(e){Nm();return}Lm()}const p0="7";function m0(e){const t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function f0(e){return`${m0(e)}${e.projectId}/envelope/`}function g0(e,t){const r={sentry_version:p0};return e.publicKey&&(r.sentry_key=e.publicKey),t&&(r.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(r).toString()}function y0(e,t,r){return t||`${f0(e)}?${g0(e,r)}`}const vu=[];function b0(e){const t={};return e.forEach(r=>{const{name:i}=r,s=t[i];s&&!s.isDefaultInstance&&r.isDefaultInstance||(t[i]=r)}),Object.values(t)}function _0(e){const t=e.defaultIntegrations||[],r=e.integrations;t.forEach(s=>{s.isDefaultInstance=!0});let i;if(Array.isArray(r))i=[...t,...r];else if(typeof r=="function"){const s=r(t);i=Array.isArray(s)?s:[s]}else i=t;return b0(i)}function v0(e,t){const r={};return t.forEach(i=>
8{i&&Om(e,i,r)}),r}function wu(e,t){for(const r of t)r!=null&&r.afterAllSetup&&r.afterAllSetup(e)}function Om(e,t,r){if(r[t.name]){Pe&&ve.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,!vu.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),vu.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const i=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,a)=>i(s,a,e))}if(typeof t.processEvent=="function"){const i=t.processEvent.bind(t),s=Object.assign((a,o)=>i(a,o,e),{id:t.name});e.addEventProcessor(s)}Pe&&ve.log(`Integration installed: ${t.name}`)}function w0(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function S0(e,t,r,i){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),r&&i&&(s.dsn=Us(i)),Wi(s,[w0(e)])}function Fm(e,t){const r=t??C0(e)??[];if(r.length===0)return;const i=e.getOptions(),s=S0(r,i._metadata,i.tunnel,e.getDsn());Um().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function C0(e){return Um().get(e)}function Um(){return Bi("clientToLogBufferMap",()=>new WeakMap)}function T0(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function x0(e,t,r,i){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),r&&i&&(s.dsn=Us(i)),Wi(s,[T0(e)])}function Bm(e,t){const r=t??k0(e)??[];if(r.length===0)return;const i=e.getOptions(),s=x0(r,i._metadata,i.tunnel,e.getDsn());qm().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function k0(e){return qm().get(e)}function qm(){return Bi("clientToMetricBufferMap",()=>new WeakMap)}const Qc=Symbol.for("SentryBufferFullError");function Vc(e=100){const t=new Set;function r(){return t.size<e}function i(o){t.delete(o)}function s(o){if(!r())return Yc(Qc);const l=o();return t.add(l),l.then(()=>i(l),()=>i(l)),l}function a(o){if(!t.size)return go(!0);const l=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return l;const c=[l,new Promise(d=>setTimeout(()=>d(!1),o))];return Promise.race(c)}return{get $(){return Array.from(t)},add:s,drain:a}}const E0=60*1e3;function P0(e,t=Date.now()){const r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;const i=Date.parse(`${e}`);return isNaN(i)?E0:i-t}function M0(e,t){return e[t]||e.all||0}function A0(e,t,r=Date.now()){return M0(e,t)>r}function D0(e,{statusCode:t,headers:r},i=Date.now()){const s={...e},a=r==null?void 0:r["x-sentry-rate-limits"],o=r==null?void 0:r["retry-after"];if(a)for(const l of a.trim().split(",")){const[c,d,,,p]=l.split(":",5),h=parseInt(c,10),f=(isNaN(h)?60:h)*1e3;if(!d)s.all=i+f;else for(const m of d.split(";"))m==="metric_bucket"?(!p||p.split(";").includes("custom"))&&(s[m]=i+f):s[m]=i+f}else o?s.all=i+P0(o,i):t===429&&(s.all=i+60*1e3);return s}const jm=64;function I0(e,t,r=Vc(e.bufferSize||jm)){let i={};const s=o=>r.drain(o);function a(o){const l=[];if(uu(o,(h,f)=>{const m=hu(f);A0(i,m)?e.recordDroppedEvent("ratelimit_backoff",m):l.push(h)}),l.length===0)return Promise.resolve({});const c=Wi(o[0],l),d=h=>{uu(c,(f,m)=>{e.recordDroppedEvent(h,hu(m))})},p=()=>t({body:qv(c)}).then(h=>(h.statusCode!==void 0&&(h.statusCode<200||h.statusCode>=300)&&Pe&&ve.warn(`Sentry responded with status code ${h.statusCode} to sent event.`),i=D0(i,h),h),h=>{throw d("network_error"),Pe&&ve.error("Encountered error running transport request:",h),h});return r.add(p).then(h=>h,h=>{if(h===Qc)return Pe&&ve.error("Skipped sending event because buffer is full."),d("queue_overflow"),Promise.resolve({});throw h})}return{send:a,flush:s}}function $0(e,t,r){const i=[{type:"client_report"},{timestamp:Os(),discarded_events:e}];return Wi(t?{dsn:t}:{},[i])}function Hm(e){const t=[];e.message&&t.push(e.message);try{const r=e.exception.values[e.exception.values.length-1];r!=null&&r.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`))}catch{}return t}function R0(e){var c;const{trace_id:t,parent_span_id:r,span_id:i,status:s,origin:a,data:o,op:l}=((c=e.contexts)==null?void 0:c.trace)??{};return{data:o??{},description:e.transaction,op:l,parent_span_id:r,span_id:i??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:a,profile_id:o==null?void 0:o[km],exclusive_time:o==null?void 0:o[Em],measurements:e.measurements,is_segment:!0}}function z0(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[km]:e.profile_id},...e.exclusive_time&&{[Em]:e.exclusive_time}}}},measurements:e.measurements}}const Su="Not capturing exception because it's already been captured.",Cu="Discarded session because of missing or non-string release",Wm=Symbol.for("SentryInternalError"),Ym=Symbol.for("SentryDoNotSendEventError"),N0=5e3;function da(e){return{message:e,[Wm]:!0}}function dl(e){return{message:e,[Ym]:!0}}function Tu(e){return!!e&&typeof e=="object"&&Wm in e}function xu(e){return!!e&&typeof e=="object"&&Ym in e}function ku(e,t,r,i,s){let a=0,o,l=!1;e.on(r,()=>{a=0,clearTimeout(o),l=!1}),e.on(t,c=>{a+=i(c),a>=8e5?s(e):l||(l=!0,o=setTimeout(()=>{s(e)},N0))}),e.on("flush",()=>{s(e)})}class L0{constructor(t){var i,s,a;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Vc(((i=t.transportOptions)==null?void 0:i.bufferSize)??jm),t.dsn?this._dsn=wv(t.dsn):Pe&&ve.warn("No DSN provided, client will not send events."),this._dsn){const o=y0(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:o})}this._options.enableLogs=this._options.enableLogs??((s=this._options._experiments)==null?void 0:s.enableLogs),this._options.enableLogs&&ku(this,"afterCaptureLog","flushLogs",B0,Fm),(this._options.enableMetrics??((a=this._options._experiments)==null?void 0:a.enableMetrics)??!0)&&ku(this,"afterCaptureMetric","flushMetrics",U0,Bm)}captureException(t,r,i){const s=jt();if(Jd(t))return Pe&&ve.log(Su),s;const a={event_id:s,...r};return this._process(()=>this.eventFromException(t,a).then(o=>this._captureEvent(o,a,i)).then(o=>o),"error"),a.event_id}captureMessage(t,r,i,s){const a={event_id:jt(),...i},o=Fc(t)?t:String(t),l=po(t),c=l?this.eventFromMessage(o,r,a):this.eventFromException(t,a);return this._process(()=>c.then(d=>this._captureEvent(d,a,s)),l?"unknown":"error"),a.event_id}captureEvent(t,r,i){const s=jt();if(r!=null&&r.originalException&&Jd(r.originalException))return Pe&&ve.log(Su),s;const a={event_id:s,...r},o=t.sdkProcessingMetadata||{},l=o.capturedSpanScope,c=o.capturedSpanIsolationScope,d=Eu(t.type);return this._process(()=>this._captureEvent(t,a,l||i,c),d),a.event_id}captureSession(t){this.sendSession(t),Ii(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const r=this._transport;if(!r)return!0;
8this.emit("flush");const i=await this._isClientDoneProcessing(t),s=await r.flush(t);return i&&s}async close(t){const r=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),r}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const r=this._integrations[t.name];Om(this,t,this._integrations),r||wu(this,[t])}sendEvent(t,r={}){this.emit("beforeSendEvent",t,r);let i=Kv(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of r.attachments||[])i=Bv(i,Hv(s));this.sendEnvelope(i).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:r,environment:i=Wc}=this._options;if("aggregates"in t){const a=t.attrs||{};if(!a.release&&!r){Pe&&ve.warn(Cu);return}a.release=a.release||r,a.environment=a.environment||i,t.attrs=a}else{if(!t.release&&!r){Pe&&ve.warn(Cu);return}t.release=t.release||r,t.environment=t.environment||i}this.emit("beforeSendSession",t);const s=Vv(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(t,r,i=1){if(this._options.sendClientReports){const s=`${t}:${r}`;Pe&&ve.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}on(t,r){const i=this._hooks[t]=this._hooks[t]||new Set,s=(...a)=>r(...a);return i.add(s),()=>{i.delete(s)}}emit(t,...r){const i=this._hooks[t];i&&i.forEach(s=>s(...r))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(r){return Pe&&ve.error("Error while sending envelope:",r),{}}return Pe&&ve.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=v0(this,t),wu(this,t)}_updateSessionFromEvent(t,r){var c,d;let i=r.level==="fatal",s=!1;const a=(c=r.exception)==null?void 0:c.values;if(a){s=!0,i=!1;for(const p of a)if(((d=p.mechanism)==null?void 0:d.handled)===!1){i=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&i)&&(Ii(t,{...i&&{status:"crashed"},errors:t.errors||Number(s||i)}),this.captureSession(t))}async _isClientDoneProcessing(t){let r=0;for(;!t||r<t;){if(await new Promise(i=>setTimeout(i,1)),!this._numProcessing)return!0;r++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,r,i,s){const a=this.getOptions(),o=Object.keys(this._integrations);return!r.integrations&&(o!=null&&o.length)&&(r.integrations=o),this.emit("preprocessEvent",t,r),t.type||s.setLastEventId(t.event_id||r.event_id),i0(a,t,r,i,this,s).then(l=>{if(l===null)return l;this.emit("postprocessEvent",l,r),l.contexts={trace:Z_(i),...l.contexts};const c=Rv(this,i);return l.sdkProcessingMetadata={dynamicSamplingContext:c,...l.sdkProcessingMetadata},l})}_captureEvent(t,r={},i=ur(),s=Hi()){return Pe&&nc(t)&&ve.log(`Captured error event \`${Hm(t)[0]||"<unknown>"}\``),this._processEvent(t,r,i,s).then(a=>a.event_id,a=>{Pe&&(xu(a)?ve.log(a.message):Tu(a)?ve.warn(a.message):ve.warn(a))})}_processEvent(t,r,i,s){const a=this.getOptions(),{sampleRate:o}=a,l=Qm(t),c=nc(t),p=`before send for type \`${t.type||"error"}\``,h=typeof o>"u"?void 0:Sv(o);if(c&&typeof h=="number"&&Math.random()>h)return this.recordDroppedEvent("sample_rate","error"),Yc(dl(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=Eu(t.type);return this._prepareEvent(t,r,i,s).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",f),dl("An event processor returned `null`, will not send event.");if(r.data&&r.data.__sentry__===!0)return m;const b=F0(this,a,m,r);return O0(b,p)}).then(m=>{var S;if(m===null){if(this.recordDroppedEvent("before_send",f),l){const w=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",w)}throw dl(`${p} returned \`null\`, will not send event.`)}const y=i.getSession()||s.getSession();if(c&&y&&this._updateSessionFromEvent(y,m),l){const k=((S=m.sdkProcessingMetadata)==null?void 0:S.spanCountBeforeProcessing)||0,w=m.spans?m.spans.length:0,T=k-w;T>0&&this.recordDroppedEvent("before_send","span",T)}const b=m.transaction_info;if(l&&b&&m.transaction!==t.transaction){const k="custom";m.transaction_info={...b,source:k}}return this.sendEvent(m,r),m}).then(null,m=>{throw xu(m)||Tu(m)?m:(this.captureException(m,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:m}),da(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
9Reason: ${m}`))})}_process(t,r){this._numProcessing++,this._promiseBuffer.add(t).then(i=>(this._numProcessing--,i),i=>(this._numProcessing--,i===Qc&&this.recordDroppedEvent("queue_overflow",r),i))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([r,i])=>{const[s,a]=r.split(":");return{reason:s,category:a,quantity:i}})}_flushOutcomes(){Pe&&ve.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Pe&&ve.log("No outcomes to send");return}if(!this._dsn){Pe&&ve.log("No dsn provided, will not send outcomes");return}Pe&&ve.log("Sending outcomes:",t);const r=$0(t,this._options.tunnel&&Us(this._dsn));this.sendEnvelope(r)}}function Eu(e){return e==="replay_event"?"replay":e||"error"}function O0(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Ls(e))return e.then(i=>{if(!bs(i)&&i!==null)throw da(r);return i},i=>{throw da(`${t} rejected with ${i}`)});if(!bs(e)&&e!==null)throw da(r);return e}function F0(e,t,r,i){const{beforeSend:s,beforeSendTransaction:a,beforeSendSpan:o,ignoreSpans:l}=t;
9let c=r;if(nc(c)&&s)return s(c,i);if(Qm(c)){if(o||l){const d=R0(c);if(l!=null&&l.length&&du(d,l))return null;if(o){const p=o(d);p?c=Fs(r,z0(p)):lu()}if(c.spans){const p=[],h=c.spans;for(const m of h){if(l!=null&&l.length&&du(m,l)){Dv(h,m);continue}if(o){const y=o(m);y?p.push(y):(lu(),p.push(m))}else p.push(m)}const f=c.spans.length-p.length;f&&e.recordDroppedEvent("before_send","span",f),c.spans=p}}if(a){if(c.spans){const d=c.spans.length;c.sdkProcessingMetadata={...r.sdkProcessingMetadata,spanCountBeforeProcessing:d}}return a(c,i)}}return c}function nc(e){return e.type===void 0}function Qm(e){return e.type==="transaction"}function U0(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Vm(e.attributes)}function B0(e){let t=0;return e.message&&(t+=e.message.length*2),t+Vm(e.attributes)}function Vm(e){if(!e)return 0;let t=0;return Object.values(e).forEach(r=>{Array.isArray(r)?t+=r.length*Pu(r[0]):po(r)?t+=Pu(r):t+=100}),t}function Pu(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function q0(e,t){t.debug===!0&&(Pe?ve.enable():qi(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),ur().update(t.initialScope);const i=new e(t);return j0(i),i.init(),i}function j0(e){ur().setClient(e)}function ul(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const r=t[6]||"",i=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:i,relative:t[5]+r+i}}function H0(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Km(e,t,r=[t],i="npm"){const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:r.map(a=>({name:`${i}:@sentry/${a}`,version:Mr})),version:Mr}),e._metadata=s}const W0=100;function Ur(e,t){const r=At(),i=Hi();if(!r)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:a=W0}=r.getOptions();if(a<=0)return;const l={timestamp:Os(),...e},c=s?qi(()=>s(l,t)):l;c!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",c,t),i.addBreadcrumb(c,a))}let Mu;const Y0="FunctionToString",Au=new WeakMap,Q0=()=>({name:Y0,setupOnce(){Mu=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=qc(this),r=Au.has(At())&&t!==void 0?t:this;return Mu.apply(r,e)}}catch{}},setup(e){Au.set(e,!0)}}),V0=Q0,K0=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],G0="EventFilters",X0=(e={})=>{let t;return{name:G0,setup(r){const i=r.getOptions();t=Du(e,i)},processEvent(r,i,s){if(!t){const a=s.getOptions();t=Du(e,a)}return Z0(r,t)?null:r}}},J0=(e={})=>({...X0(e),name:"InboundFilters"});function Du(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:K0],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Z0(e,t){if(e.type){if(e.type==="transaction"&&tw(e,t.ignoreTransactions))return Pe&&ve.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
10Event: ${br(e)}`),!0}else{if(ew(e,t.ignoreErrors))return Pe&&ve.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
11Event: ${br(e)}`),!0;if(sw(e))return Pe&&ve.warn(`Event dropped due to not having an error message, error type or stacktrace.
12Event: ${br(e)}`),!0;if(nw(e,t.denyUrls))return Pe&&ve.warn(`Event dropped due to being matched by \`denyUrls\` option.
13Event: ${br(e)}.
14Url: ${Da(e)}`),!0;if(!rw(e,t.allowUrls))return Pe&&ve.warn(`Event dropped due to not being matched by \`allowUrls\` option.
15Event: ${br(e)}.
16Url: ${Da(e)}`),!0}return!1}function ew(e,t){return t!=null&&t.length?Hm(e).some(r=>fo(r,t)):!1}function tw(e,t){if(!(t!=null&&t.length))return!1;const r=e.transaction;return r?fo(r,t):!1}
vendor: 6,169 bytes, line 16
16function nw(e,t){if(!(t!=null&&t.length))return!1;const r=Da(e);return r?fo(r,t):!1}function rw(e,t){if(!(t!=null&&t.length))return!0;const r=Da(e);return r?fo(r,t):!0}function iw(e=[]){for(let t=e.length-1;t>=0;t--){const r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Da(e){var t,r;try{const i=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(a=>{var o,l,c;return((o=a.mechanism)==null?void 0:o.parent_id)===void 0&&((c=(l=a.stacktrace)==null?void 0:l.frames)==null?void 0:c.length)}),s=(r=i==null?void 0:i.stacktrace)==null?void 0:r.frames;return s?iw(s):null}catch{return Pe&&ve.error(`Cannot extract url for event ${br(e)}`),null}}function sw(e){var t,r;return(r=(t=e.exception)==null?void 0:t.values)!=null&&r.length?!e.message&&!e.exception.values.some(i=>i.stacktrace||i.type&&i.type!=="Error"||i.value):!1}function aw(e,t,r,i,s,a){var l;if(!((l=s.exception)!=null&&l.values)||!a||!cr(a.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=rc(e,t,i,a.originalException,r,s.exception.values,o,0))}function rc(e,t,r,i,s,a,o,l){if(a.length>=r+1)return a;let c=[...a];if(cr(i[s],Error)){Iu(o,l);const d=e(t,i[s]),p=c.length;$u(d,s,p,l),c=rc(e,t,r,i[s],s,[d,...c],d,p)}return Array.isArray(i.errors)&&i.errors.forEach((d,p)=>{if(cr(d,Error)){Iu(o,l);const h=e(t,d),f=c.length;$u(h,`errors[${p}]`,f,l),c=rc(e,t,r,d,s,[h,...c],h,f)}}),c}function Iu(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function $u(e,t,r,i){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:i}}function ow(e){const t="console";Hr(t,e),Wr(t,lw)}function lw(){"console"in We&&g_.forEach(function(e){e in We.console&&Nt(We.console,e,function(t){return Aa[e]=t,function(...r){Jt("console",{args:r,level:e});const s=Aa[e];s==null||s.apply(We.console,r)}})})}function cw(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const dw="Dedupe",uw=()=>{let e;return{name:dw,processEvent(t){if(t.type)return t;try{if(pw(t,e))return Pe&&ve.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},hw=uw;function pw(e,t){return t?!!(mw(e,t)||fw(e,t)):!1}function mw(e,t){const r=e.message,i=t.message;return!(!r&&!i||r&&!i||!r&&i||r!==i||!Xm(e,t)||!Gm(e,t))}function fw(e,t){const r=Ru(t),i=Ru(e);return!(!r||!i||r.type!==i.type||r.value!==i.value||!Xm(e,t)||!Gm(e,t))}function Gm(e,t){let r=Yd(e),i=Yd(t);if(!r&&!i)return!0;if(r&&!i||!r&&i||(r=r,i=i,i.length!==r.length))return!1;for(let s=0;s<i.length;s++){const a=i[s],o=r[s];if(a.filename!==o.filename||a.lineno!==o.lineno||a.colno!==o.colno||a.function!==o.function)return!1}return!0}function Xm(e,t){let r=e.fingerprint,i=t.fingerprint;if(!r&&!i)return!0;if(r&&!i||!r&&i)return!1;r=r,i=i;try{return r.join("")===i.join("")}catch{return!1}}function Ru(e){var t,r;return(r=(t=e.exception)==null?void 0:t.values)==null?void 0:r[0]}function Jm(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const vs=We;function gw(){return"history"in vs&&!!vs.history}function yw(){if(!("fetch"in vs))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ic(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function bw(){var r;if(typeof EdgeRuntime=="string")return!0;if(!yw())return!1;if(ic(vs.fetch))return!0;let e=!1;const t=vs.document;if(t&&typeof t.createElement=="function")try{const i=t.createElement("iframe");i.hidden=!0,t.head.appendChild(i),(r=i.contentWindow)!=null&&r.fetch&&(e=ic(i.contentWindow.fetch)),t.head.removeChild(i)}catch(i){Pe&&ve.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return e}function _w(e,t){const r="fetch";Hr(r,e),Wr(r,()=>vw(void 0,t))}function vw(e,t=!1){t&&!bw()||Nt(We,"fetch",function(r){return function(...i){const s=new Error,{method:a,url:o}=ww(i),l={args:i,fetchData:{method:a,url:o},startTimestamp:Rn()*1e3,virtualError:s,headers:Sw(i)};return Jt("fetch",{...l}),r.apply(We,i).then(async c=>(Jt("fetch",{...l,endTimestamp:Rn()*1e3,response:c}),c),c=>{if(Jt("fetch",{...l,endTimestamp:Rn()*1e3,error:c}),Oc(c)&&c.stack===void 0&&(c.stack=s.stack,Fr(c,"framesToPop",1)),c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{const d=new URL(l.fetchData.url);c.message=`${c.message} (${d.host})`}catch{}throw c})}})}function ua(e,t){return!!e&&typeof e=="object"&&!!e[t]}function zu(e){return typeof e=="string"?e:e?ua(e,"url")?e.url:e.toString?e.toString():"":""}function ww(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[r,i]=e;return{url:zu(r),method:ua(i,"method")?String(i.method).toUpperCase():_m(r)&&ua(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:zu(t),method:ua(t,"method")?String(t.method).toUpperCase():"GET"}}function Sw(e){const[t,r]=e;try{if(typeof r=="object"&&r!==null&&"headers"in r&&r.headers)return new Headers(r.headers);if(_m(t))return new Headers(t.headers)}catch{}}function Cw(){return"npm"}const rt=We;let sc=0;function Zm(){return sc>0}function Tw(){sc++,setTimeout(()=>{sc--})}function Ri(e,t={}){function r(s){return typeof s=="function"}if(!r(e))return e;try{const s=e.__sentry_wrapped__;if(s)return typeof s=="function"?s:e;if(qc(e))return e}catch{return e}const i=function(...s){try{const a=s.map(o=>Ri(o,t));return e.apply(this,a)}catch(a){throw Tw(),J_(o=>{o.addEventProcessor(l=>(t.mechanism&&(Xl(l,void 0),Di(l,t.mechanism)),l.extra={...l.extra,arguments:s},l)),u0(a)}),a}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}catch{}wm(i,e),Fr(e,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get(){return e.name}})}catch{}return i}function xw(){const e=Bc(),{referrer:t}=rt.document||{},{userAgent:r}
16=rt.navigator||{},i={...t&&{Referer:t},...r&&{"User-Agent":r}};return{url:e,headers:i}}function Kc(e,t){const r=Gc(e,t),i={type:Aw(t),value:Dw(t)};return r.length&&(i.stacktrace={frames:r}),i.type===void 0&&i.value===""&&(i.value="Unrecoverable error caught"),i}function kw(e,t,r,i){const s=At(),a=s==null?void 0:s.getOptions().normalizeDepth,o=Nw(t),l={__serialized__:$m(t,a)};if(o)return{exception:{values:[Kc(e,o)]},extra:l};const c={exception:{values:[{type:mo(t)?t.constructor.name:i?"UnhandledRejection":"Error",value:Rw(t,{isUnhandledRejection:i})}]},extra:l};if(r){const d=Gc(e,r);d.length&&(c.exception.values[0].stacktrace={frames:d})}return c}function hl(e,t){return{exception:{values:[Kc(e,t)]}}}function Gc(e,t){const r=t.stacktrace||t.stack||"",i=Pw(t),s=Mw(t);try{return e(r,i,s)}catch{}return[]}const Ew=/Minified React error #\d+;/i;function Pw(e){return e&&Ew.test(e.message)?1:0}function Mw(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function ef(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function Aw(e){const t=e==null?void 0:e.name;return!t&&ef(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function Dw(e){const t=e==null?void 0:e.message;return ef(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function Iw(e,t,r,i){const s=(r==null?void 0:r.syntheticException)||void 0,a=Xc(e,t,s,i);return Di(a),a.level="error",r!=null&&r.event_id&&(a.event_id=r.event_id),go(a)}function $w(e,t,r="info",i,s){const a=(i==null?void 0:i.syntheticException)||void 0,o=ac(e,t,a,s);return o.level=r,i!=null&&i.event_id&&(o.event_id=i.event_id),go(o)}function Xc(e,t,r,i,s){let a;if(ym(t)&&t.error)return hl(e,t.error);if(Vd(t)||M_(t)){const o=t;if("stack"in t)a=hl(e,t);else{const l=o.name||(Vd(o)?"DOMError":"DOMException"),c=o.message?`${l}: ${o.message}`:l;a=ac(e,c,r,i),Xl(a,c)}return"code"in o&&(a.tags={...a.tags,"DOMException.code":`${o.code}`}),a}return Oc(t)?hl(e,t):bs(t)||mo(t)?(a=kw(e,t,r,s),Di(a,{synthetic:!0}),a):(a=ac(e,t,r,i),Xl(a,`${t}`),Di(a,{synthetic:!0}),a)}function ac(e,t,r,i){const s={};if(i&&r){const a=Gc(e,r);a.length&&(s.exception={values:[{value:t,stacktrace:{frames:a}}]}),Di(s,{synthetic:!0})}if(Fc(t)){const{__sentry_template_string__:a,__sentry_template_values__:o}=t;return s.logentry={message:a,params:o},s}return s.message=t,s}function Rw(e,{isUnhandledRejection:t}){const r=N_(e),i=t?"promise rejection":"exception";return ym(e)?`Event \`ErrorEvent\` captured as ${i} with message \`${e.message}\``:mo(e)?`Event \`${zw(e)}\` (type=${e.type}) captured as ${i}`:`Object captured as ${i} with keys: ${r}`}function zw(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Nw(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];if(r instanceof Error)return r}}class Lw extends L0{constructor(t){var p;const r=Ow(t),i=rt.SENTRY_SDK_SOURCE||Cw();Km(r,"browser",["browser"],i),(p=r._metadata)!=null&&p.sdk&&(r._metadata.sdk.settings={infer_ip:r.sendDefaultPii?"auto":"never",...r._metadata.sdk.settings}),super(r);const{sendDefaultPii:s,sendClientReports:a,enableLogs:o,_experiments:l,enableMetrics:c}=this._options,d=c??(l==null?void 0:l.enableMetrics)??!0;rt.document&&(a||o||d)&&rt.document.addEventListener("visibilitychange",()=>{rt.document.visibilityState==="hidden"&&(a&&this._flushOutcomes(),o&&Fm(this),d&&Bm(this))}),s&&this.on("beforeSendSession",H0)}eventFromException(t,r){return Iw(this._options.stackParser,t,r,this._options.attachStacktrace)}eventFromMessage(t,r="info",i){return $w(this._options.stackParser,t,r,i,this._options.attachStacktrace)}_prepareEvent(t,r,i,s){return t.platform=t.platform||"javascript",super._prepareEvent(t,r,i,s)}}function Ow(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=rt.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Fw=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Pt=We,Uw=1e3;let Nu,oc,lc;function Bw(e){const t="dom";Hr(t,e),Wr(t,qw)}function qw(){if(!Pt.document)return;const e=Jt.bind(null,"dom"),t=Lu(e,!0);Pt.document.addEventListener("click",t,!1),Pt.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{var a,o;const s=(a=Pt[r])==null?void 0:a.prototype;(o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener")&&(Nt(s,"addEventListener",function(l){return function(c,d,p){if(c==="click"||c=="
16keypress")try{const h=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=h[c]=h[c]||{refCount:0};if(!f.handler){const m=Lu(e);f.handler=m,l.call(this,c,m,p)}f.refCount++}catch{}return l.call(this,c,d,p)}}),Nt(s,"removeEventListener",function(l){return function(c,d,p){if(c==="click"||c=="keypress")try{const h=this.__sentry_instrumentation_handlers__||{},f=h[c];f&&(f.refCount--,f.refCount<=0&&(l.call(this,c,f.handler,p),f.handler=void 0,delete h[c]),Object.keys(h).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return l.call(this,c,d,p)}}))})}function jw(e){if(e.type!==oc)return!1;try{if(!e.target||e.target._sentryId!==lc)return!1}catch{}return!0}function Hw(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Lu(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;const i=Ww(r);if(Hw(r.type,i))return;Fr(r,"_sentryCaptured",!0),i&&!i._sentryId&&Fr(i,"_sentryId",jt());const s=r.type==="keypress"?"input":r.type;jw(r)||(e({event:r,name:s,global:t}),oc=r.type,lc=i?i._sentryId:void 0),clearTimeout(Nu),Nu=Pt.setTimeout(()=>{lc=void 0,oc=void 0},Uw)}}function Ww(e){try{return e.target}catch{return null}}let Zs;function tf(e){const t="history";Hr(t,e),Wr(t,Yw)}function Yw(){if(Pt.addEventListener("popstate",()=>{const t=Pt.location.href,r=Zs;if(Zs=t,r===t)return;Jt("history",{from:r,to:t})}),!gw())return;function e(t){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=Zs,a=Qw(String(i));if(Zs=a,s===a)return t.apply(this,r);Jt("history",{from:s,to:a})}return t.apply(this,r)}}Nt(Pt.history,"pushState",e),Nt(Pt.history,"replaceState",e)}function Qw(e){try{return new URL(e,Pt.location.origin).toString()}catch{return e}}const ha={};function Vw(e){const t=ha[e];if(t)return t;let r=Pt[e];if(ic(r))return ha[e]=r.bind(Pt);const i=Pt.document;if(i&&typeof i.createElement=="function")try{const s=i.createElement("iframe");s.hidden=!0,i.head.appendChild(s);const a=s.contentWindow;a!=null&&a[e]&&(r=a[e]),i.head.removeChild(s)}catch(s){Fw&&ve.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return r&&(ha[e]=r.bind(Pt))}function Kw(e){ha[e]=void 0}const as="__sentry_xhr_v3__";function Gw(e){const t="xhr";Hr(t,e),Wr(t,Xw)}function Xw(){if(!Pt.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,r,i){const s=new Error,a=Rn()*1e3,o=$n(i[0])?i[0].toUpperCase():void 0,l=Jw(i[1]);if(!o||!l)return t.apply(r,i);r[as]={method:o,url:l,request_headers:{}},o==="POST"&&l.match(/sentry_key/)&&(r.__sentry_own_request__=!0);const c=()=>{const d=r[as];if(d&&r.readyState===4){try{d.status_code=r.status}catch{}const p={endTimestamp:Rn()*1e3,startTimestamp:a,xhr:r,virtualError:s};Jt("xhr",p)}};return"onreadystatechange"in r&&typeof r.onreadystatechange=="function"?r.onreadystatechange=new Proxy(r.onreadystatechange,{apply(d,p,h){return c(),d.apply(p,h)}}):r.addEventListener("readystatechange",c),r.setRequestHeader=new Proxy(r.setRequestHeader,{apply(d,p,h){const[f,m]=h,y=p[as];return y&&$n(f)&&$n(m)&&(y.request_headers[f.toLowerCase()]=m),d.apply(p,h)}}),t.apply(r,i)}}),e.send=new Proxy(e.send,{apply(t,r,i){const s=r[as];if(!s)return t.apply(r,i);i[0]!==void 0&&(s.body=i[0]);const a={startTimestamp:Rn()*1e3,xhr:r};return Jt("xhr",a),t.apply(r,i)}})}function Jw(e){if($n(e))return e;try{return e.toString()}catch{}}const Zw=40;function eS(e,t=Vw("fetch")){let r=0,i=0;async function s(a){const o=a.body.length;r+=o,i++;const l={body:a.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:r<=6e4&&i<15,...e.fetchOptions};try{const c=await t(e.url,l);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw Kw("fetch"),c}finally{r-=o,i--}}return I0(e,s,Vc(e.bufferSize||Zw))}const yo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,tS=30,nS=50;function cc(e,t,r,i){const s={filename:e,function:t==="<anonymous>"?Or:t,in_app:!0};return r!==void 0&&(s.lineno=r),i!==void 0&&(s.colno=i),s}const rS=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,iS=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,sS=/\((\S*)(?::(\d+))(?::(\d+))\)/,aS=/at (.+?) ?\(data:(.+?),/,oS=e=>{const t=e.match(aS);
vendor: 4,830 bytes, line 16
16if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const r=rS.exec(e);if(r){const[,s,a,o]=r;return cc(s,Or,+a,+o)}const i=iS.exec(e);if(i){if(i[2]&&i[2].indexOf("eval")===0){const l=sS.exec(i[2]);l&&(i[2]=l[1],i[3]=l[2],i[4]=l[3])}const[a,o]=nf(i[1]||Or,i[2]);return cc(o,a,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},lS=[tS,oS],cS=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,dS=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,uS=e=>{const t=cS.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=dS.exec(t[3]);a&&(t[1]=t[1]||"eval",t[3]=a[1],t[4]=a[2],t[5]="")}let i=t[3],s=t[1]||Or;return[s,i]=nf(s,i),cc(i,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},hS=[nS,uS],pS=[lS,hS],mS=mm(...pS),nf=(e,t)=>{const r=e.indexOf("safari-extension")!==-1,i=e.indexOf("safari-web-extension")!==-1;return r||i?[e.indexOf("@")!==-1?e.split("@")[0]:Or,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},ea=1024,fS="Breadcrumbs",gS=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:fS,setup(r){t.console&&ow(vS(r)),t.dom&&Bw(_S(r,t.dom)),t.xhr&&Gw(wS(r)),t.fetch&&_w(SS(r)),t.history&&tf(CS(r)),t.sentry&&r.on("beforeSendEvent",bS(r))}}},yS=gS;function bS(e){return function(r){At()===e&&Ur({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:br(r)},{event:r})}}function _S(e,t){return function(i){if(At()!==e)return;let s,a,o=typeof t=="object"?t.serializeAttribute:void 0,l=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;l&&l>ea&&(yo&&ve.warn(`\`dom.maxStringLength\` cannot exceed ${ea}, but a value of ${l} was configured. Sentry will use ${ea} instead.`),l=ea),typeof o=="string"&&(o=[o]);try{const d=i.event,p=TS(d)?d.target:d;s=vm(p,{keyAttrs:o,maxStringLength:l}),a=z_(p)}catch{s="<unknown>"}if(s.length===0)return;const c={category:`ui.${i.name}`,message:s};a&&(c.data={"ui.component_name":a}),Ur(c,{event:i.event,name:i.name,global:i.global})}}function vS(e){return function(r){if(At()!==e)return;const i={category:"console",data:{arguments:r.args,logger:"console"},level:cw(r.level),message:Xd(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)i.message=`Assertion failed: ${Xd(r.args.slice(1)," ")||"console.assert"}`,i.data.arguments=r.args.slice(1);else return;Ur(i,{input:r.args,level:r.level})}}function wS(e){return function(r){if(At()!==e)return;const{startTimestamp:i,endTimestamp:s}=r,a=r.xhr[as];if(!i||!s||!a)return;const{method:o,url:l,status_code:c,body:d}=a,p={method:o,url:l,status_code:c},h={xhr:r.xhr,input:d,startTimestamp:i,endTimestamp:s},f={category:"xhr",data:p,type:"http",level:Jm(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,h),Ur(f,h)}}function SS(e){return function(r){if(At()!==e)return;const{startTimestamp:i,endTimestamp:s}=r;if(s&&!(r.fetchData.url.match(/sentry_key/)&&r.fetchData.method==="POST"))if(r.fetchData.method,r.fetchData.url,r.error){const a=r.fetchData,o={data:r.error,input:r.args,startTimestamp:i,endTimestamp:s},l={category:"fetch",data:a,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",l,o),Ur(l,o)}else{const a=r.response,o={...r.fetchData,status_code:a==null?void 0:a.status};r.fetchData.request_body_size,r.fetchData.response_body_size,a==null||a.status;const l={input:r.args,response:a,startTimestamp:i,endTimestamp:s},c={category:"fetch",data:o,type:"http",level:Jm(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,l),Ur(c,l)}}}function CS(e){return function(r){if(At()!==e)return;let i=r.from,s=r.to;const a=ul(rt.location.href);let o=i?ul(i):void 0;const l=ul(s);o!=null&&o.path||(o=a),a.protocol===l.protocol&&a.host===l.host&&(s=l.relative),a.protocol===o.protocol&&a.host===o.host&&(i=o.relative),Ur({category:"navigation",data:{from:i,to:s}})}}function TS(e){return!!e&&!!e.target}const xS=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],kS="BrowserApiErrors",ES=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:kS,setupOnce(){t.setTimeout&&Nt(rt,"setTimeout",Ou),t.setInterval&&Nt(rt,"setInterval",Ou),t.requestAnimationFrame&&Nt(rt,"requestAnimationFrame",MS),t.XMLHttpRequest&&"XMLHttpRequest"in rt&&Nt(XMLHttpRequest.prototype,"send",AS);const r=t.eventTarget;
16r&&(Array.isArray(r)?r:xS).forEach(s=>DS(s,t))}}},PS=ES;function Ou(e){return function(...t){const r=t[0];return t[0]=Ri(r,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${lr(e)}`}}),e.apply(this,t)}}function MS(e){return function(t){return e.apply(this,[Ri(t,{mechanism:{data:{handler:lr(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function AS(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in r&&typeof r[s]=="function"&&Nt(r,s,function(a){const o={mechanism:{data:{handler:lr(a)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},l=qc(a);return l&&(o.mechanism.data.handler=lr(l)),Ri(a,o)})}),e.apply(this,t)}}function DS(e,t){var s,a;const i=(s=rt[e])==null?void 0:s.prototype;(a=i==null?void 0:i.hasOwnProperty)!=null&&a.call(i,"addEventListener")&&(Nt(i,"addEventListener",function(o){return function(l,c,d){try{IS(c)&&(c.handleEvent=Ri(c.handleEvent,{mechanism:{data:{handler:lr(c),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&$S(this,l,c),o.apply(this,[l,Ri(c,{mechanism:{data:{handler:lr(c),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),d])}}),Nt(i,"removeEventListener",function(o){return function(l,c,d){try{const p=c.__sentry_wrapped__;p&&o.call(this,l,p,d)}catch{}return o.call(this,l,c,d)}}))}function IS(e){return typeof e.handleEvent=="function"}function $S(e,t,r){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,r)}const RS=()=>({name:"BrowserSession",setupOnce(){if(typeof rt.document>"u"){yo&&ve.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}bu({ignoreDuration:!0}),_u(),tf(({from:e,to:t})=>{e!==void 0&&e!==t&&(bu({ignoreDuration:!0}),_u())})}}),zS="GlobalHandlers",NS=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:zS,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&(OS(r),Fu("onerror")),t.onunhandledrejection&&(FS(r),Fu("onunhandledrejection"))}}},LS=NS;function OS(e){x_(t=>{const{stackParser:r,attachStacktrace:i}=rf();if(At()!==e||Zm())return;const{msg:s,url:a,line:o,column:l,error:c}=t,d=qS(Xc(r,c||s,void 0,i,!1),a,o,l);d.level="error",zm(d,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function FS(e){E_(t=>{const{stackParser:r,attachStacktrace:i}=rf();if(At()!==e||Zm())return;const s=US(t),a=po(s)?BS(s):Xc(r,s,void 0,i,!0);a.level="error",zm(a,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function US(e){if(po(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function BS(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function qS(e,t,r,i){const s=e.exception=e.exception||{},a=s.values=s.values||[],o=a[0]=a[0]||{},l=o.stacktrace=o.stacktrace||{},c=l.frames=l.frames||[],d=i,p=r,h=jS(t)??Bc();return c.length===0&&c.push({colno:d,filename:h,function:Or,in_app:!0,lineno:p}),e}function Fu(e){yo&&ve.log(`Global Handler attached: ${e}`)}function rf(){const e=At();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function jS(e){if(!(!$n(e)||e.length===0)){if(e.startsWith("data:")){const t=e.match(/^data:([^;]+)/),r=t?t[1]:"text/javascript",i=e.includes("base64,");return`<data:${r}${i?",base64":""}>`}return e}}const HS=()=>({name:"HttpContext",preprocessEvent(e){var i;if(!rt.navigator&&!rt.location&&!rt.document)return;const t=xw(),r={...t.headers,...(i=e.request)==null?void 0:i.headers};e.request={...t,...e.request,headers:r}}}),WS="cause",YS=5,QS="LinkedErrors",VS=(e={})=>{const t=e.limit||YS,r=e.key||WS;return{name:QS,preprocessEvent(i,s,a){const o=a.getOptions();aw(Kc,o.stackParser,r,t,i,s)}}},KS=VS;function GS(){return XS()?(yo&&qi(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function XS(){var a;if(typeof rt.window>"u")return!1;const e=rt;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((a=t==null?void 0:t.runtime)!=null&&a.id))return!1;const r=Bc(),i=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(rt===rt.top&&i.some(o=>r.startsWith(`${o}://`)))}function JS(e){return[J0(),V0(),PS(),yS(),LS(),KS(),hw(),HS(),RS()]}function ZS(e={}){const t=!e.skipBrowserExtensionCheck&&GS();let r=e.defaultIntegrations==null?JS():e.defaultIntegrations;const i={...e,enabled:t?!1:e.enabled,stackParser:C_(e.stackParser||mS),integrations:_0({integrations:e.integrations,defaultIntegrations:r}),transport:e.transport||eS};return q0(Lw,i)}function eC(e){const t={...e};return Km(t,"react"),h0("react",{version:_.version}),ZS(t)}const tC={conversation_members_only:{en:"Community access",ru:"Доступ к сообществу",es:"Acceso a la comunidad"}
16,conversation_reason_login:{en:"Log in to access full capabilities of the platform",ru:"Войдите, чтобы получить доступ ко всем возможностям платформы",es:"Inicia sesión para acceder a todas las funciones de la plataforma"},conversation_reason_banned:{en:"You are banned from this chat.",ru:"Вы заблокированы в этом чате.",es:"Se te ha bloqueado el acceso a este chat."},conversation_reason_permission:{en:"CHAT permission is required to send messages.",ru:"Для отправки сообщений нужно разрешение CHAT.",es:"Necesitas el permiso CHAT para enviar mensajes."},conversation_reason_spending:{en:"Earn or spend {{amount}} to be able to send messages.",ru:"Заработайте или потратьте {{amount}}, чтобы отправлять сообщения.",es:"Gana o gasta {{amount}} para poder enviar mensajes."},conversation_reason_denied:{en:"You do not have access to this conversation.",ru:"У вас нет доступа к этому чату.",es:"No tienes acceso a esta conversación."},conversation_send_denied:{en:"You cannot send messages in this conversation.",ru:"Вы не можете отправлять сообщения в этот чат.",es:"No puedes enviar mensajes en esta conversación."},conversation_check_access:{en:"Check access again",ru:"Проверить доступ снова",es:"Volver a comprobar el acceso"},conversation_retry:{en:"Try again",ru:"Повторить",es:"Reintentar"},conversation_summary_error:{en:"Could not check chat access. Please try again.",ru:"Не удалось проверить доступ к чату. Попробуйте ещё раз.",es:"No se pudo comprobar el acceso al chat. Inténtalo de nuevo."},conversation_history_error:{en:"Could not load this page of messages.",ru:"Не удалось загрузить эту страницу сообщений.",es:"No se pudo cargar esta página de mensajes."},conversation_navigation_error:{en:"Could not jump to that message. Please try the navigation button again.",ru:"Не удалось перейти к сообщению. Нажмите кнопку перехода ещё раз.",es:"No se pudo ir al mensaje. Pulsa de nuevo el botón de navegación."},conversation_read_error:{en:"Could not save your read position. Retrying while messages remain visible.",ru:"Не удалось сохранить прочитанное. Повторяем, пока сообщения видны.",es:"No se pudo guardar tu posición de lectura. Se reintentará mientras los mensajes estén visibles."},conversation_action_error:{en:"The action could not be completed. Please try again.",ru:"Не удалось выполнить действие. Попробуйте ещё раз.",es:"No se pudo completar la acción. Inténtalo de nuevo."},conversation_connection_error:{en:"Chat updates are temporarily unavailable. Reconnecting…",ru:"Обновления чата временно недоступны. Переподключение…",es:"Las actualizaciones del chat no están disponibles. Reconectando…"},conversation_deleted:{en:"Message deleted",ru:"Сообщение удалено",es:"Mensaje eliminado"},conversation_anonymous:{en:"Anonymous · online",ru:"Анонимно · в сети",es:"Anónimo · en línea"},conversation_open_quote:{en:"Go to quoted message",ru:"Перейти к цитируемому сообщению",es:"Ir al mensaje citado"},conversation_open_media:{en:"Open attachment {{index}}",ru:"Открыть вложение {{index}}",es:"Abrir archivo adjunto {{index}}"},conversation_copy_error:{en:"Could not copy the message.",ru:"Не удалось скопировать сообщение.",es:"No se pudo copiar el mensaje."},conversation_media_type_error:{en:"Only photos and videos can be attached.",ru:"Можно прикреплять только фото и видео.",es:"Solo se pueden adjuntar fotos y vídeos."},conversation_media_size_error:{en:"Each photo or video must be 100 MB or smaller. Your draft and existing attachments are unchanged.",ru:"Размер каждого фото или видео не должен превышать 100 МБ. Черновик и уже добавленные вложения не изменены.",es:"Cada foto o vídeo debe ocupar 100 MB o menos. El borrador y los archivos ya adjuntos no han cambiado."},conversation_media_limit:{en:"Attach up to 5 photos or videos per message.",ru:"К сообщению можно прикрепить до 5 фото или видео.",es:"Puedes adjuntar hasta 5 fotos o vídeos por mensaje."},conversation_remove_media:{en:"Remove attachment {{index}}",ru:"Убрать вложение {{index}}",es:"Quitar archivo adjunto {{index}}"},conversation_media_count:{en:"Attachments: {{count}} / 5 · Add an optional caption below.",ru:"Вложений: {{count}} / 5 · Ниже можно добавить подпись.",es:"Adjuntos: {{count}} / 5 · Puedes añadir un texto debajo."},conversation_upload_progress:{en:"Uploaded {{count}} of {{total}} · Sending…",ru:"Загружено {{count}} из {{total}} · Отправка…",es:"Subidos {{count}} de {{total}} · Enviando…"},conversation_caption:{en:"Add a caption…",ru:"Добавьте подпись…",es:"Añade un texto…"},conversation_send_error:{en:"Could not upload or send. Your draft and completed uploads are kept; try again.",ru:"Не удалось загрузить или отправить. Черновик и загруженные файлы сохранены — попробуйте снова.",es:"No se pudo subir o enviar. Se conservaron el borrador y los archivos subidos; inténtalo de nuevo."},conversation_settings_local:{en:"Appearance settings are saved on this device.",ru:"Настройки внешнего вида сохраняются на этом устройстве.",es:"Los ajustes de apariencia se guardan en este dispositivo."},conversation_missing_message:{en:"This message is no longer available. Showing nearby messages.",ru:"Сообщение больше недоступно. Показаны соседние сообщения.",es:"Este mensaje ya no está disponible. Se muestran mensajes cercanos."},conversation_load_older:{en:"Load older messages",ru:"Загрузить более ранние сообщения",es:"Cargar mensajes anteriores"},conversation_load_newer:{en:"Load newer messages",ru:"Загрузить более новые сообщения",es:"Cargar mensajes posteriores"},conversation_unread_boundary:{en:"Unread messages",ru:"Непрочитанные сообщения",es:"Mensajes sin leer"},conversation_unread_replies:{en:"Unread replies: {{count}}
16 · Go to next reply",ru:"Непрочитанных ответов: {{count}} · Перейти к следующему",es:"Respuestas sin leer: {{count}} · Ir a la siguiente"}},nC={argus_nav:{en:"Argus moderation",ru:"Модерация Argus",es:"Moderación Argus"},argus_warning_title:{en:"Oops!",ru:"Ой!",es:"¡Ups!"},argus_warning_body:{en:"It looks like your action may break the site's rules. Please follow the rules to help keep our community safe and friendly.",ru:"Кажется, это действие может нарушать правила сайта. Пожалуйста, соблюдайте правила, чтобы наше сообщество оставалось безопасным и дружелюбным.",es:"Parece que esta acción podría incumplir las reglas del sitio. Por favor, respétalas para mantener nuestra comunidad segura y amigable."},argus_dare_submitted:{en:"Submitted",ru:"Отправлено",es:"Enviado"},argus_warning_dismiss:{en:"I got it, thanks!",ru:"Понятно, спасибо!",es:"¡Entendido, gracias!"}
16,argus_subtitle:{en:"User policies, temporary pauses, directional pair exemptions and audit histories.",ru:"Правила пользователей, временные паузы, направленные исключения для пар и история изменений.",es:"Políticas de usuarios, pausas temporales, exenciones direccionales e historiales de cambios."},argus_loading:{en:"Loading Argus",ru:"Загрузка Argus",es:"Cargando Argus"},argus_access_denied:{en:"Access denied",ru:"Доступ запрещён",es:"Acceso denegado"},argus_staff_only:{en:"Argus controls are available to global moderators and administrators only.",ru:"Управление Argus доступно только глобальным модераторам и администраторам.",es:"Los controles de Argus solo están disponibles para moderadores globales y administradores."},argus_username_placeholder:{en:"Find a user by username",ru:"Поиск по имени пользователя",es:"Buscar por nombre de usuario"},argus_find:{en:"Find user",ru:"Найти",es:"Buscar usuario"},argus_policy_error:{en:"Could not load this user’s policy",ru:"Не удалось загрузить правила пользователя",es:"No se pudo cargar la política del usuario"},argus_retry:{en:"Try again",ru:"Повторить",es:"Reintentar"},argus_update_error:{en:"Change not saved",ru:"Изменение не сохранено",es:"Cambio no guardado"},argus_saved:{en:"Policy saved. The change has been recorded in the audit history.",ru:"Изменение сохранено и записано в историю.",es:"Política guardada. El cambio se ha registrado en el historial."},argus_sender_on:{en:"Sender policy: on",ru:"Исходящая модерация: вкл.",es:"Moderación saliente: sí"},argus_sender_off:{en:"Sender policy: off",ru:"Исходящая модерация: выкл.",es:"Moderación saliente: no"},argus_deposited:{en:"Has ever deposited",ru:"Были ли когда-либо пополнения",es:"Ha realizado depósitos alguna vez"},argus_yes:{en:"Yes",ru:"Да",es:"Sí"},argus_no:{en:"No",ru:"Нет",es:"No"},argus_last_30_days_topups:{en:"Positive top-ups (last 30 days)",ru:"Положительные пополнения за последние 30 дней",es:"Depósitos positivos (últimos 30 días)"},argus_automatic:{en:"Automatic moderation",ru:"Автоматическая модерация",es:"Moderación automática"},argus_required:{en:"Applies",ru:"Применяется",es:"Se aplica"},argus_exempt:{en:"Exempt",ru:"Не применяется",es:"Exento"},argus_automatic_hint:{en:"Automatic exemption requires at least $250 in positive top-ups over the rolling last 30 days. Older deposits stop counting toward this total as they leave this window, so moderation can apply again if the total falls below $250. Balance and recent spending do not affect this total. Future-dated deposits are excluded from this total. Blocked actions get a warning if any positive top-up has ever been recorded, regardless of its timestamp or the 30-day total. Only users with no positive top-up ever recorded are silently shadowed.",ru:"Автоматическое освобождение от модерации требует не менее $250 положительных пополнений за последние 30 дней (скользящее окно). Старые пополнения перестают учитываться в этой сумме по мере выхода из окна, поэтому при сумме ниже $250 модерация может возобновиться. Баланс и недавние траты не влияют на эту сумму. Пополнения с будущей датой не входят в эту сумму. Заблокированные действия сопровождаются предупреждением, если в истории есть хотя бы одно положительное пополнение, независимо от его даты и суммы за последние 30 дней. Только если положительных пополнений никогда не было, заблокированные действия скрываются без предупреждения.",es:"La exención automática requiere al menos $250 en depósitos positivos durante los últimos 30 días, en una ventana móvil. Los depósitos anteriores dejan de contar para este total al salir de esta ventana, por lo que la moderación puede volver a a
16plicarse si el total baja de $250. El saldo y los gastos recientes no afectan a este total. Los depósitos con fecha futura se excluyen de este total. Las acciones bloqueadas muestran una advertencia si alguna vez se ha registrado un depósito positivo, independientemente de su fecha o del total de los últimos 30 días. Solo se ocultan sin advertencia si nunca se ha registrado un depósito positivo."},argus_sender_status_hint:{en:"This status describes only the user’s own mode and sender pause, not pair exemptions. For a matching non-invite pair, political-only checks still run even when this status is off.",ru:"Статус описывает только режим и исходящую паузу пользователя, а не исключения для пар. Для совпавшей пары вне стрима по приглашению проверка на политику выполняется даже при выключенном статусе.",es:"Este estado solo describe el modo y la pausa del usuario, no las exenciones de pareja. Para una pareja coincidente fuera de un stream por invitación, las comprobaciones políticas siguen activas aunque este estado esté desactivado."},argus_user_history:{en:"View this user’s history",ru:"История этого пользователя",es:"Ver historial de este usuario"},argus_precedence_title:{en:"Pauses, modes and the pair exception",ru:"Паузы, режимы и исключения для пар",es:"Pausas, modos y la excepción de pareja"},argus_precedence:{en:"For ordinary policy evaluation, active pauses override even Enabled mode. Changing or resetting the mode keeps both pauses; they expire automatically. Exception: a matching pair skips all checks when the receiver’s active stream is invite-only; otherwise mandatory political-only checks run regardless of modes, top-ups or either pause.",ru:"При обычной проверке активные паузы важнее даже режима «Включена». Изменение или сброс режима сохраняет обе паузы; они истекают автоматически. Исключение: для совпавшей пары все проверки пропускаются, если активный стрим получателя только по приглашению; иначе проверка на политику обязательна независимо от режима, пополнений и обеих пауз.",es:"En la evaluación normal, las pausas activas prevalecen incluso sobre el modo Activada. Cambiar o restablecer el modo conserva ambas pausas; caducan automáticamente. Excepción: una pareja coincidente omite todas las comprobaciones si el stream activo del destinatario es solo por invitación; en caso contrario, las comprobaciones políticas son obligatorias sin importar modos, depósitos ni pausas."},argus_reason:{en:"Reason for the next change (optional)",ru:"Причина следующего изменения (необязательно)",es:"Motivo del próximo cambio (opcional)"},argus_reason_hint:{en:"Recorded with your identity in the audit history and moderation notification. Up to 1,000 characters.",ru:"Попадёт в историю и уведомление о модерации вместе с вашим именем. До 1000 символов.",es:"Se registra con tu identidad en el historial y la notificación de moderación. Hasta 1000 caracteres."},argus_reason_error:{en:"Use at most 1,000 characters.",ru:"Не более 1000 символов.",es:"Usa como máximo 1000 caracteres."},argus_permanent:{en:"Permanent sender mode",ru:"Постоянный режим отправителя",es:"Modo permanente del remitente"},argus_mode_label:{en:"Mode",ru:"Режим",es:"Modo"},argus_mode_auto:{en:"Automatic",ru:"Автоматически",es:"Automático"},argus_mode_enabled:{en:"Enabled",ru:"Включена",es:"Activada"},argus_mode_disabled:{en:"Disabled",ru:"Выключена",es:"Desactivada"},argus_mode_hint:{en:"Outside the pair exception above: Automatic uses positive top-ups from the last 30 days; Enabled forces checks unless paused; Disabled skips checks. Saving Automatic resets the saved mode, but never clears a pause or pair exemption.",ru:"Вне исключения для пары выше: авторежим учитывает положительные пополнения за последние 30 дней; «Включена» проверяет, если нет паузы; «Выключена» пропускает проверку. Сохранение авторежима сбрасывает сохранённый режим, но не снимает паузы и не удаляет исключения для пар.",es:"Fuera de la excepción de pareja indicada: Automático usa los depósitos positivos de los últimos 30 días; Activada fuerza las comprobaciones salvo pausa; Desactivada las omite. Guardar Automático restablece el modo guardado, pero no elimina pausas ni exenciones de pareja."},argus_apply_mode:{en:"Apply mode",ru:"Применить режим",es:"Aplicar modo"},argus_admin_only:{en:"Only administrators can change permanent mode. You can still pause or resume either scope below.",ru:"Постоянный режим меняет только администратор. Ниже вы можете приостановить или возобновить модерацию в любом направлении.",es:"Solo los administradores pueden camb
16iar el modo permanente. Puedes pausar o reanudar cualquiera de los ámbitos siguientes."},argus_pause_sender:{en:"Outgoing messages",ru:"Исходящие сообщения",es:"Mensajes salientes"},argus_pause_receiver:{en:"Incoming messages",ru:"Входящие сообщения",es:"Mensajes entrantes"},argus_pause_sender_hint:{en:"Pause ordinary moderation of outgoing messages, including profile text. Does not suppress mandatory political checks for a matching non-invite pair.",ru:"Приостановить обычную проверку исходящих сообщений, включая текст профиля. Не отменяет обязательную проверку на политику для совпавшей пары вне стрима по приглашению.",es:"Pausa la moderación normal de mensajes salientes, incluido el perfil. No suprime las comprobaciones políticas obligatorias de una pareja coincidente fuera de un stream por invitación."},argus_pause_receiver_hint:{en:"Skip ordinary moderation of messages addressed to this user, except mandatory political checks for a matching non-invite pair. Does not affect profile text or outgoing messages.",ru:"Пропускать обычную проверку входящих сообщений, кроме обязательной проверки на политику для совпавшей пары вне стрима по приглашению. Не влияет на профиль и исходящие сообщения.",es:"Omite la moderación normal de mensajes dirigidos a este usuario, salvo las comprobaciones políticas obligatorias de una pareja coincidente fuera de un stream por invitación. No afecta al perfil ni a mensajes salientes."},argus_paused:{en:"Paused",ru:"Приостановлено",es:"En pausa"},argus_not_paused:{en:"No active pause",ru:"Нет активной паузы",es:"Sin pausa activa"},argus_expires:{en:"Until {{time}} · {{minutes}} min left",ru:"До {{time}} · осталось {{minutes}} мин",es:"Hasta {{time}} · quedan {{minutes}} min"},argus_minutes:{en:"Pause duration (minutes)",ru:"Длительность паузы (минуты)",es:"Duración de la pausa (minutos)"},argus_minutes_hint:{en:"Enter a whole number from 1 to 1440 (24 hours).",ru:"Целое число от 1 до 1440 (24 часа).",es:"Introduce un número entero de 1 a 1440 (24 horas)."},argus_pause:{en:"Pause moderation",ru:"Приостановить",es:"Pausar moderación"},argus_update_pause:{en:"Update pause",ru:"Изменить паузу",es:"Actualizar pausa"},argus_resume:{en:"Resume now",ru:"Возобновить сейчас",es:"Reanudar ahora"},argus_audit:{en:"Audit history",ru:"История изменений",es:"Historial de cambios"},argus_refresh:{en:"Refresh",ru:"Обновить",es:"Actualizar"},argus_audit_hint:{en:"Newest changes first. Modes describe permanent policy; expiry describes the pause for the affected scope. Dates use your local time zone.",ru:"Новые изменения сверху. Режим — постоянная настройка; срок — пауза указанного направления. Время отображается в вашем часовом поясе.",es:"Cambios más recientes primero. Los modos describen la política permanente; la caducidad, la pausa del ámbito afectado. Las fechas usan tu zona horaria local."},argus_audit_username:{en:"Filter by username",ru:"Фильтр по пользователю",es:"Filtrar por usuario"},argus_all_users:{en:"All users",ru:"Все пользователи",es:"Todos los usuarios"},argus_audit_limit:{en:"Entries",ru:"Записей",es:"Entradas"},argus_filter:{en:"Apply filter",ru:"Применить фильтр",es:"Aplicar filtro"},argus_audit_error:{en:"Could not load audit history",ru:"Не удалось загрузить историю",es:"No se pudo cargar el historial"},argus_audit_empty:{en:"No changes found for this filter.",ru:"По этому фильтру изменений нет.",es:"No se encontraron cambios con este filtro."},argus_action_update:{en:"Mode changed",ru:"Режим изменён",es:"Modo camb
16iado"},argus_action_reset:{en:"Reset to automatic",ru:"Сброс в авторежим",es:"Restablecido a automático"},argus_action_pause:{en:"Paused",ru:"Пауза",es:"Pausado"},argus_action_resume:{en:"Resumed",ru:"Возобновлено",es:"Reanudado"},argus_scope_sender:{en:"Sender",ru:"Отправитель",es:"Remitente"},argus_scope_receiver:{en:"Receiver",ru:"Получатель",es:"Destinatario"},argus_actor:{en:"Changed by",ru:"Кто изменил",es:"Modificado por"},argus_target:{en:"User",ru:"Пользователь",es:"Usuario"},argus_expiry:{en:"Pause expiry",ru:"Срок паузы",es:"Caducidad de la pausa"},argus_no_expiry:{en:"None",ru:"Нет",es:"Ninguna"},argus_reason_short:{en:"Reason",ru:"Причина",es:"Motivo"},argus_no_reason:{en:"Not provided",ru:"Не указана",es:"No indicado"}},rC={argus_pairs_title:{en:"Directional pair exemptions",ru:"Направленные исключения для пар",es:"Exenciones por pareja direccional"},argus_pairs_direction_hint:{en:"An exemption is permanent until an administrator removes it. Sender A → receiver B is NOT B → A. Other recipients and profile text are unaffected.",ru:"Исключение действует, пока администратор его Ð
16½Ðµ удалит. Отправитель A → получатель B — НЕ B → A. Другие получатели и текст профиля не затрагиваются.",es:"La exención es permanente hasta que un administrador la elimine. Remitente A → destinatario B NO es B → A. No afecta a otros destinatarios ni al texto del perfil."},argus_pairs_rules:{en:"For a matching pair: when the receiver’s active stream is invite-only, all Argus checks are skipped. Otherwise, political-only checks ALWAYS run, even when the sender is disabled, exempt through top-ups, or either sender/receiver pause is active. Pair exemptions do not change the user’s own policy.",ru:"Для совпавшей пары: если активный стрим получателя доступен только по приглашению, все проверки Argus пропускаются. Иначе ВСЕГДА выполняется проверка только на политику — даже при выключенной модерации отправителя, освобождении за пополнения или активной паузе отправителя/получателя. Исключение для пары не меняет личные настройки пользователя.",es:"Para una pareja coincidente: si el stream activo del destinatario es solo por invitación, se omiten todas las comprobaciones de Argus. En caso contrario, SIEMPRE se comprueba solo el contenido político, aunque el remitente tenga la moderación desactivada, esté exento por depósitos o haya una pausa del remitente/destinatario. La exención no cambia la política propia del usuario."},argus_pairs_read_only:{en:"Read-only: moderators can inspect pairs and pair history. Only administrators can create or remove permanent pair exemptions.",ru:"Только просмотр: модераторы могут смотреть пары и их историю. Создавать и удалять постоянные исключения могут только администраторы.",es:"Solo lectura: los moderadores pueden consultar parejas y su historial. Solo los administradores pueden crear o eliminar exenciones permanentes."},argus_pairs_sender:{en:"Sender username",ru:"Имя отправителя",es:"Usuario remitente"},argus_pairs_receiver:{en:"Receiver username",ru:"Имя получателя",es:"Usuario destinatario"},argus_pairs_create:{en:"Create or update pair exemption",ru:"Создать или обновить исключение",es:"Crear o actualizar exención de pareja"},argus_pairs_prefill:{en:"Use selected user as sender: {{username}}",ru:"Взять выбранного пользователя как отправителя: {{username}}",es:"Usar el usuario seleccionado como remitente: {{username}}"},argus_pairs_draft_hint:{en:"Pair inputs and filters are independent of the user policy selected above. Saving an existing pair updates its reason.",ru:"Поля пары и фильтры не зависят от выбранных выше настроек пользователя. Сохранение существующей пары обновляет причину.",es:"Los campos y filtros de pareja son independientes de la política seleccionada arriba. Guardar una pareja existente actualiza su motivo."},argus_pairs_review:{en:"Review exemption",ru:"Проверить исключение",es:"Revisar exención"},argus_pairs_list:{en:"Permanent pair list",ru:"Список постоянных исключений",es:"Lista de parejas permanentes"},argus_pairs_filter:{en:"Search pairs",ru:"Найти пары",es:"Buscar parejas"},argus_pairs_filter_hint:{en:"Filter by exact sender and/or receiver username; leave blank for all. Showing at most the selected number of entries.",ru:"Фильтр по точному имени отправителя и/или получателя; пустое поле — все. Показано не более выбранного числа записей.",es:"Filtra por el nombre exacto del remitente y/o destinatario; deja en blanco para todos. Se muestra como máximo el número de entradas seleccionado."}
16,argus_pairs_empty:{en:"No pair exemptions found for these filters.",ru:"По этим фильтрам исключений нет.",es:"No se encontraron exenciones con estos filtros."},argus_pairs_error:{en:"Could not load pair exemptions",ru:"Не удалось загрузить исключения",es:"No se pudieron cargar las exenciones"},argus_pairs_remove:{en:"Remove {{sender}} → {{receiver}}",ru:"Удалить {{sender}} → {{receiver}}",es:"Eliminar {{sender}} → {{receiver}}"},argus_pairs_confirm_save:{en:"Confirm this direction",ru:"Подтвердите направление",es:"Confirma esta dirección"},argus_pairs_confirm_remove:{en:"Confirm pair removal",ru:"Подтвердите удаление пары",es:"Confirma la eliminación de la pareja"},argus_pairs_save_hint:{en:"Save a permanent exemption only for messages from this sender to this receiver. The reverse direction is not included.",ru:"Сохранить постоянное исключение только для сообщений от этого отправителя этому получателю. Обратное направление не включено.",es:"Guardar una exención permanente solo para mensajes de este remitente a este destinatario. No incluye la dirección inversa."},argus_pairs_remove_hint:{en:"Remove only this sender → receiver exemption. Normal policy evaluation resumes for these messages; the reverse pair, other recipients and profile settings are unchanged.",ru:"Удалить только это исключение отправитель → получатель. Для этих сообщений снова действуют обычные правила; обратная пара, другие получатели и настройки профиля не меняются.",es:"Eliminar solo esta exención remitente → destinatario. Estos mensajes vuelven a evaluarse con la política normal; la pareja inversa, otros destinatarios y el perfil no cambian."},argus_pairs_reason_hint:{en:"Optional, up to 1,000 Unicode characters. Your identity and reason are recorded in pair audit history and the moderation chat notification.",ru:"Необязательно, до 1000 символов Unicode. Ваше имя и причина записываются в историю пар и уведомление в чате модерации.",es:"Opcional, hasta 1000 caracteres Unicode. Tu identidad y motivo se registran en el historial de parejas y en la notificación del chat de moderación."},argus_pairs_save:{en:"Confirm exemption",ru:"Подтвердить исключение",es:"Confirmar exención"},argus_pairs_delete:{en:"Confirm removal",ru:"Подтвердить удаление",es:"Confirmar eliminación"},argus_pairs_cancel:{en:"Cancel",ru:"Отмена",es:"Cancelar"},argus_pairs_saved:{en:"Pair change saved and recorded in pair audit history.",ru:"Изменение пары сохранено и записано в историю.",es:"Cambio de pareja guardado y registrado en su historial."},argus_pairs_audit:{en:"Pair audit history",ru:"История изменений пар",es:"Historial de parejas"},argus_pairs_audit_filter:{en:"Search pair history",ru:"Найти изменения пар",es:"Buscar historial de parejas"},argus_pairs_audit_hint:{en:"Separate from user policy history. Newest changes first, with direction, actor, exemption state and reason. Dates use your local time zone.",ru:"Отдельно от истории настроек пользователя. Новые изменения сверху: направление, автор, состояние исключения и причина. Время в вашем часовом поясе.",es:"Separado del historial de políticas de usuario. Cambios más recientes primero, con dirección, autor, estado y motivo. Fechas en tu zona horaria local."},argus_pairs_audit_error:{en:"Could not load pair audit history",ru:"Не удалось загрузить историю пар",es:"No se pudo cargar el historial de parejas"},argus_pairs_audit_empty:{en:"No pair changes found for these filters.",ru:"По этим фильтрам изменений пар нет.",es:"No se encontraron cambios de pareja con estos filtros."},argus_pairs_enabled:{en:"Exemption enabled",ru:"Исключение включено",es:"Exención activada"},argus_pairs_disabled:{en:"No pair exemption",ru:"Нет исключения для пары",es:"Sin exención de pareja"}},iC={argus_prompts_title:{en:"Versioned prompts",ru:"Версии промптов",es:"Versiones de prompts"},argus_prompts_hint:{en:"Edit the three shared prompt sections. Publishing or restoring applies immediately; every version keeps its author, time, reason and restore source.",ru:"Редактируйте три общих раздела промпта. Публикация и восстановление применяются сразу; каждая версия сохраняет автора, время, причину и источник восстановления.",es:"Edita las tres secciones compartidas del prompt. Publicar o restaurar aplica los cambios de inmediato; cada versión conserva autor, fecha, motivo y origen de restauración."},argus_prompts_rules:{en:"Not editable here: server overrides for invite-only contact/payment-only checks and exact-pair politics-only checks. Regex contact detection, top-ups, warnings and exemptions are unchanged.",ru:"Здесь нельзя менять серверные правила: проверку только контактов/платежей в стримах по приглашению и только политики для точной пары. Поиск контактов регулярными выражениями, пополнения, предупреждения и исключения не меняются.",es:"No se editan aquí las reglas del servidor: comprobaciones solo de contactos/pagos en streams por invitación y solo de política para parejas exactas. No cambian la detección de contactos por regex, los depósitos, las advertencias ni las exenciones."},argus_prompts_read_only:{en:"Read-only: moderators can inspect prompts and history. Only administrators can publish or restore versions.",ru:"Только просмотр: модераторы могут смотреть промпты и историю. Публиковать и восстанавливать версии могут только администраторы.",es:"Solo lectura: los moderadores pueden consultar prompts e historial. Solo los administradores pueden publicar o restaurar versiones."},argus_prompts_active:{en:"Active version",ru:"Активная версия",es:"Versión activa"},argus_prompts_base:{en:"Editing from v{{id}}",ru:"Редактирование на основе v{{id}}",es:"Editando a partir de v{{id}}"},argus_prompts_general:{en:"General policy",ru:"Общие правила",es:"Política general"}
16,argus_prompts_context:{en:"Context instructions",ru:"Инструкции по контексту",es:"Instrucciones de contexto"},argus_prompts_indirect_contact:{en:"Indirect contacts examples",ru:"Примеры косвенных контактов",es:"Ejemplos de contactos indirectos"},argus_prompts_count:{en:"{{count}} / {{max}} Unicode characters",ru:"{{count}} / {{max}} символов Unicode",es:"{{count}} / {{max}} caracteres Unicode"},argus_prompts_section_error:{en:"Required: nonblank, at most 30,000 Unicode characters.",ru:"Обязательно: непустой текст, не более 30 000 символов Unicode.",es:"Obligatorio: texto no vacío, máximo 30 000 caracteres Unicode."},argus_prompts_reason:{en:"Reason for this version",ru:"Причина создания версии",es:"Motivo de esta versión"},argus_prompts_reason_hint:{en:"Required, trimmed, up to 1,000 Unicode characters. Recorded with your identity in immutable history.",ru:"Обязательно, до 1000 символов Unicode без пробелов по краям. Сохраняется с вашим именем в неизменяемой истории.",es:"Obligatorio, sin espacios al inicio ni al final, hasta 1000 caracteres Unicode. Se registra con tu identidad en el historial inmutable."},argus_prompts_reason_error:{en:"Enter a nonblank reason of at most 1,000 Unicode characters.",ru:"Укажите непустую причину длиной не более 1000 символов Unicode.",es:"Introduce un motivo no vacío de hasta 1000 caracteres Unicode."},argus_prompts_dirty:{en:"Unsaved draft",ru:"Несохранённый черновик",es:"Borrador sin guardar"},argus_prompts_newer:{en:"v{{id}} is now active. Your draft is still based on v{{base}} and has not been replaced. Copy any text you want to keep, then reload the latest version before publishing or restoring.",ru:"Теперь активна v{{id}}. Ваш черновик по-прежнему основан на v{{base}} и не был заменён. Скопируйте нужный текст и загрузите актуальную версию перед публикацией или восстановлением.",es:"Ahora está activa la v{{id}}. Tu borrador sigue basado en la v{{base}} y no se ha sustituido. Copia el texto que quieras conservar y carga la última versión antes de publicar o restaurar."},argus_prompts_reload:{en:"Reload latest version",ru:"Загрузить актуальную версию",es:"Cargar la última versión"},argus_prompts_reload_title:{en:"Discard draft and reload?",ru:"Удалить черновик и загрузить заново?",es:"¿Descartar el borrador y recargar?"},argus_prompts_reload_hint:{en:"This replaces all three draft sections and clears your reason only after the latest version loads successfully. Copy anything you want to keep first.",ru:"Все три раздела черновика и причина будут заменены только после успешной загрузки актуальной версии. Сначала скопируйте всё, что хотите сохранить.",es:"Las tres secciones del borrador y su motivo se sustituyen solo cuando la última versión se carga correctamente. Copia primero lo que quieras conservar."},argus_prompts_discard:{en:"Discard and reload",ru:"Удалить черновик и загрузить",es:"Descartar y recargar"},argus_prompts_review:{en:"Review publication",ru:"Проверить публикацию",es:"Revisar publicación"},argus_prompts_publish_title:{en:"Publish prompts now?",ru:"Опубликовать промпты сейчас?",es:"¿Publicar prompts ahora?"},argus_prompts_publish_hint:{en:"Create a new active version from this draft, replacing v{{id}} immediately. Previous versions remain unchanged.",ru:"Создать новую активную версию из этого черновика, сразу заменив v{{id}}. Предыдущие версии не изменятся.",es:"Crea una nueva ver
16sión activa con este borrador y sustituye la v{{id}} de inmediato. Las versiones anteriores no cambian."},argus_prompts_publish:{en:"Publish and apply now",ru:"Опубликовать и применить",es:"Publicar y aplicar ahora"},argus_prompts_history:{en:"Prompt version history",ru:"История версий промптов",es:"Historial de versiones de prompts"},argus_prompts_history_hint:{en:"Newest first. Versions are immutable; restoring creates a new version, never rewrites history. Dates use your local time zone. Built-in v1 was created by System #0.",ru:"Новые сверху. Версии неизменяемы: восстановление создаёт новую версию, не переписывая историю. Время в вашем часовом поясе. Встроенная v1 создана System #0.",es:"Más recientes primero. Las versiones son inmutables: restaurar crea una nueva versión, sin reescribir el historial. Fechas en tu zona horaria local. La v1 integrada fue creada por System #0."},argus_prompts_view:{en:"View v{{id}}",ru:"Открыть v{{id}}",es:"Ver v{{id}}"},argus_prompts_viewing:{en:"Viewing v{{id}} · read-only",ru:"Просмотр v{{id}} · только чтение",es:"Viendo v{{id}} · solo lectura"},argus_prompts_close_version:{en:"Close version preview",ru:"Закрыть просмотр версии",es:"Cerrar vista de versión"},argus_prompts_more:{en:"Load older versions",ru:"Загрузить старые версии",es:"Cargar versiones anteriores"},argus_prompts_empty:{en:"No versions found.",ru:"Версий не найдено.",es:"No se encontraron versiones."},argus_prompts_restored_from:{en:"Restored from v{{id}}",ru:"Восстановлено из v{{id}}",es:"Restaurada desde v{{id}}"},argus_prompts_restore:{en:"Restore v{{id}}…",ru:"Восстановить v{{id}}…",es:"Restaurar v{{id}}…"},argus_prompts_restore_title:{en:"Restore as a new active version?",ru:"Восстановить как новую активную версию?",es:"¿Restaurar como nueva versión activa?"},argus_prompts_restore_hint:{en:"Copy all three sections from v{{source}} into a NEW version, replacing active v{{id}} immediately. The source and all past records remain unchanged.",ru:"Скопировать все три раздела из v{{source}} в НОВУЮ версию, сразу заменив активную v{{id}}. Источник и все прошлые записи не изменятся.",es:"Copia las tres secciones de la v{{source}} a una NUEVA versión y sustituye la v{{id}} activa de inmediato. El origen y todos los registros anteriores no cambian."},argus_prompts_restore_dirty:{en:"You have an unsaved draft. Confirming restore discards it only after restoration succeeds; cancelling or an error keeps it.",ru:"У вас есть несохранённый черновик. Он будет удалён только после успешного восстановления; отмена или ошибка сохранят его.",es:"Tienes un borrador sin guardar. Confirmar la restauración lo descarta solo si se completa correctamente; cancelar o un error lo conserva."},argus_prompts_confirm_restore:{en:"Restore and apply now",ru:"Восстановить и применить",es:"Restaurar y aplicar ahora"},argus_prompts_saved:{en:"v{{id}} was created and applied immediately.",ru:"v{{id}} создана и сразу применена.",es:"La v{{id}} se creó y aplicó de inmediato."},argus_prompts_load_error:{en:"Could not load prompts",ru:"Не удалось загрузить промпты",es:"No se pudieron cargar los prompts"},argus_prompts_history_error:{en:"Could not load version history",ru:"Не удалось загрузить историю версий",es:"No se pudo cargar el historial de versiones"},argus_prompts_update_error:{en:"Prompt change not confirmed",ru:"Изменение промптов не подтверждено",es:"Cambio de prompts no confirmado"},argus_prompts_error_conflict:{en:"Another administrator changed the active version. Your draft and reason are preserved. Cancel, copy any edits you need, then reload the latest version and review again. Nothing is automatically overwritten or retried.",ru:"Другой администратор изменил активную версию. Черновик и причина сохранены. Отмените действие, скопируйте нужные правки, загрузите актуальную версию и проверьте снова. Автоматической перезаписи или повтора нет.",es:"Otro administrador cambió la versión activa. Tu borrador y motivo se conservan. Cancela, copia las ediciones necesarias, carga la última versión y vuelve a revisar. No se sobrescribe ni reintenta nada automáticamente."},argus_prompts_error_invalid:{en:"The server rejected the input. Check all sections and the required reason; your draft is preserved.",ru:"Сервер отклонил данные. Проверьте разделы и обязательную причину; черновик сохранён.",es:"El servidor rechazó los datos. Revisa las secciones y el motivo obligatorio; tu borrador se conserva."},argus_prompts_error_not_found:{en:"This version was not found. Refresh history and select an available version. Your draft is preserved.",ru:"Версия не найдена. Обновите историю и выберите доступную версию. Черновик сохранён.",es:"No se encontró esta versión. Actualiza el historial y elige una versión disponible. Tu borrador se conserva."},argus_prompts_error_access:{en:"Your session or permissions changed. Reload the page and sign in with an authorized staff account.",ru:"СессиÑ
16 или права изменились. Перезагрузите страницу и войдите с разрешённой учётной записью сотрудника.",es:"Tu sesión o permisos han cambiado. Recarga la página e inicia sesión con una cuenta de personal autorizada."},argus_prompts_error_unknown:{en:"The result could not be confirmed. Your draft is preserved. Check the active version and history before trying again; the server may already have applied the change.",ru:"Не удалось подтвердить результат. Черновик сохранён. Перед повтором проверьте активную версию и историю: сервер мог уже применить изменение.",es:"No se pudo confirmar el resultado. Tu borrador se conserva. Comprueba la versión activa y el historial antes de reintentar; el servidor podría haber aplicado ya el cambio."},argus_prompts_cancel:{en:"Cancel",ru:"Отмена",es:"Cancelar"}},sC={argus_search_placeholder:{en:"Type part of a username",ru:"Введите часть имени пользователя",es:"Escribe parte del nombre de usuario"},argus_search_hint:{en:"Type 2–50 characters to find a username. Choose a suggestion or enter the full name, then submit the form.",ru:"Введите 2–50 символов для поиска имени. Выберите подсказку или введите полное имя, затем отправьте форму.",es:"Escribe entre 2 y 50 caracteres para buscar un usuario. Elige una sugerencia o introduce el nombre completo y envía el formulario."},argus_search_filter_placeholder:{en:"All users, or type part of a name",ru:"Все пользователи или часть имени",es:"Todos los usuarios, o parte de un nombre"},argus_search_pair_filter_hint:{en:"Find sender and/or receiver by part of a username, then select the full name to filter. Leave blank for all. Showing at most the selected number of entries.",ru:"Найдите отправителя и/или получателя по части имени, затем выберите полное имя для фильтра. Пустое поле — все. Показано не более выбранного числа записей.",es:"Busca al remitente y/o destinatario por parte del nombre y selecciona el nombre completo para filtrar. Deja en blanco para todos. Se muestra como máximo el número de entradas seleccionado."},argus_search_minimum:{en:"Type at least 2 characters to search.",ru:"Введите не менее 2 символов для поиска.",es:"Escribe al menos 2 caracteres para buscar."},argus_search_too_long:{en:"Use at most 50 characters to search.",ru:"Для поиска используйте не более 50 символов.",es:"Usa como máximo 50 caracteres para buscar."},argus_search_loading:{en:"Searching usernames…",ru:"Поиск пользователей…",es:"Buscando usuarios…"},argus_search_empty:{en:"No matching usernames. You can still enter a full username.",ru:"Совпадений нет. Вы всё равно можете ввести полное имя пользователя.",es:"No hay usuarios coincidentes. Puedes introducir un nombre de usuario completo."},argus_search_error:{en:"Could not load suggestions. Edit the name to retry, or enter a full username.",ru:"Не удалось загрузить подсказки. Измените имя для повторного поиска или введите полное имя.",es:"No se pudieron cargar las sugerencias. Modifica el nombre para reintentar o introduce el nombre completo."}},dc=["en","ru","es","de","fr","it","pl","uk"];function aC(e){const t={};for(const r of dc)t[r]={translation:{}};for(const[r,i]of Object.entries(e))for(const s of dc)s in i&&(t[s].translation[r]=i[s]);return t}const oC={...tC,...nC,...rC,...iC,...sC,create_account:{en:"Sign Up",ru:"Зарегистрироваться",es:"
16Crear cuenta"},log_in:{en:"Log In",ru:"Войти",es:"Iniciar sesión"},my_stream:{en:"My stream",ru:"Моя трансляция",es:"Mi transmisión"},settings:{en:"Settings",ru:"Настройки",es:"Configuración"},stream:{en:"Stream",ru:"Стрим",es:"Transmisión"},customization:{en:"Customization",ru:"Персонализация",es:"Personalización"},security:{en:"Security",ru:"Безопасность",es:"Seguridad"},verification_needed:{en:"Verification needed",ru:"Требуется верификация",es:"Verificación requerida"},pick_username_color:{en:"Pick a username color",ru:"Цвет никнейма в чате",es:"Seleccione su color de usuario"},username_color_preview:{en:"Preview",ru:"Превью",es:"Ejemplo"},save_username_color:{en:"Save color",ru:"Сохранить",es:"Guardar color"},notifications:{en:"Notifications",ru:"Уведомления",es:"Notificaciones"},notify_new_streamer:{en:"Notify about new streamer",ru:"Уведомлять о новом стримере",es:"Notificar sobre un nuevo streamer"},username:{en:"Username",ru:"Имя пользователя",es:"Nombre de usuario"},notify_new_streamer_description:{en:"Receive notifications when a new streamer joins the platform",ru:"Получать уведомления о появлении новых стримеров на сайте",es:"Recibir notificaciones cuando aparezcan nuevos streamers en la plataforma"},telegram_notifications_description:{en:"Connect Telegram to receive notifications in Telegram",ru:"Подключите Telegram, чтобы получать уведомления в Telegram",es:"Conecta Telegram para recibir notificaciones en Telegram"},push_notifications:{en:"Push notifications",ru:"Push-уведомления",es:"Notificaciones push"},push_notifications_description:{en:"Allow browser push notifications on this device",ru:"Разрешить push-уведомления браузера на этом устройстве",es:"Permitir notificaciones push del navegador en este dispositivo"},status_connected:{en:"Status: connected",ru:"Статус: подключено",es:"Estado: conectado"},status_disconnected:{en:"Status: disconnected",ru:"Статус: отключено",es:"Estado: desconectado"},connect_telegram:{en:"Connect Telegram",ru:"Подключить Telegram",es:"Conectar Telegram"},disconnect_telegram:{en:"Disconnect Telegram",ru:"Отключить Telegram",es:"Desconectar Telegram"},allow_push_notifications:{en:"Allow push notifications",ru:"Разрешить push-уведомления",es:"Permitir notificaciones push"},disable_push_notifications:{en:"Disable push notifications",ru:"Отключить push-уведомления",es:"Desactivar notificaciones push"},success:{en:"Success!",ru:"Успешно!",es:"¡Éxito!"},password_changed:{en:"Your password was changed",ru:"Пароль изменён",es:"Tu contraseña ha sido cambiada"},current_password:{en:"Current password",ru:"Текущий пароль",es:"Contraseña actual"},current_password_placeholder:{en:"Enter your current password",ru:"Введите текущий пароль",es:"Introduce tu contraseña actual"},new_password:{en:"New password",ru:"Новый пароль",es:"Nueva contraseña"},new_password_placeholder:{en:"Enter your new password",ru:"Введите новый пароль",es:"Introduce tu nueva contraseña"},change_password:{en:"Change password",ru:"Изменить пароль",es:"Cambiar contraseña"},regenerate_streaming_keys:{en:"Regenerate streaming keys",ru:"Пересоздать ключи стрима",es:"Regenerar claves de transmisión"},streaming_guide:{en:"Streaming guide (click here to start streaming)",ru:"Инструкция по стримингу (нажмите, чтобы начать стрим)",es:"Guía de transmisión (haz clic aquí para empezar)"},username_color_preview_message:{en:"Username color preview",ru:"Предпросмотр цвета никнейма",es:"Vista previa del color del nombre"},loading:{en:"Loading...",ru:"Загрузка...",es:"Cargando..."},failed_to_load_account_data:{en:"Failed to load account data.",ru:"Не удалось загрузить данные аккаунта.",es:"No se pudieron cargar los datos de la cuenta."}
16,anonymizer:{en:"Anonymizer",ru:"Анонимайзер",es:"Anonimizador"},anonymizer_unavailable:{en:"The Anonymizer feature is only available to users who have deposited $1,000 or more.",ru:"Анонимайзер доступен только пользователям, внесшим депозит на сумму от $1,000.",es:"El Anonimizador solo está disponible para usuarios que hayan depositado $1,000 o más."},anonymizer_description:{en:"The Anonymizer allows you to temporarily hide your real identity while interacting on the platform.",ru:"Анонимайзер позволяет временно скрыть вашу настоящую личность при взаимодействии на платформе.",es:"El Anonimizador te permite ocultar temporalmente tu identidad real mientras interactúas en la plataforma."},anonymizer_note:{en:"This session can be ended at any time. Your activity during the session remains subject to our Terms of Service.",ru:"Сессию можно завершить в любой момент. На действия во время сессии по-прежнему распространяются Условия использования.",es:"La sesión puede finalizarse en cualquier momento. Tu actividad durante la sesión sigue estando sujeta a nuestros Términos de servicio."},status:{en:"Status",ru:"Статус",es:"Estado"},active:{en:"Active",ru:"Активен",es:"Activo"},not_active:{en:"Not active",ru:"Не активен",es:"Inactivo"},anonymous_identity:{en:"Your Anonymous Identity",ru:"Ваша анонимная личность",es:"Tu identidad anónima"},pretty_username:{en:"Pretty Username",ru:"Отображаемое имя",es:"Nombre visible"},end_session:{en:"End session",ru:"Завершить сессию",es:"Finalizar sesión"},start_anonymous_session:{en:"Start anonymous session",ru:"Начать анонимную сессию",es:"Iniciar sesión anónima"},admin:{en:"Admin",ru:"Админ",es:"Admin"},log_out:{en:"Log out",ru:"Выйти",es:"Cerrar sesión"},password:{en:"Password",ru:"Пароль",es:"Contraseña"},enter_username:{en:"Enter your username",ru:"Введите ваше имя пользователя",es:"Ingrese su usuario"},enter_password:{en:"Enter your password",ru:"Введите пароль",es:"Ingrese su contraseña"},remember_me:{en:"Remember me",ru:"Запомнить меня",es:"Recuérdame"},forgot_password:{en:"Forgot password",ru:"Забыли пароль",es:"Olvidé mi contraseña"},confirm_password:{en:"Confirm password",ru:"Подтвердите пароль",es:"Confirmar contraseña"},no_account_yet:{en:"Do not have an account yet",ru:"Не имеете аккаунта",es:"Aún no existe una cuenta con ese usuario"},tos_pp_warning:{en:"By creating an account, you acknowledge that you have read and agree to our <tos>Terms of Service</tos> and <pp>Privacy Policy</pp>",ru:"Создавая аккаунт, вы подтверждаете, что ознакомились с нашими <tos>Условиями использования</tos> и <pp>Политикой конфиденциальности</pp> и согласны с ними",es:"Al crear una cuenta, confirmas que has leído y aceptas nuestros <tos>Términos de Servicio</tos> y nuestra <pp>Política de Privacidad</pp>"},verification_message:{en:"We need to verify that you are 18+, before you can start streaming. Please upload your documents below.",ru:"Мы должны убедиться, что вы старше 18 лет перед тем, как вы начнете трансляцию. Пожалуйста, загрузите документ, подтверждающий ваш возраст, ниже",es:"Necesitamos verificar que usted sea 18+, antes de comenzar a transmitir. Por favor suba sus documentos debajo."},upload_document:{en:"Upload document (only JPEG allowed)",ru:"Загрузить документ",es:"Subir documento (solo se permite JPEG)"},chat:{en:"Chat",ru:"Чат",es:"Chat"},dares:{en:"Dares",ru:"Вызовы",es:"Retos"}
16,create_dare:{en:"Create dare",ru:"Создать вызов",es:"Crear reto"},create_a_dare:{en:"Create a dare",ru:"Создание вызова",es:"Crear un reto"},must_login_to_create_a_dare:{en:"You have to log in to be able to create a dare",ru:"Войдите в аккаунт, чтобы создавать вызовы!",es:"Debes iniciar sesión para poder crear un reto"},dare_description:{en:"Description",ru:"Описание",es:"Descripción"},dare_description_explanation:{en:"What you want the streamer to do",ru:"Опишите, что вы хотите, чтобы стример сделал",es:"Qué deseas que quien transmite haga"},dare_description_placeholder:{en:"Type here",ru:"...",es:"Escriba aquí"},dare_time:{en:"Time",ru:"Время",es:"Tiempo"},dare_time_explanation:{en:"The time (in minutes) to perform the dare",ru:"Время на выполнение вызова (в минутах)",es:"El tiempo (en minutos) para realizar el reto"},enter_dare_time:{en:"Enter time in minutes",ru:"Введите время в минутах",es:"Ingrese el tiempo en minutos"},dare_amount:{en:"Amount",ru:"Сумма",es:"Cantidad"},stream_offline:{en:"Stream offline",ru:"Оффлайн",es:"Transmisión fuera de línea"},donate:{en:"Donate",ru:"Донат",es:"Donar"},log_in_to_chat:{en:"You have to log in to be able to chat",ru:"Войдите в аккаунт, чтобы общаться в чате!",es:"Debes iniciar sesión para poder chatear"},please_log_in:{en:"Please log in",ru:"Пожалуйста, войдите в аккаунт",es:"Por favor inicie sesión"},upload_completed_message:{en:"Document uploaded, as soon as we are able to verify that this documentation is correct, you will be allowed to stream.",ru:"Документ загружен, как только мы проверим, что все в порядке, вы сможете начать стрим.",es:"Documento subido, apenas podamos verificar que la documentación este en orden, se te permitirá transmitir."},upload_completed_title:{en:"Upload completed",ru:"Загрузка завершена",es:"Subida completada"},topup_title:{en:"Top up",ru:"Пополнение",es:"Recarga"},topup_disabled:{en:"Top up is available via on-site support & Telegram",ru:"Пополнения доступны через поддержку на сайте или аккаунт поддержки в Телеграм",es:"Es posible recargar tanto por el soporte del sitio como por Telegram"},topup_disabled_message_body:{en:"Available methods: cards, PayPal, crypto",ru:"Доступные методы: банковские карты, PayPal, крипта",es:"Métodos disponibles: tarjetas, PayPal, cripto"},topup_amount:{en:"Amount",ru:"Сумма",es:"Cantidad"},topup_button:{en:"Top up",ru:"Пополнить",es:"Recargar"},donate_title:{en:"Donate",ru:"Донат",es:"Donación"},donate_amount:{en:"Amount",ru:"Сумма",es:"Cantidad"},donate_button:{en:"Donate",ru:"Отправить",es:"Donar"},login_to_contribute_to_dare:{en:"You have to log in to be able to create a dare",ru:"Войдите в аккаунт, чтобы добавить деньги в вызов!",es:"Tienes que iniciar sesión para poder crear un reto"},choose_top_up_method:{en:"Choose how you want to top up your balance",ru:"Выберите, как вы хотите пополнить баланс",es:"Seleccione cómo desea recargar su saldo"},topup_via_support:{en:"Via support",ru:"Через поддержку",es:"A través de soporte"},topup_options:{en:"Card transfer, crypto, paypal and other",ru:"Перевод на карту, крипта, PayPal",es:"Transferencia con tarjeta, cripto, PayPal y otros"},topup_available:{en:"Available",ru:"Доступно",es:"Disponible"},topup_bank_card:{en:"Bank Card",ru:"Банковская карта (кроме РФ и РБ)",es:"Tarjeta bancaria"},topup_bc_fs:{en:"Fast & secure",ru:"Быстро & безопасно",es:"Rápido y seguro"},topup_coming_soon:{en:"Coming soon",ru:"Уже скоро!",es:"Próximamente"},topup_select_payment_method:{en:"Select Payment Method",ru:"Выберите метод пополнения",es:"Seleccione el método de pago"},topup_zero_fee:{en:"ZERO FEE",ru:"БЕЗ КОМИССИИ!",es:"SIN COMISIÓN"},topup_back:{en:"Back",ru:"Назад",es:"Volver"},topup_method_cant_find:{en:"Can't find your preferred top-up method?",ru:"Не смогли найти удобный метод?",es:"¿No encuentra su método de recarga preferido?"},topup_chat_with_us:{en:"Chat with us",ru:"Напишите нам",es:"Chatea con nosotros"},topup_amount_usd:{en:"Amount (max. $445)",ru:"Сумма (макс. $445)",es:"
16Cantidad (máx. $445)"},topup_you_receive:{en:"You receive",ru:"Вы получите",es:"Usted recibe"},topup_you_pay:{en:"You pay",ru:"Вы платите",es:"Usted paga"},top_up_action:{en:"Top up",ru:"Пополнить",es:"Recargar"},withdraw_menu:{en:"Withdrawal",ru:"Вывод средств",es:"Retiro"},withdraw_admin:{en:"Users withdrawals",ru:"Выводы пользователей",es:"Retiros de usuarios"},withdraw_button:{en:"Request withdrawal",ru:"Запросить вывод средств",es:"Solicitar retiro"},withdraw_title:{en:"Withdraw",ru:"Вывод средств",es:"Retirar"},withdraw_method:{en:"Withdraw method",ru:"Метод вывода",es:"Método de retiro"},withdraw_amount:{en:"Amount (min. $10)",ru:"Сумма к выводу (мин. $10)",es:"Cantidad (min. $10)"},describe_withdrawal_method:{en:"And description and payment details for convinient withdrawal method",ru:"Добавьте описание и реквизиты для удобного Вам метода вывода",es:"Descripción y detalles de pago para tu método de retiro de preferencia"},stream_guide:{en:"Stream guide",ru:"Гайд по запуску",es:"Guía para transmitir"},streamer_guide_title:{en:"Choose your platform",ru:"Выберите тип устройства",es:"Seleccione su dispositivo"},computer_recomendation:{en:"Our official recommendation is to use the application OBS Studio",ru:"Для запуска трасляции с компьютера мы рекомендуем использовать OBS Studio",es:"Oficialmente recomendamos utilizar la aplicación OBS Studio"},computer_click_to_download:{en:"Click to download",ru:"Нажмите, чтобы скачать",es:"Click para descargar"},computer_after_opening_app:{en:"After opening proceed with the following steps:",ru:"После открытия приложения выполните следующие действия:",es:"Luego de abrir la aplicación, siga estos pasos:"},computer_settings:{en:"Click settings",ru:"Нажмите Settings",es:"Click en settings"}
16,computer_click_stream:{en:"Click Stream",ru:"Нажмите Stream",es:"Click en Stream"},computrt_check_custom:{en:"In the dropdown labeled Service, choose 'Custom...'",ru:"В выпадающем меню Service, выберите 'Custom...'",es:"En el menú desplegable Service, seleccione 'Custom...'"},computer_enter_details:{en:"Enter the following details:",ru:"Заполните следующие поля",es:"Ingrese los siguientes detalles:"},computer_click_ok:{en:"Click OK/Apply",ru:"Нажмите OK/Apply",es:"Click en OK/Apply"},computer_success_message:{en:"Now you can start stream by clicking 'Start streaming' and enjoy your time on our website!",ru:"Теперь вы можете начать трансляцию нажав кнопку 'Start streaming'. Желаем вам успешных стримов!",es:"Ahora puede comenzar a transmitir haciendo clic en 'Start streaming' disfrute de su estadía en nuestro sitio!"},iphone_recomendation:{en:"Our official recommendation is to use the application StreamCast Pro, you can download it from the App store ",ru:"Для запуска трасляции с iPhone мы рекомендуем использовать StreamCast Pro, вы можете скачать данное приложение в AppStore ",es:"Oficialmente recomendamos utilizar la aplicación StreamCast Pro, la puedes descargar desde la App store "},here:{en:"here",ru:"тут",es:"aquí"},iphone_after_opening_app:{en:"After opening proceed with the following steps:",ru:"После открытия приложения выполните следующие шаги:",es:"Luego de abrir la aplicación, siga estos pasos:"},iphone_click_channel:{en:"Press the cog wheel icon on the right side of the screen",ru:"Нажмите на значок шестеренки в правой части экрана",es:"Pulsa el icono de la rueda dentada situado en la parte derecha de la pantalla"},iphone_add_channel:{en:"Press Connections",ru:"Нажмите «Связи/Connections»",es:"Pulsa Conexiones/Connections"},iphone_press_option:{en:"Press the plus icon in the upper right corner",ru:"Нажмите на значок «плюс» в правом верхнем углу",es:"Pulsa el icono del signo más situado en la esquina superior derecha"},iphone_save_and_close:{en:"Save and make sure the connection is selected (checkmark)",ru:"Сохраните и убедитесь, что подключение выбрано (отмечено галочкой)",es:"Guarda y asegúrate de que la conexión esté seleccionada (marca de verificación)"},iphone_success_messaage:{en:"Now you can start stream by going back to the main screen and pushing the big white circle button. Enjoy your time on our website!",ru:"Теперь вы можете начать трансляцию, вернувшись на главный экран и нажав на большую белую круглую кнопку. Приятного времяпрепровождения на нашем сайте!",es:"Ahora puedes empezar a ver el contenido en streaming volviendo a la pantalla principal y pulsando el botón grande y redondo de color blanco. ¡Disfruta de tu visita a nuestra página web!"},android_recomendation:{en:"Our official recommendation is to use the application ManyCam, you can download it from Google play ",ru:"Для запуска трасляции с Android мы рекомендуем использовать ManyCam, вы можете скачать данное приложение в Google play ",es:"Oficialmente recomendamos utilizar la aplicación ManyCam, la puedes descargar desde Google play "},android_our_app:{en:"or you could try our new app (APK) ",ru:"или вы можете попробовать наше новое приложение (АПК) ",es:"o también puedes probar nuestra nueva aplicación (APK) "},android_after_opening_app:{en:`
17      <h3>Getting Started with Your Stream</h3>
18      <ol>
19        <li><strong>Open the app</strong> – When you first launch it, you'll see an option to skip registration. Go ahead and skip it for now.</li>
20        <li><strong>Go to Broadcasting</strong> – Look for the "Broadcast" or "Streaming" option in the menu and tap it.</li>
21        <li><strong>Start a new stream</strong> – Tap the blue "Start Broadcast" button.</li>
22        <li><strong>Add a new server</strong> – In the menu that appears, select "Add New Server" or "Add Server."</li>
23        <li><strong>Enter your stream details</strong> – Copy and paste these three things from the fields provided below:</li>
24    `,ru:`
25      <h3>Как начать трансляцию</h3>
26      <ol>
27        <li><strong>Откройте приложение</strong> – При первом запуске вы можете пропустить регистрацию. Смело пропускайте её.</li>
28        <li><strong>Перейдите в раздел "Трансляция"</strong> – Найдите в меню пункт "Трансляция" или "Broadcast" и нажмите на него.</li>
29        <li><strong>Начните новую трансляцию</strong> – Нажмите на голубую кнопку "Начать трансляцию".</li>
30        <li><strong>Добавьте новый сервер</strong> – В открывшемся меню выберите "Добавить новый сервер".</li>
31        <li><strong>Введите данные трансляции</strong> – Скопируйте и вставьте три параметра из полей, указанных ниже:
32    `,es:`
33      <h3>Comenzando con tu Transmisión</h3>
34      <ol>
35        <li><strong>Abre la aplicación</strong> – Cuando la abras por primera vez, verás una opción para omitir el registro. Puedes omitirlo por ahora.</li>
36        <li><strong>Ve a Transmisión</strong> – Busca la opción "Transmisión" o "Broadcasting" en el menú y tócala.</li>
37        <li><strong>Inicia una nueva transmisión</strong> – Toca el botón azul "Iniciar Transmisión".</li>
38        <li><strong>Añade un nuevo servidor</strong> – En el menú que aparece, selecciona "Añadir Nuevo Servidor" o "Agregar Servidor."</li>
39        <li><strong>Ingresa los detalles de tu transmisión</strong> – Copia y pega estas tres cosas desde los campos proporcionados abajo:
40    `},android_after_opening_app_continue:{en:`
41      <strong>Save and go live</strong> – Save your server settings, then tap "Start Streaming" to begin broadcasting!
42      </ol>
43      <p><strong>💡 Tip:</strong> Keep your Stream Key private – it's like a password for your broadcast!</p>
44    `,ru:`
45      <strong>Сохраните и начните</strong> – Сохраните настройки сервера и нажмите "Начать трансляцию" для запуска!
46      <p><strong>💡 Совет:</strong> Держите ваш Ключ трансляции в секрете – это как пароль для вашего эфира!</p>
47    `,es:`
48      <strong>Guarda e inicia</strong> – Guarda la configuración del servidor y luego toca "Iniciar Transmisión" para comenzar a transmitir.
49      <p><strong>💡 Consejo:</strong> Mantén tu Clave de Transmisión privada – ¡es como una contraseña para tu broadcast!</p>
50    `},android_click_channel:{en:"Press the channel icon in the upper right corner",ru:"Нажмите иконку канала в верхнем правом углу",es:"Presione el botón canal de arriba a la derecha"},android_add_channel:{en:"Add new channel",ru:"Add new channel",es:"Presione new channel"},android_press_option:{en:"Scroll down to the bottom and press the option:",ru:"Прокрутите вниз и нажмите:",es:"Muévase hacia abajo de todo y presione la opción:"},android_save_and_close:{en:"Save, make sure the channel is not disabled and press close",ru:"Сохраните, убедитесь, что канал не отключен и выйдите",es:"Presione save, asegúrese de que el canal no aparezca como deshabilitado y cierre"},android_success_messaage:{en:"Now you can start stream by pushing the big green button and enjoy your time on our website!",ru:"Теперь вы можете начать трансляцию нажав большую зеленою конпку. Желаем вам успешных стримов!",es:"Ahora puede empezar a transmitir pulsando el botón verde, disfrute de su estadía en nuestro sitio!"},referral:{en:"Referral program",ru:"Реферальная программа",es:"Programa de referidos"},dare_accept:{en:"Accept",ru:"Принять",es:"Aceptar"}
50,dare_contribute:{en:"Contribute",ru:"Вложиться",es:"Contribuir"},dare_delete:{en:"Delete",ru:"Удалить",es:"Eliminar"},dare_complete:{en:"Complete",ru:"Завершить",es:"Completado"},dare_vote_completed:{en:"COMPLETED",ru:"Выполнено",es:"COMPLETADO"},dare_vote_not_completed:{en:"NOT COMPLETED",ru:"Не выполнено",es:"NO COMPLETADO"},dare_state_in_progress:{en:"In progress",ru:"Выполняется",es:"En curso"},dare_state_voting:{en:"Voting",ru:"Голосование",es:"Votando"},dare_state_failed:{en:"Failed",ru:"Провалено",es:"Fallado"},dare_state_rejected:{en:"Rejected",ru:"Отклонено",es:"Rechazado"},dare_state_completed:{en:"Completed",ru:"Выполнено",es:"Completado"},dare_recover_money:{en:"Recover money",ru:"Вернуть деньги",es:"Recuperar dinero"},tos_link:{en:"Terms of Service",ru:"Условия оказания услуг",es:"Términos de Servicio"},platform_rules:{en:`
51    <h3>Platform Rules</h3>
52    <p>Users are prohibited from distributing, discussing, or sharing content that includes the following:</p>
53    <ol>
54      <li>Any exploitation of minors or propaganda of violent actions against them.</li>
55      <li>Political campaigning, propaganda, or discussions.</li>
56      <li>Promotion, demonstration, or use of narcotic substances.</li>
57      <li>Content involving violence, threats, incitement to cruelty, or their promotion, as well as the glorification of terrorism or extremism.</li>
58      <li>Encouragement of suicide, promotion of self-harm, or related discussions or demonstrations.</li>
59      <li>Pornographic content, including the use of sex toys, masturbation, sexual acts, their simulation, or explicit display of genitalia.</li>
60      <li>Collection, seeking, or disclosure of personal information, including but not limited to: real names, surnames, residential addresses, locations, social media links, email addresses, phone numbers.</li>
61      <li>Exchange of contact information or attempts to establish contact outside the platform, including sharing or requesting social media accounts, usernames, messenger contacts, accounts on other platforms, email addresses, phone numbers, or any other means of external communication. Violations of this rule may result in financial penalties.</li>
62      <li>Advertising or promotion of third-party platforms, goods, or services without prior approval from the administration.</li>
63      <li>Spam, flooding, trolling, insults, or any other malicious activities in chats.</li>
64      <li>Any presence or involvement of animals in explicit content, including their appearance on camera, any form of interaction, or indirect references to such actions.</li>
65    </ol>
66    <p>In case of a violation of these rules, the administration reserves the right to restrict the user's access to the platform and its resources.</p>
67  `,ru:`
68    <h3>Правила использования платформы</h3>
69    <p>Пользователям запрещается распространять, обсуждать или публиковать контент, содержащий следующее:</p>
70    <ol>
71      <li>Любую эксплуатацию несовершеннолетних, а также пропаганду насильственных действий в их отношении.</li>
72      <li>Политическую агитацию, пропаганду, обсуждения или дискуссии.</li>
73      <li>Пропаганду, демонстрацию или употребление наркотических веществ.</li>
74      <li>Материалы, содержащие насилие, угрозы, призывы к жестоким действиям, их пропаганду, а также героизацию терроризма или экстремизма.</li>
75      <li>Призывы к суициду, пропаганду самоповреждений или связанные с этим демонстрации и обсуждения.</li>
76      <li>Порнографический контент, включая использование сексуальных игрушек, мастурбацию, половые акты, их имитацию, а также акцентированный показ генитаÐ
76»Ð¸Ð¹.</li>
77      <li>Сбор, поиск или разглашение личной информации, включая, но не ограничиваясь: реальными именами, фамилиями, адресами проживания, местоположением, ссылками на социальные сети, адресами электронной почты, номерами телефонов.</li>
78      <li>Обмен контактными данными или попытки установить связь за пределами платформы, включая передачу или запрос аккаунтов в социальных сетях, имён пользователей, контактов в мессенджерах, аккаунтов на других платформах, адресов электронной почты, номеров телефонов или любых иных способов связи вне платформы. За нарушение данного правила могут применяться финансовые штрафы.</li>
79      <li>Рекламу, продвижение сторонних платформ, товаров или услуг без предварительного согласования с администрацией.</li>
80      <li>Спам, флуд, троллинг, оскорбления и любую другую недобросовестную активность в чате.</li>
81      <li>Любое присутствие или участие животных в откровенном контенте, включая нахождение в кадре, взаимодействие либо косвенные намёки на подобные действия.</li>
82    </ol>
83    <p>В случае нарушения данных правил администрация имеет право ограничить доступ пользователя к платформе и ее ресурсам.</p>
84  `,es:`
85    <h3>Reglas del sitio</h3>
86    <p>Se prohíbe a los usuarios distribuir, discutir o compartir contenido que incluya lo siguiente:</p>
87    <ol>
88      <li>Cualquier explotación de menores o propaganda de acciones violentas en su contra.</li>
89      <li>Campañas políticas, propaganda o discusiones políticas.</li>
90      <li>Promoción, demostración o uso de sustancias narcóticas.</li>
91      <li>Contenido que involucre violencia, amenazas, incitación a la crueldad o su promoción, así como la glorificación del terrorismo o extremismo.</li>
92      <li>Fomento del suicidio, promoción de autolesiones o discusiones y demostraciones relacionadas.</li>
93      <li>Contenido pornográfico, incluyendo el uso de juguetes sexuales, masturbación, actos sexuales, su simulación o la exhibición explícita de genitales.</li>
94      <li>Recolección, solicitud o divulgación de información personal, incluyendo, pero no limitado a: nombres reales, apellidos, direcciones residenciales, ubicaciones, enlaces a redes sociales, direcciones de e-mail o números de teléfono.</li>
95      <li>Intercambio de información de contacto o intentos de establecer comunicación fuera de la plataforma, incluyendo compartir o solicitar cuentas de redes sociales, nombres de usuario, contactos de mensajería, cuentas en otras plataformas, direcciones de correo electrónico, números de teléfono o cualquier otro medio de comunicación externo. Las infracciones de esta norma pueden dar lugar a sanciones económicas.</li>
96      <li>Publicidad o promoción de plataformas, productos o servicios de terceros sin la aprobación previa de la administración.</li>
97      <li>Spam, flooding, trolling, insultos u otras actividades maliciosas en los chats.</li>
98      <li>Cualquier presencia o participación de animales en contenido explícito, incluyendo su aparición en cámara, cualquier forma de interacción o referencias indirectas a dichas acciones.</li>
99    </ol>
100    <p>En caso de incumplimiento de estas normas, la administración se reserva el derecho de restringir el acceso del usuario al sitio y a sus recursos.</p>
101  `},subscriptions:{en:"Subscriptions",ru:"Подписки",es:"Suscripciones"},subscription_username:{en:"Username",ru:"Имя пользователя",es:"Usuario"},subscription_datetime:{en:"Subscribed at",ru:"Дата подписки",es:"Suscrito el"},spendingEarningsWarning:{en:"The chosen amount exceeds your current balance, remaining amount will be deducted from your earnings, and can no longer be withdrawn, are you sure?",ru:"Выбранная вами сумма превышает ваш текущий баланс, недостающая часть будет вычтена из вашего заработка и больше не сможет быть выведена. Вы уверены, что хотите продолжить?",es:"La cantidad elegida supera tu saldo actual, el monto restante se descontará de tus ganancias y ya no podrá ser retirado, ¿estás seguro?"},deposit_title:{en:"Deposit",ru:"Депозит",es:"Depositar"},deposit_submit:{en:"Deposit",ru:"Пополнить",es:"Depositar"},statistics:{en:"Statistics",ru:"Статистика",es:"Estadísticas"},statistics_description:{en:"<h3>Statistics</h3><p>Welcome to the earnings statistics section of your account! The time in the table is displayed in your local time zone, and the earnings shown are net amounts (after commission deductions).</p>",ru:"<h3>Статистика</h3><p>Добро пожаловать в раздел статистики вашего заработка на сайте! Время в таблице местное, а заработок указан на руки, после вычета комиссии.</p>",es:"<h3>Estadísticas</h3><p>Bienvenido a la sección de estadísticas de ganancias de tu cuenta! El horario que aparece en la tabla está en tu zona horaria local, y las ganancias mostradas son montos netos (después de las deducciones por comisión).</p>"},statistics_start:{en:"Start stream",ru:"Начало стрима",es:"Comienzo de transmisión"},statistics_finish:{en:"End stream",ru:"Конец стрима",es:"Fin de transmisión"},statistics_duration:{en:"Duration",ru:"Продолжительность",es:"Duración"},statistics_donations:{en:"Donations received",ru:"Получено донатов",es:"Donaciones recibidas"},statistics_dares:{en:"Dares earning",ru:"Заработок от вызовов",es:"Ganancias por retos"},statistics_total:{en:"Total",ru:"Всего",es:"Total"},save_language:{en:"Save language",ru:"Выбрать язык",es:"Guardar idioma"},translator_target_lang:{en:"Translator target language",ru:"Язык переводчиÐ
101ºÐ°",es:"Idioma objetivo del traductor"},set_language_tip:{en:"Choose the language for translating all messages and dares",ru:"Выберите язык, на который будут переводится сообщения и вызовы",es:"Seleccione el idioma para traducir todos los mensajes y retos."},alert_text:{en:"New top up options available! Bank cards, Telegram Stars, crypto (USDC/USDT on chains TRC20, ERC20, BSC)",ru:"Доступны пополнения банковскими картами РФ и СБП!",es:"¡Nuevas opciones de recarga disponibles! Tarjetas bancarias, Telegram Stars, cripto (USDC/USDT en cadenas TRC20, ERC20, BSC)"},alert_link:{en:" here",ru:"тут",es:" aquí"},support:{en:"Support",ru:"Поддержка",es:"Soporte"},rating:{en:"Rating",ru:"Рейтинг",es:"Valoración"},rating_title:{en:"Leaderboard",ru:"Лидеры рейтинга",es:"Tabla de posiciones"},rating_description:{en:"Welcome to the Leaderboard Page! The rating points are calculated based on activity during the calendar month.",ru:"Добро пожаловать на страницу рейтинга! Очки рейтинга рассчитывается исходя из активности за календарный месяц.",es:"Bienvenido a la página de la tabla de posiciones! La calificación se calcula según la actividad durante el mes calendario."},check_prizes_and_calculation:{en:"More information about how the rating is calculated",ru:"Подробнее про методику расчета",es:"Más información sobre cómo se calcula la clasificación"},rating_info_modal_title:{en:"Rating conditions",ru:"Условия рейтинга",es:"Condiciones de calificación"},rating_info_modal_description:{en:`
102      <p>The rating points are calculated based on activity during the current calendar month. At the end of the month, the rating points will be reset.</p>
103      <h4>For streamers, the following factors are considered:</h4>
104      <ul>
105        <li>Earnings from paid streams entry fees</li>
106        <li>Received donations</li>
107        <li>Earnings from completed challenges (main criterion)</li>
108      </ul>
109      <h4>For donors, the following are taken into account:</h4>
110      <ul>
111        <li>Spendings on entries to paid streams</li>
112        <li>Total donation amount</li>
113        <li>Contributions to dares</li>
114      </ul>
115    `,ru:`
116      <p>Очки рейтинга рассчитывается исходя из активности за календарный месяц.</p>
117      <h4>Для стримеров учитывается:</h4>
118      <ul>
119        <li>Заработок от оплаты входа в платный стрим</li>
120        <li>Полученные донаты</li>
121        <li>Заработок от выполнения заданий (основной критерий)</li>
122      </ul>
123      <h4>Для донатеров учитываются:</h4>
124      <ul>
125        <li>Затраты на покупку входа в платные стримы</li>
126        <li>Сумма донатов</li>
127        <li>Вложения в вызовы</li>
128      </ul>
129    `,es:`
130      <p>La clasificación se calcula en función de la actividad durante el mes calendario actual. Al finalizar el mes, la clasificación se restablecerá.</p>
131      <h4>Para los streamers, se consideran los siguientes factores:</h4>
132      <ul>
133        <li>Ganancias por precio de entrada en transmisiones pagas</li>
134        <li>Donaciones Recibidas</li>
135        <li>Ganancias de retos completados (factor principal)</li>
136      </ul>
137      <h4>Para los donadores, se toman en cuenta los siguientes aspectos:</h4>
138      <ul>
139        <li>Gastos en entradas a transmisiones pagas</li>
140        <li>Total de donaciones</li>
141        <li>Contribuciones a retos</li>
142      </ul>
143    `},paid_stream_enter:{en:"Enter the stream",ru:"Войти в стрим",es:"Ingresar a la transmisión"},paid_stream_warning_viewer:{en:"Paid stream is a special version of the regular stream. The same rules apply here as they do for the usual public stream.",ru:"Платный стрим - это режим обычного публичного стрима. В нем действуют такие же правила, как и в обычных трансляциях.",es:"La transmisión paga es una versión especial de una transmisión regular. Aquí se aplican las mismas reglas que para la transmisión pública habitual."},paid_stream_warning_streamer:{en:"Paid streams require users to pay a fee of your choosing to join the stream. Until they pay, they can neither view the stream nor participate in the chat nor create dares and contribute there.",ru:"Платные стримы требуют от пользователей оплаты выбранной вами суммы для входа в стрим. Пока они не оплатят, они не смогут ни просматривать стрим, ни общаться в чате, ни создавать или вносить деньги в вызовы.",es:"Las transmisiones pagas requieren que los usuarios paguen una tarifa que tú elijas para unirse a la misma. Hasta que paguen, no pueden ni ver la transmisión, ni participar en el chat, ni crear retos o contribuir en ellos."},paid_stream_description:{en:"Please describe the theme/content of the stream",ru:"Пожалуйста, укажите тему стрима или опишите, что планируете делать",es:"Por favor, describe el tema o contenido de la transmisión"},my_profile:{en:"My profile",ru:"Мой профиль",es:"Mi perfil"},stream_via:{en:"Stream via",ru:"Стрим с помощью",es:"Transmitir mediante"},browser:{en:"Browser",ru:"Браузера",es:"Navegador"},thirdparty:{en:"3rd party",ru:"Приложения",es:"Aplicación externa"}
143,via_support_info_text:{en:"When you choose the Via Support option, you'll be asked to select your preferred payment method and the amount you'd like to top up. Once that's done, a member of our support team will reach out with the payment details to help you complete the process smoothly.",ru:"Когда вы выбираете пополнение через поддержку, вам нужно будет выбрать метод и сумму пополнения. После этого представитель администрации свяжется с вами для предоставления реквизитов и помощи в оплате.",es:"Cuando eliges la opción de pago mediante soporte, se te pedirá que selecciones tu método de pago preferido y el monto que deseas recargar. Una vez hecho esto, un miembro de nuestro equipo de soporte se pondrá en contacto contigo con los detalles de pago."},via_support_info_title:{en:"Via Support Payment Information",ru:"Информация о пополнении через поддержку",es:"Información de pago mediante soporte"},consent_agreement_required:{en:"Dear Users! Before launching stream it is necessary to sign consent agreement.",ru:"Дорогие пользователи! Перед запуском стрима необходимо подписать соглашение.",es:"¡Estimados usuarios! Antes de iniciar la transmisión es necesario firmar el acuerdo de consentimiento."},click_here_to_sign:{en:"Click here to do it",ru:"Нажмите тут, чтобы сделать это",es:"Haga clic aquí para hacerlo"},consent_agreement_title:{en:"Agreement",ru:"Соглашение",es:"Acuerdo"},consent_agreement_full_title:{en:"Agreement",ru:"Соглашение",es:"Acuerdo"},consent_agreement_accept:{en:"Accept",ru:"Принять",es:"Aceptar"},cancel_agreement:{en:"Close",ru:"Закрыть",es:"Cerrar"},agree_and_continue:{en:"Accept and continue",ru:"Принять и продолжить",es:"Aceptar y continuar"},posts:{en:"Posts",ru:"Посты",es:"Publicaciones"},paid_stream_invite_only:{en:"This is an invite-only stream. Join the chat and interact with the streamer to get invited to the next one!",ru:"Это трансляция только по приглашению. Общайтесь в чате и взаимодействуйте со стримером, чтобы получить приглашение на следующую!",es:"Esta es una transmisión solo por invitación. Participa en el chat e interactúa con el streamer para recibir una invitación a la próxima."},age_verification_title:{en:"Verify Your Age",ru:"Подтвердите Ваш возраст",es:"Verificar su edad"},age_verification_text:{en:`Please upload a government-issued ID (e.g., passport, driver's license) to verify your age.
144
145For your privacy and security, please ensure that only your photo and date of birth are visible. You may cover or redact all other personal information (such as ID number, address, and other details).
146
147Accepted formats: JPG, PNG, or PDF (max 10 MB).`,ru:`Пожалуйста, загрузите документ, удостоверяющий личность, выданный государственным органом (например, паспорт или водительское удостоверение) для подтверждения вашего возраста.
148
149Для защиты вашей конфиденциальности и безопасности убедитесь, что на документе видны только ваша фотография и дата рождения. Вы можете скрыть всю остальную личную информацию (такую как номер документа, адрес, имя и фамилию и другие данные).
150
151Допустимые форматы: JPG, PNG или PDF (максимум 10 МБ).`,es:`Por favor, cargue un documento de identidad emitido por el gobierno (por ejemplo, pasaporte o licencia de conducir) para verificar su edad.
152
153Para su privacidad y seguridad, asegúrese de que solo sean visibles su fotografía y fecha de nacimiento. Puede cubrir u ocultar toda la demás información personal (como número de identificación, dirección y otros datos).
154
155Formatos aceptados: JPG, PNG o PDF (máximo 10 MB).`},post_verify_age_warning:{en:"Please verify your age to post content publicly",ru:"Пожалуйста, подтвердите свой возраст, чтобы публиковать контент",es:"Por favor, verifica tu edad para publicar contenido públicamente"}
155,verify_now:{en:"Verify now",ru:"Подтвердить сейчас",es:"Verificar ahora"},age_verification_approved:{en:"Your documents have been approved!",ru:"Ваши документы были подтверждены!",es:"¡Tus documentos han sido verificados!"},withdrawal_title:{en:"Withdraw Funds",ru:"Вывод средств",es:"Retirar fondos"},withdrawal_info:{en:"Info",ru:"Информация",es:"Información"},withdrawal_current_earnings:{en:"Current Earnings",ru:"Текущий заработок",es:"Ganancias actuales"},can_withdraw_message:{en:"Congratulations! You can withdraw your earnings now.",ru:"Поздравляем! Вы можете сейчас вывести ваш заработок.",es:"¡Felicitaciones! Ahora puede retirar sus ganancias."},request_funds:{en:"Request Funds",ru:"Вывод средств",es:"Solicitar fondos"},past_withdrawals:{en:"Past Withdrawals",ru:"Прошедшие выплаты",es:"Retiros anteriores"},bank_card:{en:"Bank card",ru:"Банковская карта",es:"Tarjeta bancaria"},bank_card_description:{en:"Bank card transfer",ru:"Вывод на банковскую карту",es:"Transferencia con tarjeta bancaria"},crypto:{en:"Crypto",ru:"Криптовалюта",es:"Cripto"},crypto_description:{en:"Crypto withdrawal",ru:"Вывод криптовалютой",es:"Retiro en cripto"},paypal_description:{en:"PayPal withdrawal",ru:"Вывод на PayPal",es:"Retiro mediante PayPal"},wallet_address:{en:"Wallet address",ru:"Адрес кошелька",es:"Dirección de billetera"},russian_bank_card:{en:"Russian Card",ru:"Карта РФ",es:"Tarjeta rusa"},russian_bank_card_description:{en:"Russian bank card transfer",ru:"Вывод на карту российского банка",es:"Transferencia a tarjeta bancaria rusa"},withdrawal_request_notification:{en:"Withdrawal request successfully created",ru:"Запрос на вывод успешно создан",es:"Solicitud de retiro creada exitosamente"},withdrawal_request_notification_message:{en:"Your request will be processed within 3 days. Support may contact you for additional details.",ru:"Ваш запрос на вывод будет обработан в течение 3 дней. Пожалуйста, проверяйте чат поддержки на сайте в этот период, поскольку нам может понадобиться уточнить информацию по платежу.",es:"Su solicitud será procesada en un plazo de 3 días. El equipo de soporte puede contactarle para solicitar detalles adicionales."},topup_ru_bank_card:{en:"Russian bank card",ru:"Пополнение картой российского банка"},topup_sbp:{en:"FPS (SBP)",ru:"СБП"},topup_pay_action:{en:"Pay",ru:"Заплатить",es:"Pagar"},feed:{en:"Feed",ru:"Посты",es:"Publicaciones"},top_up_warning_text_bank_card:{en:"After a successful payment, your balance should update immediately. If it hasn't, please contact our support team.",ru:"После успешной оплаты ваш баланс должен обновиться немедленно. Если этого не произошло, пожалуйста, свяжитесь со службой поддержки.",es:"Tras un pago exitoso, tu saldo debería actualizarse de inmediato. Si no ha ocurrido, por favor contacta a nuestro equipo de soporte."},crypto_payment_warning:{en:"Send exactly {{amount}} {{coin}} on the {{network}} network only. Sending any other coin or using a different network will result in permanent loss of funds. Funds should be credited to your account within 5 minutes. If they are not, please contact our support team and provide the transaction hash.",ru:"Отправьте ровно {{amount}} {{coin}} только в сети {{network}}. Отправка любой другой монеты или использование другой сети приведёт к безвозвратной потере средств. Средства должны поступить на ваш счёт в течение 5 минут. Если этого не произошло, пожалуйста, свяжитесь со службой поддержки и предоставьте хэш транзакции.",es:"Envía exactamente {{amount}} {{coin}} solo en la red {{network}}. Enviar otra moneda o usar una red diferente resultará en la pérdida permanente de los fondos. Los fondos deberían acreditarse en tu cuenta en un plazo de 5 minutos. Si no es así, contacta a 
155nuestro equipo de soporte y proporciona el hash de la transacción."},bundles:{en:"Bundles",ru:"Наборы",es:"Paquetes"},bundles_title:{en:"Bundles",ru:"Наборы",es:"Paquetes"},bundles_page_description:{en:"Upload, package, sell, and manage your media.",ru:"Загружайте, объединяйте, продавайте и управляйте своими медиафайлами.",es:"Subí, creá, vendé y administrá tus archivos multimedia."},bundles_nav_my_media:{en:"My media",ru:"Мои медиа",es:"Mis archivos"},bundles_nav_media_short:{en:"Media",ru:"Медиа",es:"Archivos"},bundles_nav_my_bundles:{en:"My bundles",ru:"Мои наборы",es:"Mis paquetes"},bundles_nav_bundles_short:{en:"Bundles",ru:"Наборы",es:"Paquetes"},bundles_nav_available:{en:"Available bundles",ru:"Доступные наборы",es:"Paquetes disponibles"},bundles_nav_available_short:{en:"Available",ru:"Доступные",es:"Disponibles"},bundles_nav_shared_by_me:{en:"Shared by me",ru:"Я поделился",es:"Compartidos por mí"},bundles_nav_share_short:{en:"Shared",ru:"Общие",es:"Compartidos"},bundles_nav_sales:{en:"Sales",ru:"Продажи",es:"Ventas"},bundles_scroll_menu_left:{en:"Scroll menu left",ru:"Прокрутить меню влево",es:"Desplazar el menú a la izquierda"},bundles_scroll_menu_right:{en:"Scroll menu right",ru:"Прокрутить меню вправо",es:"Desplazar el menú a la derecha"},bundles_upload_media:{en:"Upload media",ru:"Загрузить медиа",es:"Subí archivos multimedia"},bundles_upload_media_description:{en:"Add photos or videos, then reuse them in multiple bundles.",ru:"Добавляйте фото и видео, а затем используйте их в нескольких наборах.",es:"Agregá fotos o videos y reutilizalos en distintos paquetes."},bundles_photo:{en:"Photo",ru:"Фото",es:"Foto"},bundles_video:{en:"Video",ru:"Видео",es:"Video"},bundles_upload:{en:"Upload",ru:"Загрузить",es:"Subir"},bundles_upload_complete_title:{en:"Upload complete",ru:"Загрузка завершена",es:"Carga completada"},bundles_upload_complete_message:{en:"The media was uploaded.",ru:"Медиафайл загружен.",es:"El archivo se ha subido."},bundles_upload_failed_title:{en:"Upload failed",ru:"Ошибка загрузки",es:"Error al subir"},bundles_upload_failed_message:{en:"Could not upload the file.",ru:"Не удалось загрузить файл.",es:"No se pudo subir el archivo."},bundles_section_title:{en:"Bundles",ru:"Наборы",es:"Paquetes"},bundles_section_description:{en:"Created and purchased bundles appear here.",ru:"Здесь отображаются созданные и купленные наборы.",es:"Los paquetes creados y comprados aparecen aquí."},bundles_no_bundles_title:{en:"No bundles yet",ru:"Наборов пока нет",es:"Todavía no hay paquetes"},bundles_no_bundles_create_description:{en:"Select media below to create your first bundle.",ru:"Выберите медиафайлы ниже, чтобы создать первый набор.",es:"Seleccioná archivos multimedia abajo para crear tu primer paquete."},bundles_owned:{en:"Owned",ru:"Куплено",es:"Comprado"},bundles_yours:{en:"Yours",ru:"Ваш",es:"Tuyo"},bundles_discontinued:{en:"Discontinued",ru:"Снят с продажи",es:"Retirado"},bundles_create_bundle:{en:"Create bundle",ru:"Создать набор",es:"Crear paquete"},bundles_your_media:{en:"Your media",ru:"Ваши медиа",es:"Tus archivos multimedia"},bundles_select_media_instruction:{en:"Select media you want to add. Press Next to continue.",ru:"Выберите медиафайлы для набора. Нажмите «Далее», чтобы продолжить.",es:"Selecciona los archivos que quieres añadir. Pulsa Siguiente para continuar."},bundles_uploaded_count:{en:"Uploaded items: {{count}}",ru:"Загружено файлов: {{count}}",es:"Archivos subidos: {{count}}"},bundles_cancel:{en:"Cancel",ru:"Отмена",es:"Cancelar"},bundles_nothing_uploaded_title:{en:"Nothing uploaded yet",ru:"Пока ничего не загружено",es:"Nada subido aún"}
155,bundles_nothing_uploaded_description:{en:"Upload your first photo or video above.",ru:"Загрузите первое фото или видео выше.",es:"Subí tu primer foto o video arriba."},bundles_choose_media:{en:"Choose media for this bundle",ru:"Выберите медиафайлы для набора",es:"Elige archivos para este paquete"},bundles_selected_count:{en:"Selected items: {{count}}",ru:"Выбрано файлов: {{count}}",es:"Elementos seleccionados: {{count}}"},bundles_select_at_least_one_media:{en:"Select at least one media",ru:"Выберите хотя бы один файл",es:"Selecciona al menos un archivo"},bundles_next:{en:"Next",ru:"Далее",es:"Siguiente"},bundles_video_preview:{en:"Video preview",ru:"Предпросмотр видео",es:"Vista previa del video"},bundles_photo_preview:{en:"Photo preview",ru:"Предпросмотр фото",es:"Vista previa de la foto"},bundles_preview:{en:"Preview",ru:"Предпросмотр",es:"Vista previa"},bundles_locked:{en:"Locked",ru:"Заблокировано",es:"Bloqueado"},bundles_selected:{en:"Selected",ru:"Выбрано",es:"Seleccionado"},bundles_not_selected:{en:"Not selected",ru:"Не выбрано",es:"No seleccionado"},bundles_untitled:{en:"Untitled bundle",ru:"Набор без названия",es:"Paquete sin título"},bundles_open_bundle:{en:"Open {{name}}",ru:"Открыть «{{name}}»",es:"Abrir {{name}}"}
155,bundles_share:{en:"Share",ru:"Поделиться",es:"Compartir"},bundles_share_bundle:{en:"Share bundle",ru:"Поделиться набором",es:"Compartir paquete"},bundles_your_bundles_title:{en:"Your bundles",ru:"Ваши наборы",es:"Tus paquetes"},bundles_your_bundles_description:{en:"Review and manage the bundles you created from Your media.",ru:"Просматривайте наборы, созданные из ваших медиафайлов, и управляйте ими.",es:"Revisa y administra los paquetes creados con tus archivos."},bundles_no_bundles_manage_description:{en:"Go to Your media, select the items you want, and create your first bundle.",ru:"Откройте раздел «Ваши медиа», выберите нужные файлы и создайте первый набор.",es:"Ve a Tus archivos, selecciona los elementos y crea tu primer paquete."},bundles_table_bundle:{en:"Bundle",ru:"Набор",es:"Paquete"},bundles_table_price:{en:"Price",ru:"Цена",es:"Precio"},bundles_table_created:{en:"Created",ru:"Создан",es:"Creado"},bundles_sales:{en:"Sales",ru:"Продажи",es:"Ventas"},bundles_delete:{en:"Delete",ru:"Удалить",es:"Eliminar"},bundles_delete_confirm:{en:"Delete {{name}}? Buyers will keep access.",ru:"Удалить «{{name}}»? Покупатели сохранят доступ.",es:"¿Eliminar {{name}}? Los compradores conservarán el acceso."},bundles_this_bundle:{en:"this bundle",ru:"этот набор",es:"este paquete"},bundles_deleted_title:{en:"Bundle deleted",ru:"Набор удалён",es:"Paquete eliminado"},bundles_deleted_message:{en:"The bundle was removed.",ru:"Набор удалён.",es:"El paquete se ha eliminado."},bundles_delete_failed_title:{en:"Delete failed",ru:"Не удалось удалить",es:"Error al eliminar"},bundles_delete_failed_message:{en:"Could not delete the bundle.",ru:"Не удалось удалить набор.",es:"No se pudo eliminar el paquete."},bundles_buyers_keep_access_tooltip:{en:"Buyers keep previously purchased access",ru:"Покупатели сохранят ранее приобретённый доступ",es:"Los compradores conservan el acceso adquirido"},bundles_back:{en:"Back",ru:"Назад",es:"Atrás"},bundles_price:{en:"Price",ru:"Цена",es:"Precio"},bundles_media_count:{en:"Media items: {{count}}",ru:"Медиафайлов: {{count}}",es:"Elementos multimedia: {{count}}"},bundles_empty_bundle:{en:"This bundle is empty",ru:"Этот набор пуст",es:"Este paquete está vacío"},bundles_purchase_complete_title:{en:"Purchase complete",ru:"Покупка завершена",es:"Compra completada"},bundles_purchase_complete_message:{en:"The bundle is now unlocked.",ru:"Набор разблокирован.",es:"El paquete ya está desbloqueado."},bundles_purchase_failed_title:{en:"Purchase failed",ru:"Ошибка покупки",es:"Error en la compra"},bundles_purchase_failed_message:{en:"Could not complete the purchase.",ru:"Не удалось завершить покупку.",es:"No se pudo completar la compra."},bundles_buy_for:{en:"Buy for {{price}}",ru:"Купить за {{price}}",es:"Comprar por {{price}}"},bundles_deleted_purchase_access:{en:"This bundle is no longer for sale, but it remains available because you purchased it.",ru:"Этот набор больше не продаётся, но остаётся доступным, поскольку вы его купили.",es:"Este paquete ya no está a la venta, pero sigue disponible porque lo compraste."},bundles_unavailable_message:{en:"This bundle is unavailable or no longer shared with your account.",ru:"Этот набор недоступен или больше не открыт для вашего аккаунта.",es:"Este paquete no está disponible o ya no se comparte con tu cuenta."},bundles_available_title:{en:"Available bundles",ru:"Доступные наборы",es:"Paquetes disponibles"},bundles_available_description:{en:"Bundles shared with you or made available to everyone.",ru:"Наборы, которыми поделились с вами или со всеми пользователями.",es:"Paquetes compartidos contigo o disponibles para todos."},bundles_no_available_title:{en:"No bundles available",ru:"Нет доступных наборов",es:"No hay paquetes disponibles"},bundles_no_available_description:{en:"New bundles shared with you will appear here automatically.",ru:"Новые наборы, которыми поделятся с вами, автоматически появятся здесь.",es:"Los nuevos paquetes compartidos contigo aparecerán aquí automáticamente."},bundles_purchased_title:{en:"Purchased bundles",ru:"Купленные наборы",es:"Paquetes comprados"},bundles_purchased_description:{en:"Everything you already own.",ru:"Все наборы, которыми вы уже владеете.",es:"Todo lo que ya has comprado."},bundles_nothing_purchased_title:{en:"Nothing purchased yet",ru:"Покупок пока нет",es:"Aún no has comprado nada"},bundles_nothing_purchased_description:{en:"Purchased bundles will appear here.",ru:"Купленные наборы появятся здесь.",es:"Los paquetes comprados aparecerán aquí."},bundles_seller_id:{en:"Seller #{{id}}",ru:"Продавец №{{id}}",es:"Vendedor n.º {{id}}"},bundles_shared_title:{en:"Shared bundles",ru:"Общие наборы",es:"Paquetes compartidos"},bundles_shared_description:{en:"Bundles you currently share with other users.",ru:"Наборы, которыми вы сейчас делитесь с другими пользователями.",es:"Paquetes que compartes actualmente con otros usuarios."},bundles_nothing_shared_title:{en:"Nothing shared right now",ru:"Сейчас ничего не опубликовано",es:"No compartes nada ahora"},bundles_nothing_shared_description:{en:"Bundles you share will appear here as folders.",ru:"Наборы, которыми вы поделитесь, появятся здесь в виде папок.",es:"Los paquetes que compartas aparecerán aquí como carpetas."},bundles_unshared_title:{en:"Bundle unshared",ru:"Публикация отменена",es:"Paquete dejado de compartir"},bundles_unshared_message:{en:"The bundle is no longer shared.",ru:"Набор больше не доступен другим пользователям.",es:"El paquete ya no está compartido."},bundles_unshare_failed_title:{en:"Unshare failed",ru:"Не удалось отменить публикацию",es:"No se pudo dejar de compartir"}
155,bundles_unshare_failed_message:{en:"Could not stop sharing the bundle.",ru:"Не удалось прекратить общий доступ к набору.",es:"No se pudo dejar de compartir el paquete."},bundles_actions:{en:"Bundle actions",ru:"Действия с набором",es:"Acciones del paquete"},bundles_unshare:{en:"Unshare",ru:"Закрыть доступ",es:"Dejar de compartir"},bundles_created_date:{en:"Created {{date}}",ru:"Создан {{date}}",es:"Creado el {{date}}"},bundles_total_sales:{en:"Total sales",ru:"Всего продаж",es:"Ventas totales"},bundles_revenue:{en:"Revenue",ru:"Выручка",es:"Ingresos"},bundles_last_sale:{en:"Last sale",ru:"Последняя продажа",es:"Última venta"},bundles_sales_history:{en:"Sales history",ru:"История продаж",es:"Historial de ventas"},bundles_sales_history_description:{en:"Track buyers and revenue.",ru:"Отслеживайте покупателей и выручку.",es:"Controla compradores e ingresos."},bundles_no_sales:{en:"No sales yet",ru:"Продаж пока нет",es:"Aún no hay ventas"},bundles_table_buyer:{en:"Buyer",ru:"Покупатель",es:"Comprador"},bundles_table_date:{en:"Date",ru:"Дата",es:"Fecha"},bundles_bundle_short_id:{en:"Bundle {{id}}",ru:"Набор {{id}}",es:"Paquete {{id}}"},bundles_buyer_id:{en:"Buyer #{{id}}",ru:"Покупатель №{{id}}
155",es:"Comprador n.º {{id}}"},bundles_sales_modal_title:{en:"Sales · {{id}}",ru:"Продажи · {{id}}",es:"Ventas · {{id}}"},bundles_price_validation:{en:"Price must be greater than zero",ru:"Цена должна быть больше нуля",es:"El precio debe ser mayor que cero"},bundles_no_media_selected_title:{en:"No media selected",ru:"Медиафайлы не выбраны",es:"No has seleccionado archivos"},bundles_no_media_selected_message:{en:"Select at least one media item first.",ru:"Сначала выберите хотя бы один медиафайл.",es:"Selecciona primero al menos un archivo."},bundles_created_title:{en:"Bundle created",ru:"Набор создан",es:"Paquete creado"},bundles_created_message:{en:"Your bundle is ready.",ru:"Ваш набор готов.",es:"Tu paquete está listo."},bundles_creation_failed_title:{en:"Creation failed",ru:"Не удалось создать",es:"Error al crear"},bundles_creation_failed_message:{en:"Could not create the bundle.",ru:"Не удалось создать набор.",es:"No se pudo crear el paquete."},bundles_details_title:{en:"Bundle details",ru:"Параметры набора",es:"Detalles del paquete"},bundles_almost_done:{en:"Almost done",ru:"Почти готово",es:"Casi listo"},bundles_selected_media_summary:{en:"Selected media: {{count}}. Set how the bundle will be presented and priced.",ru:"Выбрано медиафайлов: {{count}}. Настройте оформление и цену набора.",es:"Archivos seleccionados: {{count}}. Configura la presentación y el precio del paquete."},bundles_price_description:{en:"The amount a donator pays to unlock this bundle.",ru:"Сумма, которую донатор платит за разблокировку набора.",es:"La cantidad que paga un donante para desbloquear este paquete."},bundles_tag:{en:"Tag",ru:"Тег",es:"Etiqueta"},bundles_tag_description:{en:"Only visible to you (the model). Donators will not see it.",ru:"Виден только вам (модели). Донаторы его не увидят.",es:"Solo es visible para ti (la modelo). Los donantes no lo verán."},bundles_tag_placeholder:{en:"e.g. Summer set",ru:"Например, Летний набор",es:"p. ej., Colección de verano"},bundles_tag_explanation:{en:"Use the tag as a private label to quickly recognize the bundle later.",ru:"Используйте тег как личную метку, чтобы быстро найти набор позже.",es:"Usa la etiqueta como nombre privado para reconocer rápidamente el paquete."},bundles_description:{en:"Description",ru:"Описание",es:"Descripción"},bundles_description_help:{en:"Visible to the donator before purchase. Explain what they will receive.",ru:"Видно донатору до покупки. Объясните, что он получит.",es:"Visible para el donante antes de comprar. Explica qué recibirá."},bundles_description_placeholder:{en:"Tell the donator what is included in this bundle...",ru:"Расскажите донатору, что входит в этот набор...",es:"Explica al donante qué incluye este paquete..."},bundles_back_to_selection:{en:"Back to selection",ru:"Вернуться к выбору",es:"Volver a la selección"},bundles_share_title:{en:"Share {{name}}",ru:"Поделиться: {{name}}",es:"Compartir {{name}}"},bundles_share_description:{en:"Choose who can discover and purchase this bundle.",ru:"Выберите, кто сможет найти и купить этот набор.",es:"Elige quién puede descubrir y comprar este paquete."},bundles_specific_user:{en:"Specific user",ru:"Конкретный пользователь",es:"Usuario específico"},bundles_everyone:{en:"Everyone",ru:"Все",es:"Todos"},bundles_search_user:{en:"Search for a user by username",ru:"Найдите пользователя по имени",es:"Busca un usuario por nombre"},bundles_selected_user:{en:"Selected user: @{{username}}",ru:"Выбран пользователь: @{{username}}",es:"Usuario seleccionado: @{{username}}"},bundles_select_user_title:{en:"Select a user",ru:"Выберите пользователя",es:"Selecciona un usuario"},bundles_select_user_message:{en:"Search for and select a username first.",ru:"Сначала найдите и выберите имя пользователя.",es:"Primero busca y selecciona un nombre de usuario."},bundles_everyone_description:{en:"Every registered user will be able to buy this bundle.",ru:"Любой зарегистрированный пользователь сможет купить этот набор.",es:"Todos los usuarios registrados podrán comprar este paquete."},bundles_share_anonymously:{en:"Share anonymously",ru:"Поделиться анонимно",es:"Compartir de forma anónima"},bundles_share_anonymously_description:{en:"The donator will not see that this bundle was shared by you.",ru:"Донатор не увидит, что этим набором поделились вы.",es:"El donante no verá que tú compartiste este paquete."},bundles_shared_success_title:{en:"Bundle shared",ru:"Набор опубликован",es:"Paquete compartido"},bundles_shared_everyone_message:{en:"Everyone can now purchase it.",ru:"Теперь его может купить любой пользователь.",es:"Ahora todos pueden comprarlo."},bundles_shared_user_message:{en:"Shared with @{{username}}.",ru:"Открыт доступ для @{{username}}.",es:"Compartido con @{{username}}."},bundles_sharing_failed_title:{en:"Sharing failed",ru:"Не удалось поделиться",es:"Error al compartir"}
155,bundles_sharing_failed_message:{en:"Could not share the bundle.",ru:"Не удалось поделиться набором.",es:"No se pudo compartir el paquete."},create_dare_explanation:{en:"Suggest a task and contribute toward getting it accepted.",ru:"Предложите задание и внесите свой вклад, чтобы стример его принял.",es:"Sugiere una tarea y contribuye para que el streamer la acepte."},dare_goal:{en:"Goal",ru:"Цель",es:"Objetivo"},dare_goal_help:{en:"What is the goal?",ru:"Что такое цель?",es:"¿Qué es el objetivo?"},dare_goal_tooltip:{en:"The goal is the suggested total amount for the streamer to accept and complete this dare. Other users can contribute toward it.",ru:"Цель — это рекомендуемая общая сумма, за которую стримеру предлагается принять и выполнить это задание. Другие пользователи также могут вносить свой вклад.",es:"El objetivo es la cantidad total sugerida para que el streamer acepte y complete este reto. Otros usuarios también pueden contribuir."},dare_goal_explanation:{en:"Suggested amount for accepting the dare. Minimum: $0.10",ru:"Рекомендуемая сумма за принятие задания. Минимум: $0.10",es:"Cantidad sugerida para aceptar el reto. Mínimo: $0.10"},dare_amount_explanation:{en:"Amount you want to contribute now. Minimum: $0.10",ru:"Сумма, которую вы хотите внести сейчас. Минимум: $0.10",es:"Cantidad que quieres aportar ahora. Mínimo: $0.10"},dare_contributions_explanation:{en:"Your contribution does not need to cover the entire goal. Other users can contribute to the dare later.",ru:"Ваш вклад не обязан покрывать всю цель. Другие пользователи смогут внести деньги в это задание позже.",es:"Tu contribución no tiene que cubrir todo el objetivo. Otros usuarios podrán contribuir al reto más tarde."},dare_validation_description_required:{en:"Description cannot be empty",ru:"Описание не может быть пустым",es:"La descripción no puede estar vacía"},dare_validation_amount_range:{en:"Contribution must be between $0.10 and $9,999",ru:"Вклад должен быть от $0.10 до $9,999",es:"La contribución debe estar entre $0.10 y $9,999"},dare_validation_goal_range:{en:"Goal must be between $0.10 and $9,999",ru:"Цель должна быть от $0.10 до $9,999",es:"El objetivo debe estar entre $0.10 y $9,999"},login_required:{en:"Please log in",ru:"Пожалуйста, войдите в аккаунт",es:"Por favor, inicia sesión"},cancel:{en:"Cancel",ru:"Отмена",es:"Cancelar"},dare_raised:{en:"Raised",ru:"Собрано",es:"Recaudado"},search_users_placeholder:{en:"Search users...",ru:"Найти пользователя...",es:"Buscar usuarios..."},public_chat_title:{en:"Public chat",ru:"Общий чат",es:"Chat público"},public_chat_user_fallback:{en:"User",ru:"Пользователь",es:"Usuario"},public_chat_online_count:{en:"{{count}} online",ru:"В сети: {{count}}",es:"{{count}} en línea"},public_chat_header_people_online:{en:"People online",ru:"Пользователи в сети",es:"Personas en línea"},public_chat_header_settings:{en:"Chat settings",ru:"Настройки чата",es:"Ajustes del chat"},public_chat_day_today:{en:"Today",ru:"Сегодня",es:"Hoy"},public_chat_day_yesterday:{en:"Yesterday",ru:"Вчера",es:"Ayer"},public_chat_empty_title:{en:"Public chat is quiet",ru:"В общем чате тихо",es:"El chat público está tranquilo"},public_chat_empty_description:{en:"Be the first to start the conversation.",ru:"Начните разговор первым.",es:"Sé el primero en iniciar la conversación."},public_chat_new_messages_count:{en:"New messages: {{count}}",ru:"Новых сообщений: {{count}}",es:"Mensajes nuevos: {{count}}"},public_chat_new_messages_newest:{en:"Newest messages",ru:"Новые сообщения",es:"Mensajes más recientes"},public_chat_pinned_by:{en:"Pinned · {{username}}",ru:"Закреплено · {{username}}",es:"Fijado · {{username}}"},public_chat_message_open_profile:{en:"Open {{username}} profile",ru:"Открыть профиль {{username}}",es:"Abrir el perfil de {{username}}"},public_chat_message_pinned:{en:"Pinned message",ru:"Закреплённое сообщение",es:"Mensaje fijado"},public_chat_message_actions:{en:"Message actions",ru:"Действия с сообщением",es:"Acciones del mensaje"},public_chat_message_translate:{en:"Translate",ru:"Перевести",es:"Traducir"},public_chat_message_reply:{en:"Reply",ru:"Ответить",es:"Responder"},public_chat_message_copy:{en:"Copy",ru:"Копировать",es:"Copiar"},public_chat_message_edit:{en:"Edit",ru:"Редактировать",es:"Editar"},public_chat_message_pin:{en:"Pin message",ru:"Закрепить сообщение",es:"Fijar mensaje"},public_chat_message_unpin:{en:"Unpin",ru:"Открепить",es:"Desfijar"},public_chat_message_delete:{en:"Delete",ru:"Удалить",es:"Eliminar"},public_chat_message_delete_confirm:{en:"Delete this message?",ru:"Удалить это сообщение?",es:"¿Eliminar este mensaje?"}
155,public_chat_message_cancel_edit:{en:"Cancel editing",ru:"Отменить редактирование",es:"Cancelar edición"},public_chat_message_save_edit:{en:"Save edited message",ru:"Сохранить изменения",es:"Guardar mensaje editado"},public_chat_message_attachment_alt:{en:"Chat attachment",ru:"Вложение в чате",es:"Archivo adjunto del chat"},public_chat_composer_placeholder:{en:"Message public chat",ru:"Сообщение в общий чат",es:"Mensaje al chat público"},public_chat_composer_sign_in:{en:"Sign in to chat",ru:"Войдите, чтобы писать в чат",es:"Inicia sesión para chatear"},public_chat_composer_emoji:{en:"Emoji",ru:"Эмодзи",es:"Emoji"},public_chat_composer_add_emoji:{en:"Add emoji",ru:"Добавить эмодзи",es:"Añadir emoji"},public_chat_composer_attach_media:{en:"Attach image or video",ru:"Прикрепить изображение или видео",es:"Adjuntar imagen o vídeo"},public_chat_composer_send:{en:"Send",ru:"Отправить",es:"Enviar"},public_chat_composer_replying_to:{en:"Replying to {{username}}",ru:"Ответ для {{username}}",es:"Respondiendo a {{username}}"},public_chat_composer_cancel_reply:{en:"Cancel reply",ru:"Отменить ответ",es:"Cancelar respuesta"},public_chat_media_send_video:{en:"Send video",ru:"Отправить видео",es:"Enviar vídeo"},public_chat_media_send_image:{en:"Send image",ru:"Отправить изображение",es:"Enviar imagen"},public_chat_media_close_preview:{en:"Close preview",ru:"Закрыть предпросмотр",es:"Cerrar vista previa"},public_chat_media_upload_not_connected:{en:"Media upload is not connected yet.",ru:"Загрузка медиа пока не подключена.",es:"La carga de archivos multimedia aún no está conectada."},public_chat_media_change:{en:"Change",ru:"Изменить",es:"Cambiar"},public_chat_media_send:{en:"Send",ru:"Отправить",es:"Enviar"},public_chat_settings_title:{en:"Chat settings",ru:"Настройки чата",es:"Ajustes del chat"},public_chat_settings_translation:{en:"Translation",ru:"Перевод",es:"Traducción"},public_chat_settings_translation_description:{en:"Choose how public messages should be translated.",ru:"Выберите, как переводить сообщения общего чата.",es:"Elige cómo se traducirán los mensajes públicos."},public_chat_settings_preferred_language:{en:"Preferred language",ru:"Предпочитаемый язык",es:"Idioma preferido"},public_chat_settings_auto_translate:{en:"Translate automatically",ru:"Переводить автоматически",es:"Traducir automáticamente"},public_chat_settings_auto_translate_description:{en:"Incoming messages will use your preferred language.",ru:"Входящие сообщения будут переводиться на выбранный язык.",es:"Los mensajes entrantes usarán tu idioma preferido."},public_chat_settings_time:{en:"Time",ru:"Время",es:"Hora"},public_chat_settings_time_description:{en:"Choose how message timestamps are displayed.",ru:"Выберите формат времени сообщений.",es:"Elige cómo se muestran las horas de los mensajes."},public_chat_settings_time_format:{en:"Time format",ru:"Формат времени",es:"Formato de hora"},public_chat_settings_time_format_24:{en:"24-hour · 18:30",ru:"24 часа · 18:30",es:"24 horas · 18:30"},public_chat_settings_time_format_12:{en:"12-hour · 6:30 PM",ru:"12 часов · 6:30 PM",es:"12 horas · 6:30 PM"},public_chat_settings_notifications:{en:"Notifications",ru:"Уведомления",es:"Notificaciones"},public_chat_settings_notifications_description:{en:"Control public-chat notifications.",ru:"Управляйте уведомлениями общего чата.",es:"Controla las notificaciones del chat público."},public_chat_settings_enable_notifications:{en:"Enable notifications",ru:"Включить уведомления",es:"Activar notificaciones"},public_chat_settings_enable_notifications_description:{en:"Mentions and important chat activity.",ru:"Упоминания и важные события в чате.",es:"Menciones y actividad importante del chat."},public_chat_settings_ui_only_hint:{en:"These settings are currently stored only in the interface until the settings API is connected.",ru:"Пока API настроек не подключён, эти параметры сохраняются только в интерфейсе.",es:"Hasta que se conecte la API de ajustes, estas opciones solo se guardan en la interfaz."},public_chat_settings_save:{en:"Save settings",ru:"Сохранить настройки",es:"Guardar ajustes"},public_chat_viewers_title:{en:"People online",ru:"Пользователи в сети",es:"Personas en línea"},public_chat_viewers_count:{en:"Online: {{count}}",ru:"В сети: {{count}}",es:"En línea: {{count}}"},public_chat_viewers_close:{en:"Close viewer list",ru:"Закрыть список пользователей",es:"Cerrar lista de usuarios"},public_chat_viewers_load_error:{en:"Could not load the list",ru:"Не удалось загрузить список",es:"No se pudo cargar la lista"},public_chat_viewers_empty:{en:"Nobody to show yet",ru:"Пока никого нет",es:"Aún no hay nadie que mostrar"},public_chat_viewers_online:{en:"online",ru:"в сети",es:"en línea"},public_chat_language_en:{en:"English",ru:"Английский",es:"Inglés"},public_chat_language_ru:{en:"Russian",ru:"Русский",es:"Ruso"},public_chat_language_uk:{en:"Ukrainian",ru:"Украинский",es:"Ucraniano"},public_chat_language_vi:{en:"Vietnamese",ru:"Вьетнамский",es:"Vietnamita"},public_chat_language_pl:{en:"Polish",ru:"Польский",es:"Polaco"},public_chat_language_de:{en:"German",ru:"Немецкий",es:"Alemán"},public_chat_language_fr:{en:"French",ru:"Французский",es:"Francés"},public_chat_language_es:{en:"Spanish",ru:"Испанский",es:"Español"},public_chat_language_pt:{en:"Portuguese",ru:"Португальский",es:"Portugués"},public_chat_language_ja:{en:"Japanese",ru:"Японский",es:"Japonés"},public_chat_language_ko:{en:"Korean",ru:"Корейский",es:"Coreano"},public_chat_language_zh:{en:"Chinese (Simplified)",ru:"Китайский (упрощённый)",es:"Chino (simplificado)"},public_chat_emoji_search:{en:"Search",ru:"Поиск",es:"Buscar"},public_chat_emoji_no_results_title:{en:"Nothing found",ru:"Ничего не найдено",es:"No se encontró nada"},public_chat_emoji_no_results_description:{en:"Try another search.",ru:"Попробуйте другой запрос.",es:"Prueba otra búsqueda."},public_chat_emoji_pick:{en:"Pick an emoji",ru:"Выберите эмодзи",es:"Elige un emoji"},public_chat_emoji_add_custom:{en:"Add custom emoji",ru:"Добавить свой эмодзи",es:"Añadir emoji personalizado"},public_chat_emoji_category_activity:{en:"Activity",ru:"Активность",es:"Actividad"},public_chat_emoji_category_custom:{en:"Custom",ru:"Свои",es:"Personalizados"},public_chat_emoji_category_flags:{en:"Flags",ru:"Флаги",es:"Banderas"},public_chat_emoji_category_foods:{en:"Food & Drink",ru:"Еда и напитки",es:"Comida y bebida"},public_chat_emoji_category_frequent:{en:"Frequently used",ru:"Часто используемые",es:"Usados frecuentemente"},public_chat_emoji_category_nature:{en:"Animals & Nature",ru:"Животные и природа",es:"Animales y naturaleza"},public_chat_emoji_category_objects:{en:"Objects",ru:"Предметы",es:"Objetos"},public_chat_emoji_category_people:{en:"Smileys & People",ru:"Смайлы и люди",es:"Caras y personas"},public_chat_emoji_category_places:{en:"Travel & Places",ru:"Путешествия и места",es:"Viajes y lugares"},public_chat_emoji_category_search:{en:"Search results",ru:"Результаты поиска",es:"Resultados de búsqueda"},public_chat_emoji_category_symbols:{en:"Symbols",ru:"Символы",es:"Símbolos"},public_chat_emoji_skin_choose:{en:"Choose default skin tone",ru:"Выберите оттенок кожи",es:"Elige el tono de piel predeterminado"},public_chat_emoji_skin_default:{en:"Default",ru:"По умолчанию",es:"Predeterminado"},public_chat_emoji_skin_light:{en:"Light",ru:"Светлый",es:"Claro"},public_chat_emoji_skin_medium_light:{en:"Medium-light",ru:"Средне-светлый",es:"Medio claro"},public_chat_emoji_skin_medium:{en:"Medium",ru:"Средний",es:"Medio"},public_chat_emoji_skin_medium_dark:{en:"Medium-dark",ru:"Средне-тёмный",es:"Medio oscuro"},public_chat_emoji_skin_dark:{en:"Dark",ru:"Тёмный",es:"Oscuro"},public_chat_format_bold:{en:"Bold",ru:"Жирный",es:"Negrita"},public_chat_format_italic:{en:"Italic",ru:"Курсив",es:"Cursiva"},public_chat_format_strikethrough:{en:"Strikethrough",ru:"Зачёркнутый",es:"Tachado"},public_chat_format_code:{en:"Inline code",ru:"Код",es:"Código"},public_chat_format_list:{en:"Bulleted list",ru:"Маркированный список",es:"Lista con viñetas"},public_chat_format_quote:{en:"Quote",ru:"Цитата",es:"Cita"},public_chat_settings_appearance:{en:"Appearance",ru:"Внешний вид",es:"Apariencia"},public_chat_settings_appearance_description:{en:"Customize how this chat looks for you.",ru:"Настройте внешний вид этого чата для себя.",es:"Personaliza cómo se ve este chat para ti."},public_chat_settings_own_message_color:{en:"Own message bubble color",ru:"Цвет своих сообщений",es:"Color de tus mensajes"},public_chat_settings_chat_scale:{en:"Chat scale",ru:"Масштаб чата",es:"Escala del chat"},chat_bundle_share_title:{en:"Share bundle with {{username}}",ru:"Поделиться набором с {{username}}",es:"Compartir paquete con {{username}}"},chat_bundle_share_description:{en:"Choose one of your bundles to make it available to this user.",ru:"Выберите один из своих наборов, чтобы открыть к нему доступ этому пользователю.",es:"Elige uno de tus paquetes para ponerlo a disposición de este usuario."}
155,chat_bundle_share:{en:"Share",ru:"Поделиться",es:"Compartir"},chat_bundle_anonymous_user:{en:"anonymous user",ru:"анонимным пользователем",es:"usuario anónimo"},chat_bundle_no_bundles:{en:"No bundles available",ru:"Нет доступных наборов",es:"No hay paquetes disponibles"},chat_bundle_no_bundles_description:{en:"Create a bundle first, then you can share it directly from chat.",ru:"Сначала создайте набор, после чего сможете поделиться им прямо из чата.",es:"Primero crea un paquete y luego podrás compartirlo directamente desde el chat."},chat_bundle_load_failed:{en:"Could not load your bundles.",ru:"Не удалось загрузить ваши наборы.",es:"No se pudieron cargar tus paquetes."},chat_share_bundle:{en:"Share bundle",ru:"Поделиться набором",es:"Compartir paquete"},bundles_open_bundle_button:{en:"Open bundle",ru:"Открыть набор",es:"Abrir paquete"},dare_terms_required_title:{en:"Read and accept the dare rules",ru:"Прочитайте и примите правила вызовов",es:"Lee y acepta las reglas de los retos"},dare_terms_required_body:{en:"Before creating a dare, please read how dares, clarifications, voting, deletion, and refunds work.",ru:"Перед созданием вызова прочитайте, как работают вызовы, уточнения, голосование, удаление и возврат средств.",es:"Antes de crear un reto, lee cómo funcionan los retos, las aclaraciones, la votación, la eliminación y los reembolsos."},dare_terms_checkbox:{en:"I have read and agree to the current dare rules.",ru:"Я прочитал(а) и принимаю актуальные правила вызовов.",es:"He leído y acepto las reglas vigentes de los retos."},dare_terms_accept:{en:"Accept rules",ru:"Принять правила",es:"Aceptar reglas"},dare_terms_loading:{en:"Loading dare rules…",ru:"Загрузка правил вызовов…",es:"Cargando las reglas de los retos…"},dare_terms_load_failed:{en:"Could not load dare rules acceptance status",ru:"Не удалось загрузить статус принятия правил вызовов",es:"No se pudo cargar el estado de aceptación de las reglas"},dare_terms_retry:{en:"Retry",ru:"Повторить",es:"Reintentar"},dare_rules_link:{en:"How dares work",ru:"Как работают вызовы",es:"Cómo funcionan los retos"},dare_create:{en:"Create dare",ru:"Создать вызов",es:"Crear reto"},dare_empty_title:{en:"No active dares",ru:"Нет активных вызовов",es:"No hay retos activos"},dare_empty_body:{en:"New dares will appear here.",ru:"Новые вызовы появятся здесь.",es:"Los nuevos retos aparecerán aquí."},dare_delete_confirm_title:{en:"Delete dare?",ru:"Удалить вызов?",es:"¿Eliminar el reto?"},dare_delete_confirm_body:{en:"You are going to delete this dare. All contributed funds will be returned to contributors. Are you sure?",ru:"Вы собираетесь удалить вызов. Все внесённые средства будут возвращены участникам. Вы уверены?",es:"Vas a eliminar este reto. Todos los fondos aportados serán devueltos a los contribuidores. ¿Estás seguro?"},dare_delete_confirm_button:{en:"Delete dare",ru:"Удалить вызов",es:"Eliminar reto"},dare_state_created:{en:"Created",ru:"Создан",es:"Creado"},dare_state_pre_voting:{en:"Pre-voting",ru:"Предголосование",es:"Prevotación"},dare_state_deleted:{en:"Deleted",ru:"Удалён",es:"Eliminado"},dare_pre_voting_title:{en:"Contributor review",ru:"Проверка участниками",es:"Revisión de los contribuidores"},dare_pre_voting_hint:{en:"Contributors can review the dare, clarify its existing conditions, or confirm completion early.",ru:"Участники могут проверить выполнение, уточнить существующие условия или досрочно подтвердить выполнение.",es:"Los contribuidores pueden revisar el reto, aclarar sus condiciones existentes o confirmar su 
155cumplimiento antes."},dare_pre_voting_confirm:{en:"Confirm completed",ru:"Подтвердить выполнение",es:"Confirmar completado"},dare_pre_voting_confirm_hint:{en:"If every contributor confirms, the dare completes immediately without normal voting.",ru:"Если все участники подтвердят выполнение, вызов завершится сразу без обычного голосования.",es:"Si todos los contribuidores confirman, el reto se completa inmediatamente sin votación normal."},dare_continue:{en:"Continue dare",ru:"Продолжить вызов",es:"Continuar reto"},dare_clarify:{en:"Clarify",ru:"Уточнить",es:"Aclarar"},dare_quick_contribute:{en:"Add $1",ru:"Добавить $1",es:"Añadir $1"},dare_voting_clarifiers_only:{en:"Only contributors who clarified the dare can manually vote. Contributors who did not clarify are counted as YES automatically.",ru:"Вручную голосовать могут только участники, которые уточняли условия. Участники без уточнений автоматически считаются проголосовавшими YES.",es:"Solo los contribuidores que aclararon el reto pueden votar manualmente. Los que no hicieron aclaraciones se cuentan automáticamente como SÍ."},speech_recognition:{en:"Speech Recognition",ru:"Распознавание речи",es:"Reconocimiento de voz"},speech_recognition_tooltip:{en:"Enable real-time speech recognition and English translation",ru:"Включить распознавание речи и перевод на английский язык в реальном времени",es:"Activar el reconocimiento de voz y la traducción al inglés en tiempo real"},speech_recognition_modal_title:{en:"Speech recognition & translation",ru:"Распознавание и перевод речи",es:"Reconocimiento y traducción de voz"},speech_recognition_modal_subtitle:{en:"Automatic real-time English subtitles",ru:"Автоматические английские субтитры в реальном времени",es:"Subtítulos automáticos en inglés en tiempo real"},speech_recognition_modal_description:{en:`You are about to enable speech recognition and translation into English. This experimental feature is currently available only for streams from Android devices.
156
157For better recognition and translation quality, we recommend speaking loudly and clearly and keeping background music quieter.`,ru:`Вы собираетесь включить распознавание и перевод речи на английский язык. Эта экспериментальная функция в данный момент доступна только для стримов с Android.
158
159Для улучшения качества распознавания и перевода рекомендуется говорить громко и чётко, а фоновую музыку сделать тише.`,es:`Estás a punto de activar el reconocimiento de voz y la traducción al inglés. Esta función experimental está disponible actualmente solo para transmisiones desde dispositivos Android.
160
161Para mejorar la calidad del reconocimiento y la traducción, recomendamos hablar alto y con claridad y mantener la música de fondo a un volumen más bajo.`},speech_recognition_modal_tip:{en:"The clearer your voice is compared with background sounds, the more accurate the subtitles and translation will be.",ru:"Чем лучше ваш голос слышен на фоне остальных звуков, тем точнее будут субтитры и перевод.",es:"Cuanto más clara se escuche tu voz frente a los sonidos de fondo, más precisos serán los subtítulos y la traducción."},ok:{en:"OK",ru:"Хорошо",es:"Aceptar"},confirm_speech_recognition:{en:"OK",ru:"Хорошо",es:"Aceptar"},cancel_speech_recognition:{en:"Cancel",ru:"Отмена",es:"Cancelar"},dare_terms_update_notice_title:{en:"Dare rules updated",ru:"Правила вызовов обновились",es:"Las reglas de los retos se actualizaron"},dare_terms_create_notice_body:{en:"Quick heads-up: if the streamer breaks the dare conditions, press Clarify on the dare card while the dare is still in progress. Otherwise you won't be able to mark it as failed.",ru:"Коротко: если стример нарушает условия вызова, нажмите Clarify в карточке вызова, пока вызов ещё идёт. Иначе отметить его как проваленный не получится.",es:"En resumen: si el streamer incumple las condiciones del reto, pulsa Clarify en la tarjeta mientras el reto siga en curso. Si no lo haces, no podrás marcarlo como fallido."}};vr.use(yy).use(by).init({fallbackLng:"en",supportedLngs:dc,resources:aC(oC)});vr.options.fallbackLng=vr.language==="uk"?"ru":"en";const Tt="dreamdares.com",sf="dreamdares",Jc="Dreamdares",lC="UG*BURRUATI35796356668",cC="https://t.me/dd_topup_bot",dC="https://t.me/dreamdares_notification_bot",Ia="BURRUATI LIMITED LLC",uc="Agias Zonis, 12, AGIA ZONI CENT
161ER, Flat/Office 404, Agias Zonis, 3027, Limassol, Cyprus",af=`${Ia}, ${uc}`,gI="+ 357(963) 566 - 68",yI="+35796356668",bI="© 2026 dreamdares.com. All rights reserved.",_I="The site is managed and operated by BURRUATI LIMITED LLC, Agias Zonis, 12, AGIA ZONI CENTER, Flat/Office 404, Agias Zonis, 3027, Limassol, Cyprus",pl=["test","admin","anonymous","KAZHANTV","Dreamdares_Official","ruben","dreamdarexx00","nafanichka"],of={1:"admin",10:"Dreamdares_Official",12:"KAZHANTV",337:"moderator",791:"moderator_168","-1":"UG_Payments","-2":"BurruPay","-3":"TG_Bot","-4":"Inwizo","-5":"Nowpayments"},uC=[26,35,3,9,11],hC=[35,95,1045],pC=[420],mC=[1045],fC=[63],gC=1253,yC=7,_r=[gC,yC],vI=50,bC="BBp5rv_TOfNWVl1wn4n9_m-qUIg3aM7yH1u0nPsJmAoUrUxH3H_VyFnzznZVZNN_rSkbYIQZa3OiDyt83cSb4E8";let ws=!1,Uu,$a=0;const Ra=new Set;function _C(e){return typeof e=="object"&&e!==null&&"moderation_warning"in e&&e.moderation_warning===!0}function vC(){return $a}function wC(e){e!==Uu&&(Uu=e,$a++,hc())}function SC(e=$a){e!==$a||ws||(ws=!0,Ra.forEach(t=>t()))}function hc(){ws&&(ws=!1,Ra.forEach(e=>e()))}function CC(e){return Ra.add(e),()=>{Ra.delete(e)}}function TC(){return ws}const Zc=window.location.host.includes("dev."),lf=Zc?`https://${Tt}`:window.location.origin,xt=lf,O=`${lf}/api`,ed=Zc?`wss://${Tt}/api`:`wss://${window.location.host}/api`,Ss=Zc?Tt:window.location.host,za=new Map([["vinera",{placement:"gold",category:"streamer"}],["lena",{placement:"silver",category:"streamer"}],["tina_cutie",{placement:"bronze",category:"streamer"}],["saharok",{placement:"gold",category:"donator"}],["robotscone",{placement:"silver",category:"donator"}],["sava1",{placement:"bronze",category:"donator"}]]),xC=(e,t)=>{if(typeof(e==null?void 0:e.message)=="string"&&e.message.trim())return e.message;if(typeof(e==null?void 0:e.error)=="string"&&e.error.trim())return e.error;if(typeof(e==null?void 0:e.detail)=="string"&&e.detail.trim())return e.detail;switch(t){case 400:return"Invalid request";case 401:return"Please log in to continue";case 403:return"You are not allowed to perform this action";case 404:return"Requested resource was not found";case 409:return"This action has already been performed";case 429:return"Too many requests. Please try again later";case 500:case 502:case 503:case 504:return"Service is temporarily unavailable. Please try again later";default:return"Something went wrong"}},Yi=async(e,t,r,i,s={})=>{const a=vC();let o="";e!=="GET"&&(o=await Bu());try{const l={Accept:"application/json","Content-Type":"application/json","X-CSRF-Token":o};i&&delete l["Content-Type"];let c=await fetch(t,{headers:l,method:e,body:i?r:r?JSON.stringify(r):null,credentials:"include"});if(c.status===401&&!t.includes("refresh-token")&&document.cookie.includes("refresh_token"))if((await kC()).message==="OK")o=await Bu(),l["X-CSRF-Token"]=o,c=await fetch(t,{headers:l,method:e,body:i?r:r?JSON.stringify(r):null,credentials:"include"});else throw new Error("Unable to refresh token");if(c.status===204)return;let d;try{d=await c.json()}catch{d={}}const p=_C(d);if(p&&SC(a),c.status===402)return[{id:1337,state:2,user_id:0,contributions:[],description:`Top up ${Math.abs(d.remained)}$ to unlock the ability to check the dare list in paid streams!`,time:0,ts:new Date().getTime()}];if(!c.ok){const h=xC(d,c.status);throw c.status!==401&&e!=="GET"&&!p&&!s.suppressErrorNotification&&Ee.show({position:"top-center",title:"Error",message:h,color:"red",icon:Ni.createElement(zt,{size:"1rem"})}),new Error(h)}return d}catch(l){throw console.error(`Request failed: ${e} ${t}`,l),l instanceof Error?l:new Error("Something went wrong")}},ae=async(e,t)=>await Yi("GET",e,void 0,!1,t),_e=async(e,t,r)=>await Yi("POST",e,t,!1,r),qn=async(e,t,r)=>await Yi("PUT",e,t,!1,r),Ft=async(e,t,r)=>await Yi("PATCH",e,t,!1,r),et=async(e,t,r)=>await Yi("DELETE",e,t,!1,r),Qi=async(e,t)=>await Yi("POST",e,t,!0);async function Bu(){return await ae(`${O}/csrf`)}async function kC(){return await _e(`${O}/refresh-token`)}function he(e,t){return(((e==null?void 0:e.permission_mask)??0)&t)!==0}const bo="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!--%20Created%20with%20Inkscape%20(http://www.inkscape.org/)%20--%3e%3csvg%20width='8.7789688mm'%20height='6.4302902mm'%20viewBox='0%200%208.778969%206.43029'%20version='1.1'%20id='svg1'%20inkscape:version='1.3%20(0e150ed6c4,%202023-07-21)'%20sodipodi:docname='dd_fancy_selected.svg'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview1'%20pagecolor='%23505050'%20bordercolor='%23eeeeee'%20borderopacity='1'%20inkscape:showpageshadow='0'%20inkscape:pageopacity='0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23505050'%20inkscape:document-units='mm'%20inkscape:zoom='14.06'%20inkscape:cx='594.13229'%20inkscape:cy='552.66714'%20inkscape:window-width='1920'%20inkscape:window-height='1013'%20inkscape:window-x='-9'%20inkscape:window-y='-9'%20inkscape:window-maximized='1'%20inkscape:current-layer='layer1'%20/%3e%3cdefs%20id='defs1'%3e%3clinearGradient%20id='linearGradient140'%20inkscape:collect='always'%3e%3cstop%20style='stop-color:%23ed6ea0;stop-opacity:1;'%20offset='0'%20id='stop140'%20/%3e%3cstop%20style='stop-color:%23ec8c69;stop-opacity:1;'%20offset='1'%20id='stop141'%20/%3e%3c/linearGradient%3e%3clinearGradient%20inkscape:collect='always'%20xlink:href='%23linearGradient140'%20id='linearGradient147'%20x1='152.81725'%20y1='146.85358'%20x2='161.59595'%20y2='146.85358'%20gradientUnits='userSpaceOnUse'%20/%3e%3c/defs%3e%3cg%20inkscape:label='Layer%201'%20inkscape:groupmode='layer'%20id='layer1'%20transform='translate(-152.81712,-143.63803)'%3e%3cpath%20id='path126'%20style='color:%23000000;fill:url(%23linearGradient147);fill-opacity:1;-inkscape-stroke:none'%20d='m%20160.79122,143.63878%20v%201.18804%20c%20-0.81572,-0.62107%20-1.99477,-0.54729%20-2.72283,0.20774%20l%20-0.57464,0.57464%200.55397,0.56844%200.58911,-0.59014%200.002,-0.002%20c%200.48627,-0.50422%201.27855,-0.51728%201.78283,-0.031%200.20523,0.1979%200.32767,0.4461%200.36949,0.70487%20v%200.12557%20h%200.0139%20c%200.0199,0.33703%20-0.0956,0.68118%20-0.34985,0.94672%20-0.25306,0.25128%20-0.58066,0.37878%20-0.90847,0.37878%20-0.32925,0%20-0.65859,-0.12735%20-0.912
16109,-0.38085%20-0.14606,-0.14606%20-1.22953,-1.22452%20-0.86558,-0.87385%20l%20-0.55087,-0.56586%205.2e-4,-5.1e-4%20-0.87178,-0.85525%20c%20-0.78404,-0.81303%20-2.09114,-0.83675%20-2.90422,-0.0527%20-0.81302,0.78401%20-0.83674,2.09114%20-0.0527,2.90422%20l%200.004,0.002%200.002,0.002%20c%200.40505,0.40502%200.93839,0.60914%201.47226,0.60927%20l%200.001,5.1e-4%20c%200.43235,-10e-5%200.86404,-0.13395%201.22783,-0.39997%20v%201.96887%20h%200.80098%20v%20-2.73472%20l%200.004,-0.004%20-0.004,-0.004%20v%20-0.004%20h%20-0.004%20l%20-0.55759,-0.54828%20-0.55552,0.55552%20c%20-0.25351,0.2535%20-0.58284,0.38086%20-0.91209,0.38085%20-0.3278,0%20-0.65493,-0.1275%20-0.90795,-0.37878%20-0.48289,-0.50444%20-0.46956,-1.29198%200.0336,-1.77716%200.50429,-0.48634%201.29608,-0.47327%201.78232,0.031%20l%200.002,0.002%200.87592,0.86661%20-0.001,0.001%200.55759,0.56844%20-0.002,0.003%200.86351,0.86351%20c%200.40517,0.40515%200.94028,0.60927%201.47433,0.60927%200.53406,-1e-5%201.06709,-0.20412%201.47226,-0.60927%20l%200.002,-0.002%200.004,-0.002%20c%200.41552,-0.43088%200.60184,-1.00053%200.56638,-1.55752%20v%20-2.68976%20z'%20/%3e%3c/g%3e%3c/svg%3e";function se(e,t){const r=(e??0)/100;return new Intl.NumberFormat("en-US",{style:"currency",currencyDisplay:"narrowSymbol",currency:t??"USD"}).format(r)}const EC="_paper_ej0mm_1",PC="_support_ej0mm_13",MC="_paymentMethod_ej0mm_26",kn={paper:EC,support:PC,paymentMethod:MC};async function AC(){return await ae(`${O}/me`)}async function DC({username:e,password:t}){return await _e(`${O}/login`,{username:e,password:t})}async function IC({username:e,password:t}){return await _e(`${O}/register`,{username:e,password:t})}async function $C(){return await _e(`${O}/logout`)}function Vi(){const e=at(),t=()=>oe({queryKey:["me"],queryFn:AC}),r=J({mutationKey:["login"],mutationFn:DC,onSuccess(){e.resetQueries({queryKey:["me"]})}}),i=J({mutationKey:["logout"],mutationFn:$C,onSuccess(){e.resetQueries({queryKey:["me"]})}}),s=J({mutationKey:["register"],mutationFn:IC,onSuccess(){e.resetQueries({queryKey:["me"]})}});return{currentUserQuery:t,loginMutation:r,logoutMutation:i,registerMutation:s}}const RC=(e,t)=>["profile",e,t],qu=(e,t)=>
161["dares",e,t],ju=(e,t)=>["dares.spy",e,t];function zC(e,t){const r={predicate:i=>{const[s,a]=i.queryKey;return(s==="profile"||s==="dares.spy"||s==="dares"&&i.queryKey.length>1)&&(t===void 0||a!==t)}};e.cancelQueries(r),e.removeQueries(r)}function Hu(e,t){var i;const r=e.getQueryState(["me"]);return!!(r!=null&&r.dataUpdatedAt)&&(((i=r.data)==null?void 0:i.id)??0)===t}const cf=_.createContext({isLoading:!0,toggleBalance:()=>{}});function NC({children:e}){const t=at(),{currentUserQuery:r}=Vi(),i=r();i.isError&&t.setQueryData(["me"],null);const s=i.isError?void 0:i.data??void 0,a=i.isFetched?(s==null?void 0:s.id)??0:void 0;return _.useLayoutEffect(()=>{zC(t,a),wC(a)},[t,a]),n(cf.Provider,{value:{user:s,isLoading:!i.isFetched,toggleBalance:i.refetch},children:i.isFetched&&n(_.Fragment,{children:e},a)})}function fe(){return _.useContext(cf)}async function LC({initial_price:e}){return await _e(`${O}/payments/form-digest`,{initial_price:e})}const OC=()=>J({mutationKey:["form-digest"],mutationFn:LC});async function FC(e){return await _e(`${O}/nowpayments/invoice`,e)}function UC(){return{createInvoiceMutation:J({mutationKey:["np.invoice.create"],mutationFn:FC})}}async function BC(e){return await _e(`${O}/nowpayments/fee-estimate`,e)}function df(e){return oe({queryKey:["np.fee-estimate",e],queryFn:()=>BC({amount:e}),enabled:e>0,staleTime:30*1e3})}async function qC(e){return await _e(`${O}/deposit`,e)}async function jC(){return await ae(`${O}/deposit`)}async function HC({id:e,amount:t}){return await Ft(`${O}/deposit/${e}/approve`,{amount:t})}async function WC(e){return await Ft(`${O}/deposit/${e}/cancel`)}async function YC(e){return await _e(`${O}/deposit/fee`,e)}async function QC(e){return await _e(`${O}/deposit/inw`,e)}async function VC(e){return await _e(`${O}/deposit/inw/fee`,e)}function Na(){const e=oe({queryKey:["deposits"],queryFn:jC}),t=J({mutationKey:["deposit.create"],mutationFn:qC}),r=J({mutationKey:["deposit.approve"],mutationFn:HC,onSuccess(){e.refetch()}}),i=J({mutationKey:["deposit.cancel"],mutationFn:WC,onSuccess(){e.refetch()}}),s=J({mutationKey:["deposit.fee"],mutationFn:YC}),a=J({mutationKey:["deposit.inw.create"],mutationFn:QC}),o=J({mutationKey:["deposit.inw.fee"],mutationFn:VC});return{depositsQuery:e,depositMutation:t,approveDepositMutation:r,cancelDepositMutation:i,calculateFeeMutation:s,createInwDepositMutation:a,calculateInwFeeMutation:o}}const KC={"auto-ru-bank-card":"MBC","auto-fps":"EXT"};function os(e){return e==="auto-ru-bank-card"||e==="auto-fps"}const GC=20,XC=GC*60,uf=({size:e=20})=>n("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:typeof e=="number"?`${e}px`:e,height:typeof e=="number"?`${e}px`:e},children:n(v,{fz:"xs",fw:700,c:"orange",children:"JCB"})}),yr=new Map([["paypal",{label:"PayPal",feePercent:10,min:30,max:250,icon:Cp,color:"blue"}],["crypto",{label:"Crypto",feePercent:0,min:20,max:500,icon:Mi,color:"yellow"}],["bank-card",{label:"Bank Card Transfer",feePercent:16,min:10,max:400,icon:wa,color:"grape"}],["ru-card",{label:"RU Card Transfer",feePercent:15,min:10,max:400,icon:Ja,color:"red"}],["auto-bank-card",{label:"VISA / MASTERCARD",feePercent:0,min:3,max:435,icon:wa,color:"orange"}],["auto-bank-card-cc",{label:"JCB",feePercent:0,min:5,max:435,icon:uf,color:"orange"}],["tg-stars",{label:"Telegram Stars",feePercent:0,min:1,max:150,icon:Sp,color:"violet"}],["auto-ru-bank-card",{label:"Russian Bank Card",feePercent:0,min:5,max:400,icon:kc,color:"teal"}],["auto-fps",{label:"SBP (Fast Payments)",feePercent:0,min:5,max:400,icon:wp,color:"cyan"}]]);function JC(e){const[t,r]=_.useState(e),i=_.useRef(null),s=_.useCallback(()=>{r(e),i.current&&clearInterval(i.current),i.current=setInterval(()=>{r(p=>p<=1?(clearInterval(i.current),0):p-1)},1e3)},[e]),a=_.useCallback(()=>{i.current&&clearInterval(i.current)},[]);_.useEffect(()=>()=>a(),[a]);const o=Math.floor(t/60),l=t%60,c=Math.round(t/e*100);return{remaining:t,mins:o,secs:l,progress:c,expired:t===0,start:s,stop:a}}function Wu(e){return e==="ERC20"?"blue":e==="BEP20"?"yellow":"red"}function pc(e){return e==="auto-bank-card"||e==="auto-bank-card-cc"}function ml(e){return pc(e)||os(e)}function ZC({opened:e,close:t,onTopUp:r}){const i=tn(),s=gt(),{user:a}=fe(),[o,l]=_.useState("intro"),[c,d]=_.useState(),[p,h]=_.useState(!1),{createInvoiceMutation:f}=UC(),[m,y]=_.useState(null),[b,S]=_.useState(null),[k,w]=_.useState(!1),T=_.useRef(null),A=OC(),{calculateFeeMutation:R}=Na(),{calculateInwFeeMutation:E,createInwDepositMutation:z}=Na(),N=JC(XC),C=Ge({initialValues:{amount:0},validate:{amount:F=>
161{if(!c)return"Select payment method first";const H=yr.get(c);return H?F<H.min?`Minimum amount is $${H.min}`:F>H.max?`Maximum amount is $${H.max}`:null:null}}});_.useEffect(()=>{if(c){const F=yr.get(c);F&&C.setFieldValue("amount",F.min)}},[c]),_.useEffect(()=>{if(!ml(c)){S(null),w(!1);return}const F=C.values.amount,H=yr.get(c);if(!H||F<H.min||F>H.max){S(null),w(!1);return}return w(!0),S(null),T.current&&clearTimeout(T.current),T.current=setTimeout(async()=>{try{const K=Math.ceil(F*100);if(os(c)){const X=await E.mutateAsync({amount_to_get:K});S(X.amount_to_pay)}else{const X=await R.mutateAsync({amount_to_get:K});S(X.amount_to_pay)}}catch(K){console.error("Failed to fetch fee",K),S(null)}finally{w(!1)}},1e3),()=>{T.current&&clearTimeout(T.current)}},[C.values.amount,c]);const M=_.useCallback((F,H,K)=>{const X=yr.get(H);return X?H==="ru-card"?F*98:H==="crypto"?F+(K??2):Math.ceil(F/(100-X.feePercent)*100*100)/100:F},[]),P=_.useCallback(()=>{l("intro"),d(void 0),y(null),S(null),w(!1),T.current&&clearTimeout(T.current),N.stop(),C.reset()},[]),I=_.useMemo(()=>c?yr.get(c):void 0,[c]),L=_.useCallback(()=>{pc(c)||os(c)||c==="crypto"||c==="tg-stars"?(l("intro"),d(void 0)):(l("select-method"),d(void 0))},[c]),U=_.useCallback(async()=>{if(!C.isValid())return;const F=Math.ceil(C.values.amount*100),H=await f.mutateAsync({amount:F});window.location.href=H.invoice_url},[C.values.amount,f]),q=_.useCallback(()=>{window.open(`${cC}`,"_blank"),P(),t()},[P,t]),B=_.useCallback(async()=>{if(!c||!C.isValid()||b===null)return;const F=KC[c];if(F){h(!0);try{const H=Math.ceil(C.values.amount*100),K=await z.mutateAsync({requested_amount_usd:H,payment_method:F});window.location.href=K.payURL}catch(H){console.error("Failed to create INW deposit",H),alert("Unable to start payment. Please try again."),h(!1)}}},[c,C.values.amount,b,z]),Y=(m==null?void 0:m.fee)??2,Q=`$${Y} fixed fee`,W=_.useMemo(()=>!C.isValid()||!c?!0:ml(c)?k||b===null:!1,[C.isValid(),c,k,b]);return u(Oe,{opened:e,onClose:()=>{P(),t()},size:"xl",radius:"xl",title:u($,{gap:"xs",children:[n(Ec,{size:24,stroke:1.5}),n(v,{fw:700,size:"xl",c:"white",children:x("topup_title")})]}),styles:{content:{backgroundColor:"var(--mantine-color-dark-7)",color:"var(--mantine-color-white)",borderRadius:"var(--mantine-radius-md)"},header:{borderRadius:"var(--mantine-radius-xl) var(--mantine-radius-xl) 0 0"}},children:[o==="intro"&&u(j,{gap:"md",children:[n(v,{size:"sm",c:"gray.3",children:x("choose_top_up_method")}),(a==null?void 0:a.id)&&n(Ie,{p:"lg",radius:"md",shadow:"sm",c:"white",classNames:{root:kn.paper},onClick:()=>{d("auto-bank-card"),l("enter-amount")},children:u($,{justify:"space-between",children:[u($,{children:[n(wa,{size:26,stroke:1.5}),u(G,{children:[n(v,{fw:700,c:"white",children:x("topup_bank_card")}),n(v,{size:"sm",c:"gray.4",children:x("topup_bc_fs")})]})]}),n(pe,{radius:"md",color:"green",children:x("topup_available")})]})}),(a==null?void 0:a.id)===2&&n(Ie,{p:"lg",radius:"md",shadow:"sm",c:"white",classNames:{root:kn.paper},onClick:()=>{d("auto-bank-card-cc"),l("enter-amount")},children:u($,{justify:"space-between",children:[u($,{children:[n(uf,{size:26}),u(G,{children:[n(v,{fw:700,c:"white",children:"JCB"}),n(v,{size:"sm",c:"gray.4",children:"Secure JCB payments"})]})]}),n(pe,{radius:"md",color:"green",children:x("topup_available")})]})}),n(Ie,{p:"lg",radius:"md",shadow:"sm",c:"white",classNames:{root:kn.paper},onClick:()=>{d("auto-ru-bank-card"),l("enter-amount")},style:{border:`1px solid ${i.colors.teal[7]}`,cursor:"pointer"},children:u($,{justify:"space-between",children:[u($,{children:[n(kc,{size:26,stroke:1.5,color:i.colors.teal[4]}),n(G,{children:n(v,{fw:700,c:"white",children:x("topup_ru_bank_card")})})]}),n(pe,{radius:"md",color:"teal",variant:"light",children:x("topup_available")})]})}),n(Ie,{p:"lg",radius:"md",shadow:"sm",c:"white",classNames:{root:kn.paper},onClick:()=>{d("auto-fps"),l("enter-amount")},style:{border:`1px solid ${i.colors.cyan[7]}`,cursor:"pointer"},children:u($,{justify:"space-between",children:[u($,{children:[n(wp,{size:26,stroke:1.5,color:i.colors.cyan[4]}),n(G,{children:n(v,{fw:700,c:"white",children:x("topup_sbp")})})]}),n(pe,{radius:"md",color:"cyan",variant:"light",children:x("topup_available")})]})}
161),n(Ie,{p:"lg",radius:"md",shadow:"sm",c:"white",classNames:{root:kn.paper},onClick:()=>{d("crypto"),l("enter-amount")},style:{border:`1px solid ${i.colors.yellow[7]}`,cursor:"pointer"},children:n($,{justify:"space-between",children:u($,{children:[n(Mi,{size:26,stroke:1.5,color:i.colors.yellow[4]}),u(G,{children:[n(v,{fw:700,c:"white",children:"Crypto"}),n(v,{size:"sm",c:"gray.4",children:"BTC · ETH · USDT · USDC · 100+ coins · $20 min · $500 max"})]})]})})}),n(Ie,{p:"lg",radius:"md",shadow:"sm",c:"white",classNames:{root:kn.paper},onClick:q,style:{border:`1px solid ${i.colors.violet[7]}`,cursor:"pointer"},children:n($,{justify:"space-between",children:u($,{children:[u(G,{style:{position:"relative"},children:[n(Ml,{size:26,stroke:1.5,color:i.colors.violet[4]}),n(Sp,{size:13,stroke:1.5,color:i.colors.yellow[4],style:{position:"absolute",bottom:-3,right:-5,fill:i.colors.yellow[4]}})]}),u(G,{children:[n(v,{fw:700,c:"white",children:"Telegram Stars"}),n(v,{size:"sm",c:"gray.4",children:"Pay via Telegram bot · Instant"})]})]})})}),n(je,{label:"Manual methods"}),n(Ie,{p:"lg",radius:"md",shadow:"sm",c:"white",classNames:{root:kn.paper},onClick:()=>l("select-method"),children:u($,{justify:"space-between",children:[u($,{children:[n(kd,{size:26,stroke:1.5}),u(G,{children:[n(v,{fw:700,children:x("topup_via_support")}),n(v,{size:"sm",c:"gray.3",children:"PayPal · Bank Card · RU Card"})]})]}),n(pe,{radius:"md",color:"blue.7",children:x("topup_available")})]})})]}),o==="select-method"&&u(j,{gap:"md",children:[n(Ye,{order:4,c:"white",size:"lg",children:x("topup_select_payment_method")}),n(Le,{title:x("via_support_info_title"),icon:n(ms,{}),variant:"filled",color:"blue.9",children:x("via_support_info_text")}),n(Lt,{type:"auto",offsetScrollbars:!0,h:"calc(80vh - 22rem)",children:n(j,{gap:"sm",children:[...yr].map(([F,H])=>{const K=H.icon;return F==="auto-bank-card"||F==="auto-bank-card-cc"||F==="auto-ru-bank-card"||F==="auto-fps"||F==="crypto"||F==="tg-stars"?null:n(Ie,{withBorder:!0,p:"md",radius:"md",c:"white",classNames:{root:kn.paymentMethod},styles:{root:{cursor:"pointer",position:"relative",transition:"transform 150ms ease",border:`2px solid ${i.colors.dark[4]}`}},onClick:()=>{d(F),l("enter-amount")},children:u($,{children:[n(K,{size:20,stroke:1.5}),u(G,{children:[n(v,{fw:700,size:"md",c:"white",children:H.label}),u(v,{size:"sm",c:"dark.2",children:["Min: $",H.min," · Max: $",H.max," · Fee:"," ",H.feePercent,"%"]})]})]})},F)})})}),u($,{align:"stretch",gap:"sm",children:[n(V,{variant:"subtle",color:"dark",size:"lg",onClick:()=>l("intro"),leftSection:n(Sa,{size:14}),styles:{root:{color:"var(--mantine-color-gray-2)"}},children:x("topup_back")}),n(Ie,{p:"md",radius:"md",c:"gray.3",style:{flexGrow:1},classNames:{root:kn.support},onClick:()=>{t(),s("/support")},children:u($,{children:[n(kd,{size:20,stroke:1.5}),u(v,{size:"sm",c:"gray.3",children:[x("topup_method_cant_find")," ",n(v,{span:!0,c:"blue.4",inherit:!0,children:x("topup_chat_with_us")})]})]})})]})]}),o==="enter-amount"&&u(j,{gap:"md",children:[c==="auto-bank-card"&&u(ke,{children:[n(Le,{icon:n(zt,{size:16}),color:"yellow",variant:"light",radius:"md",children:x("top_up_warning_text_bank_card")}),n(Ie,{p:"xs",radius:"md",bg:"dark.6",c:"lime.4",style:{border:"1px solid var(--mantine-color-lime-6, #cddc39)",textAlign:"center"},children:u(v,{size:"sm",fw:600,children:["Your billing statement will appear as ",lC]})})]}),c==="auto-fps"&&n(Le,{icon:n(zt,{size:16}),color:"yellow",variant:"light",radius:"md",children:"Если наблюдаются временные сложности с оплатой через СБП, пожалуйста, попробуйте пополнение банковской картой."}
161),m&&n(Ie,{p:"sm",radius:"md",bg:"dark.6",style:{border:`1px solid ${i.colors[Wu(m.chain)][8]}`},children:u($,{children:[n(bt,{size:"md",radius:"md",color:Wu(m.chain),variant:"light",children:m.chain==="ERC20"?n(Dy,{size:16}):n(Mi,{size:16})}),u(G,{children:[n(v,{size:"sm",fw:600,c:"white",children:m.label}),u(v,{size:"xs",c:"gray.4",children:[m.network," · ",Q]})]})]})}),n(pt,{label:n(v,{size:"md",c:"white",fw:600,children:`Amount (min $${I==null?void 0:I.min} · max $${I==null?void 0:I.max})`}),prefix:"$",size:"lg",radius:"md",min:(I==null?void 0:I.min)??1,max:(I==null?void 0:I.max)??150,...C.getInputProps("amount"),onChange:F=>{const H=(I==null?void 0:I.max)??150,K=(I==null?void 0:I.min)??1,X=typeof F=="number"?F:0;C.setFieldValue("amount",Math.min(H,Math.max(K,X)))},styles:{input:{backgroundColor:"var(--mantine-color-dark-6)",color:"white",border:"1px solid var(--mantine-color-dark-4)",fontSize:"1.125rem",height:"3.5rem"},label:{color:"white"}}}),c!=="crypto"&&I&&C.values.amount>=(I.min??1)&&c&&n(Ie,{withBorder:!0,p:"lg",radius:"md",bg:"dark.7",c:"white",children:u(j,{gap:"xs",children:[n(v,{size:"sm",c:"gray.3",fw:500,children:x("topup_you_receive")}),u(v,{fw:800,size:"2rem",c:"white",lh:1,children:["$",C.values.amount.toFixed(2)]}),n(je,{my:"xs",color:"dark.4"}),u($,{justify:"space-between",children:[n(v,{size:"md",c:"gray.2",fw:500,children:x("topup_you_pay")}),ml(c)?k?u($,{gap:6,children:[n(Iy,{size:16,style:{animation:"spin 1s linear infinite",color:"var(--mantine-color-gray-5)"}}),n(v,{size:"sm",c:"gray.5",children:"Calculating..."})]}):b!==null?n(v,{fw:800,size:"1.25rem",c:"white",children:os(c)?`₽${b}`:`$${(b/100).toFixed(2)}`}):n(v,{size:"sm",c:"gray.5",children:"—"}):c==="ru-card"?u(v,{fw:800,size:"1.25rem",c:"white",children:[M(C.values.amount,c).toFixed(0)," ","₽"]}):u(v,{fw:800,size:"1.25rem",c:"white",children:["$",M(C.values.amount,c,Y).toFixed(2)]})]})]})}),u($,{justify:"space-between",mt:"md",children:[n(V,{variant:"subtle",color:"gray",size:"lg",onClick:L,leftSection:n(Sa,{size:18}),children:x("topup_back")}),n(V,{variant:"filled",color:c==="crypto"?"yellow":c==="bank-card"?"lime":c==="tg-stars"?"violet":c==="auto-ru-bank-card"?"teal":c==="auto-fps"?"cyan":"blue",size:"lg",loading:f.isPending||p||A.isPending||z.isPending,disabled:W,onClick:async()=>{if(!c||!I||!C.isValid())return;if(c==="crypto"){await U();return}if(c==="tg-stars"){q();return}if(os(c)){await B();return}const F=C.values.amount,H=Math.ceil(F*100);let K;pc(c)&&b!==null?K=b:K=Math.ceil(M(F,c,Y)*100);const X=window.open("","_blank");r(H,K,c,X),P(),t()},children:x("topup_pay_action")})]}),n("style",{children:`
162            @keyframes spin {
163              from { transform: rotate(0deg); }
164              to { transform: rotate(360deg); }
165            }
166          `})]})]})}async function e1({username:e,message:t}){return await _e(`${O}/support/${e}`,t)}async function t1(e){return await ae(`${O}/support/${e}`)}async function n1({username:e,image:t}){const r=new FormData;return r.append("file",t),await Qi(`${O}/support/image/${e}`,r)}async function r1({id:e,username:t}){return await et(`${O}/support/${t}/${e}`)}async function i1(){return await ae(`${O}/support/unread`)}async function s1(e){return await _e(`${O}/support/read`,e)}function Bs(){const e=o=>oe({queryKey:["support",o],queryFn:()=>t1(o)}),t=J({mutationFn:e1}),r=J({mutationFn:n1}),i=J({mutationFn:r1}),s=oe({queryKey:["support.count"],queryFn:i1}),a=J({mutationFn:s1});return{messagesQuery:e,notificationCountQuery:s,sendMessageMutation:t,uploadImageMutation:r,deleteMessageMutation:i,readSupportMutation:a}}async function a1({query:e,limit:t=10,offset:r=0},i){const s=new globalThis.URL(`${O}/search`);s.searchParams.set("q",e),s.searchParams.set("limit",t.toString()),s.searchParams.set("offset",r.toString()),i.throwIfAborted();const a=await ae(s.toString());return i.throwIfAborted(),a}const Cs=(e,t)=>{const{enabled:r=!0,limit:i=10,offset:s=0,viewerScope:a}=t||{};e=e.trim();const o=r&&e.length>=2&&e.length<=50;return oe({queryKey:a===void 0?["search","users",e,i,s]:["search","users","viewer",a,e,i,s],queryFn:({signal:l})=>
166{if(!o)throw new Error("User search is disabled or the query is outside 2–50 characters");return a1({query:e,limit:i,offset:s},l)},enabled:o,placeholderData:()=>{},staleTime:0,retry:!1})},hf=({isCollapsed:e,onSelect:t})=>{const[r,i]=_.useState(""),[s]=Vg(r,300),[a,o]=_.useState(!1),{colorScheme:l}=vt(),c=gt(),{user:d}=fe(),{data:p,isLoading:h,error:f}=Cs(s,{enabled:!!d&&s.length>=2}),m=(p==null?void 0:p.users)||[];_.useEffect(()=>{s&&d&&s.length>=2?o(!0):o(!1)},[s,d]);const y=S=>{if(i(""),o(!1),t){t(S.username);return}c(`/${S.username}/profile`)},b=()=>{i(""),o(!1)};return d?e?u(ni,{opened:a&&(m.length>0||h||!!f),onClose:()=>o(!1),position:"bottom-start",withArrow:!1,shadow:"md",radius:"md",offset:5,children:[n(ni.Target,{children:u("div",{style:{position:"relative",width:"280px"},className:"search-container",children:[n("style",{children:`
167            [data-mantine-color-scheme=dark] .search-container:hover .search-icon {
168              color: rgba(255, 255, 255, 0.9) !important;
169            }
170            [data-mantine-color-scheme=dark] .search-container .search-icon {
171              color: var(--mantine-color-gray-6);
172              transition: color 0.2s ease;
173            }
174          `}),n(Te,{placeholder:x("search_users_placeholder"),value:r,onChange:S=>i(S.currentTarget.value),onFocus:()=>{m.length>0&&o(!0)},leftSection:n(Ot,{size:"1rem",className:"search-icon"}),rightSection:r?n(Ne,{size:"sm",variant:"subtle",color:"gray",onClick:b,style:{cursor:"pointer"},children:n(ht,{size:"0.8rem"})}):null,styles:{input:{backgroundColor:l==="dark"?"rgba(50, 50, 50, 0.3)":"rgba(240,240,240,0.7)",borderRadius:"8px",color:l==="dark"?"rgba(255, 255, 255, 0.9)":"rgba(0, 0, 0, 0.9)",caretColor:l==="dark"?"rgba(255, 255, 255, 0.9)":"rgba(0, 0, 0, 0.9)",transition:"all 0.2s ease","&::placeholder":{color:"var(--mantine-color-gray-6)",transition:"color 0.2s ease"},"&:hover":{backgroundColor:"rgba(70, 70, 70, 0.95)","&::placeholder":{color:"rgba(255, 255, 255, 0.7)"}},"&:focus":{backgroundColor:"rgba(255, 255, 255, 0.95)",color:"var(--mantine-color-dark-9)",caretColor:"var(--mantine-color-dark-9)","&::placeholder":{color:"var(--mantine-color-gray-6)"}}},section:{'&[dataPosition="left"]':{color:"var(--mantine-color-gray-6)",transition:"color 0.2s ease"}}},size:"sm"})]})}),n(ni.Dropdown,{p:0,style:{minWidth:"280px",maxWidth:"320px"},children:u(Ie,{radius:"md",style:{maxHeight:"300px",overflowY:"auto"},children:[h&&u($,{p:"md",justify:"center",children:[n(Xe,{size:"sm"}),n(v,{size:"sm",c:"dimmed",children:"Searching..."})]}),f&&n(v,{p:"md",size:"sm",c:"red",ta:"center",children:"Search failed. Please try again."}),!h&&!f&&m.length===0&&r.length>=2&&n(v,{p:"md",size:"sm",c:"dimmed",ta:"center",children:"No users found"}),!h&&!f&&m.length>0&&n(j,{gap:0,children:m.map(S=>u(Mt,{onClick:()=>y(S),p:"sm",style:{display:"flex",alignItems:"center",gap:"12px",width:"100%",borderRadius:"0","&:hover":{backgroundColor:"var(--mantine-color-gray-1)"}},children:[n(pn,{size:"sm",radius:"xl",children:n(fn,{size:"1rem"})}),n("div",{children:n(v,{size:"sm",fw:500,children:S.username})})]},S.username))})]})})]}):n("span",{}):null};function o1(){const{user:e,toggleBalance:t}=fe(),r=_.useRef(null),[i,s]=_.useState(!1),[a,o]=_.useState(!1),{notificationCountQuery:l}=Bs(),c=gt(),{pathname:d}=qr();_.useEffect(()=>{if(a||!e)return;r.current=new WebSocket(`${ed}/notifications`),r.current.onopen=()=>s(!0),r.current.onclose=()=>{s(!1),o(!0),setTimeout(()=>o(!1),250)},r.current.onmessage=h=>{console.log("[WS] raw message:",h.data);const f=JSON.parse(h.data);if(console.log("[WS] parsed event:",f),f.type==="topup"&&t(),f.type==="support"&&d!=="/support"){Ee.show({position:"top-center",title:"You have received a response from support",message:n(v,{children:n(Mt,{onClick:()=>{Ee.clean(),c("/support")},children:n(v,{size:"sm",c:"blue",children:"Click here to read it"})})}),color:"blue",icon:n(Jo,{}),autoClose:!1}),l.refetch();return}if(f.type==="invitation"&&d!=="/support"){Ee.show({position:"top-center",title:"You have been invited to paid stream!",message:n(v,{children:n(Mt,{onClick:()=>{Ee.clean(),c("/support")},children:n(v,{size:"sm",c:"blue",children:f.data})})}),color:"blue",icon:n(Jo,{}),autoClose:!1});return}if(f.type==="age_confirmed"&&d!=="/support"){Ee.show({position:"top-center",title:x("age_verification_approved"),message:n(v,{children:n(Mt,{onClick:()=>{Ee.clean(),c("/support")},children:n(v,{size:"sm",c:"blue"})})}),color:"blue",icon:n(Jo,{}),autoClose:!1});return}};const p=r.current;return()=>{p&&p.close()}},[a,d])}const l1=()=>Kg({opened:!1,empty:!1,selected:-1,listId:"",query:"",registeredActions:new Set}
174),c1=e=>Gg(e);function zi(e,t){const r=t.getState();t.setState({...r,...e(t.getState())})}function pf(e){zi(()=>({opened:!0,selected:-1}),e)}function mf(e){zi(()=>({opened:!1}),e)}function ff(e){zi(t=>({opened:!t.opened,selected:t.opened?t.selected:-1}),e)}function gf(e,t){t.updateState(r=>({...r,selected:e}))}function d1(e,t){t.updateState(r=>({...r,listId:e}))}function La(e,t=document){const r=t.querySelector(e);if(r)return r;const i=t instanceof ShadowRoot?t.host.children:t.children;for(let s=0;s<i.length;s+=1){const a=i[s];if(a.shadowRoot){const l=La(e,a.shadowRoot);if(l)return l}const o=La(e,a);if(o)return o}return null}function _o(e,t){var c,d;const r=t.getState(),i=r.listId?La(`#${r.listId}`):null,s=i==null?void 0:i.querySelector("[data-selected]"),a=(i==null?void 0:i.querySelectorAll("[data-action]"))??[],o=e===-1?a.length-1:e===a.length?0:e,l=dp(o,0,a.length-1);return s==null||s.removeAttribute("data-selected"),(c=a[l])==null||c.scrollIntoView({block:"nearest"}),(d=a[l])==null||d.setAttribute("data-selected","true"),gf(l,t),l}function u1(e){return _o(e.getState().selected+1,e)}function h1(e){return _o(e.getState().selected-1,e)}function p1(e){const t=e.getState(),r=La(`#${t.listId} [data-selected]`);r==null||r.click()}function m1(e,t){const r=t.getState();return r.registeredActions.add(e),()=>{r.registeredActions.delete(e)}}function f1(e,t){zi(()=>({query:e}),t),Promise.resolve().then(()=>{_o(0,t),zi(r=>({empty:r.query.trim().length>0&&r.registeredActions.size===0||!1}),t)})}function g1({clearQuery:e},t){t.updateState(r=>({...r,selected:-1,query:e?"":r.query,empty:e?!1:r.empty}))}const hn={open:pf,close:mf,toggle:ff,updateState:zi,setSelectedAction:gf,setListId:d1,selectAction:_o,selectNextAction:u1,selectPreviousAction:h1,triggerSelectedAction:p1,registerAction:m1,setQuery:f1,clearSpotlightState:g1};function td(){const e=l1();return[e,{open:()=>pf(e),close:()=>mf(e),toggle:()=>ff(e)}]}const[yf,vo]=td(),{open:wI,close:SI,toggle:CI}=vo;function bf(e){const t=e;return t.group!==void 0&&Array.isArray(t.actions)}function y1(e){return Array.isArray(e)?e.map(t=>t.trim()).join(",").toLowerCase().trim():typeof e=="string"?e.toLowerCase().trim():""}function b1(e){return e.reduce((t,r)=>"actions"in r?[...t,...r.actions.map(i=>({...i,group:r.group}))]:[...t,r],[])}function _1(e){const t={},r=[];return e.forEach(i=>{i.group?(t[i.group]||(t[i.group]={pushed:!1,data:{group:i.group,actions:[]}}),t[i.group].data.actions.push(i),t[i.group].pushed||(t[i.group].pushed=!0,r.push(t[i.group].data))):r.push(i)}),r}const v1=(e,t)=>{const r=e.trim().toLowerCase(),i=[[],[]];return b1(t).forEach(a=>{var o,l;(o=a.label)!=null&&o.toLowerCase().includes(r)?i[0].push(a):((l=a.description)!=null&&l.toLowerCase().includes(r)||y1(a.keywords).includes(r))&&i[1].push(a)}),_1(i.flat())};function _f(e,t){if(!Array.isArray(e))return[];let r=0;return e.reduce((i,s)=>{if(r>=t)return i;if(bf(s)){const a=_f(s.actions,t-r);i.push({group:s.group,actions:a}),r+=a.length}else i.push(s),r+=1;return i},[])}const[w1,Ki]=Xg("Spotlight component was not found in tree");var yn={root:"m_d2b315db",content:"m_3cd250e0",body:"m_d2abce9b",search:"m_f366a061",actionsList:"m_6e463822",action:"m_d49bb8ef",actionBody:"m_3d475731",actionSection:"m_832642f6",actionLabel:"m_6c2a1345",actionDescription:"m_a6d9d78d",empty:"m_82f78f74",footer:"m_ddcaf054",actionsGroup:"m_5a3e5f7b"};const S1={dimmedSections:!0,highlightQuery:!1},Ts=Qe((e,t)=>{const r=Ve("SpotlightAction",S1,e),{className:i,style:s,classNames:a,styles:o,id:l,description:c,label:d,leftSection:p,rightSection:h,children:f,dimmedSections:m,highlightQuery:y,highlightColor:b,closeSpotlightOnTrigger:S,onClick:k,onMouseDown:w,keywords:T,vars:A,...R}=r,E=Ki(),z={classNames:a,styles:o},N=y&&typeof d=="string"?n(Jg,{component:"span",highlight:E.query,color:b,...E.getStyles("actionLabel",z),children:d}):n("span",{...E.getStyles("actionLabel",z),children:d});return n(Mt,{ref:t,"data-action":!0,...E.getStyles("action",{className:i,style:s,...z}),...R,onMouseDown:C=>{C.preventDefault(),w==null||w(C)},onClick:C=>{k==null||k(C),(S??E.closeOnActionTrigger)&&hn.close(E.store)}
174,tabIndex:-1,children:f||u(ke,{children:[p&&n(G,{component:"span",mod:{position:"left",dimmed:m},...E.getStyles("actionSection",z),children:p}),u("span",{...E.getStyles("actionBody",z),children:[N,n("span",{...E.getStyles("actionDescription",z),children:c})]}),h&&n(G,{component:"span",mod:{position:"right",dimmed:m},...E.getStyles("actionSection",z),children:h})]})})});Ts.classes=yn;Ts.displayName="@mantine/spotlight/SpotlightAction";const C1={},wo=Qe((e,t)=>{const{className:r,style:i,styles:s,classNames:a,label:o,children:l,...c}=Ve("SpotlightActionsGroup",C1,e),d=Ki();return n(G,{...d.getStyles("actionsGroup",{className:r,style:i,classNames:a,styles:s}),ref:t,...c,__vars:{"--spotlight-label":`'${o}'`},children:l})});wo.classes=yn;wo.displayName="@mantine/core/SpotlightActionsGroup";const T1={},So=Qe((e,t)=>{const{className:r,style:i,id:s,children:a,vars:o,classNames:l,styles:c,...d}=Ve("SpotlightActionsList",T1,e),p=Ki(),h=`mantine-${_.useId().replace(/:/g,"")}`,f=s||h;return _.useEffect(()=>(hn.setListId(f,p.store),()=>hn.setListId("",p.store)),[]),n(Lt.Autosize,{...p.getStyles("actionsList",{className:r,style:i,classNames:l,styles:c}),ref:t,type:"scroll",scrollbarSize:"var(--spotlight-actions-list-padding)",offsetScrollbars:"y",id:f,...d,children:a})});So.classes=yn;So.displayName="@mantine/spotlight/SpotlightActionsList";const x1={},Co=Qe((e,t)=>{const{className:r,style:i,classNames:s,styles:a,...o}=Ve("SpotlightEmpty",x1,e),l=Ki();return n(G,{ref:t,...l.getStyles("empty",{classNames:s,styles:a,className:r,style:i}),...o})});Co.classes=yn;Co.displayName="@mantine/spotlight/SpotlightEmpty";const k1={},nd=Qe((e,t)=>{const{className:r,style:i,classNames:s,styles:a,...o}=Ve("SpotlightFooter",k1,e),l=Ki();return n(G,{ref:t,...l.getStyles("footer",{className:r,classNames:s,style:i,styles:a}),...o})});nd.classes=yn;nd.displayName="@mantine/spotlight/SpotlightFooter";function E1(e,t){if(!e)return[];const r=()=>hn.open(t);return Array.isArray(e)?e.map(i=>[i,r]):[[e,r]]}const P1={size:600,yOffset:80,zIndex:up("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"},store:yf,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K",maxHeight:400,scrollable:!1},To=Qe((e,t)=>{const r=Ve("SpotlightRoot",P1,e),{classNames:i,className:s,style:a,styles:o,unstyled:l,vars:c,store:d,children:p,query:h,onQueryChange:f,transitionProps:m,clearQueryOnClose:y,shortcut:b,tagsToIgnore:S,triggerOnContentEditable:k,disabled:w,onSpotlightOpen:T,onSpotlightClose:A,forceOpened:R,closeOnActionTrigger:E,maxHeight:z,scrollable:N,...C}=r,M=tn(),{opened:P,query:I}=c1(d),L=h||I,U=B=>{f==null||f(B),hn.setQuery(B,d)},q=_n({name:"Spotlight",classes:yn,props:r,className:s,style:a,classNames:i,styles:o,unstyled:l});return Zg(E1(b,d),S,k),kl(()=>{P?T==null||T():A==null||A()},[P]),w?null:n(w1,{value:{getStyles:q,query:L,setQuery:U,store:d,closeOnActionTrigger:E},children:n(Oe,{ref:t,...C,withCloseButton:!1,opened:P||!!R,padding:0,onClose:()=>hn.close(d),className:s,style:a,classNames:ty({theme:M,classNames:[yn,i],props:r,stylesCtx:void 0}),styles:ey({theme:M,styles:o,props:r,stylesCtx:void 0}),transitionProps:{...m,onExited:()=>{var B;y&&U(""),hn.clearSpotlightState({clearQuery:y},d),(B=m==null?void 0:m.onExited)==null||B.call(m)}},__vars:{"--spotlight-max-height":N?we(z):void 0},__staticSelector:"Spotlight","data-scrollable":N||void 0,children:p})})});To.classes=yn;To.displayName="@mantine/spotlight/SpotlightRoot";const M1={size:"lg"},xo=Qe((e,t)=>{const{classNames:r,styles:i,onKeyDown:s,onChange:a,vars:o,value:l,...c}=Ve("SpotlightSearch",M1,e),d=Ki(),p=d.getStyles("search"),[h,f]=_.useState(!1),m=y=>{s==null||s(y),!h&&(y.nativeEvent.code==="ArrowDown"&&(y.preventDefault(),hn.selectNextAction(d.store)),y.nativeEvent.code==="ArrowUp"&&(y.preventDefault(),hn.selectPreviousAction(d.store)),(y.nativeEvent.code==="Enter"||y.nativeEvent.code==="NumpadEnter")&&(y.preventDefault(),hn.triggerSelectedAction(d.store)))};return n(Zr,{ref:t,classNames:[{input:p.className},r],styles:[{input:p.style},i],...c,value:l??d.query,onChange:y=>{d.setQuery(y.currentTarget.value),a==null||a(y)},onKeyDown:m,onCompositionStart:()=>f(!0),onCompositionEnd:()=>f(!1)})});xo.classes=yn;xo.displayName="@mantine/spotlight/SpotlightSearch";const A1={size:600,yOffset:80,limit:1/0,zIndex:up("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"}
174,store:yf,filter:v1,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K",highlightQuery:!1},De=Qe((e,t)=>{const r=Ve("Spotlight",A1,e),{searchProps:i,filter:s,query:a,onQueryChange:o,actions:l,nothingFound:c,highlightQuery:d,limit:p,...h}=r,[f,m]=vc({value:a,defaultValue:"",finalValue:"",onChange:o}),y=_f(s(f,l),p).map(b=>{if(bf(b)){const S=b.actions.map(({id:k,...w})=>n(Ts,{highlightQuery:d,...w},k));return n(wo,{label:b.group,children:S},b.group)}return n(Ts,{highlightQuery:d,...b},b.id)});return u(To,{...h,query:f,onQueryChange:m,ref:t,children:[n(xo,{...i}),u(So,{children:[y,y.length===0&&c&&n(Co,{children:c})]})]})});De.classes=yn;De.displayName="@mantine/spotlight/Spotlight";De.Search=xo;De.ActionsList=So;De.Action=Ts;De.Empty=Co;De.ActionsGroup=wo;De.Footer=nd;De.Root=To;De.open=vo.open;De.close=vo.close;De.toggle=vo.toggle;function Oa(){return Oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Oa.apply(this,arguments)}function D1(e,t){if(e==null)return{};var r={},i=Object.keys(e),s,a;for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var I1=["cdnSuffix","cdnUrl","countryCode","style","svg"],$1="https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/",R1="svg",z1=127397,Fa=function(t){var r=t.cdnSuffix,i=r===void 0?R1:r,s=t.cdnUrl,a=s===void 0?$1:s,o=t.countryCode,l=t.style,c=t.svg,d=c===void 0?!1:c,p=D1(t,I1);if(typeof o!="string")return null;if(d){var h=""+a+o.toLowerCase()+"."+i;return _.createElement("img",Object.assign({},p,{src:h,style:Oa({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},l)}))}var f=o.toUpperCase().replace(/./g,function(m){return String.fromCodePoint(m.charCodeAt(0)+z1)});return _.createElement("span",Object.assign({role:"img"},p,{style:Oa({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},l)}),f)};function vf(e){return(((e==null?void 0:e.permission_mask)??0)&(Ce|iT))!==0}function TI(e){return(((e==null?void 0:e.permission_mask)??0)&Ce)!==0}function xI(e){return e==="auto"||e==="enabled"||e==="disabled"}function kI(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=1440}function EI(e){return[...e.trim()].length<=1e3}function N1(e,t){return e>t}function PI(e,t){return N1(e.sender_paused_until,t)?!1:e.mode==="enabled"||e.mode==="auto"&&e.automatic_moderation}const li={en:{nativeName:"English",flagId:"GB"},ru:{nativeName:"Русский",flagId:"RU"},es:{nativeName:"Español",flagId:"ES"}},[L1,pa]=td(),O1=({openAuthModal:e})=>{const{t,i18n:r}=Fe();return u(De.Root,{hiddenFrom:"md",store:L1,children:[n(hp,{size:"md",onClick:pa.close,style:{position:"absolute",top:"1rem",right:"1rem",zIndex:999}}),u(De.ActionsList,{p:"md",styles:{actionsList:{borderTop:0}},children:[u(De.ActionsGroup,{label:"Application",children:[n(De.Action,{onClick:()=>{pa.close(),e()},children:n($,{children:t("create_account")})}),n(De.Action,{onClick:()=>{pa.close(),e()},children:n($,{children:t("log_in")})})]}),n(De.ActionsGroup,{label:"Language",children:Object.keys(li).map(i=>n(De.Action,{onClick:()=>{r.changeLanguage(i)},closeSpotlightOnTrigger:!1,disabled:r.resolvedLanguage===i,children:u($,{style:{opacity:r.resolvedLanguage===i?"50%":"100%"},children:[n(Fa,{svg:!0,countryCode:li[i].flagId}),li[i].nativeName]})},i))})]})]})},[F1,mc]=td();function U1(){const{colorScheme:e,setColorScheme:t}=vt(),{t:r,i18n:i}=Fe(),{user:s}=fe(),{logoutMutation:a}=Vi(),o=pp(vd);function l(){t(o==="dark"?"light":"dark")}const c=gt();if(s)return u(De.Root,{fullScreen:!0,hiddenFrom:"md",store:F1,children:[n(hp,{size:"md",onClick:mc.close,style:{position:"absolute",top:"1rem",right:"1rem",zIndex:999}}),n(De.ActionsList,{p:"md",styles:{actionsList:{borderTop:0}},children:u(Lt,{h:"calc(100dvh - 1rem)",offsetScrollbars:!0,children:[u(De.ActionsGroup,{label:"Application",children:[n(De.Action,{onClick:()=>c(`${s.username}?tab=chat`),children:u($,{children:[n(Tp,{size:24,stroke:1.5}),r("my_stream")]})}),n(De.Action,{onClick:()=>c(`${s.username}/profile`),children:u($,{children:[n(fn,{size:24,stroke:1.5}),r("my_profile")]})}),n(De.Action,{onClick:()=>c("stream-panel"),children:u($,{children:[n(xp,{size:24,stroke:1.5}),r("stream_guide")]})}),n(De.Action,{onClick:()=>c("withdrawals"),children:u($,{children:[n(Xt,{size:24,stroke:1.5}),r("withdraw_menu")]})}),he(s,Ce)&&n(De.Action,{onClick:()=>c("withdraw"),children:u($,{children:[n(Xt,{size:24,stroke:1.5}),r("withdraw_admin")]})}),n(De.Action,{onClick:()=>c("settings/stream"),children:u($,{children:[n(kp,{size:24,stroke:1.5}),r("settings")]})}),vf(s)&&n(De.Action,{onClick:()=>{mc.close(),c("/argus")},children:u($,{children:[n(Ep,{size:24,stroke:1.5}),r("argus_nav")]})}),he(s,Ce)&&n(De.Action,{onClick:()=>c("admin/users"),children:u($,{children:[n(Pp,{size:24,stroke:1.5}),r("admin")]})}),n(De.Action,{onClick:()=>c("referral-program"),children:u($,{children:[n(Za,{size:24,stroke:1.5}),r("referral")]})}),n(De.Action,{onClick:()=>c("subscriptions"),children:u($,{children:[n(ai,{size:24,stroke:1.5}),r("subscriptions")]})}),n(De.Action,{onClick:()=>c("bundles"),children:u($,{children:[n(Mp,{size:24,stroke:1.5}),r("bundles")]})}),n(De.Action,{onClick:()=>c("/statistics"),children:u($,{children:[n(Ap,{size:24,stroke:1.5}),r("statistics")]})}),he(s,Ce)&&n(De.Action,{onClick:()=>c("/finances"),children:u($,{children:[n(Xt,{size:24,stroke:1.5}),r("Finances")]})}),n(De.Action,{onClick:()=>a.mutate(),children:u($,{children:[n(Dp,{size:24}),r("log_out")]})})]}),n(De.ActionsGroup,{label:"Theme",children:n(De.Action,{closeSpotlightOnTrigger:!1,children:u($,{children:[e==="dark"?n(Al,{size:24}):n(Dl,{size:24}),n(qt,{size:"xs",color:"green",checked:e==="dark",onChange:l,onClick:d=>d.stopPropagation()}),"Dark mode"]})})}),n(De.ActionsGroup,{label:"Language",children:Object.keys(li).map(d=>n(De.Action,{onClick:()=>{i.changeLanguage(d)},closeSpotlightOnTrigger:!1,disabled:i.resolvedLanguage===d,children:u($,{style:{opacity:i.resolvedLanguage===d?"50%":"100%"}
174,children:[n(Fa,{svg:!0,countryCode:li[d].flagId}),li[d].nativeName]})},d))})]})})]})}const B1="_button_zi535_1",q1={button:B1},j1={primary:{variant:"filled",color:"blue",radius:"xl"},secondary:{variant:"light",color:"gray",radius:"xl"},danger:{variant:"filled",color:"red",radius:"xl"},success:{variant:"filled",color:"green",radius:"xl"},ghost:{variant:"subtle",color:"gray",radius:"xl"},gradient:{variant:"gradient",gradient:{from:"indigo",to:"cyan",deg:135},radius:"xl"}};function An({variantType:e="primary",className:t,children:r,...i}){const s=j1[e];return n(V,{className:wc(q1.button,t),radius:"xl",...s,...i,children:r})}const H1=`
175  .auth-floating-input:-webkit-autofill,
176  .auth-floating-input:-webkit-autofill:hover,
177  .auth-floating-input:-webkit-autofill:focus,
178  .auth-floating-input:-webkit-autofill:active {
179    -webkit-box-shadow: 0 0 0 1000px var(--mantine-color-body) inset !important;
180    box-shadow: 0 0 0 1000px var(--mantine-color-body) inset !important;
181    -webkit-text-fill-color: var(--mantine-color-text) !important;
182    caret-color: var(--mantine-color-text);
183    border-bottom: none !important;
184    transition: background-color 99999s ease-in-out 0s, color 99999s ease-in-out 0s !important;
185  }
186  .auth-floating-input:autofill {
187    background-color: var(--mantine-color-body) !important;
188    color: var(--mantine-color-text) !important;
189  }
190`;if(typeof document<"u"&&!document.getElementById("_auth-autofill-styles")){const e=document.createElement("style");e.id="_auth-autofill-styles",e.textContent=H1,document.head.appendChild(e)}const wf={width:"100%",background:"transparent",border:"none",borderBottom:"none",outline:"none",fontSize:15,color:"var(--mantine-color-text)",padding:"2px 0 6px",boxSizing:"border-box"};function Yu({label:e,value:t,onChange:r,onBlur:i,error:s,type:a="text",autoComplete:o,name:l}){const[c,d]=_.useState(!1),p=_.useId(),h=c||t.length>0,f=!!s;return u("div",{style:{marginBottom:s?16:0},children:[u("div",{style:{position:"relative",paddingTop:18},children:[n("label",{htmlFor:p,style:{position:"absolute",left:0,top:h?0:18,fontSize:h?11:15,color:c?f?"#f03e3e":"#ed6ea0":f?"#f03e3e":"var(--mantine-color-dimmed)",transition:"top 180ms ease, font-size 180ms ease, color 180ms ease",pointerEvents:"none",lineHeight:1,fontWeight:h?500:400,letterSpacing:h?"0.04em":0},children:e}),n("input",{id:p,name:l,type:a,value:t,onChange:r,onFocus:()=>d(!0),onBlur:()=>{d(!1),i==null||i()},autoComplete:o,className:"auth-floating-input",style:wf}),n("div",{style:{position:"absolute",bottom:6,left:0,height:2,width:"100%",background:"var(--mantine-color-default-border)",borderRadius:1,pointerEvents:"none"}}),n("div",{style:{position:"absolute",bottom:6,left:"50%",transform:"translateX(-50%)",height:2,width:c||f?"100%":"0%",background:f?"#f03e3e":"linear-gradient(90deg, #ed6ea0, #ec8c69)",transition:"width 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94)",borderRadius:1,pointerEvents:"none"}})]}),s&&n("div",{style:{fontSize:11,color:"#f03e3e",marginTop:4,lineHeight:1.3},children:s})]})}function fl({label:e,value:t,onChange:r,onBlur:i,error:s,autoComplete:a="current-password",name:o}){const[l,c]=_.useState(!1),[d,p]=_.useState(!1),h=_.useId(),f=l||t.length>0,m=!!s;return u("div",{style:{marginBottom:s?16:0},children:[u("div",{style:{position:"relative",paddingTop:18},children:[n("label",{htmlFor:h,style:{position:"absolute",left:0,top:f?0:18,fontSize:f?11:15,color:l?m?"#f03e3e":"#ed6ea0":m?"#f03e3e":"var(--mantine-color-dimmed)",transition:"top 180ms ease, font-size 180ms ease, color 180ms ease",pointerEvents:"none",lineHeight:1,fontWeight:f?500:400,letterSpacing:f?"0.04em":0},children:e}),u("div",{style:{position:"relative"},children:[n("input",{id:h,name:o,type:d?"text":"password",value:t,onChange:r,onFocus:()=>c(!0),onBlur:()=>{c(!1),i==null||i()},autoComplete:a,className:"auth-floating-input",style:{...wf,padding:"2px 28px 6px 0"}}),n("button",{type:"button",tabIndex:-1,onClick:()=>p(y=>!y),style:{position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",padding:0,color:"var(--mantine-color-dimmed)",display:"flex",alignItems:"center"},children:d?n($y,{size:16}):n(Ry,{size:16})})]}),n("div",{style:{position:"absolute",bottom:6,left:0,height:2,width:"100%",background:"var(--mantine-color-default-border)",borderRadius:1,pointerEvents:"none"}}),n("div",{style:{position:"absolute",bottom:6,left:"50%",transform:"translateX(-50%)",height:2,width:l||m?"100%":"
1900%",background:m?"#f03e3e":"linear-gradient(90deg, #ed6ea0, #ec8c69)",transition:"width 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94)",borderRadius:1,pointerEvents:"none"}})]}),s&&n("div",{style:{fontSize:11,color:"#f03e3e",marginTop:4,lineHeight:1.3},children:s})]})}function Sf(e,t){return e?e.length<3?t("username_min_length","Username must be at least 3 characters"):e.length>16?t("username_max_length","Username must be at most 16 characters"):/^[a-zA-Z0-9_-]+$/.test(e)?/^[-_]+$/.test(e)?t("username_only_symbols","Username cannot consist only of _ or -"):(e.match(/[a-zA-Z]/g)??[]).length<3?t("username_min_letters","Username must contain at least 3 latin letters"):null:t("username_invalid_chars","Only letters, numbers, _ and - are allowed"):t("username_required","Username is required")}function Cf(e,t){return e?e.length<8?t("password_min_length","Password must be at least 8 characters"):null:t("password_required","Password is required")}function W1(e,t){return e?Sf(e,t):null}function Y1(e,t){return e?Cf(e,t):null}function Q1(e){const t=document.createElement("img");t.width=1,t.height=1,t.style.cssText="position:absolute;opacity:0;pointer-events:none;",t.src=`https://ads.trafficjunky.net/ct?a=1000569781&member_id=1008787931&cb=${Date.now()}&cti=${e}&ctv=0.00&ctd=Signup`,document.body.appendChild(t),t.onload=t.onerror=()=>t.remove()}function V1({opened:e,onClose:t}){const r=gt(),[i]=bn(),{loginMutation:s,registerMutation:a}=Vi(),{t:o}=Fe(),l=Ge({mode:"controlled",initialValues:{username:"",password:""}}),c=Ge({mode:"controlled",initialValues:{username:"",password:"",confirmPassword:""},validate:{username:y=>Sf(y,o),password:y=>Cf(y,o),confirmPassword:(y,b)=>y&&y!==b.password?o("passwords_dont_match","Passwords do not match"):null}}),[d,p]=_.useState("login");function h(y){p(y),l.reset(),c.reset()}function f(){l.reset(),c.reset(),t()}const m={from:"#ed6ea0",to:"#ec8c69",deg:35};return n(Oe,{opened:e,onClose:f,centered:!0,withCloseButton:!0,padding:"xl",radius:"lg",size:420,styles:{header:{justifyContent:"center",paddingBottom:0},title:{width:"100%"}},title:n($,{justify:"center",children:n("img",{width:72,src:bo,alt:"Logo"})}),children:u(re,{value:d,onChange:h,mt:"xs",styles:{list:{"&::before":{display:"none"}}},children:[u(re.List,{grow:!0,mb:"lg",children:[n(re.Tab,{value:"login",fw:600,children:o("log_in","Log In")}),n(re.Tab,{value:"register",fw:600,children:o("create_account","Sign Up")})]}),n(re.Panel,{value:"login",children:n("form",{onSubmit:l.onSubmit(y=>s.mutate(y,{onSuccess(){f(),r(i.get("return")??"/")}})),children:u(j,{gap:"lg",children:[s.isError&&n(Le,{variant:"light",color:"red.5",icon:n(zt,{}),children:o("wrong_credentials","Wrong username or password")}),n(Yu,{label:o("username","Username"),value:l.values.username,onChange:y=>l.setFieldValue("username",y.target.value),name:"username",autoComplete:"username"}),n(fl,{label:o("password","Password"),value:l.values.password,onChange:y=>l.setFieldValue("password",y.target.value),name:"password",autoComplete:"current-password"}),n(An,{disabled:s.isPending,loading:s.isPending,fullWidth:!0,mt:"xs",variant:"gradient",gradient:m,type:"submit",children:o("log_in","Log In")})]})})}),n(re.Panel,{value:"register",children:n("form",{onSubmit:c.onSubmit(y=>a.mutate({username:y.username,password:y.password},{onSuccess(b){Q1(b.uuid),f(),r(i.get("return")??"/")}})),children:u(j,{gap:"lg",children:[a.isError&&n(Le,{variant:"light",color:"red.5",icon:n(zt,{}),children:o("register_error","Registration failed. Please try again.")}),n(Yu,{label:o("username","Username"),value:c.values.username,onChange:y=>c.setFieldValue("username",y.target.value),onBlur:()=>{c.values.username&&c.setFieldError("username",W1(c.values.username,o))},error:c.errors.username,name:"username",autoComplete:"username"}),n(fl,{label:o("password","Password"),value:c.values.password,onChange:y=>c.setFieldValue("password",y.target.value),onBlur:()=>{c.values.password&&c.setFieldError("password",Y1(c.values.password,o))},error:c.errors.password,name:"password",autoComplete:"new-password"}),n(fl,{label:o("confirm_password","Confirm Password"),value:c.values.confirmPassword,onChange:y=>c.setFieldValue("confirmPassword",y.target.value),onBlur:()=>{if(c.values.confirmPassword){const{password:y,confirmPassword:b}=c.values;c.setFieldError("confirmPassword",b!==y?o("passwords_dont_match","Passwords do not match"):null)}},error:c.errors.confirmPassword,name:"confirmPassword",autoComplete:"new-password"}),n(v,{size:"xs",c:"dimmed",ta:"center",style:{lineHeight:1.5},children:u(_p,{i18nKey:"tos_pp_warning",components:{tos:n(Ze,{component:"a",href:"/terms-of-use",target:"_blank",rel:"noopener noreferrer",size:"xs",c:"#ed6ea0"}),pp:n(Ze,{component:"a",href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",size:"xs",c:"#ed6ea0"})},children:["By creating an account, you acknowledge that you have read and agree to our"," ",n(Ze,{component:"a",href:"/terms-of-use",target:"_blank",rel:"noopener noreferrer",size:"xs",c:"#ed6ea0",children:"Terms of Service"})," ","and"," ",n(Ze,{component:"a",href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",size:"xs",c:"#ed6ea0",children:"Privacy Policy"})]})}),n(An,{disabled:s.isPending,loading:s.isPending,fullWidth:!0,mt:"xs",variant:"primary",gradient:m,type:"submit",children:o("log_in","Log In")})]})})})]})})}const fc={before:Number.MAX_SAFE_INTEGER};function K1(e={}){const t=Object.entries(e).filter(([,i])=>i!==void 0);if(t.length>1||t.some(([,i])=>!Number.isSafeInteger(i)||i<=0))throw new Error("Invalid conversation cursor");
190const r=new URLSearchParams({limit:"50"});return t.forEach(([i,s])=>r.set(i,String(s))),r.toString()}function G1(e){return e.has_older&&e.messages.length?{before:e.messages[0].id}:void 0}function X1(e){return e.sync_after!==void 0?{after:e.sync_after}:e.has_newer&&e.messages.length?{after:e.messages[e.messages.length-1].id}:void 0}function Ua(e){const t=new Map;return e.forEach(r=>r.messages.forEach(i=>t.set(i.id,i))),[...t.values()].sort((r,i)=>r.id-i.id)}function ci(e,t){const r=new Map(t.messages.map(o=>[o.id,o])),i=new Set,s=o=>{var l;o.deleted&&i.add(o.id),(l=o.reply_to)!=null&&l.deleted&&i.add(o.reply_to.id)};e.pages.forEach(o=>o.messages.forEach(s)),t.messages.forEach(s);const a=o=>{const l=r.get(o.id)??o;return i.has(l.id)?{...l,deleted:!0,body:"",media:[],can_delete:!1,pinned:!1,reply_to:null,reply_to_id:null}:l.reply_to&&i.has(l.reply_to.id)?{...l,reply_to:{...l.reply_to,body:"",sender:null,deleted:!0}}:l};return{...e,pages:e.pages.map(o=>({...o,messages:o.messages.map(a)}))}}function J1(e,t){var o;const r=e==null?void 0:e.pages[e.pages.length-1],i=(o=r==null?void 0:r.messages[r.messages.length-1])==null?void 0:o.id;if(e!=null&&e.pages.some(l=>l.messages.some(c=>c.id===t.id)))return ci(e,{messages:[t]});if(e&&r&&i&&(!r.has_newer||r.sync_after!==void 0)){const l=[...e.pages.slice(0,-1),{...r,messages:[...r.messages,t],sync_after:r.sync_after??i}],c=ci({...e,pages:l},{messages:[]});return c.pages[c.pages.length-1].messages=Ua([c.pages[c.pages.length-1]]),c}const s={messages:[t],has_older:!0,has_newer:!1};return{pages:ci({pages:[s],pageParams:[]},{...s,messages:Ua((e==null?void 0:e.pages)??[])}
190).pages,pageParams:[{around:t.id}]}}function Qu(e,t,r,i){var o,l;const s=e.pages[e.pages.length-1];if((s==null?void 0:s.sync_after)!==void 0&&s.sync_after===i){const c=((o=t.messages[t.messages.length-1])==null?void 0:o.id)??i,d=((l=s.messages[s.messages.length-1])==null?void 0:l.id)??i,p=[...e.pages.slice(0,-1),{...s,messages:[...s.messages,...t.messages],has_newer:t.has_newer,sync_after:c<d?c:void 0}],h=ci({...e,pages:p},r);return h.pages[h.pages.length-1].messages=Ua([h.pages[h.pages.length-1]]),h}const a=i?t.messages.length?{pages:[...e.pages,t],pageParams:[...e.pageParams,{after:i}]}:e:{pages:[t],pageParams:[fc]};return ci(a,r)}function MI(e,t){const r=e.bottom-e.top,i=t.bottom-t.top,s=Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top);return r>0&&i>0&&s>=Math.min(i/2,r/2)}const rd=5e3,Fn=e=>`${O}/chats/${encodeURIComponent(e)}`;function Tf(e,t){return e.allowed&&(t==null?void 0:t.id)===e.id&&t.last_read_id>e.last_read_id?{...e,last_read_id:t.last_read_id,unread_count:t.unread_count,reply_count:t.reply_count,first_unread_id:t.first_unread_id,next_reply_id:t.next_reply_id}:e}function Z1(e){const{user:t,isLoading:r}=fe(),i=at(),s=_.useMemo(()=>["conversations",(t==null?void 0:t.id)??"guest",(t==null?void 0:t.encrypted_name)??"",(t==null?void 0:t.permission_mask)??0],[t==null?void 0:t.id,t==null?void 0:t.encrypted_name,t==null?void 0:t.permission_mask]),a=_.useMemo(()=>[...s,"summary",e??"project"],[s,e]);return{...oe({queryKey:a,enabled:!r&&!!t,queryFn:async()=>{const l=await ae(Fn(e??"project")),c=i.getQueryData(a);return Tf(l,c)},staleTime:3e3,refetchInterval:rd,retry:1}),summaryKey:a,scope:s}}function eT(){return Z1()}function ns(e,t={}){return ae(`${Fn(e)}/messages?${K1(t)}`)}function AI(e,t){const r=new FormData;return r.append("type",t.type.startsWith("video/")?"video":"photo"),r.append("file",t),Qi(`${Fn(e)}/media`,r)}function DI(e,t,r,i){return _e(`${Fn(e)}/messages`,{body:t.trim(),media_ids:r,reply_to_id:i})}function II(e,t){return et(`${Fn(e)}/messages/${t}`)}function $I(e,t,r){return _e(`${Fn(e)}/messages/${t}/pin`,{pinned:r})}function RI(e,t,r){var H,K;const i=at(),s=_.useMemo(()=>[...t,"messages",e.id,r??"entry"],[t,e.id,r]),[a]=_.useState(e.first_unread_id??null),[o,l]=_.useState(!1),[c,d]=_.useState(r?{sequence:1,target:r}:null),[p,h]=_.useState(!1),[f,m]=_.useState(!1),[y,b]=_.useState(!1),[S,k]=_.useState(!1),w=_.useRef(r?1:0),T=_.useRef(!1),A=_.useRef(!0),R=_.useRef(null),E=_.useRef(null),z=_.useCallback(X=>{E.current=X},[]),N=_.useRef(!1),[C,M]=_.useState(!1),P=zc({queryKey:s,queryFn:({pageParam:X})=>ns(e.id,X),initialPageParam:r?{around:r}:{},getPreviousPageParam:G1,getNextPageParam:X1,staleTime:1/0,gcTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,retry:1}),{fetchPreviousPage:I}=P,L=_.useMemo(()=>{var X;return Ua(((X=P.data)==null?void 0:X.pages)??[])},[P.data]),U=((K=(H=P.data)==null?void 0:H.pages[P.data.pages.length-1])==null?void 0:K.sync_after)!==void 0;_.useEffect(()=>(A.current=!0,T.current=!1,()=>{A.current=!1,w.current+=1,T.current=!0}),[]);const q=_.useCallback(async X=>{await i.cancelQueries({queryKey:s,exact:!0},{revert:!1}),i.setQueryData(s,Z=>Z&&{...Z,pages:Z.pages.map(le=>({...le,messages:le.messages.map(X)}))})},[i,s]),B=_.useCallback(()=>{var Z;const X=[...t.slice(0,-1),"project"];return t[t.length-1]!=="project"&&((Z=i.getQueryData(X))==null?void 0:Z.id)===e.id?[t,X]:[t]},[i,t,e.id]),Y=_.useCallback(()=>Promise.all(B().map(X=>i.invalidateQueries({queryKey:X,exact:!0}))),[i,B]),Q=_.useCallback(async(X,{background:Z=!1}={})=>{const le=++w.current;T.current=!0,h(!0),m(!Z),b(!1),l(!1),E.current=null;try{await i.cancelQueries({queryKey:s,exact:!0},{revert:!1});const de=X==="bottom"?fc:{around:X},ye=await ns(e.id,de);if(w.current!==le)return;i.setQueryData(s,{pages:[ye],pageParams:[de]}),d({sequence:le,target:X})}catch{w.current===le&&b(!0)}finally{w.current===le&&(T.current=!1,h(!1),m(!1))}},[i,s,e.id]),W=_.useCallback(async X=>{var ye,ge;if(!A.current)return;const Z=++w.current;if(await i.cancelQueries({queryKey:s,exact:!0},{revert:!1}),!A.current||Z!==w.current)return;const le=J1(i.getQueryData(s),X);i.setQueryData(s,le),T.current=!1,E.current=null,h(!1),m(!1),b(!1),l(!0),d({sequence:Z,target:"bottom"});const de=(ye=le.pages[le.pages.length-1])==null?void 0:ye.sync_after;de!==void 0?(R.current=Z,ns(e.id,{after:de}).then(async be=>{!A.current||Z!==w.current||(await i.cancelQueries({queryKey:s,exact:!0},{revert:!1}),!(!A.current||Z!==w.current)&&(i.setQueryData(s,Me=>Me&&Qu(Me,be,be,de)),k(!1)))}).catch(()=>{A.current&&Z===w.current&&k(!0)}).finally(()=>{R.current===Z&&(R.current=null)})):le.pages.length===1&&((ge=le.pageParams[0])==null?void 0:ge.around)===X.id&&le.pages[0].has_older&&I().catch(()=>{})},[i,s,e.id,I]);_.useEffect(()=>{if(P.isFetching||p)return;let X=!1,Z=!1;const le=async()=>{var te;if(Z||document.visibilityState!=="visible"||T.current||R.current===w.current)return;const ye=i.getQueryData(s),ge=ye==null?void 0:ye.pages[ye.pages.length-1],be=ge==null?void 0:ge.sync_after,Me=o&&!P.hasNextPage,ne=E.current;if(!Me&&!ne&&be===void 0)return;Z=!0;const Re=w.current;try{const $e=be??((te=ge==null?void 0:ge.messages[ge.messages.length-1])==null?void 0:te.id)??0,Ue=ns(e.id,ne?{around:ne}:fc),[ot,mr]=await Promise.all([Ue,Me||be!==void 0?$e?ns(e.id,{after:$e}):Ue:Promise.resolve(null)]);if(X||Re!==w.current||T.current||(await i.cancelQueries({queryKey:s,exact:!0},{revert:!1}),X||Re!==w.current||T.current))return;i.setQueryData(s,Sn=>Sn&&(mr?Qu(Sn,mr,ot,$e):ci(Sn,ot))),k(!1)}catch{X||k(!0)}finally{Z=!1}},de=window.setInterval(()=>void le(),rd);return()=>{X=!0,window.clearInterval(de)}},[o,P.hasNextPage,P.isFetching,p,i,s,e.id]);const F=_.useCallback(async X=>{var ye;if(N.current||T.current||document.visibilityState!=="visible"||!document.hasFocus())return;const Z=i.getQueryData(t);if(!(Z!=null&&Z.allowed))return;if(X<=(Z.last_read_id??0)){M(!1);return}const le=i.getQueryData(s),de=(ye=le==null?void 0:le.pages[le.pages.length-1])==null?void 0:ye.sync_after;if(!(de!==void 0&&X>de)){N.current=!0;try{const ge=await _e(`${Fn(e.id)}/read`,{message_id:X}),be=B();await Promise.all(be.map(Me=>i.cancelQueries({queryKey:Me,exact:!0}))),be.forEach(Me=>i.setQueryData(Me,ne=>ne&&!ne.allowed?ne:Tf(ge,ne))),M(!1)}catch{M(!0)}finally{N.current=!1}}},[i,t,s,e.id,B]);return{history:P,messages:L,catchingUp:U,initialUnreadId:a,navigation:c,navigating:p,navigationLoading:f,navigationError:y,pollError:S,readError:C,setAtLatest:l,setViewportMessage:z,navigate:Q,receiveMessage:W,markVisible:F,updateMessages:q,refreshSummary:Y}}function zI(e,t){const r=oe({queryKey:[...t,"online",e],queryFn:()=>ae(`${Fn(e)}/online`),refetchInterval:rd,gcTime:0,retry:1});return _.useEffect(()=>{let i=!1;const s=async()=>
190{if(!(document.visibilityState!=="visible"||i)){i=!0;try{await _e(`${Fn(e)}/presence`)}catch{}finally{i=!1}}};s();const a=window.setInterval(()=>void s(),2e4);return document.addEventListener("visibilitychange",s),()=>{window.clearInterval(a),document.removeEventListener("visibilitychange",s)}},[e]),r}function tT({color:e}){const{user:t,isLoading:r}=fe();return!r&&t?n(nT,{color:e}):null}function nT({color:e}){const{data:t}=eT();return n(rT,{color:e,data:t})}function rT({color:e,data:t}){const{t:r}=Fe(),i=t!=null&&t.allowed?t.unread_count:0,s=t!=null&&t.allowed&&t.reply_count>0?void 0:"gray",a=i&&i>99?"99+":i,o=i?`${r("public_chat_title")}: ${r("public_chat_new_messages_count",{count:i})}`:r("public_chat_title");return u(ke,{children:[n(_a,{hiddenFrom:"md",label:a,color:s,disabled:!i,size:17,offset:3,children:n(Ne,{component:xe,to:"/chat",color:e,variant:"subtle",size:"lg","aria-label":o,children:n(Ed,{size:"1.2rem"})})}),n(V,{component:xe,to:"/chat",variant:"subtle",color:e,visibleFrom:"md",size:"compact-md",leftSection:n(Ed,{size:"1.2rem"}),"aria-label":o,rightSection:i?n(pe,{color:s,size:"sm",variant:"filled",children:a}):void 0,children:r("public_chat_title")})]})}const Br=1,Vu=2,Ku=4,iT=8,Ce=16,NI=32,ei=64,Gu=128,sT=0,ta={en:{nativeName:"English"},ru:{nativeName:"Русский"},es:{nativeName:"Español"}},gc=()=>{var C,M,P,I;const[e,{open:t,close:r}]=_t(!1),[i,{open:s,close:a}]=_t(!1),{t:o,i18n:l}=Fe(),[c,d]=bn(),{user:p}=fe(),{logoutMutation:h}=Vi(),{sendMessageMutation:f,notificationCountQuery:m}=Bs(),{pathname:y}=qr(),{colorScheme:b,setColorScheme:S}=vt(),k=pp(vd),[w,{toggle:T}]=_t(!1),A=Ha(`(max-width: ${Wa(800)})`),{depositMutation:R}=Na(),E=gt();o1(),_.useEffect(()=>{const L=c.get("ref");L&&(document.cookie=`referrer=${encodeURIComponent(L)}; max-age=${3600*24*7}; path=/`,d({}))},[c]);function z(){S(k==="dark"?"light":"dark")}const N=b==="dark"?"rgba(36, 36, 36, 0.92)":"rgba(255, 255, 255, 0.92)";return u(Xo,{header:{height:50},padding:"md",children:[u(Xo.Header,{withBorder:!1,style:{background:N,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[n(V1,{opened:i,onClose:a}),n(ZC,{opened:e,close:r,onTopUp:(L,U,q,B)=>{var Y;if(q==="auto-bank-card"){R.mutate({amount_need_to_pay:U,amount:L,method:sT},{onSuccess(Q){!Q.reference||!Q.amount||!B||(B.location.href=`${O}/deposit/${Q.reference}`)},onError(){B==null||B.close()}});return}f.mutate({username:"",message:[`Top up request: ${se(L)}, `,`need to pay: ${se(U,q==="ru-card"?"RUB":void 0)} `,`via payment method ${(Y=yr.get(q))==null?void 0:Y.label}`].join("")},{onSuccess(){E("/support")}})}}),u($,{justify:"space-between",h:"100%",px:"sm",align:"center",children:[u($,{gap:"xs",align:"center",h:"100%",children:[A&&w?null:n(Bg,{onClick:L=>{if(L.preventDefault(),y!=="/"){E("/");return}window.scrollTo({top:0,behavior:"smooth"})},to:"/",style:{lineHeight:0},children:n("img",{width:40,height:40,src:bo,alt:"Logo"})}),u($,{maw:"calc(100dvw - 1.5rem)",gap:"xs",align:"center",wrap:"nowrap",children:[A&&p&&n(Ne,{size:"lg",variant:w?"light":"subtle",color:"gray",onClick:T,children:w?n(ht,{size:"1.2rem"}):n(Ot,{size:"1.2rem"})}),n(hf,{isCollapsed:w||!A})]})]}),A&&w?null:u($,{gap:"xs",align:"center",h:"100%",children:[!p&&u(ke,{children:[n($,{gap:"xs",visibleFrom:"xs",align:"center",children:u(ce,{withArrow:!0,zIndex:1e3,styles:{dropdown:{background:b==="dark"?"rgba(36, 36, 36, 0.95)":"rgba(255, 255, 255, 0.95)"}},children:[n(An,{variant:"light",size:"compact-md",onClick:s,radius:16,children:o("log_in")}),n(An,{variant:"gradient",color:"gray",size:"compact-md",onClick:s,radius:16,children:o("create_account")}),n(ce.Target,{children:n(Ne,{variant:"subtle",color:b==="dark"?"gray":"dark.7",size:"lg",children:n(fn,{size:"1.4rem"})})}),u(ce.Dropdown,{children:[n(ce.Label,{children:"Theme"}),n(ce.Item,{closeMenuOnClick:!1,leftSection:b==="dark"?n(Al,{size:"1rem"}):n(Dl,{size:"1rem"}),rightSection:n(qt,{size:"xs",color:"green",checked:k==="dark",readOnly:!0,onClick:L=>L.stopPropagation()}),onClick:z,children:"Dark mode"})," ",n(ce.Label,{children:"Language"}),Object.keys(ta).map(L=>n(ce.Item,{onClick:()=>l.changeLanguage(L),disabled:l.resolvedLanguage===L,children:ta[L].nativeName},L))]})]})}),n(O1,{openAuthModal:s}),n(An,{onClick:pa.open,variant:"default",hiddenFrom:"xs",size:"compact-md",children:n(zy,{size:"1rem"})})]}),n(tT,{color:b==="dark"?"gray":"dark.7"}),p&&u(ke,{children:[n(An,{component:xe,to:"/feed",variant:"subtle",color:b==="dark"?"gray":"dark.7",visibleFrom
190:"sm",leftSection:n(Ip,{size:"1.2rem"}),size:"compact-md",children:o("feed")}),n(An,{component:xe,to:"/rating/streamers",variant:"subtle",color:b==="dark"?"gray":"dark.7",visibleFrom:"sm",leftSection:n(Il,{size:"1.2rem"}),size:"compact-md",children:o("rating")}),n(Ne,{component:xe,to:"/rating/streamers",color:b==="dark"?"gray":"dark.7",hiddenFrom:"sm",visibleFrom:"xs",variant:"subtle",size:"lg",children:n(Il,{size:"1.2rem"})}),n(_a,{visibleFrom:"xs",size:"lg",radius:"md",processing:!0,color:"red.5",offset:5,withBorder:!0,position:"bottom-start",label:(C=m.data)==null?void 0:C.unread,disabled:m.isPending||((M=m.data)==null?void 0:M.unread)==0,children:n(An,{component:xe,to:"/support",variant:"subtle",color:b==="dark"?"gray":"dark.7",visibleFrom:"xs",leftSection:n(Pd,{size:"1.2rem"}),size:"compact-md",children:o("support")})}),n(_a,{hiddenFrom:"xs",size:"lg",radius:"md",processing:!0,color:"red.5",offset:5,withBorder:!0,position:"bottom-start",label:(P=m.data)==null?void 0:P.unread,disabled:m.isPending||((I=m.data)==null?void 0:I.unread)==0,children:n(Ne,{component:xe,to:"/support",color:b==="dark"?"gray":"dark.7",hiddenFrom:"xs",variant:"subtle",size:"lg",children:n(Pd,{size:"1.2rem"})})}),p&&n(Se,{label:`${o("topup_title")} (Earned ${se((p==null?void 0:p.earnings)??0)})`,color:"dark",withArrow:!0,children:n(An,{disabled:!he(p,Br),onClick:t,color:"green",variant:b==="dark"?"light":"filled",size:"compact-md",children:se(((p==null?void 0:p.balance)??0)+((p==null?void 0:p.earnings)??0))})}),n(U1,{}),n(Ne,{hiddenFrom:"md",variant:"light",color:b==="dark"?"gray.3":"dark.7",size:"lg",onClick:mc.open,children:n(Ny,{size:"1rem"})}),u(ce,{withArrow:!0,zIndex:1e3,styles:{dropdown:{background:b==="dark"?"rgba(36, 36, 36, 0.95)":"rgba(255, 255, 255, 0.95)"}},children:[n(ce.Target,{children:n(pn,{visibleFrom:"md",src:p.avatar?`${xt}/files/${p.avatar}`:void 0,name:p.username?p.username.charAt(0).toUpperCase():"N",size:40,style:{cursor:"pointer"}})}),u(ce.Dropdown,{children:[n(ce.Label,{children:"Application"}),n(ce.Item,{leftSection:n(Tp,{size:"1rem"}),component:xe,to:`${p.username}?tab=chat`,children:o("my_stream")}),n(ce.Item,{leftSection:n(fn,{size:"1rem"}),component:xe,to:`${p.username}/profile`,children:o("my_profile")}),n(ce.Item,{leftSection:n(xp,{size:"1rem"}),component:xe,to:"stream-panel",children:o("stream_guide")}),he(p,Ce)&&n(ce.Item,{leftSection:n(Xt,{size:"1rem"}),component:xe,to:"withdraw",children:o("withdraw_admin")}),n(ce.Item,{leftSection:n(Xt,{size:"1rem"}),component:xe,to:"withdrawals",children:o("withdraw_menu")}),n(ce.Item,{leftSection:n(kp,{size:"1rem"}),component:xe,to:"settings/stream",children:o("settings")}),vf(p)&&n(ce.Item,{leftSection:n(Ep,{size:"1rem"}),component:xe,to:"/argus",children:o("argus_nav")}),he(p,Ce)&&n(ce.Item,{leftSection:n(Pp,{size:"1rem"}),component:xe,to:"admin/users",children:o("admin")}),he(p,Ce)&&n(ce.Item,{leftSection:n(Ly,{size:"1rem"}),component:xe,to:"crypto-deposits",children:"Crypto Deposits"}),n(ce.Item,{leftSection:n(Za,{size:"1rem"}),component:xe,to:"referral-program",children:o("referral")}),n(ce.Item,{leftSection:n(ai,{size:"1rem"}),component:xe,to:"subscriptions",children:o("subscriptions")}),n(ce.Item,{leftSection:n(Ap,{size:"1rem"}),component:xe,to:"statistics",children:o("statistics")}),n(ce.Item,{leftSection:n(Mp,{size:"1rem"}),component:xe,to:"bundles",children:o("bundles")}),he(p,Ce)&&n(ce.Item,{leftSection:n(Xt,{size:"1rem"}),component:xe,to:"/finances",children:o("Finances")}),n(ce.Label,{children:"Theme"}),n(ce.Item,{closeMenuOnClick:!1,onClick:z,leftSection:b==="dark"?n(Al,{size:"1rem"}):n(Dl,{size:"1rem"}),rightSection:n(qt,{size:"xs",color:"green",checked:b==="dark",onChange:z,onClick:L=>L.stopPropagation()}),children:"Dark mode"}),n(ce.Label,{children:"Language"}),Object.keys(ta).map(L=>n(ce.Item,{onClick:()=>l.changeLanguage(L),disabled:l.resolvedLanguage===L,children:ta[L].nativeName},L)),n(ce.Divider,{}),n(ce.Item,{leftSection:n(Dp,{size:"1rem"}),onClick:async()=>{h.mutate()},children:o("log_out")})]})]})]})]})]})]}),u(Xo.Main,{children:[n("div",{style:{position:"fixed",top:"10%",right:"10%",width:"40%",height:"40%",opacity:"40%",filter:"blur(240vw)"}}),n(qg,{})]})]})},st=new Intl.DateTimeFormat(void 0,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}),xf=0,aT=1,oT=2;function Xu(e){const t=new Map([[xf,{status:"pending",color:"blue"}],[aT,{status:"cancelled",color:"red"}],[oT,{status:"completed",color:"green"}]]);return t.get(e)??t.get(0)}const lT=0,cT=1;function Ju(e){const t=new Map([[lT,{status:"Freekassa",color:"orange"}],[cT,{status:"Paypal",color:"blue"}]]);return t.get(e)??t.get(0)}function dT(){const{user:e}=fe(),{depositsQuery:t,depositMutation:r,approveDepositMutation:i,cancelDepositMutation:s}=Na(),a=Ge({initialValues:{amount:10,method:-1},validate:{amount:cs({min:10,max:9999},"Amount must be between 10 and 9999$")},transformValues:l=>
190({amount:l.amount*100,method:parseInt(l.method.toString())})}),o=_.useMemo(()=>{var l;return(l=t.data)==null?void 0:l.sort((c,d)=>new Date(d.created_at).getTime()-new Date(c.created_at).getTime())},[t.data]);return n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(ue.Section,{children:u(j,{gap:0,p:"md",children:[n(Ye,{order:3,children:x("deposit_title")}),u(wt,{style:{fontSize:"0.875rem"},children:["Payment methods explained:",u("ul",{children:[n("li",{children:"Freekassa: automatic payments through debit/credit card, after filling out this page you will be sent to Freekassa for payment"}),n("li",{children:"Paypal: You will be given an autogenerated token that will be used to identify your payment"})]})]}),n("form",{onSubmit:a.onSubmit(async()=>{}),children:u(j,{gap:5,children:[n(pt,{required:!0,label:x("donate_amount"),prefix:"$",leftSection:n(Xt,{size:"1rem"}),decimalScale:2,thousandSeparator:" ",description:"Commission and transfer fees may apply depending on the payment method",...a.getInputProps("amount")}),n(it,{required:!0,label:"Payment method",description:"Freekassa supports card/crypto: card only works in RU/UA/KZT",leftSection:n(eo,{size:"1rem"}),data:[{value:"0",label:"Freekassa"},{value:"1",label:"Paypal"}],...a.getInputProps("method")}),n($,{justify:"left",mt:"sm",children:n(V,{rightSection:n(to,{size:16}),variant:"light",color:"green.3",type:"submit",loading:r.isPending,disabled:r.isPending,children:x("deposit_submit")})}),n(je,{my:"sm",label:"Deposits"}),n(g.ScrollContainer,{minWidth:500,children:u(g,{striped:!0,stripedColor:"dark.7",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Date"}),n(g.Th,{children:"Token"}),n(g.Th,{children:"Amount"}),n(g.Th,{children:"Amount paid"}),n(g.Th,{children:"Method"}),n(g.Th,{children:"Status"}),n(g.Th,{})]})}
190),n(g.Tbody,{children:o==null?void 0:o.map(l=>{var c,d,p,h;return u(g.Tr,{children:[n(g.Td,{children:st.format(new Date(l.created_at))}),n(g.Td,{children:l.token}),n(g.Td,{children:se(l.amount)}),n(g.Td,{children:se(l.amount_paid)}),n(g.Td,{children:n(pe,{color:(c=Ju(l.method))==null?void 0:c.color,variant:"light",children:(d=Ju(l.method))==null?void 0:d.status})}),n(g.Td,{children:n(pe,{color:(p=Xu(l.request_status))==null?void 0:p.color,variant:"dot",children:(h=Xu(l.request_status))==null?void 0:h.status})}),n(g.Td,{align:"right",children:l.request_status===xf&&u(mp,{children:[he(e,Ce)&&n(V,{variant:"subtle",size:"compact-xs",color:"green.3",disabled:i.isPending,loading:i.isPending,leftSection:n(Ke,{size:"1rem"}),onClick:async()=>{const f=await prompt("Enter amount");f&&i.mutate({id:l.id,amount:parseFloat(f)*100})},children:"Approve"}),n(V,{variant:"subtle",size:"compact-xs",color:"red.3",disabled:s.isPending,loading:s.isPending,leftSection:n($p,{size:"1rem"}),onClick:async()=>{confirm("Are you sure you want to cancel?")&&s.mutate(l.id)},children:"Cancel"})]})})]},l.id)})})]})})]})})]})})})}async function uT(e){return await _e(`${O}/on-site-events`,e)}async function hT(e){return await Ft(`${O}/on-site-events/${e.id}`,e)}async function pT(){return await ae(`${O}/on-site-events`)}async function mT(e){return await ae(`${O}/on-site-events/${e}`)}function kf(){const e=J({mutationFn:uT}),t=J({mutationFn:hT});return{createEventMutation:e,updateEventMutation:t,getEventQuery:s=>oe({queryKey:["site.event",s],queryFn:()=>mT(s)}),getEventsQuery:()=>oe({queryKey:["site.events"],queryFn:pT})}}function fT(){var s,a;const{id:e}=Bn();if(!e)return;const{getEventQuery:t}=kf(),r=t(parseInt(e)),{i18n:i}=Fe();return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{dangerouslySetInnerHTML:{__html:(i.resolvedLanguage==="en"?(s=r.data)==null?void 0:s.description_eng:(a=r.data)==null?void 0:a.description_ru)??""}})})})})}function gT(){const e=gt(),[t]=bn(),{loginMutation:r}=Vi(),{t:i}=Fe(),s=Ge({initialValues:{username:"",password:""}});return u(Be,{size:420,my:40,children:[n(ct,{component:xe,to:"/",children:n("img",{width:100,src:bo})}),n(Ie,{withBorder:!0,shadow:"md",p:30,mt:30,radius:"md",children:u("form",{onSubmit:s.onSubmit(a=>r.mutate(a,{onSuccess(){e(t.get("return")??"/")}})),children:[r.isError&&n(Le,{variant:"light",color:"red.5",icon:n(zt,{}),mb:"sm",children:"Wrong username/password"}),n(Te,{label:i("username"),placeholder:i("enter_username"),leftSection:n(fs,{size:"1rem"}),required:!0,...s.getInputProps("username")}),n(ds,{label:i("password"),leftSection:n(Ca,{size:"1rem"}),placeholder:i("enter_password"),required:!0,mt:"md",...s.getInputProps("password")}),n(V,{disabled:r.isPending,loading:r.isPending,fullWidth:!0,mt:"xl",variant:"gradient",gradient:{from:"#ed6ea0",to:"#ec8c69",deg:35},type:"submit",children:i("log_in")})]})}),u(v,{c:"dimmed",size:"sm",ta:"center",mt:10,children:[i("no_account_yet"),"?"," ",n(Ze,{size:"sm",color:"pink",component:xe,to:"/create-account",children:i("create_account")})]})]})}const yT=()=>{const e=jg();return n(mt,{justify:"center",style:{height:"100dvh"},children:n(ct,{children:u(j,{gap:0,children:[!e.message&&u(ke,{children:[n(Ye,{variant:"gradient",order:1,ta:"center",fw:700,children:"404"}),n(v,{c:"dimmed",children:"The page you are looking for was not found"})]}),e.message&&u(ke,{children:[n(Ye,{variant:"gradient",order:1,ta:"center",fw:700,children:"Application error"}),n(v,{ta:"center",children:e.message})]}),u($,{justify:"center",children:[n(Ze,{underline:"never",component:xe,to:"/",children:"Go back to browse"}),n(Ze,{underline:"never",component:xe,to:"/auth",children:"Sign in"})]})]})})})};async function bT(e,t){return ae(`${O}/referral/${e}/statistics?month=${encodeURIComponent(t)}`)}function _T(e,t="total"){return{statisticsQuery:oe({queryKey:["referral","statistics",e,t],queryFn:()=>{if(e===void 0)throw new Error("User ID is required");return bT(e,t)},enabled:e!==void 0&&t.length>0})}}const vT=`
191  <h3>How the Referral Program Works</h3>
192
193  <p>
194    Invite new users to the platform using your personal referral link and earn
195    rewards from their qualifying activity.
196  </p>
197
198  <h4>Share your referral link</h4>
199
200  <p>
201    Every registered user receives a unique referral link. Share your link with
202    people you would like to invite to the platform.
203  </p>
204
205  <h4>Two levels of referrals</h4>
206
207  <ol>
208    <li>
209      <strong>Level 1 referrals</strong> are users who register directly through
210      your referral link. You receive <strong>5%</strong> from their qualifying
211      actions, including donations, dare creation and dare contributions.
212    </li>
213
214    <li>
215      <strong>Level 2 referrals</strong> are users invited by your Level 1
216      referrals. You receive <strong>1.25%</strong> from their qualifying
217      actions.
218    </li>
219  </ol>
220
221  <h4>Fair play</h4>
222
223  <p>
224    Creating duplicate accounts, manipulating referrals or using fraudulent
225    activity to generate referral rewards is prohibited. Abuse of the referral
226    program may result in removal from the program and cancellation of
227    improperly obtained rewards.
228  </p>
229
230  <p>
231    Share your link, invite new people and earn rewards as your referral network
232    grows.
233  </p>
234`,wT=`
235  <h3>Как работает реферальная программа</h3>
236
237  <p>
238    Приглашайте новых пользователей на платформу с помощью своей персональной
239    реферальной ссылки и получайте вознаграждение за их активность.
240  </p>
241
242  <h4>Поделитесь своей реферальной ссылкой</h4>
243
244  <p>
245    Каждый зарегистрированный пользователь получает уникальную реферальную
246    ссылку. Отправьте её людям, которых вы хотите пригласить на платформу.
247  </p>
248
249  <h4>Два уровня рефералов</h4>
250
251  <ol>
252    <li>
253      <strong>Рефералы первого уровня</strong> — пользователи, которые
254      зарегистрировались непосредственно по вашей ссылке. Вы получаете
255      <strong>5%</strong> от суммы их учитываемых действий, включая донаты,
256      создание заданий и взносы в задания.
257    </li>
258
259    <li>
260      <strong>Рефералы второго уровня</strong> — пользователи, приглашённые
261      вашими рефералами первого уровня. Вы получаете <strong>1,25%</strong>
262      от суммы их учитываемых действий.
263    </li>
264  </ol>
265
266  <h4>Честное участие</h4>
267
268  <p>
269    Создание дублирующих аккаунтов, манипуляции с реферальной системой и другие
270    мошеннические действия с целью получения вознаграждений запрещены.
271    Нарушение правил программы может привести к исключению из неё и отмене
272    неправомерно полученных вознаграждений.
273  </p>
274
275  <p>
276    Делитесь своей ссылкой, приглашайте новых пользователей и получайте
277    вознаграждение по мере роста своей реферальной сети.
278  </p>
279`,ST=`
280  <h3>Cómo funciona el Programa de Referidos</h3>
281
282  <p>
283    Invita a nuevos usuarios a la plataforma mediante tu enlace personal de
284    referido y recibe recompensas por su actividad válida.
285  </p>
286
287  <h4>Comparte tu enlace de referido</h4>
288
289  <p>
290    Cada usuario registrado recibe un enlace de referido único. Comparte tu
291    enlace con las personas que quieras invitar a la plataforma.
292  </p>
293
294  <h4>Dos niveles de referidos</h4>
295
296  <ol>
297    <li>
298      Los <strong>referidos de Nivel 1</strong> son usuarios que se registran
299      directamente mediante tu enlace. Recibes un <strong>5%</strong> de sus
300      acciones válidas, incluidas donaciones, creación de retos y
301      contribuciones a retos.
302    </li>
303
304    <li>
305      Los <strong>referidos de Nivel 2</strong> son usuarios invitados por tus
306      referidos de Nivel 1. Recibes un <strong>1,25%</strong> de sus acciones
307      válidas.
308    </li>
309  </ol>
310
311  <h4>Juego limpio</h4>
312
313  <p>
314    Está prohibido crear cuentas duplicadas, manipular referidos o utilizar
315    actividades fraudulentas para generar recompensas. El abuso del programa
316    puede resultar en la exclusión del mismo y en la cancelación de las
317    recompensas obtenidas de forma indebida.
318  </p>
319
320  <p>
321    Comparte tu enlace, invita a nuevas personas y recibe recompensas a medida
322    que crece tu red de referidos.
323  </p>
324`,Zu={en:vT,ru:wT,es:ST},Ef=2026,CT=3;function Pf(){return new Date().getFullYear()}function TT(){return new Date().getMonth()+1}function xT(){const e=Pf(),t=[];for(let r=Ef;r<=e;r++)t.push(String(r));return t.reverse()}function eh(e,t){const r=new Date,i=r.getFullYear(),s=r.getMonth()+1,a=e===Ef?CT:1,o=e===i?s:12,l=new Intl.DateTimeFormat(t,{month:"long"}),c=[];for(let d=a;d<=o;d++){const p=l.format(new Date(e,d-1,1));c.push({value:String(d),label:p.charAt(0).toLocaleUpperCase(t)+p.slice(1)})}return c}const kT=()=>{var z,N;const{user:e}=fe(),{t,i18n:r}=Fe(),i=Pf(),s=TT(),[a,o]=_.useState("total"),[l,c]=_.useState(String(i)),[d,p]=_.useState(String(s)),h=_.useMemo(()=>xT().map(C=>({value:C,label:C})),[]),f=_.useMemo(()=>eh(Number(l),r.language),[l,r.language]),m=a==="total"?"total":`${l}-${d.padStart(2,"0")}`,{statisticsQuery:y}=_T(e==null?void 0:e.id,m),b=((z=r.resolvedLanguage)==null?void 0:z.split("-")[0])??r.language.split("-")[0],S=Zu[b]??Zu.en,k=_.useMemo(()=>y.data?[...y.data].sort((C,M)=>(M.earned??0)-(C.earned??0)):[],[y.data]),w=_.useMemo(()=>{var C;return((C=y.data)==null?void 0:C.reduce((M,P)=>M+(P.earned??0),0))??0},[y.data]),T=C=>new Intl.NumberFormat(r.language,{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(C/100),A=C=>{switch(C){case"First Level":return t("First Level");case"Second Level":return t("Second Level");default:return C}},R=C=>{if(!C)return;const M=Number(C);c(C);const P=eh(M,r.language);!P.some(L=>L.value===d)&&P.length>0&&p(P[P.length-1].value)};if(!e)return null;const E=e.referral_code?`https://${Ss}/?ref=${e.referral_code}`:null;return n(G,{maw:1100,mx:"auto",px:{base:"md",sm:"xl"},py:{base:"lg",sm:40},children:u(j,{gap:32,children:[n(G,{children:u($,{gap:"md",align:"center",children:[n(bt,{size:48,radius:"xl",variant:"gradient",gradient:{from:"teal",to:"lime",deg:35},children:n(sa,{size:24})}),u(G,{children:[n(Ye,{order:1,size:"h2",children:t("Referral Program")}),n(v,{c:"dimmed",mt:4,children:t("Invite people and earn rewards from their activity")})]})]})}),E&&u(Ie,{radius:"lg",p:{base:"md",sm:"lg"},bg:"var(--mantine-color-default-hover)",children:[u($,{gap:"sm",mb:"sm",children:[n(Oy,{size:18}),n(v,{fw:600,children:t("Your referral link")})]}),n(v,{size:"sm",c:"dimmed",mb:"md",children:t("Share this link to invite new users")}),n(Te,{readOnly:!0,value:E,rightSection:n(us,{value:E,children:({copied:C,copy:M})=>n(Se,{label:t(C?"Copied":"Copy link"),withArrow:!0,children:n(Ne,{variant:"subtle",color:C?"green":"gray",onClick:M,"aria-label":t("Copy referral link"),children:C?n(Ke,{size:17}):n(Ta,{size:17})})})})})]}),u(mn,{cols:{base:1,xs:2},children:[n(Ie,{withBorder:!0,radius:"lg",p:"lg",children:u($,{justify:"space-between",children:[u(G,{children:[n(v,{size:"xs",tt:"uppercase",fw:600,c:"dimmed",children:t(a==="total"?"Total referral earnings":"Referral earnings for selected month")}),n(v,{fw:700,fz:{base:26,sm:32},mt:6,children:y.isLoading?"...":T(w)})]}),n(bt,{size:44,radius:"xl",variant:"light",children:n(Ja,{size:21})})]})}),n(Ie,{withBorder:!0,radius:"lg",p:"lg",children:u($,{justify:"space-between",children:[u(G,{children:[n(v,{size:"xs",tt:"uppercase",fw:600,c:"dimmed",children:t("Referrals")}),n(v,{fw:700,fz:{base:26,sm:32},mt:6,children:y.isLoading?"...":((N=y.data)==null?void 0:N.length)??0})]}),n(bt,{size:44,radius:"xl",variant:"light",children:n(sa,{size:21})})]})})]}),u(G,{children:[u($,{justify:"space-between",align:"flex-end",gap:"md",mb:"lg",children:[u(G,{children:[n(Ye,{order:2,size:"h3",children:t("Referral statistics")}),n(v,{size:"sm",c:"dimmed",mt:4,children:t("See how much you earned from each referral")})]}),u(j,{gap:"xs",w:{base:"100%",sm:"auto"},children:[n(Sc,{value:a,onChange:C=>o(C),data:[{value:"total",label:t("Total")},{value:"month",label:t("By month")}]}),a==="month"&&u($,{gap:"xs",grow:!0,wrap:"nowrap",children:[n(it,{value:d,onChange:C=>{C&&p(C)},data:f,allowDeselect:!1,label:t("Month"),w:{base:"100%",sm:180}}
324),n(it,{value:l,onChange:R,data:h,allowDeselect:!1,label:t("Year"),w:{base:"100%",sm:120}})]})]})]}),y.isError&&n(Le,{icon:n(zt,{size:18}),color:"red",mb:"md",children:t("Could not load referral statistics")}),y.isLoading&&u(j,{gap:"sm",children:[n(ri,{height:56,radius:"md"}),n(ri,{height:56,radius:"md"}),n(ri,{height:56,radius:"md"})]}),!y.isLoading&&!y.isError&&k.length===0&&n(Ie,{withBorder:!0,radius:"lg",py:48,px:"md",children:u(j,{align:"center",gap:"xs",children:[n(bt,{size:52,radius:"xl",variant:"light",color:"gray",children:n(sa,{size:25})}),n(v,{fw:600,children:t("No referrals yet")}),n(v,{c:"dimmed",size:"sm",ta:"center",maw:420,children:t("Share your referral link to start building your referral network")})]})}),!y.isLoading&&!y.isError&&k.length>0&&u(ke,{children:[n(ue,{withBorder:!0,radius:"lg",p:0,visibleFrom:"sm",children:u(g,{striped:!0,highlightOnHover:!0,verticalSpacing:"md",horizontalSpacing:"lg",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:t("Username")}),n(g.Th,{children:t("Level")}),n(g.Th,{ta:"right",children:t("Earned")})]})}),n(g.Tbody,{children:k.map(C=>n(ET,{referral:C,formatLevel:A,formatMoney:T},`${C.level}-${C.username}`))})]})}),n(j,{hiddenFrom:"sm",gap:"sm",children:k.map(C=>n(PT,{referral:C,formatLevel:A,formatMoney:T,earnedLabel:t("Earned")},`${C.level}-${C.username}`))})]})]}),n($,{children:n(V,{rightSection:n(Xt,{size:17}),component:xe,to:"/withdraw",variant:"gradient",gradient:{from:"teal",to:"lime",deg:35},children:t("Withdraw")})}),n(je,{}),n(G,{maw:850,children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:S}})})})]})})};function ET({referral:e,formatLevel:t,formatMoney:r}){return u(g.Tr,{children:[n(g.Td,{children:n(v,{fw:500,children:e.username})}),n(g.Td,{children:n(pe,{variant:"light",children:t(e.level)})}),n(g.Td,{ta:"right",children:n(v,{fw:700,children:r(e.earned??0)})})]})}function PT({referral:e,formatLevel:t,formatMoney:r,earnedLabel:i}){return n(Ie,{withBorder:!0,radius:"lg",p:"md",children:u($,{justify:"space-between",align:"flex-start",wrap:"nowrap",children:[u(G,{children:[n(v,{fw:600,children:e.username}),n(pe,{variant:"light",size:"sm",mt:7,children:t(e.level)})]}),u(G,{ta:"right",children:[n(v,{size:"xs",c:"dimmed",children:i}),n(v,{fw:700,fz:"lg",mt:2,children:r(e.earned??0)})]})]})})}function MT(){const e=gt(),{registerMutation:t}=Vi(),[r,i]=bn(),s=Ge({initialValues:{username:"",password:"",confirmPassword:""},validate:{username:$r("Username cannot be empty"),password:$r("Password cannot be empty"),confirmPassword:ny("password","passwords must match")}});return u(Be,{size:420,my:40,children:[n(ct,{component:xe,to:"/",children:n("img",{width:100,src:bo})}),n(Ie,{withBorder:!0,shadow:"md",p:30,mt:30,radius:"md",children:u("form",{onSubmit:s.onSubmit(a=>t.mutate(a,{onSuccess(){e(r.get("return")??"/")}})),children:[n(Te,{label:"Username",placeholder:"Enter your username",leftSection:n(fs,{size:"1rem"}),required:!0,...s.getInputProps("username")}),n(ds,{label:"Password",placeholder:"Enter your password",leftSection:n(xa,{size:"1rem"}),required:!0,mt:"md",...s.getInputProps("password")}),n(ds,{label:"Confirm password",placeholder:"Enter your password again",leftSection:n(xa,{size:"1rem"}),required:!0,mt:"md",...s.getInputProps("confirmPassword")}),n(v,{size:"xs",c:"dimmed",ta:"center",style:{lineHeight:1.5},children:u(_p,{i18nKey:"tos_pp_warning",components:{tos:n(Ze,{component:"a",href:"/terms-of-use",target:"_blank",rel:"noopener noreferrer",size:"xs",c:"#ed6ea0"}),pp:n(Ze,{component:"a",href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",size:"xs",c:"#ed6ea0"})},children:["By creating an account, you acknowledge that you have read and agree to our"," ",n(Ze,{component:"a",href:"/terms-of-use",target:"_blank",rel:"noopener noreferrer",size:"xs",c:"#ed6ea0",children:"Terms of Service"})," ","and"," ",n(Ze,{component:"a",href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",size:"xs",c:"#ed6ea0",children:"Privacy Policy"})]})}),n(V,{disabled:t.isPending,loading:t.isPending,rightSection:n(Fy,{size:"1rem"}),fullWidth:!0,mt:"xl",variant:"gradient",gradient:{from:"#ed6ea0",to:"#ec8c69",deg:35},type:"submit",children:"Sign Up"})]})}),u(v,{c:"dimmed",size:"sm",ta:"center",mt:10,children:["Already have an account?"," ",n(Ze,{size:"sm",color:"pink",component:xe,to:"/auth",children:"Log in"})]})]})}function AT(){const{t:e}=Fe();return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:e("platform_rules")}})})})})})}async function DT(e){return await _e(`${O}/chat`,e)}async function IT(e){return await et(`${O}/chat`,e)}async function $T(e){return await ae(`${O}/${e}/chat`)}async function RT(e){return await et(`${O}/${e}/chat`)}async function zT({username:e,messageId:t,pinned:r}){return await Ft(`${O}/${e}/chat/pin`,{id:t,pin:r})}async function NT({body:e,message_id:t,target_lang:r}){return await _e(`https://${Ss}/api/translate`,{text:e,message_id:t,target_lang:r})}const LT=(e,t,r)=>{if(!e)return e;const i=e.map(l=>l.id===t?{...l,pinned:r}:r?{...l,pinned:!1}
324:l),s=i.filter(l=>l.pinned),o=i.filter(l=>!l.pinned).slice(-50);return[...s,...o].sort((l,c)=>new Date(l.created).getTime()-new Date(c.created).getTime())};function ko(e){const t=at(),r=()=>oe({queryKey:["chat",e],queryFn:()=>$T(e)}),i=J({mutationFn:DT}),s=J({mutationFn:IT}),a=J({mutationFn:NT}),o=J({mutationFn:RT}),l=J({mutationFn:zT,onSuccess:(c,{messageId:d,pinned:p})=>{t.setQueryData(["chat",e],h=>LT(h,d,p))}});return{messagesQuery:r,sendMessageMutation:i,deleteMessageMutation:s,translateMutation:a,cleanChatMutation:o,pinMessageMutation:l}}async function OT({id:e,username:t}){return await _e(`${O}/${t}/moderator/${e}`)}async function FT({id:e,username:t}){return await et(`${O}/${t}/moderator/${e}`)}async function UT(e){return await ae(`${O}/${e}/moderator`)}async function BT({id:e,username:t}){return await _e(`${O}/${t}/moderator/ban/${e}`)}async function qT({id:e,username:t}){return await et(`${O}/${t}/moderator/ban/${e}`)}async function jT(e){return await _e(`${O}/${e}/block`)}async function HT(e){return await et(`${O}/${e}/block`)}async function WT(e){return await ae(`${O}/${e}/block`)}async function YT(e){return await ae(`${O}/${e}/moderator/ban`)}async function QT(e){return await _e(`${O}/${e}/switch-stream`)}function id(e){const t=at(),r=oe({queryKey:["moderators",e],queryFn(){return e&&UT(e)}}),i=J({mutationKey:["moderator.switch_stream"],mutationFn:QT}),s=J({mutationKey:["moderator.appoint",e],mutationFn:OT,onSuccess(){r.refetch()}}),a=J({mutationKey:["moderator.dismiss",e],mutationFn:FT,onSuccess(){r.refetch()}}),o=()=>oe({queryKey:["moderator.banned",e],queryFn(){if(e)return YT(e)}}),l=J({mutationKey:["moderator.ban",e],mutationFn:BT,onSuccess(){t.resetQueries({queryKey:["moderator.banned",e]})}}),c=J({mutationKey:["moderator.unban",e],mutationFn:qT,onSuccess(){t.resetQueries({queryKey:["moderator.banned",e]})}}),d=J({mutationKey:["moderator.block",e],mutationFn:jT,onSuccess(){t.resetQueries({queryKey:["moderator.banned",e]})}}),p=J({mutationKey:["moderator.unblock",e],mutationFn:HT,onSuccess(){t.resetQueries({queryKey:["moderator.banned",e]})}});return{moderatorsQuery:r,appointModeratorMutation:s,dismissModeratorMutation:a,banMutation:l,unbanMutation:c,bannedQuery:o,blockMutation:d,unblockMutation:p,isBlockedQuery:()=>oe({queryKey:["moderator.is_blocked",e],queryFn(){if(e)return WT(e)}}),switchStreamMutation:i}}function VT({level:e}){return u(ke,{children:[e==2&&n(Se,{color:"dark",label:"Spent more than $10 within last 30 days",children:n(Ks,{size:"1.1rem",style:{color:"#d4ffd4",marginRight:"0.25rem"}})}),e==4&&n(Se,{color:"dark",label:"Spent more than $50 within last 30 days",children:n(Ks,{size:"1.1rem",style:{color:"#f0a866",marginRight:"0.25rem"}})}),e==8&&n(Se,{color:"dark",label:"Spent more than $250 within last 30 days",children:n(Ks,{size:"1.1rem",style:{color:"#e0e0e0",marginRight:"0.25rem"}})}),e==16&&n(Se,{color:"dark",label:"Spent more than $500 within last 30 days",children:n(Ks,{size:"1.1rem",style:{color:"#ffd43b",marginRight:"0.25rem"}})}),e==32&&n(Se,{color:"dark",label:"Spent more than $1000 within last 30 days",children:n(el,{size:"1.1rem",style:{color:"#89d8f8",marginRight:"0.25rem",filter:"drop-shadow(0px 0px 2px #89d8f8)"}})}),e==64&&n(Se,{color:"dark",label:"Spent more than $2000 within last 30 days",children:n(el,{size:"1.1rem",style:{color:"#ff005d",marginRight:"0.25rem",filter:"drop-shadow(0px 0px 2px #ff005d)"}})}),e==128&&n(Se,{color:"dark",label:"Spent more than $3000 within last 30 days",children:n(el,{size:"1.1rem",style:{color:"#00ff55",marginRight:"0.25rem",filter:"drop-shadow(0px 0px 2px #00ff55)"}})})]})}function KT(){return n(Se,{color:"dark",label:"This streamer",children:n(no,{size:"1.1rem",style:{color:"#ffd43b",marginRight:"0.25rem"}})})}function GT(){return n(Se,{color:"dark",label:"Moderator on this stream",children:n(zp,{size:"1.1rem",style:{color:"#ffd43b",marginRight:"0.25rem"}})})}function XT(){return n(Se,{color:"dark",label:"Eventmaker",children:n(Rp,{size:"1.1rem",style:{color:"#3bc9db",marginRight:"0.25rem"}})})}function JT({id:e}){return n(Se,{color:"dark",label:"Women's day event winner",children:n(Uy,{size:"1.1rem",style:{color:new Map([[1045,"#f0a866"],[95,"#e0e0e0"],[35,"#ffd43b"]]).get(e),marginRight:"0.25rem"}})})}function ZT({ratingData:e}){if(!e)return null;switch(e.placement){case"gold":return n(Se,{color:"dark",label:`Top-1 ${e.category} of the previous month!`,children:e.category==="donator"?n(aa,{size:"1.1rem",style:{color:"#ffd43b",marginRight:"0.25rem"}}):n(Zo,{size:"1.1rem",style:{color:"#ffd43b",marginRight:"0.25rem"}})});case"silver":return n(Se,{color:"dark",label:`Top-2 ${e.category} of the previous month!`,children:e.category==="donator"?n(aa,{size:"1.1rem",style:{color:"#e0e0e0",marginRight:"0.25rem"}}):n(Zo,{size:"1.1rem",style:{color:"#e0e0e0",marginRight:"0.25rem"}})});case"bronze":return n(Se,{color:"dark",label:`Top-3 ${e.category} of the previous month!`,children:e.category==="donator"?n(aa,{size:"1.1rem",style:{color:"#f0a866",marginRight:"0.25rem"}}):n(Zo,{size:"1.1rem",style:{color:"#f0a866",marginRight:"0.25rem"}})})}}function ex(){return n(Se,{color:"dark",label:"First user earned $2000",children:n(By,{size:"1.1rem",style:{color:"#3bc9db",marginRight:"0.25rem"}})})}function tx(){return n(Se,{color:"dark",label:"Top referrer",children:n(jy,{size:"1.1rem",style:{color:"#1E90FF",marginRight:"0.25rem",filter:["drop-shadow(0 0 3px rgba(30, 144, 255, 0.9))","drop-shadow(0 0 8px rgba(30, 144, 255, 0.5))","brightness(1.3)","saturate(1.4)"].join(" "),transition:"transform 0.2s ease, filter 0.2s ease",cursor:"pointer",verticalAlign:"middle"},onMouseEnter:e=>{const t=e.currentTarget;t.style.transform="scale(1.25)",t.style.filter=["drop-shadow(0 0 5px rgba(30, 144, 255, 1))","drop-shadow(0 0 12px rgba(30, 144, 255, 0.8))","brightness(1.6)","saturate(1.6)"].join(" ")},onMouseLeave:e=>{const t=e.currentTarget;t.style.transform="scale(1)",t.style.filter=["drop-shadow(0 0 3px rgba(30, 144, 255, 0.9))","drop-shadow(0 0 8px rgba(30, 144, 255, 0.5))","brightness(1.3)","saturate(1.4)"].join(" ")}})})}function nx(){return n(Se,{color:"dark",label:"Main contributor to contests",children:n(qy,{size:"1.1rem",style:{color:"#f0e110ff",marginRight:"0.25rem"}})})}function rx(){return n(Se,{color:"dark",label:"Administrator [only visible to you]",children:n(bt,{size:"xs",variant:"filled",color:"blue.6",style:{marginRight:"0.25rem"},children:n(Wy,{size:"0.875rem"})})})}function ix(){return n(Se,{color:"dark",label:"Administrator",children:n(bt,{size:"xs",variant:"filled",color:"green.6",style:{marginRight:"0.25rem"},children:n(Hy,{size:"1rem"})})})}async function sx({username:e,invited_users:t}){return await _e(`${O}/invitations/${e}`,{invited_users:t})}async function ax({username:e,user_id:t,is_anonymous:r}){return await _e(`${O}/invitations/${e}/invite`,{user_id:t,is_anonymous:r})}async function ox(){return await ae(`${O}/invitations/`)}async function lx(){return await et(`${O}/invitations`)}async function cx(e){return await ae(`${O}/invitations/is_invited/${e}`)}async function dx(e){return await _e(`${O}/invitations/invite`,e)}async function ux(e){return await et(`${O}/invitations/${e.username}`)}function Mf(){const e=at(),t=oe({queryKey:["invitations"],queryFn:ox}),r=J({mutationFn:ax,onSuccess:()=>
324{e.invalidateQueries({queryKey:["invitations"]})}}),i=J({mutationFn:sx,onSuccess:()=>{e.invalidateQueries({queryKey:["invitations"]})}}),s=J({mutationFn:lx,onSuccess:()=>{e.invalidateQueries({queryKey:["invitations"]})}}),a=J({mutationFn:dx,onSuccess:()=>{e.invalidateQueries({queryKey:["invitations"]})}}),o=J({mutationFn:ux,onSuccess:()=>{e.invalidateQueries({queryKey:["invitations"]})}});return{invitationsQuery:t,inviteUserMutation:r,inviteUsersMutation:i,revokeInvitationsMutation:s,inviteByUsernameMutation:a,revokeInvitationByUsernameMutation:o}}function LI(e,t=!0){return oe({queryKey:["invitations",e],queryFn:()=>cx(e),enabled:t})}async function hx(){return ae(`${O}/bundles/media`)}async function px(){return ae(`${O}/bundles/list`)}async function mx(){return ae(`${O}/bundles/shared`)}async function fx(){return ae(`${O}/bundles/shared-by-me`)}async function gx(){return ae(`${O}/bundles/purchases`)}async function yx(){return ae(`${O}/bundles/sales`)}async function Af(e){return ae(`${O}/bundles/${encodeURIComponent(e)}`)}async function bx(e){return ae(`${O}/bundles/sales/${encodeURIComponent(e)}`)}async function _x({type:e,file:t}){const r=new FormData;return r.append("type",e),r.append("file",t),Qi(`${O}/bundles/media`,r)}async function vx(e){return _e(`${O}/bundles/create`,e)}async function wx(e){return et(`${O}/bundles/${encodeURIComponent(e)}`)}async function Sx({bundle_id:e,username:t,user_id:r,is_anonymous:i}){return _e(`${O}/bundles/${encodeURIComponent(e)}/share`,{username:t,user_id:r,is_anonymous:i})}async function Cx(e){return et(`${O}/bundles/${encodeURIComponent(e)}/share`)}async function Tx(e){return _e(`${O}/bundles/${encodeURIComponent(e)}/purchase`,{})}function Df(e,t){return`${O}/bundles/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}function sd(e,t){return`${O}/bundles/${encodeURIComponent(e)}/${encodeURIComponent(t)}/preview`}function If(e){return`${O}/bundles/media/${encodeURIComponent(e)}`}function vn(){const e=oe({queryKey:["bundles","media"],queryFn:hx}),t=oe({queryKey:["bundles","mine"],queryFn:px}),r=oe({queryKey:["bundles","shared"],queryFn:mx}),i=oe({queryKey:["bundles","shared-by-me"],queryFn:fx}),s=oe({queryKey:["bundles","purchases"],queryFn:gx}),a=oe({queryKey:["bundles","sales"],queryFn:yx}),o=y=>oe({queryKey:["bundles","detail",y],queryFn:()=>Af(y),enabled:!!y}),l=y=>oe({queryKey:["bundles","bundle-sales",y],queryFn:()=>bx(y),enabled:!!y}),c=J({mutationFn:_x}),d=J({mutationFn:vx}),p=J({mutationFn:wx}),h=J({mutationFn:Sx}),f=J({mutationFn:Cx}),m=J({mutationFn:Tx});return{myMediaQuery:e,myBundlesQuery:t,sharedBundlesQuery:r,sharedByMeQuery:i,purchasedBundlesQuery:s,mySalesQuery:a,bundleQuery:o,bundleSalesQuery:l,uploadMediaMutation:c,createBundleMutation:d,deleteBundleMutation:p,shareBundleMutation:h,unshareBundleMutation:f,purchaseBundleMutation:m}}function xx({opened:e,onClose:t,targetUser:r,isAnonymous:i}){const{myBundlesQuery:s,shareBundleMutation:a}=vn(),o=(s.data??[]).slice().sort((d,p)=>new Date(p.created_at).getTime()-new Date(d.created_at).getTime()),l=d=>{a.mutate({bundle_id:d.id,username:i?null:r.username??null,user_id:i?r.id:null,is_anonymous:i},{onSuccess:()=>{t()}})},c=i?x("chat_bundle_anonymous_user"):`@${r.username}`;return n(Oe,{opened:e,onClose:t,title:x("chat_bundle_share_title",{username:c}),centered:!0,radius:"lg",size:"md",children:u(j,{gap:"md",children:[n(v,{size:"sm",c:"dimmed",children:x("chat_bundle_share_description")}),s.isLoading?n($,{justify:"center",py:"xl",children:n(Xe,{size:"sm"})}):o.length===0?n(Ie,{withBorder:!0,radius:"lg",p:"lg",children:u(j,{align:"center",gap:"xs",children:[n(Ns,{size:30,opacity:.45}),n(v,{fw:600,children:x("chat_bundle_no_bundles")}),n(v,{size:"sm",c:"dimmed",ta:"center",children:x("chat_bundle_no_bundles_description")})]})}):n(Lt.Autosize,{mah:480,offsetScrollbars:!0,children:n(j,{gap:"sm",children:o.map(d=>n(Ie,{withBorder:!0,radius:"lg",p:"md",children:u($,{justify:"space-between",align:"center",wrap:"nowrap",gap:"md",children:[u(j,{gap:4,style:{minWidth:0},children:[u($,{gap:"xs",children:[n(v,{fw:700,truncate:!0,children:d.tag||x("bundles_no_tag")}),n(pe,{variant:"light",color:"teal",children:se(d.price)})]}),d.description&&n(v,{size:"sm",c:"dimmed",lineClamp:2,children:d.description})]}),n(V,{size:"sm",variant:"light",leftSection:n(Pc,{size:16}),loading:a.isPending,onClick:()=>l(d),style:{flexShrink:0},children:x("chat_bundle_share")})]})},d.id))})}),s.isError&&n(v,{size:"sm",c:"red",ta:"center",children:x("chat_bundle_load_failed")})]})})}var $f=(e=>(e[e.Message=0]="Message",e[e.Donation=1]="Donation",e[e.Sub=2]="Sub",e[e.Unsub=3]="Unsub",e))($f||{});function th(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")}function gl(e){return e.match(/https?:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(\/.*)?/gi)}function kx(e,t){if(t==null)return[{chunk:e,highlighted:!1}];const r=Array.isArray(t)?t.map(th):th(t);if(!(Array.isArray(r)?r.filter(l=>l.trim().length>0).length>0:r.trim()!==""))return[{chunk:e,highlighted:!1}];const s=typeof r=="string"?r.trim():r.filter(l=>
324l.trim().length!==0).map(l=>l.trim()).sort((l,c)=>c.length-l.length).join("|"),a=new RegExp(`(${s})\\b`,"gi");return e.split(a).map(l=>({chunk:l,highlighted:a.test(l)})).filter(({chunk:l})=>l)}function Ex(e){const t=e.split(":"),r=t.shift(),i=t.join("");return{amount:r,message:i}}function Px({id:e,username:t,sender:r,body:i,original_body:s,isGift:a}){const{amount:o,message:l}=Ex(i),{user:c}=fe(),{translateMutation:d}=ko(t),p=at(),{i18n:h}=Fe(),f=m=>{const y=m/100;return y%1===0?`$${Math.floor(y)}`:y%1<.1?`$${y.toFixed(1)}`:`$${y.toFixed(2)}`};return n($,{wrap:"nowrap",gap:1,align:"start",children:u(v,{size:"lg",c:"yellow",style:{cursor:l.length>0?"pointer":"auto"},onClick:async()=>{if(!he(c,Br)||l==="")return;if(s){p.setQueriesData({queryKey:["chat",t]},y=>y.map(b=>b.id===e?{...b,body:s,original_body:""}:b));return}const m=await d.mutateAsync({body:l,target_lang:h.language??"en",message_id:e});p.setQueriesData({queryKey:["chat",t]},y=>y.map(b=>b.id===e?{...b,body:`${o}:${m}`,original_body:b.body}:b))},children:[u("span",{children:[r.pretty_name," ",a?"sent a gift for ":"gifted"," ",f(Number(o))]}),l.trim()!==""&&u("span",{children:[": ",l]})]})})}
324function Mx({id:e,sender:t,receiver:r,created:i,onUsernameClick:s,username:a,anonymous_message:o}){var P;if(!a||!t.username)return null;const{user:l}=fe(),[c,d]=_.useState(!1),{deleteMessageMutation:p}=ko(a),{deleteMessageMutation:h}=Bs(),{moderatorsQuery:f,appointModeratorMutation:m,dismissModeratorMutation:y,bannedQuery:b,banMutation:S,unbanMutation:k}=id(a),{inviteUserMutation:w}=Mf(),T=f.data||[],R=(P=b().data)==null?void 0:P.some(I=>I.username===t.username),E=T.includes(t.username),z=Rf(a,T,l),{pathname:N}=qr(),C=N.includes("admin/support"),M=l&&l.username===a&&l.id!==t.id;return z?u(ke,{children:[n(xx,{opened:c,onClose:()=>d(!1),targetUser:t,isAnonymous:!!o}),u("div",{style:{display:"inline-flex",alignItems:"baseline",gap:"0.25rem"},children:[u(ce,{withArrow:!0,position:"bottom-start",shadow:"md",width:200,styles:{dropdown:{border:"1px solid var(--mantine-color-gray-3)",borderRadius:"var(--mantine-radius-md)",backgroundColor:"var(--mantine-color-body)"},item:{fontSize:"0.875rem",fontWeight:500,"&:hover":{backgroundColor:"var(--mantine-color-gray-1)"}}},children:[n(ce.Target,{children:n(pn,{size:22,color:ti(t,a,o)?t.color:"gray.6",src:t.avatar?`${xt}/files/${t.avatar}`:void 0,name:t.username.charAt(0).toUpperCase(),style:{cursor:"pointer"}})}),u(ce.Dropdown,{children:[n(ce.Item,{component:xe,to:`/${t.username}/profile`,leftSection:n(fn,{size:"1rem"}),children:"Go to Profile"}),n(ce.Divider,{}),n(ce.Item,{onClick:()=>{t.username&&(R?k.mutate({username:a,id:t.id}):S.mutate({username:a,id:t.id}))},leftSection:n(ro,{size:"1rem"}),disabled:S.isPending||k.isPending,children:R?"Unban User":"Ban User"}),M&&n(ce.Item,{onClick:()=>{t.username&&(E?y.mutate({username:a,id:t.id}):m.mutate({username:a,id:t.id}))},leftSection:n(zp,{size:"1rem"}),disabled:y.isPending||m.isPending,children:E?"Dismiss Moderator":"Appoint Moderator"}),M&&n(ce.Item,{onClick:()=>{w.mutate({username:a,user_id:t.id,is_anonymous:!!o})},leftSection:n(io,{size:"1rem"}),disabled:w.isPending,children:"Invite user"}),M&&n(ce.Item,{onClick:()=>d(!0),leftSection:n(Pc,{size:"1rem"}),children:"Share bundle"}),n(ce.Divider,{}),n(ce.Item,{onClick:()=>{if(!(!l||!confirm("Are you sure you want to delete this message?"))){if(C){h.mutate({id:e,username:a});return}p.mutate({id:e,user_id:r.id})}},color:"red",leftSection:n(Qy,{size:"1rem"}),children:"Delete Message"})]})]}),n(Se,{label:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric"}).format(new Date(i)),color:"dark",withArrow:!0,transitionProps:{transition:"pop",duration:300},children:n(Mt,{onClick:()=>s==null?void 0:s(t.username??""),children:n(v,{fw:500,c:_r.includes(t.id)?"#ffe066":ti(t,a,o)?t.color??"blue.3":"gray.6",children:t.pretty_name||t.username})})})]})]}):u("div",{style:{display:"inline-flex",alignItems:"baseline",gap:"0.25rem"},children:[n(pn,{component:xe,size:22,to:`/${t.username}/profile`,color:ti(t,a,o)?t.color:"gray.6",src:t.avatar?`${xt}/files/${t.avatar}`:void 0,name:t.username.charAt(0).toUpperCase()}),n(Se,{label:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric"}).format(new Date(i)),color:"dark",withArrow:!0,transitionProps:{transition:"pop",duration:300},children:n(Mt,{onClick:()=>s==null?void 0:s(t.username??""),children:n(v,{fw:500,c:_r.includes(t.id)?"#ffe066":ti(t,a,o)?t.color??"blue.3":"gray.6",children:t.pretty_name||t.username})})})]})}function Rf(e,t,r){return r&&he(r,Ce)||r&&r.username&&(t==null?void 0:t.includes(r.username))||r&&r.username===e}const Ax=new RegExp("^[0-9a-f]+\\.(jpg|jpeg|gif|png)$");function nh(e){return Ax.test(e)}function ti(e,t,r=!1){return e.level&&e.level>=2||he(e,Ce)||e.username===t||r}function ad({id:e,sender:t,receiver:r,body:i,type:s,created:a,highlight:o,original_body:l,onUsernameClick:c,username:d,gift_id:p,anonymous_message:h,visibility:f,observer:m}){var E,z;if(!d)return null;const{user:y}=fe(),{moderatorsQuery:b}=id(d),{translateMutation:S}=ko(d),k=kx(i,o),w=at(),{i18n:T}=Fe(),{colorScheme:A}=vt(),R=_.useRef(null);return _.useEffect(()=>{if(!(!m||!R.current))return m.observe(R.current),()=>{R.current&&m.unobserve(R.current)}},[m]),n("div",{ref:R,"data-message-id":e,style:{position:"relative",..._r.includes(t.id)&&{background:`linear-gradient(-45deg,
325            rgba(238, 119, 82, 0.4), rgba(231, 60, 126, 0.4), rgba(35, 166, 213, 0.4), rgba(35, 213, 171, 0.4))`,backgroundSize:"400% 400%",animation:"gradient 15s ease infinite",padding:"0.6rem 0.8rem",borderRadius:"0.5rem",margin:"0.5rem 0"},...t.level===128&&{background:"radial-gradient(circle, rgba(0, 255, 85, 0.08), rgba(0, 255, 85, 0.02))",borderRadius:"0.5rem",padding:"0.1rem 0.2rem",display:"inline-block"}},children:u(v,{size:"sm",component:"div",style:{overflowWrap:"break-word",maxWidth:"20rem"},children:[s===0&&t.username&&za.has(t.username)&&n(ZT,{ratingData:za.get(t.username)}),s===0&&hC.includes(t.id)&&n(JT,{id:t.id}),s===0&&uC.includes(t.id)&&n(XT,{}),s===0&&pC.includes(t.id)&&n(ex,{}),s===0&&mC.includes(t.id)&&n(nx,{}),s===0&&fC.includes(t.id)&&n(tx,{}),s===0&&he(t,Ce)&&f===0&&n(ix,{}),s===0&&he(t,Ce)&&f===1&&n(rx,{}),s===0&&n(VT,{level:t.id===14?0:t.level}),s===0&&t.username&&((E=b.data)==null?void 0:E.includes(t.username))&&n(GT,{}),s===0&&t.username===r.username&&n(KT,{}),s===0&&h&&n(Se,{label:"User enabled anonymizer",color:"dark",withArrow:!0,transitionProps:{transition:"pop",duration:300},children:n("span",{style:{display:"inline-block",marginLeft:"0.25rem"},children:n(Yy,{size:16,style:{color:"#999"}})})}),s===0&&(Rf(d,b.data,y)?n(Mx,{id:e,sender:t,receiver:r,created:a,onUsern
325ameClick:c,username:d,anonymous_message:h,body:i,type:s,highlight:o}):u("div",{style:{display:"inline-flex",alignItems:"baseline",gap:"0.25rem"},children:[n(pn,{component:xe,size:22,style:{position:"relative",top:t.avatar?2:-5,paddingRight:"0.1rem"},to:`/${t.username}/profile`,color:ti(t,d,h)?t.color:"gray.6",src:`${xt}/files/${t.avatar}`,name:(z=t.username)==null?void 0:z.charAt(0).toUpperCase()}),n(Se,{label:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric"}).format(new Date(a)),color:"dark",withArrow:!0,transitionProps:{transition:"pop",duration:300},children:n(Mt,{onClick:()=>c&&c(t.username??""),style:{position:"relative"},children:n(v,{span:!0,fw:500,c:_r.includes(t.id)?"#ffe066":ti(t,d,h)?t.color??"blue.3":"gray.6",children:t.pretty_name?t.pretty_name:t.username})})})]})),s===1&&n(Px,{id:e,username:d,sender:t,body:i,original_body:l,isGift:p&&p>0||!1}),s===2&&u($,{gap:1,children:[n(ai,{size:"1.3rem",style:{color:"white",marginRight:"0.2rem",background:"rgba(0,0,0,0.25)",padding:"0.2rem",borderRadius:"0.25rem"}}),u(v,{size:"lg",c:"blue.3",children:[t.username," subscribed"]})]}),s===3&&u($,{gap:1,children:[n(Np,{size:"1.3rem",style:{color:"white",marginRight:"0.2rem",background:"rgba(0,0,0,0.25)",padding:"0.2rem",borderRadius:"0.25rem"}}),u(v,{size:"lg",c:"blue.3",children:[t.username," unsubscribed"]})]}),s===0&&!nh(i)&&u(v,{size:"md",style:{position:"relative"},span:!0,c:_r.includes(t.id)?"#fff":A==="dark"?"gray.3":"gray.7",children:[" ",k.map(({chunk:N,highlighted:C},M)=>C?u("span",{style:{color:_r.includes(t.id)||he(t,Ce)?"#fff":"#FFE066"},children:[N," "]},M):n("span",{onClick:async()=>{var I,L;if(gl(i)&&await confirm(`You clicked a link: ${(I=gl(i))==null?void 0:I[0]} - are you sure you want to open it?`)){window.open((L=gl(i))==null?void 0:L[0],"_blank");return}if(!he(y,Br))return;if(l){w.setQueriesData({queryKey:["chat",d]},U=>U.map(q=>q.id===e?{...q,body:l,original_body:""}:q));return}const P=await S.mutateAsync({body:i,target_lang:T.language??"en",message_id:e});w.setQueriesData({queryKey:["chat",d]},U=>U.map(q=>q.id===e?{...q,body:P,original_body:q.body}:q))},style:{color:_r.includes(t.id)?"#ffffff":he(t,Ce)?f===1?"var(--mantine-color-blue-4)":"#FFE066":"inherit",cursor:"pointer"},children:N},M))]}),s===0&&nh(i)&&u(v,{size:"md",style:{position:"relative"},span:!0,c:"gray.3",children:[": ",n(Ze,{href:`https://${Ss}/files/${i}`,target:"_blank",children:n(jr,{src:`https://${Ss}/files/${i}`,w:100})})]})]})})}async function Dx(){return await ae(`${O}/stream/me`)}const Ix=async()=>await _e(`${O}/stream`),$x=async e=>await Ft(`${O}/user/color`,{color:e});async function Rx(){return await ae(`${O}/telegram`)}async function zx(){return await et(`${O}/telegram`)}async function Nx(){return await _e(`${O}/anonymizer/start`)}async function Lx(){return await _e(`${O}/anonymizer/end`)}async function Ox(){return await ae(`${O}/statistics/total-own-topups`)}async function Fx(){return await ae(`${O}/anonymizer/is-allowed`)}async function Ux(){return await ae(`${O}/anonymizer`)}async function Bx(e){return await ae(`${O}/referral/${e}`)}async function qx({username:e,message:t,amount:r,gift_id:i}){return await _e(`${O}/${e}/donate`,{message:t,amount:r,gift_id:i})}async function jx(e){return await Ft(`${O}/user/password`,e)}async function Hx({image:e,username:t}){const r=new FormData;return r.append("file",e),await Qi(`${O}/user/${t}/avatar`,r)}async function Wx(e){return await _e(`${O}/user/push-notifications`,e)}async function Yx(e){return await ae(`${O}/agreement/${e}/check`)}async function Qx(e){await _e(`${O}/agreement`,{text:e})}async function Vx({image:e}){const t=new FormData;return t.append("file",e),await Qi(`${O}/document`,t)}async function Kx(){return await ae(`${O}/document`)}function wn(){const e=at(),t=J({mutationKey:["donate"],mutationFn:qx}),r=()=>oe({queryKey:["user.keys"],queryFn:Dx}),i=A=>oe({queryKey:["referrals",A],queryFn:()=>Bx(A),enabled:!!A}),s=J({mutationKey:["user.changePassword"],mutationFn:jx}),a=J({mutationKey:["user.createStream"],mutationFn:Ix,onSuccess(){r().refetch()}}),o=J({mutationKey:["user.color"],mutationFn:$x}),l=()=>oe({queryKey:["user.telegramToken"],queryFn:Rx}),c=J({mutationKey:["user.disconnectTelegram"],mutationFn:zx}),d=J({mutationKey:["user.uploadAvatar"],mutationFn:Hx}),p=J({mutationKey:["user.updatePushNotifications"],mutationFn:Wx}),h=J({mutationKey:["user.anonymizer_start"],mutationFn:Nx}),f=J({mutationKey:["user.anonymizer_end"],mutationFn:Lx}),m=()=>
325oe({queryKey:["user.topups"],queryFn:()=>Ox()}),y=()=>oe({queryKey:["user.anonymizer_session"],queryFn:()=>Ux()}),b=()=>oe({queryKey:["user.is_anonymizer_allowed"],queryFn:()=>Fx()}),S=A=>oe({queryKey:["user.check_agreement"],queryFn:()=>Yx(A),enabled:!!A}),k=()=>J({mutationFn:Qx,onSuccess:()=>{e.invalidateQueries({queryKey:["user.check_agreement"]})}}),w=J({mutationKey:["user.uploadDocument"],mutationFn:Vx,onSuccess:()=>{e.invalidateQueries({queryKey:["user.checkDocument"]})}}),T=oe({queryKey:["user.checkDocument"],queryFn:Kx});return{donateMutation:t,referralsQuery:i,changePasswordMutation:s,createStreamMutation:a,updateColorMutation:o,telegramTokenQuery:l,disconnectTelegramMutation:c,streamKeysQuery:r,uploadAvatarMutation:d,updatePushNotificationsMutation:p,startAnonymizerMutation:h,endAnonymizerMutation:f,getTotalTopUpsQuery:m,getCurrentAnonymizerSessionQuery:y,checkAnonymizerAllowedQuery:b,checkAgreementQuery:S,signAgreementMutation:k,uploadDocumentMutation:w,checkDocumentQuery:T}}async function Gx(){return await ae(`${O}/settings`)}async function Xx(e){return await qn(`${O}/settings`,e)}function Jx(){const e=at(),t=()=>oe({queryKey:["settings"],queryFn:Gx}),r=J({mutationKey:["update-settings"],mutationFn:Xx,onSuccess(i){e.setQueryData(["settings"],i)}});return{settingsQuery:t,updateSettingsMutation:r}}function Zx(){const{changePasswordMutation:e}=wn(),{colorScheme:t}=vt(),{t:r}=Fe(),i=Ge({initialValues:{current_password:"",new_password:""}});return n("form",{onSubmit:i.onSubmit(async s=>{e.mutate(s,{onSuccess(){Ee.show({position:"top-center",title:r("success"),message:r("password_changed"),color:"green",icon:n(Ke,{size:"1rem"})})}})}),children:u(j,{gap:"sm",children:[n(ds,{w:300,label:r("current_password"),leftSection:n(Ca,{size:"1rem"}),placeholder:r("current_password_placeholder"),...i.getInputProps("current_password")}),n(ds,{w:300,label:r("new_password"),leftSection:n(Ca,{size:"1rem"}),placeholder:r("new_password_placeholder"),...i.getInputProps("new_password")}),n(je,{}),n($,{children:n(V,{type:"submit",color:t==="dark"?"green.3":"green.7",variant:"light",leftSection:n(Gy,{size:"1rem"}),children:r("change_password")})})]})})}function ek(){const{createStreamMutation:e}=wn(),{colorScheme:t}=vt(),{t:r}=Fe();return n(j,{children:u($,{children:[n(V,{variant:"light",color:t==="dark"?"blue.3":"blue.7",disabled:e.isPending,loading:e.isPending,onClick:()=>e.mutate(),leftSection:n(Ky,{size:"1rem"}),children:r("regenerate_streaming_keys")}),n(V,{variant:"gradient",maw:500,to:"/stream-panel",component:xe,children:r("streaming_guide")})]})})}function tk(){const{t:e,i18n:t}=Fe(),{user:r}=fe(),{updateColorMutation:i}=wn(),[s,a]=_.useState(""),{colorScheme:o}=vt();return _.useEffect(()=>{a((r==null?void 0:r.color)??"")},[r]),u(j,{children:[u($,{align:"flex-start",children:[u(j,{gap:0,children:[n(v,{fw:500,children:e("pick_username_color")}),n(ry,{format:"hex",value:s,onChange:a,withPicker:!0,swatchesPerRow:8,size:"xs",swatches:[...gr.colors.red.slice(2,8),...gr.colors.pink.slice(2,8),...gr.colors.green.slice(2,8),...gr.colors.blue.slice(2,8),...gr.colors.cyan.slice(2,8),...gr.colors.violet.slice(2,8),...gr.colors.yellow.slice(2,8)]})]}),u(j,{gap:"xs",children:[n(v,{fw:500,children:e("username_color_preview")}),r&&n(j,{gap:0,children:[0,1,2].map(l=>n(ad,{id:l,receiver:{...r},sender:{...r,color:s},body:e("username_color_preview_message"),highlight:"",username:r.username,type:$f.Message,created:new Date},l))})]})]}),n(je,{}),u($,{gap:"lg",children:[n(V,{onClick:()=>s&&i.mutate(s),leftSection:n(Lp,{size:"1rem"}),color:o==="dark"?"green.3":"green.7",variant:"light",children:e("save_username_color")}),n(je,{variant:"dashed",orientation:"vertical",visibleFrom:"md"}),u($,{align:"center",children:[u($,{gap:10,children:[n(v,{fw:500,children:e("translator_target_lang")}),n(Se,{label:e("set_language_tip"),position:"top",children:n(Op,{size:"1rem",style:{cursor:"pointer",marginTop:"0.25rem"}})})]}),n(nk,{language:t.language??"en",onSelect:l=>{t.changeLanguage(l),t.options.fallbackLng=l==="uk"?"ru":"en"}})]}),n(je,{})]})]})}const yl=[{value:"en",label:"English",flagId:"GB"},{value:"ru",label:"Русский",flagId:"RU"},{value:"de",label:"Deutsch",flagId:"DE"},{value:"fr",label:"Français",flagId:"FR"},{value:"es",label:"Español",flagId:"ES"},{value:"it",label:"Italiano",flagId:"IT"},{value:"pl",label:"Polski",flagId:"PL"},{value:"uk",label:"Українська",flagId:"UA"}];function nk({onSelect:e,language:t}){const[r,i]=_.useState(!1),[s,a]=_.useState(yl.find(l=>l.value===t)??yl[0]),o=yl.map(l=>n(ce.Item,{leftSection:n(Fa,{svg:!0,countryCode:l.flagId}),onClick:()=>{a(l),e(l.value)},children:l.label},l.label));return u(ce,{onOpen:()=>i(!0),onClose:()=>i(!1),width:"target",withinPortal:!0,children:[n(ce.Target,{children:n(V,{variant:"default","data-expanded":r||void 0,children:u($,{gap:"xs",children:[n(F
325a,{svg:!0,countryCode:s.flagId}),n("span",{children:s.label}),n(eb,{size:"1rem"})]})})}),n(ce.Dropdown,{children:o})]})}function rk(e){const t="=".repeat((4-e.length%4)%4),r=(e+t).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(r);return Uint8Array.from([...i].map(s=>s.charCodeAt(0)))}function ik(){var k,w;const{t:e}=Fe(),{user:t,toggleBalance:r}=fe(),{telegramTokenQuery:i,disconnectTelegramMutation:s,updatePushNotificationsMutation:a}=wn(),{settingsQuery:o,updateSettingsMutation:l}=Jx(),c=i(),d=o(),[p,h]=_.useState(void 0),[f,m]=_.useState(!1),{colorScheme:y}=vt();async function b(){m(!0);try{const A=await(await navigator.serviceWorker.ready).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:rk(bC)});try{await a.mutateAsync(A),h(A)}catch(R){throw await A.unsubscribe(),h(void 0),R}}finally{m(!1)}}async function S(){if(!("serviceWorker"in navigator))return;await navigator.serviceWorker.register("/sw.js");const A=await(await navigator.serviceWorker.ready).pushManager.getSubscription();A&&h(A)}return _.useEffect(()=>{S()},[]),u(j,{gap:"lg",children:[n(Ie,{p:"md",radius:"sm",withBorder:!0,children:n(qt,{label:e("notify_new_streamer"),description:e("notify_new_streamer_description"),checked:((k=d.data)==null?void 0:k.notify_new_streamer)??!0,disabled:d.isLoading||l.isPending,onChange:T=>{l.mutate({notify_new_streamer:T.currentTarget.checked})}})}),n(je,{}),u(j,{gap:"sm",children:[u($,{gap:"xs",children:[n(Ml,{size:"1.2rem"}),n(v,{fw:600,children:"Telegram"})]}),n(v,{size:"sm",c:"dimmed",children:e("telegram_notifications_description")}),((t==null?void 0:t.telegram_id)??0)>0&&n(pe,{w:"fit-content",radius:"sm",color:"green.3",variant:"dot",children:e("status_connected")}),[0,-1].includes((t==null?void 0:t.telegram_id)??-1)&&n(pe,{w:"fit-content",radius:"sm",color:"red.3",variant:"dot",children:e("status_disconnected")}),u($,{children:[((t==null?void 0:t.telegram_id)??0)>0&&n(V,{leftSection:n(ht,{}),variant:"light",color:y==="dark"?"red.3":"red.7",loading:s.isPending,disabled:s.isPending,onClick:()=>{s.mutate(void 0,{onSuccess(){r()}})},children:e("disconnect_telegram")}),[0,-1].includes((t==null?void 0:t.telegram_id)??-1)&&n(V,{leftSection:n(Ml,{}),variant:"light",color:y==="dark"?"blue.3":"blue.7",component:xe,disabled:c.isPending,loading:c.isPending,to:`${dC}?start=${(w=c.data)==null?void 0:w.token}`,target:"_blank",children:e("connect_telegram")})]})]}),n(je,{}),u(j,{gap:"sm",children:[u($,{gap:"xs",children:[n($l,{size:"1.2rem"}),n(v,{fw:600,children:e("push_notifications")})]}),n(v,{size:"sm",c:"dimmed",children:e("push_notifications_description")}),p&&n(pe,{w:"fit-content",radius:"sm",color:"green.3",variant:"dot",children:e("status_connected")}),!p&&n(pe,{w:"fit-content",radius:"sm",color:"red.3",variant:"dot",children:e("status_disconnected")}),u($,{children:[p&&n(V,{leftSection:n(Xy,{}),variant:"light",color:y==="dark"?"red.3":"red.7",disabled:f,loading:f,onClick:async()=>{m(!0);try{await p.unsubscribe()&&h(void 0)}finally{m(!1)}},children:e("disable_push_notifications")}),!p&&n(V,{leftSection:n($l,{}),variant:"light",color:y==="dark"?"blue.3":"blue.7",disabled:f,loading:f,onClick:b,children:e("allow_push_notifications")})]})]})]})}function sk(){const{user:e}=fe(),{t}=Fe(),[r,i]=_.useState(null),{checkAnonymizerAllowedQuery:s,startAnonymizerMutation:a,endAnonymizerMutation:o,getCurrentAnonymizerSessionQuery:l}=wn(),c=s(),{data:d,isLoading:p,error:h}=c,f=l(),{data:m,isLoading:y}=f,{mutateAsync:b,isPending:S}=a,{mutateAsync:k,isPending:w}=o,T=S||w;_.useEffect(()=>{m&&"fake_username"in m?i(m):i(null)},[m]);const A=async()=>{if(e!=null&&e.username)try{const E=await b();i(E)}catch(E){console.error("Failed to start session:",E)}},R=async()=>{if(e!=null&&e.username)try{await k(),i(null)}catch(E){console.error("Failed to end session:",E)}};return p||y?n(v,{children:t("loading")}):h?n(v,{c:"red",children:t("failed_to_load_account_data")}):d?u(ke,{children:[u(j,{mb:"md",gap:"xs",children:[n(v,{children:t("anonymizer_description")}),n(v,{size:"sm",c:"dimmed",children:t("anonymizer_note")}),u(pe,{radius:"sm",color:r?"blue":"gray",variant:"light",mt:"xs",children:[t("status"),":"," ",t(r?"active":"not_active")]})]}),n(je,{my:"xs"}),r?u(Ie,{p:"md",bg:"gray.0",c:"gray.8",radius:"sm",mb:"md",children:[u($,{mb:"sm",children:[n(fn,{size:16}),n(v,{size:"sm",fw:500,children:t("anonymous_identity")})]}),u(v,{size:"sm",children:[u("strong",{children:[t("username"),":"]})," ",r.fake_username]}),u(v,{size:"sm",mt:"xs",children:[u("strong",{children:[t("pretty_username"),":"]})," ",r.fake_pretty_name]}),n($,{justify:"center",mt:"md",children:n(V,{size:"sm",color:"red",variant:"filled",leftSection:n(Jy,{size:16}),onClick:R,disabled:T,children:t("end_session")})})]}):n(V,{leftSection:n(Zy,{size:16}),variant:"light",color:"blue",onClick:A,loading:T,disabled:T,children:t("start_anonymous_session")})]}):n(Ie,{p:"md",radius:"sm",withBorder:!0,children:n(v,{c:"dimmed",children:t("anonymizer_unavailable")})})}const ak=()=>{Cc("Settings");const{t:e}=Fe(),t=gt(),{tabId:r}=Bn(),{colorScheme:i}=vt(),s=Ha(`(max-width: ${Wa(800)})`);return n(ke,{children:u(ue,{withBorder:!0,children:[n(Ye,{order:4,mb:"xs",children:e("settings")}),u(re,{value:r,onChange:a=>t(`/settings/${a}`),variant:"pills",color:i==="dark"?"dark.4":"dark.8",children:[u(re.List,{children:[n(re.Tab,{style:{width:s?"100%":"inherit",justifyContent:"start"},leftSection:n(no,{size:"1rem"}),value:"stream",children:e("stream")}),n(re.Tab,{style:{width:s?"100%":"inherit",justifyContent:"start"},leftSection:n(Lp,{size:"1rem"}),value:"customization",children:e("customization")}),n(re.Tab,{style:{width:s?"100%":"inherit",justifyContent:"start"},leftSection:n(xa,{size:"1rem"}),value:"change-password",children:e("security")}),n(re.Tab,{style:{width:s?"100%":"inherit",justifyContent:"start"},leftSection:n($l,{size:"1rem"}),value:"notifications",children:e("notifications")}),n(re.Tab,{style:{width:s?"100%":"inherit",justifyContent:"start"},leftSection:n(Vy,{size:"1rem"}),value:"anonymizer",children:e("anonymizer")})]}),n(re.Panel,{value:"stream",mt:"sm",children:n(ek,{})}),n(re.Panel,{value:"change-password",mt:"sm",children:n(Zx,{})}),n(re.Panel,{value:"customization",mt:"sm",children:n(tk,{})}),n(re.Panel,{value:"notifications",mt:"sm",children:n(ik,{})}),n(re.Panel,{value:"anonymizer",mt:"sm",children:n(sk,{})})]})]})})},rh=x("consent_agreement_full_text");function ok({opened:e,onClose:t}){const[r,i]=_.useState(!1),{signAgreementMutation:s}=wn(),a=s(),o=()=>{r&&(a.mutate(rh),t())};
325return n(Oe,{opened:e,onClose:t,size:"xl",radius:"md",centered:!0,title:u($,{gap:"sm",children:[n(Ec,{size:24,stroke:1.5}),n(Ye,{order:3,fw:600,c:"white",children:x("consent_agreement_title")})]}),styles:{content:{backgroundColor:"var(--mantine-color-dark-7)",color:"var(--mantine-color-white)"},header:{backgroundColor:"var(--mantine-color-dark-7)",borderBottom:"1px solid var(--mantine-color-dark-5)",paddingTop:"1.5rem",paddingBottom:"1rem"},body:{padding:0}},children:u(j,{gap:0,children:[n(G,{style:{height:"400px",position:"relative"},children:n(Lt,{style:{position:"absolute",inset:0},type:"auto",scrollbarSize:8,children:u(Ie,{p:"xl",radius:0,style:{backgroundColor:"var(--mantine-color-dark-6)",lineHeight:1.7,fontSize:"0.9375rem",color:"var(--mantine-color-gray-2)"},children:[u($,{mb:"lg",c:"blue.4",gap:"xs",children:[n(so,{size:20,stroke:1.5}),n(v,{size:"sm",fw:600,tt:"uppercase",style:{letterSpacing:"0.5px"},children:x("consent_agreement_full_title")})]}),n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:rh},style:{color:"var(--mantine-color-gray-2)"}})})]})})}),n(Ie,{p:"xl",radius:0,style:{borderTop:"1px solid var(--mantine-color-dark-5)",backgroundColor:"var(--mantine-color-dark-7)"},children:u(j,{gap:"lg",children:[n(fp,{size:"md",label:n(v,{size:"sm",c:"gray.1",fw:500,children:x("consent_agreement_accept")}),checked:r,onChange:l=>i(l.currentTarget.checked),styles:{input:{cursor:"pointer",borderColor:"var(--mantine-color-dark-4)",backgroundColor:"var(--mantine-color-dark-5)","&:checked":{backgroundColor:"var(--mantine-color-blue-6)",borderColor:"var(--mantine-color-blue-6)"}},label:{cursor:"pointer",paddingLeft:"0.5rem"}}}),u($,{justify:"flex-end",gap:"md",children:[n(V,{variant:"subtle",color:"gray",onClick:t,radius:"md",size:"md",children:x("cancel_agreement")}),n(V,{variant:"filled",color:"blue",radius:"md",size:"md",onClick:o,loading:a.isPending,disabled:!r,children:x("agree_and_continue")})]})]})})]})})}function od({keys:e,showName:t,hasCombinedUrl:r}){const i=Ss.replace(/^ru\./,""),s=r?`rtmp://${i}/publish?publishsign=${e.signature}/${e.key}`:`rtmp://${i}/publish?publishsign=${e.signature}`;return u(ke,{children:[t&&n(Te,{label:"Stream Name",leftSection:n(fs,{size:"1rem"}),px:"lg",py:5,readOnly:!0,value:"dd"}),n(Te,{label:"Stream URL",px:"lg",py:5,leftSection:n(sb,{size:"1rem"}),value:s,readOnly:!0,rightSection:n(us,{value:s,children:({copied:a,copy:o})=>n(Se,{label:a?"Copied URL":"Copy URL",withArrow:!0,position:"right",children:n(Ne,{color:a?"green":"gray",variant:"subtle",onClick:o,children:a?n(Ke,{style:{width:we(16)}}):n(Ta,{style:{width:we(16)}})})})})}),!r&&n(Te,{label:"Stream Key",px:"lg",py:5,leftSection:n(xa,{size:"1rem"}),value:e.key,rightSection:n(us,{value:e.key,children:({copied:a,copy:o})=>n(Se,{label:a?"Copied key":"Copy key",withArrow:!0,position:"right",children:n(Ne,{color:a?"green":"gray",variant:"subtle",onClick:o,children:a?n(Ke,{style:{width:we(16)}}):n(Ta,{style:{width:we(16)}})})})}),readOnly:!0})]})}function lk({keys:e}){return u(j,{gap:0,children:[u(v,{mb:"sm",children:[x("iphone_recomendation"),n(Ze,{href:"https://apps.apple.com/us/app/streamcast-pro/id6443880300",target:"_blank",children:x("here")}),n("br",{}),x("iphone_after_opening_app")]}),u(dn,{withPadding:!0,type:"unordered",children:[u(dn.Item,{children:[x("iphone_click_channel"),n("br",{})]}),u(dn.Item,{children:[x("iphone_press_option"),n("br",{})]}),n(od,{showName:!0,keys:e,hasCombinedUrl:!0}),n(dn.Item,{children:x("iphone_save_and_close")}),n(v,{children:x("iphone_success_messaage")})]})]})}function ck({keys:e}){return u(j,{gap:0,children:[u(v,{mb:"sm",children:[x("android_recomendation"),n(Ze,{href:"https://play.google.com/store/apps/details?id=com.visicommedia.manycam",target:"_blank",children:x("here")}),n("br",{}),x("android_our_app"),n(Ze,{href:`https://${Tt}/files/app-release.apk`,target:"_blank",children:x("here")}),n("br",{}),n("div",{dangerouslySetInnerHTML:{__html:x("android_after_opening_app")}})]}),n(od,{showName:!0,keys:e}),n("div",{dangerouslySetInnerHTML:{__html:x("android_after_opening_app_continue")}})]})}function dk(){const{user:e}=fe(),{streamKeysQuery:t,checkAgreementQuery:r,checkDocumentQuery:i}=wn(),s=t(),o=(e!=null&&e.id?r(e.id):{data:!1}).data??!1,[l,c]=_.useState(!1),d=_.useMemo(()=>{var h;return((h=i==null?void 0:i.data)==null?void 0:h.document_uploaded)===!0},[i]),p=gt();if(s.data)return d?o?u(Lt,{offsetScrollbars:!0,style:{height:"calc(100dvh - 6rem)"},children:[n(v,{mb:"xs",fw:500,children:x("streamer_guide_title")}),u(rn,{variant:"separated",mb:"md",children:[u(rn.Item,{value:"iphone",children:[n(rn.Control,{icon:n(tb,{size:"1rem"}),children:"iPhone/iPad"}),n(rn.Panel,{children:n(lk,{keys:s.data})})]}),u(rn.Item,{value:"android",children:[n(rn.Control,{icon:n(nb,{size:"1rem"}),children:"Android"}),n(rn.Panel,{children:n(ck,{keys:s.data})})]}),u(rn.Item,{value:"computer",children:[n(rn.Control,{icon:n(rb,{size:"1rem"}),children:"Computer"}),u(rn.Panel,{children:[u(v,{mb:"sm",children:[x("computer_recomendation")," ",n("br",{}),n(V,{leftSection:n(ib,{size:"1rem"}),variant:"default",my:"xs",component:xe,to:"https://obsproject.com/download",target:"_blank",rel:"noopener noreferrer",children:x("computer_click_to_download")}),n("br",{}),x("computer_after_opening_app")]}),u(dn,{withPadding:!0,type:"unordered",children:[n(dn.Item,{children:x("computer_settings")}),n(dn.Item,{children:x("computer_click_stream")}),n(dn.Item,{children:x("computrt_check_custom")}),n(dn.Item,{children:x("computer_enter_details")}),n(od,{keys:s.data}),n(dn.Item,{children:x("computer_click_ok")})]}
325),x("computer_success_message")]})]})]})]}):u(ke,{children:[n(ok,{opened:l,onClose:()=>c(!1)}),u(Le,{color:"yellow",icon:n(ms,{size:"1.25rem"}),mb:"md",onClick:()=>c(!0),style:{cursor:"pointer"},children:[x("consent_agreement_required")," ",n(v,{span:!0,c:"blue",inherit:!0,style:{textDecoration:"underline"},children:x("click_here_to_sign")})]})]}):u(Le,{color:"yellow",icon:n(ms,{size:"1.25rem"}),mb:"md",onClick:()=>{p("/verify-age")},style:{cursor:"pointer"},children:["Please verify your age before you can start streaming "," ",n(v,{span:!0,c:"blue",inherit:!0,style:{textDecoration:"underline"},children:x("click_here_to_sign")})]})}async function uk(e){return await _e(`${O}/${e}/subscription`)}async function hk(e){return await et(`${O}/${e}/subscription`)}async function pk(){return await ae(`${O}/subscription`)}function zf(e){const t=oe({queryKey:["subscription"],queryFn:pk,enabled:!!e}),r=J({mutationFn:e&&uk}),i=J({mutationFn:e&&hk});return{subscriptionQuery:t,subscribeMutation:r,unsubscribeMutation:i}}async function mk(){return await ae(`${O}/stream`)}const Nf=8;async function fk(e){return await ae(`${O}/offline?page=${e}&limit=${Nf}`)}async function gk(e){return await ae(`${O}/${e}/stream`)}async function yk(e){return await Ft(`${O}/user/title`,e)}async function bk(e){return await qn(`${O}/stream`,e)}async function _k(e){return await _e(`${O}/${e}/stream`)}function vk(){const e=oe({queryKey:["streams"],queryFn:mk}),t=zc({queryKey:["offline"],queryFn:({pageParam:r})=>fk(r),initialPageParam:1,getNextPageParam:(r,i)=>r.length<Nf?void 0:i.length+1});return{onlineStreamsQuery:e,offlineStreamsQuery:t}}function OI(e){const t=oe({queryKey:["offline",e],queryFn:()=>gk(e)}),r=J({mutationKey:["stream.title"],mutationFn:yk}),i=J({mutationKey:["stream.upgrade"],mutationFn:bk}),s=J({mutationKey:["stream.purchase"],mutationFn:_k});return{streamQuery:t,updateTitleMutation:r,upgradeStreamMutation:i,purchaseAccessMutation:s}}function wk(){const{t:e}=Fe(),{user:t}=fe(),{subscriptionQuery:r,unsubscribeMutation:i}=zf(t),{onlineStreamsQuery:s}=vk(),a=_.useMemo(()=>{var o;return(o=r.data)==null?void 0:o.sort((l,c)=>new Date(c.subscribed_at).getTime()-new Date(l.subscribed_at).getTime())},[r.data]);return u(ue,{withBorder:!0,children:[n(Ye,{order:2,children:e("subscriptions")}),n(g.ScrollContainer,{minWidth:500,children:u(g,{withTableBorder:!0,withColumnBorders:!0,mt:"md",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:e("subscription_username")}),n(g.Th,{children:e("subscription_datetime")}),n(g.Th,{})]})}),n(g.Tbody,{children:a==null?void 0:a.map((o,l)=>{var c;return u(g.Tr,{children:[n(g.Td,{children:u($,{gap:"md",align:"center",ml:10,children:[n(_a,{offset:1,color:(c=s.data)!=null&&c.find(d=>d.username===o.username)?"green.3":"red.3"}),n(Ze,{component:xe,to:`/${o.username}`,children:o.username})]})}),n(g.Td,{children:st.format(new Date(o.subscribed_at))}),n(g.Td,{children:n(V,{variant:"subtle",color:"blue.3",leftSection:n(Np,{size:"1rem"}),onClick:async()=>{confirm(`Are you sure you want to unsubscribe to ${o.username}?`)&&i.mutate(o.username,{onSuccess:()=>{r.refetch()}})},children:"Unsubscribe"})})]},l)})})]})})]})}const ih=`
326            <h5>Terms of Use</h5>
327            <b>Effective Date</b>: November 20, 2025
328            <p><b>Last Updated</b>: November 16, 2025</p>
329            <h4>1. Introduction</h4>
330            <p>These Terms of Use (“<b>Terms</b>”) constitute a legally binding agreement between
331            <b>${Ia}</b> (“<b>Company</b>”)
332            and the individual or entity accessing or using the ${Jc} streaming platform, including all related websites,
333            applications, and services (collectively, the “<b>Service</b>”).</p>
334            <p>By accessing or using the Service, the user (“<b>User</b>”)
335            agrees to comply with and be bound by these Terms and the Company’s Privacy Policy.
336            Users who do not agree to these Terms are strictly prohibited from accessing or using the Service.</p>
337            <h4>2. Eligibility</h4>
338            <p>Access to and use of the Service is strictly limited to individuals who <b>are 18 years of age or older</b>.
339            By accessing or using the Service, the User represents and warrants that:</p>
340            <ol>
341              <li>The User is at least 18 years old;</li>
342              <li>The User has full legal capacity to enter into a binding agreement;</li>
343              <li>The User’s use of the Service is lawful under all applicable laws and regulations.</li>
344            </ol>
345            <p>
346              Any misrepresentation regarding age or eligibility shall constitute a material breach of these Terms.
347            </p>
348            <h4>3. Prohibited Content and Moderation</h4>
349            <p>The Service may allow Users to upload, transmit, or stream content (“<b>User Content</b>”).
350            The following categories of content are strictly prohibited:</p>
351            <ul>
352              <li>Illegal, harmful, threatening, harassing, defamatory, or privacy-invading content;</li>
353              <li>Hate speech, discriminatory material, or advocacy of violence, political discussions;</li>
354              <li>Pornography, or any material involving minors;</li>
355              <li>Content infringing upon copyrights, trademarks, or other intellectual property rights;</li>
356              <li>Malware, viruses, harmful code, or any content designed to damage or disrupt systems;</li>
357              <li>Content that violates any applicable local, national, or international law.</li>
358            </ul>
359            <p>The Company retains absolute discretion to review, monitor, remove, disable access to, or
360            restrict any User Content that violates these Terms, poses risks to the Service, or is otherwise deemed inappropriate.
361            The Company may suspend or terminate accounts without prior notice for violations of this section.</p>
362
363            <h4>4. Storage and Deletion of Content</h4>
364            <p>The User acknowledges and agrees to the following:</p>
365            <ul>
366              <li>The Company may store User Content but makes no guarantees regarding duration, availability, or
367              integrity of storage;</li>
368              <li>The Company may delete, remove, or restrict access to User Content at any time and for any reason,
369              including policy violations, technical limitations, or account termination;</li>
370              <li>The User is solely responsible for maintaining independent backups of all User Content;</li>
371              <li>Upon termination or closure of the User’s account, the Company may permanently delete all associated
372              User Content without obligation to recover or restore such content.</li>
373            </ul>
374            <p>The Company assumes no liability for the loss, deletion, or inability to retrieve any User Content.</p>
375
376            <h4>5. Use Restrictions and User Representations</h4>
377            <p>Users are expressly prohibited from engaging in any of the following activities:</p>
378            <ul>
379              <li>Using the Service for any unlawful purpose or in violation of any applicable law;</li>
380              <li>Attempting to access accounts, data, or systems without authorization;</li>
381              <li>Employing automated systems, bots, scrapers, or similar tools to interact with the Service;</li>
382              <li>Copying, distributing, modifying, reverse engineering, or creating derivative works based on the Service
383              without prior written authorization from the Company;</li>
384              <li>
384Circumventing, disrupting, or interfering with security, access controls, or technical protections;</li>
385              <li>Engaging in conduct that may damage, disable, or adversely affect the Service or its infrastructure.</li>
386            </ul>
387
388            <p>By submitting or uploading User Content, the User represents and warrants that:</p>
389            <ul>
390              <li>The User possesses all rights, licenses, consents, and permissions necessary to upload and distribute
391              the User Content;</li>
392              <li>The User Content does not infringe upon any third-party intellectual property or other rights;</li>
393              <li>The User Content complies fully with these Terms and with all applicable laws.</li>
394            </ul>
395
396            <p>Any breach of this section shall constitute grounds for immediate suspension or termination of
397            access to the Service.</p>
398            <h4>6. Platform Currency </h4>
399            <p>The Platform offers a virtual currency system denominated in Dollars ("Platform Currency") for use exclusively within the Platform ecosystem. Platform Currency has no cash value and is non-refundable except as specified in the Platform's Refund Policy or as required by applicable law. Users may purchase Platform Currency through approved payment methods to support Streamers through tips and gifts, and create dares for Streamers to complete during broadcasts. All transactions involving Platform Currency are subject to a thirty-five percent (35%) platform commission, meaning that when a User spends Platform Currency, 65% is allocated to the receiving Streamer and 35% is retained by the Platform as a service fee. Platform Currency cannot be transferred between Users except through authorized Platform features, may not be exchanged for cash or goods outside the Platform, and any unused balance is forfeited upon account closure or termination. Streamers may convert their earned Platform Currency to real currency according to official currency exchange rates, minus applicable payment agent fees, in accordance with the Platform's payout policies, subject to applicable verification requirements, minimum thresholds, and tax obligations. The Platform reserves the right to modify commission rates, pricing, and the availability of Platform Currency features with reasonable notice to Users. Users engaging in fraudulent activity, unauthorized transfers, or use of Platform Currency for prohibited purposes may have their access suspended or terminated and forfeit any remaining balance.</p>
400            <h4>7. Content Pre-Moderation</h4>
401            <p>All content intended for public availability on the Platform is subject to pre-moderation review before
402            becoming publicly accessible. This pre-moderation process is implemented to ensure that all content complies with applicable laws, regulations,
403            and the requirements of our payment gateway providers and financial partners. Content submitted by Users, including videos and images on their profile, will be reviewed by
404            the Platform's moderation team before became publicly available.
405            The Platform reserves the right to reject, delay, or request modifications to any content that does not meet our compliance standards,
406            legal requirements, or community guidelines. Users acknowledge and agree that content approval is at the sole discretion of the Platform
407            and that approval times may vary based on content volume and complexity. The Platform guarantee content review and publication within 1 (one) working day.
408            Users further acknowledge that pre-moderation is conducted to protect the Platform, its Users,
409            and its business partners, and that rejection of content does not entitle Users to refunds, compensation, or other remedies unless
410            explicitly stated in other sections of these Terms. The Platform reserves the right to modify its pre-moderation procedures, standards,
411            and implementation methods at any time without prior notice. Repeated submissions of content that violates Platform standards may result
412            in account restrictions, suspension, or termination as outlined in Section 5.</p>
413            <h4>8. Governing Law</h4>
414            <p>These Terms shall be governed by, and construed in accordance with, the laws of the
415            <b>Republic of Cyprus</b>, without regard to conflict-of-law principles.
416            All disputes arising out of or related to these Terms or the User’s use of the Service shall be
417            subject to the exclusive jurisdiction of the courts of <b>Cyprus</b>, and the User hereby
418            irrevocably consents to such jurisdiction and venue.</p>
419            <h>9. Contact Information</h4>
420            <p style="margin-bottom: 0;">Any notices, inquiries, or communications regarding these Terms shall be directed to:
421            <br />
422            <br />
423            <b>${Ia}</b>
424            <div style="display:flex; align-items: center;">
425            <b>Email:</b><img height="25px" src="legal.email.jpg" />
426            </div>
427            </p>
428          `,sh={en:ih,ru:ih};function Sk(){const{i18n:e}=Fe(),t=sh[e.language]??sh.en;return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:t}})})})})})}async function Ck(){return await ae(`${O}/rtmp`)}async function Tk(e){return await et(`${O}/stream/${e}`)}async function xk(e){return await ae(`${O}/user/${e}`)}async function kk(){return await ae(`${O}/user`)}const Ek=async e=>await qn(`${O}/user/${e.id}`,e);async function Pk(e){return await Ft(`${O}/document/${e}`)}async function Mk(e){return await et(`${O}/document/${e}`)}async function Ak(){return await ae(`${O}/dare`)}async function Dk(e){return await ae(`${O}/${e}/ws_connected`)}async function Ik(){return await ae(`${O}/statistics/contribs`)}async function $k(e,t,r){return await ae(`${O}/statistics/donations?cursor=${e}&limit=${t}&query=${r}`)}async function Rk(e,t,r){return await ae(`${O}/document/pending?cursor=${e}&limit=${t}&query=${r}`)}async function zk(e){return await ae(`${O}/speech_recognition/${e}`)}async function Nk(e){return await _e(`${O}/speech_recognition/${e}`,void 0,{suppressErrorNotification:!0}
428)}async function Lk(e){return await et(`${O}/speech_recognition/${e}`,void 0,{suppressErrorNotification:!0})}async function Ok(){return await ae(`${O}/giveaway`)}async function Fk(e){return await qn(`${O}/giveaway`,e)}async function Uk(e,t={}){const r=new URLSearchParams;return r.append("limit","20"),r.append("page",e.toString()),Object.entries(t).forEach(([i,s])=>{s!=null&&s!==""&&r.append(i,s.toString())}),await ae(`${O}/admin/chat_history?${r.toString()}`)}function en(){const e=at(),t=()=>oe({queryKey:["dares"],queryFn:Ak}),r=()=>oe({queryKey:["contribs"],queryFn:Ik}),i=(w,T,A)=>oe({queryKey:["admin.donations",w,T,A],queryFn:()=>$k(w,T,A),placeholderData:Fd}),s=(w,T,A)=>oe({queryKey:["admin.pendingDocuments",w,T,A],queryFn:()=>Rk(w,T,A),placeholderData:Fd}),a=w=>oe({queryKey:["viewers",w],queryFn:()=>Dk(w),enabled:!!w}),o=()=>oe({queryKey:["admin.streams"],queryFn:Ck}),l=J({mutationKey:["stream.kick"],mutationFn:Tk}),c=oe({queryKey:["users"],queryFn:kk}),d=w=>oe({queryKey:["user",w],queryFn:()=>xk(w),enabled:!!w}),p=J({mutationKey:["user.update"],mutationFn:Ek}),h=J({mutationKey:["admin.approveDocument"],mutationFn:Pk,onSuccess:()=>{e.invalidateQueries({queryKey:["admin.pendingDocuments"]})}}),f=J({mutationKey:["admin.rejectDocument"],mutationFn:Mk,onSuccess:()=>{e.invalidateQueries({queryKey:["admin.pendingDocuments"]})}}),m=(w,T=!0)=>oe({queryKey:["speech_recognition",w],queryFn:()=>zk(w),enabled:!!w&&T,staleTime:2e3,placeholderData:!1}),y=J({mutationFn:Nk,onSuccess:(w,T)=>{e.invalidateQueries({queryKey:["speech_recognition",T],exact:!0}),Ee.show({position:"top-center",title:"Success",message:`Enabled subtitles for user ${T}`,color:"green"})},onError:(w,T)=>{Ee.show({position:"top-center",title:"Error",message:`Failed to enable subtitles for user ${T}: ${w.message}`,color:"red"})}}),b=J({mutationFn:Lk,onSuccess:(w,T)=>{e.invalidateQueries({queryKey:["speech_recognition",T],exact:!0}),Ee.show({position:"top-center",title:"Success",message:`Disabled subtitles for user ${T}`,color:"green"})},onError:(w,T)=>{Ee.show({position:"top-center",title:"Error",message:`Failed to disable subtitles for user ${T}: ${w.message}`,color:"red"})}}),S=()=>oe({queryKey:["admin.getBotSettings"],queryFn:Ok}),k=J({mutationKey:["admin.updateBotSettings"],mutationFn:Fk,onSuccess:()=>{e.invalidateQueries({queryKey:["admin.getBotSettings"]})}});return{streamsQuery:o,kickStreamMutation:l,usersQuery:c,userQuery:d,updateUserMutation:p,daresQuery:t,viewersQuery:a,contribQuery:r,donationsQuery:i,pendingDocumentsQuery:s,approveDocumentMutation:h,rejectDocumentMutation:f,speechRecognitionStatusQuery:m,enableSpeechRecognitionMutation:y,disableSpeechRecognitionMutation:b,getBotSettingsQuery:S,updateBotSettingsMutation:k}}function Bk(e,t={},r){return oe({queryKey:["chat_history",e,t],queryFn:()=>Uk(e,t),placeholderData:i=>i,staleTime:1e3*60,gcTime:1e3*5*60,enabled:he(r,Ce)})}function qk(){var c,d,p,h;const{id:e}=Bn();if(!e)return;const{userQuery:t,usersQuery:r,updateUserMutation:i}=en(),s=t(parseInt(e)),a=_.useRef(null),o=Ge({mode:"uncontrolled",transformValues(f){return{...f,balance:0,earnings:0,permission_mask:(f.can_chat?Br:0)+(f.can_dare?Vu:0)+(f.can_stream?Ku:0)+(f.is_admin?Ce:0)+(f.is_muted?ei:0)+(f.is_avatar_blocked?Gu:0)}}});_.useEffect(()=>{if(s.data){const f=s.data.first_level_ref_percent??0;a.current=f,o.setValues({...s.data,can_chat:he(s.data,Br),can_dare:he(s.data,Vu),can_stream
428:he(s.data,Ku),is_admin:he(s.data,Ce),is_muted:he(s.data,ei),is_avatar_blocked:he(s.data,Gu),first_level_ref_percent:f,title:s.data.title??""})}},[s.data]);const l=Ge({initialValues:{top_up_amount:0,amount_balance:0,amount_earnings:0}});return u(Be,{size:"sm",py:"xl",children:[u(iy,{mb:"xl",children:[n(Ze,{component:xe,to:"/admin/users",children:"Users"}),e]}),u(j,{gap:"xl",children:[u("form",{onSubmit:o.onSubmit(async f=>{var m,y;i.mutate({id:f.id,username:f.username,permission_mask:f.permission_mask,password:f.password,referrer_id:((y=(m=r.data)==null?void 0:m.find(b=>b.username===f.referrer))==null?void 0:y.id)??0,title:f.title,first_level_ref_percent:f.first_level_ref_percent},{onSuccess(){Ee.show({position:"top-center",title:"Success",message:"Updated user information",color:"green",icon:n(Ke,{})}),s.refetch()}})}),children:[u("div",{children:[n(Ye,{order:2,mb:"md",children:"User Information"}),n(je,{mb:"lg"}),u(j,{gap:"md",children:[n(pn,{size:36,src:(c=s.data)!=null&&c.avatar?`${xt}/files/${s.data.avatar}`:void 0,name:(d=s.data)!=null&&d.username?(p=s.data)==null?void 0:p.username.charAt(0).toUpperCase():void 0}),n(Te,{label:"Username",description:"Remember to inform user if changed",leftSection:n(fs,{size:"1rem"}),autoComplete:"new-username",name:"new-username",...o.getInputProps("username")},o.key("username")),n(Te,{label:"Password",leftSection:n(Ca,{size:"1rem"}),description:"Remember to inform user if changed",autoComplete:"new-password",name:"new-password",...o.getInputProps("password")},o.key("password")),n(sy,{label:"Color",disabled:!0,...o.getInputProps("color")},o.key("color")),n(it,{label:"Referrer",searchable:!0,leftSection:n(Za,{size:"1rem"}),data:(h=r.data)==null?void 0:h.map(f=>f.username??""),...o.getInputProps("referrer")},o.key("referrer")),n(pt,{label:"Referral Percentage",description:`Percentage of earnings referred users generate (e.g., 5.5 = 5.5%). Current: ${a.current??0}%`,min:0,max:100,step:.1,decimalScale:1,fixedDecimalScale:!0,...o.getInputProps("first_level_ref_percent"),onChange:f=>{const m=typeof f=="string"?parseFloat(f):f;o.setFieldValue("first_level_ref_percent",isNaN(m)?0:m)}}),n(Te,{label:"Stream Title",description:"Stream title visible for all users",leftSection:n(fs,{size:"1rem"}),...o.getInputProps("title")},o.key("title"))]})]}),u("div",{children:[n(Ye,{order:2,mb:"md",children:"Permissions"}),n(je,{mb:"lg"}),n(Zr.Wrapper,{label:"User permissions",children:u(mn,{cols:2,mt:"md",children:[n(qt,{label:"Chat",color:"teal",description:"Send chat messages",checked:o.getValues().can_chat,onChange:f=>o.setFieldValue("can_chat",f.currentTarget.checked),thumbIcon:o.getValues().can_chat?n(Ke,{size:12,color:"var(--mantine-color-teal-6)",stroke:3}):n(ht,{size:12,color:"var(--mantine-color-red-6)",stroke:3})}),n(qt,{label:"Dare",color:"teal",description:"Create dare / contribute to dare",checked:o.getValues().can_dare,onChange:f=>o.setFieldValue("can_dare",f.currentTarget.checked),thumbIcon:o.getValues().can_dare?n(Ke,{size:12,color:"var(--mantine-color-teal-6)",stroke:3}):n(ht,{size:12,color:"var(--mantine-color-red-6)",stroke:3})}),n(qt,{label:"Stream",color:"teal",description:"Allow publishing streams",checked:o.getValues().can_stream,onChange:f=>o.setFieldValue("can_stream",f.currentTarget.checked),thumbIcon:o.getValues().can_stream?n(Ke,{size:12,color:"var(--mantine-color-teal-6)",stroke:3}):n(ht,{size:12,color:"var(--mantine-color-red-6)",stroke:3})}),n(qt,{label:o.getValues().is_muted?"Notifications disabled":"Notifications allowed",color:"teal",description:"Whether admins will receive notifications from support messages of this user in main support TG chat",checked:!o.getValues().is_muted,onChange:f=>o.setFieldValue("is_muted",!f.currentTarget.checked),thumbIcon:o.getValues().is_muted?n(ht,{size:12,color:"var(--mantine-color-red-6)",stroke:3}):n(Ke,{size:12,color:"var(--mantine-color-teal-6)",stroke:3})}
428),n(qt,{label:o.getValues().is_avatar_blocked?"Avatar/thumbnail disabled":"Avatar/thumbnail allowed",color:"teal",description:"Whether avatar/thumbnail will be visible",checked:!o.getValues().is_avatar_blocked,onChange:f=>o.setFieldValue("is_avatar_blocked",!f.currentTarget.checked),thumbIcon:o.getValues().is_avatar_blocked?n(ht,{size:12,color:"var(--mantine-color-red-6)",stroke:3}):n(Ke,{size:12,color:"var(--mantine-color-teal-6)",stroke:3})})]})}),n(V,{mt:"lg",w:"fit-content",variant:"light",color:"green.3",disabled:i.isPending,loading:i.isPending,leftSection:n(Fp,{size:"1rem"}),type:"submit",children:"Save changes"})]})]}),u("div",{children:[n(Ye,{order:2,mb:"md",children:"Balance & Earnings Update"}),n(je,{mb:"lg"}),n("form",{onSubmit:l.onSubmit(async f=>{const m=f.top_up_amount??0,y=f.amount_balance??0,b=f.amount_earnings??0;if(Math.abs(m)+Math.abs(y)+Math.abs(b)===0){Ee.show({position:"top-center",title:"No changes",message:"Enter a non-zero amount in one of the fields.",color:"yellow"});return}let k={id:Number(e)};m!==0?(k.balance=Math.round(m*100),k.is_topup=!0):(y!==0&&(k.balance=Math.round(y*100)),b!==0&&(k.earnings=Math.round(b*100)),k.is_topup=!1),i.mutate(k,{onSuccess(){const w=[];if(m!==0)w.push(`Topped up balance with ${se(Math.round(m*100))}`);else{if(y!==0){const T=y>0?"Added":"Subtracted";w.push(`${T} ${se(Math.abs(Math.round(y*100)))} ${T==="Added"?"to":"from"} balance`)}if(b!==0){const T=b>0?"Added":"Subtracted";w.push(`${T} ${se(Math.abs(Math.round(b*100)))} ${T==="Added"?"to":"from"} earnings`)}}Ee.show({position:"top-center",title:"Success",message:`${w.join(" and ")} for ${o.getValues().username}`,color:"green",icon:n(Ke,{})}),s.refetch(),l.setValues({top_up_amount:0,amount_balance:0,amount_earnings:0})}})}),children:u(j,{gap:"md",children:[n(pt,{label:"Top Up Amount (dollars)",prefix:"$",decimalScale:2,fixedDecimalScale:!0,thousandSeparator:" ",...l.getInputProps("top_up_amount"),onChange:f=>{const y=(typeof f=="string"?parseFloat(f):f)??0;l.setFieldValue("top_up_amount",y),y!==0&&(l.setFieldValue("amount_balance",0),l.setFieldValue("amount_earnings",0))},description:`Adds money to user's balance as new funds (e.g., deposit). Current balance: ${se(o.getValues().balance??0)}`}),n(je,{my:"sm"}),n(pt,{label:"Balance adjustment (dollars)",prefix:"$",decimalScale:2,fixedDecimalScale:!0,thousandSeparator:" ",...l.getInputProps("amount_balance"),onChange:f=>{const y=(typeof f=="string"?parseFloat(f):f)??0;l.setFieldValue("amount_balance",y),y!==0&&(l.setFieldValue("top_up_amount",0),l.setFieldValue("amount_earnings",0))},description:`Adjust balance without adding new money (e.g., bonus or penalty). Current: ${se(o.getValues().balance??0)}`}),n(pt,{label:"Earnings adjustment (dollars)",prefix:"$",decimalScale:2,fixedDecimalScale:!0,thousandSeparator:" ",...l.getInputProps("amount_earnings"),onChange:f=>{const y=(typeof f=="string"?parseFloat(f):f)??0;l.setFieldValue("amount_earnings",y),y!==0&&(l.setFieldValue("top_up_amount",0),l.setFieldValue("amount_balance",0))},description:`Adjust earnings without new money. Current: ${se(o.getValues().earnings??0)}`}),n(V,{w:"fit-content",variant:"light",color:"green.3",disabled:i.isPending,loading:i.isPending,leftSection:n(Ja,{size:"1rem"}),type:"submit",children:"Apply"})]})})]})]})]})}const bl=7;function jk({user:e}){return u(g.Tr,{children:[n(g.Td,{children:e.id}),n(g.Td,{children:e.username}),n(g.Td,{children:e.referrer}),!1,n(g.Td,{children:se(e.balance??0)}),n(g.Td,{children:se(e.earnings??0)}),n(g.Td,{children:n($,{children:n(Se,{label:"Change user information / Top up",children:n(Ne,{variant:"subtle",color:"blue.3",component:xe,to:`${e.id}`,children:n(Bp,{size:"1rem"})})})})})]},e.id)}function Hk(){var f,m;const{usersQuery:e}=en(),[t,r]=_.useState(1),{pathname:i}=qr(),[s,a]=bn(),[o,l]=_.useState(s.get("q")??""),[c,d]=_.useState("#");_.useEffect(()=>{i==="/admin/users"&&(r(1),a(()=>({q:o,sorted_by:c})))},[o,c]);const p=_.useMemo(()=>{var y;return(y=e.data)==null?void 0:y.filter(b=>{var S;return(S=b.username)==null?void 0:S.toLowerCase().includes(o.toLowerCase())}
428).sort((b,S)=>S[c]-b[c])},[e.data,o,c]),h=_.useMemo(()=>{const y=(t-1)*bl,b=t*bl;return p==null?void 0:p.slice(y,b)},[p,t]);return n(ke,{children:n(ue,{withBorder:!0,children:u(j,{children:[u(mn,{cols:{base:2},children:[u(Ie,{withBorder:!0,p:"xs",bg:"dark.5",children:[u($,{justify:"space-between",children:[n(v,{size:"xs",c:"dimmed",fw:"bold",children:"BALANCE"}),n(ab,{size:"1rem"})]}),n(v,{fw:"bold",size:"xl",children:se((f=e.data)==null?void 0:f.reduce((y,b)=>y+(b.balance??0),0))})]}),u(Ie,{withBorder:!0,p:"xs",bg:"dark.5",children:[u($,{justify:"space-between",children:[n(v,{size:"xs",c:"dimmed",fw:"bold",children:"EARNINGS"}),n(Up,{size:"1rem"})]}),n(v,{fw:"bold",size:"xl",children:se((m=e.data)==null?void 0:m.reduce((y,b)=>y+(b.earnings??0),0))})]})]}),n(Te,{leftSection:n(Ot,{size:"1rem"}),placeholder:"Search",onChange:y=>l(y.currentTarget.value),value:o}),u(v,{size:"xs",children:[n("b",{children:p==null?void 0:p.length})," records found"]}),n(g.ScrollContainer,{minWidth:500,children:u(g,{children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{style:{cursor:"pointer"},onClick:()=>d("#"),children:u($,{gap:5,align:"center",children:["#",c==="#"&&n(tl,{size:"0.875rem"})]})}),n(g.Th,{children:"Username"}),n(g.Th,{children:"Referrer"}),n(g.Th,{style:{cursor:"pointer"},onClick:()=>d("balance"),children:u($,{gap:5,align:"center",children:["Balance",c==="balance"&&n(tl,{size:"0.875rem"})]})}),n(g.Th,{style:{cursor:"pointer"},onClick:()=>d("earnings"),children:u($,{gap:5,align:"center",children:["Earnings",c==="earnings"&&n(tl,{size:"0.875rem"})]})}),n(g.Th,{children:"Actions"})]})}),n(g.Tbody,{children:h==null?void 0:h.map(y=>n(jk,{user:y},y.id))})]})}),n(yt,{color:"dark.4",value:t,onChange:y=>r(y),total:Math.ceil(((p==null?void 0:p.length)??0)/bl)})]})})})}function yc(e){return e.draft_id?`draft:${e.draft_id}`:`dare:${e.id}`}async function Wk({description:e,amount:t,goal_amount:r,time:i,username:s}){if(s)return await _e(`${O}/${s}/dare`,{description:e,amount:t,goal_amount:r,time:i})}async function Yk(e){return await et(`${O}/dare/${e}`)}async function Qk({id:e,username:t}){if(t)return await qn(`${O}/${t}/dare/${e}`)}async function Vk({id:e,username:t,vote:r}){if(t)return await qn(`${O}/${t}/dare/${e}/vote`,{vote:r})}async function Kk({id:e,username:t,amount:r}){if(!(!t||!r))return await qn(`${O}/${t}/dare/${e}/contribute`,{amount:r})}async function Gk({id:e,username:t}){if(t)return await et(`${O}/${t}/dare/${e}/contribute`)}async function Xk(e){return await ae(`${O}/${e}/dare`)}async function Jk(e){return await qn(`${O}/dare/${e}`)}async function Zk(e){return await ae(`${O}/${e}/dare/spy`)}async function eE({id:e,username:t,message:r}){if(t)return await _e(`${O}/${t}/dare/${e}/notify`,{message:r})}function qs(e){const t=at(),{user:r,isLoading:i}=fe(),s=(r==null?void 0:r.id)??0,a=()=>oe({queryKey:qu(s,e),queryFn:()=>Xk(e),enabled:!i&&!!e}),o=b=>oe({queryKey:ju(s,e),queryFn:()=>Zk(e),enabled:!i&&!!r&&!!e&&b}),l=J({mutationKey:["dare.create"],mutationFn:Wk,onMutate:()=>s,onSuccess:async(b,S,k)=>{if(!(b!=null&&b.draft_id)||!k||!Hu(t,k))return;const w=qu(k,S.username),T=ju(k,S.username);if(await Promise.all([w,T].map(R=>t.cancelQueries({queryKey:R,exact:!0}))),!Hu(t,k))return;const A=(R=[])=>[b,...R.filter(E=>yc(E)!==yc(b))];t.setQueryData(w,A),t.setQueriesData({queryKey:T,exact:!0},A);for(const R of[w,T])t.invalidateQueries({queryKey:R,exact:!0})}}),c=J({mutationKey:["dare.delete"],mutationFn:Yk}),d=J({mutationKey:["dare.accept"],mutationFn:Qk}),p=J({mutationKey:["dare.vote"],mutationFn:Vk}),h=J({mutationKey:["dare.accept"],mutationFn:Kk}),f=J({mutationKey:["dare.contribution.remove"],mutationFn:Gk}),m=J({mutationKey:["dare.override"],mutationFn:Jk}),y=J({mutationKey:["dare.notify"],mutationFn:eE});return{daresByUsernameQuery:a,createDareMutation:l,deleteDareMutation:c,acceptDareMutation:d,voteDareMutation:p,contributeMutation:h,removeContributionMutation:f,overrideDareMutation:m,useSpyDaresByUsername:o,notifyStreamerMutation:y}}const tE=({opened:e,id:t,username:r,close:i,toggleBalance:s})=>{const a=gt(),{user:o}=fe(),{contributeMutation:l}=qs(r),c=Ge({initialValues:{amount:1},validate:{amount:cs({min:.1,max:9999},"Amount must be between 0.1 and 9999$")},transformValues:d=>({amount:Math.round(d.amount*100)})});return n(Oe,{opened:e,onClose:i,title:"Contribute to a dare",centered:!0,children:u("form",{onSubmit:c.onSubmit(async d=>{r&&(d.amount>((o&&o.balance)??0)&&d.amount<=((o&&o.balance)??0)+((o&&o.earnings)??0)&&!confirm(`${se(d.amount)} ${x("spendingEarningsWarning")}`)||(l.mutate({id:t,username:r,amount:d.amount},{onSuccess(){s()},onError(p){p.message.includes("401")&&gp.openConfirmModal({title:"Please log in",children:n(v,{size:"sm",children:x("login_to_contribute_to_dare")}),labels:{confirm:"Log in",cancel:"Cancel"},onConfirm:()=>a(`/auth?return=/${r}`)})}}),c.reset(),i()))}),children:[n(pt,{label:"Amount",prefix:"$",mb:"md",step:.1,decimalScale:2,thous
428andSeparator:" ",...c.getInputProps("amount")}),n($,{justify:"right",mt:"md",children:n(V,{rightSection:n(to,{size:16}),size:"xs",variant:"gradient",loading:l.isPending,disabled:l.isPending,gradient:{from:"#ed6ea0",to:"#ec8c69",deg:35},type:"submit",children:"Contribute"})})]})})};function nE({opened:e,close:t,dare:r,username:i}){const{notifyStreamerMutation:s}=qs(i),a=Ge({initialValues:{message:""},validate:{message:l=>{const c=l.trim();return c?c.length>500?"Message must be 500 characters or less":null:"Message is required"}}}),o=()=>{a.reset(),t()};return n(Oe,{opened:e,onClose:o,title:"Clarify dare conditions",centered:!0,size:"md",children:n("form",{onSubmit:a.onSubmit(({message:l})=>{s.mutate({id:r.id,username:i,message:l.trim()},{onSuccess:o})}),children:u(j,{gap:"md",children:[u(Le,{color:"yellow",icon:n(Fi,{size:18}),title:"Use this only to clarify the dare",children:[n(v,{size:"sm",children:"All requests sent through this form are moderated. Spam, nonsense, or abuse of this feature is prohibited."}),n(v,{size:"sm",mt:"xs",children:"You may use it only to clarify the conditions of this existing dare. Do not use it to ask the streamer to do anything extra. For additional requests, send a donation or create a new dare."}),n(Ze,{component:xe,to:"/dare-rules",target:"_blank",size:"sm",children:x("dare_rules_link",{defaultValue:"Read how dares work"})})]}),u(j,{gap:4,children:[n(v,{size:"xs",c:"dimmed",children:"Dare"}),n(v,{size:"sm",children:r.description})]}),n(Li,{label:"Clarification",placeholder:"Ask a question about the existing dare conditions",autosize:!0,minRows:3,maxRows:6,maxLength:500,...a.getInputProps("message")}),u($,{justify:"flex-end",children:[n(V,{type:"button",variant:"default",onClick:o,children:"Cancel"}),n(V,{type:"submit",color:"yellow",loading:s.isPending,disabled:s.isPending,children:"Send clarification"})]})]})})})}const un=128,Lf=256,rE=2*60*1e3,iE=60*1e3;function ah(e){return e===ar||e===Ar||e===un||e===zn}const Of=e=>new Map([[ar,x("dare_state_created",{defaultValue:"Created"})],[Ar,x("dare_state_in_progress")],[un,x("dare_state_pre_voting",{defaultValue:"Pre-voting"})],[zn,x("dare_state_voting")],[ld,x("dare_state_completed")],[Eo,x("dare_state_failed")],[Po,x("dare_state_rejected")],[Lf,x("dare_state_deleted",{defaultValue:"Deleted"})],[Mo,"INVALID"]]).get(e)??"Unknown",Ff=e=>new Map([[ar,"gray"],[Ar,"yellow"],[un,"orange"],[zn,"yellow"],[ld,"green"],[Eo,"red"],[Po,"red"],[Lf,"gray"],[Mo,"blue"]]).get(e)??"gray";function sE(e,t){let r=0;if(e.state===un)r=rE;else if(e.state===zn)r=iE;else return null;return Math.max(0,Math.ceil((e.ts+r-t)/1e3))}function aE(e){const t=Math.floor(e/60),r=e%60;return`${t}:${r.toString().padStart(2,"0")}`}const oE=({dare:e,username:t,now:r,direction:i,purchaseNecessary:s})=>{if(!t)return null;const[a,o]=_t(!1),[l,c]=_t(!1),[d,p]=_t(!1),[h,f]=_.useState(()=>Date.now()),{user:m,toggleBalance:y}=fe(),{acceptDareMutation:b,voteDareMutation:S,deleteDareMutation:k,contributeMutation:w,removeContributionMutation:T}=qs(t),{translateMutation:A}=ko(t),{i18n:R}=Fe(),E=e.contributions.reduce((ge,be)=>ge+be.amount,0),z=e.goal_amount??0,N=z>0?Math.round(E/z*100):0,C=Math.min(N,100),M=m?e.contributions.findIndex(ge=>ge.user_id===m.id):-1,P=M>=0?e.contributions[M]:void 0,I=M>=0,L=M===0,U=!!(m&&e.user_id===m.id),q=!!(m&&he(m,Ce)),B=!s&&(e.state===ar||e.state===Ar),Y=!s&&I&&(e.state===Ar||e.state===un),Q=e.state===ar&&I&&!L,W=!!(m&&(U&&ah(e.state)||L&&e.state===ar||q&&ah(e.state))),F=e.state===un&&I&&(P==null?void 0:P.voted)===!1,H=e.state===un&&I&&(P==null?void 0:P.voted)===!0,K=e.state===zn&&(P==null?void 0:P.voted)===!1;_.useEffect(()=>{if(e.state!==un&&e.state!==zn)return;f(Date.now());const ge=window.setInterval(()=>{f(Date.now())},1e3);return()=>window.clearInterval(ge)},[e.state,e.ts]);const X=sE(e,h),Z=Ff(e.state),le=()=>{b.mutate({id:e.id,username:t})},de=ge=>{S.mutate({id:e.id,username:t,vote:ge},{onSuccess(){P&&(P.voted=!0,P.vote=ge)}})},ye=()=>{k.mutate(e.id,{onSuccess(){p.close()}})};return u(ke,{children:[n(tE,{opened:a,id:e.id,username:t,close:o.close,toggleBalance:y}),n(nE,{opened:l,close:c.close,dare:e,username:t}),n(Oe,{opened:d,onClose:p.close,title:x("dare_delete_confirm_title",{defaultValue:"Delete dare?"}),centered:!0,children:u(j,{gap:"md",children:[n(v,{size:"sm",children:x("dare_delete_confirm_body",{defaultValue:"You are going to delete this dare. All contributed funds will be returned to contributors. Are you sure?"})}),n(Ze,{component:xe,to:"/dare-rules",size:"sm",children:x("dare_rules_link",{defaultValue:"Read how dares work"})}),u($,{justify:"flex-end",children:[n(V,{variant:"default",onClick:p.close,disabled:k.isPending,children:x("dare_delete_confirm_cancel",{defaultValue:"Cancel"})}),n(V,{color:"red",leftSection:n(zr,{size:"1rem"}),loading:k.isPending,onClick:ye,children:x("dare_delete_confirm_confirm",{defaultValue:"Delete and refund"})})]})]})}),u(ue,{withBorder:!0,radius:"md",p:0,style:{width:"100%",maxWidth:i==="column"?"100%":"26rem",overflow:"hidden",borderColor:`var(--mantine-color-${Z}-7)`,background:"rgba(66, 66, 66, 0.14)"},children:[u(G,{p:"md",children:[u($,{justify:"space-between",align:"flex-start",wrap:"nowrap",children:[n(pe,{radius:"sm",variant:"light",color:Z,size:"sm",children:e.draft_id?x("argus_dare_submitted"):Of(e.state)}),X!==null&&u($,{gap:5,wrap:"nowrap",children:[n(ob,{size:16}),n(v,{size:"sm",fw:700,ff:"monospace",children:aE(X)})]})]}),n(v,{mt:"sm",size:"sm",fw:550,style:{cursor:he(m,Br)?"pointer":"default",overflowWrap:"anywhere"},onClick:async()=>
428{if(!he(m,Br))return;if(e.original_description){e.description=e.original_description,e.original_description="";return}const ge=await A.mutateAsync({body:e.description,target_lang:R.language??"en",message_id:e.id});e.original_description=e.description,e.description=ge},children:e.description}),e.id!==1337&&n(G,{mt:"md",children:z>0?u(ke,{children:[u($,{justify:"space-between",gap:"sm",mb:6,children:[u(G,{children:[n(v,{size:"xs",c:"dimmed",children:x("dare_raised")}),n(v,{size:"sm",fw:650,children:se(E)})]}),u(G,{style:{textAlign:"right"},children:[n(v,{size:"xs",c:"dimmed",children:x("dare_goal")}),n(v,{size:"sm",fw:650,children:se(z)})]})]}),u(G,{pos:"relative",children:[n(yp,{value:C,size:"lg",radius:"xl",color:C>=100?"green":"pink"}),u(v,{size:"xs",fw:700,style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",lineHeight:1,pointerEvents:"none",textShadow:"0 1px 2px rgba(0, 0, 0, 0.8)"},children:[N,"%"]})]})]}):n(v,{size:"md",c:"green",fw:600,children:se(E)})})]}),e.state===un&&u(G,{px:"md",py:"sm",style:{borderTop:"1px solid var(--mantine-color-orange-9)",borderBottom:"1px solid var(--mantine-color-orange-9)",background:"rgba(253, 126, 20, 0.08)"},children:[n(v,{size:"sm",fw:700,children:x("dare_pre_voting_title",{defaultValue:"Pre-voting review"})}),n(v,{size:"xs",c:"dimmed",mt:3,children:x("dare_pre_voting_hint",{defaultValue:"Contributors can confirm completion now. If everyone confirms YES, the dare completes immediately. A contributor's first clarification adds one minute to this review window and cancels their previous early approval."})})]}),e.state===zn&&n(G,{px:"md",py:"sm",style:{borderTop:"1px solid var(--mantine-color-yellow-9)",borderBottom:"1px solid var(--mantine-color-yellow-9)",background:"rgba(250, 176, 5, 0.07)"},children:n(v,{size:"xs",c:"dimmed",children:x("dare_voting_clarifiers_only",{defaultValue:"Only contributors who clarified the dare can manually vote here. Contributors who did not clarify are counted as YES automatically."})})}),n(G,{p:"md",children:u(j,{gap:"sm",children:[s&&e.id!==1337&&n(pe,{variant:"gradient",size:"md",children:"SPYING: Enter to join the fun!"}),e.state===ar&&U&&n(V,{fullWidth:!0,variant:"light",color:"yellow",leftSection:n(gs,{size:"1rem"}),loading:b.isPending,onClick:le,children:x("dare_accept")}),e.state===Ar&&U&&n(V,{fullWidth:!0,color:"green",leftSection:n(nl,{size:"1rem"}),loading:b.isPending,onClick:le,children:x("dare_complete")}),e.state===un&&U&&n(V,{fullWidth:!0,color:"orange",variant:"light",leftSection:n(gs,{size:"1rem"}),loading:b.isPending,onClick:le,children:x("dare_continue",{defaultValue:"Continue dare"})}),F&&n(V,{fullWidth:!0,color:"green",variant:"light",leftSection:n(nl,{size:"1rem"}),loading:S.isPending,onClick:()=>de(!0),children:x("dare_pre_vote_yes",{defaultValue:"Confirm dare completed"})}),H&&n(pe,{color:"green",variant:"light",size:"md",children:x("dare_pre_vote_confirmed",{defaultValue:"You confirmed completion"})}),K&&u($,{grow:!0,gap:"xs",children:[n(V,{color:"green",variant:"light",leftSection:n(nl,{size:"1rem"}),loading:S.isPending,onClick:()=>de(!0),children:x("dare_vote_completed")}),n(V,{color:"red",variant:"light",leftSection:n(ro,{size:"1rem"}),loading:S.isPending,onClick:()=>de(!1),children:x("dare_vote_not_completed")})]}),(B||Y||Q||W)&&n(je,{}),u($,{gap:"xs",wrap:"wrap",children:[B&&n(V,{variant:"default",size:"xs",leftSection:n(to,{size:"0.95rem"}),onClick:o.open,children:x("dare_contribute")}),B&&n(V,{variant:"default",size:"xs",loading:w.isPending,onClick:()=>{w.mutate({id:e.id,username:t,amount:100},{onSuccess(){y()}})},children:"+$1"}),Y&&n(V,{variant:"light",color:"yellow",size:"xs",leftSection:n(lb,{size:"0.95rem"}),onClick:c.open,children:x("dare_clarify",{defaultValue:"Clarify"})}),Q&&n(V,{variant:"light",color:"gray",size:"xs",leftSection:n(cb,{size:"0.95rem"}),loading:T.isPending,onClick:()=>{T.mutate({id:e.id,username:t},{onSuccess(){y()}})},children:x("dare_recover_money")}),W&&n(V,{variant:"light",color:"red",size:"xs",leftSection:n(zr,{size:"0.95rem"}),onClick:p.open,children:x("dare_delete")})]})]})})]})]})};async function lE(){return await ae(`${O}/dare/terms/acceptance`)}async function cE(){return await _e(`${O}/dare/terms/acceptance`)}function dE(e=!0){const t=at(),r=oe({queryKey:["dare-terms-acceptance"],queryFn:lE,enabled:e}),i=J({mutationKey:["accept-dare-terms"],mutationFn:cE,onSuccess(s){t.setQueryData(["dare-terms-acceptance"],s)}});return{dareTermsQuery:r,acceptDareTermsMutation:i}}const uE=({opened:e,username:t,close:r,toggleBalance:i})=>{var m;const s=gt(),{createDareMutation:a}=qs(t),{user:o}=fe(),{dareTermsQuery:l,acceptDareTermsMutation:c}=dE(e&&!!o),[d,p]=_.useState(!1),h=_.useRef(!1);_.useEffect(()=>{var y;if(!e){h.current=!1,p(!1);return}!o||h.current||l.isLoading||l.isError||(h.current=!0,((y=l.data)==null?void 0:y.accepted)===!1&&(p(!0),c.mutate()))},[e,o,l.isLoading,l.isError,(m=l.data)==null?void 0:m.accepted,c]);const f=Ge({initialValues:{description:"",time:null,amount:1,goal_amount:1},validate:{description:$r(x("dare_validation_description_required")),amount:cs({min:.1,max:9999},x("dare_validation_amount_range")),goal_amount:cs({min:.1,max:9999},x("dare_validation_goal_range"))},transformValues:y=>({description:y.description,time:y.time,amount:Math.round(y.amount*100),goal_amount:Math.round(y.goal_amount*100)})});return n(Oe,{opened:e,onClose:r,title:u(j,{gap:2,children:[n(v,{fw:600,size:"lg",children:x("create_a_dare")}),n(v,{size:"xs",c:"dimmed",fw:400,children:x("create_dare_explanation")})]}),centered:!0,radius:"md",size:"md",children:n("form",{onSubmit:f.onSubmit(async y=>{const b=(o==null?void 0:o.balance)??0,S=(o==null?void 0:o.earnings)??0;y.amount>b&&y.amount<=b+S&&!confirm(`${se(y.amount)} ${x("spendingEarningsWarning")}`)||a.mutate({...y,username:t},{onError(k){k.message.includes("401")&&gp.openConfirmModal({title:x("login_required"),
428children:n(v,{size:"sm",children:x("must_login_to_create_a_dare")}),labels:{confirm:x("log_in"),cancel:x("cancel")},onConfirm:()=>s(`/auth?return=/${t}`)})},onSuccess(){i(),f.reset(),r()}})}),children:u(j,{gap:"md",children:[d&&n(Le,{color:"yellow",variant:"light",title:x("dare_terms_update_notice_title"),children:n(v,{size:"sm",children:x("dare_terms_create_notice_body")})}),n(Li,{withAsterisk:!0,autosize:!0,minRows:3,maxRows:7,label:x("dare_description"),description:x("dare_description_explanation"),placeholder:x("dare_description_placeholder"),...f.getInputProps("description")}),n(je,{}),n(pt,{withAsterisk:!0,label:u($,{gap:5,children:[n(v,{component:"span",size:"sm",fw:500,children:x("dare_goal")}),n(Se,{label:x("dare_goal_tooltip"),multiline:!0,maw:280,withArrow:!0,children:n(Ne,{component:"span",variant:"subtle",size:"xs",color:"gray","aria-label":x("dare_goal_help"),children:n(Op,{size:15})})})]}),description:x("dare_goal_explanation"),prefix:"$",min:.1,max:9999,step:1,decimalScale:2,fixedDecimalScale:!0,thousandSeparator:" ",leftSection:n(db,{size:"1rem"}),...f.getInputProps("goal_amount")}),n(pt,{withAsterisk:!0,label:x("dare_amount"),description:x("dare_amount_explanation"),prefix:"$",min:.1,max:9999,step:.1,decimalScale:2,fixedDecimalScale:!0,thousandSeparator:" ",leftSection:n(Xt,{size:"1rem"}),...f.getInputProps("amount")}),n(v,{size:"xs",c:"dimmed",children:x("dare_contributions_explanation")}),u($,{justify:"flex-end",mt:"xs",children:[n(V,{variant:"default",onClick:r,children:x("cancel")}),n(V,{rightSection:n(gs,{size:16}),variant:"gradient",loading:a.isPending,disabled:a.isPending,gradient:{from:"#ed6ea0",to:"#ec8c69",deg:35},type:"submit",children:x("create_dare")})]})]})})})},ar=1,Ar=2,zn=4,ld=8,Eo=16,Po=32,Mo=64,Uf=128,hE=256,oh={[Uf]:0,[zn]:1,[Ar]:2,[ar]:3,[ld]:4,[Eo]:5,[Po]:6,[hE]:7,[Mo]:8};function FI({dares:e,videoHeight:t,direction:r,purchaseNecessary:i}){const{t:s}=Fe(),{username:a}=Bn(),{user:o,toggleBalance:l}=fe(),[c,d]=_.useState(()=>Date.now()),[p,h]=_t(!1),f=e.some(b=>b.state===Uf||b.state===zn);_.useEffect(()=>{if(!f)return;d(Date.now());const b=window.setInterval(()=>{d(Date.now())},1e3);return()=>window.clearInterval(b)},[f]);const m=_.useMemo(()=>[...e].sort((b,S)=>{const k=oh[b.state]??100,w=oh[S.state]??100;return k!==w?k-w:b.draft_id&&S.draft_id?S.ts-b.ts:S.id-b.id}),[e]),y=`calc(100dvh - ${r==="column"?`${Math.ceil(t)}px - ${t===0?"23.1":"13.15"}rem`:"11.7rem"})`;return u(ke,{children:[a&&n(uE,{username:a,opened:p,close:h.close,toggleBalance:l}),u(j,{gap:"sm",mt:"sm",children:[n(j,{style:{height:y,minHeight:"150px",minWidth:"20rem",width:"100%",position:"relative"},children:n(Lt,{style:{flex:1,minHeight:0},offsetScrollbars:!0,styles:{scrollbar:{background:"transparent"}},children:n(j,{gap:"sm",p:"sm",children:m.length===0?n(ct,{mih:140,children:u(j,{gap:4,align:"center",children:[n(v,{fw:600,children:s("dare_empty_title")}),n(v,{size:"sm",c:"dimmed",ta:"center",children:s("dare_empty_body")})]})}):m.map(b=>n(oE,{dare:b,username:a,now:c,direction:"column",purchaseNecessary:i},yc(b)))})})}),n(V,{fullWidth:!0,size:"sm",leftSection:n(gs,{size:"1rem"}),disabled:!o,onClick:h.open,children:s("dare_create")})]})]})}const pE=1,mE=2,fE=4,Bf=8,gE=16,yE=32,bE=64,_E=e=>e&yE?{label:"Rejected",color:"red"}:e&gE?{label:"Failed",color:"orange"}:e&bE?{label:"Invalid",color:"gray"}:e&Bf?{label:"Completed",color:"green"}:e&fE?{label:"Voting",color:"violet"}:e&mE?{label:"Accepted",color:"teal"}:e&pE?{label:"Created",color:"yellow"}:{label:"Unknown",color:"gray"};function vE(){const{contribQuery:e}=en(),t=e(),[r,i]=_.useState(1),[s,a]=_.useState(""),o=20,l=t.data?[...t.data].sort((y,b)=>new Date(b.dare_created_at).getTime()-new Date(y.dare_created_at).getTime()):[],c=s.trim()===""?l:l.filter(y=>y.dare_id.toString().includes(s.trim())),d=Math.ceil(c.length/o),p=(r-1)*o,h=p+o,f=c.slice(p,h),m=y=>{a(y),i(1)};return n(ue,{withBorder:!0,children:u(j,{gap:"xs",children:[u(mt,{gap:"md",align:"end",wrap:"wrap",children:[n(Te,{label:"Search by Dare ID",placeholder:"Enter dare ID",value:s,onChange:y=>{const b=y.currentTarget.value;m(b)},style:{flex:1,minWidth:200},disabled:t.isLoading,__clearable:!0}),s&&u(v,{c:"dimmed",fz:"sm",mt:"md",children:["Showing results for dare ID: ",n("strong",{children:s})," ","(",c.length," contribution",c.length!==1?"s":"",")"]})]}
428),n(g.ScrollContainer,{minWidth:800,children:u(g,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Donator"}),n(g.Th,{children:"Streamer"}),n(g.Th,{children:"Dare ID"}),n(g.Th,{children:"Amount"}),n(g.Th,{children:"Description"}),n(g.Th,{children:"Created At"}),n(g.Th,{children:"Author"}),n(g.Th,{children:"Status"})]})}),n(g.Tbody,{children:t.isLoading?n(g.Tr,{children:n(g.Td,{colSpan:8,ta:"center",py:"xl",children:n(Xe,{mx:"auto"})})}):f.length>0?f.map(y=>{const b=_E(y.state);return u(g.Tr,{children:[n(g.Td,{children:y.donator_username}),n(g.Td,{children:y.streamer_username}),n(g.Td,{children:n(pe,{variant:"dot",color:"indigo",children:y.dare_id})}),n(g.Td,{children:se(Number(y.amount))}),n(g.Td,{children:n(v,{lineClamp:2,style:{maxWidth:250},children:y.description})}),n(g.Td,{children:n(v,{fz:"sm",children:new Date(y.dare_created_at).toLocaleString()})}),n(g.Td,{children:n(pe,{color:y.author?"blue":"green",variant:"light",children:y.author?"Author":"Contributor"})}),n(g.Td,{children:n(pe,{color:b.color,variant:"outline",children:b.label})})]},`${y.dare_id}-${y.donator_username}`)}):n(g.Tr,{children:n(g.Td,{colSpan:8,ta:"center",py:"md",children:n(v,{c:"dimmed",children:s?`No contributions found for dare ID "${s}".`:"No contributions found."})})})})]})}),n($,{justify:"center",mt:"md",children:n(yt,{value:r,onChange:i,total:d,disabled:t.isLoading||d===0,color:"dark",size:"md"})})]})})}const _l=10;function wE(){const{deleteDareMutation:e,overrideDareMutation:t}=qs(),{daresQuery:r}=en(),[i,s]=_.useState(1),[a,o]=bn(),{pathname:l}=qr(),[c,d]=_.useState(a.get("q")??""),p=r();_.useEffect(()=>{l==="/admin/dares"&&(s(1),o(()=>({q:c})))},[c]);const h=_.useMemo(()=>{var m;return(m=p.data)==null?void 0:m.filter(y=>{var b;return(b=y.username)==null?void 0:b.toLowerCase().includes(c.toLowerCase())})},[p.data,c]),f=_.useMemo(()=>{const m=(i-1)*_l,y=i*_l;return h==null?void 0:h.sort((b,S)=>S.id-b.id).slice(m,y)},[h,i]);return n(ue,{withBorder:!0,children:u(j,{gap:"xs",children:[n(Te,{leftSection:n(Ot,{size:"1rem"}),placeholder:"Search by username",onChange:m=>d(m.currentTarget.value),value:c}),u(v,{size:"xs",children:[n("b",{children:h==null?void 0:h.length})," records found"]}),n(g.ScrollContainer,{minWidth:500,children:u(g,{layout:"auto",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"ID"}),n(g.Th,{children:"Username"}),n(g.Th,{children:"Last update"}),n(g.Th,{children:"Description"}),n(g.Th,{children:"Sum"}),n(g.Th,{children:"Status"}),n(g.Th,{})]})}),n(g.Tbody,{children:f==null?void 0:f.map(m=>u(g.Tr,{children:[n(g.Td,{children:m.id}),n(g.Td,{children:m.username}),n(g.Td,{children:st.format(m.ts)}),n(g.Td,{children:m.description}),n(g.Td,{children:se(m.contributions.reduce((y,b)=>y+b.amount,0))}),n(g.Td,{style:{minWidth:"10rem"},children:n(pe,{color:Ff(m.state),variant:"dot",children:Of(m.state)})}),n(g.Td,{align:"right",children:u(mp,{children:[![Eo,Po,Mo].includes(m.state)&&n(V,{variant:"filled",size:"compact-xs",color:"red.6",leftSection:n(ro,{size:"1rem"}),onClick:async()=>{e.mutate(m.id,{onSuccess(){Ee.show({position:"top-center",title:"Success",message:"Dare has been invalidated, money has been returned.",color:"green",icon:n(Ke,{})}),p.refetch()}})},children:"Invalidate"}),![Bf].includes(m.state)&&n(V,{variant:"filled",size:"compact-xs",color:"green.6",leftSection:n(Ke,{size:"1rem"}),onClick:async()=>{t.mutate(m.id,{onSuccess(){Ee.show({position:"top-center",title:"Success",message:"Dare has been overriden to complete, money has been distributed correctly.",color:"green",icon:n(Ke,{})}),p.refetch()}})},children:"Complete"})]})})]},m.id))})]})}),n(yt,{color:"dark.4",value:i,onChange:m=>s(m),total:Math.ceil(((h==null?void 0:h.length)??0)/_l)})]})})}function SE(){var d;const{kickStreamMutation:e,streamsQuery:t}=en(),{viewersQuery:r}=en(),i=t(),[s,a]=_.useState(null),o=r(s??void 0),l=()=>(o==null?void 0:o.data).event_ws??[],c=()=>(o==null?void 0:o.data).nimble_clients??[];return u(ke,{children:[n(ue,{withBorder:!0,children:u(j,{gap:"xs",children:[n(g.ScrollC
428ontainer,{minWidth:500,children:u(g,{children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Username"}),n(g.Th,{children:"Key"}),n(g.Th,{children:"Published"}),n(g.Th,{children:"Bandwidth"}),n(g.Th,{children:"Resolution"}),n(g.Th,{children:"Video codec"}),n(g.Th,{children:"Audio codec"}),n(g.Th,{children:"Connections"}),n(g.Th,{})]})}),n(g.Tbody,{children:(d=i.data)==null?void 0:d.map(p=>u(g.Tr,{children:[n(g.Td,{children:p.username}),n(g.Td,{children:p.strm}),n(g.Td,{children:new Date(parseInt(p.publish_time)*1e3).toLocaleString()}),u(g.Td,{children:[Math.round(parseInt(p.bandwidth)/1024)," kbit"]}),n(g.Td,{children:p.resolution}),n(g.Td,{children:p.vcodec}),n(g.Td,{children:p.acodec}),n(g.Td,{children:n(V,{variant:"subtle",size:"compact-xs",onClick:()=>a(p.username),children:"View"})}),n(g.Td,{align:"right",children:n(V,{variant:"filled",size:"compact-xs",color:"red",leftSection:n(ro,{size:"1rem"}),onClick:()=>e.mutate(p.strm),children:"Kick"})})]},p.strm))})]})}),n($,{justify:"center",children:n(yt,{disabled:!0,color:"dark",total:10})})]})}),n(Oe,{opened:s!==null,onClose:()=>a(null),title:`Connections for ${s??"—"}`,size:"xl",withinPortal:!0,scrollAreaComponent:Lt.Autosize,children:o?o.isFetching?n(ct,{p:"xl",children:n(Xe,{})}):o.data?u(ke,{children:[u("div",{style:{marginBottom:"1.5rem"},children:[u(v,{fw:500,mb:"xs",children:["WebSocket Clients (",l().length,")"]}),u(g,{striped:!0,withTableBorder:!0,withColumnBorders:!0,style:{width:"50%"},children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"IP"}),n(g.Th,{children:"Username"})]})}),n(g.Tbody,{children:l().length>0?l().map((p,h)=>u(g.Tr,{children:[n(g.Td,{children:n(v,{size:"sm",truncate:!0,children:p.ip})}),n(g.Td,{children:n(v,{size:"sm",truncate:!0,children:p.username})})]},`ws-${h}`)):n(g.Tr,{children:n(g.Td,{colSpan:2,ta:"center",children:"No WebSocket clients"})})})]})]}),n(je,{my:"md"}),u("div",{children:[u(v,{fw:500,mb:"xs",children:["Stream Viewers (",c().length,")"]}),u(g,{striped:!0,withTableBorder:!0,withColumnBorders:!0,children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{style:{width:"15%"},children:"IP"}),n(g.Th,{style:{width:"16%"},children:"Created (UTC)"}),n(g.Th,{style:{width:"16%"},children:"Last Access (UTC)"}),n(g.Th,{style:{width:"10%"},children:"Type"}),n(g.Th,{style:{width:"30%"},children:"User Agent"}),n(g.Th,{style:{width:"13%"},children:"Bytes Sent"})]})}),n(g.Tbody,{children:c().length>0?c().map(p=>u(g.Tr,{children:[n(g.Td,{children:n(v,{size:"sm",truncate:!0,children:p.client_ip})}),n(g.Td,{children:u(v,{size:"sm",children:[new Date(p.created*1e3).toISOString().replace("T"," ").substring(0,19)," UTC"]})}),n(g.Td,{children:u(v,{size:"sm",children:[new Date(p.last_access*1e3).toISOString().replace("T"," ").substring(0,19)," UTC"]})}),n(g.Td,{children:n(v,{size:"sm",children:p.type})}),n(g.Td,{children:n(v,{size:"sm",truncate:!0,title:p.user_agent,children:p.user_agent})}),n(g.Td,{children:n(v,{size:"sm",children:p.bytes_sent.toLocaleString()})})]},`nimble-${p.id}`)):n(g.Tr,{children:n(g.Td,{colSpan:6,ta:"center",children:"No stream viewers"})})})]})]})]}):n(v,{c:"red",children:"Error loading connections"}):n(v,{children:"Select a stream to view connections"})})]})}function CE({username:e}){var R,E;const{messagesQuery:t,sendMessageMutation:r,uploadImageMutation:i}=Bs(),{usersQuery:s,updateUserMutation:a}=en(),{user:o}=fe(),l=t(e),c=(R=s.data)==null?void 0:R.find(z=>z.username===e),d=_.useRef(null),[p,h]=_.useState(!1),[f,m]=_.useState(!1),y=_.useRef(null),[b,S]=_.useState(null),[k,w]=_.useState(void 0),T=Ge({initialValues:{message:""},validate:{message:$r("Message cannot be empty")}});_.useEffect(()=>{if(f)return;d.current=new WebSocket(`${ed}/notifications/${e}`),d.current.onopen=()=>h(!0),d.current.onclose=()=>{h(!1),m(!0),setTimeout(()=>m(!1),250)},d.current.onmessage=N=>{const C=JSON.parse(N.data);(C.type==="request"||C.type==="support"||C.type==="support_delete_message")&&(l.refetch(),setTimeout(()=>{var M;(M=y.current)==null||M.scrollTo({top:y.current.scrollHeight,behavior:"instant"})},150))};const z=d.current;return()=>{z&&z.close()}},[f]),_.useEffect(()=>{setTimeout(()=>{var z;(z=y.current)==null||z.scrollTo({top:y.current.scrollHeight,behavior:"instant"})},150)},[l]);function A(){if(!b)return;const z=URL.createObjectURL(b);return n(jr,{w:200,src:z,onLoad:()=>URL.revokeObjectURL(z)},b.name)}
428return u(j,{miw:300,children:[he(o,Ce)&&c&&n(qt,{label:he(c,ei)?"Notifications disabled":"Notifications allowed",color:"teal",checked:!he(c,ei),onChange:z=>{const N=z.currentTarget.checked,C=c.permission_mask??0,M=N?C&-65:C|ei;a.mutate({id:c.id,permission_mask:M},{onSuccess:()=>{s.refetch(),ay({title:"User updated",message:`You ${N?"unmuted":"muted"} user ${e}.`,color:"blue"})}})},thumbIcon:he(c,ei)?n(ht,{size:12,color:"var(--mantine-color-red-6)",stroke:3}):n(Ke,{size:12,color:"var(--mantine-color-teal-6)",stroke:3})}),n(sr.FullScreen,{active:!0,accept:oy,onDrop:z=>{S(z[0])},children:u($,{justify:"center",gap:"xl",mih:220,style:{pointerEvents:"none"},children:[n(sr.Accept,{children:n(Ai,{size:52,stroke:1.5})}),n(sr.Reject,{children:n(ht,{size:52,color:"var(--mantine-color-red-6)",stroke:1.5})}),n(sr.Idle,{children:n(gn,{size:52,color:"var(--mantine-color-dimmed)",stroke:1.5})}),u("div",{children:[n(v,{size:"xl",inline:!0,children:"Drag image here"}),n(v,{size:"sm",c:"dimmed",inline:!0,mt:7,children:"Image should not exceed 10mb"})]})]})}),n(Lt,{h:300,viewportRef:y,offsetScrollbars:!0,children:(E=l.data)==null?void 0:E.map(z=>n(ad,{...z,username:"test",receiver:{id:0}},z.id))}),n("form",{onSubmit:T.onSubmit(z=>{r.mutate({message:z.message,username:e},{onSuccess(){l.refetch(),T.reset()}})}),children:u($,{align:"start",children:[n(Te,{miw:300,placeholder:"Message",...T.getInputProps("message"),rightSection:n(Ne,{disabled:r.isPending,loading:r.isPending,variant:"transparent",component:"button",type:"submit",children:n(Md,{size:16})})}),b?u($,{align:"start",children:[u(j,{children:[u(V,{variant:"light",color:"blue.2",leftSection:n(Md,{size:"1rem"}),disabled:i.isPending,loading:i.isPending,onClick:()=>i.mutate({image:b,username:e},{onSuccess(){S(null),l.refetch()}}),children:["Send ",b.name]}),n(A,{})]}),n(V,{variant:"light",color:"red.2",leftSection:n(zr,{size:"1rem"}),onClick:()=>S(null),children:"Reset"})]}):n(Rr,{onChange:S,accept:"image/png,image/jpeg,image/gif",children:z=>n(V,{variant:"light",color:"blue.2",leftSection:n(ub,{size:"1rem"}),...z,children:"Select photo"})})]})}),he(o,Ce)&&u($,{align:"end",children:[n(pt,{label:"Top up amount (USD)",prefix:"$",min:0,decimalScale:2,fixedDecimalScale:!0,value:k,onChange:z=>{w(typeof z=="number"?z:void 0)},w:200}),n(V,{color:"green",disabled:!c||!k||k<=0,onClick:()=>{!c||typeof k!="number"||k<=0||a.mutate({id:c.id,balance:Math.round(k*100),is_topup:!0},{onSuccess(){w(void 0)}})},children:"Top Up"})]})]})}function qf(){var s;const{usersQuery:e}=en(),[t,r]=bn(),i=t.get("u");return n(ue,{withBorder:!0,children:u($,{align:"start",children:[n(it,{label:"Username",placeholder:"Pick a username",withScrollArea:!1,allowDeselect:!1,checkIconPosition:"right",leftSection:n(Ot,{size:"1rem"}),styles:{dropdown:{maxHeight:200,overflowY:"auto"}},data:(s=e.data)==null?void 0:s.map(a=>a.username??""),value:i,searchable:!0,onChange:a=>r({u:a??""})}),i&&n(CE,{username:i})]})})}const TE={1:"Paid Stream",2:"Premium"},xE={0:"Success",1:"Refunded"},kE={0:"green",1:"red"};async function EE(e,t){const r=new URLSearchParams;return r.append("limit","20"),r.append("page",e.toString()),Object.entries(t).forEach(([i,s])=>{s!=null&&s!==""&&r.append(i,s.toString())}),await ae(`${O}/purchases?${r.toString()}`)}async function PE(e){return await et(`${O}/purchases/${e}`)}function ME(e,t,r){return oe({queryKey:["purchases",e,t],queryFn:()=>EE(e,t),placeholderData:i=>i,staleTime:1e3*60,gcTime:1e3*5*60,enabled:he(r,Ce)})}function AE(){const e=at();return J({mutationFn:async t=>(await PE(t),t),onSuccess:t=>{Ee.show({title:"Refunded",message:`Successfully refunded purchase_id ${t}`,color:"green",icon:"✅"}),e.invalidateQueries({queryKey:["purchases"]})},onError:t=>{const r=t instanceof Error?t.message:"Unknown error";Ee.show({title:"Refund Failed",message:`Could not refund: ${r}`,color:"red",icon:"❌"})}})}function DE(){const{user:e}=fe(),[t,r]=_.useState({item_id:"",buyer:"",seller:"",type:"",status:""}),[i,s]=_.useState(1),[a,o]=_.useState(""),[l,c]=_.useState(""),d=AE(),p=_.useMemo(()=>a.length>=2?a:"",[a]),h=_.useMemo(()=>l.length>=2?l:"",[l]),{data:f}=Cs(p),m=_.useMemo(()=>(f==null?void 0:f.users.map(I=>({value:I.username,label:I.username})))||[],[f==null?void 0:f.users]),{data:y}=Cs(h),b=_.useMemo(()=>(y==null?void 0:y.users.map(I=>({value:I.username,label:I.username})))||[],[y==null?void 0:y.users]),S=I=>o(I),k=I=>c(I),w=()=>{a&&m.some(I=>I.value===a)?r({...t,buyer:a}):r({...t,buyer:""})},T=()=>{l&&b.some(I=>I.value===l)?r({...t,seller:l}):r({...t,seller:""})},A={item_id:t.item_id?Number(t.item_id):void 0,buyer:t.buyer||void 0,seller:t.seller||void 0,type:(()=>{const I=t.type?Number(t.type):void 0;return I===1||I===2?I:void 0})(),status:(()=>{const I=t.status?Number(t.status):void 0;return I===0||I===1?I:void 0})()},{data:R,isLoading:E,isError:z,error:N}=ME(i,A,e),C=(R==null?void 0:R.purchases)||[],M=(R==null?void 0:R.pages)||1,P=()=>s(1);return he(e,Ce)?n(Be,{mt:"xl",fluid:!0,children:u(ue,{shadow:"sm",padding:"lg",radiu
428s:"md",withBorder:!0,children:[n(Ye,{order:2,mb:"md",children:"Purchase History"}),n(v,{color:"dimmed",mb:"lg",children:"View all purchases with filtering and pagination."}),u(j,{mb:"lg",children:[u($,{grow:!0,children:[n(Te,{label:"Item ID",placeholder:"123",value:t.item_id,onChange:I=>r({...t,item_id:I.currentTarget.value})}),n(va,{label:"Seller Username",placeholder:"Start typing...",data:b,value:l,onChange:k,onBlur:T,limit:10}),n(va,{label:"Buyer Username",placeholder:"Start typing...",data:m,value:a,onChange:S,onBlur:w,limit:10})]}),u($,{grow:!0,align:"end",children:[n(it,{label:"Type",placeholder:"All types",data:[{value:"",label:"All Types"},{value:"1",label:"Paid Stream"},{value:"2",label:"Premium"}],value:t.type,onChange:I=>r({...t,type:I||""})}),n(it,{label:"Status",placeholder:"All statuses",data:[{value:"",label:"All"},{value:"0",label:"Success"},{value:"1",label:"Refunded"}],value:t.status,onChange:I=>r({...t,status:I||""})}),n(V,{leftSection:n(Ot,{}),color:"blue",onClick:P,fullWidth:!1,children:"Search"})]})]}),E?n(mt,{justify:"center",align:"center",py:"xl",children:n(Xe,{})}):C.length===0?n(v,{c:"dimmed",ta:"center",py:"xl",children:"No purchases found."}):u(ke,{children:[u(g,{striped:!0,highlightOnHover:!0,withTableBorder:!0,horizontalSpacing:"md",verticalSpacing:"sm",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{w:80,children:"ID"}),n(g.Th,{children:"Buyer"}),n(g.Th,{children:"Seller"}),n(g.Th,{children:"Type"}),n(g.Th,{w:100,children:"Price"}),n(g.Th,{w:100,children:"Status"}),n(g.Th,{w:160,children:"Purchased At"}),n(g.Th,{w:100,children:"Actions"})]})}),n(g.Tbody,{children:C.map(I=>u(g.Tr,{children:[n(g.Td,{children:I.id}),n(g.Td,{children:I.buyer}),n(g.Td,{children:I.seller}),n(g.Td,{children:n(pe,{color:"blue",children:TE[I.type]})}),u(g.Td,{children:["$",(I.price/100).toFixed(2)]}),n(g.Td,{children:n(pe,{color:kE[I.status],children:xE[I.status]})}),n(g.Td,{children:new Date(I.purchased_at).toLocaleString()}),n(g.Td,{children:I.status===0?n(V,{size:"xs",color:"red",variant:"light",loading:d.isPending&&d.variables===I.id,onClick:()=>{window.confirm(`Refund purchase #${I.id}? This cannot be undone.`)&&d.mutate(I.id)},fullWidth:!0,children:"Refund"}):n(pe,{color:"gray",variant:"light",children:"Refunded"})})]},I.id))})]}),n(mt,{justify:"flex-end",mt:"md",children:n(yt,{total:M,value:i,onChange:s,disabled:E})})]}),z&&n(Le,{color:"red",title:"Error loading purchases",mt:"md",children:N.message})]})}):n(Be,{mt:"xl",children:n(Le,{color:"red",title:"Access Denied",children:"You do not have permission to view this page."})})}const di={AVAILABLE:0,MANUALLY_DELETED:1,AUTO_CLEANED:2},IE={[di.AVAILABLE]:"Active",[di.MANUALLY_DELETED]:"Manually Deleted",[di.AUTO_CLEANED]:"Auto Cleaned"},$E={[di.AVAILABLE]:"green",[di.MANUALLY_DELETED]:"red",[di.AUTO_CLEANED]:"yellow"};function RE(){const{user:e}=fe(),[t,r]=_.useState({receiver:"",sender:"",deleted:"",keyword:"",session_id:""}),[i,s]=_.useState(1),[a,o]=_.useState(""),[l,c]=_.useState(""),d=_.useMemo(()=>a.length>=2?a:"",[a]),p=_.useMemo(()=>l.length>=2?l:"",[l]),{data:h}=Cs(d),f=_.useMemo(()=>(h==null?void 0:h.users.map(L=>({value:L.username,label:L.username})))||[],[h==null?void 0:h.users]),{data:m}=Cs(p),y=_.useMemo(()=>(m==null?void 0:m.users.map(L=>({value:L.username,label:L.username})))||[],[m==null?void 0:m.users]),b=L=>o(L),S=L=>c(L),k=()=>{a&&f.some(L=>L.value===a)?r({...t,receiver:a}):r({...t,receiver:""})},w=()=>{l&&y.some(L=>L.value===l)?r({...t,sender:l}):r({...t,sender:""})},T={receiver:t.receiver||void 0,sender:t.sender||void 0,deleted:t.deleted!==""?Number(t.deleted):void 0,keyword:t.keyword||void 0,session_id:t.session_id||void 0},{data:A,isLoading:R,isError:E,error:z}=Bk(i,T,e),N=(A==null?void 0:A.messages)||[],C=(A==null?void 0:A.total_pages)||1,M=(A==null?void 0:A.total_messages)||0,P=()=>s(1);if(!he(e,Ce))return n(Be,{mt:"xl",children:n(Le,{color:"red",title:"Access Denied",children:"You do not have permission to view this page."})});const I=L=>{try{return new Date(L).toLocaleString()}catch{return L}};return n(Be,{mt:"xl",fluid:!0,children:u(ue,{shadow:"sm",padding:"lg",radiu
428s:"md",withBorder:!0,children:[n(Ye,{order:2,mb:"md",children:"Chat History"}),u(v,{color:"dimmed",mb:"lg",children:["View all chat messages with filtering and pagination. Total: ",M," messages."]}),u(j,{mb:"lg",children:[u($,{grow:!0,children:[n(va,{label:"Receiver Username",placeholder:"Start typing...",data:f,value:a,onChange:b,onBlur:k,limit:10}),n(va,{label:"Sender Username",placeholder:"Start typing...",data:y,value:l,onChange:S,onBlur:w,limit:10}),n(Te,{label:"Session ID",placeholder:"abc123...",value:t.session_id,onChange:L=>r({...t,session_id:L.currentTarget.value})})]}),u($,{grow:!0,align:"end",children:[n(Te,{label:"Keyword Search",placeholder:"Search message content...",value:t.keyword,onChange:L=>r({...t,keyword:L.currentTarget.value})}),n(it,{label:"Status",placeholder:"All statuses",data:[{value:"",label:"All Statuses"},{value:"0",label:"Active"},{value:"1",label:"Manually Deleted"},{value:"2",label:"Auto Cleaned"}],value:t.deleted,onChange:L=>r({...t,deleted:L||""})}),n(V,{leftSection:n(Ot,{}),color:"blue",onClick:P,fullWidth:!1,children:"Search"})]})]}),R?n(mt,{justify:"center",align:"center",py:"xl",children:n(Xe,{})}):N.length===0?n(v,{c:"dimmed",ta:"center",py:"xl",children:"No messages found."}):u(ke,{children:[u(g,{striped:!0,highlightOnHover:!0,withTableBorder:!0,horizontalSpacing:"md",verticalSpacing:"sm",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{w:150,children:"Sender"}),n(g.Th,{w:150,children:"Receiver"}),n(g.Th,{children:"Message"}),n(g.Th,{w:120,children:"Status"}),n(g.Th,{w:180,children:"Created At"}),n(g.Th,{w:150,children:"Session ID"})]})}),n(g.Tbody,{children:N.map((L,U)=>u(g.Tr,{children:[n(g.Td,{children:L.sender_username}),n(g.Td,{children:L.receiver_username}),n(g.Td,{children:n(Se,{label:L.body,multiline:!0,w:300,withArrow:!0,position:"bottom",disabled:!L.body||L.body.length<=100,children:n(v,{lineClamp:2,style:{cursor:"default"},children:L.body})})}),"                    ",n(g.Td,{children:n(pe,{color:$E[L.deleted],children:IE[L.deleted]})}),n(g.Td,{children:I(L.created)}),n(g.Td,{children:L.anonymous_session_id?n(v,{size:"sm",c:"dimmed",children:L.anonymous_session_id}):n(v,{size:"sm",c:"dimmed",fs:"italic",children:"—"})})]},U))})]}),n(mt,{justify:"flex-end",mt:"md",children:n(yt,{total:C,value:i,onChange:s,disabled:R})})]}),E&&n(Le,{color:"red",title:"Error loading chat history",mt:"md",children:z.message})]})})}var ma={exports:{}},zE=ma.exports,lh;function NE(){return lh||(lh=1,function(e,t){(function(r,i){e.exports=i()})(zE,function(){var r=1e3,i=6e4,s=36e5,a="millisecond",o="second",l="minute",c="hour",d="day",p="week",h="month",f="quarter",m="year",y="date",b="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(U){var q=["th","st","nd","rd"],B=U%100;return"["+U+(q[(B-20)%10]||q[B]||q[0])+"]"}},T=function(U,q,B){var Y=String(U);return!Y||Y.length>=q?U:""+Array(q+1-Y.length).join(B)+U},A={s:T,z:function(U){var q=-U.utcOffset(),B=Math.abs(q),Y=Math.floor(B/60),Q=B%60;return(q<=0?"+":"-")+T(Y,2,"0")+":"+T(Q,2,"0")},m:function U(q,B){if(q.date()<B.date())return-U(B,q);var Y=12*(B.year()-q.year())+(B.month()-q.month()),Q=q.clone().add(Y,h),W=B-Q<0,F=q.clone().add(Y+(W?-1:1),h);return+(-(Y+(B-Q)/(W?Q-F:F-Q))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:h,y:m,w:p,d,D:y,h:c,m:l,s:o,ms:a,Q:f}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},R="en",E={};E[R]=w;var z="$isDayjsObject",N=function(U){return U instanceof I||!(!U||!U[z])},C=function U(q,B,Y){var Q;if(!q)return R;if(typeof q=="string"){var W=q.toLowerCase();E[W]&&(Q=W),B&&(E[W]=B,Q=W);var F=q.split("-");if(!Q&&F.length>1)return U(F[0])}else{var H=q.name;E[H]=q,Q=H}return!Y&&Q&&(R=Q),Q||!Y&&R},M=function(U,q){if(N(U))return U.clone();var B=typeof q=="object"?q:{};return B.date=U,B.args=arguments,new I(B)},P=A;P.l=C,P.i=N,P.w=function(U,q){return M(U,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var I=function(){function U(B){this.$L=C(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[z]=!0}var q=U.prototype;return q.parse=function(B){this.$d=function(Y){var Q=Y.date,W=Y.utc;if(Q===null)return new Date(NaN);if(P.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var F=Q.match(S);if(F){var H=F[2]-1||0,K=(F[7]||"0").substring(0,3);
vendor: 4,613 bytes, line 428
428return W?new Date(Date.UTC(F[1],H,F[3]||1,F[4]||0,F[5]||0,F[6]||0,K)):new Date(F[1],H,F[3]||1,F[4]||0,F[5]||0,F[6]||0,K)}}return new Date(Q)}(B),this.init()},q.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},q.$utils=function(){return P},q.isValid=function(){return this.$d.toString()!==b},q.isSame=function(B,Y){var Q=M(B);return this.startOf(Y)<=Q&&Q<=this.endOf(Y)},q.isAfter=function(B,Y){return M(B)<this.startOf(Y)},q.isBefore=function(B,Y){return this.endOf(Y)<M(B)},q.$g=function(B,Y,Q){return P.u(B)?this[Y]:this.set(Q,B)},q.unix=function(){return Math.floor(this.valueOf()/1e3)},q.valueOf=function(){return this.$d.getTime()},q.startOf=function(B,Y){var Q=this,W=!!P.u(Y)||Y,F=P.p(B),H=function(be,Me){var ne=P.w(Q.$u?Date.UTC(Q.$y,Me,be):new Date(Q.$y,Me,be),Q);return W?ne:ne.endOf(d)},K=function(be,Me){return P.w(Q.toDate()[be].apply(Q.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(Me)),Q)},X=this.$W,Z=this.$M,le=this.$D,de="set"+(this.$u?"UTC":"");switch(F){case m:return W?H(1,0):H(31,11);case h:return W?H(1,Z):H(0,Z+1);case p:var ye=this.$locale().weekStart||0,ge=(X<ye?X+7:X)-ye;return H(W?le-ge:le+(6-ge),Z);case d:case y:return K(de+"Hours",0);case c:return K(de+"Minutes",1);case l:return K(de+"Seconds",2);case o:return K(de+"Milliseconds",3);default:return this.clone()}},q.endOf=function(B){return this.startOf(B,!1)},q.$set=function(B,Y){var Q,W=P.p(B),F="set"+(this.$u?"UTC":""),H=(Q={},Q[d]=F+"Date",Q[y]=F+"Date",Q[h]=F+"Month",Q[m]=F+"FullYear",Q[c]=F+"Hours",Q[l]=F+"Minutes",Q[o]=F+"Seconds",Q[a]=F+"Milliseconds",Q)[W],K=W===d?this.$D+(Y-this.$W):Y;if(W===h||W===m){var X=this.clone().set(y,1);X.$d[H](K),X.init(),this.$d=X.set(y,Math.min(this.$D,X.daysInMonth())).$d}else H&&this.$d[H](K);return this.init(),this},q.set=function(B,Y){return this.clone().$set(B,Y)},q.get=function(B){return this[P.p(B)]()},q.add=function(B,Y){var Q,W=this;B=Number(B);var F=P.p(Y),H=function(Z){var le=M(W);return P.w(le.date(le.date()+Math.round(Z*B)),W)};if(F===h)return this.set(h,this.$M+B);if(F===m)return this.set(m,this.$y+B);if(F===d)return H(1);if(F===p)return H(7);var K=(Q={},Q[l]=i,Q[c]=s,Q[o]=r,Q)[F]||1,X=this.$d.getTime()+B*K;return P.w(X,this)},q.subtract=function(B,Y){return this.add(-1*B,Y)},q.format=function(B){var Y=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||b;var W=B||"YYYY-MM-DDTHH:mm:ssZ",F=P.z(this),H=this.$H,K=this.$m,X=this.$M,Z=Q.weekdays,le=Q.months,de=Q.meridiem,ye=function(Me,ne,Re,te){return Me&&(Me[ne]||Me(Y,W))||Re[ne].slice(0,te)},ge=function(Me){return P.s(H%12||12,Me,"0")},be=de||function(Me,ne,Re){var te=Me<12?"AM":"PM";return Re?te.toLowerCase():te};return W.replace(k,function(Me,ne){return ne||function(Re){switch(Re){case"YY":return String(Y.$y).slice(-2);case"YYYY":return P.s(Y.$y,4,"0");case"M":return X+1;case"MM":return P.s(X+1,2,"0");case"MMM":return ye(Q.monthsShort,X,le,3);case"MMMM":return ye(le,X);case"D":return Y.$D;case"DD":return P.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return ye(Q.weekdaysMin,Y.$W,Z,2);case"ddd":return ye(Q.weekdaysShort,Y.$W,Z,3);case"dddd":return Z[Y.$W];case"H":return String(H);case"HH":return P.s(H,2,"0");case"h":return ge(1);case"hh":return ge(2);case"a":return be(H,K,!0);case"A":return be(H,K,!1);case"m":return String(K);case"mm":return P.s(K,2,"0");case"s":return String(Y.$s);case"ss":return P.s(Y.$s,2,"0");case"SSS":return P.s(Y.$ms,3,"0");case"Z":return F}return null}(Me)||F.replace(":","")})},q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},q.diff=function(B,Y,Q){var W,F=this,H=P.p(Y),K=M(B),X=(K.utcOffset()-this.utcOffset())*i,Z=this-K,le=function(){return P.m(F,K)};switch(H){case m:W=le()/12;break;case h:W=le();break;case f:W=le()/3;break;case p:W=(Z-X)/6048e5;break;case d:W=(Z-X)/864e5;break;case c:W=Z/s;break;case l:W=Z/i;break;case o:W=Z/r;break;default:W=Z}return Q?W:P.a(W)},q.daysInMonth=function(){return this.endOf(h).$D},q.$locale=function(){return E[this.$L]},q.locale=function(B,Y){if(!B)return this.$L;var Q=this.clone(),W=C(B,Y,!0);return W&&(Q.$L=W),Q},q.clone=function(){return P.w(this.$d,this)},q.toDate=function(){return new Date(this.valueOf())},q.toJSON=function(){return this.isValid()?this.toISOString():null},q.toISOString=function(){return this.$d.toISOString()},q.toString=function(){return this.$d.toUTCString()},U}(),L=I.prototype;return M.prototype=L,[["$ms",a],["$s",o],["$m",l],["$H",c],["$W",d],["$M",h],["$y",m],["$D",y]].forEac
428h(function(U){L[U[1]]=function(q){return this.$g(q,U[0],U[1])}}),M.extend=function(U,q){return U.$i||(U(q,I,M),U.$i=!0),M},M.locale=C,M.isDayjs=N,M.unix=function(U){return M(1e3*U)},M.en=E[R],M.Ls=E,M.p={},M})}(ma)),ma.exports}var LE=NE();const ee=$s(LE);function OE({type:e,date:t,locale:r,format:i,labelSeparator:s}){const a=o=>ee(o).locale(r).format(i);return e==="default"?t===null?"":a(t):e==="multiple"?t.map(a).join(", "):e==="range"&&Array.isArray(t)?t[0]&&t[1]?`${a(t[0])} ${s} ${a(t[1])}`:t[0]?`${a(t[0])} ${s} `:"":""}function FE({formatter:e,...t}){return(e||OE)(t)}function UE({direction:e,levelIndex:t,rowIndex:r,cellIndex:i,size:s}){switch(e){case"up":return t===0&&r===0?null:r===0?{levelIndex:t-1,rowIndex:i<=s[t-1][s[t-1].length-1]-1?s[t-1].length-1:s[t-1].length-2,cellIndex:i}:{levelIndex:t,rowIndex:r-1,cellIndex:i};case"down":return r===s[t].length-1?{levelIndex:t+1,rowIndex:0,cellIndex:i}:r===s[t].length-2&&i>=s[t][s[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:i}:{levelIndex:t,rowIndex:r+1,cellIndex:i};case"left":return t===0&&r===0&&i===0?null:r===0&&i===0?{levelIndex:t-1,rowIndex:s[t-1].length-1,cellIndex:s[t-1][s[t-1].length-1]-1}:i===0?{levelIndex:t,rowIndex:r-1,cellIndex:s[t][r-1]-1}:{levelIndex:t,rowIndex:r,cellIndex:i-1};case"right":return r===s[t].length-1&&i===s[t][r]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:i===s[t][r]-1?{levelIndex:t,rowIndex:r+1,cellIndex:0}:{levelIndex:t,rowIndex:r,cellIndex:i+1};default:return{levelIndex:t,rowIndex:r,cellIndex:i}}}function jf({controlsRef:e,direction:t,levelIndex:r,rowIndex:i,cellIndex:s,size:a}){var c,d,p;const o=UE({direction:t,size:a,rowIndex:i,cellIndex:s,levelIndex:r});if(!o)return;const l=(p=(d=(c=e.current)==null?void 0:c[o.levelIndex])==null?void 0:d[o.rowIndex])==null?void 0:p[o.cellIndex];l&&(l.disabled||l.getAttribute("data-hidden")||l.getAttribute("data-outside")?jf({controlsRef:e,direction:t,levelIndex:o.levelIndex,cellIndex:o.cellIndex,rowIndex:o.rowIndex,size:a}):l.focus())}function BE(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function qE(e){var t;return(t=e.current)==null?void 0:t.map(r=>r.map(i=>i.length))}function cd({controlsRef:e,levelIndex:t,rowIndex:r,cellIndex:i,event:s}){const a=BE(s.key);if(a){s.preventDefault();const o=qE(e);jf({controlsRef:e,direction:a,levelIndex:t,rowIndex:r,cellIndex:i,size:o})}}function ch(e,t){if(!e||!t)return t;const r=e.getHours(),i=e.getMinutes(),s=e.getSeconds(),a=e.getMilliseconds(),o=new Date(t);return o.setHours(r),o.setMinutes(i),o.setSeconds(s),o.setMilliseconds(a),o}var fa={exports:{}},jE=fa.exports,dh;function HE(){return dh||(dh=1,function(e,t){(function(r,i){e.exports=i()})(jE,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},i={};return function(s,a,o){var l,c=function(f,m,y){y===void 0&&(y={});var b=new Date(f),S=function(k,w){w===void 0&&(w={});var T=w.timeZoneName||"short",A=k+"|"+T,R=i[A];return R||(R=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:k,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:T}),i[A]=R),R}(m,y);return S.formatToParts(b)},d=function(f,m){for(var y=c(f,m),b=[],S=0;S<y.length;S+=1){var k=y[S],w=k.type,T=k.value,A=r[w];A>=0&&(b[A]=parseInt(T,10))}var R=b[3],E=R===24?0:R,z=b[0]+"-"+b[1]+"-"+b[2]+" "+E+":"+b[4]+":"+b[5]+":000",N=+f;return(o.utc(z).valueOf()-(N-=N%1e3))/6e4},p=a.prototype;p.tz=function(f,m){f===void 0&&(f=l);var y,b=this.utcOffset(),S=this.toDate(),k=S.toLocaleString("en-US",{timeZone:f}),w=Math.round((S-new Date(k))/1e3/60),T=15*-Math.round(S.getTimezoneOffset()/15)-w;if(!Number(T))y=this.utcOffset(0,m);else if(y=o(k,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(T,!0),m){var A=y.utcOffset();y=y.add(b-A,"minute")}return y.$x.$timezone=f,y},p.offsetName=function(f){var m=this.$x.$timezone||o.tz.guess(),y=c(this.valueOf(),m,{timeZoneName:f}).find(function(b){return b.type.toLowerCase()==="timezonename"});return y&&y.value};var h=p.startOf;p.startOf=function(f,m){if(!this.$x||!this.$x.$timezone)return h.call(this,f,m);var y=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return h.call(y,f,m).tz(this.$x.$timezone,!0)},o.tz=function(f,m,y){var b=y&&m,S=y||m||l,k=d(+o(),S);if(typeof f!="string")return o(f).tz(S);var w=function(E,z,N){var C=E-60*z*1e3,M=d(C,N);if(z===M)return[C,z];var P=d(C-=60*(M-z)*1e3,N);return M===P?[C,M]:[E-60*Math.min(M,P)*1e3,Math.max(M,P)]}(o.utc(f,b).valueOf(),k,S),T=w[0],A=w[1],R=o(T).utcOffset(A);return R.$x.$timezone=S,R},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(f){l=f}}})}(fa)),fa.exports}var WE=HE();const YE=$s(WE);var ga={exports:{}},QE=ga.exports,uh;function VE(){return uh||(uh=1,function(e,t){(function(r,i){e.exports=i()})(QE,function(){var r="minute",i=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(a,o,l){var c=o.prototype;l.utc=function(b){var S={date:b,utc:!0,args:arguments};return new o(S)},c.utc=function(b){var S=l(this.toDate(),{locale:this.$L,utc:!0});return b?S.add(this.utcOffset(),r):S},c.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var d=c.parse;c.parse=function(b){b.utc&&(this.$u=!0),this.$utils().u(b.$offset)||(this.$offset=b.$offset),d.call(this,b)};var p=c.init;c.init=function(){if(this.$u){var b=this.$d;this.$y=b.getUTCFullYear(),this.$M=b.getUTCMonth(),this.$D=b.getUTCDate(),this.$W=b.getUTCDay(),this.$H=b.getUTCHours(),this.$m=b.getUTCMinutes(),this.$s=b.getUTCSeconds(),this.$ms=b.getUTCMilliseconds()}else p.call(this)};var h=c.utcOffset;c.utcOffset=function(b,S){var k=this.$utils().u;if(k(b))return this.$u?0:k(this.$offset)?h.call(this):this.$offset;if(typeof b=="string"&&(b=function(R){R===void 0&&(R="");var E=R.match(i);if(!E)return null;var z=(""+E[0]).match(s)||["-",0,0],N=z[0],C=60*+z[1]+ +z[2];return C===0?0:N==="+"?C:-C}(b),b===null))return this;var w=Math.abs(b)<=16?60*b:b,T=this;if(S)return T.$offset=w,T.$u=b===0,T;if(b!==0){var A=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(T=this.local().add(w+A,r)).$offset=w,T.$x.$localOffset=A}else T=this.utc();return T};var f=c.format;c.format=function(b){var S=b||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,S)},c.valueOf=function(){var b=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*b},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var m=c.toDate;c.toDate=function(b){return b==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():m.call(this)};var y=c.diff;
428c.diff=function(b,S,k){if(b&&this.$u===b.$u)return y.call(this,b,S,k);var w=this.local(),T=l(b).local();return y.call(w,T,S,k)}}})}(ga)),ga.exports}var KE=VE();const GE=$s(KE);ee.extend(GE);ee.extend(YE);function XE(e,t){return t?ee(e).tz(t).utcOffset()+e.getTimezoneOffset():0}const hh=(e,t,r)=>{if(!e)return null;if(!t)return e;let i=XE(e,t);return r==="remove"&&(i*=-1),ee(e).add(i,"minutes").toDate()};function Zt(e,t,r,i){return i||!t?t:Array.isArray(t)?t.map(s=>hh(s,r,e)):hh(t,r,e)}function JE({minDate:e,maxDate:t,timezone:r}){const i=Zt("add",new Date,r);return!e&&!t?i:e&&ee(i).isBefore(e)?e:t&&ee(i).isAfter(t)?t:i}const ZE={locale:"en",timezone:null,firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},eP=_.createContext(ZE);function Dt(){const e=_.useContext(eP),t=_.useCallback(o=>o||e.locale,[e.locale]),r=_.useCallback(o=>o||e.timezone||void 0,[e.timezone]),i=_.useCallback(o=>typeof o=="number"?o:e.firstDayOfWeek,[e.firstDayOfWeek]),s=_.useCallback(o=>Array.isArray(o)?o:e.weekendDays,[e.weekendDays]),a=_.useCallback(o=>typeof o=="string"?o:e.labelSeparator,[e.labelSeparator]);return{...e,getLocale:t,getTimezone:r,getFirstDayOfWeek:i,getWeekendDays:s,getLabelSeparator:a}}function tP(e,t){const r=Dt(),i=s=>Zt("remove",s,r.getTimezone()).toISOString();if(t==="range"&&Array.isArray(e)){const[s,a]=e;return s?a?`${i(s)} – ${i(a)}`:`${i(s)} –`:""}return t==="multiple"&&Array.isArray(e)?e.map(s=>s&&i(s)).filter(Boolean).join(", "):!Array.isArray(e)&&e?i(e):""}function Hf({value:e,type:t,name:r,form:i}){return n("input",{type:"hidden",value:tP(e,t),name:r,form:i})}Hf.displayName="@mantine/dates/HiddenDatesInput";var nP={input:"m_468e7eda"};const rP={},dd=Qe((e,t)=>{const r=Ve("TimeInput",rP,e),{classNames:i,styles:s,unstyled:a,vars:o,withSeconds:l,minTime:c,maxTime:d,value:p,onChange:h,...f}=r,{resolvedClassNames:m,resolvedStyles:y}=Oi({classNames:i,styles:s,props:r}),b=k=>{if(c!==void 0||d!==void 0){const[w,T,A]=k.split(":").map(Number);if(c){const[R,E,z]=c.split(":").map(Number);if(w<R||w===R&&T<E||l&&w===R&&T===E&&A<z)return-1}if(d){const[R,E,z]=d.split(":").map(Number);if(w>R||w===R&&T>E||l&&w===R&&T===E&&A>z)return 1}}return 0},S=k=>{var w,T,A;if((w=r.onBlur)==null||w.call(r,k),c!==void 0||d!==void 0){const R=k.currentTarget.value;if(R){const E=b(R);E===1?(k.currentTarget.value=d,(T=r.onChange)==null||T.call(r,k)):E===-1&&(k.currentTarget.value=c,(A=r.onChange)==null||A.call(r,k))}}};return n(bp,{classNames:{...m,input:wc(nP.input,m==null?void 0:m.input)},styles:y,unstyled:a,ref:t,value:p,...f,step:l?1:60,onChange:h,onBlur:S,type:"time",__staticSelector:"TimeInput"})});dd.classes=bp.classes;dd.displayName="@mantine/dates/TimeInput";var Wf={day:"m_396ce5cb"};const iP={},sP=Rs((e,{size:t})=>({day:{"--day-size":Ya(t,"day-size")}})),ud=Qe((e,t)=>{const r=Ve("Day",iP,e),{classNames:i,className:s,style:a,styles:o,unstyled:l,vars:c,date:d,disabled:p,__staticSelector:h,weekend:f,outside:m,selected:y,renderDay:b,inRange:S,firstInRange:k,lastInRange:w,hidden:T,static:A,highlightToday:R,...E}=r,z=_n({name:h||"Day",classes:Wf,props:r,className:s,style:a,classNames:i,styles:o,unstyled:l,vars:c,varsResolver:sP,rootSelector:"day"}),N=Dt();return n(Mt,{...z("day",{style:T?{display:"none"}:void 0}),component:A?"div":"button",ref:t,disabled:p,"data-today":ee(d).isSame(Zt("add",new Date,N.getTimezone()),"day")||void 0,"data-hidden":T||void 0,"data-highlight-today":R||void 0,"data-disabled":p||void 0,"data-weekend":!p&&!m&&f||void 0,"data-outside":!p&&m||void 0,"data-selected":!p&&y||void 0,"data-in-range":S&&!p||void 0,"data-first-in-range":k&&!p||void 0,"data-last-in-range":w&&!p||void 0,"data-static":A||void 0,unstyled:l,...E,children:(b==null?void 0:b(d))||ee(d).date()})});ud.classes=Wf;ud.displayName="@mantine/dates/Day";function aP({locale:e,format:t="dd",firstDayOfWeek:r=1}){const i=ee().day(r),s=[];for(let a=0;a<7;a+=1)typeof t=="string"?s.push(ee(i).add(a,"days").locale(e).format(t)):s.push(t(ee(i).add(a,"days").toDate()));return s}var Yf={weekday:"m_18a3eca"};const oP={},lP=Rs((e,{size:t})=>({weekdaysRow:{"--wr-fz":Qa(t),"--wr-spacing":ly(t)}})),hd=Qe((e,t)=>
428{const r=Ve("WeekdaysRow",oP,e),{classNames:i,className:s,style:a,styles:o,unstyled:l,vars:c,locale:d,firstDayOfWeek:p,weekdayFormat:h,cellComponent:f="th",__staticSelector:m,withWeekNumbers:y,...b}=r,S=_n({name:m||"WeekdaysRow",classes:Yf,props:r,className:s,style:a,classNames:i,styles:o,unstyled:l,vars:c,varsResolver:lP,rootSelector:"weekdaysRow"}),k=Dt(),w=aP({locale:k.getLocale(d),format:h,firstDayOfWeek:k.getFirstDayOfWeek(p)}).map((T,A)=>n(f,{...S("weekday"),children:T},A));return u(G,{component:"tr",ref:t,...S("weekdaysRow"),...b,children:[y&&n(f,{...S("weekday"),children:"#"}),w]})});hd.classes=Yf;hd.displayName="@mantine/dates/WeekdaysRow";function cP(e,t=1){let r=ee(e);const i=t===0?6:t-1;for(;r.day()!==i;)r=r.add(1,"day");return r.toDate()}function dP(e,t=1){let r=ee(e);for(;r.day()!==t;)r=r.subtract(1,"day");return r.toDate()}function uP({month:e,firstDayOfWeek:t=1,consistentWeeks:r}){const i=ee(e).subtract(ee(e).date()-1,"day"),s=ee(i).startOf("day"),a=s.toDate(),o=s.add(+s.daysInMonth()-1,"day").toDate(),l=cP(o,t),c=dP(a,t),d=[];for(;c<=l;){const p=[];for(let h=0;h<7;h+=1)p.push(new Date(c)),c.setDate(c.getDate()+1);d.push(p)}if(r&&d.length<6){const p=d[d.length-1],h=p[p.length-1],f=new Date(h);for(f.setDate(f.getDate()+1);d.length<6;){const m=[];for(let y=0;y<7;y+=1)m.push(new Date(f)),f.setDate(f.getDate()+1);d.push(m)}}return d}function Qf(e,t){return ee(e).format("YYYY-MM")===ee(t).format("YYYY-MM")}function Vf(e,t){return t instanceof Date?ee(e).isAfter(ee(t).subtract(1,"day"),"day"):!0}function Kf(e,t){return t instanceof Date?ee(e).isBefore(ee(t).add(1,"day"),"day"):!0}function hP(e,t,r,i,s,a,o){const l=e.flat().filter(p=>{var h;return Kf(p,r)&&Vf(p,t)&&!(s!=null&&s(p))&&!((h=i==null?void 0:i(p))!=null&&h.disabled)&&(!a||Qf(p,o))}),c=l.find(p=>{var h;return(h=i==null?void 0:i(p))==null?void 0:h.selected});if(c)return c;const d=l.find(p=>ee().isSame(p,"date"));return d||l[0]}var ya={exports:{}},pP=ya.exports,ph;function mP(){return ph||(ph=1,function(e,t){(function(r,i){e.exports=i()})(pP,function(){var r="day";return function(i,s,a){var o=function(d){return d.add(4-d.isoWeekday(),r)},l=s.prototype;l.isoWeekYear=function(){return o(this).year()},l.isoWeek=function(d){if(!this.$utils().u(d))return this.add(7*(d-this.isoWeek()),r);var p,h,f,m,y=o(this),b=(p=this.isoWeekYear(),h=this.$u,f=(h?a.utc:a)().year(p).startOf("year"),m=4-f.isoWeekday(),f.isoWeekday()>4&&(m+=7),f.add(m,r));return y.diff(b,"week")+1},l.isoWeekday=function(d){return this.$utils().u(d)?this.day()||7:this.day(this.day()%7?d:d-7)};var c=l.startOf;l.startOf=function(d,p){var h=this.$utils(),f=!!h.u(p)||p;return h.p(d)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):c.bind(this)(d,p)}}})}(ya)),ya.exports}var fP=mP();const gP=$s(fP);ee.extend(gP);function yP(e){const t=e.find(r=>ee(r).day()===1);return ee(t).isoWeek()}var Gf={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const bP={withCellSpacing:!0},_P=Rs((e,{size:t})=>({weekNumber:{"--wn-fz":Qa(t),"--wn-size":Ya(t,"wn-size")}})),Ao=Qe((e,t)=>{const r=Ve("Month",bP,e),{classNames:i,className:s,style:a,styles:o,unstyled:l,vars:c,__staticSelector:d,locale:p,firstDayOfWeek:h,weekdayFormat:f,month:m,weekendDays:y,getDayProps:b,excludeDate:S,minDate:k,maxDate:w,renderDay:T,hideOutsideDates:A,hideWeekdays:R,getDayAriaLabel:E,static:z,__getDayRef:N,__onDayKeyDown:C,__onDayClick:M,__onDayMouseEnter:P,__preventFocus:I,__stopPropagation:L,withCellSpacing:U,size:q,highlightToday:B,withWeekNumbers:Y,...Q}=r,W=_n({name:d||"Month",classes:Gf,props:r,className:s,style:a,classNames:i,styles:o,unstyled:l,vars:c,varsResolver:_P,rootSelector:"month"}),F=Dt(),H=uP({month:m,firstDayOfWeek:F.getFirstDayOfWeek(h),consistentWeeks:F.consistentWeeks}),K=hP(H,k,w,b,S,A,m),{resolvedClassNames:X,resolvedStyles:Z}=Oi({classNames:i,styles:o,props:r}),le=H.map((de,ye)=>{const ge=de.map((be,Me)=>{const ne=!Qf(be,m),Re=(E==null?void 0:E(be))||ee(be).locale(p||F.locale).format("D MMMM YYYY"),te=b==null?void 0:b(be),$e=ee(be).isSame(K,"date");return n("td",{...W("monthCell"),"data-with-spacing":U||void 0,children:n(ud,{__staticSelector:d||"Month",classNames:X,styles:Z,unstyled:l,"data-mantine-stop-propagation":L||void 0,highlightToday:B,renderDay:T,date:be,size:q,weekend:F.getWeekendDays(y).includes(be.getDay()),outside:ne,hidden:A?ne:!1,"aria-label":Re,static:z,disabled:(S==null?void 0:S(be))||!Kf(be,w)||!Vf(be,k),ref:Ue=>N==null?void 0:N(ye,Me,Ue),...te,onKeyDown:Ue=>{var ot;(ot=te==null?void 0:te.onKeyDown)==null||ot.call(te,Ue),C==null||C(Ue,{rowIndex:ye,cellIndex:Me,date:be})},onMouseEnter:Ue=>{var ot;(ot=te==null?void 0:te.onMouseEnter)==null||ot.call(te,Ue),P==null||P(Ue,be)},onClick:Ue=>{var ot;(ot=te==null?void 0:te.onClick)==null||ot.call(te,Ue),M==null||M(Ue,be)},onMouseDown:Ue=>{var ot;(ot=te==null?void 0:te.onMouseDown)==null||ot.call(te,Ue),I&&Ue.preventDefault()},tabIndex:I||!$e?-1:0})},be.toString())});return u("tr",{...W("monthRow"),children:[Y&&n("td",{...W("weekNumber"),children:yP(de)}),ge]},ye)});return u(G,{component:"table",...W("month"),size:q,ref:t,...Q,children:[!R&&n("thead",{...W("monthThead"),children:n(hd,{__staticSelector:d||"Month",locale:p,firstDayOfWeek:h,weekdayFormat:f,size:q,classNames:X,styles:Z,unstyled:l,withWeekNumbers:Y})}),n("tbody",{...W("monthTbody"),children:le})]})});Ao.classes=Gf;Ao.displayName="@mantine/dates/Month";var Xf={pickerControl:"m_dc6a3c71"};const vP={},wP=Rs((e,{size:t})=>({pickerControl:{"--dpc-fz":Qa(t),"--dpc-size":Ya(t,"dpc-size")}})),Do=Qe((e,t)=>
428{const r=Ve("PickerControl",vP,e),{classNames:i,className:s,style:a,styles:o,unstyled:l,vars:c,firstInRange:d,lastInRange:p,inRange:h,__staticSelector:f,selected:m,disabled:y,...b}=r,S=_n({name:f||"PickerControl",classes:Xf,props:r,className:s,style:a,classNames:i,styles:o,unstyled:l,vars:c,varsResolver:wP,rootSelector:"pickerControl"});return n(Mt,{...S("pickerControl"),ref:t,unstyled:l,"data-picker-control":!0,"data-selected":m&&!y||void 0,"data-disabled":y||void 0,"data-in-range":h&&!y&&!m||void 0,"data-first-in-range":d&&!y||void 0,"data-last-in-range":p&&!y||void 0,disabled:y,...b})});Do.classes=Xf;Do.displayName="@mantine/dates/PickerControl";function Jf(e,t,r){return!t&&!r?!1:!!(t&&ee(e).isBefore(t,"year")||r&&ee(e).isAfter(r,"year"))}function SP(e,t,r,i){const s=e.flat().filter(l=>{var c;return!Jf(l,t,r)&&!((c=i==null?void 0:i(l))!=null&&c.disabled)}),a=s.find(l=>{var c;return(c=i==null?void 0:i(l))==null?void 0:c.selected});if(a)return a;const o=s.find(l=>ee().isSame(l,"year"));return o||s[0]}function Zf(e){const t=e.getFullYear(),r=t-t%10;let i=0;const s=[[],[],[],[]];for(let a=0;a<4;a+=1){const o=a===3?1:3;for(let l=0;l<o;l+=1)s[a].push(new Date(r+i,0)),i+=1}return s}var eg={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const CP={yearsListFormat:"YYYY",withCellSpacing:!0},Io=Qe((e,t)=>{const r=Ve("YearsList",CP,e),{classNames:i,className:s,style:a,styles:o,unstyled:l,vars:c,decade:d,yearsListFormat:p,locale:h,minDate:f,maxDate:m,getYearControlProps:y,__staticSelector:b,__getControlRef:S,__onControlKeyDown:k,__onControlClick:w,__onControlMouseEnter:T,__preventFocus:A,__stopPropagation:R,withCellSpacing:E,size:z,...N}=r,C=_n({name:b||"YearsList",classes:eg,props:r,className:s,style:a,classNames:i,styles:o,unstyled:l,vars:c,rootSelector:"yearsList"}),M=Dt(),P=Zf(d),I=SP(P,f,m,y),L=P.map((U,q)=>{const B=U.map((Y,Q)=>{const W=y==null?void 0:y(Y),F=ee(Y).isSame(I,"year");return n("td",{...C("yearsListCell"),"data-with-spacing":E||void 0,children:n(Do,{...C("yearsListControl"),size:z,unstyled:l,"data-mantine-stop-propagation":R||void 0,disabled:Jf(Y,f,m),ref:H=>S==null?void 0:S(q,Q,H),...W,onKeyDown:H=>{var K;(K=W==null?void 0:W.onKeyDown)==null||K.call(W,H),k==null||k(H,{rowIndex:q,cellIndex:Q,date:Y})},onClick:H=>{var K;(K=W==null?void 0:W.onClick)==null||K.call(W,H),w==null||w(H,Y)},onMouseEnter:H=>{var K;(K=W==null?void 0:W.onMouseEnter)==null||K.call(W,H),T==null||T(H,Y)},onMouseDown:H=>{var K;(K=W==null?void 0:W.onMouseDown)==null||K.call(W,H),A&&H.preventDefault()},tabIndex:A||!F?-1:0,children:ee(Y).locale(M.getLocale(h)).format(p)})},Q)});return n("tr",{...C("yearsListRow"),children:B},q)});return n(G,{component:"table",ref:t,size:z,...C("yearsList"),...N,children:n("tbody",{children:L})})});Io.classes=eg;Io.displayName="@mantine/dates/YearsList";function tg(e,t,r){return!t&&!r?!1:!!(t&&ee(e).isBefore(t,"month")||r&&ee(e).isAfter(r,"month"))}function TP(e,t,r,i){const s=e.flat().filter(l=>{var c;return!tg(l,t,r)&&!((c=i==null?void 0:i(l))!=null&&c.disabled)}),a=s.find(l=>{var c;return(c=i==null?void 0:i(l))==null?void 0:c.selected});if(a)return a;const o=s.find(l=>ee().isSame(l,"month"));return o||s[0]}function xP(e){const t=ee(e).startOf("year").toDate(),r=[[],[],[],[]];let i=0;for(let s=0;s<4;s+=1)for(let a=0;a<3;a+=1)r[s].push(ee(t).add(i,"months").toDate()),i+=1;return r}var ng={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const kP={monthsListFormat:"MMM",withCellSpacing:!0},$o=Qe((e,t)=>{const r=Ve("MonthsList",kP,e),{classNames:i,className:s,style:a,styles:o,unstyled:l,vars:c,__staticSelector:d,year:p,monthsListFormat:h,locale:f,minDate:m,maxDate:y,getMonthControlProps:b,__getControlRef:S,__onControlKeyDown:k,__onControlClick:w,__onControlMouseEnter:T,__preventFocus:A,__stopPropagation:R,withCellSpacing:E,size:z,...N}=r,C=_n({name:d||"MonthsList",classes:ng,props:r,className:s,style:a,classNames:i,styles:o,unstyled:l,vars:c,rootSelector:"monthsList"}),M=Dt(),P=xP(p),I=TP(P,m,y,b),L=P.map((U,q)=>{const B=U.map((Y,Q)=>{const W=b==null?void 0:b(Y),F=ee(Y).isSame(I,"month");return n("td",{...C("monthsListCell"),"data-with-spacing":E||void 0,children:n(Do,{...C("monthsListControl"),size:z,unstyled:l,__staticSelector:d||"MonthsList","data-mantine-stop-propagation":R||void 0,disabled:tg(Y,m,y),ref:H=>S==null?void 0:S(q,Q,H),...W,onKeyDown:H=>{var K;(K=W==null?void 0:W.onKeyDown)==null||K.call(W,H),k==null||k(H,{rowIndex:q,cellIndex:Q,date:Y})},onClick:H=>{var K;(K=W==null?void 0:W.onClick)==null||K.call(W,H),w==null||w(H,Y)},onMouseEnter:H=>{var K;(K=W==null?void 0:W.onMouseEnter)==null||K.call(W,H),T==null||T(H,Y)},onMouseDown:H=>{var K;(K=W==null?void 0:W.onMouseDown)==null||K.call(W,H),A&&H.preventDefault()},tabIndex:A||!F?-1:0,children:ee(Y).locale(M.getLocale(f)).format(h)})},Q)});
428return n("tr",{...C("monthsListRow"),children:B},q)});return n(G,{component:"table",ref:t,size:z,...C("monthsList"),...N,children:n("tbody",{children:L})})});$o.classes=ng;$o.displayName="@mantine/dates/MonthsList";var rg={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const EP={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0},PP=Rs((e,{size:t})=>({calendarHeader:{"--dch-control-size":Ya(t,"dch-control-size"),"--dch-fz":Qa(t)}})),hr=Qe((e,t)=>{const r=Ve("CalendarHeader",EP,e),{classNames:i,className:s,style:a,styles:o,unstyled:l,vars:c,nextIcon:d,previousIcon:p,nextLabel:h,previousLabel:f,onNext:m,onPrevious:y,onLevelClick:b,label:S,nextDisabled:k,previousDisabled:w,hasNextLevel:T,levelControlAriaLabel:A,withNext:R,withPrevious:E,__staticSelector:z,__preventFocus:N,__stopPropagation:C,...M}=r,P=_n({name:z||"CalendarHeader",classes:rg,props:r,className:s,style:a,classNames:i,styles:o,unstyled:l,vars:c,varsResolver:PP,rootSelector:"calendarHeader"}),I=N?L=>L.preventDefault():void 0;return u(G,{...P("calendarHeader"),ref:t,...M,children:[E&&n(Mt,{...P("calendarHeaderControl"),"data-direction":"previous","aria-label":f,onClick:y,unstyled:l,onMouseDown:I,disabled:w,"data-disabled":w||void 0,tabIndex:N||w?-1:0,"data-mantine-stop-propagation":C||void 0,children:p||n(Cd,{...P("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})}),n(Mt,{component:T?"button":"div",...P("calendarHeaderLevel"),onClick:T?b:void 0,unstyled:l,onMouseDown:T?I:void 0,disabled:!T,"data-static":!T||void 0,"aria-label":A,tabIndex:N||!T?-1:0,"data-mantine-stop-propagation":C||void 0,children:S}),R&&n(Mt,{...P("calendarHeaderControl"),"data-direction":"next","aria-label":h,onClick:m,unstyled:l,onMouseDown:I,disabled:k,"data-disabled":k||void 0,tabIndex:N||k?-1:0,"data-mantine-stop-propagation":C||void 0,children:d||n(Cd,{...P("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})})]})});hr.classes=rg;hr.displayName="@mantine/dates/CalendarHeader";function MP(e){const t=Zf(e);return[t[0][0],t[3][0]]}const AP={decadeLabelFormat:"YYYY"},Ro=Qe((e,t)=>{const r=Ve("DecadeLevel",AP,e),{decade:i,locale:s,minDate:a,maxDate:o,yearsListFormat:l,getYearControlProps:c,__getControlRef:d,__onControlKeyDown:p,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:m,__preventFocus:y,nextIcon:b,previousIcon:S,nextLabel:k,previousLabel:w,onNext:T,onPrevious:A,nextDisabled:R,previousDisabled:E,levelControlAriaLabel:z,withNext:N,withPrevious:C,decadeLabelFormat:M,classNames:P,styles:I,unstyled:L,__staticSelector:U,__stopPropagation:q,size:B,...Y}=r,Q=Dt(),[W,F]=MP(i),H={__staticSelector:U||"DecadeLevel",classNames:P,styles:I,unstyled:L,size:B},K=typeof R=="boolean"?R:o?!ee(F).endOf("year").isBefore(o):!1,X=typeof E=="boolean"?E:a?!ee(W).startOf("year").isAfter(a):!1,Z=(le,de)=>ee(le).locale(s||Q.locale).format(de);return u(G,{"data-decade-level":!0,size:B,ref:t,...Y,children:[n(hr,{label:typeof M=="function"?M(W,F):`${Z(W,M)} – ${Z(F,M)}`,__preventFocus:y,__stopPropagation:q,nextIcon:b,previousIcon:S,nextLabel:k,previousLabel:w,onNext:T,onPrevious:A,nextDisabled:K,previousDisabled:X,hasNextLevel:!1,levelControlAriaLabel:z,withNext:N,withPrevious:C,...H}),n(Io,{decade:i,locale:s,minDate:a,maxDate:o,yearsListFormat:l,getYearControlProps:c,__getControlRef:d,__onControlKeyDown:p,__onControlClick:h,__onControlMouseEnter:f,__preventFocus:y,__stopPropagation:q,withCellSpacing:m,...H})]})});Ro.classes={...Io.classes,...hr.classes};Ro.displayName="@mantine/dates/DecadeLevel";const DP={yearLabelFormat:"YYYY"},zo=Qe((e,t)=>{const r=Ve("YearLevel",DP,e),{year:i,locale:s,minDate:a,maxDate:o,monthsListFormat:l,getMonthControlProps:c,__getControlRef:d,__onControlKeyDown:p,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:m,__preventFocus:y,nextIcon:b,previousIcon:S,nextLabel:k,previousLabel:w,onNext:T,onPrevious:A,onLevelClick:R,nextDisabled:E,previousDisabled:z,hasNextLevel:N,levelControlAriaLabel:C,withNext:M,withPrevious:P,yearLabelFormat:I,__staticSelector:L,__stopPropagation:U,size:q,classNames:B,styles:Y,unstyled:Q,...W}=r,F=Dt(),H={__staticSelector:L||"YearLevel",classNames:B,styles:Y,unstyled:Q,size:q},K=typeof E=="boolean"?E:o?!ee(i).endOf("year").isBefore(o):!1,X=typeof z=="boolean"?z:a?!ee(i).startOf("year").isAfter(a):!1;return u(G,{"data-year-level":!0,size:q,ref:t,...W,children:[n(hr,{label:typeof I=="function"?I(i):ee(i).locale(s||F.locale).format(I),__preventFocus:y,__stopPropagation:U,nextIcon:b,previousIcon:S,nextLabel:k,previousLabel:w,onNext:T,onPrevious:A,onLevelClick:R,nextDisabled:K,previousDisabled:X,hasNextLevel:N,levelControlAriaLabel:C,withNext:M,withPrevious:P,...H}),n($o,{year:i,locale:s,minDate:a,maxDate:o,monthsListFormat:l,getMonthControlProps:c,__getControlRef:d,__onControlKeyDown:p,__onControlClick:h,__onControlMouseEnter:f,__preventFocus:y,__stopPropagation:U,withCellSpacing:m,...H})]})});zo.classes={...hr.classes,...$o.classes};zo.displayName="@mantine/dates/YearLevel";const IP={monthLabelFormat:"MMMM YYYY"},No=Qe((e,t)=>
428{const r=Ve("MonthLevel",IP,e),{month:i,locale:s,firstDayOfWeek:a,weekdayFormat:o,weekendDays:l,getDayProps:c,excludeDate:d,minDate:p,maxDate:h,renderDay:f,hideOutsideDates:m,hideWeekdays:y,getDayAriaLabel:b,__getDayRef:S,__onDayKeyDown:k,__onDayClick:w,__onDayMouseEnter:T,withCellSpacing:A,highlightToday:R,withWeekNumbers:E,__preventFocus:z,__stopPropagation:N,nextIcon:C,previousIcon:M,nextLabel:P,previousLabel:I,onNext:L,onPrevious:U,onLevelClick:q,nextDisabled:B,previousDisabled:Y,hasNextLevel:Q,levelControlAriaLabel:W,withNext:F,withPrevious:H,monthLabelFormat:K,classNames:X,styles:Z,unstyled:le,__staticSelector:de,size:ye,static:ge,...be}=r,Me=Dt(),ne={__staticSelector:de||"MonthLevel",classNames:X,styles:Z,unstyled:le,size:ye},Re=typeof B=="boolean"?B:h?!ee(i).endOf("month").isBefore(h):!1,te=typeof Y=="boolean"?Y:p?!ee(i).startOf("month").isAfter(p):!1;return u(G,{"data-month-level":!0,size:ye,ref:t,...be,children:[n(hr,{label:typeof K=="function"?K(i):ee(i).locale(s||Me.locale).format(K),__preventFocus:z,__stopPropagation:N,nextIcon:C,previousIcon:M,nextLabel:P,previousLabel:I,onNext:L,onPrevious:U,onLevelClick:q,nextDisabled:Re,previousDisabled:te,hasNextLevel:Q,levelControlAriaLabel:W,withNext:F,withPrevious:H,...ne}),n(Ao,{month:i,locale:s,firstDayOfWeek:a,weekdayFormat:o,weekendDays:l,getDayProps:c,excludeDate:d,minDate:p,maxDate:h,renderDay:f,hideOutsideDates:m,hideWeekdays:y,getDayAriaLabel:b,__getDayRef:S,__onDayKeyDown:k,__onDayClick:w,__onDayMouseEnter:T,__preventFocus:z,__stopPropagation:N,static:ge,withCellSpacing:A,highlightToday:R,withWeekNumbers:E,...ne})]})});No.classes={...Ao.classes,...hr.classes};No.displayName="@mantine/dates/MonthLevel";var ig={levelsGroup:"m_30b26e33"};const $P={},pr=Qe((e,t)=>{const r=Ve("LevelsGroup",$P,e),{classNames:i,className:s,style:a,styles:o,unstyled:l,vars:c,__staticSelector:d,...p}=r,h=_n({name:d||"LevelsGroup",classes:ig,props:r,className:s,style:a,classNames:i,styles:o,unstyled:l,vars:c,rootSelector:"levelsGroup"});return n(G,{ref:t,...h("levelsGroup"),...p})});pr.classes=ig;pr.displayName="@mantine/dates/LevelsGroup";const RP={numberOfColumns:1},Lo=Qe((e,t)=>{const r=Ve("DecadeLevelGroup",RP,e),{decade:i,locale:s,minDate:a,maxDate:o,yearsListFormat:l,getYearControlProps:c,__onControlClick:d,__onControlMouseEnter:p,withCellSpacing:h,__preventFocus:f,nextIcon:m,previousIcon:y,nextLabel:b,previousLabel:S,onNext:k,onPrevious:w,nextDisabled:T,previousDisabled:A,classNames:R,styles:E,unstyled:z,__staticSelector:N,__stopPropagation:C,numberOfColumns:M,levelControlAriaLabel:P,decadeLabelFormat:I,size:L,vars:U,...q}=r,B=_.useRef([]),Y=Array(M).fill(0).map((Q,W)=>{const F=ee(i).add(W*10,"years").toDate();return n(Ro,{size:L,yearsListFormat:l,decade:F,withNext:W===M-1,withPrevious:W===0,decadeLabelFormat:I,__onControlClick:d,__onControlMouseEnter:p,__onControlKeyDown:(H,K)=>cd({levelIndex:W,rowIndex:K.rowIndex,cellIndex:K.cellIndex,event:H,controlsRef:B}),__getControlRef:(H,K,X)=>{Array.isArray(B.current[W])||(B.current[W]=[]),Array.isArray(B.current[W][H])||(B.current[W][H]=[]),B.current[W][H][K]=X},levelControlAriaLabel:typeof P=="function"?P(F):P,locale:s,minDate:a,maxDate:o,__preventFocus:f,__stopPropagation:C,nextIcon:m,previousIcon:y,nextLabel:b,previousLabel:S,onNext:k,onPrevious:w,nextDisabled:T,previousDisabled:A,getYearControlProps:c,__staticSelector:N||"DecadeLevelGroup",classNames:R,styles:E,unstyled:z,withCellSpacing:h},W)});return n(pr,{classNames:R,styles:E,__staticSelector:N||"DecadeLevelGroup",ref:t,size:L,unstyled:z,...q,children:Y})});Lo.classes={...pr.classes,...Ro.classes};Lo.displayName="@mantine/dates/DecadeLevelGroup";const zP={numberOfColumns:1},Oo=Qe((e,t)=>{const r=Ve("YearLevelGroup",zP,e),{year:i,locale:s,minDate:a,maxDate:o,monthsListFormat:l,getMonthControlProps:c,__onControlClick:d,__onControlMouseEnter:p,withCellSpacing:h,__preventFocus:f,nextIcon:m,previousIcon:y,nextLabel:b,previousLabel:S,onNext:k,onPrevious:w,onLevelClick:T,nextDisabled:A,previousDisabled:R,hasNextLevel:E,classNames:z,styles:N,unstyled:C,__staticSelector:M,__stopPropagation:P,numberOfColumns:I,levelControlAriaLabel:L,yearLabelFormat:U,size:q,vars:B,...Y}=r,Q=_.useRef([]),W=Array(I).fill(0).map((F,H)=>{const K=ee(i).add(H,"years").toDate();return n(zo,{size:q,monthsListFormat:l,year:K,withNext:H===I-1,withPrevious:H===0,yearLabelFormat:U,__stopPropagation:P,__onControlClick:d,__onControlMouseEnter:p,__onControlKeyDown:(X,Z)=>cd({levelIndex:H,rowIndex:Z.rowIndex,cellIndex:Z.cellIndex,event:X,controlsRef:Q}),__getControlRef:(X,Z,le)=>{Array.isArray(Q.current[H])||(Q.current[H]=[]),Array.isArray(Q.current[H][X])||(Q.current[H][X]=[]),Q.current[H][X][Z]=le},levelControlAriaLabel:typeof L=="function"?L(K):L,locale:s,minDate:a,maxDate:o,__preventFocus:f,nextIcon:m,previousIcon:y,nextLabel:b,previousLabel:S,onNext:k,onPrevious:w,onLevelClick:T,nextDisabled:A,previousDisabled:R,hasNextLevel:E,getMonthControlProps:c,classNames:z,styles:N,unstyled:C,__staticSelector:M||"YearLevelGroup",withCellSpacing:h},H)});return n(pr,{classNames:z,styles:N,__staticSelector:M||"YearLevelGroup",ref:t,size:q,unstyled:C,...Y,children:W})});Oo.classes={...zo.classes,...pr.classes};Oo.displayName="@mantine/dates/YearLevelGroup";const NP={numberOfColumns:1},Fo=Qe((e,t)=>
428{const r=Ve("MonthLevelGroup",NP,e),{month:i,locale:s,firstDayOfWeek:a,weekdayFormat:o,weekendDays:l,getDayProps:c,excludeDate:d,minDate:p,maxDate:h,renderDay:f,hideOutsideDates:m,hideWeekdays:y,getDayAriaLabel:b,__onDayClick:S,__onDayMouseEnter:k,withCellSpacing:w,highlightToday:T,withWeekNumbers:A,__preventFocus:R,nextIcon:E,previousIcon:z,nextLabel:N,previousLabel:C,onNext:M,onPrevious:P,onLevelClick:I,nextDisabled:L,previousDisabled:U,hasNextLevel:q,classNames:B,styles:Y,unstyled:Q,numberOfColumns:W,levelControlAriaLabel:F,monthLabelFormat:H,__staticSelector:K,__stopPropagation:X,size:Z,static:le,vars:de,...ye}=r,ge=_.useRef([]),be=Array(W).fill(0).map((Me,ne)=>{const Re=ee(i).add(ne,"months").toDate();return n(No,{month:Re,withNext:ne===W-1,withPrevious:ne===0,monthLabelFormat:H,__stopPropagation:X,__onDayClick:S,__onDayMouseEnter:k,__onDayKeyDown:(te,$e)=>cd({levelIndex:ne,rowIndex:$e.rowIndex,cellIndex:$e.cellIndex,event:te,controlsRef:ge}),__getDayRef:(te,$e,Ue)=>{Array.isArray(ge.current[ne])||(ge.current[ne]=[]),Array.isArray(ge.current[ne][te])||(ge.current[ne][te]=[]),ge.current[ne][te][$e]=Ue},levelControlAriaLabel:typeof F=="function"?F(Re):F,locale:s,firstDayOfWeek:a,weekdayFormat:o,weekendDays:l,getDayProps:c,excludeDate:d,minDate:p,maxDate:h,renderDay:f,hideOutsideDates:m,hideWeekdays:y,getDayAriaLabel:b,__preventFocus:R,nextIcon:E,previousIcon:z,nextLabel:N,previousLabel:C,onNext:M,onPrevious:P,onLevelClick:I,nextDisabled:L,previousDisabled:U,hasNextLevel:q,classNames:B,styles:Y,unstyled:Q,__staticSelector:K||"MonthLevelGroup",size:Z,static:le,withCellSpacing:w,highlightToday:T,withWeekNumbers:A},ne)});return n(pr,{classNames:B,styles:Y,__staticSelector:K||"MonthLevelGroup",ref:t,size:Z,...ye,children:be})});Fo.classes={...pr.classes,...No.classes};Fo.displayName="@mantine/dates/MonthLevelGroup";var sg={input:"m_6fa5e2aa"};const LP={},Gi=Qe((e,t)=>{const{inputProps:r,wrapperProps:i,placeholder:s,classNames:a,styles:o,unstyled:l,popoverProps:c,modalProps:d,dropdownType:p,children:h,formattedValue:f,dropdownHandlers:m,dropdownOpened:y,onClick:b,clearable:S,onClear:k,clearButtonProps:w,rightSection:T,shouldClear:A,readOnly:R,disabled:E,value:z,name:N,form:C,type:M,...P}=cy("PickerInputBase",LP,e),I=n(Zr.ClearButton,{onClick:k,unstyled:l,...w}),L=()=>{M==="range"&&Array.isArray(z)&&z[0]&&!z[1]&&k(),m.close()};return u(ke,{children:[p==="modal"&&!R&&n(Oe,{opened:y,onClose:L,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:l,...d,children:h}),n(Zr.Wrapper,{...i,children:u(ni,{position:"bottom-start",opened:y,trapFocus:!0,returnFocus:!1,unstyled:l,...c,disabled:(c==null?void 0:c.disabled)||p==="modal"||R,onChange:U=>{var q;U||((q=c==null?void 0:c.onClose)==null||q.call(c),L())},children:[n(ni.Target,{children:n(Zr,{"data-dates-input":!0,"data-read-only":R||void 0,disabled:E,component:"button",type:"button",multiline:!0,onClick:U=>{b==null||b(U),m.toggle()},__clearSection:I,__clearable:S&&A&&!R&&!E,rightSection:T,...r,ref:t,classNames:{...a,input:wc(sg.input,a==null?void 0:a.input)},...P,children:f||n(Zr.Placeholder,{error:r.error,unstyled:l,className:a==null?void 0:a.placeholder,style:o==null?void 0:o.placeholder,children:s})})}),n(ni.Dropdown,{"data-dates-dropdown":!0,children:h})]})}),n(Hf,{value:z,name:N,form:C,type:M})]})});Gi.classes=sg;Gi.displayName="@mantine/dates/PickerInputBase";const mh=e=>e==="range"?[null,null]:e==="multiple"?[]:null;function Uo({type:e,value:t,defaultValue:r,onChange:i,applyTimezone:s=!0}){const a=_.useRef(e),o=Dt(),[l,c,d]=vc({value:Zt("add",t,o.getTimezone(),!s),defaultValue:Zt("add",r,o.getTimezone(),!s),finalValue:mh(e),onChange:h=>{i==null||i(Zt("remove",h,o.getTimezone(),!s))}});let p=l;return a.current!==e&&(a.current=e,t===void 0&&(p=r!==void 0?r:mh(e),c(p))),[p,c,d]}function vl(e,t){return e?e==="month"?0:e==="year"?1:2:t||0}function OP(e){return e===0?"month":e===1?"year":"decade"}function rs(e,t,r){return OP(dp(vl(e,0),vl(t,0),vl(r,2)))}const FP={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},Bo=Qe((e,t)=>{const r=Ve("Calendar",FP,e),{vars:i,maxLevel:s,minLevel:a,defaultLevel:o,level:l,onLevelChange:c,date:d,defaultDate:p,onDateChange:h,numberOfColumns:f,columnsToScroll:m,ariaLabels:y,nextLabel:b,previousLabel:S,onYearSelect:k,onMonthSelect:w,onYearMouseEnter:T,onMonthMouseEnter:A,__updateDateOnYearSelect:R,__updateDateOnMonthSelect:E,firstDayOfWeek:z,weekdayFormat:N,weekendDays:C,getDayProps:M,excludeDate:P,renderDay:I,hideOutsideDates:L,hideWeekdays:U,getDayAriaLabel:q,monthLabelFormat:B,nextIcon:Y,previousIcon:Q,__onDayCl
428ick:W,__onDayMouseEnter:F,withCellSpacing:H,highlightToday:K,withWeekNumbers:X,monthsListFormat:Z,getMonthControlProps:le,yearLabelFormat:de,yearsListFormat:ye,getYearControlProps:ge,decadeLabelFormat:be,classNames:Me,styles:ne,unstyled:Re,minDate:te,maxDate:$e,locale:Ue,__staticSelector:ot,size:mr,__preventFocus:Sn,__stopPropagation:Cn,onNextDecade:qo,onPreviousDecade:jo,onNextYear:Ho,onPreviousYear:Wo,onNextMonth:Yo,onPreviousMonth:Qo,static:kg,__timezoneApplied:Eg,...Pg}=r,{resolvedClassNames:Mg,resolvedStyles:Ag}=Oi({classNames:Me,styles:ne,props:r}),[Vo,Ws]=vc({value:l?rs(l,a,s):void 0,defaultValue:o?rs(o,a,s):void 0,finalValue:rs(void 0,a,s),onChange:c}),[Dg,jn]=Uo({type:"default",value:d,defaultValue:p,onChange:h,applyTimezone:!Eg}),Ko={__staticSelector:ot||"Calendar",styles:Ag,classNames:Mg,unstyled:Re,size:mr},Ig=Dt(),Vr=m||f||1,wd=new Date,$g=te&&te>wd?te:wd,Tn=Dg||Zt("add",$g,Ig.getTimezone()),Rg=()=>{const dt=ee(Tn).add(Vr,"month").toDate();Yo==null||Yo(dt),jn(dt)},zg=()=>{const dt=ee(Tn).subtract(Vr,"month").toDate();Qo==null||Qo(dt),jn(dt)},Ng=()=>{const dt=ee(Tn).add(Vr,"year").toDate();Ho==null||Ho(dt),jn(dt)},Lg=()=>{const dt=ee(Tn).subtract(Vr,"year").toDate();Wo==null||Wo(dt),jn(dt)},Og=()=>{const dt=ee(Tn).add(10*Vr,"year").toDate();qo==null||qo(dt),jn(dt)},Fg=()=>{const dt=ee(Tn).subtract(10*Vr,"year").toDate();jo==null||jo(dt),jn(dt)};return u(G,{ref:t,size:mr,"data-calendar":!0,...Pg,children:[Vo==="month"&&n(Fo,{month:Tn,minDate:te,maxDate:$e,firstDayOfWeek:z,weekdayFormat:N,weekendDays:C,getDayProps:M,excludeDate:P,renderDay:I,hideOutsideDates:L,hideWeekdays:U,getDayAriaLabel:q,onNext:Rg,onPrevious:zg,hasNextLevel:s!=="month",onLevelClick:()=>Ws("year"),numberOfColumns:f,locale:Ue,levelControlAriaLabel:y==null?void 0:y.monthLevelControl,nextLabel:(y==null?void 0:y.nextMonth)??b,nextIcon:Y,previousLabel:(y==null?void 0:y.previousMonth)??S,previousIcon:Q,monthLabelFormat:B,__onDayClick:W,__onDayMouseEnter:F,__preventFocus:Sn,__stopPropagation:Cn,static:kg,withCellSpacing:H,highlightToday:K,withWeekNumbers:X,...Ko}),Vo==="year"&&n(Oo,{year:Tn,numberOfColumns:f,minDate:te,maxDate:$e,monthsListFormat:Z,getMonthControlProps:le,locale:Ue,onNext:Ng,onPrevious:Lg,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>Ws("decade"),levelControlAriaLabel:y==null?void 0:y.yearLevelControl,nextLabel:(y==null?void 0:y.nextYear)??b,nextIcon:Y,previousLabel:(y==null?void 0:y.previousYear)??S,previousIcon:Q,yearLabelFormat:de,__onControlMouseEnter:A,__onControlClick:(dt,Zi)=>{E&&jn(Zi),Ws(rs("month",a,s)),w==null||w(Zi)},__preventFocus:Sn,__stopPropagation:Cn,withCellSpacing:H,...Ko}),Vo==="decade"&&n(Lo,{decade:Tn,minDate:te,maxDate:$e,yearsListFormat:ye,getYearControlProps:ge,locale:Ue,onNext:Og,onPrevious:Fg,numberOfColumns:f,nextLabel:(y==null?void 0:y.nextDecade)??b,nextIcon:Y,previousLabel:(y==null?void 0:y.previousDecade)??S,previousIcon:Q,decadeLabelFormat:be,__onControlMouseEnter:T,__onControlClick:(dt,Zi)=>{R&&jn(Zi),Ws(rs("year",a,s)),k==null||k(Zi)},__preventFocus:Sn,__stopPropagation:Cn,withCellSpacing:H,...Ko})]})});Bo.classes={...Lo.classes,...Oo.classes,...Fo.classes};Bo.displayName="@mantine/dates/Calendar";function ag(e){const{maxLevel:t,minLevel:r,defaultLevel:i,level:s,onLevelChange:a,nextIcon:o,previousIcon:l,date:c,defaultDate:d,onDateChange:p,numberOfColumns:h,columnsToScroll:f,ariaLabels:m,nextLabel:y,previousLabel:b,onYearSelect:S,onMonthSelect:k,onYearMouseEnter:w,onMonthMouseEnter:T,onNextMonth:A,onPreviousMonth:R,onNextYear:E,onPreviousYear:z,onNextDecade:N,onPreviousDecade:C,withCellSpacing:M,highlightToday:P,__updateDateOnYearSelect:I,__updateDateOnMonthSelect:L,withWeekNumbers:U,firstDayOfWeek:q,weekdayFormat:B,weekendDays:Y,getDayProps:Q,excludeDate:W,renderDay:F,hideOutsideDates:H,hideWeekdays:K,getDayAriaLabel:X,monthLabelFormat:Z,monthsListFormat:le,getMonthControlProps:de,yearLabelFormat:ye,yearsListFormat:ge,getYearControlProps:be,decadeLabelFormat:Me,allowSingleDateInRange:ne,allowDeselect:Re,minDate:te,maxDate:$e,locale:Ue,...ot}=e;return{calendarProps:{maxLevel:t,minLevel:r,defaultLevel:i,level:s,onLevelChange:a,nextIcon:o,previousIcon:l,date:c,defaultDate:d,onDateChange:p,numberOfColumns:h,columnsToScroll:f,ariaLabels:m,nextLabel:y,previousLabel:b,onYearSelect:S,onMonthSelect:k,onYearMouseEnter:w,onMonthMouseEnter:T,onNextMonth:A,onPreviousMonth:R,onNextYear:E,onPreviousYear:z,onNextDecade:N,onPreviousDecade:C,withCellSpacing:M,highlightToday:P,__updateDateOnYearSelect:I,__updateDateOnMonthSelect:L,withWeekNumbers:U,firstDayOfWeek:q,weekdayFormat:B,weekendDays:Y,getDayProps:Q,excludeDate:W,renderDay:F,hideOutsideDates:H,hideWeekdays:K,getDayAriaLabel:X,monthLabelFormat:Z,monthsListFormat:le,getMonthControlProps:de,yearLabelFormat:ye,yearsListFormat:ge,getYearControlProps:be,decadeLabelFormat:Me,allowSingleDateInRange:ne,allowDeselect:Re,minDate:te,maxDate:$e,locale:Ue},others:ot}}function fh(e,t){const r=[...t].sort((i,s)=>i.getTime()-s.getTime());return ee(r[0]).startOf("day").subtract(1,"ms").isBefore(e)&&ee(r[1]).endOf("day").add(1,"ms").isAfter(e)}function UP({type:e,level:t,value:r,defaultValue:i,onChange:s,allowSingleDateInRange:a,allowDeselect:o,onMouseLeave:l,applyTimezone:c=!0}){const[d,p]=Uo({type:e,value:r,defaultValue:i,onChange:s,applyTimezone:c}),[h,f]=_.useState(e==="range"&&d[0]&&!d[1]?d[0]:null),[m,y]=_.useState(null),b=E=>
428{if(e==="range"){if(h instanceof Date&&!d[1]){if(ee(E).isSame(h,t)&&!a){f(null),y(null),p([null,null]);return}const z=[E,h];z.sort((N,C)=>N.getTime()-C.getTime()),p(z),y(null),f(null);return}if(d[0]&&!d[1]&&ee(E).isSame(d[0],t)&&!a){f(null),y(null),p([null,null]);return}p([E,null]),y(null),f(E);return}if(e==="multiple"){d.some(z=>ee(z).isSame(E,t))?p(d.filter(z=>!ee(z).isSame(E,t))):p([...d,E]);return}d&&o&&ee(E).isSame(d,t)?p(null):p(E)},S=E=>h instanceof Date&&m instanceof Date?fh(E,[m,h]):d[0]instanceof Date&&d[1]instanceof Date?fh(E,d):!1,k=e==="range"?E=>{l==null||l(E),y(null)}:l,w=E=>d[0]instanceof Date&&ee(E).isSame(d[0],t)?!(m&&ee(m).isBefore(d[0])):!1,T=E=>d[1]instanceof Date?ee(E).isSame(d[1],t):!(d[0]instanceof Date)||!m?!1:ee(m).isBefore(d[0])&&ee(E).isSame(d[0],t),A=E=>{if(e==="range")return{selected:d.some(N=>N&&ee(N).isSame(E,t)),inRange:S(E),firstInRange:w(E),lastInRange:T(E),"data-autofocus":!!d[0]&&ee(d[0]).isSame(E,t)||void 0};if(e==="multiple")return{selected:d.some(N=>N&&ee(N).isSame(E,t)),"data-autofocus":!!d[0]&&ee(d[0]).isSame(E,t)||void 0};const z=ee(d).isSame(E,t);return{selected:z,"data-autofocus":z||void 0}},R=e==="range"&&h?y:()=>{};return _.useEffect(()=>{if(e==="range")if(d[0]&&!d[1]&&(h==null?void 0:h.getTime())!==d[0].getTime())f(d[0]);else{const E=d[0]==null&&d[1]==null,z=d[0]!=null&&d[1]!=null;(E||z)&&(f(null),y(null))}},[d]),{onDateChange:b,onRootMouseLeave:k,onHoveredDateChange:R,getControlProps:A,_value:d,setValue:p}}const BP={type:"default",defaultLevel:"month",numberOfColumns:1},Xi=Qe((e,t)=>{const r=Ve("DatePicker",BP,e),{classNames:i,styles:s,vars:a,type:o,defaultValue:l,value:c,onChange:d,__staticSelector:p,getDayProps:h,allowSingleDateInRange:f,allowDeselect:m,onMouseLeave:y,numberOfColumns:b,hideOutsideDates:S,__onDayMouseEnter:k,__onDayClick:w,__timezoneApplied:T,...A}=r,{onDateChange:R,onRootMouseLeave:E,onHoveredDateChange:z,getControlProps:N}=UP({type:o,level:"day",allowDeselect:m,allowSingleDateInRange:f,value:c,defaultValue:l,onChange:d,onMouseLeave:y,applyTimezone:!T}),{resolvedClassNames:C,resolvedStyles:M}=Oi({classNames:i,styles:s,props:r}),P=Dt();return n(Bo,{ref:t,minLevel:"month",classNames:C,styles:M,__staticSelector:p||"DatePicker",onMouseLeave:E,numberOfColumns:b,hideOutsideDates:S??b!==1,__onDayMouseEnter:(I,L)=>{z(L),k==null||k(I,L)},__onDayClick:(I,L)=>{R(L),w==null||w(I,L)},getDayProps:I=>({...N(I),...h==null?void 0:h(I)}),...A,date:Zt("add",A.date,P.getTimezone(),T),__timezoneApplied:!0})});Xi.classes=Bo.classes;Xi.displayName="@mantine/dates/DatePicker";var og={timeWrapper:"m_208d2562",timeInput:"m_62ee059"};const qP={dropdownType:"popover"},xs=Qe((e,t)=>{const r=Ve("DateTimePicker",qP,e),{value:i,defaultValue:s,onChange:a,valueFormat:o,locale:l,classNames:c,styles:d,unstyled:p,timeInputProps:h,submitButtonProps:f,withSeconds:m,level:y,defaultLevel:b,size:S,variant:k,dropdownType:w,vars:T,minDate:A,maxDate:R,...E}=r,z=_n({name:"DateTimePicker",classes:og,props:r,classNames:c,styles:d,unstyled:p,vars:T}),{resolvedClassNames:N,resolvedStyles:C}=Oi({classNames:c,styles:d,props:r}),M=o||(m?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),P=_.useRef(null),I=dy(P,h==null?void 0:h.ref),{calendarProps:{allowSingleDateInRange:L,...U},others:q}=ag(E),B=Dt(),[Y,Q]=Uo({type:"default",value:i,defaultValue:s,onChange:a}),W=te=>te?ee(te).format(m?"HH:mm:ss":"HH:mm"):"",[F,H]=_.useState(W(Y)),[K,X]=_.useState(y||b||"month"),[Z,le]=_t(!1),de=Y?ee(Y).locale(B.getLocale(l)).tz(B.getTimezone(),!0).format(M):"",ye=te=>{var Ue;(Ue=h==null?void 0:h.onChange)==null||Ue.call(h,te);const $e=te.currentTarget.value;if(H($e),$e){const[ot,mr,Sn]=$e.split(":").map(Number),Cn=Zt("add",new Date,B.getTimezone());Cn.setHours(ot),Cn.setMinutes(mr),Cn.setSeconds(Sn||0),Cn.setMilliseconds(0),Q(ch(Cn,Y||Zt("add",new Date,B.getTimezone())))}},ge=te=>{var $e;te&&Q(ch(Y,te)),($e=P.current)==null||$e.focus()},be=te=>{var $e;($e=h==null?void 0:h.onKeyDown)==null||$e.call(h,te),te.key==="Enter"&&(te.preventDefault(),le.close())};kl(()=>{Z||H(W(Y))},[Y,Z]),kl(()=>{Z&&X("month")},[Z]);const Me=A?ee(A).format("HH:mm:ss"):null,ne=R?ee(R).format("HH:mm:ss"):null,Re=w==="popover";return u(Gi,{formattedValue:de,dropdownOpened:E.disabled?!1:Z,dropdownHandlers:le,classNames:N,styles:C,unstyled:p,ref:t,onClear:()=>Q(null),shouldClear:!!Y,value:Y,size:S,variant:k,dropdownType:w,...q,type:"default",__staticSelector:"DateTimePicker",children:[n(Xi,{...U,maxDate:R,minDate:A,size:S,variant:k,type:"default",value:Y,defaultDate:Y,onChange:ge,locale:l,classNames:N,styles:C,unstyled:p,__staticSelector:"DateTimePicker",__stopPropagation:Re,level:y,defaultLevel:b,onLevelChange:te=>{var $e;X(te),($e=U.onLevelChange)==null||$e.call(U,te)},__timezoneApplied:!0}),K==="month"&&u("div",{...z("timeWrapper"),children:[n(dd,{value:F,withSeconds:m,ref:I,unstyled:p,minTime:Y&&A&&Y.toDateString()===A.toDateString()?Me??void 0:void 0,maxTime:Y&&R&&Y.toDateString()===R.toDateString()?ne??void 0:void 0,...h,...z("timeInput",{className:h==null?void 0:h.className,style:h==null?void 0:h.style}),onChange:ye,onKeyDown:be,size:S,"data-mantine-stop-propagation":Re||void 0}),n(Ne,{variant:"default",size:`input-${S||"sm"}`,...z("submitButton",{className:f==null?void 0:f.className,style:f==null?void 0:f.style}),unstyled:p,"data-mantine-stop-propagation":Re||void 0,children:n(uy,{size:"30%"}),...f,onClick:te=>{var $e;($e=f==null?void 0:f.onClick)==null||$e.call(f,te),le.close()}})]})]})});xs.classes={...og,...Gi.classes,...Xi.classes};xs.displayName="@mantine/dates/DateTimePicker";function jP({type:e,value:t,defaultValue:r,onChange:i,locale:s,format:a,closeOnChange:o,sortDates:l,labelSeparator:c,valueFormatter:d}){const p=Dt(),[h,f]=_t(!1),[m,y]=Uo({type:e,value:t,defaultValue:r,onChange:i}),b=FE({type:e,date:m,locale:p.getLocale(s),format:a,labelSeparator:p.getLabelSeparator(c),formatter:d}
428),S=T=>{o&&(e==="default"&&f.close(),e==="range"&&T[0]&&T[1]&&f.close()),y(l&&e==="multiple"?[...T].sort((A,R)=>A.getTime()-R.getTime()):T)},k=()=>S(e==="range"?[null,null]:e==="multiple"?[]:null),w=e==="range"?!!m[0]:e==="multiple"?m.length>0:m!==null;return{_value:m,setValue:S,onClear:k,shouldClear:w,formattedValue:b,dropdownOpened:h,dropdownHandlers:f}}const HP={type:"default",valueFormat:"MMMM D, YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},Yr=Qe((e,t)=>{const r=Ve("DatePickerInput",HP,e),{type:i,value:s,defaultValue:a,onChange:o,valueFormat:l,labelSeparator:c,locale:d,classNames:p,styles:h,unstyled:f,closeOnChange:m,size:y,variant:b,dropdownType:S,sortDates:k,minDate:w,maxDate:T,vars:A,defaultDate:R,valueFormatter:E,...z}=r,{resolvedClassNames:N,resolvedStyles:C}=Oi({classNames:p,styles:h,props:r}),{calendarProps:M,others:P}=ag(z),{_value:I,setValue:L,formattedValue:U,dropdownHandlers:q,dropdownOpened:B,onClear:Y,shouldClear:Q}=jP({type:i,value:s,defaultValue:a,onChange:o,locale:d,format:l,labelSeparator:c,closeOnChange:m,sortDates:k,valueFormatter:E}),W=Array.isArray(I)?I[0]||R:I||R,F=Dt();return n(Gi,{formattedValue:U,dropdownOpened:B,dropdownHandlers:q,classNames:N,styles:C,unstyled:f,ref:t,onClear:Y,shouldClear:Q,value:I,size:y,variant:b,dropdownType:S,...P,type:i,__staticSelector:"DatePickerInput",children:n(Xi,{...M,size:y,variant:b,type:i,value:I,defaultDate:W||JE({maxDate:T,minDate:w,timezone:F.getTimezone()}),onChange:L,locale:d,classNames:N,styles:C,unstyled:f,__staticSelector:"DatePickerInput",__stopPropagation:S==="popover",minDate:w,maxDate:T,date:Zt("add",M.date,F.getTimezone()),__timezoneApplied:!0})})});Yr.classes={...Gi.classes,...Xi.classes};Yr.displayName="@mantine/dates/DatePickerInput";function lg(e){var t;return e?e.username!=null||!!e.dateFrom||!!e.dateTo||(((t=e.excludedUserIds)==null?void 0:t.length)??0)>0:!1}async function WP(){return await ae(`${O}/statistics`)}function YP(e){var i;const t=new URLSearchParams;(e==null?void 0:e.username)!=null&&t.set("username",e.username),e!=null&&e.dateFrom&&t.set("date_from",e.dateFrom),e!=null&&e.dateTo&&t.set("date_to",e.dateTo),(i=e==null?void 0:e.excludedUserIds)!=null&&i.length&&t.set("excluded_user_ids",e.excludedUserIds.join(","));const r=t.toString();return r?`?${r}`:""}async function QP(e){return await ae(`${O}/statistics/all${YP(e)}`)}async function VP(){return await ae(`${O}/statistics/topups`)}async function KP({id:e,topup_by:t}){return await Ft(`${O}/statistics/topups/${e}`,{topup_by:t})}async function GP(e,t){return await ae(`${O}/statistics/max-viewers-per-streamer?start=${encodeURIComponent(e)}&end=${encodeURIComponent(t)}`)}async function XP(e){return await ae(`${O}/statistics/daily-nominations/${encodeURIComponent(e)}`)}function js(e,t){const r=at(),i=J({mutationKey:["statistics.topups.update"],mutationFn:KP,onSuccess:()=>{r.invalidateQueries({queryKey:["statistics.topups"]})}}),s=c=>oe({queryKey:["statistics.daily.nominations",c],queryFn:()=>XP(c)}),a=oe({queryKey:["statistics.user"],queryFn:WP}),o=oe({queryKey:["statistics",t],queryFn:()=>QP(t),enabled:he(e,Ce)&&lg(t)}),l=oe({queryKey:["statistics.topups"],queryFn:VP,enabled:he(e,Ce)});return{currentUserStatisticsQuery:a,statisticsQuery:o,topupsQuery:l,getMaxViewersPerStreamerInRange:GP,dailyNominations:s,updateTopupByMutation:i}}const gh=e=>new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),na=e=>new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()));function JP(){const{user:e}=fe(),{getMaxViewersPerStreamerInRange:t}=js(e),r=tn(),{colorScheme:i}=vt(),s=new Date,a=new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate(),s.getUTCHours(),0,0)),o=new Date(a.getTime()+60*60*1e3),[l,c]=_.useState([gh(a),gh(o)]),[d,p]=_.useState(""),[h,f]=_.useState(1),m=20,[y,b]=_.useState([]),[S,k]=_.useState(!1),[w,T]=_.useState(null),[A,R]=_.useState(null),E=_.useCallback(()=>[l[0]?na(l[0]):null,l[1]?na(l[1]):null],[l]),z=U=>{const q=U.getUTCFullYear(),B=String(U.getUTCMonth()+1).padStart(2,"0"),Y=String(U.getUTCDate()).padStart(2,"0"),Q=String(U.getUTCHours()).padStart(2,"0"),W=String(U.getUTCMinutes()).padStart(2,"0");return`${q}-${B}-${Y} ${Q}:${W}`},N=async()=>
428{const[U,q]=E();if(!U||!q){T("Please select a valid date and time range");return}if(U>=q){T("Start time must be before end time");return}k(!0),T(null);try{const B=z(U),Y=z(q),Q=`${B}-${Y}`;if(Q!==A){const W=await t(B,Y);b(W),R(Q)}}catch(B){T(B instanceof Error?B.message:"Failed to fetch viewer statistics"),b([])}finally{k(!1),f(1)}},C=_.useMemo(()=>{if(!d.trim())return y;const U=d.toLowerCase();return y.filter(q=>q.username.toLowerCase().includes(U))},[y,d]),M=_.useMemo(()=>{const U=(h-1)*m;return C.slice(U,U+m)},[C,h]),P=Math.ceil(C.length/m),I=()=>{N()},L=U=>{U.key==="Enter"&&N()};return he(e,Ce)?n(Be,{mt:"xl",fluid:!0,children:u(ue,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,children:[n(Ye,{order:2,mb:"md",children:"Viewer Statistics"}),n(v,{color:"dimmed",mb:"lg",children:"View maximum concurrent viewers per streamer in a selected time range (UTC)."}),n(Ie,{p:"md",radius:"md",withBorder:!0,mb:"lg",bg:i==="dark"?r.colors.dark[6]:r.colors.gray[0],children:u(j,{children:[u($,{grow:!0,children:[n(xs,{label:u($,{gap:"xs",children:[n(Ad,{size:16}),n(v,{fw:500,children:"Start Time (UTC)"})]}),placeholder:"YYYY-MM-DD HH:mm",value:l[0],onChange:U=>c([U,l[1]]),clearable:!1,numberOfColumns:2,popoverProps:{withinPortal:!0},timeInputProps:{leftSection:n(v,{c:"dimmed",size:"sm",fw:600,children:"UTC"})},styles:{input:{fontWeight:500,borderColor:r.colors.blue[6],"&:focus":{borderColor:r.colors.blue[7]}}}}),n(xs,{label:u($,{gap:"xs",children:[n(Ad,{size:16}),n(v,{fw:500,children:"End Time (UTC)"})]}),placeholder:"YYYY-MM-DD HH:mm",value:l[1],onChange:U=>c([l[0],U]),clearable:!1,numberOfColumns:2,popoverProps:{withinPortal:!0},timeInputProps:{leftSection:n(v,{c:"dimmed",size:"sm",fw:600,children:"UTC"})},styles:{input:{fontWeight:500,borderColor:r.colors.green[6],"&:focus":{borderColor:r.colors.green[7]}}}})]}),u($,{grow:!0,align:"end",children:[n(Te,{label:"Search Streamer",placeholder:"Username",value:d,onChange:U=>p(U.currentTarget.value),onKeyPress:L,rightSection:n(Ot,{size:16}),styles:{input:{fontWeight:500}}}),n(V,{leftSection:n(Ot,{}),color:"blue",onClick:I,loading:S,h:42,style:{alignSelf:"flex-end"},children:"Load Statistics"})]})]})}),l[0]&&l[1]&&u(v,{size:"sm",c:"dimmed",mb:"md",fs:"italic",children:["Selected UTC range: ",n(v,{span:!0,fw:600,children:z(na(l[0]))})," to ",n(v,{span:!0,fw:600,children:z(na(l[1]))})]}),w&&n(Le,{color:"red",title:"Error",mb:"md",children:w}),S?n(mt,{justify:"center",align:"center",py:"xl",children:n(Xe,{size:"lg"})}):M.length===0?n(v,{c:"dimmed",ta:"center",py:"xl",children:y.length===0?"Click 'Load Statistics' to fetch viewer data":"No streamers match your search"}):u(ke,{children:[u(g,{striped:!0,highlightOnHover:!0,withTableBorder:!0,horizontalSpacing:"md",verticalSpacing:"sm",miw:600,children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Streamer"}),n(g.Th,{children:"Max Viewers"}),n(g.Th,{children:"Achieved At (UTC)"})]})}),n(g.Tbody,{children:M.map(U=>u(g.Tr,{children:[n(g.Td,{children:n(v,{fw:600,size:"sm",children:U.username})}),n(g.Td,{children:n(v,{fw:700,c:"blue.8",size:"sm",children:U.max_viewers.toLocaleString()})}),n(g.Td,{children:n(v,{size:"sm",c:"dimmed",children:U.achieved_at})})]},`${U.username}-${U.achieved_at}`))})]}),P>1&&n(mt,{justify:"flex-end",mt:"md",children:n(yt,{total:P,value:h,onChange:f,size:"sm",color:"blue"})})]})]})}):n(Be,{mt:"xl",children:n(Le,{color:"red",title:"Access Denied",children:"You do not have permission to view this page."})})}function ZP(){const[e,t]=bn(),{donationsQuery:r}=en(),i=Number(e.get("cursor"))||0,s=Number(e.get("limit"))||10,a=e.get("query")||"",[o,l]=_.useState(a),{data:c,isLoading:d,isFetching:p,isError:h}=r(i,s,a),f=(c==null?void 0:c.data)||[],m=c==null?void 0:c.has_next,y=(c==null?void 0:c.next_cursor)??0,[b,S]=_.useState([i]),k=_.useRef(a);_.useEffect(()=>{a!==k.current&&(S([0]),k.current=a,l(a))},[a]);function w(E){l(E.target.value)}_.useEffect(()=>{const E=setTimeout(()=>{o!==k.current&&t({cursor:"0",limit:String(s),query:o}),k.current=o},500);return()=>clearTimeout(E)},[o,s,t,a]);function T(){S([...b,y]),t(()=>
428({cursor:String(y),limit:String(s),query:o}))}function A(){const E=[...b];E.pop(),S(E),t(()=>({cursor:String(E[E.length-1]),limit:String(s),query:o}))}function R(E){t(()=>({cursor:String(i),limit:String(E),query:o}))}return h?n(Le,{icon:n(Fi,{}),children:"Error loading donations"}):u(ue,{withBorder:!0,children:[u($,{grow:!0,align:"end",justify:"space-between",mb:"xs",children:[n(Te,{leftSection:n(Ot,{size:"1rem"}),placeholder:"Search by username or message",value:o,onChange:w,error:f.length===0&&"Your query returned no results"}),u(j,{gap:3,style:{flexGrow:0},children:["Rows per page",n(it,{value:String(s),onChange:R,data:["10","25","50","100"]})]})]}),u(j,{gap:"xs",children:[u(G,{pos:"relative",children:[n(zs,{visible:d,zIndex:1e3,overlayProps:{radius:"sm",blur:2}}),n(g.ScrollContainer,{minWidth:800,children:u(g,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"#"}),n(g.Th,{children:"Donator"}),n(g.Th,{children:"Donatee"}),n(g.Th,{children:"Amount"}),n(g.Th,{children:"Message"}),n(g.Th,{children:"Gift?"}),n(g.Th,{children:"Donated at"})]})}),n(g.Tbody,{children:f.map(E=>u(g.Tr,{children:[n(g.Td,{children:E.id}),n(g.Td,{children:E.donator}),n(g.Td,{children:E.donatee}),n(g.Td,{children:se(E.amount)}),n(g.Td,{children:E.message}),n(g.Td,{children:n(pe,{color:E.is_gift?"green":"red",variant:"dot",children:E.is_gift?"Yes":"No"})}),n(g.Td,{children:st.format(new Date(E.created_at))})]},E.id))})]})})]}),u($,{justify:"right",children:[n(V,{variant:"default",leftSection:n(ao,{}),disabled:p||b.length<=1,loading:p,onClick:A,children:"Previous"}),n(V,{rightSection:n(oo,{}),disabled:p||!m,loading:p,onClick:T,children:"Next"})]})]})]})}function eM(e){const t=Math.floor(e/3600),r=Math.floor(e%3600/60);return`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function tM(){var o,l,c,d,p,h;const{dailyNominations:e}=js(),[t,r]=_.useState(new Date),{data:i,isLoading:s,isError:a}=e(new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t??new Date));return u(ue,{withBorder:!0,children:[n($,{grow:!0,align:"end",justify:"space-between",mb:"xs",children:n(Yr,{valueFormat:"YYYY-MM-DD",label:"Date",placeholder:"Pick a date",value:t,onChange:r})}),u(G,{pos:"relative",children:[n(zs,{visible:s}),a?n(Le,{icon:n(Fi,{}),children:"Error loading daily nominations"}):u($,{grow:!0,children:[u(ue,{withBorder:!0,children:[n(v,{fw:600,children:"Longest stream duration"}),u($,{gap:5,align:"center",children:[n(lo,{style:{marginTop:"0.2rem"},size:"0.875rem"}),n(v,{children:((o=i==null?void 0:i.stream_duration)==null?void 0:o.username)??"N/A"})]}),n(v,{children:eM(((l=i==null?void 0:i.stream_duration)==null?void 0:l.value)??0)})]}),u(ue,{withBorder:!0,children:[n(v,{fw:600,children:"Most concurrent viewers"}),u($,{gap:5,align:"center",children:[n(Za,{style:{marginTop:"0.2rem"},size:"0.875rem"}),n(v,{children:((c=i==null?void 0:i.peak_viewers)==null?void 0:c.username)??"N/A"})]}),n(v,{children:new Intl.NumberFormat(void 0).format(((d=i==null?void 0:i.peak_viewers)==null?void 0:d.value)??0)})]}),u(ue,{withBorder:!0,children:[n(v,{fw:600,children:"Highest earnings"}),u($,{gap:5,align:"center",children:[n(Xt,{style:{marginTop:"0.2rem"},size:"0.875rem"}),n(v,{children:((p=i==null?void 0:i.highest_earnings)==null?void 0:p.username)??"N/A"})]}),n(v,{children:se(((h=i==null?void 0:i.highest_earnings)==null?void 0:h.value)??0)})]})]})]})]})}function nM(){const[e,t]=bn(),{pendingDocumentsQuery:r,approveDocumentMutation:i,rejectDocumentMutation:s}=en(),a=Number(e.get("cursor"))||0,o=Number(e.get("limit"))||10,l=e.get("query")||"",[c,d]=_.useState(l),{data:p,isLoading:h,isFetching:f,isError:m}=r(a,o,l),y=(p==null?void 0:p.data)||[],b=p==null?void 0:p.has_next,S=(p==null?void 0:p.next_cursor)??0,[k,w]=_.useState([a]),T=_.useRef(l);_.useEffect(()=>{l!==T.current&&(w([0]),T.current=l,d(l))},[l]);function A(N){d(N.target.value)}_.useEffect(()=>{const N=setTimeout(()=>{c!==T.current&&t({cursor:"0",limit:String(o),query:c}),T.current=c},500);return()=>clearTimeout(N)},[c,o,t,l]);function R(){w([...k,S]),t(()=>
428({cursor:String(S),limit:String(o),query:c}))}function E(){const N=[...k];N.pop(),w(N),t(()=>({cursor:String(N[N.length-1]),limit:String(o),query:c}))}function z(N){t(()=>({cursor:String(a),limit:String(N),query:c}))}return m?n(Le,{icon:n(Fi,{}),children:"Error loading rows"}):u(ue,{withBorder:!0,children:[u($,{grow:!0,align:"end",justify:"space-between",mb:"xs",children:[n(Te,{leftSection:n(Ot,{size:"1rem"}),placeholder:"Search by username",value:c,onChange:A,error:y.length===0&&"Your query returned no results"}),u(j,{gap:3,style:{flexGrow:0},children:["Rows per page",n(it,{value:String(o),onChange:z,data:["10","25","50","100"]})]})]}),u(j,{gap:"xs",children:[u(G,{pos:"relative",children:[n(zs,{visible:h,zIndex:1e3,overlayProps:{radius:"sm",blur:2}}),n(g.ScrollContainer,{minWidth:800,children:u(g,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Username"}),n(g.Th,{children:"Document"}),n(g.Th,{})]})}),n(g.Tbody,{children:y.map(N=>u(g.Tr,{children:[n(g.Td,{children:N.username}),n(g.Td,{children:n(Ze,{component:xe,target:"_blank",to:`${O}/document/${N.id}`,children:"Open document"})}),n(g.Td,{children:u($,{gap:"xs",children:[n(V,{variant:"filled",size:"compact-xs",color:"green.6",disabled:i.isPending,loading:i.isPending,leftSection:n(qp,{size:"1rem"}),onClick:()=>{i.mutate(N.id)},children:"Approve"}),n(V,{variant:"filled",size:"compact-xs",color:"red.6",disabled:s.isPending,loading:s.isPending,leftSection:n(jp,{size:"1rem"}),onClick:()=>{s.mutate(N.id)},children:"Reject"})]})})]},N.id))})]})})]}),u($,{justify:"right",children:[n(V,{variant:"default",leftSection:n(ao,{}),disabled:f||k.length<=1,loading:f,onClick:E,children:"Previous"}),n(V,{rightSection:n(oo,{}),disabled:f||!b,loading:f,onClick:R,children:"Next"})]})]})]})}function rM(){const{updateBotSettingsMutation:e,getBotSettingsQuery:t}=en(),{data:r,isError:i,isLoading:s}=t(),a=Ge({initialValues:{amount:0,minimum_viewers:0,message:"",enabled:!1},transformValues(o){return{amount:o.amount*100,minimum_viewers:o.minimum_viewers,message:o.message,enabled:o.enabled}}});return _.useEffect(()=>{r&&(a.setValues(r),a.setFieldValue("amount",r.amount/100))},[r]),i?n(Le,{icon:n(Fi,{}),children:"Error loading settings"}):n(ue,{withBorder:!0,children:n(j,{gap:"xs",maw:400,children:u(G,{pos:"relative",children:[n(zs,{visible:s,zIndex:1e3,overlayProps:{radius:"sm",blur:2}}),n("form",{onSubmit:a.onSubmit(function(o){e.mutate(o)}),children:u(j,{gap:"xs",children:[n(pt,{prefix:"$",decimalScale:2,fixedDecimalScale:!0,thousandSeparator:" ",label:"Amount",...a.getInputProps("amount")}),n(pt,{label:"Minimum viewers",...a.getInputProps("minimum_viewers")}),n(Te,{label:"Message",...a.getInputProps("message")}),u($,{justify:"space-between",children:[n(qt,{label:"Enabled",color:"teal",description:"Enable or disable giveaway bot",checked:a.values.enabled,onChange:o=>a.setFieldValue("enabled",o.currentTarget.checked),thumbIcon:a.values.enabled?n(Ke,{size:12,color:"var(--mantine-color-teal-6)",stroke:3}):n(ht,{size:12,color:"var(--mantine-color-red-6)",stroke:3})}),n(V,{color:"green",loading:e.isPending,disabled:e.isPending,type:"submit",children:"Save settings"})]})]})})]})})})}async function iM(e,t){const r=new URLSearchParams({page:e.toString(),limit:"20"});return Object.entries(t).forEach(([i,s])=>{s&&r.set(i,s)}),await ae(`${O}/admin/invitations?${r.toString()}`)}async function sM(e){await et(`${O}/admin/invitations/${e}`)}function aM(e,t,r){return oe({queryKey:["admin-invitations",e,t],queryFn:()=>iM(e,t),placeholderData:i=>i,enabled:he(r,Ce)})}function oM(){const e=at();return J({mutationFn:sM,onSuccess:()=>{e.invalidateQueries({queryKey:["admin-invitations"]}),e.invalidateQueries({queryKey:["invitations"]}),Ee.show({title:"Invitation inactivated",message:"The invitation was revoked without notifying the user.",color:"green"})},onError:t=>{Ee.show({title:"Could not inactivate invitation",message:t.message,color:"red"})}})}const lM={ACTIVE:"green",INACTIVE:"gray"};function yh(e){return st.format(new Date(e))}function cM(){var S,k;const{user:e}=fe(),[t,r]=_.useState(1),[i,s]=_.useState(""),[a,o]=_.useState(""),[l,c]=_.useState(null),[d,p]=_.useState({}),h=aM(t,d,e),f=oM(),m=((S=h.data)==null?void 0:S.invitations)??[],y=Math.max(((k=h.data)==null?void 0:k.pages)??1,1);return he(e,Ce)?n(Be,{mt:"xl",fluid:!0,children:u(ue,{shadow:"sm",padding:"lg",radiu
428s:"md",withBorder:!0,children:[n(Ye,{order:2,mb:"md",children:"Invitations"}),n(v,{c:"dimmed",mb:"lg",children:"Review invitation status and silently inactivate active invitations."}),n(j,{mb:"lg",children:u($,{grow:!0,align:"end",children:[n(Te,{label:"Streamer username",placeholder:"Filter by streamer",value:i,onChange:w=>s(w.currentTarget.value)}),n(Te,{label:"Viewer username",placeholder:"Filter by viewer",value:a,onChange:w=>o(w.currentTarget.value)}),n(it,{clearable:!0,label:"Status",placeholder:"All statuses",data:["ACTIVE","INACTIVE"],value:l,onChange:w=>c(w)}),n(V,{leftSection:n(Ot,{size:"1rem"}),onClick:()=>{r(1),p({streamer:i.trim()||void 0,viewer:a.trim()||void 0,status:l||void 0})},children:"Search"})]})}),h.isLoading?n(mt,{justify:"center",py:"xl",children:n(Xe,{})}):m.length===0?n(v,{c:"dimmed",ta:"center",py:"xl",children:"No invitations found."}):u(ke,{children:[n(g.ScrollContainer,{minWidth:1e3,children:u(g,{striped:!0,highlightOnHover:!0,withTableBorder:!0,horizontalSpacing:"md",verticalSpacing:"sm",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Streamer"}),n(g.Th,{children:"Viewer"}),n(g.Th,{children:"Invited at"}),n(g.Th,{children:"Status"}),n(g.Th,{children:"Status updated at"}),n(g.Th,{children:"Status updated by"}),n(g.Th,{children:"Action"})]})}),n(g.Tbody,{children:m.map(w=>u(g.Tr,{children:[n(g.Td,{children:w.streamer_username}),n(g.Td,{children:w.viewer_username}),n(g.Td,{children:yh(w.invited_at)}),n(g.Td,{children:n(pe,{color:lM[w.status],children:w.status})}),n(g.Td,{children:yh(w.status_updated_at)}),n(g.Td,{children:w.status_updated_by==="AUTO-REVOKE"?"Auto-revoke":w.status_updated_by}),n(g.Td,{children:w.status==="ACTIVE"?n(V,{color:"red",variant:"light",size:"xs",loading:f.isPending&&f.variables===w.id,onClick:()=>{window.confirm(`Inactivate invitation for ${w.viewer_username}? The user will not be notified.`)&&f.mutate(w.id)},children:"Inactivate"}):n(v,{c:"dimmed",size:"sm",children:"Inactivated"})})]},w.id))})]})}),n(mt,{justify:"flex-end",mt:"md",children:n(yt,{total:y,value:t,onChange:r})})]}),h.isError&&n(Le,{color:"red",title:"Error loading invitations",mt:"md",children:h.error.message})]})}):n(Be,{mt:"xl",children:n(Le,{color:"red",title:"Access Denied",children:"You do not have permission to view invitations."})})}function dM(){Cc("Administration");const e=gt(),{tabId:t}=Bn(),r=Ha(`(max-width: ${Wa(800)})`);return u(re,{value:t,variant:"pills",color:"dark.5",onChange:i=>e(`/admin/${i}`),children:[u(re.List,{mb:"md",children:[n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"users",leftSection:n(sa,{size:"1rem"}),children:"Users"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"dares",leftSection:n(gs,{size:"1rem"}),children:"Dares"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"streams",leftSection:n(no,{size:"1rem"}),children:"Streams"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"invitations",leftSection:n(hb,{size:"1rem"}),children:"Invitations"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"support",leftSection:n(pb,{size:"1rem"}),children:"Support"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"events",leftSection:n(Rp,{size:"1rem"}),children:"Events"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"contribs",leftSection:n(Dd,{size:"1rem"}),children:"Contributions"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"donations",leftSection:n(mb,{size:"1rem"}),children:"Donations"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"purchases",leftSection:n(Dd,{size:"1rem"}),children:"Purchases"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"messages",leftSection:n(fb,{size:"1rem"}),children:"Message History"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"viewers",leftSection:n(gb,{size:"1rem"}),children:"Viewers Number"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"daily-nominations",leftSection:n(Hp,{size:"1rem"}),children:"Daily nominations"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"age-verification",leftSection:n(yb,{size:"1rem"}),children:"Age verification"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"giveaway",leftSection:n(bb,{size:"1rem"}),children:"Giveaway"})]}),n(re.Panel,{value:"users",children:n(Hk,{})}),n(re.Panel,{value:"dares",children:n(wE,{})}),n(re.Panel,{value:"streams",children:n(SE,{})}),n(re.Panel,{value:"invitations",children:n(cM,{})}),n(re.Panel,{value:"support",children:n(qf,{})}),n(re.Panel,{value:"contribs",children:n(vE,{})}),n(re.Panel,{value:"donations",children:n(ZP,{})}),n(re.Panel,{value:"purchases",children:n(DE,{})}),n(re.Panel,{value:"messages",children:n(RE,{})}),n(re.Panel,{value:"viewers",children:n(JP,{})}),n(re.Panel,{value:"daily-nominations",children:n(tM,{})}),n(re.Panel,{value:"age-verification",children:n(nM,{})}),n(re.Panel,{value:"giveaway",children:n(rM,{})})]})}async function uM(e){return await _e(`${O}/withdraw`,e)}async function hM(){return await ae(`${O}/withdraw/me`)}async function pM(){return await ae(`${O}/withdraw`)}async function mM(e){return await et(`${O}/withdraw/${e}`)}async function fM(e){return await qn(`${O}/withdraw/${e}`)}async function gM({id:e,...t}){return await _e(`${O}/withdraw/${e}/pay`,t)}function Qr(){const{user:e}=fe(),t=oe({queryKey:["withdrawals.user"],queryFn:hM}),r=oe({queryKey:["withdrawals"],queryFn:pM,enabled:he(e,Ce)}),i=J({mutationKey:["withdrawal.cancel"],mutationFn:mM,onSuccess(){r.refetch(),t.refetch()}}),s=J({mutationKey:["withdrawal.complete"],mutationFn:fM,onSuccess(){r.refetch(),t.refetch()}}),a=J({mutationKey:["withdrawal.create"],mutationFn:uM,onSuccess(){r.refetch(),t.refetch()}}),o=J({mutationKey:["withdrawal.pay.inw"],mutationFn:gM,onSuccess(){r.refetch()}});return{withdrawalsQuery:r,currentUserWithdrawalsQuery:t,cancelWithdrawalMutation:i,completeWithdrawalMutation:s,withdrawMutation:a,payWithdrawalInwMutation:o}}const ui=0,cg=1,yM=2;function Ba(e){const t=new Map([[ui,{status:"pending",color:"blue"}],[cg,{status:"completed",color:"green"}],[yM,{status:"cancelled",color:"red"}]]);return t.get(e)??t.get(0)}function bM({withdrawal:e,opened:t,onClose:r}){const{payWithdrawalInwMutation:i}
428=Qr(),s=Ge({initialValues:{card_number:"",currency_rate:74.8},validate:{card_number:o=>o.trim().length<16?"Enter a valid card number":null,currency_rate:o=>o<=0?"Currency rate must be positive":null}}),a=s.onSubmit(o=>{i.mutate({id:e.id,...o},{onSuccess(){Ee.show({position:"top-center",title:"INW Payout",message:`Payout for withdrawal #${e.id} submitted`,color:"green",icon:n(Ke,{})}),s.reset(),r()},onError(){Ee.show({position:"top-center",title:"INW Payout",message:"Payout request failed",color:"red"})}})});return n(Oe,{opened:t,onClose:r,title:`Pay withdrawal #${e.id} via INW`,children:n("form",{onSubmit:a,children:u(j,{gap:"sm",children:[u(v,{size:"sm",c:"dimmed",children:["Amount: ",se(e.amount)," — ",e.username," ","— ",e.method]}),n(Te,{label:"Card number",placeholder:"4111111111111111",...s.getInputProps("card_number")}),n(pt,{label:"Currency rate (RUB per USD)",placeholder:"74.8",decimalScale:2,step:.1,...s.getInputProps("currency_rate")}),u($,{justify:"right",children:[n(V,{variant:"default",onClick:r,children:"Cancel"}),n(V,{type:"submit",color:"green",loading:i.isPending,rightSection:n(Wp,{size:16}),children:"Pay"})]})]})})})}function bh({data:e}){const{user:t}=fe(),{completeWithdrawalMutation:r,cancelWithdrawalMutation:i}=Qr(),[s,a]=_.useState(null),[o,{open:l,close:c}]=_t(!1),d=he(t,Ce);return u(ke,{children:[s&&n(bM,{withdrawal:s,opened:o,onClose:()=>{c(),a(null)}}),n(g.ScrollContainer,{minWidth:500,children:u(g,{striped:!0,stripedColor:"dark.7",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Date"}),n(g.Th,{children:"Username"}),n(g.Th,{children:"Amount"}),n(g.Th,{children:"Method"}),n(g.Th,{children:"Closed At"}),n(g.Th,{children:"Status"})]})}),n(g.Tbody,{children:e==null?void 0:e.map(p=>{var h,f;return u(g.Tr,{children:[n(g.Td,{children:st.format(new Date(p.created_at))}),n(g.Td,{children:p.username}),n(g.Td,{children:se(p.amount)}),n(g.Td,{children:p.method}),n(g.Td,{align:"left",children:p.closed_at?st.format(new Date(p.closed_at)):""}),n(g.Td,{children:n(pe,{color:(h=Ba(p.request_status))==null?void 0:h.color,variant:"dot",children:(f=Ba(p.request_status))==null?void 0:f.status})}),n(g.Td,{align:"right",children:u($,{gap:"xs",justify:"right",children:[p.request_status===ui&&n(V,{variant:"filled",size:"compact-xs",color:"green.6",leftSection:n(qp,{size:"1rem"}),onClick:()=>r.mutate(p.id),children:"Approve"}),p.request_status===ui&&n(V,{variant:"filled",size:"compact-xs",color:"red.6",leftSection:n(jp,{size:"1rem"}),onClick:()=>i.mutate(p.id),children:"Cancel"}),d&&p.request_status===ui&&p.method.toLowerCase().includes("russian")&&n(V,{variant:"filled",size:"compact-xs",color:"grape.6",leftSection:n(Wp,{size:"1rem"}),onClick:()=>{a(p),l()},children:"Pay"})]})})]},p.id)})})]})})]})}function _M(){const{withdrawalsQuery:e}=Qr(),[t,r]=_.useState(1),i=_.useMemo(()=>{var o;return(o=e.data)==null?void 0:o.filter(l=>l.request_status===cg).sort((l,c)=>new Date(c.created_at).getTime()-new Date(l.created_at).getTime())},[e.data]),s=_.useMemo(()=>{var o;return(o=e.data)==null?void 0:o.filter(l=>l.request_status===ui).sort((l,c)=>new Date(c.created_at).getTime()-new Date(l.created_at).getTime())},[e.data]),a=_.useMemo(()=>{const o=(t-1)*hi,l=t*hi;return i==null?void 0:i.slice(o,l)},[i,t]);return n(ue,{withBorder:!0,styles:{root:{background:"rgba(59, 59, 59, 0.7)"}},children:u(j,{gap:"xs",children:[n(je,{label:"Pending withdrawals"}),n(Lt,{offsetScrollbars:!0,children:n(bh,{data:s})}),n(je,{label:"Completed withdrawals"}),n(Lt,{offsetScrollbars:!0,children:n(bh,{data:a})}),n($,{justify:"center",children:n(yt,{color:"dark.4",value:t,onChange:o=>r(o),total:Math.ceil(((i==null?void 0:i.length)??0)/hi)})})]})})}function vM(){const{user:e}=fe();return n(ke,{children:e&&he(e,Ce)?n(_M,{}):n(wM,{})})}const hi=7;function wM(){const{user:e,toggleBalance:t}=fe(),{currentUserWithdrawalsQuery:r,cancelWithdrawalMutation:i,withdrawMutation:s}
428=Qr(),[a,o]=_.useState(1),l=h=>!h||h.trim().length===0?"Method cannot be empty":h.length>200?"Method cannot exceed 200 characters":null,c=Ge({initialValues:{amount:1,method:""},validate:{amount:cs({min:10,max:9999},"Amount must be between $10 and 9999$"),method:l},transformValues:h=>({amount:h.amount*100,method:h.method})}),d=_.useMemo(()=>{var h;if(r.data)return(h=r.data)==null?void 0:h.sort((f,m)=>new Date(m.created_at).getTime()-new Date(f.created_at).getTime())},[r.data]),p=_.useMemo(()=>{const h=(a-1)*hi,f=a*hi;return d==null?void 0:d.slice(h,f)},[d,a]);return n(ke,{children:e&&u(ue,{withBorder:!0,radius:"md",p:"xl",children:[n(ue.Section,{children:u(j,{gap:0,p:"md",children:[n(v,{children:x("withdraw_title")}),u("form",{onSubmit:c.onSubmit(async h=>{s.mutate(h,{onSuccess(){Ee.show({position:"top-center",title:"Withdrawal",message:"Request has been sent",color:"green",icon:n(Ke,{})}),t()}}),c.reset()}),children:[n(pt,{label:x("withdraw_amount"),prefix:"$",decimalScale:2,thousandSeparator:" ",description:`Your earnings: ${se(e.earnings??0)}`,...c.getInputProps("amount")}),n(Te,{label:x("withdraw_method"),description:x("describe_withdrawal_method"),...c.getInputProps("method")}),n($,{justify:"left",mt:"md",children:n(V,{rightSection:n(Xt,{size:16}),size:"xs",variant:"gradient",gradient:{from:"teal",to:"lime",deg:35},type:"submit",children:x("withdraw_button")})})]})]})}),u(j,{gap:"xs",children:[n(je,{label:"Past withdrawals"}),n(g.ScrollContainer,{minWidth:500,children:u(g,{striped:!0,stripedColor:"dark.7",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Date"}),n(g.Th,{children:"Amount"}),n(g.Th,{children:"Method"}),n(g.Th,{children:"Status"}),n(g.Th,{children:"Closed Date"}),n(g.Th,{})]})}),n(g.Tbody,{children:p==null?void 0:p.map(h=>{var f,m;return u(g.Tr,{children:[n(g.Td,{children:h.created_at}),n(g.Td,{children:se(h.amount)}),n(g.Td,{children:h.method}),n(g.Td,{children:n(pe,{color:(f=Ba(h.request_status))==null?void 0:f.color,variant:"dot",children:(m=Ba(h.request_status))==null?void 0:m.status})}),n(g.Td,{align:"left",children:h.closed_at}),n(g.Td,{align:"right",children:h.request_status===ui&&n(V,{variant:"subtle",size:"compact-xs",leftSection:n($p,{size:"1rem"}),onClick:async()=>{i.mutate(h.id,{onSuccess(){t()}})},children:"Cancel"})})]},h.id)})})]})}),n($,{justify:"center",children:n(yt,{color:"dark.4",value:a,onChange:h=>o(h),total:Math.ceil(((d==null?void 0:d.length)??0)/hi)})})]})]})})}function pd(e){if(isNaN(e))return"Not finished";const t=Math.floor(e/60),r=e%60;return t>0?`${t}h${r}m`:`${r}m`}function SM(e,t){return!e||t==="all"?e:e.filter(r=>t==="paid"?r.paid:!r.paid)}function CM(e){const t={streamCount:0,totalDurationMinutes:0,totalDonations:0,totalDaresEarnings:0,totalPurchases:0,totalOnHands:0,totalExcludedUsersSpendings:0};if(!e)return t;for(const r of e)t.streamCount+=1,t.totalDurationMinutes+=r.duration??0,t.totalDonations+=r.donations??0,t.totalDaresEarnings+=r.dares_earnings??0,t.totalPurchases+=r.purchases??0,t.totalOnHands+=r.total_on_hands??0,t.totalExcludedUsersSpendings+=r.excluded_users_spendings??0;return t}function TM({summary:e,t}){return u(mn,{cols:{base:2,sm:4},mb:"md",children:[u(ue,{withBorder:!0,padding:"sm",children:[n(v,{size:"xs",c:"dimmed",children:t("statistics_summary_streams","Streams")}),n(v,{fw:600,children:e.streamCount})]}),u(ue,{withBorder:!0,padding:"sm",children:[n(v,{size:"xs",c:"dimmed",children:t("statistics_summary_duration","Total duration")}),n(v,{fw:600,children:pd(e.totalDurationMinutes)})]}),u(ue,{withBorder:!0,padding:"sm",children:[n(v,{size:"xs",c:"dimmed",children:t("statistics_donations")}),n(v,{fw:600,children:se(Number(e.totalDonations*100))})]}),u(ue,{withBorder:!0,padding:"sm",children:[n(v,{size:"xs",c:"dimmed",children:t("statistics_dares")}),n(v,{fw:600,children:se(Number(e.totalDaresEarnings*100))})]}),u(ue,{withBorder:!0,padding:"sm",children:[n(v,{size:"xs",c:"dimmed",children:t("statistics_purchases","Purchases")}),n(v,{fw:600,children:se(Number(e.totalPurchases*100))})]}),u(ue,{withBorder:!0,padding:"sm",children:[n(v,{size:"xs",c:"dimmed",children:t("statistics_total")}),n(v,{fw:600,children:se(Number(e.totalOnHands*100))})]}),u(ue,{withBorder:!0,padding:"sm",children:[n(v,{size:"xs",c:"dimmed",children:t("statistics_excluded_spendings","Excluded users spendings")}
428),n(v,{fw:600,children:se(Number(e.totalExcludedUsersSpendings*100))})]})]})}function xM(){const{t:e}=Fe(),{user:t}=fe(),{currentUserStatisticsQuery:r}=js(t),{colorScheme:i}=vt(),s=_.useMemo(()=>{var a;return(a=r.data)==null?void 0:a.filter(o=>o.finish_time).sort((o,l)=>new Date(l.finish_time.Time).getTime()-new Date(o.finish_time.Time).getTime())},[r.data]);return u(ue,{withBorder:!0,children:[n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:e("statistics_description")}})})}),n(g.ScrollContainer,{minWidth:500,children:u(g,{striped:!0,stripedColor:i==="dark"?"dark.7":"gray.1",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:e("statistics_start")}),n(g.Th,{children:e("statistics_finish")}),n(g.Th,{children:e("statistics_duration")}),n(g.Th,{children:e("statistics_donations")}),n(g.Th,{children:e("statistics_dares")}),n(g.Th,{children:e("statistics_purchases","Purchases")}),n(g.Th,{children:e("statistics_total")}),n(g.Th,{children:"Paid"})]})}),n(g.Tbody,{children:s==null?void 0:s.map((a,o)=>u(g.Tr,{style:{backgroundColor:a.paid?"rgba(255, 255, 0, 0.3)":void 0},children:[n(g.Td,{children:st.format(new Date(a.start_time))}),n(g.Td,{children:a.finish_time.Valid?st.format(new Date(a.finish_time.Time)):"Not finished"}),n(g.Td,{children:pd(a.duration)}),n(g.Td,{children:se(Number(a.donations*100))}),n(g.Td,{children:se(Number(a.dares_earnings*100))}),n(g.Td,{children:se(Number(a.purchases*100))}),n(g.Td,{children:se(Number(a.total_on_hands*100))}),n(g.Td,{children:a.paid?"True":"False"})]},o))})]})})]})}function kM({filter:e,onChange:t,onApply:r,onReset:i,paidFilter:s,onPaidFilterChange:a}){var l;const o=[e.dateFrom?new Date(e.dateFrom):null,e.dateTo?new Date(e.dateTo):null];return u($,{mb:"md",align:"flex-end",wrap:"wrap",children:[n(Te,{label:"Username",placeholder:"e.g. admin",value:e.username??"",onChange:c=>t({...e,username:c.currentTarget.value}),w:140}),n(Yr,{type:"range",label:"Date range",placeholder:"Pick dates",value:o,onChange:([c,d])=>t({...e,dateFrom:c?c.toISOString().slice(0,10):null,dateTo:d?d.toISOString().slice(0,10):null}),w:260,clearable:!0}),n(hy,{label:"Exclude user IDs",placeholder:"Type an ID and press Enter",value:((l=e.excludedUserIds)==null?void 0:l.map(String))??[],onChange:c=>t({...e,excludedUserIds:c.map(d=>Number(d)).filter(d=>!Number.isNaN(d))}),w:260}),n(V,{onClick:r,children:"Apply"}),n(V,{variant:"default",onClick:i,children:"Reset"}),u("div",{children:[n(v,{size:"sm",fw:500,mb:4,children:"Paid status"}),n(Sc,{value:s,onChange:c=>a(c),data:[{label:"All",value:"all"},{label:"Paid",value:"paid"},{label:"Unpaid",value:"unpaid"}]})]})]})}function EM(){const{t:e}=Fe(),{user:t}=fe(),{colorScheme:r}=vt(),[i,s]=_.useState({}),[a,o]=_.useState({}),[l,c]=_.useState("all"),{statisticsQuery:d}=js(t,a),p=lg(a),h=_.useMemo(()=>{var b;const m=(b=d.data)==null?void 0:b.filter(S=>S.finish_time),y=SM(m,l);return y==null?void 0:y.sort((S,k)=>new Date(k.finish_time.Time).getTime()-new Date(S.finish_time.Time).getTime())},[d.data,l]),f=_.useMemo(()=>CM(h),[h]);return u(ue,{withBorder:!0,children:[n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:e("statistics_description")}})})}),n(kM,{filter:i,onChange:s,onApply:()=>o(i),onReset:()=>{s({}),o({}),c("all")},paidFilter:l,onPaidFilterChange:c}),p?d.isLoading?n(v,{c:"dimmed",ta:"center",py:"xl",children:e("statistics_loading","Loading...")}):d.isError?n(v,{c:"red",ta:"center",py:"xl",children:e("statistics_error","Failed to load statistics.")}):u(ke,{children:[n(TM,{summary:f,t:e}),n(g.ScrollContainer,{minWidth:500,children:u(g,{striped:!0,stripedColor:r==="dark"?"dark.7":"gray.1",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Username"}),n(g.Th,{children:e("statistics_start")}),n(g.Th,{children:e("statistics_finish")}),n(g.Th,{children:e("statistics_duration")}),n(g.Th,{children:e("statistics_donations")}),n(g.Th,{children:e("statistics_dares")}),n(g.Th,{children:e("statistics_purchases","Purchases")}),n(g.Th,{children:e("statistics_total")}),n(g.Th,{children:e("statistics_excluded_spendings","Excluded users spendings")}
428),n(g.Th,{children:"Type"})]})}),n(g.Tbody,{children:h==null?void 0:h.map((m,y)=>u(g.Tr,{style:{backgroundColor:m.paid?"rgba(255, 255, 0, 0.3)":void 0},children:[n(g.Td,{children:m.username}),n(g.Td,{children:st.format(new Date(m.start_time))}),n(g.Td,{children:m.finish_time.Valid?st.format(new Date(m.finish_time.Time)):"Not finished"}),n(g.Td,{children:pd(m.duration)}),n(g.Td,{children:se(Number(m.donations*100))}),n(g.Td,{children:se(Number(m.dares_earnings*100))}),n(g.Td,{children:se(Number(m.purchases*100))}),n(g.Td,{children:se(Number(m.total_on_hands*100))}),n(g.Td,{children:se(Number(m.excluded_users_spendings*100))}),n(g.Td,{children:m.paid?"Paid":"Unpaid"})]},y))})]})})]}):n(v,{c:"dimmed",ta:"center",py:"xl",children:e("statistics_no_filter_applied","Apply a filter above to view stream statistics.")})]})}function PM(){const{user:e}=fe();return e&&he(e,Ce)?n(EM,{}):n(xM,{})}const MM=()=>{var R;const{user:e}=fe(),t=_.useRef(null),[r,i]=_.useState(!1),[s,a]=_.useState(!1),{messagesQuery:o,sendMessageMutation:l,uploadImageMutation:c,readSupportMutation:d,notificationCountQuery:p}=Bs(),h=o(e==null?void 0:e.username),f=_.useRef(null),[m,y]=_.useState(null),[b,S]=_.useState(!1),k=_.useRef(),w=_.useRef(new Set);_.useEffect(()=>{const E=new IntersectionObserver(z=>{z.forEach(N=>{var C;if(N.isIntersecting){const M=N.target,P=Number(M.dataset.messageId);if(w.current.has(P))return;w.current.add(P),P&&(((C=p.data)==null?void 0:C.unread)??0)>0&&d.mutate({id:P},{onSuccess(){p.refetch()},onError(){w.current.delete(P)}})}})});return k.current=E,()=>E.disconnect()},[d,p,k]);const T=Ge({initialValues:{message:""},validate:{message:$r("Message cannot be empty")}});if(_.useEffect(()=>{if(s)return;t.current=new WebSocket(`${ed}/notifications`),t.current.onopen=()=>i(!0),t.current.onclose=()=>{i(!1),a(!0),setTimeout(()=>a(!1),250)},t.current.onmessage=z=>{const N=JSON.parse(z.data);if(N.type==="support"||N.type==="support_delete_message"){h.refetch(),setTimeout(()=>{var C;(C=f.current)==null||C.scrollTo({top:f.current.scrollHeight,behavior:"instant"})},150);return}};const E=t.current;return()=>{E&&E.close()}},[s]),_.useEffect(()=>{setTimeout(()=>{var E;(E=f.current)==null||E.scrollTo({top:f.current.scrollHeight,behavior:"instant"})},150)},[h]),!e)return;const A=E=>{E&&(y(E),S(!0))};return u(ke,{children:[u(Oe,{opened:b,onClose:()=>{S(!1),y(null)},centered:!0,size:"auto",styles:{content:{borderRadius:"20px"},inner:{padding:"20px"},body:{padding:"20px"}},withCloseButton:!1,children:[u(mt,{justify:"space-between",align:"center",mb:"md",children:[n(Ye,{order:4,children:"Upload Image"}),n(Ne,{variant:"outline",color:"gray",size:"lg",radius:"xl",onClick:()=>{y(null),S(!1)},children:n(ht,{size:20})})]}),u(j,{align:"center",gap:"md",children:[m&&n(jr,{src:URL.createObjectURL(m),mah:300,fit:"contain",style:{borderRadius:"15px"},onLoad:()=>URL.revokeObjectURL(URL.createObjectURL(m))}),u(j,{gap:"sm",w:"100%",children:[n(V,{variant:"filled",disabled:c.isPending,loading:c.isPending,style:{borderRadius:"50px"},onClick:()=>{m&&c.mutate({image:m,username:e.username},{onSuccess(){y(null),S(!1),h.refetch()},onError(E){Ee.show({position:"top-center",title:"Error",message:`${E.message}`,color:"red"})}})},children:"Send Image"}),n(Rr,{onChange:A,accept:"image/*",multiple:!1,children:E=>n(V,{variant:"light",...E,style:{borderRadius:"50px"},children:"Change Image"})})]})]})]}),u(j,{style:{height:"calc(100vh - 90px)",width:"100%",maxWidth:"600px",margin:"0 auto",justifyContent:"space-between",overflow:"hidden",padding:0},children:[n(Ye,{order:3,ta:"center",style:{padding:"0.25rem 0",margin:0,minHeight:"auto",fontSize:"1rem"},children:"Support"}),n(Lt,{viewportRef:f,style:{flex:1,width:"100%",padding:"0 0.5rem",minHeight:0},children:n(j,{gap:"xs",justify:"flex-end",style:{minHeight:"100%"},children:(R=h.data)==null?void 0:R.map(E=>n(ad,{...E,username:"test",receiver:{id:0},observer:k.current},E.id))})}),u("form",{onSubmit:T.onSubmit(E=>{l.mutate(E,{onSuccess(){h.refetch(),T.reset()},onError(z){Ee.show({position:"top-center",title:"Error",message:`${z.message}`,color:"red"})}})}),style:{display:"flex",alignItems:"center",gap:"0.5rem",padding:"0.5rem",width:"100%"},children:[n(Te,{placeholder:"Type a message...",flex:1,styles:{input:{borderRadius:"50px",paddingLeft:"0.75rem",paddingRight:"0.75rem",he
428ight:"38px",display:"flex",alignItems:"center"}},...T.getInputProps("message")}),!T.values.message.trim()&&!m&&n(Rr,{onChange:A,accept:"image/*",multiple:!1,children:E=>n(Ne,{variant:"filled",size:"lg",radius:"xl",...E,style:{display:"flex",alignItems:"center",justifyContent:"center",height:"38px",width:"38px"},children:n(gn,{size:18})})}),(T.values.message.trim()||m)&&n(Ne,{variant:"filled",size:"lg",radius:"xl",disabled:l.isPending||c.isPending,loading:l.isPending||c.isPending,onClick:()=>{m?S(!0):T.onSubmit(E=>{l.mutate(E,{onSuccess(){h.refetch(),T.reset()},onError(z){Ee.show({position:"top-center",title:"Error",message:`${z.message}`,color:"red"})}})})()},type:"button",style:{display:"flex",alignItems:"center",justifyContent:"center",height:"38px",width:"38px"},children:n(_b,{size:18})})]})]})]})},AM=/^\s*>\s$/,DM=nn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",Rt(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}}
vendor: 1,036 bytes, line 428
428,addInputRules(){return[hs({find:AM,type:this.type})]}}),IM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,$M=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,RM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,zM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,NM=Ka.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Rt(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Pi({find:IM,type:this.type}),Pi({find:RM,type:this.t
vendor: 8,486 bytes, lines 428-431
428ype})]},addPasteRules(){return[Ei({find:$M,type:this.type}),Ei({find:zM,type:this.type})]}}),LM="listItem",_h="textStyle",vh=/^\s*([-+*])\s$/,OM=nn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Rt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(LM,this.editor.getAttributes(_h)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=hs({find:vh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=hs({find:vh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(_h),editor:this.editor})),[e]}}),FM=/(^|[^`])`([^`]+)`(?!`)/,UM=/(^|[^`])`([^`]+)`(?!`)/g,BM=Ka.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Rt(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Pi({find:FM,type:this.type})]},addPasteRules(){return[Ei({find:UM,type:this.type})]}}),qM=/^```([a-z]+)?[\s\n]$/,jM=/^~~~([a-z]+)?[\s\n]$/,HM=nn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:r}=this.options,a=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(o=>o.startsWith(r)).map(o=>o.replace(r,""))[0];return a||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Rt(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,r=t.pos===1;return!e||t.parent.type.name!==this.name?!1:r||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:r}=t,{$from:i,empty:s}=r;if(!s||i.parent.type!==this.type)return!1;const a=i.parentOffset===i.parent.nodeSize-2,o=i.parent.textContent.endsWith(`
429
430`);return!a||!o?!1:e.chain().command(({tr:l})=>(l.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:r,doc:i}=t,{$from:s,empty:a}=r;if(!a||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const l=s.after();return l===void 0?!1:i.nodeAt(l)?e.commands.command(({tr:d})=>(d.setSelection(ps.near(i.resolve(l))),!0)):e.commands.exitCode()}}},addInputRules(){return[Pl({find:qM,type:this.type,getAttributes:e=>({language:e[1]})}),Pl({find:jM,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Ga({key:new Tc("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const r=t.clipboardData.getData("text/plain"),i=t.clipboardData.getData("vscode-editor-data"),s=i?JSON.parse(i):void 0,a=s==null?void 0:s.mode;if(!r||!a)return!1;const{tr:o,schema:l}=e.state,c=l.text(r.replace(/\r\n?/g,`
431`));return o.replaceSelectionWith(this.type.create({language:a},c)),o.selection.$from.parent.type!==this.type&&o.setSelection(si.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}}),WM=nn.create({name:"doc",topNode:!0,content:"block+"});function YM(e={}){return new Ga({view(t){return new QM(t,e)}})}class QM{constructor(t,r){var i;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(i=r.width)!==null&&i!==void 0?i:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let a=o=>{this[s](o)};return t.dom.addEventListener(s,a),{name:s,handler:a}})}destroy(){this.handlers.forEach(({name:t,handler:r})=>this.editorView.dom.removeEventListener(t,r))}update(t,r){this.cursorPos!=null&&r.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),r=!t.parent.inlineContent,i,s=this.editorView.dom,a=s.getBoundingClientRect(),o=a.width/s.offsetWidth,l=a.height/s.offsetHeight;if(r){let h=t.nodeBefore,f=t.nodeAfter;if(h||f){let m=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(m){let y=m.getBoundingClientRect(),b=h?y.bottom:y.top;h&&f&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let S=this.width/2*l;i={left:y.left,right:y.right,top:b-S,bottom:b+S}}}}if(!i){let h=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;i={left:h.left-f,right:h.left+f,top:h.top,bottom:h.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let d,p;if(!c||c==document.body&&getComputedStyle(c).position=="static")d=-pageXOffset,p=-pageYOffset;else{let h=c.getBoundingClientRect(),f=h.width/c.offsetWidth,m=h.height/c.offsetHeight;d=h.left-c.scrollLeft*f,p=h.top-c.scrollTop*m}this.element.style.left=(i.left-d)/o+"px",this.element.style.top=(i.top-p)/l+"px",this.element.style.width=(i.right-i.left)/o+"px",this.element.style.height=(i.bottom-i.top)/l+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),i=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),s=i&&i.type.spec.disableDropCursor,a=typeof s=="function"?s(this.editorView,r,t):s;if(r&&!a){let o=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=_y(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const VM=Xa.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[YM(this.options)]}});class nt extends ps{constructor(t){super(t,t)}map(t,r){let i=t.resolve(r.map(this.head));return nt.valid(i)?new nt(i):ps.near(i)}content(){return vp.empty}eq(t){return t instanceof nt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new nt(t.resolve(r.pos))}getBookmark(){return new md(this.anchor)}static valid(t){let r=t.parent;if(r.isTextblock||!KM(t)||!GM(t))return!1;let i=r.type.spec.allowGapCursor;if(i!=null)return i;let s=r.contentMatchAt(t.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(t,r,i=!1){e:for(;;){if(!i&&nt.valid(t))return t;let s=t.pos,a=null;for(let o=t.depth;;o--){let l=t.node(o);if(r>
vendor: 1,329 bytes, line 431
4310?t.indexAfter(o)<l.childCount:t.index(o)>0){a=l.child(r>0?t.indexAfter(o):t.index(o)-1);break}else if(o==0)return null;s+=r;let c=t.doc.resolve(s);if(nt.valid(c))return c}for(;;){let o=r>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!xc.isSelectable(a)){t=t.doc.resolve(s+a.nodeSize*r),i=!1;continue e}break}a=o,s+=r;let l=t.doc.resolve(s);if(nt.valid(l))return l}return null}}}nt.prototype.visible=!1;nt.findFrom=nt.findGapCursorFrom;ps.jsonID("gapcursor",nt);class md{constructor(t){this.pos=t}map(t){return new md(t.map(this.pos))}resolve(t){let r=t.resolve(this.pos);return nt.valid(r)?new nt(r):ps.near(r)}}function KM(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),i=e.node(t);if(r==0){if(i.type.spec.isolating)return!0;continue}for(let s=i.child(r-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||s.isAtom||s.type.spec.isolating)return!0;if(s.inlineContent)return!1}}return!0}function GM(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),i=e.node(t);if(r==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let s=i.child(r);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||s.isAtom||s.type.spec.isolating)return!0;if(s.inlineContent)return!1}}return!0}function XM(){return new Ga({props:{decorations:tA,createSelectionBetween(e,t,r){return t.pos==r.pos&&nt.valid(r)?new nt(r):null}
vendor: 3,516 bytes, lines 431-432
431,handleClick:ZM,handleKeyDown:JM,handleDOMEvents:{beforeinput:eA}}})}const JM=vy({ArrowLeft:ra("horiz",-1),ArrowRight:ra("horiz",1),ArrowUp:ra("vert",-1),ArrowDown:ra("vert",1)});function ra(e,t){const r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(i,s,a){let o=i.selection,l=t>0?o.$to:o.$from,c=o.empty;if(o instanceof si){if(!a.endOfTextblock(r)||l.depth==0)return!1;c=!1,l=i.doc.resolve(t>0?l.after():l.before())}let d=nt.findGapCursorFrom(l,t,c);return d?(s&&s(i.tr.setSelection(new nt(d))),!0):!1}}function ZM(e,t,r){if(!e||!e.editable)return!1;let i=e.state.doc.resolve(t);if(!nt.valid(i))return!1;let s=e.posAtCoords({left:r.clientX,top:r.clientY});return s&&s.inside>-1&&xc.isSelectable(e.state.doc.nodeAt(s.inside))?!1:(e.dispatch(e.state.tr.setSelection(new nt(i))),!0)}function eA(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof nt))return!1;let{$from:r}=e.state.selection,i=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!i)return!1;let s=xd.empty;for(let o=i.length-1;o>=0;o--)s=xd.from(i[o].createAndFill(null,s));let a=e.state.tr.replace(r.pos,r.pos,new vp(s,0,0));return a.setSelection(si.near(a.doc.resolve(r.pos+1))),e.dispatch(a),!1}function tA(e){if(!(e.selection instanceof nt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",wy.create(e.doc,[Sy.widget(e.selection.head,t,{key:"gapcursor"})])}const nA=Xa.create({name:"gapCursor",addProseMirrorPlugins(){return[XM()]},extendNodeSchema(e){var t;const r={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Cy(Ty(e,"allowGapCursor",r)))!==null&&t!==void 0?t:null}}}),rA=nn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Rt(this.options.HTMLAttributes,e)]},renderText(){return`
432`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:r,editor:i})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:s,storedMarks:a}=r;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=i.extensionManager,c=a||s.$to.parentOffset&&s.$from.marks();return t().insertContent({type:this.name}).command(({tr:d,dispatch:p})=>{if(p&&c&&o){const h=c.filter(f=>l.includes(f.type.name));d.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),iA=nn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Pl({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
432)\\s$`),type:this.type,getAttributes:{level:e}}))}});var qa=200,ft=function(){};ft.prototype.append=function(t){return t.length?(t=ft.from(t),!this.length&&t||t.length<qa&&this.leafAppend(t)||this.length<qa&&t.leafPrepend(this)||this.appendInner(t)):this};ft.prototype.prepend=function(t){return t.length?ft.from(t).append(this):this};ft.prototype.appendInner=function(t){return new sA(this,t)};ft.prototype.slice=function(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.length),t>=r?ft.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};ft.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};ft.prototype.forEach=function(t,r,i){r===void 0&&(r=0),i===void 0&&(i=this.length),r<=i?this.forEachInner(t,r,i,0):this.forEachInvertedInner(t,r,i,0)};ft.prototype.map=function(t,r,i){r===void 0&&(r=0),i===void 0&&(i=this.length);var s=[];return this.forEach(function(a,o){return s.push(t(a,o))},r,i),s};ft.from=function(t){return t instanceof ft?t:t&&t.length?new dg(t):ft.empty};var dg=function(e){function t(i){e.call(this),this.values=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(s,a){return s==0&&a==this.length?this:new t(this.values.slice(s,a))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,a,o,l){for(var c=a;c<o;c++)if(s(this.values[c],l+c)===!1)return!1},t.prototype.forEachInvertedInner=function(s,a,o,l){for(var c=a-1;c>=o;c--)if(s(this.values[c],l+c)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=qa)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=qa)return new t(s.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(ft);ft.empty=new dg([]);var sA=function(e){function t(r,i){e.call(this),this.left=r,this.right=i,this.length=r.length+i.length,this.depth=Math.max(r.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},t.prototype.forEachInner=function(i,s,a,o){var l=this.left.length;if(s<l&&this.left.forEachInner(i,s,Math.min(a,l),o)===!1||a>l&&this.right.forEachInner(i,Math.max(s-l,0),Math.min(this.length,a)-l,o+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,s,a,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(i,s-l,Math.max(a,l)-l,o+l)===!1||a<l&&this.left.forEachInvertedInner(i,Math.min(s,l),a,o)===!1)return!1},t.prototype.sliceInner=function(i,s){if(i==0&&s==this.length)return this;var a=this.left.length;return s<=a?this.left.slice(i,s):i>=a?this.right.slice(i-a,s-a):this.left.slice(i,a).append(this.right.slice(0,s-a))},t.prototype.leafAppend=function(i){var s=this.right.leafAppend(i);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(i){var s=this.left.leafPrepend(i);if(s)return new t(s,this.right)},t.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new t(this.left,new t(this.right,i)):new t(this,i)},t}(ft);const aA=500;class Gt{constructor(t,r){this.items=t,this.eventCount=r}popEvent(t,r){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let s,a;r&&(s=this.remapping(i,this.items.length),a=s.maps.length);let o=t.tr,l,c,d=[],p=[];return this.items.forEach((h,f)=>{if(!h.step){s||(s=this.remapping(i,f+1),a=s.maps.length),a--,p.push(h);return}if(s){p.push(new sn(h.map));let m=h.step.map(s.slice(a)),y;m&&o.maybeStep(m).doc&&(y=o.mapping.maps[o.mapping.maps.length-1],d.push(new sn(y,void 0,void 0,d.length+p.length))),a--,y&&s.appendMap(y,a)}else o.maybeStep(h.step);if(h.selection)return l=s?h.selection.map(s.slice(a)):h.selection,c=new Gt(this.items.slice(0,i).append(p.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:l}}addTransform(t,r,i,s){let a=[],o=this.eventCount,l=this.items,c=!s&&l.length?l.get(l.length-1):null;for(let p=0;p<t.steps.length;p++){let h=t.steps[p].invert(t.docs[p]),f=new sn(t.mapping.maps[p],h,r),m;(m=c&&c.merge(f))&&(f=m,p?a.pop():l=l.slice(0,l.length-1)),a.push(f),r&&(o++,r=void 0),s||(c=f)}let d=o-i.depth;return d>lA&&(l=oA(l,d),o-=d),new Gt(l.append(a),o)}remapping(t,r){let i=new xy;
vendor: 8,497 bytes, line 432
432return this.items.forEach((s,a)=>{let o=s.mirrorOffset!=null&&a-s.mirrorOffset>=t?i.maps.length-s.mirrorOffset:void 0;i.appendMap(s.map,o)},t,r),i}addMaps(t){return this.eventCount==0?this:new Gt(this.items.append(t.map(r=>new sn(r))),this.eventCount)}rebased(t,r){if(!this.eventCount)return this;let i=[],s=Math.max(0,this.items.length-r),a=t.mapping,o=t.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},s);let c=r;this.items.forEach(f=>{let m=a.getMirror(--c);if(m==null)return;o=Math.min(o,m);let y=a.maps[m];if(f.step){let b=t.steps[m].invert(t.docs[m]),S=f.selection&&f.selection.map(a.slice(c+1,m));S&&l++,i.push(new sn(y,b,S))}else i.push(new sn(y))},s);let d=[];for(let f=r;f<o;f++)d.push(new sn(a.maps[f]));let p=this.items.slice(0,s).append(d).append(i),h=new Gt(p,l);return h.emptyItemCount()>aA&&(h=h.compress(this.items.length-i.length)),h}emptyItemCount(){let t=0;return this.items.forEach(r=>{r.step||t++}),t}compress(t=this.items.length){let r=this.remapping(0,t),i=r.maps.length,s=[],a=0;return this.items.forEach((o,l)=>{if(l>=t)s.push(o),o.selection&&a++;else if(o.step){let c=o.step.map(r.slice(i)),d=c&&c.getMap();if(i--,d&&r.appendMap(d,i),c){let p=o.selection&&o.selection.map(r.slice(i));p&&a++;let h=new sn(d.invert(),c,p),f,m=s.length-1;(f=s.length&&s[m].merge(h))?s[m]=f:s.push(h)}}else o.map&&i--},this.items.length,0),new Gt(ft.from(s.reverse()),a)}}Gt.empty=new Gt(ft.empty,0);function oA(e,t){let r;return e.forEach((i,s)=>{if(i.selection&&t--==0)return r=s,!1}),e.slice(r)}class sn{constructor(t,r,i,s){this.map=t,this.step=r,this.selection=i,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let r=t.step.merge(this.step);if(r)return new sn(r.getMap().invert(),r,this.selection)}}}class Qn{constructor(t,r,i,s,a){this.done=t,this.undone=r,this.prevRanges=i,this.prevTime=s,this.prevComposition=a}}const lA=20;function cA(e,t,r,i){let s=r.getMeta(Dr),a;if(s)return s.historyState;r.getMeta(hA)&&(e=new Qn(e.done,e.undone,null,0,-1));let o=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(o&&o.getMeta(Dr))return o.getMeta(Dr).redo?new Qn(e.done.addTransform(r,void 0,i,ba(t)),e.undone,wh(r.mapping.maps),e.prevTime,e.prevComposition):new Qn(e.done,e.undone.addTransform(r,void 0,i,ba(t)),null,e.prevTime,e.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=r.getMeta("composition"),c=e.prevTime==0||!o&&e.prevComposition!=l&&(e.prevTime<(r.time||0)-i.newGroupDelay||!dA(r,e.prevRanges)),d=o?wl(e.prevRanges,r.mapping):wh(r.mapping.maps);return new Qn(e.done.addTransform(r,c?t.selection.getBookmark():void 0,i,ba(t)),Gt.empty,d,r.time,l??e.prevComposition)}else return(a=r.getMeta("rebased"))?new Qn(e.done.rebased(r,a),e.undone.rebased(r,a),wl(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new Qn(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),wl(e.prevRanges,r.mapping),e.prevTime,e.prevComposition)}function dA(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((i,s)=>{for(let a=0;a<t.length;a+=2)i<=t[a+1]&&s>=t[a]&&(r=!0)}),r}function wh(e){let t=[];for(let r=e.length-1;r>=0&&t.length==0;r--)e[r].forEach((i,s,a,o)=>t.push(a,o));return t}function wl(e,t){if(!e)return null;let r=[];for(let i=0;i<e.length;i+=2){let s=t.map(e[i],1),a=t.map(e[i+1],-1);s<=a&&r.push(s,a)}return r}function uA(e,t,r){let i=ba(t),s=Dr.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,i);if(!a)return null;let o=a.selection.resolve(a.transform.doc),l=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),s,i),c=new Qn(r?l:a.remaining,r?a.remaining:l,null,0,-1);return a.transform.setSelection(o).setMeta(Dr,{redo:r,historyState:c})}let Sl=!1,Sh=null;function ba(e){let t=e.plugins;if(Sh!=t){Sl=!1,Sh=t;for(let r=0;r<t.length;r++)if(t[r].spec.historyPreserveItems){Sl=!0;break}}return Sl}const Dr=new Tc("history"),hA=new Tc("closeHistory");function pA(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Ga({key:Dr,state:{init(){return new Qn(Gt.empty,Gt.empty,null,0,-1)},apply(t,r,i){return cA(r,i,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,r){let i=r.inputType,s=i=="historyUndo"?hg:i=="historyRedo"?pg:null;return s?(r.preventDefault(),s(t.state,t.dispatch)):!1}}}})}function ug(e,t){return(r,i)=>{let s=Dr.getState(r);if(!s||(e?s.undone:s.done).eventCount==0)return!1;if(i){let a=uA(s,r,e);a&&i(t?a.scrollIntoView():a)}return!0}}const hg=ug(!1,!0),pg=ug(!0,!0),mA=Xa.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>hg(e,t),redo:()=>({state:e,dispatch:t})=>pg(e,t)}},addProseMirrorPlugins(){return[pA(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),fA=nn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Rt(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:r}=t,{$from:i,$to:s}=r,a=e();return i.parentOffset===0?a.insertContentAt({from:Math.max(i.pos-1,0),to:s.pos},{type:this.name}):Ey(r)?a.insertContentAt(s.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:o,dispatch:l})=>{var c;if(l){const{$to:d}=o.selection,p=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?o.setSelection(si.create(o.doc,d.pos+1)):d.nodeAfter.isBlock?o.setSelection(xc.create(o.doc,d.pos)):o.setSelection(si.create(o.doc,d.pos));else{const h=(c=d.parent.type.contentMatch.defaultType)===null||c===void 0?void 0:c.create();h&&(o.insert(p,h),o.setSelection(si.create(o.doc,p+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[ky({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),gA=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,yA=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,bA=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,_A=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,vA=Ka.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Rt(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Pi({find:gA,type:this.type}),Pi({find:bA,type:this.type})]},addPasteRules(){return[Ei({find:yA,type:this.type}),Ei({find:_A,type:this.type})]}}),wA=nn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Rt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),SA="listItem",Ch="textStyle",Th=/^(\d+)\.\s$/,CA=nn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...r}=e;return t===1?["ol",Rt(this.options.HTMLAttributes,r),0]:["ol",Rt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(SA,this.editor.getAttributes(Ch)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}
432,addInputRules(){let e=hs({find:Th,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,r)=>r.childCount+r.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=hs({find:Th,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Ch)}),joinPredicate:(t,r)=>r.childCount+r.attrs.start===+t[1],editor:this.editor})),[e]}}),TA=nn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Rt(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),xA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,kA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,EA=Ka.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Rt(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Pi({find:xA,type:this.type})]},addPasteRules(){return[Ei({find:kA,type:this.type})]}}),PA=nn.create({name:"text",group:"inline"}),MA=Xa.create({name:"starterKit",addExtensions(){const e=[];return this.options.bold!==!1&&e.push(NM.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(DM.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(OM.configure(this.options.bulletList)),this.options.code!==!1&&e.push(BM.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(HM.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(WM.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(VM.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(nA.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(rA.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(iA.configure(this.options.heading)),this.options.history!==!1&&e.push(mA.configure(this.options.history)),this.options.horizontalRule!==!1&&e.push(fA.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(vA.configure(this.options.italic)),this.options.listItem!==!1&&e.push(wA.configure(this.options.listItem)),this.options.orderedList!==!1&&e.push(CA.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(TA.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(EA.configure(this.options.strike)),this.options.text!==!1&&e.push(PA.configure(this.options.text)),e}});function xh({content:e,onChange:t}){const r=Py({extensions:[MA,Ay],content:e,onUpdate:({editor:i})=>{const s=i.getHTML();t(s==="<p></p>"||s==="<p><br></p>"?"":s)}});return _.useEffect(()=>{r&&r.getHTML()!==e&&r.commands.setContent(e,!1)},[e,r]),u(qe,{editor:r,children:[u(qe.Toolbar,{children:[u(qe.ControlsGroup,{children:[n(qe.Bold,{}),n(qe.Italic,{}),n(qe.Underline,{}),n(qe.Strikethrough,{}),n(qe.ClearFormatting,{}),n(qe.Highlight,{}),n(qe.Code,{})]}),u(qe.ControlsGroup,{children:[n(qe.H1,{}),n(qe.H2,{}),n(qe.H3,{}),n(qe.H4,{})]}),u(qe.ControlsGroup,{children:[n(qe.Blockquote,{}),n(qe.Hr,{}),n(qe.BulletList,{}),n(qe.OrderedList,{}),n(qe.Subscript,{}),n(qe.Superscript,{})]}),u(qe.ControlsGroup,{children:[n(qe.Link,{}),n(qe.Unlink,{})]})]}),r&&n(My,{editor:r,children:u(qe.ControlsGroup,{children:[n(qe.Bold,{}),n(qe.Italic,{}),n(qe.Link,{})]})}),n(qe.Content,{})]})}function AA(){const{id:e}=Bn();if(!e)return null;const{updateEventMutation:t,createEventMutation:r,getEventQuery:i,getEventsQuery:s}=kf(),a=s(),o=i(parseInt(e)),[l,c]=_.useState(""),[d,p]=_.useState(""),[h,f]=_.useState(""),[m,y]=_.useState(""),b=gt();return _.useEffect(()=>{var S,k,w,T;c(((S=o.data)==null?void 0:S.description_eng)??""),f(((k=o.data)==null?void 0:k.title_eng)??""),p(((w=o.data)==null?void 0:w.description_ru)??""),y(((T=o.data)==null?void 0:T.title_ru)??"")},[o.data]),n(ue,{withBorder:!0,children:u(j,{children:[u($,{justify:"space-between",children:[n(Ze,{component:xe,to:"/admin/events",children:"Back to events"}),n(V,{onClick:()=>
432{if(parseInt(e)===0){r.mutate({title_eng:h,title_ru:m,description_eng:l,description_ru:d},{onSuccess(){a.refetch(),o.refetch(),b("/admin/events")}});return}t.mutate({id:parseInt(e),title_eng:h,title_ru:m,description_eng:l,description_ru:d},{onSuccess(){a.refetch(),o.refetch(),b("/admin/events")}})},variant:"light",color:"green.2",leftSection:n(Fp,{size:"1rem"}),children:parseInt(e)===0?"Save":"Update"})]}),u($,{align:"start",grow:!0,children:[u(j,{children:[n(Ye,{order:4,children:"English"}),n(Te,{value:h,onChange:S=>f(S.target.value),label:"Title"}),n(xh,{content:l,onChange:c})]}),u(j,{children:[n(Ye,{order:4,children:"Russian"}),n(Te,{value:m,onChange:S=>y(S.target.value),label:"Title"}),n(xh,{content:d,onChange:p})]})]})]})})}const Cl=10,mg=Object.entries(of).map(([e,t])=>({value:String(e),label:t}));function DA({topupId:e,topupBy:t,onUpdate:r}){const[i,s]=_.useState(!1),a=t!=null?of[t]??String(t):null;return i?n(it,{autoFocus:!0,defaultDropdownOpened:!0,size:"xs",data:mg,defaultValue:t!=null?String(t):null,onBlur:()=>s(!1),onChange:o=>{o!==null&&r(e,Number(o)),s(!1)},w:130}):u($,{gap:4,wrap:"nowrap",children:[a!==null?n(pe,{variant:"light",color:"gray",size:"sm",children:a}):n(v,{c:"dimmed",size:"sm",children:"—"}),n(Se,{label:"Edit",withArrow:!0,children:n(Ne,{size:"xs",variant:"subtle",color:"gray",onClick:()=>s(!0),children:n(Yp,{size:12})})})]})}function IA(){const{user:e}=fe(),{topupsQuery:t,updateTopupByMutation:r}=js(e),[i,s]=_.useState(1),[a,o]=_.useState("all"),[l,c]=_.useState([]),[d,p]=_.useState([]),[h,f]=_.useState([null,null]),{pathname:m}=qr(),[y,b]=_.useState({}),S=_.useMemo(()=>{var M;const C=new Set((M=t.data)==null?void 0:M.map(P=>P.username).filter(Boolean));return Array.from(C).sort().map(P=>({value:P,label:P}))},[t.data]);_.useEffect(()=>{m==="/finances/topups"&&s(1)},[m]);const k=_.useMemo(()=>t.data?t.data.map(C=>y[C.id]!==void 0?{...C,topup_by:y[C.id]}:C):[],[t.data,y]),w=_.useMemo(()=>{let C=[...k];if(a==="exclude"){const I=new Set([...pl,...l]);C=C.filter(L=>!I.has(L.username||""))}else if(a==="only"){const I=new Set(l);C=C.filter(L=>I.has(L.username||""))}else if(a==="all"){const I=new Set(pl);C=C.filter(L=>!I.has(L.username||""))}const[M,P]=h;if((M!==null||P!==null)&&(C=C.filter(I=>{const L=I.performed_at,U=L.endsWith("Z")||/[+-]\d{2}:\d{2}$/.test(L)?L:L+"Z",q=new Date(U).getTime(),B=M?Date.UTC(M.getFullYear(),M.getMonth(),M.getDate()):null,Y=P??M,Q=Y?Date.UTC(Y.getFullYear(),Y.getMonth(),Y.getDate()+1)-1:null;return(!B||q>=B)&&(!Q||q<=Q)})),d.length>0){const I=new Set(d.map(Number));C=C.filter(L=>L.topup_by!==null&&L.topup_by!==void 0?I.has(L.topup_by):!1)}return C},[k,a,l,h,d]),T=_.useMemo(()=>[...w].sort((C,M)=>new Date(M.performed_at).getTime()-new Date(C.performed_at).getTime()),[w]),A=_.useMemo(()=>{const C=(i-1)*Cl,M=i*Cl;return T.slice(C,M)},[T,i]),R=Math.ceil(T.length/Cl),E=_.useMemo(()=>w.reduce((C,M)=>C+Number(M.amount||0),0),[w]),z=_.useMemo(()=>{const C={};return w.forEach(M=>{const P=new Date(M.performed_at),I=`${P.getFullYear()}-${String(P.getMonth()+1).padStart(2,"0")}`;C[I]=(C[I]||0)+Number(M.amount||0)}),Object.entries(C).sort(([M],[P])=>M.localeCompare(P)).map(([M,P])=>({month:M,amount:P}))},[w]),N=(C,M)=>{b(P=>({...P,[C]:M})),r.mutate({id:C,topup_by:M})};return u(ue,{withBorder:!0,children:[u($,{mb:"md",children:[n(it,{label:"Filter Mode",data:[{value:"all",label:"All (excluding defaults)"},{value:"exclude",label:"Exclude Specific Usernames"},{value:"only",label:"Only These Usernames"}],value:a,onChange:C=>{o(C),s(1)},w:250}),a==="exclude"&&n(ii,{label:"Select usernames to exclude",placeholder:"Start typing username...",data:S,value:l,onChange:c,searchable:!0,nothingFoundMessage:"No username found",w:300}),a==="only"&&n(ii,{label:"Select usernames to show",placeholder:"Start typing username...",data:S,value:l,onChange:c,searchable:!0,nothingFoundMessage:"No username found",w:300})]}),u($,{mb:"md",children:[n(Yr,{type:"range",label:"Filter by date (UTC) — pick one date or a range",placeholder:"Pick a date or range",value:h,onChange:C=>{f(C??[null,null]),s(1)},w:320,allowSingleDateInRange:!0}),n(ii,{label:"Filter by Topup By",placeholder:"Select sources...",data:mg,value:d,onChange:C=>{p(C),s(1)},searchable:!0,nothingFoundMessage:"No option found",w:250})]}),a!=="only"&&u(v,{size:"sm",c:"dimmed",mb:"md",children:["Default excluded usernames:"," ",pl.map(C=>n(pe,{variant:"outline",mr:4,children:C},C))]}
432),n(g.ScrollContainer,{minWidth:500,children:u(g,{striped:!0,stripedColor:"dark.7",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Username"}),n(g.Th,{children:"Amount"}),n(g.Th,{children:"Performed At"}),n(g.Th,{children:"Topup By"})]})}),n(g.Tbody,{children:A.map((C,M)=>u(g.Tr,{children:[n(g.Td,{children:C.username||"N/A"}),n(g.Td,{children:se(Number(C.amount))}),n(g.Td,{children:(()=>{const P=new Date(C.performed_at),I=P.toISOString().replace("T"," ").slice(0,19)+" UTC",L=P.toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"});return u("div",{children:[n(v,{size:"sm",children:I}),n(v,{size:"xs",c:"dimmed",children:L})]})})()}),n(g.Td,{children:n(DA,{topupId:C.id,topupBy:C.topup_by??null,onUpdate:N})})]},M))})]})}),n(mt,{justify:"flex-end",mt:"md",children:u(v,{fw:700,children:["Total: ",se(E)]})}),z.length>0&&u(ke,{children:[n(v,{mt:"lg",fw:600,children:"Monthly Totals"}),u(g,{mt:"xs",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Month"}),n(g.Th,{children:"Total Amount"})]})}),n(g.Tbody,{children:z.map(({month:C,amount:M},P)=>u(g.Tr,{children:[n(g.Td,{children:C}),n(g.Td,{children:se(M)})]},P))})]})]}),n($,{justify:"center",mt:"md",children:n(yt,{color:"dark.4",value:i,onChange:C=>s(C),total:R})})]})}const Tl=10;function kh(e){return new Map([[0,{status:"pending",color:"blue"}],[1,{status:"completed",color:"green"}],[2,{status:"cancelled",color:"red"}]]).get(e)??{status:"unknown",color:"gray"}}function $A(){const{withdrawalsQuery:e}=Qr(),[t,r]=_.useState(1),[i,s]=_.useState("all"),[a,o]=_.useState([]),[l,c]=_.useState(void 0),{pathname:d}=qr(),p=_.useMemo(()=>{var w;const k=new Set((w=e.data)==null?void 0:w.map(T=>T.username).filter(T=>!!T));return Array.from(k).sort().map(T=>({value:T,label:T}))},[e.data]);_.useEffect(()=>{d==="/finances/withdrawals"&&r(1)},[d]);const h=_.useMemo(()=>{if(!e.data)return[];let k=e.data.filter(w=>w.request_status===1);if(i==="exclude"){const w=new Set(a);k=k.filter(T=>!w.has(T.username||""))}else if(i==="only"){const w=new Set(a);k=k.filter(T=>w.has(T.username||""))}if(l){const[w,T]=l;k=k.filter(A=>{const R=new Date(A.created_at);return(!w||R>=w)&&(!T||R<=T)})}return k},[e.data,i,a,l]),f=_.useMemo(()=>[...h].sort((k,w)=>new Date(w.created_at).getTime()-new Date(k.created_at).getTime()),[h]),m=_.useMemo(()=>{const k=(t-1)*Tl,w=t*Tl;return f.slice(k,w)},[f,t]),y=Math.ceil(f.length/Tl),b=_.useMemo(()=>h.reduce((k,w)=>k+Number(w.amount||0),0),[h]),S=_.useMemo(()=>{const k={};return h.forEach(w=>{const T=new Date(w.created_at),A=`${T.getFullYear()}-${String(T.getMonth()+1).padStart(2,"0")}`;k[A]=(k[A]||0)+Number(w.amount||0)}),Object.entries(k).sort(([w],[T])=>w.localeCompare(T)).map(([w,T])=>({month:w,amount:T}))},[h]);return u(ue,{withBorder:!0,children:[u($,{mb:"md",children:[n(it,{label:"Filter Mode",data:[{value:"all",label:"All"},{value:"exclude",label:"Exclude Specific Usernames"},{value:"only",label:"Only These Usernames"}],value:i,onChange:k=>{s(k),r(1)},w:250}),i==="exclude"&&n(ii,{label:"Select usernames to exclude",placeholder:"Start typing username...",data:p,value:a,onChange:o,searchable:!0,nothingFoundMessage:"No username found",w:300}),i==="only"&&n(ii,{label:"Select usernames to show",placeholder:"Start typing username...",data:p,value:a,onChange:o,searchable:!0,nothingFoundMessage:"No username found",w:300})]}),n($,{mb:"md",children:n(Yr,{type:"range",label:"Filter by date",placeholder:"Pick dates range",value:l,onChange:c,w:300})}),n(g.ScrollContainer,{minWidth:500,children:u(g,{striped:!0,stripedColor:"dark.7",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Date"}),n(g.Th,{children:"Username"}),n(g.Th,{children:"Amount"}),n(g.Th,{children:"Method"}),n(g.Th,{children:"Closed At"}),n(g.Th,{children:"Status"})]})}),n(g.Tbody,{children:m.map(k=>{var w,T;return u(g.Tr,{children:[n(g.Td,{children:st.format(new Date(k.created_at))}),n(g.Td,{children:k.username||"N/A"}),n(g.Td,{children:se(Number(k.amount))}),n(g.Td,{children:k.method}),n(g.Td,{children:k.closed_at?st.format(new Date(k.closed_at)):"N/A"}),n(g.Td,{children:n(pe,{color:(w=kh(k.request_status))==null?void 0:w.color,variant:"dot",children:(T=kh(k.request_status))==null?void 0:T.status})})]},k.id)})})]})}),n(mt,{justify:"flex-end",mt:"md",children:u(v,{fw:700,children:["Total: ",se(b)]})}),S.length>0&&u(ke,{children:[n(v,{mt:"lg",fw:600,children:"Monthly Totals"}),u(g,{mt:"xs",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Month"}),n(g.Th,{children:"Total Amount"})]})}),n(g.Tbody,{children:S.map(({month:k,amount:w},T)=>u(g.Tr,{children:[n(g.Td,{children:k}),n(g.Td,{children:se(w)})]},T))})]})]}),n($,{justify:"center",mt:"md",children:n(yt,{color:"dark.4",value:t,onChange:k=>r(k),total:y})})]})}async function RA(){return await ae(`${O}/expenses`)}async function zA(e){return await _e(`${O}/expenses`,e)}
432async function NA(e){return await et(`${O}/expenses/${e}`)}async function LA(e){return await Ft(`${O}/expenses/${e}`)}function OA(e){const t=at(),r=oe({queryKey:["expenses"],queryFn:RA,enabled:he(e,Ce)}),i=J({mutationFn:zA,onSuccess:o=>{t.invalidateQueries({queryKey:["expenses"]});const l=(o==null?void 0:o.message)||"Expense added successfully!";Ee.show({title:"Success",message:l,color:"green"})},onError:o=>{console.error("Failed to add expense:",o),Ee.show({title:"Error",message:"Could not add expense.",color:"red"})}}),s=J({mutationFn:NA,onSuccess:o=>{t.invalidateQueries({queryKey:["expenses"]});const l=(o==null?void 0:o.message)||"Expense deleted successfully!";Ee.show({title:"Success",message:l,color:"green"})},onError:o=>{console.error("Failed to delete expense:",o),Ee.show({title:"Error",message:"Could not delete expense.",color:"red"})}}),a=J({mutationFn:LA,onSuccess:o=>{t.invalidateQueries({queryKey:["expenses"]});const l=(o==null?void 0:o.message)||"Expense marked as paid!";Ee.show({title:"Success",message:l,color:"green"})},onError:o=>{console.error("Failed to pay expense:",o),Ee.show({title:"Error",message:"Could not mark expense as paid.",color:"red"})}});return{expensesQuery:r,addExpenseMutation:i,deleteExpenseMutation:s,payExpenseMutation:a}}const Jr=0,bc=1,ls=2;function Eh(e){return new Map([[Jr,{status:"planned",color:"blue"}],[bc,{status:"paid",color:"green"}],[ls,{status:"deleted",color:"red"}]]).get(e)??{status:"unknown",color:"gray"}}function FA(){const{user:e}=fe(),{expensesQuery:t,addExpenseMutation:r,deleteExpenseMutation:i,payExpenseMutation:s}=OA(e),[a,{open:o,close:l}]=_t(!1),[c,d]=_.useState(["planned","paid"]),p=_.useMemo(()=>{const b={planned:Jr,paid:bc,deleted:ls};return c.map(S=>b[S])},[c]),h=Ge({initialValues:{title:"",date:new Date().toISOString().split("T")[0],amount:0},validate:{title:b=>b.trim()===""?"Title is required":null,date:b=>b.trim()===""?"Date is required":null,amount:b=>b<=0?"Amount must be greater than zero":null}}),f=async()=>{const b=h.values;await r.mutateAsync({...b,amount:Math.round(b.amount*100),status:Jr}),l(),h.reset()},m=async(b,S)=>{if(he(e,Ce))switch(S){case Jr:s.mutate(b);break;case bc:i.mutate(b);break}},y=_.useMemo(()=>t.data?t.data.filter(b=>p.includes(b.status)):[],[t.data,p]);return u(ue,{withBorder:!0,radius:"md",p:"xl",children:[u($,{justify:"space-between",children:[n(v,{size:"lg",fw:700,children:"Expenses"}),u($,{gap:"sm",children:[n(ii,{data:[{value:"planned",label:"Planned"},{value:"paid",label:"Paid"},{value:"deleted",label:"Deleted"}],defaultValue:["planned","paid"],onChange:d,miw:200}),n(V,{leftSection:n(Mc,{}),onClick:o,disabled:!he(e,Ce),children:"Add Expense"})]})]}),n(je,{my:"sm"}),u(g,{striped:!0,stripedColor:"dark.7",highlightOnHover:!0,children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Date"}),n(g.Th,{children:"Title"}),n(g.Th,{children:"Amount"}),n(g.Th,{children:"Status"}),n(g.Th,{children:"Actions"})]})}),n(g.Tbody,{children:y.map(b=>{var S,k;return u(g.Tr,{children:[n(g.Td,{children:new Date(b.date).toLocaleDateString()}),n(g.Td,{children:b.title}),n(g.Td,{children:se(b.amount)}),n(g.Td,{children:n(pe,{color:(S=Eh(b.status))==null?void 0:S.color,variant:"dot",style:{cursor:he(e,Ce)&&b.status!==ls?"pointer":"default",userSelect:"none"},onClick:()=>m(b.id,b.status),title:he(e,Ce)&&b.status!==ls?b.status===Jr?"Click to mark as paid":"Click to delete":"",children:(k=Eh(b.status))==null?void 0:k.status})}),u(g.Td,{align:"right",children:[b.status===Jr&&n(V,{variant:"subtle",size:"xs",color:"green",onClick:()=>s.mutate(b.id),style:{marginRight:8},children:"Pay"}),b.status!==ls&&n(V,{variant:"subtle",size:"xs",color:"red",onClick:()=>i.mutate(b.id),style:{padding:0,width:24,height:24},title:"Delete",children:"×"})]})]},b.id)})})]}),n(Oe,{opened:a,onClose:l,title:"Add New Expense",centered:!0,children:n("form",{onSubmit:h.onSubmit(f),children:u(j,{children:[n(Te,{label:"Title",...h.getInputProps("title")}),n(Te,{label:"Date",type:"date",...h.getInputProps("date")}),n(pt,{label:"Amount ($)",defaultValue:0,decimalScale:2,fixedDecimalScale:!0,thousandSeparator:" ",prefix:"$",...h.getInputProps("amount")}),n(V,{type:"submit",children:"Add Expense"})]})})})]})}function Ph(){Cc("Project Finances");const e=gt(),{tabId:t}=Bn(),r=Ha(`(max-width: ${Wa(800)})`);return u(re,{value:t,variant:"pills",color:"dark.5",onChange:i=>e(`/finances/${i}`),children:[u(re.List,{mb:"md",children:[n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"topups",leftSection:!0,children:"Top Ups"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"withdrawals",leftSection:!0,children:"Withdrawals"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"expenses",leftSection:!0,children:"Expenses"}),n(re.Tab,{style:{width:r?"100%":"inherit",justifyContent:"start"},value:"project-money",leftSection:!0,children:"Project Money"})]}),n(re.Panel,{value:"topups",children:n(IA,{})}),n(re.Panel,{value:"withdrawals",children:n($A,{})}),n(re.Panel,{value:"expenses",children:n(FA,{})}),n(re.Panel,{value:"project-money",children:n(qf,{})})]})}
432async function UA(e,t){const r=new URLSearchParams;e!==void 0&&r.set("month",String(e)),t!==void 0&&r.set("year",String(t));const i=r.toString();return await ae(`${O}/rating${i?`?${i}`:""}`)}function BA(e,t){return{ratingQuery:oe({queryKey:["ratings",e,t],queryFn(){return UA(e,t)}})}}const Mh=[{value:"1",label:"January"},{value:"2",label:"February"},{value:"3",label:"March"},{value:"4",label:"April"},{value:"5",label:"May"},{value:"6",label:"June"},{value:"7",label:"July"},{value:"8",label:"August"},{value:"9",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}];function qA(){const e=new Date().getFullYear(),t=[];for(let r=e;r>=e-5;r--)t.push({value:String(r),label:String(r)});return t}const jA=qA();function HA(){const{user:e}=fe(),t=he(e,Ce),r=new Date,[i,s]=_.useState(null),[a,o]=_.useState(null),l=i!==null&&a!==null?Number(i):void 0,c=i!==null&&a!==null?Number(a):void 0,{ratingQuery:d}=BA(l,c),{t:p}=Fe(),[h,{open:f,close:m}]=_t(!1),y=gt(),{tabId:b}=Bn(),S=_.useMemo(()=>{var w;return(w=d.data)==null?void 0:w.filter(T=>T.type===(b==="streamers"?0:1)).slice(0,25)},[d.data,b]),k=_.useMemo(()=>{var T;return i===null||a===null?null:`${(T=Mh.find(A=>A.value===i))==null?void 0:T.label} ${a}`},[i,a]);return n(Be,{size:"lg",py:"xl",children:n(ue,{withBorder:!0,radius:"md",shadow:"sm",style:{background:"rgba(66,66,66,0.5)"},p:"md",children:u("div",{children:[u($,{align:"center",justify:"space-between",children:[u("div",{children:[u(Ye,{order:2,mt:"md",children:[p("rating_title"),k&&u(v,{span:!0,c:"dimmed",fw:400,size:"lg",ml:"xs",children:["— ",k]})]}),n(v,{c:"dimmed",mb:"sm",children:p("rating_description")}),n(v,{c:"blue",style:{cursor:"pointer"},mb:"sm",onClick:()=>f(),children:p("check_prizes_and_calculation")}),n(Oe,{size:"lg",opened:h,onClose:m,title:p("rating_info_modal_title"),centered:!0,children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:p("rating_info_modal_description")}})})})]}),n(G,{visibleFrom:"sm",children:n(Il,{style:{stroke:"#ffd43b",opacity:"85%"},size:"3rem"})})]}),t&&u($,{mb:"md",align:"flex-end",children:[n(it,{label:"Month",placeholder:"Current",data:Mh,value:i,onChange:w=>{s(w),w!==null&&a===null&&o(String(r.getFullYear())),w===null&&o(null)},clearable:!0,w:150}),n(it,{label:"Year",placeholder:"Current",data:jA,value:a,onChange:w=>{o(w),w!==null&&i===null&&s(String(r.getMonth()+1)),w===null&&s(null)},clearable:!0,w:110}),(i!==null||a!==null)&&n(v,{c:"dimmed",size:"sm",style:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{s(null),o(null)},children:"Reset to current"})]}),u(re,{defaultValue:"streamers",color:"yellow.4",value:b||"streamers",onChange:w=>y(`/rating/${w}`),children:[u(re.List,{mb:"md",children:[n(re.Tab,{value:"streamers",leftSection:n(no,{size:"1rem"}),children:"Streamers"}),n(re.Tab,{value:"donators",leftSection:n(to,{size:"1rem"}),children:"Donators"})]}),n(G,{children:n(g,{withRowBorders:!1,striped:!0,stripedColor:"rgba(33,33,33,0.3)",verticalSpacing:"sm",children:n(g.Tbody,{children:S==null?void 0:S.map((w,T)=>{function A(){switch(T){case 0:return"#feca57";case 1:return"#c8d6e5";case 2:return"#ff9f43";default:return}}return u(g.Tr,{children:[u(g.Td,{width:"1rem",style:{position:"relative"},children:[T===0&&n(aa,{size:"1.8rem",style:{stroke:A(),left:"0.65rem",top:"0.8rem",position:"absolute"}}),T===1&&n(Rl,{style:{stroke:A(),left:"0.85rem",top:"0.85rem",position:"absolute"}}),T===2&&n(Hp,{style:{stroke:A(),left:"0.85rem",top:"0.85rem",position:"absolute"}}),T>2&&n(v,{style:{left:"1.25rem",top:"0.85rem",position:"absolute"},children:T+1})]}),n(g.Td,{children:n(v,{fw:T<3?500:400,size:T===0?"lg":T===1?"md":"sm",style:{marginLeft:"1rem"},component:xe,to:`/${w.username}`,children:w.username})}),n(g.Td,{ta:"right",children:n(v,{fw:T<3?700:300,children:n(py,{thousandSeparator:" ",value:w.value})})})]},T)})})})})]})]})})})}const pi=10,_c=0,WA=1,YA=2;function ia(e){const t=new Map([[_c,{status:"pending",color:"blue"}],[WA,{status:"completed",color:"green"}],[YA,{status:"cancelled",color:"red"}]]);return t.get(e)??t.get(0)}function QA({progress:e,message:t,canWithdraw:r,currentEarnings:i}){const s=tn();return u(j,{align:"center",gap:"lg",style:{width:"100%"},children:[n(Ye,{order:1,ta:"center",children:x("withdrawal_title")}),u(j,{align:"center",gap:0,children:[n(v,{size:"4rem",fw:700,ta:"center",style:{lineHeight:1,color:s.colors.pink[7]},children:se(i)}),n(v,{size:"lg",c:"dimmed",ta:"center",children:x("withdrawal_current_earnings")})]}),n(yp,{value:e,size:"xl",color:r?"green":"pink",style:{width:"80%",maxWidth:500},radius:"xl",styles:{root:{borderRadius:we(20)},bar:{borderRadius:we(20)}}}),n(v,{size:"lg",ta:"center",fw:500,c:r?"green":"pink",children:t})]})}const fd=[{id:"russian_bank_card",label:x("russian_bank_card"),description:x("russian_bank_card_description"),icon:kc,color:"violet"},{id:"sbp",label:"SBP (СБП)",description:"Система быстрых платежей",icon:vb,color:"teal"},{id:"bank_card",label:x("bank_card"),description:x("bank_card_description"),icon:wa,color:"blue"},{id:"crypto",label:"Crypto",description:x("crypto_description"),icon:Mi,color:"orange"},{id:"paypal",label:"PayPal",description:x("paypal_description"),icon:Cp,color:"indigo"}];function VA({onSelectMethod:e}){const{colorScheme:t}=vt(),r=t==="dark";return n(j,{gap:"xs",children:fd.map(i=>{const s=i.icon;return u(G,{onClick:()=>e(i.id),style:{width:"calc(100% - 4px)",display:"flex",alignItems:"center",gap:we(12),padding:`${we(12)} ${we(14)}`,borderRadius:we(16),cursor:"pointer",transition:"background 0.15s ease, transform 0.15s ease",background:r?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.025)",userSelect:"none"},onMouseEnter:a=>{const o=a.currentTarget;o.style.background=r?"rgba(255,255,255,0.09)":"rgba(0,0,0,0.055)",o.style.transform="translateX(4px)"},onMouseLeave:a=>{const o=a.currentTarget;o.style.background=r?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.025)",o.style.transform="translateX(0)"},onMouseDown:a=>{a.currentTarget.style.transform="scale(0.97)"},onMouseUp:a=>{a.currentTarget.style.transform="translateX(4px)"},onTouchStart:a=>{a.currentTarget.style.background=r?"rgba(255,255,255,0.09)":"rgba(0,0,0,0.055)"},onTouchEnd:a=>{a.currentTarget.style.background=r?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.025)"},children:[n(bt,{size:40,radius:"xl",variant:"light",color:i.color,style:{flexShrink:0},children:n(s,{size:19})}),u("div",{style:{flex:1,minWidth:0},children:[n(v,{fw:600,size:"sm",style:{color:r?"#e9ecef":"#1c1c2e",lineHeight:1.35},children:i.label}),n(v,{size:"xs",style:{color:r?"rgba(255,255,255,0.42)":"rgba(0,0,0,0.42)",lineHeight:1.35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i.description})]}),n(v,{size:"md",style:{color:r?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.18)",flexShrink:0},children:"→"})]},i.id)})})}const Ir={input:{borderRadius:we(14),height:we(48),fontSize:we(15),paddingLeft:we(16),paddingRight:we(16)},label:{fontSize:we(13),fontWeight:500,marginBottom:we(6),opacity:.72}};function KA({form:e}){return n(j,{gap:"md",children:n(Te,{label:"Card Number",placeholder:"1111 2222 3333 4444",maxLength:19,styles:Ir,...e.getIn
432putProps("cardNumber"),onChange:t=>{const i=t.currentTarget.value.replace(/\D/g,"").slice(0,16).replace(/(.{4})/g,"$1 ").trim();e.setFieldValue("cardNumber",i)}})})}function GA({form:e}){return u(j,{gap:"md",children:[n(Te,{label:"Номер телефона",placeholder:"+7 900 123 45 67",maxLength:16,styles:Ir,...e.getInputProps("phoneNumber"),onChange:t=>{const r=t.currentTarget.value.replace(/\D/g,"").slice(0,11);let i="";r.length>0&&(i="+7"),r.length>1&&(i+=" "+r.slice(1,4)),r.length>4&&(i+=" "+r.slice(4,7)),r.length>7&&(i+=" "+r.slice(7,9)),r.length>9&&(i+=" "+r.slice(9,11)),e.setFieldValue("phoneNumber",i)}}),n(Te,{label:"ФИО",placeholder:"Иван Иванович Р.",description:"Имя, Отчество и первая буква фамилии",styles:Ir,...e.getInputProps("name")}),n(Te,{label:"Имя Банка",placeholder:"Сбербанк",description:"Наименование банка",styles:Ir,...e.getInputProps("bank")})]})}const gd=[{value:"usdttrc20",label:"USDT",network:"TRC-20",color:"teal",recommended:!1},{value:"usdtbsc",label:"USDT",network:"BEP-20",color:"teal",recommended:!0},{value:"usdterc20",label:"USDT",network:"ERC-20",color:"teal",recommended:!1},{value:"usdcbsc",label:"USDC",network:"BEP-20",color:"blue",recommended:!1},{value:"usdc",label:"USDC",network:"ERC-20",color:"blue",recommended:!1},{value:"eth",label:"ETH",network:"ERC-20",color:"violet",recommended:!1},{value:"btc",label:"BTC",network:"Bitcoin",color:"orange",recommended:!1},{value:"ltc",label:"LTC",network:"Litecoin",color:"gray",recommended:!1},{value:"trx",label:"TRX",network:"TRON",color:"red",recommended:!1}];function XA({form:e}){const{colorScheme:t}=vt(),r=t==="dark",i=df(10),s=i.data??{},a=e.values.coin;return u(j,{gap:"md",children:[n(Le,{icon:n(Fi,{size:16}),color:"yellow",variant:"light",radius:"md",styles:{root:{padding:`${we(10)} ${we(14)}`},icon:{marginTop:we(1)}},children:u(v,{size:"xs",fw:500,children:["Network fees are deducted from your withdrawal. Fees shown below are estimates for a ",n("strong",{children:"$10"})," withdrawal and vary by network load."]})}),u(j,{gap:we(6),children:[n(v,{size:"xs",fw:500,style:{opacity:.72},children:"Select Coin & Network"}),i.isLoading&&u($,{justify:"center",py:"sm",children:[n(Xe,{size:"sm"}),n(v,{size:"xs",c:"dimmed",children:"Loading fees…"})]}),!i.isLoading&&gd.map(o=>{const l=a===o.value,c=s[o.value],d=c===void 0?null:typeof c=="number"?`~${c} ${o.label}`:`${c}`;return u(G,{onClick:()=>e.setFieldValue("coin",o.value),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:we(10),padding:`${we(10)} ${we(14)}`,borderRadius:we(14),cursor:"pointer",transition:"all 0.15s ease",border:`2px solid ${l?`var(--mantine-color-${o.color}-6)`:o.recommended?"var(--mantine-color-yellow-6)":r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.09)"}`,background:l?r?`color-mix(in srgb, var(--mantine-color-${o.color}-9) 30%, transparent)`:`var(--mantine-color-${o.color}-0)`:"transparent"},onMouseEnter:p=>{l||(p.currentTarget.style.background=r?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.03)")},onMouseLeave:p=>{l||(p.currentTarget.style.background="transparent")},children:[u($,{gap:we(10),style:{flex:1,minWidth:0},children:[l?n(bt,{size:28,radius:"xl",color:o.color,variant:"filled",children:n(Ke,{size:14})}):n(bt,{size:28,radius:"xl",color:o.color,variant:"light",children:n(Mi,{size:14})}),u("div",{children:[n(v,{fw:600,size:"sm",style:{lineHeight:1.3},children:o.label}),n(v,{size:"xs",c:"dimmed",style:{lineHeight:1.3},children:o.network})]})]}),o.recommended&&n(pe,{size:"sm",variant:"light",color:l?o.color:"yellow",radius:"sm",children:"RECOMMENDED"}),d&&n(pe,{size:"sm",variant:"light",color:l?o.color:"gray",radius:"sm",style:{fontVariantNumeric:"tabular-nums",flexShrink:0},children:d})]},o.value)}),e.errors.coin&&n(v,{size:"xs",c:"red",children:e.errors.coin})]}),n(Te,{label:x("wallet_address"),placeholder:"Enter wallet address",styles:Ir,...e.getInputProps("walletAddress")})]})}function JA({form:e}){return n(j,{gap:"md",children:n(Te,{label:"PayPal Email",placeholder:"[email protected]",type:"email",styles:Ir,...e.getIn
432putProps("email"),onChange:t=>{e.setFieldValue("email",t.currentTarget.value.trim())}})})}function ZA({form:e}){return n(j,{gap:"md",children:n(Te,{label:"Card Number",placeholder:"1111 2222 3333 4444",maxLength:19,styles:Ir,...e.getInputProps("cardNumber"),onChange:t=>{const i=t.currentTarget.value.replace(/\D/g,"").slice(0,16).replace(/(.{4})/g,"$1 ").trim();e.setFieldValue("cardNumber",i)}})})}function e2({selectedMethod:e,form:t}){const r=fd.find(s=>s.id===e),i=r==null?void 0:r.icon;return u(j,{gap:"lg",children:[r&&i&&u($,{gap:"sm",children:[n(bt,{size:34,radius:"xl",variant:"light",color:r.color,children:n(i,{size:17})}),n(v,{fw:600,size:"lg",children:r.label})]}),e==="russian_bank_card"&&n(KA,{form:t}),e==="sbp"&&n(GA,{form:t}),e==="bank_card"&&n(ZA,{form:t}),e==="crypto"&&n(XA,{form:t}),e==="paypal"&&n(JA,{form:t})]})}function t2({form:e,availableAmount:t,selectedMethod:r,cryptoForm:i}){const{colorScheme:s}=vt(),a=s==="dark",o=e.values.amount,l=r==="crypto",c=i.values.coin,d=gd.find(f=>f.value===c),p=df(l&&o>0?o:0),h=c&&p.data?p.data[c]:void 0;return u(j,{align:"center",gap:"md",style:{paddingTop:we(8),paddingBottom:we(8)},children:[n(pt,{placeholder:"0.00",prefix:"$",decimalScale:2,thous
432andSeparator:" ",min:pi,max:t/100,size:"xl",styles:{input:{borderRadius:we(20),height:"clamp(56px, 10vw, 80px)",fontSize:"clamp(1.4rem, 6vw, 2.25rem)",fontWeight:700,textAlign:"center",paddingLeft:we(16),paddingRight:we(16),letterSpacing:"-0.5px"},wrapper:{width:"100%"}},style:{width:"100%"},...e.getInputProps("amount")}),r&&n(Ie,{radius:"xl",p:"md",style:{width:"100%",border:`1px solid ${a?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.07)"}`,background:a?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)"},children:u(j,{gap:"xs",children:[l&&d?u($,{justify:"space-between",align:"center",children:[u($,{gap:we(8),children:[n(bt,{size:28,radius:"xl",color:d.color,variant:"light",children:n(Mi,{size:14})}),u("div",{children:[n(v,{size:"sm",fw:600,style:{lineHeight:1.2},children:d.label}),n(v,{size:"xs",c:"dimmed",style:{lineHeight:1.2},children:d.network})]})]}),n(pe,{variant:"light",color:d.color,radius:"sm",size:"sm",children:"Crypto"})]}):n($,{gap:we(8),children:(()=>{const f=fd.find(y=>y.id===r),m=f==null?void 0:f.icon;return f&&m?u(ke,{children:[n(bt,{size:28,radius:"xl",color:f.color,variant:"light",children:n(m,{size:14})}),n(v,{size:"sm",fw:600,children:f.label})]}):null})()}),l&&d&&u(ke,{children:[n(G,{style:{height:1,background:a?"rgba(255,255,255,0.07)":"rgba(0,0,0,0.07)"}}),u($,{justify:"space-between",align:"center",children:[n(v,{size:"xs",c:"dimmed",children:"Network fee"}),p.isLoading?n(Xe,{size:"xs"}):h!==void 0?u(v,{size:"xs",fw:600,children:["~",h," ",d.label]}):n(v,{size:"xs",c:"dimmed",children:"—"})]}),u($,{justify:"space-between",align:"center",children:[n(v,{size:"xs",c:"dimmed",children:"You receive"}),p.isLoading?n(Xe,{size:"xs"}):h!==void 0&&typeof h=="number"&&o>0?u(v,{size:"xs",fw:600,c:"green",children:["$",(o-h).toFixed(2)," equiv."]}):n(v,{size:"xs",c:"dimmed",children:"—"})]})]})]})})]})}function n2({opened:e,onClose:t,availableAmount:r}){const[i,s]=_.useState(0),[a,o]=_.useState(null),l=tn(),{colorScheme:c}=vt(),d=c==="dark",p=Ge({initialValues:{cardNumber:""},validate:{cardNumber:C=>{const M=C.replace(/\D/g,"");return M?M.length!==16?"Must be 16 digits":null:"Required"}}}),h=Ge({initialValues:{phoneNumber:"",name:"",bank:""},validate:{phoneNumber:C=>{const M=C.replace(/\D/g,"");return M?M.length!==11?"Must be 11 digits":null:"Required"},name:$r("Required"),bank:$r("Required")}}),f=Ge({initialValues:{cardNumber:""},validate:{cardNumber:C=>{const M=C.replace(/\D/g,"");return M?M.length!==16?"Must be 16 digits":null:"Required"}}}),m=Ge({initialValues:{walletAddress:"",coin:""},validate:{coin:C=>C?null:"Select a coin",walletAddress:C=>C?null:"Wallet address is required"}}),y=Ge({initialValues:{email:""},validate:{email:C=>C.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(C)?null:"Enter a valid email":"Required"}}),b=Ge({initialValues:{amount:pi},validate:{amount:C=>C<pi?`Minimum $${pi}`:C>r/100?`Cannot exceed ${se(r)}`:null}}),S=()=>{switch(a){case"russian_bank_card":return p;case"sbp":return h;case"bank_card":return f;case"crypto":return m;case"paypal":return y;default:return null}},{withdrawMutation:k,currentUserWithdrawalsQuery:w}=Qr(),{toggleBalance:T}=fe(),A=()=>{s(0),o(null),p.reset(),h.reset(),f.reset(),m.reset(),y.reset(),b.reset()},R=()=>{Ee.show({position:"top-center",title:x("withdrawal_request_notification"),message:x("withdrawal_request_notification_message"),color:"green",icon:n(Ke,{size:18}),autoClose:1e4}),T(),w.refetch(),t(),A()},E=C=>{o(C),s(1)},z=()=>{if(i===1){const C=S();if(C&&C.validate().hasErrors)return;s(2);return}if(i===2){if(b.validate().hasErrors)return;const C=S();if(!C||!a)return;let M="";switch(a){case"russian_bank_card":{M=`Method: Russian Bank Card
433Card: ${C.values.cardNumber.replace(/\D/g,"")}`;break}case"sbp":{const P=C;M=`Method: SBP (СБП)
434Phone: ${P.values.phoneNumber.replace(/\D/g,"")}
435Name: ${P.values.name}
436Bank: ${P.values.bank}`;break}case"bank_card":{M=`Method: Bank Card
437Card: ${C.values.cardNumber.replace(/\D/g,"")}`;break}case"crypto":{const P=C,I=gd.find(L=>L.value===P.values.coin);M=`Method: Crypto
438Coin: ${(I==null?void 0:I.label)??P.values.coin} (${(I==null?void 0:I.network)??""})
439Currency: ${P.values.coin}
440Wallet: ${P.values.walletAddress}`;break}case"paypal":{M=`Method: PayPal
441Email: ${C.values.email.trim()}`;break}}k.mutate({amount:b.values.amount*100,method:M},{onSuccess(){R()},onError(P){var L,U,q;if(typeof P=="object"&&P!==null&&"response"in P&&((L=P.response)==null?void 0:L.status)===201){R();return}let I="There was an error processing your request. Please try again.";if(typeof P=="object"&&P!==null&&"response"in P){const B=P;(q=(U=B.response)==null?void 0:U.data)!=null&&q.message&&(I=B.response.data.message)}Ee.show({position:"top-center",title:"Withdrawal Failed",message:I,color:"red"})}})}};return u(Oe,{opened:e,onClose:()=>{t(),A()},title:u($,{gap:"xs",align:"center",wrap:"nowrap",children:[n(v,{fw:700,size:"lg",style:{whiteSpace:"nowrap"},children:["Choose Method","Payment Details","Enter Amount"][i]??"Withdrawal"}),n(pe,{color:"blue",variant:"light",radius:"xl",size:"md",style:{fontVariantNumeric:"tabular-nums",flexShrink:0},children:se(r)})]}),size:"lg",fullScreen:!1,centered:!0,radius:"xl",styles:{content:{borderRadius:we(24),overflow:"hidden",
441width:"min(95vw, 520px)",maxHeight:"min(95dvh, 700px)",display:"flex",flexDirection:"column",boxShadow:"0 24px 60px -12px rgba(0,0,0,0.28)"},header:{borderBottom:`1px solid ${d?l.colors.dark[5]:l.colors.gray[1]}`,padding:`${we(16)} ${we(16)} ${we(12)}`,flexShrink:0},body:{padding:"clamp(12px, 4vw, 24px)",flex:"1 1 auto",overflowY:"auto",display:"flex",flexDirection:"column"}},children:[u(Qs,{active:i,allowNextStepsSelect:!1,size:"xs",mb:"md",styles:{stepIcon:{width:we(24),height:we(24),fontSize:we(11),borderRadius:"50%"},stepLabel:{fontSize:we(11),fontWeight:500,"@media (max-width: 380px)":{display:"none"}},stepDescription:{display:"none"},separator:{marginLeft:we(4),marginRight:we(4),height:we(1)}},children:[n(Qs.Step,{label:"Method"}),n(Qs.Step,{label:"Details"}),n(Qs.Step,{label:"Amount"})]}),u(G,{style:{flex:"1 1 auto",overflowY:"auto",minHeight:0},children:[i===0&&n(VA,{onSelectMethod:E}),i===1&&a&&n(e2,{selectedMethod:a,form:S()}),i===2&&n(t2,{form:b,availableAmount:r,selectedMethod:a,cryptoForm:m})]}),i>0&&u($,{justify:"space-between",mt:"md",pt:"sm",style:{flexWrap:"nowrap",flexShrink:0,borderTop:`1px solid ${d?l.colors.dark[5]:l.colors.gray[1]}`},children:[n(V,{variant:"subtle",color:"gray",radius:"xl",size:"sm",leftSection:n(Sa,{size:15}),onClick:()=>s(C=>C-1),children:"Back"}),n(V,{onClick:z,loading:k.isPending,radius:"xl",size:"sm",fw:600,style:{paddingLeft:we(22),paddingRight:we(22)},children:i===2?"Request Funds":"Continue"})]})]})}function r2(){const{currentUserWithdrawalsQuery:e,cancelWithdrawalMutation:t}=Qr(),{toggleBalance:r}=fe(),i=tn(),{colorScheme:s}=vt(),a=s==="dark",o=_.useMemo(()=>e.data?[...e.data].sort((c,d)=>new Date(d.created_at).getTime()-new Date(c.created_at).getTime()):[],[e.data]);if(o.length===0)return null;const l=c=>{t.mutate(c,{onSuccess(){r(),Ee.show({position:"top-center",title:"Withdrawal cancelled",message:"Your withdrawal request has been cancelled",color:"orange",icon:n(ht,{})})}})};return u(j,{gap:"md",style:{width:"100%",maxWidth:800},mx:"auto",children:[n(Ye,{order:2,ta:"center",mt:"xl",children:x("past_withdrawals")}),n(j,{gap:"sm",hiddenFrom:"sm",children:o.map(c=>{var d,p;return u(Ie,{radius:"xl",p:"md",withBorder:!0,style:{borderColor:a?i.colors.dark[4]:i.colors.gray[2]},children:[u($,{justify:"space-between",mb:"xs",children:[n(v,{size:"sm",c:"dimmed",children:st.format(new Date(c.created_at))}),n(pe,{color:(d=ia(c.request_status))==null?void 0:d.color,radius:"xl",variant:"light",children:(p=ia(c.request_status))==null?void 0:p.status})]}),n(v,{fw:700,size:"lg",mb:4,children:se(c.amount)}),n(v,{size:"sm",c:"dimmed",style:{whiteSpace:"pre-line"},children:c.method}),c.request_status===_c&&n(V,{mt:"sm",size:"xs",variant:"light",color:"red",radius:"xl",leftSection:n(ht,{size:12}),loading:t.isPending,onClick:()=>l(c.id),fullWidth:!0,children:"Cancel request"})]},c.id)})}),n(Ie,{radius:"xl",withBorder:!0,visibleFrom:"sm",style:{borderColor:a?i.colors.dark[4]:i.colors.gray[2],overflow:"hidden"},children:n(g.ScrollContainer,{minWidth:400,children:u(g,{striped:!0,highlightOnHover:!0,verticalSpacing:"sm",horizontalSpacing:"md",children:[n(g.Thead,{style:{background:a?i.colors.dark[6]:i.colors.gray[0]},children:u(g.Tr,{children:[n(g.Th,{children:n(v,{size:"xs",tt:"uppercase",fw:600,c:"dimmed",children:"Date"})}),n(g.Th,{children:n(v,{size:"xs",tt:"uppercase",fw:600,c:"dimmed",children:"Amount"})}),n(g.Th,{children:n(v,{size:"xs",tt:"uppercase",fw:600,c:"dimmed",children:"Method"})}),n(g.Th,{children:n(v,{size:"xs",tt:"uppercase",fw:600,c:"dimmed",children:"Status"})}),n(g.Th,{})]})}),n(g.Tbody,{children:o.map(c=>{var d,p;return u(g.Tr,{children:[n(g.Td,{style:{whiteSpace:"nowrap"},children:n(v,{size:"sm",children:st.format(new Date(c.created_at))})}),n(g.Td,{style:{whiteSpace:"nowrap"},children:n(v,{size:"sm",fw:600,children:se(c.amount)})}),n(g.Td,{children:n(v,{size:"sm",style:{whiteSpace:"pre-line",wordBreak:"break-word",minWidth:120,maxWidth:260},children:c.method})}),n(g.Td,{children:n(pe,{color:(d=ia(c.request_status))==null?void 0:d.color,radius:"xl",variant:"light",size:"sm",children:(p=ia(c.request_status))==null?void 0:p.status})}),n(g.Td,{style:{whiteSpace:"nowrap"},children:c.request_status===_c&&n(Se,{label:"Cancel this request",withArrow:!0,position:"left",children:n(Ne,{variant:"subtle",color:"red",radius:"xl",size:"sm",loading:t.isPending,onClick:()=>l(c.id),children:n(ht,{size:14})})})})]},c.id)})})]})})})]})}function i2(){const{user:e}=fe(),[t,r]=_.useState(!1);if(!e)return null;const i=e.earnings||0,s=pi*100,a=Math.min(100,i/s*100),o=i>=s,l=()=>{if(o)return x("can_withdraw_message");const c=(s-i)/100;return`Only ${se(c*100)} left to reach $${pi}!`};return u(j,{gap:"xl",align:"center",style:{width:"100%"},children:[u(re,{variant:"default",color:"pink",defaultValue:"withdraw",style:{width:"100%",maxWidth:"500px"},children:[u(re.List,{grow:!0,children:[n(re.Tab,{value:"withdraw",children:x("withdrawal_title")}),n(re.Tab,{value:"info",children:x("withdrawal_info")})]}),n(re.Panel,{value:"withdraw",children:u(j,{align:"center",p:"md",children:[n(QA,{progress:a,message:l(),canWithdraw:o,currentEarnings:i}),n(V,{size:"xl",variant:"gradient",gradient:{from:"teal",to:"lime",deg:35},disabled:!o,onClick:()=>r(!0),radius:"xl",style:{fontSize:"1.2rem",padding:"0.8rem 2.5rem",boxShadow:"0 4px 14px 0 rgba(0,0,0,0.15)"},children:x("request_funds")})]})}),n(re.Panel,{value:"info",children:n(j,{py:"md",children:n(g.ScrollC
441ontainer,{minWidth:300,children:u(g,{striped:!0,highlightOnHover:!0,verticalSpacing:"sm",horizontalSpacing:"md",width:"100%",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:n(v,{size:"xs",tt:"uppercase",fw:600,c:"dimmed",children:"Method"})}),n(g.Th,{children:n(v,{size:"xs",tt:"uppercase",fw:600,c:"dimmed",children:"Expected payout time"})})]})}),u(g.Tbody,{children:[u(g.Tr,{children:[n(g.Td,{children:"RU Bank Card"}),n(g.Td,{children:"< 12 hours (Except on weekends)"})]}),u(g.Tr,{children:[n(g.Td,{children:"Crypto"}),n(g.Td,{children:"~3 days"})]}),u(g.Tr,{children:[n(g.Td,{children:"FPS"}),n(g.Td,{children:"~3 days"})]}),u(g.Tr,{children:[n(g.Td,{children:"Bank Card"}),n(g.Td,{children:"~3 days"})]}),u(g.Tr,{children:[n(g.Td,{children:"Paypal"}),n(g.Td,{children:"Up to 14 days"})]})]})]})})})})]}),n(n2,{opened:t,onClose:()=>r(!1),availableAmount:i}),n(r2,{})]})}async function s2(e){return await ae(`${O}/${e}/profile`)}async function a2(e,t){return await Ft(`${O}/${e}/profile`,t)}function fg(e){const{user:t,isLoading:r}=fe();return oe({queryKey:RC((t==null?void 0:t.id)??0,e),queryFn:()=>s2(e),enabled:!r&&!!e,retry:1})}function o2(){return J({mutationFn:({username:e,request:t})=>a2(e,t)})}const l2="_tab_1s2ln_1",c2={tab:l2};var d2=Object.defineProperty,u2=(e,t,r)=>t in e?d2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Je=(e,t,r)=>u2(e,typeof t!="symbol"?t+"":t,r);const ja={x:0,y:0,width:0,height:0,unit:"px"},Kr=(e,t,r)=>Math.min(Math.max(e,t),r),h2=(...e)=>e.filter(t=>t&&typeof t=="string").join(" "),Ah=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function p2(e,t,r,i){const s=an(e,r,i);return e.width&&(s.height=s.width/t),e.height&&(s.width=s.height*t),s.y+s.height>i&&(s.height=i-s.y,s.width=s.height*t),s.x+s.width>r&&(s.width=r-s.x,s.height=s.width/t),e.unit==="%"?Vn(s,r,i):s}function m2(e,t,r){const i=an(e,t,r);return i.x=(t-i.width)/2,i.y=(r-i.height)/2,e.unit==="%"?Vn(i,t,r):i}function Vn(e,t,r){return e.unit==="%"?{...ja,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function an(e,t,r){return e.unit?e.unit==="px"?{...ja,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...ja,...e,unit:"px"}}function Dh(e,t,r,i,s,a=0,o=0,l=i,c=s){const d={...e};let p=Math.min(a,i),h=Math.min(o,s),f=Math.min(l,i),m=Math.min(c,s);t&&(t>1?(p=o?o*t:p,h=p/t,f=l*t):(h=a?a/t:h,p=h*t,m=c/t)),d.y<0&&(d.height=Math.max(d.height+d.y,h),d.y=0),d.x<0&&(d.width=Math.max(d.width+d.x,p),d.x=0);const y=i-(d.x+d.width);y<0&&(d.x=Math.min(d.x,i-p),d.width+=y);const b=s-(d.y+d.height);if(b<0&&(d.y=Math.min(d.y,s-h),d.height+=b),d.width<p&&((r==="sw"||r=="nw")&&(d.x-=p-d.width),d.width=p),d.height<h&&((r==="nw"||r=="ne")&&(d.y-=h-d.height),d.height=h),d.width>f&&((r==="sw"||r=="nw")&&(d.x-=f-d.width),d.width=f),d.height>m&&((r==="nw"||r=="ne")&&(d.y-=m-d.height),d.height=m),t){const S=d.width/d.height;if(S<t){const k=Math.max(d.width/t,h);(r==="nw"||r=="ne")&&(d.y-=k-d.height),d.height=k}else if(S>t){const k=Math.max(d.height*t,p);(r==="sw"||r=="nw")&&(d.x-=k-d.width),d.width=k}}return d}function f2(e,t,r,i){const s={...e};return t==="ArrowLeft"?i==="nw"?(s.x-=r,s.y-=r,s.width+=r,s.height+=r):i==="w"?(s.x-=r,s.width+=r):i==="sw"?(s.x-=r,s.width+=r,s.height+=r):i==="ne"?(s.y+=r,s.width-=r,s.height-=r):i==="e"?s.width-=r:i==="se"&&(s.width-=r,s.height-=r):t==="ArrowRight"&&(i==="nw"?(s.x+=r,s.y+=r,s.width-=r,s.height-=r):i==="w"?(s.x+=r,s.width-=r):i==="sw"?(s.x+=r,s.width-=r,s.height-=r):i==="ne"?(s.y-=r,s.width+=r,s.height+=r):i==="e"?s.width+=r:i==="se"&&(s.width+=r,s.height+=r)),t==="ArrowUp"?i==="nw"?(s.x-=r,s.y-=r,s.width+=r,s.height+=r):i==="n"?(s.y-=r,s.height+=r):i==="ne"?(s.y-=r,s.width+=r,s.height+=r):i==="sw"?(s.x+=r,s.width-=r,s.height-=r):i==="s"?s.height-=r:i==="se"&&(s.width-=r,s.height-=r):t==="ArrowDown"&&(i==="nw"?(s.x+=r,s.y+=r,s.width-=r,s.height-=r):i==="n"?(s.y+=r,s.height-=r):i==="ne"?(s.y+=r,s.width-=r,s.height-=r):i==="sw"?(s.x-=r,s.width+=r,s.height+=r):i==="s"?s.height+=r:i==="se"&&(s.width+=r,s.height+=r)),s}const Gr={capture:!0,passive:!1};let g2=0;const Yn=class Wt extends _.PureComponent{constructor(){super(...arguments),Je(this,"docMoveBound",!1),Je(this,"mouseDownOnCrop",!1),Je(this,"dragStarted",!1),Je(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),Je(this,"componentRef",_.createRef()),Je(this,"mediaRef",_.createRef()),Je(this,"resizeObserver"),Je(this,"initChangeCalled",!1),Je(this,"instanceId",`rc-${g2++}`),Je(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),Je(this,"onCropPointerDown",t=>{const{crop:r,disabled:i}=this.props,s=this.getBox();if(!r)return;const a=an(r,s.width,s.height);if(i)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const o=t.target.dataset.ord,l=!!o;let c=t.clientX,d=t.clientY,p=a.x,h=a.y;if(o){const f=t.clientX-s.x,m=t.clientY-s.y;let y=0,b=0;o==="ne"||o=="e"?(y=f-(a.x+a.width),b=m-a.y,p=a.x,h=a.y+a.height):o==="se"||o==="s"?(y=f-(a.x+a.width),b=m-(a.y+a.height),p=a.x,h=a.y):o==="sw"||o=="w"?(y=f-a.x,b=m-(a.y+a.height),p=a.x+a.width,h=a.y):(o==="nw"||o=="n")&&(y=f-a.x,b=m-a.y,p=a.x+a.width,h=a.y+a.height),c=p+s.x+y,d=h+s.y+b}this.evData={startClientX:c,startClientY:d,startCropX:p,startCropY:h,clientX:t.clientX,clientY:t.clientY,isResize:l,ord:o},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),Je(this,"onComponentPointerDown",t=>{const{crop:r,disabled:i,locked:s,keepSelection:a,onChange:o}=this.props,l=this.getBox();if(i||s||a&&r)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const c=t.clientX-l.x,d=t.clientY-l.y,p={unit:"px",x:c,y:d,width:0,height:0};this.evData={startClientX:t.clientX,startClientY:t.clientY,startCropX:c,startCropY:d,clientX:t.clientX,clientY:t.clientY,isResize:!0},this.mouseDownOnCrop=!0,o(an(p,l.width,l.height),Vn(p,l.width,l.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),Je(this,"onDocPointerMove",t=>{const{crop:r,disabled:i,onChange:s,onDragStart:a}=this.props,o=this.getBox();if(i||!r||!this.mouseDownOnCrop)return;t.cancelable&&t.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(t));const{evData:l}=this;l.clientX=t.clientX,l.clientY=t.clientY;let c;l.isResize?c=this.resizeCrop():c=this.dragCrop(),Ah(r,c)||s(an(c,o.width,o.height),Vn(c,o.width,o.height))}),Je(this,"onComponentKeyDown",t=>{const{crop:r,disabled:i,onChange:s,onComplete:a}=this.props;if(i)return;const o=t.key;let l=!1;if(!r)return;const c=this.getBox(),d=this.makePixelCrop(c),p=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?Wt.nudgeStepLarge:t.shiftKey?Wt.nudgeStepMedium:Wt.nudgeStep;
441if(o==="ArrowLeft"?(d.x-=p,l=!0):o==="ArrowRight"?(d.x+=p,l=!0):o==="ArrowUp"?(d.y-=p,l=!0):o==="ArrowDown"&&(d.y+=p,l=!0),l){t.cancelable&&t.preventDefault(),d.x=Kr(d.x,0,c.width-d.width),d.y=Kr(d.y,0,c.height-d.height);const h=an(d,c.width,c.height),f=Vn(d,c.width,c.height);s(h,f),a&&a(h,f)}}),Je(this,"onHandlerKeyDown",(t,r)=>{const{aspect:i=0,crop:s,disabled:a,minWidth:o=0,minHeight:l=0,maxWidth:c,maxHeight:d,onChange:p,onComplete:h}=this.props,f=this.getBox();if(a||!s)return;if(t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="ArrowLeft"||t.key==="ArrowRight")t.stopPropagation(),t.preventDefault();else return;const m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?Wt.nudgeStepLarge:t.shiftKey?Wt.nudgeStepMedium:Wt.nudgeStep,y=an(s,f.width,f.height),b=f2(y,t.key,m,r),S=Dh(b,i,r,f.width,f.height,o,l,c,d);if(!Ah(s,S)){const k=Vn(S,f.width,f.height);p(S,k),h&&h(S,k)}}),Je(this,"onDocPointerDone",t=>{const{crop:r,disabled:i,onComplete:s,onDragEnd:a}=this.props,o=this.getBox();this.unbindDocMove(),!(i||!r)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,a&&a(t),s&&s(an(r,o.width,o.height),Vn(r,o.width,o.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),Je(this,"onDragFocus",()=>{var t;(t=this.componentRef.current)==null||t.scrollTo(0,0)})}get document(){return document}getBox(){const t=this.mediaRef.current;if(!t)return{x:0,y:0,width:0,height:0};const{x:r,y:i,width:s,height:a}=t.getBoundingClientRect();return{x:r,y:i,width:s,height:a}}componentDidUpdate(t){const{crop:r,onComplete:i}=this.props;if(i&&!t.crop&&r){const{width:s,height:a}=this.getBox();s&&a&&i(an(r,s,a),Vn(r,s,a))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Gr),this.document.addEventListener("pointerup",this.onDocPointerDone,Gr),this.document.addEventListener("pointercancel",this.onDocPointerDone,Gr),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Gr),this.document.removeEventListener("pointerup",this.onDocPointerDone,Gr),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Gr),this.docMoveBound=!1)}getCropStyle(){const{crop:t}=this.props;if(t)return{top:`${t.y}${t.unit}`,left:`${t.x}${t.unit}`,width:`${t.width}${t.unit}`,height:`${t.height}${t.unit}`}}dragCrop(){const{evData:t}=this,r=this.getBox(),i=this.makePixelCrop(r),s=t.clientX-t.startClientX,a=t.clientY-t.startClientY;return i.x=Kr(t.startCropX+s,0,r.width-i.width),i.y=Kr(t.startCropY+a,0,r.height-i.height),i}getPointRegion(t,r,i,s){const{evData:a}=this,o=a.clientX-t.x,l=a.clientY-t.y;let c;s&&r?c=r==="nw"||r==="n"||r==="ne":c=l<a.startCropY;let d;return i&&r?d=r==="nw"||r==="w"||r==="sw":d=o<a.startCropX,d?c?"nw":"sw":c?"ne":"se"}resolveMinDimensions(t,r,i=0,s=0){const a=Math.min(i,t.width),o=Math.min(s,t.height);return!r||!a&&!o?[a,o]:r>1?a?[a,a/r]:[o*r,o]:o?[o*r,o]:[a,a/r]}resizeCrop(){const{evData:t}=this,{aspect:r=0,maxWidth:i,maxHeight:s}=this.props,a=this.getBox(),[o,l]=this.resolveMinDimensions(a,r,this.props.minWidth,this.props.minHeight);let c=this.makePixelCrop(a);const d=this.getPointRegion(a,t.ord,o,l),p=t.ord||d;let h=t.clientX-t.startClientX,f=t.clientY-t.startClientY;(o&&p==="nw"||p==="w"||p==="sw")&&(h=Math.min(h,-o)),(l&&p==="nw"||p==="n"||p==="ne")&&(f=Math.min(f,-l));const m={unit:"px",x:0,y:0,width:0,height:0};d==="ne"?(m.x=t.startCropX,m.width=h,r?(m.height=m.width/r,m.y=t.startCropY-m.height):(m.height=Math.abs(f),m.y=t.startCropY-m.height)):d==="se"?(m.x=t.startCropX,m.y=t.startCropY,m.width=h,r?m.height=m.width/r:m.height=f):d==="sw"?(m.x=t.startCropX+h,m.y=t.startCropY,m.width=Math.abs(h),r?m.height=m.width/r:m.height=f):d==="nw"&&(m.x=t.startCropX+h,m.width=Math.abs(h),r?(m.height=m.width/r,m.y=t.startCropY-m.height):(m.height=Math.abs(f),m.y=t.startCropY+f));const y=Dh(m,r,d,a.width,a.height,o,l,i,s);return r||Wt.xyOrds.indexOf(p)>-1?c=y:Wt.xOrds.indexOf(p)>-1?(c.x=y.x,c.width=y.width):Wt.yOrds.indexOf(p)>-1&&(c.y=y.y,c.height=y.height),c.x=Kr(c.x,0,a.width-c.width),c.y=Kr(c.y,0,a.height-c.height),c}renderCropSelection(){const{ariaLabels:t=Wt.defaultProps.ariaLabels,disabled:r,locked:i,renderSelectionAddon:s,ruleOfThirds:a,crop:o}=this.props,l=this.getCropStyle();if(o)return u("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group",children:[!r&&!i&&u("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus,children:[n("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),n("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),n("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),n("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),n("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"nw"),role:"button"}),n("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"n"),role:"button"}),n("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"ne"),role:"button"}),n("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"e"),role:"button"}),n("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"se"),role:"button"}),n("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"s"),role:"button"}),n("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"sw"),role:"button"}),n("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"w"),role:"button"})]}),s&&n("div",{className:"ReactCrop__selection-addon",onPointerDown:c=>c.stopPropagation(),children:s(this.state)}),a&&u(ke,{children:[n("div",{className:"ReactCrop__rule-of-thirds-hz"}),n("div",{className:"ReactCrop__rule-of-thirds-vt"})]})]})}makePixelCrop(t){const r={...ja,...this.props.crop||{}};return an(r,t.width,t.height)}render(){const{aspect:t,children:r,circularCrop:i,className:s,crop:a,disabled:o,locked:l,style:c,ruleOfThirds:d}=this.props,{cropIsActive:p,newCropIsBeingDrawn:h}=this.state,f=a?this.renderCropSelection():null,m=h2("ReactCrop",s,p&&"ReactCrop--active",o&&"ReactCrop--disabled",l&&"ReactCrop--locked",h&&"ReactCrop--new-crop",a&&t&&"ReactCrop--fixed-aspect",a&&i&&"ReactCrop--circular-crop",a&&d&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",i&&"ReactCrop--no-animate");return u("div",{ref:this.componentRef,className:m,style:c,children:[n("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown,children:r}),a?u("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%",children:[n("defs",{children:u("mask",{id:`hole-${this.instanceId}`,children:[n("rect",{width:"100%",height:"100%",fill:"white"}),i?n("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):n("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"})]})}),n("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})]}):void 0,f]})}};Je(Yn,"xOrds",["e","w"]),Je(Yn,"yOrds",["n","s"]),Je(Yn,"xyOrds",["nw","ne","se","sw"]),Je(Yn,"nudgeStep",1),Je(Yn,"nudgeStepMedium",10),Je(Yn,"nudgeStepLarge",100),Je(Yn,"defaultProps",{ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}});let y2=Yn;function b2({profile:e,opened:t,username:r,onClose:i}){const{refetch:s}=fg(r),a=o2(),{uploadAvatarMutation:o}=wn(),[l,c]=_.useState(e==null?void 0:e.pretty_name),[d,p]=_.useState(e==null?void 0:e.profile_description),[h,f]=_.useState(null),[m,y]=_.useState(),[b,S]=_.useState(null),k=_.useRef(null),[w,T]=_.useState(e!=null&&e.avatar_url?`${xt}/files/${e==null?void 0:e.avatar_url}`:""),[A,R]=_.useState(!1);_.useEffect(()=>{c(e==null?void 0:e.pretty_name),p(e==null?void 0:e.profile_description)},[e]);function E(){r&&a.mutate({username:r,request:{pretty_name:l,profile_description:d}},{onSuccess:()=>{c(e==null?void 0:e.pretty_name),p(e==null?void 0:e.profile_description),s(),i()},onError:C=>{console.error("Update failed:",C.message)}})}const z=()=>n(G,{style:{display:"flex",width:"100%"},children:n(Rr,{onChange:async C=>
441{if(!C||(f(C),R(!1),S(null),y(void 0),T(URL.createObjectURL(C)),!k.current))return;const M=k.current;M.complete||await new Promise(U=>{M.onload=U});const{width:P,height:I}=M,L=m2(p2({unit:"%",width:50},16/9,P,I),P,I);y(L)},accept:"image/png,image/jpeg,image/gif",children:C=>n(ue,{shadow:"md",style:{width:"100%",cursor:"pointer"},...C,children:n(ue.Section,{children:u(G,{style:{position:"relative",width:"100%",borderRadius:"0.25rem",overflow:"hidden"},children:[n("img",{ref:k,src:w||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAoCAYAAACIC2hQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAbRJREFUeNrsl91ugzAMhQMGJk3qNJVe7f0fb/+TWlqVskQ6YVYaCC2OduNIp6XCMV9DnCMXxpgX8zf2Vp/sN1nt8B2Oo9Ubrp+tHs30GBB7smqsWqsiEndGXG+1gUaQDQusrDqrSwLS3f9CQoM5NeZLQBrEu/HgPspIwjPg2hnIdyRySbZ48AdWeQ5yuwCyYYv3A40ryhN6yCoB6VenxvUBajA3BlkugGz9KmKuU0GMPAU5RCALtmU4rIP/vhOy4K8cOY6Ei34BZGqfVQD0sH0CsmeQFeohzDnCEiuqdmUxeFhCcfnToJ6AfGWFc2F/1MRgXdInaC2kHzWDPWIeTUAS/swJb4GmYP1KlkKQIewBwB42hNzhXoO4SdjwHL3n7NsjJgVLOML6yBlNKdgY6K0HdBds/DnYYcZIiBVjF8KGoCIuEimw1W5X5nCRHG4Xc6bVLoJ7om5HOVwkh9tRDhfJ4XZ8v4i5yMKVvMntvDOIuggeKup2hNct6iKIEXU7X/WiLiLQjly5HT/wxVxEoB25cjvtmbRn0p5JeybtmbRn0p5JeybtmbRn0p5Je6Z/6Jl+BRgAqFHkuKGmPZUAAAAASUVORK5CYII=",style:{width:"100%",height:"100%",objectFit:"fill"},onError:M=>{M.currentTarget.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAoCAYAAACIC2hQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAbRJREFUeNrsl91ugzAMhQMGJk3qNJVe7f0fb/+TWlqVskQ6YVYaCC2OduNIp6XCMV9DnCMXxpgX8zf2Vp/sN1nt8B2Oo9Ubrp+tHs30GBB7smqsWqsiEndGXG+1gUaQDQusrDqrSwLS3f9CQoM5NeZLQBrEu/HgPspIwjPg2hnIdyRySbZ48AdWeQ5yuwCyYYv3A40ryhN6yCoB6VenxvUBajA3BlkugGz9KmKuU0GMPAU5RCALtmU4rIP/vhOy4K8cOY6Ei34BZGqfVQD0sH0CsmeQFeohzDnCEiuqdmUxeFhCcfnToJ6AfGWFc2F/1MRgXdInaC2kHzWDPWIeTUAS/swJb4GmYP1KlkKQIewBwB42hNzhXoO4SdjwHL3n7NsjJgVLOML6yBlNKdgY6K0HdBds/DnYYcZIiBVjF8KGoCIuEimw1W5X5nCRHG4Xc6bVLoJ7om5HOVwkh9tRDhfJ4XZ8v4i5yMKVvMntvDOIuggeKup2hNct6iKIEXU7X/WiLiLQjly5HT/wxVxEoB25cjvtmbRn0p5JeybtmbRn0p5JeybtmbRn0p5Je6Z/6Jl+BRgAqFHkuKGmPZUAAAAASUVORK5CYII="}}),n(G,{pos:"absolute",style:{background:"linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0, 0.3))",top:0,left:0,right:0,bottom:0}}),!h&&u(G,{pos:"absolute",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:10,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"},children:[n(gn,{size:"2.5rem",color:"white",opacity:.9}),n(v,{size:"sm",c:"white",opacity:.8,fw:500,children:"Click to upload image"})]})]})})})})});async function N(C){if(!k.current||!C.width||!C.height)return;const M=k.current;M.complete||await new Promise(W=>{M.onload=W});const P=M.naturalWidth/M.width,I=M.naturalHeight/M.height,L={x:C.unit==="%"?C.x/100*M.width:C.x,y:C.unit==="%"?C.y/100*M.height:C.y,width:C.unit==="%"?C.width/100*M.width:C.width,height:C.unit==="%"?C.height/100*M.height:C.height},U={x:L.x*P,y:L.y*I,width:L.width*P,height:L.height*I};let q,B;if(typeof OffscreenCanvas<"u"?(q=new OffscreenCanvas(U.width,U.height),B=q.getContext("2d")):(q=document.createElement("canvas"),q.width=U.width,q.height=U.height,B=q.getContext("2d")),!B)return;B.drawImage(M,U.x,U.y,U.width,U.height,0,0,U.width,U.height);const Y=/iPhone/.test(navigator.userAgent);let Q;typeof OffscreenCanvas<"u"&&q instanceof OffscreenCanvas?Q=await q.convertToBlob({type:"image/jpeg",quality:Y?.4:.9}):Q=await new Promise(W=>{q.toBlob(W,"image/jpeg",Y?.4:.9)}),B&&B.clearRect(0,0,q.width,q.height),q=null,B=null,!(!Q||!h)&&S(new File([Q],h==null?void 0:h.name))}return n(Oe,{opened:t,onClose:i,title:n(v,{size:"lg",fw:500,children:"Edit Profile"}),centered:!0,radius:"sm",size:"md",overlayProps:{backgroundOpacity:.35,blur:3},children:u(j,{gap:"md",children:[n(Te,{label:"Pretty Name",placeholder:"Enter new pretty name",value:l||"",onChange:C=>c(C.currentTarget.value)}),n(Li,{label:"Profile Description",placeholder:"Enter new description",value:d||"",onChange:C=>p(C.currentTarget.value)}),u(j,{children:[n(v,{fw:500,children:"Avatar / Stream Preview"}),h?n(y2,{crop:m,onChange:C=>y(C),onComplete:N,aspect:16/9,minHeight:100,children:n(z,{})}):n(z,{}),h&&u($,{grow:!0,children:[n(V,{disabled:o.isPending||!b,loading:o.isPending,onClick:()=>b&&o.mutate({image:b,username:r},{onSuccess(){f(null),R(!0),T(URL.createObjectURL(b))},onError(C){Ee.show({position:"top-center",title:"Error",message:`${C.message}`,color:"red"}),f(null),R(!0),T(URL.createObjectURL(b))}}),leftSection:n(Ai,{size:"1rem"}
441),variant:"gradient",gradient:{from:"grape",to:"red",deg:45},children:"Apply"}),n(V,{leftSection:n(zr,{size:"1rem"}),variant:"default",onClick:()=>f(null),children:"Reset"})]})]}),a.isError&&n(Le,{icon:n(zt,{size:20}),title:"Update Error",color:"red",radius:"md",children:a.error.message||"Failed to update profile"}),u($,{grow:!0,gap:"md",children:[n(V,{variant:"light",color:"blue",onClick:i,children:"Cancel"}),n(V,{onClick:E,loading:a.isPending,disabled:!l&&!d||h!==null&&!A,variant:"gradient",leftSection:n(Bp,{size:"1rem"}),gradient:{from:"blue.4",to:"green.4",deg:45},children:"Update"})]})]})})}async function _2(e,t,r){const i=new FormData;return i.append("description",t.description),i.append("media_type",t.media_type),i.append("file",r),await Qi(`${O}/${e}/posts`,i)}async function v2(e,t){return await ae(`${O}/${e}/posts/${t}`)}async function w2(e,t=1,r=9){return await ae(`${O}/${e}/posts?page=${t}&limit=${r}`)}async function S2(e,t,r){return await Ft(`${O}/${e}/posts/${t}`,r)}async function C2(e,t){return await et(`${O}/${e}/posts/${t}`)}async function T2(e,t,r){return await ae(`${O}/posts?subscribed=${e}&page=${t}&limit=${r}`)}async function x2(e,t){return await _e(`${O}/${e}/posts/approve/${t}`)}function k2(e,t){return oe({queryKey:["post",e,t],queryFn:()=>v2(e,t),enabled:!!e&&!!t,retry:1})}function gg(e,t=9){return zc({queryKey:["posts",e,t],queryFn:({pageParam:r=1})=>w2(e,r,t),getNextPageParam:(r,i)=>{if(!(!r.posts||r.posts.length<t))return i.length+1},initialPageParam:1,enabled:!!e,retry:1})}function E2(){return J({mutationFn:({username:e,request:t,mediaFile:r})=>_2(e,t,r)})}function P2(){return J({mutationFn:({username:e,postId:t,request:r})=>S2(e,t,r)})}function yg(){return J({mutationFn:({username:e,postId:t})=>C2(e,t)})}function M2(e,t,r){return oe({queryKey:["all-posts",{subscribed:e,page:t,limit:r}],queryFn:()=>T2(e,t,r),enabled:!0})}function bg(){return J({mutationFn:({username:e,postId:t})=>x2(e,t)})}function A2({opened:e,onClose:t,onSuccess:r}){var b;const{user:i}=fe(),s=i==null?void 0:i.username,a=E2(),[o,l]=_.useState(""),c=_g(),{handleReset:d,file:p,mediaType:h,handleFileSelect:f}=c,m=()=>{l(""),d(),t()},y=()=>{!s||!p||!h||a.mutate({username:s,request:{description:o,media_type:h},mediaFile:p},{onSuccess:()=>{Ee.show({position:"top-center",title:"Success",message:"Post created successfully!",color:"green"}),m(),r==null||r()},onError:S=>{Ee.show({position:"top-center",title:"Error",message:`Failed to create post: ${S.message}`,color:"red"})}})};return n(Oe,{opened:e,onClose:m,title:n(v,{size:"lg",fw:500,children:"Create New Post"}),centered:!0,radius:"sm",size:"md",overlayProps:{backgroundOpacity:.35,blur:3},children:u(j,{gap:"md",children:[n(Li,{label:"Description",placeholder:"What's on your mind?",value:o,onChange:S=>l(S.currentTarget.value),maxLength:1e3,rows:3}),u(j,{children:[n(v,{fw:500,children:"Media"}),n(D2,{mp:c}),p&&u($,{grow:!0,children:[n(Rr,{onChange:S=>S&&f([S]),accept:"image/*,video/*",children:S=>n(V,{...S,leftSection:n(Ai,{size:"1rem"}),variant:"light",children:"Change File"})}),n(V,{leftSection:n(zr,{size:"1rem"}),variant:"default",onClick:d,children:"Remove"})]})]}),a.isError&&n(Le,{icon:n(zt,{size:20}),title:"Create Post Error",color:"red",radius:"md",children:((b=a.error)==null?void 0:b.message)||"Failed to create post"}),u($,{grow:!0,gap:"md",children:[n(V,{variant:"light",color:"blue",onClick:m,children:"Cancel"}),n(V,{onClick:y,loading:a.isPending,disabled:!p||!h||a.isPending,variant:"gradient",leftSection:n(Mc,{size:"1rem"}),gradient:{from:"blue.4",to:"green.4",deg:45},children:"Create Post"})]})]})})}function _g(){const[e,t]=_.useState(null),[r,i]=_.useState(null),[s,a]=_.useState("");return{handleFileSelect:c=>{if(!(c!=null&&c.length))return;const d=c[0];t(d),a(URL.createObjectURL(d)),d.type.startsWith("image/")?i("photo"):d.type.startsWith("video/")&&i("video")},handleReset:()=>{t(null),i(null),s&&URL.revokeObjectURL(s),a("")},previewUrl:s,mediaType:r,file:e}}function D2({mp:e}){const{handleFileSelect:t,mediaType:r,previewUrl:i,file:s}=e;return!s||!i?n(Rr,{onChange:a=>a&&t([a]),accept:"image/*,video/*",children:a=>n(ue,{shadow:"md",style:{width:"100%",cursor:"pointer",minHeight:"200px"},...a,children:n(ue.Section,{children:n(G,{style:{position:"relative",width:"100%",height:"200px",borderRadius:"0.25rem",overflow:"hidden",backgroundColor:"#f8f9fa",display:"flex",alignItems:"center",justifyContent:"center"},children:u(G,{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"16px"},children:[u($,{gap:"md",children:[n(gn,{size:"2rem",color:"#868e96"}),n(v,{size:"lg",c:"dimmed",children:"or"}),n(ka,{size:"2rem",color:"#868e96"})]}),n(v,{size:"sm",c:"dimmed",fw:500,children:"Click to upload photo or video"})]})})})})}):n(ue,{shadow:"md",style:{width:"100%"},children:n(ue.Section,{children:n(G,{style:{position:"relative",width:"100%",borderRadius:"0.25rem",overflow:"hidden"}
441,children:r==="photo"?n("img",{src:i,style:{width:"100%",height:"auto",maxHeight:"300px",objectFit:"contain",backgroundColor:"#000"},alt:"Preview"}):n("video",{src:i,style:{width:"100%",height:"auto",maxHeight:"300px",objectFit:"contain",backgroundColor:"#000"},controls:!0,preload:"metadata"})})})})}function lt(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?`${parseInt(t[1],16)}, ${parseInt(t[2],16)}, ${parseInt(t[3],16)}`:"0, 0, 0"}function vg({opened:e,onClose:t,posts:r,initialIndex:i,userColor:s,username:a,postId:o,isOwnPost:l=!1,onEdit:c,onDelete:d,onApprove:p}){const[h,f]=_.useState(i||0),[m,y]=_.useState(!1),[b,S]=_.useState(!1),[k,w]=_.useState(!1),[T,A]=_.useState(!0),[R,E]=_.useState(null),[z,N]=_.useState(!1);r&&r.length>0&&(a=a||r[h].username,s=s||r[h].user_color);const{data:C,isLoading:M,error:P}=k2(a,o),I=C?[C]:r||[],L=I[h],{user:U}=fe();_.useEffect(()=>{f(i||0)},[i]),_.useEffect(()=>{y(!1),S(!1)},[h,L]),_.useEffect(()=>{R&&clearTimeout(R);const ne=setTimeout(()=>{A(!1)},3e3);return E(ne),()=>{R&&clearTimeout(R)}},[T]);const q=()=>{T||A(!0)};_.useEffect(()=>{const ne=Re=>{e&&(Re.key==="ArrowLeft"&&h>0?f(te=>te-1):Re.key==="ArrowRight"&&h<I.length-1?f(te=>te+1):Re.key==="Escape"?t():(Re.key==="i"||Re.key==="I")&&w(te=>!te))};return window.addEventListener("keydown",ne),()=>window.removeEventListener("keydown",ne)},[e,h,I.length,t]);
441const[B,Y]=_.useState(null),[Q,W]=_.useState(null),F=ne=>{W(null),Y(ne.targetTouches[0].clientX)},H=ne=>{W(ne.targetTouches[0].clientX)},K=()=>{if(!B||!Q)return;const ne=B-Q,Re=ne>50,te=ne<-50;Re&&h<I.length-1?f($e=>$e+1):te&&h>0&&f($e=>$e-1)},X=()=>{h>0&&f(ne=>ne-1)},Z=()=>{h<I.length-1&&f(ne=>ne+1)},le=ne=>{const Re=new Date(ne),te=new Date,$e=te.getTime()-Re.getTime(),Ue=Math.floor($e/(1e3*60*60*24));return Ue===0?"Today":Ue===1?"Yesterday":Ue<7?`${Ue} days ago`:Re.toLocaleDateString("en-US",{month:"short",day:"numeric",year:Re.getFullYear()!==te.getFullYear()?"numeric":void 0})},de=()=>{y(!0),S(!1)},ye=()=>{S(!0),y(!1)},ge=()=>{c&&L&&(c(L),N(!1))},be=()=>{d&&L&&(d(L.id),N(!1))},Me=()=>{p&&L&&(p(L.id),N(!1))};return M&&!P?n(Oe,{opened:e,onClose:t,size:"100%",centered:!0,padding:0,withCloseButton:!1,fullScreen:!0,styles:{content:{background:"rgb(0, 0, 0)",border:"none",borderRadius:0},body:{padding:0,height:"100vh",width:"100vw"}},children:n(G,{style:{height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"rgb(0, 0, 0)"},children:n(ri,{height:40,width:40,radius:"xl"})})}):P||!L?n(Oe,{opened:e,onClose:t,size:"100%",centered:!0,padding:0,withCloseButton:!1,fullScreen:!0,styles:{content:{background:"rgb(0, 0, 0)",border:"none",borderRadius:0}},children:n(G,{style:{height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"rgb(0, 0, 0)"},children:u(j,{align:"center",gap:"lg",children:[n(gn,{size:"3rem",color:"rgba(255, 255, 255, 0.4)"}),n(v,{c:"rgba(255, 255, 255, 0.6)",size:"sm",children:"Post not found"})]})})}):n(Oe,{opened:e,onClose:t,size:"100%",centered:!0,padding:0,withCloseButton:!1,fullScreen:!0,styles:{content:{background:"rgb(0, 0, 0)",border:"none",borderRadius:0},body:{padding:0,height:"100vh",width:"100vw"}},children:u(G,{style:{position:"relative",height:"100vh",width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",background:"rgb(0, 0, 0)"},onTouchStart:F,onTouchMove:H,onTouchEnd:K,onMouseMove:q,children:[n(es,{mounted:T,transition:"slide-down",duration:200,timingFunction:"ease",children:ne=>n(G,{style:{...ne,position:"absolute",top:0,left:0,right:0,zIndex:100,background:"linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent)",padding:"20px",pointerEvents:"none"},children:u($,{justify:"space-between",align:"center",children:[u($,{gap:"xs",style:{pointerEvents:"auto"},children:[n(Se,{label:"Post info",children:n(Ne,{onClick:()=>w(!k),size:"lg",variant:"subtle",style:{backgroundColor:k?s:"rgba(255, 255, 255, 0.1)",border:k?"none":"1px solid rgba(255, 255, 255, 0.2)",borderRadius:"50%",backdropFilter:"blur(10px)",transition:"all 0.2s ease"},children:n(ms,{size:"1.2rem",color:"white"})})}),I.length>1&&u(v,{c:"white",size:"sm",fw:500,style:{backgroundColor:"rgba(255, 255, 255, 0.1)",padding:"4px 12px",borderRadius:"20px",border:"1px solid rgba(255, 255, 255, 0.2)",backdropFilter:"blur(10px)"},children:[h+1," / ",I.length]})]}),u($,{gap:"xs",style:{pointerEvents:"auto"},children:[(l||U&&he(U,Ce))&&u(ce,{opened:z,onChange:N,position:"bottom-end",width:180,shadow:"xl",radius:"lg",withArrow:!0,styles:{dropdown:{backgroundColor:"rgba(20, 20, 20, 0.95)",backdropFilter:"blur(20px)",border:"1px solid rgba(255, 255, 255, 0.1)"},arrow:{backgroundColor:"rgba(20, 20, 20, 0.95)",border:"1px solid rgba(255, 255, 255, 0.1)"},item:{color:"white","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"},"&[data-hovered]":{backgroundColor:"rgba(255, 255, 255, 0.1)"}}},children:[n(ce.Target,{children:n(Se,{label:"Post options",children:n(Ne,{size:"lg",variant:"subtle",style:{backgroundColor:z?"rgba(255, 255, 255, 0.2)":"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",borderRadius:"50%",backdropFilter:"blur(10px)",transition:"all 0.2s ease"},children:n(Qp,{size:"1.2rem",color:"white"})})})}),u(ce.Dropdown,{children:[l&&n(ce.Item,{leftSection:n(Vp,{size:"1rem"}),onClick:ge,children:"Edit post"}),U&&he(U,Ce)&&n(ce.Item,{leftSection:n(Ke,{size:"1rem"}),onClick:Me,color:"green",children:"Approve post"}),n(ce.Item,{leftSection:n(zr,{size:"1rem"}),onClick:be,color:"red",children:"Delete post"})]})]}),n(Se,{label:"Close",children:n(Ne,{onClick:t,size:"lg",variant:"subtle",style:{backgroundColor:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",borderRadius:"50%",backdropFilter:"blur(10px)",transition:"all 0.2s ease"},children:n(ht,{size:"1.2rem",color:"white"})})})]})]})})}),n(es,{mounted:T&&h>0,transition:"slide-right",duration:200,timingFunction:"ease",children:ne=>n(Se,{label:"Previous",children:n(Ne,{size:"xl",onClick:X,style:{...ne,position:"absolute",left:20,top:"50%",transform:"translateY(-50%)",zIndex:90,backgroundColor:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",borderRadius:"50%",backdropFilter:"blur(10px)",transition:"all 0.2s ease"},children:n(ao,{size:"1.5rem",color:"white"})})})}),n(es,{mounted:T&&h<I.length-1,transition:"slide-left",duration:200,timingFunction:"ease",children:ne=>n(Se,{label:"Next",children:n(Ne,{size:"xl",onClick:Z,style:{...ne,position:"absolute",right:20,top:"50%",transform:"translateY(-50%)",zIndex:90,backgroundColor:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",borderRadius:"50%",backdropFilter:"blur(10px)",transition:"all 0.2s ease"},children:n(oo,{size:"1.5rem",color:"white"})})})}),n(G,{style:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:L.media_type==="video"?n("video",{src:`${xt}/files/${L.media_url}`,controls:!0,autoPlay:!0,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:"8px",boxShadow:"0 20px 40px rgba(0, 0, 0, 0.3)"}}):u(G,{style:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:[!m&&!b&&n(G,{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:n(ri,{height:60,width:60,radius:"xl"})}),b?u(G,{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[n(gn,{size:"3rem",color:"rgba(255, 255, 255, 0.4)"}),n(v,{c:"rgba(255, 255, 255, 0.6)",size:"sm",children:"Failed to load image"})]}):n("img",{src:`${xt}/files/${L.media_url}`,alt:"Post",onLoad:de,onError:ye,style:{maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",objectFit:"contain",borderRadius:"8px",boxShadow:"0 20px 40px rgba(0, 0, 0, 0.3)",opacity:m?1:0,transition:"opacity 0.3s ease"}})]})}),I.length>1&&I.length<100&&n(es,{mounted:T,transition:"slide-up",duration:200,timingFunction:"ease",children:ne=>
441n(G,{style:{...ne,position:"absolute",bottom:20,left:"50%",transform:"translateX(-50%)",zIndex:100,display:"flex",gap:"6px",backgroundColor:"rgba(0, 0, 0, 0.5)",padding:"8px 12px",borderRadius:"20px",backdropFilter:"blur(10px)",border:"1px solid rgba(255, 255, 255, 0.1)"},children:I.map((Re,te)=>n(G,{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:te===h?s:"rgba(255, 255, 255, 0.4)",transition:"all 0.2s ease",cursor:"pointer"},onClick:()=>f(te)},te))})}),n(es,{mounted:k,transition:"slide-up",duration:300,timingFunction:"ease",children:ne=>n(Ie,{style:{...ne,position:"absolute",bottom:0,left:0,right:0,background:"rgba(10, 10, 10, 0.95)",backdropFilter:"blur(20px)",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",border:"1px solid rgba(255, 255, 255, 0.1)",borderBottom:"none",zIndex:110,maxHeight:"40vh",overflowY:"auto"},p:"xl",children:u(j,{gap:"md",children:[u($,{gap:"md",children:[n(pn,{size:"lg",radius:"xl",to:`/${a}/profile/`,component:xe,src:I[h].user_avatar?`${xt}/files/${I[h].user_avatar}`:void 0,style:{background:`linear-gradient(135deg, ${s}, rgba(${lt(s??"#000000")}, 0.8))`,border:`2px solid ${s}40`,boxShadow:`0 4px 12px ${s}30`},children:n(fn,{size:"1.5rem"})}),u(G,{style:{flex:1},children:[n(v,{to:`/${a}/profile/`,component:xe,size:"lg",fw:600,c:"white",mb:4,children:a}),u($,{gap:"xs",align:"center",children:[n(lo,{size:"0.9rem",color:"rgba(255, 255, 255, 0.5)"}),n(v,{c:"rgba(255, 255, 255, 0.7)",size:"sm",children:le(L.created_at)})]})]})]}),L.description&&n(v,{c:"rgba(255, 255, 255, 0.9)",size:"sm",style:{lineHeight:1.6},children:L.description})]})})})]})})}function I2({baseColor:e,shade:t,tooltip:r}){const i=tn(),s=i.colors[e][t],a=i.colors[e][t+2]||i.colors[e][t],o=i.colors[e][t-2]||s;return n(Se,{label:r,children:u("svg",{width:"140",height:"60",viewBox:"0 0 140 60",style:{position:"absolute",top:"-50px",left:"50%",transform:"translateX(-50%)",zIndex:2,filter:`drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 8px ${s})`},children:[u("defs",{children:[u("linearGradient",{id:"crownGradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[n("stop",{offset:"0%",style:{stopColor:o,stopOpacity:1}}),n("stop",{offset:"50%",style:{stopColor:s,stopOpacity:1}}),n("stop",{offset:"100%",style:{stopColor:a,stopOpacity:1}})]}),u("radialGradient",{id:"gemGradient",cx:"50%",cy:"50%",r:"50%",children:[n("stop",{offset:"0%",style:{stopColor:i.colors.red[5],stopOpacity:1}}),n("stop",{offset:"80%",style:{stopColor:i.colors.red[7],stopOpacity:1}}),n("stop",{offset:"100%",style:{stopColor:i.colors.red[9],stopOpacity:.8}})]})]}),n("path",{d:"M20 50 L40 10 L70 40 L100 10 L120 50 L110 50 C110 56 110 60 100 60 L40 60 C30 60 30 56 30 50 Z",fill:"url(#crownGradient)",stroke:o,strokeWidth:"3",children:n("animate",{attributeName:"opacity",values:"1;0.9;1",dur:"1.5s",repeatCount:"indefinite"})}),n("path",{d:"M30 45 C30 45 40 35 50 45 C60 55 80 55 90 45 C100 35 110 45 110 45",fill:"none",stroke:o,strokeWidth:"2"}),n("circle",{cx:"40",cy:"20",r:"5",fill:"url(#gemGradient)"}),n("circle",{cx:"70",cy:"30",r:"6",fill:"url(#gemGradient)"}),n("circle",{cx:"100",cy:"20",r:"5",fill:"url(#gemGradient)"}),n("path",{d:"M65 10 L75 10 L70 20 Z",fill:i.colors.red[5],stroke:i.colors.red[3],strokeWidth:"1",children:n("animate",{attributeName:"transform",type:"rotate",from:"0 70 15",to:"5 70 15",dur:"2s",repeatCount:"indefinite",values:"0;5;-5;0",keyTimes:"0;0.33;0.66;1"})})]})})}function $2(e){if(!e||!za.has(e))return null;const t=za.get(e);switch(t==null?void 0:t.placement){case"gold":return{baseColor:"yellow",shade:4,tooltip:`Top-1 ${t.category} of the previous month!`};case"silver":return{baseColor:"gray",shade:4,tooltip:`Top-2 ${t.category}  of the previous month!`};case"bronze":return{baseColor:"orange",shade:7,tooltip:`Top-3 ${t.category}  of the previous month!`};default:return null}}async function R2({username:e,request:t}){return await _e(`${O}/complaints/${e}`,t)}function z2(){return{createComplaintMutation:J({mutationFn:R2})}}const N2=0,L2=1,O2=2,F2=3,U2=4,B2=5,q2=6,j2=7,H2=8,W2=9,Y2=10,Q2=[{value:N2.toString(),label:"It is a recording, not a live broadcast"},{value:L2.toString(),label:"Streamer is a minor/presence of minors"},{value:O2.toString(),label:"Animal abuse"},{value:F2.toString(),label:"Exposing other's personal data or filming others without consent"},{value:U2.toString(),label:"Offensive behavior, harassment, or hate speech"},{value:B2.toString(),label:"Non-consentual behavior"},{value:q2.toString(),label:"Depicting, promoting or threatening self
441-harm"},{value:j2.toString(),label:"Using unsafe or illegal substances/items"},{value:H2.toString(),label:"Extreme violence or abuse"},{value:W2.toString(),label:"Advertising other platforms"},{value:Y2.toString(),label:"None of the above"}];function V2({username:e,opened:t,onClose:r}){const{createComplaintMutation:i}=z2(),s=Ge({initialValues:{reason:"",details:"",confirmed:!1},transformValues(a){return{reason:parseInt(a.reason),details:a.details,confirmed:a.confirmed}}});return n(Oe,{opened:t,onClose:r,size:"md",title:"Submit a complaint",children:n(Hg,{onSubmit:s.onSubmit(a=>{i.mutate({username:e,request:a},{onSuccess(){Ee.show({position:"top-center",title:"Complaint registered",message:"We will look into it as soon as possible",color:"green"}),r()}})}),children:u(j,{children:[n(it,{placeholder:"Please select",label:`Report ${e} for`,data:Q2,required:!0,...s.getInputProps("reason")}),n(Li,{label:"Details and explanation",placeholder:"Please provide details so that we can investigate the matter efficiently",rows:3,...s.getInputProps("details")}),n(fp,{required:!0,label:"I confirm that the information I provided is accurate and complete to the best of my knowledge,  and I understand that submitting false or harmful reports may result in losing the ability to submit future reports.",...s.getInputProps("confirmed")}),u($,{children:[n(V,{variant:"default",onClick:r,children:"Cancel"}),n(V,{type:"submit",variant:"gradient",children:"Report"})]})]})})})}function K2({isOwnProfile:e,onCreatePost:t,userColor:r}){const i=tn();return e?u(j,{gap:"lg",align:"center",py:"xl",children:[n(G,{style:{width:80,height:80,borderRadius:"50%",background:`linear-gradient(135deg, rgba(${lt(r)}, 0.1) 0%, rgba(${lt(r)}, 0.05) 100%)`,display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:n(Ec,{size:32,color:r,stroke:1.5})}),u(j,{gap:"xs",align:"center",children:[n(v,{size:"xl",fw:600,c:r,children:"Ready to share your story?"}),n(v,{c:"dimmed",ta:"center",size:"sm",maw:400,children:"Your profile is looking great! Share your first post with photos or videos to connect with your audience and bring your profile to life."})]}),n(V,{onClick:t,size:"md",radius:"xl",variant:"gradient",gradient:{from:r,to:`rgba(${lt(r)}, 0.7)`,deg:45},leftSection:n(Mc,{size:"1.2rem"}),style:{boxShadow:`0 4px 12px rgba(${lt(r)}, 0.3)`,transition:"all 0.2s ease",transform:"translateY(0px)"},onMouseEnter:s=>{s.currentTarget.style.transform="translateY(-2px)",s.currentTarget.style.boxShadow=`0 6px 20px rgba(${lt(r)}, 0.4)`},onMouseLeave:s=>{s.currentTarget.style.transform="translateY(0px)",s.currentTarget.style.boxShadow=`0 4px 12px rgba(${lt(r)}, 0.3)`},children:"Create your first post"})]}):u(j,{gap:"sm",align:"center",py:"lg",children:[n(G,{style:{width:50,height:50,borderRadius:"50%",border:`2px solid ${i.colors.gray[4]}`,display:"flex",alignItems:"center",justifyContent:"center"},children:n(so,{size:20,color:i.colors.gray[6],stroke:1.5})}),u(j,{gap:"xs",align:"center",children:[n(v,{size:"md",fw:500,children:"No posts yet"}),n(v,{c:"dimmed",ta:"center",size:"sm",children:"This user hasn't shared any posts yet."})]})]})}function G2({username:e,userColor:t,isOwnProfile:r,onCreatePost:i,onEdit:s,onDelete:a,onApprove:o}){const{data:l,isLoading:c,error:d,fetchNextPage:p,hasNextPage:h,isFetchingNextPage:f}=gg(e),[m,{open:y,close:b}]=_t(!1),[S,k]=_.useState(0),[w,T]=_.useState(!1),A=tn(),R=_.useRef(null),E=_.useRef(null),z=(l==null?void 0:l.pages.flatMap(M=>M.posts||[]))||[];_.useEffect(()=>{if(!(!h||f))return R.current=new IntersectionObserver(M=>{M[0].isIntersecting&&p()},{threshold:.1}),E.current&&R.current.observe(E.current),()=>{R.current&&R.current.disconnect()}},[h,f,p]);const N=async()=>{T(!0);try{let M=h,P=0;const I=50;for(;M&&P<I;){P++;const L=await p();if(await new Promise(U=>setTimeout(U,100)),L.data){const U=L.data.pages[L.data.pages.length-1];M=U.posts&&U.posts.length>=9}else break}}catch(M){console.error("Error loading all posts:",M)}finally{T(!1)}},C=async M=>{k(M),h&&await N(),y()};return c?n(ct,{py:"xl",children:n(Xe,{size:"lg",color:t})}):d?n(Le,{icon:n(zt,{size:20}
441),color:"red",radius:"lg",children:"Failed to load posts"}):z.length===0?n(K2,{isOwnProfile:r,onCreatePost:i,userColor:t}):u(ke,{children:[n(Kt,{gutter:"xs",children:z.map((M,P)=>n(Kt.Col,{span:4,children:n(Mt,{onClick:()=>C(P),disabled:w,style:{width:"100%",borderRadius:A.radius.md,overflow:"hidden",position:"relative",transition:"all 0.2s ease",transform:"scale(1)",opacity:w?.7:1},onMouseEnter:I=>{w||(I.currentTarget.style.transform="scale(1.02)",I.currentTarget.style.boxShadow=`0 8px 25px rgba(${lt(t)}, 0.3)`)},onMouseLeave:I=>{w||(I.currentTarget.style.transform="scale(1)",I.currentTarget.style.boxShadow="none")},children:n(Va,{ratio:1,children:u(G,{style:{position:"relative",overflow:"hidden"},children:[M.media_type==="video"?u(ke,{children:[n("video",{src:`${xt}/files/${M.media_url}`,style:{width:"100%",height:"100%",objectFit:"cover"},muted:!0}),n(El,{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:n(Ne,{size:"xl",variant:"filled",color:"white",style:{backgroundColor:"rgba(255, 255, 255, 0.9)",borderRadius:"50%"},children:n(Kp,{size:"1.5rem",color:"black"})})})]}):n(jr,{src:`${xt}/files/${M.media_url}`,alt:"Post",style:{width:"100%",height:"100%",objectFit:"cover"}}),w&&n(El,{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.5)"},children:n(Xe,{size:"sm",color:t})}),n(G,{style:{position:"absolute",bottom:0,left:0,right:0,height:"30%",background:"linear-gradient(to top, rgba(0,0,0,0.6), transparent)",pointerEvents:"none"}})]})})})},M.id))}),h&&n(ct,{py:"xl",ref:E,children:n(Xe,{size:"lg",color:t})}),n(vg,{opened:m,onClose:b,posts:z,initialIndex:S,userColor:t,onEdit:s,onDelete:a,onApprove:o,isOwnPost:r})]})}function X2({onClick:e,userColor:t,isAgeVerified:r}){return u("div",{children:[n(V,{onClick:e,disabled:!r,size:"sm",radius:"xl",variant:"gradient",gradient:{from:t,to:`rgba(${lt(t)}, 0.8)`,deg:45},leftSection:n(Cb,{size:"1rem"}),style:{boxShadow:`0 2px 8px rgba(${lt(t)}, 0.3)`,transition:"all 0.2s ease",transform:"translateY(0px)",position:"relative",overflow:"hidden"},onMouseEnter:i=>{i.currentTarget.style.transform="translateY(-1px)",i.currentTarget.style.boxShadow=`0 4px 12px rgba(${lt(t)}, 0.4)`},onMouseLeave:i=>{i.currentTarget.style.transform="translateY(0px)",i.currentTarget.style.boxShadow=`0 2px 8px rgba(${lt(t)}, 0.3)`},children:n("span",{style:{position:"relative",zIndex:1},children:"Create Post"})}),!r&&u(v,{size:"xs",c:"dimmed",mt:"xs",children:[x("post_verify_age_warning")," ",n(Ze,{href:"/verify-age",size:"xs",children:x("verify_now")})]})]})}function J2(){const{username:e}=Bn();if(!e)return n("div",{children:"User not found"});const t=gt(),{data:r,isLoading:i,error:s}=fg(e),{user:a}=fe(),o=tn(),[l,{open:c,close:d}]=_t(!1),[p,{open:h,close:f}]=_t(!1),[m,{open:y,close:b}]=_t(!1),{blockMutation:S,unblockMutation:k,isBlockedQuery:w}=id(e),{subscriptionQuery:T,subscribeMutation:A,unsubscribeMutation:R}=zf(a),E=w(),{refetch:z}=gg(e,9),N=_.useMemo(()=>{const de=E.data;return(de==null?void 0:de.blocked)===!0},[E.data]),C=_.useMemo(()=>!T.data||!e?!1:T.data.some(de=>de.username===e),[T.data,e]),{checkDocumentQuery:M}=wn(),P=_.useMemo(()=>{var de;return((de=M==null?void 0:M.data)==null?void 0:de.document_uploaded)===!0},[M]),{inviteByUsernameMutation:I}=Mf(),L=_.useCallback(()=>{e&&(N?k.mutate(e,{onSuccess(){E.refetch()}}):S.mutate(e,{onSuccess(){E.refetch()}}))},[e,N,S,k,E]),U=_.useCallback(()=>{!e||!a||(C?R.mutate(e,{onSuccess(){T.refetch()}}):A.mutate(e,{onSuccess(){T.refetch()}}))},[e,a,C,A,R,T]),q=_.useCallback(()=>{e&&t(`/${e}`)},[e,t]),B=_.useCallback(()=>{f()},[f]),Y=P2(),Q=yg(),W=bg(),F=_.useCallback(de=>{if(!e)return;const ye=prompt("Edit post description:",de.description);ye!==null&&ye!==de.description&&Y.mutate({username:e,postId:de.id,request:{description:ye}},{onSuccess:()=>{z(),d()}})},[e,Y,z,d]),H=_.useCallback(de=>{e&&confirm("Are you sure you want to delete this post?")&&Q.mutate({username:e,postId:de},{onSuccess:()=>{z(),d()}})},[e,Q,z,d]),K=_.useCallback(de=>{e&&W.mutate({username:e,postId:de},{onSuccess:()=>{z(),d()}})},[e,Q,z,d]);function X(de){if(!de.Valid)return vr.language==="en"?"Never":"Никогда";const ye=new Date(de.Time),ge=ye.getFullYear()-new Date().getFullYear();if(ge<0)return new Intl.RelativeTimeFormat(vr.language,{numeric:"auto"}).format(ge,"years");function be(ne){if(ne>3&&ne<21)return"th";switch(ne%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}return`${new Intl.DateTimeFormat(vr.language,{month:"long",day:"numeric"}).format(ye)}${vr.language==="en"?be(ye.getDate()):""}`}const Z=$2(e);if(i)return n(Be,{size:"md",py:80,children:n(ct,{style:{height:"60vh"},children:u(j,{align:"center",gap:"md",children:[n(Xe,{size:"xl",color:"red.4"}),n(v,{c:"dimmed",size:"lg",children:"Loading profile..."})]})})});if(s)return n(Be,{size:"md",py:80,children:n(ct,{children:n(Le,{icon:n(zt,{size:24}),title:"Error",color:"red",radius:"lg",style:{maxWidth:500},children:s.message||"Could not load profile"})})});if(!r)return n(Be,{size:"md",py:80,children:n(ct,{children:n(Le,{icon:n(zt,{size:24}),title:"Not Found",color:"yellow",radius:"lg",style:{maxWidth:500},children:"Profile not found"})})});const le=(a==null?void 0:a.username)===e;return u(_.Fragment,{children:[n(V2,{username:e,opened:m,onClose:b}),u(Be,{size:"lg",py:40,children:[n("div",{style:{background:r.avatar_url?`url(${xt}/files/${r.avatar_url})`:"url(/046.jpg)",backgroundSize:"cover",backgroundPosition:"center",filter:"blur(32px)",width:"100%",position:"absolute",inset:0,opacity:"0.25",zIndex:-2}}),n("div",{style:{background:"rgba(0, 0, 0, 0.25)",width:"100%",position:"absolute",inset:0,zIndex:-1}}),u($,{justify:"space-between",align:"flex-start",mb:"xl",style:{background:`linear-gradient(217deg, rgba(${lt(r.color)},0.5), transparent 70.71%)`,borderRadius:"0.25rem",padding:"1rem",position:"relative"},children:[N&&n(pe,{variant:"light",radius:"sm",leftSection:n(rl,{size:"0.875rem"}),color:"red",style:{position:"absolute",bottom:8,right:12},children:"You have blocked this user"}
441),u($,{align:"flex-start",gap:"lg",children:[u(G,{style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center"},children:[Z&&n(I2,{baseColor:Z.baseColor,shade:Z.shade,tooltip:Z.tooltip}),n(pn,{src:`${xt}/files/${r.avatar_url}`,alt:`${r.pretty_name}'s avatar`,size:140,color:r.color,style:{zIndex:1},children:r.pretty_name.charAt(0).toUpperCase()})]}),u(j,{gap:0,children:[u($,{align:"center",gap:"sm",children:[n(Ye,{order:2,c:r.color,children:r.pretty_name}),(le||he(a,Ce))&&n(Ne,{size:"sm",variant:"subtle",color:r.color,onClick:c,title:"Edit Profile",children:n(Yp,{size:"1rem"})})]}),r.profile_description&&n(v,{size:"md",c:"dark.1",maw:600,children:r.profile_description}),u($,{gap:"lg",mt:"sm",children:[u(G,{children:[n(v,{size:"xl",fw:700,children:r.subscribers}),n(v,{size:"xs",c:"dark.2",children:"Subscribers"})]}),u(G,{children:[n(v,{size:"xl",fw:600,children:X(r.last_stream)}),n(v,{size:"xs",c:"dark.2",children:"Last stream"})]})]}),!le&&a&&u($,{gap:"sm",mt:"md",children:[n(V,{variant:"filled",color:r.color,size:"sm",leftSection:C?n(wb,{size:"1rem"}):n(ai,{size:"1rem"}),onClick:U,loading:A.isPending||R.isPending,disabled:N,style:{background:C?`linear-gradient(45deg, rgba(${lt(r.color)}, 0.8), rgba(${lt(r.color)}, 0.6))`:`linear-gradient(45deg, ${r.color}, rgba(${lt(r.color)}, 0.8))`,border:"none",boxShadow:`0 2px 8px rgba(${lt(r.color)}, 0.3)`,transition:"all 0.2s ease"},children:C?"Subscribed":"Subscribe"}),n(V,{variant:"light",size:"sm",color:r.color,leftSection:n(ka,{size:"1rem"}),onClick:q,disabled:N,style:{transition:"all 0.2s ease"},children:"View stream"})]}),le&&u($,{gap:"sm",mt:"md",children:[n(V,{variant:"gradient",gradient:{from:r.color,to:`rgba(${lt(r.color)}, 0.7)`,deg:45},size:"sm",leftSection:n(ka,{size:"1rem"}),onClick:q,style:{boxShadow:`0 2px 8px rgba(${lt(r.color)}, 0.3)`,transition:"all 0.2s ease"},children:"View stream"}),n(X2,{onClick:h,userColor:r.color,isAgeVerified:P})]})]})]}),u($,{children:[n(us,{value:`${window.location.origin}/${e}/profile`,children:({copied:de,copy:ye})=>n(Se,{label:de?"Copied!":"Share Profile",position:"left",children:n(Ne,{variant:"subtle",color:"gray",size:"lg",onClick:ye,children:n(Sb,{size:18})})})}),u(ce,{shadow:"md",width:200,children:[n(ce.Target,{children:n(Ne,{variant:"subtle",color:"gray",size:"lg",children:n(Qp,{size:18})})}),u(Td,{children:[n(Vs,{leftSection:N?n(ai,{size:"1rem"}):n(rl,{size:"1rem"}),disabled:!a,onClick:L,children:N?"Unblock":"Block"}),n(Vs,{leftSection:n(Id,{size:"1rem"}),disabled:!a,onClick:y,children:"Report"})]}),u(Td,{children:[n(Vs,{leftSection:N?n(ai,{size:"1rem"}):n(rl,{size:"1rem"}),disabled:!a,onClick:L,children:N?"Unblock":"Block"}),n(ce.Item,{onClick:()=>{I.mutate({username:e})},leftSection:n(io,{size:"1rem"}),disabled:I.isPending,children:"Invite user"}),n(Vs,{leftSection:n(Id,{size:"1rem"}),disabled:!a,onClick:y,children:"Report"})]})]})]})]}),u(re,{defaultValue:"posts",variant:"pills",color:"transparent",keepMounted:!1,styles:{tabLabel:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.25rem"}},classNames:{tab:c2.tab},children:[u(re.List,{mb:"md",grow:!0,children:[u(re.Tab,{value:"posts",children:[n(so,{size:20,stroke:1.5}),n(v,{size:"sm",children:"Posts"})]}),u(re.Tab,{value:"achievements",children:[n(Rl,{size:20,stroke:1.5}),n(v,{size:"sm",children:"Achievements"})]})]}),n(re.Panel,{value:"posts",pt:"md",children:n(G2,{username:e,userColor:r.color,isOwnProfile:le,onCreatePost:h,onDelete:H,onEdit:F,onApprove:K})}),n(re.Panel,{value:"achievements",pt:"md",children:u(j,{gap:"sm",align:"center",py:"lg",children:[n(G,{style:{width:50,height:50,borderRadius:"50%",border:`2px solid ${o.colors.gray[4]}`,display:"flex",alignItems:"center",justifyContent:"center"},children:n(Rl,{size:20,color:o.colors.gray[6],stroke:1.5})}),u(j,{gap:"xs",align:"center",children:[n(v,{size:"md",fw:500,children:"Achievements"}),n(v,{c:"dimmed",ta:"center",size:"sm",children:"No achievements unlocked yet."})]})]})})]}),(le||he(a,Ce))&&u(ke,{children:[n(b2,{opened:l,profile:r,username:e,onClose:d}),n(A2,{opened:p,onClose:f,onSuccess:B})]})]})]})}const Ih=`
442  <h5>Privacy Policy</h5>
443  <b>Effective Date</b>: November 20, 2025
444  <p><b>Last Updated</b>: November 16, 2025</p>
445  <h4>1. Introduction</h4>
446  <p>Welcome to ${Jc} (“<b>we</b>,” “<b>our</b>,” or “<b>us</b>”).<br>
447  We value your privacy and are committed to protecting your personal data in accordance with the General Data Protection Regulation (EU) 2016/679 (“GDPR”) and other applicable privacy laws.<br>
448  This Privacy Policy explains what personal data we collect, how we use it, and your rights regarding that information.<br>
449  By using our platform, you agree to this Privacy Policy.</p>
450
451  <h4>2. Data Controller</h4>
452  <p style="margin-bottom: 0px;">The data controller responsible for your personal data is:<br>
453  ${Ia}<br>
454  ${uc}
455  </p>
456  <div style="display:flex; align-items: center;">
457  <b>Email:</b><img height="25px" src="legal.email.jpg" />
458  </div>
459  <h4>3. Data We Collect</h4>
460  <p>We collect and process only the minimum data necessary to provide our streaming and withdrawal services.<br>
461  We collect the following data:</p>
462  <ul>
463    <li><strong>IP Address:</strong> automatically collected when you access our platform for security, fraud prevention, and analytics.</li>
464    <li><strong>Payment Information:</strong> such as card or phone numbers or wallet addresses necessary to process withdrawals.</li>
465  </ul>
466  <p>We do not collect any other personal information unless it is required to process withdrawals, including:</p>
467  <ul>
468    <li>Email addresses</li>
469    <li>Phone numbers</li>
470    <li>Names, addresses, or other identifying information</li>
471  </ul>
472
473  <h4>4. Purpose and Legal Basis for Processing</h4>
474  <p>We process your data for the following purposes:</p>
475  <table>
476    <tr>
477      <th>Purpose</th>
478      <th>Legal Basis (under GDPR)</th>
479    </tr>
480    <tr>
481      <td>To provide access to the platform and ensure its security</td>
482      <td>Article 6(1)(f) – Legitimate interests</td>
483    </tr>
484    <tr>
485      <td>To process payments and withdrawals</td>
486      <td>Article 6(1)(b) – Performance of a contract</td>
487    </tr>
488    <tr>
489      <td>To detect, prevent, and combat fraud or misuse</td>
490      <td>Article 6(1)(f) – Legitimate interests</td>
491    </tr>
492    <tr>
493      <td>To comply with legal obligations (e.g., financial reporting, AML)</td>
494      <td>Article 6(1)(c) – Legal obligation</td>
495    </tr>
496  </table>
497
498  <h4>5. Data Storage and Retention</h4>
499  <p>We store your data securely using appropriate technical and organizational measures.</p>
500  <ul>
501    <li>IP addresses are stored for a limited period necessary to ensure security and prevent misuse.</li>
502    <li>Payment information is retained only as long as required for accounting, legal, or financial compliance.</li>
503  </ul>
504  <p>Once data is no longer needed, it will be securely deleted or anonymized.</p>
505
506  <h4>6. Data Sharing</h4>
507  <p>We do not sell or share your personal data with third parties for marketing purposes.<br>
508  We may share your data only with:</p>
509  <ul>
510    <li>Payment processors to handle withdrawals and transactions.</li>
511    <li>Regulatory authorities or law enforcement, if legally required.</li>
512    <li>Technical service providers (e.g., hosting) under strict data protection agreements.</li>
513  </ul>
514  <p>All third parties processing your data act under data processing agreements that comply with Article 28 GDPR.</p>
515
516  <h4>7. International Data Transfers</h4>
517  <p>If your data is transferred outside the European Economic Area (EEA), we ensure that it is protected using:</p>
518  <ul>
519    <li>Adequacy decisions by the European Commission, or</li>
520    <li>Standard Contractual Clauses (SCCs) approved under Article 46 GDPR.</li>
521  </ul>
522
523  <h4>8. Your Rights</h4>
524  <p>Under the GDPR, you have the following rights:</p>
525  <ul>
526    <li>Right of access – to obtain a copy of your personal data.</li>
527    <li>
527Right to rectification – to correct inaccurate data.</li>
528    <li>Right to erasure (“right to be forgotten”).</li>
529    <li>Right to restrict processing.</li>
530    <li>Right to data portability.</li>
531    <li>Right to object to certain processing.</li>
532    <li>Right to lodge a complaint with your local data protection authority.</li>
533  </ul>
534  <div style="display:flex; align-items: center;">
535    To exercise these rights, contact us at: <img height="22px" style="margin-left: 2px; margin-top: 3px;" src="legal.email.jpg" />
536  </div>
537  <h4>9. Data Security</h4>
538  <p>We use encryption, firewalls, and secure access controls to protect your data against unauthorized access, alteration, or destruction.<br>
539  Access to payment and IP data is strictly limited to authorized personnel.</p>
540
541  <h4>10. Changes to This Policy</h4>
542  <p>We may update this Privacy Policy from time to time.<br>
543  Any significant changes will be posted on this page with an updated “Last Updated” date.<br>
544  Your continued use of the platform after such changes constitutes your acceptance of the revised policy.</p>
545
546  <h4>11. Contact Us</h4>
547  <p>If you have any questions or concerns regarding this Privacy Policy or your personal data, please contact:
548  <div style="display:flex; align-items: center;">
549  <b>Email:</b><img height="25px" style="margin-left: 2px; margin-top: 3px;" src="legal.email.jpg" />
550  </div>
551  Address: ${uc}</p>
552`,$h={en:Ih,ru:Ih};function Z2(){const{i18n:e}=Fe(),t=$h[e.language]??$h.en;return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:t}})})})})})}const Rh=`
553  <h5>Refund Policy</h5>
554  <b>Effective Date</b>: November 20, 2025
555  <p><b>Last Updated</b>: November 16, 2025</p>
556  <p>This Refund Policy (“Policy”) sets out the terms and conditions under which users of
557  ${Jc} (“<b>Platform</b>”, “<b>we</b>”, “<b>our</b>”, “<b>us</b>”) may request and obtain refunds for purchases and
558  payments made through the Platform.<br>
559  By using the Platform, you agree to this Policy in addition to our Terms of Service and Privacy Policy.</p>
560
561  <h4>1. General Principles</h4>
562  <p>
563  1.1. Refunds are available <b>within seven (7) calendar days</b> following the date of purchase or top-up of the user’s account balance, provided that the request meets the conditions outlined below.<br>
564  1.2. Refunds are processed only for unused funds remaining on the user’s Platform balance at the time of the request.<br>
565  1.3. Refunds are issued only for the remaining balance amount, without accounting for payment processing or transfer fees charged by the payment provider.<br>
566  1.4. Refunds are available <b>only for transactions made through an approved payment provider</b> integrated with the Platform. Payments made by other means (e.g., direct transfer, cryptocurrency, or promotional credits) are not eligible for refund.<br>
567  1.5. Refunds are generally made to the same payment method used for the original transaction unless otherwise required by applicable law or technical limitations. The time required for funds to appear in the user’s account depends on the user’s bank or payment provider and is beyond the Platform’s control.
568  </p>
569
570  <h4>2. Refunds for On-Site Transactions</h4>
571
572  <h5>2.1. Donations and Dares</h5>
573  <p>Payments made in connection with “<b>dares</b>,” “<b>donations</b>,” or similar voluntary contributions to streamers are non-refundable, as these represent voluntary support or immediate-value interactions. Refunds for such transactions may only be issued by express agreement between the streamer and the user, and with our prior written approval.</p>
574
575  <h5>2.2. Paid Streams</h5>
576  <p>Refunds for paid streams are available only in the following circumstances:</p>
577  <ul>
578    <li>A material inconsistency between the stream description and the actual content delivered;</li>
579    <li>Technical issues on the streamer’s side that prevent the user from accessing the purchased content.</li>
580  </ul>
581  <p>In all other cases, including user-side technical problems or dissatisfaction with the subjective quality of the content, refunds are not provided.
581</p>
582
583  <h5>2.3. On-Site Refunds (Event-Based Requests)</h5>
584  <p>Users may request an on-site refund directly through the Platform’s Support Chat. The user must provide:</p>
585  <ul>
586    <li>The streamer’s name;</li>
587    <li>The name or description of the stream or event;</li>
588    <li>A brief explanation of the reason for the refund request.</li>
589  </ul>
590  <p>
591  On-site refund requests must be submitted no later than thirty (30) minutes after the end of the stream or event.<br>
592  Such requests will be reviewed within one (1) working day, and if approved, the refund will be issued immediately. The user will receive an official confirmation in the Support Chat once the refund has been processed.
593  </p>
594
595  <h4>3. Procedure for Requesting a Refund</h4>
596  <p>
597  3.1. Refund requests must be submitted through the official <b>Support Form, Customer Support email, or the on-site Support Chat</b>, within the applicable time limits.<br>
598  3.2. The user must provide:
599  </p>
600  <ul>
601    <li>The account username;</li>
602    <li>The transaction ID or proof of payment;</li>
603    <li>A brief explanation of the reason for the refund request.</li>
604  </ul>
605  <p>
606  3.3. Refund requests will be reviewed within one (1) working day from the date of submission. If approved, funds will be returned within the following fourteen (14) days, depending on the processing times of the user’s bank or payment provider.<br>
607  3.4. On-site refund requests are governed by Section 2.3 above and are handled within one (1) working day, with immediate refund issuance upon approval and confirmation in the Support Chat.
608  </p>
609
610  <h4>4. Limitations and Exceptions</h4>
611  <p>4.1. Refunds will not be issued for:</p>
612  <ul>
613    <li>Fully used or consumed digital content or services;</li>
614    <li>Promotional credits, bonuses, or gift cards;</li>
615    <li>Payments made outside of the Platform’s payment system.</li>
616  </ul>
617
618  <p>4.2. The Platform reserves the right to decline refund requests in cases of:</p>
619  <ul>
620    <li>Abuse or repeated misuse of the refund system;</li>
621    <li>Suspicious, unauthorized, or fraudulent activity;</li>
622    <li>Violation of the Platform’s Terms of Service or Community Guidelines.</li>
623  </ul>
624
625  <p>
626  4.3. In accordance with <b>EU Directive 2011/83/EU (Article 16)</b> and <b>Regulation (EU) 2019/770</b>,
627  users acknowledge that the right of withdrawal does not apply once digital content or
628  access to streaming services has been fully delivered or consumed,
629  provided that the user has given explicit consent to immediate performance and has
630  acknowledged the resulting loss of the withdrawal right.
631  </p>
632
633  <h4>5. Contact</h4>
634  <p>For all refund-related inquiries, users may contact us through one of the following channels:</p>
635  <ul>
636    <li style="display: flex; align-items:center;">Email: <img height="23px" style="margin-top:3px;" src="support.email.jpg" /></li>
637    <li>On-Site Support Chat: <a href="https://${Tt}/support">https://${Tt}/support</a> — available directly within the Platform interface, where users can submit refund requests, including on-site event refunds, and receive immediate updates on their case status.</li>
638  </ul>
639
640`,zh={en:Rh,ru:Rh};function eD(){const{i18n:e}=Fe(),t=zh[e.language]??zh.en;return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:t}})})})})})}const Nh=`
641        <h1>Anti-Human Trafficking Policy</h1>
642
643        <div class="meta-info">
644            <strong>Effective Date:</strong>December 20, 2025<br>
645            <strong>Last Updated:</strong>December 19, 2025
646        </div>
647
648        <h2>1. Purpose and Scope</h2>
649        <p>This policy establishes procedures to prevent and respond to human trafficking on our platform. It applies to all broadcasters and platform personnel. We recognize our limitations as a startup and commit to expanding protections as resources allow.</p>
650
651        <h2>2. Prohibited Activities</h2>
652        <p>The following are strictly prohibited and will result in immediate account termination and law enforcement notification:</p>
653        <ul>
654            <li>
654Broadcasting by any person under 18 years of age</li>
655            <li>Broadcasting by any person under coercion, threats, or force</li>
656            <li>Broadcasting while appearing impaired, distressed, or unable to consent</li>
657            <li>Any indication that a third party is controlling the broadcast or broadcaster against their will</li>
658        </ul>
659
660        <h2>3. Basic Verification</h2>
661        <p>Before first broadcast, all broadcasters must:</p>
662        <ul>
663            <li>Upload government-issued photo ID showing they are 18+</li>
664        </ul>
665        <div class="note">
666            <strong>Implementation note:</strong> We use manual review for verification on current stage.
667        </div>
668
669        <h2>4. Payment Structure</h2>
670
671        <h3>4.1 Direct Payment Only</h3>
672        <ul>
673            <li>All earnings paid directly to broadcaster's verified account (PayPal, bank transfer, crypto wallet)</li>
674            <li>Payment account name must match ID name (or we document the reason for any mismatch)</li>
675        </ul>
676
677        <h3>4.2 What We Allow (With Risk Acceptance)</h3>
678        <ul>
679            <li>Broadcasters can work from studio locations or agencies</li>
680            <li>We do NOT currently verify studio/agency contracts or business registration</li>
681            <li>We rely on broadcasters to report if a studio is exploitative</li>
682        </ul>
683        <div class="commitment">
684            <strong>Our commitment:</strong> As soon as we have 3+ broadcasters reporting from the same studio/location, we will implement basic studio verification.
685        </div>
686
687        <h2>5. Monitoring and Red Flags</h2>
688
689        <h3>5.1 Automated Monitoring</h3>
690        <p>We monitor for:</p>
691        <ul>
692            <li>Multiple accounts streaming from same IP address without disclosure</li>
693            <li>Accounts that earn money but never withdraw it</li>
694            <li>Accounts working extreme hours (80+ hours/week)</li>
695        </ul>
696
697        <h3>5.2 Manual Review Triggers</h3>
698        <p>Human review happens when:</p>
699        <ul>
700            <li>Broadcaster appears under 25 years old</li>
701            <li>Users report trafficking concerns in chat</li>
702            <li>Broadcaster sends help-related keywords through platform messaging</li>
703        </ul>
704
705        <h2>6. Response to Suspected Trafficking</h2>
706
707        <h3>6.1 Our Realistic Response Protocol</h3>
708        <p><strong>Within 1 hour of concern being flagged:</strong></p>
709        <ul>
710            <li>Stream access disabled (not deleted - just paused)</li>
711        </ul>
712
713        <p><strong>Within 24 hours:</strong></p>
714        <ul>
715            <li>Attempt to contact broadcaster through all available channels (email, phone, platform messaging)</li>
716            <li>Document what triggered the concern</li>
717        </ul>
718
719        <h3>6.2 Law Enforcement Cooperation</h3>
720        <ul>
721            <li>We respond to valid law enforcement requests within 72 hours</li>
722            <li>We voluntarily report suspected trafficking to National Human Trafficking Hotline and local authorities</li>
723        </ul>
724
725        <h3>6.3 If Trafficking Confirmed</h3>
726        <ul>
727            <li>Permanent ban for any traffickers or exploitative studios</li>
728            <li>Immediate release of victim's earnings (bypassing normal payout schedule)</li>
729            <li>Connection to National Human Trafficking Hotline</li>
730        </ul>
731
732        <h2>7. Policy Violations</h2>
733        <p>Immediate permanent ban for:</p>
734        <ul>
735            <li>Anyone under 18 attempting to broadcast</li>
736            <li>Confirmed trafficking or coercion of broadcasters</li>
737            <li>Using fake or stolen identity documents</li>
738            <li>Retaliating against broadcasters who report concerns</li>
739        </ul>
740
741        <h2>8. Contact Information</h2>
742            <p><strong>Trafficking Concerns Email:</strong> safety@${Tt}<br>
743            <strong>Response Time:</strong> 24 hours maximum</p>
744
745        <h2>Policy Commitment</h2>
746        </strong> We acknowledge this policy has gaps due to our startup constraints. We commit to transparency about limitations and continuous improvement as resources allow. Broadcasters have the right to know what protection they can realistically expect from us.
747          `,Lh={en:Nh,ru:Nh};function tD(){const{i18n:e}=Fe(),t=Lh[e.language]??Lh.en;return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:t}})})})})})}function nD({post:e,onClick:t}){const r=tn(),i="#40c057";return n(Mt,{onClick:t,style:{width:"100%",borderRadius:r.radius.md,overflow:"hidden",position:"relative",transition:"all 0.2s ease"},onMouseEnter:s=>{s.currentTarget.style.transform="scale(1.02)",s.currentTarget.style.boxShadow=`0 8px 25px rgba(${lt(i)}, 0.3)`},onMouseLeave:s=>{s.currentTarget.style.transform="scale(1)",s.currentTarget.style.boxShadow="none"},children:n(Va,{ratio:1,children:n(G,{style:{position:"relative",overflow:"hidden"},children:e.media_type==="video"?u(ke,{children:[n("video",{src:`${xt}/files/${e.media_url}`,style:{width:"100%",height:"100%",objectFit:"cover"},muted:!0,preload:"metadata"}),n(El,{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:n("div",{style:{backgroundColor:"white",borderRadius:"50%",padding:"0.4rem"},children:n(Kp,{size:"1.2rem",color:"black"})})})]}):n("img",{src:`${xt}/files/${e.media_url}`,alt:"Post",style:{width:"100%",height:"100%",objectFit:"cover"}})})})})}function rD(){const{user:e}=fe(),[t,r]=bn(),[i,s]=_.useState(!1),[a,{open:o,close:l}]=_t(!1),[c,d]=_.useState(0),[p,h]=_.useState(Number(t.get("page"))||1),f=Number(t.get("limit"))||24,{data:m,isLoading:y,error:b,refetch:S}=M2(i,p,f);_.useEffect(()=>{const R=setTimeout(()=>{r({page:String(p)})},500);return()=>clearTimeout(R)},[f,p,r]);const k=yg(),w=bg(),T=_.useCallback(R=>{var z;const E=(z=m==null?void 0:m.posts.find(N=>N.id===R))==null?void 0:z.username;E&&confirm("Are you sure you want to delete this post?")&&k.mutate({username:E,postId:R},{onSuccess:()=>{S(),close()}})},[k,S,close]),A=_.useCallback(R=>{var z;const E=(z=m==null?void 0:m.posts.find(N=>N.id===R))==null?void 0:z.username;E&&w.mutate({username:E,postId:R},{onSuccess:()=>{S(),close()}})},[k,S,close]);return y?n(Be,{py:"xl",children:n(ct,{style:{height:"50vh"},children:n(Xe,{size:"lg"})})}):b?n(Be,{py:"xl",children:n(Le,{icon:n(zt,{size:20}
747),color:"red",radius:"md",children:"Failed to load posts. Please try again later."})}):u(Be,{size:"lg",py:"xl",children:[n(vg,{opened:a,onClose:l,posts:m==null?void 0:m.posts,initialIndex:c,onEdit:()=>{},onDelete:T,onApprove:A,isOwnPost:!1}),u($,{justify:"space-between",align:"center",mb:"xl",children:[u(Ye,{order:2,c:"dimmed",children:[n(Ip,{size:24,stroke:1.5,style:{verticalAlign:"middle",marginRight:8}}),"Posts Feed"]}),n(Se,{position:"top-start",refProp:"rootRef",label:"Only available when signed in",disabled:!!e,children:n(qt,{label:"Subscribed creators only",checked:i,onChange:R=>s(R.currentTarget.checked),size:"sm",color:"violet",disabled:!e})})]}),m!=null&&m.posts&&m.posts.length===0?n(ct,{py:"xl",children:u(j,{align:"center",gap:"xs",children:[n(so,{size:48,color:"gray",stroke:1}),n(v,{size:"lg",c:"dimmed",children:i?"You aren't subscribed to anyone yet.":"No posts available."}),i&&n(v,{size:"sm",c:"dimmed",ta:"center",children:"Subscribe to creators to see their posts here."})]})}):n(Kt,{gutter:"xs",children:m==null?void 0:m.posts.map((R,E)=>n(Kt.Col,{span:{base:12,xs:6,md:4},children:n(nD,{post:R,onClick:()=>{d(E),o()}})},R.id))}),u($,{justify:"flex-end",children:[n(v,{size:"sm",children:`Showing ${f*(p-1)+1} – ${Math.min((m==null?void 0:m.meta.total)??0,f*p)} of ${(m==null?void 0:m.meta.total)??0}`}),n(yt,{withPages:!0,total:Math.ceil(((m==null?void 0:m.meta.total)??0)/f),value:p,onChange:h})]})]})}const Oh=`
748<h1>18 U.S.C. § 2257 Record-Keeping Requirements Compliance Statement</h1>
749
750<p>All individuals appearing in any visual depiction of actual or simulated sexually explicit conduct on this Website were eighteen (18) years of age or older at the time such visual content was created. Documentation required under Title 18 U.S.C. § 2257 and its implementing regulations for all depictions of actual sexually explicit conduct is maintained by the custodian of records identified below and is available for review by authorized government inspectors upon request.</p>
751<p>All additional visual content displayed on this Website is exempt from the requirements of 18 U.S.C. §§ 2257 and 2257A, and 28 C.F.R. § 75, for one or more of the following reasons: 1) the content does not depict conduct specified in 18 U.S.C. § 2256(2)(A)(i)-(iv); 2) the content does not depict conduct specified in 18 U.S.C. § 2257A; 3) the content does not depict conduct described in 18 U.S.C. § 2256(2)(A)(v) that was produced after July 27, 2006; or 4) the visual depictions were created before July 3, 1995.
752Documentation required under the aforementioned statutes is maintained by the following custodian of records:</p>
753
754<p>${af}</p>
755
756<p>Database Administrator: support@${Tt}</p>
757`,Fh={en:Oh,ru:Oh};function iD(){const{i18n:e}=Fe(),t=Fh[e.language]??Fh.en;return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:t}})})})})})}const sD=["image/jpeg","image/png","application/pdf"];function aD(){var m,y;const{uploadDocumentMutation:e,checkDocumentQuery:t}=wn(),{mutate:r,isPending:i,isSuccess:s,isError:a,error:o}=e,{file:l,handleFileSelect:c,previewUrl:d}=_g(),p=(m=t.data)==null?void 0:m.document_uploaded,h=(y=t.data)==null?void 0:y.age_verified,f=()=>{l&&r({image:l})};return u(Be,{size:"sm",py:"xl",children:[n(zs,{visible:t.isPending}),n(Ye,{order:2,mb:"md",children:x("age_verification_title")}),!p&&n(v,{c:"dimmed",mb:"lg",children:x("age_verification_text")}),!p&&n(sr,{onDrop:c,maxSize:10*1024*1024,accept:sD,disabled:i,children:u($,{justify:"center",gap:"xl",mih:220,style:{pointerEvents:"none"},children:[!l&&u(ke,{children:[n(sr.Accept,{children:n(Ai,{size:52,stroke:1.5})}),n(sr.Reject,{children:n(ht,{size:52,color:"var(--mantine-color-red-6)",stroke:1.5})}),n(sr.Idle,{children:n(gn,{size:52,color:"var(--mantine-color-dimmed)",stroke:1.5})})]}),n("div",{children:l?n("img",{src:d,style:{width:"100%",height:"auto",maxHeight:"300px",objectFit:"contain",backgroundColor:"#000"},alt:"Preview"}):u(ke,{children:[n(v,{size:"xl",inline:!0,children:"Drag file here or click to browse"}),n(v,{size:"sm",c:"dimmed",inline:!0,mt:7,children:"File should not exceed 10 MB"})]})})]})}),a&&n(Le,{color:"red",mt:"md",withCloseButton:!0,onClose:()=>{},children:(o==null?void 0:o.message)||"Failed to upload document. Please try again."}),(s||p)&&n(Le,{color:"green",mt:"md",icon:n(Ke,{size:16}),children:h?"Your age has been verified!":"Document uploaded successfully! Our team will review it shortly."}),!p&&n($,{justify:"center",mt:"xl",children:n(V,{onClick:f,disabled:!l||i,loading:i,size:"md",leftSection:n(Ai,{size:"1rem"}),children:"Submit Document"})})]})}const Uh=`<h1>Complaints Policy</h1>
758
759<h2>1. Introduction</h2>
760<p>This policy forms part of your agreement with us. We will handle all c
760omplaints in accordance with its terms. Please note the following key points:</p>
761<ul>
762  <li>You confirm that the information provided in your complaint is accurate to the best of your knowledge.</li>
763  <li>This Policy sets out how we handle complaints concerning:
764    <ul>
765      <li>our enforcement of the Terms of Service;</li>
766      <li>content on the platform that may be illegal or in breach of our Terms of Service; and</li>
767      <li>our compliance with applicable laws.</li>
768    </ul>
769  </li>
770  <li>This Policy does not apply to complaints regarding content moderation decisions and account moderation decisions.</li>
771</ul>
772
773<h2>2. Contact Information</h2>
774<p>The Platform is operated by ${af}</p>
775
776<h2>3. Interpretation</h2>
777<p>Unless specifically defined in this Policy, terms defined in the Terms of Use shall have the same meanings when used in this Policy.</p>
778
779<h2>4. Complaints About Content Moderation Decisions</h2>
780<p>We moderate content in accordance with our Terms of Service. Appeals against content moderation decisions, including any decision to remove content, deactivate an account, or prohibit you from using the platform on the grounds that you have engaged in illegal activity, are subject to our Appeals Policy.</p>
781
782<h2>5. How to Submit a Complaint</h2>
783<p>You may submit a complaint through one of the following methods:</p>
784<ol>
785  <li>Utilize the designated functionality available on the stream page or within the user's profile; or</li>
786  <li>Contact us via email at support@${Tt}</li>
787</ol>
788<p>You must provide sufficient information to enable us to investigate your complaint, including all relevant URLs. Complaints lacking essential information may not be properly considered.</p>
789
790<h2>6. How We Review Complaints</h2>
791<p>When reviewing a complaint:</p>
792<ol>
793  <li>we will examine the relevant information and supporting documents that you have provided;</li>
794  <li>we may request additional information or documentation from you, or from third parties, to assist us in addressing your complaint;</li>
795  <li>we will review your complaint in good faith and within any legally applicable time limit, and we aim to review and action all complaints within 24 to 72 hours of receipt. Depending on the nature of the complaint, resolution may occur sooner;</li>
796  <li>if your complaint concerns Content appearing on our platform and we determine that such Content constitutes a material violation of our Terms of Service, we will remove it;</li>
797  <li>you may be notified of the outcome of your complaint, which may include actions such as removal of the Content or account, or confirmation that our decision is upheld. If we determine that the Content complies with our Terms of Service and do not remove it, you may appeal our decision as described in our Appeals Policy;</li>
798  <li>if you wish to be informed of the outcome of an illegal content report, or if you expressly wish or do not wish to receive updates in relation to your complaint, please indicate such preference when submitting your complaint.</li>
799  <li>Our platform does not disclose the existence or content of user complaints to the reported party, except where strictly necessary to process a report or appeal.</li>
800</ol>
801
802<h2>7. Abuse of This Complaints Process</h2>
803<p>We do not tolerate complaints made in bad faith or complaints that are abusive, harassing, or otherwise intended to cause harm. If you are a Platform User and submit an abusive or unfounded complaint, we may terminate your account.</p>`,Bh={en:Uh,ru:Uh};function oD(){const{i18n:e}=Fe(),t=Bh[e.language]??Bh.en;return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:t}})})})})})}const qh=`<h1>Appeals Policy</h1>
804<p><strong>Effective Date:</strong> January 20, 2026</p>
805
806<h2>Overview</h2>
807<p>We are committed to fair and transparent content moderation. If you believe a decision about your content or account was made in error, you have the right to appeal.</p>
808
809<h2>What You Can Appeal</h2>
810<p>You may appeal the following decisions:</p>
811<ul>
812<li>Content removal or restriction</li>
813<li>Account suspension or termination</li>
814<li>Monetization restrictions</li>
815<li>Warnings for rule violations</li>
816</ul>
817
818<h2>How to Submit an Appeal</h2>
819<p>Appeals can be submitted through two channels:</p>
820
821<h3>1. Through Our Website</h3>
822<ul>
823<li>Log into your account at ${Tt}</li>
824<li>Navigate to Support</li>
825<li>Write an appeal in free form with relevant details</li>
826</ul>
827
828<h3>2. Via Email</h3>
829<ul>
830<li>
830Send your appeal to support@${Tt}</li>
831<li>Include "Appeal Request" in the subject line</li>
832<li>Provide your account details and case information</li>
833</ul>
834
835<h2>What to Include in Your Appeal</h2>
836<p>To help us review your appeal efficiently, please provide:</p>
837<ul>
838<li>Your username and account email address</li>
839<li>The specific content or decision you're appealing</li>
840<li>A clear explanation of why you believe the decision was incorrect</li>
841<li>Any supporting evidence or context that may be relevant</li>
842</ul>
843
844<h2>Review Process</h2>
845<p>Once we receive your appeal:</p>
846<ol>
847<li>You'll receive an acknowledgment within 2 business days</li>
848<li>Our moderation team will review your case and all relevant information</li>
849<li>We'll provide a decision typically within 5 business days</li>
850<li>You'll be notified of the outcome via email or site support</li>
851</ol>
852
853<h2>Appeal Outcomes</h2>
854<p>After review, we may:</p>
855<ul>
856<li>Uphold the original decision</li>
857<li>Reverse the decision and restore your content or account standing</li>
858<li>Apply a modified action based on our findings</li>
859</ul>
860<p>Our decision after appeal review is final. However, if you have additional evidence that wasn't available during the appeal, you may submit a new appeal with that information.</p>
861
862<h2>Important Notes</h2>
863<ul>
864<li>Submitting an appeal does not guarantee a reversal of the decision</li>
865<li>Abusing the appeals process may result in additional restrictions</li>
866<li>All appeals are reviewed by human moderators</li>
867<li>We may not be able to provide detailed explanations for all decisions due to safety and security reasons</li>
868</ul>
869
870<h2>Questions?</h2>
871<p>If you have questions about this policy or need assistance with the appeals process, please contact our support team through the channels listed above.</p>`,jh={en:qh,ru:qh};function lD(){const{i18n:e}=Fe(),t=jh[e.language]??jh.en;return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:t}})})})})})}async function cD(e,t){try{const r=`${xt}/publish/${t.key}?publishsign=${t.signature}&videocodecs=h264`;return await fetch(r,{method:"POST",body:e.sdp,headers:{"Content-Type":"application/sdp"},keepalive:!0})}catch{return null}}async function dD(e){return await fetch(e,{method:"DELETE",keepalive:!0})}const wg=_.createContext({publish(){},stop(){}});function uD({children:e}){const[t,r]=_.useState(),[i,s]=_.useState(),[a,o]=_.useState(),[l,c]=_.useState(),[d,p]=_.useState();async function h({signature:m,bandwidth:y,videoInput:b,audioInput:S,resolution:k}){var C,M;if(!m||!b||!S||!k){console.log({signature:m,videoInput:b,audioInput:S,resolution:k});return}const w=k.split("x");if(w.length<2)return;const T=await navigator.mediaDevices.getUserMedia({video:{width:parseInt(w[0]),height:parseInt(w[1]),deviceId:b?{exact:b}:void 0},audio:{deviceId:S?{exact:S}:void 0}});p(T);const A=new RTCPeerConnection;if(r(A),!A)return;(A==null?void 0:A.connectionState)!=null?A.onconnectionstatechange=function(){s(A.connectionState)}:A.oniceconnectionstatechange=function(){o(A.iceConnectionState)},T.getTracks().forEach(P=>A.addTrack(P,T));const R=await A.createOffer();let E=(C=R.sdp)==null?void 0:C.match(/a=rtpmap:(\d+) opus\/48000\/2/);E!==null&&E&&(E==null?void 0:E.length)>1&&(R.sdp=(M=R.sdp)==null?void 0:M.replace(`opus/48000/2\r
872`,`opus/48000/2\r
873a=rtcp-fb:${E[1]} nack\r
874`)),await A.setLocalDescription(R);const z=await cD(R,m);if(!z||z&&!z.ok){T.getTracks().forEach(P=>P.stop()),p(void 0);return}c(z.headers.get("location")??void 0);const N=await z.text();await A.setRemoteDescription({type:"answer",sdp:N}),A.getSenders().forEach(function(P){var I;if(((I=P.track)==null?void 0:I.kind)==="video"){let L=P.getParameters();L.encodings[0].maxBitrate=y*1e3,P.setParameters(L)}})}async function f(){t&&(l&&(await dD(l),await new Promise(m=>setTimeout(m,200))),t.close(),r(void 0),s("disconnected"),p(void 0))}return n(wg.Provider,{value:{publish:h,stop:f,state:i,iceState:a,mediaStream:d},children:e})}function hD(){return _.useContext(wg)}function UI({width:e,height:t}){const{mediaStream:r}=hD(),i=_.useRef(null);return _.useEffect(()=>
874{const s=i.current;if(s)return r?(s.srcObject=r,s.play().catch(()=>{})):s.srcObject=null,()=>{s.srcObject=null}},[r]),n("video",{id:"webRTCPreview",ref:i,autoPlay:!0,muted:!0,playsInline:!0,style:{width:e,height:t,background:"#000"}})}const Hh=`<h3>Content Removal Policy</h3>
875
876<h4>Overview</h4>
877<p>
878We maintain a formal process that enables any person depicted in content on our platform to request the removal of such content. This policy ensures compliance with applicable laws and respect for individual rights.
879</p>
880
881<h4>Takedown Procedure</h4>
882<p>
883If you are depicted in any content on our platform and wish to request its removal, please follow this procedure:
884</p>
885
886<h5>Step 1: Submit Your Request</h5>
887<p>You may submit a takedown request through either of the following methods:</p>
888<ul>
889<li><strong>Email:</strong> support@${Tt}</li>
890<li><strong>Support Portal:</strong> https://${Tt}/support</li>
891</ul>
892
893<h5>Step 2: Provide Required Information</h5>
894<p>Your takedown request should include the following information in free form:</p>
895<ul>
896<li><strong>Content URL:</strong> The specific web address (URL) of the content you wish to have removed</li>
897<li><strong>Description:</strong> A clear description of why you are requesting removal</li>
898<li><strong>Supporting Details:</strong> Any relevant details, documentation, or evidence that will assist us in evaluating your request and making an informed decision</li>
899</ul>
900
901<h5>Step 3: Review and Investigation</h5>
902<p>Upon receipt of your request, we will:</p>
903<ul>
904<li>Acknowledge receipt of your submission</li>
905<li>Conduct a thorough investigation to determine whether consent was provided for the content</li>
906<li>Assess whether any consent given is valid under applicable law</li>
907<li>Make a determination based on the findings of our investigation</li>
908</ul>
909
910<h5>Step 4: Resolution</h5>
911<p>Content will be removed if our investigation determines that:</p>
912<ul>
913<li>Consent was not given for the creation or publication of the content, or</li>
914<li>Any consent provided is void under applicable law</li>
915</ul>
916
917<h4>Dispute Resolution</h4>
918<p>
919Should there be a disagreement regarding the outcome of a takedown request, we will allow such disagreement to be resolved by a neutral third-party body to ensure fair and impartial resolution.
920</p>
921
922<h4>Timeline</h4>
923<p>
924We are committed to processing takedown requests promptly. All requests will be reviewed and resolved within 3 business hours of receipt.
925</p>
926
927<h4>Contact Information</h4>
928<p>
929For questions regarding this policy, please contact us at support@${Tt}
930</p>
931
932<p>
933<em>This policy is maintained in accordance with applicable legal requirements and our commitment to protecting individual rights.</em>
934</p>`,Wh={en:Hh,ru:Hh};function pD(){const{i18n:e}=Fe(),t=Wh[e.language]??Wh.en;return n(Be,{children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:t}})})})})})}async function mD(e){return await Ft(`${O}/crypto-deposit`,e)}async function fD(e){return await _e(`${O}/crypto-deposit/create-deposit`,e)}async function gD(e){const t=new URLSearchParams;Object.entries(e).forEach(([i,s])=>{s!=null&&s!==""&&t.set(i,String(s))});const r=t.size>0?`?${t.toString()}`:"";return await ae(`${O}/crypto-deposit${r}`)}function yD(e={},t=!1){const r=J({mutationKey:["deposit.crypto.create"],mutationFn:fD}),i=oe({queryKey:["deposit.crypto.list",e],queryFn:()=>gD(e),enabled:t}),s=J({mutationKey:["deposit.crypto.update"],mutationFn:mD});return{createCryptoDepositMutation:r,depositsQuery:i,updateCryptoDepositMutation:s}}const bD=20,_D={pending:"yellow",confirmed:"green",expired:"red",failed:"red"},vD={usdt:"teal",usdc:"blue",btc:"orange",eth:"violet",bnb:"yellow",trx:"red",
934sol:"grape",matic:"indigo"};function Yh({value:e,label:t}){return e?u($,{gap:4,wrap:"nowrap",children:[n(Se,{label:e,withArrow:!0,multiline:!0,maw:400,children:n(v,{size:"sm",ff:"monospace",style:{cursor:"default"},children:e.length>12?`${e.slice(0,6)}…${e.slice(-6)}`:e})}),n(us,{value:e,timeout:1500,children:({copied:r,copy:i})=>n(Se,{label:r?"Copied!":`Copy ${t}`,withArrow:!0,children:n(Ne,{size:"xs",variant:"subtle",color:r?"teal":"gray",onClick:i,children:r?n(Ke,{size:11}):n(Ta,{size:11})})})})]}):n(v,{c:"dimmed",size:"sm",children:"—"})}function Qh({value:e}){if(!e)return n(v,{c:"dimmed",size:"sm",children:"—"});const t=new Date(e);return u(j,{gap:0,children:[u(v,{size:"sm",children:[t.toISOString().replace("T"," ").slice(0,19)," UTC"]}),n(v,{size:"xs",c:"dimmed",children:t.toLocaleString()})]})}function wD({deposit:e,onClose:t,onSave:r,isSaving:i}){const[s,a]=_.useState((e==null?void 0:e.tx_id)??""),[o,l]=_.useState((e==null?void 0:e.amount_paid)??""),[c,d]=_.useState((e==null?void 0:e.transaction_volume)??""),[p,h]=_.useState((e==null?void 0:e.status)??null),[f,m]=_.useState(e!=null&&e.updated_at?new Date(e.updated_at):null);if(!e)return null;const y=()=>{const b={wallet_address:e.wallet_address};s!==e.tx_id&&(b.tx_id=s),typeof o=="number"&&o!==e.amount_paid&&(b.amount_paid=o),typeof c=="number"&&c!==e.transaction_volume&&(b.transaction_volume=c),p&&p!==e.status&&(b.status=p),f&&(b.updated_at=new Date(Date.UTC(f.getFullYear(),f.getMonth(),f.getDate(),f.getHours(),f.getMinutes(),f.getSeconds())).toISOString()),r(b)};return u(j,{gap:"sm",children:[n(Te,{label:"Wallet address",value:e.wallet_address,disabled:!0,ff:"monospace",size:"sm"}),n(Te,{label:"Tx ID",placeholder:"Transaction hash…",value:s,onChange:b=>a(b.currentTarget.value),ff:"monospace",size:"sm"}),u($,{grow:!0,children:[n(pt,{label:"Amount paid (cents)",placeholder:String(e.amount_paid),value:o,onChange:l,min:0,size:"sm",description:typeof o=="number"?`= ${se(o)}`:void 0}),n(pt,{label:"Transaction volume (cents)",placeholder:String(e.transaction_volume),value:c,onChange:d,min:0,size:"sm",description:typeof c=="number"?`= ${se(c)}`:void 0})]}),n(it,{label:"Status",data:["pending","confirmed","expired","failed"],value:p,onChange:h,size:"sm"}),n(xs,{label:"Updated at (confirmation time)",description:"Enter time in UTC as shown on the blockchain explorer",placeholder:"YYYY-MM-DD HH:MM:SS",value:f,onChange:m,withSeconds:!0,clearable:!0,size:"sm"}),u($,{justify:"flex-end",mt:"xs",children:[n(V,{variant:"subtle",color:"gray",onClick:t,disabled:i,children:"Cancel"}),n(V,{onClick:y,loading:i,children:"Save changes"})]})]})}function SD(){var Y,Q,W;const{user:e}=fe(),t=he(e,Ce),r=at(),[i,s]=_.useState(1),[a,o]=_.useState(""),[l,c]=_.useState(null),[d,p]=_.useState(null),[h,f]=_.useState(null),[m,y]=_.useState(""),[b,S]=_.useState(""),[k,w]=_.useState([null,null]),[T,A]=_.useState(null),R=F=>F?F.toISOString():void 0,E=_.useMemo(()=>({page:i,limit:bD,...a?{username:a}:{},...l?{coin:l}:{},...d?{chain:d}:{},...h?{status:h}:{},...m?{wallet:m}:{},...b?{tx_id:b}:{},...k[0]?{created_at_from:R(k[0])}:{},...k[1]?{created_at_to:R(k[1])}:{}}),[i,a,l,d,h,m,b,k]),{depositsQuery:z,updateCryptoDepositMutation:N}=yD(E,t),C=((Y=z.data)==null?void 0:Y.deposits)??[],M=((Q=z.data)==null?void 0:Q.total)??0,P=((W=z.data)==null?void 0:W.pages)??1,I=_.useMemo(()=>[...new Set(C.map(H=>H.coin).filter(Boolean))].map(H=>({value:H,label:H.toUpperCase()})),[C]),L=_.useMemo(()=>[...new Set(C.map(H=>H.chain).filter(Boolean))].map(H=>({value:H,label:H})),[C]),U=()=>{o(""),c(null),p(null),f(null),y(""),S(""),w([null,null]),s(1)},q=a||l||d||h||m||b||k[0]||k[1],B=F=>{N.mutate(F,{onSuccess:()=>{r.setQueryData(["deposit.crypto.list",E],H=>H&&{...H,deposits:H.deposits.map(K=>K.wallet_address===F.wallet_address?{...K,...F}:K)}),r.invalidateQueries({queryKey:["deposit.crypto.list"]}),A(null)}})};return u(ue,{withBorder:!0,children:[n(Oe,{opened:!!T,onClose:()=>A(null),title:u(v,{fw:500,size:"sm",children:["Edit deposit —"," ",u(v,{span:!0,ff:"monospace",size:"sm",children:[T==null?void 0:T.wallet_address.slice(0,10),"…"]})]}),size:"lg",children:n(wD,{deposit:T,onClose:()=>A(null),onSave:B,isSaving:N.isPending})}),u($,{mb:"sm",align:"flex-end",wrap:"wrap",children:[n(Te,{label:"Username",placeholder:"e.g. alice",value:a,onChange:F=>{o(F.currentTarget.value),s(1)},leftSection:n(Ot,{size:14}),w:180}
934),n(it,{label:"Coin",placeholder:"Any",data:I,value:l,onChange:F=>{c(F),s(1)},clearable:!0,w:130}),n(it,{label:"Chain",placeholder:"Any",data:L,value:d,onChange:F=>{p(F),s(1)},clearable:!0,w:130}),n(it,{label:"Status",placeholder:"Any",data:["pending","confirmed","expired","failed"],value:h,onChange:F=>{f(F),s(1)},clearable:!0,w:140}),n(Yr,{type:"range",label:"Created at",placeholder:"Pick range",value:k,onChange:F=>{w(F),s(1)},clearable:!0,w:240})]}),u($,{mb:"md",align:"flex-end",wrap:"wrap",children:[n(Te,{label:"Wallet address",placeholder:"Full or partial…",value:m,onChange:F=>{y(F.currentTarget.value),s(1)},leftSection:n(Ja,{size:14}),w:260}),n(Te,{label:"Tx ID",placeholder:"Transaction hash…",value:b,onChange:F=>{S(F.currentTarget.value),s(1)},leftSection:n(Tb,{size:14}),w:260}),q&&n(Se,{label:"Clear all filters",withArrow:!0,children:n(Ne,{variant:"light",color:"red",size:"lg",mt:24,onClick:U,children:n(ht,{size:16})})})]}),z.isLoading&&n(mt,{justify:"center",py:"xl",children:n(Xe,{size:"sm"})}),z.isError&&n(Le,{icon:n(zt,{size:16}),color:"red",mb:"md",children:"Failed to load deposits."}),!z.isLoading&&u(v,{size:"sm",c:"dimmed",mb:"xs",children:[M," record",M!==1?"s":""," found"]}),n(g.ScrollContainer,{minWidth:1200,children:u(g,{striped:!0,stripedColor:"dark.7",highlightOnHover:!0,children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:"Username"}),n(g.Th,{children:"Coin / Chain"}),n(g.Th,{children:"Wallet"}),n(g.Th,{children:"Tx ID"}),n(g.Th,{children:"Requested"}),n(g.Th,{children:"Must Pay"}),n(g.Th,{children:"Paid"}),n(g.Th,{children:"Vol."}),n(g.Th,{children:"Status"}),n(g.Th,{children:"Created"}),n(g.Th,{children:"Updated"}),t&&n(g.Th,{})]})}),n(g.Tbody,{children:C.length===0&&!z.isLoading?n(g.Tr,{children:n(g.Td,{colSpan:t?12:11,children:n(v,{c:"dimmed",ta:"center",py:"lg",children:"No deposits found"})})}):C.map((F,H)=>{var K,X;return u(g.Tr,{children:[n(g.Td,{children:n(v,{size:"sm",fw:500,children:F.username||"—"})}),n(g.Td,{children:u(j,{gap:2,children:[n(pe,{size:"sm",variant:"filled",color:vD[(K=F.coin)==null?void 0:K.toLowerCase()]??"gray",children:(X=F.coin)==null?void 0:X.toUpperCase()}),n(v,{size:"xs",c:"dimmed",children:F.chain})]})}),n(g.Td,{children:n(Yh,{value:F.wallet_address,label:"wallet"})}),n(g.Td,{children:n(Yh,{value:F.tx_id,label:"tx id"})}),n(g.Td,{children:n(v,{size:"sm",children:se(F.amount_requested)})}),n(g.Td,{children:n(v,{size:"sm",children:se(F.amount_need_to_pay)})}),n(g.Td,{children:n(v,{size:"sm",c:F.amount_paid?void 0:"dimmed",children:F.amount_paid?se(F.amount_paid):"—"})}),n(g.Td,{children:n(v,{size:"sm",c:F.transaction_volume?void 0:"dimmed",children:F.transaction_volume?se(F.transaction_volume):"—"})}),n(g.Td,{children:n(pe,{size:"sm",variant:"light",color:_D[F.status]??"gray",children:F.status})}),n(g.Td,{children:n(Qh,{value:F.created_at})}),n(g.Td,{children:n(Qh,{value:F.updated_at})}),t&&n(g.Td,{children:n(Se,{label:"Edit deposit",withArrow:!0,children:n(Ne,{size:"sm",variant:"subtle",color:"gray",onClick:()=>A(F),children:n(Vp,{size:14})})})})]},H)})})]})}),n($,{justify:"center",mt:"md",children:n(yt,{color:"dark.4",value:i,onChange:s,total:P})})]})}const Sg=_.createContext({giftsEnabled:!0,giftsEnabledRef:{current:null},giftId:0,giftEventId:0,setGiftsEnabled:()=>{},setGiftEventId:()=>{},setGiftId:()=>{}});function CD({children:e}){const[t,r]=_.useState(localStorage.getItem("giftsEnabled")===null?!0:localStorage.getItem("giftsEnabled")==="yes"),i=_.useRef(t);_.useEffect(()=>{i.current=t,localStorage.setItem("giftsEnabled",t?"yes":"no")},[t]);const[s,a]=_.useState(0),[o,l]=_.useState(0);return n(Sg.Provider,{value:{giftsEnabledRef:i,giftsEnabled:t,giftId:s,giftEventId:o,setGiftsEnabled:r,setGiftEventId:l,setGiftId:a},children:e})}function BI(){return _.useContext(Sg)}function Un({icon:e,title:t,description:r,action:i}){return n(ct,{py:48,px:"md",children:u(j,{align:"center",gap:"xs",maw:380,children:[n(bt,{size:52,radius:"xl",variant:"light",color:"gray",children:e}),n(v,{fw:700,ta:"center",children:t}),r&&n(v,{size:"sm",c:"dimmed",ta:"center",children:r}),i&&n(G,{mt:"xs",children:i})]})})}function Nn({children:e}){return n(G,{py:{base:"md",sm:"lg"},className:"bundles-section",children:e})}function dr(e,t){Ee.show({position:"top-center",title:e,message:t,color:"red"})}function Ji(e,t){Ee.show({position:"top-center",title:e,message:t,color:"teal",icon:n(Ke,{size:16})})}function ks(e){return e.duration_seconds??e.duration??e.durationSeconds}function yd(e){if(e==null||e==="")return;const t=typeof e=="string"?Number.parseFloat(e):e;if(!Number.isFinite(t)||t<0)return;const r=Math.round(t),i=Math.floor(r/3600),s=Math.floor(r%3600/60),a=r%60;return i>0?`${i}:${String(s).padStart(2,"0")}
934:${String(a).padStart(2,"0")}`:`${s}:${String(a).padStart(2,"0")}`}function Cg({type:e,assetType:t=e,src:r,previewSrc:i,label:s,rightBadge:a,videoControls:o=!1}){const l=e==="video"?ka:gn,c=t==="video",d=e==="video"?x("bundles_video"):x("bundles_photo");return n(Va,{ratio:1,children:u(G,{pos:"relative",w:"100%",h:"100%",bg:"var(--mantine-color-default-hover)",children:[c?n("video",{src:r,poster:i,controls:o,muted:!o,preload:"metadata",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):n(jr,{src:r,fallbackSrc:i,w:"100%",h:"100%",fit:"cover"}),n(pe,{variant:"filled",color:"dark",size:"sm",leftSection:n(l,{size:12}),style:{position:"absolute",top:10,left:10},children:s??d}),a&&n(pe,{variant:"filled",color:"dark",size:"sm",style:{position:"absolute",top:10,right:10},children:a})]})})}function TD({bundleId:e,media:t,onClick:r}){const i=Df(e,t.id),s=sd(e,t.id),a=!t.full_access,o=a&&t.type==="video";return u(ue,{component:"button",type:"button",withBorder:!0,p:0,radius:"lg",className:"bundle-media-tile bundle-media-button",onClick:r,"aria-label":x("bundles_open_media"),children:[n(Cg,{type:t.type,assetType:o?"preview":t.type,src:a?s:i,previewSrc:s,videoControls:!1,label:a?x("bundles_preview"):t.type==="video"?x("bundles_video"):x("bundles_photo"),rightBadge:t.type==="video"?yd(ks(t)):void 0}),a&&n($,{justify:"flex-end",px:"sm",py:"xs",children:n(pe,{size:"xs",variant:"light",color:"gray",children:x("bundles_locked")})})]})}function xD({bundleId:e,media:t}){const r=sd(e,t.id),i=Df(e,t.id),s=!t.full_access,a=s?r:i,[o,l]=_.useState(a);return _.useEffect(()=>{l(a)},[a]),n(G,{w:"100%",style:{height:"calc(100dvh - 76px)",minHeight:320,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:t.type==="video"&&!s?n("video",{src:i,poster:r,controls:!0,autoPlay:!0,preload:"metadata",style:{display:"block",maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",objectFit:"contain"}},i):n("img",{src:o,alt:"",onError:()=>{o!==r&&l(r)},style:{display:"block",maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",objectFit:"contain"}},o)})}function Hs({view:e,onChanged:t,onBack:r}){var p;const{purchaseBundleMutation:i}=vn(),{user:s}=fe(),[a,o]=_.useState(null),l=(s==null?void 0:s.id)===e.creator_id,c=!l&&!e.purchased&&!e.deleted,d=((p=e.creator_username)==null?void 0:p.trim())||x("bundles_creator_placeholder");return u(ke,{children:[n(Oe,{opened:a!=null,onClose:()=>o(null),title:x("bundles_media_viewer_title"),fullScreen:!0,radius:0,padding:"md",classNames:{content:"bundle-media-viewer-modal",body:"bundle-media-viewer-body"},styles:{body:{height:"calc(100dvh - 60px)",padding:0}},children:a&&n(xD,{bundleId:e.id,media:a})}),n(Nn,{children:u(j,{gap:"lg",children:[r&&n(V,{variant:"subtle",color:"gray",size:"compact-sm",leftSection:n(Sa,{size:16}),onClick:r,style:{alignSelf:"flex-start"},children:x("bundles_back")}),u(mt,{justify:"space-between",align:"flex-start",gap:"lg",wrap:"wrap",children:[u(j,{gap:"xs",maw:720,children:[l?u($,{gap:"xs",children:[n(bt,{variant:"light",color:"teal",radius:"md",children:n(xb,{size:18})}),n(Ye,{order:3,children:e.tag||x("bundles_untitled")})]}):u($,{gap:"sm",wrap:"nowrap",children:[n(pn,{src:e.creator_avatar_url||void 0,radius:"xl",size:42,color:"gray",children:n(fn,{size:20})}),n(G,{children:n(v,{fw:700,children:d})})]}),u($,{gap:"xs",children:[l&&n(pe,{color:"teal",variant:"light",children:x("bundles_yours")}),e.purchased&&!l&&n(pe,{color:"teal",variant:"light",children:x("bundles_owned")}),e.deleted&&n(pe,{color:"gray",variant:"light",children:x("bundles_discontinued")})]}),e.description&&n(v,{c:"dimmed",size:"sm",children:e.description})]}),u(Ie,{withBorder:!0,radius:"lg",px:"lg",py:"sm",children:[n(v,{size:"xs",c:"dimmed",children:x("bundles_price")}),n(v,{fw:800,size:"xl",children:se(e.price)})]})]}),n(je,{label:x("bundles_media_count",{count:e.media.length})}),e.media.length===0?n(Un,{icon:n(Ac,{size:26}),title:x("bundles_empty_bundle")}):n(Kt,{gutter:{base:"sm",sm:"md"},children:e.media.map(h=>n(Kt.Col,{span:{base:6,sm:4,md:3},children:n(TD,{bundleId:e.id,media:h,onClick:()=>o(h)})},h.id))}),c&&n(V,{fullWidth:!0,size:"md",radius:"md",rightSection:n(kb,{size:18}),loading:i.isPending,onClick:()=>i.mutate(e.id,{onSuccess:()=>{Ji(x("bundles_purchase_complete_title"),x("bundles_purchase_complete_message")),t==null||t()},onError:()=>dr(x("bundles_purchase_failed_title"),x("bundles_purchase_failed_message"))}),children:x("bundles_buy_for",{price:se(e.price)})}),e.deleted&&e.purchased&&n(v,{size:"sm",c:"dimmed",children:x("bundles_deleted_purchase_access")})]})})]})}function Tg({bundle:e,onOpen:t,onShare:r,onSales:i,onDelete:s,onUnshare:a,isOwner:o=!1,status:l,statusColor:c="teal",loading:d=!1,actionLoading:p=!1}){var R,E,z;const h=e.media??[],f=h[0],m=f?sd(e.id,f.id):void 0,y=(f==null?void 0:f.type)==="video"?yd(ks(f)):void 0,b=((R=e.creator_username)==null?void 0:R.trim())||x("bundles_creator_placeholder"),S=o&&((E=e.tag)==null?void 0:E.trim())||((z=e.description)==null?void 0:z.trim())||x("bundles_untitled"),k=!!(i||s||a),w=()=>{d||t()},T=N=>C=>{C.stopPropagation(),N==null||N()},A=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),w())};
934return n(ue,{withBorder:!0,shadow:"sm",radius:"xl",p:"md",className:"bundle-preview-card",role:"button",tabIndex:0,"aria-label":x("bundles_open_bundle",{name:S}),onClick:w,onKeyDown:A,children:u(j,{gap:"md",h:"100%",children:[u($,{justify:"space-between",align:"center",gap:"sm",wrap:"nowrap",className:"bundle-preview-header",children:[u($,{gap:"sm",wrap:"nowrap",style:{minWidth:0},children:[n(pn,{src:e.creator_avatar_url||void 0,radius:"xl",size:40,color:"gray",className:"bundle-preview-avatar",children:n(fn,{size:19})}),n(G,{style:{minWidth:0},children:n(v,{size:"sm",fw:700,truncate:!0,children:b})})]}),u($,{gap:4,wrap:"nowrap",children:[r&&n(Se,{label:x("bundles_share_bundle"),children:n(Ne,{variant:"subtle",color:"teal",size:"lg",radius:"md","aria-label":x("bundles_share_bundle"),onClick:T(r),children:n(Pc,{size:18})})}),k&&u(ce,{position:"bottom-end",shadow:"md",width:170,withinPortal:!0,children:[n(ce.Target,{children:n(Ne,{variant:"subtle",color:"gray",size:"lg",radius:"md",loading:p,"aria-label":x("bundles_actions"),onClick:N=>N.stopPropagation(),children:n(Eb,{size:18})})}),u(ce.Dropdown,{onClick:N=>N.stopPropagation(),children:[i&&n(ce.Item,{leftSection:n(Up,{size:16}),onClick:T(i),children:x("bundles_sales")}),a&&n(ce.Item,{color:"red",leftSection:n(Pb,{size:16}),onClick:T(a),children:x("bundles_unshare")}),s&&n(ce.Item,{color:"red",leftSection:n(zr,{size:16}),onClick:T(s),children:x("bundles_delete")})]})]})]})]}),u(G,{pos:"relative",className:"bundle-preview-image-wrap",children:[n(Va,{ratio:16/10,children:d?n(ri,{h:"100%"}):m?n(jr,{src:m,alt:x("bundles_bundle_preview_alt"),fit:"cover",className:"bundle-preview-image"}):n(G,{bg:"var(--mantine-color-default-hover)",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:n(Ac,{size:34,opacity:.5})})}),n(pe,{variant:"filled",color:"teal",size:"lg",className:"bundle-preview-price-overlay",children:se(e.price)}),!d&&n(pe,{variant:"filled",color:"dark",size:"md",leftSection:n(gn,{size:14}),className:"bundle-preview-count",children:h.length}),!d&&y&&n(pe,{variant:"filled",color:"dark",size:"md",leftSection:n(lo,{size:13}),className:"bundle-preview-duration",children:y})]}),u(j,{gap:"sm",style:{flex:1},children:[o&&u($,{gap:6,wrap:"nowrap",className:"bundle-preview-tag-row",children:[n(v,{size:"xs",c:"dimmed",fw:600,children:x("bundles_tag")}),n(v,{fw:700,size:"sm",lineClamp:1,children:e.tag||x("bundles_untitled")})]}),n(v,{size:"sm",c:e.description?void 0:"dimmed",lineClamp:3,className:"bundle-preview-description",children:e.description||x("bundles_no_description")}),l&&n(pe,{size:"sm",color:c,variant:"light",style:{alignSelf:"flex-start"},children:l}),n(V,{onClick:T(t),radius:"md",size:"md",mt:"auto",className:"bundle-preview-open-button",children:x("bundles_open_bundle_button")})]})]})})}function Es({bundle:e,status:t,statusColor:r,onClick:i,onShare:s,onSales:a,onDelete:o,onUnshare:l,isOwner:c=!1,actionLoading:d=!1}){const p=Array.isArray(e.media),h=oe({queryKey:["bundles","detail",e.id],queryFn:()=>Af(e.id),staleTime:6e4,enabled:!p}),f=h.data?{...e,...h.data}:e;return n(Tg,{bundle:f,isOwner:c,status:t,statusColor:r,loading:!p&&h.isFetching&&!h.data,actionLoading:d,onOpen:i,onShare:s,onSales:a,onDelete:o,onUnshare:l})}function Ps({title:e,description:t,action:r}){return u($,{justify:"space-between",align:"flex-start",wrap:"nowrap",gap:"md",children:[u(j,{gap:2,style:{minWidth:0},children:[n(v,{fw:700,children:e}),t&&n(v,{size:"sm",c:"dimmed",children:t})]}),r]})}const Ct=7;function kD({media:e}){const t=If(e.id);return e.type==="video"?n("video",{src:t,controls:!0,autoPlay:!0,preload:"metadata",style:{width:"100%",maxHeight:"75vh",display:"block"}}):n(jr,{src:t,fit:"contain",mah:"75vh",radius:"md"})}function ED({media:e,onClick:t,selectable:r=!1,selected:i=!1}){const s=e.type==="video"?yd(ks(e)):void 0;return u(ue,{component:"button",type:"button",withBorder:!0,p:0,radius:"lg",className:`bundle-media-tile bundle-media-button${i?" bundle-media-tile-selected":""}`,onClick:t,"aria-pressed":r?i:void 0,children:[u(G,{pos:"relative",children:[n(Cg,{type:e.type,src:If(e.id)}),s&&n(pe,{variant:"filled",color:"dark",size:"sm",leftSection:n(lo,{size:12}),className:"bundle-media-duration",children:s}),r&&n(bt,{size:28,radius:"xl",variant:i?"filled":"default",color:i?"teal":"gray",className:"bundle-media-selection-check","aria-label":i?x("bundles_selected"):x("bundles_not_selected"),children:i&&n(Ke,{size:17})})]}),n(v,{size:"xs",c:"dimmed",px:"sm",py:"xs",ta:"left",truncate:!0,children:st.format(new Date(e.created_at))})]})}function Vh(e){var r;return((r=e.bundle_tag)==null?void 0:r.trim())||x("bundles_no_tag")}function xg({rows:e,onOpenBundle:t}
934){return u(ke,{children:[n(G,{visibleFrom:"sm",children:n(g.ScrollContainer,{minWidth:620,children:u(g,{highlightOnHover:!0,verticalSpacing:"md",children:[n(g.Thead,{children:u(g.Tr,{children:[n(g.Th,{children:x("bundles_table_tag")}),n(g.Th,{children:x("bundles_table_buyer")}),n(g.Th,{children:x("bundles_table_price")}),n(g.Th,{children:x("bundles_table_date")})]})}),n(g.Tbody,{children:e.map((r,i)=>u(g.Tr,{children:[n(g.Td,{children:n(V,{variant:"subtle",size:"compact-sm",px:0,fw:600,onClick:()=>t(r.bundle_id),children:Vh(r)})}),n(g.Td,{children:r.buyer_username}),n(g.Td,{fw:700,children:se(r.price)}),n(g.Td,{c:"dimmed",children:st.format(new Date(r.purchased_at))})]},`${r.bundle_id}-${r.buyer_username}-${r.purchased_at}-${i}`))})]})})}),n(j,{hiddenFrom:"sm",gap:"sm",children:e.map((r,i)=>u(Ie,{withBorder:!0,radius:"lg",p:"md",children:[u($,{justify:"space-between",align:"flex-start",wrap:"nowrap",children:[u(G,{style:{minWidth:0},children:[n(V,{variant:"subtle",size:"compact-sm",px:0,fw:700,maw:"100%",onClick:()=>t(r.bundle_id),styles:{label:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},children:Vh(r)}),n(v,{size:"sm",c:"dimmed",lineClamp:1,children:r.buyer_username})]}),n(v,{fw:800,style:{flexShrink:0},children:se(r.price)})]}),n(v,{size:"xs",c:"dimmed",mt:"sm",children:st.format(new Date(r.purchased_at))})]},`${r.bundle_id}-${r.buyer_username}-${r.purchased_at}-${i}`))})]})}function PD({bundleId:e,opened:t,onClose:r,onOpenBundle:i}){var d,p;const{bundleSalesQuery:s}=vn(),a=s(t?e:null),o=a.data??[],l=((p=(d=o[0])==null?void 0:d.bundle_tag)==null?void 0:p.trim())||x("bundles_no_tag"),c=h=>{r(),i(h)};return n(Oe,{opened:t,onClose:r,title:a.isFetching?x("bundles_sales_modal_title_generic"):x("bundles_sales_modal_title",{tag:l}),size:"lg",centered:!0,radius:"lg",children:a.isFetching?n(ct,{p:"xl",children:n(Xe,{})}):o.length===0?n(Un,{icon:n(eo,{size:26}),title:x("bundles_no_sales")}):n(xg,{rows:o,onOpenBundle:c})})}function MD({opened:e,mediaIds:t,onClose:r,onCreated:i}){const{createBundleMutation:s}=vn(),a=Ge({initialValues:{description:"",tag:"",amount:1},validate:{amount:l=>l<=0?x("bundles_price_validation"):null}});_.useEffect(()=>{e||a.reset()},[e]);const o=a.onSubmit(l=>{if(t.length===0){dr(x("bundles_no_media_selected_title"),x("bundles_no_media_selected_message"));return}s.mutate({description:l.description.trim()||null,tag:l.tag.trim()||null,price:Math.round(l.amount*100),media_ids:t},{onSuccess:()=>{Ji(x("bundles_created_title"),x("bundles_created_message")),a.reset(),i==null||i(),r()},onError:()=>dr(x("bundles_creation_failed_title"),x("bundles_creation_failed_message"))})});return n(Oe,{opened:e,onClose:r,title:x("bundles_details_title"),size:"lg",centered:!0,radius:"lg",children:n("form",{onSubmit:o,children:u(j,{gap:"lg",children:[u(j,{gap:3,children:[n(v,{fw:700,children:x("bundles_almost_done")}),n(v,{size:"sm",c:"dimmed",children:x("bundles_selected_media_summary",{count:t.length})})]}),n(pt,{label:x("bundles_price"),description:x("bundles_price_description"),prefix:"$",min:.01,decimalScale:2,fixedDecimalScale:!0,...a.getInputProps("amount")}),u(mn,{cols:{base:1,sm:2},children:[n(Te,{label:x("bundles_tag"),description:x("bundles_tag_description"),placeholder:x("bundles_tag_placeholder"),...a.getInputProps("tag")}),n(Le,{icon:n(ms,{size:17}),variant:"light",color:"gray",className:"bundle-field-explanation",children:x("bundles_tag_explanation")})]}),n(Li,{label:x("bundles_description"),description:x("bundles_description_help"),placeholder:x("bundles_description_placeholder"),autosize:!0,minRows:4,...a.getInputProps("description")}),u($,{justify:"space-between",mt:"xs",children:[n(V,{variant:"subtle",color:"gray",onClick:r,children:x("bundles_back_to_selection")}),n(V,{type:"submit",loading:s.isPending,leftSection:n(Ns,{size:16}),children:x("bundles_create_bundle")})]})]})})})}function AD({bundle:e,opened:t,onClose:r}){const{shareBundleMutation:i}=vn(),[s,a]=_.useState(null);_.useEffect(()=>{t||a(null)},[t]);const o=()=>{a(null),r()},l=()=>{if(!s){dr(x("bundles_select_user_title"),x("bundles_select_user_message"));return}i.mutate({bundle_id:e.id,username:s,user_id:null,is_anonymous:!1},{onSuccess:()=>{Ji(x("bundles_shared_success_title"),x("bundles_shared_user_message",{username:s})),o()},onError:()=>dr(x("bundles_sharing_failed_title"),x("bundles_sharing_failed_message"))})};return n(Oe,{opened:t,onClose:o,title:x("bundles_share_title",{name:e.tag||x("bundles_untitled")}),centered:!0,radius:"lg",children:u(j,{gap:"md",children:[n(v,{size:"sm",c:"dimmed",children:x("bundles_share_description")}),u(j,{gap:"xs",children:[n(v,{size:"sm",fw:600,children:x("bundles_search_user")}),n(hf,{isCollapsed:!0,onSelect:c=>a(c)}),s&&n(pe,{variant:"light",color:"teal",size:"lg",leftSection:n(fn,{size:14}),style:{alignSelf:"flex-start"},children:x("bundles_selected_user",{username:s})})]}),u($,{justify:"center",mt:"xs",children:[n(V,{variant:"default",onClick:o,children:x("bundles_cancel")}),n(V,{loading:i.isPending,leftSection:n(Mb,{size:16}),onClick:l,disabled:!s,miw:140,children:x("bundles_share")})]})]})})}const Kh=[{key:"media",labelKey:"bundles_nav_my_media",shortLabelKey:"bundles_nav_media_short",icon:n(gn,{size:18})},{key:"bundles",labelKey:"bundles_nav_my_bundles",shortLabelKey:"bundles_nav_bundles_short",icon:n(Ns,{size:18})},{key:"sharedWithMe",labelKey:"bundles_nav_available",shortLabelKey:"bundles_nav_available_short",icon:n(io,{size:18})},{key:"sales",labelKey:"bundles_nav_sales",shortLabelKey:"bundles_nav_sales",icon:n(eo,{size:18})}];
934function Gh({active:e,onChange:t}){const r=_.useRef(null),i=s=>{var a;(a=r.current)==null||a.scrollBy({left:s*180,behavior:"smooth"})};return u(ke,{children:[n(G,{visibleFrom:"sm",className:"bundles-sidebar",children:n(j,{gap:2,children:Kh.map(s=>n(V,{variant:e===s.key?"light":"subtle",color:e===s.key?"teal":"gray",justify:"flex-start",leftSection:s.icon,onClick:()=>t(s.key),children:x(s.labelKey)},s.key))})}),u(G,{hiddenFrom:"sm",className:"bundles-mobile-nav",children:[n(Ne,{variant:"filled",color:"dark",size:"lg",radius:"xl","aria-label":x("bundles_scroll_menu_left"),onClick:()=>i(-1),className:"bundles-nav-arrow bundles-nav-arrow-left",children:n(ao,{size:20})}),n(Lt,{type:"never",viewportRef:r,className:"bundles-mobile-scroll",children:n($,{gap:4,wrap:"nowrap",px:34,children:Kh.map(s=>n(V,{variant:e===s.key?"light":"subtle",color:e===s.key?"teal":"gray",leftSection:s.icon,size:"sm",onClick:()=>t(s.key),style:{flexShrink:0},children:x(s.shortLabelKey)},s.key))})}),n(Ne,{variant:"filled",color:"dark",size:"lg",radius:"xl","aria-label":x("bundles_scroll_menu_right"),onClick:()=>i(1),className:"bundles-nav-arrow bundles-nav-arrow-right",children:n(oo,{size:20})})]})]})}function DD(){const{myBundlesQuery:e,deleteBundleMutation:t,bundleQuery:r}=vn(),[i,s]=_.useState(null),[a,o]=_.useState(null),[l,c]=_.useState(1),d=r(a),p=_.useMemo(()=>(e.data??[]).slice().sort((m,y)=>+new Date(y.created_at)-+new Date(m.created_at)),[e.data]),h=p.slice((l-1)*Ct,l*Ct),f=m=>{const y=m.tag||x("bundles_this_bundle");window.confirm(x("bundles_delete_confirm",{name:y}))&&t.mutate(m.id,{onSuccess:()=>{Ji(x("bundles_deleted_title"),x("bundles_deleted_message")),e.refetch()},onError:()=>dr(x("bundles_delete_failed_title"),x("bundles_delete_failed_message"))})};return a!=null?d.isFetching?n(ct,{py:80,children:n(Xe,{})}):d.data?n(Hs,{view:d.data,onBack:()=>o(null),onChanged:()=>d.refetch()}):null:u(Nn,{children:[i!=null&&n(PD,{bundleId:i,opened:!0,onClose:()=>s(null),onOpenBundle:o}),u(j,{gap:"md",children:[n(Ps,{title:x("bundles_your_bundles_title"),description:x("bundles_your_bundles_description")}),n(je,{}),p.length===0?n(Un,{icon:n(Ns,{size:26}),title:x("bundles_no_bundles_title"),description:x("bundles_no_bundles_manage_description")}):n(mn,{cols:{base:1,sm:2,lg:3},spacing:"md",children:h.map(m=>n(Es,{bundle:m,isOwner:!0,onClick:()=>o(m.id),onSales:()=>s(m.id),onDelete:()=>f(m),actionLoading:t.isPending&&t.variables===m.id},m.id))}),p.length>Ct&&n($,{justify:"center",children:n(yt,{value:l,onChange:c,total:Math.ceil(p.length/Ct)})})]})]})}function ID(){const{myMediaQuery:e,myBundlesQuery:t,purchasedBundlesQuery:r,uploadMediaMutation:i,bundleQuery:s}=vn(),[a,o]=_.useState("photo"),[l,c]=_.useState(null),[d,p]=_.useState(null),[h,f]=_.useState(null),[m,y]=_.useState(!1),[b,S]=_.useState([]),[k,w]=_.useState(!1),T=s(l),A=P=>{P&&i.mutate({type:a,file:P},{onSuccess:()=>{Ji(x("bundles_upload_complete_title"),x("bundles_upload_complete_message")),e.refetch()},onError:()=>dr(x("bundles_upload_failed_title"),x("bundles_upload_failed_message"))})},R=()=>{S([]),y(!0)},E=()=>{y(!1),S([]),w(!1)},z=P=>{S(I=>I.includes(P)?I.filter(L=>L!==P):[...I,P])};if(l!=null)return T.isFetching?n(ct,{py:80,children:n(Xe,{})}):T.data?n(Hs,{view:T.data,onBack:()=>c(null),onChanged:()=>T.refetch()}):null;const N=t.data??[],C=r.data??[],M=e.data??[];return u(j,{gap:"lg",pb:m?88:0,children:[n(Oe,{opened:d!=null,onClose:()=>p(null),title:(d==null?void 0:d.type)==="video"?x("bundles_video_preview"):x("bundles_photo_preview"),size:"xl",centered:!0,radius:"lg",children:d&&n(kD,{media:d})}),h&&n(AD,{bundle:h,opened:!0,onClose:()=>f(null)}),n(MD,{opened:k,mediaIds:b,onClose:()=>w(!1),onCreated:()=>{E(),t.refetch()}}),n(Nn,{children:u(mt,{justify:"space-between",align:{base:"stretch",sm:"center"},direction:{base:"column",sm:"row"},gap:"md",children:[u(j,{gap:3,children:[n(v,{fw:700,children:x("bundles_upload_media")}),n(v,{size:"sm",c:"dimmed",children:x("bundles_upload_media_description")})]}),u($,{gap:"sm",wrap:"nowrap",children:[n(Sc,{value:a,onChange:P=>o(P),data:[{label:x("bundles_photo"),value:"photo"}
934,{label:x("bundles_video"),value:"video"}]}),n(Rr,{onChange:A,accept:a==="photo"?"image/*":"video/*",children:P=>n(V,{...P,loading:i.isPending,leftSection:n(Ai,{size:16}),children:x("bundles_upload")})})]})]})}),n(Nn,{children:u(j,{gap:"md",children:[n($,{justify:"space-between",align:"flex-start",wrap:"nowrap",gap:"md",children:u(j,{gap:2,style:{minWidth:0},children:[n(v,{fw:700,children:x("bundles_section_title")}),n(v,{size:"sm",c:"dimmed",children:x("bundles_section_description")})]})}),n(je,{}),N.length+C.length===0?n(Un,{icon:n($d,{size:26}),title:x("bundles_no_bundles_title"),description:x("bundles_no_bundles_create_description")}):u(Kt,{gutter:{base:"sm",sm:"md"},children:[N.map(P=>n(Kt.Col,{span:{base:12,xs:6,lg:4},children:n(Es,{bundle:P,date:st.format(new Date(P.created_at)),isOwner:!0,onClick:()=>c(P.id),onShare:()=>f(P)})},`own-${P.id}`)),C.map(P=>n(Kt.Col,{span:{base:12,xs:6,lg:4},children:n(Es,{bundle:P.bundle,status:x("bundles_owned"),statusColor:"green",date:st.format(new Date(P.purchased_at)),onClick:()=>c(P.bundle.id)})},`bought-${P.bundle.id}`))]})]})}),n(Nn,{children:u(j,{gap:"md",children:[u($,{justify:"space-between",align:"flex-start",wrap:"nowrap",gap:"md",children:[u(j,{gap:2,style:{minWidth:0},children:[u($,{gap:"sm",wrap:"wrap",children:[n(v,{fw:700,children:m?x("bundles_create_bundle"):x("bundles_your_media")}),!m&&n(V,{size:"compact-sm",leftSection:n($d,{size:15}),onClick:R,disabled:M.length===0,children:x("bundles_create_bundle")})]}),n(v,{size:"sm",c:"dimmed",children:m?x("bundles_select_media_instruction"):x("bundles_uploaded_count",{count:M.length})})]}),m&&n(V,{size:"sm",variant:"subtle",color:"gray",leftSection:n(ht,{size:16}),onClick:E,children:x("bundles_cancel")})]}),n(je,{}),M.length===0?n(Un,{icon:n(Ac,{size:26}),title:x("bundles_nothing_uploaded_title"),description:x("bundles_nothing_uploaded_description")}):n(Kt,{gutter:{base:"sm",sm:"md"},children:M.map(P=>n(Kt.Col,{span:{base:6,sm:4,md:3},children:n(ED,{media:P,selectable:m,selected:b.includes(P.id),onClick:()=>m?z(P.id):p(P)})},P.id))})]})}),m&&u(mt,{className:"bundle-selection-bar",justify:"space-between",align:"center",gap:"md",children:[n(v,{size:"sm",fw:600,children:b.length===0?x("bundles_choose_media"):x("bundles_selected_count",{count:b.length})}),n(V,{className:b.length===0?"bundle-next-button-disabled":void 0,color:"teal",variant:"filled",rightSection:b.length>0?n(Ab,{size:16}):void 0,disabled:b.length===0,onClick:()=>w(!0),children:b.length===0?x("bundles_select_at_least_one_media"):x("bundles_next")})]})]})}function $D(){const{mySalesQuery:e,bundleQuery:t}=vn(),[r,i]=_.useState(1),[s,a]=_.useState(null),o=t(s),l=_.useMemo(()=>(e.data??[]).slice().sort((p,h)=>+new Date(h.purchased_at)-+new Date(p.purchased_at)),[e.data]),c=l.slice((r-1)*Ct,r*Ct),d=l.reduce((p,h)=>p+h.price,0);if(s!=null){if(o.isFetching)return n(ct,{py:80,children:n(Xe,{})});if(o.data)return n(Hs,{view:o.data,onBack:()=>a(null),onChanged:()=>o.refetch()})}return u(j,{gap:"lg",children:[u(mn,{cols:{base:2,sm:3},children:[u(Ie,{withBorder:!0,radius:"lg",p:"md",children:[n(v,{size:"xs",c:"dimmed",children:x("bundles_total_sales")}),n(v,{fw:800,size:"xl",children:l.length})]}),u(Ie,{withBorder:!0,radius:"lg",p:"md",children:[n(v,{size:"xs",c:"dimmed",children:x("bundles_revenue")}),n(v,{fw:800,size:"xl",children:se(d)})]}),u(Ie,{withBorder:!0,radius:"lg",p:"md",visibleFrom:"sm",children:[n(v,{size:"xs",c:"dimmed",children:x("bundles_last_sale")}),n(v,{fw:700,children:l[0]?st.format(new Date(l[0].purchased_at)):"—"})]})]}),n(Nn,{children:u(j,{gap:"md",children:[n(Ps,{title:x("bundles_sales_history"),description:x("bundles_sales_history_description")}),n(je,{}),l.length===0?n(Un,{icon:n(eo,{size:26}),title:x("bundles_no_sales")}):n(xg,{rows:c,onOpenBundle:a}),l.length>Ct&&n($,{justify:"center",children:n(yt,{value:r,onChange:i,total:Math.ceil(l.length/Ct)})})]})})]})}function RD(){const{sharedByMeQuery:e,unshareBundleMutation:t,bundleQuery:r}=vn(),[i,s]=_.useState(1),[a,o]=_.useState(null),l=r(a),c=_.useMemo(()=>(e.data??[]).slice().sort((f,m)=>+new Date(m.created_at)-+new Date(f.created_at)),[e.data]),d=Math.max(1,Math.ceil(c.length/Ct)),p=c.slice((i-1)*Ct,i*Ct);_.useEffect(()=>{i>d&&s(d)},[i,d]);const h=f=>{t.mutate(f.id,{onSuccess:()=>{Ji(x("bundles_unshared_title"),x("bundles_unshared_message")),e.refetch()},onError:()=>dr(x("bundles_unshare_failed_title"),x("bundles_unshare_failed_message"))})};return a!=null?l.isFetching?n(ct,{py:80,children:n(Xe,{})}):l.data?n(Hs,{view:l.data,onBack:()=>o(null),onChanged:()=>{l.refetch(),e.refetch()}}):null:n(Nn,{children:u(j,{gap:"md",children:[n(Ps,{title:x("bundles_shared_title"),description:x("bundles_shared_description")}),n(je,{}),e.isFetching&&!e.data?n($,{justify:"center",py:"xl",children:n(Xe,{size:"sm"})}):c.length===0?n(Un,{icon:n(Db,{size:26}),title:x("bundles_nothing_shared_title"),description:x("bundles_nothing_shared_description")}):n(mn,{cols:{base:1,sm:2,lg:3},spacing:"md",children:p.map(f=>n(Es,{bundle:f,isOwner:!0,onClick:()=>o(f.id),onUnshare:()=>h(f),actionLoading:t.isPending&&t.variables===f.id},f.id))}),c.length>Ct&&n($,{justify:"center",children:n(yt,{value:i,onChange:s,total:d})})]})})}function zD(e,t){if(!t)return e;const r=new Map(t.media.map(i=>[i.id,ks(i)]));return{...e,creator_username:e.creator_username??t.creator_username??null,creator_avatar_url:e.creator_avatar_url??t.creator_avatar_url??null,media:e.media.map(i=>({...i,duration_seconds:ks(i)??r.get(i.id)??null}))}}function ND(){const{sharedBundlesQuery:e,purchasedBundlesQuery:t,bundleQuery:r}=vn(),[i,s]=_.useState(null),[a,o]=_.useState(1),l=r(i),c=_.useMemo(()=>(e.data??[]).filter(m=>!m.purchased).slice().sort((m,y)=>+new Date(y.created_at)-+new Date(m.created_at)),[e.data]),d=_.useMemo(()=>(t.data??[]).slice().sort((m,y)=>+new Date(y.purchased_at)-+new Date(m.purchased_at)),[t.data]),p=_.useMemo(()=>{var m;return i==null||(m=e.data)==null?void 0:m.find(y=>y.id===i)},[i,e.data]),h=_.useMemo(()=>l.data?zD(l.data,p):void 0,[l.data,p]),f=c.slice((a-1)*Ct,a*Ct);return i!=null?l.isFetching?n(ct,{py:80,children:n(Xe,{})}):h?n(Hs,{view:h,onBack:()=>s(null),onChanged:()=>{l.refetch(),e.refetch(),t.refetch()}}):n(Ie,{withBorder:!0,radius:"lg",p:"md",children:n(v,{c:"red",size:"sm",children:x("bundles_unavailable_message")})}):u(j,{gap:"lg",children:[n(Nn,{children:u(j,{gap:"md",children:[n(Ps,{title:x("bundles_available_title"),description:x("bundles_available_description")}),n(je,{}),e.isFetching?n(ct,{py:60,children:n(Xe,{})}):f.length===0?n(Un,{icon:n(io,{size:26}),title:x("bundles_no_available_title"),description:x("bundles_no_available_description")}):n(mn,{cols:{base:1,sm:2,lg:3},spacing:"md",children:f.map(m=>n(Tg,{bundle:m,onOpen:()=>s(m.id)},m.id))}),c.length>Ct&&n($,{justify:"center",children:n(yt,{value:a,onChange:o,total:Math.ceil(c.length/Ct)})})]})}),n(Nn,{children:u(j,{gap:"md",children:[n(Ps,{title:x("bundles_purchased_title"),description:x("bundles_purchased_description")}),n(je,{}),d.length===0?n(Un,{icon:n(Ib,{size:26}),title:x("bundles_nothing_purchased_title"),description:x("bundles_nothing_purchased_description")}):n(mn,{cols:{base:1,sm:2,lg:3},spacing:"md",children:d.map(m=>n(Es,{bundle:m.bundle,status:x("bundles_owned"),statusColor:"green",onClick:()=>s(m.bundle.id)},m.bundle.id))})]})})]})}const LD="_page_vmjny_1",OD={page:LD};function FD({activeSection:e,onSectionChange:t}={}){const{user:r}=fe(),[i,s]=_.useState("media"),a=e??i,o=l=>{if(t){t(l);return}s(l)};return r?n(G,{className:OD.page,px:{base:"sm",sm:"xl"},py:{base:"md",sm:"xl"}
934,children:u(j,{gap:"lg",children:[n(mt,{justify:"space-between",align:"center",gap:"md",children:u($,{gap:"sm",wrap:"nowrap",children:[n(bt,{size:44,radius:"lg",variant:"gradient",gradient:{from:"teal",to:"cyan"},children:n(Ns,{size:23})}),u(G,{children:[n(Ye,{order:2,children:x("bundles_title")}),n(v,{size:"sm",c:"dimmed",children:x("bundles_page_description")})]})]})}),n(G,{hiddenFrom:"sm",children:n(Gh,{active:a,onChange:o})}),u(mt,{gap:"lg",align:"flex-start",children:[n(G,{visibleFrom:"sm",children:n(Gh,{active:a,onChange:o})}),u(G,{style:{flex:1,minWidth:0,width:"100%"},children:[a==="media"&&n(ID,{}),a==="bundles"&&n(DD,{}),a==="sharedWithMe"&&n(ND,{}),a==="sharedByMe"&&n(RD,{}),a==="sales"&&n($D,{})]})]})]})}):null}const UD={media:"/bundles/media",bundles:"/bundles/mine",sharedWithMe:"/bundles/available",sharedByMe:"/bundles/shared",sales:"/bundles/sales"};function is({section:e}){const t=gt();return n(FD,{activeSection:e,onSectionChange:r=>t(UD[r])})}function BD(){return u(Wg,{children:[n(fr,{index:!0,element:n(or,{to:"media",replace:!0})}),n(fr,{path:"media",element:n(is,{section:"media"})}),n(fr,{path:"mine",element:n(is,{section:"bundles"})}),n(fr,{path:"available",element:n(is,{section:"sharedWithMe"})}),n(fr,{path:"shared",element:n(is,{section:"sharedByMe"})}),n(fr,{path:"sales",element:n(is,{section:"sales"})}),n(fr,{path:"*",element:n(or,{to:"media",replace:!0})})]})}const bd=e=>`
935  <div style="display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:18px 0 14px;">
936    <span style="padding:8px 12px;border:1px solid #868e96;border-radius:8px;"><strong>${e.created}</strong></span>
937    <span>→</span>
938    <span style="padding:8px 12px;border:1px solid #fab005;border-radius:8px;"><strong>${e.accepted}</strong></span>
939    <span>→</span>
940    <span style="padding:8px 12px;border:1px solid #fd7e14;border-radius:8px;"><strong>${e.pre}</strong></span>
941    <span>→</span>
942    <span style="padding:8px 12px;border:1px solid #fab005;border-radius:8px;"><strong>${e.voting}</strong></span>
943    <span>→</span>
944    <span style="padding:8px 12px;border:1px solid #40c057;border-radius:8px;"><strong>${e.result}</strong></span>
945  </div>
946`,_d=(e,t)=>`
947  <div style="padding:12px 14px;border-left:3px solid #228be6;background:rgba(34,139,230,.08);border-radius:6px;margin:0 0 22px;">
948    <strong>${e}</strong><br />
949    ${t}
950  </div>
951`,qD=`
952  <h2>How dares work</h2>
953  <p>Dares involve real contributor funds, streamer decisions, clarification rights, and contributor voting. Please read this page before creating a dare.</p>
954
955  ${bd({created:"Created",accepted:"Accepted",pre:"Pre-voting (2+ min)",voting:"Voting (1 min)",result:"Completed / Failed"})}
956
957  ${_d("TL;DR","A donor creates a dare and puts money into it. The streamer accepts it and does it. After the streamer presses Complete, contributors get at least 2 minutes to check the result. Everyone can approve it early; the first clarification from each contributor adds 1 minute and gives that contributor the right to vote NO in the final 1-minute vote. If NO votes represent at least 50% of all contributed money, the dare fails and the money is returned. Otherwise the dare is completed and the streamer is paid.")}
958
959  <h3>1. Creating and contributing</h3>
960  <ul>
961    <li>You must accept the current dare rules before you can create a dare.</li>
962    <li>The initial contribution is deducted from the creator's balance when the dare is created. Additional contributions are deducted when they are added.</li>
963    <li>Until the streamer accepts the dare, the original donor may delete it and other contributors may recover their own contribution.</li>
964    <li>The goal amount and percentage show funding progress. They do not by themselves mark the dare as completed.</li>
965  </ul>
966
967  <h3>2. Streamer acceptance and performance</h3>
968  <p>When the streamer accepts the dare, it becomes active. When the streamer believes the dare has been completed, they press Complete. This does not pay the dare immediately: it starts pre-voting.</p>
969
970  <h3>3. Pre-voting review</h3>
971  <ul>
972    <li>Pre-voting lasts at least <strong>2 minutes</strong>.</li>
973    <li>Every contributor may confirm YES during this period. If all contributors confirm YES, the dare completes immediately.</li>
974    <li>A contributor may send a clarification only to clarify the conditions of the existing dare. It may not add a new task or ask the streamer to do something extra.</li>
975    <li>The <strong>first clarification from each contributor adds 1 additional minute</strong> to pre-voting. Repeated messages from the same contributor do not keep extending the timer.</li>
976    <li>If a contributor already confirmed YES and then sends a clarification, that early YES is cancelled and becomes pending again. Only the first clarification from that c
976ontributor adds extra time.</li>
977    <li>Clarification messages are moderated. Spam, abuse, nonsense, or requests for extra actions are prohibited. Extra requests require a new dare or donation.</li>
978    <li>The streamer may press <strong>Continue dare</strong> to return the dare to the active Accepted state. Pre-votes are reset; existing clarifications remain attached to the dare.</li>
979  </ul>
980
981  <h3>4. Voting</h3>
982  <p>If pre-voting expires without unanimous early YES, the dare enters a 1-minute voting phase.</p>
983  <ul>
984    <li>Contributors who never clarified the dare are automatically counted as YES.</li>
985    <li>Only contributors who clarified the dare can manually vote YES or NO during voting.</li>
986    <li>If a clarifying contributor does not cast a NO vote before voting ends, their contribution remains YES.</li>
987    <li>The dare fails when NO votes represent at least <strong>50% of the contributed amount</strong>. Otherwise it completes.</li>
988  </ul>
989
990  <h3>5. Deletion and refunds</h3>
991  <ul>
992    <li>The streamer may delete/reject an active dare at any active stage: Created, Accepted, Pre-voting, or Voting.</li>
993    <li>If the streamer rejects/deletes the dare, all contributed funds are returned to contributors.</li>
994    <li>The original donor may delete the dare only while it is still Created, before the streamer accepts it.</li>
995    <li>If a dare fails in voting, contributed funds are returned to contributors.</li>
996    <li>If a dare completes, the normal dare payout and platform commission are applied.</li>
997  </ul>
998`,jD=`
999  <h2>Как работают вызовы</h2>
1000  <p>В вызовах участвуют реальные средства донатеров, решение стримера о выполнении, право уточнить условия и голосование участников. Перед созданием вызова необходимо прочитать эти правила.</p>
1001
1002  ${bd({created:"Создан",accepted:"Принят",pre:"Предголосование (2+ мин)",voting:"Голосование (1 мин)",result:"Выполнен / Провален"})}
1003
1004  ${_d("Коротко","Донатер создаёт вызов и вносит деньги. Стример принимает вызов и выполняет его. После кнопки «Выполнено» у участников есть минимум 2 минуты, чтобы всё проверить. Можно сразу подтвердить выполнение; первое уточнение от каждого участника добавляет ещё 1 минуту и даёт этому участнику право проголосовать «Не выполнено» на финальном минутном голосовании. Если на голоса «Не выполнено» приходится 50% или больше всей суммы, вызов провален и деньги возвращаются. Иначе вызов считается выполненным и стример получает выплату.")}
1005
1006  <h3>1. Создание и участие</h3>
1007  <ul>
1008    <li>Создать вызов можно только после принятия актуальной версии этих правил.</li>
1009    <li>Первоначальный взнос списывается с баланса автора при создании вызова. Дополнительные взносы списываются в момент их добавления.</li>
1010    <li>Пока стример не принял вызов, первоначальный донатер может удалить его, а другие участники — вернуть собственный взнос.</li>
1011    <li>Цель и процент показывают прогресс сбора средств. Само по себе достижение цели не означает, что вызов выполнен.</li>
1012  </ul>
1013
1014  <h3>2. Принятие и выполнение стримером</h3>
1015  <p>После принятия стримером вызов становится активным. Когда стример считает, что выполнил условия, он нажимает «Выполнено». Деньги не выплачиваются сразу: сначала начинается этап предголосования.</p>
1016
1017  <h3>3. Предголосование</h3>
1018  <ul>
1019    <li>Предголосование длится минимум <strong>2 минуты</strong>.</li>
1020    <li>Каждый участник может заранее подтвердить YES. Если YES подтвердили все участники, вызов сразу завершается как выполненный.</li>
1021    <li>Уточнение можно отправить только для разъяснения уже существующих условий вызова. Нельзя добавлять новое задание или просить стримера сделать что-то сверх исходных условий.</li>
1022    <li><strong>Первое уточнение от каждого участника добавляет 1 дополнительную минуту</strong> к предголосованию. Повторные сообщения того же участника не продлевают таймер бесконечно.</li>
1023    <li>Если участник уже подтвердил YES, а затем отправил уточнение, его предварительное подтверждение отменяется и снова становится ожидающим решения. Дополнительную минуту даёт только первое уточнение этого участника.</li>
1024    <li>Уточнения модерируются. Спам, оскорбления, бессмысленные сообщения и просьбы о дополнительных действиях запрещены. Дл
1024я дополнительной просьбы нужно создать новый вызов или сделать отдельный донат.</li>
1025    <li>Стример может нажать <strong>«Продолжить вызов»</strong> и вернуть его в активное состояние «Принят». Предварительные голоса сбрасываются, а уже отправленные уточнения остаются связанными с вызовом.</li>
1026  </ul>
1027
1028  <h3>4. Голосование</h3>
1029  <p>Если время предголосования закончилось и единогласного досрочного YES нет, начинается обычное голосование длительностью 1 минуту.</p>
1030  <ul>
1031    <li>Участники, которые не отправляли уточнение, автоматически считаются проголосовавшими YES.</li>
1032    <li>Вручную голосовать YES или NO могут только участники, которые ранее отправили уточнение.</li>
1033    <li>Если участник с уточнением не успел проголосовать NO до окончания таймера, его вклад остаётся голосом YES.</li>
1034    <li>Вызов считается проваленным, если на голоса NO приходится не менее <strong>50% от общей суммы взносов</strong>. В остальных случаях он считается выполненным.</li>
1035  </ul>
1036
1037  <h3>5. Удаление и возврат средств</h3>
1038  <ul>
1039    <li>Стример может удалить или отклонить активный вызов на любом активном этапе: «Создан», «Принят», «Предголосование» или «Голосование».</li>
1040    <li>Если стример удаляет или отклоняет вызов, все внесённые средства возвращаются участникам.</li>
1041    <li>Первоначальный донатер может удалить вызов только до его принятия стримером.</li>
1042    <li>Если вызов провален по итогам голосования, средства возвращаются участникам.</li>
1043    <li>Если вызов выполнен, применяется обычная схема выплаты стримеру и комиссия платформы.</li>
1044  </ul>
1045`,HD=`
1046  <h2>Cómo funcionan los retos</h2>
1047  <p>Los retos implican fondos reales de los contribuidores, la decisión del streamer sobre el cumplimiento, el derecho a aclarar las condiciones y la votación de los participantes. Debes leer estas reglas antes de crear un reto.</p>
1048
1049  ${bd({created:"Creado",accepted:"Aceptado",pre:"Prevotación (2+ min)",voting:"Votación (1 min)",result:"Completado / Fallido"})}
1050
1051  ${_d("En pocas palabras","Un donante crea un reto y aporta dinero. El streamer acepta el reto y lo realiza. Cuando pulsa «Completar», los participantes tienen al menos 2 minutos para comprobar el resultado. Todos pueden aprobarlo antes; la primera aclaración de cada participante añade 1 minuto y le da derecho a votar NO en la votación final de 1 minuto. Si los votos NO representan al menos el 50% de todo el dinero aportado, el reto falla y se devuelve el dinero. De lo contrario, el reto se completa y el streamer recibe el pago.")}
1052
1053  <h3>1. Creación y contribuciones</h3>
1054  <ul>
1055    <li>Debes aceptar la versión vigente de estas reglas antes de crear un reto.</li>
1056    <li>La contribución inicial se descuenta del saldo del creador al crear el reto. Las contribuciones adicionales se descuentan cuando se añaden.</li>
1057    <li>Antes de que el streamer acepte el reto, el donante original puede eliminarlo y los demás contribuidores pueden recuperar su propia contribución.</li>
1058    <li>La meta y el porcentaje muestran el progreso de financiación. Alcanzar la meta por sí solo no significa que el reto esté completado.</li>
1059  </ul>
1060
1061  <h3>2. Aceptación y realización</h3>
1062  <p>Cuando el streamer acepta el reto, este pasa a estar activo. Cuando considera que ha cumplido las condiciones, pulsa «Completar». El pago no se realiza de inmediato: primero comienza la prevotación.</p>
1063
1064  <h3>3. Prevotación</h3>
1065  <ul>
1066    <li>La prevotación dura como mínimo <strong>2 minutos</strong>.</li>
1067    <li>Cada contribuidor puede confirmar SÍ durante este periodo. Si todos confirman SÍ, el reto se completa inmediatamente.</li>
1068    <li>Una aclaración solo puede precisar las condiciones del reto existente. No puede añadir una tarea nueva ni pedir al streamer acciones adicionales.</li>
1069    <li><strong>La primera aclaración de cada contribuidor añade 1 minuto adicional</strong> a la prevotación. Los mensajes repetidos del mismo contribuidor no pueden prolongar el temporizador indefinidamente.</li>
1070    <li>Si un contribuidor ya confirmó SÍ y después envía una aclaración, esa aprobación anticipada se cancela y vuelve a quedar pendiente. Solo la primera aclaración de ese contribuidor añade tiempo adicional.</li>
1071    <li>Las aclaraciones están moderadas. El spam, los insultos, mensajes sin sentido y solicitudes de acciones adicionales están prohibidos. Una solicitud adicional requiere un nuevo reto o una nueva donación.</li>
1072    <li>El streamer puede pulsar <strong>«Continuar reto»</strong> para devolverlo al estado activo Aceptado. Los votos anticipados se reinician; las aclaraciones ya enviadas permanecen asociadas al reto.</li>
1073  </ul>
1074
1075  <h3>4. Votación</h3>
1076  <p>Si termina la prevotación sin una aprobación anticipada unánime, comienza una votación de 1 minuto.</p>
1077  <ul>
1078    <li>Los contribuidores que nunca enviaron una aclaración se cuentan automáticamente como SÍ.</li>
1079    <li>Solo los contribuidores que aclararon el reto pueden votar manualmente SÍ o NO.</li>
1080    <li>Si un contribuidor que hizo una aclaración no registra un voto NO antes de que termine la votación, su contribución permanece como SÍ.</li>
1081    <li>El reto falla cuando los votos NO representan al menos el <strong>50% del importe total contribuido</strong>. En caso contrario, se completa.</li>
1082  </ul>
1083
1084  <h3>5. Eliminación y reembolsos</h3>
1085  <ul>
1086    <li>El streamer puede eliminar o rechazar un reto activo en cualquier etapa activa: Creado, Aceptado, Prevotación o Votación.</li>
1087    <li>Si el streamer elimina o rechaza el reto, todos los fondos contribuidos se devuelven a los contribuidores.</li>
1088    <li>El donante original solo puede eliminar el reto mientras siga en estado Creado, antes de que el streamer lo acepte.</li>
1089    <li>Si el reto falla en la votación, los fondos se devuelven a los contribuidores.</li>
1090    <li>Si el reto se completa, se aplica el pago normal al streamer y la comisión de la plataforma.</li>
1091  </ul>
1092`,Xh={en:qD,ru:jD,es:HD};function WD(){var i;const{i18n:e}=Fe(),t=((i=e.language)==null?void 0:i.split("-")[0])??"en",r=Xh[t]??Xh.en;return n(Be,{size:"md",py:"xl",children:n(ue,{withBorder:!0,radius:"md",p:"xl",children:n(j,{mb:"xs",children:n(wt,{children:n("div",{dangerouslySetInnerHTML:{__html:r}}
1092)})})})})}const YD=Ni.lazy(()=>co(()=>import("./Stream-C1h4Mhsg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),QD=Ni.lazy(()=>co(()=>import("./Browse-DRYkUbFO.js"),__vite__mapDeps([8,1,3,6,5,2,4,9]))),Jh=Ni.lazy(()=>co(()=>import("./PublicChat-DaE8zzYc.js"),__vite__mapDeps([10,1,2,3,4,11]))),VD=Ni.lazy(()=>co(()=>import("./Argus-BxQIWQME.js"),__vite__mapDeps([12,1,3,2,4,13]))),xl=e=>n(_.Suspense,{fallback:n(gc,{}),children:n(e,{})}),KD=Yg([{path:"/",element:n(gc,{}),errorElement:n(yT,{}),children:[{index:!0,id:"streams",element:xl(QD)},{id:"stream",path:"/:username",element:n(_.Suspense,{fallback:n(gc,{}),children:n(uD,{children:n(CD,{children:n(YD,{})})})})},{path:"/:username/profile",element:n(J2,{})},{path:"/chat",element:xl(Jh)},{path:"/chats/:id",element:xl(Jh)},{path:"/settings/:tabId",element:n(Ht,{children:n(ak,{})})},{path:"/stream-panel",element:n(Ht,{children:n(dk,{})})},{path:"/argus",element:n(_.Suspense,{fallback:null,children:n(VD,{})})},{path:"/admin/:tabId",element:n(Xr,{children:n(dM,{})})},{path:"/admin/users/:id",element:n(Xr,{children:n(qk,{})})},{path:"/finances",element:n(Xr,{children:n(Ph,{})}),children:[{index:!0,element:n(or,{to:"topups",replace:!0})},{path:":tabId",element:n(Ph,{})}]},{path:"/admin/events/:id",element:n(Xr,{children:n(AA,{})})},{path:"/withdraw",element:n(Xr,{children:n(vM,{})})},{path:"/withdrawals",element:n(Ht,{children:n(i2,{})})},{path:"/statistics",element:n(Ht,{children:n(PM,{})})},{path:"/crypto-deposits",element:n(Xr,{children:n(SD,{})})},{path:"/referral-program",element:n(Ht,{children:n(kT,{})})},{path:"/events/:id",element:n(fT,{})},{path:"/terms-of-use",element:n(Sk,{})},{path:"/privacy-policy",element:n(Z2,{})},{path:"/refund-policy",element:n(eD,{})},{path:"/anti-human-trafficking",element:n(tD,{})},{path:"/usc2257",element:n(iD,{})},{path:"/rules",element:n(AT,{})},{path:"/complaints-policy",element:n(oD,{})},{path:"/appeals-policy",element:n(lD,{})},{path:"/takedown-policy",element:n(pD,{})},{path:"/dare-rules",element:n(WD,{})},{path:"/subscriptions",element:n(Ht,{children:n(wk,{})})},{path:"/bundles/*",element:n(Ht,{children:n(BD,{})})},{path:"/deposit",element:n(Ht,{children:n(dT,{})})},{path:"/payment/success",element:n(or,{to:"/"})},{path:"/payment/failure",element:n(or,{to:"/"})},{path:"/support",element:n(Ht,{children:n(MM,{})})},{path:"/rating/:tabId?",element:n(Ht,{children:n(HA,{})})},{path:"/verify-age",element:n(Ht,{children:n(aD,{})})},{path:"/feed",element:n(rD,{})}]},{path:"/auth",element:n(Zh,{children:n(gT,{})})},{path:"/create-account",element:n(Zh,{children:n(MT,{})})}],{future:{v7_relativeSplatPath:!0,v7_fetcherPersist:!0,v7_normalizeFormMethod:!0,v7_partialHydration:!0,v7_skipActionErrorRevalidation:!0}});function GD(){if(typeof window<"u"&&!window.__googleTranslateFixApplied){const e=Node.prototype.removeChild;Node.prototype.removeChild=function(r){try{return e.call(this,r)}catch(i){if(i.name==="NotFoundError")return r;throw i}};const t=Node.prototype.insertBefore;Node.prototype.insertBefore=function(r,i){try{return t.call(this,r,i)}catch(s){if(s.name==="NotFoundError")return this.appendChild(r);throw s}},window.__googleTranslateFixApplied=!0}}const XD="/assets/moderation_cat-DT4OYN7O.webp",JD="_viewport_167qh_1",ZD="_banner_167qh_8",eI="_content_167qh_25",tI="_art_167qh_34",nI="_cat_167qh_64",rI="_message_167qh_71",iI="_title_167qh_76",sI="_body_167qh_86",aI="_confirm_167qh_95",En={viewport:JD,banner:ZD,content:eI,art:tI,cat:nI,message:rI,title:iI,body:sI,confirm:aI};function oI(){const e=_.useSyncExternalStore(CC,TC,()=>!1),{t}=Fe();return u(Oe.Root,{opened:e,onClose:hc,centered:!0,size:420,xOffset:12,yOffset:12,zIndex:11e3,closeOnClickOutside:!1,closeOnEscape:!0,trapFocus:!0,returnFocus:!0,lockScroll:!0,transitionProps:{duration:0},classNames:{inner:En.viewport,content:En.banner,body:En.content},children:[n(Oe.Overlay,{color:"#241b2d",backgroundOpacity:.46,blur:5}),n(Oe.Content,{children:u(Oe.Body,{children:[n("div",{className:En.art,"aria-hidden":"true",children:n("img",{className:En.cat,src:XD,width:180,height:150,alt:""})}),u("div",{className:En.message,children:[n(Oe.Title,{className:En.title,children:t("argus_warning_title")}),n("p",{className:En.body,children:t("argus_warning_body")})]}),n("button",{type:"button",className:En.confirm,onClick:hc,"data-autofocus":!0,children:t("argus_warning_dism
1092iss")})]})})]})}const vd="dark";function lI(){const e=window.plausible||function(...r){e.q=e.q||[],e.q.push(r)};e.init=e.init||function(r){e.o=r||{}},window.plausible=e;const t=document.createElement("script");t.async=!0,t.src=`https://ph.${Tt}/js/pa-7Knc3vRojk17rBkh_qx3J.js`,document.head.appendChild(t),e.init()}GD();document.title=sf;lI();eC({dsn:`https://f41005f148fb4de2996e97fad9559340@sentry.${Tt}/1`,release:`${sf}@master`,integrations:[],tracesSampleRate:0});function Ht({children:e}){const{user:t}=fe();return t?e:n(or,{to:"/auth"})}function Zh({children:e}){const{user:t}=fe();return t?n(or,{to:"/"}):e}function Xr({children:e}){const{user:t}=fe();return t&&he(t,Ce)?e:n(or,{to:"/"})}const cI=new Jb({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}});zb.createRoot(document.getElementById("root")).render(n(Ni.StrictMode,{children:u(my,{defaultColorScheme:vd,theme:{primaryColor:"red",primaryShade:4,defaultGradient:{from:"#ed6ea0",to:"#ec8c69",deg:35}},children:[n(fy,{}),n(gy,{children:u(r_,{client:cI,children:[u(NC,{children:[n(Qg,{router:KD}),n(oI,{})]}),!1]})})]})}));export{zI as $,$f as A,vI as B,uE as C,FI as D,Ss as E,LT as F,Tt as G,yI as H,gI as I,_I as J,bI as K,bo as L,ad as M,O as N,vk as O,NI as P,Jc as Q,xt as R,ld as S,Cg as T,hf as U,AI as V,ed as W,yd as X,MI as Y,RI as Z,co as _,fe as a,J as a0,DI as a1,II as a2,$I as a3,V1 as a4,Z1 as a5,vf as a6,Cs as a7,oe as a8,TI as a9,EI as aa,et as ab,kI as ac,_e as ad,xI as ae,qn as af,ae as ag,zc as ah,XD as ai,PI as aj,N1 as ak,wn as b,id as c,OI as d,en as e,Ce as f,at as g,he as h,qs as i,Hu as j,yc as k,qu as l,se as m,Eo as n,Po as o,Mo as p,BI as q,Mf as r,LI as 
1092s,hD as t,ko as u,UI as v,Ar as w,zn as x,zf as y,V2 as z};

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