@shumai-one/shumai 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{chunk-xp59apdb.js → chunk-0z8tgn67.js} +1 -1
- package/bin/{chunk-87zxtf66.js → chunk-18qzk2mm.js} +2 -2
- package/bin/{chunk-rbj4fad9.js → chunk-1b7gg0nx.js} +13 -13
- package/bin/{chunk-rpywcvg1.js → chunk-1hnpvtvf.js} +2 -2
- package/bin/chunk-1n1h09e9.js +2 -0
- package/bin/{chunk-q2bvyv39.js → chunk-1yv06e0q.js} +2 -2
- package/bin/chunk-20ee2pqp.js +4 -0
- package/bin/chunk-20yset6k.js +1 -0
- package/bin/{chunk-zqv0zhfb.js → chunk-21e4gjvw.js} +2 -2
- package/bin/{chunk-v9b3w8q5.js → chunk-23bg4h8n.js} +2 -2
- package/bin/chunk-2swjkvxv.js +211 -0
- package/bin/chunk-2y6teq4s.js +11 -0
- package/bin/chunk-3115qtvj.js +2 -0
- package/bin/{chunk-f15qyp41.js → chunk-3c0tcbga.js} +1 -1
- package/bin/{chunk-v9w25rp2.js → chunk-3mfdp2nh.js} +2 -2
- package/bin/chunk-3rwx54z7.js +2 -0
- package/bin/chunk-3x3sf7rp.js +3 -0
- package/bin/{chunk-4v5n0ayb.js → chunk-3x80f4jk.js} +1 -1
- package/bin/chunk-42ygnm34.js +2 -0
- package/bin/{chunk-wfzqnpc1.js → chunk-46wfxyd7.js} +2 -2
- package/bin/{chunk-b235azv4.js → chunk-48rbc18e.js} +13 -13
- package/bin/{chunk-4r81ghg8.js → chunk-4k2bej3c.js} +2 -2
- package/bin/{chunk-0e4wawpq.js → chunk-5trfc3xh.js} +1 -1
- package/bin/chunk-5xcjnbm9.js +1 -0
- package/bin/chunk-685gzbdg.js +14 -0
- package/bin/chunk-6kzm51c7.js +2 -0
- package/bin/{chunk-cak32x57.js → chunk-73evafrq.js} +1 -1
- package/bin/{chunk-fxswt9hc.js → chunk-7jtmwt5a.js} +2 -2
- package/bin/{chunk-av1a8fqp.js → chunk-7sc73pfr.js} +2 -2
- package/bin/{chunk-qwqvt9v6.js → chunk-7t1r3sj3.js} +2 -2
- package/bin/{chunk-vgn5zcpv.js → chunk-7v7mypc6.js} +2 -2
- package/bin/chunk-813885jm.js +1 -0
- package/bin/{chunk-bay038pj.js → chunk-8yg9zy53.js} +2 -2
- package/bin/chunk-923agf2d.js +1 -0
- package/bin/chunk-942ksfnj.js +2 -0
- package/bin/chunk-99yzvkq5.js +2 -0
- package/bin/chunk-9by727gr.js +2 -0
- package/bin/chunk-9sr1z8kv.js +42 -0
- package/bin/chunk-a0fggks8.js +2 -0
- package/bin/{chunk-cqb415s6.js → chunk-a3j3hyx2.js} +2 -2
- package/bin/chunk-a8x0dmec.js +2 -0
- package/bin/{chunk-tf28796q.js → chunk-af1mcn9p.js} +1 -1
- package/bin/{chunk-ea79xnn3.js → chunk-azafjrm4.js} +2 -2
- package/bin/{chunk-qf24e71w.js → chunk-b5a77dzv.js} +1 -1
- package/bin/chunk-b80fgsdf.js +1 -0
- package/bin/{chunk-n1jwdb0a.js → chunk-bg6kp843.js} +1 -1
- package/bin/chunk-brxwrh0b.js +11 -0
- package/bin/{chunk-zmv8cg4s.js → chunk-c51tvhra.js} +3 -3
- package/bin/chunk-c5dr9m1d.js +2 -0
- package/bin/{chunk-8fmy5jtp.js → chunk-cbpgrg5j.js} +1 -1
- package/bin/{chunk-m7m9d4fb.js → chunk-cwfjvynz.js} +2 -2
- package/bin/{chunk-66hsjnw6.js → chunk-da2w7c80.js} +2 -2
- package/bin/{chunk-1yacmegc.js → chunk-dchtr0ap.js} +2 -2
- package/bin/chunk-dqxh6dwz.js +16 -0
- package/bin/chunk-e1s1zgv0.js +2 -0
- package/bin/chunk-erharpzt.js +2 -0
- package/bin/{chunk-f3ehv01n.js → chunk-f3pb9mh9.js} +26 -26
- package/bin/chunk-fp8x63vs.js +2 -0
- package/bin/chunk-ft11rrhz.js +1 -0
- package/bin/chunk-fyszcddw.js +2 -0
- package/bin/chunk-g6hq18q1.js +1 -0
- package/bin/{chunk-wry2hvrq.js → chunk-g6xgghnq.js} +4 -4
- package/bin/{chunk-hfh0c082.js → chunk-gdg0tkbk.js} +1 -1
- package/bin/{chunk-3cyrcgm5.js → chunk-gjp851vj.js} +9 -9
- package/bin/{chunk-ehc9adfz.js → chunk-gy68h3x5.js} +2 -2
- package/bin/chunk-h4s1fgf1.js +2 -0
- package/bin/chunk-hsv4v7na.js +1 -0
- package/bin/chunk-j3kjscfj.js +2 -0
- package/bin/chunk-jbt3e1ac.js +7 -0
- package/bin/chunk-jrf90z42.js +3 -0
- package/bin/chunk-k2aqztk1.js +2 -0
- package/bin/{chunk-3a13dcs1.js → chunk-kfpfqxb3.js} +1 -1
- package/bin/chunk-kyxramkk.js +1 -0
- package/bin/chunk-m5z5mzan.js +2 -0
- package/bin/chunk-n48548fs.js +4 -0
- package/bin/chunk-ncnr223m.js +2 -0
- package/bin/chunk-ncp007yb.js +12 -0
- package/bin/{chunk-2291ehh5.js → chunk-ncqhp76x.js} +2 -2
- package/bin/chunk-njswnpaq.js +3 -0
- package/bin/{chunk-pb1zf0vb.js → chunk-nkmr6gqc.js} +2 -2
- package/bin/chunk-nngp6fhe.js +1 -0
- package/bin/chunk-nzggcbgk.js +20 -0
- package/bin/chunk-p1nb8wk8.js +3 -0
- package/bin/{chunk-6gg1ymer.js → chunk-p4yrnr37.js} +2 -2
- package/bin/chunk-pc2dnpkh.js +2 -0
- package/bin/{chunk-sfx2588q.js → chunk-pdrmbxrt.js} +2 -2
- package/bin/chunk-pmj9b8qt.js +3 -0
- package/bin/{chunk-h3tbf521.js → chunk-psk38vp4.js} +1 -1
- package/bin/{chunk-abt0azmv.js → chunk-pve3zpta.js} +2 -2
- package/bin/chunk-q3q0brsn.js +2 -0
- package/bin/{chunk-jy006gcv.js → chunk-qg1f1z3t.js} +4 -4
- package/bin/chunk-qk7me5ra.js +2 -0
- package/bin/{chunk-zehyn6vd.js → chunk-qqqarj5v.js} +2 -2
- package/bin/chunk-qysf4mpk.js +299 -0
- package/bin/chunk-r0j962y1.js +1 -0
- package/bin/chunk-r5dxd4sx.js +1 -0
- package/bin/{chunk-a32vreya.js → chunk-rq0n0vcc.js} +2 -2
- package/bin/chunk-s0caa0zm.js +5 -0
- package/bin/chunk-sa6k5ye7.js +1 -0
- package/bin/{chunk-83e12sjg.js → chunk-ss0mcgbd.js} +2 -2
- package/bin/chunk-sz6cnm4q.css +1 -0
- package/bin/{chunk-ck8azecb.js → chunk-tgee88jq.js} +5 -5
- package/bin/{chunk-ag6p3mbf.js → chunk-ty71fdw9.js} +2 -2
- package/bin/chunk-v0201sn5.js +3 -0
- package/bin/chunk-v2xt5p3x.js +10 -0
- package/bin/{chunk-2yxj593j.js → chunk-w3jmahea.js} +2 -2
- package/bin/chunk-w88h5wtf.js +1 -0
- package/bin/chunk-w9160hxz.js +5 -0
- package/bin/{chunk-k7hss0bd.js → chunk-wmkbkad1.js} +3 -3
- package/bin/{chunk-9t1ne8xr.js → chunk-wnpjz2kw.js} +2 -2
- package/bin/{chunk-8zqgaxvv.js → chunk-wrbas9cg.js} +1 -1
- package/bin/{chunk-j8fxp8ej.js → chunk-xcwjsav0.js} +1 -1
- package/bin/{chunk-jje8nj8h.js → chunk-xgy6ppww.js} +2 -2
- package/bin/{chunk-cnxwmycy.js → chunk-y13s3641.js} +3 -3
- package/bin/chunk-y78v01te.js +2 -0
- package/bin/{chunk-twdxayky.js → chunk-y8a3hans.js} +2 -2
- package/bin/chunk-z422yh6b.js +3 -0
- package/bin/chunk-z5t4yxzb.js +2 -0
- package/bin/chunk-zcfehv0w.js +18 -0
- package/bin/chunk-zg7a107s.js +3 -0
- package/bin/{chunk-e99dv20z.js → chunk-zp1sv030.js} +2 -2
- package/bin/{chunk-32pcmaqm.js → chunk-zrxe6p0q.js} +2 -2
- package/bin/chunk-zwenq5zy.js +2 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +987 -776
- package/package.json +7 -7
- package/prisma/migrations/20260907021754_add_asset_upload_id/migration.sql +2 -0
- package/prisma/migrations/20260913130237_add_asset_comment_asset_id_idx/migration.sql +2 -0
- package/prisma/schema.prisma +2 -0
- package/bin/chunk-185qefn1.js +0 -2
- package/bin/chunk-1kw2mbqb.js +0 -1
- package/bin/chunk-1wm6ptdx.js +0 -1
- package/bin/chunk-2520aq8j.js +0 -2
- package/bin/chunk-29zdp63z.js +0 -3
- package/bin/chunk-3swpwb9v.js +0 -1
- package/bin/chunk-3wmcx2bv.js +0 -2
- package/bin/chunk-5a8nt4me.js +0 -1
- package/bin/chunk-6bhn1p8v.js +0 -211
- package/bin/chunk-70c3xrgd.js +0 -2
- package/bin/chunk-7esm0hqb.js +0 -2
- package/bin/chunk-7fst8kdw.js +0 -12
- package/bin/chunk-a3dmtt2j.js +0 -1
- package/bin/chunk-aqbrzx9z.js +0 -1
- package/bin/chunk-awfwk64v.js +0 -2
- package/bin/chunk-b9yrw9et.js +0 -10
- package/bin/chunk-c007p0t8.js +0 -299
- package/bin/chunk-ce8m4zeg.js +0 -3
- package/bin/chunk-e2mvmq2m.js +0 -1
- package/bin/chunk-e7mqtkzn.js +0 -2
- package/bin/chunk-ejbvfj4r.js +0 -1
- package/bin/chunk-ekfem7kf.js +0 -1
- package/bin/chunk-etwkk0xh.js +0 -1
- package/bin/chunk-evrdd32b.js +0 -2
- package/bin/chunk-fm6p03ad.js +0 -2
- package/bin/chunk-fyha3r13.js +0 -2
- package/bin/chunk-g0vs7k2x.js +0 -1
- package/bin/chunk-g84z2w7v.js +0 -16
- package/bin/chunk-gk3eqd50.js +0 -2
- package/bin/chunk-h837fyed.js +0 -2
- package/bin/chunk-j20e0qsw.js +0 -7
- package/bin/chunk-p5gf1zdm.js +0 -4
- package/bin/chunk-pfgxggaj.js +0 -11
- package/bin/chunk-q16490pv.js +0 -2
- package/bin/chunk-qh81zhg1.js +0 -1
- package/bin/chunk-qwp3kwbz.js +0 -2
- package/bin/chunk-qydeqgyj.js +0 -5
- package/bin/chunk-r7dty1tg.js +0 -2
- package/bin/chunk-rhdxwebf.js +0 -2
- package/bin/chunk-rhh716z0.js +0 -42
- package/bin/chunk-rza4ae5z.js +0 -3
- package/bin/chunk-sk4e6rb1.js +0 -1
- package/bin/chunk-t2n1dbgx.js +0 -4
- package/bin/chunk-x8f4defx.js +0 -3
- package/bin/chunk-xtf3c29c.css +0 -1
- package/bin/chunk-z3gkt8w1.js +0 -3
- package/bin/chunk-zh6fqq44.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h,v,u,C,B,t,o,Q,ai,L,U,Me,Ue,A,T,or,Z,Te,de,Oe,E,S,Ce,Ee,Ie,he,ge,Ae,V,jg,qg,iy,Re,Yy,m0,y0,Wd,at,K0,W0,o_,Z_,ob,ab,gc,gv,tx,Vx,Yx,tS,rS,nS,oS,aS,Mh,sS,QS,va,_c,il,rE,ll,bc,vc,oE,wc,sE,PE,lI,dI,pI,mI,dp,fp,We,Ye,Je,Xe,et,tt,rt,nt,fe,ce,pe,qe,ue,It,q,Rt,R,Eg,G,je,Eo}from"./chunk-6bhn1p8v.js";import{Il}from"./chunk-7esm0hqb.js";import{gl}from"./chunk-fm6p03ad.js";import{Hs}from"./chunk-abt0azmv.js";import{Yn}from"./chunk-ag6p3mbf.js";import"./chunk-9t1ne8xr.js";import{Yr}from"./chunk-m7m9d4fb.js";var Se=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],te=T("arrow-down-wide-narrow",Se);var $e=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],se=T("sliders-vertical",$e);C();function ie({open:a,onOpenChange:c,mode:d,teamId:y,project:l}){let f=Q(),p=Me(),[n,w]=u(""),[k,N]=u(!0),[F,x]=u(void 0),[_,b]=u(void 0),[g,M]=u(!1),D=v(null);h(()=>{if(a)if(d==="edit"&&l)w(l.name||""),x(l.coverImageKey),b(l.coverImage),N(l.enableNotification!==!1);else w(""),x(void 0),b(void 0),N(!0)},[a,d,l]);let P=A.api.teams[":teamId"].projects.$post,{mutate:X}=U({mutationFn:async(i)=>{let s=await P({param:{teamId:y},json:i});if(!s.ok)throw Error(Z_());return await s.json()},onSuccess:(i)=>{f.invalidateQueries({queryKey:["teams",y,"projects"]}),c(!1);let s=i;if(s&&typeof s.id==="string")p({to:"/projects/$projectId",params:{projectId:s.id}})}}),K=A.api.projects[":projectId"].$put,{mutate:Y}=U({mutationFn:async(i)=>{let s=await K({param:{projectId:l.id},json:i});if(!s.ok)throw Error(ob());return await s.json()},onSuccess:()=>{f.invalidateQueries({queryKey:["teams",y,"projects"]}),c(!1)}}),J=A.api.teams[":teamId"].files.$post,{mutate:O}=U({mutationFn:async({file:i})=>{let s=await J({param:{teamId:y},form:{file:i}});if(!s.ok)throw Error(gc());return await s.json()},onSuccess:(i)=>{let s=i;if(s&&typeof s.key==="string")x(s.key);M(!1)},onError:()=>{M(!1)}}),m=(i)=>{let s=i.target.files?.[0];if(s){M(!0);let ee=URL.createObjectURL(s);b(ee),O({file:s})}},j=()=>{D.current?.click()},z=(i)=>{i.stopPropagation(),x(void 0),b(void 0)},I=()=>{if(!n.trim())return;if(d==="create")X({name:n.trim(),coverImageKey:F,enableNotification:k});else if(d==="edit"&&l?.id)Y({name:n.trim(),coverImageKey:F,enableNotification:k})};return t(fe,{open:a,onOpenChange:c,children:o(ce,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[o(pe,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[t("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),t("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),t("div",{className:"flex items-center gap-3",children:o("div",{children:[t(ue,{className:"text-xl font-semibold tracking-tight text-foreground",children:d==="create"?y0():Mh()}),t(It,{className:"text-xs text-muted-foreground/80 mt-1",children:d==="create"?Yy():gv()})]})})]}),o("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[o("div",{className:"space-y-2",children:[t(G,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:tS()}),o("div",{className:"relative",children:[t(q,{id:"name",value:n,onChange:(i)=>w(i.target.value),placeholder:nS(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),n.trim()&&t("div",{className:"absolute inset-y-0 right-3 flex items-center",children:t(Te,{className:"w-4 h-4 text-primary"})})]}),t("p",{className:"text-[11px] text-muted-foreground",children:rS()})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o("div",{className:"flex items-center justify-between",children:[o(G,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(Yr,{className:"w-4 h-4 text-primary"}),Yx()]}),_&&o("button",{type:"button",onClick:z,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[t(Oe,{className:"w-3.5 h-3.5"}),QS()]})]}),o("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:j,children:[t("input",{type:"file",ref:D,className:"hidden",accept:"image/*",onChange:m}),g&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(Z,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold text-foreground",children:fp()})]})}),_?o(B,{children:[t("img",{src:_,alt:m0(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),o("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[t(Yn,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:dp()})]})]}):o("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[t("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(Yn,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:pI()}),t("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:mI()})]})]})]})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o(G,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(se,{className:"w-4 h-4 text-primary"}),aS()]}),o("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[o("div",{className:"space-y-1 pr-4",children:[o("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[t(Hs,{className:"w-4 h-4 text-primary"}),jg()]}),t("p",{className:"text-xs text-muted-foreground leading-normal",children:qg()})]}),t(je,{checked:k,onCheckedChange:N,disabled:g,className:"mt-0.5"})]})]})]}),o(qe,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[t(S,{type:"button",variant:"ghost",onClick:()=>c(!1),disabled:g,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:Re()}),t(S,{type:"submit",onClick:I,disabled:!n.trim()||g,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:g?o(B,{children:[t(Z,{className:"w-4 h-4 animate-spin"}),Vx()]}):d==="create"?Wd():va()})]})]})})}function le({sortBy:a,sortDirection:c,onSortChange:d}){let y=(n)=>{d(n,c)},l=()=>{d(a,c==="asc"?"desc":"asc")},f=(n)=>{switch(n){case"name":return ll();case"created_at":return rE();case"updated_at":return oE();default:return n}},p=c==="asc";return o(he,{children:[t(ge,{asChild:!0,children:o(S,{variant:"outline",className:"gap-2 bg-muted/50",children:[t("span",{className:"text-muted-foreground",children:sE()}),t("span",{className:"font-medium text-foreground",children:f(a)})]})}),o(Ae,{align:"end",className:"w-56 p-2",children:[t("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:il()}),o(he,{children:[t(ge,{asChild:!0,children:o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[t("span",{children:f(a)}),t(te,{className:"h-4 w-4 opacity-50"})]})}),t(Ae,{className:"w-52",children:["name","created_at","updated_at"].map((n)=>o(V,{onClick:()=>y(n),className:"justify-between",children:[f(n),a===n&&t(Te,{className:"h-4 w-4"})]},n))})]}),o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:l,children:[t("span",{className:"text-muted-foreground",children:a==="name"?p?t(B,{children:_c()}):t(B,{children:wc()}):p?t(B,{children:vc()}):t(B,{children:bc()})}),p?t(gl,{className:"h-4 w-4 opacity-50"}):t(te,{className:"h-4 w-4 opacity-50"})]})]})]})}C();function Le(){let{teamId:a}=Ke.useParams(),{canEdit:c,canAdmin:d}=Rt(),y=Me(),l=Q(),[f,p]=u(null),[n,w]=u(!1),[k,N]=u("create"),[F,x]=u(void 0),[_,b]=u(!1),[g,M]=u(void 0),[D,P]=u(""),[X,K]=u(!1),{metadata:Y,setMetadata:J}=Eo(),O=`team:${a}:projects:sort`,m=Y[O],[j,z]=u(()=>m?.sortBy||"name"),[I,i]=u(()=>m?.sortDirection||"asc");h(()=>{if(m?.sortBy&&m.sortBy!==j)z(m.sortBy);if(m?.sortDirection&&m.sortDirection!==I)i(m.sortDirection)},[m]);let s=A.api.teams[":teamId"].projects.$get,{data:ee}=L({queryKey:["teams",a,"projects",j,I],queryFn:async()=>{let e=await s({param:{teamId:a},query:{sortBy:j,sortDirection:I}});if(!e.ok)throw Error("Failed to fetch projects");return await e.json()},placeholderData:ai}),{data:oe}=L({queryKey:["teams",a,"members"],queryFn:async()=>{let e=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!e.ok)throw Error("Failed to fetch members");return await e.json()}}),{data:re}=L({queryKey:["teams",a,"me"],queryFn:async()=>{let e=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!e.ok)throw Error("Failed to fetch me");return await e.json()}}),me=A.api.teams[":teamId"].invite.$post,ve=U({mutationFn:async(e)=>{let r=await me(e);if(!r.ok)throw Error("Failed to invite");return await r.json()}}),H=U({mutationFn:async(e)=>{if(!(await A.api.projects[":projectId"].$delete({param:{projectId:e}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]})}}),ye=U({mutationFn:async(e)=>{let r=await A.api.projects[":projectId"].$put({param:{projectId:e.id},json:{enableNotification:!e.enableNotification}});if(!r.ok)throw Error("Failed to update project notification settings");return await r.json()},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]}),R.success(oS())},onError:(e)=>{R.error(e instanceof Error?e.message:ab())}}),ae=()=>{N("create"),x(void 0),w(!0)},be=()=>{p("create"),setTimeout(()=>{p(null)},100),setTimeout(()=>{ae()},200)},we=(e)=>{N("edit"),x(e),w(!0)},xe=(e)=>{M(e),P(""),b(!0)},Ne=async()=>{if(g&&D==="delete")try{await H.mutateAsync(g.id),b(!1)}catch(e){console.error(e)}},De=(e,r)=>{if(r.detail>1)return;p(e),setTimeout(()=>{p(null)},100),setTimeout(()=>{y({to:"/projects/$projectId",params:{projectId:e}})},200)},ke=async(e)=>(await ve.mutateAsync({param:{teamId:a},json:{role:e}})).code,_e=U({mutationFn:async({userId:e,role:r})=>{if(!(await A.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:a,userId:e},json:{role:r}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Fe=U({mutationFn:async(e)=>{if(!(await A.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:a,userId:e}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Pe=(e)=>{if(!e)return"??";return e.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()},Be=(e,r)=>{z(e),i(r),J(a,O,{sortBy:e,sortDirection:r})},W=Array.isArray(oe)?oe:[];return o("div",{className:"flex-1 overflow-y-auto p-4",children:[o("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[t("h1",{className:"text-2xl font-bold",children:sS()}),o("div",{className:"flex flex-wrap items-center gap-4",children:[o("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>K(!0),"data-testid":"team-members-trigger",children:[W.slice(0,3).map((e)=>o(Ce,{className:"border-2 border-background w-8 h-8",children:[e.image&&t(Ee,{src:e.image,alt:e.name,className:"object-cover"}),t(Ie,{className:"text-[10px]",children:Pe(e.name)})]},e.id)),W.length>3&&o("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",W.length-3]})]}),t(le,{sortBy:j,sortDirection:I,onSortChange:Be}),c&&o(S,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:ae,children:[t(de,{className:"w-4 h-4"}),Wd()]})]})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[ee?.data?.map((e)=>t("div",{className:E("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",f===e.id?"scale-95":"scale-100"),onClick:(r)=>De(e.id,r),children:o("div",{className:"flex flex-col",children:[o("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[e.coverImage?t("img",{src:e.coverImage,alt:e.name,className:"w-full h-full object-cover rounded"}):o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[t("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),t("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),t("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),t("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),t("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),t("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),t("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),t("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),t("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),t("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),t("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),t("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),t("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),t("p",{className:"absolute left-1 bottom-2 text-white",children:e.name})]}),o("div",{className:"px-2 h-10 flex justify-between items-center",children:[o("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[dI()," ",Eg(e.updatedAt??"")]}),t("div",{onClick:(r)=>r.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t("button",{className:"hover:bg-muted outline-none flex px-1",children:t(or,{className:"w-5 h-5 text-muted-foreground"})})}),o(Ae,{align:"end",children:[c&&t(V,{onClick:(r)=>{r.stopPropagation(),we(e)},children:Mh()}),o(V,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(r)=>{r.preventDefault(),ye.mutate(e)},children:[t("span",{children:tx()}),t(je,{checked:e.enableNotification??!0,className:"pointer-events-none"})]}),d&&t(V,{className:"text-destructive focus:text-destructive",onClick:()=>xe(e),children:at()})]})]})})]})]})},e.id)),c&&t("div",{className:E("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",f==="create"?"scale-95":"scale-100"),onClick:be,children:o("div",{className:"flex flex-col",children:[t("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:t(de,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),t("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:t("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:Wd()})})]})})]}),t(ie,{open:n,onOpenChange:w,mode:k,teamId:a,project:F}),t(We,{open:_,onOpenChange:b,children:o(Ye,{children:[o(Je,{children:[t(et,{children:iy()}),o(tt,{children:[W0({name:g?.name??""}),o("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[t("span",{className:"text-sm font-medium",children:lI()}),t(q,{value:D,onChange:(e)=>P(e.target.value),placeholder:K0(),className:"h-9",autoFocus:!0})]})]})]}),o(Xe,{children:[t(nt,{disabled:H.isPending,children:Re()}),t(rt,{onClick:(e)=>{e.preventDefault(),Ne()},disabled:D!=="delete"||H.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:H.isPending?o_():at()})]})]})}),t(Il,{open:X,onOpenChange:K,title:PE(),type:"team",members:W,isOwner:re?.role==="owner",onInvite:ke,onUpdateRole:async(e,r)=>{await _e.mutateAsync({userId:e,role:r})},onRemoveMember:async(e)=>{await Fe.mutateAsync(e)},currentUserId:re?.id})]})}var Ke=Ue("/teams/$teamId/")({component:Le});export{Ke as Route};
|
|
1
|
+
import{h,w,u,C,B,t,o,W,wi,Z,U,Me,Fe,A,T,rr,L,Re,pe,ke,E,S,Ee,Ie,Te,he,ge,Ae,K,mA,hA,Py,Pe,v0,U0,q0,bf,at,b_,w_,M_,lb,kb,Pb,Dc,qw,Cx,yS,wS,CS,ES,IS,TS,MS,tg,RS,AC,Us,Bc,xl,EE,Sl,Uc,Fc,TE,zc,RE,rI,PI,DI,ZI,BI,Dp,Lp,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,$e,le,Tt,H,Pt,R,Jg,V,qe,Lo}from"./chunk-2swjkvxv.js";import{Fl}from"./chunk-a0fggks8.js";import{Pl}from"./chunk-pc2dnpkh.js";import{ui}from"./chunk-pve3zpta.js";import{so}from"./chunk-ty71fdw9.js";import{rn}from"./chunk-cwfjvynz.js";import"./chunk-wnpjz2kw.js";var Le=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],te=T("arrow-down-wide-narrow",Le);var Ke=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],se=T("sliders-vertical",Ke);C();function ce({open:a,onOpenChange:c,mode:d,teamId:v,project:l}){let f=W(),p=Me(),[n,b]=u(""),[k,N]=u(!0),[F,x]=u(void 0),[_,y]=u(void 0),[g,M]=u(!1),D=w(null);h(()=>{if(a)if(d==="edit"&&l)b(l.name||""),x(l.coverImageKey),y(l.coverImage),N(l.enableNotification!==!1);else b(""),x(void 0),y(void 0),N(!0)},[a,d,l]);let P=A.api.teams[":teamId"].projects.$post,{mutate:Y}=U({mutationFn:async(i)=>{let s=await P({param:{teamId:v},json:i});if(!s.ok)throw Error(lb());return await s.json()},onSuccess:(i)=>{f.invalidateQueries({queryKey:["teams",v,"projects"]}),c(!1);let s=i;if(s&&typeof s.id==="string")p({to:"/projects/$projectId",params:{projectId:s.id}})}}),q=A.api.projects[":projectId"].$put,{mutate:G}=U({mutationFn:async(i)=>{let s=await q({param:{projectId:l.id},json:i});if(!s.ok)throw Error(kb());return await s.json()},onSuccess:()=>{f.invalidateQueries({queryKey:["teams",v,"projects"]}),c(!1)}}),J=A.api.teams[":teamId"].files.$post,{mutate:O}=U({mutationFn:async({file:i})=>{let s=await J({param:{teamId:v},form:{file:i}});if(!s.ok)throw Error(Dc());return await s.json()},onSuccess:(i)=>{let s=i;if(s&&typeof s.key==="string")x(s.key);M(!1)},onError:()=>{M(!1)}}),m=(i)=>{let s=i.target.files?.[0];if(s){M(!0);let ee=URL.createObjectURL(s);y(ee),O({file:s})}},j=()=>{D.current?.click()},z=(i)=>{i.stopPropagation(),x(void 0),y(void 0)},I=()=>{if(!n.trim())return;if(d==="create")Y({name:n.trim(),coverImageKey:F,enableNotification:k});else if(d==="edit"&&l?.id)G({name:n.trim(),coverImageKey:F,enableNotification:k})};return t(ue,{open:a,onOpenChange:c,children:o(ie,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[o(me,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[t("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),t("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),t("div",{className:"flex items-center gap-3",children:o("div",{children:[t(le,{className:"text-xl font-semibold tracking-tight text-foreground",children:d==="create"?q0():tg()}),t(Tt,{className:"text-xs text-muted-foreground/80 mt-1",children:d==="create"?v0():qw()})]})})]}),o("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[o("div",{className:"space-y-2",children:[t(V,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:CS()}),o("div",{className:"relative",children:[t(H,{id:"name",value:n,onChange:(i)=>b(i.target.value),placeholder:IS(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),n.trim()&&t("div",{className:"absolute inset-y-0 right-3 flex items-center",children:t(Re,{className:"w-4 h-4 text-primary"})})]}),t("p",{className:"text-[11px] text-muted-foreground",children:ES()})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o("div",{className:"flex items-center justify-between",children:[o(V,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(rn,{className:"w-4 h-4 text-primary"}),wS()]}),_&&o("button",{type:"button",onClick:z,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[t(ke,{className:"w-3.5 h-3.5"}),AC()]})]}),o("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:j,children:[t("input",{type:"file",ref:D,className:"hidden",accept:"image/*",onChange:m}),g&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(L,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold text-foreground",children:Lp()})]})}),_?o(B,{children:[t("img",{src:_,alt:U0(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),o("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[t(so,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:Dp()})]})]}):o("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[t("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(so,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:ZI()}),t("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:BI()})]})]})]})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o(V,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(se,{className:"w-4 h-4 text-primary"}),MS()]}),o("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[o("div",{className:"space-y-1 pr-4",children:[o("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[t(ui,{className:"w-4 h-4 text-primary"}),mA()]}),t("p",{className:"text-xs text-muted-foreground leading-normal",children:hA()})]}),t(qe,{checked:k,onCheckedChange:N,disabled:g,className:"mt-0.5"})]})]})]}),o($e,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[t(S,{type:"button",variant:"ghost",onClick:()=>c(!1),disabled:g,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:Pe()}),t(S,{type:"submit",onClick:I,disabled:!n.trim()||g,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:g?o(B,{children:[t(L,{className:"w-4 h-4 animate-spin"}),yS()]}):d==="create"?bf():Us()})]})]})})}function de({sortBy:a,sortDirection:c,onSortChange:d}){let v=(n)=>{d(n,c)},l=()=>{d(a,c==="asc"?"desc":"asc")},f=(n)=>{switch(n){case"name":return Sl();case"created_at":return EE();case"updated_at":return TE();default:return n}},p=c==="asc";return o(he,{children:[t(ge,{asChild:!0,children:o(S,{variant:"outline",className:"gap-2 bg-muted/50",children:[t("span",{className:"text-muted-foreground",children:RE()}),t("span",{className:"font-medium text-foreground",children:f(a)})]})}),o(Ae,{align:"end",className:"w-56 p-2",children:[t("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:xl()}),o(he,{children:[t(ge,{asChild:!0,children:o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[t("span",{children:f(a)}),t(te,{className:"h-4 w-4 opacity-50"})]})}),t(Ae,{className:"w-52",children:["name","created_at","updated_at"].map((n)=>o(K,{onClick:()=>v(n),className:"justify-between",children:[f(n),a===n&&t(Re,{className:"h-4 w-4"})]},n))})]}),o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:l,children:[t("span",{className:"text-muted-foreground",children:a==="name"?p?t(B,{children:Bc()}):t(B,{children:zc()}):p?t(B,{children:Fc()}):t(B,{children:Uc()})}),p?t(Pl,{className:"h-4 w-4 opacity-50"}):t(te,{className:"h-4 w-4 opacity-50"})]})]})]})}C();function Ue(){let{teamId:a}=Oe.useParams(),{canEdit:c,canAdmin:d}=Pt(),v=Me(),l=W(),[f,p]=u(null),[n,b]=u(!1),[k,N]=u("create"),[F,x]=u(void 0),[_,y]=u(!1),[g,M]=u(void 0),[D,P]=u(""),[Y,q]=u(!1),{metadata:G,setMetadata:J}=Lo(),O=`team:${a}:projects:sort`,m=G[O],[j,z]=u(()=>m?.sortBy||"name"),[I,i]=u(()=>m?.sortDirection||"asc");h(()=>{if(m?.sortBy&&m.sortBy!==j)z(m.sortBy);if(m?.sortDirection&&m.sortDirection!==I)i(m.sortDirection)},[m]);let s=A.api.teams[":teamId"].projects.$get,{data:ee}=Z({queryKey:["teams",a,"projects",j,I],queryFn:async()=>{let e=await s({param:{teamId:a},query:{sortBy:j,sortDirection:I}});if(!e.ok)throw Error("Failed to fetch projects");return await e.json()},placeholderData:wi}),{data:oe}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let e=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!e.ok)throw Error("Failed to fetch members");return await e.json()}}),{data:re}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let e=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!e.ok)throw Error("Failed to fetch me");return await e.json()}}),fe=A.api.teams[":teamId"].invite.$post,ve=U({mutationFn:async(e)=>{let r=await fe(e);if(!r.ok)throw Error("Failed to invite");return await r.json()}}),Q=U({mutationFn:async(e)=>{if(!(await A.api.projects[":projectId"].$delete({param:{projectId:e}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]})}}),ye=U({mutationFn:async(e)=>{let r=await A.api.projects[":projectId"].$put({param:{projectId:e.id},json:{enableNotification:!e.enableNotification}});if(!r.ok)throw Error("Failed to update project notification settings");return await r.json()},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]}),R.success(TS())},onError:(e)=>{R.error(e instanceof Error?e.message:Pb())}}),ae=()=>{N("create"),x(void 0),b(!0)},be=()=>{p("create"),setTimeout(()=>{p(null)},100),setTimeout(()=>{ae()},200)},we=(e)=>{N("edit"),x(e),b(!0)},xe=(e)=>{M(e),P(""),y(!0)},Ne=async()=>{if(g&&D==="delete")try{await Q.mutateAsync(g.id),y(!1)}catch(e){console.error(e)}},De=(e,r)=>{if(r.detail>1)return;p(e),setTimeout(()=>{p(null)},100),setTimeout(()=>{v({to:"/projects/$projectId",params:{projectId:e}})},200)},je=async(e)=>(await ve.mutateAsync({param:{teamId:a},json:{role:e}})).code,Ce=U({mutationFn:async({userId:e,role:r})=>{if(!(await A.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:a,userId:e},json:{role:r}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),_e=U({mutationFn:async(e)=>{if(!(await A.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:a,userId:e}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Be=(e)=>{if(!e)return"??";return e.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()},Se=(e,r)=>{z(e),i(r),J(a,O,{sortBy:e,sortDirection:r})},X=Array.isArray(oe)?oe:[];return o("div",{className:"flex-1 overflow-y-auto p-4",children:[o("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[t("h1",{className:"text-2xl font-bold",children:RS()}),o("div",{className:"flex flex-wrap items-center gap-4",children:[o("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>q(!0),"data-testid":"team-members-trigger",children:[X.slice(0,3).map((e)=>o(Ee,{className:"border-2 border-background w-8 h-8",children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:Be(e.name)})]},e.id)),X.length>3&&o("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",X.length-3]})]}),t(de,{sortBy:j,sortDirection:I,onSortChange:Se}),c&&o(S,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:ae,children:[t(pe,{className:"w-4 h-4"}),bf()]})]})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[ee?.data?.map((e)=>t("div",{className:E("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",f===e.id?"scale-95":"scale-100"),onClick:(r)=>De(e.id,r),children:o("div",{className:"flex flex-col",children:[o("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[e.coverImage?t("img",{src:e.coverImage,alt:e.name,className:"w-full h-full object-cover rounded"}):o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[t("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),t("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),t("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),t("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),t("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),t("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),t("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),t("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),t("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),t("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),t("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),t("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),t("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),t("p",{className:"absolute left-1 bottom-2 text-white",children:e.name})]}),o("div",{className:"px-2 h-10 flex justify-between items-center",children:[o("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[DI()," ",Jg(e.updatedAt??"")]}),t("div",{onClick:(r)=>r.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t("button",{className:"hover:bg-muted outline-none flex px-1",children:t(rr,{className:"w-5 h-5 text-muted-foreground"})})}),o(Ae,{align:"end",children:[c&&t(K,{onClick:(r)=>{r.stopPropagation(),we(e)},children:tg()}),o(K,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(r)=>{r.preventDefault(),ye.mutate(e)},children:[t("span",{children:Cx()}),t(qe,{checked:e.enableNotification??!0,className:"pointer-events-none"})]}),d&&t(K,{className:"text-destructive focus:text-destructive",onClick:()=>xe(e),children:at()})]})]})})]})]})},e.id)),c&&t("div",{className:E("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",f==="create"?"scale-95":"scale-100"),onClick:be,children:o("div",{className:"flex flex-col",children:[t("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:t(pe,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),t("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:t("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:bf()})})]})})]}),t(ce,{open:n,onOpenChange:b,mode:k,teamId:a,project:F}),t(Je,{open:_,onOpenChange:y,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Py()}),o(nt,{children:[w_({name:g?.name??""}),o("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[t("span",{className:"text-sm font-medium",children:PI()}),t(H,{value:D,onChange:(e)=>P(e.target.value),placeholder:b_(),className:"h-9",autoFocus:!0})]})]})]}),o(tt,{children:[t(st,{disabled:Q.isPending,children:Pe()}),t(ot,{onClick:(e)=>{e.preventDefault(),Ne()},disabled:D!=="delete"||Q.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Q.isPending?M_():at()})]})]})}),t(Fl,{open:Y,onOpenChange:q,title:rI(),type:"team",members:X,isOwner:re?.role==="owner",onInvite:je,onUpdateRole:async(e,r)=>{await Ce.mutateAsync({userId:e,role:r})},onRemoveMember:async(e)=>{await _e.mutateAsync(e)},currentUserId:re?.id})]})}var Oe=Fe("/teams/$teamId/")({component:Ue});export{Oe as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T,
|
|
2
|
-
export{
|
|
1
|
+
import{T,ap,ip,lp,cp,bd,wd,vd,xd,Sd,Kc}from"./chunk-2swjkvxv.js";import{So}from"./chunk-dchtr0ap.js";import{Co}from"./chunk-q3q0brsn.js";var o=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],qs=T("activity",o);var a=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],no=T("cpu",a);var r=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Bo=T("gauge",r);var c=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],pn=T("server",c);var n=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],jl=T("shield-alert",n);var i=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],ci=T("user-check",i);var u=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],li=T("dollar-sign",u);var zi={agent_total_tokens:{label:()=>Sd(),icon:no,unit:"tokens"},agent_cost:{label:()=>wd(),icon:li,unit:"$"},agent_mcp_call_count:{label:()=>vd(),icon:pn,unit:"calls"},agent_bash_call_count:{label:()=>bd(),icon:Co,unit:"calls"},agent_tool_call_count:{label:()=>xd(),icon:So,unit:"calls"}};function Ma(e,t){if(e==="agent_cost")return`$${t.toFixed(2)}`;return t.toLocaleString()}function ql(e){switch(Kc(e)){case"1hour":return ip();case"5hour":return lp();case"1day":return ap();case"7day":return cp();default:return e}}
|
|
2
|
+
export{qs,no,li,Bo,pn,jl,ci,zi,Ma,ql};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{h,w,u,C,B,t,o,W,U,A,L,$r,we,ht,gt,Ns,pe,S,he,ge,Ae,K,Pe,Ya,$m,at,Nc,Oc,th,$_,G_,hh,gh,Ah,$f,Gf,Qf,Vf,gl,zh,Yf,Jf,Yh,Jh,pp,_g,Zg,Mp,TI,Np,Op,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,$e,le,Tt,H,Pt,Mt,R,Vr,dn,sA}from"./chunk-2swjkvxv.js";import{Yc,Jc,Xc,eu,tu}from"./chunk-685gzbdg.js";import{Zo}from"./chunk-qysf4mpk.js";import{so}from"./chunk-ty71fdw9.js";C();var Ee=[];function Ll({teamId:r,projectId:y,assetId:m,folders:a,files:l,totalFolders:Se,totalFiles:Me,totalFoldersSize:Re,totalFilesSize:ze,selectedItem:J,selectedIds:D,onItemSelect:X,onItemDoubleClick:Y,onSaveField:Ue,onClearSelection:Be,fetchNextFoldersPage:Z,hasNextFoldersPage:ee,isFetchingNextFoldersPage:b,fetchNextFilesPage:te,hasNextFilesPage:oe,isFetchingNextFilesPage:x,isRecentlyDeleted:k=!1,isRecents:N=!1,isLoading:se=!1,isShareView:q=!1,isPublic:re=!1,shareId:qe,allowDownload:ne=!0}){let d=W(),{canEdit:_,canAdmin:Oe}=Pt(y),ae=w(null),de=w(null),[O,We]=u(!0),[j,je]=u(!0),[Qe,F]=u(!1),[I,ce]=u(""),[He,Q]=u(!1),fe=Se??a.length,ve=Me??l.length,De=Re??(a.length>0?a.reduce((e,s)=>e+(s.sizeByte||0),0):-1),ye=ze??(l.length>0?l.reduce((e,s)=>e+(s.sizeByte||0),0):-1),Ke=De>-1,Le=ye>-1,be=(e,s)=>{if(s)return e===1?Gf({count:e}):$f({count:e});else return e===1?Vf({count:e}):Qf({count:e})},{editingItemId:xe,setEditingItemId:ke,handleAction:Ce,onRenameSubmit:Ne,isDeleteDialogOpen:Ve,setIsDeleteDialogOpen:Ge,confirmDelete:Ye,isDownloadDialogOpen:Ze,setIsDownloadDialogOpen:P,isLoadingLinks:T,resolvedFiles:_e,startDownload:it}=tu({teamId:r,projectId:y,assetId:m,folders:a,files:l,selectedIds:D,isPublic:re,shareId:qe}),{ref:lt,inView:Fe}=Mt();h(()=>{if(Fe){if(ee&&!b)Z();else if(oe&&!x)te()}},[Fe,ee,b,oe,x,Z,te]);let dt=dn((e)=>e.startTask),ct=A.api.teams[":teamId"].upload.tasks.$post,{mutate:mt}=U({mutationFn:async(e)=>{let s=await ct(e);if(!s.ok)throw Error("Failed to create upload task");return await s.json()},onMutate:()=>({files:[...Ee]}),onSuccess:async(e,s,n)=>{let p=n?.files||[],f=p.map((i)=>{let v=e.createdAssets?.find((c)=>c.tempId===i.id),M=e.presignedUrls?.find((c)=>c.id===i.id);return{fileId:v?.assetId||M?.fileId||i.id,name:i.file.name,size:i.file.size}}).filter((i)=>!!i.fileId),g=p.filter((i)=>!i.file.name.startsWith(".")),E=g.length===1?g[0].file.name:`${g.length} Items`;if(e.taskId)dt(e.taskId,E,f);d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]}),await Jc({files:p,taskId:e.taskId,teamId:r,storageBackend:e.storageBackend||"local",createdAssets:e.createdAssets,presignedUrls:e.presignedUrls,onFileFinished:async()=>{await d.invalidateQueries({queryKey:["search",r,m]})}}),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]})}}),Ie=(e)=>{if(!e||e.length===0)return;let s=[],n=[],p=new Map;for(let f of e){let g=(f.webkitRelativePath||f.name).split("/");if(g.some((z)=>z.startsWith(".")))continue;let E=g.pop(),i=n,v="";for(let z of g)if(v=`${v}/${z}`,!p.has(v)){let G=[],Dt={name:z,type:"folder",id:Zo(),children:G,size:0};i.push(Dt),p.set(v,G),i=G}else i=p.get(v);let M={file:f,id:Zo()};s.push(M);let c=f.type;if(E.toLowerCase().endsWith(".wma")&&c?.startsWith("video/"))c=c.replace(/^video\//,"audio/");i.push({name:E,size:f.size,type:"file",id:M.id,children:[],mediaType:c})}Ee=s,mt({param:{teamId:r},json:{parentId:m,files:n}})},pt=A.api.folders.$post,{mutate:ut,isPending:Te}=U({mutationFn:async(e)=>{let s=await pt({json:{name:e,parentId:m}});if(!s.ok)throw Error("Failed to create folder");return await s.json()},onSuccess:()=>{R.success(gl()),F(!1),ce(""),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["folders"]})},onError:(e)=>{R.error(`Error: ${e.message}`)}}),{mutate:ft,isPending:V}=U({mutationFn:async()=>{let e=await A.api.projects[":projectId"]["empty-trash"].$post({param:{projectId:y}});if(!e.ok)throw Error("Failed to empty trash");return await e.json()},onSuccess:()=>{R.success(TI()),d.invalidateQueries({queryKey:["projects",y,"recently-deleted"]}),Be(),Q(!1)},onError:(e)=>{R.error(`Error: ${e.message}`)}}),vt=(e)=>{if(e.preventDefault(),!I.trim())return;ut(I.trim())},wt=!se&&a.length===0&&l.length===0&&!b&&!x;return o("div",{className:"flex-1 flex flex-col min-h-0 bg-background overflow-hidden relative",children:[_&&o(B,{children:[t("input",{type:"file",ref:ae,multiple:!0,className:"hidden",onChange:(e)=>{if(e.target.files)Ie(e.target.files)}}),t("input",{type:"file",ref:de,multiple:!0,webkitdirectory:"true",className:"hidden",onChange:(e)=>{if(e.target.files)Ie(e.target.files)}})]}),k&&o("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border text-sm shrink-0",children:[o("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t($r,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{className:"text-xs",children:pp()})]}),Oe&&t(S,{variant:"destructive",size:"sm",disabled:V||a.length===0&&l.length===0,onClick:()=>Q(!0),className:"h-7 px-2.5 text-xs font-medium bg-destructive/10 text-destructive border border-destructive/20 hover:bg-destructive hover:text-destructive-foreground",children:"Delete"})]}),o("div",{className:"flex-1 overflow-y-auto min-h-0 p-3 pb-24",children:[se&&a.length===0&&l.length===0?t(sA,{}):o("div",{className:"max-w-lg mx-auto w-full",children:[fe>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>We(!O),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[O?t(we,{className:"h-4 w-4"}):t(ht,{className:"h-4 w-4"}),o("span",{children:[be(fe,!1),Ke?` • ${Vr(De)}`:""]})]}),O&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:a.map((e)=>t(eu,{item:e,isSelected:J?.id===e.id,isChecked:D.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>Ne(e,s),onFinishEditing:()=>ke(null),onAction:(s,n)=>Ce(s,n),isRecentlyDeleted:k,isRecents:N,selectedCount:D.size,canEdit:_,isShareView:q,allowDownload:ne},e.id))})]}),ve>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>je(!j),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[j?t(we,{className:"h-4 w-4"}):t(ht,{className:"h-4 w-4"}),o("span",{children:[be(ve,!0),Le?` • ${Vr(ye)}`:""]})]}),j&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:l.map((e)=>t(Xc,{teamId:r,item:e,isSelected:J?.id===e.id,isChecked:D.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>Ne(e,s),onFinishEditing:()=>ke(null),onSaveField:(s,n)=>Ue?.(e.id,s,n),fields:[],onAction:(s,n)=>Ce(s,n),isRecentlyDeleted:k,isRecents:N,selectedCount:D.size,canEdit:_,isShareView:q,allowDownload:ne},e.id))})]})]}),wt&&t("div",{className:"flex flex-col items-center justify-center h-64 text-sm text-muted-foreground p-6 text-center",children:N?o("div",{className:"flex flex-col items-center gap-2",children:[t(Ns,{className:"h-10 w-10 text-muted-foreground/40 mb-1"}),t("p",{className:"font-medium text-foreground",children:Yf()}),t("p",{className:"text-xs text-muted-foreground",children:Jf()})]}):t("span",{children:Mp()})}),t("div",{ref:lt,className:"py-4 flex justify-center items-center min-h-6",children:(b||x)&&t(L,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]}),_&&!k&&!N&&!q&&!re&&t("div",{className:"fixed bottom-6 right-6 z-30",children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(S,{size:"icon",className:"h-14 w-14 rounded-full bg-primary text-primary-foreground shadow-lg shadow-primary/25 hover:bg-primary/90 flex items-center justify-center","aria-label":"Actions",children:t(pe,{className:"h-6 w-6"})})}),o(Ae,{align:"end",side:"top",className:"w-48 mb-2",children:[o(K,{onClick:()=>ae.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(so,{className:"h-4 w-4"}),t("span",{children:Np()})]}),o(K,{onClick:()=>de.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(so,{className:"h-4 w-4"}),t("span",{children:Op()})]}),o(K,{onClick:()=>F(!0),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(Yc,{className:"h-4 w-4"}),t("span",{children:gl()})]})]})]})}),t(ue,{open:Qe,onOpenChange:F,children:t(ie,{className:"sm:max-w-md",children:o("form",{onSubmit:vt,children:[o(me,{children:[t(le,{children:gl()}),t(Tt,{children:gh()})]}),t("div",{className:"py-4",children:t(H,{autoFocus:!0,placeholder:gh(),value:I,onChange:(e)=>ce(e.target.value)})}),o($e,{children:[t(S,{type:"button",variant:"outline",onClick:()=>F(!1),children:Pe()}),o(S,{type:"submit",disabled:!I.trim()||Te,children:[Te?t(L,{className:"h-4 w-4 animate-spin mr-2"}):null,Ya()]})]})]})})}),t(Je,{open:Ve,onOpenChange:Ge,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Oc()}),t(nt,{children:Nc()})]}),o(tt,{children:[t(st,{children:Pe()}),t(ot,{onClick:()=>Ye(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:at()})]})]})}),t(Je,{open:He,onOpenChange:Q,children:o(Xe,{children:[o(et,{children:[t(rt,{children:G_()}),t(nt,{children:$_()})]}),o(tt,{children:[t(st,{children:Pe()}),t(ot,{onClick:()=>ft(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:V,children:V?"Deleting...":at()})]})]})}),t(ue,{open:Ze,onOpenChange:P,children:o(ie,{className:"sm:max-w-md",children:[o(me,{children:[t(le,{children:T?Yh():$m()}),t(Tt,{children:T?_g():hh()})]}),T?o("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[t(L,{className:"h-8 w-8 animate-spin text-primary"}),t("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:Jh()})]}):o("div",{className:"space-y-4 py-2",children:[t("div",{className:"text-sm text-muted-foreground",children:th({count:_e.length})}),o("div",{className:"flex items-start gap-3 p-3 text-sm rounded-lg bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 border border-amber-200 dark:border-amber-900/30",children:[t($r,{className:"h-5 w-5 shrink-0 mt-0.5"}),o("div",{children:[t("p",{className:"font-semibold",children:zh()}),t("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:Ah()})]})]})]}),t($e,{children:!T?o(B,{children:[t(S,{variant:"outline",onClick:()=>P(!1),children:Pe()}),o(S,{onClick:it,className:"gap-2",disabled:_e.length===0,children:[t(gt,{className:"h-4 w-4"}),Zg()]})]}):t(S,{variant:"outline",onClick:()=>P(!1),children:Pe()})})]})})]})}
|
|
2
|
+
export{Ll};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{uf}from"./chunk-nzggcbgk.js";import{v}from"./chunk-njswnpaq.js";var yi=v(function(d){var{SignatureV4:l,signatureV4aContainer:o}=uf(),r={CrtSignerV4:null},g="X-Amz-S3session-Token".toLowerCase();class a extends l{async signWithCredentials(e,i,n){let s=c(i);e.headers[g]=i.sessionToken;let t=this;return u(t,s),t.signRequest(e,n??{})}async presignWithCredentials(e,i,n){let s=c(i);return delete e.headers[g],e.headers["X-Amz-S3session-Token"]=i.sessionToken,e.query=e.query??{},e.query["X-Amz-S3session-Token"]=i.sessionToken,u(this,s),this.presign(e,n)}}function c(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function u(e,i){let n=e.credentialProvider;e.credentialProvider=()=>(e.credentialProvider=n,Promise.resolve(i))}class h{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof r.CrtSignerV4==="function")return"crt";else if(typeof o.SignatureV4a==="function")return"js";return"none"}constructor(e){this.sigv4Signer=new a(e),this.signerOptions=e}async sign(e,i={}){if(i.signingRegion==="*")return this.getSigv4aSigner().sign(e,i);return this.sigv4Signer.sign(e,i)}async signWithCredentials(e,i,n={}){if(n.signingRegion==="*"){let s=this.getSigv4aSigner(),t=r.CrtSignerV4;if(t&&s instanceof t)return s.signWithCredentials(e,i,n);else throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(e,i,n)}async presign(e,i={}){if(i.signingRegion==="*"){let n=this.getSigv4aSigner(),s=r.CrtSignerV4;if(s&&n instanceof s)return n.presign(e,i);else throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(e,i)}async presignWithCredentials(e,i,n={}){if(n.signingRegion==="*")throw Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(e,i,n)}getSigv4aSigner(){if(!this.sigv4aSigner){let e=r.CrtSignerV4,i=o.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!e&&!i)throw Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(e&&typeof e==="function")this.sigv4aSigner=new e({...this.signerOptions,signingAlgorithm:1});else if(i&&typeof i==="function")this.sigv4aSigner=new i({...this.signerOptions});else throw Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!i||typeof i!=="function")throw Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new i({...this.signerOptions})}}return this.sigv4aSigner}}d.SignatureV4MultiRegion=h;d.SignatureV4SignWithCredentials=a;d.signatureV4CrtContainer=r});
|
|
3
|
+
export{yi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ne,ur}from"./chunk-ss0mcgbd.js";import{Dn,Yr,yn}from"./chunk-23bg4h8n.js";var n=class{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(){}async releaseMigrationLock(){}get supportsOutput(){return!0}},s=class{#e;#t=new o;#r;#a;constructor(e){this.#e={...e}}async init(){if(this.#r=this.#e.database,this.#a=new i(this.#r),this.#e.onCreateConnection)await this.#e.onCreateConnection(this.#a)}async acquireConnection(){return await this.#t.lock(),this.#a}async beginTransaction(e){await e.executeQuery(ur.raw("begin"))}async commitTransaction(e){await e.executeQuery(ur.raw("commit"))}async rollbackTransaction(e){await e.executeQuery(ur.raw("rollback"))}async releaseConnection(){this.#t.unlock()}async destroy(){this.#r?.close()}},i=class{#e;constructor(e){this.#e=e}executeQuery(e){let{sql:r,parameters:a}=e,t=this.#e.prepare(r).all(...a);return Promise.resolve({rows:t})}async*streamQuery(){throw Error("Streaming query is not supported by SQLite driver.")}},o=class{#e;#t;async lock(){while(this.#e!==void 0)await this.#e;this.#e=new Promise((e)=>{this.#t=e})}unlock(){let e=this.#t;this.#e=void 0,this.#t=void 0,e?.()}},c=class{#e;constructor(e){this.#e=e}async getSchemas(){return[]}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("sqlite_schema").where("type","=","table").where("name","not like","sqlite_%").select("name").$castTo();if(!e.withInternalKyselyTables)r=r.where("name","!=",Yr).where("name","!=",yn);let a=await r.execute();return Promise.all(a.map(({name:t})=>this.#t(t)))}async getMetadata(e){return{tables:await this.getTables(e)}}async#t(e){let r=this.#e,a=(await r.selectFrom("sqlite_master").where("name","=",e).select("sql").$castTo().execute())[0]?.sql?.split(/[\(\),]/)?.find((t)=>t.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.[0]?.replace(/["`]/g,"");return{name:e,columns:(await r.selectFrom(Ne`pragma_table_info(${e})`.as("table_info")).select(["name","type","notnull","dflt_value"]).execute()).map((t)=>({name:t.name,dataType:t.type,isNullable:!t.notnull,isAutoIncrementing:t.name===a,hasDefaultValue:t.dflt_value!=null})),isView:!0}}},l=class extends Dn{getCurrentParameterPlaceholder(){return"?"}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}},m=class{#e;constructor(e){this.#e={...e}}createDriver(){return new s(this.#e)}createQueryCompiler(){return new l}createAdapter(){return new n}createIntrospector(e){return new c(e)}};export{m as NodeSqliteDialect};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ts,Ho}from"./chunk-nzggcbgk.js";import{$o}from"./chunk-w9160hxz.js";import{Go,mo,kt}from"./chunk-brxwrh0b.js";import{an,sr,He,Jr,Jt,go,jt}from"./chunk-zcfehv0w.js";var{awsEndpointFunctions:De,emitWarningIfUnsupportedVersion:Ne,createDefaultUserAgentProvider:we,NODE_APP_ID_CONFIG_OPTIONS:$e,getAwsRegionExtensionConfiguration:Ue,resolveAwsRegionExtensionConfiguration:Fe,resolveUserAgentConfig:be,resolveHostHeaderConfig:qe,getUserAgentPlugin:Me,getHostHeaderPlugin:Ve,getLoggerPlugin:We,getRecursionDetectionPlugin:Le}=kt(),{NoAuthSigner:ze,getHttpAuthSchemeEndpointRuleSetPlugin:Be,DefaultIdentityProviderConfig:je,getHttpSigningPlugin:Ge}=mo(),{normalizeProvider:se,getSmithyContext:Ke,ServiceException:Xe,NoOpLogger:Qe,emitWarningIfUnsupportedVersion:Ye,loadConfigsForDefaultMode:Je,getDefaultExtensionConfiguration:Ze,resolveDefaultRuntimeConfig:et,Client:ne,makeBuilder:tt,createAggregatedClient:st}=sr(),{Command:nt}=sr();var Fs=nt,bs=ne;var{resolveDefaultsModeConfig:ot,loadConfig:E,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rt,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:it,NODE_REGION_CONFIG_OPTIONS:at,NODE_REGION_CONFIG_FILE_OPTIONS:ct,resolveRegionConfig:ut}=He(),{BinaryDecisionDiagram:pt,EndpointCache:dt,decideEndpoint:ht,customEndpointFunctions:gt,resolveEndpointConfig:lt,getEndpointPlugin:Et}=Jr(),{parseUrl:mt,getHttpHandlerExtensionConfiguration:At,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:Ot}=jt(),{DEFAULT_RETRY_MODE:St,NODE_RETRY_MODE_CONFIG_OPTIONS:It,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Ct,resolveRetryConfig:Rt,getRetryPlugin:vt}=Go(),{TypeRegistry:oe,getSchemaSerdePlugin:ft}=an(),{resolveAwsSdkSigV4Config:Pt,AwsSdkSigV4Signer:Tt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:xt}=Ho(),{toUtf8:yt,fromUtf8:Dt,toBase64:Nt,fromBase64:wt,calculateBodyLength:$t}=Jt(),{streamCollector:Ut,NodeHttpHandler:Ft}=$o(),{AwsRestJsonProtocol:bt}=Ts(),{Sha256:qt}=go(),Mt=async(e,s,n)=>({operation:Ke(s).operation,region:await se(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Ht(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(s,n)=>({signingProperties:{config:s,context:n}})}}function Vt(e){return{schemeId:"smithy.api#noAuth"}}var Wt=(e)=>{let s=[];switch(e.operation){case"CreateOAuth2Token":{s.push(Vt());break}default:s.push(Ht(e))}return s},Lt=(e)=>{let s=Pt(e);return Object.assign(s,{authSchemePreference:se(e.authSchemePreference??[])})},zt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),Bt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Gt="3.997.43",Kt={version:Gt},h="ref",p=-1,V=!1,m=!0,W="isSet",A="booleanEquals",L="coalesce",w="PartitionResult",u="stringEquals",k="getAttr",z="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",B={[h]:"Endpoint"},d={fn:k,argv:[{[h]:w},"name"]},re={[h]:"Region"},j={[h]:w},S={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},r={},G=[re],K={conditions:[[W,G],[A,[{fn:L,argv:[{[h]:"IsControlPlane"},V]},m]],[W,[B]],["aws.partition",G,w],[A,[{[h]:"UseFIPS"},m]],[u,[d,"aws"]],[A,[{fn:L,argv:[{[h]:"IsOAuthEndpoint"},V]},m]],[A,[{[h]:"UseDualStack"},m]],[u,[d,"aws-cn"]],[u,[re,"us-gov-west-1"]],[u,[d,"aws-us-gov"]],[A,[{fn:k,argv:[j,"supportsFIPS"]},m]],[u,[d,"aws-iso"]],[u,[d,"aws-iso-b"]],[u,[d,"aws-iso-f"]],[u,[d,"aws-iso-e"]],[u,[d,"aws-eusc"]],[A,[{fn:k,argv:[j,"supportsDualStack"]},m]]],results:[[p],["https://signin.{Region}.api.aws",S],["https://signin.{Region}.api.amazonwebservices.com.cn",S],[z,S],[p,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",S],["https://{Region}.signin.aws.amazon.com",r],["https://{Region}.signin.amazonaws.cn",r],["https://{Region}.signin.amazonaws-us-gov.com",r],["https://{Region}.signin.c2shome.ic.gov",r],["https://{Region}.signin.sc2shome.sgov.gov",r],["https://{Region}.signin.csphome.hci.ic.gov",r],["https://{Region}.signin.csphome.adc-e.uk",r],["https://{Region}.signin.amazonaws-eusc.eu",r],["https://signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: FIPS and custom endpoint are not supported"],[p,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[B,r],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",r],[p,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",r],[p,"FIPS is enabled but this partition does not support FIPS"],[z,r],[p,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: Missing Region"]]},Xt=2,t=1e8,Qt=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,t+27,6,t+4,t+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,t+7,13,10,t+8,14,12,t+9,15,13,t+10,16,14,t+11,17,15,t+12,18,16,t+13,t+16,6,t+5,20,7,21,t+6,17,t+24,t+25,6,t+4,23,7,27,24,9,t+14,25,10,t+15,26,11,t+22,t+23,11,28,t+21,17,t+20,t+21,2,35,30,3,39,31,4,32,t+27,6,t+4,33,7,t+27,34,9,t+14,t+27,3,39,36,4,38,37,7,t+18,t+19,6,t+4,t+17,5,t+1,40,8,t+2,t+3]),Yt=pt.from(Qt,Xt,K.conditions,K.results),Zt=new dt({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),es=(e,s={})=>Zt.get(e,()=>ht(Yt,{endpointParams:e,logger:s.logger}));gt.aws=De;class l extends Xe{constructor(e){super(e);Object.setPrototypeOf(this,l.prototype)}}class C extends l{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error}}class R extends l{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error}}class v extends l{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error}}class f extends l{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,f.prototype),this.error=e.error}}var ts="AccessDeniedException",ss="AccessToken",ns="CreateOAuth2Token",os="CreateOAuth2TokenRequest",rs="CreateOAuth2TokenRequestBody",is="CreateOAuth2TokenResponseBody",as="CreateOAuth2TokenResponse",cs="CreateOAuth2TokenWithIAM",us="CreateOAuth2TokenWithIAMRequest",ps="CreateOAuth2TokenWithIAMResponse",ds="InternalServerException",hs="OAuthAccessToken",gs="RefreshToken",ls="TooManyRequestsError",Es="ValidationException",X="accessKeyId",x="accessToken",ms="access_token",U="client",Q="clientId",Y="codeVerifier",As="code",g="error",y="expiresIn",_s="expires_in",D="grantType",Os="grant_type",ie="http",F="httpError",J="idToken",o="jsonName",P="message",Ss="resource",I="refreshToken",Z="redirectUri",ae="smithy.ts.sdk.synthetic.com.amazonaws.signin",ee="secretAccessKey",te="sessionToken",Is="server",Cs="tokenInput",Rs="tokenOutput",N="tokenType",vs="token_type",i="com.amazonaws.signin",ce=oe.for(ae),ue=[-3,ae,"SigninServiceException",0,[],[]];ce.registerError(ue,l);var _=oe.for(i),pe=[-3,i,ts,{[g]:U},[g,P],[0,0],2];_.registerError(pe,C);var de=[-3,i,ds,{[g]:Is,[F]:500},[g,P],[0,0],2];_.registerError(de,R);var he=[-3,i,ls,{[g]:U,[F]:429},[g,P],[0,0],2];_.registerError(he,v);var ge=[-3,i,Es,{[g]:U,[F]:400},[g,P],[0,0],2];_.registerError(ge,f);var le=[ce,_],fs=[0,i,hs,8,0],Ee=[0,i,gs,8,0],me=[3,i,ss,8,[X,ee,te],[[0,{[o]:X}],[0,{[o]:ee}],[0,{[o]:te}]],3],Ae=[3,i,os,0,[Cs],[[()=>_e,16]],1],_e=[3,i,rs,0,[Q,D,As,Z,Y,I],[[0,{[o]:Q}],[0,{[o]:D}],0,[0,{[o]:Z}],[0,{[o]:Y}],[()=>Ee,{[o]:I}]],2],Oe=[3,i,as,0,[Rs],[[()=>Se,16]],1],Se=[3,i,is,0,[x,N,y,I,J],[[()=>me,{[o]:x}],[0,{[o]:N}],[1,{[o]:y}],[()=>Ee,{[o]:I}],[0,{[o]:J}]],4],Ie=[3,i,us,0,[D,Ss],[[0,{[o]:Os}],0],2],Ce=[3,i,ps,0,[x,N,y],[[()=>fs,{[o]:ms}],[0,{[o]:vs}],[1,{[o]:_s}]],3],Re=[9,i,ns,{[ie]:["POST","/v1/token",200]},()=>Ae,()=>Oe],ve=[9,i,cs,{[ie]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>Ie,()=>Ce],Ps=(e)=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??wt,base64Encoder:e?.base64Encoder??Nt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??es,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Wt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Tt},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ze}],logger:e?.logger??new Qe,protocol:e?.protocol??bt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:le,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",sha256:e?.sha256??qt,urlParser:e?.urlParser??mt,utf8Decoder:e?.utf8Decoder??Dt,utf8Encoder:e?.utf8Encoder??yt}),ks=(e)=>{Ye(process.version);let s=ot(e),n=()=>s().then(Je),c=Ps(e);Ne(process.version);let a={profile:e?.profile,logger:c.logger};return{...c,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??E(xt,a),bodyLengthChecker:e?.bodyLengthChecker??$t,defaultUserAgentProvider:e?.defaultUserAgentProvider??we({serviceId:c.serviceId,clientVersion:Kt.version}),maxAttempts:e?.maxAttempts??E(Ct,e),region:e?.region??E(at,{...ct,...a}),requestHandler:Ft.create(e?.requestHandler??n),retryMode:e?.retryMode??E({...It,default:async()=>(await n()).retryMode||St},e),streamCollector:e?.streamCollector??Ut,useDualstackEndpoint:e?.useDualstackEndpoint??E(it,a),useFipsEndpoint:e?.useFipsEndpoint??E(rt,a),userAgentAppId:e?.userAgentAppId??E($e,a)}},xs=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:n,credentials:c}=e;return{setHttpAuthScheme(a){let O=s.findIndex((T)=>T.schemeId===a.schemeId);if(O===-1)s.push(a);else s.splice(O,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){n=a},httpAuthSchemeProvider(){return n},setCredentials(a){c=a},credentials(){return c}}},ys=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Ds=(e,s)=>{let n=Object.assign(Ue(e),Ze(e),At(e),xs(e));return s.forEach((c)=>c.configure(n)),Object.assign(e,Fe(n),et(n),_t(n),ys(n))};class b extends ne{config;constructor(...[e]){let s=ks(e||{});super(s);this.initConfig=s;let n=zt(s),c=be(n),a=Rt(c),O=ut(a),T=qe(O),Te=lt(T),ke=Lt(Te),xe=Ds(ke,e?.extensions||[]);this.config=xe,this.middlewareStack.use(ft(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(vt(this.config)),this.middlewareStack.use(Ot(this.config)),this.middlewareStack.use(Ve(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(Le(this.config)),this.middlewareStack.use(Be(this.config,{httpAuthSchemeParametersProvider:Mt,identityProviderConfigProvider:async(ye)=>new je({"aws.auth#sigv4":ye.credentials})})),this.middlewareStack.use(Ge(this.config))}destroy(){super.destroy()}}var fe=tt(Bt,"Signin","SigninClient",Et),Ns={IsControlPlane:{type:"staticContextParams",value:!1}},ws={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},Pe=(e,s,n,c)=>[];class q extends fe(Ns,Pe,"CreateOAuth2Token",Re){}class M extends fe(ws,Pe,"CreateOAuth2TokenWithIAM",ve){}var $s={CreateOAuth2TokenCommand:q,CreateOAuth2TokenWithIAMCommand:M};class H extends b{}st($s,H);var Us={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};var qs=C,Ms=pe,Hs=me,Vs=Re,Ws=q,Ls=Ae,zs=_e,Bs=Oe,js=Se,Gs=ve,Ks=M,Xs=Ie,Qs=Ce,Ys=R,Js=de,Zs=Us,en=H,tn=b,sn=l,nn=ue,on=v,rn=he,cn=f,un=ge,pn=le;export{Fs as $Command,bs as __Client,qs as AccessDeniedException,Ms as AccessDeniedException$,Hs as AccessToken$,Vs as CreateOAuth2Token$,Ws as CreateOAuth2TokenCommand,Ls as CreateOAuth2TokenRequest$,zs as CreateOAuth2TokenRequestBody$,Bs as CreateOAuth2TokenResponse$,js as CreateOAuth2TokenResponseBody$,Gs as CreateOAuth2TokenWithIAM$,Ks as CreateOAuth2TokenWithIAMCommand,Xs as CreateOAuth2TokenWithIAMRequest$,Qs as CreateOAuth2TokenWithIAMResponse$,Ys as InternalServerException,Js as InternalServerException$,Zs as OAuth2ErrorCode,en as Signin,tn as SigninClient,sn as SigninServiceException,nn as SigninServiceException$,on as TooManyRequestsError,rn as TooManyRequestsError$,cn as ValidationException,un as ValidationException$,pn as errorTypeRegistries};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
3
|
-
export{
|
|
2
|
+
function ws(i){let t=3735928559,h=1103547991;for(let e=0;e<i.length;e++){let l=i.charCodeAt(e);t=Math.imul(t^l,2654435761),h=Math.imul(h^l,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(h^h>>>13,3266489909),h=Math.imul(h^h>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(h>>>0).toString(36)+(t>>>0).toString(36)}
|
|
3
|
+
export{ws};
|