PageSourceSearch

https://bytepass.ai/assets/index-xMHQ6xfX.js

js bytepass.ai collected 2026-10-05 12:51:20 UTC 187,300 bytes, 100 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SetupWizardView-DE9PTnoT.js","assets/vendor-vue-BVJWaRIf.js","assets/Select-CGXIqEG2.js","assets/vendor-i18n-pgwztqC8.js","assets/Select-CPyyRh5M.css","assets/Toggle.vue_vue_type_script_setup_true_lang-DRUF2Z-I.js","assets/vendor-misc-g39fh_pU.js","assets/vendor-misc-DB0Q8XAf.css","assets/HomeView-Dlb2A_zL.js","assets/LocaleSwitcher-6jc2cSqg.js","assets/LocaleSwitcher-CjvPxOhx.css","assets/HomeView-Dagk0jRk.css","assets/LoginView-C6T8KC1R.js","assets/AppHeader.vue_vue_type_style_index_0_scoped_59fb3e77_lang-B0IcU52u.js","assets/AppHeader-C6BDtlna.css","assets/useClipboard-sjDNYCUN.js","assets/AuthLayout-lO52Axqa.js","assets/AuthLayout-BMNyCXdz.css","assets/LoginAgreementPrompt-B7CvtFaS.js","assets/oauthAffiliate-CrlUwkd1.js","assets/LoginAgreementPrompt-DhEkaHwn.css","assets/CaptchaChallenge.vue_vue_type_script_setup_true_lang-B3FeKZF6.js","assets/CaptchaChallenge-BmkiKxf7.css","assets/apiError-zX02PgX9.js","assets/LoginView-mYEDiWCN.css","assets/RegisterView-Pb97QRP2.js","assets/authError-Ch9RozGZ.js","assets/registrationEmailPolicy-BIuq-4e8.js","assets/RegisterView-IrISxH3x.css","assets/EmailVerifyView-GVoLtHL0.js","assets/EmailVerifyView-CCbXb7Sd.css","assets/OAuthCallbackView-e876RjHn.js","assets/LinuxDoCallbackView-C1EujRN5.js","assets/PendingOAuthCreateAccountForm-DokQMFZi.js","assets/PendingOAuthCreateAccountForm-CE5mbEbn.css","assets/LinuxDoCallbackView-DQ7xRnW6.css","assets/WechatCallbackView-BGtqzCLa.js","assets/WechatCallbackView-BRJlNRB0.css","assets/WechatPaymentCallbackView-C6HMimZT.js","assets/DingTalkCallbackView-B5-uzBmg.js","assets/DingTalkCallbackView-2-yiQGEP.css","assets/DingTalkEmailCompletionView-nMw3YLNa.js","assets/OidcCallbackView-DdSmrB9g.js","assets/OidcCallbackView-Buxp4n1p.css","assets/ForgotPasswordView-wEA8s3lD.js","assets/ForgotPasswordView-D5q6IfTR.css","assets/ResetPasswordView-FNfh14GG.js","assets/ResetPasswordView-Bthzu-nm.css","assets/KeyUsageView-CAJgu3KI.js","assets/KeyUsageView-DUJT76vw.css","assets/LegalDocumentView-BSC0m_tK.js","assets/LegalDocumentView-DCxikJph.css","assets/ModelPlazaView-BmfPGXS1.js","assets/AppLayout.vue_vue_type_script_setup_true_lang-BcOvjNWX.js","assets/PlatformIcon.vue_vue_type_script_setup_true_lang-Dsanj3Um.js","assets/platformColors-n7Cdjx-Y.js","assets/GroupBadge.vue_vue_type_script_setup_true_lang-BPDXqyRF.js","assets/peak-rate-qZGUWdry.js","assets/pricing-DFfTvfS3.js","assets/channel-CvMwqZOU.js","assets/ModelPlazaView-CPKLu4gi.css","assets/DashboardView-NjTQ8kMj.js","assets/usage-DMm7m9us.js","assets/LoadingSpinner-B7dGY0g4.js","assets/LoadingSpinner-DT-rtrW_.css","assets/TokenUsageTrend.vue_vue_type_script_setup_true_lang-DCYTEOl4.js","assets/vendor-chart-DkvEGKA_.js","assets/TokenUsageTrend-C15Qf8qF.css","assets/EmptyState.vue_vue_type_script_setup_true_lang-CzSvVaAa.js","assets/user-B2rcBVaL.js","assets/KeysView-BAU4t8mW.js","assets/usePersistedPageSize-x0WpaIWh.js","assets/groups-u-BXEB33.js","assets/TablePageLayout-BohgZIYp.js","assets/TablePageLayout-CTUsgGJ4.css","assets/DataTable-BpBe2Crq.js","assets/DataTable-bsUFtred.css","assets/Pagination-DqeHzBTK.js","assets/Pagination-CtuvddY-.css","assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-CaHi4GjY.js","assets/SearchInput.vue_vue_type_script_setup_true_lang-BdYQEe7L.js","assets/vendor-ui-xAOatANW.js","assets/GroupOptionItem-BZuEK081.js","assets/GroupOptionItem-EDVK0Prz.css","assets/maskApiKey-ClKV8GuA.js","assets/BatchImageGuideView-CpGHznj6.js","assets/BatchImageGuideView-BJDwNkfA.css","assets/UsageView-BKnmKFu6.js","assets/GroupDistributionChart.vue_vue_type_script_setup_true_lang-DOe8kVYB.js","assets/EndpointDistributionChart.vue_vue_type_script_setup_true_lang-DVANODBS.js","assets/ModelDistributionChart.vue_vue_type_script_setup_true_lang-Ct3V7M8b.js","assets/errorBadges-D0HqH9oG.js","assets/RedeemView-ClK8dLV3.js","assets/RedeemView-BVFPKVLJ.css","assets/AffiliateView-REzfAVlL.js","assets/AvailableChannelsView-DjDym2zX.js","assets/ProfileView-DIM09joO.js","assets/totp-CYyQRHvM.js","assets/SubscriptionsView-DSJryCDu.js","assets/PaymentView-DCPQWZjA.js","assets/payment-DWXPMprq.js","assets/payment-BtGhy3EY.js","assets/rechargeBonus-wbdhGGXU.js","assets/currency-DpW1WrYL.js","assets/providerConfig-CHSBMM6y.js","assets/wxpay-UHDvuORB.js","assets/paymentFlow-cys_N5rS.js","assets/paymentUx-DAEiek0q.js","assets/UserOrdersView-fHe6Cl6j.js","assets/OrderTable.vue_vue_type_script_setup_true_lang-DkVgOAyb.js","assets/OrderStatusBadge.vue_vue_type_script_setup_true_lang-CJzg9NGi.js","assets/PaymentQRCodeView-BXnwsUfd.js","assets/PaymentResultView-HOPa5Y7d.js","assets/StripePaymentView-DAfktinI.js","assets/AirwallexPaymentView-7SAws79H.js","assets/StripePopupView-C5kKv_rr.js","assets/CustomPageView-BYM_d9mE.js","assets/CustomPageView-D94H50G0.css","assets/DashboardView-YbUD5_tS.js","assets/OpsDashboard-CfYenZZh.js","assets/platforms-BPKrgTUe.js","assets/HelpTooltip.vue_vue_type_script_setup_true_lang-BV_jlVIi.js","assets/OpsErrorLogTable.vue_vue_type_script_setup_true_lang-BzsA_i9M.js","assets/OpsDashboard-DwWJHeD7.css","assets/AuditLogView-B5LWDodt.js","assets/UsersView-CRBoneyO.js","assets/useTableSelection-CO317oWu.js","assets/stableObjectKey-DullU5Fx.js","assets/TotpStepUpDialog.vue_vue_type_script_setup_true_lang-HQ4Q_D6z.js","assets/UserBalanceHistoryModal.vue_vue_type_script_setup_true_lang-BzBy-_Sg.js","assets/UsersView-MqRRHQdy.css","assets/GroupsView-BuyDXxJF.js","assets/PricingEntryCard-DI5i83xc.js","assets/ModelTagInput.vue_vue_type_script_setup_true_lang-B6eliUMv.js","assets/PricingEntryCard-nMDEOCP8.css","assets/GroupsView-DtvDvFYf.css","assets/ChannelsView-lDUBrZxJ.js","assets/ChannelsView-DIXki4NF.css","assets/ChannelMonitorView-BeKU_4Rb.js","assets/channelMonitorV2-CxtGwIh3.js","assets/UsageProgressBar.vue_vue_type_script_setup_true_lang-BDzlpnOc.js","assets/ChannelStatusView-ohb-BCR2.js","assets/ChannelStatusView-CPGYMDhs.css","assets/SubscriptionsView-Bli7ICSE.js","assets/SubscriptionsView-Bcwp8LbK.css","assets/AccountsView-Can2d8kO.js","assets/proxyExpiry-BbJOraCY.js","assets/ModelWhitelistSelector.vue_vue_type_script_setup_true_lang-DQNyFCQa.js","assets/ModelWhitelistSelector-BR3Adxor.css","assets/ProxySelector-B3KueIWa.js","assets/ProxySelector-kSabwWe9.css","assets/GroupSelector.vue_vue_type_script_setup_true_lang-D0ceknCD.js","assets/AccountsView-CCvJU62G.css","assets/PluginsView-DWuvEXP3.js","assets/AnnouncementsView-Nd5Tlt8Y.js","assets/ProxiesView-B1Trx9lS.js","assets/RedeemView-C2onWYmD.js","assets/PromoCodesView-DSMMRpQ1.js","assets/SettingsView-D88cJ6DL.js","assets/SettingsView-lAy5LEwk.css","assets/RiskControlVie
1w-CDBIQhpT.js","assets/PromptAuditView-BXpeTkFU.js","assets/UsageView-BH9t69i1.js","assets/AdminAffiliateInvitesView-CGAASl3u.js","assets/AdminAffiliateRecordsTable.vue_vue_type_script_setup_true_lang-CKNO-1k_.js","assets/AdminAffiliateRebatesView-ZxVBm5Hk.js","assets/AdminAffiliateTransfersView-BvbZ8i5A.js","assets/AdminPaymentDashboardView-_f2cEQmw.js","assets/AdminOrdersView-BIs7e9BQ.js","assets/AdminPaymentPlansView-CY6Ju_ia.js","assets/NotFoundView-CRnFI7cP.js"])))=>i.map(i=>d[i]);
2import{d as ee,c as $,z as L,B as g,A as te,C as M,N as oe,r as w,D as fe,k as K,aa as $a,K as re,R as He,F as It,W as Ca,E as j,G as R,U as $t,ab as we,_ as We,L as Ma,S as Ta,w as Z,o as Ct,a as Ra,I as Ae,V as Ne,n as xa,H as ke,Y as La,u as T,Q as Mt,Z as Oa,X as Da,ac as qa,ad as Ua,ae as za,af as Ka,ag as Na}from"./vendor-vue-BVJWaRIf.js";import{c as Va,u as Tt}from"./vendor-i18n-pgwztqC8.js";import{a as de,d as Se,p as Rt}from"./vendor-misc-g39fh_pU.js";(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 s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function a(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=a(o);fetch(o.href,s)}})();const Ba=["stroke-width"],Fa=["d"],me=ee({__name:"Icon",props:{name:{},size:{default:"md"},strokeWidth:{default:1.5}},setup(e){const t=e,a={play:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z",refresh:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99",edit:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10",trash:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0",plus:"M12 4.5v15m7.5-7.5h-15",search:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z",more:"M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z",chart:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z",clock:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z",link:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244",sync:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 00-3.7-3.7 48.678 48.678 0 00-7.324 0 4.006 4.006 0 00-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3l-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 003.7 3.7 48.656 48.656 0 007.324 0 4.006 4.006 0 003.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3l-3 3",chevronDown:"M19.5 8.25l-7.5 7.5-7.5-7.5",chevronRight:"M8.25 4.5l7.5 7.5-7.5 7.5",chevronLeft:"M15.75 19.5L8.25 12l7.5-7.5",check:"M4.5 12.75l6 6 9-13.5",x:"M6 18L18 6M6 6l12 12",eye:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178zM15 12a3 3 0 11-6 0 3 3 0 016 0z",eyeOff:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88",cog:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.
2074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z M15 12a3 3 0 11-6 0 3 3 0 016 0z",grid:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z",chat:"M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z",lightbulb:"M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18",arrowRight:"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3",arrowLeft:"M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18",arrowUp:"M5 10l7-7m0 0l7 7m-7-7v18",arrowDown:"M19 14l-7 7m0 0l-7-7m7 7V3",arrowsUpDown:"M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5",chevronUp:"M5 15l7-7 7 7",externalLink:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",checkCircle:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z",xCircle:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",exclamationCircle:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z",exclamationTriangle:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",trophy:"M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v-4.5A3.375 3.375 0 0012.75 11.25h-1.5A3.375 3.375 0 008.25 14.25v4.5m8.25-12V6.75a.75.75 0 00-.75-.75h-1.5a.75.75 0 00-.75.75v1.5m0 0V9a.75.75 0 01-.75.75H9.75A.75.75 0 019 9V8.25m0 0V6.75a.75.75 0 00-.75-.75h-1.5a.75.75 0 00-.75.75v1.5m12 0h.008v.008h-.008V8.25zm-12 0h.008v.008H5.25V8.25z",infoCircle:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z",questionCircle:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",user:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z",userCircle:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z",userPlus:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",users:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 
20 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",document:"M9 12h6m-6 4h6m2 5H7a2 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",clipboard:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",copy:"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",inbox:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5",filter:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 
20 0112 3z",globe:"M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418",sort:"M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9",key:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z",lock:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z",shield:"M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z",menu:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5",calendar:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5",home:"M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25",terminal:"M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z",gift:"M21 11.25v8.25a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 109.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1114.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z",creditCard:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z",mail:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75",chartBar:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z",trendingUp:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6",database:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125",cube:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",bolt:"M13 10V3L4 14h7v7l9-11h-7z",sparkles:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456z",cloud:"M2.25 15a4.5 4.5 0 004.5 4.5H18a3.75 3.75 0 001.332-7.257 3 3 0 00-3.758-3.848 5.25 5.25 0 00-10.233 2.33A4.502 4.502 0 002.25 15z",server:"M5.25 14.25h13.5m-13.5 0a3 3 0 01-3-3m3 3a3 3 0 100 6h13.5a3 3 0 100-6m-16.5-3a3 3 0 013-3h13.5a3 3 0 013 3m-19.5 0a4.5 4.5 0 01.9-2.7L5.737 5.1a3.375 3.375 0 012.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 01.9 2.7m0 0a3 3 0 01-3 3m0 3h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008zm-3 6h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008z",sun:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z",moon:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z",book:"M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25",dollar:"M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z",ban:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",login:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9",swap:"M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5",beaker:"M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0112 15a9.065 9.065 0 00-6.23.693L5 14.5m14.8.8l1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0112 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5",cpu:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z",chatBubble:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z",calculator:"M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z",fire:"M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C14 5 16.09 5.777 17.656 7.343A7.975 7.975 0 0120 13a7.975 7.975 0 01-2.343 5.657z",badge:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63
2-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z",brain:"M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0112 15a9.065 9.065 0 00-6.23.693L5 14.5m0 0l-2.69 2.689c-1.232 1.232-.65 3.318 1.067 3.611A48.309 48.309 0 0012 21c2.773 0 5.491-.235 8.135-.687 1.718-.293 2.3-2.379 1.067-3.61L19.8 15.3M12 8.25a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm0 0v3m-3-1.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm0 0h6m-3 4.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"},r=$(()=>a[t.name]),o=$(()=>({xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"})[t.size]);return(s,i)=>(M(),L("svg",{class:te(o.value),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":e.strokeWidth},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:r.value},null,8,Fa)],10,Ba))}}),Ha="modulepreload",Wa=function(e){return"/"+e},mt={},h=function(t,a,r){let o=Promise.resolve();if(a&&a.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),c=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(a.map(u=>{if(u=Wa(u),u in mt)return;mt[u]=!0;const m=u.endsWith(".css"),l=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${l}`))return;const _=document.createElement("link");if(_.rel=m?"stylesheet":Ha,m||(_.as="script"),_.crossOrigin="",_.href=u,c&&_.setAttribute("nonce",c),document.head.appendChild(_),m)return new Promise((v,d)=>{_.addEventListener("load",v),_.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return o.then(i=>{for(const c of i||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})},xt="sub2api_locale",je="en",ja={en:()=>h(()=>import("./index-BWTux-Wo.js"),[]),zh:()=>h(()=>import("./index-D0ZjLLuH.js"),[])};function Ge(e){return e==="en"||e==="zh"}function Ga(){const e=localStorage.getItem(xt);return e&&Ge(e)?e:navigator.language.toLowerCase().startsWith("zh")?"zh":je}const D=Va({legacy:!1,locale:Ga(),fallbackLocale:je,messages:{},warnHtmlMessage:!1}),pt=new Set;async function Lt(e){if(pt.has(e))return;const t=ja[e],a=await t();D.global.setLocaleMessage(e,a.default),pt.add(e)}async function Qa(){const e=X();await Lt(e),document.documentElement.setAttribute("lang",e)}async function mf(e){var _;if(!Ge(e))return;await Lt(e),D.global.locale.value=e,localStorage.setItem(xt,e),document.documentElement.setAttribute("lang",e);const{resolveRouteDocumentTitle:t}=await h(async()=>{const{resolveRouteDocumentTitle:v}=await Promise.resolve().then(()=>yp);return{resolveRouteDocumentTitle:v}},void 0),{default:a}=await h(async()=>{const{default:v}=await Promise.resolve().then(()=>Zp);return{default:v}},void 0),{useAppStore:r}=await h(async()=>{const{useAppStore:v}=await Promise.resolve().then(()=>Qn);return{useAppStore:v}},void 0),{useAuthStore:o}=await h(async()=>{const{useAuthStore:v}=await Promise.resolve().then(()=>xm);return{useAuthStore:v}},void 0),{useAdminSettingsStore:s}=await h(async()=>{const{useAdminSettingsStore:v}=await Promise.resolve().then(()=>Lm);return{useAdminSettingsStore:v}},void 0),i=a.currentRoute.value,c=r(),u=o(),m=s(),l=[...((_=c.cachedPublicSettings)==null?void 0:_.custom_menu_items)??[],...u.isAdmin?m.customMenuItems:[]];document.title=t(i,c.siteName,l)}function X(){const e=D.global.locale.value;return Ge(e)?e:je}const pf=[{code:"en",name:"English",flag:"🇺🇸"},{code:"zh",name:"中文",flag:"🇨🇳"}],Ja="X-Admin-UI-Request",Ya="X-User-UI-Request";function ft(e){return e==="/admin"||e.startsWith("/admin/")||e==="/api/v1/admin"||e.startsWith("/api/v1/admin/")}function Ot(e){const t=e.trim();if(!t)return"";try{const a=typeof window<"u"?window.location.origin:"http://localhost";return new URL(t,a).pathname}catch{return t.split(/[?#]/,1)[0]}}function Za(e){const t=Ot(e);return t?t==="/api/v1"||t.startsWith("/api/v1/")?t.slice(7)||"/":t.startsWith("/")?t:`/${t}`:""}function Xa(e){const t=Za(e);return t?t==="/auth/me"||t==="/auth/revoke-all-sessions"||t==="/auth/oauth/bind-token"||t==="/user"||t.startsWith("/user/")||t==="/keys"||t.startsWith("/keys/")||t==="/groups/available"||t==="/groups/rates"||t==="/channels/available"||t==="/usage"||t.startsWith("/usage/")||t==="/announcements"||t.startsWith("/announcements/")||t==="/redeem"||t.startsWith("/redeem/")||t==="/subscriptions"||t.startsWith("/subscriptions/")||t==="/channel-monitors"||t.startsWith("/channel-monitors/")?!0:t.startsWith("/payment/")?!(t.startsWith("/payment/public")||t.startsWith("/payment/webhook")):!1:!1}function en(e,t){const a=typeof window<"u"?window.location.pathname:"";return ft(Ot(e))||ft(a)}function tn(e){return Xa(e)}const ce="/api/v1",an=nn();function Qe(e){return e.startsWith("/")?e:`/${e}`}function nn(e){const a=(String(ce).trim()||ce).replace(/\/+$/,"");return/^[a-z][a-z\d+.-]*:\/\//i.test(a)||a.startsWith("//")?a:Qe(a)}function pe(){return an}function ff(e){const t=pe().replace(/\/+$/,"");let a=Qe(e);return a===ce?a="":a.startsWith(`${ce}/`)&&(a=a.slice(ce.length)),`${t}${a}`}function Dt(e){const t=Qe(e);try{return`${typeof window>"u"?new URL(pe()).origin:new URL(pe(),window.location.origin).origin}${t}`}catch{return t}}const Je="auth_token",rn="auth_user",Ee="refresh_token",Ye="token_expires_at",on="sub2api-auth-token-refresh",gt=3e4,qt=1e3,sn=1e3,cn=25;let ie=null;function Ze(){const e=localStorage.getItem(rn);if(!e)return null;try{const t=Number(JSON.parse(e).id);return Number.isFinite(t)&&t>0?t:null}catch{return null}}function un(){const e=localStorage.getItem(Ee);if(!e)throw new Error("No refresh token available");return{accessToken:localStorage.getItem(Je),refreshToken:e,expiresAt:Number(localStorage.getItem(Ye)),userID:Ze()}}function ln(e){const t=localStorage.getItem(Je),a=localStorage.getItem(Ee),r=Number(localStorage.getItem(Ye));return!t||!a||!Number.isFinite(r)||r<=Date.now()||Ze()!==e.userID?null:{access_token:t,refresh_token:a,expires_in:Math.max(1,Math.ceil((r-Date.now())/1e3)),token_type:"Bearer"}}function Pe(e,t){const a=ln(e);return a&&(a.refresh_token!==e.refreshToken||t&&e.accessToken!==t&&a.access_token===e.accessToken)?a:null}async function dn(e,t,a=Date.now()+qt){for(;Date.now()<a;){const r=Pe(e,t);if(r)return r;await new Promise(o=>window.setTimeout(o,cn))}return Pe(e,t)}function mn(e){localStorage.setItem(Je,e.access_token),localStorage.setItem(Ye,String(Date.now()+e.expires_in*1e3)),localStorage.setItem(Ee,e.refresh_token)}async function pn(e,t,a=!1){var o;const r=Date.now()+gt+sn;try{const i=(await de.post(`${pe()}/auth/refresh`,{refresh_token:e.refreshToken},{headers:{"Content-Type":"application/json"},timeout:gt})).data;if(i.code!==0||!i.data)throw new Error(i.message||"Token refresh failed");if(localStorage.getItem(Ee)!==e.refreshToken||Ze()!==e.userID){const c=Pe(e,t);if(c)return c;throw new Error("Session changed during token refresh")}return mn(i.data),i.data}catch(s){const i=(o=s.response)==null?void 0:o.status,c=typeof i=="number"&&i>=400&&i<500,u=await dn(e,t,c&&a?r:Date.now()+qt);if(u)return u;throw s}}async function fn(e){const t=un(),a=async(r=!1)=>{const o=Pe(t,e.failedAccessToken);return o||pn(t,e.failedAccessToken,r)};return typeof navigator<"u"&&navigator.locks?navigator.locks.request(on,()=>a(!1)):a(!0)}function Ut(e={}){if(ie)return ie;const t=fn(e);ie=t;const a=()=>{ie===t&&(ie=null)};return t.then(a,a),t}const n=de.create({baseURL:pe(),withCredentials:!0,timeout:3e4,headers:{"Content-Type":"application/json"}}),gn=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};n.interceptors.request.use(e=>{const t=localStorage.getItem("auth_token");if(t&&e.headers&&(e.headers.Authorization=`Bearer ${t}`),e.headers&&(e.headers["Accept-Language"]=X()),e.method==="get"&&(e.params||(e.params={}),e.params.timezone=gn()),e.headers){const a=String(e.url||"");en(a)&&(e.headers[Ja]="1"),tn(a)&&(e.headers[Ya]="1")}return e},e=>Promise.reject(e));n.interceptors.response.use(e=>{const t=e.data;if(t&&typeof t=="object"&&"code"in t)if(t.code===0)e.data=t.data;else{const a=t;return Promise.reject({status:e.status,code:t.code,message:t.message||"Unknown error",reason:a.reason,metadata:a.metadata})}return e},async e=>{var a,r,o,s,i;if(e.code==="ERR_CANCELED"||de.isCancel(e))return Promise.reject(e);const t=e.config;if(e.response){const{status:c,data:u}=e.response,m=String(((a=e.config)==null?void 0:a.url)||""),l=typeof u=="object"&&u!==null?u:{};if(c===404&&l.message==="Ops monitoring is disabled"){try{localStorage.setItem("ops_monitoring_enabled_cached","fal
2se")}catch{}try{window.dispatchEvent(new CustomEvent("ops-monitoring-disabled"))}catch{}return window.location.pathname.startsWith("/admin/ops")&&(window.location.href="/admin/settings"),Promise.reject({status:c,code:"OPS_DISABLED",message:l.message||e.message,url:m})}if(c===423&&l.code==="ADMIN_COMPLIANCE_ACK_REQUIRED"){try{window.dispatchEvent(new CustomEvent("admin-compliance-required",{detail:l.metadata||{}}))}catch{}return Promise.reject({status:c,code:l.code,message:l.message||e.message,metadata:l.metadata})}if(c===401&&!t._retry){const _=localStorage.getItem("refresh_token"),v=m.includes("/auth/login")||m.includes("/auth/register")||m.includes("/auth/refresh");if(_&&!v){const k=localStorage.getItem("auth_user");t._retry=!0;try{const y=t.headers,I=(y==null?void 0:y.Authorization)??(y==null?void 0:y.authorization),E=typeof I=="string"&&I.startsWith("Bearer ")?I.slice(7):null,U=await Ut({failedAccessToken:E});return t.headers&&(t.headers.Authorization=`Bearer ${U.access_token}`),n(t)}catch(y){if(localStorage.getItem("refresh_token")!==_||localStorage.getItem("auth_user")!==k)return Promise.reject({status:401,code:"AUTH_SESSION_CHANGED",message:"Authentication session changed while refreshing."});if(de.isAxiosError(y)){const E=((r=y.response)==null?void 0:r.status)??0;if(E===0||E===429||E>=500)return Promise.reject({status:E,code:"TOKEN_REFRESH_UNAVAILABLE",message:((s=(o=y.response)==null?void 0:o.data)==null?void 0:s.message)||y.message})}return localStorage.removeItem("auth_token"),localStorage.removeItem("refresh_token"),localStorage.removeItem("auth_user"),localStorage.removeItem("token_expires_at"),sessionStorage.setItem("auth_expired","1"),window.location.pathname.includes("/login")||(window.location.href="/login"),Promise.reject({status:401,code:"TOKEN_REFRESH_FAILED",message:"Session expired. Please log in again."})}}const d=!!localStorage.getItem("auth_token"),p=(i=e.config)==null?void 0:i.headers,f=(p==null?void 0:p.Authorization)??(p==null?void 0:p.authorization),A=typeof f=="string"?f.trim()!=="":Array.isArray(f)?f.length>0:!!f;localStorage.removeItem("auth_token"),localStorage.removeItem("refresh_token"),localStorage.removeItem("auth_user"),localStorage.removeItem("token_expires_at"),(d||A)&&!v&&sessionStorage.setItem("auth_expired","1"),window.location.pathname.includes("/login")||(window.location.href="/login")}return Promise.reject({status:c,code:l.code,reason:l.reason,error:l.error,message:l.message||l.detail||e.message,metadata:l.metadata})}return Promise.reject({status:0,code:e.code||"ERR_NETWORK",message:"Network error. Please check your connection."})});async function hn(){const{data:e}=await n.get("/admin/system/version");return e}async function zt(e=!1){const{data:t}=await n.get("/admin/system/check-updates",{params:e?{force:"true"}:void 0});return t}async function yn(){const{data:e}=await n.get("/admin/system/rollback-versions");return e}const Kt=15*60*1e3;async function _n(){const{data:e}=await n.post("/admin/system/update",void 0,{timeout:Kt});return e}async function bn(e){const{data:t}=await n.post("/admin/system/rollback",e?{version:e}:void 0,{timeout:Kt});return t}async function vn(){const{data:e}=await n.post("/admin/system/restart");return e}const wn={getVersion:hn,checkUpdates:zt,performUpdate:_n,getRollbackVersions:yn,rollback:bn,restartService:vn};function gf(e){const a="/api/v1".replace(/\/$/,""),r=new URLSearchParams(e.params).toString(),o=`${a}/auth/oauth/${e.provider}/start`;return r?`${o}?${r}`:o}async function hf(e,t){const{data:a}=await n.post(`/auth/oauth/${e.provider}/start`,t,{params:e.params});return a}function Xe(e){return"requires_2fa"in e&&e.requires_2fa===!0}function Ie(e){localStorage.setItem("auth_token",e)}function ge(e){localStorage.setItem("refresh_token",e)}function he(e){const t=Date.now()+e*1e3;localStorage.setItem("token_expires_at",String(t))}function et(){return localStorage.getItem("auth_token")}function Nt(){return localStorage.getItem("refresh_token")}function An(){const e=localStorage.getItem("token_expires_at");return e?parseInt(e,10):null}function Vt(){localStorage.removeItem("auth_token"),localStorage.removeItem("refresh_token"),localStorage.removeItem("auth_user"),localStorage.removeItem("token_expires_at")}async function kn(e){const{data:t}=await n.post("/auth/login",e);return Xe(t)||(Ie(t.access_token),t.refresh_token&&ge(t.refresh_token),t.expires_in&&he(t.expires_in),localStorage.setItem("auth_user",JSON.stringify(t.user))),t}async function Sn(e){const{data:t}=await n.post("/auth/login/2fa",e);return Ie(t.access_token),t.refresh_token&&ge(t.refresh_token),t.expires_in&&he(t.expires_in),localStorage.setItem("auth_user",JSON.stringify(t.user)),t}async function Pn(e){const{data:t}=await n.post("/auth/register",e);return Ie(t.access_token),t.refresh_token&&ge(t.refresh_token),t.expires_in&&he(t.expires_in),localStorage.setItem("auth_user",JSON.stringify(t.user)),t}async function En(){return n.get("/auth/me")}async function In(){const e=Nt();if(e)try{await n.post("/auth/logout",{refresh_token:e})}catch{}Vt()}function Bt(e){const t={};return typeof(e==null?void 0:e.adoptDisplayName)=="boolean"&&(t.adopt_display_name=e.adoptDisplayName),typeof(e==null?void 0:e.adoptAvatar)=="boolean"&&(t.adopt_avatar=e.adoptAvatar),t}function $n(e){return typeof e.access_token=="string"&&e.access_token.trim().length>0}function Cn(e){return $n(e)?"login":"bind"}function Mn(e){return Cn(e)}function Tn(e){return e.error==="invitation_required"}function Rn(e){return!!(e.suggested_display_name||e.suggested_avatar_url)}function yf(e){e.refresh_token&&ge(e.refresh_token),e.expires_in&&he(e.expires_in)}async function _f(){et()&&await n.post("/auth/oauth/bind-token")}async function xn(){return Ut()}async function Ln(){const{data:e}=await n.post("/auth/revoke-all-sessions");return e}function On(){return et()!==null}async function Ft(){const{data:e}=await n.get("/settings/public");return e}function bf(e){const t=(e==null?void 0:e.wechat_oauth_enabled)??!1;return typeof(e==null?void 0:e.wechat_oauth_open_enabled)=="boolean"||typeof(e==null?void 0:e.wechat_oauth_mp_enabled)=="boolean"?(e==null?void 0:e.wechat_oauth_open_enabled)===!0||(e==null?void 0:e.wechat_oauth_mp_enabled)===!0:t}function Dn(e){return typeof(e==null?void 0:e.wechat_oauth_open_enabled)=="boolean"&&typeof(e==null?void 0:e.wechat_oauth_mp_enabled)=="boolean"}function qn(e,t){const a=(t??(typeof navigator<"u"?navigator.userAgent:"")??"").trim(),r
2=/MicroMessenger/i.test(a),o=(e==null?void 0:e.wechat_oauth_enabled)??!1,s=typeof(e==null?void 0:e.wechat_oauth_open_enabled)=="boolean"?e.wechat_oauth_open_enabled:o,i=typeof(e==null?void 0:e.wechat_oauth_mp_enabled)=="boolean"?e.wechat_oauth_mp_enabled:o,c=typeof(e==null?void 0:e.wechat_oauth_mobile_enabled)=="boolean"?e.wechat_oauth_mobile_enabled:!1;return r?i?{mode:"mp",openEnabled:s,mpEnabled:i,mobileEnabled:c,isWeChatBrowser:r,unavailableReason:null}:s?{mode:null,openEnabled:s,mpEnabled:i,mobileEnabled:c,isWeChatBrowser:r,unavailableReason:"external_browser_required"}:{mode:null,openEnabled:s,mpEnabled:i,mobileEnabled:c,isWeChatBrowser:r,unavailableReason:"not_configured"}:s?{mode:"open",openEnabled:s,mpEnabled:i,mobileEnabled:c,isWeChatBrowser:r,unavailableReason:null}:i?{mode:null,openEnabled:s,mpEnabled:i,mobileEnabled:c,isWeChatBrowser:r,unavailableReason:"wechat_browser_required"}:{mode:null,openEnabled:s,mpEnabled:i,mobileEnabled:c,isWeChatBrowser:r,unavailableReason:"not_configured"}}function vf(e,t){const a=((typeof navigator<"u"?navigator.userAgent:"")??"").trim(),r=/MicroMessenger/i.test(a);return Dn(e)?qn(e,a):{mode:null,openEnabled:!1,mpEnabled:!1,mobileEnabled:!1,isWeChatBrowser:r,unavailableReason:"capability_unknown"}}async function Un(e){const{data:t}=await n.post("/auth/send-verify-code",e);return t}async function zn(e){const{data:t}=await n.post("/auth/oauth/pending/send-verify-code",e);return t}async function Kn(e){const{data:t}=await n.post("/auth/validate-promo-code",{code:e});return t}async function Nn(e){const{data:t}=await n.post("/auth/validate-invitation-code",{code:e});return t}async function Vn(e){const{data:t}=await n.post("/auth/forgot-password",e);return t}async function Bn(e){const{data:t}=await n.post("/auth/reset-password",e);return t}async function Fn(e,t,a){return Ht(e,t,a)}async function Hn(e,t,a){return Wt(e,t,a)}async function Wn(e,t,a){return jt(e,t,a)}async function $e(e,t,a,r){const o=r==null?void 0:r.trim(),{data:s}=await n.post(`/auth/oauth/${e}/complete-registration`,{invitation_code:t,...o?{aff_code:o}:{},...Bt(a)});return s}async function Ht(e,t,a){return $e("linuxdo",e,t,a)}async function Wt(e,t,a){return $e("oidc",e,t,a)}async function jt(e,t,a){return $e("wechat",e,t,a)}async function jn(e,t,a){return $e("dingtalk",e,t,a)}async function Gt(e){const{data:t}=await n.post("/auth/oauth/pending/exchange",Bt(e));return t}async function Gn(e){return Gt(e)}const ne={login:kn,login2FA:Sn,isTotp2FARequired:Xe,register:Pn,getCurrentUser:En,logout:In,isAuthenticated:On,setAuthToken:Ie,setRefreshToken:ge,setTokenExpiresAt:he,getAuthToken:et,getRefreshToken:Nt,getTokenExpiresAt:An,clearAuthToken:Vt,getPublicSettings:Ft,sendVerifyCode:Un,sendPendingOAuthVerifyCode:zn,validatePromoCode:Kn,validateInvitationCode:Nn,forgotPassword:Vn,resetPassword:Bn,refreshToken:xn,revokeAllSessions:Ln,getPendingOAuthBindLoginKind:Mn,isPendingOAuthCreateAccountRequired:Tn,hasPendingOAuthSuggestedProfile:Rn,completePendingOAuthBindLogin:Gt,createPendingLinuxDoOAuthAccount:Ht,createPendingOIDCOAuthAccount:Wt,createPendingWeChatOAuthAccount:jt,exchangePendingOAuthCompletion:Gn,completeLinuxDoOAuthRegistration:Fn,completeOIDCOAuthRegistration:Hn,completeWeChatOAuthRegistration:Wn,createPendingDingTalkOAuthAccount:jn},G=oe("app",()=>{const e=w(!1),t=w(!1),a=w(0),r=w(!1),o=w([]),s=w(!1),i=w(!1),c=w("Sub2API"),u=w(""),m=w(""),l=w(""),_=w(""),v=w(""),d=w(null);let p=null;const f=w(!1),A=w(!1),k=w(""),y=w(""),I=w(!1),E=w("source"),U=w(null);let Q=0;const F=$(()=>o.value.length>0),H=$(()=>{var S;return((S=d.value)==null?void 0:S.backend_mode_enabled)??!1}),z=w(0);function W(){e.value=!e.value}function O(S){e.value=S}function q(){t.value=!t.value}function N(S){t.value=S}function b(S){S?z.value++:z.value=Math.max(0,z.value-1),r.value=z.value>0}function P(S,C,V){const B=`toast-${++Q}`,Ia={id:B,type:S,message:C,duration:V,startTime:V!==void 0?Date.now():void 0};return o.value.push(Ia),V!==void 0&&setTimeout(()=>{dt(B)},V),B}function x(S,C=3e3){return P("success",S,C)}function J(S,C=5e3){return P("error",S,C)}function se(S,C=3e3){return P("info",S,C)}function ya(S,C=4e3){return P("warning",S,C)}function dt(S){const C=o.value.findIndex(V=>V.id===S);C!==-1&&o.value.splice(C,1)}function _a(){o.value=[]}
2async function ba(S){b(!0);try{return await S()}finally{b(!1)}}async function va(S,C){b(!0);try{return await S()}catch(V){const B=C||V.message||D.global.t("common.unknownError");return J(B),null}finally{b(!1)}}function wa(){e.value=!1,r.value=!1,z.value=0,o.value=[]}async function Aa(S=!1){if(f.value&&!S)return{current_version:k.value,latest_version:y.value,has_update:I.value,build_type:E.value,release_info:U.value||void 0,cached:!0};if(A.value)return null;A.value=!0;try{const C=await zt(S);return k.value=C.current_version,y.value=C.latest_version,I.value=C.has_update,E.value=C.build_type||"source",U.value=C.release_info||null,f.value=!0,C}catch(C){return console.error("Failed to fetch version:",C),null}finally{A.value=!1}}function ka(){f.value=!1,I.value=!1}function Re(S){typeof window<"u"&&(window.__APP_CONFIG__={...S}),d.value=S,c.value=S.site_name||"Sub2API",u.value=S.site_logo||"",m.value=S.version||"",l.value=S.contact_info||"",_.value=S.api_base_url||"",v.value=S.doc_url||"",s.value=!0}function Sa(S=!1){if(p)return p;if(!s.value&&!S&&window.__APP_CONFIG__)return Re(window.__APP_CONFIG__),Promise.resolve(window.__APP_CONFIG__);if(s.value&&!S)return d.value?Promise.resolve({...d.value}):Promise.resolve({registration_enabled:!1,email_verify_enabled:!1,force_email_on_third_party_signup:!1,registration_email_suffix_whitelist:[],promo_code_enabled:!0,password_reset_enabled:!1,invitation_code_enabled:!1,turnstile_enabled:!1,turnstile_site_key:"",aliyun_captcha_enabled:!1,aliyun_captcha_scene_id:"",aliyun_captcha_prefix:"",aliyun_captcha_region:"cn",site_name:c.value,site_logo:u.value,site_subtitle:"",api_base_url:_.value,contact_info:l.value,doc_url:v.value,home_content:"",compact_home_enabled:!1,hide_ccs_import_button:!1,payment_enabled:!1,table_default_page_size:20,table_page_size_options:[10,20,50,100],custom_menu_items:[],custom_endpoints:[],linuxdo_oauth_enabled:!1,wechat_oauth_enabled:!1,wechat_oauth_open_enabled:!1,wechat_oauth_mp_enabled:!1,wechat_oauth_mobile_enabled:!1,oidc_oauth_enabled:!1,oidc_oauth_provider_name:"OIDC",github_oauth_enabled:!1,google_oauth_enabled:!1,backend_mode_enabled:!1,passkey_enabled:!1,version:m.value,balance_low_notify_enabled:!1,account_quota_notify_enabled:!1,balance_low_notify_threshold:0,channel_monitor_enabled:!0,channel_monitor_default_interval_seconds:60,available_channels_enabled:!1,subscription_enabled:!0,payment_balance_disabled:!1,model_plaza_enabled:!1,model_plaza_require_auth:!1,plugin_management_enabled:!1,risk_control_enabled:!1,service_quota_enabled:!1,affiliate_enabled:!1,allow_user_view_error_requests:!1});i.value=!0;let C;try{C=Ft()}catch(B){return console.error("Failed to fetch public settings:",B),i.value=!1,Promise.resolve(null)}const V=C.then(B=>(Re(B),B)).catch(B=>(console.error("Failed to fetch public settings:",B),null)).finally(()=>{p===V&&(p=null,i.value=!1)});return p=V,V}function Pa(){s.value=!1,d.value=null}function Ea(){return window.__APP_CONFIG__?(Re(window.__APP_CONFIG__),!0):!1}return{sidebarCollapsed:e,mobileOpen:t,sidebarScrollTop:a,loading:r,toasts:o,publicSettingsLoaded:s,siteName:c,siteLogo:u,siteVersion:m,contactInfo:l,apiBaseUrl:_,docUrl:v,cachedPublicSettings:d,versionLoaded:f,versionLoading:A,currentVersion:k,latestVersion:y,hasUpdate:I,buildType:E,releaseInfo:U,hasActiveToasts:F,backendModeEnabled:H,toggleSidebar:W,setSidebarCollapsed:O,toggleMobileSidebar:q,setMobileOpen:N,setLoading:b,showToast:P,showSuccess:x,showError:J,showInfo:se,showWarning:ya,hideToast:dt,clearAllToasts:_a,withLoading:ba,withLoadingAndError:va,reset:wa,fetchVersion:Aa,clearVersionCache:ka,fetchPublicSettings:Sa,clearPublicSettingsCache:Pa,initFromInjectedConfig:Ea}}),Qn=Object.freeze(Object.defineProperty({__proto__:null,useAppStore:G},Symbol.toStringTag,{value:"Module"})),Jn={class:"pointer-events-none fixed right-4 top-4 z-[9999] space-y-3","aria-live":"polite","aria-atomic":"true"},Yn={class:"p-4"},Zn={class:"flex items-start gap-3"},Xn={class:"mt-0.5 flex-shrink-0"},er={class:"min-w-0 flex-1"},tr={key:0,class:"text-sm font-semibold text-gray-900 dark:text-white"},ar=["onClick"],nr={key:0,class:"h-1 bg-gray-100 dark:bg-dark-700"},rr=ee({__name:"Toast",setup(e){const t=G(),a=$(()=>t.toasts),r=u=>{switch(u){case"success":return"checkCircle";case"error":return"xCircle";case"warning":return"exclamationTriangle";case"info":default:return"infoCircle"}},o=u=>{const m={success:"text-green-500",error:"text-red-500",warning:"text-yellow-500",info:"text-blue-500"};return m[u]||m.info},s=u=>{const m={success:"border-green-500",error:"border-red-500",warning:"border-yellow-500",info:"border-blue-500"};return m[u]||m.info},i=u=>{const m={success:"bg-green-500",error:"bg-red-500",warning:"bg-yellow-500",info:"bg-blue-500"};return m[u]||m.info},c=u=>{t.hideToast(u)};return(u,m)=>(M(),fe(He,{to:"body"},[g("div",Jn,[K($a,{"enter-active-class":"transition ease-out duration-300","enter-from-class":"opacity-0 translate-x-full","enter-to-class":"opacity-100 translate-x-0","leave-active-class":"transition ease-in duration-200","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 translate-x-full"},{default:re(()=>[(M(!0),L(It,null,Ca(a.value,l=>(M(),L("div",{key:l.id,class:te(["pointer-events-auto min-w-[320px] max-w-md overflow-hidden rounded-lg shadow-lg","bg-white dark:bg-dark-800","border-l-4",s(l.type)])},[g("div",Yn,[g("div",Zn,[g("div",Xn,[K(me,{name:r(l.type),size:"md",class:te(o(l.type)),"aria-hidden":"true"},null,8,["name","class"])]),g("div",er,[l.title?(M(),L("p",tr,R(l.title),
21)):j("",!0),g("p",{class:te(["text-sm leading-relaxed",l.title?"mt-1 text-gray-600 dark:text-gray-300":"text-gray-900 dark:text-white"])},R(l.message),3)]),g("button",{onClick:_=>c(l.id),class:"-m-1 flex-shrink-0 rounded p-1 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:text-gray-500 dark:hover:bg-dark-700 dark:hover:text-gray-300","aria-label":"Close notification"},[K(me,{name:"x",size:"sm"})],8,ar)])]),l.duration?(M(),L("div",nr,[g("div",{class:te(["h-full toast-progress",i(l.type)]),style:$t({animationDuration:`${l.duration}ms`})},null,6)])):j("",!0)],2))),128))]),_:1})])]))}}),Ce=(e,t)=>{const a=e.__vccOpts||e;for(const[r,o]of t)a[r]=o;return a},or=Ce(rr,[["__scopeId","data-v-5ff03eb7"]]);function sr(){const e=w(!1);let t=null,a=null;const r=w(!1),o=100,s=()=>{a!==null&&(clearTimeout(a),a=null)},i=()=>{t=Date.now(),e.value=!0,s(),a=setTimeout(()=>{e.value&&(r.value=!0)},o)},c=()=>{s(),e.value=!1,r.value=!1,t=null},u=()=>{s(),t=null},m=()=>{s(),e.value=!1,r.value=!1,t=null},l=()=>t===null?null:Date.now()-t,_=$(()=>r.value),v=we(e);return{isLoading:_,isNavigating:v,startNavigation:i,endNavigation:c,cancelNavigation:u,resetState:m,getNavigationDuration:l,ANTI_FLICKER_DELAY:o}}let xe=null;function Qt(){return xe||(xe=sr()),xe}const ir={class:"navigation-progress",role:"progressbar","aria-label":"Loading","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":"100"},cr=ee({__name:"NavigationProgress",setup(e){const{isLoading:t}=Qt(),a=$(()=>t.value);return(r,o)=>(M(),fe(We,{name:"progress-fade"},{default:re(()=>[Ma(g("div",ir,[...o[0]||(o[0]=[g("div",{class:"navigation-progress-bar"},null,-1)])],512),[[Ta,a.value]])]),_:1}))}}),ur=Ce(cr,[["__scopeId","data-v-0856a86e"]]),lr={class:"modal-header"},dr={key:0,class:"modal-footer"};let mr=0;const Le=new Set,pr=ee({__name:"BaseDialog",props:{show:{type:Boolean},title:{},width:{default:"normal"},closeOnEscape:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!1},showCloseButton:{type:Boolean,default:!0},zIndex:{default:50}},emits:["close"],setup(e,{emit:t}){const a=`modal-title-${++mr}`,r=w(null),o=w(null);let s=null;const i=e,c=t,u=$(()=>i.zIndex!==50?{zIndex:i.zIndex}:void 0),m=$(()=>({narrow:"max-w-md",normal:"max-w-lg",wide:"w-full sm:max-w-2xl md:max-w-3xl lg:max-w-4xl","extra-wide":"w-full sm:max-w-3xl md:max-w-4xl lg:max-w-5xl xl:max-w-6xl",full:"w-full sm:max-w-4xl md:max-w-5xl lg:max-w-6xl xl:max-w-7xl"})[i.width]),l=()=>{i.closeOnClickOutside&&c("close")},_=d=>{i.show&&i.closeOnEscape&&d.key==="Escape"&&c("close")},v=d=>{d?Le.add(a):Le.delete(a),document.body.classList.toggle("modal-open",Le.size>0)};return Z(()=>i.show,async d=>{if(d){if(s=document.activeElement,v(!0),await xa(),o.value&&(o.value.scrollTop=0),r.value){const p=r.value.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');p==null||p.focus()}}else v(!1),s&&typeof s.focus=="function"&&s.focus(),s=null},{immediate:!0}),Ct(()=>{document.addEventListener("keydown",_)}),Ra(()=>{document.removeEventListener("keydown",_),v(!1)}),(d,p)=>(M(),fe(He,{to:"body"},[K(We,{name:"modal"},{default:re(()=>[e.show?(M(),L("div",{key:0,class:"modal-overlay",style:$t(u.value),"aria-labelledby":a,role:"dialog","aria-modal":"true",onClick:Ne(l,["self"])},[g("div",{ref_key:"dialogRef",ref:r,class:te(["modal-content",m.value]),onClick:p[1]||(p[1]=Ne(()=>{},["stop"]))},[g("div",lr,[g("h3",{id:a,class:"modal-title"},R(e.title),1),e.showCloseButton?(M(),L("button",{key:0,onClick:p[0]||(p[0]=f=>c("close")),class:"-mr-2 rounded-xl p-2 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30 focus-visible:ring-offset-2 dark:text-dark-500 dark:hover:bg-dark-700 dark:hover:text-dark-300 dark:focus-visible:ring-offset-dark-900","aria-label":"Close modal"},[K(me,{name:"x",size:"md"})])):j("",!0)]),g("div",{ref_key:"modalBodyRef",ref:o,class:"modal-body"},[Ae(d.$slots,"default")],512),d.$slots.footer?(M(),L("div",dr,[Ae(d.$slots,"footer")])):j("",!0)],2)],4)):j("",!0)]),_:3})]))}}),fr={class:"w-full"},gr=["for"],hr={key:0,class:"text-red-500"},yr={class:"relative"},_r={key:0,class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3.5 text-gray-400 dark:text-dark-400"},br=["id","type","value","disabled","required","placeholder","autocomplete","readonly"],vr={key:1,class:"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 dark:text-dark-400"},wr={key:1,class:"input-error-text mt-1.5"},Ar={key:2,class:"input-hint mt-1.5"},kr=ee({__name:"Input",props:{modelValue:{},type:{default:"text"},label:{},placeholder:{},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{},hint:{},id:{},autocomplete:{}},emits:["update:modelValue","change","blur","focus","enter"],setup(e,{expose:t,emit:a}){const r=e,o=a,s=w(null),i=$(()=>r.placeholder||""),c=u=>{const m=u.target.value;o("update:modelValue",m)};return t({focus:()=>{var u;return(u=s.value)==null?void 0:u.focus()},select:()=>{var u;return(u=s.value)==null?void 0:u.select()}}),(u,m)=>(M(),L("div",fr,[e.label?(M(),L("label",{key:0,for:e.id,class:"input-label mb-1.5 block"},[ke(R(e.label)+" ",1),e.required?(M(),L("span",hr,"*")):j("",!0)],8,gr)):j("",!0),g("div",yr,[u.$slots.prefix?(M(),L("div",_r,[Ae(u.$slots,"prefix")])):j("",!0),g("input",{id:e.id,ref_key:"inputRef",ref:s,type:e.type,value:e.modelValue,disabled:e.disabled,required:e.required,placeholder:i.value,autocomplete:e.autocomplete,readonly:e.readonly,class:te(["input w-full transition-all duration-200",u.$slots.prefix?"pl-11":"",u.$slots.suffix?"pr-11":"",e.error?"input-error ring-2 ring-red-500/20":"",e.disabled?"cursor-not-allowed bg-gray-100 opacity-60 dark:bg-dark-900":""]),onInput:c,onChange:m[0]||(m[0]=l=>u.$emit("change",l.target.value)),onBlur:m[1]||(m[1]=l=>u.$emit("blur",l)),onFocus:m[2]||(m[2]=l=>u.$emit("focus",l)),onKeyup:m[3]||(m[3]=La(l=>u.$emit("enter",l),["enter"]))},null,42,br),u.$slots.suffix?(M(),L("div",vr,[Ae(u.$slots,"suffix")])):j("",!0)]),e.error?(M(),L("p",wr,R(e.error),1)):e.hint?(M(),L("p",Ar,R(e.hint),1)):j("",!0)]))}});
2function Jt(){if(!window.PublicKeyCredential||!navigator.credentials)throw new Error("Passkeys are not supported by this browser")}function ue(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),a=t+"=".repeat((4-t.length%4)%4),r=atob(a);return Uint8Array.from(r,s=>s.charCodeAt(0)).buffer}function Y(e){if(e===null)return null;const t=new Uint8Array(e);let a="";for(const r of t)a+=String.fromCharCode(r);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function Sr(e){const t={...e};t.challenge=ue(String(t.challenge));const a={...t.user};return a.id=ue(String(a.id)),t.user=a,Array.isArray(t.excludeCredentials)&&(t.excludeCredentials=t.excludeCredentials.map(r=>({...r,id:ue(String(r.id))}))),t}function Pr(e){const t={...e};return t.challenge=ue(String(t.challenge)),Array.isArray(t.allowCredentials)&&(t.allowCredentials=t.allowCredentials.map(a=>({...a,id:ue(String(a.id))}))),t}function Er(e){const t=e.response;return{id:e.id,rawId:Y(e.rawId),type:e.type,authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:e.getClientExtensionResults(),response:{attestationObject:Y(t.attestationObject),clientDataJSON:Y(t.clientDataJSON),transports:typeof t.getTransports=="function"?t.getTransports():[]}}}function Ir(e){const t=e.response;return{id:e.id,rawId:Y(e.rawId),type:e.type,authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:e.getClientExtensionResults(),response:{authenticatorData:Y(t.authenticatorData),clientDataJSON:Y(t.clientDataJSON),signature:Y(t.signature),userHandle:Y(t.userHandle)}}}async function $r(e){Jt();const{data:t}=e?await n.post("/auth/passkey/login/begin",e):await n.post("/auth/passkey/login/begin"),a=await navigator.credentials.get({publicKey:Pr(t.options.publicKey)});if(!(a instanceof PublicKeyCredential))throw new Error("Passkey sign-in was cancelled");const{data:r}=await n.post("/auth/passkey/login/finish",{session_token:t.session_token,credential:Ir(a)});return r}async function Cr(e,t){Jt();const{data:a}=await n.post("/user/passkeys/register/begin",{password:t}),r=await navigator.credentials.create({publicKey:Sr(a.options.publicKey)});if(!(r instanceof PublicKeyCredential))throw new Error("Passkey creation was cancelled");const{data:o}=await n.post("/user/passkeys/register/finish",{session_token:a.session_token,name:e,credential:Er(r)});return o}async function Mr(){const{data:e}=await n.get("/user/passkeys");return e}async function Tr(e,t){await n.patch(`/user/passkeys/${e}`,{name:t})}async function Rr(e,t){await n.delete(`/user/passkeys/${e}`,{data:{password:t}})}const xr={isSupported:()=>!!(window.PublicKeyCredential&&navigator.credentials),login:$r,register:Cr,list:Mr,rename:Tr,remove:Rr};async function Lr(e=!1){const{data:t}=await n.get("/announcements",{params:e?{unread_only:1}:{}});return t}async function Or(e){const{data:t}=await n.post(`/announcements/${e}/read`);return t}const Oe={list:Lr,markRead:Or};async function Dr(){const{data:e}=await n.get("/admin/dashboard/stats");return e}async function qr(){const{data:e}=await n.get("/admin/dashboard/realtime");return e}async function Ur(e){const{data:t}=await n.get("/admin/dashboard/trend",{params:e});return t}async function zr(e){const{data:t}=await n.get("/admin/dashboard/models",{params:e});return t}async function Kr(e){const{data:t}=await n.get("/admin/dashboard/groups",{params:e});return t}async function wf(e){const{data:t}=await n.get("/admin/dashboard/user-breakdown",{params:e});return t}async function Nr(e){const{data:t}=await n.get("/admin/dashboard/snapshot-v2",{params:e});return t}async function Vr(e){const{data:t}=await n.get("/admin/dashboard/api-keys-trend",{params:e});return t}async function Br(e){const{data:t}=await n.get("/admin/dashboard/users-trend",{params:e});return t}async function Fr(e){const{data:t}=await n.get("/admin/dashboard/users-ranking",{params:e});return t}async function Hr(e){const{data:t}=await n.post("/admin/dashboard/users-usage",{user_ids:e});return t}async function Wr(e){const{data:t}=await n.post("/admin/dashboard/api-keys-usage",{api_key_ids:e});return t}const jr={getStats:Dr,getRealtimeMetrics:qr,getUsageTrend:Ur,getModelStats:zr,getGroupStats:Kr,getSnapshotV2:Nr,getApiKeyUsageTrend:Vr,getUserUsageTrend:Br,getUserSpendingRanking:Fr,getBatchUsersUsage:Hr,getBatchApiKeysUsage:Wr};async function Gr(e=1,t=20,a,r){const o={page:e,page_size:t,status:a==null?void 0:a.status,role:a==null?void 0:a.role,search:a==null?void 0:a.search,group_name:a==null?void 0:a.group_name,api_key_group_id:a==null?void 0:a.api_key_group_id,include_subscriptions:a==null?void 0:a.include_subscriptions,sort_by:a==null?void 0:a.sort_by,sort_order:a==null?void 0:a.sort_order};if(a!=null&&a.attributes)for(const[i,c]of Object.entries(a.attributes))c&&(o[`attr[${i}]`]=c);const{data:s}=await n.get("/admin/users",{params:o,signal:r==null?void 0:r.signal});return s}async function Qr(e,t=!1){const a=t?`/admin/users/${e}?include_deleted=true`:`/admin/users/${e}`,{data:r}=await n.get(a);return r}async function Jr(e){const{data:t}=await n.post("/admin/users",e);return t}async function tt(e,t){const{data:a}=await n.put(`/admin/users/${e}`,t);return a}
2async function Yr(e){const{data:t}=await n.delete(`/admin/users/${e}`);return t}async function Zr(e,t,a="set",r){const{data:o}=await n.post(`/admin/users/${e}/balance`,{balance:t,operation:a,notes:r||""});return o}async function Xr(e,t){return tt(e,{concurrency:t})}async function eo(e){const{data:t}=await n.post("/admin/users/batch-limits",e);return t}async function to(e,t){return tt(e,{status:t})}async function ao(e){const{data:t}=await n.get(`/admin/users/${e}/api-keys`);return t}async function no(e,t="month"){const{data:a}=await n.get(`/admin/users/${e}/usage`,{params:{period:t}});return a}async function ro(e,t=1,a=20,r){const o={page:t,page_size:a};r&&(o.type=r);const{data:s}=await n.get(`/admin/users/${e}/balance-history`,{params:o});return s}async function oo(e,t,a){const{data:r}=await n.post(`/admin/users/${e}/replace-group`,{old_group_id:t,new_group_id:a});return r}async function so(e,t){const{data:a}=await n.post(`/admin/users/${e}/auth-identities`,t);return a}const Af=["anthropic","openai","gemini","antigravity","grok","kimi","zhipu","deepseek","minimax","opencode_go","typesafe"];async function io(e){const{data:t}=await n.get(`/admin/users/${e}/platform-quotas`);return t}async function co(e,t){const{data:a}=await n.put(`/admin/users/${e}/platform-quotas`,{quotas:t});return a}async function uo(e,t,a){const{data:r}=await n.post(`/admin/users/${e}/platform-quotas/reset`,{platform:t,window:a});return r}const lo={list:Gr,getById:Qr,create:Jr,update:tt,delete:Yr,updateBalance:Zr,updateConcurrency:Xr,batchUpdateLimits:eo,toggleStatus:to,getUserApiKeys:ao,getUserUsageStats:no,getUserBalanceHistory:ro,replaceGroup:oo,bindUserAuthIdentity:so,getPlatformQuotas:io,updatePlatformQuotas:co,resetPlatformQuotaWindow:uo};async function mo(e=1,t=20,a,r){const{data:o}=await n.get("/admin/groups",{params:{page:e,page_size:t,...a},signal:r==null?void 0:r.signal});return o}async function Yt(e){const{data:t}=await n.get("/admin/groups/all",{params:e?{platform:e}:void 0});return t}async function po(){const{data:e}=await n.get("/admin/groups/all",{params:{include_inactive:!0}});return e}async function fo(e){return Yt(e)}async function go(){const{data:e}=await n.get("/admin/groups/live-capability");return e}async function ho(e){const{data:t}=await n.get(`/admin/groups/${e}`);return t}async function yo(e,t){const{data:a}=await n.get(`/admin/groups/${e}/model-allowlist-candidates`,{params:t?{platform:t}:void 0});return a.models||[]}async function _o(e){const{data:t}=await n.post("/admin/groups",e);return t}const De=new Map;function bo(){var e;try{const t=(e=globalThis.localStorage)==null?void 0:e.getItem("auth_user");if(!t)return null;const a=JSON.parse(t);if(typeof a!="object"||a===null)return null;const r=a.id;return typeof r!="number"||!Number.isSafeInteger(r)||r<=0?null:String(r)}catch{return null}}function vo(e){const t=bo();return t?{adminID:t,key:`sub2api:admin:group-duplicate:${t}:${e}`}:null}function wo(e){var t;try{return((t=globalThis.sessionStorage)==null?void 0:t.getItem(e))??null}catch{return null}}function ht(e,t){var a,r;try{t?(a=globalThis.sessionStorage)==null||a.setItem(e,t):(r=globalThis.sessionStorage)==null||r.removeItem(e)}catch{}}async function Ao(e){var o,s;const t=vo(e);let a=t?De.get(t.key)??wo(t.key):null;if(!a){const i=((s=(o=globalThis.crypto)==null?void 0:o.randomUUID)==null?void 0:s.call(o))??`${Date.now()}-${Math.random().toString(36).slice(2)}`;a=`group-duplicate-${(t==null?void 0:t.adminID)??"unknown-admin"}-${e}-${i}`}t&&(De.set(t.key,a),ht(t.key,a));const{data:r}=await n.post(`/admin/groups/${e}/duplicate`,void 0,{headers:{"Idempotency-Key":a}});return t&&(De.delete(t.key),ht(t.key,null)),r}async function Zt(e,t){const{data:a}=await n.put(`/admin/groups/${e}`,t);return a}async function ko(e){const{data:t}=await n.delete(`/admin/groups/${e}`);return t}async function So(e,t){return Zt(e,{status:t})}async function Po(e){const{data:t}=await n.get(`/admin/groups/${e}/stats`);return t}async function Eo(e,t=1,a=20){const{data:r}=await n.get(`/admin/groups/${e}/api-keys`,{params:{page:t,page_size:a}});return r}async function Io(e){const{data:t}=await n.get(`/admin/groups/${e}/composite-routes`);return t}async function $o(e,t){const{data:a}=await n.post(`/admin/groups/${e}/composite-routes`,t);return a}
2async function Co(e,t,a){const{data:r}=await n.put(`/admin/groups/${e}/composite-routes/${t}`,a);return r}async function Mo(e,t){const{data:a}=await n.delete(`/admin/groups/${e}/composite-routes/${t}`);return a}async function To(e,t){const{data:a}=await n.post(`/admin/groups/${e}/composite-routes/preview`,t);return a}async function Ro(e){const{data:t}=await n.get(`/admin/groups/${e}/rate-multipliers`);return t}async function xo(e){const{data:t}=await n.put("/admin/groups/sort-order",{updates:e});return t}async function Lo(e){const{data:t}=await n.delete(`/admin/groups/${e}/rate-multipliers`);return t}async function Oo(e,t){const{data:a}=await n.put(`/admin/groups/${e}/rate-multipliers`,{entries:t});return a}async function Do(e){const{data:t}=await n.get(`/admin/groups/${e}/rate-multipliers`);return t.filter(a=>a.rpm_override!=null).map(a=>({user_id:a.user_id,user_name:a.user_name,user_email:a.user_email,user_notes:a.user_notes,user_status:a.user_status,rpm_override:a.rpm_override}))}async function qo(e,t){const{data:a}=await n.put(`/admin/groups/${e}/rpm-overrides`,{entries:t});return a}async function Uo(e){const{data:t}=await n.delete(`/admin/groups/${e}/rpm-overrides`);return t}async function zo(){const{data:e}=await n.get("/admin/groups/usage-summary");return e}async function Ko(){const{data:e}=await n.get("/admin/groups/capacity-summary");return e}const No={list:mo,getAll:Yt,getByPlatform:fo,getAllIncludingInactive:po,getLiveCapability:go,getById:ho,getModelAllowlistCandidates:yo,create:_o,duplicate:Ao,update:Zt,delete:ko,toggleStatus:So,getStats:Po,getGroupApiKeys:Eo,listCompositeRoutes:Io,createCompositeRoute:$o,updateCompositeRoute:Co,deleteCompositeRoute:Mo,previewCompositeRoute:To,getGroupRateMultipliers:Ro,clearGroupRateMultipliers:Lo,batchSetGroupRateMultipliers:Oo,getGroupRPMOverrides:Do,clearGroupRPMOverrides:Uo,batchSetGroupRPMOverrides:qo,updateSortOrder:xo,getUsageSummary:zo,getCapacitySummary:Ko};async function Vo(e=1,t=20,a,r){const{data:o}=await n.get("/admin/accounts",{params:{page:e,page_size:t,...a},signal:r==null?void 0:r.signal});return o}async function Bo(e=1,t=20,a,r){var c;const o={};r!=null&&r.etag&&(o["If-None-Match"]=r.etag);const s=await n.get("/admin/accounts/upstream-billing-rates",{params:{page:e,page_size:t,...a},headers:o,signal:r==null?void 0:r.signal,validateStatus:u=>u>=200&&u<300||u===304}),i=typeof((c=s.headers)==null?void 0:c.etag)=="string"?s.headers.etag:null;return s.status===304?{notModified:!0,etag:i,data:null}:{notModified:!1,etag:i,data:s.data}}async function Fo(e=1,t=20,a,r){var c;const o={};r!=null&&r.etag&&(o["If-None-Match"]=r.etag);const s=await n.get("/admin/accounts",{params:{page:e,page_size:t,...a},headers:o,signal:r==null?void 0:r.signal,validateStatus:u=>u>=200&&u<300||u===304}),i=typeof((c=s.headers)==null?void 0:c.etag)=="string"?s.headers.etag:null;return s.status===304?{notModified:!0,etag:i,data:null}:{notModified:!1,etag:i,data:s.data}}async function Ho(e){const{data:t}=await n.get(`/admin/accounts/${e}`);return t}async function Wo(e){const{data:t}=await n.post("/admin/accounts",e);return t}const qe=new Map;function Ve(e){return`sub2api:admin:account-duplicate:${e}`}function jo(e){var t;try{return((t=globalThis.sessionStorage)==null?void 0:t.getItem(Ve(e)))??null}catch{return null}}function yt(e,t){var a,r;try{t?(a=globalThis.sessionStorage)==null||a.setItem(Ve(e),t):(r=globalThis.sessionStorage)==null||r.removeItem(Ve(e))}catch{}}async function Go(e){var r,o;let t=qe.get(e)??jo(e);if(!t){const s=((o=(r=globalThis.crypto)==null?void 0:r.randomUUID)==null?void 0:o.call(r))??`${Date.now()}-${Math.random().toString(36).slice(2)}`;t=`account-duplicate-${e}-${s}`}qe.set(e,t),yt(e,t);const{data:a}=await n.post(`/admin/accounts/${e}/duplicate`,void 0,{headers:{"Idempotency-Key":t}});return qe.delete(e),yt(e,null),a}async function Xt(e,t){const{data:a}=await n.put(`/admin/accounts/${e}`,t);return a}async function Qo(e){const{data:t}=await n.get(`/admin/accounts/${e}/grok-media-eligibility`);return t}async function Jo(e,t){const{data:a}=await n.put(`/admin/accounts/${e}/grok-media-eligibility`,{mode:t});return a}
2async function Yo(e){const{data:t}=await n.post("/admin/accounts/check-mixed-channel",e);return t}async function Zo(e){const{data:t}=await n.delete(`/admin/accounts/${e}`);return t}async function Xo(e,t){return Xt(e,{status:t})}async function es(e){const{data:t}=await n.post(`/admin/accounts/${e}/test`);return t}async function ts(e){const{data:t}=await n.post(`/admin/accounts/${e}/refresh`);return"account"in t?t:{account:t}}async function as(e,t){const{data:a}=await n.post(`/admin/accounts/${e}/apply-oauth-credentials`,t);return a}async function ns(e,t=30){const{data:a}=await n.get(`/admin/accounts/${e}/stats`,{params:{days:t}});return a}async function rs(e){const{data:t}=await n.post(`/admin/accounts/${e}/clear-error`);return t}async function os(e,t,a){const r={};t&&(r.source=t),a&&(r.force="true");const{data:o}=await n.get(`/admin/accounts/${e}/usage`,{params:Object.keys(r).length>0?r:void 0});return o}async function ss(e,t){const{data:a}=await n.post("/admin/accounts/usage/batch",{account_ids:e,force:t===!0});return a}async function is(e){const{data:t}=await n.post(`/admin/accounts/${e}/clear-rate-limit`);return t}async function cs(e){const{data:t}=await n.post(`/admin/accounts/${e}/recover-state`);return t}async function us(e){const{data:t}=await n.post(`/admin/accounts/${e}/reset-quota`);return t}async function ls(e){const{data:t}=await n.get(`/admin/accounts/${e}/temp-unschedulable`);return t}async function ds(e){const{data:t}=await n.delete(`/admin/accounts/${e}/temp-unschedulable`);return t}async function ms(e,t){const{data:a}=await n.post(e,t);return a}async function ps(e,t){const{data:a}=await n.post(e,t);return a}async function fs(e){const{data:t}=await n.post("/admin/accounts/batch",{accounts:e});return t}async function gs(e){const{data:t}=await n.post("/admin/accounts/batch-update-credentials",e);return t}async function hs(e,t){const a=Array.isArray(e)?{account_ids:e,...t??{}}:e,{data:r}=await n.post("/admin/accounts/bulk-update",a);return r}async function ys(e){const{data:t}=await n.get(`/admin/accounts/${e}/today-stats`);return t}async function _s(e){const{data:t}=await n.post("/admin/accounts/today-stats/batch",{account_ids:e});return t}async function bs(e,t){const{data:a}=await n.post(`/admin/accounts/${e}/schedulable`,{schedulable:t});return a}async function vs(e){const{data:t}=await n.get(`/admin/accounts/${e}/models`);return t}async function ws(e){const{data:t}=await n.post(`/admin/accounts/${e}/models/sync-upstream`);return t}async function As(e){const{data:t}=await n.post("/admin/accounts/models/sync-upstream-preview",e);return t}async function ks(e){const{data:t}=await n.post("/admin/accounts/sync/crs/preview",e);return t}async function Ss(e){const{data:t}=await n.post("/admin/accounts/sync/crs",e,{timeout:18e4});return t}async function Ps(e){const t={};if(e!=null&&e.ids&&e.ids.length>0)t.ids=e.ids.join(",");else if(e!=null&&e.filters){const{platform:r,type:o,status:s,group:i,privacy_mode:c,search:u,sort_by:m,sort_order:l}=e.filters;r&&(t.platform=r),o&&(t.type=o),s&&(t.status=s),i&&(t.group=i),c&&(t.privacy_mode=c),u&&(t.search=u),m&&(t.sort_by=m),l&&(t.sort_order=l)}(e==null?void 0:e.includeProxies)===!1&&(t.include_proxies="false");const{data:a}=await n.get("/admin/accounts/data",{params:t});return a}async function Es(e){const{data:t}=await n.post("/admin/accounts/data",{data:e.data,skip_default_group_bind:e.skip_default_group_bind});return t}async function Is(e){const{data:t}=await n.post("/admin/accounts/import/codex-session",e,{timeout:12e4});return t}async function $s(e){const{data:t}=await n.post("/admin/openai/create-from-codex-pat",e);return t}async function Cs(){const{data:e}=await n.get("/admin/accounts/antigravity/default-model-mapping");return e}async function Ms(e,t,a="/admin/openai/refresh-token",r){const o={refresh_token:e};t&&(o.proxy_id=t),r&&(o.client_id=r);const{data:s}=await n.post(a,o);return s}async function Ts(e){const{data:t}=await n.post(`/admin/accounts/${e}/revert-proxy-fallback`);return t}async function Rs(e){const{data:t}=await n.post("/admin/accounts/batch-delete",{account_ids:e});return t}async function xs(e){const{data:t}=await n.post("/admin/accounts/batch-clear-error",{account_ids:e});return t}async function Ls(e){const{data:t}=await n.post("/admin/accounts/batch-refresh",{account_ids:e},{timeout:12e4});return t}async function Os(e){const{data:t}=await n.post(`/admin/accounts/${e}/set-privacy`);return t}async function Ds(e){const{data:t}=await n.post(`/admin/openai/accounts/${e}/quota/refresh`);return t}async function kf(e){const{data:t}=await n.post(`/admin/openai/accounts/${e}/referrals/refresh`);return t}async function Sf(e,t){const{data:a}=await n.post(`/admin/openai/accounts/${e}/referrals/invite`,t,{timeout:9e4});return a}
2async function qs(e){const{data:t}=await n.post(`/admin/openai/accounts/${e}/reset-quota`,void 0,{timeout:9e4});return t}async function Us(e,t){const{data:a}=await n.post(`/admin/accounts/${e}/shadow`,t);return a}async function zs(){const{data:e}=await n.get("/admin/accounts/upstream-billing-probe/settings");return e}async function Ks(e){const{data:t}=await n.put("/admin/accounts/upstream-billing-probe/settings",e);return t}async function Ns(e,t){await n.put(`/admin/accounts/${e}/upstream-billing-probe`,{enabled:t})}async function Vs(e){const{data:t}=await n.post(`/admin/accounts/${e}/upstream-billing-probe`);return t}async function Bs(e){const{data:t}=await n.post("/admin/accounts/upstream-billing-probe/batch",{account_ids:e});return t.results}async function Fs(){const{data:e}=await n.get("/admin/accounts/ollama-cloud-usage/settings");return e}async function Hs(e){const{data:t}=await n.put("/admin/accounts/ollama-cloud-usage/settings",e);return t}async function Ws(e){const{data:t}=await n.get(`/admin/accounts/${e}/ollama-cloud-usage`);return t}async function js(e,t){const{data:a}=await n.put(`/admin/accounts/${e}/ollama-cloud-usage/session`,{session:t});return a}async function Gs(e){const{data:t}=await n.delete(`/admin/accounts/${e}/ollama-cloud-usage/session`);return t}async function Qs(e,t){const{data:a}=await n.put(`/admin/accounts/${e}/ollama-cloud-usage/auto-refresh`,{enabled:t});return a}async function Js(e){const{data:t}=await n.post(`/admin/accounts/${e}/ollama-cloud-usage/refresh`);return t}async function Ys(){const{data:e}=await n.get("/admin/accounts/opencode-go-usage/settings");return e}async function Zs(e){const{data:t}=await n.put("/admin/accounts/opencode-go-usage/settings",e);return t}async function Xs(e){const{data:t}=await n.get(`/admin/accounts/${e}/opencode-go-usage`);return t}async function ei(e,t){const{data:a}=await n.put(`/admin/accounts/${e}/opencode-go-usage/auto-refresh`,{enabled:t});return a}async function ti(e){const{data:t}=await n.post(`/admin/accounts/${e}/opencode-go-usage/refresh`);return t}const ai={list:Vo,listWithEtag:Fo,getUpstreamBillingRatesWithEtag:Bo,getById:Ho,create:Wo,duplicate:Go,update:Xt,getGrokMediaEligibility:Qo,updateGrokMediaEligibility:Jo,checkMixedChannelRisk:Yo,delete:Zo,toggleStatus:Xo,testAccount:es,refreshCredentials:ts,applyOAuthCredentials:as,getStats:ns,clearError:rs,getUsage:os,getBatchUsage:ss,getTodayStats:ys,getBatchTodayStats:_s,clearRateLimit:is,recoverState:cs,resetAccountQuota:us,getTempUnschedulableStatus:ls,resetTempUnschedulable:ds,setSchedulable:bs,getAvailableModels:vs,syncUpstreamModels:ws,syncUpstreamModelsPreview:As,generateAuthUrl:ms,exchangeCode:ps,refreshOpenAIToken:Ms,batchCreate:fs,batchUpdateCredentials:gs,bulkUpdate:hs,previewFromCrs:ks,syncFromCrs:Ss,exportData:Ps,importData:Es,importCodexSession:Is,createOpenAICodexPAT:$s,getAntigravityDefaultModelMapping:Cs,batchDelete:Rs,batchClearError:xs,batchRefresh:Ls,setPrivacy:Os,revertProxyFallback:Ts,refreshOpenAIQuota:Ds,resetOpenAIQuota:qs,createSparkShadow:Us,getUpstreamBillingProbeSettings:zs,updateUpstreamBillingProbeSettings:Ks,setUpstreamBillingProbeEnabled:Ns,probeUpstreamBilling:Vs,probeUpstreamBillingBatch:Bs,getOllamaCloudUsageSettings:Fs,updateOllamaCloudUsageSettings:Hs,getOllamaCloudUsage:Ws,saveOllamaCloudUsageSession:js,deleteOllamaCloudUsageSession:Gs,setOllamaCloudUsageAutoRefresh:Qs,refreshOllamaCloudUsage:Js,getOpenCodeGoUsageSettings:Ys,updateOpenCodeGoUsageSettings:Zs,getOpenCodeGoUsage:Xs,setOpenCodeGoUsageAutoRefresh:ei,refreshOpenCodeGoUsage:ti};function at(e){if(!Array.isArray(e))throw new Error("Invalid proxy list response")}async function ni(e=1,t=20,a,r){const{data:o}=await n.get("/admin/proxies",{params:{page:e,page_size:t,...a},signal:r==null?void 0:r.signal});return at(o==null?void 0:o.items),o}async function ri(){const{data:e}=await n.get("/admin/proxies/all");return at(e),e}async function oi(){const{data:e}=await n.get("/admin/proxies/all",{params:{with_count:"true"}});return at(e),e}async function si(e){const{data:t}=await n.get(`/admin/proxies/${e}`);return t}async function ii(e){const{data:t}=await n.post("/admin/proxies",e);return t}async function ea(e,t){const{data:a}=await n.put(`/admin/proxies/${e}`,t);return a}
2async function ci(e){const{data:t}=await n.delete(`/admin/proxies/${e}`);return t}async function ui(e,t){return ea(e,{status:t})}async function li(e){const{data:t}=await n.post(`/admin/proxies/${e}/test`);return t}async function di(e){const{data:t}=await n.post(`/admin/proxies/${e}/quality-check`);return t}async function mi(e){const{data:t}=await n.get(`/admin/proxies/${e}/stats`);return t}async function pi(e){const{data:t}=await n.get(`/admin/proxies/${e}/accounts`);return t}async function fi(e){const{data:t}=await n.post("/admin/proxies/batch",{proxies:e});return t}async function gi(e){const{data:t}=await n.post("/admin/proxies/batch-delete",{ids:e});return t}async function hi(e){const t={};if(e!=null&&e.ids&&e.ids.length>0)t.ids=e.ids.join(",");else if(e!=null&&e.filters){const{protocol:r,status:o,search:s,sort_by:i,sort_order:c}=e.filters;r&&(t.protocol=r),o&&(t.status=o),s&&(t.search=s),i&&(t.sort_by=i),c&&(t.sort_order=c)}const{data:a}=await n.get("/admin/proxies/data",{params:t});return a}async function yi(e){const{data:t}=await n.post("/admin/proxies/data",e);return t}const _i={list:ni,getAll:ri,getAllWithCount:oi,getById:si,create:ii,update:ea,delete:ci,toggleStatus:ui,testProxy:li,checkProxyQuality:di,getStats:mi,getProxyAccounts:pi,batchCreate:fi,batchDelete:gi,exportData:hi,importData:yi};async function bi(e=1,t=20,a,r){const{data:o}=await n.get("/admin/redeem-codes",{params:{page:e,page_size:t,...a},signal:r==null?void 0:r.signal});return o}async function vi(e){const{data:t}=await n.get(`/admin/redeem-codes/${e}`);return t}async function wi(e,t,a,r,o,s){const i={count:e,type:t,value:a};t==="subscription"&&(i.group_id=r,o&&o>0&&(i.validity_days=o)),s&&s>0&&(i.expires_in_days=s);const{data:c}=await n.post("/admin/redeem-codes/generate",i);return c}async function Ai(e){const{data:t}=await n.delete(`/admin/redeem-codes/${e}`);return t}async function ki(e){const{data:t}=await n.post("/admin/redeem-codes/batch-delete",{ids:e});return t}async function Si(e,t){const{data:a}=await n.post("/admin/redeem-codes/batch-update",{ids:e,fields:t});return a}async function Pi(e){const{data:t}=await n.post(`/admin/redeem-codes/${e}/expire`);return t}async function Ei(){const{data:e}=await n.get("/admin/redeem-codes/stats");return e}async function Ii(e){return(await n.get("/admin/redeem-codes/export",{params:e,responseType:"blob"})).data}const $i={list:bi,getById:vi,generate:wi,delete:Ai,batchDelete:ki,batchUpdate:Si,expire:Pi,getStats:Ei,exportCodes:Ii};async function Ci(e=1,t=20,a,r){const{data:o}=await n.get("/admin/promo-codes",{params:{page:e,page_size:t,...a},signal:r==null?void 0:r.signal});return o}async function Mi(e){const{data:t}=await n.get(`/admin/promo-codes/${e}`);return t}async function Ti(e){const{data:t}=await n.post("/admin/promo-codes",e);return t}async function Ri(e,t){const{data:a}=await n.put(`/admin/promo-codes/${e}`,t);return a}async function xi(e){const{data:t}=await n.delete(`/admin/promo-codes/${e}`);return t}async function Li(e,t=1,a=20){const{data:r}=await n.get(`/admin/promo-codes/${e}/usages`,{params:{page:t,page_size:a}});return r}const Oi={list:Ci,getById:Mi,create:Ti,update:Ri,delete:xi,getUsages:Li};async function Di(e=1,t=20,a,r){const{data:o}=await n.get("/admin/announcements",{params:{page:e,page_size:t,...a},signal:r==null?void 0:r.signal});return o}async function qi(e){const{data:t}=await n.get(`/admin/announcements/${e}`);return t}async function Ui(e){const{data:t}=await n.post("/admin/announcements",e);return t}async function zi(e,t){const{data:a}=await n.put(`/admin/announcements/${e}`,t);return a}async function Ki(e){const{data:t}=await n.delete(`/admin/announcements/${e}`);return t}async function Ni(e,t=1,a=20,r,o){const{data:s}=await n.get(`/admin/announcements/${e}/read-status`,{params:{page:t,page_size:a,...r},signal:o==null?void 0:o.signal});return s}const Vi={list:Di,getById:qi,create:Ui,update:zi,delete:Ki,getReadStatus:Ni},ta=["anthropic","openai","gemini","antigravity","grok","typesafe"],Bi=["openai","anthropic","grok","kimi","zhipu","minimax","opencode_go"];function Fi(e){const t={};for(const a of Bi){const r=e==null?void 0:e[a];t[a]=typeof r=="number"&&Number.isFinite(r)?Math.min(100,Math.max(1,Math.trunc(r))):100}return t}function Pf(e){return Fi(e)}function Hi(e){const t={};for(const a of ta){const r=e==null?void 0:e[a];t[a]={daily:typeof(r==null?void 0:r.daily)=="number"?r.daily:null,weekly:typeof(r==null?void 0:r.weekly)=="number"?r.weekly:null,monthly:typeof(r==null?void 0:r.monthly)=="number"?r.monthly:null}}return t}function Wi(e){const t=r=>typeof r=="number"&&Number.isFinite(r)&&r>=0?r:null,a={};for(const r of ta){const o=e==null?void 0:e[r];a[r]={daily:t(o==null?void 0:o.daily),weekly:t(o==null?void 0:o.weekly),monthly:t(o==null?void 0:o.monthly)}}return a}const aa=["email","linuxdo","oidc","wechat","github","google","dingtalk"],ji=0,na=5,Gi={open:"open",open_platform:"open",official:"open",wx_open:"open",mp:"mp",official_account:"mp",wechat_mp:"mp",mini_program:"mp",mobile:"mobile",mobile_app:"mobile",native_app:"mobile"};function ra(e){return Array.isArray(e)?e.filter(t=>t.group_id>0&&t.validity_days>0).map(t=>({group_id:Math.floor(t.group_id),validity_days:Math.min(36500,Math.max(1,Math.floor(t.validity_days)))})):[]}function Ef(e){const t=e;return aa.reduce((a,r)=>{const o=t[`auth_source_default_${r}_subscriptions`];return a[r]={balance:Number(t[`auth_source_default_${r}_balance`]??ji),concurrency:Math.max(1,Number(t[`auth_source_default_${r}_concurrency`]??na)),subscriptions:ra(Array.isArray(o)?o:[]),grant_on_signup:t[`auth_source_default_${r}_grant_on_signup`]===!0,grant_on_first_bind:t[`auth_source_default_${r}_grant_on_first_bind`]===!0,platform_quotas:Hi(t[`auth_source_default_${r}_platform_quotas`])},a},{})}function If(e,t){const a=e;for(const r of aa){const o=t[r];a[`auth_source_default_${r}_balance`]=Number(o.balance)||0,a[`auth_source_default_${r}_concurrency`]=Math.max(1,Math.floor(Number(o.concurrency)||na)),a[`auth_source_default_${r}_subscriptions`]=ra(o.subscriptions),a[`auth_source_default_${r}_grant_on_signup`]=o.grant_on_signup,a[`auth_source_default_${r}_grant_on_first_bind`]=o.grant_on_first_bind,a[`auth_source_default_${r}_platform_quotas`]=Wi(o.platform_quotas)}return e}function nt(e){if(typeof e!="string")return"open";const t=e.trim().toLowerCase();return t?Gi[t]??"open":"open"}function $f(e){switch(nt(e)){case"mp":return"snsapi_userinfo";case"mobile":return"";default:return"snsapi_login"}}function Cf(e,t,a,r){if(typeof e=="boolean"||typeof t=="boolean"||typeof a=="boolean")return{openEnabled:e===!0,mpEnabled:t===!0,mobileEnabled:a===!0};switch(nt(r)){case"mp":return{openEnabled:!1,mpEnabled:!0,mobileEnabled:!1};case"mobile":return{openEnabled:!1,mpEnabled:!1,mobileEnabled:!0};default:return{openEnabled:!0,mpEnabled:!1,mobileEnabled:!1}}}function Mf(e,t,a,r){return t?"mp":a?"mobile":e?"open":nt(r)}async function Qi(){const{data:e}=await n.get("/admin/settings");return e}async function Ji(e){const{data:t}=await n.put("/admin/settings",e);return t}async function Yi(e){const{data:t}=await n.post("/admin/settings/test-smtp",e);return t}async function Zi(e){const{data:t}=await n.post("/admin/settings/send-test-email",e);return t}async function Xi(){const{data:e}=await n.get("/admin/settings/email-templates");return e}async function ec(e,t){const{data:a}=await n.get(`/admin/settings/email-templates/${encodeURIComponent(e)}/${encodeURIComponent(t)}`);return a}
2async function tc(e,t,a){const{data:r}=await n.put(`/admin/settings/email-templates/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,a);return r}async function ac(e,t){const{data:a}=await n.post(`/admin/settings/email-templates/${encodeURIComponent(e)}/${encodeURIComponent(t)}/restore-official`);return a}async function nc(e){const{data:t}=await n.post("/admin/settings/email-template-preview",e);return t}async function rc(){const{data:e}=await n.get("/admin/settings/admin-api-key");return e}async function oc(){const{data:e}=await n.post("/admin/settings/admin-api-key/regenerate");return e}async function sc(){const{data:e}=await n.delete("/admin/settings/admin-api-key");return e}async function ic(){const{data:e}=await n.get("/admin/settings/overload-cooldown");return e}async function cc(e){const{data:t}=await n.put("/admin/settings/overload-cooldown",e);return t}async function uc(){const{data:e}=await n.get("/admin/settings/rate-limit-429-cooldown");return e}async function lc(e){const{data:t}=await n.put("/admin/settings/rate-limit-429-cooldown",e);return t}async function dc(){const{data:e}=await n.get("/admin/settings/panel-rate-limit");return e}async function mc(e){const{data:t}=await n.put("/admin/settings/panel-rate-limit",e);return t}async function pc(){const{data:e}=await n.get("/admin/settings/stream-timeout");return e}async function fc(e){const{data:t}=await n.put("/admin/settings/stream-timeout",e);return t}async function gc(){const{data:e}=await n.get("/admin/settings/rectifier");return e}async function hc(e){const{data:t}=await n.put("/admin/settings/rectifier",e);return t}async function yc(){const{data:e}=await n.get("/admin/settings/beta-policy");return e}async function _c(e){const{data:t}=await n.put("/admin/settings/beta-policy",e);return t}async function bc(){const{data:e}=await n.get("/admin/settings/web-search-emulation");return e}async function vc(e){const{data:t}=await n.put("/admin/settings/web-search-emulation",e);return t}async function wc(e){const{data:t}=await n.post("/admin/settings/web-search-emulation/test",{query:e});return t}async function Ac(e){await n.post("/admin/settings/web-search-emulation/reset-usage",e)}const kc={getSettings:Qi,updateSettings:Ji,testSmtpConnection:Yi,sendTestEmail:Zi,getEmailTemplates:Xi,getEmailTemplate:ec,updateEmailTemplate:tc,restoreOfficialEmailTemplate:ac,previewEmailTemplate:nc,getAdminApiKey:rc,regenerateAdminApiKey:oc,deleteAdminApiKey:sc,getOverloadCooldownSettings:ic,updateOverloadCooldownSettings:cc,getRateLimit429CooldownSettings:uc,updateRateLimit429CooldownSettings:lc,getPanelRateLimitSettings:dc,updatePanelRateLimitSettings:mc,getStreamTimeoutSettings:pc,updateStreamTimeoutSettings:fc,getRectifierSettings:gc,updateRectifierSettings:hc,getBetaPolicySettings:yc,updateBetaPolicySettings:_c,getWebSearchEmulationConfig:bc,updateWebSearchEmulationConfig:vc,testWebSearchEmulation:wc,resetWebSearchUsage:Ac};async function Sc(e,t){const{data:a}=await n.post("/admin/subscriptions/bulk-action",e,{headers:{"Idempotency-Key":t}});return a}async function Pc(e=1,t=20,a,r){const{data:o}=await n.get("/admin/subscriptions",{params:{page:e,page_size:t,...a},signal:r==null?void 0:r.signal});return o}async function Ec(e){const{data:t}=await n.get(`/admin/subscriptions/${e}`);return t}async function Ic(e){const{data:t}=await n.get(`/admin/subscriptions/${e}/progress`);return t}async function $c(e){const{data:t}=await n.post("/admin/subscriptions/assign",e);return t}async function Cc(e){const{data:t}=await n.post("/admin/subscriptions/bulk-assign",e);return t}async function Mc(e,t){const{data:a}=await n.post(`/admin/subscriptions/${e}/extend`,t);return a}async function Tc(e){const{data:t}=await n.post(`/admin/subscriptions/${e}/revoke`);return t}async function Rc(e){const{data:t}=await n.post(`/admin/subscriptions/${e}/restore`);return t}async function xc(e,t){const{data:a}=await n.post(`/admin/subscriptions/${e}/reset-quota`,t);return a}async function Lc(e,t=1,a=20){const{data:r}=await n.get(`/admin/groups/${e}/subscriptions`,{params:{page:t,page_size:a}});return r}async function Oc(e,t=1,a=20){const{data:r}=await n.get(`/admin/users/${e}/subscriptions`,{params:{page:t,page_size:a}});return r}const Dc={list:Pc,getById:Ec,getProgress:Ic,assign:$c,bulkAssign:Cc,bulkAction:Sc,extend:Mc,revoke:Tc,restore:Rc,resetQuota:xc,listByGroup:Lc,listByUser:Oc};async function qc(e,t){const{data:a}=await n.get("/admin/usage",{params:e,signal:t==null?void 0:t.signal});return a}
2async function Uc(e){const{data:t}=await n.get("/admin/usage/stats",{params:e});return t}async function zc(e){const{data:t}=await n.get("/admin/usage/search-users",{params:{q:e}});return t}async function Kc(e,t){const a={};e!==void 0&&(a.user_id=e),t&&(a.q=t);const{data:r}=await n.get("/admin/usage/search-api-keys",{params:a});return r}async function Nc(e,t){const{data:a}=await n.get("/admin/usage/cleanup-tasks",{params:e,signal:t==null?void 0:t.signal});return a}async function Vc(e){const{data:t}=await n.post("/admin/usage/cleanup-tasks",e);return t}async function Bc(e){const{data:t}=await n.post(`/admin/usage/cleanup-tasks/${e}/cancel`);return t}const Fc={list:qc,getStats:Uc,searchUsers:zc,searchApiKeys:Kc,listCleanupTasks:Nc,createCleanupTask:Vc,cancelCleanupTask:Bc};async function Hc(e){const{data:t}=await n.post("/admin/gemini/oauth/auth-url",e);return t}async function Wc(e){const{data:t}=await n.post("/admin/gemini/oauth/exchange-code",e);return t}async function jc(){const{data:e}=await n.get("/admin/gemini/oauth/capabilities");return e}const Gc={generateAuthUrl:Hc,exchangeCode:Wc,getCapabilities:jc};async function Qc(e){const{data:t}=await n.post("/admin/antigravity/oauth/auth-url",e);return t}async function Jc(e){const{data:t}=await n.post("/admin/antigravity/oauth/exchange-code",e);return t}async function Yc(e,t){const a={refresh_token:e};t&&(a.proxy_id=t);const{data:r}=await n.post("/admin/antigravity/oauth/refresh-token",a);return r}const Zc={generateAuthUrl:Qc,exchangeCode:Jc,refreshAntigravityToken:Yc},oa=12e4;async function Xc(){const{data:e}=await n.get("/admin/grok/oauth/capabilities");return e}const eu=3,tu=9e4,au=9e4;function nu(e){return Math.ceil(Math.max(1,e)/eu)*tu+au}async function ru(e){const{data:t}=await n.post("/admin/grok/oauth/auth-url",e);return t}async function ou(e){const{data:t}=await n.post("/admin/grok/oauth/exchange-code",e);return t}async function su(e,t){const a={refresh_token:e};t&&(a.proxy_id=t);const{data:r}=await n.post("/admin/grok/oauth/refresh-token",a);return r}async function iu(e){const{data:t}=await n.get(`/admin/grok/accounts/${e}/quota`);return t}async function cu(e){const{data:t}=await n.post(`/admin/grok/accounts/${e}/reset-quota`);return t}async function uu(e){const{data:t}=await n.post("/admin/grok/sso-to-oauth",e,{timeout:nu(e.sso_tokens.length)});return t}async function lu(e,t){const a={sso_token:e};t&&(a.proxy_id=t);const{data:r}=await n.post("/admin/grok/oauth/sso-token",a,{timeout:oa});return r}async function du(e,t){const a="----",r=e.indexOf(a),o=(r>=0?e.slice(0,r):e).trim(),s=r>=0?e.slice(r+a.length):"",i={email:o,password:s};t&&(i.proxy_id=t);const{data:c}=await n.post("/admin/grok/oauth/password",i,{timeout:oa});return c}const mu={generateAuthUrl:ru,getCapabilities:Xc,exchangeCode:ou,refreshGrokToken:su,queryQuota:iu,resetQuota:cu,createFromSSO:uu,validateSSOToken:lu,authorizePassword:du};async function pu(e){const{data:t}=await n.get(`/admin/cn-providers/accounts/${e}/quota`);return t}async function fu(e){const{data:t}=await n.get(`/admin/cn-providers/accounts/${e}/balance`);return t}const gu={queryQuota:pu,queryBalance:fu};async function hu(){const{data:e}=await n.get("/admin/user-attributes");return e}async function yu(){const{data:e}=await n.get("/admin/user-attributes",{params:{enabled:!0}});return e}async function _u(e){const{data:t}=await n.post("/admin/user-attributes",e);return t}async function bu(e,t){const{data:a}=await n.put(`/admin/user-attributes/${e}`,t);return a}async function vu(e){const{data:t}=await n.delete(`/admin/user-attributes/${e}`);return t}async function wu(e){const{data:t}=await n.put("/admin/user-attributes/reorder",{ids:e});return t}async function Au(e){const{data:t}=await n.get(`/admin/users/${e}/attributes`);return t}async function ku(e,t){const{data:a}=await n.put(`/admin/users/${e}/attributes`,{values:t});return a}async function Su(e){const{data:t}=await n.post("/admin/user-attributes/batch",{user_ids:e});return t}const Pu={listDefinitions:hu,listEnabledDefinitions:yu,createDefinition:_u,updateDefinition:bu,deleteDefinition:vu,reorderDefinitions:wu,getUserAttributeValues:Au,updateUserAttributeValues:ku,getBatchUserAttributes:Su};async function Eu(e,t){const a={};e&&(a.platform=e),typeof t=="number"&&t>0&&(a.group_id=t);const{data:r}=await n.get("/admin/ops/concurrency",{params:a});return r}async function Iu(){const{data:e}=await n.get("/admin/ops/user-concurrency");return e}async function $u(e,t){const a={};e&&(a.platform=e),typeof t=="number"&&t>0&&(a.group_id=t);const{data:r}=await n.get("/admin/ops/account-availability",{params:a});return r}async function Cu(e,t,a){const r={window:e};t&&(r.platform=t),typeof a=="number"&&a>0&&(r.group_id=a);const{data:o}=await n.get("/admin/ops/realtime-traffic",{params:r});return o}const Mu={REALTIME_DISABLED:4001},Tu="sub2api-admin";function Ru(e,t={}){let a=null,r=0;const o=Number.isFinite(t.maxReconnectAttempts)?t.maxReconnectAttempts:1/0,s=t.reconnectBaseDelayMs??1e3,i=t.reconnectMaxDelayMs??3e4;let c=null,u=!0,m=!1,l=!1,_=0;const v=t.staleTimeoutMs??12e4,d=t.staleCheckIntervalMs??3e4;let p=null;const f=F=>{var H;(H=t.onStatusChange)==null||H.call(t,F)},A=()=>{c&&(clearTimeout(c),c=null)},k=()=>{p&&(clearInterval(p),p=null)},y=()=>{k(),!(!v||v<=0)&&(p=setInterval(()=>{if(!u||!a||a.readyState!==WebSocket.OPEN||!_)return;Date.now()-_>v&&a.close()},d))},I=()=>{var W;if(!u||l&&r>=o)return;if(typeof navigator<"u"&&"onLine"in navigator&&!navigator.onLine){f("offline");return}const F=s*Math.pow(2,r),H=Math.min(F,i),z=Math.floor(Math.random()*250);A(),c=setTimeout(()=>{r++,Q()},H+z),(W=t.onReconnectScheduled)==null||W.call(t,{attempt:r+1,delayMs:H+z})},E=()=>{u&&(a&&(a.readyState===WebSocket.OPEN||a.readyState===WebSocket.CONNECTING)||Q())},U=()=>{f("offline")},Q=()=>
2{if(!u||m||a&&(a.readyState===WebSocket.OPEN||a.readyState===WebSocket.CONNECTING)||l&&r>=o)return;m=!0,f(l?"reconnecting":"connecting");const F=t.wsBaseUrl||void 0,H=F?new URL(`${window.location.protocol==="https:"?"wss:":"ws:"}//${F}/api/v1/admin/ops/ws/qps`):new URL(Dt("/api/v1/admin/ops/ws/qps").replace(/^http/,"ws")),z=String(t.token??localStorage.getItem("auth_token")??"").trim(),W=[Tu];z&&W.push(`jwt.${z}`),a=new WebSocket(H.toString(),W),a.onopen=()=>{var O;r=0,m=!1,l=!0,A(),_=Date.now(),y(),f("connected"),(O=t.onOpen)==null||O.call(t)},a.onmessage=O=>{try{const q=JSON.parse(O.data);_=Date.now(),e(q)}catch(q){console.warn("[OpsWS] Failed to parse message:",q)}},a.onerror=O=>{var q;console.error("[OpsWS] Connection error:",O),(q=t.onError)==null||q.call(t,O)},a.onclose=O=>{var q,N;if(m=!1,(q=t.onClose)==null||q.call(t,O),k(),a=null,O&&typeof O.code=="number"&&O.code===Mu.REALTIME_DISABLED){u=!1,A(),f("closed"),(N=t.onFatalClose)==null||N.call(t,O);return}I()}};return window.addEventListener("online",E),window.addEventListener("offline",U),Q(),()=>{u=!1,window.removeEventListener("online",E),window.removeEventListener("offline",U),A(),k(),a&&a.close(),a=null,f("closed")}}async function xu(e,t={}){const{data:a}=await n.get("/admin/ops/dashboard/overview",{params:e,signal:t.signal});return a}async function Lu(e,t={}){const{data:a}=await n.get("/admin/ops/dashboard/snapshot-v2",{params:e,signal:t.signal});return a}async function Ou(e,t={}){const{data:a}=await n.get("/admin/ops/dashboard/throughput-trend",{params:e,signal:t.signal});return a}async function Du(e,t={}){const{data:a}=await n.get("/admin/ops/dashboard/latency-histogram",{params:e,signal:t.signal});return a}async function qu(e,t={}){const{data:a}=await n.get("/admin/ops/dashboard/error-trend",{params:e,signal:t.signal});return a}async function Uu(e,t={}){const{data:a}=await n.get("/admin/ops/dashboard/error-distribution",{params:e,signal:t.signal});return a}async function zu(e,t={}){const{data:a}=await n.get("/admin/ops/dashboard/openai-token-stats",{params:e,signal:t.signal});return a}async function Ku(e){const{data:t}=await n.get("/admin/ops/errors",{params:e});return t}async function Nu(e){const{data:t}=await n.get(`/admin/ops/errors/${e}`);return t}async function Vu(e,t){await n.put(`/admin/ops/errors/${e}/resolve`,{resolved:t})}async function Bu(e){const{data:t}=await n.get("/admin/ops/request-errors",{params:e});return t}async function Fu(e){const{data:t}=await n.get("/admin/ops/upstream-errors",{params:e});return t}async function Hu(e){const{data:t}=await n.get(`/admin/ops/request-errors/${e}`);return t}async function Wu(e){const{data:t}=await n.get(`/admin/ops/upstream-errors/${e}`);return t}async function ju(e,t){await n.put(`/admin/ops/request-errors/${e}/resolve`,{resolved:t})}async function Gu(e,t){await n.put(`/admin/ops/upstream-errors/${e}/resolve`,{resolved:t})}async function Qu(e,t={},a={}){const r={...t};a.include_detail&&(r.include_detail="1");const{data:o}=await n.get(`/admin/ops/request-errors/${e}/upstream-errors`,{params:r});return o}async function Ju(e){const{data:t}=await n.get("/admin/ops/requests",{params:e});return t}async function Yu(){const{data:e}=await n.get("/admin/ops/alert-rules");return e}async function Zu(e){const{data:t}=await n.post("/admin/ops/alert-rules",e);return t}async function Xu(e,t){const{data:a}=await n.put(`/admin/ops/alert-rules/${e}`,t);return a}async function el(e){await n.delete(`/admin/ops/alert-rules/${e}`)}async function tl(e={}){const{data:t}=await n.get("/admin/ops/alert-events",{params:e});return t}async function al(e){const{data:t}=await n.get(`/admin/ops/alert-events/${e}`);return t}async function nl(e,t){await n.put(`/admin/ops/alert-events/${e}/status`,{status:t})}async function rl(e){await n.post("/admin/ops/alert-silences",e)}async function ol(){const{data:e}=await n.get("/admin/ops/email-notification/config");return e}async function sl(e){const{data:t}=await n.put("/admin/ops/email-notification/config",e);return t}async function il(){const{data:e}=await n.get("/admin/ops/runtime/alert");return e}async function cl(e){const{data:t}=await n.put("/admin/ops/runtime/alert",e);return t}async function ul(){const{data:e}=await n.get("/admin/ops/runtime/logging");return e}async function ll(e){const{data:t}=await n.put("/admin/ops/runtime/logging",e);return t}async function dl(){const{data:e}=await n.post("/admin/ops/runtime/logging/reset");return e}async function ml(e){const{data:t}=await n.get("/admin/ops/system-logs",{params:e});return t}async function pl(e){const{data:t}=await n.post("/admin/ops/system-logs/cleanup",e);return t}async function fl(){const{data:e}=await n.get("/admin/ops/system-logs/health");return e}async function gl(){const{data:e}=await n.get("/admin/ops/advanced-settings");return e}async function hl(e){const{data:t}=await n.put("/admin/ops/advanced-settings",e);return t}async function yl(){const{data:e}=await n.get("/admin/ops/settings/metric-thresholds");return e}async function _l(e){await n.put("/admin/ops/settings/metric-thresholds",e)}const bl={getDashboardSnapshotV2:Lu,getDashboardOverview:xu,getThroughputTrend:Ou,getLatencyHistogram:Du,getErrorTrend:qu,getErrorDistribution:Uu,getOpenAITokenStats:zu,getConcurrencyStats:Eu,getUserConcurrencyStats:Iu,getAccountAvailabilityStats:$u,getRealtimeTrafficSummary:Cu,subscribeQPS:Ru,listErrorLogs:Ku,getErrorLogDetail:Nu,updateErrorResolved:Vu,listRequestErrors:Bu,listUpstreamErrors:Fu,getRequestErrorDetail:Hu,getUpstreamErrorDetail:Wu,updateRequestErrorResolved:ju,updateUpstreamErrorResolved:Gu,listRequestErrorUpstreamErrors:Qu,listRequestDetails:Ju,listAlertRules:Yu,createAlertRule:Zu,updateAlertRule:Xu,deleteAlertRule:el,listAlertEvents:tl,getAlertEvent:al,updateAlertEventStatus:nl,createAlertSilence:rl,getEmailNotificationConfig:ol,updateEmailNotificationConfig:sl,getAlertRuntimeSettings:il,updateAlertRuntimeSettings:cl,getRuntimeLogC
2onfig:ul,updateRuntimeLogConfig:ll,resetRuntimeLogConfig:dl,getAdvancedSettings:gl,updateAdvancedSettings:hl,getMetricThresholds:yl,updateMetricThresholds:_l,listSystemLogs:ml,cleanupSystemLogs:pl,getSystemLogSinkHealth:fl};async function vl(){const{data:e}=await n.get("/admin/error-passthrough-rules");return e}async function wl(e){const{data:t}=await n.get(`/admin/error-passthrough-rules/${e}`);return t}async function Al(e){const{data:t}=await n.post("/admin/error-passthrough-rules",e);return t}async function sa(e,t){const{data:a}=await n.put(`/admin/error-passthrough-rules/${e}`,t);return a}async function kl(e){const{data:t}=await n.delete(`/admin/error-passthrough-rules/${e}`);return t}async function Sl(e,t){return sa(e,{enabled:t})}const Pl={list:vl,getById:wl,create:Al,update:sa,delete:kl,toggleEnabled:Sl};async function El(){const{data:e}=await n.get("/admin/data-management/agent/health");return e}async function Il(){const{data:e}=await n.get("/admin/data-management/config");return e}async function $l(e){const{data:t}=await n.put("/admin/data-management/config",e);return t}async function Cl(e){const{data:t}=await n.post("/admin/data-management/s3/test",e);return t}async function Ml(e){const{data:t}=await n.get(`/admin/data-management/sources/${e}/profiles`);return t}async function Tl(e,t){const{data:a}=await n.post(`/admin/data-management/sources/${e}/profiles`,t);return a}async function Rl(e,t,a){const{data:r}=await n.put(`/admin/data-management/sources/${e}/profiles/${t}`,a);return r}async function xl(e,t){await n.delete(`/admin/data-management/sources/${e}/profiles/${t}`)}async function Ll(e,t){const{data:a}=await n.post(`/admin/data-management/sources/${e}/profiles/${t}/activate`);return a}async function Ol(){const{data:e}=await n.get("/admin/data-management/s3/profiles");return e}async function Dl(e){const{data:t}=await n.post("/admin/data-management/s3/profiles",e);return t}async function ql(e,t){const{data:a}=await n.put(`/admin/data-management/s3/profiles/${e}`,t);return a}async function Ul(e){await n.delete(`/admin/data-management/s3/profiles/${e}`)}async function zl(e){const{data:t}=await n.post(`/admin/data-management/s3/profiles/${e}/activate`);return t}async function Kl(e){const t=e.idempotency_key?{"X-Idempotency-Key":e.idempotency_key}:void 0,{data:a}=await n.post("/admin/data-management/backups",e,{headers:t});return a}async function Nl(e){const{data:t}=await n.get("/admin/data-management/backups",{params:e});return t}async function Vl(e){const{data:t}=await n.get(`/admin/data-management/backups/${e}`);return t}const Bl={getAgentHealth:El,getConfig:Il,updateConfig:$l,listSourceProfiles:Ml,createSourceProfile:Tl,updateSourceProfile:Rl,deleteSourceProfile:xl,setActiveSourceProfile:Ll,testS3:Cl,listS3Profiles:Ol,createS3Profile:Dl,updateS3Profile:ql,deleteS3Profile:Ul,setActiveS3Profile:zl,createBackupJob:Kl,listBackupJobs:Nl,getBackupJob:Vl};async function Fl(e,t){const{data:a}=await n.put(`/admin/api-keys/${e}`,{group_id:t===null?0:t});return a}const Hl={updateApiKeyGroup:Fl};async function Wl(e){const{data:t}=await n.get(`/admin/accounts/${e}/scheduled-test-plans`);return t??[]}async function jl(e){const{data:t}=await n.post("/admin/scheduled-test-plans",e);return t}async function Gl(e,t){const{data:a}=await n.put(`/admin/scheduled-test-plans/${e}`,t);return a}async function Ql(e){await n.delete(`/admin/scheduled-test-plans/${e}`)}async function Jl(e,t){const{data:a}=await n.get(`/admin/scheduled-test-plans/${e}/results`,{params:t?{limit:t}:void 0});return a??[]}const Yl={listByAccount:Wl,create:jl,update:Gl,delete:Ql,listResults:Jl};async function Zl(){const{data:e}=await n.get("/admin/backups/s3-config");return e}async function Xl(e){const{data:t}=await n.put("/admin/backups/s3-config",e);return t}async function ed(e){const{data:t}=await n.post("/admin/backups/s3-config/test",e);return t}async function td(){const{data:e}=await n.get("/admin/backups/image-storage");return e}async function ad(e){const{data:t}=await n.put("/admin/backups/image-storage",e);return t}async function nd(e){const{data:t}=await n.post("/admin/backups/image-storage/test",e);return t}async function rd(){const{data:e}=await n.get("/admin/backups/schedule");return e}async function od(e){const{data:t}=await n.put("/admin/backups/schedule",e);return t}async function sd(e){const{data:t}=await n.post("/admin/backups",e||{});return t}async function id(){const{data:e}=await n.get("/admin/backups");return e}async function cd(e){const{data:t}=await n.get(`/admin/backups/${e}`);return t}async function ud(e,t=!1){await n.delete(`/admin/backups/${e}`,t?{params:{delete_archived:!0}}:void 0)}async function ld(e){const{data:t}=await n.get(`/admin/backups/${e}/download-url`);return t}async function dd(e,t){const{data:a}=await n.post(`/admin/backups/${e}/restore`,{password:t});return a}const md={getS3Config:Zl,updateS3Config:Xl,testS3Connection:ed,getImageStorageConfig:td,updateImageStorageConfig:ad,testImageStorageConnection:nd,getSchedule:rd,updateSchedule:od,createBackup:sd,listBackups:id,getBackup:cd,deleteBackup:ud,getDownloadURL:ld,restoreBackup:dd};async function pd(){const{data:e}=await n.get("/admin/tls-fingerprint-profiles");return e}async function fd(e){const{data:t}=await n.get(`/admin/tls-fingerprint-profiles/${e}`);return t}async function gd(e){const{data:t}=await n.post("/admin/tls-fingerprint-profiles",e);return t}async function hd(e,t){const{data:a}=await n.put(`/admin/tls-fingerprint-profiles/${e}`,t);return a}
2async function yd(e){const{data:t}=await n.delete(`/admin/tls-fingerprint-profiles/${e}`);return t}const _d={list:pd,getById:fd,create:gd,update:hd,delete:yd};async function bd(e=1,t=20,a,r){const{data:o}=await n.get("/admin/channels",{params:{page:e,page_size:t,...a},signal:r==null?void 0:r.signal});return o}async function vd(e){const{data:t}=await n.get(`/admin/channels/${e}`);return t}async function wd(e){const{data:t}=await n.post("/admin/channels",e);return t}async function Ad(e,t){const{data:a}=await n.put(`/admin/channels/${e}`,t);return a}async function kd(e){await n.delete(`/admin/channels/${e}`)}async function Sd(e){const{data:t}=await n.get("/admin/channels/model-pricing",{params:{model:e}});return t}async function Pd(e){const{data:t}=await n.get("/admin/channels/pricing/sync-models",{params:{platform:e}});return t}const Ed={list:bd,getById:vd,create:wd,update:Ad,remove:kd,getModelDefaultPricing:Sd,syncPricingModels:Pd};async function Id(e={},t){const{data:a}=await n.get("/admin/channel-monitors",{params:e,signal:t==null?void 0:t.signal});return a}async function $d(e){const{data:t}=await n.get(`/admin/channel-monitors/${e}`);return t}async function Cd(e){const{data:t}=await n.post("/admin/channel-monitors",e);return t}const Ue=new Map;function Md(){var e;try{const t=(e=globalThis.localStorage)==null?void 0:e.getItem("auth_user");if(!t)return null;const a=JSON.parse(t);if(typeof a!="object"||a===null)return null;const r=a.id;return typeof r!="number"||!Number.isSafeInteger(r)||r<=0?null:String(r)}catch{return null}}function Td(e){const t=Md();return t?{adminID:t,key:`sub2api:admin:channel-monitor-duplicate:${t}:${e}`}:null}function Rd(e){var t;try{return((t=globalThis.sessionStorage)==null?void 0:t.getItem(e))??null}catch{return null}}function _t(e,t){var a,r;try{t?(a=globalThis.sessionStorage)==null||a.setItem(e,t):(r=globalThis.sessionStorage)==null||r.removeItem(e)}catch{}}async function xd(e){var o,s;const t=Td(e);let a=t?Ue.get(t.key)??Rd(t.key):null;if(!a){const i=((s=(o=globalThis.crypto)==null?void 0:o.randomUUID)==null?void 0:s.call(o))??`${Date.now()}-${Math.random().toString(36).slice(2)}`;a=`channel-monitor-duplicate-${(t==null?void 0:t.adminID)??"unknown-admin"}-${e}-${i}`}t&&(Ue.set(t.key,a),_t(t.key,a));const{data:r}=await n.post(`/admin/channel-monitors/${e}/duplicate`,void 0,{headers:{"Idempotency-Key":a}});return t&&(Ue.delete(t.key),_t(t.key,null)),r}async function Ld(e,t){const{data:a}=await n.put(`/admin/channel-monitors/${e}`,t);return a}async function Od(e){await n.delete(`/admin/channel-monitors/${e}`)}async function Dd(e){const{data:t}=await n.post(`/admin/channel-monitors/${e}/run`);return t}async function qd(e,t={}){const{data:a}=await n.get(`/admin/channel-monitors/${e}/history`,{params:t});return a}const Ud={list:Id,get:$d,create:Cd,duplicate:xd,update:Ld,del:Od,runNow:Dd,listHistory:qd};async function zd(e={}){const{data:t}=await n.get("/admin/channel-monitor-templates",{params:e});return t}async function Kd(e){const{data:t}=await n.get(`/admin/channel-monitor-templates/${e}`);return t}async function Nd(e){const{data:t}=await n.post("/admin/channel-monitor-templates",e);return t}async function Vd(e,t){const{data:a}=await n.put(`/admin/channel-monitor-templates/${e}`,t);return a}async function Bd(e){await n.delete(`/admin/channel-monitor-templates/${e}`)}async function Fd(e,t){const{data:a}=await n.post(`/admin/channel-monitor-templates/${e}/apply`,{monitor_ids:t});return a}async function Hd(e){const{data:t}=await n.get(`/admin/channel-monitor-templates/${e}/monitors`);return t}const Wd={list:zd,get:Kd,create:Nd,update:Vd,del:Bd,apply:Fd,listAssociatedMonitors:Hd},jd={getConfig(){return n.get("/admin/payment/config")},updateConfig(e){return n.put("/admin/payment/config",e)},getDashboard(e){return n.get("/admin/payment/dashboard",{params:e?{days:e}:void 0})},getOrders(e){return n.get("/admin/payment/orders",{params:e})},getOrder(e){return n.get(`/admin/payment/orders/${e}`)},cancelOrder(e){return n.post(`/admin/payment/orders/${e}/cancel`)},retryRecharge(e){return n.post(`/admin/payment/orders/${e}
2/retry`)},refundOrder(e,t){return n.post(`/admin/payment/orders/${e}/refund`,t)},queryRefund(e){return n.post(`/admin/payment/orders/${e}/refund/query`)},getChannels(){return n.get("/admin/payment/channels")},createChannel(e){return n.post("/admin/payment/channels",e)},updateChannel(e,t){return n.put(`/admin/payment/channels/${e}`,t)},deleteChannel(e){return n.delete(`/admin/payment/channels/${e}`)},getPlans(){return n.get("/admin/payment/plans")},createPlan(e){return n.post("/admin/payment/plans",e)},updatePlan(e,t){return n.put(`/admin/payment/plans/${e}`,t)},deletePlan(e){return n.delete(`/admin/payment/plans/${e}`)},getProviders(){return n.get("/admin/payment/providers")},createProvider(e){return n.post("/admin/payment/providers",e)},updateProvider(e,t){return n.put(`/admin/payment/providers/${e}`,t)},deleteProvider(e){return n.delete(`/admin/payment/providers/${e}`)}};async function Gd(e={}){const{data:t}=await n.get("/admin/affiliates/users",{params:{page:e.page??1,page_size:e.page_size??20,search:e.search??""}});return t}async function Qd(e){const{data:t}=await n.get("/admin/affiliates/users/lookup",{params:{q:e}});return t}async function Jd(e,t){const{data:a}=await n.put(`/admin/affiliates/users/${e}`,t);return a}async function Yd(e){const{data:t}=await n.delete(`/admin/affiliates/users/${e}`);return t}async function Zd(e){const{data:t}=await n.post("/admin/affiliates/users/batch-rate",e);return t}function rt(e={}){return{page:e.page??1,page_size:e.page_size??20,search:e.search??"",start_at:e.start_at||void 0,end_at:e.end_at||void 0,sort_by:e.sort_by||void 0,sort_order:e.sort_order||void 0,timezone:e.timezone||void 0}}async function Xd(e={}){const{data:t}=await n.get("/admin/affiliates/invites",{params:rt(e)});return t}async function em(e={}){const{data:t}=await n.get("/admin/affiliates/rebates",{params:rt(e)});return t}async function tm(e={}){const{data:t}=await n.get("/admin/affiliates/transfers",{params:rt(e)});return t}async function am(e){const{data:t}=await n.get(`/admin/affiliates/users/${e}/overview`);return t}async function nm(e,t,a){var o;const r=await n.post(`/admin/affiliates/users/${e}/withdraw`,t,{headers:{"Idempotency-Key":a}});return{result:r.data,replayed:((o=r.headers)==null?void 0:o["x-idempotency-replayed"])==="true"}}const rm={listUsers:Gd,lookupUsers:Qd,updateUserSettings:Jd,clearUserSettings:Yd,batchSetRate:Zd,listInviteRecords:Xd,listRebateRecords:em,listTransferRecords:tm,getUserOverview:am,withdrawUserQuota:nm};async function om(){const{data:e}=await n.get("/admin/risk-control/config");return e}async function sm(e){const{data:t}=await n.put("/admin/risk-control/config",e);return t}async function im(){const{data:e}=await n.get("/admin/risk-control/status");return e}async function cm(e={}){const{data:t}=await n.post("/admin/risk-control/api-keys/test",e);return t}async function um(e={}){const{data:t}=await n.get("/admin/risk-control/logs",{params:e});return t}async function lm(e){const{data:t}=await n.post(`/admin/risk-control/users/${e}/unban`);return t}async function dm(e){const{data:t}=await n.delete("/admin/risk-control/hashes",{data:{input_hash:e}});return t}async function mm(){const{data:e}=await n.delete("/admin/risk-control/hashes/all");return e}const pm={getConfig:om,updateConfig:sm,getStatus:im,testAPIKeys:cm,listLogs:um,unbanUser:lm,deleteFlaggedHash:dm,clearFlaggedHashes:mm},Be={async getStatus(){const{data:e}=await n.get("/admin/compliance");return e},async accept(e){const{data:t}=await n.post("/admin/compliance/accept",e);return t}};async function fm(e){const{data:t}=await n.get("/admin/audit-logs",{params:e});return t}async function gm(e){const{data:t}=await n.get(`/admin/audit-logs/${e}`);return t}async function hm(e){const{data:t}=await n.post("/admin/audit-logs/clear",{totp_code:e});return t}const ym={list:fm,get:gm,clear:hm};async function _m(){const{data:e}=await n.get("/admin/plugins");return e}async function bm(e){const t=new FormData;t.append("plugin",e);const{data:a}=await n.post("/admin/plugins/upload",t,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4});return a}
2async function vm(e,t,a){const{data:r}=await n.post(`/admin/plugins/${e}/enable`,{rollout_percent:t,accept_untested:a});return r}async function wm(e){const{data:t}=await n.post(`/admin/plugins/${e}/disable`);return t}async function Am(e){await n.delete(`/admin/plugins/${e}`)}async function km(e){const{data:t}=await n.get(`/admin/plugins/${e}/config`);return t}async function Sm(e,t){const{data:a}=await n.put(`/admin/plugins/${e}/config`,t);return a}async function Pm(e){const{data:t}=await n.post(`/admin/plugins/${e}/test`);return t}async function Em(e){const{data:t}=await n.get(`/admin/plugins/${e}/status`);return t}async function Im(e){const{data:t}=await n.post(`/admin/plugins/${e}/ui-session`);return t}const $m={list:_m,upload:bm,enable:vm,disable:wm,remove:Am,getConfig:km,saveConfig:Sm,test:Pm,status:Em,createUISession:Im},bt={dashboard:jr,users:lo,groups:No,accounts:ai,proxies:_i,redeem:$i,promo:Oi,announcements:Vi,settings:kc,system:wn,subscriptions:Dc,usage:Fc,gemini:Gc,antigravity:Zc,grok:mu,cnProviders:gu,userAttributes:Pu,ops:bl,errorPassthrough:Pl,dataManagement:Bl,apiKeys:Hl,scheduledTests:Yl,backup:md,tlsFingerprintProfiles:_d,channels:Ed,channelMonitor:Ud,channelMonitorTemplate:Wd,payment:jd,affiliates:rm,riskControl:pm,compliance:Be,audit:ym,plugins:$m},ye="auth_token",_e="auth_user",be="refresh_token",ve="token_expires_at",le="pending_auth_session",Cm=60*1e3,Mm=120*1e3;function Tm(e){return e==="pending_oauth_token"?"pending_oauth_token":"pending_auth_token"}function vt(){const e=localStorage.getItem(le);if(!e)return null;try{const t=JSON.parse(e),a=typeof(t==null?void 0:t.provider)=="string"?t.provider.trim():"";return a?{token:typeof(t==null?void 0:t.token)=="string"?t.token:"",token_field:Tm(t==null?void 0:t.token_field),provider:a,redirect:typeof(t==null?void 0:t.redirect)=="string"?t.redirect:void 0,adoption_required:typeof(t==null?void 0:t.adoption_required)=="boolean"?t.adoption_required:void 0,suggested_display_name:typeof(t==null?void 0:t.suggested_display_name)=="string"?t.suggested_display_name:void 0,suggested_avatar_url:typeof(t==null?void 0:t.suggested_avatar_url)=="string"?t.suggested_avatar_url:void 0}:(localStorage.removeItem(le),null)}catch{return localStorage.removeItem(le),null}}function Rm(e){localStorage.setItem(le,JSON.stringify(e))}function wt(){localStorage.removeItem(le)}const Me=oe("auth",()=>{const e=w(null),t=w(null),a=w(null),r=w(null),o=w("standard"),s=w(null);let i=null,c=null;const u=$(()=>!!t.value&&!!e.value),m=$(()=>{var b;return((b=e.value)==null?void 0:b.role)==="admin"}),l=$(()=>o.value==="simple"),_=$(()=>s.value!==null);function v(){const b=localStorage.getItem(ye),P=localStorage.getItem(_e),x=localStorage.getItem(be),J=localStorage.getItem(ve);if(s.value=vt(),b&&P)try{t.value=b,e.value=JSON.parse(P),a.value=x,r.value=J?parseInt(J,10):null,q().catch(se=>{console.error("Failed to refresh user on init:",se)}),d(),x&&r.value!==null&&f(r.value)}catch(se){console.error("Failed to parse saved user data:",se),N({preservePendingAuthSession:!0})}}function d(){p(),i=setInterval(()=>{t.value&&q().catch(b=>{console.error("Auto-refresh user failed:",b)})},Cm)}function p(){i&&(clearInterval(i),i=null)}function f(b){c&&(clearTimeout(c),c=null);const P=Date.now(),x=Math.max(0,b-P-Mm);if(x<=0){k();return}c=setTimeout(()=>{k()},x)}function A(b){const P=Date.now()+b*1e3;r.value=P,localStorage.setItem(ve,String(P)),f(P)}async function k(){if(a.value)try{const b=await ne.refreshToken();t.value=b.access_token,a.value=b.refresh_token,A(b.expires_in)}catch(b){console.error("Token refresh failed:",b)}}function y(){c&&(clearTimeout(c),c=null)}async function I(b){try{const P=await ne.login(b);return Xe(P)||Q(P),P}catch(P){throw N({preservePendingAuthSession:s.value!==null}),P}}async function E(b,P){try{const x=await ne.login2FA({temp_token:b,totp_code:P});return Q(x),e.value}catch(x){throw N({preservePendingAuthSession:s.value!==null}),x}}async function U(b){try{const P=await xr.login(b);return Q(P),e.value}catch(P){throw N({preservePendingAuthSession:s.value!==null}),P}}function Q(b){t.value=b.access_token,b.refresh_token&&(a.value=b.refresh_token,localStorage.setItem(be,b.refresh_token)),b.user.run_mode&&(o.value=b.user.run_mode);const{run_mode:P,...x}=b.user;e.value=x,localStorage.setItem(ye,b.access_token),localStorage.setItem(_e,JSON.stringify(x)),W(),d(),b.refresh_token&&b.expires_in&&A(b.expires_in)}async function F(b){try{const P=await ne.register(b);return Q(P),e.value}catch(P){throw N({preservePendingAuthSession:s.value!==null}),P}}
2async function H(b){p(),y(),t.value=null,e.value=null,t.value=b,localStorage.setItem(ye,b);const P=localStorage.getItem(be),x=localStorage.getItem(ve);P&&(a.value=P),x&&(r.value=parseInt(x,10));try{const J=await q();return d(),P&&r.value!==null&&f(r.value),W(),J}catch(J){throw N({preservePendingAuthSession:s.value!==null}),J}}function z(b){if(s.value=b,b){Rm(b);return}wt()}function W(){z(null)}async function O(){try{await ne.logout()}catch(b){console.warn("Logout API call failed, clearing local session anyway",b)}finally{N()}}async function q(){if(!t.value)throw new Error("Not authenticated");try{const b=await ne.getCurrentUser();b.data.run_mode&&(o.value=b.data.run_mode);const{run_mode:P,...x}=b.data;return e.value=x,localStorage.setItem(_e,JSON.stringify(x)),x}catch(b){throw b.status===401&&N({preservePendingAuthSession:s.value!==null}),b}}function N(b){if(p(),y(),t.value=null,a.value=null,r.value=null,e.value=null,localStorage.removeItem(ye),localStorage.removeItem(_e),localStorage.removeItem(be),localStorage.removeItem(ve),b!=null&&b.preservePendingAuthSession){s.value=vt();return}s.value=null,wt()}return{user:e,token:t,runMode:we(o),pendingAuthSession:we(s),isAuthenticated:u,isAdmin:m,isSimpleMode:l,hasPendingAuthSession:_,login:I,loginWithPasskey:U,login2FA:E,register:F,setToken:H,logout:O,checkAuth:v,refreshUser:q,setPendingAuthSession:z,clearPendingAuthSession:W}}),xm=Object.freeze(Object.defineProperty({__proto__:null,useAuthStore:Me},Symbol.toStringTag,{value:"Module"})),ot=oe("adminSettings",()=>{const e=w(!1),t=w(!1),a=(y,I)=>{try{const E=localStorage.getItem(y);if(E==="true")return!0;if(E==="false")return!1}catch{}return I},r=(y,I)=>{try{localStorage.setItem(y,I?"true":"false")}catch{}},o=(y,I)=>{try{const E=localStorage.getItem(y);if(typeof E=="string"&&E.length>0)return E}catch{}return I},s=(y,I)=>{try{localStorage.setItem(y,I)}catch{}},i=w(a("ops_monitoring_enabled_cached",!0)),c=w(a("ops_realtime_monitoring_enabled_cached",!0)),u=w(o("ops_query_mode_default_cached","auto")),m=w(a("payment_enabled_cached",!1)),l=w([]);async function _(y=!1){var I;if(!(e.value&&!y)&&!t.value){t.value=!0;try{const[E,U]=await Promise.all([bt.settings.getSettings(),bt.payment.getConfig()]);i.value=E.ops_monitoring_enabled??!0,r("ops_monitoring_enabled_cached",i.value),
2c.value=E.ops_realtime_monitoring_enabled??!0,r("ops_realtime_monitoring_enabled_cached",c.value),u.value=E.ops_query_mode_default||"auto",s("ops_query_mode_default_cached",u.value),l.value=Array.isArray(E.custom_menu_items)?E.custom_menu_items:[],m.value=((I=U.data)==null?void 0:I.enabled)??!1,r("payment_enabled_cached",m.value),e.value=!0}catch(E){console.error("[adminSettings] Failed to fetch settings:",E)}finally{t.value=!1}}}function v(y){i.value=y,r("ops_monitoring_enabled_cached",y),e.value=!0}function d(y){c.value=y,r("ops_realtime_monitoring_enabled_cached",y),e.value=!0}function p(y){m.value=y,r("payment_enabled_cached",y),e.value=!0}function f(y){u.value=y||"auto",s("ops_query_mode_default_cached",u.value),e.value=!0}let A=null;function k(){if(!A)try{const y=()=>{v(!1)};window.addEventListener("ops-monitoring-disabled",y),A=()=>{window.removeEventListener("ops-monitoring-disabled",y)}}catch{}}return typeof window<"u"&&k(),{loaded:e,loading:t,opsMonitoringEnabled:i,opsRealtimeMonitoringEnabled:c,opsQueryModeDefault:u,paymentEnabled:m,customMenuItems:l,fetch:_,setOpsMonitoringEnabledLocal:v,setOpsRealtimeMonitoringEnabledLocal:d,setPaymentEnabledLocal:p,setOpsQueryModeDefaultLocal:f}}),Lm=Object.freeze(Object.defineProperty({__proto__:null,useAdminSettingsStore:ot},Symbol.toStringTag,{value:"Module"}));async function Om(){return(await n.get("/subscriptions")).data}async function Dm(){return(await n.get("/subscriptions/active")).data}async function qm(){return(await n.get("/subscriptions/progress")).data}async function Um(){return(await n.get("/subscriptions/summary")).data}async function zm(e){return(await n.get(`/subscriptions/${e}/progress`)).data}const Km={getMySubscriptions:Om,getActiveSubscriptions:Dm,getSubscriptionsProgress:qm,getSubscriptionSummary:Um,getSubscriptionProgress:zm},Nm=6e4;let ze=0;const Vm=oe("subscriptions",()=>{const e=w([]),t=w(!1),a=w(!1),r=w(null);let o=null,s=null;const i=$(()=>e.value.length>0);async function c(v=!1){const d=Date.now();if(!v&&a.value&&r.value&&d-r.value<Nm)return e.value;if(o&&!v)return o;const p=++ze;t.value=!0;const f=Km.getActiveSubscriptions().then(A=>(p===ze&&(e.value=A,a.value=!0,r.value=Date.now()),A)).catch(A=>{throw console.error("Failed to fetch active subscriptions:",A),A}).finally(()=>{o===f&&(t.value=!1,o=null)});return o=f,o}function u(){s||(s=setInterval(()=>{c(!0).catch(v=>{console.error("Subscription polling failed:",v)})},5*60*1e3))}function m(){s&&(clearInterval(s),s=null)}function l(){ze++,o=null,t.value=!1,e.value=[],a.value=!1,r.value=null,m()}function _(){r.value=null}return{activeSubscriptions:e,loading:t,hasActiveSubscriptions:i,fetchActiveSubscriptions:c,startPolling:u,stopPolling:m,clear:l,invalidateCache:_}}),Bm=20*60*1e3,ia=oe("announcements",()=>{const e=w([]),t=w(!1),a=w(0),r=w([]),o=w(null);let s=new Set,i=0;const c=$(()=>e.value.filter(f=>!f.read_at).length);async function u(f=!1){const A=Date.now();if(!f&&a.value>0&&A-a.value<Bm)return;a.value=A;const k=++i;try{t.value=!0;const y=await Oe.list(!1);if(k!==i)return;e.value=y.slice(0,20),m()}catch(y){if(k!==i)return;a.value=0,console.error("Failed to fetch announcements:",y)}finally{k===i&&(t.value=!1)}}function m(){const f=e.value.filter(A=>A.notify_mode==="popup"&&!A.read_at&&!s.has(A.id));if(f.length!==0){for(const A of f)r.value.some(k=>k.id===A.id)||r.value.push(A);o.value||l()}}function l(){if(r.value.length===0){o.value=null;return}o.value=r.value.shift(),s.add(o.value.id)}async function _(){if(!o.value)return;const f=o.value.id;o.value=null,v(f),r.value.length>0&&setTimeout(()=>l(),300)}async function v(f){try{await Oe.markRead(f);const A=e.value.find(k=>k.id===f);A&&(A.read_at=new Date().toISOString())}catch(A){console.error("Failed to mark announcement as read:",A)}}async function d(){const f=e.value.filter(A=>!A.read_at);if(f.length!==0)try{t.value=!0;const k=(await Promise.allSettled(f.map(async y=>{await Oe.markRead(y.id),y.read_at=new Date().toISOString()}))).find(y=>y.status==="rejected");if(k)throw k.reason}catch(A){throw console.error("Failed to mark all as read:",A),A}finally{t.value=!1}}function p(){i++,e.value=[],a.value=0,s=new Set,r.value=[],o.value=null,t.value=!1}return{announcements:e,loading:t,currentPopup:o,unreadCount:c,fetchAnnouncements:u,dismissPopup:_,markAsRead:v,markAllAsRead:d,reset:p}}),At="我已阅读、理解并同意 Sub2API 部署与运营合规承诺",kt="I have read, understood, and agree to the Sub2API Deployment and Operation Compliance Commitment",st=oe("adminCompl
2iance",()=>{const e=w(null),t=w(!1),a=w(!1),r=w(!1),o=w(!1),s=$(()=>{var d;return((d=e.value)==null?void 0:d.required)===!0}),i=$(()=>s.value||o.value),c=$(()=>X()),u=$(()=>{var d,p;return c.value==="zh"?((d=e.value)==null?void 0:d.ack_phrase_zh)||At:((p=e.value)==null?void 0:p.ack_phrase_en)||kt});async function m(){t.value=!0;try{const d=await Be.getStatus();return e.value=d,r.value=!0,o.value=d.required,d}finally{t.value=!1}}async function l(d){a.value=!0;try{const p=await Be.accept({phrase:d,language:c.value});return e.value=p,o.value=p.required,p}finally{a.value=!1}}function _(d){var p,f,A,k,y,I,E,U;e.value={required:!0,version:(d==null?void 0:d.version)||((p=e.value)==null?void 0:p.version)||"v2026.06.10",document_path_zh:(d==null?void 0:d.document_path_zh)||((f=e.value)==null?void 0:f.document_path_zh)||"docs/legal/admin-compliance.zh.md",document_path_en:(d==null?void 0:d.document_path_en)||((A=e.value)==null?void 0:A.document_path_en)||"docs/legal/admin-compliance.en.md",document_url_zh:(d==null?void 0:d.document_url_zh)||((k=e.value)==null?void 0:k.document_url_zh)||"https://github.com/Wei-Shaw/sub2api/blob/main/docs/legal/admin-compliance.zh.md",document_url_en:(d==null?void 0:d.document_url_en)||((y=e.value)==null?void 0:y.document_url_en)||"https://github.com/Wei-Shaw/sub2api/blob/main/docs/legal/admin-compliance.en.md",ack_phrase_zh:(d==null?void 0:d.ack_phrase_zh)||((I=e.value)==null?void 0:I.ack_phrase_zh)||At,ack_phrase_en:(d==null?void 0:d.ack_phrase_en)||((E=e.value)==null?void 0:E.ack_phrase_en)||kt,acknowledgement:(U=e.value)==null?void 0:U.acknowledgement},r.value=!0,o.value=!0}function v(){e.value=null,t.value=!1,a.value=!1,r.value=!1,o.value=!1}return{status:e,loading:t,submitting:a,initialized:r,required:s,shouldShow:i,expectedPhrase:u,fetchStatus:m,accept:l,requireAcknowledgement:_,reset:v}}),Fm=`# Sub2API 部署与运营合规承诺
3
4版本:v2026.06.10
5
6本文件适用于部署、配置、管理、运营或实际控制 Sub2API 实例的个人、组织及其授权代表。继续访问或使用控制台功能前,确认主体应完整阅读、理解并接受本文件。
7
8## 一、适用范围
9
10Sub2API 是开源软件。任何基于 Sub2API 进行的自部署、二次开发、托管运行、对外服务、商业化使用、用户管理、内容处理、数据处理、支付结算、客户支持及上游账号或接口使用行为,均由相应实例的部署、运营或控制主体自行负责。
11
12本文件不替代开源许可证、上游服务条款、用户协议、隐私政策、数据处理协议、商业合同、监管备案、行政许可、安全评估或其他依法应当具备的文件、手续或义务。
13
14## 二、主体责任
15
16确认主体应自行评估并持续遵守其所在地、服务器所在地、目标用户所在地、业务实际开展地以及上游服务提供方所在地可能适用的法律法规、监管要求、行业规范、合同约定和平台规则。
17
18确认主体应确保其已具备部署和运营相关实例所需的授权、资质、备案、许可、评估、合同、风控能力、内容安全能力、数据保护能力、投诉处理机制和应急处置能力。相关义务不得因使用开源软件而转移、免除或降低。
19
20## 三、非关联关系与责任隔离
21
22任何第三方实例、商业服务、收费套餐、用户招揽、内容处理、数据处理、账号使用、接口调用、支付结算、客户支持或推广活动,均由相应部署、运营或控制主体独立实施,并不因本项目开源、代码贡献、议题讨论、文档维护、版本发布、缺陷修复、社区交流或一般性技术说明而形成开源项目、著作权人、贡献者或维护者对该等活动的参与、授权、认可、担保、共同经营、代理、合伙、雇佣、授权运营、共同控制、收益分配、共同侵权或其他连带责任关系。
23
24确认主体不得以项目名称、标识、文档、截图、社区内容或开源仓库信息明示或暗示其第三方实例、商业服务、收费套餐或运营活动获得开源项目、著作权人、贡献者、维护者或社区的参与、授权、认可、担保或背书。
25
26确认主体应独立承担因其部署、配置、运营、推广、收费、用户行为管理、内容处理、数据处理、账号使用、接口调用及违反法律法规、监管要求、合同约定或上游规则所产生的相关后果。
27
28依法不得由协议排除或限制的强制性责任,依相关法律规定处理;该等法定例外不构成对任何第三方部署、运营或商业活动的参与、授权、认可、担保或背书。
29
30## 四、合规承诺
31
32确认主体在继续使用控制台功能时,作出以下承诺:
33
341. 已独立审阅并将持续遵守 OpenAI、Anthropic、Google 及其他上游服务提供方的服务条款、可接受使用政策、支持国家和地区、账号/API Key 使用规则、商业使用要求、转售限制、风控要求和技术限制。
352. 不利用本项目规避或协助他人规避上游服务的地区限制、访问限制、账号限制、风控限制、计费限制、身份验证、使用限制或服务条款。
363. 不在缺乏必要授权、资质、备案、许可、评估或合同安排的情况下,向公众或不特定对象提供 API 中转、模型调用转售、账号额度分发、共享订阅、付费调用、代充代付或其他类似服务。
374. 如在中国大陆境内或面向中国大陆公众提供生成式人工智能服务、深度合成服务、算法相关服务、API 中转、付费调用或其他可能受监管服务,将自行完成可能适用的互联网信息服务、生成式人工智能服务、深度合成、算法备案、安全评估、网络安全、数据安全、个人信息保护、内容安全、支付结算、税务及上游授权等义务。
385. 建立与业务规模和风险相匹配的用户管理、访问控制、内容审核、滥用处理、日志留存、隐私保护、数据删除、投诉处理、应急下线和安全事件响应机制。
396. 不向任何用户、客户、合作方、渠道方、监管机构或第三方作出与本文件第三条相冲突的陈述、承诺、宣传或保证。
407. 对其部署、运营、推广、收费、用户行为管理、内容处理、数据处理、账号使用、接口调用及违反法律法规、监管要求、合同约定或上游规则所产生的后果独立承担责任。
41
42## 五、风险与责任提示
43
44将 Sub2API 用于公开 API 服务、商业中转、额度分发、团队共享、付费调用或类似用途,可能涉及服务条款、合同违约、数据保护、内容安全、消费者权益、支付结算、税务、出口管制、制裁合规、网络安全、行业准入及行政监管等风险。不同司法辖区和业务场景的要求可能不同,并可能随时间变化。
45
46控制台中的强制提示、协议链接、逐字输入确认和本地确认记录,旨在以清晰、显著、可留痕的方式提示部署与运营风险,确认控制台使用者已阅读当前版本文件,并在开源项目、著作权人、贡献者、维护者与第三方部署、运营或控制主体之间形成明确的责任隔离记录。
47
48## 六、电子确认
49
50确认主体通过继续使用控制台、打开协议链接、阅读本文件并按页面要求逐字输入确认短语,即表示其以电子方式确认已阅读、理解并同意本文件,并同意系统记录确认版本、确认时间、控制台账户标识、IP 地址和 User-Agent 等必要留痕信息。
51`,Hm=`# Sub2API Deployment and Operation Compliance Commitment
52
53Version: v2026.06.10
54
55This document applies to any individual, organization, or authorized representative that deploys, configures, manages, operates, or effectively controls a Sub2API instance. Before continuing to access or use console functions, the acknowledging party must read, understand, and accept this document in full.
56
57## 1. Scope
58
59Sub2API is open-source software. Any self-hosted deployment, modification, hosted operation, external service, commercial use, user management, content processing, data processing, payment settlement, customer support, or upstream account/API usage based on Sub2API is the sole responsibility of the party that deploys, operates, or controls the relevant instance.
60
61This document does not replace the open-source license, upstream terms of service, user agreements, privacy policies, data processing agreements, commercial contracts, regulatory filings, administrative permits, security assessments, or any other documents, procedures, or obligations required by applicable law or contract.
62
63## 2. Responsibility of the Deploying or Operating Party
64
65The acknowledging party must independently assess and continuously comply with the laws, regulations, regulatory requirements, industry rules, contractual obligations, and platform policies that may apply in its location, server location, target-user location, place of actual business operation, and the locations of upstream service providers.
66
67The acknowledging party must ensure that it has all authorizations, qualifications, filings, permits, assessments, contracts, risk-control capabilities, content-safety capabilities, data-protection capabilities, complaint-handling mechanisms, and emergency-response capabilities required for deploying and operating the relevant instance. Such obligations are not transferred, waived, or reduced by the use of open-source software.
68
69## 3. No Affiliation and Allocation of Responsibility
70
71Any third-party instance, commercial service, paid plan, user solicitation, content processing, data processing, account usage, API call, payment settlement, customer support, or promotional activity is independently carried out by the corresponding deploying, operating, or controlling party. The open-source nature of this project, code contributions, issue discussions, documentation maintenance, version releases, bug fixes, community communications, or general technical explanations do not create participation in, authorization of, approval of, warranty for, joint operation, agency, partnership, employment, authorized operation, joint control, revenue sharing, joint tort, or any other joint-and-several liability relationship between the open-source project, copyright holders, contributors, or maintainers and such activities.
72
73The acknowledging party must not use the project name, marks, documentation, screenshots, community content, or open-source repository information to state or imply that its third-party instance, commercial service, paid plan, or operation is participated in, authorized, approved, warranted, or endorsed by the open-source project, copyright holders, contributors, maintainers, or community.
74
75The acknowledging party is independently responsible for consequences arising from its deployment, configuration, operation, promotion, charging, user-behavior management, content processing, data processing, account usage, API calls, or violations of laws, regulations, regulatory requirements, contractual obligations, or upstream rules.
76
77Any mandatory liability that cannot be excluded or limited by agreement shall be handled according to applicable law. Such statutory exception does not constitute participation in, authorization of, approval of, warranty for, or endorsement of any third-party deployment, operation, or commercial activity.
78
79## 4. Compliance Commitments
80
81By continuing to use console functions, the acknowledging party makes the following commitments:
82
831. It has independently reviewed and will continuously comply with the terms of service, acceptable use policies, supported countries and regions, account/API key rules, commercial-use requirements, resale restrictions, risk-control requirements, and technical restrictions of OpenAI, Anthropic, Google, and any other upstream service providers.
842. It will not use this project to bypass, or assist others in bypassing, upstream regional restrictions, access restrictions, account restrictions, risk controls, billing restrictions, identity verification, usage limits, or terms of service.
853. It will not provide API relay, model-call resale, account quota distribution, shared subscriptions, paid calls, top-up/payment agency, or similar services to the public or an indefinite group of users unless all necessary authorizations, qualifications, filings, permits, assessments, or contractual arrangements have been obtained.
864. If it provides generative AI services, deep synthesis services, algorithm-related services, API relay, paid calls, or other potentially regulated services within Mainland China or to the Mainland China public, it will independently complete all potentially applicable obligations regarding internet information services, generative AI services, deep synthesis, algorithm filing, security assessment, cybersecurity, data security, personal information protection, content safety, payment settlement, taxes, and upstream authorization.
875. It will maintain user management, access control, content review, abuse handling, log retention, privacy protection, data deletion, complaint handling, emergency takedown, and security incident response mechanisms appropriate to the scale and risk of its business.
886. It will not make any statement, commitment, marketing representation, or warranty to any user, customer, partner, channel, regulator, or third party that conflicts with Section 3 of this document.
897. It will be independently responsible for consequences arising from its deployment, operation, promotion, charging, user-behavior management, content processing, data processing, account usage, API calls, or violations of laws, regulations, regulatory requirements, contractual obligations, or upstream rules.
90
91## 5. Risk and Responsibility Notice
92
93Using Sub2API for public API services, commercial relay, quota distribution, team sharing, paid calls, or similar purposes may involve risks relating to terms of service, contractual breach, data protection, content safety, consumer protection, payment settlement, taxes, export controls, sanctions compliance, cybersecurity, industry access, and administrative regulation. Requirements vary by jurisdiction and business model and may change over time.
94
95The mandatory notice, document link, exact-phrase acknowledgment, and local acknowledgment record 
95in the console are intended to provide clear, conspicuous, and reproducible notice of deployment and operation risks, confirm that the console user has read the current version of this document, and create a clear responsibility-separation record between the open-source project, copyright holders, contributors, maintainers and any third-party deploying, operating, or controlling party.
96
97## 6. Electronic Acknowledgment
98
99By continuing to use the console, opening the document link, reading this document, and typing the required confirmation phrase exactly as displayed, the acknowledging party electronically confirms that it has read, understood, and agreed to this document, and agrees that the system may record necessary evidence including the acknowledged version, acknowledgment time, console account identifier, IP address, and User-Agent.
100`,Wm={class:"space-y-5"},jm={class:"rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-100"},Gm={class:"flex gap-3"},Qm={class:"space-y-2"},Jm={class:"font-semibold"},Ym={class:"leading-6"},Zm={class:"grid gap-4 md:grid-cols-[minmax(0,1fr)_240px]"},Xm={class:"min-h-[320px] max-h-[46vh] overflow-y-auto rounded-lg border border-gray-200 bg-white p-5 dark:border-dark-700 dark:bg-dark-900"},ep=["innerHTML"],tp={class:"space-y-3 rounded-lg border border-gray-200 bg-gray-50 p-4 text-sm dark:border-dark-700 dark:bg-dark-900/60"},ap={class:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-dark-400"},np={class:"mt-1 break-all font-mono text-gray-900 dark:text-white"},rp=["href"],op={class:"leading-6 text-gray-600 dark:text-dark-300"},sp={class:"space-y-3"},ip={for:"admin-compliance-phrase",class:"block text-sm font-semibold text-gray-900 dark:text-white"},cp={class:"rounded-lg bg-gray-100 px-3 py-2 font-mono text-sm text-gray-900 dark:bg-dark-800 dark:text-dark-100"},up={class:"text-xs leading-5 text-gray-500 dark:text-dark-400"},lp={class:"flex flex-col gap-3 sm:flex-row sm:justify-end"},dp=["disabled"],mp=["disabled"],pp={key:0},fp={key:1},gp=ee({__name:"AdminComplianceDialog",setup(e){const{t}=Tt(),a=st(),r=Me(),o=G(),s=w(""),i=w(!1);Se.setOptions({breaks:!0,gfm:!0});const c=$(()=>r.isAuthenticated&&r.isAdmin&&a.shouldShow),u=$(()=>a.expectedPhrase),m=$(()=>s.value.trim()===u.value),l=$(()=>X()==="zh"?Fm:Hm),_=$(()=>{var k,y;return X()==="zh"?((k=a.status)==null?void 0:k.document_url_zh)||"https://github.com/Wei-Shaw/sub2api/blob/main/docs/legal/admin-compliance.zh.md":((y=a.status)==null?void 0:y.document_url_en)||"https://github.com/Wei-Shaw/sub2api/blob/main/docs/legal/admin-compliance.en.md"}),v=$(()=>!i.value||m.value?"":t("adminCompliance.inputMismatch")),d=$(()=>{const k=Se.parse(l.value);return Rt.sanitize(k)});Z(u,()=>{s.value="",i.value=!1}),Z(c,k=>{k&&(s.value="",i.value=!1)});function p(){}async function f(){if(i.value=!0,!!m.value)try{(await a.accept(s.value.trim())).required||(o.showSuccess(t("adminCompliance.accepted")),s.value="",i.value=!1)}catch(k){const y=(k==null?void 0:k.message)||t("adminCompliance.acceptFailed");o.showError(y)}}async function A(){await r.logout(),window.location.href="/login"}return(k,y)=>(M(),fe(pr,{show:c.value,title:T(t)("adminCompliance.title"),width:"wide","close-on-escape":!1,"close-on-click-outside":!1,"show-close-button":!1,"z-index":80,onClose:p},{footer:re(()=>[g("div",lp,[g("button",{type:"button",class:"btn btn-secondary",disabled:T(a).submitting,onClick:A},R(T(t)("adminCompliance.logout")),9,dp),g("button",{type:"button",class:"btn btn-primary",disabled:!m.value||T(a).submitting,onClick:f},[T(a).submitting?(M(),L("span",pp,R(T(t)("common.submitting")),1)):(M(),L("span",fp,R(T(t)("adminCompliance.accept")),1))],8,mp)])]),default:re(()=>{var I;return[g("div",Wm,[g("div",jm,[g("div",Gm,[K(me,{name:"exclamationTriangle",size:"md",class:"mt-0.5 flex-shrink-0"}),g("div",Qm,[g("p",Jm,R(T(t)("adminCompliance.blockingNotice")),1),g("p",Ym,R(T(t)("adminCompliance.riskNotice")),1)])])]),g("div",Zm,[g("section",Xm,[g("div",{class:"legal-document-content",innerHTML:d.value},null,8,ep)]),g("aside",tp,[g("div",null,[g("p",ap,R(T(t)("adminCompl
100iance.version")),1),g("p",np,R(((I=T(a).status)==null?void 0:I.version)||"v2026.06.10"),1)]),g("a",{href:_.value,target:"_blank",rel:"noopener noreferrer",class:"inline-flex items-center gap-2 text-primary-600 underline underline-offset-4 hover:text-primary-700 dark:text-primary-300 dark:hover:text-primary-200"},[K(me,{name:"externalLink",size:"sm"}),ke(" "+R(T(t)("adminCompliance.openDocument")),1)],8,rp),g("p",op,R(T(t)("adminCompliance.documentSource")),1)])]),g("div",sp,[g("label",ip,R(T(t)("adminCompliance.inputLabel")),1),g("div",cp,R(u.value),1),K(kr,{id:"admin-compliance-phrase",modelValue:s.value,"onUpdate:modelValue":y[0]||(y[0]=E=>s.value=E),placeholder:T(t)("adminCompliance.inputPlaceholder"),autocomplete:"off",disabled:T(a).submitting,error:v.value,onEnter:f},null,8,["modelValue","placeholder","disabled","error"])]),g("p",up,R(T(t)("adminCompliance.legalNote")),1)])]}),_:1},8,["show","title"]))}}),hp=Ce(gp,[["__scopeId","data-v-42404ff1"]]);function ca(e,t,a){const r=typeof t=="string"&&t.trim()?t.trim():"Sub2API";if(typeof a=="string"&&a.trim()){const o=D.global.t(a);if(o&&o!==a)return`${o} - ${r}`}return typeof e=="string"&&e.trim()?`${e.trim()} - ${r}`:r}const ua="PurchaseSubscription";function la(e,t={}){if(e.name===ua){if(t.billingMode==="recharge_only")return{titleKey:"nav.recharge",descriptionKey:"purchase.rechargeDescription"};if(t.billingMode==="subscription_only")return{titleKey:"nav.subscribe",descriptionKey:"purchase.subscriptionDescription"}}return{titleKey:typeof e.meta.titleKey=="string"?e.meta.titleKey:void 0,descriptionKey:typeof e.meta.descriptionKey=="string"?e.meta.descriptionKey:void 0}}function it(e,t,a=[],r={}){const o=typeof e.params.id=="string"?e.params.id:"",s=e.name==="CustomPage"&&o?a.find(u=>u.id===o):void 0,i=s==null?void 0:s.label.trim(),{titleKey:c}=la(e,r);return ca(i||e.meta.title,t,i?void 0:c)}const yp=Object.freeze(Object.defineProperty({__proto__:null,PURCHASE_ROUTE_NAME:ua,resolveDocumentTitle:ca,resolveRouteDocumentTitle:it,resolveRouteMetaKeys:la},Symbol.toStringTag,{value:"Module"}));function _p(e){if(!e)return D.global.t("common.time.never");const t=new Date,a=new Date(e),r=t.getTime()-a.getTime();if(r<0||isNaN(r))return D.global.t("common.time.never");const o=Math.floor(r/1e3),s=Math.floor(o/60),i=Math.floor(s/60),c=Math.floor(i/24);return c>0?D.global.t("common.time.daysAgo",{n:c}):i>0?D.global.t("common.time.hoursAgo",{n:i}):s>0?D.global.t("common.time.minutesAgo",{n:s}):D.global.t("common.time.justNow")}function Tf(e){if(e==null)return"0";const t=X(),a=Math.abs(e);return new Intl.NumberFormat(t,{notation:a>=1e4?"compact":"standard",maximumFractionDigits:1}).format(e)}function Rf(e,t="USD"){if(e==null)return"$0.00";const a=X(),r=e>0&&e<.01?6:2;return new Intl.NumberFormat(a,{style:"currency",currency:t,minimumFractionDigits:r,maximumFractionDigits:r}).format(e)}function xf(e,t=2){if(e===0)return"0 Bytes";const a=1024,r=t<0?0:t,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(a));return parseFloat((e/Math.pow(a,s)).toFixed(r))+" "+o[s]}function ct(e,t={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},a){if(!e)return"";const r=new Date(e);if(isNaN(r.getTime()))return"";const o=a??X();return new Intl.DateTimeFormat(o,t).format(r)}function bp(e,t,a){return ct(e,t,a)}function Lf(e,t){return ct(e,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1},t)}function Of(e){if(isNaN(e.getTime()))return"";const t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${a}-${r}`}function Df(e){if(!e)return"";const t=new Date(e*1e3);if(isNaN(t.getTime()))return"";const a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),s=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0");return`${a}-${r}-${o}T${s}:${i}`}function qf(e){if(!e)return null;const t=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/.exec(e);if(!t)return null;const a=Number(t[1]),r=Number(t[2]),o=Number(t[3]),s=Number(t[4]),i=Number(t[5]),c=t[6]?Number(t[6]):0,u=t[7]?Number(t[7].slice(0,3).padEnd(3,"0")):0;if(!Number.isSafeInteger(a)||a<1||r<1||r>12||o<1||o>31||s>23||i>59||c>59)return null;const m=new Date(0);if(m.setFullYear(a,r-1,o),m.setHours(s,i,c,u),m.getFullYear()!==a||m.getMonth()!==r-1||m.getDate()!==o)return null;const l=m.getTime();return Number.isFinite(l)?Math.floor(l/1e3):null}function Uf(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function Fe(e){return(e??"").toString().trim().toLowerCase().replace(/[-_\s]/g,"")}function zf(e){const t=(e??"").toString().trim();if(!t)return"-";switch(Fe(t)){case"low":return"Low";case"medium":return"Medium";case"high":return"High";case"xhigh":case"extrahigh":return"XHigh";case"max":return"Max";
100case"none":case"minimal":return"-";default:return t.length>1?t[0].toUpperCase()+t.slice(1):t.toUpperCase()}}function Kf(e,t){const a=Fe(e),r=Fe(t);return!a&&!r?!0:a!==""&&a===r}function Nf(e){return ct(e,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Vf(e){return e.toLocaleString()}function Bf(e,t=4){return e.toFixed(t)}function Ff(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function Hf(e,t){if(e==null)return"0";const a=Math.abs(e);return(t==null?void 0:t.allowBillions)!==!1&&a>=1e9?`${(e/1e9).toFixed(1)}B`:a>=1e6?`${(e/1e6).toFixed(1)}M`:a>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function vp(e){if(!e)return null;const t=new Date,r=new Date(e).getTime()-t.getTime();if(r<=0||isNaN(r))return null;const o=Math.floor(r/(1e3*60)),s=Math.floor(o/60),i=Math.floor(s/24),c=s%24,u=o%60;return i>0?D.global.t("common.time.countdown.daysHours",{d:i,h:c}):s>0?D.global.t("common.time.countdown.hoursMinutes",{h:s,m:u}):D.global.t("common.time.countdown.minutes",{m:o})}function Wf(e){const t=vp(e);return t?D.global.t("common.time.countdown.withSuffix",{time:t}):null}function wp(e){if(!e)return"";const t=_p(e),a=bp(e);return!a||t===D.global.t("common.time.never")?t:`${t} · ${a}`}const Ap={key:0,class:"fixed inset-0 z-[120] flex items-start justify-center overflow-y-auto bg-gradient-to-br from-black/70 via-black/60 to-black/70 p-4 pt-[8vh] backdrop-blur-md"},kp={class:"relative overflow-hidden border-b border-amber-100/80 bg-gradient-to-br from-amber-50/80 via-orange-50/50 to-yellow-50/30 px-8 py-6 dark:border-dark-700/50 dark:from-amber-900/20 dark:via-orange-900/10 dark:to-yellow-900/5"},Sp={class:"relative z-10"},Pp={class:"mb-3 flex items-center gap-2"},Ep={class:"inline-flex items-center gap-1.5 rounded-lg bg-gradient-to-r from-amber-500 to-orange-600 px-2.5 py-1 text-xs font-medium text-white shadow-lg shadow-amber-500/30"},Ip={class:"mb-2 text-2xl font-bold leading-tight text-gray-900 dark:text-white"},$p={class:"flex items-center gap-1.5 text-sm text-gray-600 dark:text-gray-400"},Cp={class:"max-h-[50vh] overflow-y-auto bg-white px-8 py-8 dark:bg-dark-800"},Mp={class:"relative"},Tp={class:"pl-6"},Rp=["innerHTML"],xp={class:"border-t border-gray-100 bg-gray-50/50 px-8 py-5 dark:border-dark-700 dark:bg-dark-900/30"},Lp={class:"flex items-center justify-end"},Op={class:"flex items-center gap-2"},Dp={key:0,class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},qp={key:1,class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Up=ee({__name:"AnnouncementPopup",props:{announcement:{default:null},preview:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const a=e,r=t,{t:o}=Tt(),s=ia(),i=$(()=>a.preview?a.announcement:s.currentPopup);Se.setOptions({breaks:!0,gfm:!0});const c=$(()=>{var _;const m=(_=i.value)==null?void 0:_.content;if(!m)return"";const l=Se.parse(m);return Rt.sanitize(l)});function u(){if(a.preview){r("close");return}s.dismissPopup()}return Z(i,m=>{m?document.body.style.overflow="hidden":a.preview&&(document.body.style.overflow="")},{immediate:!0}),Mt(()=>{a.preview&&(document.body.style.overflow="")}),(m,l)=>(M(),fe(He,{to:"body"},[K(We,{name:"popup-fade"},{default:re(()=>[i.value?(M(),L("div",Ap,[g("div",{class:"w-full max-w-[680px] overflow-hidden rounded-3xl bg-white shadow-2xl ring-1 ring-black/5 dark:bg-dark-800 dark:ring-white/10",onClick:l[0]||(l[0]=Ne(()=>{},["stop"]))},[g("div",kp,[l[4]||(l[4]=g("div",{class:"absolute right-0 top-0 h-full w-64 bg-gradient-to-l from-orange-100/30 to-transparent dark:from-orange-900/20"},null,-1)),l[5]||(l[5]=g("div",{class:"absolute -right-8 -top-8 h-32 w-32 rounded-full bg-gradient-to-br from-amber-400/20 to-orange-500/20 blur-3xl"},null,-1)),l[6]||(l[6]=g("div",{class:"absolute -left-4 -bottom-4 h-24 w-24 rounded-full bg-gradient-to-tr from-yellow-400/20 to-amber-500/20 blur-2xl"},null,-1)),g("div",Sp,[g("div",Pp,[l[2]||(l[2]=g("div",{class:"flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-amber-500 to-orange-600 text-white shadow-lg shadow-amber-500/30"},[g("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})])],-1)),g("span",Ep,[l[1]||(l[1]=g("span",{class:"relative flex h-2 w-2"},[g("span",{class:"absolute inline-flex h-full w-full animate-ping rounded-full bg-white opacity-75"}),g("span",{class:"relative inline-flex h-2 w-2 rounded-full bg-white"})],-1)),ke(" "+R(T(o)("announcements.unread")),1)])]),g("h2",Ip,R(i.value.title),
1001),g("div",$p,[l[3]||(l[3]=g("svg",{class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),g("time",null,R(T(wp)(i.value.created_at)),1)])])]),g("div",Cp,[g("div",Mp,[l[7]||(l[7]=g("div",{class:"absolute left-0 top-0 bottom-0 w-1 rounded-full bg-gradient-to-b from-amber-500 via-orange-500 to-yellow-500"},null,-1)),g("div",Tp,[g("div",{class:"markdown-body prose prose-sm max-w-none dark:prose-invert",innerHTML:c.value},null,8,Rp)])])]),g("div",xp,[g("div",Lp,[g("button",{onClick:u,"data-testid":"announcement-popup-dismiss",class:"rounded-xl bg-gradient-to-r from-amber-500 to-orange-600 px-6 py-2.5 text-sm font-medium text-white shadow-lg shadow-amber-500/30 transition-all hover:shadow-xl hover:scale-105"},[g("span",Op,[e.preview?(M(),L("svg",Dp,[...l[8]||(l[8]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)])])):(M(),L("svg",qp,[...l[9]||(l[9]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 13l4 4L19 7"},null,-1)])])),ke(" "+R(e.preview?T(o)("common.close"):T(o)("announcements.markRead")),1)])])])])])])):j("",!0)]),_:1})]))}}),zp=Ce(Up,[["__scopeId","data-v-bdbde8bb"]]),Te=de.create({baseURL:Dt("/").replace(/\/+$/,""),timeout:3e4,headers:{"Content-Type":"application/json"}});async function da(){return(await Te.get("/setup/status")).data.data}async function jf(e){await Te.post("/setup/test-db",e)}async function Gf(e){await Te.post("/setup/test-redis",e)}async function Qf(e){return(await Te.post("/setup/install",e)).data.data}function Kp(e,t={}){const a=e.trim();if(!a)return"";if(t.allowRelative&&a.startsWith("/")&&!a.startsWith("//")||t.allowDataUrl&&a.startsWith("data:image/"))return a;if(!a.match(/^https?:\/\//i))return"";try{const r=new URL(a),o=r.protocol.toLowerCase();return o!=="http:"&&o!=="https:"?"":r.toString()}catch{return""}}function ma(e){const t=Kp(e,{allowRelative:!0,allowDataUrl:!0});if(!t)return;let a=document.querySelector('link[rel="icon"]');a||(a=document.createElement("link"),a.rel="icon",document.head.appendChild(a)),a.type=t.endsWith(".svg")?"image/svg+xml":"image/x-icon",a.href=t}const ut={channelMonitor:{key:"channel_monitor_enabled",mode:"opt-out",label:"Channel Monitor"},availableChannels:{key:"available_channels_enabled",mode:"opt-in",label:"Available Channels"},subscription:{key:"subscription_enabled",mode:"opt-out",label:"Subscription"},modelPlaza:{key:"model_plaza_enabled",mode:"opt-in",label:"Model Plaza"},pluginManagement:{key:"plugin_management_enabled",mode:"opt-in",label:"Plugin Management"},payment:{key:"payment_enabled",mode:"opt-out",label:"Payment"},riskControl:{key:"risk_control_enabled",mode:"opt-in",label:"Risk Control"},affiliate:{key:"affiliate_enabled",mode:"opt-in",label:"Affiliate"}};function lt(e){const t=G();return pa(t.cachedPublicSettings,e)}function pa(e,t){const a=e==null?void 0:e[t.key];return typeof a=="boolean"?a:t.mode==="opt-out"}function Jf(e){return()=>lt(e)}function fa(){return lt(ut.channelMonitor)}function ga(){var a;return((a=G().cachedPublicSettings)==null?void 0:a.channel_monitor_mode)==="v2"?"v2":"v1"}function Yf(){return fa()&&ga()==="v1"}function Zf(){return fa()&&ga()==="v2"}function Xf(){var t;return!!((t=G().cachedPublicSettings)!=null&&t.channel_monitor_hide_throughput)}function e0(){var t;return((t=G().cachedPublicSettings)==null?void 0:t.channel_monitor_show_quota)===!0}function t0(){var t;return!!((t=G().cachedPublicSettings)!=null&&t.channel_monitor_hide_user_ranking)}const a0=["recharge_and_subscription","recharge_only","subscription_only"],n0={recharge_and_subscription:"rechargeAndSubscription",recharge_only:"rechargeOnly",subscription_only:"subscriptionOnly"};function Np(e){return pa({subscription_enabled:e==null?void 0:e.subscription_enabled},ut.subscription)?(e==null?void 0:e.payment_balance_disabled)===!0?"subscription_only":"recharge_and_subscription":"recharge_only"}function r0(e){switch(e){case"recharge_only":return{subscription_enabled:!1,payment_balance_disabled:!1};case"subscription_only":return{subscription_enabled:!0,payment_balance_disabled:!0};default:return{subscription_enabled:!0,payment_balance_disabled:!1}}}const Vp=ee({__name:"App",setup(e){const t=Oa(),a=Da(),r=G(),o=Me(),s=Vm(),i=ia(),c=st(),u=ot();function m(){var f;const p=[...((f=r.cachedPublicSettings)==null?void 0:f.custom_menu_items)??[],...o.isAdmin?u.customMenuItems:[]];document.title=it(a,r.siteName,p,{billingMode:Np(r.cachedPublicSettings)})}Z(()=>r.siteLogo,p=>{p&&ma(p)},{immediate:!0}),Z([()=>a.fullPath,()=>a.meta.title,()=>
100a.meta.titleKey,()=>r.siteName,()=>{var p;return(p=r.cachedPublicSettings)==null?void 0:p.custom_menu_items},()=>{var p;return(p=r.cachedPublicSettings)==null?void 0:p.subscription_enabled},()=>{var p;return(p=r.cachedPublicSettings)==null?void 0:p.payment_balance_disabled},()=>o.isAdmin,()=>u.customMenuItems],m,{deep:!0});function l(){document.visibilityState==="visible"&&o.isAuthenticated&&i.fetchAnnouncements()}function _(p){const f=p.detail||{};c.requireAcknowledgement(f)}const v=$(()=>lt(ut.subscription));function d(){s.fetchActiveSubscriptions().catch(p=>{console.error("Failed to preload subscriptions:",p)}),s.startPolling()}return Z(v,p=>{o.isAuthenticated&&(p?d():s.clear())}),Z(()=>o.isAuthenticated,(p,f)=>{p?(o.isAdmin&&c.fetchStatus().catch(A=>{console.error("Failed to fetch admin compliance status:",A)}),v.value&&d(),f===!1?setTimeout(()=>i.fetchAnnouncements(!0),3e3):i.fetchAnnouncements(),document.addEventListener("visibilitychange",l)):(s.clear(),i.reset(),c.reset(),document.removeEventListener("visibilitychange",l))},{immediate:!0}),t.afterEach(()=>{o.isAuthenticated&&i.fetchAnnouncements()}),Mt(()=>{document.removeEventListener("visibilitychange",l),window.removeEventListener("admin-compliance-required",_)}),Ct(async()=>{window.addEventListener("admin-compliance-required",_);try{if((await da()).needs_setup&&a.path!=="/setup"){t.replace("/setup");return}}catch{}await r.fetchPublicSettings(),m()}),(p,f)=>(M(),L(It,null,[K(ur),K(T(qa)),K(or),K(zp),K(hp)],64))}}),Bp={"/admin/dashboard":["/admin/accounts","/admin/users"],"/admin/accounts":["/admin/dashboard","/admin/users"],"/admin/users":["/admin/groups","/admin/dashboard"],"/admin/groups":["/admin/subscriptions","/admin/users"],"/admin/subscriptions":["/admin/groups","/admin/redeem"],"/dashboard":["/keys","/usage"],"/keys":["/dashboard","/usage"],"/usage":["/keys","/redeem"],"/redeem":["/usage","/profile"],"/profile":["/dashboard","/keys"]},Fp=(e,t)=>typeof window.requestIdleCallback=="function"?window.requestIdleCallback(e,t):setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>50})},1e3),Hp=e=>{typeof window.cancelIdleCallback=="function"&&typeof e=="number"?window.cancelIdleCallback(e):clearTimeout(e)};function Wp(e){const t=w(null),a=w(new Set),r=_=>{var p;if(!e)return null;const d=e.getRoutes().find(f=>f.path===_);if(d&&((p=d.components)!=null&&p.default)){const f=d.components.default;if(typeof f=="function")return f}return null},o=_=>Bp[_.path]||[],s=async _=>{try{await _()}catch{}},i=()=>{t.value!==null&&(Hp(t.value),t.value=null)},c=_=>{i();const v=o(_);v.length!==0&&(t.value=Fp(()=>{t.value=null;const d=_.path;if(a.value.has(d))return;const p=[];for(const f of v){const A=r(f);A&&p.push(A)}p.length>0&&Promise.all(p.map(s)).then(()=>{a.value.add(d)})},{timeout:2e3}))},u=()=>{i(),a.value.clear()},m=_=>_.startsWith("/admin"),l=_=>{const v=o(_),d=[];for(const p of v){const f=r(p);f&&d.push(f)}return d};return{prefetchedRoutes:we(a),triggerPrefetch:c,cancelPendingPrefetch:i,resetPrefetchState:u,_getPrefetchConfig:l,_isAdminRoute:m}}function jp(e,t){return e?t?"/admin/dashboard":"/dashboard":"/login"}const Gp=[{path:"/setup",name:"Setup",component:()=>h(()=>import("./SetupWizardView-DE9PTnoT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),meta:{requiresAuth:!1,title:"Setup"}},{path:"/home",name:"Home",component:()=>h(()=>import("./HomeView-Dlb2A_zL.js"),__vite__mapDeps([8,9,1,3,10,6,7,11])),meta:{requiresAuth:!1,title:"Home"}}
100,{path:"/login",name:"Login",component:()=>h(()=>import("./LoginView-C6T8KC1R.js"),__vite__mapDeps([12,1,13,14,6,7,15,16,17,18,19,3,20,21,22,23,24,10])),meta:{requiresAuth:!1,title:"Login",titleKey:"home.login"}},{path:"/register",name:"Register",component:()=>h(()=>import("./RegisterView-Pb97QRP2.js"),__vite__mapDeps([25,1,13,14,6,7,15,16,17,18,19,3,20,21,22,26,23,27,28,10])),meta:{requiresAuth:!1,title:"Register",titleKey:"auth.createAccount"}},{path:"/email-verify",name:"EmailVerify",component:()=>h(()=>import("./EmailVerifyView-GVoLtHL0.js"),__vite__mapDeps([29,1,13,14,6,7,15,16,17,21,3,22,26,23,27,19,30,10])),meta:{requiresAuth:!1,title:"Verify Email"}},{path:"/auth/callback",name:"OAuthCallback",alias:"/auth/oauth/callback",component:()=>h(()=>import("./OAuthCallbackView-e876RjHn.js"),__vite__mapDeps([31,1,15,19,3,6,7])),meta:{requiresAuth:!1,title:"OAuth Callback",titleKey:"auth.oauthCallbackPageTitle"}},{path:"/auth/linuxdo/callback",name:"LinuxDoOAuthCallback",component:()=>h(()=>import("./LinuxDoCallbackView-C1EujRN5.js"),__vite__mapDeps([32,1,13,14,6,7,15,16,17,33,21,3,22,34,19,35,10])),meta:{requiresAuth:!1,title:"LinuxDo OAuth Callback",titleKey:"auth.linuxdoCallbackPageTitle"}},{path:"/auth/wechat/callback",name:"WeChatOAuthCallback",component:()=>h(()=>import("./WechatCallbackView-BGtqzCLa.js"),__vite__mapDeps([36,1,13,14,6,7,15,16,17,33,21,3,22,34,19,37,10])),meta:{requiresAuth:!1,title:"WeChat OAuth Callback",titleKey:"auth.wechatCallbackPageTitle"}},{path:"/auth/wechat/payment/callback",name:"WeChatPaymentOAuthCallback",component:()=>h(()=>import("./WechatPaymentCallbackView-C6HMimZT.js"),__vite__mapDeps([38,1,3,6,7])),meta:{requiresAuth:!1,title:"WeChat Payment Callback",titleKey:"auth.wechatPaymentCallbackPageTitle"}},{path:"/auth/dingtalk/callback",name:"DingTalkOAuthCallback",component:()=>h(()=>import("./DingTalkCallbackView-B5-uzBmg.js"),__vite__mapDeps([39,1,13,14,6,7,15,16,17,33,21,3,22,34,19,40,10])),meta:{requiresAuth:!1,title:"DingTalk OAuth Callback",titleKey:"auth.dingtalkCallbackPageTitle"}},{path:"/auth/dingtalk/email-completion",name:"dingtalk-email-completion",component:()=>h(()=>import("./DingTalkEmailCompletionView-nMw3YLNa.js"),__vite__mapDeps([41,1,13,14,6,7,15,16,17,33,21,3,22,34,19,10])),meta:{requiresAuth:!1,title:"DingTalk Email Completion"}},{path:"/auth/oidc/callback",name:"OIDCOAuthCallback",component:()=>h(()=>import("./OidcCallbackView-DdSmrB9g.js"),__vite__mapDeps([42,1,13,14,6,7,15,16,17,33,21,3,22,34,19,43,10])),meta:{requiresAuth:!1,title:"OIDC OAuth Callback",titleKey:"auth.oidcCallbackPageTitle"}},{path:"/forgot-password",name:"ForgotPassword",component:()=>h(()=>import("./ForgotPasswordView-wEA8s3lD.js"),__vite__mapDeps([44,1,13,14,6,7,15,16,17,21,3,22,45,10])),meta:{requiresAuth:!1,title:"Forgot Password",titleKey:"auth.forgotPasswordTitle"}},{path:"/reset-password",name:"ResetPassword",component:()=>h(()=>import("./ResetPasswordView-FNfh14GG.js"),__vite__mapDeps([46,1,13,14,6,7,15,16,17,3,47,10])),meta:{requiresAuth:!1,title:"Reset Password"}},{path:"/key-usage",name:"KeyUsage",component:()=>h(()=>import("./KeyUsageView-CAJgu3KI.js"),__vite__mapDeps([48,1,9,3,10,6,7,49])),meta:{requiresAuth:!1,title:"Key Usage"}},{path:"/legal/:documentId",name:"LegalDocument",component:()=>h(()=>import("./LegalDocumentView-BSC0m_tK.js"),__vite__mapDeps([50,1,6,7,3,51])),meta:{requiresAuth:!1,title:"Legal Document"}},{path:"/model-plaza",name:"ModelPlaza",component:()=>h(()=>import("./ModelPlazaView-BmfPGXS1.js"),__vite__mapDeps([52,1,53,13,14,6,7,3,15,9,10,54,55,56,57,58,59,60])),meta:{requiresAuth:!1,title:"Model Plaza",titleKey:"modelPlaza.title"}},{path:"/",redirect:"/home"},{path:"/dashboard",name:"Dashboard",component:()=>h(()=>import("./DashboardView-NjTQ8kMj.js"),__vite__mapDeps([61,62,53,13,1,14,6,7,3,15,9,10,63,64,65,66,67,2,4,68,69])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Dashboard",titleKey:"dashboard.title",descriptionKey:"dashboard.welcomeMessage"}},{path:"/keys",name:"Keys",component:()=>h(()=>import("./KeysView-BAU4t8mW.js"),__vite__mapDeps([70,1,53,13,14,6,7,3,15,9,10,71,62,72,73,74,2,4,75,76,77,78,79,68,80,81,56,57,54,82,83,84,55])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"API Keys",titleKey:"keys.title",descriptionKey:"keys.description"}},{path:"/batch-image",name:"BatchImageGuide",alias:"/docs/batch-image",component:()=>h(()=>import("./BatchImageGuideView-CpGHznj6.js"),__vite__mapDeps([85,1,53,13,14,6,7,3,15,9,10,73,74,75,76,2,4,80,81,71,86])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Batch Image Guide",titleKey:"batchImageGuide.title",descriptionKey:"batchImageGuide.description"}},{path:"/usage",name:"Usage",component:()=>h(()=>import("./UsageView-BKnmKFu6.js"),__vite__mapDeps([87,13,1,14,62,72,53,6,7,3,15,9,10,77,2,4,71,78,65,66,63,64,67,88,89,90,75,76,68,91])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Usage Records",titleKey:"usage.title",descriptionKey:"usage.description"}},{path:"/redeem",name:"Redeem",component:()=>h(()=>import("./RedeemView-ClK8dLV3.js"),__vite__mapDeps([92,1,53,13,14,6,7,3,15,9,10,93])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Redeem Code",titleKey:"redeem.title",descriptionKey:"redeem.description"}},{path:"/affiliate",name:"Affiliate",component:()=>h(()=>import("./AffiliateView-REzfAVlL.js"),__vite__mapDeps([94,53,13,1,14,6,7,3,15,9,10,69,23])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Affiliate",titleKey:"affiliate.title",descriptionKey:"affiliate.description"}},{path:"/available-channels",name:"UserAvailableChannels",component:()=>h(()=>import("./AvailableChannelsView-DjDym2zX.js"),__vite__mapDeps([95,1,53,13,14,6,7,3,15,9,10,73,74,54,56,57,58,59,55,72,23])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Available Channels",titleKey:"availableChannels.title",descriptionKey:"availableChannels.description"}},{path:"/profile",name:"Profile",component:()=>h(()=>import("./ProfileView-DIM09joO.js"),__vite__mapDeps([96,53,13,1,14,6,7,3,15,9,10,69,23,97])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Profile",titleKey:"profile.title",descriptionKey:"profile.description"}},{path:"/subscriptions",name:"Subscriptions",component:()=>h(()=>import("./SubscriptionsView-DSJryCDu.js"),__vite__mapDeps([98,1,53,13,14,6,7,3,15,9,10,57,55])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"My Subscriptions",titleKey:"userSubscriptions.title",descriptionKey:"userSubscriptions.description",requiresSubscription:!0}
100},{path:"/purchase",name:"PurchaseSubscription",component:()=>h(()=>import("./PaymentView-DCPQWZjA.js"),__vite__mapDeps([99,1,6,7,100,101,23,57,102,53,13,14,3,15,9,10,103,104,105,106,55,107])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Purchase Subscription",titleKey:"nav.buySubscription",descriptionKey:"purchase.description",requiresPayment:!0}},{path:"/orders",name:"OrderList",component:()=>h(()=>import("./UserOrdersView-fHe6Cl6j.js"),__vite__mapDeps([108,1,101,23,53,13,14,6,7,3,15,9,10,77,2,4,71,78,109,75,76,110,103])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"My Orders",titleKey:"nav.myOrders",requiresPayment:!0}},{path:"/payment/qrcode",name:"PaymentQRCode",component:()=>h(()=>import("./PaymentQRCodeView-BXnwsUfd.js"),__vite__mapDeps([111,1,53,13,14,6,7,3,15,9,10,100,101,23,104,105])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Payment",titleKey:"payment.qr.scanToPay",requiresPayment:!0}},{path:"/payment/result",name:"PaymentResult",component:()=>h(()=>import("./PaymentResultView-HOPa5Y7d.js"),__vite__mapDeps([112,1,110,3,106,100,101,103,107,23,6,7])),meta:{requiresAuth:!1,requiresAdmin:!1,title:"Payment Result",titleKey:"payment.result.success",requiresPayment:!1}},{path:"/payment/stripe",name:"StripePayment",component:()=>h(()=>import("./StripePaymentView-DAfktinI.js"),__vite__mapDeps([113,1,100,101,23,103,106,53,13,14,6,7,3,15,9,10])),meta:{requiresAuth:!1,requiresAdmin:!1,title:"Stripe Payment",titleKey:"payment.stripePay",requiresPayment:!1}},{path:"/payment/airwallex",name:"AirwallexPayment",component:()=>h(()=>import("./AirwallexPaymentView-7SAws79H.js"),__vite__mapDeps([114,1,53,13,14,6,7,3,15,9,10,106])),meta:{requiresAuth:!1,requiresAdmin:!1,title:"Airwallex Payment",titleKey:"payment.airwallexPay",requiresPayment:!1}},{path:"/payment/stripe-popup",name:"StripePopup",component:()=>h(()=>import("./StripePopupView-C5kKv_rr.js"),__vite__mapDeps([115,1,23,3,6,7])),meta:{requiresAuth:!1,requiresAdmin:!1,title:"Payment",requiresPayment:!1}},{path:"/custom/:id",name:"CustomPage",component:()=>h(()=>import("./CustomPageView-BYM_d9mE.js"),__vite__mapDeps([116,1,81,53,13,14,6,7,3,15,9,10,117])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Custom Page",titleKey:"customPage.title"}},{path:"/admin",redirect:"/admin/dashboard"},{path:"/admin/dashboard",name:"AdminDashboard",component:()=>h(()=>import("./DashboardView-YbUD5_tS.js"),__vite__mapDeps([118,1,53,13,14,6,7,3,15,9,10,63,64,65,66,67,2,4,90])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Admin Dashboard",titleKey:"admin.dashboard.title",descriptionKey:"admin.dashboard.description"}},{path:"/admin/ops",name:"AdminOps",component:()=>h(()=>import("./OpsDashboard-CfYenZZh.js"),__vite__mapDeps([119,1,53,13,14,6,7,3,15,9,10,2,4,120,121,122,75,76,68,77,71,78,91,66,81,23,5,79,123])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Ops Monitoring",titleKey:"admin.ops.title",descriptionKey:"admin.ops.description"}},{path:"/admin/audit-logs",name:"AdminAuditLogs",component:()=>h(()=>import("./AuditLogView-B5LWDodt.js"),__vite__mapDeps([124,1,97,53,13,14,6,7,3,15,9,10,73,74,75,76,77,2,4,71,78,79])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Audit Logs",titleKey:"admin.audit.title",descriptionKey:"admin.audit.description"}},{path:"/admin/users",name:"AdminUsers",component:()=>h(()=>import("./UsersView-CRBoneyO.js"),__vite__mapDeps([125,1,71,126,53,13,14,6,7,3,15,9,10,73,74,75,76,77,2,4,78,79,68,56,57,54,127,128,97,5,82,83,23,129,130])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"User Management",titleKey:"admin.users.title",descriptionKey:"admin.users.description"}},{path:"/admin/groups",name:"AdminGroups",component:()=>h(()=>import("./GroupsView-BuyDXxJF.js"),__vite__mapDeps([131,1,53,13,14,6,7,3,15,9,10,120,73,74,75,76,77,2,4,71,78,5,79,68,54,132,133,59,134,127,23,135])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Group Management",titleKey:"admin.groups.title",descriptionKey:"admin.groups.description"}},{path:"/admin/channels",redirect:"/admin/channels/pricing"},{path:"/admin/channels/pricing",name:"AdminChannels",component:()=>h(()=>import("./ChannelsView-lDUBrZxJ.js"),__vite__mapDeps([136,1,23,133,59,3,55,53,13,14,6,7,15,9,10,73,74,75,76,77,2,4,71,78,79,68,54,5,132,134,137])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Channel Management",titleKey:"admin.channels.title",descriptionKey:"admin.channels.description"}},{path:"/admin/channels/monitor",name:"AdminChannelMonitor",component:()=>h(()=>import("./ChannelMonitorView-BeKU_4Rb.js"),__vite__mapDeps([138,23,53,13,1,14,6,7,3,15,9,10,73,74,75,76,77,2,4,71,78,79,68,121,5,139,140,81,72,133,59,56,57,54,84])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Channel Monitor",titleKey:"admin.channelMonitor.title",descriptionKey:"admin.channelMonitor.description"}},{path:"/monitor",name:"ChannelStatus",component:()=>h(()=>import("./ChannelStatusView-ohb-BCR2.js"),__vite__mapDeps([141,23,53,13,1,14,6,7,3,15,9,10,68,139,140,81,63,64,2,4,66,142])),meta:{requiresAuth:!0,requiresAdmin:!1,title:"Channel Status",titleKey:"nav.channelStatus"}},{path:"/admin/subscriptions",name:"AdminSubscriptions",component:()=>h(()=>import("./SubscriptionsView-Bli7ICSE.js"),__vite__mapDeps([143,1,126,3,71,53,13,14,6,7,15,9,10,73,74,75,76,77,2,4,78,79,68,56,57,54,82,83,120,144])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Subscription Management",titleKey:"admin.subscriptions.title",descriptionKey:"admin.subscriptions.description"}},{path:"/admin/accounts",name:"AdminAccounts",component:()=>h(()=>import("./AccountsView-Can2d8kO.js"),__vite__mapDeps([145,1,71,81,146,3,55,54,126,128,97,53,13,14,6,7,15,9,10,73,74,75,76,121,77,2,4,78,79,147,148,23,149,150,151,56,57,5,127,140,63,64,80,120,66,90,89,152])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Account Management",titleKey:"admin.accounts.title",descriptionKey:"admin.accounts.description"}},{path:"/admin/plugins",name:"AdminPlugins",component:()=>h(()=>import("./PluginsView-DWuvEXP3.js"),__vite__mapDeps([153,53,13,1,14,6,7,3,15,9,10,128,97])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Plugin Management",titleKey:"admin.plugins.title",descriptionKey:"admin.plugins.description"}},{path:"/admin/announcements",name:"AdminAnnouncements",component:()=>h(()=>import("./AnnouncementsView-Nd5Tlt8Y.js"),__vite__mapDeps([154,1,71,53,13,14,6,7,3,15,9,10,73,74,75,76,77,2,4,78,79,68,151,56,57,54])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Announcements",titleKey:"admin.announcements.title",descriptionKey:"admin.announcements.description"}},{path:"/admin/proxies",name:"AdminProxies",component:()=>h(()=>import("./ProxiesView-B1Trx9lS.js"),__vite__mapDeps([155,1,53,13,14,6,7,3,15,9,10,73,74,75,76,77,2,4,71,78,79,68,146,55,54,126])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Proxy Management",titleKey:"admin.proxies.title",descriptionKey:"admin.proxies.description"}},{path:"/admin/redeem",name:"AdminRedeem",component:()=>h(()=>import("./RedeemView-C2onWYmD.js"),__vite__mapDeps([156,1,15,126,71,53,13,14,6,7,3,9,10,73,74,75,76,77,2,4,78,79,56,57,54,82,83])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Redeem Code Management",titleKey:"admin.redeem.title",descriptionKey:"admin.redeem.description"}},{path:"/admin/promo-codes",name:"AdminPromoCodes",component:()=>h(()=>import("./PromoCodesView-DSMMRpQ1.js"),__vite__mapDeps([157,1,15,71,53,13,14,6,7,3,9,10,73,74,75,76,77,2,4,78,79])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Promo Code Management",titleKey:"admin.promo.title",descriptionKey:"admin.promo.description"}},{path:"/admin/settings",name:"AdminSettings",component:()=>h(()=>import("./SettingsView-D88cJ6DL.js"),__vite__mapDeps([158,1,53,13,14,6,7,3,15,9,10,2,4,79,104,121,56,57,54,82,83,5,149,150,128,97,23,102,106,27,159])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"System Settings",titleKey:"admin.settings.title",descriptionKey:"admin.settings.description"}},{path:"/admin/risk-control",name:"AdminRiskControl",component:()=>h(()=>
100import("./RiskControlView-CDBIQhpT.js"),__vite__mapDeps([160,1,53,13,14,6,7,3,15,9,10,2,4,5,77,71,78,147,148,149,150,23])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Risk Control",titleKey:"admin.riskControl.title",descriptionKey:"admin.riskControl.description",requiresRiskControl:!0}},{path:"/admin/prompt-audit",name:"AdminPromptAudit",component:()=>h(()=>import("./PromptAuditView-BXpeTkFU.js"),__vite__mapDeps([161,1,53,13,14,6,7,3,15,9,10,79,23,77,2,4,71,78])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Prompt Audit",titleKey:"admin.promptAudit.title",descriptionKey:"admin.promptAudit.description",requiresRiskControl:!0}},{path:"/admin/usage",name:"AdminUsage",component:()=>h(()=>import("./UsageView-BH9t69i1.js"),__vite__mapDeps([162,1,6,7,71,88,3,89,66,63,64,90,75,76,68,91,53,13,14,15,9,10,77,2,4,78,65,67,79,129,122])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Usage Records",titleKey:"admin.usage.title",descriptionKey:"admin.usage.description"}},{path:"/admin/affiliates",redirect:"/admin/affiliates/invites"},{path:"/admin/affiliates/invites",name:"AdminAffiliateInvites",component:()=>h(()=>import("./AdminAffiliateInvitesView-CGAASl3u.js"),__vite__mapDeps([163,164,1,53,13,14,6,7,3,15,9,10,73,74,75,76,77,2,4,71,78,110,23])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Affiliate Invite Records",titleKey:"nav.affiliateInviteRecords",descriptionKey:"admin.affiliates.invitesDescription"}},{path:"/admin/affiliates/rebates",name:"AdminAffiliateRebates",component:()=>h(()=>import("./AdminAffiliateRebatesView-ZxVBm5Hk.js"),__vite__mapDeps([165,164,1,53,13,14,6,7,3,15,9,10,73,74,75,76,77,2,4,71,78,110,23])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Affiliate Rebate Records",titleKey:"nav.affiliateRebateRecords",descriptionKey:"admin.affiliates.rebatesDescription"}},{path:"/admin/affiliates/transfers",name:"AdminAffiliateTransfers",component:()=>h(()=>import("./AdminAffiliateTransfersView-BvbZ8i5A.js"),__vite__mapDeps([166,164,1,53,13,14,6,7,3,15,9,10,73,74,75,76,77,2,4,71,78,110,23])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Affiliate Transfer Records",titleKey:"nav.affiliateTransferRecords",descriptionKey:"admin.affiliates.transfersDescription"}},{path:"/admin/orders/dashboard",name:"AdminPaymentDashboard",component:()=>h(()=>import("./AdminPaymentDashboardView-_f2cEQmw.js"),__vite__mapDeps([167,23,53,13,1,14,6,7,3,15,9,10,63,64,66])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Payment Dashboard",titleKey:"nav.paymentDashboard",requiresPayment:!0}},{path:"/admin/orders",name:"AdminOrders",component:()=>h(()=>import("./AdminOrdersView-BIs7e9BQ.js"),__vite__mapDeps([168,1,23,53,13,14,6,7,3,15,9,10,77,2,4,71,78,103,110,109,75,76])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Order Management",titleKey:"nav.orderManagement",requiresPayment:!0}},{path:"/admin/orders/plans",name:"AdminPaymentPlans",component:()=>h(()=>import("./AdminPaymentPlansView-CY6Ju_ia.js"),__vite__mapDeps([169,23,53,13,1,14,6,7,3,15,9,10,75,76,79,56,57,54,103,2,4,55])),meta:{requiresAuth:!0,requiresAdmin:!0,title:"Subscription Plans",titleKey:"nav.paymentPlans",requiresPayment:!0}},{path:"/:pathMatch(.*)*",name:"NotFound",component:()=>h(()=>import("./NotFoundView-CRnFI7cP.js"),__vite__mapDeps([170,1,3,6,7])),meta:{title:"404 Not Found"}}],ae=Ua({history:za("/"),routes:Gp,scrollBehavior(e,t,a){return a||{top:0}}});let St=!1;const ha=Qt();let Ke=null;const Qp=["/login","/key-usage","/setup","/payment/result","/payment/airwallex","/legal"],Jp=["/auth/callback","/auth/linuxdo/callback","/auth/dingtalk/callback","/auth/dingtalk/email-completion","/auth/oidc/callback","/auth/wechat/callback","/auth/wechat/payment/callback"],Yp=["/register","/email-verify"];function Pt(e,t){return!!(Qp.some(a=>e===a||e.startsWith(a))||Jp.some(a=>e===a)||t&&Yp.some(a=>e===a))}ae.beforeEach(async(e,t,a)=>{var m,l,_,v;ha.startNavigation();const r=Me();St||(r.checkAuth(),St=!0);const o=G(),s=ot(),i=[...((m=o.cachedPublicSettings)==null?void 0:m.custom_menu_items)??[],...r.isAdmin?s.customMenuItems:[]];document.title=it(e,o.siteName,i);const c=e.meta.requiresAuth!==!1,u=e.meta.requiresAdmin===!0;if(e.path==="/setup")try{if(!(await da()).needs_setup){a(jp(r.isAuthenticated,r.isAdmin));return}}catch{}if(!c){if(r.isAuthenticated&&(e.path==="/login"||e.path==="/register")){if(o.backendModeEnabled&&!r.isAdmin){a();return}a(r.isAdmin?"/admin/dashboard":"/dashboard");return}if(e.path==="/model-plaza"){if(!o.publicSettingsLoaded)try{await o.fetchPublicSettings()}catch(p){console.warn("Failed to load public settings in route guard",p)}const d=o.cachedPublicSettings;if(o.publicSettingsLoaded&&(d==null?void 0:d.model_plaza_enabled)===!1){a(r.isAuthenticated?r.isAdmin?"/admin/dashboard":"/dashboard":"/home");return}if((d==null?void 0:d.model_plaza_require_auth)===!0&&!r.isAuthenticated){a({path:"/login",query:{redirect:e.fullPath}});return}if(o.backendModeEnabled&&r.isAuthenticated&&!r.isAdmin){a("/login");return}}if(o.backendModeEnabled&&!r.isAuthenticated&&!Pt(e.path,r.hasPendingAuthSession)){a("/login");return}a();return}if(!r.isAuthenticated){a({path:"/login",query:{redirect:e.fullPath}});return}if(u&&!r.isAdmin){a("/dashboard");return}if(u&&r.isAdmin){const d=st();if(!d.initialized)try{await d.fetchStatus()}catch(p){const f=p;f.status===423&&f.code==="ADMIN_COMPLIANCE_ACK_REQUIRED"&&d.requireAcknowledgement(f.metadata)}}if((e.meta.requiresPayment||e.meta.requiresRiskControl||e.meta.requiresSubscription)&&!o.publicSettingsLoaded)try{await o.fetchPublicSettings()}catch(d){console.warn("Failed to load public settings in route guard",d)}
100if(e.meta.requiresPayment&&o.publicSettingsLoaded&&((l=o.cachedPublicSettings)==null?void 0:l.payment_enabled)===!1){a(r.isAdmin?"/admin/dashboard":"/dashboard");return}if(e.meta.requiresRiskControl&&o.publicSettingsLoaded&&((_=o.cachedPublicSettings)==null?void 0:_.risk_control_enabled)===!1){a(r.isAdmin?"/admin/settings":"/dashboard");return}if(e.meta.requiresSubscription&&o.publicSettingsLoaded&&((v=o.cachedPublicSettings)==null?void 0:v.subscription_enabled)===!1){a(r.isAdmin?"/admin/dashboard":"/dashboard");return}if(r.isSimpleMode&&["/admin/subscriptions","/admin/redeem","/subscriptions","/redeem"].some(p=>e.path.startsWith(p))){a(r.isAdmin?"/admin/dashboard":"/dashboard");return}if(o.backendModeEnabled){if(r.isAuthenticated&&r.isAdmin){a();return}if(!Pt(e.path,r.hasPendingAuthSession)){a("/login");return}}a()});ae.afterEach(e=>{ha.endNavigation(),Ke||(Ke=Wp(ae)),Ke.triggerPrefetch(e)});ae.onError(e=>{var a,r,o;if(console.error("Router error:",e),((a=e.message)==null?void 0:a.includes("Failed to fetch dynamically imported module"))||((r=e.message)==null?void 0:r.includes("Loading chunk"))||((o=e.message)==null?void 0:o.includes("Loading CSS chunk"))||e.name==="ChunkLoadError"){const s="chunk_reload_attempted",i=sessionStorage.getItem(s),c=Date.now();!i||c-parseInt(i)>1e4?(sessionStorage.setItem(s,c.toString()),console.warn("Chunk load error detected, reloading page to fetch latest version..."),window.location.reload()):console.error("Chunk load error persists after reload. Please clear browser cache.")}});const Zp=Object.freeze(Object.defineProperty({__proto__:null,default:ae},Symbol.toStringTag,{value:"Module"})),Xp=/\b(Mobi|Android|iPhone|iPod|Windows Phone|webOS|BlackBerry|IEMobile)\b/i,ef=/\b(iPad|Tablet)\b/i,tf=/\b(iPhone|iPad|iPod)\b/i;function Et(e,t){var a;try{return((a=e==null?void 0:e(t))==null?void 0:a.matches)===!0}catch{return!1}}function af(e={}){var l;const t=e.navigator;if(!t)return!1;if(((l=t.userAgentData)==null?void 0:l.mobile)===!0)return!0;const a=t.userAgent||"",r=t.maxTouchPoints??0,o=t.platform==="MacIntel"&&r>1,s=Xp.test(a),i=ef.test(a)||o,c=Et(e.matchMedia,"(pointer: coarse)"),u=Et(e.matchMedia,"(hover: none)"),m=r>0;return s||i||c&&u&&m}function o0(){return typeof navigator>"u"?!1:af({navigator,matchMedia:typeof window<"u"?window.matchMedia.bind(window):void 0})}function nf(e={}){const t=e.navigator;if(!t)return!1;const a=t.userAgent||"",r=t.maxTouchPoints??0,o=t.platform==="MacIntel"&&r>1;return tf.test(a)||o}function rf(){return typeof navigator>"u"?!1:nf({navigator})}function of(){if(!rf())return;const e=document.querySelector('meta[name="viewport"]');if(!e)return;const t=e.getAttribute("content")||"";/maximum-scale/i.test(t)||e.setAttribute("content",`${t}, maximum-scale=1.0`)}function sf(){const e=localStorage.getItem("theme"),t=e==="dark"||!e&&window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.toggle("dark",t)}async function cf(){sf(),of();const e=Ka(Vp),t=Na();e.use(t);const a=G();a.initFromInjectedConfig(),a.siteName&&a.siteName!=="Sub2API"&&(document.title=`${a.siteName} - AI API Gateway`),ma(a.siteLogo),await Qa(),e.use(ae),e.use(D),await ae.isReady(),e.mount("#app")}cf();export{Vn as $,pf as A,mf as B,Ce as C,wf as D,Uf as E,qf as F,Df as G,Kp as H,lt as I,ut as J,Ft as K,bf as L,Kn as M,Nn as N,gf as O,hf as P,zn as Q,Un as R,$n as S,Cn as T,Fn as U,Sn as V,et as W,Dn as X,Wn as Y,Hn as Z,me as _,G as a,Ja as a$,Bn as a0,pa as a1,Of as a2,Fm as a3,Hm as a4,X as a5,rm as a6,jd as a7,zf as a8,ne as a9,la as aA,Fi as aB,Hi as aC,Ef as aD,a0 as aE,n0 as aF,r0 as aG,Bi as aH,ra as aI,Cf as aJ,Mf as aK,$f as aL,Wi as aM,Pf as aN,If as aO,Af as aP,Tf as aQ,e0 as aR,Xf as aS,t0 as aT,vp as aU,Wf as aV,Nf as aW,kf as aX,Sf as aY,Ds as aZ,qs as a_,zp as aa,Xe as ab,xf as ac,bl as ad,Cs as ae,ai as af,Ff as ag,Vf as ah,Bf as ai,Fc as aj,Ku as ak,Ed as al,qn as am,Kf as an,xr as ao,Zf as ap,ga as aq,Yf as ar,_n as as,yn as at,bn as au,vn as av,Np as aw,Jf as ax,wp as ay,_p as az,ot as b,kr as b0,Xt as b1,Vm as c,ia as d,st as e,n as f,pr as g,bp as h,D as i,bt as j,Hf as k,Gf as l,Qf as m,Dt as n,ff as o,_f as p,yf as q,vf as r,Gn as s,jf as t,Me as u,Rf as v,Km as w,Lf as x,h as y,o0 as z};

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