cognova 0.2.7 → 0.2.9
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{Bb9LNSu_.js → -JdScH3W.js} +1 -1
- package/.output/public/_nuxt/{A5lrd5_j.js → 0EY9Msdx.js} +1 -1
- package/.output/public/_nuxt/{BsXPllgv.js → 1lOC4Si0.js} +1 -1
- package/.output/public/_nuxt/{CeDxLTxX.js → 1zIQX9mh.js} +1 -1
- package/.output/public/_nuxt/{D3V98LVR.js → 4Qy4OdWt.js} +1 -1
- package/.output/public/_nuxt/{MdebRWqA.js → 4nN41Tyd.js} +1 -1
- package/.output/public/_nuxt/{BrICHPil.js → 5MZBbx-H.js} +1 -1
- package/.output/public/_nuxt/{Brqrl-cH.js → 6lIxuL6n.js} +1 -1
- package/.output/public/_nuxt/AUdD1uDD.js +1 -0
- package/.output/public/_nuxt/{B9Kd_0HK.js → B-513wJW.js} +1 -1
- package/.output/public/_nuxt/{CNwGp6eP.js → B1vDCixB.js} +1 -1
- package/.output/public/_nuxt/{deSeNTOh.js → B2MVZlI-.js} +1 -1
- package/.output/public/_nuxt/{CVr40yKH.js → B5JDxHxC.js} +1 -1
- package/.output/public/_nuxt/{CvMqUdkl.js → B63LIwsW.js} +3 -3
- package/.output/public/_nuxt/{C5nfaH9w.js → B6bnHNWY.js} +1 -1
- package/.output/public/_nuxt/{BaJEGr8G.js → B6wYZD_K.js} +1 -1
- package/.output/public/_nuxt/{_16_b82K.js → B8Ou5yh2.js} +1 -1
- package/.output/public/_nuxt/{BaVaTug8.js → BE4Ndhrq.js} +1 -1
- package/.output/public/_nuxt/{CphXSvBo.js → BES6FzF5.js} +1 -1
- package/.output/public/_nuxt/{BmTCDcNm.js → BE_OHTBv.js} +1 -1
- package/.output/public/_nuxt/{CBrXB4hk.js → BJ8jbKuq.js} +1 -1
- package/.output/public/_nuxt/{vM-wdhkZ.js → BNBGEa-U.js} +1 -1
- package/.output/public/_nuxt/{XzRnkkwG.js → BOGXUgGg.js} +1 -1
- package/.output/public/_nuxt/BQ1T6zWA.js +1 -0
- package/.output/public/_nuxt/{Bb1B0ntt.js → BVc_fOF1.js} +1 -1
- package/.output/public/_nuxt/{B-5roYpk.js → BX6vcvkp.js} +1 -1
- package/.output/public/_nuxt/{CLZS246x.js → BYIq3eP8.js} +1 -1
- package/.output/public/_nuxt/{B_28CKij.js → BZqdzrSw.js} +2 -2
- package/.output/public/_nuxt/{D-wVwRIx.js → BaYtugUf.js} +1 -1
- package/.output/public/_nuxt/{EgYyfo1g.js → Be5L93GM.js} +3 -3
- package/.output/public/_nuxt/{BLszW9T3.js → BfECQayu.js} +1 -1
- package/.output/public/_nuxt/{Ci-MVdCd.js → BgG2k-zy.js} +1 -1
- package/.output/public/_nuxt/BhnONkIm.js +1 -0
- package/.output/public/_nuxt/{BjFs8Ujb.js → BjI5wb_q.js} +1 -1
- package/.output/public/_nuxt/{CK5Ef4YR.js → Bk9-HxOg.js} +1 -1
- package/.output/public/_nuxt/{MzEmU9ER.js → BltasKce.js} +1 -1
- package/.output/public/_nuxt/{BvuV9uCn.js → Bp9kHdw6.js} +1 -1
- package/.output/public/_nuxt/{CnW8zyuA.js → Bsdcw5gr.js} +1 -1
- package/.output/public/_nuxt/{Zjvb5YJR.js → BsnhHCOa.js} +1 -1
- package/.output/public/_nuxt/{DMsHLHmB.js → BwJVN9k0.js} +1 -1
- package/.output/public/_nuxt/{CgQKyBSS.js → BwVt3BzR.js} +1 -1
- package/.output/public/_nuxt/{Bc0NIKN7.js → BwdxQyyo.js} +1 -1
- package/.output/public/_nuxt/{CfWDee_q.js → BzTjmQCD.js} +1 -1
- package/.output/public/_nuxt/{RRoc4m9d.js → C1FhgWcI.js} +1 -1
- package/.output/public/_nuxt/{DvgLoqaC.js → C2DZeD9G.js} +1 -1
- package/.output/public/_nuxt/{B43p0So7.js → C3JOLqW1.js} +1 -1
- package/.output/public/_nuxt/{atVSHCxP.js → C4ScCUjy.js} +1 -1
- package/.output/public/_nuxt/{Bn8loaeQ.js → C6HEirAm.js} +1 -1
- package/.output/public/_nuxt/{BLL1JLwq.js → C6UTTaCP.js} +1 -1
- package/.output/public/_nuxt/{DNpsjOxN.js → C8gtQaKB.js} +1 -1
- package/.output/public/_nuxt/{BhOIdu3Z.js → C8tXHRIo.js} +1 -1
- package/.output/public/_nuxt/{DaiWSWdm.js → C8wa4Wh4.js} +1 -1
- package/.output/public/_nuxt/{DZdh7_lh.js → CDradKPE.js} +1 -1
- package/.output/public/_nuxt/{DB3y_21M.js → CEJh-OAl.js} +1 -1
- package/.output/public/_nuxt/CGfVTQUF.js +1 -0
- package/.output/public/_nuxt/{Dx2Tgm6S.js → CGgZuPnb.js} +1 -1
- package/.output/public/_nuxt/{CwaMSU1O.js → CH8kNq6W.js} +1 -1
- package/.output/public/_nuxt/{NlScC3GW.js → CIJ2MJdc.js} +1 -1
- package/.output/public/_nuxt/{CzTTKfet.js → CIUZAp6g.js} +1 -1
- package/.output/public/_nuxt/{CwCEQ4Dw.js → CXBOHJ2W.js} +1 -1
- package/.output/public/_nuxt/{BJ_GgKV0.js → CY3x8iy3.js} +1 -1
- package/.output/public/_nuxt/{ByfSJZV6.js → CaLO8sre.js} +1 -1
- package/.output/public/_nuxt/{jeu3Xx8e.js → CbTu13wM.js} +1 -1
- package/.output/public/_nuxt/{CjYUi9c8.js → CfO_d5gC.js} +1 -1
- package/.output/public/_nuxt/{DpYns7cT.js → Clr3MHUr.js} +1 -1
- package/.output/public/_nuxt/{1Hz98MKF.js → Cmdr5BNz.js} +1 -1
- package/.output/public/_nuxt/{DZ_azKLI.js → Cmj-BR0q.js} +1 -1
- package/.output/public/_nuxt/{CSQ-nblB.js → Cn83lLUb.js} +1 -1
- package/.output/public/_nuxt/{BdCB2PoJ.js → CqMgz85Z.js} +1 -1
- package/.output/public/_nuxt/{Dkzqkzki.js → CrW6y2-s.js} +1 -1
- package/.output/public/_nuxt/{DAs574wU.js → CrjNndEO.js} +1 -1
- package/.output/public/_nuxt/{CB8_A8N4.js → Cs_udj6A.js} +1 -1
- package/.output/public/_nuxt/{qW7F87d8.js → CsbHYpNi.js} +3 -3
- package/.output/public/_nuxt/{DuOsLoVR.js → CwKe2KkK.js} +1 -1
- package/.output/public/_nuxt/{Db5XIfWS.js → CwOUYOe5.js} +1 -1
- package/.output/public/_nuxt/{0J8pJb0Z.js → CybU4a95.js} +1 -1
- package/.output/public/_nuxt/{WWNeb45u.js → CziltI1u.js} +1 -1
- package/.output/public/_nuxt/{DgPiIWA2.js → CzurfTnt.js} +1 -1
- package/.output/public/_nuxt/{DAFasgHH.js → D-O8wAju.js} +1 -1
- package/.output/public/_nuxt/{CJ85o8FK.js → D1t0272g.js} +1 -1
- package/.output/public/_nuxt/D3RROe4s.js +1 -0
- package/.output/public/_nuxt/{Cedv1M65.js → D5G5UL_g.js} +1 -1
- package/.output/public/_nuxt/{1IuG3yiQ.js → D76Dw8rw.js} +1 -1
- package/.output/public/_nuxt/{w3t8WD8v.js → D7DTZ0iS.js} +1 -1
- package/.output/public/_nuxt/{C6Kc4XvS.js → D7WbsJsa.js} +1 -1
- package/.output/public/_nuxt/D7iYVmH6.js +1 -0
- package/.output/public/_nuxt/{CXuKrnTA.js → D8gh62A0.js} +1 -1
- package/.output/public/_nuxt/{CW8xtqwN.js → DA2RowFe.js} +1 -1
- package/.output/public/_nuxt/{4bC1z31I.js → DBKxzQ3U.js} +1 -1
- package/.output/public/_nuxt/DBuW01Fx.js +1 -0
- package/.output/public/_nuxt/{B7-0ADn3.js → DCL9gWFw.js} +1 -1
- package/.output/public/_nuxt/{NBE83ZQn.js → DGJKfutb.js} +1 -1
- package/.output/public/_nuxt/{B5OWqWCh.js → DHScQdvh.js} +1 -1
- package/.output/public/_nuxt/{BTk5mgdf.js → DI1FIvaM.js} +1 -1
- package/.output/public/_nuxt/{0LyRrTRM.js → DJ4pqxg-.js} +1 -1
- package/.output/public/_nuxt/{DImdNj-F.js → DJoRBCVm.js} +1 -1
- package/.output/public/_nuxt/{DfpSaqgV.js → DLuRYg2p.js} +1 -1
- package/.output/public/_nuxt/DMy2sxuC.js +1 -0
- package/.output/public/_nuxt/{BJi2ZHtT.js → DQd-GXKJ.js} +1 -1
- package/.output/public/_nuxt/{CpC3C9gj.js → DSgubznn.js} +1 -1
- package/.output/public/_nuxt/{BZFXnEwe.js → DSynhNOO.js} +1 -1
- package/.output/public/_nuxt/{BsPj3ifk.js → DTrFhdRO.js} +1 -1
- package/.output/public/_nuxt/{BNlugvM3.js → DTu0K_pX.js} +1 -1
- package/.output/public/_nuxt/{DV0JMebZ.js → DUDbJONU.js} +1 -1
- package/.output/public/_nuxt/{C14DGwaT.js → DYu_NYj3.js} +1 -1
- package/.output/public/_nuxt/{Bf34lExB.js → D_tCgCFX.js} +1 -1
- package/.output/public/_nuxt/{pkbwpgSD.js → DdXVAzIg.js} +1 -1
- package/.output/public/_nuxt/DfIqFkyp.js +1 -0
- package/.output/public/_nuxt/{BoPAYize.js → Dj2opPDu.js} +1 -1
- package/.output/public/_nuxt/{Drr-RSSP.js → DjmFlCHK.js} +1 -1
- package/.output/public/_nuxt/{DgKeJf5C.js → DkhxRAb3.js} +1 -1
- package/.output/public/_nuxt/DlSJ4TF_.js +1 -0
- package/.output/public/_nuxt/{S4a_N6rD.js → DmmQUhEb.js} +1 -1
- package/.output/public/_nuxt/{CG0fS-BQ.js → DvATBMPl.js} +1 -1
- package/.output/public/_nuxt/{CxJr4mB0.js → DwAJIRGg.js} +1 -1
- package/.output/public/_nuxt/{CjRmY2OQ.js → FYOLNuMV.js} +1 -1
- package/.output/public/_nuxt/Gy6_ehml.js +1 -0
- package/.output/public/_nuxt/{zBoPDS4z.js → HPOXd4gt.js} +1 -1
- package/.output/public/_nuxt/{HCCuOAgZ.js → HlbU_z9a.js} +1 -1
- package/.output/public/_nuxt/{DsKy-gee.js → JQV21WEV.js} +1 -1
- package/.output/public/_nuxt/{JJIcQEna.js → NusIKwmA.js} +1 -1
- package/.output/public/_nuxt/{HC3657Xq.js → OrcbFmB1.js} +1 -1
- package/.output/public/_nuxt/{fTEmwfo4.js → Oy4_RPEZ.js} +1 -1
- package/.output/public/_nuxt/{Dpp5cOwJ.js → Pa936BQP.js} +1 -1
- package/.output/public/_nuxt/PzQHm02e.js +1 -0
- package/.output/public/_nuxt/{Dysa6np_.js → REP2-rzf.js} +1 -1
- package/.output/public/_nuxt/{-2wkydbj.js → RRbnMIVe.js} +1 -1
- package/.output/public/_nuxt/{CzqLfT8k.js → TGVM5w2K.js} +1 -1
- package/.output/public/_nuxt/UbZP7wjm.js +1 -0
- package/.output/public/_nuxt/{BW-E-Sar.js → XJYoLoTi.js} +1 -1
- package/.output/public/_nuxt/{CrjKigv8.js → a9_LvIZ4.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/613faa5d-8ace-45e0-8274-b611cc4fd1ad.json +1 -0
- package/.output/public/_nuxt/entry.DkvuF_CR.css +1 -0
- package/.output/public/_nuxt/{CwJR22-0.js → fVkHtgGF.js} +1 -1
- package/.output/public/_nuxt/{sdvIKLwS.js → hm3ShyaF.js} +1 -1
- package/.output/public/_nuxt/{CqiOV9n1.js → k16puyWi.js} +1 -1
- package/.output/public/_nuxt/{B8Kve-DH.js → myNwwtfj.js} +1 -1
- package/.output/public/_nuxt/{DxR8g9So.js → nTCVPCKg.js} +1 -1
- package/.output/public/_nuxt/{DytaiikM.js → pHQcHl8n.js} +1 -1
- package/.output/public/_nuxt/{Cebw7Q7c.js → pNqWPbXW.js} +1 -1
- package/.output/public/_nuxt/{Cow1TrPj.js → qWWnsfRV.js} +1 -1
- package/.output/public/_nuxt/{DCco_rlV.js → rRYEvKFu.js} +1 -1
- package/.output/public/_nuxt/{hqpqUuXS.js → svWfwR0T.js} +1 -1
- package/.output/public/_nuxt/{BMLwzSDu.js → wgX1ldgZ.js} +1 -1
- package/.output/public/_nuxt/{CEfkp9Rl.js → xrh9hzzH.js} +2 -2
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/server.mjs +1 -1
- package/.output/server/chunks/build/{settings-DuT6LGJZ.mjs → settings-B2KXoGcz.mjs} +1679 -203
- package/.output/server/chunks/build/settings-B2KXoGcz.mjs.map +1 -0
- package/.output/server/chunks/build/styles.mjs +4 -4
- package/.output/server/chunks/nitro/nitro.mjs +922 -866
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/app/pages/settings.vue +581 -6
- package/package.json +1 -1
- package/server/api/skills/import.post.ts +1 -1
- package/server/bridge/adapters/telegram.ts +84 -9
- package/.output/public/_nuxt/B-YQztaH.js +0 -1
- package/.output/public/_nuxt/B1gFtqXK.js +0 -1
- package/.output/public/_nuxt/BTfZ7nek.js +0 -1
- package/.output/public/_nuxt/BbPnqQJ0.js +0 -1
- package/.output/public/_nuxt/BhSWIRpp.js +0 -1
- package/.output/public/_nuxt/By6kmkhJ.js +0 -1
- package/.output/public/_nuxt/C4XVJnNJ.js +0 -1
- package/.output/public/_nuxt/CkvyAKbu.js +0 -1
- package/.output/public/_nuxt/D2f7BlK2.js +0 -1
- package/.output/public/_nuxt/D2lmhTjQ.js +0 -1
- package/.output/public/_nuxt/D64-rCSQ.js +0 -1
- package/.output/public/_nuxt/DGP2JJt8.js +0 -1
- package/.output/public/_nuxt/builds/meta/9863fe43-d78c-4b29-a1e8-e6de61119507.json +0 -1
- package/.output/public/_nuxt/entry._7ZkP07A.css +0 -1
- package/.output/public/_nuxt/f7zDjk6q.js +0 -1
- package/.output/server/chunks/build/settings-DuT6LGJZ.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bp as N,c as L,bq as P,e as E,Z as R,f as M,a7 as x,aT as U,br as C,be as q,k as D,a2 as I,a5 as H,bs as $,a as Y,a_ as j,ah as X,y as _,Q as z,R as G,S as Q,a4 as V,C as Z,a3 as J,bt as b,a0 as A,bu as F,bv as ee,bw as te,bx as k,by as B,bz as ne}from"./
|
|
1
|
+
import{bp as N,c as L,bq as P,e as E,Z as R,f as M,a7 as x,aT as U,br as C,be as q,k as D,a2 as I,a5 as H,bs as $,a as Y,a_ as j,ah as X,y as _,Q as z,R as G,S as Q,a4 as V,C as Z,a3 as J,bt as b,a0 as A,bu as F,bv as ee,bw as te,bx as k,by as B,bz as ne}from"./B63LIwsW.js";const ae=N(()=>{const e=E(new Map),t=E(),n=L(()=>{for(const v of e.value.values())if(v)return!0;return!1}),o=R({scrollBody:E(!0)});let c=null;const p=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",C&&c?.(),t.value=void 0};return M(n,(v,m)=>{if(!x)return;if(!v){m&&p();return}t.value===void 0&&(t.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,h={padding:l,margin:0},r=o.scrollBody?.value?typeof o.scrollBody.value=="object"?U({padding:o.scrollBody.value.padding===!0?l:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?l:o.scrollBody.value.margin},h):h:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof r.padding=="number"?`${r.padding}px`:String(r.padding),document.body.style.marginRight=typeof r.margin=="number"?`${r.margin}px`:String(r.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),C&&(c=q(document,"touchmove",a=>re(a),{passive:!1})),D(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function pe(e){const t=Math.random().toString(36).substring(2,7),n=ae();n.value.set(t,e??!1);const o=L({get:()=>n.value.get(t)??!1,set:c=>n.value.set(t,c)});return P(()=>{n.value.delete(t)}),o}function W(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:W(n)}}function re(e){const t=e||window.event,n=t.target;return n instanceof Element&&W(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}var oe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},g=new WeakMap,w=new WeakMap,S={},O=0,K=function(e){return e&&(e.host||K(e.parentNode))},se=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=K(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ue=function(e,t,n,o){var c=se(t,Array.isArray(e)?e:[e]);S[n]||(S[n]=new WeakMap);var p=S[n],v=[],m=new Set,l=new Set(c),h=function(a){!a||m.has(a)||(m.add(a),h(a.parentNode))};c.forEach(h);var r=function(a){!a||l.has(a)||Array.prototype.forEach.call(a.children,function(s){if(m.has(s))r(s);else try{var d=s.getAttribute(o),u=d!==null&&d!=="false",i=(g.get(s)||0)+1,f=(p.get(s)||0)+1;g.set(s,i),p.set(s,f),v.push(s),i===1&&u&&w.set(s,!0),f===1&&s.setAttribute(n,"true"),u||s.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",s,y)}})};return r(t),m.clear(),O++,function(){v.forEach(function(a){var s=g.get(a)-1,d=p.get(a)-1;g.set(a,s),p.set(a,d),s||(w.has(a)||a.removeAttribute(o),w.delete(a)),d||a.removeAttribute(n)}),O--,O||(g=new WeakMap,g=new WeakMap,w=new WeakMap,S={})}},ie=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),c=oe(e);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),ue(o,c,n,"aria-hidden")):function(){return null}};function me(e){let t;M(()=>H(e),n=>{n?t=ie(n):t&&t()}),I(()=>{t&&t()})}const ce=$(()=>E([]));function le(){const e=ce();return{add(t){const n=e.value[0];t!==n&&n?.pause(),e.value=T(e.value,t),e.value.unshift(t)},remove(t){e.value=T(e.value,t),e.value[0]?.resume()}}}function T(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function de(e){return e.filter(t=>t.tagName!=="A")}var fe=Y({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const n=e,o=t,{currentRef:c,currentElement:p}=j(),v=E(null),m=le(),l=X({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});_(r=>{if(!x)return;const a=p.value;if(!n.trapped)return;function s(f){if(l.paused||!a)return;const y=f.target;a.contains(y)?v.value=y:b(v.value,{select:!0})}function d(f){if(l.paused||!a)return;const y=f.relatedTarget;y!==null&&(a.contains(y)||b(v.value,{select:!0}))}function u(f){a.contains(v.value)||b(a)}document.addEventListener("focusin",s),document.addEventListener("focusout",d);const i=new MutationObserver(u);a&&i.observe(a,{childList:!0,subtree:!0}),r(()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",d),i.disconnect()})}),_(async r=>{const a=p.value;if(await D(),!a)return;m.add(l);const s=A();if(!a.contains(s)){const u=new CustomEvent(F,B);a.addEventListener(F,i=>o("mountAutoFocus",i)),a.dispatchEvent(u),u.defaultPrevented||(ee(de(te(a)),{select:!0}),A()===s&&b(a))}r(()=>{a.removeEventListener(F,f=>o("mountAutoFocus",f));const u=new CustomEvent(k,B),i=f=>{o("unmountAutoFocus",f)};a.addEventListener(k,i),a.dispatchEvent(u),setTimeout(()=>{u.defaultPrevented||b(s??document.body,{select:!0}),a.removeEventListener(k,i),m.remove(l)},0)})});function h(r){if(!n.loop&&!n.trapped||l.paused)return;const a=r.key==="Tab"&&!r.altKey&&!r.ctrlKey&&!r.metaKey,s=A();if(a&&s){const d=r.currentTarget,[u,i]=ne(d);u&&i?!r.shiftKey&&s===i?(r.preventDefault(),n.loop&&b(u,{select:!0})):r.shiftKey&&s===u&&(r.preventDefault(),n.loop&&b(i,{select:!0})):s===d&&r.preventDefault()}}return(r,a)=>(G(),z(Z(J),{ref_key:"currentRef",ref:c,tabindex:"-1","as-child":r.asChild,as:r.as,onKeydown:h},{default:Q(()=>[V(r.$slots,"default")]),_:3},8,["as-child","as"]))}}),ye=fe;export{ye as F,pe as a,me as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x,Q as g,S as a,R as l,ab as o,G as C,a9 as b,T as c,_ as h,ae as n,aa as d,W as y}from"./
|
|
1
|
+
import{a as x,Q as g,S as a,R as l,ab as o,G as C,a9 as b,T as c,_ as h,ae as n,aa as d,W as y}from"./B63LIwsW.js";import{_ as k}from"./DdXVAzIg.js";const v={class:"p-6"},B={class:"flex items-start gap-4"},L={key:0,class:"shrink-0 p-2 rounded-full bg-error/10"},N={class:"flex-1 min-w-0"},U={class:"text-lg font-semibold text-default"},V={class:"mt-2 text-sm text-muted"},w={class:"mt-6 flex justify-end gap-3"},M=x({__name:"ConfirmModal",props:{open:{type:Boolean},title:{default:"Confirm Action"},description:{default:"Are you sure you want to proceed?"},confirmLabel:{default:"Confirm"},cancelLabel:{default:"Cancel"},confirmColor:{default:"primary"},icon:{default:void 0},loading:{type:Boolean,default:!1}},emits:["update:open","confirm","cancel"],setup(e,{emit:r}){const t=r;function m(){t("update:open",!1),t("cancel")}function f(){t("confirm")}return($,s)=>{const u=h,i=y,_=k;return l(),g(_,{open:e.open,"onUpdate:open":s[0]||(s[0]=p=>t("update:open",p))},{content:a(()=>[o("div",v,[o("div",B,[e.icon?(l(),C("div",L,[c(u,{name:e.icon,class:"size-6 text-error"},null,8,["name"])])):b("",!0),o("div",N,[o("h3",U,n(e.title),1),o("p",V,n(e.description),1)])]),o("div",w,[c(i,{color:"neutral",variant:"ghost",disabled:e.loading,onClick:m},{default:a(()=>[d(n(e.cancelLabel),1)]),_:1},8,["disabled"]),c(i,{color:e.confirmColor,loading:e.loading,onClick:f},{default:a(()=>[d(n(e.confirmLabel),1)]),_:1},8,["color","loading"])])])]),_:1},8,["open"])}}}),S=Object.assign(M,{__name:"ConfirmModal"});export{S as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Z,aq as Tt,ar as Ft,Q as y,S as u,R as s,ab as e,T as i,aa as v,W as tt,G as p,a9 as x,ae as c,_ as et,bg as Bt,am as Et,ag as Nt,c as j,bl as jt,aD as Lt,e as $,f as Ot,q as zt,ak as H,C as n,ai as L,aj as Y}from"./CvMqUdkl.js";import{_ as nt}from"./Zjvb5YJR.js";import{_ as It}from"./CB8_A8N4.js";import{_ as Vt}from"./D-wVwRIx.js";import{_ as qt,a as Gt}from"./1Hz98MKF.js";import{_ as Wt}from"./CBrXB4hk.js";import{_ as Ht}from"./CwaMSU1O.js";import{_ as Jt}from"./B8Kve-DH.js";import{u as Pt,_ as Qt,a as Kt,b as Xt}from"./MzEmU9ER.js";import{c as Yt}from"./Bb1B0ntt.js";import{_ as Zt}from"./NlScC3GW.js";import{_ as ot}from"./pkbwpgSD.js";import{u as te}from"./DpYns7cT.js";import{u as ee}from"./BvuV9uCn.js";import"./S4a_N6rD.js";import"./B1gFtqXK.js";import"./CxJr4mB0.js";import"./sdvIKLwS.js";import"./HCCuOAgZ.js";import"./Cow1TrPj.js";import"./C8ut0f5H.js";import"./CqkleIqs.js";import"./B-5roYpk.js";import"./DlAUqK2U.js";import"./BaJEGr8G.js";import"./MdebRWqA.js";import"./Bn8loaeQ.js";import"./DImdNj-F.js";import"./BJi2ZHtT.js";import"./CXuKrnTA.js";import"./Dkzqkzki.js";import"./D3V98LVR.js";import"./D2lmhTjQ.js";import"./Db5XIfWS.js";import"./w3t8WD8v.js";import"./zBoPDS4z.js";import"./DfpSaqgV.js";import"./C6Y-ieo6.js";import"./WWNeb45u.js";import"./deSeNTOh.js";import"./CW8xtqwN.js";import"./Vcq4gwWv.js";import"./CJ85o8FK.js";import"./BJ_GgKV0.js";import"./D2f7BlK2.js";import"./B7-0ADn3.js";const ne={key:0,class:"p-4 space-y-4"},oe={class:"flex flex-wrap items-center gap-4"},se={class:"text-sm text-muted"},ae={key:0,class:"text-sm text-muted"},re={class:"grid grid-cols-2 sm:grid-cols-4 gap-4 p-4 rounded-lg bg-muted/5"},ie={class:"font-medium"},le={class:"font-medium"},ue={class:"font-medium"},ce={class:"font-medium"},de={key:0,class:"p-4 rounded-lg bg-error-500/10 border border-error-500/20"},me={class:"text-sm text-error-400 whitespace-pre-wrap font-mono overflow-x-auto"},pe={key:1},fe={class:"max-h-96 overflow-auto rounded-lg bg-muted/5 border border-default"},ge={class:"p-4 text-sm whitespace-pre-wrap font-mono"},_e={key:2,class:"text-center text-muted py-8"},ve={key:1,class:"p-4 text-center text-muted"},xe={class:"flex justify-end"},ye=Z({__name:"AgentRunModal",props:Tt({run:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(d){const k=Ft(d,"open");function U(m){return m?m<1e3?`${m}ms`:m<6e4?`${(m/1e3).toFixed(1)}s`:`${(m/6e4).toFixed(1)}m`:"-"}function D(m){return m?new Date(m).toLocaleString():"-"}function S(m){switch(m){case"success":return"success";case"error":return"error";case"budget_exceeded":return"warning";case"running":return"info";case"cancelled":return"neutral";default:return"neutral"}}return(m,l)=>{const O=nt,z=et,I=tt,V=ot;return s(),y(V,{open:k.value,"onUpdate:open":l[1]||(l[1]=M=>k.value=M),title:(d.run,"Run Details"),ui:{content:"sm:max-w-3xl"}},{content:u(()=>[d.run?(s(),p("div",ne,[e("div",oe,[i(O,{color:S(d.run.status),size:"lg"},{default:u(()=>[v(c(d.run.status),1)]),_:1},8,["color"]),e("span",se," Started: "+c(D(d.run.startedAt)),1),d.run.completedAt?(s(),p("span",ae," Completed: "+c(D(d.run.completedAt)),1)):x("",!0)]),e("div",re,[e("div",null,[l[2]||(l[2]=e("p",{class:"text-xs text-muted uppercase"}," Duration ",-1)),e("p",ie,c(U(d.run.durationMs)),1)]),e("div",null,[l[3]||(l[3]=e("p",{class:"text-xs text-muted uppercase"}," Cost ",-1)),e("p",le,c(d.run.costUsd?`$${d.run.costUsd.toFixed(4)}`:"-"),1)]),e("div",null,[l[4]||(l[4]=e("p",{class:"text-xs text-muted uppercase"}," Input Tokens ",-1)),e("p",ue,c(d.run.inputTokens?.toLocaleString()||"-"),1)]),e("div",null,[l[5]||(l[5]=e("p",{class:"text-xs text-muted uppercase"}," Output Tokens ",-1)),e("p",ce,c(d.run.outputTokens?.toLocaleString()||"-"),1)])]),d.run.error?(s(),p("div",de,[l[6]||(l[6]=e("p",{class:"text-sm font-medium text-error-500 mb-2"}," Error ",-1)),e("pre",me,c(d.run.error),1)])):x("",!0),d.run.output?(s(),p("div",pe,[l[7]||(l[7]=e("p",{class:"text-sm font-medium mb-2"}," Output ",-1)),e("div",fe,[e("pre",ge,c(d.run.output),1)])])):x("",!0),!d.run.output&&!d.run.error&&d.run.status==="running"?(s(),p("div",_e,[i(z,{name:"i-lucide-loader-2",class:"size-8 animate-spin mb-2"}),l[8]||(l[8]=e("p",null,"Agent is currently running...",-1))])):x("",!0)])):(s(),p("div",ve," No run selected "))]),footer:u(()=>[e("div",xe,[i(I,{color:"neutral",variant:"ghost",onClick:l[0]||(l[0]=M=>k.value=!1)},{default:u(()=>[...l[9]||(l[9]=[v(" Close ",-1)])]),_:1})])]),_:1},8,["open","title"])}}}),he=Object.assign(ye,{__name:"AgentsAgentRunModal"}),$e=Yt(Xt),ke={class:"contents"},be={class:"flex items-center gap-3"},we={class:"font-semibold text-lg truncate"},Ae={key:0,class:"flex items-center justify-center h-64"},Ce={key:1,class:"p-4 space-y-6"},Re={class:"space-y-3"},Ue={key:0},De={class:"flex flex-wrap gap-6"},Se={class:"flex items-center gap-2"},Me={class:"text-sm text-muted"},Te={key:0},Fe={class:"flex items-center gap-2"},Be={key:1},Ee={class:"flex items-center gap-2"},Ne={class:"space-y-4"},je={key:0,class:"flex items-center justify-center h-32"},Le={key:1,class:"flex flex-col items-center justify-center h-32 text-neutral-500"},Oe={key:2,class:"space-y-2"},ze={class:"flex items-start justify-between gap-4"},Ie={class:"flex-1 min-w-0"},Ve={class:"flex items-center gap-2 mb-1"},qe={class:"text-sm text-muted"},Ge={class:"text-sm text-muted truncate"},We={class:"text-right text-sm text-muted shrink-0"},He={key:0},Je={class:"p-4 space-y-4"},Pe={class:"flex items-center gap-3"},Qe={class:"p-2 rounded-full bg-error-500/10"},Ke={class:"text-sm text-muted"},Xe={class:"flex justify-end gap-2"},Wn=Z({__name:"[id]",async setup(d){let k,U;const D=Bt(),S=Et(),m=Nt(),{fetchAgentStats:l,fetchRuns:O,updateAgent:z,deleteAgent:I,toggleEnabled:V,runAgent:M,cancelAgent:st}=Pt(),{isAgentRunning:at}=te(),T=j(()=>D.params.id),{data:rt,status:it,error:q,refresh:J}=([k,U]=jt(()=>ee(()=>`/api/agents/${T.value}`,{key:`agent-${T.value}`},"$aMAiG7xhIp")),k=await k,U(),k),a=j(()=>rt.value?.data??null),lt=j(()=>it.value==="pending");if(q.value)throw Lt({statusCode:q.value.statusCode||404,message:q.value.message||"Agent not found"});const C=$(null),F=$([]),G=$(!1),W=$(!1),P=j(()=>a.value?at(a.value.id)?!0:F.value.some(o=>o.status==="running"):!1),w=$("7d"),ut=[{label:"24h",value:"24h"},{label:"7d",value:"7d"},{label:"30d",value:"30d"}],A=$(!1),R=$(!1),Q=$(null),B=$(!1);function ct(o){const t=o.split(" ");if(t.length!==5)return o;const g=t[0],f=t[1],_=t[2],h=t[3],b=t[4];return g==="0"&&f==="*"&&_==="*"&&h==="*"&&b==="*"?"Every hour":g==="*/5"&&f==="*"&&_==="*"&&h==="*"&&b==="*"?"Every 5 minutes":_==="*"&&h==="*"&&b==="*"&&f!=="*"?`Daily at ${f}:${g.padStart(2,"0")}`:b==="0"&&_==="*"&&h==="*"?`Weekly on Sunday at ${f}:${g.padStart(2,"0")}`:o}function dt(o){if(!o)return"Never";const t=new Date(o),f=new Date().getTime()-t.getTime(),_=Math.floor(f/6e4),h=Math.floor(f/36e5),b=Math.floor(f/864e5);return _<1?"Just now":_<60?`${_}m ago`:h<24?`${h}h ago`:`${b}d ago`}function mt(o){return o?o<1e3?`${o}ms`:o<6e4?`${(o/1e3).toFixed(1)}s`:`${(o/6e4).toFixed(1)}m`:"-"}function pt(o){return o?new Date(o).toLocaleString():"-"}function ft(o){switch(o){case"success":return"success";case"error":return"error";case"budget_exceeded":return"warning";case"running":return"info";case"cancelled":return"neutral";default:return"neutral"}}async function E(){G.value=!0;try{C.value=await l(T.value,w.value)}catch{}finally{G.value=!1}}async function N(){W.value=!0;try{F.value=await O(T.value,w.value)}catch{}finally{W.value=!1}}async function gt(){if(a.value)try{await V(a.value.id),await J()}catch{m.add({title:"Failed to toggle agent",color:"error",icon:"i-lucide-alert-circle"})}}async function _t(){if(a.value)try{await M(a.value.id),setTimeout(N,1e3)}catch{m.add({title:"Failed to run agent",color:"error",icon:"i-lucide-alert-circle"})}}async function vt(){if(a.value)try{await st(a.value.id),m.add({title:"Agent cancelled",color:"warning",icon:"i-lucide-x-circle"}),setTimeout(()=>{N(),E()},1e3)}catch{m.add({title:"Failed to cancel agent",description:"No running execution found",color:"error",icon:"i-lucide-alert-circle"})}}async function xt(o){if(a.value)try{await z(a.value.id,o),m.add({title:"Agent updated",color:"success",icon:"i-lucide-check"}),A.value=!1,J(),E()}catch(t){m.add({title:"Failed to update agent",description:t instanceof Error?t.message:"An unexpected error occurred",color:"error",icon:"i-lucide-alert-circle"})}}async function yt(){if(a.value)try{await I(a.value.id),m.add({title:"Agent deleted",color:"success",icon:"i-lucide-check"}),S.push("/agents")}catch{m.add({title:"Failed to delete agent",color:"error",icon:"i-lucide-alert-circle"})}}function ht(o){Q.value=o,B.value=!0}function K(o,t=100){return o?o.length<=t?o:o.substring(0,t)+"...":"-"}return Ot(w,()=>{E(),N()}),zt(()=>{E(),N()}),(o,t)=>{const g=tt,f=et,_=nt,h=It,b=Vt,$t=Gt,kt=Wt,bt=Ht,X=Jt,wt=Qt,At=$e,Ct=qt,Rt=Kt,Ut=Zt,Dt=ot,St=he;return s(),p("div",ke,[i(Ct,{id:"agent-detail",grow:""},{header:u(()=>[i($t,null,{left:u(()=>[e("div",be,[i(g,{icon:"i-lucide-arrow-left",variant:"ghost",size:"sm",onClick:t[0]||(t[0]=r=>n(S).push("/agents"))}),n(a)?(s(),p(L,{key:0},[e("h1",we,c(n(a).name),1),n(P)?(s(),y(_,{key:0,color:"info",variant:"subtle"},{default:u(()=>[i(f,{name:"i-lucide-loader-2",class:"w-3 h-3 animate-spin mr-1"}),t[8]||(t[8]=v(" Running ",-1))]),_:1})):n(a).enabled?x("",!0):(s(),y(_,{key:1,color:"neutral",variant:"subtle"},{default:u(()=>[...t[9]||(t[9]=[v(" Disabled ",-1)])]),_:1}))],64)):(s(),y(h,{key:1,class:"h-6 w-32"}))])]),right:u(()=>[n(a)?(s(),p(L,{key:0},[i(b,{"model-value":n(a).enabled,"onUpdate:modelValue":gt},null,8,["model-value"]),n(P)?(s(),y(g,{key:0,icon:"i-lucide-square",variant:"ghost",color:"error",onClick:vt})):(s(),y(g,{key:1,icon:"i-lucide-play",variant:"ghost",disabled:!n(a).enabled,onClick:_t},null,8,["disabled"])),i(g,{icon:"i-lucide-pencil",variant:"ghost",onClick:t[1]||(t[1]=r=>A.value=!0)}),i(g,{icon:"i-lucide-trash-2",variant:"ghost",color:"error",onClick:t[2]||(t[2]=r=>R.value=!0)})],64)):x("",!0)]),_:1}),i(bt,null,{left:u(()=>[i(kt,null,{default:u(()=>[(s(),p(L,null,Y(ut,r=>i(g,{key:r.value,color:n(w)===r.value?"primary":"neutral",variant:n(w)===r.value?"solid":"ghost",size:"sm",onClick:Mt=>w.value=r.value},{default:u(()=>[v(c(r.label),1)]),_:2},1032,["color","variant","onClick"])),64))]),_:1})]),_:1})]),body:u(()=>[n(lt)?(s(),p("div",Ae,[i(f,{name:"i-lucide-loader-2",class:"w-8 h-8 animate-spin text-neutral-400"})])):n(a)?(s(),p("div",Ce,[i(X,null,{default:u(()=>[e("div",Re,[n(a).description?(s(),p("div",Ue,[t[10]||(t[10]=e("p",{class:"text-sm text-muted uppercase mb-1"}," Description ",-1)),e("p",null,c(n(a).description),1)])):x("",!0),e("div",De,[e("div",null,[t[11]||(t[11]=e("p",{class:"text-sm text-muted uppercase mb-1"}," Schedule ",-1)),e("p",Se,[i(f,{name:"i-lucide-clock"}),v(" "+c(ct(n(a).schedule))+" ",1),e("span",Me,"("+c(n(a).schedule)+")",1)])]),n(a).maxBudgetUsd?(s(),p("div",Te,[t[12]||(t[12]=e("p",{class:"text-sm text-muted uppercase mb-1"}," Budget Limit ",-1)),e("p",Fe,[i(f,{name:"i-lucide-dollar-sign"}),v(" $"+c(n(a).maxBudgetUsd)+" per run ",1)])])):x("",!0),n(a).lastRunAt?(s(),p("div",Be,[t[13]||(t[13]=e("p",{class:"text-sm text-muted uppercase mb-1"}," Last Run ",-1)),e("p",Ee,[i(f,{name:"i-lucide-activity"}),v(" "+c(dt(n(a).lastRunAt)),1)])])):x("",!0)])])]),_:1}),i(wt,{stats:n(C),loading:n(G),variant:"detail"},null,8,["stats","loading"]),n(C)&&n(C).dailyRuns.length>0?(s(),y(At,{key:0,data:n(C).dailyRuns,title:"Run Activity"},null,8,["data"])):x("",!0),e("div",Ne,[t[16]||(t[16]=e("h2",{class:"text-lg font-semibold"}," Run History ",-1)),n(W)?(s(),p("div",je,[i(f,{name:"i-lucide-loader-2",class:"w-6 h-6 animate-spin text-neutral-400"})])):n(F).length===0?(s(),p("div",Le,[i(f,{name:"i-lucide-history",class:"w-8 h-8 mb-2"}),t[14]||(t[14]=e("p",null,"No runs yet",-1))])):(s(),p("div",Oe,[(s(!0),p(L,null,Y(n(F),r=>(s(),y(X,{key:r.id,class:"cursor-pointer transition-all hover:ring-2 hover:ring-primary/50",onClick:Mt=>ht(r)},{default:u(()=>[e("div",ze,[e("div",Ie,[e("div",Ve,[r.status==="running"?(s(),y(_,{key:0,color:"info",variant:"subtle",size:"sm"},{default:u(()=>[i(f,{name:"i-lucide-loader-2",class:"w-3 h-3 animate-spin mr-1"}),t[15]||(t[15]=v(" Running ",-1))]),_:1})):(s(),y(_,{key:1,color:ft(r.status),size:"sm"},{default:u(()=>[v(c(r.status),1)]),_:2},1032,["color"])),e("span",qe,c(pt(r.startedAt)),1)]),e("p",Ge,c(r.error?K(r.error):K(r.output)),1)]),e("div",We,[e("p",null,c(mt(r.durationMs)),1),r.costUsd?(s(),p("p",He," $"+c(r.costUsd.toFixed(4)),1)):x("",!0)])])]),_:2},1032,["onClick"]))),128))]))])])):x("",!0)]),_:1}),i(Ut,{open:n(A),"onUpdate:open":t[4]||(t[4]=r=>H(A)?A.value=r:null)},{title:u(()=>[...t[17]||(t[17]=[v(" Edit Agent ",-1)])]),body:u(()=>[i(Rt,{agent:n(a),onSubmit:xt,onCancel:t[3]||(t[3]=r=>A.value=!1)},null,8,["agent"])]),_:1},8,["open"]),i(Dt,{open:n(R),"onUpdate:open":t[6]||(t[6]=r=>H(R)?R.value=r:null)},{content:u(()=>[e("div",Je,[e("div",Pe,[e("div",Qe,[i(f,{name:"i-lucide-alert-triangle",class:"w-6 h-6 text-error-500"})]),e("div",null,[t[18]||(t[18]=e("h3",{class:"font-semibold"}," Delete Agent ",-1)),e("p",Ke,' Are you sure you want to delete "'+c(n(a)?.name)+'"? This action cannot be undone. ',1)])])])]),footer:u(()=>[e("div",Xe,[i(g,{color:"neutral",variant:"ghost",onClick:t[5]||(t[5]=r=>R.value=!1)},{default:u(()=>[...t[19]||(t[19]=[v(" Cancel ",-1)])]),_:1}),i(g,{color:"error",onClick:yt},{default:u(()=>[...t[20]||(t[20]=[v(" Delete ",-1)])]),_:1})])]),_:1},8,["open"]),i(St,{open:n(B),"onUpdate:open":t[7]||(t[7]=r=>H(B)?B.value=r:null),run:n(Q)},null,8,["open","run"])])}}});export{Wn as default};
|
|
1
|
+
import{a as Z,aq as Tt,ar as Ft,Q as y,S as u,R as s,ab as e,T as i,aa as v,W as tt,G as p,a9 as x,ae as c,_ as et,bg as Bt,an as Et,ag as Nt,c as j,bl as jt,aD as Lt,e as $,f as Ot,q as zt,ai as H,C as n,aj as L,ak as Y}from"./B63LIwsW.js";import{_ as nt}from"./BsnhHCOa.js";import{_ as It}from"./Cs_udj6A.js";import{_ as Vt}from"./BaYtugUf.js";import{_ as qt,a as Gt}from"./Cmdr5BNz.js";import{_ as Wt}from"./BJ8jbKuq.js";import{_ as Ht}from"./CH8kNq6W.js";import{_ as Jt}from"./myNwwtfj.js";import{u as Pt,_ as Qt,a as Kt,b as Xt}from"./BltasKce.js";import{c as Yt}from"./BVc_fOF1.js";import{_ as Zt}from"./CIJ2MJdc.js";import{_ as ot}from"./DdXVAzIg.js";import{u as te}from"./Clr3MHUr.js";import{u as ee}from"./Bp9kHdw6.js";import"./DmmQUhEb.js";import"./DMy2sxuC.js";import"./DwAJIRGg.js";import"./hm3ShyaF.js";import"./HlbU_z9a.js";import"./qWWnsfRV.js";import"./C8ut0f5H.js";import"./CqkleIqs.js";import"./BX6vcvkp.js";import"./DlAUqK2U.js";import"./B6wYZD_K.js";import"./4nN41Tyd.js";import"./C6HEirAm.js";import"./DJoRBCVm.js";import"./DQd-GXKJ.js";import"./D8gh62A0.js";import"./CrW6y2-s.js";import"./4Qy4OdWt.js";import"./DlSJ4TF_.js";import"./CwOUYOe5.js";import"./D7DTZ0iS.js";import"./HPOXd4gt.js";import"./DLuRYg2p.js";import"./C6Y-ieo6.js";import"./CziltI1u.js";import"./B2MVZlI-.js";import"./DA2RowFe.js";import"./Vcq4gwWv.js";import"./D1t0272g.js";import"./CY3x8iy3.js";import"./AUdD1uDD.js";import"./DCL9gWFw.js";const ne={key:0,class:"p-4 space-y-4"},oe={class:"flex flex-wrap items-center gap-4"},se={class:"text-sm text-muted"},ae={key:0,class:"text-sm text-muted"},re={class:"grid grid-cols-2 sm:grid-cols-4 gap-4 p-4 rounded-lg bg-muted/5"},ie={class:"font-medium"},le={class:"font-medium"},ue={class:"font-medium"},ce={class:"font-medium"},de={key:0,class:"p-4 rounded-lg bg-error-500/10 border border-error-500/20"},me={class:"text-sm text-error-400 whitespace-pre-wrap font-mono overflow-x-auto"},pe={key:1},fe={class:"max-h-96 overflow-auto rounded-lg bg-muted/5 border border-default"},ge={class:"p-4 text-sm whitespace-pre-wrap font-mono"},_e={key:2,class:"text-center text-muted py-8"},ve={key:1,class:"p-4 text-center text-muted"},xe={class:"flex justify-end"},ye=Z({__name:"AgentRunModal",props:Tt({run:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(d){const k=Ft(d,"open");function U(m){return m?m<1e3?`${m}ms`:m<6e4?`${(m/1e3).toFixed(1)}s`:`${(m/6e4).toFixed(1)}m`:"-"}function D(m){return m?new Date(m).toLocaleString():"-"}function S(m){switch(m){case"success":return"success";case"error":return"error";case"budget_exceeded":return"warning";case"running":return"info";case"cancelled":return"neutral";default:return"neutral"}}return(m,l)=>{const O=nt,z=et,I=tt,V=ot;return s(),y(V,{open:k.value,"onUpdate:open":l[1]||(l[1]=M=>k.value=M),title:(d.run,"Run Details"),ui:{content:"sm:max-w-3xl"}},{content:u(()=>[d.run?(s(),p("div",ne,[e("div",oe,[i(O,{color:S(d.run.status),size:"lg"},{default:u(()=>[v(c(d.run.status),1)]),_:1},8,["color"]),e("span",se," Started: "+c(D(d.run.startedAt)),1),d.run.completedAt?(s(),p("span",ae," Completed: "+c(D(d.run.completedAt)),1)):x("",!0)]),e("div",re,[e("div",null,[l[2]||(l[2]=e("p",{class:"text-xs text-muted uppercase"}," Duration ",-1)),e("p",ie,c(U(d.run.durationMs)),1)]),e("div",null,[l[3]||(l[3]=e("p",{class:"text-xs text-muted uppercase"}," Cost ",-1)),e("p",le,c(d.run.costUsd?`$${d.run.costUsd.toFixed(4)}`:"-"),1)]),e("div",null,[l[4]||(l[4]=e("p",{class:"text-xs text-muted uppercase"}," Input Tokens ",-1)),e("p",ue,c(d.run.inputTokens?.toLocaleString()||"-"),1)]),e("div",null,[l[5]||(l[5]=e("p",{class:"text-xs text-muted uppercase"}," Output Tokens ",-1)),e("p",ce,c(d.run.outputTokens?.toLocaleString()||"-"),1)])]),d.run.error?(s(),p("div",de,[l[6]||(l[6]=e("p",{class:"text-sm font-medium text-error-500 mb-2"}," Error ",-1)),e("pre",me,c(d.run.error),1)])):x("",!0),d.run.output?(s(),p("div",pe,[l[7]||(l[7]=e("p",{class:"text-sm font-medium mb-2"}," Output ",-1)),e("div",fe,[e("pre",ge,c(d.run.output),1)])])):x("",!0),!d.run.output&&!d.run.error&&d.run.status==="running"?(s(),p("div",_e,[i(z,{name:"i-lucide-loader-2",class:"size-8 animate-spin mb-2"}),l[8]||(l[8]=e("p",null,"Agent is currently running...",-1))])):x("",!0)])):(s(),p("div",ve," No run selected "))]),footer:u(()=>[e("div",xe,[i(I,{color:"neutral",variant:"ghost",onClick:l[0]||(l[0]=M=>k.value=!1)},{default:u(()=>[...l[9]||(l[9]=[v(" Close ",-1)])]),_:1})])]),_:1},8,["open","title"])}}}),he=Object.assign(ye,{__name:"AgentsAgentRunModal"}),$e=Yt(Xt),ke={class:"contents"},be={class:"flex items-center gap-3"},we={class:"font-semibold text-lg truncate"},Ae={key:0,class:"flex items-center justify-center h-64"},Ce={key:1,class:"p-4 space-y-6"},Re={class:"space-y-3"},Ue={key:0},De={class:"flex flex-wrap gap-6"},Se={class:"flex items-center gap-2"},Me={class:"text-sm text-muted"},Te={key:0},Fe={class:"flex items-center gap-2"},Be={key:1},Ee={class:"flex items-center gap-2"},Ne={class:"space-y-4"},je={key:0,class:"flex items-center justify-center h-32"},Le={key:1,class:"flex flex-col items-center justify-center h-32 text-neutral-500"},Oe={key:2,class:"space-y-2"},ze={class:"flex items-start justify-between gap-4"},Ie={class:"flex-1 min-w-0"},Ve={class:"flex items-center gap-2 mb-1"},qe={class:"text-sm text-muted"},Ge={class:"text-sm text-muted truncate"},We={class:"text-right text-sm text-muted shrink-0"},He={key:0},Je={class:"p-4 space-y-4"},Pe={class:"flex items-center gap-3"},Qe={class:"p-2 rounded-full bg-error-500/10"},Ke={class:"text-sm text-muted"},Xe={class:"flex justify-end gap-2"},Wn=Z({__name:"[id]",async setup(d){let k,U;const D=Bt(),S=Et(),m=Nt(),{fetchAgentStats:l,fetchRuns:O,updateAgent:z,deleteAgent:I,toggleEnabled:V,runAgent:M,cancelAgent:st}=Pt(),{isAgentRunning:at}=te(),T=j(()=>D.params.id),{data:rt,status:it,error:q,refresh:J}=([k,U]=jt(()=>ee(()=>`/api/agents/${T.value}`,{key:`agent-${T.value}`},"$aMAiG7xhIp")),k=await k,U(),k),a=j(()=>rt.value?.data??null),lt=j(()=>it.value==="pending");if(q.value)throw Lt({statusCode:q.value.statusCode||404,message:q.value.message||"Agent not found"});const C=$(null),F=$([]),G=$(!1),W=$(!1),P=j(()=>a.value?at(a.value.id)?!0:F.value.some(o=>o.status==="running"):!1),w=$("7d"),ut=[{label:"24h",value:"24h"},{label:"7d",value:"7d"},{label:"30d",value:"30d"}],A=$(!1),R=$(!1),Q=$(null),B=$(!1);function ct(o){const t=o.split(" ");if(t.length!==5)return o;const g=t[0],f=t[1],_=t[2],h=t[3],b=t[4];return g==="0"&&f==="*"&&_==="*"&&h==="*"&&b==="*"?"Every hour":g==="*/5"&&f==="*"&&_==="*"&&h==="*"&&b==="*"?"Every 5 minutes":_==="*"&&h==="*"&&b==="*"&&f!=="*"?`Daily at ${f}:${g.padStart(2,"0")}`:b==="0"&&_==="*"&&h==="*"?`Weekly on Sunday at ${f}:${g.padStart(2,"0")}`:o}function dt(o){if(!o)return"Never";const t=new Date(o),f=new Date().getTime()-t.getTime(),_=Math.floor(f/6e4),h=Math.floor(f/36e5),b=Math.floor(f/864e5);return _<1?"Just now":_<60?`${_}m ago`:h<24?`${h}h ago`:`${b}d ago`}function mt(o){return o?o<1e3?`${o}ms`:o<6e4?`${(o/1e3).toFixed(1)}s`:`${(o/6e4).toFixed(1)}m`:"-"}function pt(o){return o?new Date(o).toLocaleString():"-"}function ft(o){switch(o){case"success":return"success";case"error":return"error";case"budget_exceeded":return"warning";case"running":return"info";case"cancelled":return"neutral";default:return"neutral"}}async function E(){G.value=!0;try{C.value=await l(T.value,w.value)}catch{}finally{G.value=!1}}async function N(){W.value=!0;try{F.value=await O(T.value,w.value)}catch{}finally{W.value=!1}}async function gt(){if(a.value)try{await V(a.value.id),await J()}catch{m.add({title:"Failed to toggle agent",color:"error",icon:"i-lucide-alert-circle"})}}async function _t(){if(a.value)try{await M(a.value.id),setTimeout(N,1e3)}catch{m.add({title:"Failed to run agent",color:"error",icon:"i-lucide-alert-circle"})}}async function vt(){if(a.value)try{await st(a.value.id),m.add({title:"Agent cancelled",color:"warning",icon:"i-lucide-x-circle"}),setTimeout(()=>{N(),E()},1e3)}catch{m.add({title:"Failed to cancel agent",description:"No running execution found",color:"error",icon:"i-lucide-alert-circle"})}}async function xt(o){if(a.value)try{await z(a.value.id,o),m.add({title:"Agent updated",color:"success",icon:"i-lucide-check"}),A.value=!1,J(),E()}catch(t){m.add({title:"Failed to update agent",description:t instanceof Error?t.message:"An unexpected error occurred",color:"error",icon:"i-lucide-alert-circle"})}}async function yt(){if(a.value)try{await I(a.value.id),m.add({title:"Agent deleted",color:"success",icon:"i-lucide-check"}),S.push("/agents")}catch{m.add({title:"Failed to delete agent",color:"error",icon:"i-lucide-alert-circle"})}}function ht(o){Q.value=o,B.value=!0}function K(o,t=100){return o?o.length<=t?o:o.substring(0,t)+"...":"-"}return Ot(w,()=>{E(),N()}),zt(()=>{E(),N()}),(o,t)=>{const g=tt,f=et,_=nt,h=It,b=Vt,$t=Gt,kt=Wt,bt=Ht,X=Jt,wt=Qt,At=$e,Ct=qt,Rt=Kt,Ut=Zt,Dt=ot,St=he;return s(),p("div",ke,[i(Ct,{id:"agent-detail",grow:""},{header:u(()=>[i($t,null,{left:u(()=>[e("div",be,[i(g,{icon:"i-lucide-arrow-left",variant:"ghost",size:"sm",onClick:t[0]||(t[0]=r=>n(S).push("/agents"))}),n(a)?(s(),p(L,{key:0},[e("h1",we,c(n(a).name),1),n(P)?(s(),y(_,{key:0,color:"info",variant:"subtle"},{default:u(()=>[i(f,{name:"i-lucide-loader-2",class:"w-3 h-3 animate-spin mr-1"}),t[8]||(t[8]=v(" Running ",-1))]),_:1})):n(a).enabled?x("",!0):(s(),y(_,{key:1,color:"neutral",variant:"subtle"},{default:u(()=>[...t[9]||(t[9]=[v(" Disabled ",-1)])]),_:1}))],64)):(s(),y(h,{key:1,class:"h-6 w-32"}))])]),right:u(()=>[n(a)?(s(),p(L,{key:0},[i(b,{"model-value":n(a).enabled,"onUpdate:modelValue":gt},null,8,["model-value"]),n(P)?(s(),y(g,{key:0,icon:"i-lucide-square",variant:"ghost",color:"error",onClick:vt})):(s(),y(g,{key:1,icon:"i-lucide-play",variant:"ghost",disabled:!n(a).enabled,onClick:_t},null,8,["disabled"])),i(g,{icon:"i-lucide-pencil",variant:"ghost",onClick:t[1]||(t[1]=r=>A.value=!0)}),i(g,{icon:"i-lucide-trash-2",variant:"ghost",color:"error",onClick:t[2]||(t[2]=r=>R.value=!0)})],64)):x("",!0)]),_:1}),i(bt,null,{left:u(()=>[i(kt,null,{default:u(()=>[(s(),p(L,null,Y(ut,r=>i(g,{key:r.value,color:n(w)===r.value?"primary":"neutral",variant:n(w)===r.value?"solid":"ghost",size:"sm",onClick:Mt=>w.value=r.value},{default:u(()=>[v(c(r.label),1)]),_:2},1032,["color","variant","onClick"])),64))]),_:1})]),_:1})]),body:u(()=>[n(lt)?(s(),p("div",Ae,[i(f,{name:"i-lucide-loader-2",class:"w-8 h-8 animate-spin text-neutral-400"})])):n(a)?(s(),p("div",Ce,[i(X,null,{default:u(()=>[e("div",Re,[n(a).description?(s(),p("div",Ue,[t[10]||(t[10]=e("p",{class:"text-sm text-muted uppercase mb-1"}," Description ",-1)),e("p",null,c(n(a).description),1)])):x("",!0),e("div",De,[e("div",null,[t[11]||(t[11]=e("p",{class:"text-sm text-muted uppercase mb-1"}," Schedule ",-1)),e("p",Se,[i(f,{name:"i-lucide-clock"}),v(" "+c(ct(n(a).schedule))+" ",1),e("span",Me,"("+c(n(a).schedule)+")",1)])]),n(a).maxBudgetUsd?(s(),p("div",Te,[t[12]||(t[12]=e("p",{class:"text-sm text-muted uppercase mb-1"}," Budget Limit ",-1)),e("p",Fe,[i(f,{name:"i-lucide-dollar-sign"}),v(" $"+c(n(a).maxBudgetUsd)+" per run ",1)])])):x("",!0),n(a).lastRunAt?(s(),p("div",Be,[t[13]||(t[13]=e("p",{class:"text-sm text-muted uppercase mb-1"}," Last Run ",-1)),e("p",Ee,[i(f,{name:"i-lucide-activity"}),v(" "+c(dt(n(a).lastRunAt)),1)])])):x("",!0)])])]),_:1}),i(wt,{stats:n(C),loading:n(G),variant:"detail"},null,8,["stats","loading"]),n(C)&&n(C).dailyRuns.length>0?(s(),y(At,{key:0,data:n(C).dailyRuns,title:"Run Activity"},null,8,["data"])):x("",!0),e("div",Ne,[t[16]||(t[16]=e("h2",{class:"text-lg font-semibold"}," Run History ",-1)),n(W)?(s(),p("div",je,[i(f,{name:"i-lucide-loader-2",class:"w-6 h-6 animate-spin text-neutral-400"})])):n(F).length===0?(s(),p("div",Le,[i(f,{name:"i-lucide-history",class:"w-8 h-8 mb-2"}),t[14]||(t[14]=e("p",null,"No runs yet",-1))])):(s(),p("div",Oe,[(s(!0),p(L,null,Y(n(F),r=>(s(),y(X,{key:r.id,class:"cursor-pointer transition-all hover:ring-2 hover:ring-primary/50",onClick:Mt=>ht(r)},{default:u(()=>[e("div",ze,[e("div",Ie,[e("div",Ve,[r.status==="running"?(s(),y(_,{key:0,color:"info",variant:"subtle",size:"sm"},{default:u(()=>[i(f,{name:"i-lucide-loader-2",class:"w-3 h-3 animate-spin mr-1"}),t[15]||(t[15]=v(" Running ",-1))]),_:1})):(s(),y(_,{key:1,color:ft(r.status),size:"sm"},{default:u(()=>[v(c(r.status),1)]),_:2},1032,["color"])),e("span",qe,c(pt(r.startedAt)),1)]),e("p",Ge,c(r.error?K(r.error):K(r.output)),1)]),e("div",We,[e("p",null,c(mt(r.durationMs)),1),r.costUsd?(s(),p("p",He," $"+c(r.costUsd.toFixed(4)),1)):x("",!0)])])]),_:2},1032,["onClick"]))),128))]))])])):x("",!0)]),_:1}),i(Ut,{open:n(A),"onUpdate:open":t[4]||(t[4]=r=>H(A)?A.value=r:null)},{title:u(()=>[...t[17]||(t[17]=[v(" Edit Agent ",-1)])]),body:u(()=>[i(Rt,{agent:n(a),onSubmit:xt,onCancel:t[3]||(t[3]=r=>A.value=!1)},null,8,["agent"])]),_:1},8,["open"]),i(Dt,{open:n(R),"onUpdate:open":t[6]||(t[6]=r=>H(R)?R.value=r:null)},{content:u(()=>[e("div",Je,[e("div",Pe,[e("div",Qe,[i(f,{name:"i-lucide-alert-triangle",class:"w-6 h-6 text-error-500"})]),e("div",null,[t[18]||(t[18]=e("h3",{class:"font-semibold"}," Delete Agent ",-1)),e("p",Ke,' Are you sure you want to delete "'+c(n(a)?.name)+'"? This action cannot be undone. ',1)])])])]),footer:u(()=>[e("div",Xe,[i(g,{color:"neutral",variant:"ghost",onClick:t[5]||(t[5]=r=>R.value=!1)},{default:u(()=>[...t[19]||(t[19]=[v(" Cancel ",-1)])]),_:1}),i(g,{color:"error",onClick:yt},{default:u(()=>[...t[20]||(t[20]=[v(" Delete ",-1)])]),_:1})])]),_:1},8,["open"]),i(St,{open:n(B),"onUpdate:open":t[7]||(t[7]=r=>H(B)?B.value=r:null),run:n(Q)},null,8,["open","run"])])}}});export{Wn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as i,N as p,c as v,G as t,R as d,ab as m,a9 as f,a4 as c,U as o,
|
|
1
|
+
import{ao as i,N as p,c as v,G as t,R as d,ab as m,a9 as f,a4 as c,U as o,am as l}from"./B63LIwsW.js";const b={slots:{root:"my-5",preview:"flex justify-center border border-muted relative p-4 rounded-md",code:"[&>div>pre]:rounded-t-none [&>div]:my-0"},variants:{code:{true:{preview:"border-b-0 rounded-b-none"}}}},C={__name:"ProseCodePreview",props:{class:{type:null,required:!1},ui:{type:null,required:!1}},setup(n){const e=n,r=i(),u=p(),s=v(()=>l({extend:l(b),...u.ui?.prose?.codePreview||{}})({code:!!r.code}));return(a,w)=>(d(),t("div",{class:o(s.value.root({class:[e.ui?.root,e.class]}))},[m("div",{class:o(s.value.preview({class:[e.ui?.preview]}))},[c(a.$slots,"default")],2),r.code?(d(),t("div",{key:0,class:o(s.value.code({class:[e.ui?.code]}))},[c(a.$slots,"code")],2)):f("",!0)],2))}};export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aT as _e,s as Ee,l as Te,aB as Pe,c as Q,n as Le}from"./CvMqUdkl.js";var Ie={},ie={};const G=Object.create(null),F=e=>Ie||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?G:globalThis),B=new Proxy(G,{get(e,t){return F()[t]??G[t]},has(e,t){return t in F()||t in G},set(e,t,n){const r=F(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;const n=F(!0);return delete n[t],!0},ownKeys(){const e=F(!0);return Object.keys(e)}});function g(e,t){return typeof process<"u"&&ie?ie[e]??t:typeof Deno<"u"?Deno.env.get(e)??t:typeof Bun<"u"?Bun.env[e]??t:t}const $=1,y=4,L=8,S=24,ae={eterm:y,cons25:y,console:y,cygwin:y,dtterm:y,gnome:y,hurd:y,jfbterm:y,konsole:y,kterm:y,mlterm:y,mosh:S,putty:y,st:y,"rxvt-unicode-24bit":S,terminator:S,"xterm-kitty":S},Ae=new Map(Object.entries({APPVEYOR:L,BUILDKITE:L,CIRCLECI:S,DRONE:L,GITEA_ACTIONS:S,GITHUB_ACTIONS:S,GITLAB_CI:L,TRAVIS:L})),xe=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function Ce(){if(g("FORCE_COLOR")!==void 0)switch(g("FORCE_COLOR")){case"":case"1":case"true":return y;case"2":return L;case"3":return S;default:return $}if(g("NODE_DISABLE_COLORS")!==void 0&&g("NODE_DISABLE_COLORS")!==""||g("NO_COLOR")!==void 0&&g("NO_COLOR")!==""||g("TERM")==="dumb")return $;if(g("TMUX"))return S;if("TF_BUILD"in B&&"AGENT_NAME"in B)return y;if("CI"in B){for(const{0:e,1:t}of Ae)if(e in B)return t;return g("CI_NAME")==="codeship"?L:$}if("TEAMCITY_VERSION"in B)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(g("TEAMCITY_VERSION"))!==null?y:$;switch(g("TERM_PROGRAM")){case"iTerm.app":return!g("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(g("TERM_PROGRAM_VERSION"))!==null?L:S;case"HyperTerm":case"MacTerm":return S;case"Apple_Terminal":return L}if(g("COLORTERM")==="truecolor"||g("COLORTERM")==="24bit")return S;if(g("TERM")){if(/truecolor/.exec(g("TERM"))!==null)return S;if(/^xterm-256/.exec(g("TERM"))!==null)return L;const e=g("TERM").toLowerCase();if(ae[e])return ae[e];if(xe.some(t=>t.exec(e)!==null))return y}return g("COLORTERM")?y:$}const I={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",fg:{red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m"}},ne=["debug","info","success","warn","error"];function Ne(e,t){return ne.indexOf(t)>=ne.indexOf(e)}const Me={info:I.fg.blue,success:I.fg.green,warn:I.fg.yellow,error:I.fg.red,debug:I.fg.magenta},Ue=(e,t,n)=>{const r=new Date().toISOString();return n?`${I.dim}${r}${I.reset} ${Me[e]}${e.toUpperCase()}${I.reset} ${I.bright}[Better Auth]:${I.reset} ${t}`:`${r} ${e.toUpperCase()} [Better Auth]: ${t}`},qe=e=>{const t="error",n=Ce()!==1,r=(s,c,a=[])=>{if(!Ne(t,s))return;const d=Ue(s,c,n);{s==="error"?console.error(d,...a):s==="warn"?console.warn(d,...a):console.log(d,...a);return}};return{...Object.fromEntries(ne.map(s=>[s,(...[c,...a])=>r(s,c,a)])),get level(){return t}}};qe();function Fe(e){return e.charAt(0).toUpperCase()+e.slice(1)}var J=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function Be(e){try{return(new URL(e).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new J(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function $e(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new J(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof J?t:new J(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function ue(e,t="/api/auth"){if($e(e),Be(e))return e;const n=e.replace(/\/+$/,"");return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function De(e,t,n,r,s){if(e)return ue(e,t);if(typeof window<"u"&&window.location)return ue(window.location.origin,t)}const je={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},ke={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Ve=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,ce={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},We=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Ge(e){return e instanceof Date&&!isNaN(e.getTime())}function Je(e){const t=We.exec(e);if(!t)return null;const[,n,r,s,c,a,d,o,u,i,f]=t,h=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(s,10),parseInt(c,10),parseInt(a,10),parseInt(d,10),o?parseInt(o.padEnd(3,"0"),10):0));if(u){const m=(parseInt(i,10)*60+parseInt(f,10))*(u==="+"?-1:1);h.setUTCMinutes(h.getUTCMinutes()+m)}return Ge(h)?h:null}function He(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:s,parseDates:c=!0}=t;if(typeof e!="string")return e;const a=e.trim();if(a.length>0&&a[0]==='"'&&a.endsWith('"')&&!a.slice(1,-1).includes('"'))return a.slice(1,-1);const d=a.toLowerCase();if(d.length<=9&&d in ce)return ce[d];if(!Ve.test(a)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(ke).some(([o,u])=>{const i=u.test(a);return i&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${o} pattern`),i})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(u,i)=>{if(u==="__proto__"||u==="constructor"&&i&&typeof i=="object"&&"prototype"in i){r&&console.warn(`[better-json] Dropping "${u}" key to prevent prototype pollution`);return}if(c&&typeof i=="string"){const f=Je(i);if(f)return f}return s?s(u,i):i})}catch(o){if(n)throw o;return e}}function Ye(e,t={strict:!0}){return He(e,t)}let E=[],U=0;const k=4,me=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(r){return n.lc=t.push(r),()=>{for(let c=U+k;c<E.length;)E[c]===r?E.splice(c,k):c+=k;let s=t.indexOf(r);~s&&(t.splice(s,1),--n.lc||n.off())}},notify(r,s){let c=!E.length;for(let a of t)E.push(a,n.value,r,s);if(c){for(U=0;U<E.length;U+=k)E[U](E[U+1],E[U+2],E[U+3]);E.length=0}},off(){},set(r){let s=n.value;s!==r&&(n.value=r,n.notify(s))},subscribe(r){let s=n.listen(r);return r(n.value),s},value:e};return n},Qe=5,V=6,W=10;let ze=(e,t,n,r)=>(e.events=e.events||{},e.events[n+W]||(e.events[n+W]=r(s=>{e.events[n].reduceRight((c,a)=>(a(c),c),{shared:{},...s})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let s=e.events[n],c=s.indexOf(t);s.splice(c,1),s.length||(delete e.events[n],e.events[n+W](),delete e.events[n+W])}),Xe=1e3,ve=(e,t)=>ze(e,r=>{let s=t(r);s&&e.events[V].push(s)},Qe,r=>{let s=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),s(...a));let c=e.off;return e.events[V]=[],e.off=()=>{c(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[V])a();e.events[V]=[]}},Xe)},()=>{e.listen=s,e.off=c}});const Ze=()=>typeof window>"u",Ke=(e,t,n,r)=>{const s=me({data:null,error:null,isPending:!0,isRefetching:!1,refetch:d=>c(d)}),c=async d=>new Promise(o=>{const u=typeof r=="function"?r({data:s.get().data,error:s.get().error,isPending:s.get().isPending}):r;n(t,{...u,query:{...u?.query,...d?.query},async onSuccess(i){s.set({data:i.data,error:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await u?.onSuccess?.(i)},async onError(i){const{request:f}=i,h=typeof f.retry=="number"?f.retry:f.retry?.attempts,m=f.retryAttempt||0;h&&m<h||(s.set({error:i.error,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await u?.onError?.(i))},async onRequest(i){const f=s.get();s.set({isPending:f.data===null,data:f.data,error:null,isRefetching:!0,refetch:s.value.refetch}),await u?.onRequest?.(i)}}).catch(i=>{s.set({error:i,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch})}).finally(()=>{o(void 0)})});e=Array.isArray(e)?e:[e];let a=!1;for(const d of e)d.subscribe(async()=>{Ze()||(a?await c():ve(s,()=>{const o=setTimeout(async()=>{a||(await c(),a=!0)},0);return()=>{s.off(),d.off(),clearTimeout(o)}}))});return s},z=Symbol.for("better-auth:broadcast-channel"),et=()=>Math.floor(Date.now()/1e3);var tt=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:et()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function X(e="better-auth.message"){return globalThis[z]||(globalThis[z]=new tt(e)),globalThis[z]}const Z=Symbol.for("better-auth:focus-manager");var nt=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function le(){return globalThis[Z]||(globalThis[Z]=new nt),globalThis[Z]}const K=Symbol.for("better-auth:online-manager");var rt=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function ee(){return globalThis[K]||(globalThis[K]=new rt),globalThis[K]}const q=()=>Math.floor(Date.now()/1e3),st=5;function ot(e){const{sessionAtom:t,sessionSignal:n,$fetch:r,options:s={}}=e,c=s.sessionOptions?.refetchInterval??0,a=s.sessionOptions?.refetchOnWindowFocus??!0,d=s.sessionOptions?.refetchWhenOffline??!1,o={lastSync:0,lastSessionRequest:0,cachedSession:void 0},u=()=>d||ee().isOnline,i=v=>{if(!u())return;if(v?.event==="storage"){o.lastSync=q(),n.set(!n.get());return}const O=t.get();if(v?.event==="poll"){o.lastSessionRequest=q(),r("/get-session").then(l=>{l.error?t.set({...O,data:null,error:l.error}):t.set({...O,data:l.data,error:null}),o.lastSync=q(),n.set(!n.get())}).catch(()=>{});return}if(v?.event==="visibilitychange"){if(q()-o.lastSessionRequest<st)return;o.lastSessionRequest=q()}(O?.data===null||O?.data===void 0||v?.event==="visibilitychange")&&(o.lastSync=q(),n.set(!n.get()))},f=v=>{X().post({event:"session",data:{trigger:v},clientId:Math.random().toString(36).substring(7)})},h=()=>{c&&c>0&&(o.pollInterval=setInterval(()=>{t.get()?.data&&i({event:"poll"})},c*1e3))},m=()=>{o.unsubscribeBroadcast=X().subscribe(()=>{i({event:"storage"})})},R=()=>{a&&(o.unsubscribeFocus=le().subscribe(()=>{i({event:"visibilitychange"})}))},A=()=>{o.unsubscribeOnline=ee().subscribe(v=>{v&&i({event:"visibilitychange"})})};return{init:()=>{h(),m(),R(),A(),X().setup(),le().setup(),ee().setup()},cleanup:()=>{o.pollInterval&&(clearInterval(o.pollInterval),o.pollInterval=void 0),o.unsubscribeBroadcast&&(o.unsubscribeBroadcast(),o.unsubscribeBroadcast=void 0),o.unsubscribeFocus&&(o.unsubscribeFocus(),o.unsubscribeFocus=void 0),o.unsubscribeOnline&&(o.unsubscribeOnline(),o.unsubscribeOnline=void 0),o.lastSync=0,o.lastSessionRequest=0,o.cachedSession=void 0},triggerRefetch:i,broadcastSessionUpdate:f}}function it(e,t){const n=me(!1),r=Ke(n,"/get-session",e,{method:"GET"});return ve(r,()=>{const s=ot({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return s.init(),()=>{s.cleanup()}}),{session:r,$sessionSignal:n}}var at=Object.defineProperty,ut=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,de=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))lt.call(t,n)&&de(e,n,t[n]);if(fe)for(var n of fe(t))ft.call(t,n)&&de(e,n,t[n]);return e},P=(e,t)=>ut(e,ct(t)),dt=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},ht=async(e,t)=>{var n,r,s,c,a,d;let o=t||{};const u={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:o,hooks:u};for(const i of t?.plugins||[]){if(i.init){const f=await((n=i.init)==null?void 0:n.call(i,e.toString(),t));o=f.options||o,e=f.url}u.onRequest.push((r=i.hooks)==null?void 0:r.onRequest),u.onResponse.push((s=i.hooks)==null?void 0:s.onResponse),u.onSuccess.push((c=i.hooks)==null?void 0:c.onSuccess),u.onError.push((a=i.hooks)==null?void 0:a.onError),u.onRetry.push((d=i.hooks)==null?void 0:d.onRetry)}return{url:e,options:o,hooks:u}},he=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},pt=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function gt(e){if(typeof e=="number")return new he({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new he(e);case"exponential":return new pt(e);default:throw new Error("Invalid retry strategy")}}var yt=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,s]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!s)return t;t.authorization=`Basic ${btoa(`${r}:${s}`)}`}else if(e.auth.type==="Custom"){const[r,s]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!s)return t;t.authorization=`${r??""} ${s}`}}return t},mt=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function vt(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return mt.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function bt(e){try{return JSON.parse(e),!0}catch{return!1}}function re(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function pe(e){try{return JSON.parse(e)}catch{return e}}function ge(e){return typeof e=="function"}function wt(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&ge(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&ge(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function Ot(e){const t=new Headers(e?.headers),n=await yt(e);for(const[r,s]of Object.entries(n||{}))t.set(r,s);if(!t.has("content-type")){const r=Rt(e?.body);r&&t.set("content-type",r)}return t}function Rt(e){return re(e)?"application/json":null}function St(e){if(!e?.body)return null;const t=new Headers(e?.headers);if(re(e.body)&&!t.has("content-type")){for(const[n,r]of Object.entries(e?.body))r instanceof Date&&(e.body[n]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&t.get("content-type")==="application/x-www-form-urlencoded"&&re(e.body)?new URLSearchParams(e.body).toString():e.body}function _t(e,t){var n;if(t?.method)return t.method.toUpperCase();if(e.startsWith("@")){const r=(n=e.split("@")[1])==null?void 0:n.split("/")[0];return we.includes(r)?r.toUpperCase():t?.body?"POST":"GET"}return t?.body?"POST":"GET"}function Et(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Tt=class be extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,be.prototype)}};async function H(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new Tt(n.issues);return n.value}var we=["get","post","put","patch","delete"],Pt=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r,s,c,a;const d=((s=(r=e.plugins)==null?void 0:r.find(o=>{var u;return(u=o.schema)!=null&&u.config?t.startsWith(o.schema.config.baseURL||"")||t.startsWith(o.schema.config.prefix||""):!1}))==null?void 0:s.schema)||e.schema;if(d){let o=t;(c=d.config)!=null&&c.prefix&&o.startsWith(d.config.prefix)&&(o=o.replace(d.config.prefix,""),d.config.baseURL&&(t=t.replace(d.config.prefix,d.config.baseURL))),(a=d.config)!=null&&a.baseURL&&o.startsWith(d.config.baseURL)&&(o=o.replace(d.config.baseURL,""));const u=d.schema[o];if(u){let i=P(T({},n),{method:u.method,output:u.output});return n?.disableValidation||(i=P(T({},i),{body:u.input?await H(u.input,n?.body):n?.body,params:u.params?await H(u.params,n?.params):n?.params,query:u.query?await H(u.query,n?.query):n?.query})),{url:t,options:i}}}return{url:t,options:n}}}),Lt=e=>{async function t(n,r){const s=P(T(T({},e),r),{plugins:[...e?.plugins||[],Pt(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await se(n,s)}catch(c){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:c}}}return await se(n,s)}return t};function It(e,t){const{baseURL:n,params:r,query:s}=t||{query:{},params:{},baseURL:""};let c=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){const f=e.toString().split("@")[1].split("/")[0];we.includes(f)&&(e=e.replace(`@${f}/`,"/"))}c.endsWith("/")||(c+="/");let[a,d]=e.replace(c,"").split("?");const o=new URLSearchParams(d);for(const[f,h]of Object.entries(s||{})){if(h==null)continue;let m;if(typeof h=="string")m=h;else if(Array.isArray(h)){for(const R of h)o.append(f,R);continue}else m=JSON.stringify(h);o.set(f,m)}if(r)if(Array.isArray(r)){const f=a.split("/").filter(h=>h.startsWith(":"));for(const[h,m]of f.entries()){const R=r[h];a=a.replace(m,R)}}else for(const[f,h]of Object.entries(r))a=a.replace(`:${f}`,String(h));a=a.split("/").map(encodeURIComponent).join("/"),a.startsWith("/")&&(a=a.slice(1));let u=o.toString();return u=u.length>0?`?${u}`.replace(/\+/g,"%20"):"",c.startsWith("http")?new URL(`${a}${u}`,c):`${c}${a}${u}`}var se=async(e,t)=>{var n,r,s,c,a,d,o,u;const{hooks:i,url:f,options:h}=await ht(e,t),m=wt(h),R=new AbortController,A=(n=h.signal)!=null?n:R.signal,w=It(f,h),M=St(h),v=await Ot(h),O=_t(f,h);let l=P(T({},h),{url:w,headers:v,body:M,method:O,signal:A});for(const _ of i.onRequest)if(_){const b=await _(l);typeof b=="object"&&b!==null&&(l=b)}("pipeTo"in l&&typeof l.pipeTo=="function"||typeof((r=t?.body)==null?void 0:r.pipe)=="function")&&("duplex"in l||(l.duplex="half"));const{clearTimeout:x}=Et(h,R);let p=await m(l.url,l);x();const D={response:p,request:l};for(const _ of i.onResponse)if(_){const b=await _(P(T({},D),{response:(s=t?.hookOptions)!=null&&s.cloneResponse?p.clone():p}));b instanceof Response?p=b:typeof b=="object"&&b!==null&&(p=b.response)}if(p.ok){if(!(l.method!=="HEAD"))return{data:"",error:null};const b=vt(p),C={data:null,response:p,request:l};if(b==="json"||b==="text"){const N=await p.text(),Se=(c=l.jsonParser)!=null?c:pe;C.data=await Se(N)}else C.data=await p[b]();l?.output&&l.output&&!l.disableValidation&&(C.data=await H(l.output,C.data));for(const N of i.onSuccess)N&&await N(P(T({},C),{response:(a=t?.hookOptions)!=null&&a.cloneResponse?p.clone():p}));return t?.throw?C.data:{data:C.data,error:null}}const Oe=(d=t?.jsonParser)!=null?d:pe,j=await p.text(),oe=bt(j),Y=oe?await Oe(j):null,Re={response:p,responseText:j,request:l,error:P(T({},Y),{status:p.status,statusText:p.statusText})};for(const _ of i.onError)_&&await _(P(T({},Re),{response:(o=t?.hookOptions)!=null&&o.cloneResponse?p.clone():p}));if(t?.retry){const _=gt(t.retry),b=(u=t.retryAttempt)!=null?u:0;if(await _.shouldAttemptRetry(b,p)){for(const N of i.onRetry)N&&await N(D);const C=_.getDelay(b);return await new Promise(N=>setTimeout(N,C)),await se(e,P(T({},t),{retryAttempt:b+1}))}}if(t?.throw)throw new dt(p.status,p.statusText,oe?Y:j);return{data:null,error:P(T({},Y),{status:p.status,statusText:p.statusText})}};const At=(e,t)=>{const n="credentials"in Request.prototype,r=De(e?.baseURL,e?.basePath)??"/api/auth",s=e?.plugins?.flatMap(l=>l.fetchPlugins).filter(l=>l!==void 0)||[],c={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:a,onError:d,onRequest:o,onResponse:u,...i}=e?.fetchOptions||{},f=Lt({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(l){return l?Ye(l,{strict:!1}):null},customFetchImpl:fetch,...i,plugins:[c,...i.plugins||[],...e?.disableDefaultFetchPlugins?[]:[je],...s]}),{$sessionSignal:h,session:m}=it(f,e),R=e?.plugins||[];let A={};const w={$sessionSignal:h,session:m},M={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},v=[{signal:"$sessionSignal",matcher(l){return l==="/sign-out"||l==="/update-user"||l==="/sign-up/email"||l==="/sign-in/email"||l==="/delete-user"||l==="/verify-email"||l==="/revoke-sessions"||l==="/revoke-session"||l==="/change-email"}}];for(const l of R)l.getAtoms&&Object.assign(w,l.getAtoms?.(f)),l.pathMethods&&Object.assign(M,l.pathMethods),l.atomListeners&&v.push(...l.atomListeners);const O={notify:l=>{w[l].set(!w[l].get())},listen:(l,x)=>{w[l].subscribe(x)},atoms:w};for(const l of R)l.getActions&&(A=_e(l.getActions?.(f,O,e)??{},A));return{get baseURL(){return r},pluginsActions:A,pluginsAtoms:w,pluginPathMethods:M,atomListeners:v,$fetch:f,$store:O}};function xt(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function Ct(e,t,n){const r=t[e],{fetchOptions:s,query:c,...a}=n||{};return r||(s?.method?s.method:a&&Object.keys(a).length>0?"POST":"GET")}function Nt(e,t,n,r,s){function c(a=[]){return new Proxy(function(){},{get(d,o){if(typeof o!="string"||o==="then"||o==="catch"||o==="finally")return;const u=[...a,o];let i=e;for(const f of u)if(i&&typeof i=="object"&&f in i)i=i[f];else{i=void 0;break}return typeof i=="function"||xt(i)?i:c(u)},apply:async(d,o,u)=>{const i="/"+a.map(v=>v.replace(/[A-Z]/g,O=>`-${O.toLowerCase()}`)).join("/"),f=u[0]||{},h=u[1]||{},{query:m,fetchOptions:R,...A}=f,w={...h,...R},M=Ct(i,n,f);return await t(i,{...w,body:M==="GET"?void 0:{...A,...w?.body||{}},query:m||w?.query,method:M,async onSuccess(v){if(await w?.onSuccess?.(v),!s||w.disableSignal)return;const O=s.filter(x=>x.matcher(i));if(!O.length)return;const l=new Set;for(const x of O){const p=r[x.signal];if(!p)return;if(l.has(x.signal))continue;l.add(x.signal);const D=p.get();setTimeout(()=>{p.set(!D)},10)}}})}})}return c()}function ye(e){const t=Ee(),n=e.subscribe(r=>{t.value=r});return Te()&&Pe(n),t}function Mt(e){return`use${Fe(e)}`}function Ut(e){const{baseURL:t,pluginPathMethods:n,pluginsActions:r,pluginsAtoms:s,$fetch:c,$store:a,atomListeners:d}=At(e),o={};for(const[i,f]of Object.entries(s))o[Mt(i)]=()=>ye(f);function u(i){if(i){const f=ye(s.$sessionSignal);return i(`${t}/get-session`,{ref:f}).then(h=>({data:h.data,isPending:!1,error:h.error}))}return o.useSession()}return Nt({...r,...o,useSession:u,$fetch:c,$store:a},c,n,s,d)}let te=null;function qt(){if(!te){const e=window.location.origin;te=Ut({baseURL:e})}return te}function Bt(){const e=qt(),t=e.useSession();async function n(o,u){return await e.signIn.email({email:o,password:u})}async function r(){await e.signOut(),Le("/login")}async function s(o,u,i){return await e.signUp.email({email:o,password:u,name:i})}async function c(o){return await e.updateUser(o)}async function a(o){try{return await $fetch("/api/user/email",{method:"PATCH",body:{email:o}}),await e.getSession({fetchOptions:{cache:"no-store"}}),{data:{success:!0},error:null}}catch(u){return{data:null,error:{message:u.data?.message||"Failed to change email"}}}}async function d(o){return await e.changePassword(o)}return{session:t,user:Q(()=>t.value?.data?.user),isAuthenticated:Q(()=>!!t.value?.data?.user),isPending:Q(()=>t.value?.isPending??!0),login:n,logout:r,register:s,updateProfile:c,changeEmail:a,changePassword:d}}export{Bt as u};
|
|
1
|
+
import{aT as _e,s as Ee,l as Te,aB as Pe,c as Q,n as Le}from"./B63LIwsW.js";var Ie={},ie={};const G=Object.create(null),F=e=>Ie||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?G:globalThis),B=new Proxy(G,{get(e,t){return F()[t]??G[t]},has(e,t){return t in F()||t in G},set(e,t,n){const r=F(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;const n=F(!0);return delete n[t],!0},ownKeys(){const e=F(!0);return Object.keys(e)}});function g(e,t){return typeof process<"u"&&ie?ie[e]??t:typeof Deno<"u"?Deno.env.get(e)??t:typeof Bun<"u"?Bun.env[e]??t:t}const $=1,y=4,L=8,S=24,ae={eterm:y,cons25:y,console:y,cygwin:y,dtterm:y,gnome:y,hurd:y,jfbterm:y,konsole:y,kterm:y,mlterm:y,mosh:S,putty:y,st:y,"rxvt-unicode-24bit":S,terminator:S,"xterm-kitty":S},Ae=new Map(Object.entries({APPVEYOR:L,BUILDKITE:L,CIRCLECI:S,DRONE:L,GITEA_ACTIONS:S,GITHUB_ACTIONS:S,GITLAB_CI:L,TRAVIS:L})),xe=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function Ce(){if(g("FORCE_COLOR")!==void 0)switch(g("FORCE_COLOR")){case"":case"1":case"true":return y;case"2":return L;case"3":return S;default:return $}if(g("NODE_DISABLE_COLORS")!==void 0&&g("NODE_DISABLE_COLORS")!==""||g("NO_COLOR")!==void 0&&g("NO_COLOR")!==""||g("TERM")==="dumb")return $;if(g("TMUX"))return S;if("TF_BUILD"in B&&"AGENT_NAME"in B)return y;if("CI"in B){for(const{0:e,1:t}of Ae)if(e in B)return t;return g("CI_NAME")==="codeship"?L:$}if("TEAMCITY_VERSION"in B)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(g("TEAMCITY_VERSION"))!==null?y:$;switch(g("TERM_PROGRAM")){case"iTerm.app":return!g("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(g("TERM_PROGRAM_VERSION"))!==null?L:S;case"HyperTerm":case"MacTerm":return S;case"Apple_Terminal":return L}if(g("COLORTERM")==="truecolor"||g("COLORTERM")==="24bit")return S;if(g("TERM")){if(/truecolor/.exec(g("TERM"))!==null)return S;if(/^xterm-256/.exec(g("TERM"))!==null)return L;const e=g("TERM").toLowerCase();if(ae[e])return ae[e];if(xe.some(t=>t.exec(e)!==null))return y}return g("COLORTERM")?y:$}const I={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",fg:{red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m"}},ne=["debug","info","success","warn","error"];function Ne(e,t){return ne.indexOf(t)>=ne.indexOf(e)}const Me={info:I.fg.blue,success:I.fg.green,warn:I.fg.yellow,error:I.fg.red,debug:I.fg.magenta},Ue=(e,t,n)=>{const r=new Date().toISOString();return n?`${I.dim}${r}${I.reset} ${Me[e]}${e.toUpperCase()}${I.reset} ${I.bright}[Better Auth]:${I.reset} ${t}`:`${r} ${e.toUpperCase()} [Better Auth]: ${t}`},qe=e=>{const t="error",n=Ce()!==1,r=(s,c,a=[])=>{if(!Ne(t,s))return;const d=Ue(s,c,n);{s==="error"?console.error(d,...a):s==="warn"?console.warn(d,...a):console.log(d,...a);return}};return{...Object.fromEntries(ne.map(s=>[s,(...[c,...a])=>r(s,c,a)])),get level(){return t}}};qe();function Fe(e){return e.charAt(0).toUpperCase()+e.slice(1)}var J=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function Be(e){try{return(new URL(e).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new J(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function $e(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new J(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof J?t:new J(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function ue(e,t="/api/auth"){if($e(e),Be(e))return e;const n=e.replace(/\/+$/,"");return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function De(e,t,n,r,s){if(e)return ue(e,t);if(typeof window<"u"&&window.location)return ue(window.location.origin,t)}const je={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},ke={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Ve=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,ce={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},We=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Ge(e){return e instanceof Date&&!isNaN(e.getTime())}function Je(e){const t=We.exec(e);if(!t)return null;const[,n,r,s,c,a,d,o,u,i,f]=t,h=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(s,10),parseInt(c,10),parseInt(a,10),parseInt(d,10),o?parseInt(o.padEnd(3,"0"),10):0));if(u){const m=(parseInt(i,10)*60+parseInt(f,10))*(u==="+"?-1:1);h.setUTCMinutes(h.getUTCMinutes()+m)}return Ge(h)?h:null}function He(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:s,parseDates:c=!0}=t;if(typeof e!="string")return e;const a=e.trim();if(a.length>0&&a[0]==='"'&&a.endsWith('"')&&!a.slice(1,-1).includes('"'))return a.slice(1,-1);const d=a.toLowerCase();if(d.length<=9&&d in ce)return ce[d];if(!Ve.test(a)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(ke).some(([o,u])=>{const i=u.test(a);return i&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${o} pattern`),i})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(u,i)=>{if(u==="__proto__"||u==="constructor"&&i&&typeof i=="object"&&"prototype"in i){r&&console.warn(`[better-json] Dropping "${u}" key to prevent prototype pollution`);return}if(c&&typeof i=="string"){const f=Je(i);if(f)return f}return s?s(u,i):i})}catch(o){if(n)throw o;return e}}function Ye(e,t={strict:!0}){return He(e,t)}let E=[],U=0;const k=4,me=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(r){return n.lc=t.push(r),()=>{for(let c=U+k;c<E.length;)E[c]===r?E.splice(c,k):c+=k;let s=t.indexOf(r);~s&&(t.splice(s,1),--n.lc||n.off())}},notify(r,s){let c=!E.length;for(let a of t)E.push(a,n.value,r,s);if(c){for(U=0;U<E.length;U+=k)E[U](E[U+1],E[U+2],E[U+3]);E.length=0}},off(){},set(r){let s=n.value;s!==r&&(n.value=r,n.notify(s))},subscribe(r){let s=n.listen(r);return r(n.value),s},value:e};return n},Qe=5,V=6,W=10;let ze=(e,t,n,r)=>(e.events=e.events||{},e.events[n+W]||(e.events[n+W]=r(s=>{e.events[n].reduceRight((c,a)=>(a(c),c),{shared:{},...s})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let s=e.events[n],c=s.indexOf(t);s.splice(c,1),s.length||(delete e.events[n],e.events[n+W](),delete e.events[n+W])}),Xe=1e3,ve=(e,t)=>ze(e,r=>{let s=t(r);s&&e.events[V].push(s)},Qe,r=>{let s=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),s(...a));let c=e.off;return e.events[V]=[],e.off=()=>{c(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[V])a();e.events[V]=[]}},Xe)},()=>{e.listen=s,e.off=c}});const Ze=()=>typeof window>"u",Ke=(e,t,n,r)=>{const s=me({data:null,error:null,isPending:!0,isRefetching:!1,refetch:d=>c(d)}),c=async d=>new Promise(o=>{const u=typeof r=="function"?r({data:s.get().data,error:s.get().error,isPending:s.get().isPending}):r;n(t,{...u,query:{...u?.query,...d?.query},async onSuccess(i){s.set({data:i.data,error:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await u?.onSuccess?.(i)},async onError(i){const{request:f}=i,h=typeof f.retry=="number"?f.retry:f.retry?.attempts,m=f.retryAttempt||0;h&&m<h||(s.set({error:i.error,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await u?.onError?.(i))},async onRequest(i){const f=s.get();s.set({isPending:f.data===null,data:f.data,error:null,isRefetching:!0,refetch:s.value.refetch}),await u?.onRequest?.(i)}}).catch(i=>{s.set({error:i,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch})}).finally(()=>{o(void 0)})});e=Array.isArray(e)?e:[e];let a=!1;for(const d of e)d.subscribe(async()=>{Ze()||(a?await c():ve(s,()=>{const o=setTimeout(async()=>{a||(await c(),a=!0)},0);return()=>{s.off(),d.off(),clearTimeout(o)}}))});return s},z=Symbol.for("better-auth:broadcast-channel"),et=()=>Math.floor(Date.now()/1e3);var tt=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:et()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function X(e="better-auth.message"){return globalThis[z]||(globalThis[z]=new tt(e)),globalThis[z]}const Z=Symbol.for("better-auth:focus-manager");var nt=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function le(){return globalThis[Z]||(globalThis[Z]=new nt),globalThis[Z]}const K=Symbol.for("better-auth:online-manager");var rt=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function ee(){return globalThis[K]||(globalThis[K]=new rt),globalThis[K]}const q=()=>Math.floor(Date.now()/1e3),st=5;function ot(e){const{sessionAtom:t,sessionSignal:n,$fetch:r,options:s={}}=e,c=s.sessionOptions?.refetchInterval??0,a=s.sessionOptions?.refetchOnWindowFocus??!0,d=s.sessionOptions?.refetchWhenOffline??!1,o={lastSync:0,lastSessionRequest:0,cachedSession:void 0},u=()=>d||ee().isOnline,i=v=>{if(!u())return;if(v?.event==="storage"){o.lastSync=q(),n.set(!n.get());return}const O=t.get();if(v?.event==="poll"){o.lastSessionRequest=q(),r("/get-session").then(l=>{l.error?t.set({...O,data:null,error:l.error}):t.set({...O,data:l.data,error:null}),o.lastSync=q(),n.set(!n.get())}).catch(()=>{});return}if(v?.event==="visibilitychange"){if(q()-o.lastSessionRequest<st)return;o.lastSessionRequest=q()}(O?.data===null||O?.data===void 0||v?.event==="visibilitychange")&&(o.lastSync=q(),n.set(!n.get()))},f=v=>{X().post({event:"session",data:{trigger:v},clientId:Math.random().toString(36).substring(7)})},h=()=>{c&&c>0&&(o.pollInterval=setInterval(()=>{t.get()?.data&&i({event:"poll"})},c*1e3))},m=()=>{o.unsubscribeBroadcast=X().subscribe(()=>{i({event:"storage"})})},R=()=>{a&&(o.unsubscribeFocus=le().subscribe(()=>{i({event:"visibilitychange"})}))},A=()=>{o.unsubscribeOnline=ee().subscribe(v=>{v&&i({event:"visibilitychange"})})};return{init:()=>{h(),m(),R(),A(),X().setup(),le().setup(),ee().setup()},cleanup:()=>{o.pollInterval&&(clearInterval(o.pollInterval),o.pollInterval=void 0),o.unsubscribeBroadcast&&(o.unsubscribeBroadcast(),o.unsubscribeBroadcast=void 0),o.unsubscribeFocus&&(o.unsubscribeFocus(),o.unsubscribeFocus=void 0),o.unsubscribeOnline&&(o.unsubscribeOnline(),o.unsubscribeOnline=void 0),o.lastSync=0,o.lastSessionRequest=0,o.cachedSession=void 0},triggerRefetch:i,broadcastSessionUpdate:f}}function it(e,t){const n=me(!1),r=Ke(n,"/get-session",e,{method:"GET"});return ve(r,()=>{const s=ot({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return s.init(),()=>{s.cleanup()}}),{session:r,$sessionSignal:n}}var at=Object.defineProperty,ut=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,de=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))lt.call(t,n)&&de(e,n,t[n]);if(fe)for(var n of fe(t))ft.call(t,n)&&de(e,n,t[n]);return e},P=(e,t)=>ut(e,ct(t)),dt=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},ht=async(e,t)=>{var n,r,s,c,a,d;let o=t||{};const u={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:o,hooks:u};for(const i of t?.plugins||[]){if(i.init){const f=await((n=i.init)==null?void 0:n.call(i,e.toString(),t));o=f.options||o,e=f.url}u.onRequest.push((r=i.hooks)==null?void 0:r.onRequest),u.onResponse.push((s=i.hooks)==null?void 0:s.onResponse),u.onSuccess.push((c=i.hooks)==null?void 0:c.onSuccess),u.onError.push((a=i.hooks)==null?void 0:a.onError),u.onRetry.push((d=i.hooks)==null?void 0:d.onRetry)}return{url:e,options:o,hooks:u}},he=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},pt=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function gt(e){if(typeof e=="number")return new he({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new he(e);case"exponential":return new pt(e);default:throw new Error("Invalid retry strategy")}}var yt=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,s]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!s)return t;t.authorization=`Basic ${btoa(`${r}:${s}`)}`}else if(e.auth.type==="Custom"){const[r,s]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!s)return t;t.authorization=`${r??""} ${s}`}}return t},mt=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function vt(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return mt.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function bt(e){try{return JSON.parse(e),!0}catch{return!1}}function re(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function pe(e){try{return JSON.parse(e)}catch{return e}}function ge(e){return typeof e=="function"}function wt(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&ge(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&ge(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function Ot(e){const t=new Headers(e?.headers),n=await yt(e);for(const[r,s]of Object.entries(n||{}))t.set(r,s);if(!t.has("content-type")){const r=Rt(e?.body);r&&t.set("content-type",r)}return t}function Rt(e){return re(e)?"application/json":null}function St(e){if(!e?.body)return null;const t=new Headers(e?.headers);if(re(e.body)&&!t.has("content-type")){for(const[n,r]of Object.entries(e?.body))r instanceof Date&&(e.body[n]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&t.get("content-type")==="application/x-www-form-urlencoded"&&re(e.body)?new URLSearchParams(e.body).toString():e.body}function _t(e,t){var n;if(t?.method)return t.method.toUpperCase();if(e.startsWith("@")){const r=(n=e.split("@")[1])==null?void 0:n.split("/")[0];return we.includes(r)?r.toUpperCase():t?.body?"POST":"GET"}return t?.body?"POST":"GET"}function Et(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Tt=class be extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,be.prototype)}};async function H(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new Tt(n.issues);return n.value}var we=["get","post","put","patch","delete"],Pt=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r,s,c,a;const d=((s=(r=e.plugins)==null?void 0:r.find(o=>{var u;return(u=o.schema)!=null&&u.config?t.startsWith(o.schema.config.baseURL||"")||t.startsWith(o.schema.config.prefix||""):!1}))==null?void 0:s.schema)||e.schema;if(d){let o=t;(c=d.config)!=null&&c.prefix&&o.startsWith(d.config.prefix)&&(o=o.replace(d.config.prefix,""),d.config.baseURL&&(t=t.replace(d.config.prefix,d.config.baseURL))),(a=d.config)!=null&&a.baseURL&&o.startsWith(d.config.baseURL)&&(o=o.replace(d.config.baseURL,""));const u=d.schema[o];if(u){let i=P(T({},n),{method:u.method,output:u.output});return n?.disableValidation||(i=P(T({},i),{body:u.input?await H(u.input,n?.body):n?.body,params:u.params?await H(u.params,n?.params):n?.params,query:u.query?await H(u.query,n?.query):n?.query})),{url:t,options:i}}}return{url:t,options:n}}}),Lt=e=>{async function t(n,r){const s=P(T(T({},e),r),{plugins:[...e?.plugins||[],Pt(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await se(n,s)}catch(c){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:c}}}return await se(n,s)}return t};function It(e,t){const{baseURL:n,params:r,query:s}=t||{query:{},params:{},baseURL:""};let c=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){const f=e.toString().split("@")[1].split("/")[0];we.includes(f)&&(e=e.replace(`@${f}/`,"/"))}c.endsWith("/")||(c+="/");let[a,d]=e.replace(c,"").split("?");const o=new URLSearchParams(d);for(const[f,h]of Object.entries(s||{})){if(h==null)continue;let m;if(typeof h=="string")m=h;else if(Array.isArray(h)){for(const R of h)o.append(f,R);continue}else m=JSON.stringify(h);o.set(f,m)}if(r)if(Array.isArray(r)){const f=a.split("/").filter(h=>h.startsWith(":"));for(const[h,m]of f.entries()){const R=r[h];a=a.replace(m,R)}}else for(const[f,h]of Object.entries(r))a=a.replace(`:${f}`,String(h));a=a.split("/").map(encodeURIComponent).join("/"),a.startsWith("/")&&(a=a.slice(1));let u=o.toString();return u=u.length>0?`?${u}`.replace(/\+/g,"%20"):"",c.startsWith("http")?new URL(`${a}${u}`,c):`${c}${a}${u}`}var se=async(e,t)=>{var n,r,s,c,a,d,o,u;const{hooks:i,url:f,options:h}=await ht(e,t),m=wt(h),R=new AbortController,A=(n=h.signal)!=null?n:R.signal,w=It(f,h),M=St(h),v=await Ot(h),O=_t(f,h);let l=P(T({},h),{url:w,headers:v,body:M,method:O,signal:A});for(const _ of i.onRequest)if(_){const b=await _(l);typeof b=="object"&&b!==null&&(l=b)}("pipeTo"in l&&typeof l.pipeTo=="function"||typeof((r=t?.body)==null?void 0:r.pipe)=="function")&&("duplex"in l||(l.duplex="half"));const{clearTimeout:x}=Et(h,R);let p=await m(l.url,l);x();const D={response:p,request:l};for(const _ of i.onResponse)if(_){const b=await _(P(T({},D),{response:(s=t?.hookOptions)!=null&&s.cloneResponse?p.clone():p}));b instanceof Response?p=b:typeof b=="object"&&b!==null&&(p=b.response)}if(p.ok){if(!(l.method!=="HEAD"))return{data:"",error:null};const b=vt(p),C={data:null,response:p,request:l};if(b==="json"||b==="text"){const N=await p.text(),Se=(c=l.jsonParser)!=null?c:pe;C.data=await Se(N)}else C.data=await p[b]();l?.output&&l.output&&!l.disableValidation&&(C.data=await H(l.output,C.data));for(const N of i.onSuccess)N&&await N(P(T({},C),{response:(a=t?.hookOptions)!=null&&a.cloneResponse?p.clone():p}));return t?.throw?C.data:{data:C.data,error:null}}const Oe=(d=t?.jsonParser)!=null?d:pe,j=await p.text(),oe=bt(j),Y=oe?await Oe(j):null,Re={response:p,responseText:j,request:l,error:P(T({},Y),{status:p.status,statusText:p.statusText})};for(const _ of i.onError)_&&await _(P(T({},Re),{response:(o=t?.hookOptions)!=null&&o.cloneResponse?p.clone():p}));if(t?.retry){const _=gt(t.retry),b=(u=t.retryAttempt)!=null?u:0;if(await _.shouldAttemptRetry(b,p)){for(const N of i.onRetry)N&&await N(D);const C=_.getDelay(b);return await new Promise(N=>setTimeout(N,C)),await se(e,P(T({},t),{retryAttempt:b+1}))}}if(t?.throw)throw new dt(p.status,p.statusText,oe?Y:j);return{data:null,error:P(T({},Y),{status:p.status,statusText:p.statusText})}};const At=(e,t)=>{const n="credentials"in Request.prototype,r=De(e?.baseURL,e?.basePath)??"/api/auth",s=e?.plugins?.flatMap(l=>l.fetchPlugins).filter(l=>l!==void 0)||[],c={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:a,onError:d,onRequest:o,onResponse:u,...i}=e?.fetchOptions||{},f=Lt({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(l){return l?Ye(l,{strict:!1}):null},customFetchImpl:fetch,...i,plugins:[c,...i.plugins||[],...e?.disableDefaultFetchPlugins?[]:[je],...s]}),{$sessionSignal:h,session:m}=it(f,e),R=e?.plugins||[];let A={};const w={$sessionSignal:h,session:m},M={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},v=[{signal:"$sessionSignal",matcher(l){return l==="/sign-out"||l==="/update-user"||l==="/sign-up/email"||l==="/sign-in/email"||l==="/delete-user"||l==="/verify-email"||l==="/revoke-sessions"||l==="/revoke-session"||l==="/change-email"}}];for(const l of R)l.getAtoms&&Object.assign(w,l.getAtoms?.(f)),l.pathMethods&&Object.assign(M,l.pathMethods),l.atomListeners&&v.push(...l.atomListeners);const O={notify:l=>{w[l].set(!w[l].get())},listen:(l,x)=>{w[l].subscribe(x)},atoms:w};for(const l of R)l.getActions&&(A=_e(l.getActions?.(f,O,e)??{},A));return{get baseURL(){return r},pluginsActions:A,pluginsAtoms:w,pluginPathMethods:M,atomListeners:v,$fetch:f,$store:O}};function xt(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function Ct(e,t,n){const r=t[e],{fetchOptions:s,query:c,...a}=n||{};return r||(s?.method?s.method:a&&Object.keys(a).length>0?"POST":"GET")}function Nt(e,t,n,r,s){function c(a=[]){return new Proxy(function(){},{get(d,o){if(typeof o!="string"||o==="then"||o==="catch"||o==="finally")return;const u=[...a,o];let i=e;for(const f of u)if(i&&typeof i=="object"&&f in i)i=i[f];else{i=void 0;break}return typeof i=="function"||xt(i)?i:c(u)},apply:async(d,o,u)=>{const i="/"+a.map(v=>v.replace(/[A-Z]/g,O=>`-${O.toLowerCase()}`)).join("/"),f=u[0]||{},h=u[1]||{},{query:m,fetchOptions:R,...A}=f,w={...h,...R},M=Ct(i,n,f);return await t(i,{...w,body:M==="GET"?void 0:{...A,...w?.body||{}},query:m||w?.query,method:M,async onSuccess(v){if(await w?.onSuccess?.(v),!s||w.disableSignal)return;const O=s.filter(x=>x.matcher(i));if(!O.length)return;const l=new Set;for(const x of O){const p=r[x.signal];if(!p)return;if(l.has(x.signal))continue;l.add(x.signal);const D=p.get();setTimeout(()=>{p.set(!D)},10)}}})}})}return c()}function ye(e){const t=Ee(),n=e.subscribe(r=>{t.value=r});return Te()&&Pe(n),t}function Mt(e){return`use${Fe(e)}`}function Ut(e){const{baseURL:t,pluginPathMethods:n,pluginsActions:r,pluginsAtoms:s,$fetch:c,$store:a,atomListeners:d}=At(e),o={};for(const[i,f]of Object.entries(s))o[Mt(i)]=()=>ye(f);function u(i){if(i){const f=ye(s.$sessionSignal);return i(`${t}/get-session`,{ref:f}).then(h=>({data:h.data,isPending:!1,error:h.error}))}return o.useSession()}return Nt({...r,...o,useSession:u,$fetch:c,$store:a},c,n,s,d)}let te=null;function qt(){if(!te){const e=window.location.origin;te=Ut({baseURL:e})}return te}function Bt(){const e=qt(),t=e.useSession();async function n(o,u){return await e.signIn.email({email:o,password:u})}async function r(){await e.signOut(),Le("/login")}async function s(o,u,i){return await e.signUp.email({email:o,password:u,name:i})}async function c(o){return await e.updateUser(o)}async function a(o){try{return await $fetch("/api/user/email",{method:"PATCH",body:{email:o}}),await e.getSession({fetchOptions:{cache:"no-store"}}),{data:{success:!0},error:null}}catch(u){return{data:null,error:{message:u.data?.message||"Failed to change email"}}}}async function d(o){return await e.changePassword(o)}return{session:t,user:Q(()=>t.value?.data?.user),isAuthenticated:Q(()=>!!t.value?.data?.user),isPending:Q(()=>t.value?.isPending??!0),login:n,logout:r,register:s,updateProfile:c,changeEmail:a,changePassword:d}}export{Bt as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as B,a as Et,b as Lt,c as Be,z as xt,h as Pt}from"./
|
|
1
|
+
import{s as B,a as Et,b as Lt,c as Be,z as xt,h as Pt}from"./Be5L93GM.js";import{s as et,f as Gt,h as $t}from"./BZqdzrSw.js";import"./B63LIwsW.js";import"./88opOQSr.js";import"./iik6CYzq.js";import"./CqkleIqs.js";import"./DCL9gWFw.js";import"./BVc_fOF1.js";const Bt=/[ \t\n\f\r]/g;function Ne(n){return typeof n=="object"?n.type==="text"?Me(n.value):!1:Me(n)}function Me(n){return n.replace(Bt,"")===""}const Mt=/^>|^->|<!--|-->|--!>|<!-$/g,Ot=[">"],jt=["<",">"];function Dt(n,e,t,s){return s.settings.bogusComments?"<?"+B(n.value,Object.assign({},s.settings.characterReferences,{subset:Ot}))+">":"<!--"+n.value.replace(Mt,r)+"-->";function r(i){return B(i,Object.assign({},s.settings.characterReferences,{subset:jt}))}}function Wt(n,e,t,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}const w=nt(1),tt=nt(-1),Ft=[];function nt(n){return e;function e(t,s,r){const i=t?t.children:Ft;let o=(s||0)+n,c=i[o];if(!r)for(;c&&Ne(c);)o+=n,c=i[o];return c}}const zt={}.hasOwnProperty;function st(n){return e;function e(t,s,r){return zt.call(n,t.tagName)&&n[t.tagName](t,s,r)}}const ke=st({body:Ht,caption:ue,colgroup:ue,dd:Jt,dt:Vt,head:ue,html:qt,li:Kt,optgroup:Qt,option:Yt,p:Ut,rp:Oe,rt:Oe,tbody:Zt,td:je,tfoot:en,th:je,thead:Xt,tr:tn});function ue(n,e,t){const s=w(t,e,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Ne(s.value.charAt(0)))}function qt(n,e,t){const s=w(t,e);return!s||s.type!=="comment"}function Ht(n,e,t){const s=w(t,e);return!s||s.type!=="comment"}function Ut(n,e,t){const s=w(t,e);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!t||!(t.type==="element"&&(t.tagName==="a"||t.tagName==="audio"||t.tagName==="del"||t.tagName==="ins"||t.tagName==="map"||t.tagName==="noscript"||t.tagName==="video"))}function Kt(n,e,t){const s=w(t,e);return!s||s.type==="element"&&s.tagName==="li"}function Vt(n,e,t){const s=w(t,e);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function Jt(n,e,t){const s=w(t,e);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function Oe(n,e,t){const s=w(t,e);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function Qt(n,e,t){const s=w(t,e);return!s||s.type==="element"&&s.tagName==="optgroup"}function Yt(n,e,t){const s=w(t,e);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function Xt(n,e,t){const s=w(t,e);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function Zt(n,e,t){const s=w(t,e);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function en(n,e,t){return!w(t,e)}function tn(n,e,t){const s=w(t,e);return!s||s.type==="element"&&s.tagName==="tr"}function je(n,e,t){const s=w(t,e);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const nn=st({body:on,colgroup:an,head:rn,html:sn,tbody:cn});function sn(n){const e=w(n,-1);return!e||e.type!=="comment"}function rn(n){const e=new Set;for(const s of n.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(e.has(s.tagName))return!1;e.add(s.tagName)}const t=n.children[0];return!t||t.type==="element"}function on(n){const e=w(n,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ne(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function an(n,e,t){const s=tt(t,e),r=w(n,-1,!0);return t&&s&&s.type==="element"&&s.tagName==="colgroup"&&ke(s,t.children.indexOf(s),t)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function cn(n,e,t){const s=tt(t,e),r=w(n,-1);return t&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&ke(s,t.children.indexOf(s),t)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const K={name:[[`
|
|
2
2
|
\f\r &/=>`.split(""),`
|
|
3
3
|
\f\r "&'/=>\``.split("")],[`\0
|
|
4
4
|
\f\r "&'/<=>`.split(""),`\0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as f,c as b,G as l,R as h,a4 as a,U as i,
|
|
1
|
+
import{N as f,c as b,G as l,R as h,a4 as a,U as i,am as r}from"./B63LIwsW.js";const u={base:"ms-4 border-s border-default ps-8 [counter-reset:step]",variants:{level:{2:"[&>h2]:[counter-increment:step] [&>h2]:relative [&>h2]:before:absolute [&>h2]:before:size-8 [&>h2]:before:bg-elevated [&>h2]:before:rounded-full [&>h2]:before:font-semibold [&>h2]:before:text-sm [&>h2]:before:tabular-nums [&>h2]:before:inline-flex [&>h2]:before:items-center [&>h2]:before:justify-center [&>h2]:before:ring-4 [&>h2]:before:ring-bg [&>h2]:before:-ms-[48.5px] [&>h2]:before:-mt-0 [&>h2]:before:content-[counter(step)] [&>h2>a>span.absolute]:hidden",3:"[&>h3]:[counter-increment:step] [&>h3]:relative [&>h3]:before:absolute [&>h3]:before:size-7 [&>h3]:before:inset-x-0.5 [&>h3]:before:bg-elevated [&>h3]:before:rounded-full [&>h3]:before:font-semibold [&>h3]:before:text-sm [&>h3]:before:tabular-nums [&>h3]:before:inline-flex [&>h3]:before:items-center [&>h3]:before:justify-center [&>h3]:before:ring-4 [&>h3]:before:ring-bg [&>h3]:before:-ms-[48.5px] [&>h3]:before:content-[counter(step)] [&>h3>a>span.absolute]:hidden",4:"[&>h4]:[counter-increment:step] [&>h4]:relative [&>h4]:before:absolute [&>h4]:before:size-7 [&>h4]:before:inset-x-0.5 [&>h4]:before:bg-elevated [&>h4]:before:rounded-full [&>h4]:before:font-semibold [&>h4]:before:text-sm [&>h4]:before:tabular-nums [&>h4]:before:inline-flex [&>h4]:before:items-center [&>h4]:before:justify-center [&>h4]:before:ring-4 [&>h4]:before:ring-bg [&>h4]:before:-ms-[48.5px] [&>h4]:before:content-[counter(step)] [&>h4>a>span.absolute]:hidden"}},defaultVariants:{level:"3"}},d={__name:"ProseSteps",props:{level:{type:null,required:!1},class:{type:null,required:!1}},setup(o){const e=o,t=f(),s=b(()=>r({extend:r(u),...t.ui?.prose?.steps||{}}));return(n,c)=>(h(),l("div",{class:i(s.value({class:e.class,level:e.level}))},[a(n.$slots,"default")],2))}};export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./
|
|
1
|
+
import{a as g}from"./HlbU_z9a.js";import{L as b,N as v,c as h,G as n,R as c,a9 as x,T as u,ab as d,U as r,ae as q,C as o,W as C,a4 as k,V as S,am as p}from"./B63LIwsW.js";import $ from"./BgG2k-zy.js";const w={slots:{root:"relative my-5 group",header:"flex items-center gap-1.5 border border-muted bg-default border-b-0 relative rounded-t-md px-4 py-3",filename:"text-default text-sm/6",icon:"size-4 shrink-0",copy:"absolute top-[11px] right-[11px] lg:opacity-0 lg:group-hover:opacity-100 transition",base:"group font-mono text-sm/6 border border-muted bg-muted rounded-md px-4 py-3 whitespace-pre-wrap break-words overflow-x-auto focus:outline-none"},variants:{filename:{true:{root:"[&>pre]:rounded-t-none [&>pre]:my-0 my-5"}}}},P={__name:"ProsePre",props:{icon:{type:null,required:!1},code:{type:String,required:!1},language:{type:String,required:!1},filename:{type:String,required:!1},highlights:{type:Array,required:!1},hideHeader:{type:Boolean,required:!1},meta:{type:String,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(a){const e=a,{t:m}=b(),{copy:f,copied:y}=g(),t=v(),s=h(()=>p({extend:p(w),...t.ui?.prose?.pre||{}})());return(l,i)=>(c(),n("div",{class:r(s.value.root({class:[e.ui?.root],filename:!!a.filename}))},[a.filename&&!a.hideHeader?(c(),n("div",{key:0,class:r(s.value.header({class:e.ui?.header}))},[u($,{icon:a.icon,filename:a.filename,class:r(s.value.icon({class:e.ui?.icon}))},null,8,["icon","filename","class"]),d("span",{class:r(s.value.filename({class:e.ui?.filename}))},q(a.filename),3)],2)):x("",!0),u(C,{icon:o(y)?o(t).ui.icons.copyCheck:o(t).ui.icons.copy,color:"neutral",variant:"outline",size:"sm","aria-label":o(m)("prose.pre.copy"),class:r(s.value.copy({class:e.ui?.copy})),tabindex:"-1",onClick:i[0]||(i[0]=B=>o(f)(e.code||""))},null,8,["icon","aria-label","class"]),d("pre",S({class:s.value.base({class:[e.ui?.base,e.class]})},l.$attrs),[k(l.$slots,"default")],16)],2))}};export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as H,L as I,N as z,aJ as F,aI as K,aK as M,aC as q,c as w,
|
|
1
|
+
import{ao as H,L as I,N as z,aJ as F,aI as K,aK as M,aC as q,c as w,am as B,Q as u,R as o,S as r,T as y,a9 as n,C as t,V as $,aL as U,a4 as d,aM as W,aa as g,ae as b,G as h,U as f,ab as G,W as J,aN as C,aO as x,aj as Q}from"./B63LIwsW.js";import{D as X,a as Y,b as Z}from"./D1t0272g.js";import{D as _,a as P,b as O,c as ee,d as S}from"./CY3x8iy3.js";import{c as te}from"./HlbU_z9a.js";const ae={slots:{overlay:"fixed inset-0",content:"bg-default divide-y divide-default flex flex-col focus:outline-none",header:"flex items-center gap-1.5 p-4 sm:px-6 min-h-16",wrapper:"",body:"flex-1 p-4 sm:p-6",footer:"flex items-center gap-1.5 p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",close:"absolute top-4 end-4"},variants:{transition:{true:{overlay:"data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]",content:"data-[state=open]:animate-[scale-in_200ms_ease-out] data-[state=closed]:animate-[scale-out_200ms_ease-in]"}},fullscreen:{true:{content:"inset-0"},false:{content:"w-[calc(100vw-2rem)] max-w-lg rounded-lg shadow-lg ring ring-default"}},overlay:{true:{overlay:"bg-elevated/75"}},scrollable:{true:{overlay:"overflow-y-auto",content:"relative"},false:{content:"fixed",body:"overflow-y-auto"}}},compoundVariants:[{scrollable:!0,fullscreen:!1,class:{overlay:"grid place-items-center p-4 sm:py-8"}},{scrollable:!1,fullscreen:!1,class:{content:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)] overflow-hidden"}}]},ne={__name:"UModal",props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},scrollable:{type:Boolean,required:!1},transition:{type:Boolean,required:!1,default:!0},fullscreen:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:null,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["after:leave","after:enter","close:prevent","update:open"],setup(a,{emit:T}){const e=a,m=T,l=H(),{t:V}=I(),k=z(),E=F(K(e,"open","defaultOpen","modal"),m),N=M(q(()=>e.portal)),R=q(()=>e.content),j=w(()=>e.dismissible?e.scrollable?{pointerDownOutside:s=>{const c=s.detail.originalEvent,p=c.target;(c.offsetX>p.clientWidth||c.offsetY>p.clientHeight)&&s.preventDefault()}}:{}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((c,p)=>(c[p]=v=>{v.preventDefault(),m("close:prevent")},c),{})),[L,D]=te(),i=w(()=>B({extend:B(ae),...k.ui?.modal||{}})({transition:e.transition,fullscreen:e.fullscreen,overlay:e.overlay,scrollable:e.scrollable}));return(s,c)=>(o(),u(t(Z),C(x(t(E))),{default:r(({open:p,close:v})=>[y(t(L),null,{default:r(()=>[y(t(_),$({"data-slot":"content",class:i.value.content({class:[!l.default&&e.class,e.ui?.content]})},R.value,{onAfterEnter:c[0]||(c[0]=A=>m("after:enter")),onAfterLeave:c[1]||(c[1]=A=>m("after:leave"))},U(j.value)),{default:r(()=>[l.content&&(a.title||l.title||a.description||l.description)?(o(),u(t(W),{key:0},{default:r(()=>[a.title||l.title?(o(),u(t(P),{key:0},{default:r(()=>[d(s.$slots,"title",{},()=>[g(b(a.title),1)])]),_:3})):n("",!0),a.description||l.description?(o(),u(t(O),{key:1},{default:r(()=>[d(s.$slots,"description",{},()=>[g(b(a.description),1)])]),_:3})):n("",!0)]),_:3})):n("",!0),d(s.$slots,"content",{close:v},()=>[l.header||a.title||l.title||a.description||l.description||e.close||l.close?(o(),h("div",{key:0,"data-slot":"header",class:f(i.value.header({class:e.ui?.header}))},[d(s.$slots,"header",{close:v},()=>[G("div",{"data-slot":"wrapper",class:f(i.value.wrapper({class:e.ui?.wrapper}))},[a.title||l.title?(o(),u(t(P),{key:0,"data-slot":"title",class:f(i.value.title({class:e.ui?.title}))},{default:r(()=>[d(s.$slots,"title",{},()=>[g(b(a.title),1)])]),_:3},8,["class"])):n("",!0),a.description||l.description?(o(),u(t(O),{key:1,"data-slot":"description",class:f(i.value.description({class:e.ui?.description}))},{default:r(()=>[d(s.$slots,"description",{},()=>[g(b(a.description),1)])]),_:3},8,["class"])):n("",!0)],2),d(s.$slots,"actions"),e.close||l.close?(o(),u(t(ee),{key:0,"as-child":""},{default:r(()=>[d(s.$slots,"close",{ui:i.value},()=>[e.close?(o(),u(J,$({key:0,icon:a.closeIcon||t(k).ui.icons.close,color:"neutral",variant:"ghost","aria-label":t(V)("modal.close")},typeof e.close=="object"?e.close:{},{"data-slot":"close",class:i.value.close({class:e.ui?.close})}),null,16,["icon","aria-label","class"])):n("",!0)])]),_:2},1024)):n("",!0)])],2)):n("",!0),l.body?(o(),h("div",{key:1,"data-slot":"body",class:f(i.value.body({class:e.ui?.body}))},[d(s.$slots,"body",{close:v})],2)):n("",!0),l.footer?(o(),h("div",{key:2,"data-slot":"footer",class:f(i.value.footer({class:e.ui?.footer}))},[d(s.$slots,"footer",{close:v})],2)):n("",!0)])]),_:2},1040,["class"])]),_:2},1024),l.default?(o(),u(t(X),{key:0,"as-child":"",class:f(e.class)},{default:r(()=>[d(s.$slots,"default",{open:p})]),_:2},1032,["class"])):n("",!0),y(t(Y),C(x(t(N))),{default:r(()=>[a.scrollable?(o(),u(t(S),{key:0,"data-slot":"overlay",class:f(i.value.overlay({class:e.ui?.overlay}))},{default:r(()=>[y(t(D))]),_:1},8,["class"])):(o(),h(Q,{key:1},[a.overlay?(o(),u(t(S),{key:0,"data-slot":"overlay",class:f(i.value.overlay({class:e.ui?.overlay}))},null,8,["class"])):n("",!0),y(t(D))],64))]),_:1},16)]),_:3},16))}};export{ne as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l}from"./BE4Ndhrq.js";import{N as c,c as p,Q as n,R as m,S as u,U as i,am as s}from"./B63LIwsW.js";import{_ as d}from"./BsnhHCOa.js";import"./iik6CYzq.js";const f={base:"rounded-full"},v={__name:"ProseBadge",props:{class:{type:null,required:!1}},setup(a){const e=a,o=c(),r=p(()=>s({extend:s(f),...o.ui?.prose?.badge||{}}));return(t,_)=>(m(),n(d,{color:"primary",variant:"subtle",class:i(r.value({class:e.class}))},{default:u(()=>[l(t.$slots,"default",{mdcUnwrap:"p"})]),_:3},8,["class"]))}};export{v as default};
|