@shumai-one/shumai 0.3.4 → 0.3.6
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-c4nenmry.js → chunk-0jesq6sm.js} +1 -1
- package/bin/{chunk-gg1wfpm8.js → chunk-0jr6q4j4.js} +2 -2
- package/bin/{chunk-cwpmf8tx.js → chunk-0sajh8fw.js} +2 -2
- package/bin/{chunk-ardp3pze.js → chunk-1b7shyfp.js} +1 -1
- package/bin/{chunk-kfbztymc.js → chunk-1f8rr3ef.js} +2 -2
- package/bin/{chunk-zpq34g0w.js → chunk-1fq10abj.js} +2 -2
- package/bin/chunk-1hn9v6hv.js +2 -0
- package/bin/{chunk-4rexdetz.js → chunk-20wtz3kc.js} +3 -3
- package/bin/chunk-2882s5sp.js +1 -0
- package/bin/{chunk-6gjn8trh.js → chunk-29nhtrfv.js} +1 -1
- package/bin/chunk-3egeywt8.js +1 -0
- package/bin/chunk-3htn4m2d.js +7 -0
- package/bin/{chunk-tbdgkpgw.js → chunk-47093mwk.js} +1 -1
- package/bin/{chunk-2mr99scd.js → chunk-4a9sdfyp.js} +2 -2
- package/bin/{chunk-3t7v2de9.js → chunk-4ajat3xv.js} +57 -57
- package/bin/{chunk-6b0f3d07.js → chunk-55myfmhy.js} +2 -2
- package/bin/{chunk-5e48saab.js → chunk-5wrakb8p.js} +1 -1
- package/bin/{chunk-d4sjezbk.js → chunk-6awkqp09.js} +1 -1
- package/bin/chunk-6bztpk7h.js +1 -0
- package/bin/{chunk-j5q3t199.js → chunk-6edadcpn.js} +2 -2
- package/bin/chunk-74zstxav.js +6 -0
- package/bin/chunk-76hs7g0x.js +2 -0
- package/bin/{chunk-s584wxzj.js → chunk-7b60a9sy.js} +2 -2
- package/bin/{chunk-v5zdafv4.js → chunk-7fm1hznx.js} +2 -2
- package/bin/{chunk-sfmhbk59.js → chunk-800vdz5n.js} +1 -1
- package/bin/{chunk-5qwzveck.js → chunk-89kqtj7x.js} +2 -2
- package/bin/chunk-8g0mhzsg.js +2 -0
- package/bin/chunk-8jdgzy22.js +2 -0
- package/bin/chunk-8js9m1j7.js +1 -0
- package/bin/{chunk-r9thyg31.js → chunk-9annjnj2.js} +2 -2
- package/bin/{chunk-pew69nxg.js → chunk-9hsfjqgq.js} +2 -2
- package/bin/{chunk-e6rmqgzv.js → chunk-9p5n3m2z.js} +1 -1
- package/bin/{chunk-8pa1n500.js → chunk-9tnfhrnh.js} +2 -2
- package/bin/{chunk-qw5yjhab.js → chunk-a5fw02xq.js} +3 -3
- package/bin/chunk-adekdctx.css +1 -0
- package/bin/{chunk-q9tm2d21.js → chunk-aeg4kya9.js} +1 -1
- package/bin/{chunk-vzx1r87y.js → chunk-bq2aq6v8.js} +2 -2
- package/bin/{chunk-ddfx823h.js → chunk-c9bpf8gp.js} +2 -2
- package/bin/{chunk-ankkm2wz.js → chunk-ce50f746.js} +2 -2
- package/bin/{chunk-h0k9zw29.js → chunk-crdvxq38.js} +2 -2
- package/bin/{chunk-3vbx3x11.js → chunk-d2qp8g98.js} +2 -2
- package/bin/{chunk-5dqn7egd.js → chunk-d8bpqbdw.js} +1 -1
- package/bin/{chunk-4a185tez.js → chunk-dfzmqx1v.js} +3 -3
- package/bin/{chunk-03pw611p.js → chunk-dmjzrdan.js} +2 -2
- package/bin/chunk-e5s7202g.js +2 -0
- package/bin/{chunk-bpb0szs5.js → chunk-ef5v7gta.js} +2 -2
- package/bin/{chunk-7kdz1eng.js → chunk-ew4cxkcc.js} +2 -2
- package/bin/{chunk-axe5rq99.js → chunk-ex4qa7gv.js} +1 -1
- package/bin/{chunk-75x3w5hx.js → chunk-f2eh802w.js} +1 -1
- package/bin/{chunk-c1j58ekb.js → chunk-f44d9fpd.js} +2 -2
- package/bin/chunk-f5zg7b38.js +1 -0
- package/bin/chunk-fdm1yc29.js +1 -0
- package/bin/{chunk-w3xzd86e.js → chunk-fwbrcfaq.js} +2 -2
- package/bin/{chunk-bhqrqt97.js → chunk-fzaw1e34.js} +2 -2
- package/bin/{chunk-58y9bagr.js → chunk-g70eyttc.js} +2 -2
- package/bin/{chunk-nabagpah.js → chunk-gct52xks.js} +2 -2
- package/bin/{chunk-j5dejr3e.js → chunk-gewh7p42.js} +6 -6
- package/bin/chunk-gg1gwjtn.js +2 -0
- package/bin/chunk-gh64hag9.js +2 -0
- package/bin/{chunk-898hrxwq.js → chunk-ghz19a7t.js} +2 -2
- package/bin/{chunk-n7cmya8k.js → chunk-gra3617w.js} +2 -2
- package/bin/{chunk-jnx8p6kj.js → chunk-gx5rjm9m.js} +1 -1
- package/bin/chunk-h0p8yew4.js +1 -0
- package/bin/{chunk-6ab9eftx.js → chunk-hcvpb1hw.js} +1 -1
- package/bin/chunk-hgngnc1k.js +1 -0
- package/bin/chunk-hqbzjzsm.js +2 -0
- package/bin/{chunk-d4sg0z3y.js → chunk-j1awxx51.js} +2 -2
- package/bin/{chunk-khc3dydj.js → chunk-js0genbf.js} +1 -1
- package/bin/chunk-jt4yh37q.js +62 -0
- package/bin/{chunk-c9f6n4sf.js → chunk-jtd7rydv.js} +1 -1
- package/bin/chunk-k0xpskyq.js +1 -0
- package/bin/{chunk-jgxhv36z.js → chunk-kaxwma6y.js} +1 -1
- package/bin/{chunk-8wzepzp3.js → chunk-kk0gx8eg.js} +2 -2
- package/bin/{chunk-8tnq43k9.js → chunk-mgbqjbfc.js} +1 -1
- package/bin/{chunk-xkh6b42h.js → chunk-mhj0pqq3.js} +2 -2
- package/bin/{chunk-05m8w09t.js → chunk-mmrtjcst.js} +1 -1
- package/bin/{chunk-bagxeg82.js → chunk-mxee09jk.js} +2 -2
- package/bin/{chunk-z544s59c.js → chunk-n198tewr.js} +2 -2
- package/bin/{chunk-1bfrnc6b.js → chunk-n9cjmkky.js} +1 -1
- package/bin/{chunk-4153rke8.js → chunk-nh31ma8d.js} +2 -2
- package/bin/{chunk-gg8dmkwd.js → chunk-nh8azwsx.js} +2 -2
- package/bin/chunk-nhc72y4x.js +2 -0
- package/bin/{chunk-8qe7cpbr.js → chunk-pm64et9d.js} +1 -1
- package/bin/chunk-px6q3jpz.js +1 -0
- package/bin/{chunk-q2shr586.js → chunk-q7xfrtnj.js} +1 -1
- package/bin/{chunk-scfbmsy7.js → chunk-rmm6y799.js} +2 -2
- package/bin/{chunk-sddrv3ep.js → chunk-snexx7ks.js} +1 -1
- package/bin/chunk-sx3by19j.js +1 -0
- package/bin/{chunk-2ydhnafa.js → chunk-sx7kparv.js} +2 -2
- package/bin/{chunk-2y9t0qxp.js → chunk-t5561vz5.js} +1 -1
- package/bin/chunk-thj4cpev.js +2 -0
- package/bin/{chunk-3xfhbvar.js → chunk-tqxmj05h.js} +2 -2
- package/bin/{chunk-d2xrh0vv.js → chunk-vgr9db5g.js} +2 -2
- package/bin/{chunk-7pcba64w.js → chunk-vqgz25av.js} +1 -1
- package/bin/{chunk-m8tnsds1.js → chunk-vw1rhgjs.js} +2 -2
- package/bin/chunk-vz75bqvx.js +2 -0
- package/bin/{chunk-zned6mj8.js → chunk-w16jgdfx.js} +1 -1
- package/bin/{chunk-s5s1rk4n.js → chunk-w4ycztv5.js} +1 -1
- package/bin/{chunk-38hp9gfh.js → chunk-w98wvk17.js} +2 -2
- package/bin/chunk-wa8k9fwx.js +1 -0
- package/bin/{chunk-89chaa11.js → chunk-y0yrmcf3.js} +2 -2
- package/bin/{chunk-2jnyk045.js → chunk-y1t47c7f.js} +1 -1
- package/bin/{chunk-1apsnd7e.js → chunk-y8vw7zv1.js} +1 -1
- package/bin/{chunk-k78m3rar.js → chunk-ym47952x.js} +2 -2
- package/bin/{chunk-kgr3ytpb.js → chunk-yzra1x8f.js} +2 -2
- package/bin/{chunk-7xfx7741.js → chunk-z0tbq08w.js} +1 -1
- package/bin/{chunk-9deae0n7.js → chunk-z0zevgb6.js} +1 -1
- package/bin/{chunk-2967rnmn.js → chunk-z2ef8zpz.js} +1 -1
- package/bin/chunk-z3p3qz9d.js +3 -0
- package/bin/chunk-zv85aqwb.css +1 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +490 -340
- package/package.json +7 -7
- package/prisma/migrations/20260810025327_add_mcp_servers/migration.sql +71 -0
- package/prisma/migrations/20260810074554_mcp_server_cleanup/migration.sql +12 -0
- package/prisma/migrations/20260810124707_add_mcp_server_instructions/migration.sql +2 -0
- package/prisma/schema.prisma +69 -0
- package/bin/chunk-0ark0qrm.js +0 -1
- package/bin/chunk-21h9kgp5.js +0 -1
- package/bin/chunk-2errtbmb.js +0 -2
- package/bin/chunk-2pxev94x.js +0 -2
- package/bin/chunk-61hfhfce.js +0 -2
- package/bin/chunk-7e39zmss.js +0 -1
- package/bin/chunk-7h1m1e0b.js +0 -1
- package/bin/chunk-8btfb5g6.js +0 -2
- package/bin/chunk-bn1sts8x.js +0 -3
- package/bin/chunk-cwh21vfb.js +0 -2
- package/bin/chunk-dtjx1097.js +0 -2
- package/bin/chunk-e32bzfza.js +0 -1
- package/bin/chunk-ersxsrz8.js +0 -62
- package/bin/chunk-gnx9g8px.js +0 -2
- package/bin/chunk-htrzgs2a.css +0 -1
- package/bin/chunk-j2jdrmaa.js +0 -2
- package/bin/chunk-k41vt2gq.js +0 -1
- package/bin/chunk-krpr6g8a.js +0 -1
- package/bin/chunk-mfmcsdd7.js +0 -1
- package/bin/chunk-msjv1ykh.js +0 -2
- package/bin/chunk-n73dbqps.js +0 -1
- package/bin/chunk-nn5qpr0q.js +0 -1
- package/bin/chunk-q7v8sj72.js +0 -1
- package/bin/chunk-twhj7h73.js +0 -1
- package/bin/chunk-yn7mxpmb.js +0 -7
package/bin/chunk-8btfb5g6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{R as n,S as o,T as s}from"./chunk-k78m3rar.js";import{$ as E2,Aa as Z1,Ba as h,Ca as X2,Da as S1,Ea as X1,V as v,W as O2,X as E5,Y as _0,Z as S2,_ as I5,ba as y2,da as I2,ea as D5,fa as f5,ga as x5,ha as j5,ia as y5,ja as _5,ka as v5,la as D2,ma as f2,na as x2,oa as h5,pa as g5,qa as m5,ra as b5,sa as P1,ta as T1,ua as O1,va as c5,wa as u5,xa as Z2,ya as $1,za as J1}from"./chunk-bpb0szs5.js";import{Wa as _}from"./chunk-2pxev94x.js";import{eb as g0}from"./chunk-ankkm2wz.js";import{rf as K2}from"./chunk-gg1wfpm8.js";import{Cf as S0,Df as y,If as q5,Nf as B0,Sf as P2}from"./chunk-j5q3t199.js";import{ig as U0}from"./chunk-v5zdafv4.js";import{jg as L1,lg as R1,mg as k1,ng as C1}from"./chunk-38hp9gfh.js";import{Ag as Q2,Aj as V0,Bg as K,Bj as A0,Cg as A,Cj as L0,Dg as H1,Fi as c2,Fj as I,Gj as h0,Hh as N1,Ig as b2,Jh as H2,Kh as w0,Ki as G1,Lh as z5,Li as M1,Mh as G5,Qi as r0,Ri as U1,Sh as M5,Ti as w1,Vi as F1,Yg as n0,Zg as Q5,Zi as V1,_i as A1,cj as F0,dh as O0,ei as B1,fi as W1,oi as z1,rh as K1,sj as m0,th as q1,xj as R0,zg as u,zj as $0}from"./chunk-ersxsrz8.js";import{Jk as c}from"./chunk-8tnq43k9.js";var a2=Symbol.for("immer-nothing"),p2=Symbol.for("immer-draftable"),b=Symbol.for("immer-state");function l($,...J){throw Error(`[Immer] minified error nr: ${$}. Full error at: https://bit.ly/3cXEKWf`)}var k0=Object.getPrototypeOf;function N0($){return!!$&&!!$[b]}function Y0($){if(!$)return!1;return t2($)||Array.isArray($)||!!$[p2]||!!$.constructor?.[p2]||T0($)||p0($)}var v1=Object.prototype.constructor.toString(),i2=new WeakMap;function t2($){if(!$||typeof $!=="object")return!1;let J=Object.getPrototypeOf($);if(J===null||J===Object.prototype)return!0;let Z=Object.hasOwnProperty.call(J,"constructor")&&J.constructor;if(Z===Object)return!0;if(typeof Z!=="function")return!1;let X=i2.get(Z);if(X===void 0)X=Function.toString.call(Z),i2.set(Z,X);return X===v1}function c0($,J,Z=!0){if(l0($)===0)(Z?Reflect.ownKeys($):Object.keys($)).forEach((Y)=>{J(Y,$[Y],$)});else $.forEach((X,Y)=>J(Y,X,$))}function l0($){let J=$[b];return J?J.type_:Array.isArray($)?1:T0($)?2:p0($)?3:0}function W2($,J){return l0($)===2?$.has(J):Object.prototype.hasOwnProperty.call($,J)}function e2($,J,Z){let X=l0($);if(X===2)$.set(J,Z);else if(X===3)$.add(Z);else $[J]=Z}function h1($,J){if($===J)return $!==0||1/$===1/J;else return $!==$&&J!==J}function T0($){return $ instanceof Map}function p0($){return $ instanceof Set}function X0($){return $.copy_||$.base_}function z2($,J){if(T0($))return new Map($);if(p0($))return new Set($);if(Array.isArray($))return Array.prototype.slice.call($);let Z=t2($);if(J===!0||J==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors($);delete X[b];let Y=Reflect.ownKeys(X);for(let q=0;q<Y.length;q++){let Q=Y[q],H=X[Q];if(H.writable===!1)H.writable=!0,H.configurable=!0;if(H.get||H.set)X[Q]={configurable:!0,writable:!0,enumerable:H.enumerable,value:$[Q]}}return Object.create(k0($),X)}else{let X=k0($);if(X!==null&&Z)return{...$};let Y=Object.create(X);return Object.assign(Y,$)}}function F2($,J=!1){if(i0($)||N0($)||!Y0($))return $;if(l0($)>1)Object.defineProperties($,{set:b0,add:b0,clear:b0,delete:b0});if(Object.freeze($),J)Object.values($).forEach((Z)=>F2(Z,!0));return $}function g1(){l(2)}var b0={value:g1};function i0($){if($===null||typeof $!=="object")return!0;return Object.isFrozen($)}var m1={};function Q0($){let J=m1[$];if(!J)l(0,$);return J}var C0;function $5(){return C0}function b1($,J){return{drafts_:[],parent_:$,immer_:J,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function n2($,J){if(J)Q0("Patches"),$.patches_=[],$.inversePatches_=[],$.patchListener_=J}function G2($){M2($),$.drafts_.forEach(c1),$.drafts_=null}function M2($){if($===C0)C0=$.parent_}function o2($){return C0=b1(C0,$)}function c1($){let J=$[b];if(J.type_===0||J.type_===1)J.revoke_();else J.revoked_=!0}function s2($,J){J.unfinalizedDrafts_=J.drafts_.length;let Z=J.drafts_[0];if($!==void 0&&$!==Z){if(Z[b].modified_)G2(J),l(4);if(Y0($)){if($=u0(J,$),!J.parent_)d0(J,$)}if(J.patches_)Q0("Patches").generateReplacementPatches_(Z[b].base_,$,J.patches_,J.inversePatches_)}else $=u0(J,Z,[]);if(G2(J),J.patches_)J.patchListener_(J.patches_,J.inversePatches_);return $!==a2?$:void 0}function u0($,J,Z){if(i0(J))return J;let X=$.immer_.shouldUseStrictIteration(),Y=J[b];if(!Y)return c0(J,(q,Q)=>r2($,Y,J,q,Q,Z),X),J;if(Y.scope_!==$)return J;if(!Y.modified_)return d0($,Y.base_,!0),Y.base_;if(!Y.finalized_){Y.finalized_=!0,Y.scope_.unfinalizedDrafts_--;let q=Y.copy_,Q=q,H=!1;if(Y.type_===3)Q=new Set(q),q.clear(),H=!0;if(c0(Q,(G,z)=>r2($,Y,q,G,z,Z,H),X),d0($,q,!1),Z&&$.patches_)Q0("Patches").generatePatches_(Y,Z,$.patches_,$.inversePatches_)}return Y.copy_}function r2($,J,Z,X,Y,q,Q){if(Y==null)return;if(typeof Y!=="object"&&!Q)return;let H=i0(Y);if(H&&!Q)return;if(N0(Y)){let G=q&&J&&J.type_!==3&&!W2(J.assigned_,X)?q.concat(X):void 0,z=u0($,Y,G);if(e2(Z,X,z),N0(z))$.canAutoFreeze_=!1;else return}else if(Q)Z.add(Y);if(Y0(Y)&&!H){if(!$.immer_.autoFreeze_&&$.unfinalizedDrafts_<1)return;if(J&&J.base_&&J.base_[X]===Y&&H)return;if(u0($,Y),(!J||!J.scope_.parent_)&&typeof X!=="symbol"&&(T0(Z)?Z.has(X):Object.prototype.propertyIsEnumerable.call(Z,X)))d0($,Y)}}function d0($,J,Z=!1){if(!$.parent_&&$.immer_.autoFreeze_&&$.canAutoFreeze_)F2(J,Z)}function u1($,J){let Z=Array.isArray($),X={type_:Z?1:0,scope_:J?J.scope_:$5(),modified_:!1,finalized_:!1,assigned_:{},parent_:J,base_:$,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,q=V2;if(Z)Y=[X],q=P0;let{revoke:Q,proxy:H}=Proxy.revocable(Y,q);return X.draft_=H,X.revoke_=Q,H}var V2={get($,J){if(J===b)return $;let Z=X0($);if(!W2(Z,J))return d1($,Z,J);let X=Z[J];if($.finalized_||!Y0(X))return X;if(X===N2($.base_,J))return B2($),$.copy_[J]=w2(X,$);return X},has($,J){return J in X0($)},ownKeys($){return Reflect.ownKeys(X0($))},set($,J,Z){let X=J5(X0($),J);if(X?.set)return X.set.call($.draft_,Z),!0;if(!$.modified_){let Y=N2(X0($),J),q=Y?.[b];if(q&&q.base_===Z)return $.copy_[J]=Z,$.assigned_[J]=!1,!0;if(h1(Z,Y)&&(Z!==void 0||W2($.base_,J)))return!0;B2($),U2($)}if($.copy_[J]===Z&&(Z!==void 0||(J in $.copy_))||Number.isNaN(Z)&&Number.isNaN($.copy_[J]))return!0;return $.copy_[J]=Z,$.assigned_[J]=!0,!0},deleteProperty($,J){if(N2($.base_,J)!==void 0||J in $.base_)$.assigned_[J]=!1,B2($),U2($);else delete $.assigned_[J];if($.copy_)delete $.copy_[J];return!0},getOwnPropertyDescriptor($,J){let Z=X0($),X=Reflect.getOwnPropertyDescriptor(Z,J);if(!X)return X;return{writable:!0,configurable:$.type_!==1||J!=="length",enumerable:X.enumerable,value:Z[J]}},defineProperty(){l(11)},getPrototypeOf($){return k0($.base_)},setPrototypeOf(){l(12)}},P0={};c0(V2,($,J)=>{P0[$]=function(){return arguments[0]=arguments[0][0],J.apply(this,arguments)}});P0.deleteProperty=function($,J){return P0.set.call(this,$,J,void 0)};P0.set=function($,J,Z){return V2.set.call(this,$[0],J,Z,$[0])};function N2($,J){let Z=$[b];return(Z?X0(Z):$)[J]}function d1($,J,Z){let X=J5(J,Z);return X?"value"in X?X.value:X.get?.call($.draft_):void 0}function J5($,J){if(!(J in $))return;let Z=k0($);while(Z){let X=Object.getOwnPropertyDescriptor(Z,J);if(X)return X;Z=k0(Z)}return}function U2($){if(!$.modified_){if($.modified_=!0,$.parent_)U2($.parent_)}}function B2($){if(!$.copy_)$.copy_=z2($.base_,$.scope_.immer_.useStrictShallowCopy_)}var l1=class{constructor($){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(J,Z,X)=>{if(typeof J==="function"&&typeof Z!=="function"){let q=Z;Z=J;let Q=this;return function(G=q,...z){return Q.produce(G,(M)=>Z.call(this,M,...z))}}if(typeof Z!=="function")l(6);if(X!==void 0&&typeof X!=="function")l(7);let Y;if(Y0(J)){let q=o2(this),Q=w2(J,void 0),H=!0;try{Y=Z(Q),H=!1}finally{if(H)G2(q);else M2(q)}return n2(q,X),s2(Y,q)}else if(!J||typeof J!=="object"){if(Y=Z(J),Y===void 0)Y=J;if(Y===a2)Y=void 0;if(this.autoFreeze_)F2(Y,!0);if(X){let q=[],Q=[];Q0("Patches").generateReplacementPatches_(J,Y,q,Q),X(q,Q)}return Y}else l(1,J)},this.produceWithPatches=(J,Z)=>{if(typeof J==="function")return(Q,...H)=>this.produceWithPatches(Q,(G)=>J(G,...H));let X,Y;return[this.produce(J,Z,(Q,H)=>{X=Q,Y=H}),X,Y]},typeof $?.autoFreeze==="boolean")this.setAutoFreeze($.autoFreeze);if(typeof $?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy($.useStrictShallowCopy);if(typeof $?.useStrictIteration==="boolean")this.setUseStrictIteration($.useStrictIteration)}createDraft($){if(!Y0($))l(8);if(N0($))$=p1($);let J=o2(this),Z=w2($,void 0);return Z[b].isManual_=!0,M2(J),Z}finishDraft($,J){let Z=$&&$[b];if(!Z||!Z.isManual_)l(9);let{scope_:X}=Z;return n2(X,J),s2(void 0,X)}setAutoFreeze($){this.autoFreeze_=$}setUseStrictShallowCopy($){this.useStrictShallowCopy_=$}setUseStrictIteration($){this.useStrictIteration_=$}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches($,J){let Z;for(Z=J.length-1;Z>=0;Z--){let Y=J[Z];if(Y.path.length===0&&Y.op==="replace"){$=Y.value;break}}if(Z>-1)J=J.slice(Z+1);let X=Q0("Patches").applyPatches_;if(N0($))return X($,J);return this.produce($,(Y)=>X(Y,J))}};function w2($,J){let Z=T0($)?Q0("MapSet").proxyMap_($,J):p0($)?Q0("MapSet").proxySet_($,J):u1($,J);return(J?J.scope_:$5()).drafts_.push(Z),Z}function p1($){if(!N0($))l(10,$);return Z5($)}function Z5($){if(!Y0($)||i0($))return $;let J=$[b],Z,X=!0;if(J){if(!J.modified_)return J.base_;J.finalized_=!0,Z=z2($,J.scope_.immer_.useStrictShallowCopy_),X=J.scope_.immer_.shouldUseStrictIteration()}else Z=z2($,!0);if(c0(Z,(Y,q)=>{e2(Z,Y,Z5(q))},X),J)J.finalized_=!1;return Z}var i1=new l1,X5=i1.produce;var n1=($)=>(J,Z,X)=>{return X.setState=(Y,q,...Q)=>{let H=typeof Y==="function"?X5(Y):Y;return J(H,q,...Q)},$(X.setState,Z,X)},Y5=n1;var o0=n0()(Q5(Y5(($,J)=>({members:[],loading:!1,fetchMembers:async(Z,X,Y)=>{if(!Y&&J().loadedTeamId===Z&&J().loadedWithAgents===X)return;$({loading:!0});try{let q=await O0.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{includeAgents:X?"true":"false"}});if(!q.ok)throw Error("failed to fetch members");let Q=await q.json();$({members:Q||[],loadedTeamId:Z,loadedWithAgents:X,loading:!1})}catch{$({loading:!1})}}}))));var H5=n0(($)=>({fields:[],loadedProjectId:null,setFields:(J,Z)=>$({fields:J,loadedProjectId:Z}),updateFields:(J)=>$({fields:J})}));function A2($,J,Z){let X=y($,Z?.in);if(isNaN(J))return S0(Z?.in||$,NaN);if(!J)return X;let Y=X.getDate(),q=S0(Z?.in||$,X.getTime());q.setMonth(X.getMonth()+J+1,0);let Q=q.getDate();if(Y>=Q)return q;else return X.setFullYear(q.getFullYear(),q.getMonth(),Y),X}function K5($,J){let Z=y($,J?.in),X=Z.getMonth();return Z.setFullYear(Z.getFullYear(),X+1,0),Z.setHours(23,59,59,999),Z}function N5($,J){let[Z,X]=q5($,J.start,J.end);return{start:Z,end:X}}function B5($,J){let{start:Z,end:X}=N5(J?.in,$),Y=+Z>+X,q=Y?+Z:+X,Q=Y?X:Z;Q.setHours(0,0,0,0);let H=J?.step??1;if(!H)return[];if(H<0)H=-H,Y=!Y;let G=[];while(+Q<=q)G.push(S0(Z,Q)),Q.setDate(Q.getDate()+H),Q.setHours(0,0,0,0);return Y?G.reverse():G}function s0($,J){return y($,J?.in).getDate()}function W5($,J){return y($,J?.in).getDay()}function L2($,J){return y($,J?.in).getHours()}function R2($,J){return y($,J?.in).getMinutes()}function k2($,J){return y($,J?.in).getMonth()}function C2($,J){return y($,J?.in).getFullYear()}var a=c(u(),1);var o1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.date,[q,Q]=a.useState(!1),H=a.useRef(null),G=$?new Date($):new Date,z=B0(G)?G:new Date,[M,U]=a.useState(z);a.useEffect(()=>{if(q&&$){let N=new Date($);if(B0(N))U(N)}},[q,$]),a.useEffect(()=>{let N=(k)=>{if(H.current&&!H.current.contains(k.target)){if(q)Q(!1)}};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[q]);let W=()=>{if(!X)Q(!0)},F=(N)=>{if(!N)return"";let k=new Date(N);if(!B0(k))return"Invalid Date";let O="PPP";if(Y?.displayFormat==="usa")O="MM/dd/yyyy";else if(Y?.displayFormat==="euro")O="dd/MM/yyyy";else if(Y?.displayFormat==="iso")O="yyyy-MM-dd";if(Y?.includeTime)if(Y?.timeFormat==="twenty_four_hour")O+=" HH:mm";else O+=" p";let D=P2(k,O);if(Y?.displayTimezone)D+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return D},B=new Date(M.getFullYear(),M.getMonth(),1),T=K5(M),P=B5({start:B,end:T}),R=W5(B),S=(N)=>{let k=new Date(N);if(Y?.includeTime)k.setHours(L2(z)),k.setMinutes(R2(z));let O=k.toISOString();if(Z(O),!Y?.includeTime)Q(!1)},w=(N,k)=>{let O=$?new Date($):new Date;if(!B0(O))O.setTime(new Date().getTime());if(N==="hour")O.setHours(k);if(N==="minute")O.setMinutes(k);let D=O.toISOString();Z(D)},L=Array.from({length:24},(N,k)=>k),V=Array.from({length:12},(N,k)=>k*5);if(q)return A("div",{className:"relative w-full",ref:H,children:[K("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:$?F($):K("span",{className:"text-muted-foreground",children:"Select date..."})}),A("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[A("div",{className:"p-4 w-64",children:[A("div",{className:"flex justify-between items-center mb-4",children:[K("button",{onClick:()=>U(A2(M,-1)),className:"p-1 hover:bg-accent rounded",children:K(z5,{className:"w-4 h-4"})}),K("span",{className:"font-semibold text-sm",children:P2(M,"MMMM yyyy")}),K("button",{onClick:()=>U(A2(M,1)),className:"p-1 hover:bg-accent rounded",children:K(G5,{className:"w-4 h-4"})})]}),K("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((N)=>K("div",{children:N},N))}),A("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:R}).map((N,k)=>K("div",{},`empty-${k}`)),P.map((N)=>{let k=$?new Date($):null,O=k&&B0(k)&&s0(k)===s0(N)&&k2(k)===k2(N)&&C2(k)===C2(N);return K("button",{onClick:()=>S(N),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${O?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:s0(N)},N.toString())})]})]}),Y?.includeTime&&A("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[A("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[K(M5,{className:"w-3 h-3"})," Time"]}),A("div",{className:"flex flex-1 h-64",children:[K("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:L.map((N)=>K("div",{onClick:()=>w("hour",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${L2(z)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))}),K("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:V.map((N)=>K("div",{onClick:()=>w("minute",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${R2(z)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))})]})]})]})]});return K("div",{onClick:W,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$?F($):K("span",{className:"text-muted-foreground italic",children:"Empty"})})},U5=o1;var p=c(u(),1);var s1=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=p.useState(!1),[q,Q]=p.useState($||""),H=p.useRef(null),G=p.useRef(null),[z,M]=p.useState(!1);p.useEffect(()=>{Q($||"")},[$]),p.useEffect(()=>{if(X&&H.current)H.current.focus(),M(!1)},[X]),p.useEffect(()=>{let B=(T)=>{if(z&&G.current&&!G.current.contains(T.target))M(!1)};if(z)document.addEventListener("mousedown",B);return()=>{document.removeEventListener("mousedown",B)}},[z]);let U=()=>{Y(!1),J(q)},W=(B)=>{B.stopPropagation(),M(!0)},F=(B)=>{if(B.stopPropagation(),!Z)Y(!0)};if(X)return K("textarea",{ref:H,value:q,onChange:(B)=>Q(B.target.value),onBlur:U,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return A("div",{ref:G,className:"relative w-full text-sm",children:[K("div",{onClick:W,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 line-clamp-2 max-h-[3rem] overflow-hidden ${!Z?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:$?$:K("span",{className:"text-muted-foreground italic",children:"Empty"})}),z&&K("div",{onClick:F,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!Z?"cursor-text":""}`,children:$?$:K("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},w5=s1;var t=c(u(),1);var r1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.number,[q,Q]=t.useState(!1),[H,G]=t.useState(""),z=t.useRef(null);t.useEffect(()=>{G($!==void 0&&$!==null?$.toString():"")},[$]),t.useEffect(()=>{if(q&&z.current)z.current.focus()},[q]);let M=()=>{if(!X)Q(!0)},U=()=>{if(Q(!1),H==="")Z(void 0);else{let B=parseFloat(H);Z(isNaN(B)?void 0:B)}},W=(B)=>{if(B.key==="Enter")B.stopPropagation(),z.current?.blur()},F=(B)=>{if(B===void 0||B===null||isNaN(B))return"";return B.toFixed(Y?.scale)};if(q)return K("input",{ref:z,type:"number",step:1/Math.pow(10,Y?.scale||0),value:H,onChange:(B)=>G(B.target.value),onBlur:U,onKeyDown:W,onDoubleClick:(B)=>B.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return K("div",{onClick:M,onDoubleClick:(B)=>B.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$!==void 0&&$!==null?F($):K("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},F5=r1;var V5=c(u(),1);var a1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.rating,q=Math.max(2,Math.min(6,Y?.maxValue||5)),[Q,H]=V5.useState(null),G=(M,U)=>{if(M.stopPropagation(),X)return;let W;if($===U)W=0;else W=U;Z(W)},z=Array.from({length:q},(M,U)=>U+1);return K("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!X&&H(null),onDoubleClick:(M)=>M.stopPropagation(),children:z.map((M)=>{let U=Q!==null?M<=Q:M<=($||0);return K("button",{onClick:(W)=>G(W,M),onMouseEnter:()=>!X&&H(M),className:`focus:outline-none transition-transform ${!X?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:X,children:K(r0,{className:`w-5 h-5 transition-colors ${U?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},M)})})},A5=a1;var E1=c(u(),1);var H0;(function($){$.Base32IncorrectEncoding="B32_ENC_INVALID",$.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",$.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",$.EncodeTimeNegative="ENC_TIME_NEG",$.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",$.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",$.PRNGDetectFailure="PRNG_DETECT",$.ULIDInvalid="ULID_INVALID",$.Unexpected="UNEXPECTED",$.UUIDInvalid="UUID_INVALID"})(H0||(H0={}));class W0 extends Error{constructor($,J){super(`${J} (${$})`);this.name="ULIDError",this.code=$}}function t1($){let J=Math.floor($()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(J)}function e1($){let J=$4(),Z=J&&(J.crypto||J.msCrypto)||null;if(typeof Z?.getRandomValues==="function")return()=>{let X=new Uint8Array(1);return Z.getRandomValues(X),X[0]/256};else if(typeof Z?.randomBytes==="function")return()=>Z.randomBytes(1).readUInt8()/256;throw new W0(H0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function $4(){if(X4())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function J4($,J){let Z="";for(;$>0;$--)Z=t1(J)+Z;return Z}function Z4($,J=10){if(isNaN($))throw new W0(H0.EncodeTimeValueMalformed,`Time must be a number: ${$}`);else if($>281474976710655)throw new W0(H0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${$}`);else if($<0)throw new W0(H0.EncodeTimeNegative,`Time must be positive: ${$}`);else if(Number.isInteger($)===!1)throw new W0(H0.EncodeTimeValueMalformed,`Time must be an integer: ${$}`);let Z,X="";for(let Y=J;Y>0;Y--)Z=$%32,X="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(Z)+X,$=($-Z)/32;return X}function X4(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function L5($,J){let Z=J||e1(),X=!$||isNaN($)?Date.now():$;return Z4(X,10)+J4(16,Z)}var v0=c(u(),1);var{create:Y4,defineProperty:d5,defineProperties:Q4,getOwnPropertyDescriptor:H4,getOwnPropertyDescriptors:K4,getOwnPropertySymbols:J2}=Object,l5=Object.prototype.hasOwnProperty,p5=Object.prototype.propertyIsEnumerable,q4=($,J)=>(J=Symbol[$])?J:Symbol.for("Symbol."+$),j0=($)=>{throw TypeError($)},j2=($,J,Z)=>(J in $)?d5($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,R5=($,J)=>{for(var Z in J||(J={}))if(l5.call(J,Z))j2($,Z,J[Z]);if(J2){for(var Z of J2(J))if(p5.call(J,Z))j2($,Z,J[Z])}return $},k5=($,J)=>Q4($,K4(J)),N4=($,J)=>{var Z={};for(var X in $)if(l5.call($,X)&&J.indexOf(X)<0)Z[X]=$[X];if($!=null&&J2){for(var X of J2($))if(J.indexOf(X)<0&&p5.call($,X))Z[X]=$[X]}return Z},B4=($)=>{var J;return[,,,Y4((J=void 0)!=null?J:null)]},i5=["class","method","getter","setter","accessor","field","value","get","set"],I0=($)=>$!==void 0&&typeof $!=="function"?j0("Function expected"):$,W4=($,J,Z,X,Y)=>({kind:i5[$],name:J,metadata:X,addInitializer:(q)=>Z._?j0("Already initialized"):Y.push(I0(q||null))}),z4=($,J)=>j2(J,q4("metadata"),$[3]),a0=($,J,Z,X)=>{for(var Y=0,q=$[J>>1],Q=q&&q.length;Y<Q;Y++)J&1?q[Y].call(Z):X=q[Y].call(Z,X);return X},n5=($,J,Z,X,Y,q)=>{var Q,H,G,z,M,U=J&7,W=!1,F=!1,B=$.length+1,T=i5[U+5],P=$[B-1]=[],R=$[B]||($[B]=[]),S=(Y=Y.prototype,H4({get[Z](){return D0(this,q)},set[Z](L){return K0(this,q,L)}},Z));for(var w=X.length-1;w>=0;w--)if(z=W4(U,Z,G={},$[3],R),z.static=W,z.private=F,M=z.access={has:(L)=>(Z in L)},M.get=(L)=>L[Z],M.set=(L,V)=>L[Z]=V,H=(0,X[w])({get:S.get,set:S.set},z),G._=1,H===void 0)I0(H)&&(S[T]=H);else if(typeof H!=="object"||H===null)j0("Object expected");else I0(Q=H.get)&&(S.get=Q),I0(Q=H.set)&&(S.set=Q),I0(Q=H.init)&&P.unshift(Q);return S&&d5(Y,Z,S),Y},o5=($,J,Z)=>J.has($)||j0("Cannot "+Z),D0=($,J,Z)=>(o5($,J,"read from private field"),J.get($)),E0=($,J,Z)=>J.has($)?j0("Cannot add the same private member more than once"):J instanceof WeakSet?J.add($):J.set($,Z),K0=($,J,Z,X)=>(o5($,J,"write to private field"),J.set($,Z),Z);function i($){return $ instanceof g2||$ instanceof a5}var t0=10,G4=class extends y2{constructor($){super($);let J=E5(()=>{let{dragOperation:X}=$;if(!x2(X.activatorEvent))return;if(!i(X.source))return;if(X.status.initialized){let Y=$.registry.plugins.get(b5);if(Y)return Y.disable(),()=>Y.enable()}}),Z=$.monitor.addEventListener("dragmove",(X,Y)=>{queueMicrotask(()=>{if(this.disabled||X.defaultPrevented||!X.nativeEvent)return;let{dragOperation:q}=Y;if(!x2(X.nativeEvent))return;if(!i(q.source))return;if(!q.shape)return;let{actions:Q,collisionObserver:H,registry:G}=Y,{by:z}=X;if(!z)return;let M=M4(z),{source:U,target:W}=q,{center:F}=q.shape.current,B=[],T=[];v(()=>{for(let V of G.droppables){let{id:N}=V;if(!V.accepts(U)||N===(W==null?void 0:W.id)&&i(V)||!V.element)continue;let k=V.shape,O=new f2(V.element,{getBoundingClientRect:(D)=>f5(D,void 0,0.2)});if(!O.height||!O.width)continue;if(M=="down"&&F.y+t0<O.center.y||M=="up"&&F.y-t0>O.center.y||M=="left"&&F.x-t0>O.center.x||M=="right"&&F.x+t0<O.center.x)B.push(V),V.shape=O,T.push(()=>V.shape=k)}}),X.preventDefault(),H.disable();let P=H.computeCollisions(B,g5);v(()=>T.forEach((V)=>V()));let[R]=P;if(!R)return;let{id:S}=R,{index:w,group:L}=U.sortable;Q.setDropTarget(S).then(()=>{let{source:V,target:N,shape:k}=q;if(!V||!i(V)||!k)return;let{index:O,group:D,target:f}=V.sortable,g=w!==O||L!==D,m=g?f:N==null?void 0:N.element;if(!m)return;_5(m);let C=new f2(m);if(!C)return;let E=E2.delta(C,E2.from(k.current.boundingRectangle),V.alignment);if(Q.move({by:E}),g)Q.setDropTarget(V.id).then(()=>H.enable());else H.enable()})})});this.destroy=()=>{Z(),J()}}};function M4($){let{x:J,y:Z}=$;if(J>0)return"right";else if(J<0)return"left";else if(Z>0)return"down";else if(Z<0)return"up"}var{defineProperty:U4,defineProperties:w4,getOwnPropertyDescriptors:F4,getOwnPropertySymbols:C5}=Object,V4=Object.prototype.hasOwnProperty,A4=Object.prototype.propertyIsEnumerable,P5=($,J,Z)=>(J in $)?U4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,z0=($,J)=>{for(var Z in J||(J={}))if(V4.call(J,Z))P5($,Z,J[Z]);if(C5){for(var Z of C5(J))if(A4.call(J,Z))P5($,Z,J[Z])}return $},G0=($,J)=>w4($,F4(J));function L4($,J,Z){if(J===Z)return $;let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}function T2($){return"initialIndex"in $&&typeof $.initialIndex==="number"&&"index"in $&&typeof $.index==="number"}function R4($,J,Z){var X,Y,q;let{source:Q,target:H,canceled:G}=J.operation;if(!Q||!H||G){if("preventDefault"in J)J.preventDefault();return $}let z=(L,V)=>L===V||typeof L==="object"&&("id"in L)&&L.id===V;if(Array.isArray($)){let L=$.findIndex((N)=>z(N,Q.id)),V=$.findIndex((N)=>z(N,H.id));if(L===-1||V===-1){if(T2(Q)){let{initialIndex:N,index:k}=Q;if(N===k||N<0||N>=$.length){if("preventDefault"in J)J.preventDefault();return $}return Z($,N,k)}return $}if(!G&&"index"in Q&&typeof Q.index==="number"){let N=Q.index;if(N!==L)return Z($,L,N)}return Z($,L,V)}let M=Object.entries($),U=-1,W,F=-1,B;for(let[L,V]of M){if(U===-1){if(U=V.findIndex((N)=>z(N,Q.id)),U!==-1)W=L}if(F===-1){if(F=V.findIndex((N)=>z(N,H.id)),F!==-1)B=L}if(U!==-1&&F!==-1)break}if(U===-1&&T2(Q)){let{initialGroup:L,initialIndex:V,group:N,index:k}=Q;if(L==null||N==null||!(L in $)||!(N in $)){if("preventDefault"in J)J.preventDefault();return $}if(L===N&&V===k){if("preventDefault"in J)J.preventDefault();return $}if(L===N)return G0(z0({},$),{[L]:Z($[L],V,k)});let O=$[L][V];return G0(z0({},$),{[L]:[...$[L].slice(0,V),...$[L].slice(V+1)],[N]:[...$[N].slice(0,k),O,...$[N].slice(k)]})}if(!Q.manager)return $;let{dragOperation:T}=Q.manager,P=(Y=(X=T.shape)==null?void 0:X.current.center)!=null?Y:T.position.current;if(B==null){if(H.id in $){let L=H.shape&&P.y>H.shape.center.y?$[H.id].length:0;B=H.id,F=L}}if(W==null||B==null||W===B&&U===F){if(W!=null&&W===B&&U===F&&T2(Q)){let L=Q.group!=null&&Q.group!==W,V=Q.index!==U;if(L||V){let N=(q=Q.group)!=null?q:W;if(N in $){if(W===N)return G0(z0({},$),{[W]:Z($[W],U,Q.index)});let k=$[W][U];return G0(z0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[N]:[...$[N].slice(0,Q.index),k,...$[N].slice(Q.index)]})}}}if("preventDefault"in J)J.preventDefault();return $}if(W===B)return G0(z0({},$),{[W]:Z($[W],U,F)});let S=H.shape&&Math.round(P.y)>Math.round(H.shape.center.y)?1:0,w=$[W][U];return G0(z0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[B]:[...$[B].slice(0,F+S),w,...$[B].slice(F+S)]})}function k4($,J){return R4($,J,L4)}var T5="__default__",C4=class extends y2{constructor($){super($);let J=()=>{let X=new Map;for(let Y of $.registry.droppables)if(Y instanceof g2){let{sortable:q}=Y,{group:Q}=q,H=X.get(Q);if(!H)H=new Set,X.set(Q,H);H.add(q)}for(let[Y,q]of X)X.set(Y,new Set(e0(q)));return X},Z=[$.monitor.addEventListener("dragover",(X,Y)=>{if(this.disabled)return;let{dragOperation:q}=Y,{source:Q,target:H}=q;if(!i(Q)||!i(H))return;if(Q.sortable===H.sortable)return;let G=J(),z=Q.sortable.group===H.sortable.group,M=G.get(Q.sortable.group),U=z?M:G.get(H.sortable.group);if(!M||!U)return;queueMicrotask(()=>{if(X.defaultPrevented)return;Y.renderer.rendering.then(()=>{var W,F,B;let T=J();for(let[f,g]of G.entries()){let m=Array.from(g).entries();for(let[C,E]of m)if(E.index!==C||E.group!==f||!((W=T.get(f))==null?void 0:W.has(E)))return}let P=Q.sortable.element,R=H.sortable.element;if(!R||!P)return;if(!z&&H.id===Q.sortable.group)return;let S=e0(M),w=z?S:e0(U),L=(F=Q.sortable.group)!=null?F:T5,V=(B=H.sortable.group)!=null?B:T5,N={[L]:S,[V]:w},k=k4(N,X);if(N===k)return;let O=k[V].indexOf(Q.sortable),D=k[V].indexOf(H.sortable);Y.collisionObserver.disable(),O5(P,O,R,D),v(()=>{for(let[f,g]of k[L].entries())g.index=f;if(!z)for(let[f,g]of k[V].entries())g.group=H.sortable.group,g.index=f}),Y.actions.setDropTarget(Q.id).then(()=>Y.collisionObserver.enable())})})}),$.monitor.addEventListener("dragend",(X,Y)=>{if(!X.canceled)return;let{dragOperation:q}=Y,{source:Q}=q;if(!i(Q))return;if(Q.sortable.initialIndex===Q.sortable.index&&Q.sortable.initialGroup===Q.sortable.group)return;queueMicrotask(()=>{let H=J(),G=H.get(Q.sortable.initialGroup);if(!G)return;Y.renderer.rendering.then(()=>{for(let[F,B]of H.entries()){let T=Array.from(B).entries();for(let[P,R]of T)if(R.index!==P||R.group!==F)return}let z=e0(G),M=Q.sortable.element,U=z[Q.sortable.initialIndex],W=U==null?void 0:U.element;if(!U||!W||!M)return;O5(M,U.index,W,Q.index),v(()=>{for(let[F,B]of H.entries()){let T=Array.from(B).values();for(let P of T)P.index=P.initialIndex,P.group=P.initialGroup}})})})})];this.destroy=()=>{for(let X of Z)X()}}};function O5($,J,Z,X){let Y=X<J?"afterend":"beforebegin";Z.insertAdjacentElement(Y,$)}function P4($,J){return $.index-J.index}function e0($){return Array.from($).sort(P4)}var S5=[G4,C4],_2={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},$2=new I5,s5,r5,e,v2,f0,x0,h2,M0;r5=[S2],s5=[S2];var y0=class{constructor($,J){E0(this,v2,a0(e,8,this)),a0(e,11,this),E0(this,f0),E0(this,x0),E0(this,h2,a0(e,12,this)),a0(e,15,this),E0(this,M0),this.register=()=>{return v(()=>{var W,F;(W=this.manager)==null||W.registry.register(this.droppable),(F=this.manager)==null||F.registry.register(this.draggable)}),()=>this.unregister()},this.unregister=()=>{v(()=>{var W,F;(W=this.manager)==null||W.registry.unregister(this.droppable),(F=this.manager)==null||F.registry.unregister(this.draggable)})},this.destroy=()=>{v(()=>{this.droppable.destroy(),this.draggable.destroy()})};var Z=$,{effects:X=()=>[],group:Y,index:q,sensors:Q,type:H,transition:G=_2,plugins:z}=Z,M=N4(Z,["effects","group","index","sensors","type","transition","plugins"]);let U=I2(z,S5);this.droppable=new g2(M,J,this),this.draggable=new a5(k5(R5({},M),{plugins:U,effects:()=>[()=>{var W,F,B;let T=(W=this.manager)==null?void 0:W.dragOperation.status;if((T==null?void 0:T.initializing)&&this.id===((B=(F=this.manager)==null?void 0:F.dragOperation.source)==null?void 0:B.id))$2.clear(this.manager);if(T==null?void 0:T.dragging)$2.set(this.manager,this.id,O2(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:W,group:F,manager:B}=this,T=D0(this,x0),P=D0(this,f0);if(W!==T||F!==P)K0(this,x0,W),K0(this,f0,F),this.animate()},()=>{var W,F;let{target:B}=this,{isDragSource:T}=this.draggable;if(((F=(W=this.draggable.pluginConfig(m5))==null?void 0:W.feedback)!=null?F:"default")==="move"&&T)this.droppable.disabled=!B},...X()],type:H,sensors:Q}),J,this),K0(this,M0,M.element),this.manager=J,this.index=q,K0(this,x0,q),this.group=Y,K0(this,f0,Y),this.type=H,this.transition=G}get initialIndex(){var $,J;return(J=($=$2.get(this.manager,this.id))==null?void 0:$.initialIndex)!=null?J:this.index}get initialGroup(){var $,J;return(J=($=$2.get(this.manager,this.id))==null?void 0:$.initialGroup)!=null?J:this.group}animate(){O2(()=>{let{manager:$,transition:J}=this,{shape:Z}=this.droppable;if(!$)return;let{idle:X}=$.dragOperation.status;if(!Z||!J||X&&!J.idle)return;$.renderer.rendering.then(()=>{let{element:Y}=this;if(!Y)return;for(let M of Y.getAnimations())if("transitionProperty"in M&&(M.transitionProperty==="transform"||M.transitionProperty==="translate"||M.transitionProperty==="scale"))M.cancel();let q=this.refreshShape();if(!q)return;let Q={x:Z.boundingRectangle.left-q.boundingRectangle.left,y:Z.boundingRectangle.top-q.boundingRectangle.top},{translate:H}=y5(Y),G=D2(Y,H,!1),z=D2(Y,H);if(Q.x||Q.y){let M=x5(D5(Y))?k5(R5({},J),{duration:0}):J;v5({element:Y,keyframes:{translate:[`${G.x+Q.x}px ${G.y+Q.y}px ${G.z}`,`${z.x}px ${z.y}px ${z.z}`]},options:M}).then(()=>{if(!$.dragOperation.status.dragging)this.droppable.shape=void 0})}})})}get manager(){return this.draggable.manager}set manager($){v(()=>{this.draggable.manager=$,this.droppable.manager=$})}set element($){v(()=>{let J=D0(this,M0),Z=this.droppable.element,X=this.draggable.element;if(!Z||Z===J)this.droppable.element=$;if(!X||X===J)this.draggable.element=$;K0(this,M0,$)})}get element(){var $,J;let Z=D0(this,M0);if(!Z)return;return(J=($=j5.get(Z))!=null?$:Z)!=null?J:this.droppable.element}set target($){this.droppable.element=$}get target(){return this.droppable.element}set source($){this.draggable.element=$}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set plugins($){this.draggable.plugins=I2($,S5)}set disabled($){v(()=>{this.droppable.disabled=$,this.draggable.disabled=$})}set data($){v(()=>{this.droppable.data=$,this.draggable.data=$})}set handle($){this.draggable.handle=$}set id($){this.droppable.id=$,this.draggable.id=$}get id(){return this.droppable.id}set sensors($){this.draggable.sensors=$}set modifiers($){this.draggable.modifiers=$}set collisionPriority($){this.droppable.collisionPriority=$}set collisionDetector($){this.droppable.collisionDetector=$!=null?$:h5}set alignment($){this.draggable.alignment=$}get alignment(){return this.draggable.alignment}set type($){v(()=>{this.droppable.type=$,this.draggable.type=$})}get type(){return this.draggable.type}set accept($){this.droppable.accept=$}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts($){return this.droppable.accepts($)}};e=B4();v2=new WeakMap;f0=new WeakMap;x0=new WeakMap;h2=new WeakMap;M0=new WeakMap;n5(e,4,"index",r5,y0,v2);n5(e,4,"group",s5,y0,h2);z4(e,y0);var a5=class extends c5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},g2=class extends u5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get group(){return this.sortable.group}};var{defineProperty:T4,defineProperties:O4,getOwnPropertyDescriptors:S4,getOwnPropertySymbols:t5}=Object,E4=Object.prototype.hasOwnProperty,I4=Object.prototype.propertyIsEnumerable,e5=($,J,Z)=>(J in $)?T4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,m2=($,J)=>{for(var Z in J||(J={}))if(E4.call(J,Z))e5($,Z,J[Z]);if(t5){for(var Z of t5(J))if(I4.call(J,Z))e5($,Z,J[Z])}return $},D4=($,J)=>O4($,S4(J));function Y1($){let{accept:J,collisionDetector:Z,collisionPriority:X,id:Y,data:q,element:Q,handle:H,index:G,group:z,disabled:M,modifiers:U,sensors:W,target:F,type:B,plugins:T}=$,P=m2(m2({},_2),$.transition),R=X1((w)=>{return new y0(D4(m2({},$),{transition:P,register:!1,handle:Z2(H),element:Z2(Q),target:Z2(F)}),w)}),S=J1(R,f4);return h(Y,()=>R.id=Y),$1(()=>{v(()=>{R.group=z,R.index=G})},[R,z,G]),h(B,()=>R.type=B),h(J,()=>R.accept=J,void 0,_0),h(q,()=>q&&(R.data=q)),h(G,()=>{var w;if(((w=R.manager)==null?void 0:w.dragOperation.status.idle)&&(P==null?void 0:P.idle))R.refreshShape()},Z1),X2(H,(w)=>R.handle=w),X2(Q,(w)=>R.element=w),X2(F,(w)=>R.target=w),h(M,()=>R.disabled=M===!0),h(W,()=>R.sensors=W),h(Z,()=>R.collisionDetector=Z),h(X,()=>R.collisionPriority=X),h(T,()=>R.plugins=T,void 0,_0),h(P,()=>R.transition=P,void 0,_0),h(U,()=>R.modifiers=U,void 0,_0),h($.alignment,()=>R.alignment=$.alignment),{sortable:S,get isDragging(){return S.isDragging},get isDropping(){return S.isDropping},get isDragSource(){return S.isDragSource},get isDropTarget(){return S.isDropTarget},handleRef:v0.useCallback((w)=>{R.handle=w!=null?w:void 0},[R]),ref:v0.useCallback((w)=>{var L,V;if(!w&&((L=R.element)==null?void 0:L.isConnected)&&!((V=R.manager)==null?void 0:V.dragOperation.status.idle))return;R.element=w!=null?w:void 0},[R]),sourceRef:v0.useCallback((w)=>{var L,V;if(!w&&((L=R.source)==null?void 0:L.isConnected)&&!((V=R.manager)==null?void 0:V.dragOperation.status.idle))return;R.source=w!=null?w:void 0},[R]),targetRef:v0.useCallback((w)=>{var L,V;if(!w&&((L=R.target)==null?void 0:L.isConnected)&&!((V=R.manager)==null?void 0:V.dragOperation.status.idle))return;R.target=w!=null?w:void 0},[R])}}function f4($,J,Z){if($==="isDragSource"&&!Z&&J)return!0;return!1}function x4($,J,Z){let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}function Q1($,J,Z,X){if(Z===X)return $;let Y=x4(J,Z,X),q=new Set(J.map((H)=>H.id)),Q=0;return $.map((H)=>q.has(H.id)?Y[Q++]:H)}async function H$($){let J=[],Z=[],X=$.items;if(X)for(let Q=0;Q<X.length;Q++){let H=X[Q];if(H.kind==="file"){let G=H.webkitGetAsEntry?.();if(G)Z.push({entry:G,path:""})}}else return Array.from($.files);let Y=(Q)=>{return new Promise((H)=>{Q.readEntries((G)=>H(G),()=>H([]))})},q=(Q)=>{return new Promise((H,G)=>{Q.file((z)=>H(z),(z)=>G(z))})};while(Z.length>0){let Q=Z.shift();if(!Q)continue;let{entry:H,path:G}=Q;if(H.isFile)try{let z=await q(H),M=G?`${G}/${z.name}`:z.name;Object.defineProperty(z,"webkitRelativePath",{value:M,writable:!1,configurable:!0}),J.push(z)}catch(z){console.error("Error reading file entry:",z)}else if(H.isDirectory){let z=H.createReader(),M=[],U=await Y(z);while(U.length>0)M=M.concat(U),U=await Y(z);let W=G?`${G}/${H.name}`:H.name;for(let F of M)Z.push({entry:F,path:W})}}return J}var d=c(u(),1);var Y2=["red","orange","yellow","green","blue","purple","gray"],u2={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function q0($){if(!$)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let J=$.toLowerCase(),Z=u2[J];if(Z)return{backgroundColor:Z.bg,color:Z.text};if($.startsWith("#"))return{backgroundColor:`${$}33`,color:$};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:$}}function j4($=[]){let J=new Set($.map((X)=>X.color?.toLowerCase()).filter(Boolean)),Z=Y2.filter((X)=>!J.has(X.toLowerCase()));if(Z.length>0)return Z[Math.floor(Math.random()*Z.length)];return Y2[Math.floor(Math.random()*Y2.length)]}var y4={[_.text]:F1,[_.longText]:q1,[_.select]:z1,[_.selectMulti]:U1,[_.rating]:r0,[_.number]:W1,[_.toggle]:w1,[_.date]:N1,[_.user]:V1,[_.userMulti]:A1};function _4({field:$,index:J,onVisibilityChange:Z}){let{ref:X,handleRef:Y}=Y1({id:$.id,index:J}),q=$.config?.type?y4[$.config.type]:null;return A("div",{ref:X,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[A("div",{className:"flex items-center gap-2",children:[K("div",{ref:Y,className:"cursor-grab",children:K(B1,{className:"h-4 w-4 text-muted-foreground"})}),q&&K(q,{className:"h-4 w-4 text-muted-foreground shrink-0"}),$.aiAutofill&&K(K1,{className:"h-4 w-4 text-muted-foreground shrink-0"}),K("span",{className:"text-sm truncate",children:$.config?.name})]}),K(g0,{checked:$.visible,onCheckedChange:(Q)=>Z($.id,Q)})]})}function T$({projectId:$,onManageFields:J,onSave:Z}){let{fields:X,updateFields:Y}=H5(),[q,Q]=d.useState(""),[H,G]=d.useState("list"),[z,M]=d.useState(""),[U,W]=d.useState(""),[F,B]=d.useState(!1),[T,P]=d.useState(""),[R,S]=d.useState([]),w=H1();d.useEffect(()=>{w.invalidateQueries({queryKey:["fields",$]})},[$,w]);let L=O0.api.projects[":projectId"].fields.order.$patch,{mutate:V}=b2({mutationFn:async(C)=>{if(!(await L(C)).ok)throw Error(I.failed_update_fields_order());return null}}),N=O0.api.projects[":projectId"].fields.$post,{mutate:k}=b2({mutationFn:async(C)=>{let E=await N(C);if(!E.ok)throw Error(I.failed_create_field());return await E.json()},onSuccess:(C)=>{let E={...C,visible:!0},x=[...X,E];Y(x),M(""),S([]),V({param:{projectId:$},json:x.map((j)=>({fieldId:j.id,visible:j.visible||!1}))}),Z?.()}}),O=d.useMemo(()=>X.filter((C)=>C.config?.name?.toLowerCase().includes(q.toLowerCase())),[X,q]),D=(C)=>{if(C.canceled)return;let{source:E}=C.operation;if(!i(E))return;let{initialIndex:x,index:j}=E;if(x===j)return;let d2=Q1(X,O,x,j);Y(d2),V({param:{projectId:$},json:d2.map((l2)=>({fieldId:l2.id,visible:l2.visible||!1}))})},f=(C,E)=>{let x=X.map((j)=>j.id===C?{...j,visible:E}:j);Y(x),V({param:{projectId:$},json:x.map((j)=>({fieldId:j.id,visible:j.visible||!1}))})},g=()=>{if(!z||!U)return;let C=U===_.select?{select:{options:R}}:U===_.selectMulti?{selectMulti:{options:R}}:{};k({param:{projectId:$},json:{config:{name:z,type:U,...C},label:z,aiAutofill:F,description:T}})},m=X.filter((C)=>C.visible).length;if(H==="create")return K("div",{className:"w-80 p-4",children:A("div",{className:"space-y-4",children:[A("div",{className:"space-y-2",children:[K(U0,{htmlFor:"field-name",children:I.field_name()}),K(h0,{id:"field-name",placeholder:I.new_field_placeholder(),value:z,onChange:(C)=>M(C.target.value),autoFocus:!0})]}),A("div",{className:"space-y-2",children:[K(U0,{children:I.field_type()}),A(L1,{children:[K(R1,{asChild:!0,children:A($0,{variant:"outline",className:"w-full justify-between font-normal",children:[U?K("span",{className:"capitalize",children:U.replace(/_/g," ")}):K("span",{className:"text-muted-foreground border-dashed",children:I.select_field_type()}),K(w0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),K(k1,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(_).map((C)=>K(C1,{onClick:()=>{W(C),S([])},className:"capitalize",children:C.replace(/_/g," ")},C))})]})]}),A("div",{className:"space-y-2",children:[K(U0,{htmlFor:"field-desc",children:I.description()}),K(h0,{id:"field-desc",placeholder:I.description_optional_placeholder(),value:T,onChange:(C)=>P(C.target.value)})]}),A("div",{className:"flex items-center space-x-2",children:[K(g0,{id:"ai-autofill",checked:F,onCheckedChange:B}),K(U0,{htmlFor:"ai-autofill",children:I.ai_autofill()})]}),(U===_.select||U===_.selectMulti)&&A("div",{className:"space-y-2",children:[A("div",{className:"flex items-center justify-between",children:[K(U0,{className:"text-sm font-medium",children:I.options()}),A($0,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let C={id:L5(),displayName:I.new_option(),color:j4(R)};S([...R,C])},children:[K(c2,{className:"h-4 w-4 mr-1"})," ",I.add_option()]})]}),K("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:R.map((C,E)=>A("div",{className:"flex items-center gap-2",children:[K(h0,{value:C.displayName,onChange:(x)=>{let j=[...R];j[E]={...C,displayName:x.target.value},S(j)},placeholder:I.option_name_placeholder(),className:"h-8 flex-1"}),A(n,{children:[K(o,{asChild:!0,children:K("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:u2[C.color||""]?.hex||C.color||"#808080"}})}),K(s,{className:"p-2 w-auto",align:"end",children:K("div",{className:"flex gap-1",children:Y2.map((x)=>K("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:u2[x]?.hex||x},onClick:()=>{let j=[...R];j[E]={...C,color:x},S(j)}},x))})})]}),K($0,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{S(R.filter((x,j)=>j!==E))},children:K(F0,{className:"h-4 w-4"})})]},C.id))})]}),A("div",{className:"flex gap-2 pt-2",children:[K($0,{variant:"secondary",className:"flex-1",onClick:()=>{G("list"),M(""),W(""),B(!1),P(""),S([])},children:I.cancel()}),K($0,{className:"flex-1",onClick:g,disabled:!z||!U,children:I.save()})]})]})});return A("div",{className:"w-80 p-4",children:[K("div",{className:"flex items-center justify-between mb-4",children:A("h3",{className:"font-semibold",children:[I.fields()," ",K("span",{className:"text-muted-foreground text-sm font-normal",children:I.visible_count({count:m})})]})}),A("div",{className:"relative mb-4",children:[K(G1,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),K(h0,{placeholder:I.search_fields_placeholder(),value:q,onChange:(C)=>Q(C.target.value),className:"pl-8"})]}),K("div",{className:"max-h-60 overflow-y-auto pr-2",children:K(S1,{sensors:[O1.configure({activationConstraints:[new T1.Distance({value:8})]}),P1],onDragEnd:D,children:O.map((C,E)=>K(_4,{field:C,index:E,onVisibilityChange:f},C.id))})}),J&&A("div",{className:"mt-4 space-y-2",children:[A($0,{variant:"secondary",className:"w-full",onClick:J,children:[K(M1,{className:"h-4 w-4 mr-2"}),I.manage_fields()]}),A($0,{className:"w-full",onClick:()=>G("create"),children:[K(c2,{className:"h-4 w-4 mr-2"}),I.new_field()]})]})]})}var v4=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.select,[q,Q]=E1.useState(!1),H=Y?.options?.find((W)=>W.id===$),G=()=>{if(!X)Q(!0)},z=(W)=>{Z(W),Q(!1)};return K("div",{className:"relative w-full",onClick:(W)=>W.stopPropagation(),children:A(n,{open:!X&&q,onOpenChange:(W)=>{if(X)return;Q(W)},children:[K(o,{asChild:!0,children:A("div",{onClick:G,className:`flex items-center justify-between w-full min-h-[28px] px-2 py-1 rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((W)=>{if(!W)return K("span",{className:"text-muted-foreground italic",children:"Select an option"});return K("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:q0(W.color),children:W.displayName})})(H),!X&&K(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),A(s,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[150px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[A("div",{onClick:()=>z(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2",children:[K(F0,{className:"w-3 h-3"})," Clear"]}),Y?.options?.map((W)=>K("div",{onClick:()=>z(W.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center",children:K("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:q0(W.color),children:W.displayName})},W.id))]})]})})},I1=v4;var J0=c(u(),1);var h4=({value:$=[],config:J,onSave:Z,readOnly:X})=>{let Y=J?.selectMulti,q=J0.useRef(null),[Q,H]=J0.useState(!1),[G,z]=J0.useState(!1),[M,U]=J0.useState($.length),W=Y?.options?.filter((w)=>($||[]).includes(w.id))||[];J0.useLayoutEffect(()=>{if(Q||G){U(W.length);return}if(q.current){let w=q.current.offsetWidth,V=document.createElement("canvas").getContext("2d");if(V){V.font="12px ui-sans-serif, system-ui, sans-serif";let N=0,k=0,D=w-28;for(let f=0;f<W.length;f++){let m=V.measureText(W[f].displayName).width+16+4;if(N+m>D&&f<W.length-1)break;if(f===W.length-1){if(N+m<=w)k++;break}N+=m,k++}U(k)}}},[W,Q,G,$]);let F=(w)=>{let L=$||[],V;if(L.includes(w))V=L.filter((N)=>N!==w);else V=[...L,w];Z(V)},B=(w)=>{if(w.stopPropagation(),Q)return;let L=W.length-M;if(!G&&L>0)z(!0);else if(!X)H(!0)},T=(w)=>{if(w.stopPropagation(),!X)H(!0)},P=W.length-M;return K("div",{className:"relative w-full",onClick:(w)=>w.stopPropagation(),children:A(n,{open:!X&&(G&&!Q||Q),onOpenChange:(w)=>{if(X)return;if(!w)z(!1),H(!1)},children:[K(o,{asChild:!0,children:A("div",{ref:q,onClick:B,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!X||P>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[W.length===0&&K("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.slice(0,M).map((w)=>K("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:q0(w.color),children:w.displayName},w.id)),P>0&&A("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",P]})]})}),K(s,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${G&&!Q?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:G&&!Q?T:void 0,children:G&&!Q?A(Q2,{children:[W.length===0&&K("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.map((w)=>K("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:q0(w.color),children:w.displayName},w.id))]}):Y?.options?.map((w)=>{let L=($||[]).includes(w.id);return A("div",{onClick:()=>F(w.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between",children:[K("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:q0(w.color),children:w.displayName}),L&&K(H2,{className:"w-4 h-4 text-primary"})]},w.id)})})]})})},D1=h4;var Z0=c(u(),1);var g4=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=Z0.useState(!1),[q,Q]=Z0.useState($||""),H=Z0.useRef(null);Z0.useEffect(()=>{Q($||"")},[$]),Z0.useEffect(()=>{if(X&&H.current)H.current.focus()},[X]);let G=()=>{if(!Z)Y(!0)},z=()=>{Y(!1),J(q)},M=(U)=>{if(U.key==="Enter")H.current?.blur()};if(X)return K("input",{ref:H,type:"text",value:q,onChange:(U)=>Q(U.target.value),onBlur:z,onKeyDown:M,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return K("div",{onClick:G,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$||K("span",{className:"text-muted-foreground italic",children:"Empty"})})},f1=g4;var m4=({value:$,onSave:J,readOnly:Z})=>{return K("div",{className:"flex items-center h-[28px] w-full",onClick:(Y)=>Y.stopPropagation(),children:K(g0,{checked:$,onCheckedChange:(Y)=>{if(!Z)J(Y)},disabled:Z,className:"cursor-pointer"})})},x1=m4;var q2=c(u(),1);var b4=({value:$,onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:q}=o0(),[Q,H]=q2.useState(!1);q2.useEffect(()=>{if(X)q(X)},[X,q]);let G=Y.find((B)=>B.id===$),z=()=>{if(!Z)H(!0)},M=(B)=>{J(B),H(!1)},U=(B)=>{if(Z)return;H(B)},W=(B)=>{return B.split(" ").map((T)=>T[0]).slice(0,2).join("").toUpperCase()};return K("div",{className:"relative w-full",onClick:(B)=>B.stopPropagation(),children:A(n,{open:!Z&&Q,onOpenChange:U,children:[K(o,{asChild:!0,children:A("div",{onClick:z,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((B)=>{if(!B)return K("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return A("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[A(V0,{className:"w-4 h-4",children:[K(A0,{src:B.image,alt:B.name,className:"object-cover"}),K(L0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),K("span",{className:"truncate max-w-[120px]",children:B.name})]})})(G),!Z&&K(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),A(s,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[A("div",{onClick:()=>M(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[K(F0,{className:"w-3 h-3"})," Clear"]}),Y.map((B)=>A("div",{onClick:()=>M(B.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[A(V0,{className:"w-5 h-5",children:[K(A0,{src:B.image,alt:B.name,className:"object-cover"}),K(L0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),K("span",{className:"text-sm font-medium text-foreground",children:B.name})]},B.id))]})]})})},j1=b4;var r=c(u(),1);var c4=({value:$=[],onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:q}=o0(),Q=r.useRef(null),[H,G]=r.useState(!1),[z,M]=r.useState(!1),[U,W]=r.useState($.length);r.useEffect(()=>{if(X)q(X)},[X,q]);let F=Y.filter((N)=>($||[]).includes(N.id)),B=(N)=>{return N.split(" ").map((k)=>k[0]).slice(0,2).join("").toUpperCase()};r.useLayoutEffect(()=>{if(H||z){W(F.length);return}if(Q.current){let N=Q.current.offsetWidth,O=document.createElement("canvas").getContext("2d");if(O){O.font="12px ui-sans-serif, system-ui, sans-serif";let D=0,f=0,m=N-28;for(let C=0;C<F.length;C++){let x=O.measureText(F[C].name).width+42;if(D+x>m&&C<F.length-1)break;if(C===F.length-1){if(D+x<=N)f++;break}D+=x,f++}W(f)}}},[F,H,z,$]);let T=(N)=>{let k=$||[],O;if(k.includes(N))O=k.filter((D)=>D!==N);else O=[...k,N];J(O)},P=(N)=>{if(N.stopPropagation(),H)return;let k=F.length-U;if(!z&&k>0)M(!0);else if(!Z)G(!0)},R=(N)=>{if(N.stopPropagation(),!Z)G(!0)},S=F.length-U,w=z&&!H||H,L=(N)=>{if(Z)return;if(!N)M(!1),G(!1)},V=(N)=>{return A("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[A(V0,{className:"w-4 h-4",children:[K(A0,{src:N.image,alt:N.name,className:"object-cover"}),K(L0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:B(N.name)})]}),K("span",{className:"truncate max-w-[100px]",children:N.name})]},N.id)};return K("div",{className:"relative w-full",onClick:(N)=>N.stopPropagation(),children:A(n,{open:!Z&&w,onOpenChange:L,children:[K(o,{asChild:!0,children:A("div",{ref:Q,onClick:P,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!Z||S>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[F.length===0&&K("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),F.slice(0,U).map(V),S>0&&A("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",S]})]})}),K(s,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${z&&!H?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:z&&!H?R:void 0,children:z&&!H?A(Q2,{children:[F.length===0&&K("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),F.map(V)]}):Y.map((N)=>{let k=($||[]).includes(N.id);return A("div",{onClick:()=>T(N.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[A("div",{className:"flex items-center gap-2",children:[A(V0,{className:"w-5 h-5",children:[K(A0,{src:N.image,alt:N.name,className:"object-cover"}),K(L0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:B(N.name)})]}),K("span",{className:"text-sm font-medium text-foreground",children:N.name})]}),k&&K(H2,{className:"w-4 h-4 text-primary"})]},N.id)})})]})})},y1=c4;var u4=($)=>{if(!$.config)return K("div",{children:"Unknown Field Type"});switch($.config.type){case"text":return K(f1,{...$,value:$.value,onSave:$.onSave});case"longText":return K(w5,{...$,value:$.value,onSave:$.onSave});case"select":return K(I1,{...$,value:$.value,onSave:$.onSave});case"selectMulti":return K(D1,{...$,value:$.value,onSave:$.onSave});case"rating":return K(A5,{...$,value:$.value,onSave:$.onSave});case"number":return K(F5,{...$,value:$.value,onSave:$.onSave});case"toggle":return K(x1,{...$,value:$.value,onSave:$.onSave});case"date":return K(U5,{...$,value:$.value,onSave:$.onSave});case"user":return K(j1,{...$,value:$.value,onSave:$.onSave});case"userMulti":return K(y1,{...$,value:$.value,onSave:$.onSave});default:return K("div",{children:"Unknown Field Type"})}},A6=u4;var k6=({progress:$,className:J})=>{let X=2*Math.PI*20,Y=X-Math.min(100,Math.max(0,$))/100*X;return A("svg",{viewBox:"0 0 50 50",className:R0("w-12 h-12",J),children:[K("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),K("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:X,strokeDashoffset:Y,transform:"rotate(-90 25 25)"}),K("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round($)}%`})]})};var d4=($)=>{if(isNaN($))return"00:00";let J=new Date($*1000),Z=J.getUTCHours(),X=J.getUTCMinutes().toString().padStart(2,"0"),Y=J.getUTCSeconds().toString().padStart(2,"0");if(Z)return`${Z}:${X}:${Y}`;return`${X}:${Y}`},T6=($,J,Z,X)=>{if(Z==="frames")return`${$} fr`;if(Z==="standard")return d4($/J);let Y=Math.round(J),q=J!==Y,Q=!1;if(q&&(Y===30||Y===60))Q=!0;let H=0;if(X){let B=X.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(B){let T=parseInt(B[1],10),P=parseInt(B[2],10),R=parseInt(B[3],10),S=parseInt(B[5],10);if(Q=B[4]!==":",H=(T*3600+P*60+R)*Y+S,Q){let w=T*60+P,L=J<30?2:4;H-=L*(w-Math.floor(w/10))}}}let G=$+H;if(Q){let B=J<30?2:4,T=Math.floor(G/(17982*B/2)),P=G%(17982*B/2);if(P<B)P=P+B;G+=9*B*T+B*Math.floor((P-B)/(1798*B/2))}let z=G%Y,M=Math.floor(G/Y)%60,U=Math.floor(G/(Y*60))%60,W=Math.floor(G/(Y*3600))%24,F=Q?";":":";return`${W.toString().padStart(2,"0")}:${U.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}${F}${z.toString().padStart(2,"0")}`};var O6=($,J)=>{if(!J)return 0;let Z=1/J;return $*Z+Z/2},l4=($)=>Math.max(100,3000/($||30)),S6=({dbTotalFrames:$,containerDuration:J,frameRate:Z})=>{let X=Z||30,Y=Math.round(J*X);if($<=0)return Y;let q=$/X,Q=J-q,H=l4(X)/1000;return Q>H?Y:$};var _1=c(u(),1);function f6({className:$,defaultValue:J,value:Z,min:X=0,max:Y=100,...q}){let Q=_1.useMemo(()=>Array.isArray(Z)?Z:Array.isArray(J)?J:[X,Y],[Z,J,X,Y]);return A(m0.Root,{"data-slot":"slider",defaultValue:J,value:Z,min:X,max:Y,className:R0("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",$),...q,children:[K(m0.Track,{"data-slot":"slider-track",className:R0("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:K(m0.Range,{"data-slot":"slider-range",className:R0("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:Q.length},(H,G)=>K(m0.Thumb,{"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"},G))]})}
|
|
2
|
-
export{A2 as p,K5 as q,N5 as r,k2 as s,C2 as t,Q1 as u,H$ as v,H5 as w,L5 as x,k6 as y,A5 as z,i as A,Y1 as B,Y2 as C,u2 as D,q0 as E,j4 as F,y4 as G,T$ as H,o0 as I,A6 as J,d4 as K,T6 as L,O6 as M,l4 as N,S6 as O,f6 as P};
|