@shumai-one/shumai 0.5.1 → 0.5.3
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-03zkxckm.js +2 -0
- package/bin/chunk-04nqnkzs.js +4 -0
- package/bin/chunk-157axqz1.js +1 -0
- package/bin/{chunk-zp5b1mb6.js → chunk-1tesbv8w.js} +2 -2
- package/bin/chunk-23780yj6.js +3 -0
- package/bin/{chunk-mt532a33.js → chunk-24da4wg9.js} +1 -1
- package/bin/chunk-24nx3krz.js +2 -0
- package/bin/{chunk-5t05jpna.js → chunk-26am2rzm.js} +1 -1
- package/bin/{chunk-vre5andt.js → chunk-2pt9h882.js} +3 -3
- package/bin/{chunk-xyh5dkr5.js → chunk-2rrcdhkj.js} +1 -1
- package/bin/{chunk-6v6c2921.js → chunk-2w2bknn2.js} +4 -4
- package/bin/{chunk-f22nrm6r.js → chunk-3ahax79y.js} +4 -4
- package/bin/{chunk-1k16xsqq.js → chunk-3wcvema0.js} +6 -6
- package/bin/{chunk-20anqpf1.js → chunk-40tmh04g.js} +2 -2
- package/bin/chunk-45p7d22e.js +2 -0
- package/bin/chunk-461gcgrs.js +2 -0
- package/bin/{chunk-2g5qdx4s.js → chunk-4bc3gqmn.js} +2 -2
- package/bin/{chunk-m5cpsm28.js → chunk-4nkwe7dz.js} +2 -2
- package/bin/{chunk-gptzcgte.js → chunk-59ayg5am.js} +1 -1
- package/bin/{chunk-5patxztz.js → chunk-5ebb2pdf.js} +3 -3
- package/bin/{chunk-d7mgjqf8.js → chunk-5y3kx4kk.js} +1 -1
- package/bin/{chunk-4437dnfa.js → chunk-68xsb3t8.js} +1 -1
- package/bin/{chunk-m2dtwvg0.js → chunk-6hs63sva.js} +31 -31
- package/bin/{chunk-628k58ek.js → chunk-6hzktewz.js} +2 -2
- package/bin/{chunk-0e8xg41c.js → chunk-6pwf7qa6.js} +1 -1
- package/bin/{chunk-q5mkbnr9.js → chunk-6sq6dfa1.js} +2 -2
- package/bin/chunk-87secbzy.js +1 -0
- package/bin/chunk-8pykp70z.js +1 -0
- package/bin/{chunk-zhe16jvg.js → chunk-8ts3xkme.js} +1 -1
- package/bin/{chunk-ehhsezbj.js → chunk-909h3qzp.js} +2 -2
- package/bin/{chunk-j909v9p5.js → chunk-929abwgr.js} +1 -1
- package/bin/{chunk-0ttr4a6b.js → chunk-9ca8a5f2.js} +2 -2
- package/bin/{chunk-6vvs18bw.js → chunk-9fyb95r5.js} +1 -1
- package/bin/{chunk-kzsdp31a.js → chunk-a8bymrv1.js} +2 -2
- package/bin/chunk-axeq2pq5.js +2 -0
- package/bin/{chunk-z7p7s55t.js → chunk-b3tkvdfk.js} +2 -2
- package/bin/{chunk-r1m4q8vw.js → chunk-b5r0be06.js} +2 -2
- package/bin/{chunk-z8mmqfm4.js → chunk-b6dbqs39.js} +1 -1
- package/bin/{chunk-0yv0nnmh.js → chunk-b88tdt79.js} +2 -2
- package/bin/{chunk-grsgkkrb.js → chunk-bcyvxp1c.js} +6 -6
- package/bin/{chunk-3cvbb6kh.js → chunk-bn0taqr3.js} +2 -2
- package/bin/chunk-cb37q6t0.js +1 -0
- package/bin/{chunk-sg7n2g3z.js → chunk-cdk8vqeg.js} +4 -4
- package/bin/chunk-cfqny70c.js +3 -0
- package/bin/{chunk-3m6ch1x5.js → chunk-cqnected.js} +2 -2
- package/bin/{chunk-hr2027z3.js → chunk-cvfznrnt.js} +8 -8
- package/bin/chunk-d1q1tn36.js +1 -0
- package/bin/chunk-d1rjpbgv.js +2 -0
- package/bin/{chunk-asgxtqf0.js → chunk-eshwjf91.js} +2 -2
- package/bin/{chunk-1dt700ws.js → chunk-fa9yq17g.js} +49 -49
- package/bin/{chunk-rkq6jvhb.js → chunk-fnkkwna8.js} +2 -2
- package/bin/{chunk-zfqz72sd.js → chunk-fpjvr3qw.js} +1 -1
- package/bin/{chunk-5jbx9gqe.js → chunk-fsr83nb1.js} +1 -1
- package/bin/{chunk-80qz30dc.js → chunk-fxg81vtx.js} +2 -2
- package/bin/chunk-fznchvm7.js +1 -0
- package/bin/chunk-g2z0c39g.js +1 -0
- package/bin/chunk-gnt9gewm.js +2 -0
- package/bin/{chunk-h9x81yp6.js → chunk-gvcjqcjf.js} +1 -1
- package/bin/chunk-hbnpx0a5.js +1 -0
- package/bin/chunk-hgy9rqt1.js +1 -0
- package/bin/chunk-hk659cg2.css +1 -0
- package/bin/{chunk-03bfjh8k.js → chunk-hn2g40r6.js} +2 -2
- package/bin/{chunk-exgtwask.js → chunk-hsx4pns6.js} +1 -1
- package/bin/{chunk-6ns2vhbd.js → chunk-hy5ncvpf.js} +2 -2
- package/bin/{chunk-y03z5rrg.js → chunk-j420aqk8.js} +3 -3
- package/bin/{chunk-tcat7q9p.js → chunk-jt6v15wx.js} +2 -2
- package/bin/{chunk-ar6kq7hh.js → chunk-k3ds96cb.js} +2 -2
- package/bin/{chunk-mqr096rn.js → chunk-k97axrc4.js} +1 -1
- package/bin/{chunk-zcrtr8qd.js → chunk-m41tbrvt.js} +2 -2
- package/bin/chunk-m9f21ye9.js +1 -0
- package/bin/chunk-md7pgk86.js +2 -0
- package/bin/chunk-me3zmpj5.js +14 -0
- package/bin/chunk-mg6sybt0.js +1 -0
- package/bin/{chunk-xyk7vk42.js → chunk-mzme3m82.js} +2 -2
- package/bin/chunk-n08h1jgx.js +2 -0
- package/bin/{chunk-z1r86fna.js → chunk-ncv8v6mj.js} +2 -2
- package/bin/{chunk-h153xefb.js → chunk-nmd1901j.js} +1 -1
- package/bin/{chunk-62sj29j8.js → chunk-np39aknv.js} +2 -2
- package/bin/{chunk-9h6nn1a3.js → chunk-p7zw53ep.js} +1 -1
- package/bin/{chunk-kgfa5y9w.js → chunk-ppb4aj0y.js} +4 -4
- package/bin/{chunk-5yd9cv7f.js → chunk-pwq6dbb5.js} +3 -3
- package/bin/chunk-q1gfypy3.js +2 -0
- package/bin/{chunk-3z20b2hz.js → chunk-q4qqmes7.js} +2 -2
- package/bin/{chunk-j3xaq9s3.js → chunk-q7t5zs7n.js} +2 -2
- package/bin/{chunk-hx76pje1.js → chunk-qcpeefhr.js} +1 -1
- package/bin/{chunk-gy8z8sd7.js → chunk-qjdvs1s5.js} +1 -1
- package/bin/{chunk-dvkzhpxx.js → chunk-qqapw198.js} +2 -2
- package/bin/chunk-qx553512.js +211 -0
- package/bin/chunk-r3s1x5wp.js +1 -0
- package/bin/{chunk-zwb9kamp.js → chunk-rh8dy99a.js} +2 -2
- package/bin/{chunk-e3r1m6rb.js → chunk-s0vfj06y.js} +1 -1
- package/bin/chunk-s6g2mzpn.js +2 -0
- package/bin/{chunk-c4wnhekn.js → chunk-s9sf37dv.js} +2 -2
- package/bin/{chunk-qgkbxw1k.js → chunk-sbyyn9yw.js} +2 -2
- package/bin/{chunk-xvdd04gy.js → chunk-scvepfv8.js} +1 -1
- package/bin/chunk-sjbvt3wa.js +2 -0
- package/bin/{chunk-31vx01aw.js → chunk-srmx5z3v.js} +2 -2
- package/bin/{chunk-36r20sj7.js → chunk-srv5kvm4.js} +1 -1
- package/bin/{chunk-7vd5yajk.js → chunk-t1h12r3q.js} +7 -7
- package/bin/chunk-t6myw0jf.js +2 -0
- package/bin/chunk-t8jfp3vx.js +1 -0
- package/bin/{chunk-3584j9fc.js → chunk-tqdde9bj.js} +2 -2
- package/bin/{chunk-wydd7sz7.js → chunk-v5hz09a1.js} +2 -2
- package/bin/chunk-vk9ecq8n.js +2 -0
- package/bin/{chunk-3zvvct3r.js → chunk-vsnq4381.js} +1 -1
- package/bin/{chunk-r6gkv98n.js → chunk-w4adkd0a.js} +5 -5
- package/bin/{chunk-4mq874m3.js → chunk-wbmqbpgm.js} +2 -2
- package/bin/{chunk-kvqp50dm.js → chunk-wperd2h9.js} +2 -2
- package/bin/{chunk-wkxm6yny.js → chunk-xbw7ffrz.js} +2 -2
- package/bin/{chunk-v42jcex0.js → chunk-xdrpahym.js} +4 -4
- package/bin/{chunk-s978ftze.js → chunk-xfmnfcv2.js} +3 -3
- package/bin/chunk-xhngtwn9.js +1 -0
- package/bin/chunk-xjnehexk.js +2 -0
- package/bin/chunk-xzb0t8mx.js +1 -0
- package/bin/{chunk-rn9rktp4.js → chunk-y5h5d5gx.js} +4 -4
- package/bin/{chunk-rsdpycdr.js → chunk-y6xyc4wp.js} +2 -2
- package/bin/{chunk-m1xc3t0p.js → chunk-zpk87b33.js} +6 -6
- package/bin/{chunk-trndqdaa.js → chunk-zq5j9wsc.js} +1 -1
- package/bin/{chunk-t597y392.js → chunk-zsg61vr0.js} +1 -1
- package/bin/chunk-zts21ft7.js +1 -0
- package/bin/{chunk-zf2h3w7t.js → chunk-zzbn0b6c.js} +1 -1
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +431 -409
- package/package.json +7 -7
- package/prisma/migrations/20261008134859_add_transcode_3d/migration.sql +2 -0
- package/prisma/migrations/20261014054332_add_embedding_768/migration.sql +8 -0
- package/prisma/schema.prisma +11 -8
- package/bin/chunk-088e1ath.js +0 -3
- package/bin/chunk-18kgmvme.js +0 -2
- package/bin/chunk-1ya6vx4k.js +0 -1
- package/bin/chunk-3xw70yr4.js +0 -2
- package/bin/chunk-4frhvsy0.js +0 -1
- package/bin/chunk-57nqvcg7.js +0 -1
- package/bin/chunk-58hdvwj2.js +0 -1
- package/bin/chunk-5seey9ee.js +0 -2
- package/bin/chunk-66hdwm6f.js +0 -2
- package/bin/chunk-6devq6jh.js +0 -2
- package/bin/chunk-756mr32b.js +0 -2
- package/bin/chunk-9k86d2a3.js +0 -4
- package/bin/chunk-a5fsqkt7.js +0 -1
- package/bin/chunk-axfwh5et.js +0 -2
- package/bin/chunk-c0vbj8za.js +0 -1
- package/bin/chunk-dcmfn4hs.js +0 -2
- package/bin/chunk-dy79b8kd.js +0 -1
- package/bin/chunk-ehvyq65t.js +0 -2
- package/bin/chunk-g21k2awz.js +0 -2
- package/bin/chunk-g9f9nzcc.js +0 -1
- package/bin/chunk-gzzfta3s.js +0 -2
- package/bin/chunk-k9cgfzgk.js +0 -3
- package/bin/chunk-nbfcknsq.js +0 -1
- package/bin/chunk-phzemmmy.js +0 -2
- package/bin/chunk-qcf3tb72.js +0 -1
- package/bin/chunk-rgfh5apb.js +0 -1
- package/bin/chunk-rh1hs8wa.js +0 -2
- package/bin/chunk-rpxayeqd.js +0 -1
- package/bin/chunk-s33pcxn0.js +0 -1
- package/bin/chunk-s9svhjv6.js +0 -2
- package/bin/chunk-tcp4q15p.js +0 -1
- package/bin/chunk-vnk2p7mq.css +0 -1
- package/bin/chunk-vsefjzzj.js +0 -211
- package/bin/chunk-wf32n1s3.js +0 -1
- package/bin/chunk-yd1k76na.js +0 -2
- package/bin/chunk-yfm9xwes.js +0 -14
- package/bin/chunk-zkep4r7d.js +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Zr,si,hf,e,h,d,x,U,i,r,T,y,l,s}from"./chunk-t1h12r3q.js";function c(t,n){let o={};if(!Object.keys(n).length)return o=t,o;for(let[u,a]of Object.entries(t)){let m=n[u];if(m===null)continue;o[m??u]=a}return o}function b(t){let n={};for(let[o,u]of Object.entries(t))if(typeof u<"u")n[o]=u;return n}class w extends Error{rawValue;rawMessage;static[Symbol.hasInstance](t){if(!(t instanceof Error))return!1;if(!("rawValue"in t))return!1;if(!("rawMessage"in t))return!1;if(!("pretty"in t))return!1;if(typeof t.pretty!=="function")return!1;return!0}constructor(t,n,o){super(`${t}: ${n}`);this.name="SDKValidationError",this.cause=n,this.rawValue=o,this.rawMessage=t}pretty(){if(this.cause instanceof si)return`${this.rawMessage}
|
|
3
|
+
${lf(this.cause)}`;else return this.toString()}}function lf(t){return hf(t)}function ya(t){return{ok:!0,value:t}}function os(t){return{ok:!1,error:t}}async function N(t){let n=await t;if(!n.ok)throw n.error;return n.value}function v(t,n,o){try{return ya(n(t))}catch(u){return os(new w(o,u,t))}}var qo=r({prompt_tokens:h().default(0),completion_tokens:h().default(0),total_tokens:h().default(0),prompt_audio_seconds:s(h()).optional()}).catchall(x()).transform((t)=>c(t,{prompt_tokens:"promptTokens",completion_tokens:"completionTokens",total_tokens:"totalTokens",prompt_audio_seconds:"promptAudioSeconds"})),pc=r({promptTokens:h().default(0),completionTokens:h().default(0),totalTokens:h().default(0),promptAudioSeconds:s(h()).optional()}).catchall(x()).transform((t)=>({...c(t,{promptTokens:"prompt_tokens",completionTokens:"completion_tokens",totalTokens:"total_tokens",promptAudioSeconds:"prompt_audio_seconds"})}));function D(t){return O++,t}var O=0,P=0;function _(){P++;let t=O;return{end:(n)=>{let o=O-t;if(O=t+(n??o),--P===0)O=0;return o}}}function J(t){let n=Object.values(t);return T([...n.map((o)=>l(o)),e().transform((o)=>D(o))])}function el(t){let n=Object.values(t).filter((o)=>typeof o==="number");return T([...n.map((o)=>l(o)),h().transform((o)=>D(o))])}function ft(t){return e()}function pm(t){return h()}var M=Symbol("UNKNOWN");function K(t){return typeof t==="object"&&t!==null&&M in t}function We(t,n,o={}){let{unknownValue:u="UNKNOWN",outputPropertyName:a}=o;return U().transform((m)=>{let f=Object.defineProperties({raw:m,[a??t]:u,isUnknown:!0},{[M]:{value:!0,enumerable:!1,configurable:!1}});if(!(typeof m==="object"&&m!==null))return f;let S=m[t];if(typeof S!=="string")return f;if(!(S in n))return f;let j=n[S];if(!j)return f;let g=_(),C=j.safeParse(m);if(!C.success)return g.end(0),f;if(g.end(),a)C.data[a]=S;return C.data})}var Y=/^\d{4}-\d{2}-\d{2}$/;class I{serialized;static today(){return new I(new Date)}constructor(t){if(typeof t==="string"&&!Y.test(t))throw RangeError("RFCDate: date strings must be in the format YYYY-MM-DD: "+t);let n=new Date(t);if(isNaN(+n))throw RangeError("RFCDate: invalid date provided: "+t);if(this.serialized=n.toISOString().slice(0,10),!Y.test(this.serialized))throw TypeError(`RFCDate: failed to build valid date with given value: ${t} serialized to ${this.serialized}`)}toJSON(){return this.toString()}toString(){return this.serialized}}function k(t){return U().transform((n,o)=>{let u=[],a=t.map(()=>[]),m=_();for(let[z,S]of t.entries()){let j=_(),g=S.safeParse(n),C=j.end(),ie=0;if(g.success){u.push({data:g.data,inexactCount:C,zeroDefaultCount:0,fieldCount:-1});continue}a[z].push(...g.error.issues)}if(u.length===0)return m.end(0),o.addIssue({input:n,code:"invalid_union",errors:a}),Zr;let f=u[0];for(let z of u){if(u.length>1)z.fieldCount=ne(z.data);f=te(z,f)}return m.end(f.inexactCount),f.data})}function te(t,n){let o=t.inexactCount===0,u=n.inexactCount===0;if(o!==u)return o?t:n;let a=t.fieldCount-t.zeroDefaultCount,m=n.fieldCount-n.zeroDefaultCount;if(a!==m)return a>m?t:n;return t.inexactCount<n.inexactCount?t:n}function ne(t){let n=0,o=[t],u=0;while(u<o.length){let a=o[u++];if(a===void 0||K(a))continue;let m=typeof a;if(a===null||m==="number"||m==="string"||m==="boolean"||m==="bigint"||a instanceof Date||a instanceof I){n++;continue}if(Array.isArray(a)){o.push(...a);continue}if(m==="object")o.push(...Object.values(a))}return n}var B=r({type:l("input_audio"),input_audio:e()}).transform((t)=>c(t,{input_audio:"inputAudio"})),V=r({type:l("input_audio"),inputAudio:e()}).transform((t)=>c(t,{inputAudio:"input_audio"}));var Fi=r({type:l("document_url").default("document_url"),document_url:e(),document_name:s(e()).optional()}).transform((t)=>c(t,{document_url:"documentUrl",document_name:"documentName"})),Js=r({type:l("document_url").default("document_url"),documentUrl:e(),documentName:s(e()).optional()}).transform((t)=>c(t,{documentUrl:"document_url",documentName:"document_name"}));var W=r({type:l("file").default("file"),file_id:e()}).transform((t)=>c(t,{file_id:"fileId"})),dc=r({type:l("file").default("file"),fileId:e()}).transform((t)=>c(t,{fileId:"file_id"}));var Z={Low:"low",Auto:"auto",High:"high"},q=J(Z),G=ft(Z);var L=r({url:e(),detail:s(q).optional()}),A=r({url:e(),detail:s(G).optional()});var De=k([L,e()]),Ee=k([A,e()]);var Li=r({type:l("image_url").default("image_url"),image_url:k([L,e()])}).transform((t)=>c(t,{image_url:"imageUrl"})),Xs=r({type:l("image_url").default("image_url"),imageUrl:k([A,e()])}).transform((t)=>c(t,{imageUrl:"image_url"}));var Pe=k([h(),e()]),Me=k([h(),e()]);var R=r({type:l("reference").default("reference"),reference_ids:i(k([h(),e()]))}).transform((t)=>c(t,{reference_ids:"referenceIds"})),F=r({type:l("reference").default("reference"),referenceIds:i(k([h(),e()]))}).transform((t)=>c(t,{referenceIds:"reference_ids"}));var ss=r({type:l("text").default("text"),text:e()}),is=r({type:l("text").default("text"),text:e()});var H={WebSearch:"web_search",WebSearchPremium:"web_search_premium",CodeInterpreter:"code_interpreter",ImageGeneration:"image_generation",DocumentLibrary:"document_library"},fn=J(H),ei=ft(H);var qe=k([fn,e()]),Ge=k([ei,e()]);var ba=r({type:l("tool_reference").default("tool_reference"),tool:k([fn,e()]),title:e(),url:s(e()).optional(),favicon:s(e()).optional(),description:s(e()).optional()}),fc=r({type:l("tool_reference").default("tool_reference"),tool:k([ei,e()]),title:e(),url:s(e()).optional(),favicon:s(e()).optional(),description:s(e()).optional()});var nt=k([ba,ss,R]),ot=k([fc,is,F]);var Zi=r({type:l("thinking").default("thinking"),thinking:i(k([ba,ss,R])),signature:s(e()).optional(),closed:d().optional()}),Bi=r({type:l("thinking").default("thinking"),thinking:i(k([fc,is,F])),signature:s(e()).optional(),closed:d().optional()});var tl=We("type",{image_url:Li.and(r({type:l("image_url")})),document_url:Fi.and(r({type:l("document_url")})),text:ss.and(r({type:l("text")})),reference:R.and(r({type:l("reference")})),file:W.and(r({type:l("file")})),thinking:Zi.and(r({type:l("thinking")})),input_audio:B}),ti=T([Xs.and(r({type:l("image_url")})),Js.and(r({type:l("document_url")})),is.and(r({type:l("text")})),F.and(r({type:l("reference")})),dc.and(r({type:l("file")})),Bi.and(r({type:l("thinking")})),V]);var zt=k([y(e(),x()),e()]),St=k([y(e(),x()),e()]);var Q=r({name:e(),arguments:k([y(e(),x()),e()])}),X=r({name:e(),arguments:k([y(e(),x()),e()])});var vu=r({id:e().default("null"),type:e().optional(),function:Q,index:h().default(0)}),mm=r({id:e().default("null"),type:e().optional(),function:X,index:h().default(0)});var Jt=k([e(),i(tl)]);var wu=r({role:s(e()).optional(),content:s(k([e(),i(tl)])).optional(),tool_calls:s(i(vu)).optional(),tool_call_id:s(e()).optional(),index:s(h()).optional(),metadata:s(y(e(),x())).optional()}).transform((t)=>c(t,{tool_calls:"toolCalls",tool_call_id:"toolCallId"}));var oe={Stop:"stop",Length:"length",Error:"error",ToolCalls:"tool_calls"},re=J(oe),ee=r({index:h(),delta:wu,finish_reason:s(re)}).transform((t)=>c(t,{finish_reason:"finishReason"}));var cf=r({id:e(),object:e().optional(),created:h().optional(),model:e(),usage:qo.optional(),choices:i(ee)});function hm(t){return v(t,(n)=>cf.parse(JSON.parse(n)),"Failed to parse 'CompletionChunk' from JSON")}
|
|
4
|
+
export{lf,ya,os,N,v,c,b,J,el,ft,pm,We,k,Fi,Js,dc,Li,Xs,ss,is,fn,ei,ba,fc,Zi,Bi,tl,ti,vu,mm,wu,qo,pc,cf,hm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m,D,u,S,L,t,o,mt,Re,ze,A,O,ta,jn,no,Ce,Ie,Te,J0,K_,Lf,qc,hS,An,ut,Nt,vr,$t,Ct,am}from"./chunk-qx553512.js";import{Ir}from"./chunk-6pwf7qa6.js";import{tr}from"./chunk-md7pgk86.js";import{Pn,Nn,Dn,xr,It,xt}from"./chunk-k3ds96cb.js";S();var k=(a)=>{if(!a)return"??";return a.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()};function T(){let{projectId:a}=j.useParams(),{teamId:r,ensureTeamIdForProject:n}=ut(),v=Re();m(()=>{n(a)},[a,n]);let{data:i}=tr(am(a)),d=i?.rootFolder,[N,h]=u(240),{fileListLeftSidebarCollapsed:c,setFileListLeftSidebarCollapsed:y}=$t(),{data:f,isLoading:w,fetchNextPage:p,hasNextPage:b,isFetchingNextPage:l}=mt({queryKey:["collections",a],queryFn:async({pageParam:e})=>{let s=await A.api.projects[":projectId"].collections.$get({param:{projectId:a},query:{first:"20",after:e}});if(!s.ok)throw Error("Failed to fetch collections");return await s.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,enabled:!!a}),{ref:I,inView:x}=Nt();m(()=>{if(x&&b&&!l)p()},[x,b,l,p]);let g=D(()=>f?.pages.flatMap((e)=>e.data)||[],[f]);if(!r||!d||!i)return t(Ct,{});return t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{className:"flex flex-1 overflow-hidden relative",children:[!c&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>y(!0)}),!c&&o(L,{children:[t("div",{className:"bg-background",style:{width:N},children:t(vr,{teamId:r,projectId:a,projectName:i.name??"",rootFolderId:d})}),t(Ir,{onResize:(e)=>{h((s)=>Math.max(180,Math.min(400,s+e)))},className:"hidden md:block"})]}),o("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[t("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:o("div",{className:"flex items-center gap-2",children:[t(ta,{className:"h-5 w-5 text-primary"}),t("h1",{className:"font-bold text-lg text-foreground",children:J0()})]})}),t("div",{className:"flex-1 overflow-y-auto p-6",children:w?t("div",{className:"flex justify-center items-center h-64",children:t("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):g.length===0?o("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[t(no,{className:"h-10 w-10 text-muted-foreground/50"}),t("p",{children:hS()})]}):o("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[o(Pn,{children:[t(Nn,{children:o(xr,{className:"hover:bg-transparent bg-muted/20",children:[t(It,{className:"font-semibold px-4 py-3",children:K_()}),t(It,{className:"font-semibold px-4 py-3",children:qc()}),t(It,{className:"font-semibold px-4 py-3 w-[200px]",children:Lf()})]})}),t(Dn,{children:g.map((e)=>o(xr,{className:"hover:bg-muted/10 transition-colors cursor-pointer",onClick:()=>v({to:"/projects/$projectId/collections/$collectionId",params:{projectId:a,collectionId:e.id}}),children:[t(xt,{className:"font-medium px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[t(ta,{className:"h-4 w-4 text-primary shrink-0"}),t("span",{className:"text-foreground font-semibold hover:underline",children:e.name})]})}),t(xt,{className:"px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[e.creator?.image&&t(Ie,{src:e.creator.image,alt:e.creator.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:k(e.creator?.name)})]}),t("span",{className:"text-sm font-medium text-foreground truncate max-w-[200px]",children:e.creator?.name||An()})]})}),t(xt,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:o("div",{className:"flex items-center gap-2",children:[t(jn,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),t("span",{children:new Date(e.createdAt).toLocaleDateString()})]})})]},e.id))})]}),t("div",{ref:I,className:"h-10 w-full flex items-center justify-center",children:l&&t(O,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var j=ze("/projects/$projectId/collections/")({component:T});export{j as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{F,h,N,y,u,S,L,t,o,C,mt,_e,Y,Lt,se,mi,hi,Hn,Ai,Pc}from"./chunk-vsefjzzj.js";S();S();var De=Object.defineProperty,f=(a,e)=>De(a,"name",{value:e,configurable:!0}),ue=["PageUp","PageDown"],fe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],me={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},O="Slider",[J,Ve,Ie]=hi(O),[Q,it]=mt(O,[Ie]),[Ae,U]=Q(O),Be=F(f(function(e,r){let{name:i,min:s=0,max:n=100,step:c=1,orientation:d="horizontal",disabled:m=!1,minStepsBetweenThumbs:g=0,defaultValue:b=[s],value:v,onValueChange:l=f(()=>{},"onValueChange"),onValueCommit:p=f(()=>{},"onValueCommit"),inverted:P=!1,form:R,...x}=e,T=y(new Set),_=y(0),E=y(!1),D=d==="horizontal"?Ke:ke,[A,te]=u(null),j=_e(r,te),[V=[],X]=Lt({prop:v,defaultProp:b,onChange:f((w)=>{[...T.current][_.current]?.focus({preventScroll:!0,focusVisible:E.current}),E.current=!1,l(w)},"onChange")}),ne=y(V),Ce=y(V);h(()=>{let w=R?A?.ownerDocument.getElementById(R):A?.closest("form");if(w instanceof HTMLFormElement){let I=f(()=>X(Ce.current),"reset");return w.addEventListener("reset",I),()=>w.removeEventListener("reset",I)}},[A,R,X]);function re(w){let I=we(V,w);K(w,I)}f(re,"handleSlideStart");function oe(w){K(w,_.current)}f(oe,"handleSlideMove");function ie(){if(String(V)!==String(ne.current))p(V)}f(ie,"handleSlideEnd");function K(w,I,{commit:ae}={commit:!1}){let le=ee(c),W=H(Math.round((w-s)/c)*c+s,le),z=Ai(W,[s,n]);X((k=[])=>{let B=ve(k,z,I);if(ye(B,g*c)){_.current=B.indexOf(z);let ce=String(B)!==String(k);if(ce&&ae)p(B);return ce?B:k}else return k})}return f(K,"updateValues"),t(Ae,{scope:e.__scopeSlider,name:i,disabled:m,min:s,max:n,valueIndexToChangeRef:_,thumbs:T.current,values:V,orientation:d,form:R,children:t(J.Provider,{scope:e.__scopeSlider,children:t(J.Slot,{scope:e.__scopeSlider,children:t(D,{"aria-disabled":m,"data-disabled":m?"":void 0,...x,ref:j,onPointerDown:Y(x.onPointerDown,()=>{if(!m)ne.current=V,E.current=!1}),min:s,max:n,inverted:P,onSlideStart:m?void 0:re,onSlideMove:m?void 0:oe,onSlideEnd:m?void 0:ie,onHomeKeyDown:()=>{if(!m)E.current=!0,K(s,0,{commit:!0})},onEndKeyDown:()=>{if(!m)E.current=!0,K(n,V.length-1,{commit:!0})},onStepKeyDown:({event:w,direction:I})=>{if(!m){E.current=!0;let W=ue.includes(w.key)||w.shiftKey&&fe.includes(w.key)?10:1,z=_.current,k=V[z],B=Te(k,{min:s,step:c,direction:I,multiplier:W});K(B,z,{commit:!0})}}})})})})},"Slider")),[Se,he]=Q(O,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Ke=F(f(function(e,r){let{min:i,max:s,dir:n,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:g,onStepKeyDown:b,...v}=e,[l,p]=u(null),P=_e(r,p),R=y(void 0),x=Hn(n),T=x==="ltr",_=T&&!c||!T&&c;function E(M){let D=R.current||l.getBoundingClientRect(),A=[0,D.width],j=G(A,_?[i,s]:[s,i]);return R.current=D,j(M-D.left)}return f(E,"getValueFromPointer"),t(Se,{scope:e.__scopeSlider,startEdge:_?"left":"right",endEdge:_?"right":"left",direction:_?1:-1,size:"width",children:t(pe,{dir:x,"data-orientation":"horizontal",...v,ref:P,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:(M)=>{let D=E(M.clientX);d?.(D)},onSlideMove:(M)=>{let D=E(M.clientX);m?.(D)},onSlideEnd:()=>{R.current=void 0,g?.()},onStepKeyDown:(M)=>{let A=me[_?"from-left":"from-right"].includes(M.key);b?.({event:M,direction:A?-1:1})}})})},"SliderHorizontal")),ke=F(f(function(e,r){let{min:i,max:s,inverted:n,onSlideStart:c,onSlideMove:d,onSlideEnd:m,onStepKeyDown:g,...b}=e,v=y(null),l=_e(r,v),p=y(void 0),P=!n;function R(x){let T=p.current||v.current.getBoundingClientRect(),_=[0,T.height],M=G(_,P?[s,i]:[i,s]);return p.current=T,M(x-T.top)}return f(R,"getValueFromPointer"),t(Se,{scope:e.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:t(pe,{"data-orientation":"vertical",...b,ref:l,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:(x)=>{let T=R(x.clientY);c?.(T)},onSlideMove:(x)=>{let T=R(x.clientY);d?.(T)},onSlideEnd:()=>{p.current=void 0,m?.()},onStepKeyDown:(x)=>{let _=me[P?"from-bottom":"from-top"].includes(x.key);g?.({event:x,direction:_?-1:1})}})})},"SliderVertical")),pe=F(f(function(e,r){let{__scopeSlider:i,onSlideStart:s,onSlideMove:n,onSlideEnd:c,onHomeKeyDown:d,onEndKeyDown:m,onStepKeyDown:g,...b}=e,v=U(O,i);return t(se.span,{...b,ref:r,onKeyDown:Y(e.onKeyDown,(l)=>{if(l.key==="Home")d(l),l.preventDefault();else if(l.key==="End")m(l),l.preventDefault();else if(ue.concat(fe).includes(l.key))g(l),l.preventDefault()}),onPointerDown:Y(e.onPointerDown,(l)=>{let p=l.target;if(p.setPointerCapture(l.pointerId),l.preventDefault(),v.thumbs.has(p))p.focus({preventScroll:!0,focusVisible:!1});else s(l)}),onPointerMove:Y(e.onPointerMove,(l)=>{if(l.target.hasPointerCapture(l.pointerId))n(l)}),onPointerUp:Y(e.onPointerUp,(l)=>{let p=l.target;if(p.hasPointerCapture(l.pointerId))p.releasePointerCapture(l.pointerId),c(l)})})},"SliderImpl")),Ne="SliderTrack",ze=F(f(function(e,r){let{__scopeSlider:i,...s}=e,n=U(Ne,i);return t(se.span,{"data-disabled":n.disabled?"":void 0,"data-orientation":n.orientation,...s,ref:r})},"SliderTrack")),de="SliderRange",He=F(f(function(e,r){let{__scopeSlider:i,...s}=e,n=U(de,i),c=he(de,i),d=y(null),m=_e(r,d),g=n.values.length,b=n.values.map((p)=>Z(p,n.min,n.max)),v=g>1?Math.min(...b):0,l=100-Math.max(...b);return t(se.span,{"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,...s,ref:m,style:{...e.style,[c.startEdge]:v+"%",[c.endEdge]:l+"%"}})},"SliderRange")),Fe="SliderThumb",[Le,ge]=Q(Fe),Oe="SliderThumbProvider";function be(a){let{__scopeSlider:e,name:r,children:i,internal_do_not_use_render:s}=a,n=U(Oe,e),c=Ve(e),[d,m]=u(null),g=N(()=>d?c().findIndex((x)=>x.ref.current===d):-1,[c,d]),b=mi(d),v=d?!!n.form||!!d.closest("form"):!0,l=n.values[g],p=r??(n.name?n.name+(n.values.length>1?"[]":""):void 0),P=l===void 0?0:Z(l,n.min,n.max);h(()=>{if(d)return n.thumbs.add(d),()=>{n.thumbs.delete(d)}},[d,n.thumbs]);let R={value:l,name:p,form:n.form,isFormControl:v,index:g,thumb:d,onThumbChange:m,percent:P,size:b};return t(Le,{scope:e,...R,children:Ee(s)?s(R):i})}f(be,"SliderThumbProvider");var q="SliderThumbTrigger",Ue=F(f(function(e,r){let{__scopeSlider:i,...s}=e,n=U(q,i),c=he(q,i),{index:d,value:m,percent:g,size:b,onThumbChange:v}=ge(q,i),l=_e(r,v),p=Re(d,n.values.length),P=b?.[c.size],R=P?Pe(P,g,c.direction):0;return t("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${g}% + ${R}px)`},children:t(J.ItemSlot,{scope:i,children:t(se.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":n.min,"aria-valuenow":m,"aria-valuemax":n.max,"aria-orientation":n.orientation,"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,tabIndex:n.disabled?void 0:0,...s,ref:l,style:m===void 0?{display:"none"}:e.style,onFocus:Y(e.onFocus,()=>{n.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),Ye=F(f(function(e,r){let{__scopeSlider:i,name:s,...n}=e;return t(be,{__scopeSlider:i,name:s,internal_do_not_use_render:({index:c,isFormControl:d})=>o(L,{children:[t(Ue,{...n,ref:r,__scopeSlider:i}),d?t($e,{__scopeSlider:i},c):null]})})},"SliderThumb")),Ge="SliderBubbleInput",$e=F(f(function({__scopeSlider:e,...r},i){let{value:s,name:n,form:c}=ge(Ge,e),d=y(null),m=_e(d,i),g=Pc(s);return h(()=>{let b=d.current;if(!b)return;let v=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(v,"value").set;if(g!==s&&p){let P=new Event("input",{bubbles:!0});p.call(b,s),b.dispatchEvent(P)}},[g,s]),t(se.input,{style:{display:"none"},name:n,form:c,...r,ref:m,defaultValue:s})},"SliderBubbleInput"));function ve(a=[],e,r){let i=[...a];return i[r]=e,i.sort((s,n)=>s-n)}f(ve,"getNextSortedValues");function Z(a,e,r){let n=100/(r-e)*(a-e);return Ai(n,[0,100])}f(Z,"convertValueToPercentage");function Re(a,e){if(e>2)return`Value ${a+1} of ${e}`;else if(e===2)return["Minimum","Maximum"][a];else return}f(Re,"getLabel");function we(a,e){if(a.length===1)return 0;let r=a.map((s)=>Math.abs(s-e)),i=Math.min(...r);return r.indexOf(i)}f(we,"getClosestValueIndex");function Pe(a,e,r){let i=a/2,s=50,n=G([0,50],[0,i]);return(i-n(e)*r)*r}f(Pe,"getThumbInBoundsOffset");function xe(a){return a.slice(0,-1).map((e,r)=>a[r+1]-e)}f(xe,"getStepsBetweenValues");function ye(a,e){if(e>0){let r=xe(a);return Math.min(...r)>=e}return!0}f(ye,"hasMinStepsBetweenValues");function G(a,e){return(r)=>{if(a[0]===a[1]||e[0]===e[1])return e[0];let i=(e[1]-e[0])/(a[1]-a[0]);return e[0]+i*(r-a[0])}}f(G,"linearScale");function ee(a){if(!Number.isFinite(a))return 0;let e=a.toString();if(e.includes("e")){let[i,s]=e.split("e"),n=i.split(".")[1]||"",c=Number(s);return Math.max(0,n.length-c)}let r=e.split(".")[1];return r?r.length:0}f(ee,"getDecimalCount");function H(a,e){let r=Math.pow(10,e);return Math.round(a*r)/r}f(H,"roundValue");function Te(a,{min:e,step:r,direction:i,multiplier:s}){let n=ee(r),c=(a-e)/r,d=Math.round(c),m=H(d*r+e,n)===H(a,n),g;if(m)g=d+s*i;else if(i>0)g=Math.ceil(c);else g=Math.floor(c);return H(g*r+e,n)}f(Te,"getNextStepValue");function Ee(a){return typeof a==="function"}f(Ee,"isFunction");function Uo({className:a,defaultValue:e,value:r,min:i=0,max:s=100,...n}){let c=N(()=>Array.isArray(r)?r:Array.isArray(e)?e:[i,s],[r,e,i,s]);return o(Be,{"data-slot":"slider",defaultValue:e,value:r,min:i,max:s,className:C("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",a),...n,children:[t(ze,{"data-slot":"slider-track",className:C("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:t(He,{"data-slot":"slider-range",className:C("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(d,m)=>t(Ye,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},m))]})}
|
|
2
|
-
export{
|
|
1
|
+
import{F,m,D,_,u,S,L,t,o,C,gt,ye,Y,Lt,se,Ai,_i,$n,bi,Lc}from"./chunk-qx553512.js";S();S();var De=Object.defineProperty,f=(a,e)=>De(a,"name",{value:e,configurable:!0}),ue=["PageUp","PageDown"],fe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],me={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},O="Slider",[J,Ve,Ie]=_i(O),[Q,it]=gt(O,[Ie]),[Ae,U]=Q(O),Be=F(f(function(e,r){let{name:i,min:s=0,max:n=100,step:c=1,orientation:d="horizontal",disabled:h=!1,minStepsBetweenThumbs:g=0,defaultValue:b=[s],value:v,onValueChange:l=f(()=>{},"onValueChange"),onValueCommit:p=f(()=>{},"onValueCommit"),inverted:P=!1,form:R,...x}=e,T=_(new Set),y=_(0),E=_(!1),V=d==="horizontal"?Ke:ke,[B,te]=u(null),j=ye(r,te),[I=[],X]=Lt({prop:v,defaultProp:b,onChange:f((w)=>{[...T.current][y.current]?.focus({preventScroll:!0,focusVisible:E.current}),E.current=!1,l(w)},"onChange")}),ne=_(I),Ce=_(I);m(()=>{let w=R?B?.ownerDocument.getElementById(R):B?.closest("form");if(w instanceof HTMLFormElement){let A=f(()=>X(Ce.current),"reset");return w.addEventListener("reset",A),()=>w.removeEventListener("reset",A)}},[B,R,X]);function re(w){let A=we(I,w);k(w,A)}f(re,"handleSlideStart");function oe(w){k(w,y.current)}f(oe,"handleSlideMove");function ie(){if(String(I)!==String(ne.current))p(I)}f(ie,"handleSlideEnd");function k(w,A,{commit:ae}={commit:!1}){let le=ee(c),W=H(Math.round((w-s)/c)*c+s,le),z=bi(W,[s,n]);X((N=[])=>{let K=ve(N,z,A);if(_e(K,g*c)){y.current=K.indexOf(z);let ce=String(K)!==String(N);if(ce&&ae)p(K);return ce?K:N}else return N})}return f(k,"updateValues"),t(Ae,{scope:e.__scopeSlider,name:i,disabled:h,min:s,max:n,valueIndexToChangeRef:y,thumbs:T.current,values:I,orientation:d,form:R,children:t(J.Provider,{scope:e.__scopeSlider,children:t(J.Slot,{scope:e.__scopeSlider,children:t(V,{"aria-disabled":h,"data-disabled":h?"":void 0,...x,ref:j,onPointerDown:Y(x.onPointerDown,()=>{if(!h)ne.current=I,E.current=!1}),min:s,max:n,inverted:P,onSlideStart:h?void 0:re,onSlideMove:h?void 0:oe,onSlideEnd:h?void 0:ie,onHomeKeyDown:()=>{if(!h)E.current=!0,k(s,0,{commit:!0})},onEndKeyDown:()=>{if(!h)E.current=!0,k(n,I.length-1,{commit:!0})},onStepKeyDown:({event:w,direction:A})=>{if(!h){E.current=!0;let W=ue.includes(w.key)||w.shiftKey&&fe.includes(w.key)?10:1,z=y.current,N=I[z],K=Te(N,{min:s,step:c,direction:A,multiplier:W});k(K,z,{commit:!0})}}})})})})},"Slider")),[Se,he]=Q(O,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Ke=F(f(function(e,r){let{min:i,max:s,dir:n,inverted:c,onSlideStart:d,onSlideMove:h,onSlideEnd:g,onStepKeyDown:b,...v}=e,[l,p]=u(null),P=ye(r,p),R=_(void 0),x=$n(n),T=x==="ltr",y=T&&!c||!T&&c;function E(M){let V=R.current||l.getBoundingClientRect(),B=[0,V.width],j=G(B,y?[i,s]:[s,i]);return R.current=V,j(M-V.left)}return f(E,"getValueFromPointer"),t(Se,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:t(pe,{dir:x,"data-orientation":"horizontal",...v,ref:P,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:(M)=>{let V=E(M.clientX);d?.(V)},onSlideMove:(M)=>{let V=E(M.clientX);h?.(V)},onSlideEnd:()=>{R.current=void 0,g?.()},onStepKeyDown:(M)=>{let B=me[y?"from-left":"from-right"].includes(M.key);b?.({event:M,direction:B?-1:1})}})})},"SliderHorizontal")),ke=F(f(function(e,r){let{min:i,max:s,inverted:n,onSlideStart:c,onSlideMove:d,onSlideEnd:h,onStepKeyDown:g,...b}=e,v=_(null),l=ye(r,v),p=_(void 0),P=!n;function R(x){let T=p.current||v.current.getBoundingClientRect(),y=[0,T.height],M=G(y,P?[s,i]:[i,s]);return p.current=T,M(x-T.top)}return f(R,"getValueFromPointer"),t(Se,{scope:e.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:t(pe,{"data-orientation":"vertical",...b,ref:l,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:(x)=>{let T=R(x.clientY);c?.(T)},onSlideMove:(x)=>{let T=R(x.clientY);d?.(T)},onSlideEnd:()=>{p.current=void 0,h?.()},onStepKeyDown:(x)=>{let y=me[P?"from-bottom":"from-top"].includes(x.key);g?.({event:x,direction:y?-1:1})}})})},"SliderVertical")),pe=F(f(function(e,r){let{__scopeSlider:i,onSlideStart:s,onSlideMove:n,onSlideEnd:c,onHomeKeyDown:d,onEndKeyDown:h,onStepKeyDown:g,...b}=e,v=U(O,i);return t(se.span,{...b,ref:r,onKeyDown:Y(e.onKeyDown,(l)=>{if(l.key==="Home")d(l),l.preventDefault();else if(l.key==="End")h(l),l.preventDefault();else if(ue.concat(fe).includes(l.key))g(l),l.preventDefault()}),onPointerDown:Y(e.onPointerDown,(l)=>{let p=l.target;if(p.setPointerCapture(l.pointerId),l.preventDefault(),v.thumbs.has(p))p.focus({preventScroll:!0,focusVisible:!1});else s(l)}),onPointerMove:Y(e.onPointerMove,(l)=>{if(l.target.hasPointerCapture(l.pointerId))n(l)}),onPointerUp:Y(e.onPointerUp,(l)=>{let p=l.target;if(p.hasPointerCapture(l.pointerId))p.releasePointerCapture(l.pointerId),c(l)})})},"SliderImpl")),Ne="SliderTrack",ze=F(f(function(e,r){let{__scopeSlider:i,...s}=e,n=U(Ne,i);return t(se.span,{"data-disabled":n.disabled?"":void 0,"data-orientation":n.orientation,...s,ref:r})},"SliderTrack")),de="SliderRange",He=F(f(function(e,r){let{__scopeSlider:i,...s}=e,n=U(de,i),c=he(de,i),d=_(null),h=ye(r,d),g=n.values.length,b=n.values.map((p)=>Z(p,n.min,n.max)),v=g>1?Math.min(...b):0,l=100-Math.max(...b);return t(se.span,{"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,...s,ref:h,style:{...e.style,[c.startEdge]:v+"%",[c.endEdge]:l+"%"}})},"SliderRange")),Fe="SliderThumb",[Le,ge]=Q(Fe),Oe="SliderThumbProvider";function be(a){let{__scopeSlider:e,name:r,children:i,internal_do_not_use_render:s}=a,n=U(Oe,e),c=Ve(e),[d,h]=u(null),g=D(()=>d?c().findIndex((x)=>x.ref.current===d):-1,[c,d]),b=Ai(d),v=d?!!n.form||!!d.closest("form"):!0,l=n.values[g],p=r??(n.name?n.name+(n.values.length>1?"[]":""):void 0),P=l===void 0?0:Z(l,n.min,n.max);m(()=>{if(d)return n.thumbs.add(d),()=>{n.thumbs.delete(d)}},[d,n.thumbs]);let R={value:l,name:p,form:n.form,isFormControl:v,index:g,thumb:d,onThumbChange:h,percent:P,size:b};return t(Le,{scope:e,...R,children:Ee(s)?s(R):i})}f(be,"SliderThumbProvider");var q="SliderThumbTrigger",Ue=F(f(function(e,r){let{__scopeSlider:i,...s}=e,n=U(q,i),c=he(q,i),{index:d,value:h,percent:g,size:b,onThumbChange:v}=ge(q,i),l=ye(r,v),p=Re(d,n.values.length),P=b?.[c.size],R=P?Pe(P,g,c.direction):0;return t("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${g}% + ${R}px)`},children:t(J.ItemSlot,{scope:i,children:t(se.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":n.min,"aria-valuenow":h,"aria-valuemax":n.max,"aria-orientation":n.orientation,"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,tabIndex:n.disabled?void 0:0,...s,ref:l,style:h===void 0?{display:"none"}:e.style,onFocus:Y(e.onFocus,()=>{n.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),Ye=F(f(function(e,r){let{__scopeSlider:i,name:s,...n}=e;return t(be,{__scopeSlider:i,name:s,internal_do_not_use_render:({index:c,isFormControl:d})=>o(L,{children:[t(Ue,{...n,ref:r,__scopeSlider:i}),d?t($e,{__scopeSlider:i},c):null]})})},"SliderThumb")),Ge="SliderBubbleInput",$e=F(f(function({__scopeSlider:e,...r},i){let{value:s,name:n,form:c}=ge(Ge,e),d=_(null),h=ye(d,i),g=Lc(s);return m(()=>{let b=d.current;if(!b)return;let v=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(v,"value").set;if(g!==s&&p){let P=new Event("input",{bubbles:!0});p.call(b,s),b.dispatchEvent(P)}},[g,s]),t(se.input,{style:{display:"none"},name:n,form:c,...r,ref:h,defaultValue:s})},"SliderBubbleInput"));function ve(a=[],e,r){let i=[...a];return i[r]=e,i.sort((s,n)=>s-n)}f(ve,"getNextSortedValues");function Z(a,e,r){let n=100/(r-e)*(a-e);return bi(n,[0,100])}f(Z,"convertValueToPercentage");function Re(a,e){if(e>2)return`Value ${a+1} of ${e}`;else if(e===2)return["Minimum","Maximum"][a];else return}f(Re,"getLabel");function we(a,e){if(a.length===1)return 0;let r=a.map((s)=>Math.abs(s-e)),i=Math.min(...r);return r.indexOf(i)}f(we,"getClosestValueIndex");function Pe(a,e,r){let i=a/2,s=50,n=G([0,50],[0,i]);return(i-n(e)*r)*r}f(Pe,"getThumbInBoundsOffset");function xe(a){return a.slice(0,-1).map((e,r)=>a[r+1]-e)}f(xe,"getStepsBetweenValues");function _e(a,e){if(e>0){let r=xe(a);return Math.min(...r)>=e}return!0}f(_e,"hasMinStepsBetweenValues");function G(a,e){return(r)=>{if(a[0]===a[1]||e[0]===e[1])return e[0];let i=(e[1]-e[0])/(a[1]-a[0]);return e[0]+i*(r-a[0])}}f(G,"linearScale");function ee(a){if(!Number.isFinite(a))return 0;let e=a.toString();if(e.includes("e")){let[i,s]=e.split("e"),n=i.split(".")[1]||"",c=Number(s);return Math.max(0,n.length-c)}let r=e.split(".")[1];return r?r.length:0}f(ee,"getDecimalCount");function H(a,e){let r=Math.pow(10,e);return Math.round(a*r)/r}f(H,"roundValue");function Te(a,{min:e,step:r,direction:i,multiplier:s}){let n=ee(r),c=(a-e)/r,d=Math.round(c),h=H(d*r+e,n)===H(a,n),g;if(h)g=d+s*i;else if(i>0)g=Math.ceil(c);else g=Math.floor(c);return H(g*r+e,n)}f(Te,"getNextStepValue");function Ee(a){return typeof a==="function"}f(Ee,"isFunction");function jo({className:a,defaultValue:e,value:r,min:i=0,max:s=100,...n}){let c=D(()=>Array.isArray(r)?r:Array.isArray(e)?e:[i,s],[r,e,i,s]);return o(Be,{"data-slot":"slider",defaultValue:e,value:r,min:i,max:s,className:C("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",a),...n,children:[t(ze,{"data-slot":"slider-track",className:C("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:t(He,{"data-slot":"slider-range",className:C("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(d,h)=>t(Ye,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},h))]})}
|
|
2
|
+
export{jo};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ge,qt}from"./chunk-
|
|
2
|
+
import{Ge,qt}from"./chunk-y5h5d5gx.js";import{H}from"./chunk-a8bymrv1.js";var _=H(Ge());var N=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.AccessKeyId==="string"&&typeof e.SecretAccessKey==="string"&&typeof e.Token==="string"&&typeof e.Expiration==="string",h=(e)=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration),...e.AccountId&&{accountId:e.AccountId}});var C=({maxRetries:e=0,timeout:t=1000})=>({maxRetries:e,timeout:t});var v=H(Ge());import R from"http";function E(e){return new Promise((t,n)=>{let o=R.request({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});o.on("error",(r)=>{n(Object.assign(new v.ProviderError("Unable to connect to instance metadata service"),r)),o.destroy()}),o.on("timeout",()=>{n(new v.ProviderError("TimeoutError from instance metadata service")),o.destroy()}),o.on("response",(r)=>{let{statusCode:a=400}=r;if(a<200||300<=a)n(Object.assign(new v.ProviderError("Error response received from instance metadata service"),{statusCode:a})),o.destroy();let p=[];r.on("data",(s)=>{p.push(s)}),r.on("end",()=>{t(Buffer.concat(p)),o.destroy()})}),o.end()})}var T=(e,t)=>{let n=e();for(let o=0;o<t;o++)n=n.catch(e);return n};var A="AWS_CONTAINER_CREDENTIALS_FULL_URI",g="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",D="AWS_CONTAINER_AUTHORIZATION_TOKEN",G=(e={})=>{let{timeout:t,maxRetries:n}=C(e);return()=>T(async()=>{let o=await X({logger:e.logger}),r=JSON.parse(await q(t,o));if(!N(r))throw new _.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:e.logger});return h(r)},n)},q=async(e,t)=>{if(process.env[D])t.headers={...t.headers,Authorization:process.env[D]};return(await E({...t,timeout:e})).toString()},Y="169.254.170.2",j=new Set(["localhost","127.0.0.1"]),J=new Set(["http:","https:"]),X=async({logger:e})=>{if(process.env[g])return{hostname:Y,path:process.env[g]};if(process.env[A]){let t;try{t=new URL(process.env[A])}catch{throw new _.CredentialsProviderError(`${process.env[A]} is not a valid container metadata service URL`,{tryNextLink:!1,logger:e})}if(!t.hostname||!j.has(t.hostname))throw new _.CredentialsProviderError(`${t.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!t.protocol||!J.has(t.protocol))throw new _.CredentialsProviderError(`${t.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{protocol:t.protocol,hostname:t.hostname,path:t.pathname+t.search,port:t.port?parseInt(t.port,10):void 0}}throw new _.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${g} or ${A} environment variable is set`,{tryNextLink:!1,logger:e})};var u=H(Ge());var y=H(Ge());class O extends y.CredentialsProviderError{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(e,t=!0){super(e,t);this.tryNextLink=t,Object.setPrototypeOf(this,O.prototype)}}var w=H(Ge()),F=H(qt());var S;(function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"})(S||(S={}));var P={environmentVariableSelector:(e)=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(e)=>e.ec2_metadata_service_endpoint,default:void 0};var l;(function(e){e.IPv4="IPv4",e.IPv6="IPv6"})(l||(l={}));var z="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",Z="ec2_metadata_service_endpoint_mode",L={environmentVariableSelector:(e)=>e[z],configFileSelector:(e)=>e[Z],default:l.IPv4};var b=async()=>F.parseUrl(await Q()||await ee()),Q=async()=>w.loadConfig(P)(),ee=async()=>{let e=await w.loadConfig(L)();switch(e){case l.IPv4:return S.IPv4;case l.IPv6:return S.IPv6;default:throw Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(l)}`)}};var M=(e,t)=>{let n=300+Math.floor(Math.random()*300),o=new Date(Date.now()+n*1000);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(o)}.
|
|
3
3
|
For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let r=e.originalExpiration??e.expiration;return{...e,...r?{originalExpiration:r}:{},expiration:o}};var V=(e,t={})=>{let n=t?.logger||console,o;return async()=>{let r;try{if(r=await e(),r.expiration&&r.expiration.getTime()<Date.now())r=M(r,n)}catch(a){if(o)n.warn("Credential renew failed: ",a),r=M(o,n);else throw a}return o=r,r}};var W="/latest/meta-data/iam/security-credentials/",te="/latest/api/token",x="AWS_EC2_METADATA_V1_DISABLED",k="ec2_metadata_v1_disabled",U="x-aws-ec2-metadata-token",oe=(e={})=>V(re(e),{logger:e.logger}),re=(e={})=>{let t=!1,{logger:n,profile:o}=e,{timeout:r,maxRetries:a}=C(e),p=async(s,m)=>{if(t||m.headers?.[U]==null){let i=!1,c=!1,B=await u.loadConfig({environmentVariableSelector:(d)=>{let f=d[x];if(c=!!f&&f!=="false",f===void 0)throw new u.CredentialsProviderError(`${x} not set in env, checking config file next.`,{logger:e.logger});return c},configFileSelector:(d)=>{let f=d[k];return i=!!f&&f!=="false",i},default:!1},{profile:o})();if(e.ec2MetadataV1Disabled||B){let d=[];if(e.ec2MetadataV1Disabled)d.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(i)d.push(`config file profile (${k})`);if(c)d.push(`process environment variable (${x})`);throw new O(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${d.join(", ")}].`)}}let K=(await T(async()=>{let i;try{i=await ae(m)}catch(c){if(c.statusCode===401)t=!1;throw c}return i},s)).trim();return T(async()=>{let i;try{i=await se(K,m,e)}catch(c){if(c.statusCode===401)t=!1;throw c}return i},s)};return async()=>{let s=await b();if(t)return n?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),p(a,{...s,timeout:r});else{let m;try{m=(await ne({...s,timeout:r})).toString()}catch(I){if(I?.statusCode===400)throw Object.assign(I,{message:"EC2 Metadata token request returned error"});else if(I.message==="TimeoutError"||[403,404,405].includes(I.statusCode))t=!0;return n?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),p(a,{...s,timeout:r})}return p(a,{...s,headers:{[U]:m},timeout:r})}}},ne=async(e)=>E({...e,path:te,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),ae=async(e)=>(await E({...e,path:W})).toString(),se=async(e,t,n)=>{let o=JSON.parse((await E({...t,path:W+e})).toString());if(!N(o))throw new u.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:n.logger});return h(o)};export{A as ENV_CMDS_FULL_URI,g as ENV_CMDS_RELATIVE_URI,G as fromContainerMetadata,oe as fromInstanceMetadata};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ko}from"./chunk-4bc3gqmn.js";import{Dt}from"./chunk-3ahax79y.js";import{Ge,Xt,qt}from"./chunk-y5h5d5gx.js";import{H}from"./chunk-a8bymrv1.js";var N=H(Dt()),c=H(Ge()),w=H(Ko());import L from"fs/promises";var l=H(Ge());var O="169.254.170.2",y="169.254.170.23",v="[fd00:ec2::23]",A=(e,o)=>{if(e.protocol==="https:")return;if(e.hostname===O||e.hostname===y||e.hostname===v)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;let n=e.hostname.split("."),r=(t)=>{let s=parseInt(t,10);return 0<=s&&s<=255};if(n[0]==="127"&&r(n[1])&&r(n[2])&&r(n[3])&&n.length===4)return}throw new l.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
3
3
|
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
4
4
|
- ECS container host 169.254.170.2
|
|
5
5
|
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:o})};var i=H(Ge()),C=H(qt()),p=H(Xt()),_=H(Xt());function f(e){return new C.HttpRequest({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((o,[n,r])=>(o[n]=r,o),{}),fragment:e.hash})}async function I(e,o){let r=await _.sdkStreamMixin(e.body).transformToString();if(e.statusCode===200){let t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new i.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:o});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:p.parseRfc3339DateTime(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new i.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:o}),{Code:t.Code,Message:t.Message})}throw new i.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:o})}var u=(e,o,n)=>async()=>{for(let r=0;r<o;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,n))}return await e()};var U="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",k="http://169.254.170.2",K="AWS_CONTAINER_CREDENTIALS_FULL_URI",P="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",F="AWS_CONTAINER_AUTHORIZATION_TOKEN",x=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let o,n=e.awsContainerCredentialsRelativeUri??process.env[U],r=e.awsContainerCredentialsFullUri??process.env[K],t=e.awsContainerAuthorizationToken??process.env[F],s=e.awsContainerAuthorizationTokenFile??process.env[P],a=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?.warn?console.warn:e.logger.warn.bind(e.logger);if(n&&r)a("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),a("awsContainerCredentialsRelativeUri will take precedence.");if(t&&s)a("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),a("awsContainerAuthorizationTokenFile will take precedence.");if(n)o=`${k}${n}`;else if(r)o=r;else throw new c.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{In,S,t,o,Z,A,m0,v0,Nf,_d,Yf,wS,HC,Pp,Yg,DI,Gp,Vp,An,ue,ae,pe,le,Mt,DA,kn,ao,Io,he}from"./chunk-qx553512.js";import{ko}from"./chunk-03zkxckm.js";S();var y=(g)=>g.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:");function Yl({sessionId:g,open:N,onOpenChange:_}){let{data:x,isLoading:D}=Z({queryKey:["agent-sessions",g,"entries"],queryFn:async()=>{if(!g)return[];let s=await A.api["agent-sessions"][":sessionId"].entries.$get({param:{sessionId:g}});if(!s.ok)throw Error("Failed to fetch session logs");return await s.json()},enabled:N&&!!g});return t(ue,{open:N,onOpenChange:_,children:o(ae,{className:"sm:max-w-2xl max-h-[80vh] flex flex-col p-6 overflow-hidden bg-background/95 backdrop-blur-md border border-foreground/15 shadow-2xl",children:[o(pe,{className:"pb-4 border-b border-foreground/15",children:[o(le,{className:"flex items-center gap-2 text-xl font-bold",children:[t(ko,{className:"w-5 h-5 text-violet-500"}),v0()]}),t(Mt,{children:m0()})]}),t("div",{className:"flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text",children:D?o("div",{className:"space-y-4",children:[o("div",{className:"flex gap-4",children:[t(he,{className:"h-5 w-5 rounded-full shrink-0"}),o("div",{className:"flex-1 space-y-2",children:[t(he,{className:"h-4 w-1/4"}),t(he,{className:"h-20 w-full"})]})]}),o("div",{className:"flex gap-4",children:[t(he,{className:"h-5 w-5 rounded-full shrink-0"}),o("div",{className:"flex-1 space-y-2",children:[t(he,{className:"h-4 w-1/4"}),t(he,{className:"h-12 w-full"})]})]})]}):x&&x.length>0?t("div",{className:"flex flex-col",children:x.map((s)=>{let a=s.entry,b=a?.timestamp||s.timestamp,f="";if(typeof b==="string"||typeof b==="number"){let e=new Date(b);if(!isNaN(e.getTime()))f=kn(e.toISOString())}if(a&&typeof a==="object"){if(a.type==="custom_message"){if(a.customType==="context")return null;if(a.customType==="shumai_message"){let e=DA(a.details),m=typeof a.content==="string"?a.content:"",p=e?`${m}
|
|
2
2
|
|
|
3
|
-
${e}`.trim():m,w="bg-primary/10 text-primary",v=
|
|
4
|
-
export{
|
|
3
|
+
${e}`.trim():m,w="bg-primary/10 text-primary",v=Yg();return o("div",{className:"relative pl-6 pb-6 last:pb-0",children:[t("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),t("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center bg-primary"}),o("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[o("div",{className:"flex items-center justify-between gap-2",children:[o("div",{className:"flex items-center gap-2 flex-wrap",children:[t("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider bg-primary/10 text-primary",children:v}),o("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:_d(),children:[_d(),": ",s.id]})]}),t("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:f})]}),t("div",{className:"text-xs text-foreground/90 whitespace-pre-wrap leading-relaxed font-sans",children:p})]})]},s.id)}}if(a.type==="message"&&a.message){let e=a.message,m="bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200",p=String(e.role||"");if(e.role==="user")m="bg-primary/10 text-primary",p=Yg();else if(e.role==="assistant")m="bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300",p=HC();else if(e.role==="toolResult")m=e.isError?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300":"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300",p=Vp({name:String(e.toolName||An())});else if(e.role==="thought")m="bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",p=Pp();let w=(n)=>{let r=n;if(typeof n==="string")try{r=JSON.parse(n)}catch{}if(r&&typeof r==="object"&&!Array.isArray(r))return t("div",{className:"mt-1 space-y-1.5 pt-3",children:Object.entries(r).map(([l,i])=>{let c=i&&typeof i==="object"?JSON.stringify(i,null,2):String(i);return o("div",{className:"text-xs leading-relaxed break-words",children:[o("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:[l,":"]})," ",t("span",{className:"text-foreground/90 font-mono whitespace-pre-wrap",children:c})]},l)})});return t("div",{className:"text-xs font-mono whitespace-pre-wrap",children:String(n)})},v=()=>{let n=e.content;if(!n)return null;if(typeof n==="string"){if(!n.trim())return null;return t("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:t(Io,{children:y(n)})})}if(Array.isArray(n)){let r=[];if(n.forEach((d,l)=>{if(!d)return;if(typeof d==="string"){if(!d.trim())return;r.push(t("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:t(Io,{children:y(d)})},`str-${l}`));return}if(typeof d==="object"){let i=d,c=i.type;if(c==="text"){let u=i.text;if(typeof u!=="string"||!u.trim())return;r.push(t("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:t(Io,{children:y(u)})},`txt-${l}`));return}if(c==="toolCall"){let u=String(i.name||i.toolName||An()),h=i.arguments||i.args;r.push(o("div",{className:"text-xs space-y-2 py-1",children:[o("div",{className:"font-semibold text-violet-600 dark:text-violet-400 flex items-center gap-1.5",children:[Nf()," ",t("span",{className:"font-mono bg-violet-500/10 px-1 py-0.5 rounded text-[11px]",children:u})]}),!!h&&o("div",{className:"space-y-1 pt-3",children:[t("div",{className:"text-[10px] text-muted-foreground/60 uppercase font-bold tracking-wider",children:Gp()}),w(h)]})]},`tool-${l}`));return}if(c==="image"){r.push(t("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Yf()},`img-${l}`));return}let k=JSON.stringify(d,null,2);if(k==="{}")return;r.push(t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:k},`other-${l}`))}}),r.length===0)return null;return t("div",{className:"space-y-3 w-full",children:r.map((d,l)=>o(In,{children:[l>0&&t(ao,{className:"my-3 opacity-50"}),d]},l))})}return null};return o("div",{className:"relative pl-6 pb-6 last:pb-0",children:[t("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),t("div",{className:`absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center ${e.role==="user"?"bg-primary":e.role==="assistant"?"bg-violet-500":e.role==="toolResult"?e.isError?"bg-red-500":"bg-emerald-500":"bg-amber-500"}`}),o("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[o("div",{className:"flex items-center justify-between gap-2",children:[o("div",{className:"flex items-center gap-2 flex-wrap",children:[t("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider ${m}`,children:p}),o("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:_d(),children:[_d(),": ",s.id]})]}),t("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:f})]}),v()]})]},s.id)}}return o("div",{className:"relative pl-6 pb-6 last:pb-0",children:[t("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),t("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background bg-gray-400"}),o("div",{className:"bg-muted/30 p-3 rounded-lg border border-foreground/5",children:[o("div",{className:"flex items-center justify-between gap-2 mb-1.5 flex-wrap",children:[o("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:"Entry ID",children:["ID: ",s.id]}),t("div",{className:"text-[10px] text-muted-foreground/60",children:f})]}),t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words",children:JSON.stringify(s.entry,null,2)})]})]},s.id)})}):o("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[t(ko,{className:"w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse"}),t("p",{className:"text-sm font-medium",children:wS()}),t("p",{className:"text-xs text-muted-foreground/60 mt-1",children:DI()})]})})]})})}
|
|
4
|
+
export{Yl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{m,u,S,L,t,o,Re,gn,ze,I,ir,O,to,on,E,Mm,iy,ay,Wf,Jf,kw,lS,cS,_p,pE,mE,hE,Vg,zC,jC,z,f,R,W,Ul,zl,jl}from"./chunk-qx553512.js";import{nr}from"./chunk-qqapw198.js";var v=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],w=I("key-round",v);S();var x=R({password:f().min(3,_p()),confirmPassword:f().min(3,_p())}).refine((s)=>s.password===s.confirmPassword,{message:hE(),path:["confirmPassword"]}),b=ze("/reset-password")({component:N});function N(){let s=Re(),r=b.useSearch().token||"",[n,a]=u(null),[l,c]=u(!1),[i,h]=u(!1),e=zl({resolver:jl(x),defaultValues:{password:"",confirmPassword:""}});m(()=>{if(i){let d=setTimeout(()=>{s({to:"/login"})},3000);return()=>clearTimeout(d)}},[i,s]);let g=async(d)=>{if(!r){a(Jf());return}c(!0),a(null);let{error:p}=await Mm({newPassword:d.password,token:r});if(c(!1),p){a(p.message||Jf());return}h(!0)};return o(Ul,{children:[o("div",{className:"mb-8",children:[t("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:Vg()}),t("p",{className:"text-muted-foreground text-sm mt-1",children:zC()})]}),!r?o("div",{className:"space-y-6",children:[o("div",{className:"p-4 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm flex items-start gap-3",children:[t(nr,{className:"w-5 h-5 shrink-0 mt-0.5"}),o("div",{className:"space-y-1",children:[t("p",{className:"font-semibold",children:Jf()}),t("p",{className:"text-xs text-muted-foreground",children:kw()})]})]}),t(gn,{to:"/login",className:"block w-full",children:o(E,{variant:"outline",className:"w-full h-11 rounded-xl flex items-center justify-center gap-2",children:[Wf(),t(to,{className:"w-4 h-4"})]})})]}):i?o("div",{className:"space-y-6",children:[o("div",{className:"p-4 bg-emerald-500/10 border border-emerald-500/20 text-emerald-600 dark:text-emerald-400 rounded-xl text-sm flex items-start gap-3",children:[t(ir,{className:"w-5 h-5 shrink-0 mt-0.5"}),o("div",{className:"space-y-1",children:[t("p",{className:"font-semibold",children:pE()}),t("p",{className:"text-xs text-muted-foreground",children:mE()})]})]}),t(gn,{to:"/login",className:"block w-full",children:o(E,{className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",children:[Wf(),t(to,{className:"w-4 h-4"})]})})]}):o("form",{onSubmit:e.handleSubmit(g),className:"space-y-5",children:[n&&t("div",{className:"p-3 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm text-center font-medium",children:n}),o("div",{className:"space-y-2",children:[t(W,{htmlFor:"password",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:lS()}),o("div",{className:"relative group",children:[t(on,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),t(z,{id:"password",type:"password",...e.register("password"),placeholder:cS(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),e.formState.errors.password&&t("p",{className:"text-destructive text-xs font-medium",children:e.formState.errors.password.message})]}),o("div",{className:"space-y-2",children:[t(W,{htmlFor:"confirmPassword",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:iy()}),o("div",{className:"relative group",children:[t(on,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),t(z,{id:"confirmPassword",type:"password",...e.register("confirmPassword"),placeholder:ay(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),e.formState.errors.confirmPassword&&t("p",{className:"text-destructive text-xs font-medium",children:e.formState.errors.confirmPassword.message})]}),t(E,{type:"submit",className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",disabled:l,children:l?o(L,{children:[t(O,{className:"h-4 w-4 animate-spin"}),jC()]}):o(L,{children:[t(w,{className:"w-4 h-4"}),Vg()]})}),t("div",{className:"pt-2 text-center text-sm",children:t(gn,{to:"/login",className:"font-semibold text-rose-500 hover:text-rose-600 dark:text-rose-400 dark:hover:text-rose-300 transition-colors hover:underline inline-flex items-center gap-1",children:Wf()})})]})]})}export{b as Route};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{F,
|
|
1
|
+
import{F,P,m,D,_,u,S,L,t,o,B,A,I,ea,ve,er,ar,Ra,we,Ne,E,sn,an,ln,cn,Ce,Ie,Te,__,fb,Pb,rp,Ox,PC,ZC,BC,r1,ut,Si,At,_t,yt,Ks,jr,$t,he}from"./chunk-qx553512.js";import{To,vn,Lr,ma}from"./chunk-np39aknv.js";var Mt=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],_u=I("arrow-left",Mt);var Et=[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]],ze=I("brush",Et);var It=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],je=I("redo",It);var Rt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],$e=I("square",Rt);var Dt=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],Be=I("undo",Dt);S();var Lt=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#a855f7","#ec4899","#000000","#ffffff"],Ws=F(({projectId:v,onSendMessage:He,replyingTo:d,onCancelReply:ne,placeholder:Oe,initialText:V="",value:R,onChangeText:T,disabled:pe=!1,allowMentions:qe,disableMentions:We=!1,allowAttachments:Ke=!0,workspaceAssets:y,onRemoveWorkspaceAsset:fe,allowMarkup:Ve,hideAnnotationControl:Xe=!1,canMarkup:Qe=!0,markupDisabledTooltip:Ge,allowTimestamp:Je=!0,currentTime:f,frameRate:g,startTimecode:ge,formatTimestamp:w,bottomLeftExtra:Ye,isStreaming:oe=!1,onAbort:Ze,onTyping:U},et)=>{let[b,z]=u([]),[re,X]=u(null),[h,tt]=u(!0),j=qe??!We,nt=Ve??!Xe,H=Je,{videoTimeDisplayMode:Q}=$t(),ot=D(()=>{if(f===void 0)return"";if(w)return w(f);if(!g)return"";let e=Math.round(f*g);return vn(e,g,Q,ge)},[f,g,Q,ge,w]),{teamId:G,ensureTeamIdForProject:be}=ut(),{members:xe,loading:ye,fetchMembers:rt,fetchProjectMembers:at}=jr();m(()=>{if(v&&!G)be(v)},[v,G,be]);let{isDrawing:st,setIsDrawing:O,currentTool:J,setTool:Y,currentColor:ke,setColor:lt,undo:it,redo:ct,history:dt,historyIndex:Me,annotations:ae,reset:Ae}=Lr(),[se,N]=u(!1),[le,mt]=u(""),[q,W]=u(0),[x,Ee]=u({bots:!1,users:!1}),[ie,k]=u(!1),pt=D(()=>{if(!h||!H||f===void 0||!w&&!g||ie)return"";if(Q==="timecode")return"pl-[120px]";return"pl-[85px]"},[h,H,f,g,ie,Q,w]),s=_(null),Z=_(null),C=_(null),Re=_(null),M=_(!1),{mutateAsync:De}=B({mutationFn:async({projectId:e,data:n})=>{let r=await A.api.projects[":projectId"].attachments.$post({param:{projectId:e},json:n});if(!r.ok)throw Error("Failed to create attachment");return await r.json()}});m(()=>{if(R!==void 0&&s.current){if(M.current){M.current=!1;return}if(s.current.innerText!==R)s.current.innerText=R,k(!!R.trim())}else if(V&&s.current){s.current.innerText=V,k(!!V.trim()),s.current.focus();let e=document.createRange(),n=window.getSelection();e.selectNodeContents(s.current),e.collapse(!1),n?.removeAllRanges(),n?.addRange(e)}},[R,V]);let ce=_(null),Le=P((e)=>{if(!s.current)return;let n=document.createElement("span");n.contentEditable="false",n.dataset.type="mention",n.dataset.id=e.id,n.className="inline-block bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 px-1.5 py-0.5 rounded-md text-sm font-medium align-middle select-none mx-0.5",n.innerText=`@${e.name}`;let r=document.createTextNode(" ");s.current.appendChild(n),s.current.appendChild(r);let l=document.createRange(),i=window.getSelection();l.setStartAfter(r),l.collapse(!0),i?.removeAllRanges(),i?.addRange(l),k(!0);let a=s.current.innerText||"";M.current=!0,T?.(a),U?.(),s.current.focus()},[T,U]);m(()=>{if(d&&s.current){if(d.id!==ce.current){if(ce.current=d.id,j&&d.creator?.id&&d.creator?.name){let r=s.current.querySelectorAll('span[data-type="mention"]');if(!Array.from(r).some((i)=>i.dataset.id===d.creator.id)){Le({id:d.creator.id,name:d.creator.name});return}}}s.current.focus();let e=document.createRange(),n=window.getSelection();e.selectNodeContents(s.current),e.collapse(!1),n?.removeAllRanges(),n?.addRange(e)}else if(!d)ce.current=null},[d,j,Le]),m(()=>()=>{O(!1)},[O]);let K=xe.filter((e)=>e.type==="agent"&&e.name?.toLowerCase().startsWith(le.toLowerCase())).map((e)=>({type:"user",data:e})),ee=xe.filter((e)=>e.type!=="agent"&&e.name?.toLowerCase().startsWith(le.toLowerCase())).map((e)=>({type:"user",data:e})),te=[...x.bots?[]:K,...x.users?[]:ee];m(()=>{W(0)},[le,se,x]),m(()=>{Re.current?.querySelector(`[data-index="${q}"]`)?.scrollIntoView({block:"nearest"})},[q]);let Se=(e)=>e.split(" ").map((n)=>n[0]).slice(0,2).join("").toUpperCase(),Pe=()=>{if(!s.current)return;let e=s.current.innerText||"";if(k(!!e.trim()),M.current=!0,T?.(e),U?.(),!j){N(!1),C.current=null;return}let n=window.getSelection();if(!n||n.rangeCount===0)return;let r=n.getRangeAt(0),{startContainer:l,startOffset:i}=r;if(l.nodeType===Node.TEXT_NODE){let c=(l.textContent||"").slice(0,i),p=c.lastIndexOf("@");if(p!==-1){let kt=p===0,Ct=c[p-1];if(kt||/\s/.test(Ct)){let Ue=c.slice(p+1);if(!/\s/.test(Ue)){if(mt(Ue),N(!0),v)at(v,!0,!0);else if(G)rt(G,!0,!0);let me=document.createRange();me.setStart(l,p),me.setEnd(l,i),C.current=me;return}}}}N(!1),C.current=null},de=(e)=>{if(!C.current||!s.current)return;let n=C.current;n.deleteContents();let r=document.createElement("span");r.contentEditable="false",r.dataset.type="mention",r.dataset.id=e.data.id,r.className="inline-block bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 px-1.5 py-0.5 rounded-md text-sm font-medium align-middle select-none mx-0.5",r.innerText=`@${e.data.name}`,n.insertNode(r);let l=document.createTextNode(" ");r.after(l);let i=document.createRange(),a=window.getSelection();i.setStartAfter(l),i.collapse(!0),a?.removeAllRanges(),a?.addRange(i),N(!1),C.current=null,k(!0);let c=s.current.innerText||"";M.current=!0,T?.(c),U?.(),s.current.focus()},ft=(e)=>{e.preventDefault();let n=e.clipboardData.getData("text/plain");if(!n)return;let r=window.getSelection();if(!r||r.rangeCount===0||!s.current?.contains(r.anchorNode)){if(s.current){s.current.focus();let i=document.createRange();i.selectNodeContents(s.current),i.collapse(!1),r=window.getSelection(),r?.removeAllRanges(),r?.addRange(i)}}if(!(typeof document.execCommand==="function"&&document.queryCommandSupported?.("insertText")&&document.execCommand("insertText",!1,n))){let i=window.getSelection();if(i&&i.rangeCount>0){let a=i.getRangeAt(0);a.deleteContents();let c=document.createTextNode(n);a.insertNode(c),a.setStartAfter(c),a.collapse(!0),i.removeAllRanges(),i.addRange(a)}else if(s.current)s.current.innerText+=n}Pe()},gt=(e)=>{if(e.nativeEvent.isComposing)return;if(se&&j&&te.length>0){if(e.key==="ArrowUp"){e.preventDefault(),W((n)=>n>0?n-1:te.length-1);return}if(e.key==="ArrowDown"){e.preventDefault(),W((n)=>n<te.length-1?n+1:0);return}if(e.key==="Enter"||e.key==="Tab"){e.preventDefault(),de(te[q]);return}if(e.key==="Escape"){e.preventDefault(),N(!1);return}}if(e.key==="Enter"&&!e.shiftKey)e.preventDefault(),_e()},bt=P(async(e)=>{if(!e.target.files)return;let n=Array.from(e.target.files);for(let r of n){let l=`${Date.now()}-${r.name}`,i={id:l,file:r,progress:0};z((a)=>[...a,i]);try{let a=await De({projectId:v,data:{fileName:r.name,contentType:r.type,size:r.size}});if(a.uploadUrl&&a.id)await fetch(a.uploadUrl,{method:"PUT",body:r,headers:{"Content-Type":r.type}}),z((c)=>c.map((p)=>p.id===l?{...p,progress:100,attachmentId:a.id}:p))}catch(a){z((c)=>c.map((p)=>p.id===l?{...p,error:a instanceof Error?a.message:"Upload failed"}:p))}}if(Z.current)Z.current.value=""},[v,De]),ht=(e)=>{z((n)=>n.filter((r)=>r.id!==e))},_e=()=>{if(!s.current)return;if(b.some((a)=>!a.attachmentId&&!a.error))return;let n=b.map((a)=>a.attachmentId).filter((a)=>!!a),r=b.filter((a)=>!a.error&&!!a.attachmentId).map((a)=>({id:a.attachmentId,name:a.file.name,type:a.file.type,url:a.file.type.startsWith("image/")||Ks(a.file.name)?URL.createObjectURL(a.file):void 0})),l="";s.current.childNodes.forEach((a)=>{if(a.nodeType===Node.TEXT_NODE)l+=a.textContent;else if(a.nodeType===Node.ELEMENT_NODE){let c=a;if(c.dataset.type==="mention")l+=`<@${c.dataset.id}>`;else if(c.tagName==="BR")l+=`
|
|
2
2
|
`;else if(c.tagName==="DIV"||c.tagName==="P")l+=`
|
|
3
|
-
`+c.innerText;else l+=c.innerText}}),l=l.trim();let i=(
|
|
3
|
+
`+c.innerText;else l+=c.innerText}}),l=l.trim();let i=(y?.length??0)>0;if(!l&&n.length===0&&ae.length===0&&!i)return;if(He(l,n,ae,d?.id,H&&h?f:void 0,r),s.current.innerHTML="",k(!1),M.current=!0,T?.(""),z([]),X(null),O(!1),Ae(),N(!1),ne)ne()},ue=b.some((e)=>!e.attachmentId&&!e.error),xt=b.some((e)=>!!e.attachmentId),vt=(y?.length??0)>0,wt=pe||oe,Fe=(ie||xt||ae.length>0||vt)&&!wt,Nt=y&&y.length>0||b.length>0||!!d;return o("div",{ref:et,className:"relative flex flex-col w-full border border-foreground/35 rounded-3xl shadow-sm transition-all duration-200 bg-background",children:[t("style",{children:`
|
|
4
4
|
[contenteditable]:empty:before {
|
|
5
5
|
content: attr(data-placeholder);
|
|
6
6
|
color: #9ca3af;
|
|
7
7
|
cursor: text;
|
|
8
8
|
}
|
|
9
|
-
`}),se&&j&&(ye||K.length>0||ee.length>0)&&t("div",{onMouseDown:(e)=>e.preventDefault(),className:"absolute bottom-full left-4 mb-2 w-64 rounded-xl shadow-lg border border-border overflow-hidden z-20 bg-popover text-popover-foreground animate-in fade-in slide-in-from-bottom-2 duration-200",children:t("div",{ref:Re,className:"h-64 overflow-y-auto",children:ye?o("div",{className:"p-2 space-y-4 animate-pulse",children:[o("div",{className:"space-y-2",children:[t("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:t(me,{className:"h-3 w-16"})}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(me,{className:"w-6 h-6 rounded-full"}),t(me,{className:"h-4 w-28"})]}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(me,{className:"w-6 h-6 rounded-full"}),t(me,{className:"h-4 w-20"})]})]}),o("div",{className:"space-y-2",children:[t("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:t(me,{className:"h-3 w-16"})}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(me,{className:"w-6 h-6 rounded-full"}),t(me,{className:"h-4 w-32"})]}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(me,{className:"w-6 h-6 rounded-full"}),t(me,{className:"h-4 w-24"})]})]})]}):o(L,{children:[K.length>0&&o(L,{children:[o("button",{type:"button",onMouseDown:(e)=>e.preventDefault(),onClick:(e)=>{e.preventDefault(),e.stopPropagation(),Ee((n)=>({...n,bots:!n.bots})),s.current?.focus()},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border flex items-center justify-between hover:bg-muted transition-colors cursor-pointer select-none",children:[t("span",{children:"Agents"}),t(ve,{className:`w-3 h-3 transition-transform ${x.bots?"-rotate-90":""}`})]}),!x.bots&&K.map((e,n)=>{let r=n;return o("button",{type:"button","data-index":r,onMouseDown:(l)=>l.preventDefault(),onClick:()=>de(e),onMouseEnter:()=>W(r),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left cursor-pointer ${r===q?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[o(Ce,{className:"w-6 h-6",children:[e.type==="user"&&e.data.image&&t(Ie,{src:e.data.image,alt:e.data.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-purple-400 text-black font-semibold",children:Se(e.data.name)})]}),t("span",{className:"text-sm",children:e.data.name})]},e.data.id)})]}),ee.length>0&&o(L,{children:[o("button",{type:"button",onMouseDown:(e)=>e.preventDefault(),onClick:(e)=>{e.preventDefault(),e.stopPropagation(),Ee((n)=>({...n,users:!n.users})),s.current?.focus()},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border flex items-center justify-between hover:bg-muted transition-colors cursor-pointer select-none",children:[t("span",{children:"Members"}),t(ve,{className:`w-3 h-3 transition-transform ${x.users?"-rotate-90":""}`})]}),!x.users&&ee.map((e,n)=>{let r=x.bots?0:K.length,l=n+r;return o("button",{type:"button","data-index":l,onMouseDown:(i)=>i.preventDefault(),onClick:()=>de(e),onMouseEnter:()=>W(l),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left cursor-pointer ${l===q?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[o(Ce,{className:"w-6 h-6",children:[e.type==="user"&&e.data.image&&t(Ie,{src:e.data.image,alt:e.data.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-purple-400 text-black font-semibold",children:Se(e.data.name)})]}),t("span",{className:"text-sm",children:e.data.name})]},e.data.id)})]})]})})}),kt&&o("div",{className:"flex flex-col gap-2 p-3 pb-0 animate-in fade-in slide-in-from-bottom-2 duration-200",children:[w&&w.length>0&&t("div",{className:"flex flex-col gap-1.5 min-h-0 max-h-[160px] overflow-y-auto border border-border/60 rounded-lg bg-muted/20 p-2.5 divide-y divide-border/50",children:w.map((e)=>o("div",{className:"flex items-center justify-between py-1 text-xs group",children:[o("div",{className:"flex items-baseline gap-1.5 min-w-0 pr-2",children:[t("span",{className:"truncate font-medium text-foreground",children:e.name}),t("span",{className:"text-[9px] text-muted-foreground uppercase flex-shrink-0",children:e.type})]}),ge&&t("button",{onClick:()=>ge(e.id),className:"text-muted-foreground hover:text-destructive transition-colors p-0.5 cursor-pointer",title:gC?.()||"Remove from context",children:t(we,{className:"h-3.5 w-3.5"})})]},e.id))}),d&&o("div",{className:"flex items-center justify-between bg-muted p-2 px-3 rounded-lg border border-border",children:[t("div",{className:"text-xs text-muted-foreground truncate mr-2",children:xC({message:d.message||""})}),t("button",{onClick:ne,className:"text-muted-foreground hover:text-foreground p-1 rounded-full hover:bg-muted-foreground/10 shrink-0",children:t(Ne,{className:"w-3.5 h-3.5"})})]}),g.length>0&&t("div",{className:"flex gap-3 overflow-x-auto py-2 px-1 scrollbar-hide",children:g.map((e)=>o("div",{className:"relative group flex-shrink-0",children:[o("div",{className:"w-16 h-16 rounded-lg border border-gray-200 overflow-hidden bg-gray-50 flex items-center justify-center",children:[e.file.type.startsWith("image/")?t("img",{src:URL.createObjectURL(e.file),alt:"preview",onClick:()=>X(e.file),className:`w-full h-full object-cover ${!e.attachmentId?"opacity-50":""}`}):t(tr,{className:"w-8 h-8 text-gray-400"}),ue&&!e.attachmentId&&!e.error&&t("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:t(pa,{progress:e.progress,className:"w-10 h-10"})})]}),t("button",{onClick:()=>vt(e.id),className:"absolute -top-1.5 -right-1.5 bg-gray-500 text-white rounded-full p-0.5 shadow-md opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-500 z-10 cursor-pointer",children:t(Ne,{className:"w-3 h-3"})}),t("span",{className:"text-[10px] text-gray-500 mt-1 block max-w-[4rem] truncate text-center",children:e.file.name})]},e.id))})]}),o("div",{onClick:()=>s.current?.focus(),className:"w-full px-4 pt-1 pb-1 cursor-text flow-root max-h-60 overflow-y-auto",children:[H&&b&&p!==void 0&&(f!==void 0||k!==void 0)&&t("div",{onClick:(e)=>{e.stopPropagation(),s.current?.focus()},className:"float-left select-none bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-2.5 py-0.5 mt-3 mr-2 rounded-sm text-xs font-mono font-bold flex items-center gap-1 cursor-text",children:ot}),t("div",{ref:s,contentEditable:!fe&&!oe,suppressContentEditableWarning:!0,onInput:Pe,onKeyDown:bt,onPaste:ft,"data-placeholder":Oe||(d?wC():yx()),className:`bg-transparent border-none focus:ring-0 resize-none min-h-[40px] leading-relaxed py-2 focus:outline-none block whitespace-pre-wrap break-words ${pt}`})]}),o("div",{className:"flex justify-between items-center px-2 pb-2",children:[st?o("div",{className:"flex items-center gap-2 overflow-x-auto scrollbar-hide w-full mr-2",children:[t(E,{onClick:()=>{O(!1),Ae()},variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer text-gray-500 hover:text-gray-700 hover:bg-gray-100 mr-2",title:"Back",children:t(Au,{className:"w-4 h-4"})}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),t("button",{onClick:()=>Y("arrow"),className:`p-1.5 rounded hover:bg-gray-100 ${J==="arrow"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Arrow",children:t(ea,{size:16,className:"rotate-45"})}),t("button",{onClick:()=>Y("line"),className:`p-1.5 rounded hover:bg-gray-100 ${J==="line"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Line",children:t(Vs,{size:16,className:"-rotate-45"})}),t("button",{onClick:()=>Y("box"),className:`p-1.5 rounded hover:bg-gray-100 ${J==="box"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Box",children:t($e,{size:16})}),t("button",{onClick:()=>Y("freehand"),className:`p-1.5 rounded hover:bg-gray-100 ${J==="freehand"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Freehand",children:t(ze,{size:16})}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),o(ht,{children:[t(gt,{asChild:!0,children:o("button",{className:"flex items-center gap-1 p-1 rounded hover:bg-gray-100",children:[t("div",{className:"w-4 h-4 rounded-full border border-gray-200",style:{backgroundColor:ke}}),t(ve,{size:12,className:"text-gray-500"})]})}),t(At,{className:"w-auto p-2",align:"center",side:"top",children:t("div",{className:"flex items-center gap-1",children:Tt.map((e)=>t("button",{onClick:()=>it(e),className:`w-6 h-6 rounded-full border border-gray-200 transition-transform hover:scale-110 ${ke===e?"ring-2 ring-blue-500 ring-offset-1":""}`,style:{backgroundColor:e}},e))})})]}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),t("button",{onClick:ct,disabled:Me<=0,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:t(Be,{size:16})}),t("button",{onClick:dt,disabled:Me>=ut.length-1,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:t(je,{size:16})})]}):o("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[80%]",children:[Ye,Ke&&o(L,{children:[t("input",{type:"file",ref:Z,className:"hidden",multiple:!0,onChange:xt}),t(E,{onClick:()=>Z.current?.click(),className:"p-2 rounded-full cursor-pointer shrink-0",variant:"ghost",size:"icon",title:f_(),children:t(ka,{className:"w-4 h-4"})})]}),H&&p!==void 0&&(f!==void 0||k!==void 0)&&t(E,{onClick:()=>tt(!b),variant:b?"secondary":"ghost",size:"icon",className:`p-2 rounded-full cursor-pointer shrink-0 ${b?"text-blue-600 bg-blue-50 dark:bg-blue-900/20":""}`,title:b?ib():Cb(),children:t(er,{className:"w-4 h-4"})}),nt&&(Qe?t(E,{onClick:()=>{U?.(),O(!0)},variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer shrink-0",title:zT(),children:t(vi,{className:"w-4 h-4"})}):t(sn,{children:o(an,{children:[t(ln,{asChild:!0,children:t("span",{className:"inline-block cursor-not-allowed shrink-0",children:t(E,{disabled:!0,variant:"ghost",size:"icon",className:"p-2 rounded-full opacity-40 cursor-not-allowed pointer-events-none",children:t(vi,{className:"w-4 h-4"})})})}),t(cn,{side:"top",children:t("p",{className:"text-xs",children:Ge||Xf()})})]})}))]}),oe?t("button",{onClick:Ze,className:"p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm bg-destructive text-destructive-foreground hover:bg-destructive/90 transform hover:-translate-y-0.5 cursor-pointer",title:"Stop generation",children:t("div",{className:"h-4 w-4 flex items-center justify-center",children:t("div",{className:"h-3 w-3 rounded-[2px] bg-white"})})}):t("button",{onClick:_e,disabled:!Fe||ue,className:`p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 ${Fe&&!ue?"bg-blue-600 text-white shadow-md hover:bg-blue-700 hover:shadow-lg transform hover:-translate-y-0.5 cursor-pointer":"bg-gray-400 cursor-not-allowed opacity-50"}`,children:t(ea,{className:"w-4 h-4"})})]}),re&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>X(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50",children:t(Ne,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:URL.createObjectURL(re),alt:"Enlarged view",className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),X(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:re.name})]})]})});Gs.displayName="ChatInput";
|
|
10
|
-
export{
|
|
9
|
+
`}),se&&j&&(ye||K.length>0||ee.length>0)&&t("div",{onMouseDown:(e)=>e.preventDefault(),className:"absolute bottom-full left-4 mb-2 w-64 rounded-xl shadow-lg border border-border overflow-hidden z-20 bg-popover text-popover-foreground animate-in fade-in slide-in-from-bottom-2 duration-200",children:t("div",{ref:Re,className:"h-64 overflow-y-auto",children:ye?o("div",{className:"p-2 space-y-4 animate-pulse",children:[o("div",{className:"space-y-2",children:[t("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:t(he,{className:"h-3 w-16"})}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(he,{className:"w-6 h-6 rounded-full"}),t(he,{className:"h-4 w-28"})]}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(he,{className:"w-6 h-6 rounded-full"}),t(he,{className:"h-4 w-20"})]})]}),o("div",{className:"space-y-2",children:[t("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:t(he,{className:"h-3 w-16"})}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(he,{className:"w-6 h-6 rounded-full"}),t(he,{className:"h-4 w-32"})]}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(he,{className:"w-6 h-6 rounded-full"}),t(he,{className:"h-4 w-24"})]})]})]}):o(L,{children:[K.length>0&&o(L,{children:[o("button",{type:"button",onMouseDown:(e)=>e.preventDefault(),onClick:(e)=>{e.preventDefault(),e.stopPropagation(),Ee((n)=>({...n,bots:!n.bots})),s.current?.focus()},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border flex items-center justify-between hover:bg-muted transition-colors cursor-pointer select-none",children:[t("span",{children:"Agents"}),t(ve,{className:`w-3 h-3 transition-transform ${x.bots?"-rotate-90":""}`})]}),!x.bots&&K.map((e,n)=>{let r=n;return o("button",{type:"button","data-index":r,onMouseDown:(l)=>l.preventDefault(),onClick:()=>de(e),onMouseEnter:()=>W(r),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left cursor-pointer ${r===q?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[o(Ce,{className:"w-6 h-6",children:[e.type==="user"&&e.data.image&&t(Ie,{src:e.data.image,alt:e.data.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-purple-400 text-black font-semibold",children:Se(e.data.name)})]}),t("span",{className:"text-sm",children:e.data.name})]},e.data.id)})]}),ee.length>0&&o(L,{children:[o("button",{type:"button",onMouseDown:(e)=>e.preventDefault(),onClick:(e)=>{e.preventDefault(),e.stopPropagation(),Ee((n)=>({...n,users:!n.users})),s.current?.focus()},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border flex items-center justify-between hover:bg-muted transition-colors cursor-pointer select-none",children:[t("span",{children:"Members"}),t(ve,{className:`w-3 h-3 transition-transform ${x.users?"-rotate-90":""}`})]}),!x.users&&ee.map((e,n)=>{let r=x.bots?0:K.length,l=n+r;return o("button",{type:"button","data-index":l,onMouseDown:(i)=>i.preventDefault(),onClick:()=>de(e),onMouseEnter:()=>W(l),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left cursor-pointer ${l===q?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[o(Ce,{className:"w-6 h-6",children:[e.type==="user"&&e.data.image&&t(Ie,{src:e.data.image,alt:e.data.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-purple-400 text-black font-semibold",children:Se(e.data.name)})]}),t("span",{className:"text-sm",children:e.data.name})]},e.data.id)})]})]})})}),Nt&&o("div",{className:"flex flex-col gap-2 p-3 pb-0 animate-in fade-in slide-in-from-bottom-2 duration-200",children:[y&&y.length>0&&t("div",{className:"flex flex-col gap-1.5 min-h-0 max-h-[160px] overflow-y-auto border border-border/60 rounded-lg bg-muted/20 p-2.5 divide-y divide-border/50",children:y.map((e)=>o("div",{className:"flex items-center justify-between py-1 text-xs group",children:[o("div",{className:"flex items-baseline gap-1.5 min-w-0 pr-2",children:[t("span",{className:"truncate font-medium text-foreground",children:e.name}),t("span",{className:"text-[9px] text-muted-foreground uppercase flex-shrink-0",children:e.type})]}),fe&&t("button",{onClick:()=>fe(e.id),className:"text-muted-foreground hover:text-destructive transition-colors p-0.5 cursor-pointer",title:PC?.()||"Remove from context",children:t(we,{className:"h-3.5 w-3.5"})})]},e.id))}),d&&o("div",{className:"flex items-center justify-between bg-muted p-2 px-3 rounded-lg border border-border",children:[t("div",{className:"text-xs text-muted-foreground truncate mr-2",children:BC({message:d.message||""})}),t("button",{onClick:ne,className:"text-muted-foreground hover:text-foreground p-1 rounded-full hover:bg-muted-foreground/10 shrink-0",children:t(Ne,{className:"w-3.5 h-3.5"})})]}),b.length>0&&t("div",{className:"flex gap-3 overflow-x-auto py-2 px-1 scrollbar-hide",children:b.map((e)=>o("div",{className:"relative group flex-shrink-0",children:[o("div",{className:"w-16 h-16 rounded-lg border border-gray-200 overflow-hidden bg-gray-50 flex items-center justify-center",children:[e.file.type.startsWith("image/")?t("img",{src:URL.createObjectURL(e.file),alt:"preview",onClick:()=>X(e.file),className:`w-full h-full object-cover ${!e.attachmentId?"opacity-50":""}`}):t(ar,{className:"w-8 h-8 text-gray-400"}),ue&&!e.attachmentId&&!e.error&&t("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:t(ma,{progress:e.progress,className:"w-10 h-10"})})]}),t("button",{onClick:()=>ht(e.id),className:"absolute -top-1.5 -right-1.5 bg-gray-500 text-white rounded-full p-0.5 shadow-md opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-500 z-10 cursor-pointer",children:t(Ne,{className:"w-3 h-3"})}),t("span",{className:"text-[10px] text-gray-500 mt-1 block max-w-[4rem] truncate text-center",children:e.file.name})]},e.id))})]}),o("div",{onClick:()=>s.current?.focus(),className:"w-full px-4 pt-1 pb-1 cursor-text flow-root max-h-60 overflow-y-auto",children:[H&&h&&f!==void 0&&(g!==void 0||w!==void 0)&&t("div",{onClick:(e)=>{e.stopPropagation(),s.current?.focus()},className:"float-left select-none bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-2.5 py-0.5 mt-3 mr-2 rounded-sm text-xs font-mono font-bold flex items-center gap-1 cursor-text",children:ot}),t("div",{ref:s,contentEditable:!pe&&!oe,suppressContentEditableWarning:!0,onInput:Pe,onKeyDown:gt,onPaste:ft,"data-placeholder":Oe||(d?ZC():Ox()),className:`bg-transparent border-none focus:ring-0 resize-none min-h-[40px] leading-relaxed py-2 focus:outline-none block whitespace-pre-wrap break-words ${pt}`})]}),o("div",{className:"flex justify-between items-center px-2 pb-2",children:[st?o("div",{className:"flex items-center gap-2 overflow-x-auto scrollbar-hide w-full mr-2",children:[t(E,{onClick:()=>{O(!1),Ae()},variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer text-gray-500 hover:text-gray-700 hover:bg-gray-100 mr-2",title:"Back",children:t(_u,{className:"w-4 h-4"})}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),t("button",{onClick:()=>Y("arrow"),className:`p-1.5 rounded hover:bg-gray-100 ${J==="arrow"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Arrow",children:t(ea,{size:16,className:"rotate-45"})}),t("button",{onClick:()=>Y("line"),className:`p-1.5 rounded hover:bg-gray-100 ${J==="line"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Line",children:t(To,{size:16,className:"-rotate-45"})}),t("button",{onClick:()=>Y("box"),className:`p-1.5 rounded hover:bg-gray-100 ${J==="box"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Box",children:t($e,{size:16})}),t("button",{onClick:()=>Y("freehand"),className:`p-1.5 rounded hover:bg-gray-100 ${J==="freehand"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Freehand",children:t(ze,{size:16})}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),o(At,{children:[t(_t,{asChild:!0,children:o("button",{className:"flex items-center gap-1 p-1 rounded hover:bg-gray-100",children:[t("div",{className:"w-4 h-4 rounded-full border border-gray-200",style:{backgroundColor:ke}}),t(ve,{size:12,className:"text-gray-500"})]})}),t(yt,{className:"w-auto p-2",align:"center",side:"top",children:t("div",{className:"flex items-center gap-1",children:Lt.map((e)=>t("button",{onClick:()=>lt(e),className:`w-6 h-6 rounded-full border border-gray-200 transition-transform hover:scale-110 ${ke===e?"ring-2 ring-blue-500 ring-offset-1":""}`,style:{backgroundColor:e}},e))})})]}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),t("button",{onClick:it,disabled:Me<=0,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:t(Be,{size:16})}),t("button",{onClick:ct,disabled:Me>=dt.length-1,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:t(je,{size:16})})]}):o("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[80%]",children:[Ye,Ke&&o(L,{children:[t("input",{type:"file",ref:Z,className:"hidden",multiple:!0,onChange:bt}),t(E,{onClick:()=>Z.current?.click(),className:"p-2 rounded-full cursor-pointer shrink-0",variant:"ghost",size:"icon",title:__(),children:t(Ra,{className:"w-4 h-4"})})]}),H&&f!==void 0&&(g!==void 0||w!==void 0)&&t(E,{onClick:()=>tt(!h),variant:h?"secondary":"ghost",size:"icon",className:`p-2 rounded-full cursor-pointer shrink-0 ${h?"text-blue-600 bg-blue-50 dark:bg-blue-900/20":""}`,title:h?fb():Pb(),children:t(er,{className:"w-4 h-4"})}),nt&&(Qe?t(E,{onClick:()=>{U?.(),O(!0)},variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer shrink-0",title:r1(),children:t(Si,{className:"w-4 h-4"})}):t(sn,{children:o(an,{children:[t(ln,{asChild:!0,children:t("span",{className:"inline-block cursor-not-allowed shrink-0",children:t(E,{disabled:!0,variant:"ghost",size:"icon",className:"p-2 rounded-full opacity-40 cursor-not-allowed pointer-events-none",children:t(Si,{className:"w-4 h-4"})})})}),t(cn,{side:"top",children:t("p",{className:"text-xs",children:Ge||rp()})})]})}))]}),oe?t("button",{onClick:Ze,className:"p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm bg-destructive text-destructive-foreground hover:bg-destructive/90 transform hover:-translate-y-0.5 cursor-pointer",title:"Stop generation",children:t("div",{className:"h-4 w-4 flex items-center justify-center",children:t("div",{className:"h-3 w-3 rounded-[2px] bg-white"})})}):t("button",{onClick:_e,disabled:!Fe||ue,className:`p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 ${Fe&&!ue?"bg-blue-600 text-white shadow-md hover:bg-blue-700 hover:shadow-lg transform hover:-translate-y-0.5 cursor-pointer":"bg-gray-400 cursor-not-allowed opacity-50"}`,children:t(ea,{className:"w-4 h-4"})})]}),re&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>X(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50",children:t(Ne,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:URL.createObjectURL(re),alt:"Enlarged view",className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),X(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:re.name})]})]})});Ws.displayName="ChatInput";
|
|
10
|
+
export{_u,Ws};
|