formue-crud 0.2.13 → 0.2.15
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/dist/formue-crud.js +565 -563
- package/dist/formue-crud.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/formue-crud.umd.cjs
CHANGED
|
@@ -27,7 +27,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
27
27
|
}`;var te=nc(function(){return ue(y,G+"return "+z).apply(t,E)});if(te.source=z,Sa(te))throw te;return te}function M_(r){return de(r).toLowerCase()}function L_(r){return de(r).toUpperCase()}function D_(r,o,h){if(r=de(r),r&&(h||o===t))return cu(r);if(!r||!(o=it(o)))return r;var f=vt(r),m=vt(o),y=fu(f,m),E=pu(f,m)+1;return oi(f,y,E).join("")}function A_(r,o,h){if(r=de(r),r&&(h||o===t))return r.slice(0,mu(r)+1);if(!r||!(o=it(o)))return r;var f=vt(r),m=pu(f,vt(o))+1;return oi(f,0,m).join("")}function F_(r,o,h){if(r=de(r),r&&(h||o===t))return r.replace(So,"");if(!r||!(o=it(o)))return r;var f=vt(r),m=fu(f,vt(o));return oi(f,m).join("")}function z_(r,o){var h=Y,f=he;if(Ce(o)){var m="separator"in o?o.separator:m;h="length"in o?Q(o.length):h,f="omission"in o?it(o.omission):f}r=de(r);var y=r.length;if(Gi(r)){var E=vt(r);y=E.length}if(h>=y)return r;var x=h-Ui(f);if(x<1)return f;var T=E?oi(E,0,x).join(""):r.slice(0,x);if(m===t)return T+f;if(E&&(x+=T.length-x),Ma(m)){if(r.slice(x).search(m)){var D,A=T;for(m.global||(m=Uo(m.source,de(zh.exec(m))+"g")),m.lastIndex=0;D=m.exec(A);)var z=D.index;T=T.slice(0,z===t?x:z)}}else if(r.indexOf(it(m),x)!=x){var B=T.lastIndexOf(m);B>-1&&(T=T.slice(0,B))}return T+f}function P_(r){return r=de(r),r&&jy.test(r)?r.replace(Dh,uE):r}var O_=Zi(function(r,o,h){return r+(h?" ":"")+o.toUpperCase()}),Aa=rd("toUpperCase");function ic(r,o,h){return r=de(r),o=h?t:o,o===t?sE(r)?fE(r):YC(r):r.match(o)||[]}var nc=ie(function(r,o){try{return et(r,t,o)}catch(h){return Sa(h)?h:new J(h)}}),H_=Bt(function(r,o){return at(o,function(h){h=kt(h),Ot(r,h,Ta(r[h],r))}),r});function B_(r){var o=r==null?0:r.length,h=K();return r=o?we(r,function(f){if(typeof f[1]!="function")throw new lt(a);return[h(f[0]),f[1]]}):[],ie(function(f){for(var m=-1;++m<o;){var y=r[m];if(et(y[0],this,f))return et(y[1],this,f)}})}function N_(r){return u0(ut(r,w))}function Fa(r){return function(){return r}}function I_(r,o){return r==null||r!==r?o:r}var V_=od(),W_=od(!0);function Je(r){return r}function za(r){return Ou(typeof r=="function"?r:ut(r,w))}function $_(r){return Bu(ut(r,w))}function G_(r,o){return Nu(r,ut(o,w))}var U_=ie(function(r,o){return function(h){return Hn(h,r,o)}}),j_=ie(function(r,o){return function(h){return Hn(r,h,o)}});function Pa(r,o,h){var f=Fe(o),m=Br(o,f);h==null&&!(Ce(o)&&(m.length||!f.length))&&(h=o,o=r,r=this,m=Br(o,Fe(o)));var y=!(Ce(h)&&"chain"in h)||!!h.chain,E=It(r);return at(m,function(x){var T=o[x];r[x]=T,E&&(r.prototype[x]=function(){var D=this.__chain__;if(y||D){var A=r(this.__wrapped__),z=A.__actions__=qe(this.__actions__);return z.push({func:T,args:arguments,thisArg:r}),A.__chain__=D,A}return T.apply(r,ei([this.value()],arguments))})}),r}function K_(){return Pe._===this&&(Pe._=wE),this}function Oa(){}function q_(r){return r=Q(r),ie(function(o){return Iu(o,r)})}var X_=fa(we),Y_=fa(au),J_=fa(Bo);function rc(r){return ya(r)?No(kt(r)):k0(r)}function Z_(r){return function(o){return r==null?t:Ei(r,o)}}var Q_=ld(),eT=ld(!0);function Ha(){return[]}function Ba(){return!1}function tT(){return{}}function iT(){return""}function nT(){return!0}function rT(r,o){if(r=Q(r),r<1||r>We)return[];var h=$e,f=Ne(r,$e);o=K(o),r-=$e;for(var m=Wo(f,o);++h<r;)o(h);return m}function sT(r){return Z(r)?we(r,kt):nt(r)?[r]:qe(Rd(de(r)))}function oT(r){var o=++bE;return de(r)+o}var aT=Gr(function(r,o){return r+o},0),lT=pa("ceil"),hT=Gr(function(r,o){return r/o},1),uT=pa("floor");function dT(r){return r&&r.length?Hr(r,Je,Qo):t}function cT(r,o){return r&&r.length?Hr(r,K(o,2),Qo):t}function fT(r){return uu(r,Je)}function pT(r,o){return uu(r,K(o,2))}function gT(r){return r&&r.length?Hr(r,Je,na):t}function mT(r,o){return r&&r.length?Hr(r,K(o,2),na):t}var bT=Gr(function(r,o){return r*o},1),vT=pa("round"),wT=Gr(function(r,o){return r-o},0);function yT(r){return r&&r.length?Vo(r,Je):0}function CT(r,o){return r&&r.length?Vo(r,K(o,2)):0}return v.after=$x,v.ary=Pd,v.assign=LR,v.assignIn=Xd,v.assignInWith=ns,v.assignWith=DR,v.at=AR,v.before=Od,v.bind=Ta,v.bindAll=H_,v.bindKey=Hd,v.castArray=tR,v.chain=Ad,v.chunk=u1,v.compact=d1,v.concat=c1,v.cond=B_,v.conforms=N_,v.constant=Fa,v.countBy=yx,v.create=FR,v.curry=Bd,v.curryRight=Nd,v.debounce=Id,v.defaults=zR,v.defaultsDeep=PR,v.defer=Gx,v.delay=Ux,v.difference=f1,v.differenceBy=p1,v.differenceWith=g1,v.drop=m1,v.dropRight=b1,v.dropRightWhile=v1,v.dropWhile=w1,v.fill=y1,v.filter=Ex,v.flatMap=_x,v.flatMapDeep=Tx,v.flatMapDepth=kx,v.flatten=Sd,v.flattenDeep=C1,v.flattenDepth=E1,v.flip=jx,v.flow=V_,v.flowRight=W_,v.fromPairs=x1,v.functions=WR,v.functionsIn=$R,v.groupBy=Sx,v.initial=_1,v.intersection=T1,v.intersectionBy=k1,v.intersectionWith=S1,v.invert=UR,v.invertBy=jR,v.invokeMap=Lx,v.iteratee=za,v.keyBy=Dx,v.keys=Fe,v.keysIn=Ye,v.map=Jr,v.mapKeys=qR,v.mapValues=XR,v.matches=$_,v.matchesProperty=G_,v.memoize=Qr,v.merge=YR,v.mergeWith=Yd,v.method=U_,v.methodOf=j_,v.mixin=Pa,v.negate=es,v.nthArg=q_,v.omit=JR,v.omitBy=ZR,v.once=Kx,v.orderBy=Ax,v.over=X_,v.overArgs=qx,v.overEvery=Y_,v.overSome=J_,v.partial=ka,v.partialRight=Vd,v.partition=Fx,v.pick=QR,v.pickBy=Jd,v.property=rc,v.propertyOf=Z_,v.pull=A1,v.pullAll=Ld,v.pullAllBy=F1,v.pullAllWith=z1,v.pullAt=P1,v.range=Q_,v.rangeRight=eT,v.rearg=Xx,v.reject=Ox,v.remove=O1,v.rest=Yx,v.reverse=Ra,v.sampleSize=Bx,v.set=t_,v.setWith=i_,v.shuffle=Nx,v.slice=H1,v.sortBy=Wx,v.sortedUniq=G1,v.sortedUniqBy=U1,v.split=__,v.spread=Jx,v.tail=j1,v.take=K1,v.takeRight=q1,v.takeRightWhile=X1,v.takeWhile=Y1,v.tap=dx,v.throttle=Zx,v.thru=Yr,v.toArray=jd,v.toPairs=Zd,v.toPairsIn=Qd,v.toPath=sT,v.toPlainObject=qd,v.transform=n_,v.unary=Qx,v.union=J1,v.unionBy=Z1,v.unionWith=Q1,v.uniq=ex,v.uniqBy=tx,v.uniqWith=ix,v.unset=r_,v.unzip=_a,v.unzipWith=Dd,v.update=s_,v.updateWith=o_,v.values=tn,v.valuesIn=a_,v.without=nx,v.words=ic,v.wrap=eR,v.xor=rx,v.xorBy=sx,v.xorWith=ox,v.zip=ax,v.zipObject=lx,v.zipObjectDeep=hx,v.zipWith=ux,v.entries=Zd,v.entriesIn=Qd,v.extend=Xd,v.extendWith=ns,Pa(v,v),v.add=aT,v.attempt=nc,v.camelCase=d_,v.capitalize=ec,v.ceil=lT,v.clamp=l_,v.clone=iR,v.cloneDeep=rR,v.cloneDeepWith=sR,v.cloneWith=nR,v.conformsTo=oR,v.deburr=tc,v.defaultTo=I_,v.divide=hT,v.endsWith=c_,v.eq=yt,v.escape=f_,v.escapeRegExp=p_,v.every=Cx,v.find=xx,v.findIndex=Td,v.findKey=OR,v.findLast=Rx,v.findLastIndex=kd,v.findLastKey=HR,v.floor=uT,v.forEach=Fd,v.forEachRight=zd,v.forIn=BR,v.forInRight=NR,v.forOwn=IR,v.forOwnRight=VR,v.get=La,v.gt=aR,v.gte=lR,v.has=GR,v.hasIn=Da,v.head=Md,v.identity=Je,v.includes=Mx,v.indexOf=R1,v.inRange=h_,v.invoke=KR,v.isArguments=_i,v.isArray=Z,v.isArrayBuffer=hR,v.isArrayLike=Xe,v.isArrayLikeObject=ke,v.isBoolean=uR,v.isBuffer=ai,v.isDate=dR,v.isElement=cR,v.isEmpty=fR,v.isEqual=pR,v.isEqualWith=gR,v.isError=Sa,v.isFinite=mR,v.isFunction=It,v.isInteger=Wd,v.isLength=ts,v.isMap=$d,v.isMatch=bR,v.isMatchWith=vR,v.isNaN=wR,v.isNative=yR,v.isNil=ER,v.isNull=CR,v.isNumber=Gd,v.isObject=Ce,v.isObjectLike=_e,v.isPlainObject=$n,v.isRegExp=Ma,v.isSafeInteger=xR,v.isSet=Ud,v.isString=is,v.isSymbol=nt,v.isTypedArray=en,v.isUndefined=RR,v.isWeakMap=_R,v.isWeakSet=TR,v.join=M1,v.kebabCase=g_,v.last=ct,v.lastIndexOf=L1,v.lowerCase=m_,v.lowerFirst=b_,v.lt=kR,v.lte=SR,v.max=dT,v.maxBy=cT,v.mean=fT,v.meanBy=pT,v.min=gT,v.minBy=mT,v.stubArray=Ha,v.stubFalse=Ba,v.stubObject=tT,v.stubString=iT,v.stubTrue=nT,v.multiply=bT,v.nth=D1,v.noConflict=K_,v.noop=Oa,v.now=Zr,v.pad=v_,v.padEnd=w_,v.padStart=y_,v.parseInt=C_,v.random=u_,v.reduce=zx,v.reduceRight=Px,v.repeat=E_,v.replace=x_,v.result=e_,v.round=vT,v.runInContext=R,v.sample=Hx,v.size=Ix,v.snakeCase=R_,v.some=Vx,v.sortedIndex=B1,v.sortedIndexBy=N1,v.sortedIndexOf=I1,v.sortedLastIndex=V1,v.sortedLastIndexBy=W1,v.sortedLastIndexOf=$1,v.startCase=T_,v.startsWith=k_,v.subtract=wT,v.sum=yT,v.sumBy=CT,v.template=S_,v.times=rT,v.toFinite=Vt,v.toInteger=Q,v.toLength=Kd,v.toLower=M_,v.toNumber=ft,v.toSafeInteger=MR,v.toString=de,v.toUpper=L_,v.trim=D_,v.trimEnd=A_,v.trimStart=F_,v.truncate=z_,v.unescape=P_,v.uniqueId=oT,v.upperCase=O_,v.upperFirst=Aa,v.each=Fd,v.eachRight=zd,v.first=Md,Pa(v,function(){var r={};return _t(v,function(o,h){ce.call(v.prototype,h)||(r[h]=o)}),r}(),{chain:!1}),v.VERSION=i,at(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){v[r].placeholder=v}),at(["drop","take"],function(r,o){ae.prototype[r]=function(h){h=h===t?1:De(Q(h),0);var f=this.__filtered__&&!o?new ae(this):this.clone();return f.__filtered__?f.__takeCount__=Ne(h,f.__takeCount__):f.__views__.push({size:Ne(h,$e),type:r+(f.__dir__<0?"Right":"")}),f},ae.prototype[r+"Right"]=function(h){return this.reverse()[r](h).reverse()}}),at(["filter","map","takeWhile"],function(r,o){var h=o+1,f=h==Re||h==gt;ae.prototype[r]=function(m){var y=this.clone();return y.__iteratees__.push({iteratee:K(m,3),type:h}),y.__filtered__=y.__filtered__||f,y}}),at(["head","last"],function(r,o){var h="take"+(o?"Right":"");ae.prototype[r]=function(){return this[h](1).value()[0]}}),at(["initial","tail"],function(r,o){var h="drop"+(o?"":"Right");ae.prototype[r]=function(){return this.__filtered__?new ae(this):this[h](1)}}),ae.prototype.compact=function(){return this.filter(Je)},ae.prototype.find=function(r){return this.filter(r).head()},ae.prototype.findLast=function(r){return this.reverse().find(r)},ae.prototype.invokeMap=ie(function(r,o){return typeof r=="function"?new ae(this):this.map(function(h){return Hn(h,r,o)})}),ae.prototype.reject=function(r){return this.filter(es(K(r)))},ae.prototype.slice=function(r,o){r=Q(r);var h=this;return h.__filtered__&&(r>0||o<0)?new ae(h):(r<0?h=h.takeRight(-r):r&&(h=h.drop(r)),o!==t&&(o=Q(o),h=o<0?h.dropRight(-o):h.take(o-r)),h)},ae.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},ae.prototype.toArray=function(){return this.take($e)},_t(ae.prototype,function(r,o){var h=/^(?:filter|find|map|reject)|While$/.test(o),f=/^(?:head|last)$/.test(o),m=v[f?"take"+(o=="last"?"Right":""):o],y=f||/^find/.test(o);m&&(v.prototype[o]=function(){var E=this.__wrapped__,x=f?[1]:arguments,T=E instanceof ae,D=x[0],A=T||Z(E),z=function(re){var le=m.apply(v,ei([re],x));return f&&B?le[0]:le};A&&h&&typeof D=="function"&&D.length!=1&&(T=A=!1);var B=this.__chain__,G=!!this.__actions__.length,q=y&&!B,te=T&&!G;if(!y&&A){E=te?E:new ae(this);var X=r.apply(E,x);return X.__actions__.push({func:Yr,args:[z],thisArg:t}),new ht(X,B)}return q&&te?r.apply(this,x):(X=this.thru(z),q?f?X.value()[0]:X.value():X)})}),at(["pop","push","shift","sort","splice","unshift"],function(r){var o=Er[r],h=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",f=/^(?:pop|shift)$/.test(r);v.prototype[r]=function(){var m=arguments;if(f&&!this.__chain__){var y=this.value();return o.apply(Z(y)?y:[],m)}return this[h](function(E){return o.apply(Z(E)?E:[],m)})}}),_t(ae.prototype,function(r,o){var h=v[o];if(h){var f=h.name+"";ce.call(Xi,f)||(Xi[f]=[]),Xi[f].push({name:o,func:h})}}),Xi[$r(t,L).name]=[{name:"wrapper",func:t}],ae.prototype.clone=PE,ae.prototype.reverse=OE,ae.prototype.value=HE,v.prototype.at=cx,v.prototype.chain=fx,v.prototype.commit=px,v.prototype.next=gx,v.prototype.plant=bx,v.prototype.reverse=vx,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=wx,v.prototype.first=v.prototype.head,Ln&&(v.prototype[Ln]=mx),v},ji=pE();bi?((bi.exports=ji)._=ji,zo._=ji):Pe._=ji}).call(li)}(Gn,Gn.exports);var $=Gn.exports;const hc=({headers:l,baseURL:e}={headers:[],baseURL:""})=>{ye.defaults.baseURL=e;for(const t in l)$.set(ye.defaults.headers,t,l[t])};function uc(l){return{all:l=l||new Map,on:function(e,t){var i=l.get(e);i?i.push(t):l.set(e,[t])},off:function(e,t){var i=l.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):l.set(e,[]))},emit:function(e,t){var i=l.get(e);i&&i.slice().map(function(n){n(t)}),(i=l.get("*"))&&i.slice().map(function(n){n(e,t)})}}}class nn{constructor(){if(nn.instance)return nn.instance;this.emitt=uc(),this.lockedListeners=[],this.fns=[],this.fns2=[],this.fns3=[],nn.instance=this}listen(e,t,i=!1){e=Array.isArray(e)?e:[e];for(const n of e)this.emitt.on(n,t),i&&this.lockedListeners.push([e,t])}event(e,t){this.emitt.emit(e,t)}runAfterPageChanged(e){this.fns.push(e)}runAfterPageLoaded(e){this.fns2.push(e)}runBeforeMajraInit(e){this.fns3.push(e)}clear(e){this.emitt.all.clear(),e&&e(),this.listen("beforeMajraInit",t=>{this.fns3.forEach(i=>i(t)),this.fns3=[]}),this.listen("majraMounted",t=>{this.fns.forEach(i=>i(t)),this.fns=[]}),this.listen("majraDataLoaded",t=>{this.fns2.forEach(i=>i(t)),this.fns2=[]});for(let t of this.lockedListeners)this.listen(t[0],t[1])}}const se=new nn,Na=l=>{Object.assign(se,l)},dc={en:{clear:"Clear",no:"No",yes:"yes",alert_to_delete:"Are you sure to delete?",first:"First",previous:"Previous",next:"Next",last:"Last",apply_filter:"Apply filter",filter:"Filter",add_filter:"Add filter",clear_all:"Clear all",add:"Add",save:"Save",edit:"Edit",cancel:"Cancel",choose_filter:"Choose filter",select_type:"Select type",equal_to:"Equal to",not_equal_to:"Not equal to",greater_than:"Greater than",less_than:"Less than",look_like:"Look like",search:"Search ...",range:"Range",add:"Add",export:"Export",export_as_pdf:"Export as PDF",export_as_excel:" Export as Excel",print:"Print",reload:"Reload",select_row:"Select row",custom_column:"Custom column",filter_data:"Filter data",active_filter:"Active filter",not_null:"Not Null",null:"Null"},fa:{clear:"پاک کردن",no:"خیر",yes:"بله",alert_to_delete:"آیا از حذف کردن مطمئن هستید؟",first:"ابتدا",previous:"قبلی",next:"بعدی",last:"آخرین",apply_filter:"اعمال فیلتر",filter:"فیلتر",add_filter:"افزودن فیلتر",clear_all:"حذف فیلترها",add:"افرودن",save:"ذخیره",edit:"ویرایش",cancel:"لغو",choose_filter:"انتخاب فیلتر",select_type:"انتخاب کنید",equal_to:"برابر با",not_equal_to:"نابرابر با",greater_than:"بزرگتر از",less_than:"کوچکتر از",look_like:"مشابه",search:"جستجو ...",range:"محدوده",edit_filter:"ویرایش فیلتر",export:"خروجیگرفتن",export_as_pdf:"PDF خروجی",export_as_excel:"Excel خروجی",print:"خروجی چاپی",reload:"بارگذاری مجدد",select_row:"انتخاب ردیف",custom_column:"ستون سفارشی",filter_data:"فیلترکردن ",active_filter:"فیلترهای فعال",not_load_or_existing_data:"دیتایی وجود ندارد :(",filter_save_placeholder:"اسم فیلتر",not_filter_create_yes:"هنوز فیلتری ایجاد نشده است",operator:"عملگر",in:"برابر با مقادیر",not_in:"نابرابر با مقادیر",value:"مقدار",between:"از میان",not_null:"دارای مقدار",null:"بدون مقدار"}},Ti=$t.defineStore("formuCrudLangs",{state:()=>({lang:"fa",dir:"rtl",langs:dc}),getters:{currentLang(l){return $.get(l.langs,l.lang,"fa")}},actions:{translate(l){return $.get(this.currentLang,l,l)}}});var ki=TypeError;const cc=lc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var rs=typeof Map=="function"&&Map.prototype,ss=Object.getOwnPropertyDescriptor&&rs?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Un=rs&&ss&&typeof ss.get=="function"?ss.get:null,Ia=rs&&Map.prototype.forEach,os=typeof Set=="function"&&Set.prototype,as=Object.getOwnPropertyDescriptor&&os?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,jn=os&&as&&typeof as.get=="function"?as.get:null,Va=os&&Set.prototype.forEach,fc=typeof WeakMap=="function"&&WeakMap.prototype,rn=fc?WeakMap.prototype.has:null,pc=typeof WeakSet=="function"&&WeakSet.prototype,sn=pc?WeakSet.prototype.has:null,gc=typeof WeakRef=="function"&&WeakRef.prototype,Wa=gc?WeakRef.prototype.deref:null,mc=Boolean.prototype.valueOf,bc=Object.prototype.toString,vc=Function.prototype.toString,wc=String.prototype.match,ls=String.prototype.slice,Gt=String.prototype.replace,yc=String.prototype.toUpperCase,$a=String.prototype.toLowerCase,Ga=RegExp.prototype.test,Ua=Array.prototype.concat,Et=Array.prototype.join,Cc=Array.prototype.slice,ja=Math.floor,hs=typeof BigInt=="function"?BigInt.prototype.valueOf:null,us=Object.getOwnPropertySymbols,ds=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Si=typeof Symbol=="function"&&typeof Symbol.iterator=="object",on=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Si||"symbol")?Symbol.toStringTag:null,Ka=Object.prototype.propertyIsEnumerable,qa=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(l){return l.__proto__}:null);function Xa(l,e){if(l===1/0||l===-1/0||l!==l||l&&l>-1e3&&l<1e3||Ga.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof l=="number"){var i=l<0?-ja(-l):ja(l);if(i!==l){var n=String(i),s=ls.call(e,n.length+1);return Gt.call(n,t,"$&_")+"."+Gt.call(Gt.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Gt.call(e,t,"$&_")}var cs=cc,Ya=cs.custom,Ja=tl(Ya)?Ya:null,Za={__proto__:null,double:'"',single:"'"},Ec={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Kn=function l(e,t,i,n){var s=t||{};if(St(s,"quoteStyle")&&!St(Za,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(St(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=St(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(St(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(St(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return nl(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var d=String(e);return u?Xa(e,d):d}if(typeof e=="bigint"){var p=String(e)+"n";return u?Xa(e,p):p}var g=typeof s.depth>"u"?5:s.depth;if(typeof i>"u"&&(i=0),i>=g&&g>0&&typeof e=="object")return fs(e)?"[Array]":"[Object]";var w=Ic(s,i);if(typeof n>"u")n=[];else if(il(n,e)>=0)return"[Circular]";function b(xe,Re,Ve){if(Re&&(n=Cc.call(n),n.push(Re)),Ve){var gt={depth:s.depth};return St(s,"quoteStyle")&&(gt.quoteStyle=s.quoteStyle),l(xe,gt,i+1,n)}return l(xe,s,i+1,n)}if(typeof e=="function"&&!el(e)){var C=Dc(e),_=qn(e,b);return"[Function"+(C?": "+C:" (anonymous)")+"]"+(_.length>0?" { "+Et.call(_,", ")+" }":"")}if(tl(e)){var S=Si?Gt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):ds.call(e);return typeof e=="object"&&!Si?an(S):S}if(Hc(e)){for(var F="<"+$a.call(String(e.nodeName)),L=e.attributes||[],U=0;U<L.length;U++)F+=" "+L[U].name+"="+Qa(xc(L[U].value),"double",s);return F+=">",e.childNodes&&e.childNodes.length&&(F+="..."),F+="</"+$a.call(String(e.nodeName))+">",F}if(fs(e)){if(e.length===0)return"[]";var H=qn(e,b);return w&&!Nc(H)?"["+gs(H,w)+"]":"[ "+Et.call(H,", ")+" ]"}if(_c(e)){var N=qn(e,b);return!("cause"in Error.prototype)&&"cause"in e&&!Ka.call(e,"cause")?"{ ["+String(e)+"] "+Et.call(Ua.call("[cause]: "+b(e.cause),N),", ")+" }":N.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Et.call(N,", ")+" }"}if(typeof e=="object"&&a){if(Ja&&typeof e[Ja]=="function"&&cs)return cs(e,{depth:g-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Ac(e)){var O=[];return Ia&&Ia.call(e,function(xe,Re){O.push(b(Re,e,!0)+" => "+b(xe,e))}),rl("Map",Un.call(e),O,w)}if(Pc(e)){var oe=[];return Va&&Va.call(e,function(xe){oe.push(b(xe,e))}),rl("Set",jn.call(e),oe,w)}if(Fc(e))return ps("WeakMap");if(Oc(e))return ps("WeakSet");if(zc(e))return ps("WeakRef");if(kc(e))return an(b(Number(e)));if(Mc(e))return an(b(hs.call(e)));if(Sc(e))return an(mc.call(e));if(Tc(e))return an(b(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof li<"u"&&e===li)return"{ [object globalThis] }";if(!Rc(e)&&!el(e)){var V=qn(e,b),W=qa?qa(e)===Object.prototype:e instanceof Object||e.constructor===Object,pe=e instanceof Object?"":"null prototype",Y=!W&&on&&Object(e)===e&&on in e?ls.call(Ut(e),8,-1):pe?"Object":"",he=W||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",j=he+(Y||pe?"["+Et.call(Ua.call([],Y||[],pe||[]),": ")+"] ":"");return V.length===0?j+"{}":w?j+"{"+gs(V,w)+"}":j+"{ "+Et.call(V,", ")+" }"}return String(e)};function Qa(l,e,t){var i=t.quoteStyle||e,n=Za[i];return n+l+n}function xc(l){return Gt.call(String(l),/"/g,""")}function hi(l){return!on||!(typeof l=="object"&&(on in l||typeof l[on]<"u"))}function fs(l){return Ut(l)==="[object Array]"&&hi(l)}function Rc(l){return Ut(l)==="[object Date]"&&hi(l)}function el(l){return Ut(l)==="[object RegExp]"&&hi(l)}function _c(l){return Ut(l)==="[object Error]"&&hi(l)}function Tc(l){return Ut(l)==="[object String]"&&hi(l)}function kc(l){return Ut(l)==="[object Number]"&&hi(l)}function Sc(l){return Ut(l)==="[object Boolean]"&&hi(l)}function tl(l){if(Si)return l&&typeof l=="object"&&l instanceof Symbol;if(typeof l=="symbol")return!0;if(!l||typeof l!="object"||!ds)return!1;try{return ds.call(l),!0}catch{}return!1}function Mc(l){if(!l||typeof l!="object"||!hs)return!1;try{return hs.call(l),!0}catch{}return!1}var Lc=Object.prototype.hasOwnProperty||function(l){return l in this};function St(l,e){return Lc.call(l,e)}function Ut(l){return bc.call(l)}function Dc(l){if(l.name)return l.name;var e=wc.call(vc.call(l),/^function\s*([\w$]+)/);return e?e[1]:null}function il(l,e){if(l.indexOf)return l.indexOf(e);for(var t=0,i=l.length;t<i;t++)if(l[t]===e)return t;return-1}function Ac(l){if(!Un||!l||typeof l!="object")return!1;try{Un.call(l);try{jn.call(l)}catch{return!0}return l instanceof Map}catch{}return!1}function Fc(l){if(!rn||!l||typeof l!="object")return!1;try{rn.call(l,rn);try{sn.call(l,sn)}catch{return!0}return l instanceof WeakMap}catch{}return!1}function zc(l){if(!Wa||!l||typeof l!="object")return!1;try{return Wa.call(l),!0}catch{}return!1}function Pc(l){if(!jn||!l||typeof l!="object")return!1;try{jn.call(l);try{Un.call(l)}catch{return!0}return l instanceof Set}catch{}return!1}function Oc(l){if(!sn||!l||typeof l!="object")return!1;try{sn.call(l,sn);try{rn.call(l,rn)}catch{return!0}return l instanceof WeakSet}catch{}return!1}function Hc(l){return!l||typeof l!="object"?!1:typeof HTMLElement<"u"&&l instanceof HTMLElement?!0:typeof l.nodeName=="string"&&typeof l.getAttribute=="function"}function nl(l,e){if(l.length>e.maxStringLength){var t=l.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return nl(ls.call(l,0,e.maxStringLength),e)+i}var n=Ec[e.quoteStyle||"single"];n.lastIndex=0;var s=Gt.call(Gt.call(l,n,"\\$1"),/[\x00-\x1f]/g,Bc);return Qa(s,"single",e)}function Bc(l){var e=l.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+yc.call(e.toString(16))}function an(l){return"Object("+l+")"}function ps(l){return l+" { ? }"}function rl(l,e,t,i){var n=i?gs(t,i):Et.call(t,", ");return l+" ("+e+") {"+n+"}"}function Nc(l){for(var e=0;e<l.length;e++)if(il(l[e],`
|
|
28
28
|
`)>=0)return!1;return!0}function Ic(l,e){var t;if(l.indent===" ")t=" ";else if(typeof l.indent=="number"&&l.indent>0)t=Et.call(Array(l.indent+1)," ");else return null;return{base:t,prev:Et.call(Array(e+1),t)}}function gs(l,e){if(l.length===0)return"";var t=`
|
|
29
29
|
`+e.prev+e.base;return t+Et.call(l,","+t)+`
|
|
30
|
-
`+e.prev}function qn(l,e){var t=fs(l),i=[];if(t){i.length=l.length;for(var n=0;n<l.length;n++)i[n]=St(l,n)?e(l[n],l):""}var s=typeof us=="function"?us(l):[],a;if(Si){a={};for(var u=0;u<s.length;u++)a["$"+s[u]]=s[u]}for(var d in l)St(l,d)&&(t&&String(Number(d))===d&&d<l.length||Si&&a["$"+d]instanceof Symbol||(Ga.call(/[^\w$]/,d)?i.push(e(d,l)+": "+e(l[d],l)):i.push(d+": "+e(l[d],l))));if(typeof us=="function")for(var p=0;p<s.length;p++)Ka.call(l,s[p])&&i.push("["+e(s[p])+"]: "+e(l[s[p]],l));return i}var Vc=Kn,Wc=ki,Xn=function(l,e,t){for(var i=l,n;(n=i.next)!=null;i=n)if(n.key===e)return i.next=n.next,t||(n.next=l.next,l.next=n),n},$c=function(l,e){if(l){var t=Xn(l,e);return t&&t.value}},Gc=function(l,e,t){var i=Xn(l,e);i?i.value=t:l.next={key:e,next:l.next,value:t}},Uc=function(l,e){return l?!!Xn(l,e):!1},jc=function(l,e){if(l)return Xn(l,e,!0)},Kc=function(){var e,t={assert:function(i){if(!t.has(i))throw new Wc("Side channel does not contain "+Vc(i))},delete:function(i){var n=e&&e.next,s=jc(e,i);return s&&n&&n===s&&(e=void 0),!!s},get:function(i){return $c(e,i)},has:function(i){return Uc(e,i)},set:function(i,n){e||(e={next:void 0}),Gc(e,i,n)}};return t},sl=Object,qc=Error,Xc=EvalError,Yc=RangeError,Jc=ReferenceError,Zc=SyntaxError,Qc=URIError,ef=Math.abs,tf=Math.floor,nf=Math.max,rf=Math.min,sf=Math.pow,of=Math.round,af=Number.isNaN||function(e){return e!==e},lf=af,hf=function(e){return lf(e)||e===0?e:e<0?-1:1},uf=Object.getOwnPropertyDescriptor,Yn=uf;if(Yn)try{Yn([],"length")}catch{Yn=null}var ol=Yn,Jn=Object.defineProperty||!1;if(Jn)try{Jn({},"a",{value:1})}catch{Jn=!1}var df=Jn,ms,al;function cf(){return al||(al=1,ms=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[t]=n;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(e,t);if(u.value!==n||u.enumerable!==!0)return!1}return!0}),ms}var bs,ll;function ff(){if(ll)return bs;ll=1;var l=typeof Symbol<"u"&&Symbol,e=cf();return bs=function(){return typeof l!="function"||typeof Symbol!="function"||typeof l("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},bs}var vs,hl;function ul(){return hl||(hl=1,vs=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),vs}var ws,dl;function cl(){if(dl)return ws;dl=1;var l=sl;return ws=l.getPrototypeOf||null,ws}var pf="Function.prototype.bind called on incompatible ",gf=Object.prototype.toString,mf=Math.max,bf="[object Function]",fl=function(e,t){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var s=0;s<t.length;s+=1)i[s+e.length]=t[s];return i},vf=function(e,t){for(var i=[],n=t||0,s=0;n<e.length;n+=1,s+=1)i[s]=e[n];return i},wf=function(l,e){for(var t="",i=0;i<l.length;i+=1)t+=l[i],i+1<l.length&&(t+=e);return t},yf=function(e){var t=this;if(typeof t!="function"||gf.apply(t)!==bf)throw new TypeError(pf+t);for(var i=vf(arguments,1),n,s=function(){if(this instanceof n){var g=t.apply(this,fl(i,arguments));return Object(g)===g?g:this}return t.apply(e,fl(i,arguments))},a=mf(0,t.length-i.length),u=[],d=0;d<a;d++)u[d]="$"+d;if(n=Function("binder","return function ("+wf(u,",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var p=function(){};p.prototype=t.prototype,n.prototype=new p,p.prototype=null}return n},Cf=yf,Zn=Function.prototype.bind||Cf,ys=Function.prototype.call,Cs,pl;function gl(){return pl||(pl=1,Cs=Function.prototype.apply),Cs}var Ef=typeof Reflect<"u"&&Reflect&&Reflect.apply,xf=Zn,Rf=gl(),_f=ys,Tf=Ef,kf=Tf||xf.call(_f,Rf),Sf=Zn,Mf=ki,Lf=ys,Df=kf,ml=function(e){if(e.length<1||typeof e[0]!="function")throw new Mf("a function is required");return Df(Sf,Lf,e)},Es,bl;function Af(){if(bl)return Es;bl=1;var l=ml,e=ol,t;try{t=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!!t&&e&&e(Object.prototype,"__proto__"),n=Object,s=n.getPrototypeOf;return Es=i&&typeof i.get=="function"?l([i.get]):typeof s=="function"?function(u){return s(u==null?u:n(u))}:!1,Es}var xs,vl;function Ff(){if(vl)return xs;vl=1;var l=ul(),e=cl(),t=Af();return xs=l?function(n){return l(n)}:e?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return e(n)}:t?function(n){return t(n)}:null,xs}var Rs,wl;function zf(){if(wl)return Rs;wl=1;var l=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=Zn;return Rs=t.call(l,e),Rs}var ne,Pf=sl,Of=qc,Hf=Xc,Bf=Yc,Nf=Jc,Mi=Zc,Li=ki,If=Qc,Vf=ef,Wf=tf,$f=nf,Gf=rf,Uf=sf,jf=of,Kf=hf,yl=Function,_s=function(l){try{return yl('"use strict"; return ('+l+").constructor;")()}catch{}},ln=ol,qf=df,Ts=function(){throw new Li},Xf=ln?function(){try{return arguments.callee,Ts}catch{try{return ln(arguments,"callee").get}catch{return Ts}}}():Ts,Di=ff()(),Ae=Ff(),Yf=cl(),Jf=ul(),Cl=gl(),hn=ys,Ai={},Zf=typeof Uint8Array>"u"||!Ae?ne:Ae(Uint8Array),ui={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ne:ArrayBuffer,"%ArrayIteratorPrototype%":Di&&Ae?Ae([][Symbol.iterator]()):ne,"%AsyncFromSyncIteratorPrototype%":ne,"%AsyncFunction%":Ai,"%AsyncGenerator%":Ai,"%AsyncGeneratorFunction%":Ai,"%AsyncIteratorPrototype%":Ai,"%Atomics%":typeof Atomics>"u"?ne:Atomics,"%BigInt%":typeof BigInt>"u"?ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Of,"%eval%":eval,"%EvalError%":Hf,"%Float16Array%":typeof Float16Array>"u"?ne:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ne:FinalizationRegistry,"%Function%":yl,"%GeneratorFunction%":Ai,"%Int8Array%":typeof Int8Array>"u"?ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Di&&Ae?Ae(Ae([][Symbol.iterator]())):ne,"%JSON%":typeof JSON=="object"?JSON:ne,"%Map%":typeof Map>"u"?ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Di||!Ae?ne:Ae(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Pf,"%Object.getOwnPropertyDescriptor%":ln,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":Bf,"%ReferenceError%":Nf,"%Reflect%":typeof Reflect>"u"?ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Di||!Ae?ne:Ae(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Di&&Ae?Ae(""[Symbol.iterator]()):ne,"%Symbol%":Di?Symbol:ne,"%SyntaxError%":Mi,"%ThrowTypeError%":Xf,"%TypedArray%":Zf,"%TypeError%":Li,"%Uint8Array%":typeof Uint8Array>"u"?ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ne:Uint32Array,"%URIError%":If,"%WeakMap%":typeof WeakMap>"u"?ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ne:WeakSet,"%Function.prototype.call%":hn,"%Function.prototype.apply%":Cl,"%Object.defineProperty%":qf,"%Object.getPrototypeOf%":Yf,"%Math.abs%":Vf,"%Math.floor%":Wf,"%Math.max%":$f,"%Math.min%":Gf,"%Math.pow%":Uf,"%Math.round%":jf,"%Math.sign%":Kf,"%Reflect.getPrototypeOf%":Jf};if(Ae)try{null.error}catch(l){var Qf=Ae(Ae(l));ui["%Error.prototype%"]=Qf}var ep=function l(e){var t;if(e==="%AsyncFunction%")t=_s("async function () {}");else if(e==="%GeneratorFunction%")t=_s("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=_s("async function* () {}");else if(e==="%AsyncGenerator%"){var i=l("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=l("%AsyncGenerator%");n&&Ae&&(t=Ae(n.prototype))}return ui[e]=t,t},El={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},un=Zn,Qn=zf(),tp=un.call(hn,Array.prototype.concat),ip=un.call(Cl,Array.prototype.splice),xl=un.call(hn,String.prototype.replace),er=un.call(hn,String.prototype.slice),np=un.call(hn,RegExp.prototype.exec),rp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sp=/\\(\\)?/g,op=function(e){var t=er(e,0,1),i=er(e,-1);if(t==="%"&&i!=="%")throw new Mi("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new Mi("invalid intrinsic syntax, expected opening `%`");var n=[];return xl(e,rp,function(s,a,u,d){n[n.length]=u?xl(d,sp,"$1"):a||s}),n},ap=function(e,t){var i=e,n;if(Qn(El,i)&&(n=El[i],i="%"+n[0]+"%"),Qn(ui,i)){var s=ui[i];if(s===Ai&&(s=ep(i)),typeof s>"u"&&!t)throw new Li("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new Mi("intrinsic "+e+" does not exist!")},ks=function(e,t){if(typeof e!="string"||e.length===0)throw new Li("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Li('"allowMissing" argument must be a boolean');if(np(/^%?[^%]*%?$/,e)===null)throw new Mi("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=op(e),n=i.length>0?i[0]:"",s=ap("%"+n+"%",t),a=s.name,u=s.value,d=!1,p=s.alias;p&&(n=p[0],ip(i,tp([0,1],p)));for(var g=1,w=!0;g<i.length;g+=1){var b=i[g],C=er(b,0,1),_=er(b,-1);if((C==='"'||C==="'"||C==="`"||_==='"'||_==="'"||_==="`")&&C!==_)throw new Mi("property names with quotes must have matching quotes");if((b==="constructor"||!w)&&(d=!0),n+="."+b,a="%"+n+"%",Qn(ui,a))u=ui[a];else if(u!=null){if(!(b in u)){if(!t)throw new Li("base intrinsic for "+e+" exists, but the property is not available.");return}if(ln&&g+1>=i.length){var S=ln(u,b);w=!!S,w&&"get"in S&&!("originalValue"in S.get)?u=S.get:u=u[b]}else w=Qn(u,b),u=u[b];w&&!d&&(ui[a]=u)}}return u},Rl=ks,_l=ml,lp=_l([Rl("%String.prototype.indexOf%")]),Tl=function(e,t){var i=Rl(e,!!t);return typeof i=="function"&&lp(e,".prototype.")>-1?_l([i]):i},hp=ks,dn=Tl,up=Kn,dp=ki,kl=hp("%Map%",!0),cp=dn("Map.prototype.get",!0),fp=dn("Map.prototype.set",!0),pp=dn("Map.prototype.has",!0),gp=dn("Map.prototype.delete",!0),mp=dn("Map.prototype.size",!0),Sl=!!kl&&function(){var e,t={assert:function(i){if(!t.has(i))throw new dp("Side channel does not contain "+up(i))},delete:function(i){if(e){var n=gp(e,i);return mp(e)===0&&(e=void 0),n}return!1},get:function(i){if(e)return cp(e,i)},has:function(i){return e?pp(e,i):!1},set:function(i,n){e||(e=new kl),fp(e,i,n)}};return t},bp=ks,tr=Tl,vp=Kn,ir=Sl,wp=ki,Fi=bp("%WeakMap%",!0),yp=tr("WeakMap.prototype.get",!0),Cp=tr("WeakMap.prototype.set",!0),Ep=tr("WeakMap.prototype.has",!0),xp=tr("WeakMap.prototype.delete",!0),Rp=Fi?function(){var e,t,i={assert:function(n){if(!i.has(n))throw new wp("Side channel does not contain "+vp(n))},delete:function(n){if(Fi&&n&&(typeof n=="object"||typeof n=="function")){if(e)return xp(e,n)}else if(ir&&t)return t.delete(n);return!1},get:function(n){return Fi&&n&&(typeof n=="object"||typeof n=="function")&&e?yp(e,n):t&&t.get(n)},has:function(n){return Fi&&n&&(typeof n=="object"||typeof n=="function")&&e?Ep(e,n):!!t&&t.has(n)},set:function(n,s){Fi&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new Fi),Cp(e,n,s)):ir&&(t||(t=ir()),t.set(n,s))}};return i}:ir,_p=ki,Tp=Kn,kp=Kc,Sp=Sl,Mp=Rp,Lp=Mp||Sp||kp,Dp=function(){var e,t={assert:function(i){if(!t.has(i))throw new _p("Side channel does not contain "+Tp(i))},delete:function(i){return!!e&&e.delete(i)},get:function(i){return e&&e.get(i)},has:function(i){return!!e&&e.has(i)},set:function(i,n){e||(e=Lp()),e.set(i,n)}};return t},Ap=String.prototype.replace,Fp=/%20/g,Ss={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ms={default:Ss.RFC3986,formatters:{RFC1738:function(l){return Ap.call(l,Fp,"+")},RFC3986:function(l){return String(l)}},RFC1738:Ss.RFC1738,RFC3986:Ss.RFC3986},zp=Ms,Ls=Object.prototype.hasOwnProperty,di=Array.isArray,xt=function(){for(var l=[],e=0;e<256;++e)l.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return l}(),Pp=function(e){for(;e.length>1;){var t=e.pop(),i=t.obj[t.prop];if(di(i)){for(var n=[],s=0;s<i.length;++s)typeof i[s]<"u"&&n.push(i[s]);t.obj[t.prop]=n}}},Ml=function(e,t){for(var i=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)typeof e[n]<"u"&&(i[n]=e[n]);return i},Op=function l(e,t,i){if(!t)return e;if(typeof t!="object"&&typeof t!="function"){if(di(e))e.push(t);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!Ls.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var n=e;return di(e)&&!di(t)&&(n=Ml(e,i)),di(e)&&di(t)?(t.forEach(function(s,a){if(Ls.call(e,a)){var u=e[a];u&&typeof u=="object"&&s&&typeof s=="object"?e[a]=l(u,s,i):e.push(s)}else e[a]=s}),e):Object.keys(t).reduce(function(s,a){var u=t[a];return Ls.call(s,a)?s[a]=l(s[a],u,i):s[a]=u,s},n)},Hp=function(e,t){return Object.keys(t).reduce(function(i,n){return i[n]=t[n],i},e)},Bp=function(l,e,t){var i=l.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},Ds=1024,Np=function(e,t,i,n,s){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(C){return"%26%23"+parseInt(C.slice(2),16)+"%3B"});for(var u="",d=0;d<a.length;d+=Ds){for(var p=a.length>=Ds?a.slice(d,d+Ds):a,g=[],w=0;w<p.length;++w){var b=p.charCodeAt(w);if(b===45||b===46||b===95||b===126||b>=48&&b<=57||b>=65&&b<=90||b>=97&&b<=122||s===zp.RFC1738&&(b===40||b===41)){g[g.length]=p.charAt(w);continue}if(b<128){g[g.length]=xt[b];continue}if(b<2048){g[g.length]=xt[192|b>>6]+xt[128|b&63];continue}if(b<55296||b>=57344){g[g.length]=xt[224|b>>12]+xt[128|b>>6&63]+xt[128|b&63];continue}w+=1,b=65536+((b&1023)<<10|p.charCodeAt(w)&1023),g[g.length]=xt[240|b>>18]+xt[128|b>>12&63]+xt[128|b>>6&63]+xt[128|b&63]}u+=g.join("")}return u},Ip=function(e){for(var t=[{obj:{o:e},prop:"o"}],i=[],n=0;n<t.length;++n)for(var s=t[n],a=s.obj[s.prop],u=Object.keys(a),d=0;d<u.length;++d){var p=u[d],g=a[p];typeof g=="object"&&g!==null&&i.indexOf(g)===-1&&(t.push({obj:a,prop:p}),i.push(g))}return Pp(t),e},Vp=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Wp=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},$p=function(e,t){return[].concat(e,t)},Gp=function(e,t){if(di(e)){for(var i=[],n=0;n<e.length;n+=1)i.push(t(e[n]));return i}return t(e)},Ll={arrayToObject:Ml,assign:Hp,combine:$p,compact:Ip,decode:Bp,encode:Np,isBuffer:Wp,isRegExp:Vp,maybeMap:Gp,merge:Op},Dl=Dp,nr=Ll,cn=Ms,Up=Object.prototype.hasOwnProperty,Al={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},Rt=Array.isArray,jp=Array.prototype.push,Fl=function(l,e){jp.apply(l,Rt(e)?e:[e])},Kp=Date.prototype.toISOString,zl=cn.default,Me={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:nr.encode,encodeValuesOnly:!1,filter:void 0,format:zl,formatter:cn.formatters[zl],indices:!1,serializeDate:function(e){return Kp.call(e)},skipNulls:!1,strictNullHandling:!1},qp=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},As={},Xp=function l(e,t,i,n,s,a,u,d,p,g,w,b,C,_,S,F,L,U){for(var H=e,N=U,O=0,oe=!1;(N=N.get(As))!==void 0&&!oe;){var V=N.get(e);if(O+=1,typeof V<"u"){if(V===O)throw new RangeError("Cyclic object value");oe=!0}typeof N.get(As)>"u"&&(O=0)}if(typeof g=="function"?H=g(t,H):H instanceof Date?H=C(H):i==="comma"&&Rt(H)&&(H=nr.maybeMap(H,function(Qe){return Qe instanceof Date?C(Qe):Qe})),H===null){if(a)return p&&!F?p(t,Me.encoder,L,"key",_):t;H=""}if(qp(H)||nr.isBuffer(H)){if(p){var W=F?t:p(t,Me.encoder,L,"key",_);return[S(W)+"="+S(p(H,Me.encoder,L,"value",_))]}return[S(t)+"="+S(String(H))]}var pe=[];if(typeof H>"u")return pe;var Y;if(i==="comma"&&Rt(H))F&&p&&(H=nr.maybeMap(H,p)),Y=[{value:H.length>0?H.join(",")||null:void 0}];else if(Rt(g))Y=g;else{var he=Object.keys(H);Y=w?he.sort(w):he}var j=d?String(t).replace(/\./g,"%2E"):String(t),xe=n&&Rt(H)&&H.length===1?j+"[]":j;if(s&&Rt(H)&&H.length===0)return xe+"[]";for(var Re=0;Re<Y.length;++Re){var Ve=Y[Re],gt=typeof Ve=="object"&&Ve&&typeof Ve.value<"u"?Ve.value:H[Ve];if(!(u&>===null)){var Be=b&&d?String(Ve).replace(/\./g,"%2E"):String(Ve),We=Rt(H)?typeof i=="function"?i(xe,Be):xe:xe+(b?"."+Be:"["+Be+"]");U.set(e,O);var At=Dl();At.set(As,U),Fl(pe,l(gt,We,i,n,s,a,u,d,i==="comma"&&F&&Rt(H)?null:p,g,w,b,C,_,S,F,L,At))}}return pe},Yp=function(e){if(!e)return Me;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||Me.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=cn.default;if(typeof e.format<"u"){if(!Up.call(cn.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var n=cn.formatters[i],s=Me.filter;(typeof e.filter=="function"||Rt(e.filter))&&(s=e.filter);var a;if(e.arrayFormat in Al?a=e.arrayFormat:"indices"in e?a=e.indices?"indices":"repeat":a=Me.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:Me.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Me.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Me.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Me.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?Me.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Me.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:Me.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:Me.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Me.encodeValuesOnly,filter:s,format:i,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Me.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Me.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Me.strictNullHandling}},Jp=function(l,e){var t=l,i=Yp(e),n,s;typeof i.filter=="function"?(s=i.filter,t=s("",t)):Rt(i.filter)&&(s=i.filter,n=s);var a=[];if(typeof t!="object"||t===null)return"";var u=Al[i.arrayFormat],d=u==="comma"&&i.commaRoundTrip;n||(n=Object.keys(t)),i.sort&&n.sort(i.sort);for(var p=Dl(),g=0;g<n.length;++g){var w=n[g],b=t[w];i.skipNulls&&b===null||Fl(a,Xp(b,w,u,d,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,p))}var C=a.join(i.delimiter),_=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),C.length>0?_+C:""},ci=Ll,Fs=Object.prototype.hasOwnProperty,Pl=Array.isArray,Ee={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ci.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},Zp=function(l){return l.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},Ol=function(l,e,t){if(l&&typeof l=="string"&&e.comma&&l.indexOf(",")>-1)return l.split(",");if(e.throwOnLimitExceeded&&t>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return l},Qp="utf8=%26%2310003%3B",eg="utf8=%E2%9C%93",tg=function(e,t){var i={__proto__:null},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=t.parameterLimit===1/0?void 0:t.parameterLimit,a=n.split(t.delimiter,t.throwOnLimitExceeded?s+1:s);if(t.throwOnLimitExceeded&&a.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var u=-1,d,p=t.charset;if(t.charsetSentinel)for(d=0;d<a.length;++d)a[d].indexOf("utf8=")===0&&(a[d]===eg?p="utf-8":a[d]===Qp&&(p="iso-8859-1"),u=d,d=a.length);for(d=0;d<a.length;++d)if(d!==u){var g=a[d],w=g.indexOf("]="),b=w===-1?g.indexOf("="):w+1,C,_;b===-1?(C=t.decoder(g,Ee.decoder,p,"key"),_=t.strictNullHandling?null:""):(C=t.decoder(g.slice(0,b),Ee.decoder,p,"key"),_=ci.maybeMap(Ol(g.slice(b+1),t,Pl(i[C])?i[C].length:0),function(F){return t.decoder(F,Ee.decoder,p,"value")})),_&&t.interpretNumericEntities&&p==="iso-8859-1"&&(_=Zp(String(_))),g.indexOf("[]=")>-1&&(_=Pl(_)?[_]:_);var S=Fs.call(i,C);S&&t.duplicates==="combine"?i[C]=ci.combine(i[C],_):(!S||t.duplicates==="last")&&(i[C]=_)}return i},ig=function(l,e,t,i){var n=0;if(l.length>0&&l[l.length-1]==="[]"){var s=l.slice(0,-1).join("");n=Array.isArray(e)&&e[s]?e[s].length:0}for(var a=i?e:Ol(e,t,n),u=l.length-1;u>=0;--u){var d,p=l[u];if(p==="[]"&&t.parseArrays)d=t.allowEmptyArrays&&(a===""||t.strictNullHandling&&a===null)?[]:ci.combine([],a);else{d=t.plainObjects?{__proto__:null}:{};var g=p.charAt(0)==="["&&p.charAt(p.length-1)==="]"?p.slice(1,-1):p,w=t.decodeDotInKeys?g.replace(/%2E/g,"."):g,b=parseInt(w,10);!t.parseArrays&&w===""?d={0:a}:!isNaN(b)&&p!==w&&String(b)===w&&b>=0&&t.parseArrays&&b<=t.arrayLimit?(d=[],d[b]=a):w!=="__proto__"&&(d[w]=a)}a=d}return a},ng=function(e,t,i,n){if(e){var s=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,d=i.depth>0&&a.exec(s),p=d?s.slice(0,d.index):s,g=[];if(p){if(!i.plainObjects&&Fs.call(Object.prototype,p)&&!i.allowPrototypes)return;g.push(p)}for(var w=0;i.depth>0&&(d=u.exec(s))!==null&&w<i.depth;){if(w+=1,!i.plainObjects&&Fs.call(Object.prototype,d[1].slice(1,-1))&&!i.allowPrototypes)return;g.push(d[1])}if(d){if(i.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+i.depth+" and strictDepth is true");g.push("["+s.slice(d.index)+"]")}return ig(g,t,i,n)}},rg=function(e){if(!e)return Ee;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=typeof e.charset>"u"?Ee.charset:e.charset,i=typeof e.duplicates>"u"?Ee.duplicates:e.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:Ee.allowDots:!!e.allowDots;return{allowDots:n,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Ee.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Ee.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Ee.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Ee.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ee.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Ee.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:Ee.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:Ee.decoder,delimiter:typeof e.delimiter=="string"||ci.isRegExp(e.delimiter)?e.delimiter:Ee.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Ee.depth,duplicates:i,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Ee.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Ee.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Ee.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:Ee.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ee.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},sg=function(l,e){var t=rg(e);if(l===""||l===null||typeof l>"u")return t.plainObjects?{__proto__:null}:{};for(var i=typeof l=="string"?tg(l,t):l,n=t.plainObjects?{__proto__:null}:{},s=Object.keys(i),a=0;a<s.length;++a){var u=s[a],d=ng(u,i[u],t,typeof l=="string");n=ci.merge(n,d,t)}return t.allowSparse===!0?n:ci.compact(n)},og=Jp,ag=sg,lg=Ms,hg={formats:lg,parse:ag,stringify:og};const ug=ac(hg),zs=l=>$.upperFirst($.camelCase(l));function dg(l){let e=[];function t(i){for(let n in i)typeof i[n]=="object"&&i[n]!==null&&(!["schema","columns"].includes(n)&&!$.has(i[n],"schema")&&!["group"].includes($.get(i[n],"type"))?($.has(i[n],"placeholder")||(i[n].placeholder=$.get(i[n],"title")),i[n].field=n,e.push(i[n])):t(i[n]))}return t(l),e}const cg=(l="myStore")=>$t.defineStore(l,{state:()=>({mainKey:"",form:{},items:{},query:"",routes:{},fields:[],options:[],filters:[],loadings:{},dialog:!1,structure:{},paginations:{},searchParam:"",isEditing:!1,panelName:!1,editItemId:!1,hiddenActions:[],isFiltering:!1,sorts:["id:desc"],selected:new Set([])}),getters:{getItems(e){return t=>$.get(e==null?void 0:e.items,t,[])},getPaginations(e){return t=>$.get(e==null?void 0:e.paginations,t,[])},mainItems(e){return $.get(e==null?void 0:e.items,e==null?void 0:e.mainKey,[])},mainPagination(e){return this.getPaginations(e==null?void 0:e.mainKey)},mainRoute(e){return $.get(e==null?void 0:e.routes,e==null?void 0:e.mainKey,"")},flatFields(e){let t=dg(e==null?void 0:e.fields);return t.unshift(c.reactive({title:"",type:"hidden",value:"_select_",field:"_select_",align:"center",headerSort:!1})),t},formFields(e){return e.fields},flatFieldsWithoutActions(){return this.flatFields.filter(e=>!["_actions_","_index_","_select_"].includes(e.field))},headers(){return Eg(this.flatFields)},headersWithoutActions(){return this.headers.filter(e=>!["_actions_","_index_","_select_"].includes(e.field))}},actions:{reset(){this.items={},this.loadings={},this.routes={},this.options=[],this.filters=[],this.paginations={},this.selected=new Set([])},setData(e,t){this.items[e]=t},addData(e){Array.isArray(this.items[this.mainKey])||(this.items[this.mainKey]=[]),this.items[this.mainKey]=[e,...this.items[this.mainKey]]},editData(e){const t=this.items[this.mainKey].findIndex(i=>i.id===e.id);t!==-1&&(this.items[this.mainKey][t]={_index_:this.items[this.mainKey][t]._index_,...e})},removeData(e){const t=this.items[this.mainKey].findIndex(i=>i.id===e);t!==-1&&this.items[this.mainKey].splice(t,1)},getModelKey(e){let t=typeof e=="string"?e.substr(e.lastIndexOf("/")+1):e.key;return this.mainKey=this.mainKey||zs(t),zs(t)},setPagination(e,t){t in this.paginations||(this.paginations[t]={total:0,currentPage:0,lastPage:0}),this.paginations[t].total=$.get(e,"total"),this.paginations[t].currentPage=$.get(e,"current_page"),this.paginations[t].lastPage=$.get(e,"last_page")},paginate(e){this.isFiltering?this.getWithFilter(e):this.loadItems(this.mainKey,e)},reloadData(){this.isFiltering?this.getWithFilter():this.loadItems()},convertToFilterForm(){var t,i,n;let e={};for(const s of this.filters)if((t=s==null?void 0:s.field)!=null&&t.field){if((i=s==null?void 0:s.field)!=null&&i.query){const a=(n=s==null?void 0:s.field)==null?void 0:n.query(s);e=$.merge(e,a);continue}e[s.field.field]={[s.op]:s.value}}return ug.stringify({filters:e,sort:this.sorts},{encodeValuesOnly:!0})},generateQuery(e=this.mainKey){let t=$.get(this.routes,e+".index","");const[i,n]=t.split("?");return i+"/export?"+(n?n+"&":"")+this.convertToFilterForm()},generateRoute(e=this.mainKey,t=!1){let i=$.get(this.routes,e+".index",""),n=i.indexOf("?")>-1?"&page=":"?page=";if(n+=t,this.searchParam&&(n+="&search="+this.searchParam),i=i+n+"&"+this.convertToFilterForm(),this.query){const s=i.includes("?")?"&":"?";i+=s+this.query}return i},async loadItems(e=this.mainKey,t=1){this.loadings[e]=!0,this.loadings.mainLoading=e===this.mainKey;const i=this.generateRoute(e,t);return ye.get(i).then(n=>{n=$.get(n,"data",{}),this.items[e]=$.get(n,"data"),this.setPagination(n,e)}).finally(()=>{this.loadings[e]=!1,this.loadings.mainLoading=!1})},async loadItems(e=this.mainKey,t=1){this.items[e]&&Array.isArray(this.items[e])&&(this.items[e].length=0),this.loadings[e]=!0,this.loadings.mainLoading=e===this.mainKey;const i=this.generateRoute(e,t);return ye.get(i).then(n=>{n=$.get(n,"data",{}),this.items[e]=$.get(n,"data"),this.setPagination(n,e)}).finally(()=>{this.loadings[e]=!1,this.loadings.mainLoading=!1})},customLoadItems(e,t=1,i=()=>({})){this.loadings[e]=!0,i(n=>{this.items[e]=n.data,this.setPagination(n,e)},()=>{},()=>{this.loadings[e]=!1},t)},getWithFilter(e=1,t=15){const i="http://192.168.190.10:9090/api/filter";return this.loadings.filter=!0,ye.post(`${i}?page=${e}`,{model:this.mainKey,itemPerPage:t,filters:this.filters}).then(n=>{n=$.get(n,"data",{}),this.items[this.mainKey]=n.data,this.setPagination(n,this.mainKey)}).finally(()=>{this.loadings.filter=!1})},addItem(e){this.loadings.mainLoading=!0;let t=$.get(this.routes,this.mainKey+".create",""),i=Vl(e,this.flatFields);return ye.post(t,i).then(async()=>{this.reloadData(),se.event("alert",{text:"با موفقیت ثبت شد",color:"green"}),se.event("handleDialogForm",!1)}).catch(n=>{se.event("alert",{text:$.get(n,"response.data.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})},editItem(e){let t=$.get(this.routes,this.mainKey+".update","");t=t.split("?")[0];let i=Vl(e,this.flatFields);return this.loadings.mainLoading=!0,ye.patch(t+"/"+this.editItemId,i).then(async()=>{this.reloadData(),se.event("alert",{text:"با موفقیت ویرایش شد",color:"green"}),se.event("handleDialogForm",!1)}).catch(n=>{se.event("alert",{text:$.get(n,"response.data.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})},remove(e){const t=Array.isArray(e)?e:[e];let i=$.get(this.routes,this.mainKey+".delete","");i=i.split("?")[0],this.loadings.mainLoading=!0,t.forEach(n=>{ye.delete(i+"/"+n).then(()=>{se.event("alert",{text:"با موفقیت حذف شد",color:"green"}),se.event("handleDeleteDialog",!1),this.removeData(e),this.reloadData()}).catch(s=>{se.event("alert",{text:$.get(s,"response.data.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})})}}}),fg=l=>cg(l)(),pg=["create","update","delete","show","print","importExcel","exportExcel","filter"],Ps=c.ref([]);function Os(){function l(t){Ps.value=pg.filter(i=>!t.includes(i))}function e(t){return Ps.value.includes(t)}return{can:e,setPermissions:l,permissions:Ps}}const gg=l=>({onChange:(...e)=>{const t=e[2].form$.el$(l);t&&"clear"in t&&t.clear(),t&&"updateItems"in t&&t.updateItems()}}),mg=(l={})=>({search:!0,clearOnSearch:!0,type:"select",delay:1e3,object:!0,filterResults:!1,native:!1,formatter:e=>$.get(e.getValue(),$.get(l,"labelProp")),...l}),bg=(l={})=>({search:!0,clearOnSearch:!0,type:"select",object:!0,native:!1,formatter:e=>$.get(e.getValue(),$.get(l,"labelProp"),e.getValue()),...l}),vg=(l={})=>({search:!0,clearOnSearch:!0,type:"multiselect",delay:1e3,object:!0,filterResults:!1,native:!1,formatter:e=>$.get(e.getValue(),$.get(l,"labelProp")),...l}),Hl=(l={})=>({search:!0,clearOnSearch:!0,type:"tags",delay:1e3,object:!0,filterResults:!1,hideSelected:!0,native:!1,formatter:e=>$.get(e.getValue(),$.get(l,"labelProp")),...l}),Bl=(l={})=>({type:"date",...l}),Nl={normalSelect:bg,multiSelect:vg,multiFile:(l={})=>({type:"multifile",label:l==null?void 0:l.title,placeholder:l==null?void 0:l.title,drop:!0,filename:"name",url:"http://192.168.190.69:9090/api/file/show",uploadTempEndpoint:"http://192.168.190.69:9090/api/file/upload",accept:[".jpg",".png",".gif",".docx",".txt",".zip",".rar"],sort:!0,clickable:!0,object:!0,storeFile:"hash",...l}),hasRel:gg,select:mg,group:(l,e={})=>({addClass:["bg-gray-100","p-4","rounded-lg",""],type:"group",label:l,schema:e}),tags:Hl,date:Bl};let Il={};function wg({form:l,fieldName:e,field:t}){const i=$.get(l,e),n=Array.isArray(i),s=$.has(t,"valueProp");if(!n)return!1;if(s){const a=i[0];return a&&typeof a=="object"&&!Array.isArray(a)}return!1}function Vl(l,e){let t={},i=!1;for(let n in l){let s=Cg(n,e);if(!s)continue;i=!0;let a=yg(s),u=n;const d=$.get(s,"valueProp",!1);if(d&&(u+="."+d),wg({form:l,fieldName:n,field:s})){t[a]=$.get(l,n).map((w,b)=>$.get(w,d));continue}const g=$.get(l,u,$.get(l,n));t[a]=g}return i?t:l}function yg(l){return"sendKey"in l?l.sendKey:l.field}function Cg(l,e){return e.find(t=>t.field==l)}function Eg(l){let e=l.filter(s=>s.isHeader&&s.field!=="_actions_");const t=l.find(s=>s.field==="_actions_");let i={title:"",value:"_actions_",field:"_actions_",type:"text",align:"left",headerSort:!1,hozAlign:"left",headerHozAlign:"left"};t&&(i={...i,...t}),e.push(i);let n=0;return l.find(s=>s.field==="_select_"&&s.isHeader)&&(n=1),e.splice(n,0,{title:"#",type:"text",value:"_index_",field:"_index_",maxWidth:"100px",align:"center",headerSort:!1}),e}function xg(l){for(const e of l)"init"in e&&e.init()}const Rg=l=>{const e=$.get(Il,l);return e?c.markRaw(e):""},_g=l=>({url:e,key:t,foreignKey:i,dataKey:n,change:s}={url:!1,key:!1,foreignKey:!1,dataKey:!1,change:a=>a})=>async(...a)=>{let u=a[0],d=e;if(i&&n){d+=d.includes("?")?"&":"?";const C=i.split(".");let _="filters";for(const S of C)_+=`[${S.replace("|",".")}]`;d+=`${_}[$eq]={${n}}`}!t&&typeof d=="string"&&(t=(C=>{const _=C.lastIndexOf("/");let S;return C.includes("?")?S=C.substring(_+1,C.indexOf("?")):S=C.substring(_+1),zs(S)})(d)),(d.match(/\{(.*?)\}/g)||[]).forEach(C=>{const _=C.replace(/[{}]/g,"");d=d.replace(C,$.get(l.form,_,""))});const w=d.includes("?")?"&":"?";u=typeof u=="string"?u:"";const b=await ye.get(d+w+"search="+u);return s||(s=C=>C),s($.get(b,"data.data",[]))},Tg=(l,e)=>l({getRegisterField:Rg,axios:ye,get:_g(e),getSafe:$.get,useFields:Nl}),Wl=l=>{Il=l};function kg({fields:l,hiddenActions:e,options:t,route:i,structure:n,query:s}){const{setPermissions:a}=Os(),u=fg("Store-"+parseInt(Math.random()*1e7));u.query=s||"",u.fields=Tg(l,u),se.event("beforeFormueInit");const d=u.getModelKey(i),p={create:typeof i=="string"?i:i.create,update:typeof i=="string"?i:i.update,delete:typeof i=="string"?i:i.delete,index:typeof i=="string"?i:i.index};return u.routes[d]=p,u.loadItems(),u.options=t,a(e),u.structure=n,xg(u.flatFields),u}const Sg={install(l,{fields:e={},axiosConfig:t={},dir:i="rtl",emitter:n}={}){hc(t);const s=Ti();s.dir=i,n&&Na(n),l.config.globalProperties.$fcTr=a=>s.translate(a),Wl(e)}};class ze{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class ge{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var n=e?t.split(e):[t],s=n.length,a;for(let u=0;u<s&&(i=i[n[u]],a=i,!!i);u++);return a}static deepClone(e,t,i=[]){var n={}.__proto__,s=[].__proto__;t||(t=Object.assign(Array.isArray(e)?[]:{},e));for(var a in e){let u=e[a],d,p;u!=null&&typeof u=="object"&&(u.__proto__===n||u.__proto__===s)&&(d=i.findIndex(g=>g.subject===u),d>-1?t[a]=i[d].copy:(p=Object.assign(Array.isArray(u)?[]:{},u),i.unshift({subject:u,copy:p}),t[a]=this.deepClone(u,p,i)))}return t}}let Mg=class oc extends ze{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,n=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let s=ge.elOffset(this.container);i-=s.left,n-=s.top}return{x:i,y:n}}elementPositionCoords(e,t="right"){var i=ge.elOffset(e),n,s,a;switch(this.container!==document.body&&(n=ge.elOffset(this.container),i.left-=n.left,i.top-=n.top),t){case"right":s=i.left+e.offsetWidth,a=i.top-1;break;case"bottom":s=i.left,a=i.top+e.offsetHeight;break;case"left":s=i.left,a=i.top-1;break;case"top":s=i.left,a=i.top;break;case"center":s=i.left+e.offsetWidth/2,a=i.top+e.offsetHeight/2;break}return{x:s,y:a,offset:i}}show(e,t){var i,n,s,a,u;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(s=e,u=this.elementPositionCoords(e,t),a=u.offset,i=u.x,n=u.y):typeof e=="number"?(a={top:0,left:0},i=e,n=t):(u=this.containerEventCoords(e),i=u.x,n=u.y,this.reversedX=!1),this.element.style.top=n+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,n,s,a,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",d=>{d.stopPropagation()}),this)}_fitToScreen(e,t,i,n,s){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-n.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0);let u=Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0);if(t+this.element.offsetHeight>u)if(i)switch(s){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.height=u+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new oc(this.table,e,this),this.childPopup}};class ee extends ze{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(n=>n.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new Mg(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var Lg={rownum:function(l,e,t,i,n,s){return s.getPosition()}};const Pi=class Pi extends ee{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(n=>{var s="accessor"+(n.charAt(0).toUpperCase()+n.slice(1)),a;e.definition[s]&&(a=this.lookupAccessor(e.definition[s]),a&&(t=!0,i[s]={accessor:a,params:e.definition[s+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":Pi.accessors[e]?t=Pi.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=e.getComponent(),s=ge.deepClone(e.data||{});return this.table.columnManager.traverse(function(a){var u,d,p,g;a.modules.accessor&&(d=a.modules.accessor[i]||a.modules.accessor.accessor||!1,d&&(u=a.getFieldValue(s),u!="undefined"&&(g=a.getComponent(),p=typeof d.params=="function"?d.params(u,s,t,g,n):d.params,a.setFieldValue(s,d.accessor(u,s,t,p,g,n)))))}),s}};P(Pi,"moduleName","accessor"),P(Pi,"accessors",Lg);let Hs=Pi;var Dg={method:"GET"};function Bs(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((n,s)=>{t=t.concat(Bs(n,e?e+"["+s+"]":s))});else if(typeof l=="object")for(var i in l)t=t.concat(Bs(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}function Ag(l){var e=Bs(l),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function $l(l,e,t){return l&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",l+=(l.includes("?")?"&":"?")+Ag(t)),l}function Fg(l,e,t){var i;return new Promise((n,s)=>{if(l=this.urlGenerator.call(this.table,l,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var a in i.headers)e.headers||(e.headers={}),typeof e.headers[a]>"u"&&(e.headers[a]=i.headers[a]);e.body=i.body.call(this,l,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);l?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(l,e).then(u=>{u.ok?u.json().then(d=>{n(d)}).catch(d=>{s(d),console.warn("Ajax Load Error - Invalid JSON returned",d)}):(console.error("Ajax Load Error - Connection Error: "+u.status,u.statusText),s(u))}).catch(u=>{console.error("Ajax Load Error - Connection Error: ",u),s(u)})):(console.warn("Ajax Load Error - No URL Set"),n([]))})}function Ns(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((n,s)=>{t=t.concat(Ns(n,e?e+"["+s+"]":s))});else if(typeof l=="object")for(var i in l)t=t.concat(Ns(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}var zg={json:{headers:{"Content-Type":"application/json"},body:function(l,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(l,e,t){var i=Ns(t),n=new FormData;return i.forEach(function(s){n.append(s.key,s.value)}),n}}};const pt=class pt extends ee{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=pt.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||pt.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||pt.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,n){var s=this.table.options.ajaxParams;return s&&(typeof s=="function"&&(s=s.call(this.table)),n=Object.assign(Object.assign({},s),n)),n}requestDataCheck(e,t,i,n){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,n,s){var a;return!s&&this.requestDataCheck(e)?(e&&this.setUrl(e),a=this.generateConfig(i),this.sendRequest(this.url,t,a)):s}setDefaultConfig(e={}){this.config=Object.assign({},pt.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(n=>(this.table.options.ajaxResponse&&(n=this.table.options.ajaxResponse.call(this.table,e,t,n)),n)):Promise.reject()}};P(pt,"moduleName","ajax"),P(pt,"defaultConfig",Dg),P(pt,"defaultURLGenerator",$l),P(pt,"defaultLoaderPromise",Fg),P(pt,"contentTypeFormatters",zg);let Is=pt;var Pg={replace:function(l){return this.table.setData(l)},update:function(l){return this.table.updateOrAddData(l)},insert:function(l){return this.table.addData(l)}},Og={table:function(l){var e=[],t=!0,i=this.table.columnManager.columns,n=[],s=[];return l=l.split(`
|
|
30
|
+
`+e.prev}function qn(l,e){var t=fs(l),i=[];if(t){i.length=l.length;for(var n=0;n<l.length;n++)i[n]=St(l,n)?e(l[n],l):""}var s=typeof us=="function"?us(l):[],a;if(Si){a={};for(var u=0;u<s.length;u++)a["$"+s[u]]=s[u]}for(var d in l)St(l,d)&&(t&&String(Number(d))===d&&d<l.length||Si&&a["$"+d]instanceof Symbol||(Ga.call(/[^\w$]/,d)?i.push(e(d,l)+": "+e(l[d],l)):i.push(d+": "+e(l[d],l))));if(typeof us=="function")for(var p=0;p<s.length;p++)Ka.call(l,s[p])&&i.push("["+e(s[p])+"]: "+e(l[s[p]],l));return i}var Vc=Kn,Wc=ki,Xn=function(l,e,t){for(var i=l,n;(n=i.next)!=null;i=n)if(n.key===e)return i.next=n.next,t||(n.next=l.next,l.next=n),n},$c=function(l,e){if(l){var t=Xn(l,e);return t&&t.value}},Gc=function(l,e,t){var i=Xn(l,e);i?i.value=t:l.next={key:e,next:l.next,value:t}},Uc=function(l,e){return l?!!Xn(l,e):!1},jc=function(l,e){if(l)return Xn(l,e,!0)},Kc=function(){var e,t={assert:function(i){if(!t.has(i))throw new Wc("Side channel does not contain "+Vc(i))},delete:function(i){var n=e&&e.next,s=jc(e,i);return s&&n&&n===s&&(e=void 0),!!s},get:function(i){return $c(e,i)},has:function(i){return Uc(e,i)},set:function(i,n){e||(e={next:void 0}),Gc(e,i,n)}};return t},sl=Object,qc=Error,Xc=EvalError,Yc=RangeError,Jc=ReferenceError,Zc=SyntaxError,Qc=URIError,ef=Math.abs,tf=Math.floor,nf=Math.max,rf=Math.min,sf=Math.pow,of=Math.round,af=Number.isNaN||function(e){return e!==e},lf=af,hf=function(e){return lf(e)||e===0?e:e<0?-1:1},uf=Object.getOwnPropertyDescriptor,Yn=uf;if(Yn)try{Yn([],"length")}catch{Yn=null}var ol=Yn,Jn=Object.defineProperty||!1;if(Jn)try{Jn({},"a",{value:1})}catch{Jn=!1}var df=Jn,ms,al;function cf(){return al||(al=1,ms=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[t]=n;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(e,t);if(u.value!==n||u.enumerable!==!0)return!1}return!0}),ms}var bs,ll;function ff(){if(ll)return bs;ll=1;var l=typeof Symbol<"u"&&Symbol,e=cf();return bs=function(){return typeof l!="function"||typeof Symbol!="function"||typeof l("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},bs}var vs,hl;function ul(){return hl||(hl=1,vs=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),vs}var ws,dl;function cl(){if(dl)return ws;dl=1;var l=sl;return ws=l.getPrototypeOf||null,ws}var pf="Function.prototype.bind called on incompatible ",gf=Object.prototype.toString,mf=Math.max,bf="[object Function]",fl=function(e,t){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var s=0;s<t.length;s+=1)i[s+e.length]=t[s];return i},vf=function(e,t){for(var i=[],n=t||0,s=0;n<e.length;n+=1,s+=1)i[s]=e[n];return i},wf=function(l,e){for(var t="",i=0;i<l.length;i+=1)t+=l[i],i+1<l.length&&(t+=e);return t},yf=function(e){var t=this;if(typeof t!="function"||gf.apply(t)!==bf)throw new TypeError(pf+t);for(var i=vf(arguments,1),n,s=function(){if(this instanceof n){var g=t.apply(this,fl(i,arguments));return Object(g)===g?g:this}return t.apply(e,fl(i,arguments))},a=mf(0,t.length-i.length),u=[],d=0;d<a;d++)u[d]="$"+d;if(n=Function("binder","return function ("+wf(u,",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var p=function(){};p.prototype=t.prototype,n.prototype=new p,p.prototype=null}return n},Cf=yf,Zn=Function.prototype.bind||Cf,ys=Function.prototype.call,Cs,pl;function gl(){return pl||(pl=1,Cs=Function.prototype.apply),Cs}var Ef=typeof Reflect<"u"&&Reflect&&Reflect.apply,xf=Zn,Rf=gl(),_f=ys,Tf=Ef,kf=Tf||xf.call(_f,Rf),Sf=Zn,Mf=ki,Lf=ys,Df=kf,ml=function(e){if(e.length<1||typeof e[0]!="function")throw new Mf("a function is required");return Df(Sf,Lf,e)},Es,bl;function Af(){if(bl)return Es;bl=1;var l=ml,e=ol,t;try{t=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!!t&&e&&e(Object.prototype,"__proto__"),n=Object,s=n.getPrototypeOf;return Es=i&&typeof i.get=="function"?l([i.get]):typeof s=="function"?function(u){return s(u==null?u:n(u))}:!1,Es}var xs,vl;function Ff(){if(vl)return xs;vl=1;var l=ul(),e=cl(),t=Af();return xs=l?function(n){return l(n)}:e?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return e(n)}:t?function(n){return t(n)}:null,xs}var Rs,wl;function zf(){if(wl)return Rs;wl=1;var l=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=Zn;return Rs=t.call(l,e),Rs}var ne,Pf=sl,Of=qc,Hf=Xc,Bf=Yc,Nf=Jc,Mi=Zc,Li=ki,If=Qc,Vf=ef,Wf=tf,$f=nf,Gf=rf,Uf=sf,jf=of,Kf=hf,yl=Function,_s=function(l){try{return yl('"use strict"; return ('+l+").constructor;")()}catch{}},ln=ol,qf=df,Ts=function(){throw new Li},Xf=ln?function(){try{return arguments.callee,Ts}catch{try{return ln(arguments,"callee").get}catch{return Ts}}}():Ts,Di=ff()(),Ae=Ff(),Yf=cl(),Jf=ul(),Cl=gl(),hn=ys,Ai={},Zf=typeof Uint8Array>"u"||!Ae?ne:Ae(Uint8Array),ui={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ne:ArrayBuffer,"%ArrayIteratorPrototype%":Di&&Ae?Ae([][Symbol.iterator]()):ne,"%AsyncFromSyncIteratorPrototype%":ne,"%AsyncFunction%":Ai,"%AsyncGenerator%":Ai,"%AsyncGeneratorFunction%":Ai,"%AsyncIteratorPrototype%":Ai,"%Atomics%":typeof Atomics>"u"?ne:Atomics,"%BigInt%":typeof BigInt>"u"?ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Of,"%eval%":eval,"%EvalError%":Hf,"%Float16Array%":typeof Float16Array>"u"?ne:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ne:FinalizationRegistry,"%Function%":yl,"%GeneratorFunction%":Ai,"%Int8Array%":typeof Int8Array>"u"?ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Di&&Ae?Ae(Ae([][Symbol.iterator]())):ne,"%JSON%":typeof JSON=="object"?JSON:ne,"%Map%":typeof Map>"u"?ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Di||!Ae?ne:Ae(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Pf,"%Object.getOwnPropertyDescriptor%":ln,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":Bf,"%ReferenceError%":Nf,"%Reflect%":typeof Reflect>"u"?ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Di||!Ae?ne:Ae(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Di&&Ae?Ae(""[Symbol.iterator]()):ne,"%Symbol%":Di?Symbol:ne,"%SyntaxError%":Mi,"%ThrowTypeError%":Xf,"%TypedArray%":Zf,"%TypeError%":Li,"%Uint8Array%":typeof Uint8Array>"u"?ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ne:Uint32Array,"%URIError%":If,"%WeakMap%":typeof WeakMap>"u"?ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ne:WeakSet,"%Function.prototype.call%":hn,"%Function.prototype.apply%":Cl,"%Object.defineProperty%":qf,"%Object.getPrototypeOf%":Yf,"%Math.abs%":Vf,"%Math.floor%":Wf,"%Math.max%":$f,"%Math.min%":Gf,"%Math.pow%":Uf,"%Math.round%":jf,"%Math.sign%":Kf,"%Reflect.getPrototypeOf%":Jf};if(Ae)try{null.error}catch(l){var Qf=Ae(Ae(l));ui["%Error.prototype%"]=Qf}var ep=function l(e){var t;if(e==="%AsyncFunction%")t=_s("async function () {}");else if(e==="%GeneratorFunction%")t=_s("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=_s("async function* () {}");else if(e==="%AsyncGenerator%"){var i=l("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=l("%AsyncGenerator%");n&&Ae&&(t=Ae(n.prototype))}return ui[e]=t,t},El={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},un=Zn,Qn=zf(),tp=un.call(hn,Array.prototype.concat),ip=un.call(Cl,Array.prototype.splice),xl=un.call(hn,String.prototype.replace),er=un.call(hn,String.prototype.slice),np=un.call(hn,RegExp.prototype.exec),rp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sp=/\\(\\)?/g,op=function(e){var t=er(e,0,1),i=er(e,-1);if(t==="%"&&i!=="%")throw new Mi("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new Mi("invalid intrinsic syntax, expected opening `%`");var n=[];return xl(e,rp,function(s,a,u,d){n[n.length]=u?xl(d,sp,"$1"):a||s}),n},ap=function(e,t){var i=e,n;if(Qn(El,i)&&(n=El[i],i="%"+n[0]+"%"),Qn(ui,i)){var s=ui[i];if(s===Ai&&(s=ep(i)),typeof s>"u"&&!t)throw new Li("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new Mi("intrinsic "+e+" does not exist!")},ks=function(e,t){if(typeof e!="string"||e.length===0)throw new Li("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Li('"allowMissing" argument must be a boolean');if(np(/^%?[^%]*%?$/,e)===null)throw new Mi("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=op(e),n=i.length>0?i[0]:"",s=ap("%"+n+"%",t),a=s.name,u=s.value,d=!1,p=s.alias;p&&(n=p[0],ip(i,tp([0,1],p)));for(var g=1,w=!0;g<i.length;g+=1){var b=i[g],C=er(b,0,1),_=er(b,-1);if((C==='"'||C==="'"||C==="`"||_==='"'||_==="'"||_==="`")&&C!==_)throw new Mi("property names with quotes must have matching quotes");if((b==="constructor"||!w)&&(d=!0),n+="."+b,a="%"+n+"%",Qn(ui,a))u=ui[a];else if(u!=null){if(!(b in u)){if(!t)throw new Li("base intrinsic for "+e+" exists, but the property is not available.");return}if(ln&&g+1>=i.length){var S=ln(u,b);w=!!S,w&&"get"in S&&!("originalValue"in S.get)?u=S.get:u=u[b]}else w=Qn(u,b),u=u[b];w&&!d&&(ui[a]=u)}}return u},Rl=ks,_l=ml,lp=_l([Rl("%String.prototype.indexOf%")]),Tl=function(e,t){var i=Rl(e,!!t);return typeof i=="function"&&lp(e,".prototype.")>-1?_l([i]):i},hp=ks,dn=Tl,up=Kn,dp=ki,kl=hp("%Map%",!0),cp=dn("Map.prototype.get",!0),fp=dn("Map.prototype.set",!0),pp=dn("Map.prototype.has",!0),gp=dn("Map.prototype.delete",!0),mp=dn("Map.prototype.size",!0),Sl=!!kl&&function(){var e,t={assert:function(i){if(!t.has(i))throw new dp("Side channel does not contain "+up(i))},delete:function(i){if(e){var n=gp(e,i);return mp(e)===0&&(e=void 0),n}return!1},get:function(i){if(e)return cp(e,i)},has:function(i){return e?pp(e,i):!1},set:function(i,n){e||(e=new kl),fp(e,i,n)}};return t},bp=ks,tr=Tl,vp=Kn,ir=Sl,wp=ki,Fi=bp("%WeakMap%",!0),yp=tr("WeakMap.prototype.get",!0),Cp=tr("WeakMap.prototype.set",!0),Ep=tr("WeakMap.prototype.has",!0),xp=tr("WeakMap.prototype.delete",!0),Rp=Fi?function(){var e,t,i={assert:function(n){if(!i.has(n))throw new wp("Side channel does not contain "+vp(n))},delete:function(n){if(Fi&&n&&(typeof n=="object"||typeof n=="function")){if(e)return xp(e,n)}else if(ir&&t)return t.delete(n);return!1},get:function(n){return Fi&&n&&(typeof n=="object"||typeof n=="function")&&e?yp(e,n):t&&t.get(n)},has:function(n){return Fi&&n&&(typeof n=="object"||typeof n=="function")&&e?Ep(e,n):!!t&&t.has(n)},set:function(n,s){Fi&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new Fi),Cp(e,n,s)):ir&&(t||(t=ir()),t.set(n,s))}};return i}:ir,_p=ki,Tp=Kn,kp=Kc,Sp=Sl,Mp=Rp,Lp=Mp||Sp||kp,Dp=function(){var e,t={assert:function(i){if(!t.has(i))throw new _p("Side channel does not contain "+Tp(i))},delete:function(i){return!!e&&e.delete(i)},get:function(i){return e&&e.get(i)},has:function(i){return!!e&&e.has(i)},set:function(i,n){e||(e=Lp()),e.set(i,n)}};return t},Ap=String.prototype.replace,Fp=/%20/g,Ss={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ms={default:Ss.RFC3986,formatters:{RFC1738:function(l){return Ap.call(l,Fp,"+")},RFC3986:function(l){return String(l)}},RFC1738:Ss.RFC1738,RFC3986:Ss.RFC3986},zp=Ms,Ls=Object.prototype.hasOwnProperty,di=Array.isArray,xt=function(){for(var l=[],e=0;e<256;++e)l.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return l}(),Pp=function(e){for(;e.length>1;){var t=e.pop(),i=t.obj[t.prop];if(di(i)){for(var n=[],s=0;s<i.length;++s)typeof i[s]<"u"&&n.push(i[s]);t.obj[t.prop]=n}}},Ml=function(e,t){for(var i=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)typeof e[n]<"u"&&(i[n]=e[n]);return i},Op=function l(e,t,i){if(!t)return e;if(typeof t!="object"&&typeof t!="function"){if(di(e))e.push(t);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!Ls.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var n=e;return di(e)&&!di(t)&&(n=Ml(e,i)),di(e)&&di(t)?(t.forEach(function(s,a){if(Ls.call(e,a)){var u=e[a];u&&typeof u=="object"&&s&&typeof s=="object"?e[a]=l(u,s,i):e.push(s)}else e[a]=s}),e):Object.keys(t).reduce(function(s,a){var u=t[a];return Ls.call(s,a)?s[a]=l(s[a],u,i):s[a]=u,s},n)},Hp=function(e,t){return Object.keys(t).reduce(function(i,n){return i[n]=t[n],i},e)},Bp=function(l,e,t){var i=l.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},Ds=1024,Np=function(e,t,i,n,s){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(C){return"%26%23"+parseInt(C.slice(2),16)+"%3B"});for(var u="",d=0;d<a.length;d+=Ds){for(var p=a.length>=Ds?a.slice(d,d+Ds):a,g=[],w=0;w<p.length;++w){var b=p.charCodeAt(w);if(b===45||b===46||b===95||b===126||b>=48&&b<=57||b>=65&&b<=90||b>=97&&b<=122||s===zp.RFC1738&&(b===40||b===41)){g[g.length]=p.charAt(w);continue}if(b<128){g[g.length]=xt[b];continue}if(b<2048){g[g.length]=xt[192|b>>6]+xt[128|b&63];continue}if(b<55296||b>=57344){g[g.length]=xt[224|b>>12]+xt[128|b>>6&63]+xt[128|b&63];continue}w+=1,b=65536+((b&1023)<<10|p.charCodeAt(w)&1023),g[g.length]=xt[240|b>>18]+xt[128|b>>12&63]+xt[128|b>>6&63]+xt[128|b&63]}u+=g.join("")}return u},Ip=function(e){for(var t=[{obj:{o:e},prop:"o"}],i=[],n=0;n<t.length;++n)for(var s=t[n],a=s.obj[s.prop],u=Object.keys(a),d=0;d<u.length;++d){var p=u[d],g=a[p];typeof g=="object"&&g!==null&&i.indexOf(g)===-1&&(t.push({obj:a,prop:p}),i.push(g))}return Pp(t),e},Vp=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Wp=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},$p=function(e,t){return[].concat(e,t)},Gp=function(e,t){if(di(e)){for(var i=[],n=0;n<e.length;n+=1)i.push(t(e[n]));return i}return t(e)},Ll={arrayToObject:Ml,assign:Hp,combine:$p,compact:Ip,decode:Bp,encode:Np,isBuffer:Wp,isRegExp:Vp,maybeMap:Gp,merge:Op},Dl=Dp,nr=Ll,cn=Ms,Up=Object.prototype.hasOwnProperty,Al={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},Rt=Array.isArray,jp=Array.prototype.push,Fl=function(l,e){jp.apply(l,Rt(e)?e:[e])},Kp=Date.prototype.toISOString,zl=cn.default,Me={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:nr.encode,encodeValuesOnly:!1,filter:void 0,format:zl,formatter:cn.formatters[zl],indices:!1,serializeDate:function(e){return Kp.call(e)},skipNulls:!1,strictNullHandling:!1},qp=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},As={},Xp=function l(e,t,i,n,s,a,u,d,p,g,w,b,C,_,S,F,L,U){for(var H=e,N=U,O=0,oe=!1;(N=N.get(As))!==void 0&&!oe;){var V=N.get(e);if(O+=1,typeof V<"u"){if(V===O)throw new RangeError("Cyclic object value");oe=!0}typeof N.get(As)>"u"&&(O=0)}if(typeof g=="function"?H=g(t,H):H instanceof Date?H=C(H):i==="comma"&&Rt(H)&&(H=nr.maybeMap(H,function(Qe){return Qe instanceof Date?C(Qe):Qe})),H===null){if(a)return p&&!F?p(t,Me.encoder,L,"key",_):t;H=""}if(qp(H)||nr.isBuffer(H)){if(p){var W=F?t:p(t,Me.encoder,L,"key",_);return[S(W)+"="+S(p(H,Me.encoder,L,"value",_))]}return[S(t)+"="+S(String(H))]}var pe=[];if(typeof H>"u")return pe;var Y;if(i==="comma"&&Rt(H))F&&p&&(H=nr.maybeMap(H,p)),Y=[{value:H.length>0?H.join(",")||null:void 0}];else if(Rt(g))Y=g;else{var he=Object.keys(H);Y=w?he.sort(w):he}var j=d?String(t).replace(/\./g,"%2E"):String(t),xe=n&&Rt(H)&&H.length===1?j+"[]":j;if(s&&Rt(H)&&H.length===0)return xe+"[]";for(var Re=0;Re<Y.length;++Re){var Ve=Y[Re],gt=typeof Ve=="object"&&Ve&&typeof Ve.value<"u"?Ve.value:H[Ve];if(!(u&>===null)){var Be=b&&d?String(Ve).replace(/\./g,"%2E"):String(Ve),We=Rt(H)?typeof i=="function"?i(xe,Be):xe:xe+(b?"."+Be:"["+Be+"]");U.set(e,O);var At=Dl();At.set(As,U),Fl(pe,l(gt,We,i,n,s,a,u,d,i==="comma"&&F&&Rt(H)?null:p,g,w,b,C,_,S,F,L,At))}}return pe},Yp=function(e){if(!e)return Me;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||Me.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=cn.default;if(typeof e.format<"u"){if(!Up.call(cn.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var n=cn.formatters[i],s=Me.filter;(typeof e.filter=="function"||Rt(e.filter))&&(s=e.filter);var a;if(e.arrayFormat in Al?a=e.arrayFormat:"indices"in e?a=e.indices?"indices":"repeat":a=Me.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:Me.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Me.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Me.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Me.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?Me.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Me.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:Me.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:Me.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Me.encodeValuesOnly,filter:s,format:i,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Me.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Me.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Me.strictNullHandling}},Jp=function(l,e){var t=l,i=Yp(e),n,s;typeof i.filter=="function"?(s=i.filter,t=s("",t)):Rt(i.filter)&&(s=i.filter,n=s);var a=[];if(typeof t!="object"||t===null)return"";var u=Al[i.arrayFormat],d=u==="comma"&&i.commaRoundTrip;n||(n=Object.keys(t)),i.sort&&n.sort(i.sort);for(var p=Dl(),g=0;g<n.length;++g){var w=n[g],b=t[w];i.skipNulls&&b===null||Fl(a,Xp(b,w,u,d,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,p))}var C=a.join(i.delimiter),_=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),C.length>0?_+C:""},ci=Ll,Fs=Object.prototype.hasOwnProperty,Pl=Array.isArray,Ee={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ci.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},Zp=function(l){return l.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},Ol=function(l,e,t){if(l&&typeof l=="string"&&e.comma&&l.indexOf(",")>-1)return l.split(",");if(e.throwOnLimitExceeded&&t>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return l},Qp="utf8=%26%2310003%3B",eg="utf8=%E2%9C%93",tg=function(e,t){var i={__proto__:null},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=t.parameterLimit===1/0?void 0:t.parameterLimit,a=n.split(t.delimiter,t.throwOnLimitExceeded?s+1:s);if(t.throwOnLimitExceeded&&a.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var u=-1,d,p=t.charset;if(t.charsetSentinel)for(d=0;d<a.length;++d)a[d].indexOf("utf8=")===0&&(a[d]===eg?p="utf-8":a[d]===Qp&&(p="iso-8859-1"),u=d,d=a.length);for(d=0;d<a.length;++d)if(d!==u){var g=a[d],w=g.indexOf("]="),b=w===-1?g.indexOf("="):w+1,C,_;b===-1?(C=t.decoder(g,Ee.decoder,p,"key"),_=t.strictNullHandling?null:""):(C=t.decoder(g.slice(0,b),Ee.decoder,p,"key"),_=ci.maybeMap(Ol(g.slice(b+1),t,Pl(i[C])?i[C].length:0),function(F){return t.decoder(F,Ee.decoder,p,"value")})),_&&t.interpretNumericEntities&&p==="iso-8859-1"&&(_=Zp(String(_))),g.indexOf("[]=")>-1&&(_=Pl(_)?[_]:_);var S=Fs.call(i,C);S&&t.duplicates==="combine"?i[C]=ci.combine(i[C],_):(!S||t.duplicates==="last")&&(i[C]=_)}return i},ig=function(l,e,t,i){var n=0;if(l.length>0&&l[l.length-1]==="[]"){var s=l.slice(0,-1).join("");n=Array.isArray(e)&&e[s]?e[s].length:0}for(var a=i?e:Ol(e,t,n),u=l.length-1;u>=0;--u){var d,p=l[u];if(p==="[]"&&t.parseArrays)d=t.allowEmptyArrays&&(a===""||t.strictNullHandling&&a===null)?[]:ci.combine([],a);else{d=t.plainObjects?{__proto__:null}:{};var g=p.charAt(0)==="["&&p.charAt(p.length-1)==="]"?p.slice(1,-1):p,w=t.decodeDotInKeys?g.replace(/%2E/g,"."):g,b=parseInt(w,10);!t.parseArrays&&w===""?d={0:a}:!isNaN(b)&&p!==w&&String(b)===w&&b>=0&&t.parseArrays&&b<=t.arrayLimit?(d=[],d[b]=a):w!=="__proto__"&&(d[w]=a)}a=d}return a},ng=function(e,t,i,n){if(e){var s=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,d=i.depth>0&&a.exec(s),p=d?s.slice(0,d.index):s,g=[];if(p){if(!i.plainObjects&&Fs.call(Object.prototype,p)&&!i.allowPrototypes)return;g.push(p)}for(var w=0;i.depth>0&&(d=u.exec(s))!==null&&w<i.depth;){if(w+=1,!i.plainObjects&&Fs.call(Object.prototype,d[1].slice(1,-1))&&!i.allowPrototypes)return;g.push(d[1])}if(d){if(i.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+i.depth+" and strictDepth is true");g.push("["+s.slice(d.index)+"]")}return ig(g,t,i,n)}},rg=function(e){if(!e)return Ee;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=typeof e.charset>"u"?Ee.charset:e.charset,i=typeof e.duplicates>"u"?Ee.duplicates:e.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:Ee.allowDots:!!e.allowDots;return{allowDots:n,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Ee.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Ee.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Ee.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Ee.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ee.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Ee.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:Ee.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:Ee.decoder,delimiter:typeof e.delimiter=="string"||ci.isRegExp(e.delimiter)?e.delimiter:Ee.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Ee.depth,duplicates:i,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Ee.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Ee.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Ee.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:Ee.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ee.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},sg=function(l,e){var t=rg(e);if(l===""||l===null||typeof l>"u")return t.plainObjects?{__proto__:null}:{};for(var i=typeof l=="string"?tg(l,t):l,n=t.plainObjects?{__proto__:null}:{},s=Object.keys(i),a=0;a<s.length;++a){var u=s[a],d=ng(u,i[u],t,typeof l=="string");n=ci.merge(n,d,t)}return t.allowSparse===!0?n:ci.compact(n)},og=Jp,ag=sg,lg=Ms,hg={formats:lg,parse:ag,stringify:og};const ug=ac(hg),zs=l=>$.upperFirst($.camelCase(l));function dg(l){let e=[];function t(i){for(let n in i)typeof i[n]=="object"&&i[n]!==null&&(!["schema","columns"].includes(n)&&!$.has(i[n],"schema")&&!["group"].includes($.get(i[n],"type"))?($.has(i[n],"placeholder")||(i[n].placeholder=$.get(i[n],"title")),i[n].field=n,e.push(i[n])):t(i[n]))}return t(l),e}const cg=(l="myStore")=>$t.defineStore(l,{state:()=>({mainKey:"",form:{},items:{},query:"",routes:{},fields:[],options:[],filters:[],loadings:{},dialog:!1,structure:{},paginations:{},searchParam:"",isEditing:!1,panelName:!1,editItemId:!1,hiddenActions:[],isFiltering:!1,sorts:["id:desc"],selected:new Set([])}),getters:{getItems(e){return t=>$.get(e==null?void 0:e.items,t,[])},getPaginations(e){return t=>$.get(e==null?void 0:e.paginations,t,[])},mainItems(e){if(e)return $.get(e==null?void 0:e.items,e==null?void 0:e.mainKey,[])},mainPagination(e){return this.getPaginations(e==null?void 0:e.mainKey)},mainRoute(e){return $.get(e==null?void 0:e.routes,e==null?void 0:e.mainKey,"")},flatFields(e){let t=dg(e==null?void 0:e.fields);return t.unshift(c.reactive({title:"",type:"hidden",value:"_select_",field:"_select_",align:"center",headerSort:!1})),t},formFields(e){return e.fields},flatFieldsWithoutActions(){return this.flatFields.filter(e=>!["_actions_","_index_","_select_"].includes(e.field))},headers(){return Eg(this.flatFields)},headersWithoutActions(){return this.headers.filter(e=>!["_actions_","_index_","_select_"].includes(e.field))}},actions:{reset(){this.items={},this.loadings={},this.routes={},this.options=[],this.filters=[],this.paginations={},this.selected=new Set([])},setData(e,t){this.items[e]=t},addData(e){Array.isArray(this.items[this.mainKey])||(this.items[this.mainKey]=[]),this.items[this.mainKey]=[e,...this.items[this.mainKey]]},editData(e){const t=this.items[this.mainKey].findIndex(i=>i.id===e.id);t!==-1&&(this.items[this.mainKey][t]={_index_:this.items[this.mainKey][t]._index_,...e})},removeData(e){const t=this.items[this.mainKey].findIndex(i=>i.id===e);t!==-1&&this.items[this.mainKey].splice(t,1)},getModelKey(e){let t=typeof e=="string"?e.substr(e.lastIndexOf("/")+1):e.key;return this.mainKey=this.mainKey||zs(t),zs(t)},setPagination(e,t){t in this.paginations||(this.paginations[t]={total:0,currentPage:0,lastPage:0}),this.paginations[t].total=$.get(e,"total"),this.paginations[t].currentPage=$.get(e,"current_page"),this.paginations[t].lastPage=$.get(e,"last_page")},paginate(e){this.isFiltering?this.getWithFilter(e):this.loadItems(this.mainKey,e)},reloadData(){this.isFiltering?this.getWithFilter():this.loadItems()},convertToFilterForm(){var t,i,n;let e={};for(const s of this.filters)if((t=s==null?void 0:s.field)!=null&&t.field){if((i=s==null?void 0:s.field)!=null&&i.query){const a=(n=s==null?void 0:s.field)==null?void 0:n.query(s);e=$.merge(e,a);continue}e[s.field.field]={[s.op]:s.value}}return ug.stringify({filters:e,sort:this.sorts},{encodeValuesOnly:!0})},generateQuery(e=this.mainKey){let t=$.get(this.routes,e+".index","");const[i,n]=t.split("?");return i+"/export?"+(n?n+"&":"")+this.convertToFilterForm()},generateRoute(e=this.mainKey,t=!1){let i=$.get(this.routes,e+".index",""),n=i.indexOf("?")>-1?"&page=":"?page=";if(n+=t,this.searchParam&&(n+="&search="+this.searchParam),i=i+n+"&"+this.convertToFilterForm(),this.query){const s=i.includes("?")?"&":"?";i+=s+this.query}return i},async loadItems(e=this.mainKey,t=1){this.loadings[e]=!0,this.loadings.mainLoading=e===this.mainKey;const i=this.generateRoute(e,t);return ye.get(i).then(n=>{n=$.get(n,"data",{}),this.items[e]=$.get(n,"data"),this.setPagination(n,e)}).finally(()=>{this.loadings[e]=!1,this.loadings.mainLoading=!1})},async loadItems(e=this.mainKey,t=1){this.items[e]&&Array.isArray(this.items[e])&&(this.items[e].length=0),this.loadings[e]=!0,this.loadings.mainLoading=e===this.mainKey;const i=this.generateRoute(e,t);return ye.get(i).then(n=>{n=$.get(n,"data",{}),this.items[e]=$.get(n,"data"),this.setPagination(n,e)}).finally(()=>{this.loadings[e]=!1,this.loadings.mainLoading=!1})},customLoadItems(e,t=1,i=()=>({})){this.loadings[e]=!0,i(n=>{this.items[e]=n.data,this.setPagination(n,e)},()=>{},()=>{this.loadings[e]=!1},t)},getWithFilter(e=1,t=15){const i="http://192.168.190.10:9090/api/filter";return this.loadings.filter=!0,ye.post(`${i}?page=${e}`,{model:this.mainKey,itemPerPage:t,filters:this.filters}).then(n=>{n=$.get(n,"data",{}),this.items[this.mainKey]=n.data,this.setPagination(n,this.mainKey)}).finally(()=>{this.loadings.filter=!1})},addItem(e){this.loadings.mainLoading=!0;let t=$.get(this.routes,this.mainKey+".create",""),i=Vl(e,this.flatFields);return ye.post(t,i).then(async()=>{this.reloadData(),se.event("alert",{text:"با موفقیت ثبت شد",color:"green"}),se.event("handleDialogForm",!1)}).catch(n=>{se.event("alert",{text:$.get(n,"response.data.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})},editItem(e){let t=$.get(this.routes,this.mainKey+".update","");t=t.split("?")[0];let i=Vl(e,this.flatFields);return this.loadings.mainLoading=!0,ye.patch(t+"/"+this.editItemId,i).then(async()=>{this.reloadData(),se.event("alert",{text:"با موفقیت ویرایش شد",color:"green"}),se.event("handleDialogForm",!1)}).catch(n=>{se.event("alert",{text:$.get(n,"response.data.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})},remove(e){const t=Array.isArray(e)?e:[e];let i=$.get(this.routes,this.mainKey+".delete","");i=i.split("?")[0],this.loadings.mainLoading=!0,t.forEach(n=>{ye.delete(i+"/"+n).then(()=>{se.event("alert",{text:"با موفقیت حذف شد",color:"green"}),se.event("handleDeleteDialog",!1),this.removeData(e),this.reloadData()}).catch(s=>{se.event("alert",{text:$.get(s,"response.data.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})})}}}),fg=l=>cg(l)(),pg=["create","update","delete","show","print","importExcel","exportExcel","filter"],Ps=c.ref([]);function Os(){function l(t){Ps.value=pg.filter(i=>!t.includes(i))}function e(t){return Ps.value.includes(t)}return{can:e,setPermissions:l,permissions:Ps}}const gg=l=>({onChange:(...e)=>{const t=e[2].form$.el$(l);t&&"clear"in t&&t.clear(),t&&"updateItems"in t&&t.updateItems()}}),mg=(l={})=>({search:!0,clearOnSearch:!0,type:"select",delay:1e3,object:!0,filterResults:!1,native:!1,formatter:e=>$.get(e.getValue(),$.get(l,"labelProp")),...l}),bg=(l={})=>({search:!0,clearOnSearch:!0,type:"select",object:!0,native:!1,formatter:e=>$.get(e.getValue(),$.get(l,"labelProp"),e.getValue()),...l}),vg=(l={})=>({search:!0,clearOnSearch:!0,type:"multiselect",delay:1e3,object:!0,filterResults:!1,native:!1,formatter:e=>$.get(e.getValue(),$.get(l,"labelProp")),...l}),Hl=(l={})=>({search:!0,clearOnSearch:!0,type:"tags",delay:1e3,object:!0,filterResults:!1,hideSelected:!0,native:!1,formatter:e=>$.get(e.getValue(),$.get(l,"labelProp")),...l}),Bl=(l={})=>({type:"date",...l}),Nl={normalSelect:bg,multiSelect:vg,multiFile:(l={})=>({type:"multifile",label:l==null?void 0:l.title,placeholder:l==null?void 0:l.title,drop:!0,filename:"name",url:"http://192.168.190.69:9090/api/file/show",uploadTempEndpoint:"http://192.168.190.69:9090/api/file/upload",accept:[".jpg",".png",".gif",".docx",".txt",".zip",".rar"],sort:!0,clickable:!0,object:!0,storeFile:"hash",...l}),hasRel:gg,select:mg,group:(l,e={})=>({addClass:["bg-gray-100","p-4","rounded-lg",""],type:"group",label:l,schema:e}),tags:Hl,date:Bl};let Il={};function wg({form:l,fieldName:e,field:t}){const i=$.get(l,e),n=Array.isArray(i),s=$.has(t,"valueProp");if(!n)return!1;if(s){const a=i[0];return a&&typeof a=="object"&&!Array.isArray(a)}return!1}function Vl(l,e){let t={},i=!1;for(let n in l){let s=Cg(n,e);if(!s)continue;i=!0;let a=yg(s),u=n;const d=$.get(s,"valueProp",!1);if(d&&(u+="."+d),wg({form:l,fieldName:n,field:s})){t[a]=$.get(l,n).map((w,b)=>$.get(w,d));continue}const g=$.get(l,u,$.get(l,n));t[a]=g}return i?t:l}function yg(l){return"sendKey"in l?l.sendKey:l.field}function Cg(l,e){return e.find(t=>t.field==l)}function Eg(l){let e=l.filter(s=>s.isHeader&&s.field!=="_actions_");const t=l.find(s=>s.field==="_actions_");let i={title:"",value:"_actions_",field:"_actions_",type:"text",align:"left",headerSort:!1,hozAlign:"left",headerHozAlign:"left"};t&&(i={...i,...t}),e.push(i);let n=0;return l.find(s=>s.field==="_select_"&&s.isHeader)&&(n=1),e.splice(n,0,{title:"#",type:"text",value:"_index_",field:"_index_",maxWidth:"100px",align:"center",headerSort:!1}),e}function xg(l){for(const e of l)"init"in e&&e.init()}const Rg=l=>{const e=$.get(Il,l);return e?c.markRaw(e):""},_g=l=>({url:e,key:t,foreignKey:i,dataKey:n,change:s}={url:!1,key:!1,foreignKey:!1,dataKey:!1,change:a=>a})=>async(...a)=>{let u=a[0],d=e;if(i&&n){d+=d.includes("?")?"&":"?";const C=i.split(".");let _="filters";for(const S of C)_+=`[${S.replace("|",".")}]`;d+=`${_}[$eq]={${n}}`}!t&&typeof d=="string"&&(t=(C=>{const _=C.lastIndexOf("/");let S;return C.includes("?")?S=C.substring(_+1,C.indexOf("?")):S=C.substring(_+1),zs(S)})(d)),(d.match(/\{(.*?)\}/g)||[]).forEach(C=>{const _=C.replace(/[{}]/g,"");d=d.replace(C,$.get(l.form,_,""))});const w=d.includes("?")?"&":"?";u=typeof u=="string"?u:"";const b=await ye.get(d+w+"search="+u);return s||(s=C=>C),s($.get(b,"data.data",[]))},Tg=(l,e)=>l({getRegisterField:Rg,axios:ye,get:_g(e),getSafe:$.get,useFields:Nl}),Wl=l=>{Il=l};function kg({fields:l,hiddenActions:e,options:t,route:i,structure:n,query:s}){const{setPermissions:a}=Os(),u=fg("Store-"+parseInt(Math.random()*1e7));u.query=s||"",u.fields=Tg(l,u),se.event("beforeFormueInit");const d=u.getModelKey(i),p={create:typeof i=="string"?i:i.create,update:typeof i=="string"?i:i.update,delete:typeof i=="string"?i:i.delete,index:typeof i=="string"?i:i.index};return u.routes[d]=p,u.loadItems(),u.options=t,a(e),u.structure=n,xg(u.flatFields),u}const Sg={install(l,{fields:e={},axiosConfig:t={},dir:i="rtl",emitter:n}={}){hc(t);const s=Ti();s.dir=i,n&&Na(n),l.config.globalProperties.$fcTr=a=>s.translate(a),Wl(e)}};class ze{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class ge{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var n=e?t.split(e):[t],s=n.length,a;for(let u=0;u<s&&(i=i[n[u]],a=i,!!i);u++);return a}static deepClone(e,t,i=[]){var n={}.__proto__,s=[].__proto__;t||(t=Object.assign(Array.isArray(e)?[]:{},e));for(var a in e){let u=e[a],d,p;u!=null&&typeof u=="object"&&(u.__proto__===n||u.__proto__===s)&&(d=i.findIndex(g=>g.subject===u),d>-1?t[a]=i[d].copy:(p=Object.assign(Array.isArray(u)?[]:{},u),i.unshift({subject:u,copy:p}),t[a]=this.deepClone(u,p,i)))}return t}}let Mg=class oc extends ze{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,n=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let s=ge.elOffset(this.container);i-=s.left,n-=s.top}return{x:i,y:n}}elementPositionCoords(e,t="right"){var i=ge.elOffset(e),n,s,a;switch(this.container!==document.body&&(n=ge.elOffset(this.container),i.left-=n.left,i.top-=n.top),t){case"right":s=i.left+e.offsetWidth,a=i.top-1;break;case"bottom":s=i.left,a=i.top+e.offsetHeight;break;case"left":s=i.left,a=i.top-1;break;case"top":s=i.left,a=i.top;break;case"center":s=i.left+e.offsetWidth/2,a=i.top+e.offsetHeight/2;break}return{x:s,y:a,offset:i}}show(e,t){var i,n,s,a,u;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(s=e,u=this.elementPositionCoords(e,t),a=u.offset,i=u.x,n=u.y):typeof e=="number"?(a={top:0,left:0},i=e,n=t):(u=this.containerEventCoords(e),i=u.x,n=u.y,this.reversedX=!1),this.element.style.top=n+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,n,s,a,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",d=>{d.stopPropagation()}),this)}_fitToScreen(e,t,i,n,s){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-n.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0);let u=Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0);if(t+this.element.offsetHeight>u)if(i)switch(s){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.height=u+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new oc(this.table,e,this),this.childPopup}};class ee extends ze{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(n=>n.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new Mg(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var Lg={rownum:function(l,e,t,i,n,s){return s.getPosition()}};const Pi=class Pi extends ee{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(n=>{var s="accessor"+(n.charAt(0).toUpperCase()+n.slice(1)),a;e.definition[s]&&(a=this.lookupAccessor(e.definition[s]),a&&(t=!0,i[s]={accessor:a,params:e.definition[s+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":Pi.accessors[e]?t=Pi.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=e.getComponent(),s=ge.deepClone(e.data||{});return this.table.columnManager.traverse(function(a){var u,d,p,g;a.modules.accessor&&(d=a.modules.accessor[i]||a.modules.accessor.accessor||!1,d&&(u=a.getFieldValue(s),u!="undefined"&&(g=a.getComponent(),p=typeof d.params=="function"?d.params(u,s,t,g,n):d.params,a.setFieldValue(s,d.accessor(u,s,t,p,g,n)))))}),s}};P(Pi,"moduleName","accessor"),P(Pi,"accessors",Lg);let Hs=Pi;var Dg={method:"GET"};function Bs(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((n,s)=>{t=t.concat(Bs(n,e?e+"["+s+"]":s))});else if(typeof l=="object")for(var i in l)t=t.concat(Bs(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}function Ag(l){var e=Bs(l),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function $l(l,e,t){return l&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",l+=(l.includes("?")?"&":"?")+Ag(t)),l}function Fg(l,e,t){var i;return new Promise((n,s)=>{if(l=this.urlGenerator.call(this.table,l,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var a in i.headers)e.headers||(e.headers={}),typeof e.headers[a]>"u"&&(e.headers[a]=i.headers[a]);e.body=i.body.call(this,l,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);l?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(l,e).then(u=>{u.ok?u.json().then(d=>{n(d)}).catch(d=>{s(d),console.warn("Ajax Load Error - Invalid JSON returned",d)}):(console.error("Ajax Load Error - Connection Error: "+u.status,u.statusText),s(u))}).catch(u=>{console.error("Ajax Load Error - Connection Error: ",u),s(u)})):(console.warn("Ajax Load Error - No URL Set"),n([]))})}function Ns(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((n,s)=>{t=t.concat(Ns(n,e?e+"["+s+"]":s))});else if(typeof l=="object")for(var i in l)t=t.concat(Ns(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}var zg={json:{headers:{"Content-Type":"application/json"},body:function(l,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(l,e,t){var i=Ns(t),n=new FormData;return i.forEach(function(s){n.append(s.key,s.value)}),n}}};const pt=class pt extends ee{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=pt.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||pt.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||pt.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,n){var s=this.table.options.ajaxParams;return s&&(typeof s=="function"&&(s=s.call(this.table)),n=Object.assign(Object.assign({},s),n)),n}requestDataCheck(e,t,i,n){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,n,s){var a;return!s&&this.requestDataCheck(e)?(e&&this.setUrl(e),a=this.generateConfig(i),this.sendRequest(this.url,t,a)):s}setDefaultConfig(e={}){this.config=Object.assign({},pt.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(n=>(this.table.options.ajaxResponse&&(n=this.table.options.ajaxResponse.call(this.table,e,t,n)),n)):Promise.reject()}};P(pt,"moduleName","ajax"),P(pt,"defaultConfig",Dg),P(pt,"defaultURLGenerator",$l),P(pt,"defaultLoaderPromise",Fg),P(pt,"contentTypeFormatters",zg);let Is=pt;var Pg={replace:function(l){return this.table.setData(l)},update:function(l){return this.table.updateOrAddData(l)},insert:function(l){return this.table.addData(l)}},Og={table:function(l){var e=[],t=!0,i=this.table.columnManager.columns,n=[],s=[];return l=l.split(`
|
|
31
31
|
`),l.forEach(function(a){e.push(a.split(" "))}),e.length&&!(e.length===1&&e[0].length<2)?(e[0].forEach(function(a){var u=i.find(function(d){return a&&d.definition.title&&a.trim()&&d.definition.title.trim()===a.trim()});u?n.push(u):t=!1}),t||(t=!0,n=[],e[0].forEach(function(a){var u=i.find(function(d){return a&&d.field&&a.trim()&&d.field.trim()===a.trim()});u?n.push(u):t=!1}),t||(n=this.table.columnManager.columnsByIndex)),t&&e.shift(),e.forEach(function(a){var u={};a.forEach(function(d,p){n[p]&&(u[n[p].field]=d)}),s.push(u)}),s):!1}},Hg={copyToClipboard:["ctrl + 67","meta + 67"]},Bg={copyToClipboard:function(l){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},Ng={keybindings:{bindings:Hg,actions:Bg}};const jt=class jt extends ee{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,(this.mode===!0||this.mode==="copy")&&this.table.element.addEventListener("copy",e=>{var t,i,n;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(n=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),i=this.table.modules.export.generateHTMLTable(n),t=i?this.generatePlainContent(n):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())}),(this.mode===!0||this.mode==="paste")&&this.table.element.addEventListener("paste",e=>{this.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach(i=>{var n=[];i.columns.forEach(s=>{var a="";if(s)if(i.type==="group"&&(s.value=s.component.getKey()),s.value===null)a="";else switch(typeof s.value){case"object":a=JSON.stringify(s.value);break;case"undefined":a="";break;default:a=s.value}n.push(a)}),t.push(n.join(" "))}),t.join(`
|
|
32
32
|
`)}copy(e,t){var i,n;this.blocked=!1,this.customSelection=!1,(this.mode===!0||this.mode==="copy")&&(this.rowRange=e||this.table.options.clipboardCopyRowRange,typeof window.getSelection<"u"&&typeof document.createRange<"u"?(e=document.createRange(),e.selectNodeContents(this.table.element),i=window.getSelection(),i.toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):typeof document.selection<"u"&&typeof document.body.createTextRange<"u"&&(n=document.body.createTextRange(),n.moveToElementText(this.table.element),n.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=jt.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e;break}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=jt.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e;break}}paste(e){var t,i,n;this.checkPasteOrigin(e)&&(t=this.getPasteData(e),i=this.pasteParser.call(this,t),i?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),n=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,n)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach(i=>{t.push(this.table.modules.mutator.transformRow(i,"clipboard"))}):t=e,t}checkPasteOrigin(e){var t=!0,i=this.confirm("clipboard-paste",[e]);return(i||!["DIV","SPAN"].includes(e.target.tagName))&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}};P(jt,"moduleName","clipboard"),P(jt,"moduleExtensions",Ng),P(jt,"pasteActions",Pg),P(jt,"pasteParsers",Og);let Vs=jt;class Ig{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,n){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}_getSelf(){return this._row}}class Gl{constructor(e){return this._cell=e,new Proxy(this,{get:function(t,i,n){return typeof t[i]<"u"?t[i]:t._cell.table.componentFunctionBinder.handle("cell",t._cell,i)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(e){return this._cell.row.getData(e)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){typeof t>"u"&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class fn extends ze{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var e=this.element,t=this.column.getField(),i={top:"flex-start",bottom:"flex-end",middle:"center"},n={left:"flex-start",right:"flex-end",center:"center"};if(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems=i[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent=n[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass){var s=this.column.definition.cssClass.split(" ");s.forEach(a=>{e.classList.add(a)})}this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(e=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value),typeof e){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",e!=null&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){var n=this.setValueProcessData(e,t,i);n&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var n=!1;return(this.value!==e||i)&&(n=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),n&&this.dispatch("cell-value-changed",this),n}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new Gl(this)),this.component}}class Ul{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(t,i,n){return typeof t[i]<"u"?t[i]:t._column.table.componentFunctionBinder.handle("column",t._column,i)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(e){e.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(e){e.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(e,t){return this._column.table.columnManager.scrollToColumn(this._column,e,t)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return e?e.getComponent():!1}getPrevColumn(){var e=this._column.prevColumn();return e?e.getComponent():!1}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return e===!0?t=this._column.reinitializeWidth(!0):t=this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var jl={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};const pi=class pi extends ze{constructor(e,t,i){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((n,s)=>{var a=new pi(n,this);this.attachColumn(a)}),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.isRowHeader&&e.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end";break}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)typeof this.definition[t]>"u"&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(pi.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(e=>{pi.defaultOptionList.indexOf(e)===-1&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)})}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(e){e.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),e.headerVertical==="flip"&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;if(this.dispatch("column-layout",this),typeof e.visible<"u"&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass){var t=e.cssClass.split(" ");t.forEach(i=>{this.element.classList.add(i)})}e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap&&t.classList.add("tabulator-col-title-wrap"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",n=>{n.stopPropagation(),i.focus()}),i.addEventListener("mousedown",n=>{n.stopPropagation()}),i.addEventListener("change",()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),t.appendChild(i),e.field?this.langBind("columns|"+e.field,n=>{i.value=n||e.title||" "}):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,n=>{this._formatColumnHeaderTitle(t,n||e.title||" ")}):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,()=>t);switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var e=this.definition.cssClass.split(" ");e.forEach(t=>{this.element.classList.add(t)})}this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t=e,i=this.fieldStructure,n=i.length,s;for(let a=0;a<n&&(t=t[i[a]],s=t,!!t);a++);return s}_setFlatData(e,t){this.field&&(e[this.field]=t)}_setNestedData(e,t){var i=e,n=this.fieldStructure,s=n.length;for(let a=0;a<s;a++)if(a==s-1)i[n[a]]=t;else{if(!i[n[a]])if(typeof t<"u")i[n[a]]={};else break;i=i[n[a]]}}attachColumn(e){this.groupElement?(this.columns.push(e),this.groupElement.appendChild(e.getElement()),e.columnRendered()):console.warn("Column Warning - Column being attached to another column instead of column group")}verticalAlign(e,t){var i=this.parent.isGroup?this.parent.getGroupElement().clientHeight:t||this.parent.getHeadersElement().clientHeight;this.element.style.height=i+"px",this.dispatch("column-height",this,this.element.style.height),this.isGroup&&(this.groupElement.style.minHeight=i-this.contentElement.offsetHeight+"px"),this.columns.forEach(function(n){n.verticalAlign(e)})}clearVerticalAlign(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach(function(e){e.clearVerticalAlign()}),this.dispatch("column-height",this,"")}getElement(){return this.element}getGroupElement(){return this.groupElement}getField(){return this.field}getTitleDownload(){return this.titleDownload}getFirstColumn(){return this.isGroup?this.columns.length?this.columns[0].getFirstColumn():!1:this}getLastColumn(){return this.isGroup?this.columns.length?this.columns[this.columns.length-1].getLastColumn():!1:this}getColumns(e){var t=[];return e?this.columns.forEach(i=>{t.push(i),t=t.concat(i.getColumns(!0))}):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach(function(i){t.push(i.getDefinition(!0))}),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach(function(t){t.visible&&(e=!0)}),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.show()}),!this.isGroup&&this.width===null&&this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.hide()}),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}),this.contentElement.style.maxWidth=e-1+"px",this.table.initialized&&(this.element.style.width=e+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var e=[];this.cells.forEach(function(t){t.row.heightInitialized&&(t.row.getElement().offsetParent!==null?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)}),e.forEach(function(t){t.calcHeight()}),e.forEach(function(t){t.setCellHeight()})}getWidth(){var e=0;return this.isGroup?this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}):e=this.width,e}getLeftOffset(){var e=this.element.offsetLeft;return this.parent.isGroup&&(e+=this.parent.getLeftOffset()),e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})}setMaxWidth(e){this.minWidth&&e<this.minWidth&&(e=this.minWidth,console.warn("the maxWidth ("+e+"px) for column '"+this.field+"' cannot be smaller that its minWidth ("+this.minWidthStyled+")")),this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach(function(t){t.setMaxWidth()})}delete(){return new Promise((e,t)=>{this.isGroup&&this.columns.forEach(function(n){n.delete()}),this.dispatch("column-delete",this);var i=this.cells.length;for(let n=0;n<i;n++)this.cells[0].delete();this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.contentElement=!1,this.titleElement=!1,this.groupElement=!1,this.parent.isGroup&&this.parent.removeChild(this),this.table.columnManager.deregisterColumn(this),this.table.columnManager.rerenderColumns(!0),this.dispatch("column-deleted",this),e()})}columnRendered(){this.titleFormatterRendered&&this.titleFormatterRendered(),this.dispatch("column-rendered",this)}generateCell(e){var t=new fn(this,e);return this.cells.push(t),t}nextColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._nextVisibleColumn(e+1):!1}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._prevVisibleColumn(e-1):!1}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,typeof this.definition.width<"u"&&!e&&this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(n=>{n.clearWidth()}));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(n=>{var s=n.getWidth();s>t&&(t=s)}),t)){var i=t+1;e?this.setWidth(i):(this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i))}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then(i=>(t.field==this.field&&(this.field=!1),this.delete().then(()=>i.getComponent()))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new Ul(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof pi?this.parent.getComponent():!1}};P(pi,"defaultOptionList",jl);let fi=pi;class rr{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,n){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(e,t){return this._row.table.rowManager.scrollToRow(this._row,e,t)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e&&e.getComponent()}getPrevRow(){var e=this._row.prevRow();return e&&e.getComponent()}}class He extends ze{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e,t){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,t),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,t)}rendered(){this.cells.forEach(e=>{e.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&this.element.offsetParent!==null&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&this.element.offsetParent!==null&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t=0,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.calcMinHeight(),t=this.calcMaxHeight(),e?this.height=Math.max(t,i):this.height=this.manualHeight?this.height:Math.max(t,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var e=0;return this.cells.forEach(function(t){var i=t.getHeight();i>e&&(e=i)}),e}setCellHeight(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(e){e.clearHeight()})}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var t=this.element&&ge.elVisible(this.element),i={},n;return new Promise((s,a)=>{typeof e=="string"&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(i=Object.assign(i,this.data),i=Object.assign(i,e)),n=this.chain("row-data-changing",[this,i,e],null,e);for(let u in n)this.data[u]=n[u];this.dispatch("row-data-save-after",this);for(let u in e)this.table.columnManager.getColumnsByFieldRoot(u).forEach(p=>{let g=this.getCell(p.getField());if(g){let w=p.getFieldValue(n);g.getValue()!==w&&(g.setValueProcessData(w),t&&g.cellRendered())}});t?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,t,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s()})}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){var t=!1;return e=this.table.columnManager.findColumn(e),!this.initialized&&this.cells.length===0&&this.generateCells(),t=this.cells.find(function(i){return i.column===e}),t}getCellIndex(e){return this.cells.findIndex(function(t){return t===e})}findCell(e){return this.cells.find(t=>t.element===e)}getCells(){return!this.initialized&&this.cells.length===0&&this.generateCells(),this.cells}nextRow(){var e=this.table.rowManager.nextDisplayRow(this,!0);return e||!1}prevRow(){var e=this.table.rowManager.prevDisplayRow(this,!0);return e||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t<e;t++)this.cells[0].delete()}wipe(){if(this.detachModules(),this.deleteCells(),this.element){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.parentNode&&this.element.parentNode.removeChild(this.element)}this.element=!1,this.modules={}}isDisplayed(){return this.table.rowManager.getDisplayRows().includes(this)}getPosition(){return this.isDisplayed()?this.position:!1}setPosition(e){e!=this.position&&(this.position=e,this.positionWatchers.forEach(t=>{t(this.position)}))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new rr(this)),this.component}}var Vg={avg:function(l,e,t){var i=0,n=typeof t.precision<"u"?t.precision:2;return l.length&&(i=l.reduce(function(s,a){return Number(s)+Number(a)}),i=i/l.length,i=n!==!1?i.toFixed(n):i),parseFloat(i).toString()},max:function(l,e,t){var i=null,n=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(s){s=Number(s),(s>i||i===null)&&(i=s)}),i!==null?n!==!1?i.toFixed(n):i:""},min:function(l,e,t){var i=null,n=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(s){s=Number(s),(s<i||i===null)&&(i=s)}),i!==null?n!==!1?i.toFixed(n):i:""},sum:function(l,e,t){var i=0,n=typeof t.precision<"u"?t.precision:!1;return l.length&&l.forEach(function(s){s=Number(s),i+=isNaN(s)?0:Number(s)}),n!==!1?i.toFixed(n):i},concat:function(l,e,t){var i=0;return l.length&&(i=l.reduce(function(n,s){return String(n)+String(s)})),i},count:function(l,e,t){var i=0;return l.length&&l.forEach(function(n){n&&i++}),i},unique:function(l,e,t){var i=l.filter((n,s)=>(l||n===0)&&l.indexOf(n)===s);return i.length}};const Kt=class Kt extends ee{constructor(e){super(e),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-calcs-holder"),e}initialize(){this.genColumn=new fi({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(e){this.recalc(this.table.rowManager.activeRows),e&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(e,t){return this.topRow&&t.unshift(this.topRow),this.botRow&&t.push(this.botRow),t}rowsUpdated(e){this.table.options.groupBy?this.recalcRowGroup(e):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(e){(e.column.definition.topCalc||e.column.definition.bottomCalc)&&(this.table.options.groupBy?((this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both")&&this.recalcActiveRows(),this.table.options.columnCalcs!="table"&&this.recalcRowGroup(e.row)):this.recalcActiveRows())}initializeColumnCheck(e){(e.definition.topCalc||e.definition.bottomCalc)&&this.initializeColumn(e)}initializeColumn(e){var t=e.definition,i={topCalcParams:t.topCalcParams||{},botCalcParams:t.bottomCalcParams||{}};if(t.topCalc){switch(typeof t.topCalc){case"string":Kt.calculations[t.topCalc]?i.topCalc=Kt.calculations[t.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.topCalc);break;case"function":i.topCalc=t.topCalc;break}i.topCalc&&(e.modules.columnCalcs=i,this.topCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeTopRow())}if(t.bottomCalc){switch(typeof t.bottomCalc){case"string":Kt.calculations[t.bottomCalc]?i.botCalc=Kt.calculations[t.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.bottomCalc);break;case"function":i.botCalc=t.bottomCalc;break}i.botCalc&&(e.modules.columnCalcs=i,this.botCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var e=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),e=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),e=!0),e&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var e=document.createDocumentFragment();this.topInitialized||(e.appendChild(document.createElement("br")),e.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(e,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(e){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=e)}recalc(e){var t,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(t=this.rowsToData(e),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",t),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",t),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(e){this.recalcGroup(this.table.modules.groupRows.getRowGroup(e))}recalcAll(){if((this.topCalcs.length||this.botCalcs.length)&&(this.table.options.columnCalcs!=="group"&&this.recalcActiveRows(),this.table.options.groupBy&&this.table.options.columnCalcs!=="table")){var e=this.table.modules.groupRows.getChildGroups();e.forEach(t=>{this.recalcGroup(t)})}}recalcGroup(e){var t,i;this.blockCheck()||e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[],i=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,n=this.table.modules.dataTree;return e.forEach(s=>{var a;t.push(s.getData()),i&&((a=s.modules.dataTree)!=null&&a.open)&&this.rowsToData(n.getFilteredTreeChildren(s)).forEach(u=>{t.push(s)})}),t}generateRow(e,t){var i=this.generateRowData(e,t),n;return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),n=new He(i,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),n.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),n.component=!1,n.getComponent=()=>(n.component||(n.component=new Ig(n)),n.component),n.generateCells=()=>{var s=[];this.table.columnManager.columnsByIndex.forEach(a=>{this.genColumn.setField(a.getField()),this.genColumn.hozAlign=a.hozAlign,a.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter(a.definition[e+"CalcFormatter"]),params:a.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=a.definition.cssClass;var u=new fn(this.genColumn,n);u.getElement(),u.column=a,u.setWidth(),a.cells.push(u),s.push(u),a.visible||u.hide()}),n.cells=s},n}generateRowData(e,t){var i={},n=e=="top"?this.topCalcs:this.botCalcs,s=e=="top"?"topCalc":"botCalc",a,u;return n.forEach(function(d){var p=[];d.modules.columnCalcs&&d.modules.columnCalcs[s]&&(t.forEach(function(g){p.push(d.getFieldValue(g))}),u=s+"Params",a=typeof d.modules.columnCalcs[u]=="function"?d.modules.columnCalcs[u](p,t):d.modules.columnCalcs[u],d.setFieldValue(i,d.modules.columnCalcs[s](p,t,a)))}),i}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={},t;return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(i=>{e[i.getKey()]=this.getGroupResults(i)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),n={},s={};return i.forEach(a=>{n[a.getKey()]=this.getGroupResults(a)}),s={top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:n},s}adjustForScrollbar(e){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=e+"px":this.botElement.style.paddingRight=e+"px")}};P(Kt,"moduleName","columnCalcs"),P(Kt,"calculations",Vg);let Ws=Kt;class Kl extends ee{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement?t.dataTreeBranchElement===!0?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):typeof t.dataTreeBranchElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),t.dataTreeCollapseElement?typeof t.dataTreeCollapseElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),t.dataTreeExpandElement?typeof t.dataTreeExpandElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(i,n){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(i,n){return t.dataTreeStartExpanded[n]};break}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleting",this.rowDeleting.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){var t;e&&(t=this.table.rowManager.getRows(),t.forEach(i=>{this.reinitializeRowChildren(i)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||(e?e.field:!1)}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach(t=>{e=e.concat(this.getTreeChildren(t,!1,!0))}),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){var t=e.column.getField();t===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),n=i||!i&&typeof t=="object"&&t!==null;!n&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!n&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:n?e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0):!1,controlEl:e.modules.dataTree&&n?e.modules.dataTree.controlEl:!1,branchEl:e.modules.dataTree&&n?e.modules.dataTree.branchEl:!1,parent:e.modules.dataTree?e.modules.dataTree.parent:!1,children:n}}reinitializeRowChildren(e){var t=this.getTreeChildren(e,!1,!0);t.forEach(function(i){i.reinitialize(!0)})}layoutRow(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],i=t.getElement(),n=e.modules.dataTree;n.branchEl&&(n.branchEl.parentNode&&n.branchEl.parentNode.removeChild(n.branchEl),n.branchEl=!1),n.controlEl&&(n.controlEl.parentNode&&n.controlEl.parentNode.removeChild(n.controlEl),n.controlEl=!1),this.generateControlElement(e,i),e.getElement().classList.add("tabulator-tree-level-"+n.index),n.index&&(this.branchEl?(n.branchEl=this.branchEl.cloneNode(!0),i.insertBefore(n.branchEl,i.firstChild),this.table.rtl?n.branchEl.style.marginRight=(n.branchEl.offsetWidth+n.branchEl.style.marginLeft)*(n.index-1)+n.index*this.indent+"px":n.branchEl.style.marginLeft=(n.branchEl.offsetWidth+n.branchEl.style.marginRight)*(n.index-1)+n.index*this.indent+"px"):this.table.rtl?i.style.paddingRight=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-right"))+n.index*this.indent+"px":i.style.paddingLeft=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-left"))+n.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,n=i.controlEl;t=t||e.getCells()[0].getElement(),i.children!==!1&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",s=>{s.stopPropagation(),this.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",s=>{s.stopPropagation(),this.expandRow(e)})),i.controlEl.addEventListener("mousedown",s=>{s.stopPropagation()}),n&&n.parentNode===t?n.parentNode.replaceChild(i.controlEl,n):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach((i,n)=>{var s,a;t.push(i),i instanceof He&&(i.create(),s=i.modules.dataTree,!s.index&&s.children!==!1&&(a=this.getChildren(i,!1,!0),a.forEach(u=>{u.create(),t.push(u)})))}),t}getChildren(e,t,i){var n=e.modules.dataTree,s=[],a=[];return n.children!==!1&&(n.open||t)&&(Array.isArray(n.children)||(n.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?s=this.table.modules.filter.filter(n.children):s=n.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(s,i),s.forEach(u=>{a.push(u);var d=this.getChildren(u,!1,!0);d.forEach(p=>{a.push(p)})})),a}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(n=>{var s=new He(n||{},this.table.rowManager);s.create(),s.modules.dataTree.index=e.modules.dataTree.index+1,s.modules.dataTree.parent=e,s.modules.dataTree.children&&(s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)),t.push(s)}),t}expandRow(e,t){var i=e.modules.dataTree;i.children!==!1&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return e.modules.dataTree.parent?e.modules.dataTree.parent.getComponent():!1}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[],n;return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?n=this.table.modules.filter.filter(t.children):n=t.children,n.forEach(s=>{s instanceof He&&i.push(s)})),i}rowDeleting(e){var t=e.modules.dataTree;t&&t.children&&Array.isArray(t.children)&&t.children.forEach(i=>{i instanceof He&&i.wipe()})}rowDelete(e){var t=e.modules.dataTree.parent,i;t&&(i=this.findChildIndex(e,t),i!==!1&&t.data[this.field].splice(i,1),t.data[this.field].length||delete t.data[this.field],this.initializeRow(t),this.layoutRow(t)),this.refreshData(!0)}addTreeChildRow(e,t,i,n){var s=!1;typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),typeof n<"u"&&(s=this.findChildIndex(n,e),s!==!1&&e.data[this.field].splice(i?s:s+1,0,t)),s===!1&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return typeof e=="object"?e instanceof He?i=e.data:e instanceof rr?i=e._getSelf().data:typeof HTMLElement<"u"&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find(n=>n instanceof He?n.element===e:!1),i&&(i=i.data)):e===null&&(i=!1):typeof e>"u"?i=!1:i=t.data[this.field].find(n=>n.data[this.table.options.index]==e),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),i==-1&&(i=!1)),i}getTreeChildren(e,t,i){var n=e.modules.dataTree,s=[];return n&&n.children&&(Array.isArray(n.children)||(n.children=this.generateChildren(e)),n.children.forEach(a=>{a instanceof He&&(s.push(t?a.getComponent():a),i&&this.getTreeChildren(a,t,i).forEach(u=>{s.push(u)}))})),s}getChildField(){return this.field}redrawNeeded(e){return(this.field?typeof e[this.field]<"u":!1)||(this.elementField?typeof e[this.elementField]<"u":!1)}}P(Kl,"moduleName","dataTree");function Wg(l,e={},t){var i=e.delimiter?e.delimiter:",",n=[],s=[];l.forEach(a=>{var u=[];switch(a.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":a.columns.forEach((d,p)=>{d&&d.depth===1&&(s[p]=typeof d.value>"u"||d.value===null?"":'"'+String(d.value).split('"').join('""')+'"')});break;case"row":a.columns.forEach(d=>{if(d){switch(typeof d.value){case"object":d.value=d.value!==null?JSON.stringify(d.value):"";break;case"undefined":d.value="";break}u.push('"'+String(d.value).split('"').join('""')+'"')}}),n.push(u.join(i));break}}),s.length&&n.unshift(s.join(i)),n=n.join(`
|
|
33
33
|
`),e.bom&&(n="\uFEFF"+n),t(n,"text/csv")}function $g(l,e,t){var i=[];l.forEach(n=>{var s={};switch(n.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":n.columns.forEach(a=>{a&&(s[a.component.getTitleDownload()||a.component.getField()]=a.value)}),i.push(s);break}}),i=JSON.stringify(i,null," "),t(i,"application/json")}function Gg(l,e={},t){var i=[],n=[],s={},a=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},u=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},d=e.jsPDF||{},p=e.title?e.title:"",g,w;d.orientation||(d.orientation=e.orientation||"landscape"),d.unit||(d.unit="pt"),l.forEach(C=>{switch(C.type){case"header":i.push(b(C));break;case"group":n.push(b(C,a));break;case"calc":n.push(b(C,u));break;case"row":n.push(b(C));break}});function b(C,_){var S=[];return C.columns.forEach(F=>{var L;if(F){switch(typeof F.value){case"object":F.value=F.value!==null?JSON.stringify(F.value):"";break;case"undefined":F.value="";break}L={content:F.value,colSpan:F.width,rowSpan:F.height},_&&(L.styles=_),S.push(L)}}),S}g=this.dependencyRegistry.lookup("jspdf","jsPDF"),w=new g(d),e.autoTable&&(typeof e.autoTable=="function"?s=e.autoTable(w)||{}:s=e.autoTable),p&&(s.didDrawPage=function(C){w.text(p,40,30)}),s.head=i,s.body=n,w.autoTable(s),e.documentProcessing&&e.documentProcessing(w),t(w.output("arraybuffer"),"application/pdf")}function Ug(l,e,t){var i=this,n=e.sheetName||"Sheet1",s=this.dependencyRegistry.lookup("XLSX"),a=s.utils.book_new(),u=new ze(this),d="compress"in e?e.compress:!0,p=e.writeOptions||{bookType:"xlsx",bookSST:!0,compression:d},g;p.type="binary",a.SheetNames=[],a.Sheets={};function w(){var _=[],S=[],F={},L={s:{c:0,r:0},e:{c:l[0]?l[0].columns.reduce((U,H)=>U+(H&&H.width?H.width:1),0):0,r:l.length}};return l.forEach((U,H)=>{var N=[];U.columns.forEach(function(O,oe){O?(N.push(!(O.value instanceof Date)&&typeof O.value=="object"?JSON.stringify(O.value):O.value),(O.width>1||O.height>-1)&&(O.height>1||O.width>1)&&S.push({s:{r:H,c:oe},e:{r:H+O.height-1,c:oe+O.width-1}})):N.push("")}),_.push(N)}),s.utils.sheet_add_aoa(F,_),F["!ref"]=s.utils.encode_range(L),S.length&&(F["!merges"]=S),F}if(e.sheetOnly){t(w());return}if(e.sheets)for(var b in e.sheets)e.sheets[b]===!0?(a.SheetNames.push(b),a.Sheets[b]=w()):(a.SheetNames.push(b),u.commsSend(e.sheets[b],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:i.active,intercept:function(_){a.Sheets[b]=_}}));else a.SheetNames.push(n),a.Sheets[n]=w();e.documentProcessing&&(a=e.documentProcessing(a));function C(_){for(var S=new ArrayBuffer(_.length),F=new Uint8Array(S),L=0;L!=_.length;++L)F[L]=_.charCodeAt(L)&255;return S}g=s.write(a,p),t(C(g),"application/octet-stream")}function jg(l,e,t){this.modExists("export",!0)&&t(this.modules.export.generateHTMLTable(l),"text/html")}function Kg(l,e,t){const i=[];l.forEach(n=>{const s={};switch(n.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":n.columns.forEach(a=>{a&&(s[a.component.getTitleDownload()||a.component.getField()]=a.value)}),i.push(JSON.stringify(s));break}}),t(i.join(`
|
|
@@ -50,4 +50,4 @@ Data: `,e),!1}loadData(e){var t={data:e};this.loadSheet(this.newSheet(t))}de
|
|
|
50
50
|
Expecting: array
|
|
51
51
|
Received: `,typeof e,`
|
|
52
52
|
Data: `,e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach(e=>{e.wipe()}),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(e,t){var i=this.rows.indexOf(e),n=this.activeRows.indexOf(e);n>-1&&this.activeRows.splice(n,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator(s=>{var a=s.indexOf(e);a>-1&&s.splice(a,1)}),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this.tableEmpty(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,n){var s=this.addRowActual(e,t,i,n);return s}addRows(e,t,i,n){var s=[];return new Promise((a,u)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),(typeof i>"u"&&t||typeof i<"u"&&!t)&&e.reverse(),e.forEach((d,p)=>{var g=this.addRow(d,t,i,!0);s.push(g),this.dispatch("row-added",g,d,t,i)}),this.refreshActiveData(n?"displayPipeline":!1,!1,!0),this.regenerateRowPositions(),this.displayRowsCount&&this._clearPlaceholder(),a(s)})}findAddRowPos(e){return typeof e>"u"&&(e=this.table.options.addRowPos),e==="pos"&&(e=!0),e==="bottom"&&(e=!1),e}addRowActual(e,t,i,n){var s=e instanceof He?e:new He(e||{},this),a=this.findAddRowPos(t),u=-1,d,p;return i||(p=this.chain("row-adding-position",[s,a],null,{index:i,top:a}),i=p.index,a=p.top),typeof i<"u"&&(i=this.findRow(i)),i=this.chain("row-adding-index",[s,i,a],null,i),i&&(u=this.rows.indexOf(i)),i&&u>-1?(d=this.activeRows.indexOf(i),this.displayRowIterator(function(g){var w=g.indexOf(i);w>-1&&g.splice(a?w:w+1,0,s)}),d>-1&&this.activeRows.splice(a?d:d+1,0,s),this.rows.splice(a?u:u+1,0,s)):a?(this.displayRowIterator(function(g){g.unshift(s)}),this.activeRows.unshift(s),this.rows.unshift(s)):(this.displayRowIterator(function(g){g.push(s)}),this.activeRows.push(s),this.rows.push(s)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",s.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n||this.reRenderInPosition(),s}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator(n=>{this.moveRowInArray(n,e,t,i)}),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,n){var s,a,u,d;if(t!==i&&(s=e.indexOf(t),s>-1&&(e.splice(s,1),a=e.indexOf(i),a>-1?n?e.splice(a+1,0,t):e.splice(a,0,t):e.splice(s,0,t)),e===this.getDisplayRows())){u=s<a?s:a,d=a>s?a:s+1;for(let p=u;p<=d;p++)e[p]&&this.styleRow(e[p],p)}}clearData(){this.setData([])}getRowIndex(e){return this.findRowIndex(e,this.rows)}getDisplayRowIndex(e){var t=this.getDisplayRows().indexOf(e);return t>-1?t:!1}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),n=!1;return i!==!1&&i<this.displayRowsCount-1&&(n=this.getDisplayRows()[i+1]),n&&(!(n instanceof He)||n.type!="row")?this.nextDisplayRow(n,t):n}prevDisplayRow(e,t){var i=this.getDisplayRowIndex(e),n=!1;return i&&(n=this.getDisplayRows()[i-1]),t&&n&&(!(n instanceof He)||n.type!="row")?this.prevDisplayRow(n,t):n}findRowIndex(e,t){var i;return e=this.findRow(e),e&&(i=t.indexOf(e),i>-1)?i:!1}getData(e,t){var i=[],n=this.getRows(e);return n.forEach(function(s){s.type=="row"&&i.push(s.getData(t||"data"))}),i}getComponents(e){var t=[],i=this.getRows(e);return i.forEach(function(n){t.push(n.getComponent())}),t}getDataCount(e){var t=this.getRows(e);return t.length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){typeof t<"u"?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((i,n)=>i.priority-n.priority)):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){typeof t<"u"?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((i,n)=>i.priority-n.priority)):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,t,i){var n=this.table,s="",a=0,u=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if(typeof e=="function")if(a=this.dataPipeline.findIndex(d=>d.handler===e),a>-1)s="dataPipeline",t&&(a==this.dataPipeline.length-1?s="display":a++);else if(a=this.displayPipeline.findIndex(d=>d.handler===e),a>-1)s="displayPipeline",t&&(a==this.displayPipeline.length-1?s="end":a++);else{console.error("Unable to refresh data, invalid handler provided",e);return}else s=e||"all",a=0;if(this.redrawBlock){(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===s&&a<this.redrawBlockRestoreConfig.index||u.indexOf(s)<u.indexOf(this.redrawBlockRestoreConfig.stage)))&&(this.redrawBlockRestoreConfig={handler:e,skipStage:t,renderInPosition:i,stage:s,index:a});return}else ge.elVisible(this.element)?i?this.reRenderInPosition(this.refreshPipelines.bind(this,e,s,a,i)):(this.refreshPipelines(e,s,a,i),e||this.table.columnManager.renderer.renderColumns(),this.renderTable(),n.options.layoutColumnsOnNewData&&this.table.columnManager.redraw(!0)):this.refreshPipelines(e,s,a,i),this.dispatch("data-refreshed")}}refreshPipelines(e,t,i,n){switch(this.dispatch("data-refreshing"),(!e||!this.activeRowsPipeline[0])&&(this.activeRowsPipeline[0]=this.rows.slice(0)),t){case"all":case"dataPipeline":for(let s=i;s<this.dataPipeline.length;s++){let a=this.dataPipeline[s].handler(this.activeRowsPipeline[s].slice(0));this.activeRowsPipeline[s+1]=a||this.activeRowsPipeline[s].slice(0)}this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);case"display":i=0,this.resetDisplayRows();case"displayPipeline":for(let s=i;s<this.displayPipeline.length;s++){let a=this.displayPipeline[s].handler((s?this.getDisplayRows(s-1):this.activeRows).slice(0),n);this.setDisplayRows(a||this.getDisplayRows(s-1).slice(0),s)}case"end":this.regenerateRowPositions()}this.getDisplayRows().length&&this._clearPlaceholder()}regenerateRowPositions(){var e=this.getDisplayRows(),t=1;e.forEach(i=>{i.type==="row"&&(i.setPosition(t),t++)})}setActiveRows(e){this.activeRows=this.activeRows=Object.assign([],e),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){this.displayRows[t]=e,t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(e){return typeof e>"u"?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.fixedHeight||this.adjustTableSize(),this.scrollBarCheck(),this.dispatchExternal("renderComplete"))}scrollBarCheck(){var e=0;this.element.scrollHeight>this.element.clientHeight&&(e=this.element.offsetWidth-this.element.clientWidth),e!==this.scrollbarWidth&&(this.scrollbarWidth=e,this.dispatch("scrollbar-vertical",e))}initializeRenderer(){var e,t={virtual:Db,basic:Lb};typeof this.table.options.renderVertical=="string"?e=t[this.table.options.renderVertical]:e=this.table.options.renderVertical,e?(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),(this.table.element.clientHeight||this.table.options.height)&&!(this.table.options.minHeight&&this.table.options.maxHeight)?this.fixedHeight=!0:this.fixedHeight=!1):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.fixedHeight||this.adjustTableSize(),this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}checkPlaceholder(){this.displayRowsCount?this._clearPlaceholder():this.tableEmpty()}_showPlaceholder(){this.placeholder&&(this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.initializePlaceholder(),this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder(),this.adjustTableSize())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(e){this.activeRows.forEach(function(t){t.normalizeHeight(e)})}adjustTableSize(){let e=this.element.clientHeight,t,i=!1;if(this.renderer.verticalFillMode==="fill"){let n=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){t=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";const s="calc(100% - "+n+"px)";this.element.style.minHeight=t||"calc(100% - "+n+"px)",this.element.style.height=s,this.element.style.maxHeight=s}else this.element.style.height="",this.element.style.height=this.table.element.clientHeight-n+"px",this.element.scrollTop=this.scrollTop;this.renderer.resize(),!this.fixedHeight&&e!=this.element.clientHeight&&(i=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw()),this.scrollBarCheck()}return this._positionPlaceholder(),i}reinitialize(){this.rows.forEach(function(e){e.reinitialize(!0)})}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(this.scrollLeft))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,this.table.browser==="ie"){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class Fb extends ze{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)switch(typeof this.table.options.footerElement){case"string":this.table.options.footerElement[0]==="<"?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement;break}}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){(!this.element.firstChild||e)&&(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class zb extends ze{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach(t=>{e[t]={handler:null,components:[]}}),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach(e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)}),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),n={row:["cell"],cell:["row"]};i=i.filter(s=>{var a=n[e];return s!==e&&(!a||a&&!a.includes(s))}),i.forEach(s=>{var a=this.pseudoTrackers[s].target;this.pseudoTrackers[s].target&&(this.dispatch(s+"-mouseleave",t,a),this.pseudoTrackers[s].target=null)})}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let n of e){let s=i+"-"+n;this.subscriptionChange(s,this.subscriptionChanged.bind(this,i,n))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var n=this.listeners[t].components,s=n.indexOf(e),a=!1;i?s===-1&&(n.push(e),a=!0):this.subscribed(e+"-"+t)||s>-1&&(n.splice(s,1),a=!0),(t==="mouseenter"||t==="mouseleave")&&!this.pseudoTracking&&this.bindPseudoEvents(),a&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,n=this.findTargets(i);n=this.bindComponents(e,n),this.triggerEvents(e,t,n),this.pseudoTracking&&(e=="mouseover"||e=="mouseleave")&&!Object.keys(n).length&&this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let n of e){let s=n.classList?[...n.classList]:[];if(s.filter(d=>this.abortClasses.includes(d)).length)break;let u=s.filter(d=>i.includes(d));for(let d of u)t[this.componentMap[d]]||(t[this.componentMap[d]]=n)}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),n=this.listeners[e],s={},a={},u={};for(let d of i){let p,g=t[d],w=this.previousTargets[d];if(w&&w.target===g)p=w.component;else switch(d){case"row":case"group":(n.components.includes("row")||n.components.includes("cell")||n.components.includes("group"))&&(p=this.table.rowManager.getVisibleRows(!0).find(C=>C.getElement()===g),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[d]=!1));break;case"column":n.components.includes("column")&&(p=this.table.columnManager.findColumn(g));break;case"cell":n.components.includes("cell")&&(s.row instanceof He?p=s.row.findCell(g):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"));break}p&&(s[d]=p,u[d]={target:g,component:p})}return this.previousTargets=u,Object.keys(t).forEach(d=>{let p=s[d];a[d]=p}),a}triggerEvents(e,t,i){var n=this.listeners[e];for(let s in i)i[s]&&n.components.includes(s)&&this.dispatch(s+"-"+e,t,i[s])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class Pb{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&typeof this.bindings[e][i].bind=="function")return this.bindings[e][i].bind(null,t);i!=="then"&&typeof i=="string"&&!i.startsWith("_")&&this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class Ob extends ze{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,n,s,a){var u=++this.requestOrder;if(this.table.destroyed)return Promise.resolve();if(this.dispatchExternal("dataLoading",e),e&&(e.indexOf("{")==0||e.indexOf("[")==0)&&(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,s])){this.loading=!0,s||this.alertLoader(),t=this.chain("data-params",[e,i,s],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams);var d=this.chain("data-load",[e,t,i,s],!1,Promise.resolve([]));return d.then(p=>{if(this.table.destroyed)console.warn("Data Load Response Blocked - Table has been destroyed");else{!Array.isArray(p)&&typeof p=="object"&&(p=this.mapParams(p,this.objectInvert(this.table.options.dataReceiveParams)));var g=this.chain("data-loaded",[p],null,p);u==this.requestOrder?(this.clearAlert(),g!==!1&&(this.dispatchExternal("dataLoaded",g),this.table.rowManager.setData(g,n,typeof a>"u"?!n:a))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}}).catch(p=>{console.error("Data Load Error: ",p),this.dispatchExternal("dataLoadError",p),s||this.alertError(),setTimeout(()=>{this.clearAlert()},this.table.options.dataLoaderErrorTimeout)}).finally(()=>{this.loading=!1})}else return this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,n,typeof a>"u"?!n:a),Promise.resolve()}mapParams(e,t){var i={};for(let n in e)i[t.hasOwnProperty(n)?t[n]:n]=e[n];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){var e=typeof this.table.options.dataLoader=="function"?this.table.options.dataLoader():this.table.options.dataLoader;e&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Hb{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e])if(t)if(i=this.events[e].findIndex(n=>n===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}else delete this.events[e];else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(n=>{n(t)})}_dispatch(){var e=Array.from(arguments),t=e.shift(),i;return this.events[t]&&this.events[t].forEach((n,s)=>{let a=n.apply(this.table,e);s||(i=a)}),i}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class Bb{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort((n,s)=>n.priority-s.priority),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t)if(i=this.events[e].findIndex(n=>n.callback===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}}else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,n){var s=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach((a,u)=>{s=a.callback.apply(this,t.concat([s]))}),s):typeof n=="function"?n():n}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach((n,s)=>{n.callback.apply(this,t)&&(i=!0)}),i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(n=>{n(t)})}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach(i=>{i.callback.apply(this,e)})}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class Nb extends ze{constructor(e){super(e)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(e,t,i){var n="";return typeof this.options(e)<"u"?(n="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(n=n+", Please use the %c"+t+"%c option instead",this._warnUser(n,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;"),i&&(this.table.options[t]=this.table.options[e])):this._warnUser(n,"font-weight: bold;","font-weight: normal;"),!1):!0}checkMsg(e,t){return typeof this.options(e)<"u"?(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1):!0}msg(e){this._warnUser(e)}}class Ib extends ze{constructor(e){super(e),this.deps={},this.props={}}initialize(){this.deps=Object.assign({},this.options("dependencies"))}lookup(e,t,i){if(Array.isArray(e)){for(const s of e){var n=this.lookup(s,t,!0);if(n)break}if(n)return n;this.error(e)}else return t?this.lookupProp(e,t,i):this.lookupKey(e,i)}lookupProp(e,t,i){var n;if(this.props[e]&&this.props[e][t])return this.props[e][t];if(n=this.lookupKey(e,i),n)return this.props[e]||(this.props[e]={}),this.props[e][t]=n[t]||n,this.props[e][t]}lookupKey(e,t){var i;return this.deps[e]?i=this.deps[e]:window[e]?(this.deps[e]=window[e],i=this.deps[e]):t||this.error(e),i}error(e){console.error("Unable to find dependency",e,"Please check documentation and ensure you have imported the required library into your project")}}function Vb(l,e){e&&this.table.columnManager.renderer.reinitializeColumnWidths(l),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function fh(l,e){l.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function Wb(l,e){var t=0,i=this.table.rowManager.element.clientWidth,n=0,s=!1;l.forEach((a,u)=>{a.widthFixed||a.reinitializeWidth(),(this.table.options.responsiveLayout?a.modules.responsive.visible:a.visible)&&(s=a),a.visible&&(t+=a.getWidth())}),s?(n=i-t+s.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(s.setWidth(0),this.table.modules.responsiveLayout.update()),n>0?s.setWidth(n):s.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function $b(l,e){var t=this.table.rowManager.element.getBoundingClientRect().width,i=0,n=0,s=0,a=0,u=[],d=[],p=0,g=0,w=0;function b(_){var S;return typeof _=="string"?_.indexOf("%")>-1?S=t/100*parseInt(_):S=parseInt(_):S=_,S}function C(_,S,F,L){var U=[],H=0,N=0,O=0,oe=s,V=0,W=0,pe=[];function Y(j){return F*(j.column.definition.widthGrow||1)}function he(j){return b(j.width)-F*(j.column.definition.widthShrink||0)}return _.forEach(function(j,xe){var Re=L?he(j):Y(j);j.column.minWidth>=Re?U.push(j):j.column.maxWidth&&j.column.maxWidth<Re?(j.width=j.column.maxWidth,S-=j.column.maxWidth,oe-=L?j.column.definition.widthShrink||1:j.column.definition.widthGrow||1,oe&&(F=Math.floor(S/oe))):(pe.push(j),W+=L?j.column.definition.widthShrink||1:j.column.definition.widthGrow||1)}),U.length?(U.forEach(function(j){H+=L?j.width-j.column.minWidth:j.column.minWidth,j.width=j.column.minWidth}),N=S-H,O=W?Math.floor(N/W):N,V=C(pe,N,O,L)):(V=W?S-Math.floor(S/W)*W:S,pe.forEach(function(j){j.width=L?he(j):Y(j)})),V}this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(t-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),l.forEach(function(_){var S,F,L;_.visible&&(S=_.definition.width,F=parseInt(_.minWidth),S?(L=b(S),i+=L>F?L:F,_.definition.widthShrink&&(d.push({column:_,width:L>F?L:F}),p+=_.definition.widthShrink)):(u.push({column:_,width:0}),s+=_.definition.widthGrow||1))}),n=t-i,a=Math.floor(n/s),w=C(u,n,a,!1),u.length&&w>0&&(u[u.length-1].width+=w),u.forEach(function(_){n-=_.width}),g=Math.abs(w)+n,g>0&&p&&(w=C(d,g,Math.floor(g/p),!0)),w&&d.length&&(d[d.length-1].width-=w),u.forEach(function(_){_.column.setWidth(_.width)}),d.forEach(function(_){_.column.setWidth(_.width)})}var Gb={fitData:Vb,fitDataFill:fh,fitDataTable:fh,fitDataStretch:Wb,fitColumns:$b};const Bi=class Bi extends ee{constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;Bi.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){e.definition.widthGrow&&(e.definition.widthGrow=Number(e.definition.widthGrow)),e.definition.widthShrink&&(e.definition.widthShrink=Number(e.definition.widthShrink))}getMode(){return this.mode}layout(e){var t=this.table.columnManager.columnsByIndex.find(i=>i.definition.variableHeight||i.definition.formatter==="textarea");this.dispatch("layout-refreshing"),Bi.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),t&&this.table.rowManager.normalizeHeight(!0),this.dispatch("layout-refreshed")}};P(Bi,"moduleName","layout"),P(Bi,"modes",Gb);let lo=Bi;var Ub={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};const Cn=class Cn extends ee{constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=ge.deepClone(Cn.langs),this.table.options.columnDefaults.headerFilterPlaceholder!==!1&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&typeof e[i]=="object"?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){e=e||"default";function t(i,n){for(var s in i)typeof i[s]=="object"?(n[s]||(n[s]={}),t(i[s],n[s])):n[s]=i[s]}if(e===!0&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let i=e.split("-")[0];this.langList[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=ge.deepClone(this.langList.default||{}),e!="default"&&t(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=t?e+"|"+t:e,n=i.split("|"),s=this._getLangElement(n,this.locale);return s||""}_getLangElement(e,t){var i=this.lang;return e.forEach(function(n){var s;i&&(s=i[n],typeof s<"u"?i=s:i=!1)}),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach(t=>{t(this.getText(e),this.lang)})}};P(Cn,"moduleName","localize"),P(Cn,"langs",Ub);let ho=Cn;class ph extends ee{constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[],i;return i=this.table.constructor.registry.lookupTable(e),i.forEach(n=>{this.table!==n&&t.push(n)}),t}send(e,t,i,n){var s=this.getConnections(e);s.forEach(a=>{a.tableComms(this.table.element,t,i,n)}),!s.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,n){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,n);console.warn("Inter-table Comms Error - no such module:",t)}}P(ph,"moduleName","comms");var jb=Object.freeze({__proto__:null,CommsModule:ph,LayoutModule:lo,LocalizeModule:ho});const Ze=class Ze{static findTable(e){var t=Ze.registry.lookupTable(e,!0);return Array.isArray(t)&&!t.length?!1:t}};P(Ze,"registry",{tables:[],register(e){Ze.registry.tables.push(e)},deregister(e){var t=Ze.registry.tables.indexOf(e);t>-1&&Ze.registry.tables.splice(t,1)},lookupTable(e,t){var i=[],n,s;if(typeof e=="string"){if(n=document.querySelectorAll(e),n.length)for(var a=0;a<n.length;a++)s=Ze.registry.matchElement(n[a]),s&&i.push(s)}else typeof HTMLElement<"u"&&e instanceof HTMLElement||e instanceof Ze?(s=Ze.registry.matchElement(e),s&&i.push(s)):Array.isArray(e)?e.forEach(function(u){i=i.concat(Ze.registry.lookupTable(u))}):t||console.warn("Table Connection Error - Invalid Selector",e);return i},matchElement(e){return Ze.registry.tables.find(function(t){return e instanceof Ze?t===e:t.element===e})}});let uo=Ze;const fe=class fe extends uo{constructor(){super()}static initializeModuleBinder(e){fe.modulesRegistered||(fe.modulesRegistered=!0,fe._registerModules(jb,!0),e&&fe._registerModules(e))}static _extendModule(e,t,i){if(fe.moduleBindings[e]){var n=fe.moduleBindings[e][t];if(n)if(typeof i=="object")for(let s in i)n[s]=i[s];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",t)}else console.warn("Module Error - module does not exist:",e)}static _registerModules(e,t){var i=Object.values(e);t&&i.forEach(n=>{n.prototype.moduleCore=!0}),fe._registerModule(i)}static _registerModule(e){Array.isArray(e)||(e=[e]),e.forEach(t=>{fe._registerModuleBinding(t),fe._registerModuleExtensions(t)})}static _registerModuleBinding(e){e.moduleName?fe.moduleBindings[e.moduleName]=e:console.error("Unable to bind module, no moduleName defined",e.moduleName)}static _registerModuleExtensions(e){var t=e.moduleExtensions;if(e.moduleExtensions)for(let i in t){let n=t[i];if(fe.moduleBindings[i])for(let s in n)fe._extendModule(i,s,n[s]);else{fe.moduleExtensions[i]||(fe.moduleExtensions[i]={});for(let s in n)fe.moduleExtensions[i][s]||(fe.moduleExtensions[i][s]={}),Object.assign(fe.moduleExtensions[i][s],n[s])}}fe._extendModuleFromQueue(e)}static _extendModuleFromQueue(e){var t=fe.moduleExtensions[e.moduleName];if(t)for(let i in t)fe._extendModule(e.moduleName,i,t[i])}_bindModules(){var e=[],t=[],i=[];this.modules={};for(var n in fe.moduleBindings){let s=fe.moduleBindings[n],a=new s(this);this.modules[n]=a,s.prototype.moduleCore?this.modulesCore.push(a):s.moduleInitOrder?s.moduleInitOrder<0?e.push(a):t.push(a):i.push(a)}e.sort((s,a)=>s.moduleInitOrder>a.moduleInitOrder?1:-1),t.sort((s,a)=>s.moduleInitOrder>a.moduleInitOrder?1:-1),this.modulesRegular=e.concat(i.concat(t))}};P(fe,"moduleBindings",{}),P(fe,"moduleExtensions",{}),P(fe,"modulesRegistered",!1),P(fe,"defaultModules",!1);let co=fe;class Kb extends ze{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.dispatch("alert-show",t),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),typeof e=="function"&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.dispatch("alert-hide",this.type),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}const Dt=class Dt extends co{static extendModule(){Dt.initializeModuleBinder(),Dt._extendModule(...arguments)}static registerModule(){Dt.initializeModuleBinder(),Dt._registerModule(...arguments)}constructor(e,t,i){super(),Dt.initializeModuleBinder(i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new Pb(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Nb(this),this.optionsList=new ch(this,"table constructor"),this.dependencyRegistry=new Ib(this),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout(()=>{this._create()})),this.constructor.registry.register(this)}initializeElement(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement?(this.element=e,!0):typeof e=="string"?(this.element=document.querySelector(e),this.element?!0:(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new Mb(this),this.rowManager=new Ab(this),this.footerManager=new Fb(this),this.dataLoader=new Ob(this),this.alertManager=new Kb(this),this._bindModules(),this.options=this.optionsList.generate(Dt.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Hb(this,this.options,this.options.debugEventsExternal),this.eventBus=new Bb(this.options.debugEventsInternal),this.interactionMonitor=new zb(this),this.dataLoader.initialize(),this.footerManager.initialize(),this.dependencyRegistry.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this.initialized=!0,this._loadInitialData().finally(()=>{this.eventBus.dispatch("table-initialized"),this.externalEvents.dispatch("tableBuilt")})}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if(e.direction!=="rtl")break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e=this.element,t=this.options,i;if(e.tagName==="TABLE"){this.originalElement=this.element,i=document.createElement("div");var n=e.attributes;for(var s in n)typeof n[s]=="object"&&i.setAttribute(n[s].name,n[s].value);e.parentNode.replaceChild(i,e),this.element=e=i}for(e.classList.add("tabulator"),e.setAttribute("role","grid");e.firstChild;)e.removeChild(e.firstChild);t.height&&(t.height=isNaN(t.height)?t.height:t.height+"px",e.style.height=t.height),t.minHeight!==!1&&(t.minHeight=isNaN(t.minHeight)?t.minHeight:t.minHeight+"px",e.style.minHeight=t.minHeight),t.maxHeight!==!1&&(t.maxHeight=isNaN(t.maxHeight)?t.maxHeight:t.maxHeight+"px",e.style.maxHeight=t.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach(i=>{i.initialize()}),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach(i=>{i.initialize()}),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){return this.dataLoader.load(this.options.data).finally(()=>{this.columnManager.verticalAlignHeaders()})}destroy(){var e=this.element;for(this.destroyed=!0,this.constructor.registry.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):e.indexOf("Mac OS")>-1?(this.browser="safari",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}initGuard(e,t){var i,n;return this.options.debugInitialization&&!this.initialized&&(e||(i=new Error().stack.split(`
|
|
53
|
-
`),n=i[0]=="Error"?i[2]:i[1],n[0]==" "?e=n.trim().split(" ")[1].split(".")[1]:e=n.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise((i,n)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(s=>{var a=this.rowManager.findRow(s[this.options.index]);a?(t++,a.updateData(s).then(()=>{t--,t||i()}).catch(u=>{n("Update Error - Unable to update row",s,u)})):n("Update Error - Unable to find row",s)}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}addData(e,t,i){return this.initGuard(),new Promise((n,s)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then(a=>{var u=[];a.forEach(function(d){u.push(d.getComponent())}),n(u)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise((n,s)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(a=>{var u=this.rowManager.findRow(a[this.options.index]);i++,u?u.updateData(a).then(()=>{i--,t.push(u.getComponent()),i||n(t)}):this.rowManager.addRows(a).then(d=>{i--,t.push(d[0].getComponent()),i||n(t)})}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let n=this.rowManager.findRow(i,!0);if(n)t.push(n);else return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found")}return t.sort((i,n)=>this.rowManager.rows.indexOf(i)>this.rowManager.rows.indexOf(n)?1:-1),t.forEach(i=>{i.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),typeof e=="string"&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i,!0).then(n=>n[0].getComponent())}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>i.getComponent()):this.rowManager.addRows(t).then(n=>n[0].getComponent())}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>Promise.resolve(i.getComponent())):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var n=this.rowManager.findRow(e);return n?this.rowManager.scrollToRow(n,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var n=this.rowManager.findRow(e);this.initGuard(),n?n.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.show();else return console.warn("Column Show Error - No matching column found:",e),!1}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.hide();else return console.warn("Column Hide Error - No matching column found:",e),!1}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.visible?t.hide():t.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1}addColumn(e,t,i){var n=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,n).then(s=>s.getComponent())}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var n=this.columnManager.findColumn(e),s=this.columnManager.findColumn(t);this.initGuard(),n?s?this.columnManager.moveColumn(n,s,i):console.warn("Move Error - No matching column found:",s):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise((n,s)=>{var a=this.columnManager.findColumn(e);return a?this.columnManager.scrollToColumn(a,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))})}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){var e=Array.from(arguments);e.shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return this.modules[e]?!0:(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}};P(Dt,"defaultOptions",Tb);let fo=Dt;var pn=fo;class qb extends pn{static extendModule(){pn.initializeModuleBinder(ao),pn._extendModule(...arguments)}static registerModule(){pn.initializeModuleBinder(ao),pn._registerModule(...arguments)}constructor(e,t,i){super(e,t,ao)}}var Xb=qb;const gh={__name:"ActionButton",props:{data:{},index:{}},setup(l){const{can:e}=Os(),t=l;return(i,n)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.unref(e)("delete")?(c.openBlock(),c.createElementBlock("button",{key:0,class:"mx-2 inline-flex items-center justify-center w-5 h-5 rounded-full text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500","data-tooltip":"حذف",onClick:n[0]||(n[0]=s=>c.unref(se).event("deleteBtn",t.data))},n[2]||(n[2]=[c.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-trash-2"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>',1)]))):c.createCommentVNode("",!0),c.unref(e)("update")?(c.openBlock(),c.createElementBlock("button",{key:1,class:"mx-2 inline-flex items-center justify-center w-5 h-5 rounded-full text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500","data-tooltip":"ویرایش",onClick:n[1]||(n[1]=s=>c.unref(se).event("editBtn",t.data))},n[3]||(n[3]=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-file-pen-line"},[c.createElementVNode("path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2"}),c.createElementVNode("path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),c.createElementVNode("path",{d:"M8 18h1"})],-1)]))):c.createCommentVNode("",!0)],64))}},mh={__name:"SelectColumn",props:{data:{default:()=>({})},index:{default:-1},all:{default:!1}},setup(l){const e=l,t=c.ref(!1);se.listen("batch.removed",()=>{t.value=!1}),se.listen("toggle.select.all",n=>{e.all||(t.value=n,se.event("toggle.select",e.data.id))});function i(n){if(e.all)return se.event("toggle.select.all",t.value);se.event("toggle.select",e.data.id)}return(n,s)=>c.withDirectives((c.openBlock(),c.createElementBlock("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>t.value=a),class:"rounded",type:"checkbox",onChange:i,style:{border:"1px dashed rgba(0, 0, 0, 0.2)"}},null,544)),[[c.vModelCheckbox,t.value]])}};let lr;const Yb=({element:l,headers:e,options:t}={element:null,headers:[],options:{}})=>(lr=new Xb(l,{pagination:!1,paginationMode:"remote",layout:"fitDataStretch",resizableColumnFit:!0,paginationSize:5,paginationInitialPage:1,paginationSizeSelector:[3,6,8,10],paginationCounter:"rows",ajaxLoaderLoading:"<div style='display:inline-block; border:4px solid #333; border-radius:10px; background:#fff; font-weight:bold; font-size:16px; color:#000; padding:10px 20px;'>Loading Data</div>",columns:bh(e),...t}),lr);function bh(l){const e=["type","value","align","rules","isHeader","placeholder","text","columns","clearOnSearch","valueProp","labelProp","normalizer","onChange","items","filterResults","label"],t={_select_:{formatter:Zb,formatterParams:{component:mh},titleFormatter:Qb},_actions_:{formatter:Jb,formatterParams:{component:gh}}};return $.cloneDeep(l).map(n=>n.field in t?{...t[n.field],...n}:n).map(n=>{for(const s of e)s in n&&delete n[s];return{...n,headerSort:!1}})}function Jb(l,e){const t=l.getRow().getData(),i=l.getRow().getPosition(),n=document.createElement("div"),s=e.component;return c.createApp(s,{data:t,index:i}).mount(n),n}function Zb(l,e){const t=l.getRow().getData(),i=l.getRow().getPosition(),n=document.createElement("div"),s=e.component;return c.createApp(s,{data:t,index:i}).mount(n),n}function Qb(){const l=document.createElement("div");return c.createApp(mh,{all:!0}).mount(l),l}function vh(l){lr.setData(l)}function ev(l){lr.setColumns(l)}const tv={up:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjEyLjcgMTQ4LjdjNi4yLTYuMiAxNi40LTYuMiAyMi42IDBsMTYwIDE2MGM2LjIgNi4yIDYuMiAxNi40IDAgMjIuNnMtMTYuNCA2LjItMjIuNiAwTDIyNCAxODIuNiA3NS4zIDMzMS4zYy02LjIgNi4yLTE2LjQgNi4yLTIyLjYgMHMtNi4yLTE2LjQgMC0yMi42bDE2MC0xNjB6Ii8+PC9zdmc+",down:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjEyLjcgMzMxLjNjNi4yIDYuMiAxNi40IDYuMiAyMi42IDBsMTYwLTE2MGM2LjItNi4yIDYuMi0xNi40IDAtMjIuNnMtMTYuNC02LjItMjIuNiAwTDIyNCAyOTcuNCA3NS4zIDE0OC43Yy02LjItNi4yLTE2LjQtNi4yLTIyLjYgMHMtNi4yIDE2LjQgMCAyMi42bDE2MCAxNjB6Ii8+PC9zdmc+"},wh=(l="up")=>{const e=document.createElement("img");return e.src=tv[l],e.style.width="10px",e.style.height="10px",e.style.marginLeft="5px",e},yh=(l,e)=>{l._column.titleHolderElement.style.display="flex",l._column.titleHolderElement.style.alignItems="center",l._column.titleHolderElement.appendChild(e)},Ch=l=>{l._column.titleHolderElement.lastChild.remove()};function iv(l,e){let t=[];e.on("tableBuilt",function(){c.watch(()=>l.mainItems,i=>{vh(i)},{immediate:!0}),c.watch(()=>l.flatFields,()=>{const i=bh(l.headers);ev(i)},{deep:!0}),c.watch(()=>l.loadings.mainLoading,i=>{i&&vh([])},{deep:!0})}),e.on("headerClick",(i,n)=>{const s=n.getField();if(!["_index_","_select_","_actions_"].includes(s)){if(t.includes(s+":asc")){let a=t.indexOf(s+":asc");t[a]=s+":desc",Ch(n),yh(n,wh("down"))}else if(t.includes(s+":desc")){let a=t.indexOf(s+":desc");t.splice(a,1),Ch(n)}else yh(n,wh()),t.push(s+":asc");l.sorts=t,l.loadItems()}})}const zT="",Mt=(l,e)=>{const t=l.__vccOpts||l;for(const[i,n]of e)t[i]=n;return t},nv={key:0,id:"paginate"},rv={class:"flex items-center justify-center py-2 lg:px-0 sm:px-6 px-4"},sv={class:"lg:w-5/5 bg-white w-full flex items-center justify-between rounded-lg border pb-3"},ov={class:"sm:flex hidden mx-auto"},av=["onClick"],lv=Mt({__name:"MTablePagination",setup(l){const e=c.inject("store");function t(u){e.paginate(u)}function i(){e.mainPagination.currentPage>1&&t(e.mainPagination.currentPage-1)}function n(u){t(u)}function s(){e.mainPagination.currentPage<e.mainPagination.lastPage&&t(e.mainPagination.currentPage+1)}function a(){let u=[];if(e.mainPagination.lastPage>10){let d=e.mainPagination.currentPage,p=d-1,g=d+1;d!=1&&u.push(1),d!=1&&d!=2&&p!=2&&u.push("..."),p>1&&u.push(p),u.push(d),g<e.mainPagination.lastPage&&u.push(g),d!=e.mainPagination.lastPage&&d!=e.mainPagination.lastPage-1&&g!=e.mainPagination.lastPage-1&&u.push("..."),e.mainPagination.lastPage!=d&&u.push(e.mainPagination.lastPage)}else u=e.mainPagination.lastPage;return u}return(u,d)=>c.unref(e).mainPagination.lastPage?(c.openBlock(),c.createElementBlock("div",nv,[c.createElementVNode("div",rv,[c.createElementVNode("div",sv,[c.createElementVNode("div",ov,[c.createElementVNode("div",{onClick:i,class:"flex items-center px-2 pt-3 text-gray-600 hover:text-indigo-700 cursor-pointer"},d[0]||(d[0]=[c.createElementVNode("svg",{class:"rtl:rotate-180 w-[10px] fill-muted-600",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[c.createElementVNode("path",{d:"M15 239c-9.4 9.4-9.4 24.6 0 33.9L207 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65.9 256 241 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L15 239z"})],-1)])),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(a(),p=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:p},[typeof p=="number"?(c.openBlock(),c.createElementBlock("p",{key:0,class:c.normalizeClass(c.unref(e).mainPagination.currentPage===p?"text-sm font-medium leading-none cursor-pointer text-indigo-700 !border-indigo-400 border-t-[1px] pt-3 mr-4 px-2":"text-sm font-medium leading-none cursor-pointer text-gray-600 hover:text-indigo-700 border-t-[1px] border-transparent hover:border-indigo-400 pt-3 mr-4 px-2"),onClick:g=>n(p)},c.toDisplayString(p),11,av)):(c.openBlock(),c.createElementBlock("p",{key:1,class:c.normalizeClass(["text-sm font-medium leading-none text-gray-600 pt-3 px-2",{"mr-4":a()>1}])},c.toDisplayString(p),3))],64))),128)),c.createElementVNode("div",{onClick:s,class:"flex items-center px-2 pt-3 text-gray-600 hover:text-indigo-700 cursor-pointer"},d[1]||(d[1]=[c.createElementVNode("svg",{class:"ltr:rotate-180 w-[10px] fill-muted-600",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[c.createElementVNode("path",{d:"M15 239c-9.4 9.4-9.4 24.6 0 33.9L207 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65.9 256 241 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L15 239z"})],-1)]))])])])])):c.createCommentVNode("",!0)}},[["__scopeId","data-v-7f626758"]]),hv={key:0,class:"mt-[-20px]"},uv={class:"flex animate-pulse flex-row items-center h-full justify-center"},dv={class:"w-full flex flex-row items-start rtl:mr-8 ltr:ml-8"},cv={key:1,class:"padding: 100px; mt-[-20px] rounded-b-xl bg-white text-center p-[100px] dark:bg-muted-800"},fv={class:"dark:text-muted-200 text-muted-600"},pv={__name:"MTable",setup(l){const e=c.ref(null),t=c.inject("store"),i=c.inject("tableOptions"),n=c.computed(()=>t.mainItems.length===0&&!t.loadings.mainLoading);return c.onMounted(()=>{const s=Yb({options:i,element:e.value,headers:t.headers});iv(t,s)}),(s,a)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",{ref_key:"table",ref:e,class:"mt-2 w-full overflow-x-auto"},null,512),c.unref(t).loadings.mainLoading?(c.openBlock(),c.createElementBlock("div",hv,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(10,u=>c.createElementVNode("div",{key:u,class:c.normalizeClass([{"border-t-0":u===1,"border-b-0":u===10,"bg-muted-50 dark:bg-muted-700":u%2!==0,"bg-white dark:bg-muted-800":u%2===0},"w-full py-4 mx-auto border-b-1"])},[c.createElementVNode("div",uv,[c.createElementVNode("div",dv,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(9,d=>c.createElementVNode("div",{key:d,class:"mx-1 w-[10%] bg-muted-300 dark:bg-muted-900 h-2.5 rounded-md"})),64))])])],2)),64))])):c.createCommentVNode("",!0),n.value?(c.openBlock(),c.createElementBlock("div",cv,[c.createElementVNode("h2",fv,c.toDisplayString(s.$fcTr("not_load_or_existing_data")),1)])):c.createCommentVNode("",!0),c.createVNode(lv)],64))}},gv="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXgiPjxwYXRoIGQ9Ik0xOCA2IDYgMTgiLz48cGF0aCBkPSJtNiA2IDEyIDEyIi8+PC9zdmc+",OT="",mv={key:0,class:"w-full rounded-lg bg-white shadow-secondary-1 shadow-lg border border-muted-300 dark:bg-surface-dark"},bv={class:"border-b-2 flex justify-between border--100 px-6 py-3 text-surface dark:border-white/10 dark:text-white"},vv={key:0,class:"text-primerr-700"},wv={key:1,class:"text-primerr-700"},yv=["src"],Cv={class:"p-6"},Ev={class:"flex justify-end p-3 bg-gray-100 rounded-lg"},xv=Mt({__name:"MTabForm",setup(l){const e=c.inject("store");return(t,i)=>(c.openBlock(),c.createBlock(c.Transition,{name:"fade",appear:""},{default:c.withCtx(()=>[c.unref(e).dialog?(c.openBlock(),c.createElementBlock("div",mv,[c.createElementVNode("div",bv,[c.unref(e).isEditing?(c.openBlock(),c.createElementBlock("b",vv,c.toDisplayString(t.$fcTr("edit")),1)):(c.openBlock(),c.createElementBlock("b",wv,c.toDisplayString(t.$fcTr("add")),1)),c.createElementVNode("img",{style:{"max-width":"18px",cursor:"pointer"},src:c.unref(gv),onClick:i[0]||(i[0]=n=>c.unref(e).dialog=!1)},null,8,yv)]),c.createElementVNode("div",Cv,[c.renderSlot(t.$slots,"default",{},void 0,!0),c.createElementVNode("div",Ev,[c.renderSlot(t.$slots,"actions",{},void 0,!0)])])])):c.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-305ba86b"]]),Rv={class:"flex flex-col text-right mt-4"},_v={class:"mb-5"},Tv={__name:"FormCore",setup(l){const e=c.inject("store"),t=c.ref(null),i=()=>{e.isEditing?e.editItem({...e.form}):e.addItem({...e.form})},n=async()=>{try{t.value.validate().then(()=>{if(!t.value.invalid)return i()})}catch{return}};return se.listen("saveForm",()=>{n()}),(s,a)=>{const u=c.resolveComponent("Vueform");return c.openBlock(),c.createElementBlock("div",Rv,[c.createElementVNode("div",_v,[c.createVNode(u,c.mergeProps({modelValue:c.unref(e).form,"onUpdate:modelValue":a[0]||(a[0]=d=>c.unref(e).form=d)},c.unref(e).structure,{schema:c.unref(e).formFields,columns:{label:12},ref_key:"form$",ref:t,sync:""}),null,16,["modelValue","schema"])])])}}},BT="",kv={class:"fixed z-50 inset-0 overflow-hidden pointer-events-none"},Sv={class:"text-lg font-semibold text-gray-900 flex items-center gap-2 pointer-events-none"},Mv={key:0,class:"text-sm text-gray-500 font-normal"},Lv={class:"flex items-center gap-1 pointer-events-auto"},Dv=["title"],Av={class:"w-4 h-4 text-gray-600 group-hover:text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Fv={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 12H4"},zv={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"},Pv=["title"],Ov={class:"w-4 h-4 text-gray-600 group-hover:text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Hv={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V6a2 2 0 012-2h2M4 16v2a2 2 0 002 2h2m8-16h2a2 2 0 012 2v2m-4 12h2a2 2 0 002-2v-2"},Bv={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 9h6v6H9V9zm0 0V7a2 2 0 012-2h2a2 2 0 012 2v2M9 15v2a2 2 0 002 2h2a2 2 0 002-2v-2"},Nv={class:"flex-shrink-0 bg-gray-50 px-4 py-3 border-t border-gray-200 rounded-b-xl"},Iv={class:"flex justify-end gap-2"},Vv=Mt({__name:"TailwindDialog",props:{title:{default:""},modelValue:{}},emits:["update:modelValue"],setup(l,{emit:e}){c.inject("store");const t=e,i=l,n=c.ref(null),s=c.ref(null),a=c.ref({x:0,y:0}),u=c.ref({width:512,height:window.innerHeight>1080?window.innerHeight*.5:window.innerHeight-100}),d=c.ref(!1),p=c.ref(!1),g=c.ref(!1),w=c.ref(!1),b=c.ref({position:{x:0,y:0},size:{width:512,height:window.innerHeight>1080?window.innerHeight*.5:window.innerHeight-100}});let C=null;const _=c.computed(()=>g.value?{bottom:"1rem",left:"1rem",width:"300px",height:"auto",transform:"none"}:w.value?{top:"1rem",left:"1rem",width:"calc(100vw - 2rem)",height:"calc(100vh - 2rem)",transform:"none"}:{left:"50%",top:"50%",transform:`translate(calc(-50% + ${a.value.x}px), calc(-50% + ${a.value.y}px))`,width:`${u.value.width}px`,height:`${u.value.height}px`,minWidth:"300px",minHeight:"200px",maxWidth:"90vw",maxHeight:"90vh"}),S=c.computed(()=>w.value?{height:"calc(100vh - 2rem - 50px)"}:{height:`${u.value.height-50}px`}),F=c.computed(()=>({minHeight:"100px"}));function L(){t("update:modelValue",!1),U()}function U(){a.value={x:0,y:0};const V=Math.min(window.innerHeight*.9,window.innerHeight>1080?window.innerHeight*.5:window.innerHeight-100);u.value={width:512,height:V},g.value=!1,w.value=!1}function H(){g.value?(a.value={...b.value.position},u.value={...b.value.size},g.value=!1):(b.value={position:{...a.value},size:{...u.value}},g.value=!0,w.value=!1)}function N(){if(!w.value)b.value={position:{...a.value},size:{...u.value}};else{const V=b.value.size.width,W=b.value.size.height,pe=window.innerWidth*.05,Y=window.innerHeight*.05,he=window.innerWidth/2-V/2-pe,j=-(window.innerWidth/2)+V/2+pe,xe=window.innerHeight/2-W/2-Y,Re=-(window.innerHeight/2)+W/2+Y;a.value={x:Math.max(j,Math.min(he,b.value.position.x)),y:Math.max(Re,Math.min(xe,b.value.position.y))},u.value={...b.value.size}}w.value=!w.value,g.value=!1}function O(V){if(w.value||V.target.closest("button"))return;V.preventDefault(),d.value=!0;const W=V.clientX,pe=V.clientY,Y=a.value.x,he=a.value.y;function j(Re){d.value&&(C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const Ve=Re.clientX-W,gt=Re.clientY-pe,Be=Y+Ve,We=he+gt;if(g.value)return;const At=u.value.width,Qe=u.value.height,$e=window.innerWidth*.05,Ni=window.innerHeight*.05,mo=window.innerWidth/2-At/2-$e,bo=-(window.innerWidth/2)+At/2+$e,Zt=window.innerHeight/2-Qe/2-Ni,Ii=-(window.innerHeight/2)+Qe/2+Ni;a.value={x:Math.max(bo,Math.min(mo,Be)),y:Math.max(Ii,Math.min(Zt,We))}}))}function xe(){d.value=!1,C&&(cancelAnimationFrame(C),C=null),document.removeEventListener("mousemove",j,{passive:!0}),document.removeEventListener("mouseup",xe)}document.addEventListener("mousemove",j,{passive:!0}),document.addEventListener("mouseup",xe)}function oe(V){V.preventDefault(),V.stopPropagation(),p.value=!0;const W=V.clientX,pe=V.clientY,Y=u.value.width,he=u.value.height;function j(Re){p.value&&(C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const Ve=Re.clientX-W,gt=Re.clientY-pe,Be=window.innerWidth/2+a.value.x,We=window.innerHeight/2+a.value.y,At=Math.min(window.innerWidth*.9,(Be-window.innerWidth*.05)*2,(window.innerWidth*.95-Be)*2),Qe=Math.min(window.innerHeight*.9,(We-window.innerHeight*.05)*2,(window.innerHeight*.95-We)*2),$e=Math.max(300,Math.min(At,Y+Ve)),Ni=Math.max(200,Math.min(Qe,he+gt));u.value={width:$e,height:Ni}}))}function xe(){p.value=!1,C&&(cancelAnimationFrame(C),C=null),document.removeEventListener("mousemove",j,{passive:!0}),document.removeEventListener("mouseup",xe)}document.addEventListener("mousemove",j,{passive:!0}),document.addEventListener("mouseup",xe)}return c.onMounted(async()=>{await c.nextTick(),a.value={x:0,y:0}}),c.onUnmounted(()=>{C&&cancelAnimationFrame(C)}),(V,W)=>(c.openBlock(),c.createBlock(c.Transition,{name:"fade",appear:""},{default:c.withCtx(()=>[l.modelValue?(c.openBlock(),c.createElementBlock("div",{key:0,onKeydown:c.withKeys(L,["escape"]),class:"relative z-50",role:"dialog"},[g.value?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-30 transition-opacity backdrop-blur-sm",onClick:L})),c.createElementVNode("div",kv,[c.createElementVNode("div",{ref_key:"dialogRef",ref:n,class:c.normalizeClass(["absolute bg-white shadow-2xl border border-gray-200 pointer-events-auto transition-all duration-300",d.value?"select-none":"",p.value?"select-none":"",g.value?"rounded-t-xl shadow-lg":"rounded-xl"]),style:c.normalizeStyle(_.value)},[c.createElementVNode("div",{ref_key:"headerRef",ref:s,class:c.normalizeClass(["flex items-center justify-between px-4 py-3 border-gray-200",g.value?"border-b-0 rounded-t-xl bg-gradient-to-r from-blue-100 to-indigo-100":"border-b rounded-t-xl bg-gradient-to-r from-blue-50 to-indigo-50",d.value?"cursor-grabbing":"cursor-grab"]),onMousedown:O,onDblclick:W[0]||(W[0]=pe=>g.value?H():N())},[c.createElementVNode("h3",Sv,[c.createElementVNode("div",{class:c.normalizeClass(["w-2 h-2 rounded-full",g.value?"bg-orange-500 animate-pulse":"bg-blue-500 animate-pulse"])},null,2),c.createTextVNode(" "+c.toDisplayString(i.title)+" ",1),g.value?(c.openBlock(),c.createElementBlock("span",Mv,"(minimized)")):c.createCommentVNode("",!0)]),c.createElementVNode("div",Lv,[c.createElementVNode("button",{onClick:H,class:"p-1.5 rounded-full hover:bg-white/70 transition-colors group",title:g.value?"Restore":"Minimize"},[(c.openBlock(),c.createElementBlock("svg",Av,[g.value?(c.openBlock(),c.createElementBlock("path",zv)):(c.openBlock(),c.createElementBlock("path",Fv))]))],8,Dv),g.value?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("button",{key:0,onClick:N,class:"p-1.5 rounded-full hover:bg-white/70 transition-colors group",title:w.value?"Restore":"Maximize"},[(c.openBlock(),c.createElementBlock("svg",Ov,[w.value?(c.openBlock(),c.createElementBlock("path",Bv)):(c.openBlock(),c.createElementBlock("path",Hv))]))],8,Pv)),c.createElementVNode("button",{onClick:L,class:"p-1.5 rounded-full hover:bg-red-100 transition-colors group",title:"Close"},W[1]||(W[1]=[c.createElementVNode("svg",{class:"w-4 h-4 text-gray-600 group-hover:text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])],34),c.createVNode(c.Transition,{name:"slide-down"},{default:c.withCtx(()=>[g.value?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",{key:0,class:"flex flex-col overflow-hidden",style:c.normalizeStyle(S.value)},[c.createElementVNode("div",{class:"flex-1 px-4 py-4 overflow-y-auto",style:c.normalizeStyle(F.value)},[c.renderSlot(V.$slots,"default",{},void 0,!0)],4),c.createElementVNode("div",Nv,[c.createElementVNode("div",Iv,[c.renderSlot(V.$slots,"actions",{},()=>[c.createElementVNode("button",{type:"button",class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 transition-colors",onClick:L}," لغو "),c.createElementVNode("button",{type:"button",class:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 transition-colors",onClick:L}," تایید ")],!0)])])],4))]),_:3}),!g.value&&!w.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"absolute bottom-0 right-0 w-4 h-4 cursor-se-resize hover:bg-blue-100 rounded-tl-lg transition-colors z-10",onMousedown:oe,title:"Resize"},W[2]||(W[2]=[c.createElementVNode("svg",{class:"w-full h-full text-gray-400 p-0.5",fill:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{d:"M22 22H20V20h2v2zm0-4H18v-2h4v2zm0-4H16v-2h6v2zm0-4H14v-2h8v2z"})],-1)]),32)):c.createCommentVNode("",!0)],6)])],32)):c.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-cc2284ca"]]),IT="",Eh=Mt({__name:"MDialogForm",setup(l){const e=c.inject("store");return(t,i)=>(c.openBlock(),c.createBlock(Vv,{modelValue:c.unref(e).dialog,"onUpdate:modelValue":i[0]||(i[0]=n=>c.unref(e).dialog=n),title:c.unref(e).isEditing?t.$fcTr("edit"):t.$fcTr("add")},{actions:c.withCtx(()=>[c.renderSlot(t.$slots,"actions",{},void 0,!0)]),default:c.withCtx(()=>[c.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3},8,["modelValue","title"]))}},[["__scopeId","data-v-3c50400f"]]);function Wv(l,e){return Array.isArray(l)?$.every(l,t=>$.isType(t,e)):!1}const $v=(l,e)=>{const t=$.get(l,"field"),i=$.get(l,"valueProp");return Wv(e,"object")?e.map(n=>$.get(n,i)):$.get(e,t)},xh=(l,e)=>$.get(e,l.field),Gv={select:$v,text:xh};function Rh(l,e="",t={}){for(const i in l){const n=l[i],s=e?`${e}.${i}`:i;typeof n=="object"&&n!==null&&(typeof n.normalizer=="function"&&(t.value=n.normalizer),Rh(n,s,t))}return t}const Uv=(l,e)=>{if(typeof l.normalizer=="function")return l.normalizer(e);const t=Rh(l);if(typeof t.value=="function")return t.value(e);const i=Gv[l.type];return i?i(l,e):xh(l,e)},WT="",jv=["disabled"],Kv={key:0},qv={key:1},Xv={key:2},Yv={class:"w-full"},Jv={__name:"MList",setup(l){const e=c.inject("store"),t=c.inject("form.save.key"),i=c.computed(()=>{const u={tab:xv,dialog:Eh};return $.get(u,e.options.formMode)||Eh});function n(){return{}}const s=u=>{let d={...u};for(const p of e.flatFieldsWithoutActions)d[p.field]=Uv(p,u);return d};return(()=>{se.listen("formue.dialog",u=>{e.dialog=u}),se.listen("toggle.select",u=>{if(e.selected.has(u))return e.selected.delete(u);e.selected.add(u)}),se.listen("createBtn",()=>{e.dialog=!0,e.editItemId=!1,e.isEditing=!1,e.form={}}),se.listen("fillForm",u=>{e.dialog=!0,e.editItemId=!1,e.isEditing=!1,e.form=s(u)}),se.listen("editBtn",u=>{e.dialog=!0,e.editItemId=u.id,e.isEditing=!0,e.form=s(u)}),se.listen("handleDialogForm",u=>{e.dialog=u}),se.listen("editTheItem",u=>{edit(u)}),se.listen("addTheItem",u=>{add(u)})})(),(u,d)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.value),null,{actions:c.withCtx(()=>[c.createElementVNode("button",{disabled:c.unref(e).loadings.mainLoading,onClick:d[0]||(d[0]=p=>c.unref(se).event("saveForm")),className:"btn mt-1 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 !bg-green-500 text-base font-medium text-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},[c.unref(e).loadings.mainLoading?(c.openBlock(),c.createElementBlock("span",Kv,d[2]||(d[2]=[c.createElementVNode("b",null,null,-1),c.createElementVNode("b",null,null,-1),c.createElementVNode("b",null,null,-1)]))):c.unref(e).isEditing?(c.openBlock(),c.createElementBlock("span",qv,c.toDisplayString(u.$fcTr("edit")),1)):(c.openBlock(),c.createElementBlock("span",Xv,c.toDisplayString(c.unref(t)||u.$fcTr("save")),1))],8,jv),c.createElementVNode("button",{onClick:d[1]||(d[1]=p=>c.unref(e).dialog=!1),className:"mt-1 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},c.toDisplayString(u.$fcTr("cancel")),1)]),default:c.withCtx(()=>[c.createVNode(Tv)]),_:1})),c.createElementVNode("div",Yv,[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(pv),c.normalizeProps(c.guardReactiveProps(n())),null,16))])],64))}},Zv={TextFilter:()=>{const l=Ti();return{op:{placeholder:l.translate("operator"),columns:4,items:[{value:"$eq",text:l.translate("equal_to")},{value:"$ne",text:l.translate("not_equal_to")},{value:"$gt",text:l.translate("greater_than")},{value:"$lt",text:l.translate("less_than")},{value:"$contains",text:l.translate("look_like")}],"label-prop":"text","value-prop":"value",native:!1,type:"select"},value:{placeholder:l.translate("value"),type:"text",columns:4}}},DateFilter:()=>{const l=Ti();return{op:{placeholder:l.translate("operator"),columns:4,items:[{value:"$eq",text:l.translate("equal_to")},{value:"$between",text:l.translate("between")},{value:"$gt",text:l.translate("greater_than")},{value:"$lt",text:l.translate("less_than")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:Bl({placeholder:l.translate("value"),columns:4})}},NullFilter:()=>{const l=Ti();return{op:{placeholder:l.translate("operator"),columns:4,items:[{value:"$notNull",text:l.translate("not_null")},{value:"$null",text:l.translate("null")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:{type:"hidden",default:!0,columns:4}}},SelectFilter:l=>{const e=Ti();return{op:{placeholder:e.translate("operator"),columns:4,items:[{value:"$in",text:e.translate("in")},{value:"$notIn",text:e.translate("not_in")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:Hl({placeholder:e.translate("value"),items:"filterItems"in l?l.filterItems:l.items,search:!0,columns:4,labelProp:l.labelProp,valueProp:l.valueProp,object:!1})}}};function Qv(l){return c.getCurrentScope()?(c.onScopeDispose(l),!0):!1}function po(l){return typeof l=="function"?l():c.unref(l)}const _h=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ew=Object.prototype.toString,tw=l=>ew.call(l)==="[object Object]",hr=()=>{},iw=nw();function nw(){var l,e;return _h&&((l=window==null?void 0:window.navigator)==null?void 0:l.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function rw(l,e){function t(...i){return new Promise((n,s)=>{Promise.resolve(l(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(n).catch(s)})}return t}const Th=l=>l();function sw(l=Th){const e=c.ref(!0);function t(){e.value=!1}function i(){e.value=!0}const n=(...s)=>{e.value&&l(...s)};return{isActive:c.readonly(e),pause:t,resume:i,eventFilter:n}}function ow(l){return l||c.getCurrentInstance()}function aw(l,e,t={}){const{eventFilter:i=Th,...n}=t;return c.watch(l,rw(i,e),n)}function lw(l,e,t={}){const{eventFilter:i,...n}=t,{eventFilter:s,pause:a,resume:u,isActive:d}=sw(i);return{stop:aw(l,e,{...n,eventFilter:s}),pause:a,resume:u,isActive:d}}function hw(l,e=!0,t){ow()?c.onMounted(l,t):e?l():c.nextTick(l)}function gn(l){var e;const t=po(l);return(e=t==null?void 0:t.$el)!=null?e:t}const ur=_h?window:void 0;function mn(...l){let e,t,i,n;if(typeof l[0]=="string"||Array.isArray(l[0])?([t,i,n]=l,e=ur):[e,t,i,n]=l,!e)return hr;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const s=[],a=()=>{s.forEach(g=>g()),s.length=0},u=(g,w,b,C)=>(g.addEventListener(w,b,C),()=>g.removeEventListener(w,b,C)),d=c.watch(()=>[gn(e),po(n)],([g,w])=>{if(a(),!g)return;const b=tw(w)?{...w}:w;s.push(...t.flatMap(C=>i.map(_=>u(g,C,_,b))))},{immediate:!0,flush:"post"}),p=()=>{d(),a()};return Qv(p),p}let kh=!1;function uw(l,e,t={}){const{window:i=ur,ignore:n=[],capture:s=!0,detectIframe:a=!1}=t;if(!i)return hr;iw&&!kh&&(kh=!0,Array.from(i.document.body.children).forEach(b=>b.addEventListener("click",hr)),i.document.documentElement.addEventListener("click",hr));let u=!0;const d=b=>n.some(C=>{if(typeof C=="string")return Array.from(i.document.querySelectorAll(C)).some(_=>_===b.target||b.composedPath().includes(_));{const _=gn(C);return _&&(b.target===_||b.composedPath().includes(_))}}),g=[mn(i,"click",b=>{const C=gn(l);if(!(!C||C===b.target||b.composedPath().includes(C))){if(b.detail===0&&(u=!d(b)),!u){u=!0;return}e(b)}},{passive:!0,capture:s}),mn(i,"pointerdown",b=>{const C=gn(l);u=!d(b)&&!!(C&&!b.composedPath().includes(C))},{passive:!0}),a&&mn(i,"blur",b=>{setTimeout(()=>{var C;const _=gn(l);((C=i.document.activeElement)==null?void 0:C.tagName)==="IFRAME"&&!(_!=null&&_.contains(i.document.activeElement))&&e(b)},0)})].filter(Boolean);return()=>g.forEach(b=>b())}const dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},cr="__vueuse_ssr_handlers__",dw=cw();function cw(){return cr in dr||(dr[cr]=dr[cr]||{}),dr[cr]}function fw(l,e){return dw[l]||e}function pw(l){return l==null?"any":l instanceof Set?"set":l instanceof Map?"map":l instanceof Date?"date":typeof l=="boolean"?"boolean":typeof l=="string"?"string":typeof l=="object"?"object":Number.isNaN(l)?"any":"number"}const gw={boolean:{read:l=>l==="true",write:l=>String(l)},object:{read:l=>JSON.parse(l),write:l=>JSON.stringify(l)},number:{read:l=>Number.parseFloat(l),write:l=>String(l)},any:{read:l=>l,write:l=>String(l)},string:{read:l=>l,write:l=>String(l)},map:{read:l=>new Map(JSON.parse(l)),write:l=>JSON.stringify(Array.from(l.entries()))},set:{read:l=>new Set(JSON.parse(l)),write:l=>JSON.stringify(Array.from(l))},date:{read:l=>new Date(l),write:l=>l.toISOString()}},Sh="vueuse-storage";function mw(l,e,t,i={}){var n;const{flush:s="pre",deep:a=!0,listenToStorageChanges:u=!0,writeDefaults:d=!0,mergeDefaults:p=!1,shallow:g,window:w=ur,eventFilter:b,onError:C=Y=>{console.error(Y)},initOnMounted:_}=i,S=(g?c.shallowRef:c.ref)(typeof e=="function"?e():e);if(!t)try{t=fw("getDefaultStorage",()=>{var Y;return(Y=ur)==null?void 0:Y.localStorage})()}catch(Y){C(Y)}if(!t)return S;const F=po(e),L=pw(F),U=(n=i.serializer)!=null?n:gw[L],{pause:H,resume:N}=lw(S,()=>oe(S.value),{flush:s,deep:a,eventFilter:b});w&&u&&hw(()=>{mn(w,"storage",W),mn(w,Sh,pe),_&&W()}),_||W();function O(Y,he){w&&w.dispatchEvent(new CustomEvent(Sh,{detail:{key:l,oldValue:Y,newValue:he,storageArea:t}}))}function oe(Y){try{const he=t.getItem(l);if(Y==null)O(he,null),t.removeItem(l);else{const j=U.write(Y);he!==j&&(t.setItem(l,j),O(he,j))}}catch(he){C(he)}}function V(Y){const he=Y?Y.newValue:t.getItem(l);if(he==null)return d&&F!=null&&t.setItem(l,U.write(F)),F;if(!Y&&p){const j=U.read(he);return typeof p=="function"?p(j,F):L==="object"&&!Array.isArray(j)?{...F,...j}:j}else return typeof he!="string"?he:U.read(he)}function W(Y){if(!(Y&&Y.storageArea!==t)){if(Y&&Y.key==null){S.value=F;return}if(!(Y&&Y.key!==l)){H();try{(Y==null?void 0:Y.newValue)!==U.write(S.value)&&(S.value=V(Y))}catch(he){C(he)}finally{Y?c.nextTick(N):N()}}}}function pe(Y){W(Y.detail)}return S}const bw={class:"relative"},go={__name:"MMenu",setup(l){const e=c.ref(null);uw(e,s=>t.value=!1);const t=c.ref(!1),i={isOpen:t.value},n={click:()=>t.value=!t.value};return(s,a)=>(c.openBlock(),c.createElementBlock("div",bw,[c.renderSlot(s.$slots,"activator",c.normalizeProps(c.guardReactiveProps({on:n,props:i})),()=>[c.createElementVNode("button",c.mergeProps({class:"bg-blue-500 text-white px-4 py-2 rounded-md"},c.toHandlers(n,!0))," Open Menu "+c.toDisplayString(t.value),17)]),t.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"absolute top-[35px] left-0 mt-2 w-48 rounded-md shadow-lg z-[1]",ref_key:"target",ref:e},[c.renderSlot(s.$slots,"default",{},()=>[a[0]||(a[0]=c.createElementVNode("ul",{class:"py-2"},[c.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 1"),c.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 2"),c.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 3")],-1))])],512)):c.createCommentVNode("",!0)]))}},KT="",vw={class:"border-muted-200 dark:border-muted-700 dark:bg-muted-800 relative mb-4 w-full rounded-lg border bg-white p-6 transition-all duration-300"},ww={class:"flex flex-col ml-1 border-[rgba(0,0,0,.1)] pb-4"},yw={class:"flex flex-row justify-between mb-4 items-center"},Cw={class:"font-heading text-base font-semibold leading-tight text-muted-800 dark:text-white"},Ew={class:"flex items-center"},xw={class:"z-[1]"},Rw={class:"fc-drop-down-content"},_w={key:0,class:"p-2 text-center"},Tw=["onClick"],kw={class:"text-muted-400 font-sans text-sm"},Sw={class:"flex w-full justify-between align-start"},Mw={class:"w-[12%] flex justify-center items-center"},Lw=["disabled"],Dw={class:"flex border-t dark:border-muted-600 flex-col p-2 mt-2"},Aw={class:"flex items-center"},Fw={class:"font-heading text-base font-semibold leading-tight text-muted-800 dark:text-white"},zw={class:"group-hover:text-red-500"},Pw={class:"my-2 flex overflow-x-auto slimscroll"},Ow={class:"flex"},Hw=["onClick"],Bw={class:"mt-[0px]"},Nw=["onClick"],Iw={key:0,class:"flex items-center mx-2 text-[0.75rem]"},Vw={class:"flex w-full gap-x-2 justify-between !items-end"},Ww={class:"pt-4 md:pt-6"},$w={class:"flex gap-x-2"},Gw=["placeholder"],Uw=Mt({__name:"MFilter",setup(l){const e=c.inject("store");let t=-1;const i=c.ref(!1),n=c.ref({field:""}),s=c.ref(!1),a=c.ref(""),u=b(),d=c.ref(null);function p(N){if(!N)return!1;const O={text:"TextFilter",date:"DateFilter",select:"SelectFilter",map:"NullFilter"},oe=$.get(O,N.type),V=$.get(Zv,oe);return typeof V=="function"?V(N):!1}const g={field:{placeholder:"field",type:"select",native:!1,items:e.headersWithoutActions,"label-prop":"title","value-prop":"field",object:!0,search:!0,trackBy:["title"],columns:2,onChange(N,O,oe){const V=p(N)||[];for(const W in n.value)W!=="field"&&delete n.value[W];w.value={...g,...V},c.nextTick(()=>{try{const W=oe.form$.el$("value");W&&"clear"in W&&W.clear(),W&&"updateItems"in W&&W.updateItems()}catch{}})}}},w=c.ref({...g});function b(){const N=window.location.pathname.replace(/^\/|\/$/g,"")+"-filters";return mw(N,{},localStorage,{mergeDefaults:!0})}function C(){e.filters.push($.cloneDeep(n.value)),n.value={}}function _(){t!==-1&&e.filters.splice(t,1,n.value),i.value=!1,n.value={}}function S(N,O){i.value=!0,t=O,n.value=N,c.nextTick(()=>{n.value.op=N.op,n.value.value=N.value})}function F(N){e.filters=e.filters.filter(O=>O!==N)}function L(){e.filters=[],e.loadItems()}function U(){if(!s.value)return s.value=!0,d.value.focus();a.value&&(u.value[a.value]={...e.filters},s.value=!1,a.value="",d.value.blur())}function H(){e.loadItems()}return(N,O)=>{const oe=c.resolveComponent("Vueform");return c.withDirectives((c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["accordion-content",{hide:c.unref(e).panel!=="filters"}])},[c.createElementVNode("div",vw,[c.createElementVNode("div",ww,[c.createElementVNode("div",yw,[c.createElementVNode("h3",Cw,c.toDisplayString(N.$fcTr("filter_data")),1),c.createElementVNode("div",Ew,[c.createVNode(go,null,{activator:c.withCtx(({props:V,on:W})=>[c.createElementVNode("button",c.mergeProps(c.toHandlers(W,!0),{class:[V.isOpen?"before:hidden":"before:block","fc-filter-choose is-button rounded is-button-default min-w-[130px]"]}),[c.createElementVNode("span",xw,c.toDisplayString(N.$fcTr("choose_filter")),1)],16)]),default:c.withCtx(()=>[c.createElementVNode("div",Rw,[Object.keys(c.unref(u)).length===0?(c.openBlock(),c.createElementBlock("p",_w,c.toDisplayString(N.$fcTr("not_filter_create_yes")),1)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(u),(V,W)=>(c.openBlock(),c.createElementBlock("a",{class:"group rounded flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-100 dark:hover:bg-muted-700 justify-between rtl:pl-4 rtl:pr-5",key:W,onClick:c.withModifiers(pe=>c.unref(e).filters=Object.values(V),["stop"])},[c.createElementVNode("p",kw,c.toDisplayString(W),1),O[6]||(O[6]=c.createElementVNode("svg",{"data-v-74b3417a":"","aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-muted-500"},[c.createElementVNode("path",{"data-v-74b3417a":"",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1))],8,Tw))),128))])]),_:1})])]),c.createElementVNode("div",Sw,[c.createVNode(oe,{modelValue:n.value,"onUpdate:modelValue":O[0]||(O[0]=V=>n.value=V),schema:w.value,sync:!0,class:"w-[100%] justify-between ml-4",columns:{label:12}},null,8,["modelValue","schema"]),c.createElementVNode("div",Mw,[i.value?(c.openBlock(),c.createElementBlock("button",{key:1,class:"!border-dashed is-button-default is-button w-full rounded-full font-bold py-1 px-2 !border-green-400 !text-green-400 hover:!bg-green-50",onClick:_},[c.createTextVNode(c.toDisplayString(N.$fcTr("edit_filter"))+" ",1),O[8]||(O[8]=c.createElementVNode("svg",{class:"icon h-4 w-4",viewBox:"0 0 24 24"},[c.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1))])):(c.openBlock(),c.createElementBlock("button",{key:0,disabled:!n.value.field,class:"disabled:cursor-not-allowed disabled:hover:bg-transparent !border-dashed !h-[86%] is-button-default is-button w-full rounded font-bold py-1 px-2 !border-green-400 !text-green-400 dark:active:hover:bg-muted-600 active:hover:!bg-green-50",onClick:C},[O[7]||(O[7]=c.createElementVNode("svg",{class:"icon h-4 ml-1 w-4",viewBox:"0 0 24 24"},[c.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),c.createTextVNode(" "+c.toDisplayString(N.$fcTr("add_filter")),1)],8,Lw))])])]),c.withDirectives(c.createElementVNode("div",Dw,[c.createElementVNode("div",Aw,[c.createElementVNode("h3",Fw,c.toDisplayString(N.$fcTr("active_filter")),1),c.createElementVNode("button",{onClick:L,class:"is-button group hover:text-red-500 hover:border-red-500 w-fit text-muted-600 dark:text-muted-400 !text-xs border !px-3 !py-0 !h-[1.5rem] mx-2 !rounded-full"},[c.createElementVNode("span",zw,c.toDisplayString(N.$fcTr("clear_all")),1),O[9]||(O[9]=c.createElementVNode("svg",{stroke:"currentColor",width:"1em",height:"1em",class:"ml-1 rtl:ml-1 rtl:mr-1 group-hover:fill-red-500 dark:fill-muted-400 fill-muted-600",viewBox:"0 0 512 512"},[c.createElementVNode("path",{d:"M340 148L488 0l24 24L364 172l52 52L257.2 483.9 240 512l-23.3-23.3L23.3 295.3 0 272l28.1-17.2L288 96l52 52zM51.4 278.1l47.9 47.9 33.4-33.4L144 281.4 166.6 304l-11.3 11.3-33.4 33.4L233.9 460.6l89.6-146.6L197.9 188.6 51.4 278.1zM340.6 286l34.9-57.2-92.4-92.4L226 171.4 340.6 286z"})],-1))])]),c.createElementVNode("div",Pw,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(e).filters,(V,W)=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:W},[c.createElementVNode("div",Ow,[c.createElementVNode("span",{class:"flex px-3 font-sans transition-shadow duration-300 py-1 text-[0.75rem] cursor-pointer rounded-full bg-primary-100 text-primary-500 border-primary-100 dark:border-primary-500 dark:text-primary-500 border dark:bg-transparent",onClick:pe=>S(V,W)},[c.createElementVNode("span",Bw,c.toDisplayString(c.unref($.get)(V,"field.title")),1),c.createElementVNode("button",{class:"text-white font-bold rounded px-1 hover:bg-primary-500 hover:text-black-500",onClick:c.withModifiers(pe=>F(V),["stop"])},O[10]||(O[10]=[c.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-primary-500"},[c.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1)]),8,Nw)],8,Hw)]),c.unref(e).filters.length-1!==W?(c.openBlock(),c.createElementBlock("span",Iw,c.toDisplayString(N.$fcTr("&")),1)):c.createCommentVNode("",!0)],64))),128))])],512),[[c.vShow,c.unref(e).filters.length>0]]),c.createElementVNode("div",Vw,[c.createElementVNode("button",{onClick:O[1]||(O[1]=V=>c.unref(e).panel=""),class:"is-button text-muted-500 rounded hover:text-red-500 !underline focus-within:!outline-none"},c.toDisplayString(N.$fcTr("cancel")),1),c.createElementVNode("div",Ww,[c.createElementVNode("div",$w,[c.createElementVNode("button",{onClick:O[5]||(O[5]=c.withModifiers(V=>Object.keys(c.unref(e).filters).length!==0?U():"",["self"])),class:c.normalizeClass([{"!bg-muted-100 dark:!bg-muted-700 ltr:pr-1":s.value," focus:outline-none !cursor-not-allowed":Object.keys(c.unref(e).filters).length===0},"transitionX-inp is-button rounded is-button-default"])},[c.createElementVNode("span",{onClick:O[2]||(O[2]=c.withModifiers(V=>Object.keys(c.unref(e).filters).length!==0?U():"",["self"])),class:c.normalizeClass({" bg-green-500 px-2 py-1 rounded text-muted-50":s.value," focus:outline-none !cursor-not-allowed":Object.keys(c.unref(e).filters).length===0})},c.toDisplayString(N.$fcTr("save")),3),c.createElementVNode("span",{class:c.normalizeClass(["transitionX-inp overflow-hidden flex items-center justify-between",s.value?"w-[221px] opacity-1 ltr:pl-3 rtl:mr-3":"opacity-0 w-[0px]"])},[c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":O[3]||(O[3]=V=>a.value=V),class:c.normalizeClass(["fc-focus py-1 rounded px-2 dark:bg-muted-800",s.value?" border border-1":"flex "]),placeholder:N.$fcTr("filter_save_placeholder"),ref_key:"filterNameInp",ref:d},null,10,Gw),[[c.vModelText,a.value]]),c.createElementVNode("span",{class:"px-2",onClick:O[4]||(O[4]=V=>s.value=!1)},O[11]||(O[11]=[c.createElementVNode("svg",{"data-v-74b3417a":"","aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-primary-500"},[c.createElementVNode("path",{"data-v-74b3417a":"",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1)]))],2)],2),c.createElementVNode("button",{onClick:H,class:"is-button rounded bg-primary-500 dark:bg-primary-500 hover:enabled:bg-primary-400 dark:hover:enabled:bg-primary-400 text-white hover:enabled:shadow-lg hover:enabled:shadow-primary-500/50 dark:hover:enabled:shadow-primary-800/20 focus-visible:outline-primary-400/70 focus-within:outline-primary-400/70 focus-visible:bg-primary-500 active:enabled:bg-primary-500 dark:focus-visible:outline-primary-400 dark:focus-within:outline-primary-400 dark:focus-visible:bg-primary-500 dark:active:enabled:bg-primary-500"},c.toDisplayString(N.$fcTr("filter")),1)])])])])],2)),[[c.vShow,c.unref(e).panel==="filters"]])}}},[["__scopeId","data-v-c58a2751"]]),XT="",jw={id:"tooltip",class:"tooltip"},Kw=Mt({__name:"MTooltip",setup(l){return c.onMounted(()=>{const e=document.getElementById("tooltip");function t(n){const s=n.target.closest("[data-tooltip]");if(s){const a=s.getAttribute("data-tooltip");e.textContent=a,e.style.left=`${n.pageX+10}px`,e.style.top=`${n.pageY+10}px`,e.classList.add("visible")}}function i(){e.classList.remove("visible")}document.addEventListener("mouseover",t),document.addEventListener("mouseout",i)}),(e,t)=>(c.openBlock(),c.createElementBlock("div",jw))}},[["__scopeId","data-v-d7c03134"]]),JT="",qw={key:0,class:"w-full border bg-white rounded p-2 flex align-center mt-2"},Xw=["onClick"],Yw={__name:"MHeaderBox",setup(l){const e=c.inject("store");let t=null;c.watch(()=>e.panel,n=>{e.panel==="headerBox"&&e.headersWithoutActions.forEach(s=>{t=document.querySelector(`[tabulator-field="${s.field}"]`),t.innerHTML=t.innerHTML+'<span class="fc-remove"><button class="text-white font-bold rounded px-1" onclick=""><svg aria-hidden="true" viewBox="0 0 24 24" class="h-4 w-4 text-primary-500"><path data-v-74b3417a="" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6 6 18M6 6l12 12"></path></svg></button></span>'})});function i(n){n.isHeader=!n.isHeader}return(n,s)=>c.unref(e).panel==="headerBox"?(c.openBlock(),c.createElementBlock("div",qw,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(e).flatFields,a=>(c.openBlock(),c.createElementBlock("div",{key:a.field,class:c.normalizeClass(["px-1 mx-1 cursor-pointer divide-y rounded",{"bg-primary-600 text-white":a.isHeader}]),onClick:u=>i(a)},c.toDisplayString(a.title),11,Xw))),128))])):c.createCommentVNode("",!0)}},Jw=["disabled"],Zw={__name:"BatchActions",setup(l){const e=c.inject("store"),t=c.ref([]);se.listen("toggle.select",n=>{t.value.includes(n)?t.value=t.value.filter(s=>s!==n):t.value.push(n)});function i(){se.event("dialog.confirm",{description:" آیا از حذف این "+t.value.length+" آیتم ، مطمئن هستید؟ ",title:"حذف دسته جمعی",icon:"fluent:delete-dismiss-24-regular",confirmFunc:async()=>{const n=await e.remove(t.value);return t.value=[],se.event("batch.removed"),n}})}return(n,s)=>(c.openBlock(),c.createBlock(c.Transition,{name:"fade"},{default:c.withCtx(()=>[c.createElementVNode("button",{class:"fc-header-icon-btn !bg-red-100","data-tooltip":"حذف دسته جمعی",disabled:!t.value.length,onClick:i},s[0]||(s[0]=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},[c.createElementVNode("rect",{width:"16",height:"16",fill:"none"}),c.createElementVNode("path",{fill:"#f00",d:"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5M11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1zm1.958 1l-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47M8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5"})],-1)]),8,Jw)]),_:1}))}},Qw={class:"flex items-center gap-3 relative hover:bg-muted-200 dark:hover:bg-muted-700 rounded-lg px-5 pl-3 rtl:pl-8 rtl:pr-5 py-2 duration-300"},ey=["modelValue"],ty={class:"text-success-500 peer-disabled:opacity-75"},iy={class:"font-heading text-muted-800 text-xs font-semibold leading-tight dark:text-white"},ny={__name:"SelectColumnItem",props:{checked:{default:!1},columnName:{default:""}},setup(l){return(e,t)=>(c.openBlock(),c.createElementBlock("div",Qw,[c.createElementVNode("div",{class:c.normalizeClass(["nui-focus block focus-within:outline-current rounded-full",JSON.parse(l.checked)?"is-checked":"is-unchecked"])},[c.createElementVNode("input",{modelValue:l.checked,type:"checkbox",class:"peer cursor-pointer disabled:cursor-not-allowed","true-value":"true","false-value":"false",onClick:t[0]||(t[0]=i=>e.$emit("toggle"))},null,8,ey),c.createElementVNode("label",ty,[c.createElementVNode("div",{class:c.normalizeClass(["rtl:left-[auto] rtl:!right-0 ltr:right-[auto] ltr:left-0",JSON.parse(l.checked)?"is-opaque":""])},null,2),t[1]||(t[1]=c.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 52 52","data-v-3e8a7b5f":""},[c.createElementVNode("circle",{cx:"26",cy:"26",r:"25",fill:"none",stroke:"currentColor"}),c.createElementVNode("path",{fill:"none",stroke:"currentColor",d:"m14.1 27.2 7.1 7.2 16.7-16.8"})],-1))])],2),c.createElementVNode("div",null,[c.createElementVNode("h6",iy,c.toDisplayString(l.columnName),1)])]))}},ZT="",ry={class:"fc-header"},sy={class:"fc-header-left-sid"},oy={class:"z-[1]"},ay={class:"bg-muted-200 dark:bg-muted-800 cursor-pointer rounded-xl fm-light-shadow"},ly={class:"text-muted-400 font-sans text-xs"},hy={class:"bg-white dark:bg-muted-800 rounded-xl pt-1 rtl:text-right ltr:text-left fm-light-shadow"},uy={class:"m-3 mt-2 text-muted-600 dark:text-muted-200"},dy={class:"p-2"},cy={key:0,"data-tooltip":"فیلتر",class:"fm-header-rigth-sid flex w-full sm:w-auto rtl:flex-row-reverse rtl:justify-end"},fy={key:0},py={class:"group/nui-input relative rtl:"},gy=["placeholder"],my={class:"ltr:left-0 text-muted-400 group-focus-within/nui-input:text-primary-500 absolute end-0 rtl:start-0 top-0 flex items-center justify-center transition-colors duration-300 peer-disabled:cursor-not-allowed peer-disabled:opacity-75 h-10 w-10"},by={key:0,class:"icon h-[1.15rem] w-[1.15rem]",width:"1em",height:"1em",viewBox:"0 0 24 24"},vy={key:1,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",class:"icon animate-spin"},wy=Mt({__name:"MButtonBox",setup(l){const{can:e}=Os(),t=c.inject("store");function i(b){b===t.panel?t.panel="":t.panel=b}const n=c.ref(null);c.onMounted(()=>{n.value=document.body.getAttribute("dir")});const s=c.computed(()=>t.flatFields.find(b=>b.field==="_select_")),a=c.computed(()=>!!s.value.isHeader);function u(){s.value.isHeader=!s.value.isHeader,s.value.isHeader||t.selected.clear()}const d=c.ref(!1);function p(){d.value=!0,t.loadItems().finally(()=>d.value=!1)}const g=$.debounce(p,600);function w(){window.open(ye.defaults.baseURL+t.generateQuery())}return(b,C)=>(c.openBlock(),c.createElementBlock("div",ry,[c.createElementVNode("div",sy,[c.unref(e)("create")?(c.openBlock(),c.createElementBlock("button",{key:0,class:"fc-plus-btn","data-tooltip":"افزودن",onClick:C[0]||(C[0]=_=>c.unref(se).event("createBtn"))},C[5]||(C[5]=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-plus"},[c.createElementVNode("path",{d:"M5 12h14"}),c.createElementVNode("path",{d:"M12 5v14"})],-1)]))):c.createCommentVNode("",!0),c.createVNode(go,null,{activator:c.withCtx(({on:_,props:S})=>[c.createElementVNode("button",c.mergeProps({class:S.isOpen?"before:block":"before:hidden"},S,c.toHandlers(_,!0),{class:"fc-header-icon-btn fc-drop-down-btn min-w-[130px]"}),[c.createElementVNode("span",oy,c.toDisplayString(b.$fcTr("export")),1)],16)]),default:c.withCtx(()=>[c.createElementVNode("div",ay,[c.createElementVNode("a",{class:"group flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-300 dark:hover:bg-muted-700 rounded-xl justify-end flex-row-reverse",onClick:w},[c.createElementVNode("p",ly,c.toDisplayString(b.$fcTr("export_as_excel")),1),C[6]||(C[6]=c.createElementVNode("svg",{class:"fill-muted-400 w-3.5 mx-2",viewBox:"0 0 512 512"},[c.createElementVNode("path",{d:"M48 448V64c0-8.8 7.2-16 16-16H224v80c0 17.7 14.3 32 32 32h80V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V154.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0H64zm90.9 233.3c-8.1-10.5-23.2-12.3-33.7-4.2s-12.3 23.2-4.2 33.7L161.6 320l-44.5 57.3c-8.1 10.5-6.3 25.5 4.2 33.7s25.5 6.3 33.7-4.2L192 359.1l37.1 47.6c8.1 10.5 23.2 12.3 33.7 4.2s12.3-23.2 4.2-33.7L222.4 320l44.5-57.3c8.1-10.5 6.3-25.5-4.2-33.7s-25.5-6.3-33.7 4.2L192 280.9l-37.1-47.6z"})],-1))])])]),_:1}),c.createElementVNode("button",{class:"fc-header-icon-btn","data-tooltip":"رفرش",onClick:C[1]||(C[1]=(..._)=>c.unref(t).reloadData&&c.unref(t).reloadData(..._))},[(c.openBlock(),c.createElementBlock("svg",{class:c.normalizeClass({spin:c.unref(t).loadings.mainLoading}),viewBox:"0 0 512 512"},C[7]||(C[7]=[c.createElementVNode("path",{d:"M371.2 122.9C340.3 96.2 300 80 256 80C158.8 80 80 158.8 80 256s78.8 176 176 176c39.7 0 76.2-13.1 105.6-35.2c10.6-8 25.6-5.8 33.6 4.8s5.8 25.6-4.8 33.6C353 463.3 306.4 480 256 480C132.3 480 32 379.7 32 256S132.3 32 256 32c57.3 0 109.6 21.5 149.2 56.9l30.5-30.5c6.6-6.6 15.6-10.3 25-10.3C480.2 48 496 63.8 496 83.3V200c0 13.3-10.7 24-24 24H355.3c-19.5 0-35.3-15.8-35.3-35.3c0-9.4 3.7-18.3 10.3-25l40.8-40.8zm76.8-9L385.9 176H448V113.9z"},null,-1)]),2))]),c.createElementVNode("button",{class:c.normalizeClass(["fc-header-icon-btn",{"fm-active-btn":a.value}]),"data-tooltip":"انتخاب گروهی",onClick:u},C[8]||(C[8]=[c.createElementVNode("svg",{viewBox:"0 0 512 512"},[c.createElementVNode("path",{d:"M384 48c8.8 0 16 7.2 16 16V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H384zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM80 112v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H96c-8.8 0-16 7.2-16 16zM96 352c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H96zm80-224c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H200c-13.3 0-24 10.7-24 24zm32 128c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H232c-13.3 0-24 10.7-24 24zM176 384c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H200c-13.3 0-24 10.7-24 24zm-4.7-140.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L112 257.4 99.3 244.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l24 24c6.2 6.2 16.4 6.2 22.6 0l48-48z"})],-1)]),2),a.value?(c.openBlock(),c.createBlock(Zw,{key:1})):c.createCommentVNode("",!0),c.createVNode(go,{"close-on-content-click":!0},{activator:c.withCtx(({props:_,on:S})=>[c.createElementVNode("button",c.mergeProps(c.toHandlers(S,!0),{class:["fc-header-icon-btn",[_.isOpen?"light:!bg-white dark:bg-muted-800":"",_.isOpen?n.value==="rtl"?"expanded-rtl":"expanded2":""]],"data-tooltip":"انتخاب سرستون"}),C[9]||(C[9]=[c.createElementVNode("svg",{viewBox:"0 0 448 512",class:"z-[1]"},[c.createElementVNode("path",{d:"M64 448c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32H384c17.7 0 32 14.3 32 32V416c0 17.7-14.3 32-32 32H64zM0 416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96V416zM128 288c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16V272c0 8.8 7.2 16 16 16zm176 48c0 8.8 7.2 16 16 16s16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16V336zm-80-80c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16z"})],-1)]),16)]),default:c.withCtx(()=>[c.createElementVNode("div",hy,[c.createElementVNode("div",uy,c.toDisplayString(b.$fcTr("custom_column")),1),c.createElementVNode("ul",dy,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(t).flatFieldsWithoutActions,_=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:_.field},[_.title?(c.openBlock(),c.createBlock(ny,{key:0,"column-name":_.title,checked:_.isHeader,onToggle:S=>_.isHeader=!_.isHeader},null,8,["column-name","checked","onToggle"])):c.createCommentVNode("",!0)],64))),128))])])]),_:1})]),c.unref(e)("filter")?(c.openBlock(),c.createElementBlock("div",cy,[c.createElementVNode("button",{class:c.normalizeClass(["test fc-header-icon-btn transform transition-all",c.unref(t).panel==="filters"?"!bg-white dark:!bg-muted-800 !rounded-b-none ":""]),onClick:C[2]||(C[2]=_=>i("filters"))},[c.createVNode(c.Transition,{name:"scale"},{default:c.withCtx(()=>[c.unref(t).panel==="filters"?(c.openBlock(),c.createElementBlock("div",fy,C[10]||(C[10]=[c.createElementVNode("span",null,null,-1)]))):c.createCommentVNode("",!0)]),_:1}),(c.openBlock(),c.createElementBlock("svg",{class:c.normalizeClass(c.unref(t).panel==="filters"?"light:!fill-primary-700":""),stroke:"currentColor",viewBox:"0 0 512 512"},C[11]||(C[11]=[c.createElementVNode("path",{d:"M0 73.7C0 50.7 18.7 32 41.7 32H470.3c23 0 41.7 18.7 41.7 41.7c0 9.6-3.3 18.9-9.4 26.3L336 304.5V447.7c0 17.8-14.5 32.3-32.3 32.3c-7.3 0-14.4-2.5-20.1-7l-92.5-73.4c-9.6-7.6-15.1-19.1-15.1-31.3V304.5L9.4 100C3.3 92.6 0 83.3 0 73.7zM55 80L218.6 280.8c3.5 4.3 5.4 9.6 5.4 15.2v68.4l64 50.8V296c0-5.5 1.9-10.9 5.4-15.2L457 80H55z"},null,-1)]),2))],2),c.createElementVNode("div",py,[c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":C[3]||(C[3]=_=>c.unref(t).searchParam=_),type:"text",class:"nui-focus px-4! border-muted-300 text-muted-600 placeholder:text-muted-300 dark:border-muted-700 dark:bg-muted-900/75 dark:text-muted-200 dark:placeholder:text-muted-500 dark:focus:border-muted-700 peer w-full border bg-white font-sans transition-all duration-300 disabled:cursor-not-allowed disabled:opacity-75 h-10 py-2 text-sm leading-5 pe-4 ps-9 rounded-full",placeholder:b.$fcTr("search"),onKeyup:C[4]||(C[4]=(..._)=>c.unref(g)&&c.unref(g)(..._))},null,40,gy),[[c.vModelText,c.unref(t).searchParam]]),c.createElementVNode("div",my,[d.value?(c.openBlock(),c.createElementBlock("svg",vy,C[13]||(C[13]=[c.createElementVNode("path",{d:"M457 372c11.5 6.6 26.3 2.7 31.8-9.3C503.7 330.2 512 294.1 512 256C512 122.7 410.1 13.2 280 1.1C266.8-.1 256 10.7 256 24v0c0 13.3 10.8 23.9 24 25.4C383.5 61.2 464 149.2 464 256c0 29.3-6.1 57.3-17 82.6c-5.3 12.2-1.5 26.8 10 33.5v0z"},null,-1)]))):(c.openBlock(),c.createElementBlock("svg",by,C[12]||(C[12]=[c.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[c.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),c.createElementVNode("path",{d:"m21 21l-4.35-4.35"})],-1)])))])])])):c.createCommentVNode("",!0)]))}},[["__scopeId","data-v-121187ed"]]),yy={};function Cy(l,e){return c.openBlock(),c.createElementBlock("div")}const Ey=Mt(yy,[["render",Cy]]),ek="",xy={class:"fixed z-50 inset-0 overflow-hidden pointer-events-none"},Ry={class:"absolute bg-white shadow-2xl border border-gray-200 pointer-events-auto transition-all duration-300 rounded-xl",style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"400px","max-width":"90vw"}},_y={class:"flex items-center justify-between px-4 py-3 border-gray-200 border-b rounded-t-xl bg-gradient-to-r from-red-50 to-orange-50"},Ty={class:"flex flex-col overflow-hidden"},ky={class:"px-4 py-4 overflow-y-auto"},Sy={class:"mb-5 flex flex-row flex-wrap"},My={class:"flex-shrink-0 bg-gray-50 px-4 py-3 border-t border-gray-200 rounded-b-xl"},Ly={class:"flex justify-end gap-2"},Dy=["disabled"],Ay={key:0},Fy={key:1},zy=Mt({__name:"MDeleteDialog",setup(l){const e=c.inject("store"),t=c.ref(!1);let i="";return se.listen("deleteBtn",n=>{t.value=!0,i=n.id}),se.listen("handleDeleteDialog",n=>{t.value=n}),(n,s)=>(c.openBlock(),c.createBlock(c.Transition,{name:"fade",appear:""},{default:c.withCtx(()=>[t.value?(c.openBlock(),c.createElementBlock("div",{key:0,onKeydown:s[4]||(s[4]=c.withKeys(a=>t.value=!1,["escape"])),class:"relative z-50",role:"dialog"},[c.createElementVNode("div",{class:"fixed inset-0 bg-black bg-opacity-30 transition-opacity backdrop-blur-sm",onClick:s[0]||(s[0]=a=>t.value=!1)}),c.createElementVNode("div",xy,[c.createElementVNode("div",Ry,[c.createElementVNode("div",_y,[s[6]||(s[6]=c.createElementVNode("h3",{class:"text-lg font-semibold text-gray-900 flex items-center gap-2"},[c.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),c.createTextVNode(" حذف ")],-1)),c.createElementVNode("button",{onClick:s[1]||(s[1]=a=>t.value=!1),class:"p-1.5 rounded-full hover:bg-red-100 transition-colors group",title:"Close"},s[5]||(s[5]=[c.createElementVNode("svg",{class:"w-4 h-4 text-gray-600 group-hover:text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),c.createElementVNode("div",Ty,[c.createElementVNode("div",ky,[c.createElementVNode("div",Sy,c.toDisplayString(n.$fcTr("alert_to_delete")),1)]),c.createElementVNode("div",My,[c.createElementVNode("div",Ly,[c.createElementVNode("button",{onClick:s[2]||(s[2]=a=>t.value=!1),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-1 transition-colors"},c.toDisplayString(n.$fcTr("no")),1),c.createElementVNode("button",{disabled:c.unref(e).loadings.mainLoading,class:"px-4 py-2 text-sm font-medium text-white bg-red-600 border border-transparent rounded-lg hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-1 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:s[3]||(s[3]=a=>c.unref(e).remove(c.unref(i)))},[c.unref(e).loadings.mainLoading?(c.openBlock(),c.createElementBlock("span",Fy,"loading")):(c.openBlock(),c.createElementBlock("span",Ay,c.toDisplayString(n.$fcTr("yes")),1))],8,Dy)])])])])])],32)):c.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-144e4312"]]),Py=({listen:l,store:e})=>{se.listen("reloadData",()=>{e.reloadData()})},Oy={__name:"MCrud",props:{options:{default:()=>({})},structure:{default:()=>({})},hiddenActions:{default:()=>[]},fields:{default:()=>[]},tableOptions:{default:()=>({})},dir:{default:()=>Ti().dir},route:{default:"route"}},emits:["mounted"],setup(l,{emit:e}){const t=l,i=e,n=kg({fields:t.fields,hiddenActions:t.hiddenActions,options:t.options,structure:t.structure,route:t.route,query:c.inject("formue.query")||!1});return c.provide("store",n),c.provide("tableOptions",{dir:t.dir,...t.tableOptions}),document.body.setAttribute("dir",t.dir),c.onMounted(()=>{i("mounted")}),Py({store:n}),c.onUnmounted(()=>{n.$dispose(),n.reset()}),(s,a)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createVNode(wy),c.createVNode(Uw),c.createVNode(Yw),c.createVNode(Jv),c.createVNode(Ey),c.createVNode(zy),c.createVNode(Kw),c.renderSlot(s.$slots,"extra")],64))}};Te.ActionButton=gh,Te.MCrud=Oy,Te.emitter=se,Te.fields=Nl,Te.install=Sg,Te.registerFields=Wl,Te.setEmitter=Na,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})});
|
|
53
|
+
`),n=i[0]=="Error"?i[2]:i[1],n[0]==" "?e=n.trim().split(" ")[1].split(".")[1]:e=n.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise((i,n)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(s=>{var a=this.rowManager.findRow(s[this.options.index]);a?(t++,a.updateData(s).then(()=>{t--,t||i()}).catch(u=>{n("Update Error - Unable to update row",s,u)})):n("Update Error - Unable to find row",s)}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}addData(e,t,i){return this.initGuard(),new Promise((n,s)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then(a=>{var u=[];a.forEach(function(d){u.push(d.getComponent())}),n(u)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise((n,s)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(a=>{var u=this.rowManager.findRow(a[this.options.index]);i++,u?u.updateData(a).then(()=>{i--,t.push(u.getComponent()),i||n(t)}):this.rowManager.addRows(a).then(d=>{i--,t.push(d[0].getComponent()),i||n(t)})}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let n=this.rowManager.findRow(i,!0);if(n)t.push(n);else return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found")}return t.sort((i,n)=>this.rowManager.rows.indexOf(i)>this.rowManager.rows.indexOf(n)?1:-1),t.forEach(i=>{i.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),typeof e=="string"&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i,!0).then(n=>n[0].getComponent())}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>i.getComponent()):this.rowManager.addRows(t).then(n=>n[0].getComponent())}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>Promise.resolve(i.getComponent())):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var n=this.rowManager.findRow(e);return n?this.rowManager.scrollToRow(n,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var n=this.rowManager.findRow(e);this.initGuard(),n?n.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.show();else return console.warn("Column Show Error - No matching column found:",e),!1}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.hide();else return console.warn("Column Hide Error - No matching column found:",e),!1}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.visible?t.hide():t.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1}addColumn(e,t,i){var n=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,n).then(s=>s.getComponent())}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var n=this.columnManager.findColumn(e),s=this.columnManager.findColumn(t);this.initGuard(),n?s?this.columnManager.moveColumn(n,s,i):console.warn("Move Error - No matching column found:",s):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise((n,s)=>{var a=this.columnManager.findColumn(e);return a?this.columnManager.scrollToColumn(a,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))})}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){var e=Array.from(arguments);e.shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return this.modules[e]?!0:(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}};P(Dt,"defaultOptions",Tb);let fo=Dt;var pn=fo;class qb extends pn{static extendModule(){pn.initializeModuleBinder(ao),pn._extendModule(...arguments)}static registerModule(){pn.initializeModuleBinder(ao),pn._registerModule(...arguments)}constructor(e,t,i){super(e,t,ao)}}var Xb=qb;const gh={__name:"ActionButton",props:{data:{},index:{}},setup(l){const{can:e}=Os(),t=l;return(i,n)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.unref(e)("delete")?(c.openBlock(),c.createElementBlock("button",{key:0,class:"mx-2 inline-flex items-center justify-center w-5 h-5 rounded-full text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500","data-tooltip":"حذف",onClick:n[0]||(n[0]=s=>c.unref(se).event("deleteBtn",t.data))},n[2]||(n[2]=[c.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-trash-2"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>',1)]))):c.createCommentVNode("",!0),c.unref(e)("update")?(c.openBlock(),c.createElementBlock("button",{key:1,class:"mx-2 inline-flex items-center justify-center w-5 h-5 rounded-full text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500","data-tooltip":"ویرایش",onClick:n[1]||(n[1]=s=>c.unref(se).event("editBtn",t.data))},n[3]||(n[3]=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-file-pen-line"},[c.createElementVNode("path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2"}),c.createElementVNode("path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),c.createElementVNode("path",{d:"M8 18h1"})],-1)]))):c.createCommentVNode("",!0)],64))}},mh={__name:"SelectColumn",props:{data:{default:()=>({})},index:{default:-1},all:{default:!1}},setup(l){const e=l,t=c.ref(!1);se.listen("batch.removed",()=>{t.value=!1}),se.listen("toggle.select.all",n=>{e.all||(t.value=n,se.event("toggle.select",e.data.id))});function i(n){if(e.all)return se.event("toggle.select.all",t.value);se.event("toggle.select",e.data.id)}return(n,s)=>c.withDirectives((c.openBlock(),c.createElementBlock("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>t.value=a),class:"rounded",type:"checkbox",onChange:i,style:{border:"1px dashed rgba(0, 0, 0, 0.2)"}},null,544)),[[c.vModelCheckbox,t.value]])}};let lr;const Yb=({element:l,headers:e,options:t}={element:null,headers:[],options:{}})=>(lr=new Xb(l,{pagination:!1,paginationMode:"remote",layout:"fitDataStretch",resizableColumnFit:!0,paginationSize:5,paginationInitialPage:1,paginationSizeSelector:[3,6,8,10],paginationCounter:"rows",ajaxLoaderLoading:"<div style='display:inline-block; border:4px solid #333; border-radius:10px; background:#fff; font-weight:bold; font-size:16px; color:#000; padding:10px 20px;'>Loading Data</div>",columns:bh(e),...t}),lr);function bh(l){const e=["type","value","align","rules","isHeader","placeholder","text","columns","clearOnSearch","valueProp","labelProp","normalizer","onChange","items","filterResults","label"],t={_select_:{formatter:Zb,formatterParams:{component:mh},titleFormatter:Qb},_actions_:{formatter:Jb,formatterParams:{component:gh}}};return $.cloneDeep(l).map(n=>n.field in t?{...t[n.field],...n}:n).map(n=>{for(const s of e)s in n&&delete n[s];return{...n,headerSort:!1}})}function Jb(l,e){const t=l.getRow().getData(),i=l.getRow().getPosition(),n=document.createElement("div"),s=e.component;return c.createApp(s,{data:t,index:i}).mount(n),n}function Zb(l,e){const t=l.getRow().getData(),i=l.getRow().getPosition(),n=document.createElement("div"),s=e.component;return c.createApp(s,{data:t,index:i}).mount(n),n}function Qb(){const l=document.createElement("div");return c.createApp(mh,{all:!0}).mount(l),l}function vh(l){lr.setData(l)}function ev(l){lr.setColumns(l)}const tv={up:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjEyLjcgMTQ4LjdjNi4yLTYuMiAxNi40LTYuMiAyMi42IDBsMTYwIDE2MGM2LjIgNi4yIDYuMiAxNi40IDAgMjIuNnMtMTYuNCA2LjItMjIuNiAwTDIyNCAxODIuNiA3NS4zIDMzMS4zYy02LjIgNi4yLTE2LjQgNi4yLTIyLjYgMHMtNi4yLTE2LjQgMC0yMi42bDE2MC0xNjB6Ii8+PC9zdmc+",down:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjEyLjcgMzMxLjNjNi4yIDYuMiAxNi40IDYuMiAyMi42IDBsMTYwLTE2MGM2LjItNi4yIDYuMi0xNi40IDAtMjIuNnMtMTYuNC02LjItMjIuNiAwTDIyNCAyOTcuNCA3NS4zIDE0OC43Yy02LjItNi4yLTE2LjQtNi4yLTIyLjYgMHMtNi4yIDE2LjQgMCAyMi42bDE2MCAxNjB6Ii8+PC9zdmc+"},wh=(l="up")=>{const e=document.createElement("img");return e.src=tv[l],e.style.width="10px",e.style.height="10px",e.style.marginLeft="5px",e},yh=(l,e)=>{l._column.titleHolderElement.style.display="flex",l._column.titleHolderElement.style.alignItems="center",l._column.titleHolderElement.appendChild(e)},Ch=l=>{l._column.titleHolderElement.lastChild.remove()};function iv(l,e){let t=[];e.on("tableBuilt",function(){c.watch(()=>l.mainItems,i=>{vh(i)},{immediate:!0}),c.watch(()=>l.flatFields,()=>{const i=bh(l.headers);ev(i)},{deep:!0}),c.watch(()=>l.loadings.mainLoading,i=>{i&&vh([])},{deep:!0})}),e.on("headerClick",(i,n)=>{const s=n.getField();if(!["_index_","_select_","_actions_"].includes(s)){if(t.includes(s+":asc")){let a=t.indexOf(s+":asc");t[a]=s+":desc",Ch(n),yh(n,wh("down"))}else if(t.includes(s+":desc")){let a=t.indexOf(s+":desc");t.splice(a,1),Ch(n)}else yh(n,wh()),t.push(s+":asc");l.sorts=t,l.loadItems()}})}const zT="",Mt=(l,e)=>{const t=l.__vccOpts||l;for(const[i,n]of e)t[i]=n;return t},nv={key:0,id:"paginate"},rv={class:"flex items-center justify-center py-2 lg:px-0 sm:px-6 px-4"},sv={class:"lg:w-5/5 bg-white w-full flex items-center justify-between rounded-lg border pb-3"},ov={class:"sm:flex hidden mx-auto"},av=["onClick"],lv=Mt({__name:"MTablePagination",setup(l){const e=c.inject("store");function t(u){e.paginate(u)}function i(){e.mainPagination.currentPage>1&&t(e.mainPagination.currentPage-1)}function n(u){t(u)}function s(){e.mainPagination.currentPage<e.mainPagination.lastPage&&t(e.mainPagination.currentPage+1)}function a(){let u=[];if(e.mainPagination.lastPage>10){let d=e.mainPagination.currentPage,p=d-1,g=d+1;d!=1&&u.push(1),d!=1&&d!=2&&p!=2&&u.push("..."),p>1&&u.push(p),u.push(d),g<e.mainPagination.lastPage&&u.push(g),d!=e.mainPagination.lastPage&&d!=e.mainPagination.lastPage-1&&g!=e.mainPagination.lastPage-1&&u.push("..."),e.mainPagination.lastPage!=d&&u.push(e.mainPagination.lastPage)}else u=e.mainPagination.lastPage;return u}return(u,d)=>c.unref(e).mainPagination.lastPage?(c.openBlock(),c.createElementBlock("div",nv,[c.createElementVNode("div",rv,[c.createElementVNode("div",sv,[c.createElementVNode("div",ov,[c.createElementVNode("div",{onClick:i,class:"flex items-center px-2 pt-3 text-gray-600 hover:text-indigo-700 cursor-pointer"},d[0]||(d[0]=[c.createElementVNode("svg",{class:"rtl:rotate-180 w-[10px] fill-muted-600",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[c.createElementVNode("path",{d:"M15 239c-9.4 9.4-9.4 24.6 0 33.9L207 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65.9 256 241 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L15 239z"})],-1)])),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(a(),p=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:p},[typeof p=="number"?(c.openBlock(),c.createElementBlock("p",{key:0,class:c.normalizeClass(c.unref(e).mainPagination.currentPage===p?"text-sm font-medium leading-none cursor-pointer text-indigo-700 !border-indigo-400 border-t-[1px] pt-3 mr-4 px-2":"text-sm font-medium leading-none cursor-pointer text-gray-600 hover:text-indigo-700 border-t-[1px] border-transparent hover:border-indigo-400 pt-3 mr-4 px-2"),onClick:g=>n(p)},c.toDisplayString(p),11,av)):(c.openBlock(),c.createElementBlock("p",{key:1,class:c.normalizeClass(["text-sm font-medium leading-none text-gray-600 pt-3 px-2",{"mr-4":a()>1}])},c.toDisplayString(p),3))],64))),128)),c.createElementVNode("div",{onClick:s,class:"flex items-center px-2 pt-3 text-gray-600 hover:text-indigo-700 cursor-pointer"},d[1]||(d[1]=[c.createElementVNode("svg",{class:"ltr:rotate-180 w-[10px] fill-muted-600",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[c.createElementVNode("path",{d:"M15 239c-9.4 9.4-9.4 24.6 0 33.9L207 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65.9 256 241 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L15 239z"})],-1)]))])])])])):c.createCommentVNode("",!0)}},[["__scopeId","data-v-7f626758"]]),hv={key:0,class:"mt-[-20px]"},uv={class:"flex animate-pulse flex-row items-center h-full justify-center"},dv={class:"w-full flex flex-row items-start rtl:mr-8 ltr:ml-8"},cv={key:1,class:"padding: 100px; mt-[-20px] rounded-b-xl bg-white text-center p-[100px] dark:bg-muted-800"},fv={class:"dark:text-muted-200 text-muted-600"},pv={__name:"MTable",setup(l){const e=c.ref(null),t=c.inject("store"),i=c.inject("tableOptions"),n=c.computed(()=>t.mainItems.length===0&&!t.loadings.mainLoading);return c.onMounted(()=>{const s=Yb({options:i,element:e.value,headers:t.headers});iv(t,s)}),(s,a)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",{ref_key:"table",ref:e,class:"mt-2 w-full overflow-x-auto"},null,512),c.unref(t).loadings.mainLoading?(c.openBlock(),c.createElementBlock("div",hv,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(10,u=>c.createElementVNode("div",{key:u,class:c.normalizeClass([{"border-t-0":u===1,"border-b-0":u===10,"bg-muted-50 dark:bg-muted-700":u%2!==0,"bg-white dark:bg-muted-800":u%2===0},"w-full py-4 mx-auto border-b-1"])},[c.createElementVNode("div",uv,[c.createElementVNode("div",dv,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(9,d=>c.createElementVNode("div",{key:d,class:"mx-1 w-[10%] bg-muted-300 dark:bg-muted-900 h-2.5 rounded-md"})),64))])])],2)),64))])):c.createCommentVNode("",!0),n.value?(c.openBlock(),c.createElementBlock("div",cv,[c.createElementVNode("h2",fv,c.toDisplayString(s.$fcTr("not_load_or_existing_data")),1)])):c.createCommentVNode("",!0),c.createVNode(lv)],64))}},gv="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXgiPjxwYXRoIGQ9Ik0xOCA2IDYgMTgiLz48cGF0aCBkPSJtNiA2IDEyIDEyIi8+PC9zdmc+",OT="",mv={key:0,class:"w-full rounded-lg bg-white shadow-secondary-1 shadow-lg border border-muted-300 dark:bg-surface-dark"},bv={class:"border-b-2 flex justify-between border--100 px-6 py-3 text-surface dark:border-white/10 dark:text-white"},vv={key:0,class:"text-primerr-700"},wv={key:1,class:"text-primerr-700"},yv=["src"],Cv={class:"p-6"},Ev={class:"flex justify-end p-3 bg-gray-100 rounded-lg"},xv=Mt({__name:"MTabForm",setup(l){const e=c.inject("store");return(t,i)=>(c.openBlock(),c.createBlock(c.Transition,{name:"fade",appear:""},{default:c.withCtx(()=>[c.unref(e).dialog?(c.openBlock(),c.createElementBlock("div",mv,[c.createElementVNode("div",bv,[c.unref(e).isEditing?(c.openBlock(),c.createElementBlock("b",vv,c.toDisplayString(t.$fcTr("edit")),1)):(c.openBlock(),c.createElementBlock("b",wv,c.toDisplayString(t.$fcTr("add")),1)),c.createElementVNode("img",{style:{"max-width":"18px",cursor:"pointer"},src:c.unref(gv),onClick:i[0]||(i[0]=n=>c.unref(e).dialog=!1)},null,8,yv)]),c.createElementVNode("div",Cv,[c.renderSlot(t.$slots,"default",{},void 0,!0),c.createElementVNode("div",Ev,[c.renderSlot(t.$slots,"actions",{},void 0,!0)])])])):c.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-305ba86b"]]),Rv={class:"flex flex-col text-right mt-4"},_v={class:"mb-5"},Tv={__name:"FormCore",setup(l){const e=c.inject("store"),t=c.ref(null),i=()=>{e.isEditing?e.editItem({...e.form}):e.addItem({...e.form})},n=async()=>{try{t.value.validate().then(()=>{if(!t.value.invalid)return i()})}catch{return}};return se.listen("saveForm",()=>{n()}),(s,a)=>{const u=c.resolveComponent("Vueform");return c.openBlock(),c.createElementBlock("div",Rv,[c.createElementVNode("div",_v,[c.createVNode(u,c.mergeProps({modelValue:c.unref(e).form,"onUpdate:modelValue":a[0]||(a[0]=d=>c.unref(e).form=d)},c.unref(e).structure,{schema:c.unref(e).formFields,columns:{label:12},ref_key:"form$",ref:t,sync:""}),null,16,["modelValue","schema"])])])}}},BT="",kv={class:"fixed z-50 inset-0 overflow-hidden pointer-events-none"},Sv={class:"text-lg font-semibold text-gray-900 flex items-center gap-2 pointer-events-none"},Mv={key:0,class:"text-sm text-gray-500 font-normal"},Lv={class:"flex items-center gap-1 pointer-events-auto"},Dv=["title"],Av={class:"w-4 h-4 text-gray-600 group-hover:text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Fv={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 12H4"},zv={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"},Pv=["title"],Ov={class:"w-4 h-4 text-gray-600 group-hover:text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Hv={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V6a2 2 0 012-2h2M4 16v2a2 2 0 002 2h2m8-16h2a2 2 0 012 2v2m-4 12h2a2 2 0 002-2v-2"},Bv={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 9h6v6H9V9zm0 0V7a2 2 0 012-2h2a2 2 0 012 2v2M9 15v2a2 2 0 002 2h2a2 2 0 002-2v-2"},Nv={class:"flex-shrink-0 bg-gray-50 px-4 py-3 border-t border-gray-200 rounded-b-xl"},Iv={class:"flex justify-end gap-2"},Vv=Mt({__name:"TailwindDialog",props:{title:{default:""},modelValue:{}},emits:["update:modelValue"],setup(l,{emit:e}){c.inject("store");const t=e,i=l,n=c.ref(null),s=c.ref(null),a=c.ref({x:0,y:0}),u=c.ref({width:512,height:window.innerHeight>1080?window.innerHeight*.5:window.innerHeight-100}),d=c.ref(!1),p=c.ref(!1),g=c.ref(!1),w=c.ref(!1),b=c.ref({position:{x:0,y:0},size:{width:512,height:window.innerHeight>1080?window.innerHeight*.5:window.innerHeight-100}});let C=null;const _=c.computed(()=>g.value?{bottom:"1rem",left:"1rem",width:"300px",height:"auto",transform:"none"}:w.value?{top:"1rem",left:"1rem",width:"calc(100vw - 2rem)",height:"calc(100vh - 2rem)",transform:"none"}:{left:"50%",top:"50%",transform:`translate(calc(-50% + ${a.value.x}px), calc(-50% + ${a.value.y}px))`,width:`${u.value.width}px`,height:`${u.value.height}px`,minWidth:"300px",minHeight:"200px",maxWidth:"90vw",maxHeight:"90vh"}),S=c.computed(()=>w.value?{height:"calc(100vh - 2rem - 50px)"}:{height:`${u.value.height-50}px`}),F=c.computed(()=>({minHeight:"100px"}));function L(){t("update:modelValue",!1),U()}function U(){a.value={x:0,y:0};const V=Math.min(window.innerHeight*.9,window.innerHeight>1080?window.innerHeight*.5:window.innerHeight-100);u.value={width:512,height:V},g.value=!1,w.value=!1}function H(){g.value?(a.value={...b.value.position},u.value={...b.value.size},g.value=!1):(b.value={position:{...a.value},size:{...u.value}},g.value=!0,w.value=!1)}function N(){if(!w.value)b.value={position:{...a.value},size:{...u.value}};else{const V=b.value.size.width,W=b.value.size.height,pe=window.innerWidth*.05,Y=window.innerHeight*.05,he=window.innerWidth/2-V/2-pe,j=-(window.innerWidth/2)+V/2+pe,xe=window.innerHeight/2-W/2-Y,Re=-(window.innerHeight/2)+W/2+Y;a.value={x:Math.max(j,Math.min(he,b.value.position.x)),y:Math.max(Re,Math.min(xe,b.value.position.y))},u.value={...b.value.size}}w.value=!w.value,g.value=!1}function O(V){if(w.value||V.target.closest("button"))return;V.preventDefault(),d.value=!0;const W=V.clientX,pe=V.clientY,Y=a.value.x,he=a.value.y;function j(Re){d.value&&(C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const Ve=Re.clientX-W,gt=Re.clientY-pe,Be=Y+Ve,We=he+gt;if(g.value)return;const At=u.value.width,Qe=u.value.height,$e=window.innerWidth*.05,Ni=window.innerHeight*.05,mo=window.innerWidth/2-At/2-$e,bo=-(window.innerWidth/2)+At/2+$e,Zt=window.innerHeight/2-Qe/2-Ni,Ii=-(window.innerHeight/2)+Qe/2+Ni;a.value={x:Math.max(bo,Math.min(mo,Be)),y:Math.max(Ii,Math.min(Zt,We))}}))}function xe(){d.value=!1,C&&(cancelAnimationFrame(C),C=null),document.removeEventListener("mousemove",j,{passive:!0}),document.removeEventListener("mouseup",xe)}document.addEventListener("mousemove",j,{passive:!0}),document.addEventListener("mouseup",xe)}function oe(V){V.preventDefault(),V.stopPropagation(),p.value=!0;const W=V.clientX,pe=V.clientY,Y=u.value.width,he=u.value.height;function j(Re){p.value&&(C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const Ve=Re.clientX-W,gt=Re.clientY-pe,Be=window.innerWidth/2+a.value.x,We=window.innerHeight/2+a.value.y,At=Math.min(window.innerWidth*.9,(Be-window.innerWidth*.05)*2,(window.innerWidth*.95-Be)*2),Qe=Math.min(window.innerHeight*.9,(We-window.innerHeight*.05)*2,(window.innerHeight*.95-We)*2),$e=Math.max(300,Math.min(At,Y+Ve)),Ni=Math.max(200,Math.min(Qe,he+gt));u.value={width:$e,height:Ni}}))}function xe(){p.value=!1,C&&(cancelAnimationFrame(C),C=null),document.removeEventListener("mousemove",j,{passive:!0}),document.removeEventListener("mouseup",xe)}document.addEventListener("mousemove",j,{passive:!0}),document.addEventListener("mouseup",xe)}return c.onMounted(async()=>{await c.nextTick(),a.value={x:0,y:0}}),c.onUnmounted(()=>{C&&cancelAnimationFrame(C)}),(V,W)=>(c.openBlock(),c.createBlock(c.Transition,{name:"fade",appear:""},{default:c.withCtx(()=>[l.modelValue?(c.openBlock(),c.createElementBlock("div",{key:0,onKeydown:c.withKeys(L,["escape"]),class:"relative z-50",role:"dialog"},[g.value?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-30 transition-opacity backdrop-blur-sm",onClick:L})),c.createElementVNode("div",kv,[c.createElementVNode("div",{ref_key:"dialogRef",ref:n,class:c.normalizeClass(["absolute bg-white shadow-2xl border border-gray-200 pointer-events-auto transition-all duration-300",d.value?"select-none":"",p.value?"select-none":"",g.value?"rounded-t-xl shadow-lg":"rounded-xl"]),style:c.normalizeStyle(_.value)},[c.createElementVNode("div",{ref_key:"headerRef",ref:s,class:c.normalizeClass(["flex items-center justify-between px-4 py-3 border-gray-200",g.value?"border-b-0 rounded-t-xl bg-gradient-to-r from-blue-100 to-indigo-100":"border-b rounded-t-xl bg-gradient-to-r from-blue-50 to-indigo-50",d.value?"cursor-grabbing":"cursor-grab"]),onMousedown:O,onDblclick:W[0]||(W[0]=pe=>g.value?H():N())},[c.createElementVNode("h3",Sv,[c.createElementVNode("div",{class:c.normalizeClass(["w-2 h-2 rounded-full",g.value?"bg-orange-500 animate-pulse":"bg-blue-500 animate-pulse"])},null,2),c.createTextVNode(" "+c.toDisplayString(i.title)+" ",1),g.value?(c.openBlock(),c.createElementBlock("span",Mv,"(minimized)")):c.createCommentVNode("",!0)]),c.createElementVNode("div",Lv,[c.createElementVNode("button",{onClick:H,class:"p-1.5 rounded-full hover:bg-white/70 transition-colors group",title:g.value?"Restore":"Minimize"},[(c.openBlock(),c.createElementBlock("svg",Av,[g.value?(c.openBlock(),c.createElementBlock("path",zv)):(c.openBlock(),c.createElementBlock("path",Fv))]))],8,Dv),g.value?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("button",{key:0,onClick:N,class:"p-1.5 rounded-full hover:bg-white/70 transition-colors group",title:w.value?"Restore":"Maximize"},[(c.openBlock(),c.createElementBlock("svg",Ov,[w.value?(c.openBlock(),c.createElementBlock("path",Bv)):(c.openBlock(),c.createElementBlock("path",Hv))]))],8,Pv)),c.createElementVNode("button",{onClick:L,class:"p-1.5 rounded-full hover:bg-red-100 transition-colors group",title:"Close"},W[1]||(W[1]=[c.createElementVNode("svg",{class:"w-4 h-4 text-gray-600 group-hover:text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])],34),c.createVNode(c.Transition,{name:"slide-down"},{default:c.withCtx(()=>[g.value?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",{key:0,class:"flex flex-col overflow-hidden",style:c.normalizeStyle(S.value)},[c.createElementVNode("div",{class:"flex-1 px-4 py-4 overflow-y-auto",style:c.normalizeStyle(F.value)},[c.renderSlot(V.$slots,"default",{},void 0,!0)],4),c.createElementVNode("div",Nv,[c.createElementVNode("div",Iv,[c.renderSlot(V.$slots,"actions",{},()=>[c.createElementVNode("button",{type:"button",class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 transition-colors",onClick:L}," لغو "),c.createElementVNode("button",{type:"button",class:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 transition-colors",onClick:L}," تایید ")],!0)])])],4))]),_:3}),!g.value&&!w.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"absolute bottom-0 right-0 w-4 h-4 cursor-se-resize hover:bg-blue-100 rounded-tl-lg transition-colors z-10",onMousedown:oe,title:"Resize"},W[2]||(W[2]=[c.createElementVNode("svg",{class:"w-full h-full text-gray-400 p-0.5",fill:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{d:"M22 22H20V20h2v2zm0-4H18v-2h4v2zm0-4H16v-2h6v2zm0-4H14v-2h8v2z"})],-1)]),32)):c.createCommentVNode("",!0)],6)])],32)):c.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-cc2284ca"]]),IT="",Eh=Mt({__name:"MDialogForm",setup(l){const e=c.inject("store");return(t,i)=>(c.openBlock(),c.createBlock(Vv,{modelValue:c.unref(e).dialog,"onUpdate:modelValue":i[0]||(i[0]=n=>c.unref(e).dialog=n),title:c.unref(e).isEditing?t.$fcTr("edit"):t.$fcTr("add")},{actions:c.withCtx(()=>[c.renderSlot(t.$slots,"actions",{},void 0,!0)]),default:c.withCtx(()=>[c.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3},8,["modelValue","title"]))}},[["__scopeId","data-v-3c50400f"]]);function Wv(l,e){return Array.isArray(l)?$.every(l,t=>$.isType(t,e)):!1}const $v=(l,e)=>{const t=$.get(l,"field"),i=$.get(l,"valueProp");return Wv(e,"object")?e.map(n=>$.get(n,i)):$.get(e,t)},xh=(l,e)=>$.get(e,l.field),Gv={select:$v,text:xh};function Rh(l,e="",t={}){for(const i in l){const n=l[i],s=e?`${e}.${i}`:i;typeof n=="object"&&n!==null&&(typeof n.normalizer=="function"&&(t.value=n.normalizer),Rh(n,s,t))}return t}const Uv=(l,e)=>{if(typeof l.normalizer=="function")return l.normalizer(e);const t=Rh(l);if(typeof t.value=="function")return t.value(e);const i=Gv[l.type];return i?i(l,e):xh(l,e)},WT="",jv=["disabled"],Kv={key:0},qv={key:1},Xv={key:2},Yv={class:"w-full"},Jv={__name:"MList",setup(l){const e=c.inject("store"),t=c.inject("tableComponent"),i=c.inject("form.save.key"),n=c.computed(()=>{const d={tab:xv,dialog:Eh};return $.get(d,e.options.formMode)||Eh});function s(){return{}}const a=d=>{let p={...d};for(const g of e.flatFieldsWithoutActions)p[g.field]=Uv(g,d);return p};return(()=>{se.listen("formue.dialog",d=>{e.dialog=d}),se.listen("toggle.select",d=>{if(e.selected.has(d))return e.selected.delete(d);e.selected.add(d)}),se.listen("createBtn",()=>{e.dialog=!0,e.editItemId=!1,e.isEditing=!1,e.form={}}),se.listen("fillForm",d=>{e.dialog=!0,e.editItemId=!1,e.isEditing=!1,e.form=a(d)}),se.listen("editBtn",d=>{e.dialog=!0,e.editItemId=d.id,e.isEditing=!0,e.form=a(d)}),se.listen("handleDialogForm",d=>{e.dialog=d}),se.listen("editTheItem",d=>{edit(d)}),se.listen("addTheItem",d=>{add(d)})})(),(d,p)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.value),null,{actions:c.withCtx(()=>[c.createElementVNode("button",{disabled:c.unref(e).loadings.mainLoading,onClick:p[0]||(p[0]=g=>c.unref(se).event("saveForm")),className:"btn mt-1 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 !bg-green-500 text-base font-medium text-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},[c.unref(e).loadings.mainLoading?(c.openBlock(),c.createElementBlock("span",Kv,p[2]||(p[2]=[c.createElementVNode("b",null,null,-1),c.createElementVNode("b",null,null,-1),c.createElementVNode("b",null,null,-1)]))):c.unref(e).isEditing?(c.openBlock(),c.createElementBlock("span",qv,c.toDisplayString(d.$fcTr("edit")),1)):(c.openBlock(),c.createElementBlock("span",Xv,c.toDisplayString(c.unref(i)||d.$fcTr("save")),1))],8,jv),c.createElementVNode("button",{onClick:p[1]||(p[1]=g=>c.unref(e).dialog=!1),className:"mt-1 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},c.toDisplayString(d.$fcTr("cancel")),1)]),default:c.withCtx(()=>[c.createVNode(Tv)]),_:1})),c.createElementVNode("div",Yv,[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(c.unref(t)||pv),c.normalizeProps(c.guardReactiveProps(s())),null,16))])],64))}},Zv={TextFilter:()=>{const l=Ti();return{op:{placeholder:l.translate("operator"),columns:4,items:[{value:"$eq",text:l.translate("equal_to")},{value:"$ne",text:l.translate("not_equal_to")},{value:"$gt",text:l.translate("greater_than")},{value:"$lt",text:l.translate("less_than")},{value:"$contains",text:l.translate("look_like")}],"label-prop":"text","value-prop":"value",native:!1,type:"select"},value:{placeholder:l.translate("value"),type:"text",columns:4}}},DateFilter:()=>{const l=Ti();return{op:{placeholder:l.translate("operator"),columns:4,items:[{value:"$eq",text:l.translate("equal_to")},{value:"$between",text:l.translate("between")},{value:"$gt",text:l.translate("greater_than")},{value:"$lt",text:l.translate("less_than")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:Bl({placeholder:l.translate("value"),columns:4})}},NullFilter:()=>{const l=Ti();return{op:{placeholder:l.translate("operator"),columns:4,items:[{value:"$notNull",text:l.translate("not_null")},{value:"$null",text:l.translate("null")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:{type:"hidden",default:!0,columns:4}}},SelectFilter:l=>{const e=Ti();return{op:{placeholder:e.translate("operator"),columns:4,items:[{value:"$in",text:e.translate("in")},{value:"$notIn",text:e.translate("not_in")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:Hl({placeholder:e.translate("value"),items:"filterItems"in l?l.filterItems:l.items,search:!0,columns:4,labelProp:l.labelProp,valueProp:l.valueProp,object:!1})}}};function Qv(l){return c.getCurrentScope()?(c.onScopeDispose(l),!0):!1}function po(l){return typeof l=="function"?l():c.unref(l)}const _h=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ew=Object.prototype.toString,tw=l=>ew.call(l)==="[object Object]",hr=()=>{},iw=nw();function nw(){var l,e;return _h&&((l=window==null?void 0:window.navigator)==null?void 0:l.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function rw(l,e){function t(...i){return new Promise((n,s)=>{Promise.resolve(l(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(n).catch(s)})}return t}const Th=l=>l();function sw(l=Th){const e=c.ref(!0);function t(){e.value=!1}function i(){e.value=!0}const n=(...s)=>{e.value&&l(...s)};return{isActive:c.readonly(e),pause:t,resume:i,eventFilter:n}}function ow(l){return l||c.getCurrentInstance()}function aw(l,e,t={}){const{eventFilter:i=Th,...n}=t;return c.watch(l,rw(i,e),n)}function lw(l,e,t={}){const{eventFilter:i,...n}=t,{eventFilter:s,pause:a,resume:u,isActive:d}=sw(i);return{stop:aw(l,e,{...n,eventFilter:s}),pause:a,resume:u,isActive:d}}function hw(l,e=!0,t){ow()?c.onMounted(l,t):e?l():c.nextTick(l)}function gn(l){var e;const t=po(l);return(e=t==null?void 0:t.$el)!=null?e:t}const ur=_h?window:void 0;function mn(...l){let e,t,i,n;if(typeof l[0]=="string"||Array.isArray(l[0])?([t,i,n]=l,e=ur):[e,t,i,n]=l,!e)return hr;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const s=[],a=()=>{s.forEach(g=>g()),s.length=0},u=(g,w,b,C)=>(g.addEventListener(w,b,C),()=>g.removeEventListener(w,b,C)),d=c.watch(()=>[gn(e),po(n)],([g,w])=>{if(a(),!g)return;const b=tw(w)?{...w}:w;s.push(...t.flatMap(C=>i.map(_=>u(g,C,_,b))))},{immediate:!0,flush:"post"}),p=()=>{d(),a()};return Qv(p),p}let kh=!1;function uw(l,e,t={}){const{window:i=ur,ignore:n=[],capture:s=!0,detectIframe:a=!1}=t;if(!i)return hr;iw&&!kh&&(kh=!0,Array.from(i.document.body.children).forEach(b=>b.addEventListener("click",hr)),i.document.documentElement.addEventListener("click",hr));let u=!0;const d=b=>n.some(C=>{if(typeof C=="string")return Array.from(i.document.querySelectorAll(C)).some(_=>_===b.target||b.composedPath().includes(_));{const _=gn(C);return _&&(b.target===_||b.composedPath().includes(_))}}),g=[mn(i,"click",b=>{const C=gn(l);if(!(!C||C===b.target||b.composedPath().includes(C))){if(b.detail===0&&(u=!d(b)),!u){u=!0;return}e(b)}},{passive:!0,capture:s}),mn(i,"pointerdown",b=>{const C=gn(l);u=!d(b)&&!!(C&&!b.composedPath().includes(C))},{passive:!0}),a&&mn(i,"blur",b=>{setTimeout(()=>{var C;const _=gn(l);((C=i.document.activeElement)==null?void 0:C.tagName)==="IFRAME"&&!(_!=null&&_.contains(i.document.activeElement))&&e(b)},0)})].filter(Boolean);return()=>g.forEach(b=>b())}const dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},cr="__vueuse_ssr_handlers__",dw=cw();function cw(){return cr in dr||(dr[cr]=dr[cr]||{}),dr[cr]}function fw(l,e){return dw[l]||e}function pw(l){return l==null?"any":l instanceof Set?"set":l instanceof Map?"map":l instanceof Date?"date":typeof l=="boolean"?"boolean":typeof l=="string"?"string":typeof l=="object"?"object":Number.isNaN(l)?"any":"number"}const gw={boolean:{read:l=>l==="true",write:l=>String(l)},object:{read:l=>JSON.parse(l),write:l=>JSON.stringify(l)},number:{read:l=>Number.parseFloat(l),write:l=>String(l)},any:{read:l=>l,write:l=>String(l)},string:{read:l=>l,write:l=>String(l)},map:{read:l=>new Map(JSON.parse(l)),write:l=>JSON.stringify(Array.from(l.entries()))},set:{read:l=>new Set(JSON.parse(l)),write:l=>JSON.stringify(Array.from(l))},date:{read:l=>new Date(l),write:l=>l.toISOString()}},Sh="vueuse-storage";function mw(l,e,t,i={}){var n;const{flush:s="pre",deep:a=!0,listenToStorageChanges:u=!0,writeDefaults:d=!0,mergeDefaults:p=!1,shallow:g,window:w=ur,eventFilter:b,onError:C=Y=>{console.error(Y)},initOnMounted:_}=i,S=(g?c.shallowRef:c.ref)(typeof e=="function"?e():e);if(!t)try{t=fw("getDefaultStorage",()=>{var Y;return(Y=ur)==null?void 0:Y.localStorage})()}catch(Y){C(Y)}if(!t)return S;const F=po(e),L=pw(F),U=(n=i.serializer)!=null?n:gw[L],{pause:H,resume:N}=lw(S,()=>oe(S.value),{flush:s,deep:a,eventFilter:b});w&&u&&hw(()=>{mn(w,"storage",W),mn(w,Sh,pe),_&&W()}),_||W();function O(Y,he){w&&w.dispatchEvent(new CustomEvent(Sh,{detail:{key:l,oldValue:Y,newValue:he,storageArea:t}}))}function oe(Y){try{const he=t.getItem(l);if(Y==null)O(he,null),t.removeItem(l);else{const j=U.write(Y);he!==j&&(t.setItem(l,j),O(he,j))}}catch(he){C(he)}}function V(Y){const he=Y?Y.newValue:t.getItem(l);if(he==null)return d&&F!=null&&t.setItem(l,U.write(F)),F;if(!Y&&p){const j=U.read(he);return typeof p=="function"?p(j,F):L==="object"&&!Array.isArray(j)?{...F,...j}:j}else return typeof he!="string"?he:U.read(he)}function W(Y){if(!(Y&&Y.storageArea!==t)){if(Y&&Y.key==null){S.value=F;return}if(!(Y&&Y.key!==l)){H();try{(Y==null?void 0:Y.newValue)!==U.write(S.value)&&(S.value=V(Y))}catch(he){C(he)}finally{Y?c.nextTick(N):N()}}}}function pe(Y){W(Y.detail)}return S}const bw={class:"relative"},go={__name:"MMenu",setup(l){const e=c.ref(null);uw(e,s=>t.value=!1);const t=c.ref(!1),i={isOpen:t.value},n={click:()=>t.value=!t.value};return(s,a)=>(c.openBlock(),c.createElementBlock("div",bw,[c.renderSlot(s.$slots,"activator",c.normalizeProps(c.guardReactiveProps({on:n,props:i})),()=>[c.createElementVNode("button",c.mergeProps({class:"bg-blue-500 text-white px-4 py-2 rounded-md"},c.toHandlers(n,!0))," Open Menu "+c.toDisplayString(t.value),17)]),t.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"absolute top-[35px] left-0 mt-2 w-48 rounded-md shadow-lg z-[1]",ref_key:"target",ref:e},[c.renderSlot(s.$slots,"default",{},()=>[a[0]||(a[0]=c.createElementVNode("ul",{class:"py-2"},[c.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 1"),c.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 2"),c.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 3")],-1))])],512)):c.createCommentVNode("",!0)]))}},KT="",vw={class:"border-muted-200 dark:border-muted-700 dark:bg-muted-800 relative mb-4 w-full rounded-lg border bg-white p-6 transition-all duration-300"},ww={class:"flex flex-col ml-1 border-[rgba(0,0,0,.1)] pb-4"},yw={class:"flex flex-row justify-between mb-4 items-center"},Cw={class:"font-heading text-base font-semibold leading-tight text-muted-800 dark:text-white"},Ew={class:"flex items-center"},xw={class:"z-[1]"},Rw={class:"fc-drop-down-content"},_w={key:0,class:"p-2 text-center"},Tw=["onClick"],kw={class:"text-muted-400 font-sans text-sm"},Sw={class:"flex w-full justify-between align-start"},Mw={class:"w-[12%] flex justify-center items-center"},Lw=["disabled"],Dw={class:"flex border-t dark:border-muted-600 flex-col p-2 mt-2"},Aw={class:"flex items-center"},Fw={class:"font-heading text-base font-semibold leading-tight text-muted-800 dark:text-white"},zw={class:"group-hover:text-red-500"},Pw={class:"my-2 flex overflow-x-auto slimscroll"},Ow={class:"flex"},Hw=["onClick"],Bw={class:"mt-[0px]"},Nw=["onClick"],Iw={key:0,class:"flex items-center mx-2 text-[0.75rem]"},Vw={class:"flex w-full gap-x-2 justify-between !items-end"},Ww={class:"pt-4 md:pt-6"},$w={class:"flex gap-x-2"},Gw=["placeholder"],Uw=Mt({__name:"MFilter",setup(l){const e=c.inject("store");let t=-1;const i=c.ref(!1),n=c.ref({field:""}),s=c.ref(!1),a=c.ref(""),u=b(),d=c.ref(null);function p(N){if(!N)return!1;const O={text:"TextFilter",date:"DateFilter",select:"SelectFilter",map:"NullFilter"},oe=$.get(O,N.type),V=$.get(Zv,oe);return typeof V=="function"?V(N):!1}const g={field:{placeholder:"field",type:"select",native:!1,items:e.headersWithoutActions,"label-prop":"title","value-prop":"field",object:!0,search:!0,trackBy:["title"],columns:2,onChange(N,O,oe){const V=p(N)||[];for(const W in n.value)W!=="field"&&delete n.value[W];w.value={...g,...V},c.nextTick(()=>{try{const W=oe.form$.el$("value");W&&"clear"in W&&W.clear(),W&&"updateItems"in W&&W.updateItems()}catch{}})}}},w=c.ref({...g});function b(){const N=window.location.pathname.replace(/^\/|\/$/g,"")+"-filters";return mw(N,{},localStorage,{mergeDefaults:!0})}function C(){e.filters.push($.cloneDeep(n.value)),n.value={}}function _(){t!==-1&&e.filters.splice(t,1,n.value),i.value=!1,n.value={}}function S(N,O){i.value=!0,t=O,n.value=N,c.nextTick(()=>{n.value.op=N.op,n.value.value=N.value})}function F(N){e.filters=e.filters.filter(O=>O!==N)}function L(){e.filters=[],e.loadItems()}function U(){if(!s.value)return s.value=!0,d.value.focus();a.value&&(u.value[a.value]={...e.filters},s.value=!1,a.value="",d.value.blur())}function H(){e.loadItems()}return(N,O)=>{const oe=c.resolveComponent("Vueform");return c.withDirectives((c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["accordion-content",{hide:c.unref(e).panel!=="filters"}])},[c.createElementVNode("div",vw,[c.createElementVNode("div",ww,[c.createElementVNode("div",yw,[c.createElementVNode("h3",Cw,c.toDisplayString(N.$fcTr("filter_data")),1),c.createElementVNode("div",Ew,[c.createVNode(go,null,{activator:c.withCtx(({props:V,on:W})=>[c.createElementVNode("button",c.mergeProps(c.toHandlers(W,!0),{class:[V.isOpen?"before:hidden":"before:block","fc-filter-choose is-button rounded is-button-default min-w-[130px]"]}),[c.createElementVNode("span",xw,c.toDisplayString(N.$fcTr("choose_filter")),1)],16)]),default:c.withCtx(()=>[c.createElementVNode("div",Rw,[Object.keys(c.unref(u)).length===0?(c.openBlock(),c.createElementBlock("p",_w,c.toDisplayString(N.$fcTr("not_filter_create_yes")),1)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(u),(V,W)=>(c.openBlock(),c.createElementBlock("a",{class:"group rounded flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-100 dark:hover:bg-muted-700 justify-between rtl:pl-4 rtl:pr-5",key:W,onClick:c.withModifiers(pe=>c.unref(e).filters=Object.values(V),["stop"])},[c.createElementVNode("p",kw,c.toDisplayString(W),1),O[6]||(O[6]=c.createElementVNode("svg",{"data-v-74b3417a":"","aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-muted-500"},[c.createElementVNode("path",{"data-v-74b3417a":"",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1))],8,Tw))),128))])]),_:1})])]),c.createElementVNode("div",Sw,[c.createVNode(oe,{modelValue:n.value,"onUpdate:modelValue":O[0]||(O[0]=V=>n.value=V),schema:w.value,sync:!0,class:"w-[100%] justify-between ml-4",columns:{label:12}},null,8,["modelValue","schema"]),c.createElementVNode("div",Mw,[i.value?(c.openBlock(),c.createElementBlock("button",{key:1,class:"!border-dashed is-button-default is-button w-full rounded-full font-bold py-1 px-2 !border-green-400 !text-green-400 hover:!bg-green-50",onClick:_},[c.createTextVNode(c.toDisplayString(N.$fcTr("edit_filter"))+" ",1),O[8]||(O[8]=c.createElementVNode("svg",{class:"icon h-4 w-4",viewBox:"0 0 24 24"},[c.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1))])):(c.openBlock(),c.createElementBlock("button",{key:0,disabled:!n.value.field,class:"disabled:cursor-not-allowed disabled:hover:bg-transparent !border-dashed !h-[86%] is-button-default is-button w-full rounded font-bold py-1 px-2 !border-green-400 !text-green-400 dark:active:hover:bg-muted-600 active:hover:!bg-green-50",onClick:C},[O[7]||(O[7]=c.createElementVNode("svg",{class:"icon h-4 ml-1 w-4",viewBox:"0 0 24 24"},[c.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),c.createTextVNode(" "+c.toDisplayString(N.$fcTr("add_filter")),1)],8,Lw))])])]),c.withDirectives(c.createElementVNode("div",Dw,[c.createElementVNode("div",Aw,[c.createElementVNode("h3",Fw,c.toDisplayString(N.$fcTr("active_filter")),1),c.createElementVNode("button",{onClick:L,class:"is-button group hover:text-red-500 hover:border-red-500 w-fit text-muted-600 dark:text-muted-400 !text-xs border !px-3 !py-0 !h-[1.5rem] mx-2 !rounded-full"},[c.createElementVNode("span",zw,c.toDisplayString(N.$fcTr("clear_all")),1),O[9]||(O[9]=c.createElementVNode("svg",{stroke:"currentColor",width:"1em",height:"1em",class:"ml-1 rtl:ml-1 rtl:mr-1 group-hover:fill-red-500 dark:fill-muted-400 fill-muted-600",viewBox:"0 0 512 512"},[c.createElementVNode("path",{d:"M340 148L488 0l24 24L364 172l52 52L257.2 483.9 240 512l-23.3-23.3L23.3 295.3 0 272l28.1-17.2L288 96l52 52zM51.4 278.1l47.9 47.9 33.4-33.4L144 281.4 166.6 304l-11.3 11.3-33.4 33.4L233.9 460.6l89.6-146.6L197.9 188.6 51.4 278.1zM340.6 286l34.9-57.2-92.4-92.4L226 171.4 340.6 286z"})],-1))])]),c.createElementVNode("div",Pw,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(e).filters,(V,W)=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:W},[c.createElementVNode("div",Ow,[c.createElementVNode("span",{class:"flex px-3 font-sans transition-shadow duration-300 py-1 text-[0.75rem] cursor-pointer rounded-full bg-primary-100 text-primary-500 border-primary-100 dark:border-primary-500 dark:text-primary-500 border dark:bg-transparent",onClick:pe=>S(V,W)},[c.createElementVNode("span",Bw,c.toDisplayString(c.unref($.get)(V,"field.title")),1),c.createElementVNode("button",{class:"text-white font-bold rounded px-1 hover:bg-primary-500 hover:text-black-500",onClick:c.withModifiers(pe=>F(V),["stop"])},O[10]||(O[10]=[c.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-primary-500"},[c.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1)]),8,Nw)],8,Hw)]),c.unref(e).filters.length-1!==W?(c.openBlock(),c.createElementBlock("span",Iw,c.toDisplayString(N.$fcTr("&")),1)):c.createCommentVNode("",!0)],64))),128))])],512),[[c.vShow,c.unref(e).filters.length>0]]),c.createElementVNode("div",Vw,[c.createElementVNode("button",{onClick:O[1]||(O[1]=V=>c.unref(e).panel=""),class:"is-button text-muted-500 rounded hover:text-red-500 !underline focus-within:!outline-none"},c.toDisplayString(N.$fcTr("cancel")),1),c.createElementVNode("div",Ww,[c.createElementVNode("div",$w,[c.createElementVNode("button",{onClick:O[5]||(O[5]=c.withModifiers(V=>Object.keys(c.unref(e).filters).length!==0?U():"",["self"])),class:c.normalizeClass([{"!bg-muted-100 dark:!bg-muted-700 ltr:pr-1":s.value," focus:outline-none !cursor-not-allowed":Object.keys(c.unref(e).filters).length===0},"transitionX-inp is-button rounded is-button-default"])},[c.createElementVNode("span",{onClick:O[2]||(O[2]=c.withModifiers(V=>Object.keys(c.unref(e).filters).length!==0?U():"",["self"])),class:c.normalizeClass({" bg-green-500 px-2 py-1 rounded text-muted-50":s.value," focus:outline-none !cursor-not-allowed":Object.keys(c.unref(e).filters).length===0})},c.toDisplayString(N.$fcTr("save")),3),c.createElementVNode("span",{class:c.normalizeClass(["transitionX-inp overflow-hidden flex items-center justify-between",s.value?"w-[221px] opacity-1 ltr:pl-3 rtl:mr-3":"opacity-0 w-[0px]"])},[c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":O[3]||(O[3]=V=>a.value=V),class:c.normalizeClass(["fc-focus py-1 rounded px-2 dark:bg-muted-800",s.value?" border border-1":"flex "]),placeholder:N.$fcTr("filter_save_placeholder"),ref_key:"filterNameInp",ref:d},null,10,Gw),[[c.vModelText,a.value]]),c.createElementVNode("span",{class:"px-2",onClick:O[4]||(O[4]=V=>s.value=!1)},O[11]||(O[11]=[c.createElementVNode("svg",{"data-v-74b3417a":"","aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-primary-500"},[c.createElementVNode("path",{"data-v-74b3417a":"",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1)]))],2)],2),c.createElementVNode("button",{onClick:H,class:"is-button rounded bg-primary-500 dark:bg-primary-500 hover:enabled:bg-primary-400 dark:hover:enabled:bg-primary-400 text-white hover:enabled:shadow-lg hover:enabled:shadow-primary-500/50 dark:hover:enabled:shadow-primary-800/20 focus-visible:outline-primary-400/70 focus-within:outline-primary-400/70 focus-visible:bg-primary-500 active:enabled:bg-primary-500 dark:focus-visible:outline-primary-400 dark:focus-within:outline-primary-400 dark:focus-visible:bg-primary-500 dark:active:enabled:bg-primary-500"},c.toDisplayString(N.$fcTr("filter")),1)])])])])],2)),[[c.vShow,c.unref(e).panel==="filters"]])}}},[["__scopeId","data-v-c58a2751"]]),XT="",jw={id:"tooltip",class:"tooltip"},Kw=Mt({__name:"MTooltip",setup(l){return c.onMounted(()=>{const e=document.getElementById("tooltip");function t(n){const s=n.target.closest("[data-tooltip]");if(s){const a=s.getAttribute("data-tooltip");e.textContent=a,e.style.left=`${n.pageX+10}px`,e.style.top=`${n.pageY+10}px`,e.classList.add("visible")}}function i(){e.classList.remove("visible")}document.addEventListener("mouseover",t),document.addEventListener("mouseout",i)}),(e,t)=>(c.openBlock(),c.createElementBlock("div",jw))}},[["__scopeId","data-v-d7c03134"]]),JT="",qw={key:0,class:"w-full border bg-white rounded p-2 flex align-center mt-2"},Xw=["onClick"],Yw={__name:"MHeaderBox",setup(l){const e=c.inject("store");let t=null;c.watch(()=>e.panel,n=>{e.panel==="headerBox"&&e.headersWithoutActions.forEach(s=>{t=document.querySelector(`[tabulator-field="${s.field}"]`),t.innerHTML=t.innerHTML+'<span class="fc-remove"><button class="text-white font-bold rounded px-1" onclick=""><svg aria-hidden="true" viewBox="0 0 24 24" class="h-4 w-4 text-primary-500"><path data-v-74b3417a="" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6 6 18M6 6l12 12"></path></svg></button></span>'})});function i(n){n.isHeader=!n.isHeader}return(n,s)=>c.unref(e).panel==="headerBox"?(c.openBlock(),c.createElementBlock("div",qw,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(e).flatFields,a=>(c.openBlock(),c.createElementBlock("div",{key:a.field,class:c.normalizeClass(["px-1 mx-1 cursor-pointer divide-y rounded",{"bg-primary-600 text-white":a.isHeader}]),onClick:u=>i(a)},c.toDisplayString(a.title),11,Xw))),128))])):c.createCommentVNode("",!0)}},Jw=["disabled"],Zw={__name:"BatchActions",setup(l){const e=c.inject("store"),t=c.ref([]);se.listen("toggle.select",n=>{t.value.includes(n)?t.value=t.value.filter(s=>s!==n):t.value.push(n)});function i(){se.event("dialog.confirm",{description:" آیا از حذف این "+t.value.length+" آیتم ، مطمئن هستید؟ ",title:"حذف دسته جمعی",icon:"fluent:delete-dismiss-24-regular",confirmFunc:async()=>{const n=await e.remove(t.value);return t.value=[],se.event("batch.removed"),n}})}return(n,s)=>(c.openBlock(),c.createBlock(c.Transition,{name:"fade"},{default:c.withCtx(()=>[c.createElementVNode("button",{class:"fc-header-icon-btn !bg-red-100","data-tooltip":"حذف دسته جمعی",disabled:!t.value.length,onClick:i},s[0]||(s[0]=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},[c.createElementVNode("rect",{width:"16",height:"16",fill:"none"}),c.createElementVNode("path",{fill:"#f00",d:"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5M11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1zm1.958 1l-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47M8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5"})],-1)]),8,Jw)]),_:1}))}},Qw={class:"flex items-center gap-3 relative hover:bg-muted-200 dark:hover:bg-muted-700 rounded-lg px-5 pl-3 rtl:pl-8 rtl:pr-5 py-2 duration-300"},ey=["modelValue"],ty={class:"text-success-500 peer-disabled:opacity-75"},iy={class:"font-heading text-muted-800 text-xs font-semibold leading-tight dark:text-white"},ny={__name:"SelectColumnItem",props:{checked:{default:!1},columnName:{default:""}},setup(l){return(e,t)=>(c.openBlock(),c.createElementBlock("div",Qw,[c.createElementVNode("div",{class:c.normalizeClass(["nui-focus block focus-within:outline-current rounded-full",JSON.parse(l.checked)?"is-checked":"is-unchecked"])},[c.createElementVNode("input",{modelValue:l.checked,type:"checkbox",class:"peer cursor-pointer disabled:cursor-not-allowed","true-value":"true","false-value":"false",onClick:t[0]||(t[0]=i=>e.$emit("toggle"))},null,8,ey),c.createElementVNode("label",ty,[c.createElementVNode("div",{class:c.normalizeClass(["rtl:left-[auto] rtl:!right-0 ltr:right-[auto] ltr:left-0",JSON.parse(l.checked)?"is-opaque":""])},null,2),t[1]||(t[1]=c.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 52 52","data-v-3e8a7b5f":""},[c.createElementVNode("circle",{cx:"26",cy:"26",r:"25",fill:"none",stroke:"currentColor"}),c.createElementVNode("path",{fill:"none",stroke:"currentColor",d:"m14.1 27.2 7.1 7.2 16.7-16.8"})],-1))])],2),c.createElementVNode("div",null,[c.createElementVNode("h6",iy,c.toDisplayString(l.columnName),1)])]))}},ZT="",ry={class:"fc-header"},sy={class:"fc-header-left-sid"},oy={class:"z-[1]"},ay={class:"bg-muted-200 dark:bg-muted-800 cursor-pointer rounded-xl fm-light-shadow"},ly={class:"text-muted-400 font-sans text-xs"},hy={class:"bg-white dark:bg-muted-800 rounded-xl pt-1 rtl:text-right ltr:text-left fm-light-shadow"},uy={class:"m-3 mt-2 text-muted-600 dark:text-muted-200"},dy={class:"p-2"},cy={key:0,"data-tooltip":"فیلتر",class:"fm-header-rigth-sid flex w-full sm:w-auto rtl:flex-row-reverse rtl:justify-end"},fy={key:0},py={class:"group/nui-input relative rtl:"},gy=["placeholder"],my={class:"ltr:left-0 text-muted-400 group-focus-within/nui-input:text-primary-500 absolute end-0 rtl:start-0 top-0 flex items-center justify-center transition-colors duration-300 peer-disabled:cursor-not-allowed peer-disabled:opacity-75 h-10 w-10"},by={key:0,class:"icon h-[1.15rem] w-[1.15rem]",width:"1em",height:"1em",viewBox:"0 0 24 24"},vy={key:1,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",class:"icon animate-spin"},wy=Mt({__name:"MButtonBox",setup(l){const{can:e}=Os(),t=c.inject("store");function i(b){b===t.panel?t.panel="":t.panel=b}const n=c.ref(null);c.onMounted(()=>{n.value=document.body.getAttribute("dir")});const s=c.computed(()=>t.flatFields.find(b=>b.field==="_select_")),a=c.computed(()=>!!s.value.isHeader);function u(){s.value.isHeader=!s.value.isHeader,s.value.isHeader||t.selected.clear()}const d=c.ref(!1);function p(){d.value=!0,t.loadItems().finally(()=>d.value=!1)}const g=$.debounce(p,600);function w(){window.open(ye.defaults.baseURL+t.generateQuery())}return(b,C)=>(c.openBlock(),c.createElementBlock("div",ry,[c.createElementVNode("div",sy,[c.unref(e)("create")?(c.openBlock(),c.createElementBlock("button",{key:0,class:"fc-plus-btn","data-tooltip":"افزودن",onClick:C[0]||(C[0]=_=>c.unref(se).event("createBtn"))},C[5]||(C[5]=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-plus"},[c.createElementVNode("path",{d:"M5 12h14"}),c.createElementVNode("path",{d:"M12 5v14"})],-1)]))):c.createCommentVNode("",!0),c.createVNode(go,null,{activator:c.withCtx(({on:_,props:S})=>[c.createElementVNode("button",c.mergeProps({class:S.isOpen?"before:block":"before:hidden"},S,c.toHandlers(_,!0),{class:"fc-header-icon-btn fc-drop-down-btn min-w-[130px]"}),[c.createElementVNode("span",oy,c.toDisplayString(b.$fcTr("export")),1)],16)]),default:c.withCtx(()=>[c.createElementVNode("div",ay,[c.createElementVNode("a",{class:"group flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-300 dark:hover:bg-muted-700 rounded-xl justify-end flex-row-reverse",onClick:w},[c.createElementVNode("p",ly,c.toDisplayString(b.$fcTr("export_as_excel")),1),C[6]||(C[6]=c.createElementVNode("svg",{class:"fill-muted-400 w-3.5 mx-2",viewBox:"0 0 512 512"},[c.createElementVNode("path",{d:"M48 448V64c0-8.8 7.2-16 16-16H224v80c0 17.7 14.3 32 32 32h80V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V154.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0H64zm90.9 233.3c-8.1-10.5-23.2-12.3-33.7-4.2s-12.3 23.2-4.2 33.7L161.6 320l-44.5 57.3c-8.1 10.5-6.3 25.5 4.2 33.7s25.5 6.3 33.7-4.2L192 359.1l37.1 47.6c8.1 10.5 23.2 12.3 33.7 4.2s12.3-23.2 4.2-33.7L222.4 320l44.5-57.3c8.1-10.5 6.3-25.5-4.2-33.7s-25.5-6.3-33.7 4.2L192 280.9l-37.1-47.6z"})],-1))])])]),_:1}),c.createElementVNode("button",{class:"fc-header-icon-btn","data-tooltip":"رفرش",onClick:C[1]||(C[1]=(..._)=>c.unref(t).reloadData&&c.unref(t).reloadData(..._))},[(c.openBlock(),c.createElementBlock("svg",{class:c.normalizeClass({spin:c.unref(t).loadings.mainLoading}),viewBox:"0 0 512 512"},C[7]||(C[7]=[c.createElementVNode("path",{d:"M371.2 122.9C340.3 96.2 300 80 256 80C158.8 80 80 158.8 80 256s78.8 176 176 176c39.7 0 76.2-13.1 105.6-35.2c10.6-8 25.6-5.8 33.6 4.8s5.8 25.6-4.8 33.6C353 463.3 306.4 480 256 480C132.3 480 32 379.7 32 256S132.3 32 256 32c57.3 0 109.6 21.5 149.2 56.9l30.5-30.5c6.6-6.6 15.6-10.3 25-10.3C480.2 48 496 63.8 496 83.3V200c0 13.3-10.7 24-24 24H355.3c-19.5 0-35.3-15.8-35.3-35.3c0-9.4 3.7-18.3 10.3-25l40.8-40.8zm76.8-9L385.9 176H448V113.9z"},null,-1)]),2))]),c.createElementVNode("button",{class:c.normalizeClass(["fc-header-icon-btn",{"fm-active-btn":a.value}]),"data-tooltip":"انتخاب گروهی",onClick:u},C[8]||(C[8]=[c.createElementVNode("svg",{viewBox:"0 0 512 512"},[c.createElementVNode("path",{d:"M384 48c8.8 0 16 7.2 16 16V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H384zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM80 112v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H96c-8.8 0-16 7.2-16 16zM96 352c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H96zm80-224c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H200c-13.3 0-24 10.7-24 24zm32 128c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H232c-13.3 0-24 10.7-24 24zM176 384c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H200c-13.3 0-24 10.7-24 24zm-4.7-140.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L112 257.4 99.3 244.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l24 24c6.2 6.2 16.4 6.2 22.6 0l48-48z"})],-1)]),2),a.value?(c.openBlock(),c.createBlock(Zw,{key:1})):c.createCommentVNode("",!0),c.createVNode(go,{"close-on-content-click":!0},{activator:c.withCtx(({props:_,on:S})=>[c.createElementVNode("button",c.mergeProps(c.toHandlers(S,!0),{class:["fc-header-icon-btn",[_.isOpen?"light:!bg-white dark:bg-muted-800":"",_.isOpen?n.value==="rtl"?"expanded-rtl":"expanded2":""]],"data-tooltip":"انتخاب سرستون"}),C[9]||(C[9]=[c.createElementVNode("svg",{viewBox:"0 0 448 512",class:"z-[1]"},[c.createElementVNode("path",{d:"M64 448c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32H384c17.7 0 32 14.3 32 32V416c0 17.7-14.3 32-32 32H64zM0 416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96V416zM128 288c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16V272c0 8.8 7.2 16 16 16zm176 48c0 8.8 7.2 16 16 16s16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16V336zm-80-80c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16z"})],-1)]),16)]),default:c.withCtx(()=>[c.createElementVNode("div",hy,[c.createElementVNode("div",uy,c.toDisplayString(b.$fcTr("custom_column")),1),c.createElementVNode("ul",dy,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(t).flatFieldsWithoutActions,_=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:_.field},[_.title?(c.openBlock(),c.createBlock(ny,{key:0,"column-name":_.title,checked:_.isHeader,onToggle:S=>_.isHeader=!_.isHeader},null,8,["column-name","checked","onToggle"])):c.createCommentVNode("",!0)],64))),128))])])]),_:1})]),c.unref(e)("filter")?(c.openBlock(),c.createElementBlock("div",cy,[c.createElementVNode("button",{class:c.normalizeClass(["test fc-header-icon-btn transform transition-all",c.unref(t).panel==="filters"?"!bg-white dark:!bg-muted-800 !rounded-b-none ":""]),onClick:C[2]||(C[2]=_=>i("filters"))},[c.createVNode(c.Transition,{name:"scale"},{default:c.withCtx(()=>[c.unref(t).panel==="filters"?(c.openBlock(),c.createElementBlock("div",fy,C[10]||(C[10]=[c.createElementVNode("span",null,null,-1)]))):c.createCommentVNode("",!0)]),_:1}),(c.openBlock(),c.createElementBlock("svg",{class:c.normalizeClass(c.unref(t).panel==="filters"?"light:!fill-primary-700":""),stroke:"currentColor",viewBox:"0 0 512 512"},C[11]||(C[11]=[c.createElementVNode("path",{d:"M0 73.7C0 50.7 18.7 32 41.7 32H470.3c23 0 41.7 18.7 41.7 41.7c0 9.6-3.3 18.9-9.4 26.3L336 304.5V447.7c0 17.8-14.5 32.3-32.3 32.3c-7.3 0-14.4-2.5-20.1-7l-92.5-73.4c-9.6-7.6-15.1-19.1-15.1-31.3V304.5L9.4 100C3.3 92.6 0 83.3 0 73.7zM55 80L218.6 280.8c3.5 4.3 5.4 9.6 5.4 15.2v68.4l64 50.8V296c0-5.5 1.9-10.9 5.4-15.2L457 80H55z"},null,-1)]),2))],2),c.createElementVNode("div",py,[c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":C[3]||(C[3]=_=>c.unref(t).searchParam=_),type:"text",class:"nui-focus px-4! border-muted-300 text-muted-600 placeholder:text-muted-300 dark:border-muted-700 dark:bg-muted-900/75 dark:text-muted-200 dark:placeholder:text-muted-500 dark:focus:border-muted-700 peer w-full border bg-white font-sans transition-all duration-300 disabled:cursor-not-allowed disabled:opacity-75 h-10 py-2 text-sm leading-5 pe-4 ps-9 rounded-full",placeholder:b.$fcTr("search"),onKeyup:C[4]||(C[4]=(..._)=>c.unref(g)&&c.unref(g)(..._))},null,40,gy),[[c.vModelText,c.unref(t).searchParam]]),c.createElementVNode("div",my,[d.value?(c.openBlock(),c.createElementBlock("svg",vy,C[13]||(C[13]=[c.createElementVNode("path",{d:"M457 372c11.5 6.6 26.3 2.7 31.8-9.3C503.7 330.2 512 294.1 512 256C512 122.7 410.1 13.2 280 1.1C266.8-.1 256 10.7 256 24v0c0 13.3 10.8 23.9 24 25.4C383.5 61.2 464 149.2 464 256c0 29.3-6.1 57.3-17 82.6c-5.3 12.2-1.5 26.8 10 33.5v0z"},null,-1)]))):(c.openBlock(),c.createElementBlock("svg",by,C[12]||(C[12]=[c.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[c.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),c.createElementVNode("path",{d:"m21 21l-4.35-4.35"})],-1)])))])])])):c.createCommentVNode("",!0)]))}},[["__scopeId","data-v-121187ed"]]),yy={};function Cy(l,e){return c.openBlock(),c.createElementBlock("div")}const Ey=Mt(yy,[["render",Cy]]),ek="",xy={class:"fixed z-50 inset-0 overflow-hidden pointer-events-none"},Ry={class:"absolute bg-white shadow-2xl border border-gray-200 pointer-events-auto transition-all duration-300 rounded-xl",style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"400px","max-width":"90vw"}},_y={class:"flex items-center justify-between px-4 py-3 border-gray-200 border-b rounded-t-xl bg-gradient-to-r from-red-50 to-orange-50"},Ty={class:"flex flex-col overflow-hidden"},ky={class:"px-4 py-4 overflow-y-auto"},Sy={class:"mb-5 flex flex-row flex-wrap"},My={class:"flex-shrink-0 bg-gray-50 px-4 py-3 border-t border-gray-200 rounded-b-xl"},Ly={class:"flex justify-end gap-2"},Dy=["disabled"],Ay={key:0},Fy={key:1},zy=Mt({__name:"MDeleteDialog",setup(l){const e=c.inject("store"),t=c.ref(!1);let i="";return se.listen("deleteBtn",n=>{t.value=!0,i=n.id}),se.listen("handleDeleteDialog",n=>{t.value=n}),(n,s)=>(c.openBlock(),c.createBlock(c.Transition,{name:"fade",appear:""},{default:c.withCtx(()=>[t.value?(c.openBlock(),c.createElementBlock("div",{key:0,onKeydown:s[4]||(s[4]=c.withKeys(a=>t.value=!1,["escape"])),class:"relative z-50",role:"dialog"},[c.createElementVNode("div",{class:"fixed inset-0 bg-black bg-opacity-30 transition-opacity backdrop-blur-sm",onClick:s[0]||(s[0]=a=>t.value=!1)}),c.createElementVNode("div",xy,[c.createElementVNode("div",Ry,[c.createElementVNode("div",_y,[s[6]||(s[6]=c.createElementVNode("h3",{class:"text-lg font-semibold text-gray-900 flex items-center gap-2"},[c.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),c.createTextVNode(" حذف ")],-1)),c.createElementVNode("button",{onClick:s[1]||(s[1]=a=>t.value=!1),class:"p-1.5 rounded-full hover:bg-red-100 transition-colors group",title:"Close"},s[5]||(s[5]=[c.createElementVNode("svg",{class:"w-4 h-4 text-gray-600 group-hover:text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),c.createElementVNode("div",Ty,[c.createElementVNode("div",ky,[c.createElementVNode("div",Sy,c.toDisplayString(n.$fcTr("alert_to_delete")),1)]),c.createElementVNode("div",My,[c.createElementVNode("div",Ly,[c.createElementVNode("button",{onClick:s[2]||(s[2]=a=>t.value=!1),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-1 transition-colors"},c.toDisplayString(n.$fcTr("no")),1),c.createElementVNode("button",{disabled:c.unref(e).loadings.mainLoading,class:"px-4 py-2 text-sm font-medium text-white bg-red-600 border border-transparent rounded-lg hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-1 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:s[3]||(s[3]=a=>c.unref(e).remove(c.unref(i)))},[c.unref(e).loadings.mainLoading?(c.openBlock(),c.createElementBlock("span",Fy,"loading")):(c.openBlock(),c.createElementBlock("span",Ay,c.toDisplayString(n.$fcTr("yes")),1))],8,Dy)])])])])])],32)):c.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-144e4312"]]),Py=({listen:l,store:e})=>{se.listen("reloadData",()=>{e.reloadData()})},Oy={__name:"MCrud",props:{options:{default:()=>({})},structure:{default:()=>({})},hiddenActions:{default:()=>[]},fields:{default:()=>[]},tableOptions:{default:()=>({})},tableComponent:{default:null},dir:{default:()=>Ti().dir},route:{default:"route"}},emits:["mounted"],setup(l,{emit:e}){const t=l,i=e,n=kg({fields:t.fields,hiddenActions:t.hiddenActions,options:t.options,structure:t.structure,route:t.route,query:c.inject("formue.query")||!1});return c.provide("store",n),c.provide("tableOptions",{dir:t.dir,...t.tableOptions}),c.provide("tableComponent",t.tableComponent),document.body.setAttribute("dir",t.dir),c.onMounted(()=>{i("mounted")}),Py({store:n}),c.onUnmounted(()=>{n.$dispose(),n.reset()}),(s,a)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createVNode(wy),c.createVNode(Uw),c.createVNode(Yw),c.createVNode(Jv),c.createVNode(Ey),c.createVNode(zy),c.createVNode(Kw),c.renderSlot(s.$slots,"extra")],64))}};Te.ActionButton=gh,Te.MCrud=Oy,Te.emitter=se,Te.fields=Nl,Te.install=Sg,Te.registerFields=Wl,Te.setEmitter=Na,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})});
|