@kyro-cms/core 0.13.3 → 0.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{WebhookService-BOJMgjBm.d.cts → WebhookService-BJTCP3cU.d.cts} +1 -1
- package/dist/{WebhookService-BLi5Rz2m.d.ts → WebhookService-Bqr_66lK.d.ts} +1 -1
- package/dist/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +1 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +1 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{base-BCgFt3Yx.d.ts → base-C2DOe8wD.d.ts} +3 -2
- package/dist/{base-B-i-tjm1.d.ts → base-DIpT2Vuz.d.cts} +3 -2
- package/dist/chunk-2TYITUOC.js +122 -0
- package/dist/{chunk-K73HOMQY.cjs → chunk-3CIMGC2F.cjs} +3 -3
- package/dist/{chunk-DSHKQL3R.cjs → chunk-6YS6XLOD.cjs} +13 -13
- package/dist/{chunk-ELFQKQLL.js → chunk-ALTU3FDG.js} +1 -1
- package/dist/{chunk-O7CBGP4N.cjs → chunk-LKRI5X2V.cjs} +1 -1
- package/dist/{chunk-22RXJ442.js → chunk-YIFKTA5N.js} +1 -1
- package/dist/cli/index.cjs +86 -86
- package/dist/cli/index.js +87 -87
- package/dist/client.d.cts +25 -0
- package/dist/client.d.ts +25 -0
- package/dist/drizzle/index.d.cts +3 -3
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/fields/index.d.cts +2 -2
- package/dist/fields/index.d.ts +2 -2
- package/dist/graphql/index.d.cts +3 -3
- package/dist/graphql/index.d.ts +3 -3
- package/dist/{index-BttsFZDa.d.ts → index-C9uBoJtm.d.ts} +2 -2
- package/dist/{index-8Ino7vKq.d.ts → index-Ci7aUrmN.d.cts} +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +3 -3
- package/dist/mongodb/index.d.cts +3 -3
- package/dist/mongodb/index.d.ts +3 -3
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +4 -4
- package/dist/rest/index.d.ts +4 -4
- package/dist/rest/index.js +1 -1
- package/dist/templates/index.d.cts +2 -2
- package/dist/templates/index.d.ts +2 -2
- package/dist/trpc/index.d.cts +3 -3
- package/dist/trpc/index.d.ts +3 -3
- package/dist/{types-Bii0bhUV.d.ts → types-C3QFX0l6.d.cts} +5 -0
- package/dist/{types-B9oXBEKI.d.cts → types-C3QFX0l6.d.ts} +5 -1
- package/dist/{types-Cdssrcbz.d.cts → types-CKWnrUAh.d.ts} +23 -2
- package/dist/{types-BRDBNacn.d.ts → types-CdwfDpyW.d.cts} +23 -2
- package/package.json +2 -2
- package/dist/WebhookService-BcuD8tnn.d.cts +0 -143
- package/dist/WebhookService-CFe6Zd0_.d.cts +0 -143
- package/dist/WebhookService-CVXmjbtQ.d.cts +0 -143
- package/dist/WebhookService-D5PSI5t6.d.cts +0 -143
- package/dist/WebhookService-DPCCn_12.d.ts +0 -143
- package/dist/WebhookService-Dk1lzSrG.d.cts +0 -143
- package/dist/WebhookService-Dncnbgm9.d.cts +0 -143
- package/dist/WebhookService-I6hdue2Y.d.ts +0 -143
- package/dist/WebhookService-KnQ2UDlW.d.ts +0 -143
- package/dist/WebhookService-UY5p89Bj.d.ts +0 -143
- package/dist/WebhookService-YZXBCRXA.d.ts +0 -143
- package/dist/WebhookService-fk0FGRlk.d.ts +0 -143
- package/dist/WebhookService-vsFnWrOh.d.ts +0 -143
- package/dist/WebhookService-zrDmAx7L.d.cts +0 -143
- package/dist/base-B--L0lCn.d.cts +0 -218
- package/dist/base-B-siit_y.d.cts +0 -218
- package/dist/base-B8SyZI4D.d.ts +0 -218
- package/dist/base-BHRGJ40F.d.cts +0 -218
- package/dist/base-BVoDPNjJ.d.cts +0 -218
- package/dist/base-BaOJ5uWd.d.cts +0 -218
- package/dist/base-BfPaVEAE.d.cts +0 -218
- package/dist/base-BxrX5EPU.d.cts +0 -218
- package/dist/base-CAb9EYQs.d.ts +0 -218
- package/dist/base-CcZIEll-.d.ts +0 -218
- package/dist/base-CyG7aF1e.d.cts +0 -218
- package/dist/base-DOImeJ-F.d.ts +0 -218
- package/dist/base-DbnwE42-.d.cts +0 -218
- package/dist/base-NyiSsD-n.d.ts +0 -218
- package/dist/base-OYfoYPYP.d.ts +0 -218
- package/dist/base-xflndGDO.d.ts +0 -218
- package/dist/bootstrap-E24SGUJP.cjs +0 -1
- package/dist/bootstrap-QQ6D3OYG.js +0 -1
- package/dist/bootstrap-QVKSKXJF.cjs +0 -1
- package/dist/bootstrap-RILR44UM.cjs +0 -1
- package/dist/bootstrap-YFVE7MRG.js +0 -1
- package/dist/bootstrap-ZRRUPRUR.js +0 -1
- package/dist/chunk-2FSOHXOU.cjs +0 -56
- package/dist/chunk-2OS5Y4LE.cjs +0 -1
- package/dist/chunk-2PXXQKN3.cjs +0 -3
- package/dist/chunk-32QY56XF.js +0 -122
- package/dist/chunk-355R4LS5.cjs +0 -56
- package/dist/chunk-35IVNLMA.js +0 -122
- package/dist/chunk-3GXLOYM3.js +0 -2
- package/dist/chunk-3LAWUINR.cjs +0 -1
- package/dist/chunk-3O3AVMWM.cjs +0 -1
- package/dist/chunk-3U6MKWET.cjs +0 -120
- package/dist/chunk-4YCI3HBD.js +0 -3
- package/dist/chunk-4ZWLNGLS.js +0 -2
- package/dist/chunk-5A7E7N4B.cjs +0 -431
- package/dist/chunk-5ZEYOFAK.js +0 -2
- package/dist/chunk-6DD4J7LI.js +0 -2
- package/dist/chunk-6GGPY7U2.js +0 -4
- package/dist/chunk-6MNLRAKM.cjs +0 -121
- package/dist/chunk-73Y63IPP.js +0 -57
- package/dist/chunk-7DUKWHRN.cjs +0 -1
- package/dist/chunk-7K6ZUNJM.js +0 -4
- package/dist/chunk-7LLCXY5O.cjs +0 -19
- package/dist/chunk-A35ZP72D.cjs +0 -132
- package/dist/chunk-A3IOQOV6.js +0 -2
- package/dist/chunk-A3XVL6ED.cjs +0 -3
- package/dist/chunk-A7LZ6T42.cjs +0 -1
- package/dist/chunk-APDQ6ZTG.cjs +0 -120
- package/dist/chunk-ATI2UZ7U.js +0 -2
- package/dist/chunk-AWQGDMOE.js +0 -3
- package/dist/chunk-B3BSVEFC.cjs +0 -3
- package/dist/chunk-B4AC23SG.js +0 -122
- package/dist/chunk-BD6XHMMM.cjs +0 -2
- package/dist/chunk-CHYVUWZ3.js +0 -2
- package/dist/chunk-CIVA6SKW.js +0 -2
- package/dist/chunk-CNHUCCQJ.js +0 -121
- package/dist/chunk-CRP6PSCE.js +0 -2
- package/dist/chunk-DI6TCZSE.js +0 -122
- package/dist/chunk-DORUYZQV.cjs +0 -1
- package/dist/chunk-E4H3ZZ7U.js +0 -4
- package/dist/chunk-EFKEVWAD.js +0 -4
- package/dist/chunk-EI7FRSNY.js +0 -57
- package/dist/chunk-EON4XLKQ.cjs +0 -1
- package/dist/chunk-EUQAOYEO.cjs +0 -121
- package/dist/chunk-EVAUBT7H.js +0 -57
- package/dist/chunk-EYHD7HZE.cjs +0 -1
- package/dist/chunk-EYYIPA5N.js +0 -432
- package/dist/chunk-FBWLSWZ4.js +0 -122
- package/dist/chunk-FDKU7HJX.js +0 -2
- package/dist/chunk-FG3IFGJP.cjs +0 -1
- package/dist/chunk-FGN6IMPY.cjs +0 -3
- package/dist/chunk-FLS2FJM6.cjs +0 -431
- package/dist/chunk-FP5UK272.cjs +0 -1
- package/dist/chunk-FSL3NLRT.cjs +0 -2
- package/dist/chunk-FUFS65Q5.js +0 -133
- package/dist/chunk-GV2IB4WQ.cjs +0 -56
- package/dist/chunk-GWIZT2P5.js +0 -57
- package/dist/chunk-H3FJ54KB.cjs +0 -121
- package/dist/chunk-HY3EAWB2.js +0 -4
- package/dist/chunk-I6UJVO2P.js +0 -57
- package/dist/chunk-IQSF6XRV.js +0 -57
- package/dist/chunk-IXGDTAES.js +0 -4
- package/dist/chunk-JB4WG2YJ.cjs +0 -121
- package/dist/chunk-JCEJ4VTN.js +0 -20
- package/dist/chunk-JZ7Z6WC2.cjs +0 -3
- package/dist/chunk-K5XGP57D.cjs +0 -19
- package/dist/chunk-LBLFU6KI.js +0 -57
- package/dist/chunk-LP3HRZGK.js +0 -57
- package/dist/chunk-LPFRMQFQ.js +0 -121
- package/dist/chunk-LYU44UNN.cjs +0 -56
- package/dist/chunk-M75VGFCI.js +0 -3
- package/dist/chunk-MFNN5DYG.cjs +0 -1
- package/dist/chunk-MJAODEFC.cjs +0 -121
- package/dist/chunk-MLCBSEBU.js +0 -2
- package/dist/chunk-MSC4G2HF.cjs +0 -2
- package/dist/chunk-MYHNTJLR.cjs +0 -56
- package/dist/chunk-N2YHO2WI.cjs +0 -3
- package/dist/chunk-N6MNQIQU.js +0 -123
- package/dist/chunk-NPBXLPOP.js +0 -3
- package/dist/chunk-OJ3H4AQ2.cjs +0 -56
- package/dist/chunk-ON5XJEPO.cjs +0 -3
- package/dist/chunk-OPTVCCQQ.cjs +0 -122
- package/dist/chunk-OT2Z4XBD.cjs +0 -1
- package/dist/chunk-PFKVHUOT.js +0 -432
- package/dist/chunk-PFTBTWSC.cjs +0 -1
- package/dist/chunk-PTPVFLET.js +0 -20
- package/dist/chunk-PZDLPRJF.js +0 -4
- package/dist/chunk-QC4YXUBT.cjs +0 -383
- package/dist/chunk-QUTYCUST.js +0 -4
- package/dist/chunk-REKKBAQX.cjs +0 -56
- package/dist/chunk-RTNQP6BV.js +0 -2
- package/dist/chunk-RUJW47ZJ.js +0 -2
- package/dist/chunk-RXYCFZJC.cjs +0 -121
- package/dist/chunk-S2MZNEBQ.cjs +0 -1
- package/dist/chunk-S5HTTLN7.cjs +0 -2
- package/dist/chunk-S73YERS2.js +0 -57
- package/dist/chunk-SMQ6736Y.js +0 -57
- package/dist/chunk-T3DJ3UTP.cjs +0 -121
- package/dist/chunk-TEY5LZ26.cjs +0 -56
- package/dist/chunk-TJZO7ZSX.cjs +0 -3
- package/dist/chunk-TKUNRCRH.js +0 -4
- package/dist/chunk-TQLCOMKC.js +0 -4
- package/dist/chunk-TRXYDWGE.cjs +0 -1
- package/dist/chunk-TS55CUNJ.js +0 -57
- package/dist/chunk-UFBJ3WOZ.js +0 -2
- package/dist/chunk-UQRVQUVR.js +0 -2
- package/dist/chunk-UW5W35NP.js +0 -122
- package/dist/chunk-UWVBFRCW.js +0 -2
- package/dist/chunk-UZWYFEUN.js +0 -122
- package/dist/chunk-VI7WCO2J.cjs +0 -3
- package/dist/chunk-VOYPKTID.cjs +0 -1
- package/dist/chunk-VTOL3URF.js +0 -4
- package/dist/chunk-VVVCCB6R.js +0 -2
- package/dist/chunk-W2GPP6RB.js +0 -122
- package/dist/chunk-WHOA7YJU.cjs +0 -1
- package/dist/chunk-WNRUPL26.js +0 -2
- package/dist/chunk-XBQ6HV3T.cjs +0 -114
- package/dist/chunk-XIAJQLGS.js +0 -2
- package/dist/chunk-XK6UB77Q.js +0 -4
- package/dist/chunk-XP7BXFXT.cjs +0 -121
- package/dist/chunk-Y2VHO66Q.cjs +0 -3
- package/dist/chunk-Y5O2OD7J.cjs +0 -3
- package/dist/chunk-YARB43JG.cjs +0 -56
- package/dist/chunk-YLCEMVYY.cjs +0 -56
- package/dist/chunk-YSOM57GK.cjs +0 -3
- package/dist/chunk-Z2SN2MYP.js +0 -122
- package/dist/chunk-Z3UVDGYS.cjs +0 -56
- package/dist/chunk-ZO3YB5DK.cjs +0 -1
- package/dist/chunk-ZOVH6QT5.cjs +0 -1
- package/dist/chunk-ZRIBWDYJ.js +0 -384
- package/dist/chunk-ZWDBPEXL.js +0 -115
- package/dist/index-B9BFNOHd.d.cts +0 -105
- package/dist/index-BMcYFpTv.d.cts +0 -105
- package/dist/index-ByOM1Y5x.d.ts +0 -105
- package/dist/index-C6xmtRio.d.cts +0 -105
- package/dist/index-CTI3K_uq.d.cts +0 -105
- package/dist/index-CTL4zv_u.d.ts +0 -105
- package/dist/index-CaDbioSg.d.ts +0 -105
- package/dist/index-CxA9uOv0.d.ts +0 -105
- package/dist/index-D6AXbuPI.d.ts +0 -105
- package/dist/index-DF0KDBaM.d.cts +0 -105
- package/dist/index-DG4Xu7gA.d.cts +0 -105
- package/dist/index-DS3DpJli.d.cts +0 -105
- package/dist/index-eHex8Iwj.d.ts +0 -105
- package/dist/index-rm7uyOK1.d.cts +0 -105
- package/dist/lib-5QYYN6ML.cjs +0 -12
- package/dist/lib-XXYYUPMW.js +0 -13
- package/dist/local-DPLKZQA3.js +0 -1
- package/dist/local-KR3AIGVA.cjs +0 -1
- package/dist/local-S5VA7IXE.cjs +0 -1
- package/dist/local-T7GISZBL.js +0 -1
- package/dist/mongo-auth-adapter-EUHAYWJ6.cjs +0 -1
- package/dist/mongo-auth-adapter-FW7ATYQ6.js +0 -1
- package/dist/mongo-auth-adapter-GR2CFFEA.js +0 -1
- package/dist/mongo-auth-adapter-UOO2LZUJ.cjs +0 -1
- package/dist/nodemailer-transport-CHO2WKIY.js +0 -1
- package/dist/nodemailer-transport-ED2IXNGW.cjs +0 -1
- package/dist/postgres-auth-adapter-SK3N3OSS.js +0 -1
- package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +0 -1
- package/dist/redis-adapter-EGMUN65D.cjs +0 -1
- package/dist/redis-adapter-QPCTMF55.js +0 -1
- package/dist/sqlite-adapter-52PL52VU.js +0 -1
- package/dist/sqlite-adapter-MNNZZXGX.cjs +0 -1
- package/dist/types-6ShQp2EM.d.cts +0 -839
- package/dist/types-B5Qz1svz.d.cts +0 -822
- package/dist/types-B9oXBEKI.d.ts +0 -330
- package/dist/types-Bii0bhUV.d.cts +0 -329
- package/dist/types-Bt2_ycUO.d.ts +0 -811
- package/dist/types-C4wXHImf.d.ts +0 -822
- package/dist/types-C8yIAV6K.d.cts +0 -839
- package/dist/types-CORUQhY-.d.ts +0 -839
- package/dist/types-CjGqxBd3.d.cts +0 -330
- package/dist/types-CjGqxBd3.d.ts +0 -330
- package/dist/types-DBGR-eQl.d.cts +0 -839
- package/dist/types-DCWgPFmi.d.cts +0 -822
- package/dist/types-DROqAsr0.d.cts +0 -330
- package/dist/types-DROqAsr0.d.ts +0 -330
- package/dist/types-DlGSbh7I.d.cts +0 -297
- package/dist/types-DlGSbh7I.d.ts +0 -297
- package/dist/types-DsF64Wrc.d.cts +0 -811
- package/dist/types-IeKFn7Ky.d.ts +0 -839
- package/dist/types-ZrjEVWfi.d.ts +0 -811
- package/dist/types-dEy5JxvN.d.ts +0 -822
- package/dist/types-tVJc9YbX.d.cts +0 -811
- package/dist/types-zt5qIvje.d.ts +0 -839
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {K,H}from'./chunk-
|
|
1
|
+
import {K,H}from'./chunk-YIFKTA5N.js';import {e}from'./chunk-RYXLEFS5.js';import {hb}from'./chunk-2TYITUOC.js';import {a as a$1}from'./chunk-WNU76M2C.js';import {c}from'./chunk-6NBZDW53.js';import {a}from'./chunk-6E44MQQ5.js';import {a as a$2}from'./chunk-YGI5W4RS.js';import {g}from'./chunk-Y2YAKDEQ.js';import w from'kyro:config';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
2
|
g();var r=null,l=null;async function b(){if(!r){if(globalThis.__KYRO_INSTANCE__)try{await globalThis.__KYRO_INSTANCE__.shutdown();}catch{}try{let e$1=w.default||w,t=e$1.adapter,o=t&&!t.dialect&&typeof t.connect=="function";if(globalThis.DB&&(!t||o)){let s=globalThis.DB;e$1.adapter=new c({type:"sqlite",client:s}),K.info("Hot-swapped to D1 DrizzleAdapter");}r=H(e$1),await r.init();let a$3=e$1.adapter,p=a$3&&a$3.dialect&&(a$3.dialect==="postgres"||a$3.dialect==="sqlite"),c$1=a$3&&a$3.dialect==="mongodb",n;if(p)a$3.dialect==="postgres"?n=new a({db:a$3.client}):a$3.dialect==="sqlite"&&(n=new hb({db:a$3.rawClient||a$3.client}));else if(o&&!globalThis.DB){let s=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db";n=new a$1({path:s});}else c$1&&(n=new a$2({adapter:a$3}));if(n?.connect)try{await n.connect();}catch(s){K.warn("Auth connect warning:",s);}try{await r.loadSettings();}catch(s){K.warn("loadSettings warning:",s);}try{await e(n);}catch(s){K.warn("autoBootstrap warning:",s);}globalThis.__KYRO_INSTANCE__=r;}catch(e){throw r=null,l=null,K.error("Init failed, will retry:",e),e}}}async function E(e){let t=globalThis.DB?globalThis:null;try{let{env:o}=await import('cloudflare:workers');o&&(t=o);}catch{}if(e)try{t=e.locals?.cfContext?.env||e?.env||t;}catch{}if(!t)try{t=process.env;}catch{}t?.DB&&(globalThis.DB=t.DB),t?.STORAGE_BUCKET&&(globalThis.STORAGE_BUCKET=t.STORAGE_BUCKET),l||(l=b()),await l;}var _={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};function T(e){return r?r.settings?.access?.apiAccess?.[e]??_[e]??true:_[e]??true}var R=async e=>{if(!r)try{await Promise.race([E(e),new Promise((t,o)=>setTimeout(()=>o(new Error("Initialization timeout")),3e4))]);}catch(t){return console.error("[Kyro API] Warm error:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Service Unavailable",message:"Kyro CMS is still starting up. Please try again in a moment."}),{status:503,headers:{"Content-Type":"application/json","Retry-After":"5"}})}try{let o=new URL(e.request.url).pathname,a=__KYRO_API_PATH__;if(o===`${a}/graphql`&&typeof r.getGraphQL=="function"){if(!T("graphqlEnabled"))return new Response(JSON.stringify({error:"GraphQL is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await r.getGraphQL().fetch(e.request,e.locals);return new Response(n.body,n)}if(o.startsWith(`${a}/trpc/`)&&typeof r.getTRPC=="function"){if(!T("trpcEnabled"))return new Response(JSON.stringify({error:"tRPC is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await r.getTRPC().fetch(e.request,e.locals);return new Response(n.body,n)}return await(await r.getREST()).fetch(e.request,e.locals)}catch(t){return console.error("[Kyro API Execution Error]:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Internal Server Error",message:t?.message||String(t),stack:t?.stack}),{status:500,headers:{"Content-Type":"application/json"}})}},N=R;export{r as a,E as b,R as c,N as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk3CIMGC2F_cjs=require('./chunk-3CIMGC2F.cjs'),chunkEW424IBO_cjs=require('./chunk-EW424IBO.cjs'),chunk6YS6XLOD_cjs=require('./chunk-6YS6XLOD.cjs'),chunkEQN3HDES_cjs=require('./chunk-EQN3HDES.cjs'),chunkN4FXLQE3_cjs=require('./chunk-N4FXLQE3.cjs'),chunkQYN6C3FZ_cjs=require('./chunk-QYN6C3FZ.cjs'),chunkJ6V573PE_cjs=require('./chunk-J6V573PE.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs'),w=require('kyro:config');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var w__default=/*#__PURE__*/_interopDefault(w);chunkBUNLC3II_cjs.h();exports.a=null;var l=null;async function b(){if(!exports.a){if(globalThis.__KYRO_INSTANCE__)try{await globalThis.__KYRO_INSTANCE__.shutdown();}catch{}try{let e=w__default.default.default||w__default.default,t=e.adapter,o=t&&!t.dialect&&typeof t.connect=="function";if(globalThis.DB&&(!t||o)){let s=globalThis.DB;e.adapter=new chunkN4FXLQE3_cjs.c({type:"sqlite",client:s}),chunk3CIMGC2F_cjs.K.info("Hot-swapped to D1 DrizzleAdapter");}exports.a=chunk3CIMGC2F_cjs.H(e),await exports.a.init();let a=e.adapter,p=a&&a.dialect&&(a.dialect==="postgres"||a.dialect==="sqlite"),c=a&&a.dialect==="mongodb",n;if(p)a.dialect==="postgres"?n=new chunkQYN6C3FZ_cjs.a({db:a.client}):a.dialect==="sqlite"&&(n=new chunk6YS6XLOD_cjs.hb({db:a.rawClient||a.client}));else if(o&&!globalThis.DB){let s=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db";n=new chunkEQN3HDES_cjs.a({path:s});}else c&&(n=new chunkJ6V573PE_cjs.a({adapter:a}));if(n?.connect)try{await n.connect();}catch(s){chunk3CIMGC2F_cjs.K.warn("Auth connect warning:",s);}try{await exports.a.loadSettings();}catch(s){chunk3CIMGC2F_cjs.K.warn("loadSettings warning:",s);}try{await chunkEW424IBO_cjs.e(n);}catch(s){chunk3CIMGC2F_cjs.K.warn("autoBootstrap warning:",s);}globalThis.__KYRO_INSTANCE__=exports.a;}catch(e){throw exports.a=null,l=null,chunk3CIMGC2F_cjs.K.error("Init failed, will retry:",e),e}}}async function E(e){let t=globalThis.DB?globalThis:null;try{let{env:o}=await import('cloudflare:workers');o&&(t=o);}catch{}if(e)try{t=e.locals?.cfContext?.env||e?.env||t;}catch{}if(!t)try{t=process.env;}catch{}t?.DB&&(globalThis.DB=t.DB),t?.STORAGE_BUCKET&&(globalThis.STORAGE_BUCKET=t.STORAGE_BUCKET),l||(l=b()),await l;}var _={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};function T(e){return exports.a?exports.a.settings?.access?.apiAccess?.[e]??_[e]??true:_[e]??true}var R=async e=>{if(!exports.a)try{await Promise.race([E(e),new Promise((t,o)=>setTimeout(()=>o(new Error("Initialization timeout")),3e4))]);}catch(t){return console.error("[Kyro API] Warm error:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Service Unavailable",message:"Kyro CMS is still starting up. Please try again in a moment."}),{status:503,headers:{"Content-Type":"application/json","Retry-After":"5"}})}try{let o=new URL(e.request.url).pathname,a=__KYRO_API_PATH__;if(o===`${a}/graphql`&&typeof exports.a.getGraphQL=="function"){if(!T("graphqlEnabled"))return new Response(JSON.stringify({error:"GraphQL is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await exports.a.getGraphQL().fetch(e.request,e.locals);return new Response(n.body,n)}if(o.startsWith(`${a}/trpc/`)&&typeof exports.a.getTRPC=="function"){if(!T("trpcEnabled"))return new Response(JSON.stringify({error:"tRPC is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await exports.a.getTRPC().fetch(e.request,e.locals);return new Response(n.body,n)}return await(await exports.a.getREST()).fetch(e.request,e.locals)}catch(t){return console.error("[Kyro API Execution Error]:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Internal Server Error",message:t?.message||String(t),stack:t?.stack}),{status:500,headers:{"Content-Type":"application/json"}})}},L=R;exports.b=E;exports.c=R;exports.d=L;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$3}from'./chunk-LWM4WABU.js';import {a as a$2}from'./chunk-D6SDGHY6.js';import {a as a$5,i as i$1}from'./chunk-RYHOWZLK.js';import {r as r$1,p as p$1,n as n$1,c as c$2,q as q$1,o as o$1,J as J$1,b as b$4,a as a$6,F as F$2,D as D$1,C as C$1,e as e$4,H as H$2,x as x$1,d as d$3,y as y$2,k as k$1,f as f$3,A as A$2,j as j$1,z as z$2,u as u$1,v as v$1,w as w$1,g as g$3,E as E$1,B as B$2,t as t$1,s as s$1,m as m$1,i as i$2,l as l$1,h as h$1}from'./chunk-X473JI7Z.js';import {wa as wa$1,a as a$1,ua as ua$1,Aa as Aa$1,ra as ra$1,Da as Da$1,Na as Na$1,qa as qa$1,ka as ka$1,za as za$1,i,Ga as Ga$1,Ea as Ea$1,f as f$1,Ma as Ma$1,Qa as Qa$1,Ra as Ra$1,Sa as Sa$1,Oa as Oa$1,Ta as Ta$1,Ua as Ua$1,b as b$1,ya as ya$1,la as la$1,Pa as Pa$1,sa as sa$1,va as va$1,La as La$1,ma as ma$1,Fa as Fa$1,k,Ja as Ja$1,Ia as Ia$1,ha as ha$1,t,s,u,r,Ca as Ca$1,ja,d as d$1,j,Ha as Ha$1,Ka as Ka$1,Ba as Ba$1,h,w,pa as pa$1,ga as ga$1,Va as Va$1,oa as oa$1,na as na$1,xa as xa$1,ta as ta$1,m,I,G as G$1,L,D,v,O,Y,C,x,R,P,fa as fa$1,X,ea as ea$1,c as c$1,Z,K,y as y$1,_,E,H as H$1,W,ba as ba$1,Q as Q$1,U,T,e,N as N$1,S,ia as ia$1,g as g$1,V,M,$,B as B$1,aa as aa$1,da as da$1,A as A$1,z as z$1,J,F as F$1,n,q,Wa as Wa$1,o,l,p,ca as ca$1,Xa as Xa$1,Ya as Ya$1,$a as $a$1,ib}from'./chunk-
|
|
1
|
+
import {a as a$3}from'./chunk-LWM4WABU.js';import {a as a$2}from'./chunk-D6SDGHY6.js';import {a as a$5,i as i$1}from'./chunk-RYHOWZLK.js';import {r as r$1,p as p$1,n as n$1,c as c$2,q as q$1,o as o$1,J as J$1,b as b$4,a as a$6,F as F$2,D as D$1,C as C$1,e as e$4,H as H$2,x as x$1,d as d$3,y as y$2,k as k$1,f as f$3,A as A$2,j as j$1,z as z$2,u as u$1,v as v$1,w as w$1,g as g$3,E as E$1,B as B$2,t as t$1,s as s$1,m as m$1,i as i$2,l as l$1,h as h$1}from'./chunk-X473JI7Z.js';import {wa as wa$1,a as a$1,ua as ua$1,Aa as Aa$1,ra as ra$1,Da as Da$1,Na as Na$1,qa as qa$1,ka as ka$1,za as za$1,i,Ga as Ga$1,Ea as Ea$1,f as f$1,Ma as Ma$1,Qa as Qa$1,Ra as Ra$1,Sa as Sa$1,Oa as Oa$1,Ta as Ta$1,Ua as Ua$1,b as b$1,ya as ya$1,la as la$1,Pa as Pa$1,sa as sa$1,va as va$1,La as La$1,ma as ma$1,Fa as Fa$1,k,Ja as Ja$1,Ia as Ia$1,ha as ha$1,t,s,u,r,Ca as Ca$1,ja,d as d$1,j,Ha as Ha$1,Ka as Ka$1,Ba as Ba$1,h,w,pa as pa$1,ga as ga$1,Va as Va$1,oa as oa$1,na as na$1,xa as xa$1,ta as ta$1,m,I,G as G$1,L,D,v,O,Y,C,x,R,P,fa as fa$1,X,ea as ea$1,c as c$1,Z,K,y as y$1,_,E,H as H$1,W,ba as ba$1,Q as Q$1,U,T,e,N as N$1,S,ia as ia$1,g as g$1,V,M,$,B as B$1,aa as aa$1,da as da$1,A as A$1,z as z$1,J,F as F$1,n,q,Wa as Wa$1,o,l,p,ca as ca$1,Xa as Xa$1,Ya as Ya$1,$a as $a$1,ib}from'./chunk-2TYITUOC.js';import {n as n$2,e as e$2,f as f$2}from'./chunk-REQ622YC.js';import {a as a$4,b as b$3,c as c$4,d as d$2}from'./chunk-GQGFNTDZ.js';import {b as b$2,e as e$3}from'./chunk-KEITOXIP.js';import {c as c$3}from'./chunk-6NBZDW53.js';import {g as g$2}from'./chunk-47CXBWMA.js';import {c,g,b,d,a,f,e as e$1}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
2
|
var _s=c((_w,ja)=>{g();function jp(){return Object.keys(globalThis).some(t=>t.startsWith("__NEXT"))}ja.exports=function(){return !!(globalThis.Deno||globalThis.Bun||jp())};});function qa(t,e){return (e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function vs(t,e=false){let r=[],n=0;for(;n<t.length;){let s=t[n],i=F(function(o){if(!e)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:t[n++]});},"ErrorOrInvalid");if(s==="*"){r.push({type:"ASTERISK",index:n,value:t[n++]});continue}if(s==="+"||s==="?"){r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});continue}if(s==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});continue}if(s==="{"){r.push({type:"OPEN",index:n,value:t[n++]});continue}if(s==="}"){r.push({type:"CLOSE",index:n,value:t[n++]});continue}if(s===":"){let o="",a=n+1;for(;a<t.length;){let l=t.substr(a,1);if(a===n+1&&Up.test(l)||a!==n+1&&Bp.test(l)){o+=t[a++];continue}break}if(!o){i(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:o}),n=a;continue}if(s==="("){let o=1,a="",l=n+1,c=false;if(t[l]==="?"){i(`Pattern cannot start with "?" at ${l}`);continue}for(;l<t.length;){if(!qa(t[l],false)){i(`Invalid character '${t[l]}' at ${l}.`),c=true;break}if(t[l]==="\\"){a+=t[l++]+t[l++];continue}if(t[l]===")"){if(o--,o===0){l++;break}}else if(t[l]==="("&&(o++,t[l+1]!=="?")){i(`Capturing groups are not allowed at ${l}`),c=true;break}a+=t[l++];}if(c)continue;if(o){i(`Unbalanced pattern at ${n}`);continue}if(!a){i(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:a}),n=l;continue}r.push({type:"CHAR",index:n,value:t[n++]});}return r.push({type:"END",index:n,value:""}),r}function ks(t,e={}){let r=vs(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${me(e.delimiter)}]+?`,s=[],i=0,o=0,l=new Set,c=F(P=>{if(o<r.length&&r[o].type===P)return r[o++].value},"tryConsume"),u=F(()=>c("OTHER_MODIFIER")??c("ASTERISK"),"tryConsumeModifier"),h=F(P=>{let T=c(P);if(T!==void 0)return T;let{type:S,index:v}=r[o];throw new TypeError(`Unexpected ${S} at ${v}, expected ${P}`)},"mustConsume"),d=F(()=>{let P="",T;for(;T=c("CHAR")??c("ESCAPED_CHAR");)P+=T;return P},"consumeText"),p=F(P=>P,"DefaultEncodePart"),_=e.encodePart||p,w="",R=F(P=>{w+=P;},"appendToPendingFixedValue"),C=F(()=>{w.length&&(s.push(new wt(3,"","",_(w),"",3)),w="");},"maybeAddPartFromPendingFixedValue"),I=F((P,T,S,v,O)=>{let g=3;switch(O){case "?":g=1;break;case "*":g=0;break;case "+":g=2;break}if(!T&&!S&&g===3){R(P);return}if(C(),!T&&!S){if(!P)return;s.push(new wt(3,"","",_(P),"",g));return}let x;S?S==="*"?x=Ss:x=S:x=n;let E=2;x===n?(E=1,x=""):x===Ss&&(E=0,x="");let k;if(T?k=T:S&&(k=i++),l.has(k))throw new TypeError(`Duplicate name '${k}'.`);l.add(k),s.push(new wt(E,k,_(P),x,_(v),g));},"addPart");for(;o<r.length;){let P=c("CHAR"),T=c("NAME"),S=c("REGEX");if(!T&&!S&&(S=c("ASTERISK")),T||S){let O=P??"";e.prefixes.indexOf(O)===-1&&(R(O),O=""),C();let g=u();I(O,T,S,"",g);continue}let v=P??c("ESCAPED_CHAR");if(v){R(v);continue}if(c("OPEN")){let O=d(),g=c("NAME"),x=c("REGEX");!g&&!x&&(x=c("ASTERISK"));let E=d();h("CLOSE");let k=u();I(O,g,x,E,k);continue}C(),h("END");}return s}function me(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Es(t){return t&&t.ignoreCase?"ui":"u"}function Ua(t,e,r){return Ts(ks(t,r),e,r)}function rt(t){switch(t){case 0:return "*";case 1:return "?";case 2:return "+";case 3:return ""}}function Ts(t,e,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=false,r.strict??=false,r.end??=true,r.start??=true,r.endsWith="";let n=r.start?"^":"";for(let a of t){if(a.type===3){a.modifier===3?n+=me(a.value):n+=`(?:${me(a.value)})${rt(a.modifier)}`;continue}e&&e.push(a.name);let l=`[^${me(r.delimiter)}]+?`,c=a.value;if(a.type===1?c=l:a.type===0&&(c=Ss),!a.prefix.length&&!a.suffix.length){a.modifier===3||a.modifier===1?n+=`(${c})${rt(a.modifier)}`:n+=`((?:${c})${rt(a.modifier)})`;continue}if(a.modifier===3||a.modifier===1){n+=`(?:${me(a.prefix)}(${c})${me(a.suffix)})`,n+=rt(a.modifier);continue}n+=`(?:${me(a.prefix)}`,n+=`((?:${c})(?:`,n+=me(a.suffix),n+=me(a.prefix),n+=`(?:${c}))*)${me(a.suffix)})`,a.modifier===0&&(n+="?");}let s=`[${me(r.endsWith)}]|$`,i=`[${me(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${s})`:n+="$",new RegExp(n,Es(r));r.strict||(n+=`(?:${i}(?=${s}))?`);let o=false;if(t.length){let a=t[t.length-1];a.type===3&&a.modifier===3&&(o=r.delimiter.indexOf(a)>-1);}return o||(n+=`(?=${i}|${s})`),new RegExp(n,Es(r))}function Ba(t,e){return t.length?t[0]==="/"?true:!e||t.length<2?false:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":false}function Cs(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function Ma(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function As(t){return !t||t.length<2?false:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}function Rs(t){if(!t)return true;for(let e of $a)if(t.test(e))return true;return false}function Na(t,e){if(t=Cs(t,"#"),e||t==="")return t;let r=new URL("https://example.com");return r.hash=t,r.hash?r.hash.substring(1,r.hash.length):""}function Ga(t,e){if(t=Cs(t,"?"),e||t==="")return t;let r=new URL("https://example.com");return r.search=t,r.search?r.search.substring(1,r.search.length):""}function za(t,e){return e||t===""?t:As(t)?Fs(t):Os(t)}function Ha(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function Va(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function Wa(t,e,r){if(r||t==="")return t;if(e&&!$a.includes(e))return new URL(`${e}:${t}`).pathname;let n=t[0]=="/";return t=new URL(n?t:"/-"+t,"https://example.com").pathname,n||(t=t.substring(2,t.length)),t}function Ka(t,e,r){return Ls(e)===t&&(t=""),r||t===""?t:Is(t)}function Qa(t,e){return t=Ma(t,":"),e||t===""?t:Lr(t)}function Ls(t){switch(t){case "ws":case "http":return "80";case "wws":case "https":return "443";case "ftp":return "21";default:return ""}}function Lr(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function Za(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function Ja(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function Os(t){if(t==="")return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname}function Fs(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function Is(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function Ya(t){if(t==="")return t;let e=new URL("https://example.com");return e.pathname=t[0]!=="/"?"/-"+t:t,t[0]!=="/"?e.pathname.substring(2,e.pathname.length):e.pathname}function Xa(t){return t===""?t:new URL(`data:${t}`).pathname}function el(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function tl(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}function Ps(t,e){if(typeof t!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(t,e);return {protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!==""?r.search.substring(1,r.search.length):void 0,hash:r.hash!==""?r.hash.substring(1,r.hash.length):void 0}}function Te(t,e){return e?_t(t):t}function xt(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=Te(n.protocol.substring(0,n.protocol.length-1),r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(t.username=Te(n.username,r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(t.password=Te(n.password,r)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=Te(n.hostname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=Te(n.port,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=Te(n.pathname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(t.search=Te(n.search.substring(1,n.search.length),r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&e.hash===void 0&&(t.hash=Te(n.hash.substring(1,n.hash.length),r));}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=Qa(e.protocol,r)),typeof e.username=="string"&&(t.username=Va(e.username,r)),typeof e.password=="string"&&(t.password=Ha(e.password,r)),typeof e.hostname=="string"&&(t.hostname=za(e.hostname,r)),typeof e.port=="string"&&(t.port=Ka(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!Ba(t.pathname,r)){let s=n.pathname.lastIndexOf("/");s>=0&&(t.pathname=Te(n.pathname.substring(0,s+1),r)+t.pathname);}t.pathname=Wa(t.pathname,t.protocol,r);}return typeof e.search=="string"&&(t.search=Ga(e.search,r)),typeof e.hash=="string"&&(t.hash=Na(e.hash,r)),t}function _t(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function nl(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function sl(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=false,e.strict??=false,e.end??=true,e.start??=true,e.endsWith="";let r=".*",n=`[^${nl(e.delimiter)}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,i="";for(let o=0;o<t.length;++o){let a=t[o];if(a.type===3){if(a.modifier===3){i+=_t(a.value);continue}i+=`{${_t(a.value)}}${rt(a.modifier)}`;continue}let l=a.hasCustomName(),c=!!a.suffix.length||!!a.prefix.length&&(a.prefix.length!==1||!e.prefixes.includes(a.prefix)),u=o>0?t[o-1]:null,h=o<t.length-1?t[o+1]:null;if(!c&&l&&a.type===1&&a.modifier===3&&h&&!h.prefix.length&&!h.suffix.length)if(h.type===3){let d=h.value.length>0?h.value[0]:"";c=s.test(d);}else c=!h.hasCustomName();if(!c&&!a.prefix.length&&u&&u.type===3){let d=u.value[u.value.length-1];c=e.prefixes.includes(d);}c&&(i+="{"),i+=_t(a.prefix),l&&(i+=`:${a.name}`),a.type===2?i+=`(${a.value})`:a.type===1?l||(i+=`(${n})`):a.type===0&&(!l&&(!u||u.type===3||u.modifier!==3||c||a.prefix!=="")?i+="*":i+=`(${r})`),a.type===1&&l&&a.suffix.length&&s.test(a.suffix[0])&&(i+="\\"),i+=_t(a.suffix),c&&(i+="}"),a.modifier!==3&&(i+=rt(a.modifier));}return i}var qp,F,wt,Up,Bp,Ss,He,Mp,$p,$a,rl,ws,ze,Or,il=b(()=>{g();qp=Object.defineProperty,F=(t,e)=>qp(t,"name",{value:e,configurable:true}),wt=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,s,i){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=s,this.modifier=i;}hasCustomName(){return this.name!==""&&typeof this.name!="number"}};F(wt,"Part");Up=/[$_\p{ID_Start}]/u,Bp=/[$_\u200C\u200D\p{ID_Continue}]/u,Ss=".*";F(qa,"isASCII");F(vs,"lexer");F(ks,"parse");F(me,"escapeString");F(Es,"flags");F(Ua,"stringToRegexp");F(rt,"modifierToString");F(Ts,"partsToRegexp");He={delimiter:"",prefixes:"",sensitive:true,strict:true},Mp={delimiter:".",prefixes:"",sensitive:true,strict:true},$p={delimiter:"/",prefixes:"/",sensitive:true,strict:true};F(Ba,"isAbsolutePathname");F(Cs,"maybeStripPrefix");F(Ma,"maybeStripSuffix");F(As,"treatAsIPv6Hostname");$a=["ftp","file","http","https","ws","wss"];F(Rs,"isSpecialScheme");F(Na,"canonicalizeHash");F(Ga,"canonicalizeSearch");F(za,"canonicalizeHostname");F(Ha,"canonicalizePassword");F(Va,"canonicalizeUsername");F(Wa,"canonicalizePathname");F(Ka,"canonicalizePort");F(Qa,"canonicalizeProtocol");F(Ls,"defaultPortForProtocol");F(Lr,"protocolEncodeCallback");F(Za,"usernameEncodeCallback");F(Ja,"passwordEncodeCallback");F(Os,"hostnameEncodeCallback");F(Fs,"ipv6HostnameEncodeCallback");F(Is,"portEncodeCallback");F(Ya,"standardURLPathnameEncodeCallback");F(Xa,"pathURLPathnameEncodeCallback");F(el,"searchEncodeCallback");F(tl,"hashEncodeCallback");rl=class{#o;#r=[];#n={};#t=0;#p=1;#w=0;#s=0;#y=0;#l=0;#i=false;constructor(t){this.#o=t;}get result(){return this.#n}parse(){for(this.#r=vs(this.#o,true);this.#t<this.#r.length;this.#t+=this.#p){if(this.#p=1,this.#r[this.#t].type==="END"){if(this.#s===0){this.#b(),this.#k()?this.#e(9,1):this.#d()?this.#e(8,1):this.#e(7,0);continue}else if(this.#s===2){this.#f(5);continue}this.#e(10,0);break}if(this.#y>0)if(this.#T())this.#y-=1;else continue;if(this.#L()){this.#y+=1;continue}switch(this.#s){case 0:this.#h()&&this.#f(1);break;case 1:if(this.#h()){this.#O();let t=7,e=1;this.#E()?(t=2,e=3):this.#i&&(t=2),this.#e(t,e);}break;case 2:this.#g()?this.#f(3):(this.#v()||this.#d()||this.#k())&&this.#f(5);break;case 3:this.#x()?this.#e(4,1):this.#g()&&this.#e(5,1);break;case 4:this.#g()&&this.#e(5,1);break;case 5:this.#F()?this.#l+=1:this.#_()&&(this.#l-=1),this.#P()&&!this.#l?this.#e(6,1):this.#v()?this.#e(7,0):this.#d()?this.#e(8,1):this.#k()&&this.#e(9,1);break;case 6:this.#v()?this.#e(7,0):this.#d()?this.#e(8,1):this.#k()&&this.#e(9,1);break;case 7:this.#d()?this.#e(8,1):this.#k()&&this.#e(9,1);break;case 8:this.#k()&&this.#e(9,1);break;}}this.#n.hostname!==void 0&&this.#n.port===void 0&&(this.#n.port="");}#e(t,e){switch(this.#s){case 0:break;case 1:this.#n.protocol=this.#S();break;case 2:break;case 3:this.#n.username=this.#S();break;case 4:this.#n.password=this.#S();break;case 5:this.#n.hostname=this.#S();break;case 6:this.#n.port=this.#S();break;case 7:this.#n.pathname=this.#S();break;case 8:this.#n.search=this.#S();break;case 9:this.#n.hash=this.#S();break;}this.#s!==0&&t!==10&&([1,2,3,4].includes(this.#s)&&[6,7,8,9].includes(t)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#s)&&[8,9].includes(t)&&(this.#n.pathname??=this.#i?"/":""),[1,2,3,4,5,6,7].includes(this.#s)&&t===9&&(this.#n.search??="")),this.#m(t,e);}#m(t,e){this.#s=t,this.#w=this.#t+e,this.#t+=e,this.#p=0;}#b(){this.#t=this.#w,this.#p=0;}#f(t){this.#b(),this.#s=t;}#u(t){return t<0&&(t=this.#r.length-t),t<this.#r.length?this.#r[t]:this.#r[this.#r.length-1]}#c(t,e){let r=this.#u(t);return r.value===e&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}#h(){return this.#c(this.#t,":")}#E(){return this.#c(this.#t+1,"/")&&this.#c(this.#t+2,"/")}#g(){return this.#c(this.#t,"@")}#x(){return this.#c(this.#t,":")}#P(){return this.#c(this.#t,":")}#v(){return this.#c(this.#t,"/")}#d(){if(this.#c(this.#t,"?"))return true;if(this.#r[this.#t].value!=="?")return false;let t=this.#u(this.#t-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}#k(){return this.#c(this.#t,"#")}#L(){return this.#r[this.#t].type=="OPEN"}#T(){return this.#r[this.#t].type=="CLOSE"}#F(){return this.#c(this.#t,"[")}#_(){return this.#c(this.#t,"]")}#S(){let t=this.#r[this.#t],e=this.#u(this.#w).index;return this.#o.substring(e,t.index)}#O(){let t={};Object.assign(t,He),t.encodePart=Lr;let e=Ua(this.#S(),void 0,t);this.#i=Rs(e);}};F(rl,"Parser");ws=["protocol","username","password","hostname","port","pathname","search","hash"],ze="*";F(Ps,"extractValues");F(Te,"processBaseURLString");F(xt,"applyInit");F(_t,"escapePatternString");F(nl,"escapeRegexpString");F(sl,"partsToPattern");Or=class{#o;#r={};#n={};#t={};#p={};#w=false;constructor(t={},e,r){try{let n;if(typeof e=="string"?n=e:r=e,typeof t=="string"){let a=new rl(t);if(a.parse(),t=a.result,n===void 0&&typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n;}else {if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let s={ignoreCase:r.ignoreCase===!0},i={pathname:ze,protocol:ze,username:ze,password:ze,hostname:ze,port:ze,search:ze,hash:ze};this.#o=xt(i,t,!0),Ls(this.#o.protocol)===this.#o.port&&(this.#o.port="");let o;for(o of ws){if(!(o in this.#o))continue;let a={},l=this.#o[o];switch(this.#n[o]=[],o){case "protocol":Object.assign(a,He),a.encodePart=Lr;break;case "username":Object.assign(a,He),a.encodePart=Za;break;case "password":Object.assign(a,He),a.encodePart=Ja;break;case "hostname":Object.assign(a,Mp),As(l)?a.encodePart=Fs:a.encodePart=Os;break;case "port":Object.assign(a,He),a.encodePart=Is;break;case "pathname":Rs(this.#r.protocol)?(Object.assign(a,$p,s),a.encodePart=Ya):(Object.assign(a,He,s),a.encodePart=Xa);break;case "search":Object.assign(a,He,s),a.encodePart=el;break;case "hash":Object.assign(a,He,s),a.encodePart=tl;break}try{this.#p[o]=ks(l,a),this.#r[o]=Ts(this.#p[o],this.#n[o],a),this.#t[o]=sl(this.#p[o],a),this.#w=this.#w||this.#p[o].some(c=>c.type===2);}catch{throw new TypeError(`invalid ${o} pattern '${this.#o[o]}'.`)}}}catch(n){throw new TypeError(`Failed to construct 'URLPattern': ${n.message}`)}}get[Symbol.toStringTag](){return "URLPattern"}test(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return false;try{typeof t=="object"?r=xt(r,t,!1):r=xt(r,Ps(t,e),!1);}catch{return false}let n;for(n of ws)if(!this.#r[n].exec(r[n]))return false;return true}exec(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{typeof t=="object"?r=xt(r,t,!1):r=xt(r,Ps(t,e),!1);}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let s;for(s of ws){let i=this.#r[s].exec(r[s]);if(!i)return null;let o={};for(let[a,l]of this.#n[s].entries())if(typeof l=="string"||typeof l=="number"){let c=i[a+1];o[l]=c;}n[s]={input:r[s]??"",groups:o};}return n}static compareComponent(t,e,r){let n=F((a,l)=>{for(let c of ["type","modifier","prefix","value","suffix"]){if(a[c]<l[c])return -1;if(a[c]!==l[c])return 1}return 0},"comparePart"),s=new wt(3,"","","","",3),i=new wt(0,"","","","",3),o=F((a,l)=>{let c=0;for(;c<Math.min(a.length,l.length);++c){let u=n(a[c],l[c]);if(u)return u}return a.length===l.length?0:n(a[c]??s,l[c]??s)},"comparePartList");return !e.#t[t]&&!r.#t[t]?0:e.#t[t]&&!r.#t[t]?o(e.#p[t],[i]):!e.#t[t]&&r.#t[t]?o([i],r.#p[t]):o(e.#p[t],r.#p[t])}get protocol(){return this.#t.protocol}get username(){return this.#t.username}get password(){return this.#t.password}get hostname(){return this.#t.hostname}get port(){return this.#t.port}get pathname(){return this.#t.pathname}get search(){return this.#t.search}get hash(){return this.#t.hash}get hasRegExpGroups(){return this.#w}};F(Or,"URLPattern");});var ol={};d(ol,{URLPattern:()=>Or});var al=b(()=>{g();il();globalThis.URLPattern||(globalThis.URLPattern=Or);});var We=c(de=>{g();Object.defineProperty(de,"__esModule",{value:true});de.isPromise=Fr;de.isActualPromise=cl;de.handleMaybePromise=Ve;de.fakePromise=Ce;de.createDeferredPromise=Np;de.iterateAsync=ul;de.iterateAsyncVoid=ul;de.fakeRejectPromise=nt;de.mapMaybePromise=Gp;de.mapAsyncIterator=zp;de.promiseLikeFinally=fl;de.unfakePromise=hl;var Ir=Symbol.for("@whatwg-node/promise-helpers/FakePromise");function Fr(t){return t?.then!=null}function cl(t){let e=t;return e&&e.then&&e.catch&&e.finally}function Ve(t,e,r,n){let s=Ce().then(t).then(e,r);return n&&(s=s.finally(n)),hl(s)}function Ce(t){return t&&cl(t)?t:Fr(t)?{then:(e,r)=>Ce(t.then(e,r)),catch:e=>Ce(t.then(r=>r,e)),finally:e=>Ce(e?fl(t,e):t),[Symbol.toStringTag]:"Promise"}:{then(e){if(e)try{return Ce(e(t))}catch(r){return nt(r)}return this},catch(){return this},finally(e){if(e)try{return Ce(e()).then(()=>t,()=>t)}catch(r){return nt(r)}return this},[Symbol.toStringTag]:"Promise",__fakePromiseValue:t,[Ir]:"resolved"}}function Np(){if(Promise.withResolvers)return Promise.withResolvers();let t,e;return {promise:new Promise(function(s,i){t=s,e=i;}),get resolve(){return t},get reject(){return e}}}function ul(t,e,r){if(t?.length===0)return;let n=t[Symbol.iterator](),s=0;function i(){let{done:o,value:a}=n.next();if(o)return;let l=false;function c(){l=true;}return Ve(function(){return e(a,c,s++)},function(h){if(h&&r?.push(h),!l)return i()})}return i()}function nt(t){return {then(e,r){if(r)try{return Ce(r(t))}catch(n){return nt(n)}return this},catch(e){if(e)try{return Ce(e(t))}catch(r){return nt(r)}return this},finally(e){if(e)try{e();}catch(r){return nt(r)}return this},__fakeRejectError:t,[Symbol.toStringTag]:"Promise",[Ir]:"rejected"}}function Gp(t,e,r){return Ve(()=>t,e,r)}function zp(t,e,r,n){Symbol.asyncIterator in t&&(t=t[Symbol.asyncIterator]());let s,i,o;if(n){let c;o=u=>(c||=Ve(n,()=>u,()=>u),c);}typeof t.return=="function"&&(s=t.return,i=c=>{let u=()=>{throw c};return s.call(t).then(u,u)});function a(c){return c.done?o?o(c):c:Ve(()=>c.value,u=>Ve(()=>e(u),ll,i))}let l;if(r){let c,u=r;l=h=>(c||=Ve(()=>h,d=>Ve(()=>u(d),ll,i)),c);}return {next(){return t.next().then(a,l)},return(){let c=s?s.call(t).then(a,l):Ce({value:void 0,done:true});return o?c.then(o):c},throw(c){return typeof t.throw=="function"?t.throw(c).then(a,l):i?i(c):nt(c)},[Symbol.asyncIterator](){return this}}}function ll(t){return {value:t,done:false}}function Hp(t){return t?.[Ir]==="resolved"}function Vp(t){return t?.[Ir]==="rejected"}function fl(t,e){return "finally"in t?t.finally(e):t.then(r=>{let n=e();return Fr(n)?n.then(()=>r):r},r=>{let n=e();if(Fr(n))return n.then(()=>{throw r});throw r})}function hl(t){if(Hp(t))return t.__fakePromiseValue;if(Vp(t))throw t.__fakeRejectError;return t}});var Ds=c((Lw,dl)=>{g();var{EventEmitter:Wp}=a("events"),{inherits:Kp}=a("util");function st(t){if(typeof t=="string"&&(t=Buffer.from(t)),!Buffer.isBuffer(t))throw new TypeError("The needle has to be a String or a Buffer.");let e=t.length,r=e-1;if(e===0)throw new Error("The needle cannot be an empty String/Buffer.");if(e>256)throw new Error("The needle cannot have a length bigger than 256.");this.maxMatches=1/0,this.matches=0,this._occ=new Uint8Array(256).fill(e),this._lookbehind_size=0,this._needle=t,this._bufpos=0,this._lookbehind=Buffer.alloc(r);for(var n=0;n<r;++n)this._occ[t[n]]=r-n;}Kp(st,Wp);st.prototype.reset=function(){this._lookbehind_size=0,this.matches=0,this._bufpos=0;};st.prototype.push=function(t,e){Buffer.isBuffer(t)||(t=Buffer.from(t,"binary"));let r=t.length;this._bufpos=e||0;let n;for(;n!==r&&this.matches<this.maxMatches;)n=this._sbmh_feed(t);return n};st.prototype._sbmh_feed=function(t){let e=t.length,r=this._needle,n=r.length,s=n-1,i=r[s],o=-this._lookbehind_size,a;if(o<0){for(;o<0&&o<=e-n;){if(a=t[o+s],a===i&&this._sbmh_memcmp(t,o,s))return this._lookbehind_size=0,++this.matches,this.emit("info",true),this._bufpos=o+n;o+=this._occ[a];}for(;o<0&&!this._sbmh_memcmp(t,o,e-o);)++o;if(o>=0)this.emit("info",false,this._lookbehind,0,this._lookbehind_size),this._lookbehind_size=0;else {let l=this._lookbehind_size+o;return l>0&&this.emit("info",false,this._lookbehind,0,l),this._lookbehind_size-=l,this._lookbehind.copy(this._lookbehind,0,l,this._lookbehind_size),t.copy(this._lookbehind,this._lookbehind_size),this._lookbehind_size+=e,this._bufpos=e,e}}if(o=t.indexOf(r,o+this._bufpos),o!==-1)return ++this.matches,o===0?this.emit("info",true):this.emit("info",true,t,this._bufpos,o),this._bufpos=o+n;for(o=e-s,o<0&&(o=0);o!==e&&(t[o]!==r[0]||Buffer.compare(t.subarray(o+1,e),r.subarray(1,e-o))!==0);)++o;return o!==e&&(t.copy(this._lookbehind,0,o,e),this._lookbehind_size=e-o),o!==0&&this.emit("info",false,t,this._bufpos,o),this._bufpos=e,e};st.prototype._sbmh_lookup_char=function(t,e){return e<0?this._lookbehind[this._lookbehind_size+e]:t[e]};st.prototype._sbmh_memcmp=function(t,e,r){for(var n=0;n<r;++n)if(this._sbmh_lookup_char(t,e+n)!==this._needle[n])return false;return true};dl.exports=st;});var bl=c((Fw,ml)=>{g();var Qp=a("util").inherits,pl=a("stream").Readable;function js(t){pl.call(this,t);}Qp(js,pl);js.prototype._read=function(t){};ml.exports=js;});var Dr=c((Dw,yl)=>{g();yl.exports=function(e,r,n){if(!e||e[r]===void 0||e[r]===null)return n;if(typeof e[r]!="number"||isNaN(e[r]))throw new TypeError("Limit "+r+" is not a valid number");return e[r]};});var wl=c((qw,_l)=>{g();var xl=a("events").EventEmitter,Zp=a("util").inherits,gl=Dr(),Jp=Ds(),Yp=Buffer.from(`\r
|
|
3
3
|
\r
|
|
4
4
|
`),Xp=/\r\n/g,em=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function St(t){xl.call(this),t=t||{};let e=this;this.nread=0,this.maxed=false,this.npairs=0,this.maxHeaderPairs=gl(t,"maxHeaderPairs",2e3),this.maxHeaderSize=gl(t,"maxHeaderSize",80*1024),this.buffer="",this.header={},this.finished=false,this.ss=new Jp(Yp),this.ss.on("info",function(r,n,s,i){n&&!e.maxed&&(e.nread+i-s>=e.maxHeaderSize?(i=e.maxHeaderSize-e.nread+s,e.nread=e.maxHeaderSize,e.maxed=true):e.nread+=i-s,e.buffer+=n.toString("binary",s,i)),r&&e._finish();});}Zp(St,xl);St.prototype.push=function(t){let e=this.ss.push(t);if(this.finished)return e};St.prototype.reset=function(){this.finished=false,this.buffer="",this.header={},this.ss.reset();};St.prototype._finish=function(){this.buffer&&this._parseHeader(),this.ss.matches=this.ss.maxMatches;let t=this.header;this.header={},this.buffer="",this.finished=true,this.nread=this.npairs=0,this.maxed=false,this.emit("header",t);};St.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs)return;let t=this.buffer.split(Xp),e=t.length,r,n;for(var s=0;s<e;++s){if(t[s].length===0)continue;if((t[s][0]===" "||t[s][0]===" ")&&n){this.header[n][this.header[n].length-1]+=t[s];continue}let i=t[s].indexOf(":");if(i===-1||i===0)return;if(r=em.exec(t[s]),n=r[1].toLowerCase(),this.header[n]=this.header[n]||[],this.header[n].push(r[2]||""),++this.npairs===this.maxHeaderPairs)break}};_l.exports=St;});var Us=c((Bw,El)=>{g();var qs=a("stream").Writable,tm=a("util").inherits,rm=Ds(),Sl=bl(),nm=wl(),sm=45,im=Buffer.from("-"),om=Buffer.from(`\r
|