@shumai-one/shumai 0.6.2 → 0.6.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-02b5bcmc.js +1 -0
- package/bin/{chunk-m0q2cgfg.js → chunk-09mj32d7.js} +1 -1
- package/bin/{chunk-b7bnp021.js → chunk-09mpcg9x.js} +2 -2
- package/bin/{chunk-257dcd2f.js → chunk-0a298n62.js} +2 -2
- package/bin/{chunk-cz13a82m.js → chunk-0rgbxp24.js} +2 -2
- package/bin/{chunk-mwktrwtx.js → chunk-19zbh4fr.js} +1 -1
- package/bin/{chunk-v05rrxp5.js → chunk-1e1q1hyg.js} +2 -2
- package/bin/{chunk-fatmqnp1.js → chunk-1ja2zw4w.js} +1 -1
- package/bin/chunk-1tar0x8s.js +7 -0
- package/bin/{chunk-1nvd90g2.js → chunk-1y6h4vge.js} +1 -1
- package/bin/{chunk-tekwpkjf.js → chunk-20bamhwa.js} +2 -2
- package/bin/{chunk-8mqbztj8.js → chunk-20w1w9x7.js} +2 -2
- package/bin/{chunk-qwpkcp8d.js → chunk-25npafhz.js} +2 -2
- package/bin/{chunk-km4gn6b6.js → chunk-2qgagdb7.js} +1 -1
- package/bin/chunk-2t6g3pny.js +3 -0
- package/bin/{chunk-ns33grgx.js → chunk-34f64q0q.js} +1 -1
- package/bin/{chunk-1wfg56z3.js → chunk-3hgrw1m0.js} +4 -4
- package/bin/{chunk-p3f5aevs.js → chunk-3s2ga6mt.js} +1 -1
- package/bin/{chunk-hzkjgcre.js → chunk-3vpz5nat.js} +1 -1
- package/bin/{chunk-2jj4j8cn.js → chunk-4p31kxjh.js} +2 -2
- package/bin/{chunk-9t3p4xp6.js → chunk-4vjgdj0h.js} +1 -1
- package/bin/{chunk-96qpjght.js → chunk-50pfmxt1.js} +2 -2
- package/bin/{chunk-2cdxm1cp.js → chunk-5ddg5ezb.js} +9 -9
- package/bin/chunk-5ngftxjb.js +218 -0
- package/bin/{chunk-r1xer8gn.js → chunk-6f3zhq64.js} +3 -3
- package/bin/chunk-6nqqe7w9.js +1 -0
- package/bin/{chunk-h1n7jqnw.js → chunk-6t525bmg.js} +1 -1
- package/bin/{chunk-01052ssf.js → chunk-7546ptwg.js} +11 -11
- package/bin/{chunk-82tps5n1.js → chunk-7jz3cmq6.js} +1 -1
- package/bin/{chunk-v5cn90cf.js → chunk-7kah3zb5.js} +2 -2
- package/bin/{chunk-73yncv54.js → chunk-7mawxsk3.js} +2 -2
- package/bin/chunk-8ww98y1m.js +2 -0
- package/bin/{chunk-55h9ze53.js → chunk-9405hzv2.js} +2 -2
- package/bin/{chunk-cgmebxx6.js → chunk-95b4mwyq.js} +1 -1
- package/bin/chunk-9vxmgvc8.js +2 -0
- package/bin/{chunk-knj2s8mg.js → chunk-9x42vgeq.js} +5 -5
- package/bin/{chunk-7sgrtxbt.js → chunk-a859y4e1.js} +2 -2
- package/bin/{chunk-y241cxff.js → chunk-addssm8d.js} +1 -1
- package/bin/{chunk-f6avg5qe.js → chunk-ajq9sxg0.js} +33 -33
- package/bin/chunk-amp9h878.js +2 -0
- package/bin/{chunk-yk12hydf.js → chunk-atdfqdkj.js} +4 -4
- package/bin/{chunk-5wapd171.js → chunk-atpt99h4.js} +10 -10
- package/bin/chunk-awshe30f.js +1 -0
- package/bin/chunk-b3t7gbhm.js +2 -0
- package/bin/{chunk-e4f56spj.js → chunk-bbxwyhz3.js} +3 -3
- package/bin/{chunk-a411xhmm.js → chunk-bd3v8mp1.js} +4 -4
- package/bin/{chunk-167z646e.js → chunk-brgns7hv.js} +1 -1
- package/bin/{chunk-576nj64j.js → chunk-c02727j9.js} +2 -2
- package/bin/{chunk-8yjsmr7g.js → chunk-c1wvs81k.js} +1 -1
- package/bin/chunk-c8frmqsk.js +2 -0
- package/bin/{chunk-xc54vhfz.js → chunk-cagzye3j.js} +1 -1
- package/bin/{chunk-s9ksftq2.js → chunk-cp96e9pq.js} +1 -1
- package/bin/{chunk-q5vkxee3.js → chunk-d55138xx.js} +2 -2
- package/bin/{chunk-7v7mypc6.js → chunk-ddmf9gqv.js} +2 -2
- package/bin/chunk-djb65frk.js +1 -0
- package/bin/{chunk-q83h0hkx.js → chunk-dkhdn92k.js} +2 -2
- package/bin/chunk-dx9f5wab.js +1 -0
- package/bin/{chunk-f25fe9th.js → chunk-dygj751y.js} +11 -11
- package/bin/{chunk-m9adtgzk.js → chunk-e55sgg8t.js} +1 -1
- package/bin/{chunk-q8w4mbw4.js → chunk-enax4303.js} +2 -2
- package/bin/{chunk-vcrmjtcz.js → chunk-erfkd3z9.js} +2 -2
- package/bin/{chunk-8cjet7pp.js → chunk-esj0kwe5.js} +5 -5
- package/bin/{chunk-atfz7g7e.js → chunk-etrm28sy.js} +1 -1
- package/bin/chunk-ex3174e3.js +2 -0
- package/bin/{chunk-9n1w5dw1.js → chunk-ezjxx44x.js} +3 -3
- package/bin/{chunk-cf5axr8c.js → chunk-f4xnx4n6.js} +1 -1
- package/bin/{chunk-7naa7tpn.js → chunk-f8hgy69t.js} +2 -2
- package/bin/chunk-fakph5jp.js +1 -0
- package/bin/{chunk-kvhf12b4.js → chunk-femnbfkj.js} +1 -1
- package/bin/{chunk-ah8fjb6f.js → chunk-ffjdkdcv.js} +2 -2
- package/bin/{chunk-vkzasgxw.js → chunk-gd016e9p.js} +2 -2
- package/bin/{chunk-ympbfzz4.js → chunk-gyv3yrhj.js} +1 -1
- package/bin/{chunk-jzgbxqdg.js → chunk-h2bphev9.js} +2 -2
- package/bin/chunk-h3atwgx2.js +1 -0
- package/bin/chunk-h7xny3de.js +2 -0
- package/bin/{chunk-m82tkhaa.js → chunk-hg3rkp41.js} +5 -5
- package/bin/{chunk-3z85zxkn.js → chunk-hpzk9k55.js} +1 -1
- package/bin/{chunk-9zsv6d2f.js → chunk-hsyfrzdd.js} +1 -1
- package/bin/chunk-hvyy8vct.js +3 -0
- package/bin/{chunk-b5rhvzv9.js → chunk-j2txsbxz.js} +2 -2
- package/bin/chunk-j6x53e33.js +1 -0
- package/bin/chunk-jacanzp7.js +1 -0
- package/bin/{chunk-g6sdezec.js → chunk-jc7dycy6.js} +1 -1
- package/bin/{chunk-cwat1jwx.js → chunk-k7vbk8v4.js} +1 -1
- package/bin/{chunk-zrszykjf.js → chunk-mn0kt3p6.js} +1 -1
- package/bin/chunk-mn71dffh.js +4 -0
- package/bin/{chunk-vp3czaeh.js → chunk-npeapp7e.js} +2 -2
- package/bin/{chunk-2nhgdqdg.js → chunk-p2vsdnd1.js} +2 -2
- package/bin/chunk-pdw77q09.js +2 -0
- package/bin/{chunk-zezje74z.js → chunk-pq6kdp83.js} +3 -3
- package/bin/chunk-ptcz4ed3.js +2 -0
- package/bin/{chunk-z1p13dnc.js → chunk-q1fzgqsv.js} +2 -2
- package/bin/chunk-q4ny4hpt.js +2 -0
- package/bin/{chunk-mzsw9var.js → chunk-q5x0yywj.js} +2 -2
- package/bin/{chunk-g22wmpk1.js → chunk-q8xr1a8j.js} +2 -2
- package/bin/chunk-q8ysc5ex.js +1 -0
- package/bin/{chunk-1ktk6764.js → chunk-qm50g4n5.js} +4 -4
- package/bin/{chunk-q2bew2vc.js → chunk-qvp24w0q.js} +2 -2
- package/bin/{chunk-9xhjy897.js → chunk-r6t0j0jx.js} +3 -3
- package/bin/chunk-s1j4v33x.js +2 -0
- package/bin/{chunk-yq32evnn.js → chunk-s6pk2zyg.js} +5 -5
- package/bin/{chunk-hnkcgvcj.js → chunk-s74g9vsk.js} +1 -1
- package/bin/{chunk-gxepkvt2.js → chunk-sz19nn1x.js} +1 -1
- package/bin/{chunk-hpbn0k9n.js → chunk-sz5zawfw.js} +1 -1
- package/bin/chunk-t68y25gf.js +1 -0
- package/bin/{chunk-mcw198kg.js → chunk-te484xtb.js} +8 -8
- package/bin/{chunk-jt0ykktx.js → chunk-tfrevef9.js} +1 -1
- package/bin/chunk-thpw6tcj.js +2 -0
- package/bin/{chunk-02fvcrej.js → chunk-v0yevesp.js} +7 -7
- package/bin/chunk-vj4gamdn.js +2 -0
- package/bin/{chunk-p4s95471.js → chunk-vmwys2ch.js} +1 -1
- package/bin/{chunk-e4yscwen.js → chunk-vnmggrd6.js} +7 -7
- package/bin/{chunk-hpwv4am3.js → chunk-vv0m0m2f.js} +4 -4
- package/bin/{chunk-x03jwaga.js → chunk-w6g84d59.js} +4 -4
- package/bin/{chunk-3ckkwdjx.js → chunk-wgvgtttc.js} +3 -3
- package/bin/chunk-xy9qpn6b.js +1 -0
- package/bin/{chunk-mcj1xpcc.js → chunk-y3haqtr8.js} +2 -2
- package/bin/chunk-y5dv67mg.js +2 -0
- package/bin/{chunk-4mws03es.js → chunk-yb4mzqrd.js} +2 -2
- package/bin/{chunk-x8mjh387.js → chunk-z0de127n.js} +4 -4
- package/bin/chunk-z8t6e0ee.js +1 -0
- package/bin/chunk-zfg4yy3c.js +2 -0
- package/bin/{chunk-hw6czrya.js → chunk-zkvezz89.js} +1 -1
- package/bin/chunk-zrrnvdxq.js +3 -0
- package/bin/{chunk-srxp5jav.js → chunk-zx1c4vm5.js} +30 -30
- package/bin/chunk-zzqse5qc.js +2 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +328 -328
- package/package.json +7 -7
- package/bin/chunk-0bj887zm.js +0 -2
- package/bin/chunk-26qn7fek.js +0 -2
- package/bin/chunk-2ne2b54t.js +0 -2
- package/bin/chunk-2vbeqczj.js +0 -1
- package/bin/chunk-37p6bcx2.js +0 -1
- package/bin/chunk-3knfx6dm.js +0 -1
- package/bin/chunk-54tbfvya.js +0 -2
- package/bin/chunk-56kh5fxc.js +0 -1
- package/bin/chunk-6cnqjngz.js +0 -1
- package/bin/chunk-7g46e1wy.js +0 -3
- package/bin/chunk-84x8p7v5.js +0 -1
- package/bin/chunk-8fyg9dy4.js +0 -2
- package/bin/chunk-8gtfgkrn.js +0 -2
- package/bin/chunk-8xb6yz11.js +0 -2
- package/bin/chunk-91rb0jpb.js +0 -2
- package/bin/chunk-9f1xk1nt.js +0 -1
- package/bin/chunk-9mk9cvbk.js +0 -1
- package/bin/chunk-9nw5w8vh.js +0 -1
- package/bin/chunk-dk42gf7v.js +0 -2
- package/bin/chunk-eb7mzbfm.js +0 -1
- package/bin/chunk-er14d498.js +0 -3
- package/bin/chunk-fvx9k1dc.js +0 -2
- package/bin/chunk-gtf19jc1.js +0 -2
- package/bin/chunk-hfm82066.js +0 -2
- package/bin/chunk-kj6h5j5a.js +0 -4
- package/bin/chunk-ny1kbmxt.js +0 -2
- package/bin/chunk-p3j6ydk1.js +0 -1
- package/bin/chunk-pk406dgy.js +0 -2
- package/bin/chunk-s1e4qy3q.js +0 -14
- package/bin/chunk-swtwaaqe.js +0 -1
- package/bin/chunk-tagdrg7p.js +0 -1
- package/bin/chunk-twtxnzbv.js +0 -2
- package/bin/chunk-v5mcjwxy.js +0 -2
- package/bin/chunk-x342vzdx.js +0 -2
- package/bin/chunk-xvkwbczx.js +0 -3
- package/bin/chunk-zarz3sqn.js +0 -211
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ee}from"./chunk-
|
|
2
|
+
import{Ee}from"./chunk-atdfqdkj.js";import{Gs}from"./chunk-w6g84d59.js";function B(u,f){if(typeof u==="string"&&typeof f==="string")return u.toLowerCase()===f.toLowerCase();return u===f}function T(u,f){if(typeof u!=="string")return f.includes(u);return f.some((w)=>typeof w==="string"&&u.toLowerCase()===w.toLowerCase())}function k(u,f){return!T(u,f)}function J(u,f){if(typeof u!=="string"||typeof f!=="string")return!1;return u.toLowerCase().includes(f.toLowerCase())}function v(u,f){if(typeof u!=="string"||typeof f!=="string")return!1;return u.toLowerCase().startsWith(f.toLowerCase())}function _(u,f){if(typeof u!=="string"||typeof f!=="string")return!1;return u.toLowerCase().endsWith(f.toLowerCase())}function N(u){let f=new Map;for(let w of u)f.set(w.id,w);return f}function x(u,f,w){let L=new Set([...Object.keys(f),...Object.keys(w)]);for(let j of L){if(!(j in w)){delete u[j];continue}let d=N(f[j]??[]),m=w[j]??[],R=N(m),M=u[j]??[],A=[],O=new Set;for(let n of M){let r=n.id,l=d.get(r),c=R.get(r);if(l!==void 0&&c===void 0)continue;if(c!==void 0&&F(l,c))A.push(c);else A.push(n);O.add(r)}for(let n of m)if(!d.has(n.id)&&!O.has(n.id))A.push(n);u[j]=A}}function F(u,f){if(u===void 0)return!0;return JSON.stringify(u)!==JSON.stringify(f)}var q=(u,f)=>{let w=null,L=(d)=>Gs({config:{adapterId:"memory",adapterName:"Memory Adapter",usePlural:!1,debugLogs:f?.debugLogs||!1,supportsArrays:!0,customTransformInput(m){if(m.options.advanced?.database?.generateId==="serial"&&m.field==="id"&&m.action==="create")return d[m.model].length+1;return m.data},transaction:async(m)=>{let R=structuredClone(d),M=structuredClone(d),A=await m(L(M)(w));return x(d,R,M),A}},adapter:({getFieldName:m,getDefaultFieldName:R,options:M})=>{let A=(n,r,l)=>{if(!r)return n;return n.sort((c,o)=>{let a=m({model:l,field:r.field}),s=c[a],g=o[a],y=0;if(s==null&&g==null)y=0;else if(s==null)y=-1;else if(g==null)y=1;else if(typeof s==="string"&&typeof g==="string")y=s.localeCompare(g);else if(s instanceof Date&&g instanceof Date)y=s.getTime()-g.getTime();else if(typeof s==="number"&&typeof g==="number")y=s-g;else if(typeof s==="boolean"&&typeof g==="boolean")y=s===g?0:s?1:-1;else y=String(s).localeCompare(String(g));return r.direction==="asc"?y:-y})};function O(n,r,l,c,o){let a=(()=>{let y=d[r];if(!y)throw Ee.error(`[MemoryAdapter] Model ${r} not found in the DB`,Object.keys(d)),Error(`Model ${r} not found`);let h=(e,p)=>{let{field:i,value:t,operator:S,mode:I="sensitive"}=p,b=I==="insensitive"&&(typeof t==="string"||Array.isArray(t)&&t.every((E)=>typeof E==="string"));switch(S){case"in":if(!Array.isArray(t))throw Error("Value must be an array");if(b)return T(e[i],t);return t.includes(e[i]);case"not_in":if(!Array.isArray(t))throw Error("Value must be an array");if(b)return k(e[i],t);return!t.includes(e[i]);case"contains":if(b)return J(e[i],t);return e[i]?.includes(t);case"starts_with":if(b)return v(e[i],t);return e[i].startsWith(t);case"ends_with":if(b)return _(e[i],t);return e[i].endsWith(t);case"ne":return b?!B(e[i],t):e[i]!==t;case"gt":return t!=null&&Boolean(e[i]>t);case"gte":return t!=null&&Boolean(e[i]>=t);case"lt":return t!=null&&Boolean(e[i]<t);case"lte":return t!=null&&Boolean(e[i]<=t);default:if(b)return B(e[i],t);if(t===null)return e[i]==null;return e[i]===t}},C=y.filter((e)=>{if(!n.length||n.length===0)return!0;let p=h(e,n[0]);for(let i of n){let t=h(e,i);if(i.connector==="OR")p=p||t;else p=p&&t}return p});if(o?.length&&o.length>0)C=C.map((e)=>Object.fromEntries(Object.entries(e).filter(([p])=>o.includes(R({model:l,field:p})))));return C})();if(!c)return a;let s=new Map,g=new Map;for(let y of a){let h=String(y.id);if(!s.has(h)){let e={...y};for(let[p,i]of Object.entries(c)){let t=p;if(i.relation==="one-to-one")e[t]=null;else e[t]=[],g.set(`${h}-${p}`,new Set)}s.set(h,e)}let C=s.get(h);for(let[e,p]of Object.entries(c)){let i=e,t=d[i];if(!t)throw Ee.error(`[MemoryAdapter] JoinOption model ${i} not found in the DB`,Object.keys(d)),Error(`JoinOption model ${i} not found`);let S=t.filter((I)=>I[p.on.to]===y[p.on.from]);if(p.relation==="one-to-one")C[i]=S[0]||null;else{let I=g.get(`${h}-${e}`),b=p.limit??100,E=0;for(let W of S){if(E>=b)break;if(!I.has(W.id))C[i].push(W),I.add(W.id),E++}}}}return Array.from(s.values())}return{create:async({model:n,data:r})=>{if(M.advanced?.database?.generateId==="serial")r.id=d[n].length+1;if(!d[n])d[n]=[];return d[n].push(r),r},findOne:async({model:n,modelKey:r=n,where:l,select:c,join:o})=>{let a=O(l,n,r,o,c);if(o){let s=a;if(!s.length)return null;return s[0]}return a[0]||null},findMany:async({model:n,modelKey:r=n,where:l,sortBy:c,limit:o,select:a,offset:s,join:g})=>{let y=O(l||[],n,r,g,a);if(g){let C=y;if(!C.length)return[];A(C,c,r);let e=C;if(s!==void 0)e=e.slice(s);if(o!==void 0)e=e.slice(0,o);return e}let h=A(y,c,r);if(s!==void 0)h=h.slice(s);if(o!==void 0)h=h.slice(0,o);return h||[]},count:async({model:n,modelKey:r=n,where:l})=>{if(l)return O(l,n,r).length;return d[n].length},update:async({model:n,modelKey:r=n,where:l,update:c})=>{if(l.length===0)return null;let o=O(l,n,r);return o.forEach((a)=>{Object.assign(a,c)}),o[0]||null},delete:async({model:n,modelKey:r=n,where:l})=>{if(l.length===0)return;let c=d[n],o=O(l,n,r);d[n]=c.filter((a)=>!o.includes(a))},deleteMany:async({model:n,modelKey:r=n,where:l})=>{let c=d[n],o=O(l,n,r),a=0;return d[n]=c.filter((s)=>{if(o.includes(s))return a++,!1;return!o.includes(s)}),a},consumeOne:async({model:n,modelKey:r=n,where:l})=>{let c=d[n],o=O(l,n,r)[0];if(!o)return null;return d[n]=c.filter((a)=>a!==o),o},incrementOne:async({model:n,modelKey:r=n,where:l,increment:c,set:o})=>{let a=O(l,n,r)[0];if(!a)return null;for(let[s,g]of Object.entries(c))a[s]=(typeof a[s]==="number"?a[s]:0)+g;if(o)Object.assign(a,o);return a},updateMany:async({model:n,modelKey:r=n,where:l,update:c})=>{let o=O(l,n,r);return o.forEach((a)=>{Object.assign(a,c)}),o.length}}}}),j=L(u);return(d)=>(w=d,j(d))};export{q as memoryAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{z}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{z}from"./chunk-5ngftxjb.js";var c=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Br=z("copy",c);
|
|
2
|
+
export{Br};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{z}from"./chunk-
|
|
2
|
-
export{Zi,
|
|
1
|
+
import{z}from"./chunk-5ngftxjb.js";var e=[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]],Zi=z("key",e);var c=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],pu=z("shield-check",c);
|
|
2
|
+
export{Zi,pu};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,g,
|
|
2
|
-
export{ss,fi,ro,
|
|
1
|
+
import{a,g,tn,z,B}from"./chunk-5ngftxjb.js";var S=[["path",{d:"M5 12h14",key:"1ays0h"}]],ss=z("minus",S);var fi=(o)=>{if(isNaN(o))return"00:00";let n=new Date(o*1000),t=n.getUTCHours(),e=n.getUTCMinutes().toString().padStart(2,"0"),r=n.getUTCSeconds().toString().padStart(2,"0");if(t)return`${t}:${e}:${r}`;return`${e}:${r}`},ro=(o,n,t,e)=>{if(t==="frames")return`${o} fr`;if(t==="standard")return fi(o/n);let r=Math.round(n),u=n!==r,i=!1;if(u&&(r===30||r===60))i=!0;let c=0;if(e){let s=e.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(s){let m=parseInt(s[1],10),l=parseInt(s[2],10),M=parseInt(s[3],10),w=parseInt(s[5],10);if(i=s[4]!==":",c=(m*3600+l*60+M)*r+w,i){let f=m*60+l,I=n<30?2:4;c-=I*(f-Math.floor(f/10))}}}let d=o+c;if(i){let s=n<30?2:4,m=Math.floor(d/(17982*s/2)),l=d%(17982*s/2);if(l<s)l=l+s;d+=9*s*m+s*Math.floor((l-s)/(1798*s/2))}let h=d%r,p=Math.floor(d/r)%60,x=Math.floor(d/(r*60))%60,y=Math.floor(d/(r*3600))%24,b=i?";":":";return`${y.toString().padStart(2,"0")}:${x.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}${b}${h.toString().padStart(2,"0")}`};var Ta=(o,n)=>{if(!n)return 0;let t=1/n;return o*t+t/2},Kd=(o)=>Math.max(100,3000/(o||30)),Wd=({dbTotalFrames:o,containerDuration:n,frameRate:t})=>{let e=t||30,r=Math.round(n*e);if(o<=0)return r;let u=o/e,i=n-u,c=Kd(e)/1000;return i>c?r:o};var un=tn((o,n)=>({isDrawing:!1,currentTool:"arrow",currentColor:"#ef4444",annotations:[],history:[[]],historyIndex:0,setIsDrawing:(t)=>o({isDrawing:t}),setTool:(t)=>o({currentTool:t}),setColor:(t)=>o({currentColor:t}),addAnnotation:(t)=>{let{annotations:e,history:r,historyIndex:u}=n(),i=[...e,t],c=r.slice(0,u+1);c.push(i),o({annotations:i,history:c,historyIndex:c.length-1})},setAnnotations:(t)=>{o({annotations:t,history:[t],historyIndex:0})},undo:()=>{let{historyIndex:t,history:e}=n();if(t>0){let r=t-1;o({annotations:e[r],historyIndex:r})}},redo:()=>{let{historyIndex:t,history:e}=n();if(t<e.length-1){let r=t+1;o({annotations:e[r],historyIndex:r})}},reset:()=>o({isDrawing:!1,currentTool:"arrow",annotations:[],history:[[]],historyIndex:0})}));var fl=({progress:o,className:n})=>{let e=2*Math.PI*20,r=e-Math.min(100,Math.max(0,o))/100*e;return g("svg",{viewBox:"0 0 50 50",className:B("w-12 h-12",n),children:[a("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),a("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:e,strokeDashoffset:r,transform:"rotate(-90 25 25)"}),a("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round(o)}%`})]})};
|
|
2
|
+
export{ss,fi,ro,Ta,Kd,Wd,un,fl};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Yt}from"./chunk-
|
|
2
|
+
import{Yt}from"./chunk-r6t0j0jx.js";import{at}from"./chunk-vnmggrd6.js";import{se}from"./chunk-4p31kxjh.js";var i=se(at());var t=se(at());import{exec as u}from"child_process";import{promisify as w}from"util";var a=se(Yt()),p=(r,e,o)=>{if(e.Version!==1)throw Error(`Profile ${r} credential_process did not return Version 1.`);if(e.AccessKeyId===void 0||e.SecretAccessKey===void 0)throw Error(`Profile ${r} credential_process returned invalid credentials.`);if(e.Expiration){let d=new Date;if(new Date(e.Expiration)<d)throw Error(`Profile ${r} credential_process returned expired credentials.`)}let s=e.AccountId;if(!s&&o?.[r]?.aws_account_id)s=o[r].aws_account_id;let n={accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,...e.SessionToken&&{sessionToken:e.SessionToken},...e.Expiration&&{expiration:new Date(e.Expiration)},...e.CredentialScope&&{credentialScope:e.CredentialScope},...s&&{accountId:s}};return a.setCredentialFeature(n,"CREDENTIALS_PROCESS","w"),n};var f=async(r,e,o)=>{let s=e[r];if(e[r]){let n=s.credential_process;if(n!==void 0){let d=w(t.externalDataInterceptor?.getTokenRecord?.().exec??u);try{let{stdout:c}=await d(n),l;try{l=JSON.parse(c.trim())}catch{throw Error(`Profile ${r} credential_process returned invalid JSON.`)}return p(r,l,e)}catch(c){throw new t.CredentialsProviderError(c.message,{logger:o})}}else throw new t.CredentialsProviderError(`Profile ${r} did not contain credential_process.`,{logger:o})}else throw new t.CredentialsProviderError(`Profile ${r} could not be found in shared credentials file.`,{logger:o})};var P=(r={})=>async({callerClientConfig:e}={})=>{r.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let o=await i.parseKnownFiles(r);return f(i.getProfileName({profile:r.profile??e?.profile}),o,r.logger)};export{P as fromProcess};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S,Q,M,w,L,W,a,g,X,Tt,We,R,er,K,Dn,F,i1,re,Bn,hs,nm,ct,Nt,Ft,St}from"./chunk-5ngftxjb.js";import{Ea}from"./chunk-1tar0x8s.js";import{_u,Ns}from"./chunk-ajq9sxg0.js";import{Au}from"./chunk-thpw6tcj.js";import{xa}from"./chunk-6f3zhq64.js";import{hu,gu}from"./chunk-q1fzgqsv.js";import{Yr}from"./chunk-d55138xx.js";L();function wa({shareId:r,initialFolderId:ve,initialFileId:G,startTime:J,versionId:x,compare:ye,compareLeftId:C,compareRightId:k,compareActiveSide:Y="left"}){let c=We(),A=hs(),p=!!ye&&!!C&&!!k,[d,Z]=w(()=>localStorage.getItem(`share_pwd_${r}`)||""),[z,xe]=w(""),{data:s,error:b,isLoading:Se}=X({queryKey:["share-info",r,d],queryFn:async()=>{let e=await R.api.shares[":shareId"].info.$get({param:{shareId:r}},{headers:{"x-share-password":d}});if(e.status===401)throw Error("Unauthorized");if(e.status===403){let t=await e.json();throw Error(t.error||"Forbidden")}if(!e.ok)throw Error("Failed to fetch share info");return await e.json()},retry:!1}),o=ve||s?.rootFolderId,l=G||null,V=x||l,[U,ee]=w([]),{data:j}=X({queryKey:["public-share-folder",r,o,d],queryFn:async()=>{let e=await R.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:o}},{headers:{"x-share-password":d}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!s&&!!o});S(()=>{if(j?.ancestorFolders&&s){let e=j.ancestorFolders.findIndex((t)=>t.id===s.rootFolderId);if(e!==-1)ee(j.ancestorFolders.slice(0,e));else if(o===s.rootFolderId)ee([])}},[j,s,o]);let[D,u]=w(null),[I,f]=w(new Set),[be,Pe]=w(360),[_,Ne]=w(()=>!G),P=M(null),[te,E]=w([]),[Ce,se]=w(0),[ke,B]=w(null),[oe,Ae]=w(null),[je,De]=w(void 0),{data:T,fetchNextPage:ae,hasNextPage:ne,isFetchingNextPage:ie,isLoading:le,error:de}=Tt({queryKey:["public-share-children",r,o,"folder",d],queryFn:async({pageParam:e})=>{let t=await R.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:r,folderId:o},query:{assetType:"folder",after:e}},{headers:{"x-share-password":d}});if(t.status===401)throw Error("Unauthorized");if(t.status===403)throw Error("Expired");return await t.json()},enabled:!!s&&!!o,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,retry:!1}),{data:q,fetchNextPage:ce,hasNextPage:fe,isFetchingNextPage:ue,isLoading:me}=Tt({queryKey:["public-share-children",r,o,"file",d],queryFn:async({pageParam:e})=>{let t=await R.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:r,folderId:o},query:{assetType:"file",after:e}},{headers:{"x-share-password":d}});if(t.status===401)throw Error("Unauthorized");if(t.status===403)throw Error("Expired");return await t.json()},enabled:!!s&&!!o,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,retry:!1}),{data:pe}=X({queryKey:["public-share-fields",r,d],queryFn:async()=>{let e=await R.api.shares[":shareId"].fields.$get({param:{shareId:r}},{headers:{"x-share-password":d}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!s}),{data:m,isLoading:$e}=X({queryKey:["public-share-file",r,l,d],queryFn:async()=>{let e=await R.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:l}},{headers:{"x-share-password":d}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!l&&!!s}),{data:Ee,isLoading:Te}=X({queryKey:["public-share-file",r,x,d],queryFn:async()=>{let e=await R.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:x}},{headers:{"x-share-password":d}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!x&&!!s}),n=x?Ee:m,Le=$e||!!x&&Te;S(()=>{if(de?.message==="Unauthorized")Z(""),localStorage.removeItem(`share_pwd_${r}`)},[de,r]);let h=Q(()=>T?.pages.flatMap((e)=>e.data??[])??[],[T]),v=Q(()=>q?.pages.flatMap((e)=>e.data??[])??[],[q]),Re=T?.pages[0]?.pageInfo?.total,qe=q?.pages[0]?.pageInfo?.total,ze=T?.pages[0]?.pageInfo?.totalSize,Me=q?.pages[0]?.pageInfo?.totalSize,ge=Q(()=>{if(n)return n;if(I.size!==1)return null;let e=Array.from(I)[0];return[...h,...v].find((t)=>t.id===e)||null},[I,h,v,n]),Ke=(e)=>{e.preventDefault(),Z(z),localStorage.setItem(`share_pwd_${r}`,z)},he=(e)=>{if(e.type==="folder"||e.targetType==="folder")c({to:"/share/$shareId/folders/$folderId",params:{shareId:r,folderId:e.id}});else c({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:e.versionStack?e.versionStack.id:e.id}});f(new Set)},Ve=(e)=>{if(!s)return;let t=e==="root"?s.rootFolderId:e;if(t===s.rootFolderId)c({to:"/share/$shareId",params:{shareId:r}});else c({to:"/share/$shareId/folders/$folderId",params:{shareId:r,folderId:t}});f(new Set),u(null)},Ue=(e)=>{B(e.id||null);let t=e.annotations;if(t&&t.length>0)E(t);else E([]);if(p){if(e.second!==null&&e.second!==void 0)De({second:e.second,nonce:Date.now()});return}if(e.second!==null&&e.second!==void 0)P.current?.seekTo(e.second),P.current?.pause();else if(t&&t.length>0)P.current?.pause()},we=()=>{E([]),B(null)},_e=()=>{E([]),B(null)},H=(e)=>{if(!l)return;c({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:l},search:(t)=>({...t,...e})})},Be=()=>{H({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:Y==="left"?C:k})},{setProjectState:Ie,clearProjectState:Fe}=Bn();S(()=>{if(s&&o){let e=o===s.rootFolderId?s.name:h.find((t)=>t.id===o)?.name||s.name;Ie({teamId:"",projectId:s.projectId,projectName:s.name,ancestorFolders:U,currentAsset:{name:n?.name||e,type:l?"file":"folder",version:m?.versionStack?m.versionStack.versions.find((t)=>t.id===V)?.version??m.versionStack.versions.length:void 0,proxyType:n?.proxyType||null},isRootFolder:o===s.rootFolderId&&!l,isPublic:!0,shareId:r,fileId:l||void 0,allowDownload:s.allowDownload,downloadInfo:n?{originalKey:n.media?.original?.key,videoTranscodes:n.media?.videoTranscodes?.map((t)=>({key:t.key,width:t.width,height:t.height,resolution:t.resolution,hdr:t.hdr}))}:void 0,onFolderClick:Ve,isRightSidebarCollapsed:_,onRightSidebarToggle:()=>Ne((t)=>!t),versions:m?.versionStack?.versions,compareMode:p,canCompareVersions:(m?.versionStack?.versions?.length??0)>=2,onCompareVersions:()=>{let t=_u(m?.versionStack?.versions);if(!t||!l)return;c({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:l},search:(i)=>({...i,compare:!0,cmpLeft:t.left.id,cmpRight:t.right.id,cmpActive:"left"})})}})}return()=>Fe()},[s,o,h,n,m,V,l,U,Ie,Fe,_,p,c,r]);let y;if(Se&&!b)y=a("div",{className:"flex flex-1 items-center justify-center bg-background",children:a(K,{className:"h-8 w-8 animate-spin text-foreground"})});else if(b)if(b.message==="Unauthorized"){let e=d!=="";y=a("div",{className:"flex flex-1 items-center justify-center p-4",children:g(ct,{className:"w-full max-w-md",children:[g(Nt,{className:"text-center",children:[a("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:a(Dn,{className:"h-6 w-6 text-primary"})}),a(Ft,{children:i1()})]}),a(St,{children:g("form",{onSubmit:Ke,className:"space-y-4",children:[g("div",{className:"space-y-2",children:[a(re,{type:"password",placeholder:"Enter password",value:z,onChange:(t)=>xe(t.target.value),autoFocus:!0}),e&&a("p",{className:"text-sm font-medium text-destructive",children:"Incorrect password. Please try again."})]}),a(F,{type:"submit",className:"w-full",children:"Access Share"})]})})]})})}else{let e=b.message.includes("expired"),t=b.message.includes("disabled");y=a("div",{className:"flex flex-1 items-center justify-center p-4",children:g(ct,{className:"w-full max-w-md",children:[g(Nt,{className:"text-center",children:[a("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:a(er,{className:"h-6 w-6 text-destructive"})}),a(Ft,{children:e?"Share Expired":t?"Share Disabled":"Error"})]}),a(St,{className:"text-center text-muted-foreground",children:b.message})]})})}else if(!s)y=a("div",{className:"flex flex-1 items-center justify-center bg-background",children:a(K,{className:"h-8 w-8 animate-spin text-foreground"})});else if(A&&l&&!p&&n){let e=n?.ancestorFolders?.[0]?.id||(o!==s.rootFolderId?o:void 0),t=n?.ancestorFolders&&n.ancestorFolders.length>0?n.ancestorFolders:U;y=a(hu,{projectId:s.projectId,fileId:l,file:n,projectInfo:{name:s.name,rootFolder:s.rootFolderId},ancestorFolders:t,versions:m?.versionStack?.versions??n?.versionStack?.versions,activeFileId:V||l,startTime:J,isPublic:!0,shareId:r,allowDownload:s.allowDownload,publicFields:pe,siblingFiles:v,onNavigateToFile:(i)=>{c({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:i}})},onNavigateBack:()=>{if(e&&e!==s.rootFolderId)c({to:"/share/$shareId/folders/$folderId",params:{shareId:r,folderId:e}});else c({to:"/share/$shareId",params:{shareId:r}})},onSelectVersion:(i)=>{c({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:l},search:(N)=>({...N,version:i})})},onSaveField:()=>{}})}else y=g("div",{className:"flex flex-1 overflow-hidden relative",children:[l?g("div",{className:"flex-1 relative bg-muted/30",children:[Le&&!p&&a("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:a(K,{className:"h-8 w-8 animate-spin text-foreground"})}),p&&C&&k?a(gu,{isPublic:!0,shareId:r,versions:n?.versionStack?.versions??[],leftId:C,rightId:k,activeSide:Y,annotations:te,seekRequest:je,allowDownload:s.allowDownload,onActiveSideChange:(e)=>H({cmpActive:e}),onSwitchVersion:(e,t)=>H(e==="left"?{cmpLeft:t}:{cmpRight:t}),onExit:Be,onActiveAssetChange:Ae,onPlay:we,onTimeUpdate:se}):n&&a(Ns,{file:n,mediaControllerRef:P,onPlay:we,onTimeUpdate:se,onSeek:_e,annotations:te,startTime:J,shareId:r,allowDownload:s.allowDownload})]}):o&&(A?a(Au,{teamId:"",projectId:s.projectId,assetId:o,folders:h,files:v,totalFolders:Re,totalFiles:qe,totalFoldersSize:ze,totalFilesSize:Me,selectedItem:D,selectedIds:I,onItemSelect:(e,t)=>{if(t.metaKey||t.ctrlKey){let i=new Set(I);if(i.has(e.id)){if(i.delete(e.id),f(i),D?.id===e.id){let N=[...h,...v].find((O)=>i.has(O.id));u(N||null)}}else i.add(e.id),f(i),u(e)}else f(new Set([e.id])),u(e)},onItemDoubleClick:he,onClearSelection:()=>{f(new Set),u(null)},fetchNextFoldersPage:ae,hasNextFoldersPage:ne,isFetchingNextFoldersPage:ie,fetchNextFilesPage:ce,hasNextFilesPage:fe,isFetchingNextFilesPage:ue,isLoading:le||me,isShareView:!0,isPublic:!0,shareId:r,allowDownload:s.allowDownload}):a(Ea,{teamId:"",projectId:s.projectId,assetId:o,folders:h,files:v,selectedItem:D,selectedIds:I,onItemSelect:(e,t)=>{if(t.metaKey||t.ctrlKey){let i=new Set(I);if(i.has(e.id)){if(i.delete(e.id),f(i),D?.id===e.id){let N=[...h,...v].find((O)=>i.has(O.id));u(N||null)}}else i.add(e.id),f(i),u(e)}else f(new Set([e.id])),u(e)},onItemDoubleClick:he,onSaveField:()=>{},displayStyle:s.viewMode??"card",onClearSelection:()=>{f(new Set),u(null)},fetchNextFoldersPage:ae,hasNextFoldersPage:ne,isFetchingNextFoldersPage:ie,fetchNextFilesPage:ce,hasNextFilesPage:fe,isFetchingNextFilesPage:ue,isLoading:le||me,isShareView:!0,isPublic:!0,shareId:r,sharePassword:d,allowDownload:s.allowDownload})),!_&&!A&&g(W,{children:[a(Yr,{onResize:(e)=>Pe((t)=>Math.max(240,Math.min(600,t-e)))}),a("div",{style:{width:be},className:"flex-shrink-0 border-l",children:a(xa,{teamId:"",projectId:s.projectId,file:p?oe:ge,onSaveField:()=>{},members:[],readOnly:!0,publicFields:pe,onCommentSelect:Ue,isPublic:!0,shareId:r,currentTime:Ce,onTyping:()=>{P.current?.pause()},selectedCommentId:ke,hideAnnotationControl:(p?oe:ge)?.proxyType==="audio"})})]})]});return g("div",{className:"flex h-[100dvh] flex-col bg-background",children:[(!A||!l)&&a(nm,{}),y]})}
|
|
2
|
+
export{wa};
|