sync: update dist-site from main repo

This commit is contained in:
abingyyds committed 2026-04-11 17:47:53 +08:00
1 parent 2e8356b6e3
commit c384954920
51 files changed
+1260 -938

No files matched your search

-1
View File
@@ -1 +0,0 @@
import{r as S,j as Qt}from"./index-BxETo_Fm.js";function kt(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const Yt=typeof window<"u",te=Yt?S.useLayoutEffect:S.useEffect;function ee(t,e){t.indexOf(e)===-1&&t.push(e)}function ne(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const U=(t,e,n)=>n>e?e:n<t?t:n;let Ct=()=>{};const ft={},Y=t=>t,se=(t,e)=>n=>e(t(n)),ht=(...t)=>t.reduce(se),Vt=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class re{constructor(){this.subscriptions=[]}add(e){return ee(this.subscriptions,e),()=>ne(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const L=t=>t*1e3,P=t=>t/1e3;function It(t,e){return e?t*(1e3/e):0}const Et=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,ie=1e-7,oe=12;function ae(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=Et(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>ie&&++a<oe);return o}function j(t,e,n,r){if(t===e&&n===r)return Y;const s=i=>ae(i,0,1,t,n);return i=>i===0||i===1?i:Et(s(i),e,r)}const Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pt=t=>e=>1-t(1-e),Nt=j(.33,1.53,.69,.99),dt=Pt(Nt),ce=Rt(dt),ue=t=>t>=1?1:(t*=2)<1?.5*dt(t):.5*(2-Math.pow(2,-10*(t-1))),pt=t=>1-Math.sin(Math.acos(t)),le=Pt(pt),fe=Rt(pt),he=j(.42,0,1,1),de=j(0,0,.58,1),Ot=j(.42,0,.58,1),pe=t=>Array.isArray(t)&&typeof t[0]!="number",me=t=>Array.isArray(t)&&typeof t[0]=="number",ge={linear:Y,easeIn:he,easeInOut:Ot,easeOut:de,circIn:pt,circInOut:fe,circOut:le,backIn:dt,backInOut:ce,backOut:Nt,anticipate:ue},ye=t=>typeof t=="string",Tt=t=>{if(me(t)){Ct(t.length===4);const[e,n,r,s]=t;return j(e,n,r,s)}else if(ye(t))return ge[t];return t},z=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function be(t,e){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(c){o.has(c)&&(l.schedule(c),t()),c(a)}const l={schedule:(c,f=!1,d=!1)=>{const x=d&&s?n:r;return f&&o.add(c),x.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,s){i=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(u),n.clear(),s=!1,i&&(i=!1,l.process(c))}};return l}const Te=40;function ve(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=z.reduce((T,g)=>(T[g]=be(i),T),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:f,preRender:d,render:M,postRender:x}=o,m=()=>{const T=ft.useManualTiming,g=T?s.timestamp:performance.now();n=!1,T||(s.delta=r?1e3/60:Math.max(Math.min(g-s.timestamp,Te),1)),s.timestamp=g,s.isProcessing=!0,a.process(s),u.process(s),l.process(s),c.process(s),f.process(s),d.process(s),M.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(m))},v=()=>{n=!0,r=!0,s.isProcessing||t(m)};return{schedule:z.reduce((T,g)=>{const y=o[g];return T[g]=(D,C=!1,b=!1)=>(n||v(),y.schedule(D,C,b)),T},{}),cancel:T=>{for(let g=0;g<z.length;g++)o[z[g]].cancel(T)},state:s,steps:o}}const{schedule:tt,cancel:Ut,state:J}=ve(typeof requestAnimationFrame<"u"?requestAnimationFrame:Y,!0);let Z;function xe(){Z=void 0}const V={now:()=>(Z===void 0&&V.set(J.isProcessing||ft.useManualTiming?J.timestamp:performance.now()),Z),set:t=>{Z=t,queueMicrotask(xe)}},Me=t=>e=>typeof e=="string"&&e.startsWith(t),Ae=Me("var(--"),De=t=>Ae(t)?Fe.test(t.split("/*")[0].trim()):!1,Fe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Kt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Gt={...Kt,transform:t=>U(0,1,t)},q=t=>Math.round(t*1e5)/1e5,Lt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Se(t){return t==null}const we=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mt=(t,e)=>n=>!!(typeof n=="string"&&we.test(n)&&n.startsWith(t)||e&&!Se(n)&&Object.prototype.hasOwnProperty.call(n,e)),qt=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Lt);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ke=t=>U(0,255,t),nt={...Kt,transform:t=>Math.round(ke(t))},O={test:mt("rgb","red"),parse:qt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+q(Gt.transform(r))+")"};function Ce(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const at={test:mt("#"),parse:Ce,transform:O.transform},Ve=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),vt=Ve("%"),G={test:mt("hsl","hue"),parse:qt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"Line truncated
-1
View File
@@ -1 +0,0 @@
import{u as k,d as w,r,j as e,Q as b,L as d,g as U,e as C,z as S}from"./index-BxETo_Fm.js";import{C as n}from"./CountUp-Cw5TWdkr.js";import{u as L}from"./useTranslation-X387rOdZ.js";function E(){const{t:s}=L(),{user:a,refreshUser:j}=k(),{symbol:c,rate:i}=w(),[t,N]=r.useState(null),[l,x]=r.useState(""),[m,p]=r.useState(!1),h=async()=>{try{const o=await U();o.data.success&&N(o.data.data)}catch{}};r.useEffect(()=>{h()},[]);const f=async o=>{if(o.preventDefault(),!!l.trim()){p(!0);try{(await C(l.trim())).data.success&&(S.success(s("dashboard.redeemSuccess")),x(""),await Promise.all([h(),j()]))}catch{}p(!1)}},g=(t==null?void 0:t.quota)??(a==null?void 0:a.quota)??0,u=(t==null?void 0:t.used_quota)??(a==null?void 0:a.used_quota)??0,v=(t==null?void 0:t.request_count)??(a==null?void 0:a.request_count)??0,y=g/b*i;return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-2xl font-heading font-bold text-page mb-1",children:[s("dashboard.welcome")," ",(a==null?void 0:a.display_name)||(a==null?void 0:a.username)||"User"]}),e.jsx("p",{className:"text-sm text-page-secondary",children:s("dashboard.manageDesc")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.balance")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[c,e.jsx(n,{from:0,to:Math.round(y*100)/100,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:g.toLocaleString()})})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.used")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[c,e.jsx(n,{from:0,to:Math.round(u/b*i*100)/100,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:u.toLocaleString()})})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.totalRequests")}),e.jsx("div",{className:"text-3xl font-bold text-page",children:e.jsx(n,{from:0,to:v,duration:1.5})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("dashboard.redeemCode")}),e.jsxs("form",{onSubmit:f,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:l,onChange:o=>x(o.target.value),className:"input flex-1",placeholder:s("dashboard.enterCode")}),e.jsx("button",{type:"submit",disabled:m,className:"btn-primary whitespace-nowrap",children:s(m?"dashboard.redeeming":"dashboard.redeem")})]})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("dashboard.quickLinks")}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs(d,{to:"/tokens",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.apiKeys")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.manageKeys")})]}),e.jsxs(d,{to:"/packages",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.packages")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.viewPlans")})]}),e.jsxs(d,{to:"/pricing",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.pricing")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.modelPrices")})]}),e.jsxs(d,{to:"/logs",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.logs")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.viewLogs")})]})]})]})]})]})}export{E as default};
-1
View File
@@ -1 +0,0 @@
import{r as n,j as b}from"./index-BxETo_Fm.js";const $=({children:c,blur:f=!1,duration:e=800,delay:t=0,threshold:o=.1,initialOpacity:l=0,className:u="",...m})=>{const i=n.useRef(null),[s,p]=n.useState(!1);return n.useEffect(()=>{const a=i.current;if(!a)return;const r=new IntersectionObserver(([x])=>{x.isIntersecting&&(p(!0),r.disconnect())},{threshold:o});return r.observe(a),()=>r.disconnect()},[o]),b.jsx("div",{ref:i,className:u,style:{opacity:s?1:l,filter:f?s?"blur(0px)":"blur(10px)":void 0,transform:s?"translateY(0)":"translateY(20px)",transition:`opacity ${e}ms ease-out ${t}ms, filter ${e}ms ease-out ${t}ms, transform ${e}ms ease-out ${t}ms`,willChange:"opacity, filter, transform"},...m,children:c})};export{$ as F};
-1
View File
@@ -1 +0,0 @@
import{u as f,a as y,d as w,r as m,h as M,n as q,j as e,L as a,Q as C}from"./index-BxETo_Fm.js";import{c as D,R as L}from"./RotatingEquiv-DyNyTpNy.js";import{C as h}from"./CountUp-Cw5TWdkr.js";import{F as i}from"./FadeContent-C5iyyIb_.js";import{u as S}from"./useTranslation-X387rOdZ.js";function T(){const{t:s}=S(),{user:n}=f(),{site:c}=y(),{symbol:u}=w(),[g,v]=m.useState([]),[j,N]=m.useState([]);m.useEffect(()=>{M().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{}),q().then(t=>{t.data.success&&N(t.data.data||[])}).catch(()=>{})},[]);const l=g.filter(t=>t.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-bold text-slate-900 leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-slate-500 mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-slate-900 text-white font-medium text-sm hover:bg-slate-800 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-lg bg-slate-900 text-white font-medium text-sm hover:bg-slate-800 transition-colors",children:s("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-slate-500 font-medium text-sm hover:text-slate-900 transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center divide-x divide-slate-200 mt-20 pt-10 border-t border-slate-200",children:[e.jsxs("div",{className:"pr-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:[e.jsx(h,{from:0,to:l.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{className:"px-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{className:"pl-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"bg-slate-50 border-y border-slate-200",children:e.jsx("div",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-slate-500 mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),icon:e.jsx("svg",{className:"w-5 h-5 text-slate-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),icon:e.jsx("svg",{className:"w-5 h-5 text-slate-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),icon:e.jsx("svg",{className:"w-5 h-5 text-slate-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,o)=>e.jsxs("div",{className:"p-6 rounded-xl bg-white border border-slate-200 hover:shadow-sm transition-all",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-slate-100 flex items-center justify-center mb-4",children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-slate-900 mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:t.desc})]},o))})]})})}),l.length>0&&e.jsx("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-slate-500",children:s("home.availableModelsDesc",{count:l.length})})]}),l.lLine truncated
-1
View File
@@ -1 +0,0 @@
import{u as v,a as y,d as w,r as x,h as D,n as S,j as e,L as l,Q as q}from"./index-BxETo_Fm.js";import{c as F,R as M}from"./RotatingEquiv-DyNyTpNy.js";import{C as h}from"./CountUp-Cw5TWdkr.js";import{F as n}from"./FadeContent-C5iyyIb_.js";import{u as P}from"./useTranslation-X387rOdZ.js";function L(){const{t:s}=P(),{user:i}=v(),{site:c}=y(),{symbol:u}=w(),[g,f]=x.useState([]),[b,N]=x.useState([]);x.useEffect(()=>{D().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{}),S().then(t=>{t.data.success&&N(t.data.data||[])}).catch(()=>{})},[]);const r=g.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-24",children:[e.jsx(n,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full border border-emerald-500/20 mb-8",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),e.jsx("span",{className:"text-xs text-emerald-400/80 font-medium tracking-wide",children:s("home.heroTagline")||"All Systems Operational"})]}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:s("home.getStarted")}),e.jsxs(l,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(n,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 border-t border-neutral-800 pt-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-emerald-400",children:[e.jsx(h,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),accent:"emerald"},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),accent:"cyan"},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),accent:"violet"}].map((t,a)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-neutral-800/60 last:border-0 group",children:[e.jsxs("span",{className:`text-sm font-mono text-${t.accent}-500/60 mt-0.5`,children:["0",a+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-white mb-1 group-hover:text-neutral-300 transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:t.desc})]})]},a))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-emerald-400 hover:text-emerald-300 transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-emerald-500/20 transition-colors group",children:e.jsx("span",{className:"text-sm text-neutral-400 font-mono group-hover:text-neutral-300 transition-colors truncate block",children:t.display_name||t.model_name})},Line truncated
-1
View File
@@ -1 +0,0 @@
import{u as N,a as v,d as y,r as m,h as E,n as w,j as e,L as l,Q as F}from"./index-BxETo_Fm.js";import{c as B,R as C}from"./RotatingEquiv-DyNyTpNy.js";import{C as h}from"./CountUp-Cw5TWdkr.js";import{F as i}from"./FadeContent-C5iyyIb_.js";import{u as q}from"./useTranslation-X387rOdZ.js";function A(){const{t:s}=q(),{user:n}=N(),{site:c}=v(),{symbol:u}=y(),[D,f]=m.useState([]),[b,g]=m.useState([]);m.useEffect(()=>{E().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{}),w().then(t=>{t.data.success&&g(t.data.data||[])}).catch(()=>{})},[]);const o=D.filter(t=>t.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-[#3D3024] leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-[#6B5D4F] mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:n?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:s("home.getStarted")}),e.jsxs(l,{to:"/pricing",className:"px-7 py-3 text-[#8B7D6E] font-medium text-sm hover:text-[#3D3024] transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 pt-10 border-t border-[#E8DDD0]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:[e.jsx(h,{from:0,to:o.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"bg-[#F5EEE6]",children:e.jsx("div",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc")},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc")},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc")}].map((t,a)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-[#E8DDD0] last:border-0 group",children:[e.jsxs("span",{className:"text-sm font-mono text-[#D97757]/50 mt-0.5",children:["0",a+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-[#3D3024] mb-1 group-hover:text-[#D97757] transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-[#6B5D4F] leading-relaxed max-w-lg",children:t.desc})]})]},a))})]})})}),o.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-[#8B7D6E]",children:s("home.availableModelsDesc",{count:o.length})})]}),o.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-[#D97757] hover:text-[#C4613F] transition-colors",children:[s("home.viewAllModels",{count:o.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:o.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-[#E8DDD0] hover:border-[#D9C5B2] transition-colors",children:e.jsx("span",{className:"text-sm text-[#6B5D4F] font-mono",children:t.display_name||t.model_name})},t.id||a))})]})}),b.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:b.filter(t=>t.enabled).slice(0,3).map((t,a)=>{conLine truncated
-1
View File
@@ -1 +0,0 @@
import{u as N,a as v,d as w,r as x,h as y,n as q,j as e,L as l,Q as D}from"./index-BxETo_Fm.js";import{c as M,R as S}from"./RotatingEquiv-DyNyTpNy.js";import{C as m}from"./CountUp-Cw5TWdkr.js";import{F as o}from"./FadeContent-C5iyyIb_.js";import{u as F}from"./useTranslation-X387rOdZ.js";function A(){const{t:s}=F(),{user:i}=N(),{site:c}=v(),{symbol:h}=w(),[p,g]=x.useState([]),[u,f]=x.useState([]);x.useEffect(()=>{y().then(t=>{t.data.success&&g(t.data.data||[])}).catch(()=>{}),q().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{})},[]);const r=p.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-24",children:[e.jsx(o,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.getStarted")," →"]}),e.jsx(l,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:s("home.viewPricing")})]})})]})}),e.jsx(o,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 border-t border-neutral-800 pt-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(m,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(m,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(m,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-6",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc")},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc")},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc")}].map((t,a)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-neutral-800/60 last:border-0 group",children:[e.jsxs("span",{className:"text-sm font-mono text-neutral-600 mt-0.5",children:["0",a+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-white mb-1 group-hover:text-neutral-300 transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:t.desc})]})]},a))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-neutral-400 hover:text-white transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:t.display_name||t.model_name})},t.id||a))})]})}),u.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:u.filter(t=>t.enabled).slice(0,3).map(t=>{const a=t.quota_amount>0?t.quota_aLine truncated
-1
View File
@@ -1 +0,0 @@
import{u as f,a as w,d as N,r as m,h as y,n as M,j as e,L as l,Q as k}from"./index-BxETo_Fm.js";import{c as D,R as q}from"./RotatingEquiv-DyNyTpNy.js";import{C as L}from"./CountUp-Cw5TWdkr.js";import{F as i}from"./FadeContent-C5iyyIb_.js";import{u as S}from"./useTranslation-X387rOdZ.js";function T(){const{t:s}=S(),{user:n}=f(),{site:c}=w(),{symbol:h}=N(),[j,g]=m.useState([]),[u,v]=m.useState([]);m.useEffect(()=>{y().then(t=>{t.data.success&&g(t.data.data||[])}).catch(()=>{}),M().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{})},[]);const o=j.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute -top-40 left-1/4 w-[600px] h-[600px] bg-violet-600/10 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute top-20 right-1/4 w-[400px] h-[400px] bg-blue-600/8 rounded-full blur-3xl"})]}),e.jsxs("section",{className:"relative max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("h1",{className:"text-5xl md:text-7xl font-heading font-extrabold text-white leading-[1.08] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl mx-auto",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:n?e.jsx(l,{to:"/dashboard",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.goToDashboard")}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.getStarted")}),e.jsx(l,{to:"/pricing",className:"px-8 py-3.5 rounded-2xl border border-white/15 text-white font-medium text-sm hover:bg-white/5 transition-all",children:s("home.viewPricing")})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsx("div",{className:"grid grid-cols-3 gap-6 max-w-xl mx-auto mt-24",children:[{value:o.length||50,suffix:"+",label:s("home.aiModels")},{value:99.9,suffix:"%",label:s("home.uptime")},{value:50,suffix:"ms",label:s("home.latency"),prefix:"<"}].map((t,a)=>e.jsxs("div",{className:"text-center p-5 rounded-2xl bg-white/[0.03] border border-white/[0.06]",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[t.prefix,e.jsx(L,{from:0,to:t.value,duration:2}),t.suffix]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.label})]},a))})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500",children:s("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),color:"violet",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),color:"blue",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),color:"cyan",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,a)=>e.jsxs("div",{className:"p-6 rounded-xl bg-white/[0.02] border border-white/[0.06] hover:border-white/[0.12] transition-colors",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg bg-${t.color}-500/10 text-${t.color}-400 flex items-center justify-center mb-4`,children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-white mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t.desc})]},a))})]})}),o.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.avLine truncated
-1
View File
@@ -1 +0,0 @@
import{u as f,a as v,d as w,r as m,h as M,n as q,j as e,L as a,Q as C}from"./index-BxETo_Fm.js";import{c as D,R as L}from"./RotatingEquiv-DyNyTpNy.js";import{C as h}from"./CountUp-Cw5TWdkr.js";import{F as i}from"./FadeContent-C5iyyIb_.js";import{u as P}from"./useTranslation-X387rOdZ.js";function T(){const{t:s}=P(),{user:n}=f(),{site:c}=v(),{symbol:u}=w(),[p,y]=m.useState([]),[g,N]=m.useState([]);m.useEffect(()=>{M().then(t=>{t.data.success&&y(t.data.data||[])}).catch(()=>{}),q().then(t=>{t.data.success&&N(t.data.data||[])}).catch(()=>{})},[]);const r=p.filter(t=>t.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("p",{className:"text-sm font-medium text-blue-600 mb-4 tracking-wide",children:s("home.heroTagline")||"AI API Platform"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-gray-900 leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-gray-500 mt-6 leading-relaxed max-w-xl mx-auto",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:s("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-gray-500 font-medium text-sm hover:text-gray-900 transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"grid grid-cols-3 gap-8 max-w-lg mx-auto mt-20 pt-10 border-t border-gray-100",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(h,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-3",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-gray-500",children:s("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),color:"blue",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),color:"indigo",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),color:"emerald",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,o)=>e.jsxs("div",{className:"p-6 rounded-xl border border-gray-100 hover:border-gray-200 hover:shadow-sm transition-all",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg bg-${t.color}-50 text-${t.color}-600 flex items-center justify-center mb-4`,children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:t.desc})]},o))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.Line truncated
-1
View File
@@ -1 +0,0 @@
import{u as N,a as w,d as y,r as m,h as M,n as S,j as e,L as a,Q as q}from"./index-BxETo_Fm.js";import{c as D,R as L}from"./RotatingEquiv-DyNyTpNy.js";import{C as h}from"./CountUp-Cw5TWdkr.js";import{F as l}from"./FadeContent-C5iyyIb_.js";import{u as P}from"./useTranslation-X387rOdZ.js";function T(){const{t:s}=P(),{user:i}=N(),{site:c}=w(),{symbol:u}=y(),[g,f]=m.useState([]),[b,v]=m.useState([]);m.useEffect(()=>{M().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{}),S().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{})},[]);const r=g.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[900px] h-[500px] bg-gradient-radial from-brand-600/15 to-transparent blur-3xl opacity-60"})}),e.jsxs("section",{className:"relative max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(l,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("p",{className:"text-sm font-medium text-brand-400 mb-4 tracking-wide uppercase",children:s("home.heroTagline")||"AI API Platform"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl mx-auto",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:i?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:s("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(l,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"grid grid-cols-3 gap-8 max-w-lg mx-auto mt-20 pt-10 border-t border-neutral-800/60",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(h,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500",children:s("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,n)=>e.jsxs("div",{className:"p-6 rounded-xl border border-neutral-800/60 hover:border-brand-500/25 transition-colors group",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-brand-500/10 text-brand-400 flex items-center justify-center mb-4",children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-white mb-2",children:t.title}),e.jsx("p",{className:"text-sm Line truncated
-1
View File
@@ -1 +0,0 @@
import{j as n}from"./index-BxETo_Fm.js";import{u as a}from"./useTranslation-X387rOdZ.js";function u({className:t=""}){var s;const{i18n:e}=a(),o=(s=e.language)==null?void 0:s.startsWith("zh"),r=()=>{e.changeLanguage(o?"en":"zh")};return n.jsxs("button",{onClick:r,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs transition-colors ${t}`,"aria-label":"Switch language",children:[n.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:[n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.6 9h16.8M3.6 15h16.8"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3a15.3 15.3 0 0 1 4 9 15.3 15.3 0 0 1-4 9 15.3 15.3 0 0 1-4-9 15.3 15.3 0 0 1 4-9Z"})]}),n.jsx("span",{children:o?"EN":"中文"})]})}export{u as L};
-1
View File
@@ -1 +0,0 @@
import{u as d,a as u,b as p,c as b,r as g,j as e,L as l,O as j}from"./index-BxETo_Fm.js";import{L as v}from"./LanguageSwitch-8SXPkAdj.js";import{u as f}from"./useTranslation-X387rOdZ.js";function L(){const{t:a}=f(),{user:n,logout:m}=d(),{site:t}=u(),h=p(),i=b(),[r,c]=g.useState(!1),o=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||n);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-neutral-950 text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"border-b border-neutral-800/60 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-neutral-400",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-lg bg-neutral-950/80 border-b border-neutral-800/40",children:[e.jsxs("div",{className:"max-w-5xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-2.5 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:o,className:"h-7 w-auto"}):e.jsx("span",{className:"text-base font-semibold text-white",children:o}),(t==null?void 0:t.logo)&&e.jsx("span",{className:"text-base font-semibold text-white",children:o})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-6",children:x.map(s=>e.jsx(l,{to:s.to,className:`text-sm transition-colors ${i.pathname===s.to?"text-white":"text-neutral-500 hover:text-white"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"text-neutral-500 hover:text-white hover:bg-white/5"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 hidden sm:block",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await m(),h("/")},className:"text-sm text-neutral-500 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-500 hover:text-white transition-colors hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"px-4 py-1.5 rounded-lg bg-white text-neutral-900 text-sm font-medium hover:bg-neutral-200 transition-colors",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1",onClick:()=>c(!r),children:e.jsx("svg",{className:"w-5 h-5 text-neutral-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-neutral-800/40 bg-neutral-950/95",children:e.jsx("nav",{className:"max-w-5xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded transition-colors ${i.pathname===s.to?"text-white":"text-neutral-500 hover:text-white"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(j,{})}),e.jsx("footer",{className:"border-t border-neutral-800/40 mt-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-3",children:[e.jsxs("p",{className:"text-xs text-neutral-600",children:["© ",new Date().getFullYear()," ",o]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-white transition-colors",children:a("nav.contact")})]})})]})}export{L as default};
-1
View File
@@ -1 +0,0 @@
import{u as h,a as u,b as p,c as b,r as f,j as e,L as s,O as g}from"./index-BxETo_Fm.js";import{L as j}from"./LanguageSwitch-8SXPkAdj.js";import{u as v}from"./useTranslation-X387rOdZ.js";function L(){const{t:a}=v(),{user:l,logout:i}=h(),{site:t}=u(),x=p(),m=b(),[n,d]=f.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",c=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(o=>!o.auth||l);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#030712] text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-emerald-500/5 border-b border-emerald-500/10 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-emerald-300/80 font-mono",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-[#030712]/80 border-b border-emerald-500/[0.08]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-7 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-400 font-bold font-mono text-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-base font-semibold text-emerald-400 font-mono group-hover:text-emerald-300 transition-colors tracking-wide",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:c.map(o=>e.jsx(s,{to:o.to,className:`px-3 py-1.5 text-sm font-mono rounded transition-all ${m.pathname===o.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:o.label},o.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-500 hover:text-emerald-400 hover:bg-emerald-500/5 font-mono"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 font-mono hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await i(),x("/")},className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(s,{to:"/login",className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors hidden sm:block px-3 py-1.5",children:a("nav.login")}),e.jsx(s,{to:"/register",className:"px-4 py-1.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-sm font-mono hover:bg-emerald-500/15 transition-all",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded hover:bg-white/5",onClick:()=>d(!n),children:e.jsx("svg",{className:"w-5 h-5 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),n&&e.jsx("div",{className:"md:hidden border-t border-emerald-500/[0.08] bg-[#030712]/95 backdrop-blur-xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:c.map(o=>e.jsx(s,{to:o.to,onClick:()=>d(!1),className:`px-3 py-2 text-sm font-mono rounded transition-colors ${m.pathname===o.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:o.label},o.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(g,{})}),e.jsx("footer",{className:"border-t border-emerald-500/[0.08] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-xs text-neutral-600 font-mono",children:["© ",new Date().getFullYear()," ",r]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-emerald-400 font-mono transition-colors",children:a("nav.contact")})]})})]})}export{L as default};
-1
View File
@@ -1 +0,0 @@
import{u as h,a as u,b,c as p,r as g,j as e,L as l,O as v}from"./index-BxETo_Fm.js";import{L as f}from"./LanguageSwitch-8SXPkAdj.js";import{u as j}from"./useTranslation-X387rOdZ.js";function L(){const{t:a}=j(),{user:o,logout:d}=h(),{site:t}=u(),m=b(),i=p(),[r,c]=g.useState(!1),n=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||o);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#09090b]",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-gradient-to-r from-violet-600/10 via-blue-600/10 to-cyan-600/10 border-b border-white/[0.06] text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-neutral-300",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-2xl bg-[#09090b]/80 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:n,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-violet-500 via-blue-500 to-cyan-500 flex items-center justify-center text-white font-bold text-sm shadow-lg shadow-blue-500/20",children:n.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-blue-400 transition-colors",children:n})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1 bg-white/[0.04] rounded-full px-1.5 py-1 border border-white/[0.06]",children:x.map(s=>e.jsx(l,{to:s.to,className:`px-4 py-1.5 text-sm rounded-full transition-all ${i.pathname===s.to?"text-white bg-white/[0.08]":"text-neutral-400 hover:text-white"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),o?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:o.display_name||o.username}),e.jsx("button",{onClick:async()=>{await d(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-400 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"px-5 py-2 rounded-full bg-white text-black text-sm font-medium hover:bg-neutral-100 transition-all",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-[#09090b]/95 backdrop-blur-2xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-blue-400 bg-blue-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto bg-[#09090b]",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",n,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:a("nav.contact")})})]})})]})}export{L as default};
-1
View File
@@ -1 +0,0 @@
import{u as h,a as u,b as p,c as b,r as g,j as e,L as l,O as v}from"./index-BxETo_Fm.js";import{L as j}from"./LanguageSwitch-8SXPkAdj.js";import{u as f}from"./useTranslation-X387rOdZ.js";function M(){const{t:a}=f(),{user:n,logout:o}=h(),{site:t}=u(),m=p(),x=b(),[i,c]=g.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",d=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||n);return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-brand-600/20 border-b border-brand-500/20 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-brand-200",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-black/60 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-8 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-brand-500 to-purple-600 flex items-center justify-center text-white font-bold text-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-brand-400 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:d.map(s=>e.jsx(N,{to:s.to,active:x.pathname===s.to,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await o(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-300 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"btn-primary text-sm !px-4 !py-1.5",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!i),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),i&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-black/90 backdrop-blur-xl",children:e.jsxs("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:[d.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${x.pathname===s.to?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:s.label},s.to)),!n&&e.jsx(l,{to:"/login",onClick:()=>c(!1),className:"px-3 py-2 text-sm text-neutral-400 hover:text-white rounded-lg hover:bg-white/5 transition-colors sm:hidden",children:a("nav.login")})]})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",r,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:a("nav.contact")})})]})})]})}function N({to:a,children:n,active:o}){return e.jsx(l,{to:a,className:`px-3 py-1.5 text-sm rounded-lg transition-all ${o?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:n})}export{M as default};
-1
View File
@@ -1 +0,0 @@
import{u as h,a as g,b as u,c as b,r as p,j as e,L as o,O as v}from"./index-BxETo_Fm.js";import{L as j}from"./LanguageSwitch-8SXPkAdj.js";import{u as y}from"./useTranslation-X387rOdZ.js";function L(){const{t:a}=y(),{user:l,logout:m}=h(),{site:t}=g(),d=u(),i=b(),[n,c]=p.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||l);return e.jsxs("div",{className:"theme-light min-h-screen flex flex-col bg-white text-gray-900",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-blue-50 border-b border-blue-100 text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-blue-700",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-white/80 backdrop-blur-xl border-b border-gray-100",children:[e.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-blue-600 to-indigo-600 flex items-center justify-center text-white font-bold text-sm shadow-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(s=>e.jsx(o,{to:s.to,className:`px-3.5 py-2 text-sm rounded-lg transition-all ${i.pathname===s.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-gray-400 hover:text-gray-700 hover:bg-gray-50"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-gray-500 hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-gray-400 hover:text-gray-700 transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-gray-500 hover:text-gray-900 px-3 py-2 hidden sm:block transition-colors",children:a("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-lg bg-blue-600 text-white text-sm font-medium hover:bg-blue-700 transition-colors shadow-sm",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-gray-50 transition-colors",onClick:()=>c(!n),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),n&&e.jsx("div",{className:"md:hidden border-t border-gray-100 bg-white",children:e.jsx("nav",{className:"max-w-6xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(o,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2.5 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-gray-100 mt-auto bg-gray-50/50",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-gray-400",children:["© ",new Date().getFullYear()," ",r,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-gray-400 hover:text-gray-600 transition-colors",children:a("nav.contact")})})]})})]})}export{L as default};
-1
View File
@@ -1 +0,0 @@
import{u as h,a as u,b as p,c as g,r as b,j as e,L as o,O as j}from"./index-BxETo_Fm.js";import{L as v}from"./LanguageSwitch-8SXPkAdj.js";import{u as f}from"./useTranslation-X387rOdZ.js";function L(){const{t:s}=f(),{user:n,logout:m}=h(),{site:t}=u(),d=p(),i=g(),[r,c]=b.useState(!1),l=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:s("nav.home"),auth:!1},{to:"/pricing",label:s("nav.pricing"),auth:!1},{to:"/packages",label:s("nav.packages"),auth:!1},{to:"/dashboard",label:s("nav.dashboard"),auth:!0},{to:"/tokens",label:s("nav.apiKeys"),auth:!0},{to:"/logs",label:s("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||n);return e.jsxs("div",{className:"theme-light min-h-screen flex flex-col bg-white text-gray-900",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-slate-900 text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-slate-200",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-white border-b border-gray-200",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 lg:px-8 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:l,className:"h-8 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-900 flex items-center justify-center text-white font-bold text-sm",children:l.charAt(0)}),e.jsx("span",{className:"text-lg font-bold text-slate-900 tracking-tight",children:l})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-0.5",children:x.map(a=>e.jsx(o,{to:a.to,className:`px-4 py-2 text-sm font-medium transition-colors ${i.pathname===a.to?"text-slate-900 border-b-2 border-slate-900":"text-slate-500 hover:text-slate-900"}`,children:a.label},a.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"text-slate-400 hover:text-slate-700 hover:bg-slate-50"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-slate-600 hidden sm:block font-medium",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-slate-400 hover:text-slate-700 transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-slate-600 hover:text-slate-900 px-3 py-2 hidden sm:block transition-colors font-medium",children:s("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-lg bg-slate-900 text-white text-sm font-medium hover:bg-slate-800 transition-colors",children:s("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-slate-50 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-slate-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-gray-200 bg-white",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col",children:x.map(a=>e.jsx(o,{to:a.to,onClick:()=>c(!1),className:`px-4 py-3 text-sm font-medium border-b border-gray-100 last:border-0 transition-colors ${i.pathname===a.to?"text-slate-900 bg-slate-50":"text-slate-500 hover:text-slate-900"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(j,{})}),e.jsx("footer",{className:"border-t border-gray-200 mt-auto bg-white",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8 py-10",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-bold text-slate-900 tracking-tight",children:l}),e.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:["© ",new Date().getFullYear()," ",l,". All rights reserved."]})]}),e.jsx("div",{className:"flex items-center gap-6",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-slate-400 hover:text-slate-600 transition-colors",children:s("nav.contact")})})]})})})]})}export{L as default};
-1
View File
@@ -1 +0,0 @@
import{u as h,a as u,b as p,c as g,r as b,j as e,L as o,O as D}from"./index-BxETo_Fm.js";import{L as v}from"./LanguageSwitch-8SXPkAdj.js";import{u as f}from"./useTranslation-X387rOdZ.js";function w(){const{t:a}=f(),{user:l,logout:m}=h(),{site:t}=u(),d=p(),i=g(),[r,c]=b.useState(!1),n=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||l);return e.jsxs("div",{className:"theme-light theme-claude min-h-screen flex flex-col bg-[#FAF6F1] text-[#3D3024]",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-[#D97757] text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-white font-medium",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-[#FAF6F1]/85 backdrop-blur-xl border-b border-[#E8DDD0]",children:[e.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:n,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-2xl bg-gradient-to-br from-[#D97757] to-[#C4613F] flex items-center justify-center text-white font-bold text-sm shadow-sm",children:n.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-[#3D3024] group-hover:text-[#D97757] transition-colors",children:n})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(s=>e.jsx(o,{to:s.to,className:`px-3.5 py-2 text-sm rounded-lg transition-all ${i.pathname===s.to?"text-[#D97757] bg-[#D97757]/8 font-medium":"text-[#6B5D4F] hover:text-[#3D3024] hover:bg-[#E8DDD0]/50"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{className:"text-[#8B7D6E] hover:text-[#3D3024] hover:bg-[#E8DDD0]/50"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[#6B5D4F] hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-[#8B7D6E] hover:text-[#3D3024] transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-[#6B5D4F] hover:text-[#3D3024] px-3 py-2 hidden sm:block transition-colors",children:a("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-full bg-[#D97757] text-white text-sm font-medium hover:bg-[#C4613F] transition-colors shadow-sm",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-[#E8DDD0]/50 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-[#6B5D4F]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-[#E8DDD0] bg-[#FAF6F1]",children:e.jsx("nav",{className:"max-w-6xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(o,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2.5 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-[#D97757] bg-[#D97757]/8 font-medium":"text-[#6B5D4F] hover:text-[#3D3024] hover:bg-[#E8DDD0]/50"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(D,{})}),e.jsx("footer",{className:"border-t border-[#E8DDD0] mt-auto bg-[#F5EEE6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-[#8B7D6E]",children:["© ",new Date().getFullYear()," ",n,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-[#8B7D6E] hover:text-[#D97757] transition-colors",children:a("nav.contact")})})]})})]})}export{w as default};
-1
View File
@@ -1 +0,0 @@
import{u as v,a as w,b as y,c as k,r as p,j as e,N as L,L as S,z as x}from"./index-BxETo_Fm.js";import{u as C}from"./useTranslation-X387rOdZ.js";function A(){var c,m;const{t:s}=C(),{login:g,user:h}=v(),{site:n}=w(),f=y(),l=k(),[t,o]=p.useState({username:"",password:""}),[r,i]=p.useState(!1);if(h){const a=((m=(c=l.state)==null?void 0:c.from)==null?void 0:m.pathname)||"/dashboard";return e.jsx(L,{to:a,replace:!0})}const b=async a=>{var u,d;if(a.preventDefault(),!t.username||!t.password){x.error(s("login.fillAllFields"));return}i(!0);try{if((await g(t.username,t.password)).success){x.success(s("login.welcomeBackToast"));const N=((d=(u=l.state)==null?void 0:u.from)==null?void 0:d.pathname)||"/dashboard";f(N,{replace:!0});return}}catch{}i(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-2",children:s("login.welcomeBack")}),e.jsx("p",{className:"text-sm text-page-secondary",children:n!=null&&n.name?s("login.signInTo",{name:n.name}):s("login.signInToDefault")})]}),e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:s("login.username")}),e.jsx("input",{type:"text",value:t.username,onChange:a=>o({...t,username:a.target.value}),className:"input",placeholder:s("login.enterUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:s("login.password")}),e.jsx("input",{type:"password",value:t.password,onChange:a=>o({...t,password:a.target.value}),className:"input",placeholder:s("login.enterPassword"),autoComplete:"current-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:r,className:"btn-primary w-full flex items-center justify-center gap-2",children:[r&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(r?"login.signingIn":"login.signInBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-page-secondary",children:[s("login.noAccount")," ",e.jsx(S,{to:"/register",className:"text-page-link hover:text-page-link transition-colors font-medium",children:s("login.createOne")})]})})]})})})}export{A as default};
-1
View File
@@ -1 +0,0 @@
import{d as S,r as l,B as $,j as e,Q as b}from"./index-BxETo_Fm.js";import{u as F}from"./useTranslation-X387rOdZ.js";function v(s){if(!s)return"-";const a=new Date(s*1e3),n=i=>String(i).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())} ${n(a.getHours())}:${n(a.getMinutes())}:${n(a.getSeconds())}`}function L(){const{t:s}=F(),{symbol:a,rate:n}=S(),[i,k]=l.useState([]),[p,w]=l.useState(0),[d,x]=l.useState(1),[_,j]=l.useState(!0),[h,f]=l.useState(""),[g,y]=l.useState(""),m=20,N=l.useCallback(async()=>{var t,r;j(!0);try{const o={p:d,page_size:m,type:2};h&&(o.model_name=h),g&&(o.token_name=g);const c=await $(o);c.data.success&&(k(((t=c.data.data)==null?void 0:t.items)||[]),w(((r=c.data.data)==null?void 0:r.total)||0))}catch{}j(!1)},[d,h,g]);l.useEffect(()=>{N()},[N]);const u=Math.max(1,Math.ceil(p/m));return e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-1",children:s("logs.title")}),e.jsx("p",{className:"text-sm text-page-secondary",children:s("logs.subtitle")})]}),e.jsx("div",{className:"glass rounded-2xl p-4 mb-6",children:e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx("div",{className:"flex-1 min-w-[180px]",children:e.jsx("input",{type:"text",value:h,onChange:t=>{f(t.target.value),x(1)},className:"input w-full",placeholder:s("logs.filterModel")})}),e.jsx("div",{className:"flex-1 min-w-[180px]",children:e.jsx("input",{type:"text",value:g,onChange:t=>{y(t.target.value),x(1)},className:"input w-full",placeholder:s("logs.filterToken")})}),e.jsx("button",{onClick:()=>{f(""),y(""),x(1)},className:"btn-secondary text-sm",children:s("logs.clearFilter")})]})}),e.jsx("div",{className:"glass rounded-2xl overflow-hidden",children:_?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):i.length===0?e.jsx("div",{className:"text-center py-16 text-page-secondary",children:e.jsx("p",{children:s("logs.noLogs")})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-page-divider",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium text-page-secondary",children:s("logs.time")}),e.jsx("th",{className:"text-left px-4 py-3 font-medium text-page-secondary",children:s("logs.model")}),e.jsx("th",{className:"text-left px-4 py-3 font-medium text-page-secondary",children:s("logs.token")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.promptTokens")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.completionTokens")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.cost")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.duration")})]})}),e.jsx("tbody",{children:i.map((t,r)=>{var o,c;return e.jsxs("tr",{className:"border-b border-page-divider last:border-0 hover:bg-page-surface transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-page-secondary text-xs whitespace-nowrap",children:v(t.created_at)}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"font-mono text-xs text-page",children:t.model_name||"-"})}),e.jsx("td",{className:"px-4 py-3 text-xs text-page-secondary",children:t.token_name||"-"}),e.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs text-page-label",children:((o=t.prompt_tokens)==null?void 0:o.toLocaleString())||"0"}),e.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs text-page-label",children:((c=t.completion_tokens)==null?void 0:c.toLocaleString())||"0"}),e.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs text-page-warning",children:t.quota>0?`${a}${(t.quota/b*n).toFixed(6)}`:"-"}),e.jsx("td",{className:"px-4 py-3 text-right text-xs text-page-secondary",children:t.use_time>0?`${t.use_time}s`:"-"})]},r)})})]})}),e.jsx("div",{className:"md:hidden divide-y divide-page-divider",children:i.map((t,r)=>e.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs text-page font-medium",children:t.model_name||"-"}),e.jsx("span",{className:"font-mono text-xs text-page-warning",children:t.quota>0?`${a}${(t.quota/b*n).toFixed(6)}`:"-"})]}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-page-secondary",children:[e.jsx("span",{children:v(t.created_at)}),e.jsxs("span",{children:[t.prompt_tokens||0," / ",t.completion_tokens||0," tokens"]})]}),t.token_name&&e.jsx("div",{className:"text-[11px] text-page-muted",children:t.token_name})]},r))})]})}),p>m&&e.jsxs("div",{className:"flex items-cenLine truncated
-1
View File
@@ -1 +0,0 @@
import{u as R,b as W,d as z,r,n as I,h as T,o as w,j as e,Q as x,L as U,s as $,z as S}from"./index-BxETo_Fm.js";import{c as K,R as O}from"./RotatingEquiv-DyNyTpNy.js";import{u as G}from"./useTranslation-X387rOdZ.js";const _={never:"packages.resetNever",daily:"packages.resetDaily",weekly:"packages.resetWeekly",monthly:"packages.resetMonthly"};function L(a){return a?new Date(a*1e3).toLocaleDateString():""}function X(){const{t:a}=G(),{user:o,refreshUser:q}=R(),M=W(),{symbol:p,rate:m}=z(),[P,C]=r.useState([]),[b,F]=r.useState([]),[D,E]=r.useState(!0),[u,j]=r.useState(null),[N,v]=r.useState([]),[l,g]=r.useState(null),f=s=>a(_[s]||_.never);r.useEffect(()=>{Promise.all([I().then(s=>{s.data.success&&C(s.data.data||[])}).catch(()=>{}),T().then(s=>{s.data.success&&F(s.data.data||[])}).catch(()=>{})]).finally(()=>E(!1))},[]),r.useEffect(()=>{o&&w().then(s=>{s.data.success&&v(s.data.data||[])}).catch(()=>{})},[o]);const B=async s=>{if(!o){M("/register");return}g(s)},A=async()=>{if(!l)return;const s=l.id;j(s);try{const n=await $(s);n.data.success?(S.success(a("packages.subscribedSuccess")),g(null),await q(),w().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{})):S.error(n.data.message||a("common.requestFailed"))}catch{}j(null)},Q=r.useMemo(()=>b.filter(s=>s.enabled!==!1),[b]);if(D)return e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})});const k=P.filter(s=>s.enabled);return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-3xl font-heading font-bold text-page mb-3",children:a("packages.title")}),e.jsx("p",{className:"text-page-secondary max-w-xl mx-auto",children:a("packages.subtitle")})]}),N.length>0&&e.jsxs("div",{className:"max-w-3xl mx-auto mb-10",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:a("packages.mySubscriptions")}),e.jsx("div",{className:"space-y-3",children:N.map(s=>{const n=s.amount_total||0,t=s.amount_used||0,i=Math.max(0,n-t),d=n>0?Math.min(100,t/n*100):0;return e.jsxs("div",{className:"glass rounded-xl p-4 border border-page-divider",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-page",children:a("packages.subscriptionId",{id:s.id})}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-green-500/10 text-page-success border border-green-500/20",children:a("packages.active")})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-page-secondary mb-3",children:[e.jsxs("span",{children:[a("packages.expires"),": ",L(s.end_time)]}),s.next_reset_time>0&&e.jsxs("span",{children:[a("packages.nextReset"),": ",L(s.next_reset_time)]})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("div",{className:"flex-1 h-2 bg-page-surface rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-brand-500 to-purple-500 transition-all",style:{width:`${d}%`}})}),e.jsxs("span",{className:"text-xs text-page-secondary whitespace-nowrap",children:[p,(i/x*m).toFixed(2)," / ",p,(n/x*m).toFixed(2)]})]})]},s.id)})})]}),k.length===0?e.jsxs("div",{className:"text-center py-12 text-page-secondary",children:[e.jsx("p",{children:a("packages.noPackages")}),e.jsxs(U,{to:"/pricing",className:"text-page-link hover:text-page-link transition-colors mt-2 inline-block",children:[a("packages.checkPricing")," →"]})]}):e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-5xl mx-auto",children:k.map((s,n)=>{const t=s.quota_reset_period||"never",i=t!=="never",d=s.quota_amount>0?s.quota_amount/x:0;let h=d;if(i&&s.duration>0&&d>0){let c=1;t==="daily"?c=s.duration:t==="weekly"?c=Math.floor(s.duration/7):t==="monthly"&&(c=Math.floor(s.duration/30)),c<1&&(c=1),h=d*c}const y=K(Q,h);return e.jsx("div",{className:"glass rounded-2xl flex flex-col",children:e.jsxs("div",{className:"p-6 flex-1 flex flex-col",children:[e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-xl font-semibold text-page",children:s.name}),i&&e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-purple-500/10 text-page-info border border-purple-500/20",children:f(t)})]}),s.description&&e.jsx("p",{className:"text-sm text-page-secondary mt-1",children:s.description})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-4xl font-bold text-page",children:[p,Number(s.price).toFixed(2)]}),s.original_price>0&&s.original_price>s.price&&e.jsxs("span",{className:"text-lg text-page-muted line-through",children:[p,Number(s.original_price).toFixed(2)]})]}),s.duration>0&&e.jsx("p",{className:"text-sm text-page-muted mt-1",children:a("packages.daysAccess",{count:Line truncated
-1
View File
@@ -1 +0,0 @@
import{d as N,r as n,h as v,j as t}from"./index-BxETo_Fm.js";import{u as w}from"./useTranslation-X387rOdZ.js";function S(){const{t:s}=w(),{symbol:d,rate:c}=N(),[h,g]=n.useState([]),[x,f]=n.useState([]),[l,b]=n.useState(""),[r,p]=n.useState(""),[j,y]=n.useState(!0);n.useEffect(()=>{v().then(e=>{e.data.success&&(g(e.data.data||[]),f(e.data.vendors||[]))}).catch(()=>{}).finally(()=>y(!1))},[]);const i=h.filter(e=>e.enabled!==!1),m=n.useMemo(()=>{const e=new Set(i.map(a=>a.vendor_name).filter(Boolean));return x.filter(a=>e.has(a.name))},[i,x]),u=n.useMemo(()=>{let e=i;if(r&&(e=e.filter(a=>a.vendor_name===r)),l){const a=l.toLowerCase();e=e.filter(o=>(o.display_name||o.model_name||"").toLowerCase().includes(a))}return e=[...e].sort((a,o)=>(Number(a.input_price)||0)-(Number(o.input_price)||0)),e},[i,r,l]);return j?t.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:t.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):t.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[t.jsxs("div",{className:"text-center mb-10",children:[t.jsx("h1",{className:"text-3xl font-heading font-bold text-page mb-3",children:s("pricing.title")}),t.jsx("p",{className:"text-page-secondary max-w-xl mx-auto",children:s("pricing.subtitle")})]}),m.length>0&&t.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mb-6",children:[t.jsx("button",{onClick:()=>p(""),className:`inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-sm font-medium transition-all ${r?"glass-sm text-page-secondary hover:text-page hover:bg-page-surface-hover":"bg-brand-500 text-white shadow-lg shadow-brand-500/25"}`,children:s("pricing.allVendors")}),m.map(e=>t.jsx("button",{onClick:()=>p(e.name),className:`inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-sm font-medium transition-all ${r===e.name?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-page-secondary hover:text-page hover:bg-page-surface-hover"}`,children:e.name},e.id))]}),t.jsx("div",{className:"max-w-md mx-auto mb-8",children:t.jsxs("div",{className:"relative",children:[t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-page-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{type:"text",value:l,onChange:e=>b(e.target.value),className:"input !pl-10",placeholder:s("pricing.searchPlaceholder")})]})}),u.length===0?t.jsx("div",{className:"text-center py-12 text-page-secondary",children:s(l||r?"pricing.noMatch":"pricing.noModels")}):t.jsx("div",{className:"glass-sm rounded-xl overflow-hidden",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-page-divider",children:[t.jsx("th",{className:"text-left px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.model")}),t.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.inputPrice")}),t.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.outputPrice")}),t.jsx("th",{className:"text-center px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.status")})]})}),t.jsx("tbody",{children:u.map((e,a)=>t.jsxs("tr",{className:"border-b border-page-divider last:border-0 hover:bg-page-surface transition-colors",children:[t.jsx("td",{className:"px-5 py-3.5",children:t.jsx("span",{className:"font-mono text-page",children:e.display_name||e.model_name})}),t.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:e.input_price!=null?`${d}${(Number(e.input_price)*1e3*c).toFixed(4)}`:"-"}),t.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:e.output_price!=null?`${d}${(Number(e.output_price)*1e3*c).toFixed(4)}`:"-"}),t.jsx("td",{className:"px-5 py-3.5 text-center",children:t.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs border ${e.status==="healthy"?"bg-green-500/10 text-page-success border-green-500/20":"bg-page-surface text-page-secondary border-page-divider"}`,children:[t.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${e.status==="healthy"?"bg-green-500":"bg-neutral-500"}`}),e.status==="healthy"?s("pricing.online"):s("pricing.unknown")]})})]},e.model_name||a))})]})})]})}export{S as default};
-1
View File
@@ -1 +0,0 @@
import{u as x,a as h,b as w,r as c,j as e,N as f,L as b,z as a}from"./index-BxETo_Fm.js";import{u as j}from"./useTranslation-X387rOdZ.js";function y(){const{t:s}=j(),{register:d,user:m}=x(),{site:l}=h(),u=w(),[r,i]=c.useState({username:"",password:"",password2:"",email:""}),[n,o]=c.useState(!1);if(m)return e.jsx(f,{to:"/dashboard",replace:!0});const p=async t=>{if(t.preventDefault(),!r.username||!r.password){a.error(s("register.fillRequired"));return}if(r.password!==r.password2){a.error(s("register.passwordMismatch"));return}if(r.password.length<8){a.error(s("register.passwordLength"));return}if(r.password.length>20){a.error(s("register.passwordLength"));return}o(!0);try{if((await d({username:r.username,password:r.password,email:r.email||void 0})).success){a.success(s("register.accountCreated")),u("/login",{replace:!0});return}}catch{}o(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-2",children:s("register.createAccount")}),e.jsx("p",{className:"text-sm text-page-secondary",children:l!=null&&l.name?s("register.getStartedWith",{name:l.name}):s("register.getStartedDefault")})]}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:[s("register.username")," *"]}),e.jsx("input",{type:"text",value:r.username,onChange:t=>i({...r,username:t.target.value}),className:"input",placeholder:s("register.chooseUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:s("register.email")}),e.jsx("input",{type:"email",value:r.email,onChange:t=>i({...r,email:t.target.value}),className:"input",placeholder:s("register.emailPlaceholder"),autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:[s("register.password")," *"]}),e.jsx("input",{type:"password",value:r.password,onChange:t=>i({...r,password:t.target.value}),className:"input",placeholder:s("register.passwordPlaceholder"),autoComplete:"new-password",required:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:[s("register.confirmPassword")," *"]}),e.jsx("input",{type:"password",value:r.password2,onChange:t=>i({...r,password2:t.target.value}),className:"input",placeholder:s("register.repeatPassword"),autoComplete:"new-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:n,className:"btn-primary w-full flex items-center justify-center gap-2",children:[n&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(n?"register.creating":"register.createAccountBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-page-secondary",children:[s("register.hasAccount")," ",e.jsx(b,{to:"/login",className:"text-page-link hover:text-page-link transition-colors font-medium",children:s("register.signIn")})]})})]})})})}export{y as default};
-1
View File
@@ -1 +0,0 @@
import{r as s,j as P}from"./index-BxETo_Fm.js";const c=[{pattern:"claude-opus-4-5",label:"Claude Opus 4.5",inputPerMtok:5},{pattern:"claude-opus-4-6",label:"Claude Opus 4.6",inputPerMtok:5},{pattern:"claude-opus-4-1",label:"Claude Opus 4.1",inputPerMtok:15},{pattern:"claude-opus-4",label:"Claude Opus 4",inputPerMtok:15},{pattern:"claude-3-opus",label:"Claude 3 Opus",inputPerMtok:15},{pattern:"claude-sonnet-4-5",label:"Claude Sonnet 4.5",inputPerMtok:3},{pattern:"claude-sonnet-4-6",label:"Claude Sonnet 4.6",inputPerMtok:3},{pattern:"claude-sonnet-4",label:"Claude Sonnet 4",inputPerMtok:3},{pattern:"claude-3-7-sonnet",label:"Claude 3.7 Sonnet",inputPerMtok:3},{pattern:"claude-3-5-sonnet",label:"Claude 3.5 Sonnet",inputPerMtok:3},{pattern:"claude-haiku-4-5",label:"Claude Haiku 4.5",inputPerMtok:1},{pattern:"claude-3-5-haiku",label:"Claude 3.5 Haiku",inputPerMtok:.8},{pattern:"claude-3-haiku",label:"Claude 3 Haiku",inputPerMtok:.25},{pattern:"gpt-4o-mini",label:"GPT-4o Mini",inputPerMtok:.15},{pattern:"gpt-4o-2024-05-13",label:"GPT-4o",inputPerMtok:5},{pattern:"chatgpt-4o-latest",label:"GPT-4o",inputPerMtok:5},{pattern:"gpt-4o",label:"GPT-4o",inputPerMtok:2.5},{pattern:"gpt-4.1-mini",label:"GPT-4.1 Mini",inputPerMtok:.4},{pattern:"gpt-4.1-nano",label:"GPT-4.1 Nano",inputPerMtok:.1},{pattern:"gpt-4.1",label:"GPT-4.1",inputPerMtok:2},{pattern:"gpt-5.4",label:"GPT-5.4",inputPerMtok:2.5},{pattern:"gpt-5.3",label:"GPT-5.3",inputPerMtok:1.75},{pattern:"gpt-5.2",label:"GPT-5.2",inputPerMtok:1.75},{pattern:"gpt-5.1",label:"GPT-5.1",inputPerMtok:1.25},{pattern:"gemini-2.5-flash-lite",label:"Gemini 2.5 Flash Lite",inputPerMtok:.04},{pattern:"gemini-2.5-flash",label:"Gemini 2.5 Flash",inputPerMtok:.15},{pattern:"gemini-2.5-pro",label:"Gemini 2.5 Pro",inputPerMtok:1.25},{pattern:"gemini-2.0-flash",label:"Gemini 2.0 Flash",inputPerMtok:.1},{pattern:"gemini-1.5-pro",label:"Gemini 1.5 Pro",inputPerMtok:1.25},{pattern:"gemini-1.5-flash",label:"Gemini 1.5 Flash",inputPerMtok:.075},{pattern:"deepseek-r1",label:"DeepSeek R1",inputPerMtok:.55},{pattern:"deepseek-chat",label:"DeepSeek V3",inputPerMtok:.27},{pattern:"deepseek-v3",label:"DeepSeek V3",inputPerMtok:.27}];function b(e,r){if(!e||e.length===0||r<=0)return[];const l={};for(const t of e){const n=Number(t.input_price);if(!n||n<=0)continue;const o=(t.model_name||"").toLowerCase();for(const a of c)if(o.includes(a.pattern.toLowerCase())){const p=n*1e3,u=a.inputPerMtok/p,i=r*u;i>r&&(!l[a.label]||i>l[a.label])&&(l[a.label]=i);break}}return Object.entries(l).map(([t,n])=>({label:t,equivDollars:Math.round(n)})).sort((t,n)=>n.equivDollars-t.equivDollars).slice(0,3)}function M({items:e,text:r,className:l="",interval:t=3e3}){const[n,o]=s.useState(0),[a,p]=s.useState(!0);return s.useEffect(()=>{if(e.length<=1)return;const u=setInterval(()=>{p(!1),setTimeout(()=>{o(i=>(i+1)%e.length),p(!0)},300)},t);return()=>clearInterval(u)},[e.length,t]),!e||e.length===0?null:P.jsx("span",{className:`inline-block transition-all duration-300 ${a?"opacity-100 translate-y-0":"opacity-0 translate-y-1"} ${l}`,children:r(e[n])})}export{M as R,b as c};
-73
View File
@@ -1,73 +0,0 @@
import{r as o,f as R,h as z,j as e,z as S,i as G,k as P,l as W,m as U}from"./index-BxETo_Fm.js";import{u as I}from"./useTranslation-X387rOdZ.js";const V=()=>{var b;const{t}=I(),[h,_]=o.useState([]),[l,j]=o.useState(null),[c,v]=o.useState([]),[r,N]=o.useState(""),[d,w]=o.useState("claudecode"),[C,M]=o.useState(!0),[K,g]=o.useState(!1),[y,f]=o.useState(""),[k,m]=o.useState(!1),L=o.useRef(null),x=window.location.origin,u=[{id:"claudecode",name:"Claude Code",path:"~/.claude/settings.json"},{id:"openclaw",name:"OpenClaw",path:"~/.openclaw/openclaw.json"},{id:"opencode",name:"OpenCode",path:"~/.config/opencode/opencode.json"},{id:"cursor",name:"Cursor",path:"Settings → Models → OpenAI API Key"},{id:"curl",name:"cURL",path:"Terminal"},{id:"python",name:"Python SDK",path:"main.py"},{id:"anthropic",name:"Anthropic SDK",path:"main.py"}];o.useEffect(()=>{A()},[]),o.useEffect(()=>{l&&H(l)},[l]),o.useEffect(()=>{const s=a=>{L.current&&!L.current.contains(a.target)&&m(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const A=async()=>{M(!0);try{const s=await R();if(s.data.success){const a=s.data.data||[];_(a),a.length>0&&j(a[0])}}catch{}M(!1)},H=async s=>{try{if(s.model_limits_enabled&&s.model_limits){const n=s.model_limits.split(",").filter(i=>i.trim());v(n),n.length>0&&N(n[0]);return}const a=await z();if(a.data.success&&a.data.data){const i=(Array.isArray(a.data.data)?a.data.data:a.data.data.items||[]).map(p=>p.model_name||p.id||p);v(i),i.length>0&&N(i[0])}}catch{}},D=s=>{const a=s.toLowerCase();return a.includes("claude")?{provider:"anthropic",api:"anthropic-messages"}:a.includes("gpt")||a.includes("o1")||a.includes("o3")?{provider:"openai",api:"openai-chat"}:a.includes("gemini")?{provider:"google",api:"google-chat"}:{provider:"openai",api:"openai-chat"}},$=()=>{if(!l||!r)return"";const s="sk-"+l.key;switch(d){case"claudecode":return`{
"env": {
"ANTHROPIC_API_KEY": "${s}",
"ANTHROPIC_BASE_URL": "${x}/",
"ANTHROPIC_MODEL": "${r}"
}
}`;case"openclaw":{const a=D(r);return`{
"provider": "${a.provider}",
"base_url": "${x}/",
"api": "${a.api}",
"api_key": "${s}",
"model": {
"id": "${r}",
"name": "${r}"
}
}`}case"opencode":return`{
"provider": {
"openai": {
"options": {
"baseURL": "${x}/v1",
"apiKey": "${s}"
},
"models": {
"${r}": {
"name": "${r}",
"options": {
"store": false
}
}
}
}
},
"$schema": "https://opencode.ai/config.json"
}`;case"cursor":return`API Key: ${s}
Base URL: ${x}/v1
Model: ${r}`;case"curl":return`curl ${x}/v1/chat/completions \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer ${s}" \\
-d '{
"model": "${r}",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'`;case"python":return`from openai import OpenAI
client = OpenAI(
api_key="${s}",
base_url="${x}/v1"
)
response = client.chat.completions.create(
model="${r}",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)`;case"anthropic":return`import anthropic
client = anthropic.Anthropic(
api_key="${s}",
base_url="${x}/"
)
message = client.messages.create(
model="${r}",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(message.content[0].text)`;default:return""}},E=()=>{var s;switch(d){case"curl":return"api-call.sh";case"python":return"main.py";case"anthropic":return"main.py";case"cursor":return"cursor-config.txt";default:return((s=u.find(a=>a.id===d))==null?void 0:s.path.split("/").pop())||"config.json"}},B=async()=>{const s=$();try{await navigator.clipboard.writeText(s)}catch{const n=document.createElement("textarea");n.value=s,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}g(!0),S.success(t("config.copied")),setTimeout(()=>g(!1),2e3)},T=()=>{const s=$(),a=E(),n=new Blob([s],{type:"text/plain"}),i=URL.createObjectURL(n),p=document.createElement("a");p.href=i,p.download=a,p.click(),URL.revokeObjectURL(i),S.success(t("config.downloaded"))};if(C)return e.jsxs("div",{className:"glass rounded-2xl p-6 text-center",children:[e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-page-secondary",children:t("config.loading")})]});if(h.length===0)return e.jsxs("div",{className:"glass rounded-2xl p-6 text-center",children:[e.jsx("svg",{className:"w-8 h-8 mx-auto mb-3 text-page-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),e.jsx("p",{className:"text-sm text-page-secondary mb-1",children:t("config.noKeyPrompt")}),e.jsx("p",{className:"text-xs text-page-muted",children:t("config.noKeyDesc")})]});const O=$();return e.jsxs("div",{className:"glass rounded-2xl overflow-hidden",children:[e.jsxs("div",{className:"px-5 py-4 border-b border-page-divider",children:[e.jsxs("h4",{className:"font-semibold text-sm text-page flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-brand-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),t("config.title")]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:t("config.subtitle")})]}),e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-page-label mb-2",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),t("config.selectKey")]}),e.jsx("select",{value:(l==null?void 0:l.id)||"",onChange:s=>{const a=h.find(n=>n.id===parseInt(s.target.value));j(a)},className:"input",children:h.map(s=>e.jsxs("option",{value:s.id,children:[s.name," (sk-",s.key.substring(0,16),"...)"]},s.id))})]}),c.length>0&&e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-page-label mb-2",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})}),t("config.selectModel")]}),e.jsxs("div",{className:"relative",ref:L,children:[e.jsx("input",{type:"text",value:k?y:r,onChange:s=>{f(s.target.value),m(!0)},onFocus:()=>{f(""),m(!0)},className:"input pr-8",placeholder:t("config.searchModel")}),e.jsx("svg",{className:"w-3.5 h-3.5 absolute right-3 top-1/2 -translate-y-1/2 text-page-muted pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),k&&e.jsxs("div",{className:"absolute z-50 mt-1 w-full max-h-60 overflow-y-auto rounded-lg glass shadow-xl",children:[c.filter(s=>s.toLowerCase().includes(y.toLowerCase())).map(s=>e.jsx("button",{onClick:()=>{N(s),m(!1),f("")},className:`w-full text-left px-3 py-2 text-sm transition-colors hover:bg-page-surface-hover ${s===r?"text-brand-400 bg-brand-500/10":"text-page-secondary"}`,children:s},s)),c.filter(s=>s.toLowerCase().includes(y.toLowerCase())).length===0&&e.jsx("p",{className:"px-3 py-3 text-xs text-page-muted text-center",children:t("config.noModelMatch")})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-page-label mb-2 block",children:t("config.selectTool")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(s=>e.jsx("button",{onClick:()=>w(s.id),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${d===s.id?"bg-brand-500 text-whitLine truncated
-1
View File
@@ -1 +0,0 @@
import{u as Oe,a as $e,d as Me,r as n,g as Ee,p as Le,j as e,Q as ae,e as Ue,z as d,q as He,t as Re,v as Fe,w as De,x as ze,y as Be,A as We}from"./index-BxETo_Fm.js";import{C as H}from"./CountUp-Cw5TWdkr.js";import{u as Qe}from"./useTranslation-X387rOdZ.js";function Xe(){var ee;const{t:s}=Qe(),{user:i,refreshUser:R}=Oe(),{site:r}=$e(),{symbol:S,rate:$}=Me(),[m,le]=n.useState(null),[l,ne]=n.useState(null),[re,F]=n.useState(!0),[M,D]=n.useState(""),[z,B]=n.useState(!1),[h,E]=n.useState(""),[ce,L]=n.useState(null),[W,Q]=n.useState(null),[oe,J]=n.useState(!1),[b,y]=n.useState(!1),[U,f]=n.useState(""),[C,k]=n.useState(null),[de,j]=n.useState(!1),[p,V]=n.useState(""),[P,ie]=n.useState("usdt"),[N,me]=n.useState(null),[A,pe]=n.useState(!1),[G,ue]=n.useState([]),[xe,K]=n.useState(!1);r!=null&&r.enable_topup,r==null||r.topup_config;const q=n.useCallback(async()=>{var t;F(!0);try{const[a,c]=await Promise.all([Ee(),r!=null&&r.enable_topup?Le().catch(()=>null):Promise.resolve(null)]);a.data.success&&le(a.data.data),(t=c==null?void 0:c.data)!=null&&t.data&&ne(c.data.data)}catch{}F(!1)},[r==null?void 0:r.enable_topup]);n.useEffect(()=>{q()},[q]);const X=(m==null?void 0:m.quota)??(i==null?void 0:i.quota)??0,ge=(m==null?void 0:m.used_quota)??(i==null?void 0:i.used_quota)??0,he=(m==null?void 0:m.request_count)??(i==null?void 0:i.request_count)??0,be=X/ae*$,ye=async t=>{if(t.preventDefault(),!!M.trim()){B(!0);try{(await Ue(M.trim())).data.success&&(d.success(s("topup.redeemSuccess")),D(""),await Promise.all([q(),R()]))}catch{}B(!1)}},Y=async t=>{if(!t||t<=0){Q(null);return}J(!0);try{const a=await He({amount:parseInt(t)});a.data.message==="success"&&Q(a.data.data)}catch{}J(!1)},fe=t=>{L(t),E(t),Y(t)},je=t=>["stripe","alipay","wxpay"].includes(t)&&!t.startsWith("epay_"),Ne=async t=>{var c;const a=parseInt(h);if(!a||a<=0){d.error(s("topup.enterAmount"));return}y(!0),f(t);try{const u=window.location.origin+"/topup",_={amount:a,payment_method:t,return_url:u};if(je(t)){const o=await Re(_);if(o.data.message==="success"&&((c=o.data.data)!=null&&c.pay_link))window.open(o.data.data.pay_link,"_blank");else if(o.data.message!=="success"){const x=typeof o.data.data=="string"?o.data.data:o.data.message;d.error(x||s("common.requestFailed"))}}else{const o=await Fe(_);if(o.data.message==="success"){const x=o.data.data,te=o.data.url;if(te&&x){const g=document.createElement("form");g.action=te,g.method="POST",navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<1||(g.target="_blank");for(const se in x){const O=document.createElement("input");O.type="hidden",O.name=se,O.value=x[se],g.appendChild(O)}document.body.appendChild(g),g.submit(),document.body.removeChild(g)}}else{const x=typeof o.data.data=="string"?o.data.data:o.data.message;d.error(x||s("common.requestFailed"))}}}catch{}y(!1),f("")},ve=async t=>{var a;y(!0),f("creem");try{const c=await De({product_id:t.productId,payment_method:"creem"});if(c.data.message==="success"&&((a=c.data.data)!=null&&a.checkout_url))window.open(c.data.data.checkout_url,"_blank");else if(c.data.message!=="success"){const u=typeof c.data.data=="string"?c.data.data:c.data.message;d.error(u||s("common.requestFailed"))}}catch{}y(!1),f("")},we=async()=>{const t=parseInt(h);if(!t||t<=0){d.error(s("topup.enterAmount"));return}if(!p){d.error(s("topup.selectChain"));return}if(!P){d.error(s("topup.selectToken"));return}y(!0),f("crypto");try{const a=await ze({amount:t,chain:p,token:P});if(a.data.message==="success"&&a.data.data)k(a.data.data),Ce(a.data.data.trade_no);else if(a.data.message!=="success"){const c=typeof a.data.data=="string"?a.data.data:a.data.message;d.error(c||s("common.requestFailed"))}}catch{}y(!1),f("")},Ce=t=>{j(!0);const a=setInterval(async()=>{var u,_;try{const o=await Be(t);((u=o.data.data)==null?void 0:u.status)==="success"?(clearInterval(a),j(!1),k(null),d.success(s("topup.paymentSuccess")),await Promise.all([q(),R()])):((_=o.data.data)==null?void 0:_.status)==="expired"&&(clearInterval(a),j(!1),d.error(s("topup.orderExpired")))}catch{clearInterval(a),j(!1)}},5e3),c=((l==null?void 0:l.crypto_expiry_minutes)||30)*60*1e3;setTimeout(()=>{clearInterval(a),j(!1)},c)},v=(l==null?void 0:l.crypto_wallets)||{},w=n.useMemo(()=>{const t=[];return v.tron&&t.push({key:"tron",label:"TRON (TRC20)"}),v.eth&&t.push({key:"eth",label:"Ethereum (ERC20)"}),v.bsc&&t.push({key:"bsc",label:"BSC (BEP20)"}),t},[v.tron,v.eth,v.bsc]);n.useEffect(()=>{w.length>0&&!p&&V(w[0].key)},[w,p]);const Z=n.useMemo(()=>{if(!(l!=null&&l.creem_products))return[];try{const t=typeof l.creem_products=="string"?JSON.parse(l.creem_products):l.creem_products;return Array.isArray(t)?t:[]}catch{return[]}},[l==null?void 0:l.creem_products]),_e=async()=>{var t;K(!0);try{const a=await We({page:1,page_size:20});(t=a.data.data)!=null&&t.items&&ue(a.data.data.items)}catch{}K(!1)},Se=(l==null?void 0:l.amount_options)||[1,5,10,20,50,100],T=(l==null?void 0:l.min_topup)||1,ke=(l==null?void 0:l.pay_methods)||[],Pe=l==null?void 0:lLine truncated
-1
View File
@@ -1 +0,0 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,Noto Sans SC,system-ui,-apple-system,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,Fira Code,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--brand: 99 102 241;--page-bg: #000000;--page-spinner: rgba(255,255,255,.7);--page-spinner-track: rgba(255,255,255,.2);--page-text: 255 255 255;--page-text-secondary: 163 163 163;--page-text-muted: 115 115 115;--page-label: 212 212 212;--page-link: 129 140 248;--page-card-bg: rgba(255,255,255,.03);--page-card-border: rgba(255,255,25Line truncated
-249
View File
@@ -1,249 +0,0 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-vFSySY_B.js","assets/RotatingEquiv-DyNyTpNy.js","assets/CountUp-Cw5TWdkr.js","assets/FadeContent-C5iyyIb_.js","assets/useTranslation-X387rOdZ.js","assets/Layout-BYi_9fkV.js","assets/LanguageSwitch-8SXPkAdj.js","assets/Home-REPSAZGO.js","assets/Layout-B6P6BmuZ.js","assets/Home-BMhk5TXo.js","assets/Layout-B4bLv_xM.js","assets/Home-QDWUuRT3.js","assets/Layout-1VhRl38k.js","assets/Home-ck4M3Vvq.js","assets/Layout-BeFsIDQ-.js","assets/Home-BI3tkd9X.js","assets/Layout-CLqPD2Rn.js","assets/Home-BdGzA7g6.js","assets/Layout-CMGYN9_e.js","assets/Login-DTNLZtTe.js","assets/Register-E-LT0EWd.js","assets/Dashboard-CfR8P5v3.js","assets/Tokens-Copp1Fbk.js","assets/Packages-Cwsumhg2.js","assets/Pricing-Ba0u5vW-.js","assets/Topup-BinBMMqo.js","assets/Logs-DjZbDp4k.js"])))=>i.map(i=>d[i]);
function Hp(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ic={exports:{}},mi={},Dc={exports:{}},z={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Kr=Symbol.for("react.element"),Wp=Symbol.for("react.portal"),Qp=Symbol.for("react.fragment"),qp=Symbol.for("react.strict_mode"),Gp=Symbol.for("react.profiler"),Jp=Symbol.for("react.provider"),Yp=Symbol.for("react.context"),Xp=Symbol.for("react.forward_ref"),Zp=Symbol.for("react.suspense"),eh=Symbol.for("react.memo"),th=Symbol.for("react.lazy"),Aa=Symbol.iterator;function nh(e){return e===null||typeof e!="object"?null:(e=Aa&&e[Aa]||e["@@iterator"],typeof e=="function"?e:null)}var Fc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},jc=Object.assign,$c={};function Wn(e,t,n){this.props=e,this.context=t,this.refs=$c,this.updater=n||Fc}Wn.prototype.isReactComponent={};Wn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Wn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zc(){}zc.prototype=Wn.prototype;function Rl(e,t,n){this.props=e,this.context=t,this.refs=$c,this.updater=n||Fc}var _l=Rl.prototype=new zc;_l.constructor=Rl;jc(_l,Wn.prototype);_l.isPureReactComponent=!0;var Ia=Array.isArray,Uc=Object.prototype.hasOwnProperty,Ll={current:null},Mc={key:!0,ref:!0,__self:!0,__source:!0};function bc(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Uc.call(t,r)&&!Mc.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Kr,type:e,key:i,ref:s,props:o,_owner:Ll.current}}function rh(e,t){return{$$typeof:Kr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Tl(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kr}function oh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Da=/\/+/g;function bi(e,t){return typeof e=="object"&&e!==null&&e.key!=null?oh(""+e.key):t.toString(36)}function Co(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Kr:case Wp:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+bi(s,0):r,Ia(o)?(n="",e!=null&&(n=e.replace(Da,"$&/")+"/"),Co(o,t,n,"",function(u){return u})):o!=null&&(Tl(o)&&(o=rh(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Da,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Ia(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+bi(i,l);s+=Co(i,t,n,a,o)}else if(a=nh(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+bi(i,l++),s+=Co(i,t,n,a,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ro(e,t,n){if(e==null)return e;var r=[],o=0;return Co(e,r,"","",function(i){return t.call(n,i,o++)}),r}function ih(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ce={current:null},Po={transition:null},sh={ReactCurrentDispatcher:Ce,ReactCurrentBatchConfig:Po,ReactCurrentOwner:Ll};function Bc(){throw Error("act(...) is not supported in production builds of React.")}z.Children={map:ro,forEach:function(e,t,n){ro(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ro(e,function(){t++}),t},toArray:function(e){return ro(e,function(t){return t})||[]},only:function(e){if(!Tl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};z.Component=Wn;z.Fragment=Qp;z.Profiler=Gp;z.PureComponent=Rl;z.StrictMode=qp;z.Suspense=Zp;z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sh;z.act=Bc;z.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=jc({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Ll.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Uc.call(t,a)&&!Mc.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Kr,type:e.type,key:o,ref:i,props:r,_owner:s}};z.createContext=function(e){return e={$$typeof:Yp,_currentValue:e,_currentValue2:e,_threadCount:0,ProviderLine truncated
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ah=x,uh=Symbol.for("react.element"),ch=Symbol.for("react.fragment"),fh=Object.prototype.hasOwnProperty,dh=ah.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ph={key:!0,ref:!0,__self:!0,__source:!0};function Vc(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)fh.call(t,r)&&!ph.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:uh,type:e,key:i,ref:s,props:o,_owner:dh.current}}mi.Fragment=ch;mi.jsx=Vc;mi.jsxs=Vc;Ic.exports=mi;var A=Ic.exports,Es={},Hc={exports:{}},Me={},Kc={exports:{}},Wc={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(O,N){var j=O.length;O.push(N);e:for(;0<j;){var F=j-1>>>1,U=O[F];if(0<o(U,N))O[F]=N,O[j]=U,j=F;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var N=O[0],j=O.pop();if(j!==N){O[0]=j;e:for(var F=0,U=O.length,Re=U>>>1;F<Re;){var ke=2*(F+1)-1,ft=O[ke],Yt=ke+1,no=O[Yt];if(0>o(ft,j))Yt<U&&0>o(no,ft)?(O[F]=no,O[Yt]=j,F=Yt):(O[F]=ft,O[ke]=j,F=ke);else if(Yt<U&&0>o(no,j))O[F]=no,O[Yt]=j,F=Yt;else break e}}return N}function o(O,N){var j=O.sortIndex-N.sortIndex;return j!==0?j:O.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,f=null,p=3,y=!1,d=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(O){for(var N=n(u);N!==null;){if(N.callback===null)r(u);else if(N.startTime<=O)r(u),N.sortIndex=N.expirationTime,t(a,N);else break;N=n(u)}}function k(O){if(v=!1,m(O),!d)if(n(a)!==null)d=!0,b(E);else{var N=n(u);N!==null&&he(k,N.startTime-O)}}function E(O,N){d=!1,v&&(v=!1,g(L),L=-1),y=!0;var j=p;try{for(m(N),f=n(a);f!==null&&(!(f.expirationTime>N)||O&&!pe());){var F=f.callback;if(typeof F=="function"){f.callback=null,p=f.priorityLevel;var U=F(f.expirationTime<=N);N=e.unstable_now(),typeof U=="function"?f.callback=U:f===n(a)&&r(a),m(N)}else r(a);f=n(a)}if(f!==null)var Re=!0;else{var ke=n(u);ke!==null&&he(k,ke.startTime-N),Re=!1}return Re}finally{f=null,p=j,y=!1}}var R=!1,P=null,L=-1,$=5,T=-1;function pe(){return!(e.unstable_now()-T<$)}function Be(){if(P!==null){var O=e.unstable_now();T=O;var N=!0;try{N=P(!0,O)}finally{N?H():(R=!1,P=null)}}else R=!1}var H;if(typeof h=="function")H=function(){h(Be)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,Jt=X.port2;X.port1.onmessage=Be,H=function(){Jt.postMessage(null)}}else H=function(){w(Be,0)};function b(O){P=O,R||(R=!0,H())}function he(O,N){L=w(function(){O(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){d||y||(d=!0,b(E))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(O){switch(p){case 1:case 2:case 3:var N=3;break;default:N=p}var j=p;p=N;try{return O()}finally{p=j}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,N){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var j=p;p=O;try{return N()}finally{p=j}},e.unstable_scheduleCallback=function(O,N,j){var F=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?F+j:F):j=F,O){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=j+U,O={id:c++,callback:N,priorityLevel:O,startTime:j,expirationTime:U,sortIndex:-1},j>F?(O.sortIndex=j,t(u,O),n(a)===null&&O===n(u)&&(v?(g(L),L=-1):v=!0,he(k,j-F))):(O.sortIndex=U,t(a,O),d||y||(d=!0,b(E))),O},e.unstable_shouldYield=pe,e.unstable_wrapCallback=function(O){var N=p;return function(){var j=p;p=N;try{return O.apply(this,arguments)}finally{p=j}}}})(Wc);Kc.exports=Wc;var hh=Kc.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var gh=x,Ue=hh;function C(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Qc=new Set,Pr={};function gn(e,t){zn(e,t),zn(e+"Capture",t)}function zn(e,t){for(Pr[e]=t,e=0;e<t.length;e++)Qc.add(t[e])}var vt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cs=Object.prototype.hasOwnProperty,mh=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Fa={},ja={};function yh(e){return Cs.call(ja,e)?!0:Cs.call(Fa,e)?!1:mh.test(e)?ja[e]=!0:(Fa[e]=!0,!1)}function vh(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function wh(e,t,n,r){if(t===null||typeof t>"u"||vh(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pe(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var de={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){de[e]=new Pe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];de[t]=new Pe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){de[e]=new Pe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){de[e]=new Pe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){de[e]=new Pe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){de[e]=new Pe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){de[e]=new Pe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){de[e]=new Pe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){de[e]=new Pe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Nl=/[\-:]([a-z])/g;function Al(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Nl,Al);de[t]=new Pe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Nl,Al);de[t]=new Pe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Nl,Al);de[t]=new Pe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){de[e]=new Pe(e,1,!1,e.toLowerCase(),null,!1,!1)});de.xlinkHref=new Pe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){de[e]=new Pe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Il(e,t,n,r){var o=de.hasOwnProperty(t)?de[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!==" Line truncated
`+Bi+e}var Vi=!1;function Hi(e,t){if(!e||Vi)return"";Vi=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
`),i=r.stack.split(`
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var a=`
`+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{Vi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ur(e):""}function Sh(e){switch(e.tag){case 5:return ur(e.type);case 16:return ur("Lazy");case 13:return ur("Suspense");case 19:return ur("SuspenseList");case 0:case 2:case 15:return e=Hi(e.type,!1),e;case 11:return e=Hi(e.type.render,!1),e;case 1:return e=Hi(e.type,!0),e;default:return""}}function _s(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case kn:return"Fragment";case Sn:return"Portal";case Ps:return"Profiler";case Dl:return"StrictMode";case Os:return"Suspense";case Rs:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Gc:return(e.displayName||"Context")+".Consumer";case qc:return(e._context.displayName||"Context")+".Provider";case Fl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case jl:return t=e.displayName||null,t!==null?t:_s(e.type)||"Memo";case Ot:t=e._payload,e=e._init;try{return _s(e(t))}catch{}}return null}function kh(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _s(t);case 8:return t===Dl?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xh(e){var t=Yc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function io(e){e._valueTracker||(e._valueTracker=xh(e))}function Xc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Yc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Mo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ls(e,t){var n=t.checked;return Y({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function za(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Zc(e,t){t=t.checked,t!=null&&Il(e,"checked",t,!1)}function Ts(e,t){Zc(e,t);var n=Vt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ns(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ns(e,t.type,Vt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ua(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ns(e,t,n){(t!=="number"||Mo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var cr=Array.isArray;function An(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vt(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function As(e,t){if(t.dang Line truncated
`).replace(Ag,"")}function ho(e,t,n){if(t=au(t),au(e)!==t&&n)throw Error(C(425))}function qo(){}var Ks=null,Ws=null;function Qs(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qs=typeof setTimeout=="function"?setTimeout:void 0,Ig=typeof clearTimeout=="function"?clearTimeout:void 0,uu=typeof Promise=="function"?Promise:void 0,Dg=typeof queueMicrotask=="function"?queueMicrotask:typeof uu<"u"?function(e){return uu.resolve(null).then(e).catch(Fg)}:qs;function Fg(e){setTimeout(function(){throw e})}function rs(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Tr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Tr(t)}function $t(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function cu(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var qn=Math.random().toString(36).slice(2),st="__reactFiber$"+qn,Fr="__reactProps$"+qn,wt="__reactContainer$"+qn,Gs="__reactEvents$"+qn,jg="__reactListeners$"+qn,$g="__reactHandles$"+qn;function tn(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=cu(e);e!==null;){if(n=e[st])return n;e=cu(e)}return t}e=n,n=e.parentNode}return null}function qr(e){return e=e[st]||e[wt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Pn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(C(33))}function ki(e){return e[Fr]||null}var Js=[],On=-1;function Wt(e){return{current:e}}function Q(e){0>On||(e.current=Js[On],Js[On]=null,On--)}function K(e,t){On++,Js[On]=e.current,e.current=t}var Ht={},Se=Wt(Ht),Te=Wt(!1),un=Ht;function Un(e,t){var n=e.type.contextTypes;if(!n)return Ht;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ne(e){return e=e.childContextTypes,e!=null}function Go(){Q(Te),Q(Se)}function fu(e,t,n){if(Se.current!==Ht)throw Error(C(168));K(Se,t),K(Te,n)}function Bf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(C(108,kh(e)||"Unknown",o));return Y({},n,r)}function Jo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,un=Se.current,K(Se,e),K(Te,Te.current),!0}function du(e,t,n){var r=e.stateNode;if(!r)throw Error(C(169));n?(e=Bf(e,t,un),r.__reactInternalMemoizedMergedChildContext=e,Q(Te),Q(Se),K(Se,e)):Q(Te),K(Te,n)}var ht=null,xi=!1,os=!1;function Vf(e){ht===null?ht=[e]:ht.push(e)}function zg(e){xi=!0,Vf(e)}function Qt(){if(!os&&ht!==null){os=!0;var e=0,t=B;try{var n=ht;for(B=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ht=null,xi=!1}catch(o){throw ht!==null&&(ht=ht.slice(e+1)),hf(zl,Qt),o}finally{B=t,os=!1}}return null}var Rn=[],_n=0,Yo=null,Xo=0,He=[],Ke=0,cn=null,gt=1,mt="";function Zt(e,t){Rn[_n++]=Xo,Rn[_n++]=Yo,Yo=e,Xo=t}function Hf(e,t,n){He[Ke++]=gt,He[Ke++]=mt,He[Ke++]=cn,cn=e;var r=gt;e=mt;var o=32-et(r)-1;r&=~(1<<o),n+=1;var i=32-et(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,gt=1<<32-et(t)+o|n<<o|r,mt=i+e}else gt=1<<i|n<<o|r,mt=e}function Ql(e){e.return!==null&&(Zt(e,1),Hf(e,1,0))}function ql(e){for(;e===Yo;)Yo=Rn[--_n],Rn[_n]=null,Xo=Rn[--_n],Rn[_n]=null;for(;e===cn;)cn=He[--Ke],He[Ke]=null,mt=He[--Ke],He[Ke]=null,gt=He[--Ke],He[Ke]=null}var ze=null,$e=null,q=!1,Ze=null;function Kf(e,t){var n=We(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function pu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ze=e,$e=$t(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ze=e,$e=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=cn!==null?{id:gt,overflow:mt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=We(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ze=e,$e=null,!0):!1;default:return!1}}function Ys(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xs(e){if(q){var t=$e;if(t){var n=t;if(!pu(e,t)){if(Ys(e))throw Error(C(418));t=$t(n.nextSibling);var r=ze;t&&pu(e,t)?Kf(r,n):(e.flags=e.flags&-4097|2,q=!1,ze=e)}}else{if(Ys(e))throw Error(C(418));e.flags=e.flags&-4097|2,q=!1,ze=e}}}function hu(e){for(e=e.return;e!==null&&e.t Line truncated
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function us(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function nl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Qg=typeof WeakMap=="function"?WeakMap:Map;function vd(e,t,n){n=yt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){si||(si=!0,dl=r),nl(e,t)},n}function wd(e,t,n){n=yt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){nl(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){nl(e,t),typeof r!="function"&&(Ut===null?Ut=new Set([this]):Ut.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function xu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qg;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=lm.bind(null,e,t,n),t.then(e,e))}function Eu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Cu(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=yt(-1,1),t.tag=2,zt(n,t,1))),n.lanes|=1),e)}var qg=Et.ReactCurrentOwner,Le=!1;function xe(e,t,n,r){t.child=e===null?qf(t,null,n,r):bn(t,e.child,n,r)}function Pu(e,t,n,r,o){n=n.render;var i=t.ref;return jn(t,o),r=ia(e,t,n,r,i,o),n=sa(),e!==null&&!Le?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,kt(e,t,o)):(q&&n&&Ql(t),t.flags|=1,xe(e,t,r,o),t.child)}function Ou(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!ma(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Sd(e,t,i,r,o)):(e=Fo(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ar,n(s,r)&&e.ref===t.ref)return kt(e,t,o)}return t.flags|=1,e=bt(i,r),e.ref=t.ref,e.return=t,t.child=e}function Sd(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Ar(i,r)&&e.ref===t.ref)if(Le=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Le=!0);else return t.lanes=e.lanes,kt(e,t,o)}return rl(e,t,n,r,o)}function kd(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},K(Nn,je),je|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,K(Nn,je),je|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,K(Nn,je),je|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,K(Nn,je),je|=r;return xe(e,t,o,n),t.child}function xd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function rl(e,t,n,r,o){var i=Ne(n)?un:Se.current;return i=Un(t,i),jn(t,o),n=ia(e,t,n,r,i,o),r=sa(),e!==null&&!Le?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,kt(e,t,o)):(q&&r&&Ql(t),t.flags|=1,xe(e,t,n,o),t.child)}function Ru(e,t,n,r,o){if(Ne(n)){var i=!0;Jo(t)}else i=!1;if(jn(t,o),t.stateNode===null)Ao(e,t),yd(t,n,r),tl(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=qe(u):(u=Ne(n)?un:Se.current,u=Un(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&ku(t,s,r,u),Rt=!1;var p=t.memoizedState;s.state=p,ti(t,r,s,o),a=t.memoizedState,l!==r||p!==a||Te.current||Rt?(typeof c=="function"&&(el(t,n,c,r),a=t.memoizedState),(l=Rt||Su(t,n,l,r,p,a,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Jf(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Ye(t.type,l),s.props=u,f=t.pendingProps,p=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=qe(a):(a=Ne(n)?un:Se.current,a=Un(t,a));var y=n.getDerivedStateFromProps;(c=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||p!==a)&&ku(t,s,r,a),Rt=!1,p=t.memoizedState,s.state=p,ti(t,r,s,o);var d=t.memoizedState;l Line truncated
* @remix-run/router v1.23.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Br(){return Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Br.apply(this,arguments)}var It;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(It||(It={}));const bu="popstate";function wm(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:s,hash:l}=r.location;return ml("",{pathname:i,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:ci(o)}return km(t,n,null,e)}function ne(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Sm(){return Math.random().toString(36).substr(2,8)}function Bu(e,t){return{usr:e.state,key:e.key,idx:t}}function ml(e,t,n,r){return n===void 0&&(n=null),Br({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Gn(t):t,{state:n,key:t&&t.key||r||Sm()})}function ci(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Gn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function km(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,l=It.Pop,a=null,u=c();u==null&&(u=0,s.replaceState(Br({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function f(){l=It.Pop;let w=c(),g=w==null?null:w-u;u=w,a&&a({action:l,location:v.location,delta:g})}function p(w,g){l=It.Push;let h=ml(v.location,w,g);u=c()+1;let m=Bu(h,u),k=v.createHref(h);try{s.pushState(m,"",k)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;o.location.assign(k)}i&&a&&a({action:l,location:v.location,delta:1})}function y(w,g){l=It.Replace;let h=ml(v.location,w,g);u=c();let m=Bu(h,u),k=v.createHref(h);s.replaceState(m,"",k),i&&a&&a({action:l,location:v.location,delta:0})}function d(w){let g=o.location.origin!=="null"?o.location.origin:o.location.href,h=typeof w=="string"?w:ci(w);return h=h.replace(/ $/,"%20"),ne(g,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,g)}let v={get action(){return l},get location(){return e(o,s)},listen(w){if(a)throw new Error("A history only accepts one active listener");return o.addEventListener(bu,f),a=w,()=>{o.removeEventListener(bu,f),a=null}},createHref(w){return t(o,w)},createURL:d,encodeLocation(w){let g=d(w);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:y,go(w){return s.go(w)}};return v}var Vu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Vu||(Vu={}));function xm(e,t,n){return n===void 0&&(n="/"),Em(e,t,n)}function Em(e,t,n,r){let o=typeof t=="string"?Gn(t):t,i=xa(o.pathname||"/",n);if(i==null)return null;let s=Wd(e);Cm(s);let l=null;for(let a=0;l==null&&a<s.length;++a){let u=jm(i);l=Im(s[a],u)}return l}function Wd(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,s,l)=>{let a={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};a.relativePath.startsWith("/")&&(ne(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Bt([r,a.relativePath]),c=n.concat(a);i.children&&i.children.length>0&&(ne(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Wd(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Nm(u,i.index),routesMeta:c})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,s);else for(let a of Qd(i.path))o(i,s,a)}),t}function Qd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=Qd(r.join("/")),l=[];return l.push(...s.map(a=>a===""?i:[i,a].join("/"))),o&&l.push(...s),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function Cm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Am(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Pm=/^:[\w-]+$/,Om=3,Rm=2,_m=1,Lm=10,Tm=-2,Hu=e=>e==="*";function Nm(e,t){let n=e.split("/"),r=n.length;return n.some(Hu)&&(r+=Tm),t&&(r+=Rm),n.filter(o=>!Hu(o)).reduce((o,i)=>o+(Pm.test(i)?Om:i===""?_m:Lm),r)}function Am(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Im(e,t,n){let{routesMeta:r}=e,o={},i="/",s=[];for(let l=0;l<r.length;++l){let a=r[l],u=l===r.length-1,c=i==="/"?t:t.slice(i.length)||"/",f=Dm({path:a.relativePath,caseSensitive:a.caseSeLine truncated
* React Router v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vr.apply(this,arguments)}const Pa=x.createContext(null),Wm=x.createContext(null),qt=x.createContext(null),Ai=x.createContext(null),Ct=x.createContext({outlet:null,matches:[],isDataRoute:!1}),Gd=x.createContext(null);function Qm(e,t){let{relative:n}=t===void 0?{}:t;Jn()||ne(!1);let{basename:r,navigator:o}=x.useContext(qt),{hash:i,pathname:s,search:l}=Xd(e,{relative:n}),a=s;return r!=="/"&&(a=s==="/"?r:Bt([r,s])),o.createHref({pathname:a,search:l,hash:i})}function Jn(){return x.useContext(Ai)!=null}function Yn(){return Jn()||ne(!1),x.useContext(Ai).location}function Jd(e){x.useContext(qt).static||x.useLayoutEffect(e)}function Yd(){let{isDataRoute:e}=x.useContext(Ct);return e?ay():qm()}function qm(){Jn()||ne(!1);let e=x.useContext(Pa),{basename:t,future:n,navigator:r}=x.useContext(qt),{matches:o}=x.useContext(Ct),{pathname:i}=Yn(),s=JSON.stringify(Ea(o,n.v7_relativeSplatPath)),l=x.useRef(!1);return Jd(()=>{l.current=!0}),x.useCallback(function(u,c){if(c===void 0&&(c={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=Ca(u,JSON.parse(s),i,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Bt([t,f.pathname])),(c.replace?r.replace:r.push)(f,c.state,c)},[t,r,s,i,e])}const Gm=x.createContext(null);function Jm(e){let t=x.useContext(Ct).outlet;return t&&x.createElement(Gm.Provider,{value:e},t)}function Xd(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(qt),{matches:o}=x.useContext(Ct),{pathname:i}=Yn(),s=JSON.stringify(Ea(o,r.v7_relativeSplatPath));return x.useMemo(()=>Ca(e,JSON.parse(s),i,n==="path"),[e,s,i,n])}function Ym(e,t){return Xm(e,t)}function Xm(e,t,n,r){Jn()||ne(!1);let{navigator:o}=x.useContext(qt),{matches:i}=x.useContext(Ct),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let u=Yn(),c;if(t){var f;let w=typeof t=="string"?Gn(t):t;a==="/"||(f=w.pathname)!=null&&f.startsWith(a)||ne(!1),c=w}else c=u;let p=c.pathname||"/",y=p;if(a!=="/"){let w=a.replace(/^\//,"").split("/");y="/"+p.replace(/^\//,"").split("/").slice(w.length).join("/")}let d=xm(e,{pathname:y}),v=ry(d&&d.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:Bt([a,o.encodeLocation?o.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?a:Bt([a,o.encodeLocation?o.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return t&&v?x.createElement(Ai.Provider,{value:{location:Vr({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:It.Pop}},v):v}function Zm(){let e=ly(),t=Hm(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:o},n):null,null)}const ey=x.createElement(Zm,null);class ty extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(Ct.Provider,{value:this.props.routeContext},x.createElement(Gd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ny(e){let{routeContext:t,match:n,children:r}=e,o=x.useContext(Pa);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Ct.Provider,{value:t},r)}function ry(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let c=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);c>=0||ne(!1),s=s.slice(0,Math.min(s.length,c+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c<s.length;c++){let f=s[c];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=c),f.route.id){let{loaderData:p,errors:y}=n,d=f.route.loader&&p[f.route.id]===void 0&&(!y||y[f.route.id]===void 0);if(f.route.lazy||d){a=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,f,p)=>{let y,d=!1,v=nuLine truncated
* React Router DOM v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function vl(){return vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vl.apply(this,arguments)}function hy(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function gy(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function my(e,t){return e.button===0&&(!t||t==="_self")&&!gy(e)}const yy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],vy="6";try{window.__reactRouterVersion=vy}catch{}const wy="startTransition",Qu=lh[wy];function Sy(e){let{basename:t,children:n,future:r,window:o}=e,i=x.useRef();i.current==null&&(i.current=wm({window:o,v5Compat:!0}));let s=i.current,[l,a]=x.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=x.useCallback(f=>{u&&Qu?Qu(()=>a(f)):a(f)},[a,u]);return x.useLayoutEffect(()=>s.listen(c),[s,c]),x.useEffect(()=>cy(r),[r]),x.createElement(dy,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const ky=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,f1=x.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:l,target:a,to:u,preventScrollReset:c,viewTransition:f}=t,p=hy(t,yy),{basename:y}=x.useContext(qt),d,v=!1;if(typeof u=="string"&&xy.test(u)&&(d=u,ky))try{let m=new URL(window.location.href),k=u.startsWith("//")?new URL(m.protocol+u):new URL(u),E=xa(k.pathname,y);k.origin===m.origin&&E!=null?u=E+k.search+k.hash:v=!0}catch{}let w=Qm(u,{relative:o}),g=Ey(u,{replace:s,state:l,target:a,preventScrollReset:c,relative:o,viewTransition:f});function h(m){r&&r(m),m.defaultPrevented||g(m)}return x.createElement("a",vl({},p,{href:d||w,onClick:v||i?r:h,ref:n,target:a}))});var qu;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(qu||(qu={}));var Gu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Gu||(Gu={}));function Ey(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,a=Yd(),u=Yn(),c=Xd(e,{relative:s});return x.useCallback(f=>{if(my(f,n)){f.preventDefault();let p=r!==void 0?r:ci(u)===ci(c);a(e,{replace:p,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[u,a,c,r,o,n,e,i,s,l])}let Cy={data:""},Py=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Cy},Oy=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ry=/\/\*[^]*?\*\/| +/g,Ju=/\n+/g,Tt=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+s+";":r+=i[1]=="f"?Tt(s,i):i+"{"+Tt(s,i[1]=="k"?"":t)+"}":typeof s=="object"?r+=Tt(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,a=>/&/.test(a)?a.replace(/&/g,l):l?l+" "+a:a)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Tt.p?Tt.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},dt={},rp=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+rp(e[n]);return t}return e},_y=(e,t,n,r,o)=>{let i=rp(e),s=dt[i]||(dt[i]=(a=>{let u=0,c=11;for(;u<a.length;)c=101*c+a.charCodeAt(u++)>>>0;return"go"+c})(i));if(!dt[s]){let a=i!==e?e:(u=>{let c,f,p=[{}];for(;c=Oy.exec(u.replace(Ry,""));)c[4]?p.shift():c[3]?(f=c[3].replace(Ju," ").trim(),p.unshift(p[0][f]=p[0][f]||{})):p[0][c[1]]=c[2].replace(Ju," ").trim();return p[0]})(e);dt[s]=Tt(o?{["@keyframes "+s]:a}:a,n?"":"."+s)}let l=n&&dt.g?dt.g:null;return n&&(dt.g=dt[s]),((a,u,c,f)=>{f?u.data=u.data.replace(f,a):u.data.indexOf(a)===-1&&(u.data=c?a+u.data:u.data+a)})(dt[s],t,r,l),s},Ly=(e,t,n)=>e.reduce((r,o,i)=>{let s=t[i];if(s&&s.call){let l=s(n),a=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=a?"."+a:l&&typeof l=="object"?l.props?"":Tt(l,""):l===!1?"":l}return r+o+(s??"")},"");function Ii(e){let t=this||{},n=e.call?e(t.p):e;return _y(n.unshift?n.raw?Ly(n,[].slice.call(arguments,1),t.p):n.reduce((r,o)=>Object.assign(r,o&&o.call?o(t.p):o),{}):n,Py(t.target),t.g,t.o,t.k)}let op,wl,Sl;Ii.bind({g:1});let xt=Ii.bind({k:1});function Ty(e,t,n,r){Tt.p=t,op=e,wl=n,Sl=r}function Gt(e,t){let n=this||{};return function(){let r=arguments;function o(i,s){let l=Object.assign({},i),a=l.className||o.className;n.p=Object.assign({theme:wl&&wl()},l),n.o=/ *go\d+/.test(a),l.className=Ii.apply(n,r)+(a?" "+a:"");let u=e;return e[0]&&(u=l.as||e,delete l.as),Sl&&u[0]&&Sl(l),op(u,l)}return o}}var Ny=e=>typeof e=="function",fi=(e,t)=>Ny(e)?e(t):e,Ay=(()=>{let e=0;return()=Line truncated
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,by=xt`
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}`,By=xt`
from {
transform: scale(0) rotate(90deg);
opacity: 0;
}
to {
transform: scale(1) rotate(90deg);
opacity: 1;
}`,Vy=Gt("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#ff4b4b"};
position: relative;
transform: rotate(45deg);
animation: ${My} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after,
&:before {
content: '';
animation: ${by} 0.15s ease-out forwards;
animation-delay: 150ms;
position: absolute;
border-radius: 3px;
opacity: 0;
background: ${e=>e.secondary||"#fff"};
bottom: 9px;
left: 4px;
height: 2px;
width: 12px;
}
&:before {
animation: ${By} 0.15s ease-out forwards;
animation-delay: 180ms;
transform: rotate(90deg);
}
`,Hy=xt`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,Ky=Gt("div")`
width: 12px;
height: 12px;
box-sizing: border-box;
border: 2px solid;
border-radius: 100%;
border-color: ${e=>e.secondary||"#e0e0e0"};
border-right-color: ${e=>e.primary||"#616161"};
animation: ${Hy} 1s linear infinite;
`,Wy=xt`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,Qy=xt`
0% {
height: 0;
width: 0;
opacity: 0;
}
40% {
height: 0;
width: 6px;
opacity: 1;
}
100% {
opacity: 1;
height: 10px;
}`,qy=Gt("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#61d345"};
position: relative;
transform: rotate(45deg);
animation: ${Wy} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after {
content: '';
box-sizing: border-box;
animation: ${Qy} 0.2s ease-out forwards;
opacity: 0;
animation-delay: 200ms;
position: absolute;
border-right: 2px solid;
border-bottom: 2px solid;
border-color: ${e=>e.secondary||"#fff"};
bottom: 6px;
left: 6px;
height: 10px;
width: 6px;
}
`,Gy=Gt("div")`
position: absolute;
`,Jy=Gt("div")`
position: relative;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
min-height: 20px;
`,Yy=xt`
from {
transform: scale(0.6);
opacity: 0.4;
}
to {
transform: scale(1);
opacity: 1;
}`,Xy=Gt("div")`
position: relative;
transform: scale(0.6);
opacity: 0.4;
min-width: 20px;
animation: ${Yy} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
`,Zy=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?x.createElement(Xy,null,t):t:n==="blank"?null:x.createElement(Jy,null,x.createElement(Ky,{...r}),n!=="loading"&&x.createElement(Gy,null,n==="error"?x.createElement(Vy,{...r}):x.createElement(qy,{...r})))},ev=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,tv=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,nv="0%{opacity:0;} 100%{opacity:1;}",rv="0%{opacity:1;} 100%{opacity:0;}",ov=Gt("div")`
display: flex;
align-items: center;
background: #fff;
color: #363636;
line-height: 1.3;
will-change: transform;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
max-width: 350px;
pointer-events: auto;
padding: 8px 10px;
border-radius: 8px;
`,iv=Gt("div")`
display: flex;
justify-content: center;
margin: 4px 10px;
color: inherit;
flex: 1 1 auto;
white-space: pre-line;
`,sv=(e,t)=>{let n=e.includes("top")?1:-1,[r,o]=ip()?[nv,rv]:[ev(n),tv(n)];return{animation:t?`${xt(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${xt(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},lv=x.memo(({toast:e,position:t,style:n,children:r})=>{let o=e.height?sv(e.position||t||"top-center",e.visible):{opacity:0},i=x.createElement(Zy,{toast:e}),s=x.createElement(iv,{...e.ariaProps},fi(e.message,e));return x.createElement(ov,{className:e.className,style:{...o,...n,...e.style}},typeof r=="function"?r({icon:i,message:s}):x.createElement(x.Fragment,null,i,s))});Ty(x.createElement);var av=({id:e,className:t,style:n,onHeightUpdate:r,children:o})=>{let i=x.useCallback(s=>{if(s){let l=()=>{let a=s.getBoundingClientRect().height;r(e,a)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return x.createElement("div",{ref:i,className:t,style:n},o)},uv=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:ip()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}},cv=Ii`
z-index: 9999;
> * {
pointer-events: auto;
}
`,ko=16,fv=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:a,handlers:u}=Uy(n,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:ko,left:ko,right:ko,bottom:ko,pointerEvents:"none",...s},className:l,onMouseEnter:u.startPause,onMouseLeave:u.endPause},a.map(c=>{let f=c.position||t,p=u.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),y=uv(f,p);return x.createElement(av,{id:c.id,key:c.id,onHeightUpdate:u.updateHeight,className:c.visible?cv:"",style:y},c.type==="custom"?fi(c.message,c):o?o(c):x.createElement(lv,{toast:c,position:f}))}))},hs=se;const dv="modulepreload",pv=function(e){return"/"+e},Yu={},Z=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=pv(a),a in Yu)return;Yu[a]=!0;const u=a.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":dv,u||(f.as="script"),f.crossOrigin="",f.href=a,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((p,y)=>{f.addEventListener("load",p),f.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${a}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return o.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function cp(e,t){return function(){return e.apply(t,arguments)}}const{toString:hv}=Object.prototype,{getPrototypeOf:Ra}=Object,{iterator:Fi,toStringTag:fp}=Symbol,ji=(e=>t=>{const n=hv.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),rt=e=>(e=e.toLowerCase(),t=>ji(t)===e),$i=e=>t=>typeof t===e,{isArray:Xn}=Array,Kn=$i("undefined");function Yr(e){return e!==null&&!Kn(e)&&e.constructor!==null&&!Kn(e.constructor)&&Ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const dp=rt("ArrayBuffer");function gv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&dp(e.buffer),t}const mv=$i("string"),Ie=$i("function"),pp=$i("number"),Xr=e=>e!==null&&typeof e=="object",yv=e=>e===!0||e===!1,$o=e=>{if(ji(e)!=="object")return!1;const t=Ra(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(fp in e)&&!(Fi in e)},vv=e=>{if(!Xr(e)||Yr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},wv=rt("Date"),Sv=rt("File"),kv=e=>!!(e&&typeof e.uri<"u"),xv=e=>e&&typeof e.getParts<"u",Ev=rt("Blob"),Cv=rt("FileList"),Pv=e=>Xr(e)&&Ie(e.pipe);function Ov(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Xu=Ov(),Zu=typeof Xu.FormData<"u"?Xu.FormData:void 0,Rv=e=>{let t;return e&&(Zu&&e instanceof Zu||Ie(e.append)&&((t=ji(e))==="formdata"||t==="object"&&Ie(e.toString)&&e.toString()==="[object FormData]"))},_v=rt("URLSearchParams"),[Lv,Tv,Nv,Av]=["ReadableStream","Request","Response","Headers"].map(rt),Iv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Xn(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(Yr(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(r=0;r<s;r++)l=i[r],t.call(null,e[l],l,e)}}function hp(e,t){if(Yr(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const on=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gp=e=>!Kn(e)&&e!==on;function kl(){const{caseless:e,skipUndefined:t}=gp(this)&&this||{},n={},r=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const s=e&&hp(n,i)||i;$o(n[s])&&$o(o)?n[s]=kl(n[s],o):$o(o)?n[s]=kl({},o):Xn(o)?n[s]=o.slice():(!t||!Kn(o))&&(n[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&Zr(arguments[o],r);return n}const Dv=(e,t,n,{allOwnKeys:r}={})=>(Zr(t,(o,i)=>{n&&Ie(o)?Object.defineProperty(e,i,{value:cp(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Fv=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jv=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},$v=(e,t,n,r)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!r||r(s Line truncated
`).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||t[n]&&v0[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},rc=Symbol("internals");function lr(e){return e&&String(e).trim().toLowerCase()}function zo(e){return e===!1||e==null?e:S.isArray(e)?e.map(zo):String(e)}function S0(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const k0=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ms(e,t,n,r,o){if(S.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!S.isString(t)){if(S.isString(r))return t.indexOf(r)!==-1;if(S.isRegExp(r))return r.test(t)}}function x0(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function E0(e,t){const n=S.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,s){return this[r].call(this,t,o,i,s)},configurable:!0})})}let De=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(l,a,u){const c=lr(a);if(!c)throw new Error("header name must be a non-empty string");const f=S.findKey(o,c);(!f||o[f]===void 0||u===!0||u===void 0&&o[f]!==!1)&&(o[f||a]=zo(l))}const s=(l,a)=>S.forEach(l,(u,c)=>i(u,c,a));if(S.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(S.isString(t)&&(t=t.trim())&&!k0(t))s(w0(t),n);else if(S.isObject(t)&&S.isIterable(t)){let l={},a,u;for(const c of t){if(!S.isArray(c))throw TypeError("Object iterator must return a key-value pair");l[u=c[0]]=(a=l[u])?S.isArray(a)?[...a,c[1]]:[a,c[1]]:c[1]}s(l,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=lr(t),t){const r=S.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return S0(o);if(S.isFunction(n))return n.call(this,o,r);if(S.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=lr(t),t){const r=S.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ms(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(s){if(s=lr(s),s){const l=S.findKey(r,s);l&&(!n||ms(r,r[l],l,n))&&(delete r[l],o=!0)}}return S.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||ms(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return S.forEach(this,(o,i)=>{const s=S.findKey(r,i);if(s){n[s]=zo(o),delete n[i];return}const l=t?x0(i):String(i).trim();l!==i&&delete n[i],n[l]=zo(o),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return S.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&S.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[rc]=this[rc]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=lr(s);r[l]||(E0(o,s),r[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};De.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);S.reduceDescriptors(De.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});S.freezeMethods(De);function ys(e,t){const n=this||eo,r=t||n,o=De.from(r.headers);let i=r.data;return S.forEach(e,function(l){i=l.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ep(e){return!!(e&&e.__CANCEL__)}let to=class extends I{constructor(t,n,r){super(t??"canceled",I.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function Cp(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new I("Request failed with status code "+n.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function C0(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function P0(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),c=r[i];s||(s=u),n[o]=a,r[o]=u;let f=i,p=0;for(;f!==o;)p+=n[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-s<t)return;const y=c&&u-c;return y?Math.round(p*1e3/y):void 0}}function O0(e,t){let n=0,r=1e3/t,o,i;const s=(u,c=Date.now())=>{n=c,o=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const c=Date.now(),f=c-n;f>=r?s(u,c):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},r-f)))},()=>o&&s(o)]}const di=(e,t,n=3)=>{let r=0;const o=P0(50,250);return O0(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,a=s-r,u=o(a),c=s<=l;r=s;const f={loaded:s,total:l,progress:l?s/l:void 0,bytes:a,rate:u||void 0,estimated:u&&l&&c?(l-s)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},oc=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ic=e=>(...t)=>S.asap(()=>e(...t)),R0=we.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,we.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(we.origin),we.navigator&&/(msie|trident)/i.test(we.navigator.userAgent)):()=>!0,_0=we.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),S.isString(r)&&l.push(`path=${r}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function L0(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function T0(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Pp(e,t,n){let r=!L0(t);return e&&(r||n==!1)?T0(e,t):t}const sc=e=>e instanceof De?{...e}:e;function hn(e,t){t=t||{};const n={};function r(u,c,f,p){return S.isPlainObject(u)&&S.isPlainObject(c)?S.merge.call({caseless:p},u,c):S.isPlainObject(c)?S.merge({},c):S.isArray(c)?c.slice():c}function o(u,c,f,p){if(S.isUndefined(c)){if(!S.isUndefined(u))return r(void 0,u,f,p)}else return r(u,c,f,p)}function i(u,c){if(!S.isUndefined(c))return r(void 0,c)}function s(u,c){if(S.isUndefined(c)){if(!S.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function l(u,c,f){if(f in t)return r(u,c);if(f in e)return r(void 0,u)}const a={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,c,f)=>o(sc(u),sc(c),f,!0)};return S.forEach(Object.keys({...e,...t}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;const f=S.hasOwnProp(a,c)?a[c]:o,p=f(e[c],t[c],c);S.isUndefined(p)&&f!==l||(n[c]=p)}),n}const Op=e=>{const t=hn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=De.from(s),t.url=kp(Pp(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(n)){if(we.hasStandardBrowserEnv||we.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(n.getHeaders)){c Line truncated
`+s.map(dc).join(`
`):" "+dc(s[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const _p={getAdapter:b0,adapters:Na};function vs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new to(null,e)}function pc(e){return vs(e),e.headers=De.from(e.headers),e.data=ys.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),_p.getAdapter(e.adapter||eo.adapter,e)(e).then(function(r){return vs(e),r.data=ys.call(e,e.transformResponse,r),r.headers=De.from(r.headers),r},function(r){return Ep(r)||(vs(e),r&&r.response&&(r.response.data=ys.call(e,e.transformResponse,r.response),r.response.headers=De.from(r.response.headers))),Promise.reject(r)})}const Lp="1.13.6",Ui={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ui[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const hc={};Ui.transitional=function(t,n,r){function o(i,s){return"[Axios v"+Lp+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,l)=>{if(t===!1)throw new I(o(s," has been removed"+(n?" in "+n:"")),I.ERR_DEPRECATED);return n&&!hc[s]&&(hc[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,l):!0}};Ui.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function B0(e,t,n){if(typeof e!="object")throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const l=e[i],a=l===void 0||s(l,i,e);if(a!==!0)throw new I("option "+i+" must be "+a,I.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new I("Unknown option "+i,I.ERR_BAD_OPTION)}}const Uo={assertOptions:B0,validators:Ui},Ve=Uo.validators;let an=class{constructor(t){this.defaults=t||{},this.interceptors={request:new nc,response:new nc}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=hn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Uo.assertOptions(r,{silentJSONParsing:Ve.transitional(Ve.boolean),forcedJSONParsing:Ve.transitional(Ve.boolean),clarifyTimeoutError:Ve.transitional(Ve.boolean),legacyInterceptorReqResOrdering:Ve.transitional(Ve.boolean)},!1),o!=null&&(S.isFunction(o)?n.paramsSerializer={serialize:o}:Uo.assertOptions(o,{encode:Ve.function,serialize:Ve.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Uo.assertOptions(n,{baseUrl:Ve.spelling("baseURL"),withXsrfToken:Ve.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[n.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=De.concat(s,i);const l=[];let a=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;a=a&&v.synchronous;const w=n.transitional||La;w&&w.legacyInterceptorReqResOrdering?l.unshift(v.fulfilled,v.rejected):l.push(v.fulfilled,v.rejected)});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,f=0,p;if(!a){const d=[pc.bind(this),void 0];for(d.unshift(...l),d.push(...u),p=d.length,c=Promise.resolve(n);f<p;)c=c.then(d[f++],d[f++]);return c}p=l.length;let y=n;for(;f<p;){const d=l[f++],v=l[f++];try{y=d(y)}catch(w){v.call(this,w);break}}try{c=pc.call(this,y)}catch(d){return Promise.reject(d)}for(f=0,p=u.length;f<p;)c=c.then(u[f++],u[f++]);return c}getUri(t){t=hn(this.defaults,t);const n=Pp(t.baseURL,t.url,t.allowAbsoluteUrls);return kp(n,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){an.prototype[t]=function(n,r){return this.request(hn(r||{},{method:t,url:n,data:(r||{}).data}))}});S.forEach(["post","put","patch"],function(t){function n(r){return function(i,s,l){return this.request(hn(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}an.prototype[t]=n(),an.prototype[t+"Form"]=n(!0)});let V0=class Tp{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{r.subscribe(l),i=l}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,l){r.reason||(r.reason=new to(i,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Tp(function(o){t=o}),cancel:t}}};function H0(e){return function(n){return e.apply(null,n)}}function K0(e){return S.isObject(e)&&e.isAxiosError===!0}const Cl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Cl).forEach(([e,t])=>{Cl[t]=e});function Np(e){const t=new an(e),n=cp(an.prototype.request,t);return S.extend(n,an.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Np(hn(e,o))},n}const re=Np(eo);re.Axios=an;re.CanceledError=to;re.CancelToken=V0;re.isCancel=Ep;re.VERSION=Lp; Line truncated
-9
View File
@@ -1,9 +0,0 @@
import{r as l,C as q,D as B}from"./index-BxETo_Fm.js";const H=(e,t,r,i)=>{var n,d,y,g;const s=[r,{code:t,...i||{}}];if((d=(n=e==null?void 0:e.services)==null?void 0:n.logger)!=null&&d.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);p(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(g=(y=e==null?void 0:e.services)==null?void 0:y.logger)!=null&&g.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},z={},U=(e,t,r,i)=>{p(r)&&z[r]||(p(r)&&(z[r]=new Date),H(e,t,r,i))},F=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},O=(e,t,r)=>{e.loadNamespaces(t,F(e,r))},A=(e,t,r,i)=>{if(p(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return O(e,r,i);r.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,F(e,i))},J=(e,t,r={})=>!t.languages||!t.languages.length?(U(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(i,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,e))return!1}}),p=e=>typeof e=="string",K=e=>typeof e=="object"&&e!==null,Q=l.createContext();class V{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var M={exports:{}},$={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var h=l;function Z(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ee=typeof Object.is=="function"?Object.is:Z,te=h.useState,ne=h.useEffect,re=h.useLayoutEffect,ae=h.useDebugValue;function se(e,t){var r=t(),i=te({inst:{value:r,getSnapshot:t}}),s=i[0].inst,n=i[1];return re(function(){s.value=r,s.getSnapshot=t,C(s)&&n({inst:s})},[e,r,t]),ne(function(){return C(s)&&n({inst:s}),e(function(){C(s)&&n({inst:s})})},[e]),ae(r),r}function C(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!ee(e,r)}catch{return!0}}function oe(e,t){return t()}var ce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?oe:se;$.useSyncExternalStore=h.useSyncExternalStore!==void 0?h.useSyncExternalStore:ce;M.exports=$;var ue=M.exports;const ie=(e,t)=>{if(p(t))return t;if(K(t)&&p(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const r=e[e.length-1];return typeof r=="function"?"":r}return e},le={t:ie,ready:!1},fe=()=>()=>{},ge=(e,t={})=>{var j,b,P;const{i18n:r}=t,{i18n:i,defaultNS:s}=l.useContext(Q)||{},n=r||i||B();n&&!n.reportNamespaces&&(n.reportNamespaces=new V),n||U(n,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const d=l.useMemo(()=>{var a;return{...q(),...(a=n==null?void 0:n.options)==null?void 0:a.react,...t}},[n,t]),{useSuspense:y,keyPrefix:g}=d,x=s||((j=n==null?void 0:n.options)==null?void 0:j.defaultNS),_=p(x)?[x]:x||["translation"],f=l.useMemo(()=>_,_);(P=(b=n==null?void 0:n.reportNamespaces)==null?void 0:b.addUsedNamespaces)==null||P.call(b,f);const L=l.useRef(0),G=l.useCallback(a=>{if(!n)return fe;const{bindI18n:o,bindI18nStore:c}=d,u=()=>{L.current+=1,a()};return o&&n.on(o,u),c&&n.store.on(c,u),()=>{o&&o.split(" ").forEach(v=>n.off(v,u)),c&&c.split(" ").forEach(v=>n.store.off(v,u))}},[n,d]),R=l.useRef(),I=l.useCallback(()=>{if(!n)return le;const a=!!(n.isInitialized||n.initializedStoreOnce)&&f.every(Y=>J(Y,n,d)),o=t.lng||n.language,c=L.current,u=R.current;if(u&&u.ready===a&&u.lng===o&&u.keyPrefix===g&&u.revision===c)return u;const k={t:n.getFixedT(o,d.nsMode==="fallback"?f:f[0],g),ready:a,lng:o,keyPrefix:g,revision:c};return R.current=k,k},[n,f,g,d,t.lng]),[W,D]=l.useState(0),{t:N,ready:S}=ue.useSyncExternalStore(G,I,I);l.useEffect(()=>{if(n&&!S&&!y){const a=()=>D(o=>o+1);t.lng?A(n,t.lng,f,a):O(n,f,a)}},[n,t.lng,f,S,y,W]);const m=n||{},w=l.useRef(null),E=l.useRef(),T=a=>{const o=Object.getOwnPropertyDescriptors(a);o.__original&&delete o.__original;const c=Object.create(Object.getPrototypeOf(a),o);if(!Object.prototype.hasOwnProperty.call(c,"__original"))try{Object.defineProperty(c,"__original",{value:a,writable:!1,enumerable:!1,configurable:!1})}catch{}return c},X=l.useMemo(()=>{const a=m,o=a==null?void 0:a.language;let c=a;a&&(w.current&&w.current.__original===a?E.current!==o?(c=T(a),w.current=c,E.current=o):c=w.current:(c=T(a),w.current=c,E.current=o));const u=[N,c,S];return u.t=N,u.i18n=c,u.ready=S,u},[N,m,S,m.resolvedLanguage,m.language,m.languages]);if(n&&y&&!S)throw new Promise(a=>{const o=()=>a();t.lng?A(n,t.lng,f,o):O(n,f,o)});return X};export{ge as u};
+2 -2
View File
@@ -7,8 +7,8 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
<title>AI Platform</title>
<script type="module" crossorigin src="/assets/index-BxETo_Fm.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B9svmztF.css">
<script type="module" crossorigin src="/assets/index-CgGPBQ4H.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B3G1pDJs.css">
</head>
<body class="antialiased">
<script>
+2
View File
@@ -11,6 +11,7 @@ const Packages = lazy(() => import('./pages/Packages'));
const Pricing = lazy(() => import('./pages/Pricing'));
const Topup = lazy(() => import('./pages/Topup'));
const Logs = lazy(() => import('./pages/Logs'));
const SubDistributor = lazy(() => import('./pages/SubDistributor'));
const Loading = () => (
<div className="flex items-center justify-center min-h-screen" style={{ background: 'var(--page-bg)' }}>
@@ -30,6 +31,7 @@ function ThemedRoutes() {
<Route path="/" element={<Home />} />
<Route path="/pricing" element={<Pricing />} />
<Route path="/packages" element={<Packages />} />
<Route path="/sub-site" element={<SubDistributor />} />
<Route path="/login" element={<Login />} />
<Route path="/register" element={<Register />} />
+11
View File
@@ -48,6 +48,7 @@ export const getSiteModels = () => api.get('/api/dist/site/models');
export const getSitePricing = () => api.get('/api/dist/site/pricing');
export const getSitePackages = () => api.get('/api/dist/site/packages');
export const getSiteKeyGroups = () => api.get('/api/dist/site/key-groups');
export const getSubDistributorInfo = () => api.get('/api/dist/site/sub-distributor/info');
// ===== Auth =====
export const register = (data) => api.post('/api/dist/user/register', data);
@@ -80,6 +81,16 @@ export const createCryptoOrder = (data) => api.post('/api/dist/topup/crypto/pay'
export const getCryptoOrderStatus = (tradeNo) => api.get(`/api/dist/topup/crypto/status?trade_no=${tradeNo}`);
export const getTopupHistory = (params) => api.get('/api/dist/topup/history', { params });
// ===== Affiliate / Invitation =====
export const getAffCode = () => api.get('/api/dist/aff');
export const transferAffQuota = (data) => api.post('/api/dist/aff_transfer', data);
export const getAffEarnings = (params) => api.get('/api/dist/aff_earnings', { params });
export const getAffPayouts = (params) => api.get('/api/dist/aff_payouts', { params });
export const requestAffWithdraw = (data) => api.post('/api/dist/aff_withdraw', data);
export const submitDistKolApply = (data) => api.post('/api/dist/kol_apply', data);
export const getDistKolStatus = () => api.get('/api/dist/kol_status');
export const createSubDistributorOrder = (data) => api.post('/api/dist/site/sub-distributor/pay', data);
// ===== Helpers =====
export const quotaToDollar = (quota) => (quota / Q).toFixed(4);
export const quotaToDollar6 = (quota) => (quota / Q).toFixed(6);
-406
View File
@@ -1,406 +0,0 @@
import React, { useState, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { getTokens, getSiteModels } from '../api';
import toast from 'react-hot-toast';
const ConfigExporter = () => {
const { t } = useTranslation();
const [tokens, setTokens] = useState([]);
const [selectedToken, setSelectedToken] = useState(null);
const [availableModels, setAvailableModels] = useState([]);
const [selectedModel, setSelectedModel] = useState('');
const [selectedTool, setSelectedTool] = useState('claudecode');
const [loading, setLoading] = useState(true);
const [copied, setCopied] = useState(false);
const [modelSearch, setModelSearch] = useState('');
const [modelDropdownOpen, setModelDropdownOpen] = useState(false);
const modelDropdownRef = useRef(null);
const serverAddress = window.location.origin;
const tools = [
{ id: 'claudecode', name: 'Claude Code', path: '~/.claude/settings.json' },
{ id: 'openclaw', name: 'OpenClaw', path: '~/.openclaw/openclaw.json' },
{ id: 'opencode', name: 'OpenCode', path: '~/.config/opencode/opencode.json' },
{ id: 'cursor', name: 'Cursor', path: 'Settings → Models → OpenAI API Key' },
{ id: 'curl', name: 'cURL', path: 'Terminal' },
{ id: 'python', name: 'Python SDK', path: 'main.py' },
{ id: 'anthropic', name: 'Anthropic SDK', path: 'main.py' },
];
useEffect(() => {
loadData();
}, []);
useEffect(() => {
if (selectedToken) {
loadModelsForToken(selectedToken);
}
}, [selectedToken]);
// Close model dropdown on click outside
useEffect(() => {
const handleClickOutside = (e) => {
if (modelDropdownRef.current && !modelDropdownRef.current.contains(e.target)) {
setModelDropdownOpen(false);
}
};
document.addEventListener('mousedown', handleClickOutside);
return () => document.removeEventListener('mousedown', handleClickOutside);
}, []);
const loadData = async () => {
setLoading(true);
try {
const res = await getTokens();
if (res.data.success) {
const tokenList = res.data.data || [];
setTokens(tokenList);
if (tokenList.length > 0) {
setSelectedToken(tokenList[0]);
}
}
} catch (e) { /* interceptor */ }
setLoading(false);
};
const loadModelsForToken = async (token) => {
try {
// Try token-specific model limits first
if (token.model_limits_enabled && token.model_limits) {
const models = token.model_limits.split(',').filter(m => m.trim());
setAvailableModels(models);
if (models.length > 0) setSelectedModel(models[0]);
return;
}
// Fall back to site-wide model list
const res = await getSiteModels();
if (res.data.success && res.data.data) {
const list = Array.isArray(res.data.data) ? res.data.data : (res.data.data.items || []);
const modelNames = list.map(m => m.model_name || m.id || m);
setAvailableModels(modelNames);
if (modelNames.length > 0) setSelectedModel(modelNames[0]);
}
} catch (e) { /* silent */ }
};
const getProviderInfo = (modelName) => {
const lower = modelName.toLowerCase();
if (lower.includes('claude')) return { provider: 'anthropic', api: 'anthropic-messages' };
if (lower.includes('gpt') || lower.includes('o1') || lower.includes('o3')) return { provider: 'openai', api: 'openai-chat' };
if (lower.includes('gemini')) return { provider: 'google', api: 'google-chat' };
return { provider: 'openai', api: 'openai-chat' };
};
const generateConfig = () => {
if (!selectedToken || !selectedModel) return '';
const apiKey = 'sk-' + selectedToken.key;
switch (selectedTool) {
case 'claudecode':
return `{
"env": {
"ANTHROPIC_API_KEY": "${apiKey}",
"ANTHROPIC_BASE_URL": "${serverAddress}/",
"ANTHROPIC_MODEL": "${selectedModel}"
}
}`;
case 'openclaw': {
const info = getProviderInfo(selectedModel);
return `{
"provider": "${info.provider}",
"base_url": "${serverAddress}/",
"api": "${info.api}",
"api_key": "${apiKey}",
"model": {
"id": "${selectedModel}",
"name": "${selectedModel}"
}
}`;
}
case 'opencode':
return `{
"provider": {
"openai": {
"options": {
"baseURL": "${serverAddress}/v1",
"apiKey": "${apiKey}"
},
"models": {
"${selectedModel}": {
"name": "${selectedModel}",
"options": {
"store": false
}
}
}
}
},
"$schema": "https://opencode.ai/config.json"
}`;
case 'cursor':
return `API Key: ${apiKey}
Base URL: ${serverAddress}/v1
Model: ${selectedModel}`;
case 'curl':
return `curl ${serverAddress}/v1/chat/completions \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer ${apiKey}" \\
-d '{
"model": "${selectedModel}",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'`;
case 'python':
return `from openai import OpenAI
client = OpenAI(
api_key="${apiKey}",
base_url="${serverAddress}/v1"
)
response = client.chat.completions.create(
model="${selectedModel}",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)`;
case 'anthropic':
return `import anthropic
client = anthropic.Anthropic(
api_key="${apiKey}",
base_url="${serverAddress}/"
)
message = client.messages.create(
model="${selectedModel}",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(message.content[0].text)`;
default:
return '';
}
};
const getFilename = () => {
switch (selectedTool) {
case 'curl': return 'api-call.sh';
case 'python': return 'main.py';
case 'anthropic': return 'main.py';
case 'cursor': return 'cursor-config.txt';
default: return tools.find(t => t.id === selectedTool)?.path.split('/').pop() || 'config.json';
}
};
const handleCopy = async () => {
const config = generateConfig();
try {
await navigator.clipboard.writeText(config);
} catch (e) {
const ta = document.createElement('textarea');
ta.value = config;
ta.style.position = 'fixed';
ta.style.opacity = '0';
document.body.appendChild(ta);
ta.select();
document.execCommand('copy');
document.body.removeChild(ta);
}
setCopied(true);
toast.success(t('config.copied'));
setTimeout(() => setCopied(false), 2000);
};
const handleDownload = () => {
const config = generateConfig();
const filename = getFilename();
const blob = new Blob([config], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
a.click();
URL.revokeObjectURL(url);
toast.success(t('config.downloaded'));
};
if (loading) {
return (
<div className="glass rounded-2xl p-6 text-center">
<div className="w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin mx-auto mb-2" />
<p className="text-sm text-page-secondary">{t('config.loading')}</p>
</div>
);
}
if (tokens.length === 0) {
return (
<div className="glass rounded-2xl p-6 text-center">
<svg className="w-8 h-8 mx-auto mb-3 text-page-muted" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
</svg>
<p className="text-sm text-page-secondary mb-1">{t('config.noKeyPrompt')}</p>
<p className="text-xs text-page-muted">{t('config.noKeyDesc')}</p>
</div>
);
}
const config = generateConfig();
return (
<div className="glass rounded-2xl overflow-hidden">
{/* Header */}
<div className="px-5 py-4 border-b border-page-divider">
<h4 className="font-semibold text-sm text-page flex items-center gap-2">
<svg className="w-4 h-4 text-brand-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
{t('config.title')}
</h4>
<p className="text-xs text-page-muted mt-1">{t('config.subtitle')}</p>
</div>
{/* Controls */}
<div className="p-5 space-y-4">
{/* API Key Selection */}
<div>
<label className="flex items-center gap-2 text-xs font-medium text-page-label mb-2">
<svg className="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
</svg>
{t('config.selectKey')}
</label>
<select
value={selectedToken?.id || ''}
onChange={(e) => {
const token = tokens.find(t => t.id === parseInt(e.target.value));
setSelectedToken(token);
}}
className="input"
>
{tokens.map((token) => (
<option key={token.id} value={token.id}>
{token.name} (sk-{token.key.substring(0, 16)}...)
</option>
))}
</select>
</div>
{/* Model Selection — searchable */}
{availableModels.length > 0 && (
<div>
<label className="flex items-center gap-2 text-xs font-medium text-page-label mb-2">
<svg className="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />
</svg>
{t('config.selectModel')}
</label>
<div className="relative" ref={modelDropdownRef}>
<input
type="text"
value={modelDropdownOpen ? modelSearch : selectedModel}
onChange={(e) => { setModelSearch(e.target.value); setModelDropdownOpen(true); }}
onFocus={() => { setModelSearch(''); setModelDropdownOpen(true); }}
className="input pr-8"
placeholder={t('config.searchModel')}
/>
<svg className="w-3.5 h-3.5 absolute right-3 top-1/2 -translate-y-1/2 text-page-muted pointer-events-none" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
{modelDropdownOpen && (
<div className="absolute z-50 mt-1 w-full max-h-60 overflow-y-auto rounded-lg glass shadow-xl">
{availableModels
.filter(m => m.toLowerCase().includes(modelSearch.toLowerCase()))
.map((model) => (
<button
key={model}
onClick={() => { setSelectedModel(model); setModelDropdownOpen(false); setModelSearch(''); }}
className={`w-full text-left px-3 py-2 text-sm transition-colors hover:bg-page-surface-hover ${
model === selectedModel ? 'text-brand-400 bg-brand-500/10' : 'text-page-secondary'
}`}
>
{model}
</button>
))
}
{availableModels.filter(m => m.toLowerCase().includes(modelSearch.toLowerCase())).length === 0 && (
<p className="px-3 py-3 text-xs text-page-muted text-center">{t('config.noModelMatch')}</p>
)}
</div>
)}
</div>
</div>
)}
{/* Tool Selection */}
<div>
<label className="text-xs font-medium text-page-label mb-2 block">{t('config.selectTool')}</label>
<div className="flex flex-wrap gap-2">
{tools.map((tool) => (
<button
key={tool.id}
onClick={() => setSelectedTool(tool.id)}
className={`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${
selectedTool === tool.id
? 'bg-brand-500 text-white shadow-sm'
: 'bg-page-surface text-page-secondary hover:bg-page-surface-hover'
}`}
>
{tool.name}
</button>
))}
</div>
</div>
</div>
{/* Config Preview */}
<div className="border-t border-page-divider">
<div className="flex items-center justify-between px-4 py-2.5 bg-page-inset">
<div className="flex items-center gap-2">
<div className="flex gap-1.5">
<span className="w-2.5 h-2.5 rounded-full bg-red-400" />
<span className="w-2.5 h-2.5 rounded-full bg-yellow-400" />
<span className="w-2.5 h-2.5 rounded-full bg-green-400" />
</div>
<span className="text-xs text-page-muted ml-1">
{tools.find(t => t.id === selectedTool)?.path}
</span>
</div>
<div className="flex items-center gap-2">
<button
onClick={handleCopy}
className="p-1.5 rounded-md hover:bg-page-surface-hover transition-colors text-page-muted hover:text-page"
title={t('config.copy')}
>
{copied ? (
<svg className="w-3.5 h-3.5 text-page-success" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" /></svg>
) : (
<svg className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg>
)}
</button>
<button
onClick={handleDownload}
className="p-1.5 rounded-md hover:bg-page-surface-hover transition-colors text-page-muted hover:text-page"
title={t('config.download')}
>
<svg className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>
</button>
</div>
</div>
<pre className="p-4 text-xs leading-relaxed overflow-x-auto max-h-64 font-mono text-page-success">
<code>{config}</code>
</pre>
</div>
</div>
);
};
export default ConfigExporter;
+102 -1
View File
@@ -93,6 +93,44 @@
"dashboard.apiDocs": "API Docs",
"dashboard.comingSoon": "Coming soon",
"subDist.nav": "Launch Sub-site",
"subDist.dashboardEntry": "Pay once and manage your own sub-site",
"subDist.badge": "Site Owner Plan",
"subDist.title": "Launch Your Own Sub-site",
"subDist.subtitle": "Pay through {{name}} to open your own sub-site. After payment, the system will automatically grant owner access and continue the management flow.",
"subDist.defaultSiteName": "this site",
"subDist.notAvailable": "Sub-site launch is currently unavailable",
"subDist.disabledFallback": "Please contact the site owner to enable this feature",
"subDist.loginHint": "Please log in or register on this site first. After successful payment, your account will be upgraded to a site owner.",
"subDist.goLogin": "Log In",
"subDist.goRegister": "Register",
"subDist.siteName": "Site Name",
"subDist.siteNamePlaceholder": "e.g. My AI Site",
"subDist.siteSlug": "Site Slug",
"subDist.siteSlugHelp": "This will become your site identifier and cannot be changed after payment.",
"subDist.paymentMethod": "Payment Method",
"subDist.chain": "Blockchain",
"subDist.token": "Token",
"subDist.payAndOpen": "Pay ¥{{price}} to Launch",
"subDist.currentUserHint": "Current paying account: {{user}}, payment method: {{method}}",
"subDist.postPayHint": "After payment, your owner access will be activated automatically. If a login is required, continue with the same account.",
"subDist.cryptoTitle": "Crypto Order Created",
"subDist.cryptoHint": "Please transfer using the details below. Your sub-site will be activated automatically after confirmation.",
"subDist.wallet": "Wallet",
"subDist.amount": "Amount",
"subDist.tradeNo": "Trade No",
"subDist.priceCardTitle": "Pricing",
"subDist.openPrice": "Launch Price",
"subDist.priceSummary": "This page only shows the final price you need to pay. Internal supply cost, upstream profit, and settlement details are only shown after activation in the appropriate back-office flow.",
"subDist.ruleTitle": "Profit Rules",
"subDist.rule1": "You are paying the launch price configured by the current site owner, and activation will follow the current site's rules after payment succeeds.",
"subDist.rule2": "Upstream profit, discount spread, and internal settlement belong to the owner back-office flow and are not disclosed on this public page.",
"subDist.rule3": "Once activated, your account is upgraded to a site owner and you can continue configuring domains, themes, pricing, and models.",
"subDist.loginRequired": "Please log in before launching a sub-site",
"subDist.fillRequired": "Please fill in the site name, slug, and payment method",
"subDist.selectPayment": "Please select a payment method",
"subDist.createFailed": "Failed to create order",
"tokens.title": "API Keys",
"tokens.subtitle": "Manage your API access tokens",
"tokens.newKey": "+ New Key",
@@ -159,6 +197,8 @@
"pricing.model": "Model",
"pricing.inputPrice": "Input / 1M tokens",
"pricing.outputPrice": "Output / 1M tokens",
"pricing.perCall": "Per call",
"pricing.perCallUnit": "call",
"pricing.status": "Status",
"pricing.online": "Online",
"pricing.unknown": "Unknown",
@@ -208,7 +248,9 @@
"topup.onlineTopup": "Online Top Up",
"topup.selectAmount": "Select Amount",
"topup.customAmount": "Custom Amount",
"topup.amountPlaceholder": "Enter amount (min ${{min}})",
"topup.customAmountHint": "Custom amounts are automatically aligned to payable tiers so the entered and charged amounts stay consistent.",
"topup.rechargeAmountLabel": "Recharge Amount",
"topup.amountPlaceholder": "Enter amount (min {{min}})",
"topup.paymentMethod": "Payment Method",
"topup.processing": "Processing...",
"topup.calculating": "Calculating...",
@@ -243,6 +285,65 @@
"topup.quotaIncluded": "{{count}} quota included",
"topup.creemPayment": "Creem Payment",
"topup.inviteTitle": "Referral Program",
"topup.inviteSubtitle": "Invite friends and earn ongoing commissions",
"topup.affAvailable": "Available Commission",
"topup.affTotal": "Total Commission",
"topup.affCount": "Invited Users",
"topup.inviteLink": "Invitation Link",
"topup.copy": "Copy",
"topup.copied": "Copied",
"topup.viewEarnings": "View Earnings",
"topup.hideEarnings": "Hide Earnings",
"topup.noEarnings": "No earnings yet",
"topup.transferToBalance": "Transfer to Balance",
"topup.transferPlaceholder": "Enter transfer amount (quota)",
"topup.transfer": "Transfer",
"topup.transferSuccess": "Transfer successful",
"topup.withdraw": "Withdraw",
"topup.withdrawTitle": "Request Withdrawal",
"topup.withdrawSubtitle": "Submit a payout request with your preferred payment method",
"topup.withdrawAvailable": "Withdrawable Balance",
"topup.withdrawAmount": "Withdrawal Amount",
"topup.withdrawAll": "Withdraw All",
"topup.withdrawMethod": "Payment Method",
"topup.withdrawMethodPlaceholder": "e.g. Alipay, WeChat, bank card",
"topup.withdrawRemark": "Account / Note",
"topup.withdrawRemarkPlaceholder": "Enter your payout account or extra notes",
"topup.submitWithdraw": "Submit Withdrawal",
"topup.withdrawSuccess": "Withdrawal request submitted",
"topup.invalidWithdrawAmount": "Please enter a valid withdrawal amount",
"topup.withdrawExceedsBalance": "Withdrawal amount cannot exceed your withdrawable balance",
"topup.enterWithdrawMethod": "Please enter a payment method",
"topup.currentCommissionRateLabel": "Commission Rate",
"topup.currentCommissionRateDesc": "All regular users get a default {{rate}}% commission. It is paid only from the sub-site owner's profit and never touches the main site's base cost.",
"topup.kolApplyTitle": "Apply for a Higher Commission Rate",
"topup.kolApplyDesc": "Your default commission is {{rate}}%. If you have promotion resources, you can apply for a higher custom rate from the sub-site owner.",
"topup.kolApplyAction": "Apply Now",
"topup.kolPendingTitle": "Commission Upgrade Under Review",
"topup.kolPendingDesc": "Your request has been submitted. The sub-site owner will review it and set a new rate if approved.",
"topup.kolPendingBadge": "Pending",
"topup.kolApprovedTitle": "Custom Commission Enabled",
"topup.kolApprovedDesc": "You are currently using a custom commission rate approved by the sub-site owner.",
"topup.kolRemarkLabel": "Owner note: ",
"topup.kolRejectedLabel": "Request not approved: ",
"topup.kolRejectedFallback": "The request was not approved yet. You can improve your materials and apply again.",
"topup.kolApplyModalTitle": "Apply for a Higher Commission Rate",
"topup.kolApplyModalDesc": "Submit your promotion profile and the sub-site owner can approve a higher rate for you.",
"topup.kolSocialLabel": "Social Link",
"topup.kolSocialPlaceholder": "Enter your profile, channel, or account link",
"topup.kolFollowersLabel": "Followers / Community Size",
"topup.kolFollowersPlaceholder": "For example: 5,000 followers / 3 groups",
"topup.kolPlanLabel": "Promotion Plan",
"topup.kolPlanPlaceholder": "Tell us how you plan to promote this sub-site",
"topup.kolContactLabel": "Contact Info",
"topup.kolContactPlaceholder": "Enter WeChat, Telegram, email, etc.",
"topup.kolApplySubmit": "Submit Request",
"topup.kolApplySuccess": "Application submitted. Please wait for the owner review.",
"topup.kolSocialRequired": "Please enter a social link",
"dashboard.topupDesc": "Recharge account balance",
"nav.logs": "Logs",
"dashboard.logs": "Call Logs",
+102 -1
View File
@@ -93,6 +93,44 @@
"dashboard.apiDocs": "API 文档",
"dashboard.comingSoon": "即将推出",
"subDist.nav": "开通分站",
"subDist.dashboardEntry": "付费开通并管理自己的分站",
"subDist.badge": "站长计划",
"subDist.title": "开通你的下级分站",
"subDist.subtitle": "基于 {{name}} 直接付费开通自己的分站。支付完成后,系统会自动为您开通站长权限并进入管理流程。",
"subDist.defaultSiteName": "当前分站",
"subDist.notAvailable": "当前暂未开放下级分站",
"subDist.disabledFallback": "请联系站长开启该功能",
"subDist.loginHint": "请先登录或注册当前分站账户,支付成功后会自动获得分站站长权限。",
"subDist.goLogin": "去登录",
"subDist.goRegister": "去注册",
"subDist.siteName": "站点名称",
"subDist.siteNamePlaceholder": "例如:我的 AI 分站",
"subDist.siteSlug": "站点标识",
"subDist.siteSlugHelp": "将作为您的专属分站标识,支付成功后不可修改。",
"subDist.paymentMethod": "支付方式",
"subDist.chain": "区块链",
"subDist.token": "代币",
"subDist.payAndOpen": "支付开通 ¥{{price}}",
"subDist.currentUserHint": "当前支付账号:{{user}},支付方式:{{method}}",
"subDist.postPayHint": "支付完成后系统会自动为您开通分站站长权限;如需补登录,请使用同一账号继续进入站长后台。",
"subDist.cryptoTitle": "加密货币订单已创建",
"subDist.cryptoHint": "请按照以下信息转账,到账后系统会自动开通分站。",
"subDist.wallet": "收款地址",
"subDist.amount": "支付金额",
"subDist.tradeNo": "订单号",
"subDist.priceCardTitle": "费用说明",
"subDist.openPrice": "当前开通价",
"subDist.priceSummary": "当前页面仅展示您的实际开通价格。供货成本、上级收益与内部结算明细将在开通完成后进入对应后台流程。",
"subDist.ruleTitle": "收益规则",
"subDist.rule1": "您支付的是当前分站站长设置的开通价,支付成功后会按当前站点规则自动完成开通。",
"subDist.rule2": "上级站长收益、折扣差与内部结算属于站长后台结算逻辑,不在当前公开页面展示。",
"subDist.rule3": "开通成功后,您会升级为分站站长,并可继续配置域名、主题、价格和模型。",
"subDist.loginRequired": "请先登录后再开通分站",
"subDist.fillRequired": "请填写站点名称、标识和支付方式",
"subDist.selectPayment": "请选择支付方式",
"subDist.createFailed": "创建订单失败",
"tokens.title": "API 密钥",
"tokens.subtitle": "管理您的 API 访问令牌",
"tokens.newKey": "+ 新建密钥",
@@ -159,6 +197,8 @@
"pricing.model": "模型",
"pricing.inputPrice": "输入 / 百万 token",
"pricing.outputPrice": "输出 / 百万 token",
"pricing.perCall": "按次计费",
"pricing.perCallUnit": "次",
"pricing.status": "状态",
"pricing.online": "在线",
"pricing.unknown": "未知",
@@ -208,7 +248,9 @@
"topup.onlineTopup": "在线充值",
"topup.selectAmount": "选择金额",
"topup.customAmount": "自定义金额",
"topup.amountPlaceholder": "输入金额(最低 ${{min}})",
"topup.customAmountHint": "自定义金额会自动对齐到可支付档位,避免输入金额和实付金额不一致。",
"topup.rechargeAmountLabel": "充值金额",
"topup.amountPlaceholder": "输入金额(最低 {{min}})",
"topup.paymentMethod": "支付方式",
"topup.processing": "处理中...",
"topup.calculating": "计算中...",
@@ -243,6 +285,65 @@
"topup.quotaIncluded": "含 {{count}} 额度",
"topup.creemPayment": "Creem 支付",
"topup.inviteTitle": "邀请返佣",
"topup.inviteSubtitle": "邀请好友注册,持续获得消费佣金",
"topup.affAvailable": "可用佣金",
"topup.affTotal": "累计佣金",
"topup.affCount": "邀请人数",
"topup.inviteLink": "邀请链接",
"topup.copy": "复制",
"topup.copied": "已复制",
"topup.viewEarnings": "查看收入明细",
"topup.hideEarnings": "收起明细",
"topup.noEarnings": "暂无收入记录",
"topup.transferToBalance": "划转到余额",
"topup.transferPlaceholder": "输入划转额度 (quota)",
"topup.transfer": "划转",
"topup.transferSuccess": "划转成功",
"topup.withdraw": "提现",
"topup.withdrawTitle": "申请提现",
"topup.withdrawSubtitle": "填写收款方式后即可提交提现申请",
"topup.withdrawAvailable": "可提现余额",
"topup.withdrawAmount": "提现金额",
"topup.withdrawAll": "全部提现",
"topup.withdrawMethod": "收款方式",
"topup.withdrawMethodPlaceholder": "如:支付宝、微信、银行卡",
"topup.withdrawRemark": "收款账号 / 备注",
"topup.withdrawRemarkPlaceholder": "请输入收款账号或补充说明",
"topup.submitWithdraw": "提交提现",
"topup.withdrawSuccess": "提现申请已提交",
"topup.invalidWithdrawAmount": "请输入有效的提现金额",
"topup.withdrawExceedsBalance": "提现金额不能超过可提现余额",
"topup.enterWithdrawMethod": "请输入收款方式",
"topup.currentCommissionRateLabel": "当前返佣比例",
"topup.currentCommissionRateDesc": "普通用户默认可获得 {{rate}}% 返佣,返佣只从分站站长利润中结算,不会扣到主站进货成本。",
"topup.kolApplyTitle": "申请更高返佣比例",
"topup.kolApplyDesc": "当前默认返佣为 {{rate}}%,如果您有推广资源,可以向分站站长申请更高返佣。",
"topup.kolApplyAction": "申请提额",
"topup.kolPendingTitle": "返佣申请审核中",
"topup.kolPendingDesc": "您的提额申请已提交,分站站长审核后会为您设置新的返佣比例。",
"topup.kolPendingBadge": "审核中",
"topup.kolApprovedTitle": "已获得自定义返佣",
"topup.kolApprovedDesc": "您当前享受的是站长审批后的自定义返佣比例。",
"topup.kolRemarkLabel": "站长备注:",
"topup.kolRejectedLabel": "申请未通过:",
"topup.kolRejectedFallback": "暂未通过审核,您可以补充资料后重新申请。",
"topup.kolApplyModalTitle": "申请更高返佣比例",
"topup.kolApplyModalDesc": "请填写您的推广资料,站长审核通过后会为您调整返佣比例。",
"topup.kolSocialLabel": "社交媒体链接",
"topup.kolSocialPlaceholder": "请输入主页、频道或账号链接",
"topup.kolFollowersLabel": "粉丝数 / 社群规模",
"topup.kolFollowersPlaceholder": "例如:5000 粉丝 / 3 个社群",
"topup.kolPlanLabel": "推广计划",
"topup.kolPlanPlaceholder": "介绍您打算如何推广本分站",
"topup.kolContactLabel": "联系方式",
"topup.kolContactPlaceholder": "请输入微信、Telegram、邮箱等",
"topup.kolApplySubmit": "提交申请",
"topup.kolApplySuccess": "申请已提交,请等待站长审核",
"topup.kolSocialRequired": "请填写社交媒体链接",
"dashboard.topupDesc": "充值账户余额",
"nav.logs": "调用日志",
"dashboard.logs": "调用日志",
+16
View File
@@ -121,6 +121,12 @@
@apply rounded-xl;
}
/* Modal overlay — opaque card background so content is readable */
.modal-overlay .glass,
.modal-overlay .glass-sm {
background: rgba(20, 20, 28, 0.95);
}
.btn-primary {
@apply px-6 py-2.5 rounded-xl bg-brand-600 font-medium text-sm
hover:bg-brand-500 active:bg-brand-700
@@ -185,6 +191,16 @@
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.theme-light .modal-overlay .glass,
.theme-light .modal-overlay .glass-sm {
background: rgba(255, 255, 255, 0.97);
}
.theme-claude .modal-overlay .glass,
.theme-claude .modal-overlay .glass-sm {
background: rgba(250, 246, 241, 0.97);
}
/* Light theme input focus */
.theme-light .input:focus {
border-color: rgb(99 102 241);
+549 -20
View File
@@ -1,9 +1,19 @@
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useCallback } from 'react';
import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { useAuth } from '../context/AuthContext';
import { getUserUsage, redeemCode, Q, quotaToDollar } from '../api';
import { useCurrency } from '../context/SiteContext';
import {
getUserUsage,
redeemCode,
getAffCode,
transferAffQuota,
getAffEarnings,
requestAffWithdraw,
getDistKolStatus,
submitDistKolApply,
Q,
} from '../api';
import { useCurrency, useSite } from '../context/SiteContext';
import CountUp from '../components/bits/CountUp';
import toast from 'react-hot-toast';
@@ -11,18 +21,53 @@ export default function Dashboard() {
const { t } = useTranslation();
const { user, refreshUser } = useAuth();
const { symbol, rate } = useCurrency();
const { site } = useSite();
const [usage, setUsage] = useState(null);
const [redeemInput, setRedeemInput] = useState('');
const [redeeming, setRedeeming] = useState(false);
const loadUsage = async () => {
try {
const r = await getUserUsage();
if (r.data.success) setUsage(r.data.data);
} catch (e) { /* interceptor */ }
};
// Invitation / Aff
const [affLink, setAffLink] = useState('');
const [affEarnings, setAffEarnings] = useState([]);
const [showAffEarnings, setShowAffEarnings] = useState(false);
const [affEarningsLoading, setAffEarningsLoading] = useState(false);
const [transferAmount, setTransferAmount] = useState('');
const [transferring, setTransferring] = useState(false);
const [showWithdrawModal, setShowWithdrawModal] = useState(false);
const [withdrawAmount, setWithdrawAmount] = useState('');
const [withdrawMethod, setWithdrawMethod] = useState('');
const [withdrawRemark, setWithdrawRemark] = useState('');
const [withdrawing, setWithdrawing] = useState(false);
const [distKolStatus, setDistKolStatus] = useState(null);
const [showKolApplyModal, setShowKolApplyModal] = useState(false);
const [kolApplyLoading, setKolApplyLoading] = useState(false);
const [socialLink, setSocialLink] = useState('');
const [followers, setFollowers] = useState('');
const [promotionPlan, setPromotionPlan] = useState('');
const [contactInfo, setContactInfo] = useState('');
useEffect(() => { loadUsage(); }, []);
const loadData = useCallback(async () => {
try {
const [usageRes, affRes, kolRes] = await Promise.all([
getUserUsage(),
getAffCode().catch(() => null),
getDistKolStatus().catch(() => null),
]);
if (usageRes.data.success) setUsage(usageRes.data.data);
if (affRes?.data?.success && affRes.data.data) {
setAffLink(`${window.location.origin}/register?aff=${affRes.data.data}`);
}
if (kolRes?.data?.success) {
setDistKolStatus(kolRes.data.data || null);
}
} catch (e) {
/* interceptor */
}
}, []);
useEffect(() => {
loadData();
}, [loadData]);
const handleRedeem = async (e) => {
e.preventDefault();
@@ -33,20 +78,232 @@ export default function Dashboard() {
if (res.data.success) {
toast.success(t('dashboard.redeemSuccess'));
setRedeemInput('');
await Promise.all([loadUsage(), refreshUser()]);
await Promise.all([loadData(), refreshUser()]);
}
} catch (err) { /* interceptor */ }
} catch (err) {
/* interceptor */
}
setRedeeming(false);
};
const loadAffEarnings = async () => {
setAffEarningsLoading(true);
try {
const res = await getAffEarnings({ page: 1, page_size: 20 });
if (res.data.success && res.data.data) {
setAffEarnings(res.data.data);
}
} catch (e) {
/* interceptor */
}
setAffEarningsLoading(false);
};
const handleCopyAffLink = () => {
if (!affLink) return;
navigator.clipboard.writeText(affLink).then(() => {
toast.success(t('topup.copied'));
}).catch(() => {
toast.error('Copy failed');
});
};
const handleTransfer = async () => {
const val = parseInt(transferAmount);
if (!val || val <= 0) {
toast.error(t('topup.enterAmount'));
return;
}
setTransferring(true);
try {
const res = await transferAffQuota({ quota: val });
if (res.data.success) {
toast.success(res.data.message || t('topup.transferSuccess'));
setTransferAmount('');
await Promise.all([loadData(), refreshUser()]);
}
} catch (e) {
/* interceptor */
}
setTransferring(false);
};
const resetWithdrawForm = () => {
setWithdrawAmount('');
setWithdrawMethod('');
setWithdrawRemark('');
};
const handleOpenWithdraw = () => {
resetWithdrawForm();
setShowWithdrawModal(true);
};
const handleCloseWithdraw = () => {
if (withdrawing) return;
resetWithdrawForm();
setShowWithdrawModal(false);
};
const resetKolApplyForm = () => {
setSocialLink('');
setFollowers('');
setPromotionPlan('');
setContactInfo('');
};
const handleOpenKolApply = () => {
resetKolApplyForm();
setShowKolApplyModal(true);
};
const handleCloseKolApply = () => {
if (kolApplyLoading) return;
resetKolApplyForm();
setShowKolApplyModal(false);
};
const quota = usage?.quota ?? user?.quota ?? 0;
const usedQuota = usage?.used_quota ?? user?.used_quota ?? 0;
const requestCount = usage?.request_count ?? user?.request_count ?? 0;
const balanceDollars = quota / Q * rate;
const balanceDollars = (quota / Q) * rate;
const availableAffAmount = ((user?.aff_quota || 0) / Q) * rate;
const defaultCommissionRate = Number(user?.default_commission_rate ?? 0.05);
const currentCommissionRate = Number(
user?.commission_rate ?? defaultCommissionRate,
);
const hasCustomCommissionRate =
currentCommissionRate > defaultCommissionRate + 1e-8;
const handleWithdraw = async () => {
const amount = Number.parseFloat(withdrawAmount);
if (!Number.isFinite(amount) || amount <= 0) {
toast.error(t('topup.invalidWithdrawAmount'));
return;
}
if (amount - availableAffAmount > 1e-8) {
toast.error(t('topup.withdrawExceedsBalance'));
return;
}
if (!withdrawMethod.trim()) {
toast.error(t('topup.enterWithdrawMethod'));
return;
}
setWithdrawing(true);
try {
const res = await requestAffWithdraw({
amount: amount / rate,
payment_method: withdrawMethod.trim(),
remark: withdrawRemark.trim(),
});
if (res.data.success) {
toast.success(res.data.message || t('topup.withdrawSuccess'));
setShowWithdrawModal(false);
resetWithdrawForm();
await Promise.all([loadData(), refreshUser()]);
}
} catch (err) {
/* interceptor */
}
setWithdrawing(false);
};
const handleKolApply = async () => {
if (!socialLink.trim()) {
toast.error(t('topup.kolSocialRequired'));
return;
}
setKolApplyLoading(true);
try {
const res = await submitDistKolApply({
social_link: socialLink.trim(),
followers: followers.trim(),
promotion_plan: promotionPlan.trim(),
contact_info: contactInfo.trim(),
});
if (res.data.success) {
toast.success(res.data.message || t('topup.kolApplySuccess'));
setShowKolApplyModal(false);
resetKolApplyForm();
await Promise.all([loadData(), refreshUser()]);
}
} catch (err) {
/* interceptor */
}
setKolApplyLoading(false);
};
const renderCommissionApplicationPanel = () => {
if (distKolStatus?.status === 0) {
return (
<div className="glass-sm rounded-xl border border-amber-500/20 bg-amber-500/5 p-4">
<div className="flex items-center justify-between gap-3">
<div>
<p className="text-sm font-medium text-page">{t('topup.kolPendingTitle')}</p>
<p className="mt-1 text-xs text-page-secondary">{t('topup.kolPendingDesc')}</p>
</div>
<span className="rounded-full border border-amber-500/20 bg-amber-500/10 px-3 py-1 text-xs font-medium text-amber-600">
{t('topup.kolPendingBadge')}
</span>
</div>
</div>
);
}
if (distKolStatus?.status === 1 || hasCustomCommissionRate) {
return (
<div className="glass-sm rounded-xl border border-emerald-500/20 bg-emerald-500/5 p-4">
<div className="flex items-center justify-between gap-3">
<div>
<p className="text-sm font-medium text-page">{t('topup.kolApprovedTitle')}</p>
<p className="mt-1 text-xs text-page-secondary">{t('topup.kolApprovedDesc')}</p>
</div>
<span className="rounded-full border border-emerald-500/20 bg-emerald-500/10 px-3 py-1 text-xs font-medium text-emerald-600">
{(currentCommissionRate * 100).toFixed(1)}%
</span>
</div>
{distKolStatus?.admin_remark && (
<p className="mt-3 text-xs text-page-muted">
{t('topup.kolRemarkLabel')}
{distKolStatus.admin_remark}
</p>
)}
</div>
);
}
return (
<div className="glass-sm rounded-xl border border-brand-500/20 bg-brand-500/5 p-4">
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<div>
<p className="text-sm font-medium text-page">{t('topup.kolApplyTitle')}</p>
<p className="mt-1 text-xs text-page-secondary">
{t('topup.kolApplyDesc', {
rate: (defaultCommissionRate * 100).toFixed(1),
})}
</p>
</div>
<button
type="button"
onClick={handleOpenKolApply}
className="btn-primary whitespace-nowrap px-4 py-2 text-sm"
>
{t('topup.kolApplyAction')}
</button>
</div>
{distKolStatus?.status === 2 && (
<p className="mt-3 text-xs text-red-500">
{t('topup.kolRejectedLabel')}
{distKolStatus.admin_remark || t('topup.kolRejectedFallback')}
</p>
)}
</div>
);
};
return (
<div className="max-w-7xl mx-auto px-6 py-10">
{/* Welcome */}
<div className="mb-8">
<h1 className="text-2xl font-heading font-bold text-page mb-1">
{t('dashboard.welcome')} {user?.display_name || user?.username || 'User'}
@@ -54,12 +311,12 @@ export default function Dashboard() {
<p className="text-sm text-page-secondary">{t('dashboard.manageDesc')}</p>
</div>
{/* Stats Cards */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-10">
<div className="glass rounded-2xl p-6">
<p className="text-sm text-page-secondary mb-2">{t('dashboard.balance')}</p>
<div className="text-3xl font-bold text-page">
{symbol}<CountUp from={0} to={Math.round(balanceDollars * 100) / 100} duration={1.5} />
{symbol}
<CountUp from={0} to={Math.round(balanceDollars * 100) / 100} duration={1.5} />
</div>
<p className="text-xs text-page-muted mt-1">{t('dashboard.quotaUnits', { count: quota.toLocaleString() })}</p>
</div>
@@ -67,7 +324,8 @@ export default function Dashboard() {
<div className="glass rounded-2xl p-6">
<p className="text-sm text-page-secondary mb-2">{t('dashboard.used')}</p>
<div className="text-3xl font-bold text-page">
{symbol}<CountUp from={0} to={Math.round(usedQuota / Q * rate * 100) / 100} duration={1.5} />
{symbol}
<CountUp from={0} to={Math.round((usedQuota / Q) * rate * 100) / 100} duration={1.5} />
</div>
<p className="text-xs text-page-muted mt-1">{t('dashboard.quotaUnits', { count: usedQuota.toLocaleString() })}</p>
</div>
@@ -80,9 +338,7 @@ export default function Dashboard() {
</div>
</div>
{/* Quick Actions */}
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
{/* Redeem Code */}
<div className="glass rounded-2xl p-6">
<h2 className="text-lg font-semibold text-page mb-4">{t('dashboard.redeemCode')}</h2>
<form onSubmit={handleRedeem} className="flex gap-3">
@@ -99,7 +355,6 @@ export default function Dashboard() {
</form>
</div>
{/* Quick Links */}
<div className="glass rounded-2xl p-6">
<h2 className="text-lg font-semibold text-page mb-4">{t('dashboard.quickLinks')}</h2>
<div className="grid grid-cols-2 gap-3">
@@ -107,6 +362,10 @@ export default function Dashboard() {
<p className="text-sm font-medium text-page group-hover:text-page-link transition-colors">{t('dashboard.apiKeys')}</p>
<p className="text-xs text-page-muted">{t('dashboard.manageKeys')}</p>
</Link>
<Link to="/topup" className="glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group">
<p className="text-sm font-medium text-page group-hover:text-page-link transition-colors">{t('nav.topup')}</p>
<p className="text-xs text-page-muted">{t('dashboard.topupDesc')}</p>
</Link>
<Link to="/packages" className="glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group">
<p className="text-sm font-medium text-page group-hover:text-page-link transition-colors">{t('dashboard.packages')}</p>
<p className="text-xs text-page-muted">{t('dashboard.viewPlans')}</p>
@@ -119,9 +378,279 @@ export default function Dashboard() {
<p className="text-sm font-medium text-page group-hover:text-page-link transition-colors">{t('dashboard.logs')}</p>
<p className="text-xs text-page-muted">{t('dashboard.viewLogs')}</p>
</Link>
{site?.allow_sub_dist && (
<Link to="/sub-site" className="glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group">
<p className="text-sm font-medium text-page group-hover:text-page-link transition-colors">{t('subDist.nav')}</p>
<p className="text-xs text-page-muted">{t('subDist.dashboardEntry')}</p>
</Link>
)}
</div>
</div>
</div>
{affLink && (
<div className="glass rounded-2xl p-6 mt-6">
<div className="mb-5 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div>
<h2 className="text-lg font-semibold text-page mb-1">{t('topup.inviteTitle')}</h2>
<p className="text-sm text-page-secondary">{t('topup.inviteSubtitle')}</p>
</div>
<div className="inline-flex items-center gap-2 self-start rounded-full border border-brand-500/20 bg-brand-500/10 px-3 py-1 text-xs font-medium text-page">
<span className="text-page-secondary">{t('topup.currentCommissionRateLabel')}</span>
<span className="text-page-link">{(currentCommissionRate * 100).toFixed(1)}%</span>
</div>
</div>
<p className="mb-5 text-xs text-page-muted">
{t('topup.currentCommissionRateDesc', {
rate: (defaultCommissionRate * 100).toFixed(1),
})}
</p>
<div className="mb-5">
{renderCommissionApplicationPanel()}
</div>
<div className="grid grid-cols-3 gap-4 mb-6">
<div className="glass-sm rounded-xl p-4 text-center">
<p className="text-xs text-page-secondary mb-1">{t('topup.affAvailable')}</p>
<p className="text-xl font-bold text-page">
{symbol}{(((user?.aff_quota || 0) / Q) * rate).toFixed(2)}
</p>
</div>
<div className="glass-sm rounded-xl p-4 text-center">
<p className="text-xs text-page-secondary mb-1">{t('topup.affTotal')}</p>
<p className="text-xl font-bold text-page">
{symbol}{(((user?.aff_history_quota || 0) / Q) * rate).toFixed(2)}
</p>
</div>
<div className="glass-sm rounded-xl p-4 text-center">
<p className="text-xs text-page-secondary mb-1">{t('topup.affCount')}</p>
<p className="text-xl font-bold text-page">{user?.aff_count || 0}</p>
</div>
</div>
<div className="mb-5">
<label className="block text-sm font-medium text-page-label mb-2">{t('topup.inviteLink')}</label>
<div className="flex gap-2">
<input type="text" readOnly value={affLink} className="input flex-1 text-sm" />
<button onClick={handleCopyAffLink} className="btn-primary whitespace-nowrap text-sm px-4">
{t('topup.copy')}
</button>
</div>
</div>
{(user?.aff_quota || 0) > 0 && (
<div className="mb-5">
<div className="mb-2 flex items-center justify-between gap-3">
<label className="block text-sm font-medium text-page-label">{t('topup.transferToBalance')}</label>
<button type="button" onClick={handleOpenWithdraw} className="btn-secondary whitespace-nowrap px-4 py-2 text-sm">
{t('topup.withdraw')}
</button>
</div>
<div className="flex gap-2">
<input
type="number"
value={transferAmount}
onChange={(e) => setTransferAmount(e.target.value)}
placeholder={t('topup.transferPlaceholder')}
className="input flex-1 text-sm"
min={1}
/>
<button onClick={handleTransfer} disabled={transferring} className="btn-primary whitespace-nowrap text-sm px-4">
{transferring ? t('topup.processing') : t('topup.transfer')}
</button>
</div>
</div>
)}
<div>
<button
onClick={() => {
setShowAffEarnings(!showAffEarnings);
if (!showAffEarnings) loadAffEarnings();
}}
className="text-sm text-page-secondary hover:text-page transition-colors"
>
{showAffEarnings ? t('topup.hideEarnings') : t('topup.viewEarnings')}
</button>
{showAffEarnings && (
<div className="mt-3">
{affEarningsLoading ? (
<div className="flex justify-center py-6">
<div className="w-6 h-6 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin" />
</div>
) : affEarnings.length === 0 ? (
<p className="text-sm text-page-muted text-center py-6">{t('topup.noEarnings')}</p>
) : (
<div className="space-y-2">
{affEarnings.map((item, i) => (
<div key={i} className="flex items-center justify-between glass-sm rounded-xl px-4 py-3">
<div>
<p className="text-sm text-page">{item.model_name}</p>
<p className="text-xs text-page-muted">
{new Date(item.created_time * 1000).toLocaleString()} · {(item.commission_rate * 100).toFixed(1)}%
</p>
</div>
<span className="text-sm font-medium text-page-success">
+{symbol}{((item.commission_quota / Q) * rate).toFixed(4)}
</span>
</div>
))}
</div>
)}
</div>
)}
</div>
</div>
)}
{showWithdrawModal && (
<div
className="modal-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm"
onClick={handleCloseWithdraw}
>
<div className="glass w-full max-w-md rounded-2xl p-6" onClick={(e) => e.stopPropagation()}>
<div className="mb-5">
<h3 className="text-lg font-semibold text-page mb-1">{t('topup.withdrawTitle')}</h3>
<p className="text-sm text-page-secondary">{t('topup.withdrawSubtitle')}</p>
</div>
<div className="space-y-4">
<div>
<label className="mb-2 block text-sm font-medium text-page-label">{t('topup.withdrawAvailable')}</label>
<input
type="text"
readOnly
value={`${symbol}${availableAffAmount.toFixed(2)}`}
className="input bg-page-surface-hover/60 text-page-secondary"
/>
</div>
<div>
<label className="mb-2 block text-sm font-medium text-page-label">{t('topup.withdrawAmount')}</label>
<div className="flex gap-2">
<div className="relative flex-1">
<span className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-page-muted">
{symbol}
</span>
<input
type="number"
min="0"
step="0.01"
value={withdrawAmount}
onChange={(e) => setWithdrawAmount(e.target.value)}
placeholder="0.00"
className="input pl-8"
/>
</div>
<button type="button" onClick={() => setWithdrawAmount(availableAffAmount.toFixed(2))} className="btn-secondary whitespace-nowrap px-4">
{t('topup.withdrawAll')}
</button>
</div>
</div>
<div>
<label className="mb-2 block text-sm font-medium text-page-label">{t('topup.withdrawMethod')}</label>
<input
type="text"
value={withdrawMethod}
onChange={(e) => setWithdrawMethod(e.target.value)}
placeholder={t('topup.withdrawMethodPlaceholder')}
className="input"
/>
</div>
<div>
<label className="mb-2 block text-sm font-medium text-page-label">{t('topup.withdrawRemark')}</label>
<textarea
value={withdrawRemark}
onChange={(e) => setWithdrawRemark(e.target.value)}
placeholder={t('topup.withdrawRemarkPlaceholder')}
className="input min-h-[96px] resize-y"
/>
</div>
</div>
<div className="mt-6 flex justify-end gap-3">
<button type="button" onClick={handleCloseWithdraw} disabled={withdrawing} className="btn-secondary px-4 py-2">
{t('tokens.cancel')}
</button>
<button type="button" onClick={handleWithdraw} disabled={withdrawing} className="btn-primary px-4 py-2">
{withdrawing ? t('topup.processing') : t('topup.submitWithdraw')}
</button>
</div>
</div>
</div>
)}
{showKolApplyModal && (
<div
className="modal-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm"
onClick={handleCloseKolApply}
>
<div className="glass w-full max-w-md rounded-2xl p-6" onClick={(e) => e.stopPropagation()}>
<div className="mb-5">
<h3 className="text-lg font-semibold text-page mb-1">{t('topup.kolApplyModalTitle')}</h3>
<p className="text-sm text-page-secondary">{t('topup.kolApplyModalDesc')}</p>
</div>
<div className="space-y-4">
<div>
<label className="mb-2 block text-sm font-medium text-page-label">{t('topup.kolSocialLabel')}</label>
<input
type="text"
value={socialLink}
onChange={(e) => setSocialLink(e.target.value)}
placeholder={t('topup.kolSocialPlaceholder')}
className="input"
/>
</div>
<div>
<label className="mb-2 block text-sm font-medium text-page-label">{t('topup.kolFollowersLabel')}</label>
<input
type="text"
value={followers}
onChange={(e) => setFollowers(e.target.value)}
placeholder={t('topup.kolFollowersPlaceholder')}
className="input"
/>
</div>
<div>
<label className="mb-2 block text-sm font-medium text-page-label">{t('topup.kolPlanLabel')}</label>
<textarea
value={promotionPlan}
onChange={(e) => setPromotionPlan(e.target.value)}
placeholder={t('topup.kolPlanPlaceholder')}
className="input min-h-[96px] resize-y"
/>
</div>
<div>
<label className="mb-2 block text-sm font-medium text-page-label">{t('topup.kolContactLabel')}</label>
<input
type="text"
value={contactInfo}
onChange={(e) => setContactInfo(e.target.value)}
placeholder={t('topup.kolContactPlaceholder')}
className="input"
/>
</div>
</div>
<div className="mt-6 flex justify-end gap-3">
<button type="button" onClick={handleCloseKolApply} disabled={kolApplyLoading} className="btn-secondary px-4 py-2">
{t('tokens.cancel')}
</button>
<button type="button" onClick={handleKolApply} disabled={kolApplyLoading} className="btn-primary px-4 py-2">
{kolApplyLoading ? t('topup.processing') : t('topup.kolApplySubmit')}
</button>
</div>
</div>
</div>
)}
</div>
);
}
+1 -1
View File
@@ -285,7 +285,7 @@ export default function Packages() {
const resetPeriod = confirmPkg.quota_reset_period || 'never';
const isSubscription = resetPeriod !== 'never';
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" onClick={() => !subscribing && setConfirmPkg(null)}>
<div className="modal-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" onClick={() => !subscribing && setConfirmPkg(null)}>
<div className="glass rounded-2xl p-6 w-full max-w-sm" onClick={(e) => e.stopPropagation()}>
<h2 className="text-lg font-semibold text-page mb-3">{t('packages.confirmTitle')}</h2>
<p className="text-sm text-page-secondary mb-2">
+19 -4
View File
@@ -45,11 +45,26 @@ export default function Pricing() {
(m.display_name || m.model_name || '').toLowerCase().includes(q)
);
}
// Sort by input_price ascending
list = [...list].sort((a, b) => (Number(a.input_price) || 0) - (Number(b.input_price) || 0));
list = [...list].sort((a, b) => {
if (!!a.is_per_call !== !!b.is_per_call) {
return a.is_per_call ? 1 : -1;
}
if (a.is_per_call) {
return (Number(a.fixed_price) || 0) - (Number(b.fixed_price) || 0);
}
return (Number(a.input_price) || 0) - (Number(b.input_price) || 0);
});
return list;
}, [enabledModels, vendor, search]);
const formatTokenPrice = (price) =>
price != null ? `${symbol}${(Number(price) * 1000 * rate).toFixed(4)}` : '-';
const formatPerCallPrice = (price) =>
price != null
? `${symbol}${(Number(price) * rate).toFixed(4)}/${t('pricing.perCallUnit')}`
: '-';
if (loading) {
return (
<div className="flex items-center justify-center min-h-[50vh]">
@@ -134,10 +149,10 @@ export default function Pricing() {
<span className="font-mono text-page">{m.display_name || m.model_name}</span>
</td>
<td className="px-5 py-3.5 text-right font-mono text-page-label">
{m.input_price != null ? `${symbol}${(Number(m.input_price) * 1000 * rate).toFixed(4)}` : '-'}
{m.is_per_call ? t('pricing.perCall') : formatTokenPrice(m.input_price)}
</td>
<td className="px-5 py-3.5 text-right font-mono text-page-label">
{m.output_price != null ? `${symbol}${(Number(m.output_price) * 1000 * rate).toFixed(4)}` : '-'}
{m.is_per_call ? formatPerCallPrice(m.fixed_price) : formatTokenPrice(m.output_price)}
</td>
<td className="px-5 py-3.5 text-center">
<span className={`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs border ${
+11 -1
View File
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useState, useEffect } from 'react';
import { Link, Navigate, useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { useAuth } from '../context/AuthContext';
@@ -13,6 +13,14 @@ export default function Register() {
const [form, setForm] = useState({ username: '', password: '', password2: '', email: '' });
const [loading, setLoading] = useState(false);
// Capture aff code from URL and persist in localStorage
useEffect(() => {
const affCode = new URLSearchParams(window.location.search).get('aff');
if (affCode) {
localStorage.setItem('dist_aff', affCode);
}
}, []);
// If already logged in, redirect via component
if (user) {
return <Navigate to="/dashboard" replace />;
@@ -38,10 +46,12 @@ export default function Register() {
}
setLoading(true);
try {
const affCode = new URLSearchParams(window.location.search).get('aff') || localStorage.getItem('dist_aff') || '';
const result = await register({
username: form.username,
password: form.password,
email: form.email || undefined,
aff_code: affCode || undefined,
});
if (result.success) {
toast.success(t('register.accountCreated'));
+267
View File
@@ -0,0 +1,267 @@
import React, { useEffect, useMemo, useState } from 'react';
import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import toast from 'react-hot-toast';
import { createSubDistributorOrder, getSubDistributorInfo } from '../api';
import { useAuth } from '../context/AuthContext';
import { useSite } from '../context/SiteContext';
function submitEpayForm(resData) {
const params = resData.data;
const url = resData.url;
if (!params || !url) return;
const form = document.createElement('form');
form.action = url;
form.method = 'POST';
const isSafari = navigator.userAgent.indexOf('Safari') > -1 && navigator.userAgent.indexOf('Chrome') < 1;
if (!isSafari) {
form.target = '_blank';
}
Object.keys(params).forEach((key) => {
const input = document.createElement('input');
input.type = 'hidden';
input.name = key;
input.value = params[key];
form.appendChild(input);
});
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
}
export default function SubDistributor() {
const { t } = useTranslation();
const { user } = useAuth();
const { site } = useSite();
const [loading, setLoading] = useState(true);
const [subInfo, setSubInfo] = useState(null);
const [submitting, setSubmitting] = useState(false);
const [cryptoOrder, setCryptoOrder] = useState(null);
const [form, setForm] = useState({
name: '',
slug: '',
payment_method: '',
chain: 'tron',
token: 'usdt',
});
useEffect(() => {
getSubDistributorInfo()
.then((res) => {
if (res.data.success) {
const info = res.data.data;
setSubInfo(info);
if (info.pay_methods?.length > 0) {
setForm((prev) => ({ ...prev, payment_method: info.pay_methods[0].type }));
}
}
})
.catch(() => {})
.finally(() => setLoading(false));
}, []);
const paymentMethods = subInfo?.pay_methods || [];
const currentPayMethod = useMemo(
() => paymentMethods.find((item) => item.type === form.payment_method),
[paymentMethods, form.payment_method]
);
const handleSubmit = async (e) => {
e.preventDefault();
if (!user) {
toast.error(t('subDist.loginRequired'));
return;
}
if (!form.name.trim() || !form.slug.trim()) {
toast.error(t('subDist.fillRequired'));
return;
}
if (!form.payment_method) {
toast.error(t('subDist.selectPayment'));
return;
}
setSubmitting(true);
setCryptoOrder(null);
try {
const payload = {
name: form.name.trim(),
slug: form.slug.trim().toLowerCase(),
payment_method: form.payment_method,
};
if (form.payment_method === 'crypto') {
payload.chain = form.chain;
payload.token = form.token;
}
const res = await createSubDistributorOrder(payload);
if (res.data.message === 'success') {
if (res.data.payment_type === 'stripe' && res.data.data?.pay_link) {
window.open(res.data.data.pay_link, '_blank');
} else if (res.data.payment_type === 'crypto') {
setCryptoOrder(res.data.data);
} else {
submitEpayForm(res.data);
}
} else if (res.data.data) {
toast.error(typeof res.data.data === 'string' ? res.data.data : t('subDist.createFailed'));
}
} catch (e) {
// handled by interceptor
}
setSubmitting(false);
};
if (loading) {
return (
<div className="min-h-[60vh] flex items-center justify-center">
<div className="w-8 h-8 rounded-full border-2 border-white/20 border-t-white animate-spin" />
</div>
);
}
return (
<div className="max-w-5xl mx-auto px-6 py-12">
<div className="grid lg:grid-cols-[1.1fr_0.9fr] gap-6 items-start">
<div className="glass rounded-3xl p-8">
<div className="mb-8">
<p className="text-sm text-page-link font-medium mb-3">{t('subDist.badge')}</p>
<h1 className="text-3xl font-heading font-bold text-page mb-3">{t('subDist.title')}</h1>
<p className="text-sm text-page-secondary leading-6">
{t('subDist.subtitle', { name: site?.name || t('subDist.defaultSiteName') })}
</p>
</div>
{!subInfo?.enabled ? (
<div className="rounded-2xl border border-red-500/20 bg-red-500/5 p-5">
<p className="text-sm font-medium text-page mb-2">{t('subDist.notAvailable')}</p>
<p className="text-sm text-page-secondary">{subInfo?.disabled_reason || t('subDist.disabledFallback')}</p>
</div>
) : !user ? (
<div className="rounded-2xl border border-border p-5 space-y-4">
<p className="text-sm text-page-secondary">{t('subDist.loginHint')}</p>
<div className="flex flex-wrap gap-3">
<Link to="/login" className="btn-primary">{t('subDist.goLogin')}</Link>
<Link to="/register" className="btn-secondary">{t('subDist.goRegister')}</Link>
</div>
</div>
) : (
<form onSubmit={handleSubmit} className="space-y-5">
<div>
<label className="block text-sm font-medium text-page-label mb-2">{t('subDist.siteName')}</label>
<input
value={form.name}
onChange={(e) => setForm({ ...form, name: e.target.value })}
className="input"
placeholder={t('subDist.siteNamePlaceholder')}
required
/>
</div>
<div>
<label className="block text-sm font-medium text-page-label mb-2">{t('subDist.siteSlug')}</label>
<input
value={form.slug}
onChange={(e) => setForm({ ...form, slug: e.target.value.toLowerCase() })}
className="input"
placeholder="my-sub-site"
required
/>
<p className="text-xs text-page-muted mt-2">{t('subDist.siteSlugHelp')}</p>
</div>
<div>
<label className="block text-sm font-medium text-page-label mb-2">{t('subDist.paymentMethod')}</label>
<div className="grid sm:grid-cols-2 gap-3">
{paymentMethods.map((method) => (
<label
key={method.type}
className={`rounded-2xl border px-4 py-3 cursor-pointer transition-colors ${
form.payment_method === method.type
? 'border-page-link bg-page-link/10'
: 'border-border hover:bg-page-surface-hover'
}`}
>
<input
type="radio"
className="sr-only"
checked={form.payment_method === method.type}
onChange={() => setForm({ ...form, payment_method: method.type })}
/>
<div className="text-sm font-medium text-page">{method.name || method.type}</div>
</label>
))}
</div>
</div>
{form.payment_method === 'crypto' && (
<div className="grid sm:grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-page-label mb-2">{t('subDist.chain')}</label>
<select value={form.chain} onChange={(e) => setForm({ ...form, chain: e.target.value })} className="input">
<option value="tron">TRON (TRC20)</option>
<option value="eth">Ethereum (ERC20)</option>
<option value="bsc">BSC (BEP20)</option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-page-label mb-2">{t('subDist.token')}</label>
<select value={form.token} onChange={(e) => setForm({ ...form, token: e.target.value })} className="input">
<option value="usdt">USDT</option>
<option value="usdc">USDC</option>
</select>
</div>
</div>
)}
<button type="submit" disabled={submitting} className="btn-primary w-full justify-center flex items-center gap-2">
{submitting && <span className="w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" />}
{t('subDist.payAndOpen', { price: Number(subInfo?.price || 0).toFixed(2) })}
</button>
<p className="text-xs text-page-muted">
{t('subDist.currentUserHint', { user: user.display_name || user.username || 'User', method: currentPayMethod?.name || form.payment_method })}
</p>
<p className="text-xs text-page-muted">
{t('subDist.postPayHint')}
</p>
</form>
)}
{cryptoOrder && (
<div className="mt-6 rounded-2xl border border-emerald-500/20 bg-emerald-500/5 p-5 space-y-2">
<p className="text-sm font-medium text-page">{t('subDist.cryptoTitle')}</p>
<p className="text-sm text-page-secondary">{t('subDist.cryptoHint')}</p>
<div className="text-sm text-page">
<div>{t('subDist.wallet')}: <span className="font-mono break-all">{cryptoOrder.wallet}</span></div>
<div>{t('subDist.amount')}: <span className="font-mono">{cryptoOrder.amount} {cryptoOrder.token}</span></div>
<div>{t('subDist.tradeNo')}: <span className="font-mono break-all">{cryptoOrder.trade_no}</span></div>
</div>
</div>
)}
</div>
<div className="space-y-6">
<div className="glass rounded-3xl p-6">
<h2 className="text-lg font-semibold text-page mb-4">{t('subDist.priceCardTitle')}</h2>
<div className="space-y-4">
<div className="flex items-center justify-between text-sm">
<span className="text-page-secondary">{t('subDist.openPrice')}</span>
<span className="text-2xl font-bold text-page">¥{Number(subInfo?.price || 0).toFixed(2)}</span>
</div>
<p className="text-sm text-page-secondary leading-6">{t('subDist.priceSummary')}</p>
</div>
</div>
<div className="glass rounded-3xl p-6">
<h2 className="text-lg font-semibold text-page mb-4">{t('subDist.ruleTitle')}</h2>
<div className="space-y-3 text-sm text-page-secondary leading-6">
<p>{t('subDist.rule1')}</p>
<p>{t('subDist.rule2')}</p>
<p>{t('subDist.rule3')}</p>
</div>
</div>
</div>
</div>
</div>
);
}
+3 -9
View File
@@ -1,7 +1,6 @@
import React, { useState, useEffect, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { getTokens, createToken, updateToken, deleteToken, getSiteKeyGroups } from '../api';
import ConfigExporter from '../components/ConfigExporter';
import toast from 'react-hot-toast';
export default function Tokens() {
@@ -200,7 +199,7 @@ export default function Tokens() {
{/* ========== Create Modal ========== */}
{showCreate && (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" onClick={() => { setShowCreate(false); setSelectedGroupId(0); }}>
<div className="modal-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" onClick={() => { setShowCreate(false); setSelectedGroupId(0); }}>
<div className="glass rounded-2xl p-6 w-full max-w-md" onClick={(e) => e.stopPropagation()}>
<h2 className="text-lg font-semibold text-page mb-4">{t('tokens.createApiKey')}</h2>
{selectedGroupId > 0 && (() => {
@@ -240,7 +239,7 @@ export default function Tokens() {
{/* ========== New Key Reveal Modal ========== */}
{newKey && (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm">
<div className="modal-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm">
<div className="glass rounded-2xl p-6 w-full max-w-lg">
<h2 className="text-lg font-semibold text-page mb-2">{t('tokens.newApiKey')}</h2>
<div className="bg-yellow-500/10 border border-yellow-500/20 rounded-xl p-3 mb-4">
@@ -270,7 +269,7 @@ export default function Tokens() {
{/* ========== Delete Confirmation Modal ========== */}
{deleteConfirm && (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" onClick={() => setDeleteConfirm(null)}>
<div className="modal-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" onClick={() => setDeleteConfirm(null)}>
<div className="glass rounded-2xl p-6 w-full max-w-sm" onClick={(e) => e.stopPropagation()}>
<h2 className="text-lg font-semibold text-page mb-3">{t('tokens.deleteToken')}</h2>
<p className="text-sm text-page-secondary mb-4">
@@ -351,11 +350,6 @@ export default function Tokens() {
</div>
)}
</div>
{/* Config File Generator */}
<div className="mt-8">
<ConfigExporter />
</div>
</div>
);
}
+117 -94
View File
@@ -28,6 +28,7 @@ export default function Topup() {
// Online topup
const [amount, setAmount] = useState('');
const [displayAmount, setDisplayAmount] = useState('');
const [selectedPreset, setSelectedPreset] = useState(null);
const [payAmount, setPayAmount] = useState(null);
const [amountLoading, setAmountLoading] = useState(false);
@@ -50,6 +51,14 @@ export default function Topup() {
const enableTopup = site?.enable_topup && topupInfo;
const topupConfig = site?.topup_config;
const presetAmounts = topupInfo?.amount_options || [1, 5, 10, 20, 50, 100];
const minTopup = topupInfo?.min_topup || 1;
const payMethods = topupInfo?.pay_methods || [];
const enableOnline = topupInfo?.enable_online_topup;
const enableStripe = topupInfo?.enable_stripe_topup;
const enableCreem = topupInfo?.enable_creem_topup;
const enableCrypto = topupInfo?.enable_crypto_topup;
const hasAnyPayment = enableOnline || enableStripe || enableCreem || enableCrypto;
const loadData = useCallback(async () => {
setLoading(true);
@@ -71,6 +80,22 @@ export default function Topup() {
const requestCount = usage?.request_count ?? user?.request_count ?? 0;
const balanceDollars = quota / Q * rate;
const formatCurrencyAmount = useCallback((value) => {
if (value === '' || value == null || Number.isNaN(Number(value))) return '';
return Number(value).toFixed(2).replace(/\.?0+$/, '');
}, []);
const toDisplayAmount = useCallback((quotaAmount) => {
if (quotaAmount === '' || quotaAmount == null) return '';
return formatCurrencyAmount(Number(quotaAmount) * rate);
}, [formatCurrencyAmount, rate]);
const toQuotaAmount = useCallback((currencyAmount) => {
const numeric = Number.parseFloat(currencyAmount);
if (!Number.isFinite(numeric) || numeric <= 0) return '';
return Math.max(minTopup, Math.round(numeric / rate));
}, [minTopup, rate]);
// Redeem
const handleRedeem = async (e) => {
e.preventDefault();
@@ -103,7 +128,8 @@ export default function Topup() {
// Select preset
const handlePreset = (val) => {
setSelectedPreset(val);
setAmount(val);
setAmount(String(val));
setDisplayAmount(toDisplayAmount(val));
calcAmount(val);
};
@@ -291,15 +317,6 @@ export default function Topup() {
setHistoryLoading(false);
};
const presetAmounts = topupInfo?.amount_options || [1, 5, 10, 20, 50, 100];
const minTopup = topupInfo?.min_topup || 1;
const payMethods = topupInfo?.pay_methods || [];
const enableOnline = topupInfo?.enable_online_topup;
const enableStripe = topupInfo?.enable_stripe_topup;
const enableCreem = topupInfo?.enable_creem_topup;
const enableCrypto = topupInfo?.enable_crypto_topup;
const hasAnyPayment = enableOnline || enableStripe || enableCreem || enableCrypto;
// Filter pay methods: EPay methods + Stripe-based methods go in the main payment buttons
// Creem and Crypto get their own sections
const epayAndStripeMethods = payMethods.filter(
@@ -346,8 +363,8 @@ export default function Topup() {
</div>
</div>
{/* Online Topup - EPay & Stripe */}
{site?.enable_topup && (enableOnline || enableStripe) && epayAndStripeMethods.length > 0 && (
{/* Online Topup - EPay & Stripe & Crypto */}
{site?.enable_topup && (enableOnline || enableStripe || enableCrypto) && (epayAndStripeMethods.length > 0 || enableCrypto) && (
<div className="glass rounded-2xl p-6 mb-6">
<div className="flex items-center justify-between mb-6">
<h2 className="text-lg font-semibold text-page">{t('topup.onlineTopup')}</h2>
@@ -373,7 +390,7 @@ export default function Topup() {
: 'glass-sm text-page-label hover:text-page hover:bg-page-surface-hover'
}`}
>
{symbol}{val}
{symbol}{formatCurrencyAmount(val * rate)}
</button>
))}
</div>
@@ -385,22 +402,50 @@ export default function Topup() {
<div className="flex gap-3">
<input
type="number"
value={amount}
value={displayAmount}
onChange={(e) => {
setAmount(e.target.value);
const currentValue = e.target.value;
setDisplayAmount(currentValue);
setSelectedPreset(null);
const quotaAmount = toQuotaAmount(currentValue);
setAmount(quotaAmount === '' ? '' : String(quotaAmount));
calcAmount(quotaAmount);
}}
onBlur={(e) => calcAmount(e.target.value)}
min={minTopup}
placeholder={t('topup.amountPlaceholder', { min: minTopup })}
onBlur={(e) => {
const quotaAmount = toQuotaAmount(e.target.value);
if (quotaAmount === '') {
setDisplayAmount('');
setAmount('');
setPayAmount(null);
return;
}
setAmount(String(quotaAmount));
setDisplayAmount(toDisplayAmount(quotaAmount));
calcAmount(quotaAmount);
}}
min={minTopup * rate}
step="0.01"
placeholder={t('topup.amountPlaceholder', { min: formatCurrencyAmount(minTopup * rate) })}
className="input flex-1"
/>
</div>
<p className="text-xs text-page-muted mt-2">
{t('topup.customAmountHint')}
</p>
{amountLoading ? (
<p className="text-xs text-page-muted mt-2">{t('topup.calculating')}</p>
) : payAmount ? (
<p className="text-xs text-page-secondary mt-2">
{t('topup.payAmountLabel')}: <span className="text-page-success font-medium">¥{payAmount}</span>
<div className="mt-2 space-y-1 text-xs text-page-secondary">
<p>
{t('topup.rechargeAmountLabel')}: <span className="text-page font-medium">{symbol}{displayAmount || toDisplayAmount(amount)}</span>
</p>
<p>
{t('topup.payAmountLabel')}: <span className="text-page-success font-medium">{symbol}{payAmount}</span>
</p>
</div>
) : amount ? (
<p className="text-xs text-page-muted mt-2">
{t('topup.rechargeAmountLabel')}: {symbol}{displayAmount || toDisplayAmount(amount)}
</p>
) : null}
</div>
@@ -424,6 +469,57 @@ export default function Topup() {
})}
</div>
</div>
{/* Crypto Payment (inline) */}
{enableCrypto && availableChains.length > 0 && (
<div className="mt-6 pt-6 border-t border-page-divider">
<label className="block text-sm font-medium text-page-label mb-3">{t('topup.cryptoPayment')}</label>
<div className="flex flex-wrap items-center gap-3">
{/* Chain */}
<div className="flex gap-1.5">
{availableChains.map((chain) => (
<button
key={chain.key}
onClick={() => setSelectedChain(chain.key)}
className={`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${
selectedChain === chain.key
? 'bg-brand-500 text-white shadow-lg shadow-brand-500/25'
: 'glass-sm text-page-label hover:text-page hover:bg-page-surface-hover'
}`}
>
{chain.label}
</button>
))}
</div>
{/* Token */}
<div className="flex gap-1.5">
{['usdt', 'usdc'].map((token) => (
<button
key={token}
onClick={() => setSelectedToken(token)}
className={`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${
selectedToken === token
? 'bg-brand-500 text-white shadow-lg shadow-brand-500/25'
: 'glass-sm text-page-label hover:text-page hover:bg-page-surface-hover'
}`}
>
{token.toUpperCase()}
</button>
))}
</div>
{/* Pay */}
<button
onClick={handleCryptoPay}
disabled={paymentLoading || !amount}
className="px-4 py-2.5 rounded-xl text-sm font-medium glass-sm text-page-label hover:text-page hover:bg-page-surface-hover disabled:opacity-40 disabled:cursor-not-allowed transition-all"
>
{paymentLoading && payingMethod === 'crypto'
? t('topup.processing')
: `${selectedToken.toUpperCase()} (${availableChains.find(c => c.key === selectedChain)?.label || selectedChain})`}
</button>
</div>
</div>
)}
</div>
)}
@@ -468,82 +564,9 @@ export default function Topup() {
</div>
)}
{/* Crypto Payment Section */}
{site?.enable_topup && enableCrypto && availableChains.length > 0 && (
<div className="glass rounded-2xl p-6 mb-6">
<h2 className="text-lg font-semibold text-page mb-4">{t('topup.cryptoPayment')}</h2>
{/* Amount input for crypto */}
<div className="mb-4">
<label className="block text-sm font-medium text-page-label mb-2">{t('topup.amount')}</label>
<input
type="number"
value={amount}
onChange={(e) => {
setAmount(e.target.value);
setSelectedPreset(null);
}}
min={minTopup}
placeholder={t('topup.amountPlaceholder', { min: minTopup })}
className="input w-full"
/>
</div>
{/* Chain Selector */}
<div className="mb-4">
<label className="block text-sm font-medium text-page-label mb-2">{t('topup.chain')}</label>
<div className="flex flex-wrap gap-2">
{availableChains.map((chain) => (
<button
key={chain.key}
onClick={() => setSelectedChain(chain.key)}
className={`px-4 py-2 rounded-xl text-sm font-medium transition-all ${
selectedChain === chain.key
? 'bg-brand-500 text-white shadow-lg shadow-brand-500/25'
: 'glass-sm text-page-label hover:text-page hover:bg-page-surface-hover'
}`}
>
{chain.label}
</button>
))}
</div>
</div>
{/* Token Selector */}
<div className="mb-4">
<label className="block text-sm font-medium text-page-label mb-2">{t('topup.token') || 'Token'}</label>
<div className="flex gap-2">
{['usdt', 'usdc'].map((token) => (
<button
key={token}
onClick={() => setSelectedToken(token)}
className={`px-4 py-2 rounded-xl text-sm font-medium transition-all ${
selectedToken === token
? 'bg-brand-500 text-white shadow-lg shadow-brand-500/25'
: 'glass-sm text-page-label hover:text-page hover:bg-page-surface-hover'
}`}
>
{token.toUpperCase()}
</button>
))}
</div>
</div>
<button
onClick={handleCryptoPay}
disabled={paymentLoading || !amount}
className="btn-primary w-full"
>
{paymentLoading && payingMethod === 'crypto'
? t('topup.processing')
: `${t('topup.payWith') || 'Pay with'} ${selectedToken.toUpperCase()} (${availableChains.find(c => c.key === selectedChain)?.label || selectedChain})`}
</button>
</div>
)}
{/* Crypto Payment Modal */}
{cryptoOrder && (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" onClick={() => setCryptoOrder(null)}>
<div className="modal-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm" onClick={() => setCryptoOrder(null)}>
<div className="glass rounded-2xl p-6 max-w-md w-full mx-4" onClick={(e) => e.stopPropagation()}>
<h3 className="text-lg font-semibold text-page mb-4">{t('topup.cryptoPayment')}</h3>
<div className="space-y-4">
+1
View File
@@ -19,6 +19,7 @@ export default function ClaudeLayout() {
{ to: '/', label: t('nav.home'), auth: false },
{ to: '/pricing', label: t('nav.pricing'), auth: false },
{ to: '/packages', label: t('nav.packages'), auth: false },
...(site?.allow_sub_dist ? [{ to: '/sub-site', label: t('subDist.nav'), auth: false }] : []),
{ to: '/dashboard', label: t('nav.dashboard'), auth: true },
{ to: '/tokens', label: t('nav.apiKeys'), auth: true },
{ to: '/logs', label: t('nav.logs'), auth: true },
+1
View File
@@ -19,6 +19,7 @@ export default function CleanLayout() {
{ to: '/', label: t('nav.home'), auth: false },
{ to: '/pricing', label: t('nav.pricing'), auth: false },
{ to: '/packages', label: t('nav.packages'), auth: false },
...(site?.allow_sub_dist ? [{ to: '/sub-site', label: t('subDist.nav'), auth: false }] : []),
{ to: '/dashboard', label: t('nav.dashboard'), auth: true },
{ to: '/tokens', label: t('nav.apiKeys'), auth: true },
{ to: '/logs', label: t('nav.logs'), auth: true },
+1
View File
@@ -19,6 +19,7 @@ export default function CorporateLayout() {
{ to: '/', label: t('nav.home'), auth: false },
{ to: '/pricing', label: t('nav.pricing'), auth: false },
{ to: '/packages', label: t('nav.packages'), auth: false },
...(site?.allow_sub_dist ? [{ to: '/sub-site', label: t('subDist.nav'), auth: false }] : []),
{ to: '/dashboard', label: t('nav.dashboard'), auth: true },
{ to: '/tokens', label: t('nav.apiKeys'), auth: true },
{ to: '/logs', label: t('nav.logs'), auth: true },
+1
View File
@@ -19,6 +19,7 @@ export default function DarkLayout() {
{ to: '/', label: t('nav.home'), auth: false },
{ to: '/pricing', label: t('nav.pricing'), auth: false },
{ to: '/packages', label: t('nav.packages'), auth: false },
...(site?.allow_sub_dist ? [{ to: '/sub-site', label: t('subDist.nav'), auth: false }] : []),
{ to: '/dashboard', label: t('nav.dashboard'), auth: true },
{ to: '/tokens', label: t('nav.apiKeys'), auth: true },
{ to: '/logs', label: t('nav.logs'), auth: true },
+1
View File
@@ -19,6 +19,7 @@ export default function DefaultLayout() {
{ to: '/', label: t('nav.home'), auth: false },
{ to: '/pricing', label: t('nav.pricing'), auth: false },
{ to: '/packages', label: t('nav.packages'), auth: false },
...(site?.allow_sub_dist ? [{ to: '/sub-site', label: t('subDist.nav'), auth: false }] : []),
{ to: '/dashboard', label: t('nav.dashboard'), auth: true },
{ to: '/tokens', label: t('nav.apiKeys'), auth: true },
{ to: '/logs', label: t('nav.logs'), auth: true },
+1
View File
@@ -19,6 +19,7 @@ export default function MinimalLayout() {
{ to: '/', label: t('nav.home'), auth: false },
{ to: '/pricing', label: t('nav.pricing'), auth: false },
{ to: '/packages', label: t('nav.packages'), auth: false },
...(site?.allow_sub_dist ? [{ to: '/sub-site', label: t('subDist.nav'), auth: false }] : []),
{ to: '/dashboard', label: t('nav.dashboard'), auth: true },
{ to: '/tokens', label: t('nav.apiKeys'), auth: true },
{ to: '/logs', label: t('nav.logs'), auth: true },
+1
View File
@@ -19,6 +19,7 @@ export default function StarterLayout() {
{ to: '/', label: t('nav.home'), auth: false },
{ to: '/pricing', label: t('nav.pricing'), auth: false },
{ to: '/packages', label: t('nav.packages'), auth: false },
...(site?.allow_sub_dist ? [{ to: '/sub-site', label: t('subDist.nav'), auth: false }] : []),
{ to: '/dashboard', label: t('nav.dashboard'), auth: true },
{ to: '/tokens', label: t('nav.apiKeys'), auth: true },
{ to: '/logs', label: t('nav.logs'), auth: true },
+51 -42
View File
@@ -7,38 +7,38 @@ import { Q } from '../api';
// Patterns must match actual backend model_name format (e.g. "claude-opus-4-5-20251101").
const OFFICIAL_PRICES = [
// Claude — order matters: longer/more-specific first
{ pattern: 'claude-opus-4-5', label: 'Claude Opus 4.5', inputPerMtok: 5 },
{ pattern: 'claude-opus-4-6', label: 'Claude Opus 4.6', inputPerMtok: 5 },
{ pattern: 'claude-opus-4-1', label: 'Claude Opus 4.1', inputPerMtok: 15 },
{ pattern: 'claude-opus-4', label: 'Claude Opus 4', inputPerMtok: 15 },
{ pattern: 'claude-3-opus', label: 'Claude 3 Opus', inputPerMtok: 15 },
{ pattern: 'claude-sonnet-4-5', label: 'Claude Sonnet 4.5', inputPerMtok: 3 },
{ pattern: 'claude-sonnet-4-6', label: 'Claude Sonnet 4.6', inputPerMtok: 3 },
{ pattern: 'claude-sonnet-4', label: 'Claude Sonnet 4', inputPerMtok: 3 },
{ pattern: 'claude-3-7-sonnet', label: 'Claude 3.7 Sonnet', inputPerMtok: 3 },
{ pattern: 'claude-3-5-sonnet', label: 'Claude 3.5 Sonnet', inputPerMtok: 3 },
{ pattern: 'claude-haiku-4-5', label: 'Claude Haiku 4.5', inputPerMtok: 1 },
{ pattern: 'claude-3-5-haiku', label: 'Claude 3.5 Haiku', inputPerMtok: 0.8 },
{ pattern: 'claude-3-haiku', label: 'Claude 3 Haiku', inputPerMtok: 0.25 },
{ pattern: 'claude-opus-4-5', label: 'Claude Opus 4.5', inputPerMtok: 5, family: 'claudecode' },
{ pattern: 'claude-opus-4-6', label: 'Claude Opus 4.6', inputPerMtok: 5, family: 'claudecode' },
{ pattern: 'claude-opus-4-1', label: 'Claude Opus 4.1', inputPerMtok: 15, family: 'claudecode' },
{ pattern: 'claude-opus-4', label: 'Claude Opus 4', inputPerMtok: 15, family: 'claudecode' },
{ pattern: 'claude-3-opus', label: 'Claude 3 Opus', inputPerMtok: 15, family: 'claudecode' },
{ pattern: 'claude-sonnet-4-5', label: 'Claude Sonnet 4.5', inputPerMtok: 3, family: 'claudecode' },
{ pattern: 'claude-sonnet-4-6', label: 'Claude Sonnet 4.6', inputPerMtok: 3, family: 'claudecode' },
{ pattern: 'claude-sonnet-4', label: 'Claude Sonnet 4', inputPerMtok: 3, family: 'claudecode' },
{ pattern: 'claude-3-7-sonnet', label: 'Claude 3.7 Sonnet', inputPerMtok: 3, family: 'claudecode' },
{ pattern: 'claude-3-5-sonnet', label: 'Claude 3.5 Sonnet', inputPerMtok: 3, family: 'claudecode' },
{ pattern: 'claude-haiku-4-5', label: 'Claude Haiku 4.5', inputPerMtok: 1, family: 'claudecode' },
{ pattern: 'claude-3-5-haiku', label: 'Claude 3.5 Haiku', inputPerMtok: 0.8, family: 'claudecode' },
{ pattern: 'claude-3-haiku', label: 'Claude 3 Haiku', inputPerMtok: 0.25, family: 'claudecode' },
// OpenAI — more specific first
{ pattern: 'gpt-4o-mini', label: 'GPT-4o Mini', inputPerMtok: 0.15 },
{ pattern: 'gpt-4o-2024-05-13', label: 'GPT-4o', inputPerMtok: 5 },
{ pattern: 'chatgpt-4o-latest', label: 'GPT-4o', inputPerMtok: 5 },
{ pattern: 'gpt-4o', label: 'GPT-4o', inputPerMtok: 2.5 },
{ pattern: 'gpt-4.1-mini', label: 'GPT-4.1 Mini', inputPerMtok: 0.4 },
{ pattern: 'gpt-4.1-nano', label: 'GPT-4.1 Nano', inputPerMtok: 0.1 },
{ pattern: 'gpt-4.1', label: 'GPT-4.1', inputPerMtok: 2 },
{ pattern: 'gpt-5.4', label: 'GPT-5.4', inputPerMtok: 2.5 },
{ pattern: 'gpt-5.3', label: 'GPT-5.3', inputPerMtok: 1.75 },
{ pattern: 'gpt-5.2', label: 'GPT-5.2', inputPerMtok: 1.75 },
{ pattern: 'gpt-5.1', label: 'GPT-5.1', inputPerMtok: 1.25 },
{ pattern: 'gpt-4o-mini', label: 'GPT-4o Mini', inputPerMtok: 0.15, family: 'gpt' },
{ pattern: 'gpt-4o-2024-05-13', label: 'GPT-4o', inputPerMtok: 5, family: 'gpt' },
{ pattern: 'chatgpt-4o-latest', label: 'GPT-4o', inputPerMtok: 5, family: 'gpt' },
{ pattern: 'gpt-4o', label: 'GPT-4o', inputPerMtok: 2.5, family: 'gpt' },
{ pattern: 'gpt-4.1-mini', label: 'GPT-4.1 Mini', inputPerMtok: 0.4, family: 'gpt' },
{ pattern: 'gpt-4.1-nano', label: 'GPT-4.1 Nano', inputPerMtok: 0.1, family: 'gpt' },
{ pattern: 'gpt-4.1', label: 'GPT-4.1', inputPerMtok: 2, family: 'gpt' },
{ pattern: 'gpt-5.4', label: 'GPT-5.4', inputPerMtok: 2.5, family: 'gpt' },
{ pattern: 'gpt-5.3', label: 'GPT-5.3', inputPerMtok: 1.75, family: 'gpt' },
{ pattern: 'gpt-5.2', label: 'GPT-5.2', inputPerMtok: 1.75, family: 'gpt' },
{ pattern: 'gpt-5.1', label: 'GPT-5.1', inputPerMtok: 1.25, family: 'gpt' },
// Gemini — more specific first
{ pattern: 'gemini-2.5-flash-lite', label: 'Gemini 2.5 Flash Lite', inputPerMtok: 0.04 },
{ pattern: 'gemini-2.5-flash', label: 'Gemini 2.5 Flash', inputPerMtok: 0.15 },
{ pattern: 'gemini-2.5-pro', label: 'Gemini 2.5 Pro', inputPerMtok: 1.25 },
{ pattern: 'gemini-2.0-flash', label: 'Gemini 2.0 Flash', inputPerMtok: 0.1 },
{ pattern: 'gemini-1.5-pro', label: 'Gemini 1.5 Pro', inputPerMtok: 1.25 },
{ pattern: 'gemini-1.5-flash', label: 'Gemini 1.5 Flash', inputPerMtok: 0.075 },
{ pattern: 'gemini-2.5-flash-lite', label: 'Gemini 2.5 Flash Lite', inputPerMtok: 0.04, family: 'gemini' },
{ pattern: 'gemini-2.5-flash', label: 'Gemini 2.5 Flash', inputPerMtok: 0.15, family: 'gemini' },
{ pattern: 'gemini-2.5-pro', label: 'Gemini 2.5 Pro', inputPerMtok: 1.25, family: 'gemini' },
{ pattern: 'gemini-2.0-flash', label: 'Gemini 2.0 Flash', inputPerMtok: 0.1, family: 'gemini' },
{ pattern: 'gemini-1.5-pro', label: 'Gemini 1.5 Pro', inputPerMtok: 1.25, family: 'gemini' },
{ pattern: 'gemini-1.5-flash', label: 'Gemini 1.5 Flash', inputPerMtok: 0.075, family: 'gemini' },
// DeepSeek
{ pattern: 'deepseek-r1', label: 'DeepSeek R1', inputPerMtok: 0.55 },
{ pattern: 'deepseek-chat', label: 'DeepSeek V3', inputPerMtok: 0.27 },
@@ -46,16 +46,15 @@ const OFFICIAL_PRICES = [
];
/**
* Find ALL official equivalents for a given quota.
* Returns array of { label, equivDollars } sorted by equivDollars desc.
* Only includes results where equivDollars > quotaDollars.
* Deduplicates by label (keeps best ratio per model label).
* Find official equivalents for the three headline families only:
* GPT, Claude Code, and Gemini.
* Returns at most one best result per family, in fixed display order.
*/
export function calcOfficialEquivList(models, quotaDollars) {
if (!models || models.length === 0 || quotaDollars <= 0) return [];
// label -> best equivDollars
const bestByLabel = {};
const familyOrder = ['gpt', 'claudecode', 'gemini'];
const bestByFamily = {};
for (const m of models) {
const siteInputPrice = Number(m.input_price);
@@ -65,13 +64,20 @@ export function calcOfficialEquivList(models, quotaDollars) {
for (const official of OFFICIAL_PRICES) {
if (modelName.includes(official.pattern.toLowerCase())) {
if (!official.family || !familyOrder.includes(official.family)) break;
const sitePricePerMtok = siteInputPrice * 1000;
const ratio = official.inputPerMtok / sitePricePerMtok;
const equivDollars = quotaDollars * ratio;
if (equivDollars > quotaDollars) {
if (!bestByLabel[official.label] || equivDollars > bestByLabel[official.label]) {
bestByLabel[official.label] = equivDollars;
const currentBest = bestByFamily[official.family];
if (!currentBest || equivDollars > currentBest.equivDollars) {
bestByFamily[official.family] = {
family: official.family,
label: official.label,
equivDollars,
};
}
}
break;
@@ -79,10 +85,13 @@ export function calcOfficialEquivList(models, quotaDollars) {
}
}
return Object.entries(bestByLabel)
.map(([label, equivDollars]) => ({ label, equivDollars: Math.round(equivDollars) }))
.sort((a, b) => b.equivDollars - a.equivDollars)
.slice(0, 3);
return familyOrder
.map((family) => bestByFamily[family])
.filter(Boolean)
.map((item) => ({
label: item.label,
equivDollars: Math.round(item.equivDollars),
}));
}
/**