@golstats/gsc-reports 1.0.78 → 1.0.79
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/{FilterConditions-55d68355-DMqzcKBO-D2kXmeoL-DEviWylE.js → FilterConditions-55d68355-DMqzcKBO-D2ZerJ0p-Cc4ohJII.js} +1 -1
- package/dist/{FilterField-59a73e38-CNaE03Ge-B0XkVQzG-V94Z81Vi.js → FilterField-59a73e38-CNaE03Ge-Dq6bT6HM-pz8ZTRNa.js} +1 -1
- package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-Df-aYrQw-VYuSaZOV.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-a9ImVRWo-CrA3UZVD.js} +1 -1
- package/dist/gsc-reports.css +1 -1
- package/dist/gsc-reports.es.js +1 -1
- package/dist/gsc-reports.umd.js +2 -2
- package/dist/{index-Ddsk52G7.js → index-Dp5bx4hi.js} +13 -13
- package/package.json +2 -2
- package/src/App.vue +4 -4
package/dist/gsc-reports.umd.js
CHANGED
|
@@ -4115,7 +4115,7 @@ __p += '`),Go&&(La+=`' +
|
|
|
4115
4115
|
function print() { __p += __j.call(arguments, '') }
|
|
4116
4116
|
`:`;
|
|
4117
4117
|
`)+La+`return __p
|
|
4118
|
-
}`;var ko=_p(function(){return hi(Er,fi+"return "+La).apply(i,an)});if(ko.source=La,rn(ko))throw ko;return ko}function pf(Se){return ge(Se).toLowerCase()}function m0(Se){return ge(Se).toUpperCase()}function Ry(Se,Ae,gt){if(Se=ge(Se),Se&&(gt||Ae===i))return bu(Se);if(!Se||!(Ae=Su(Ae)))return Se;var Zt=cs(Se),mr=cs(Ae),Er=Cd(Zt,mr),an=Bo(Zt,mr)+1;return Pd(Zt,Er,an).join("")}function hf(Se,Ae,gt){if(Se=ge(Se),Se&&(gt||Ae===i))return Se.slice(0,du(Se)+1);if(!Se||!(Ae=Su(Ae)))return Se;var Zt=cs(Se),mr=Bo(Zt,cs(Ae))+1;return Pd(Zt,0,mr).join("")}function My(Se,Ae,gt){if(Se=ge(Se),Se&&(gt||Ae===i))return Se.replace(vt,"");if(!Se||!(Ae=Su(Ae)))return Se;var Zt=cs(Se),mr=Cd(Zt,cs(Ae));return Pd(Zt,mr).join("")}function Wy(Se,Ae){var gt=z,Zt=O;if(Xn(Ae)){var mr="separator"in Ae?Ae.separator:mr;gt="length"in Ae?oi(Ae.length):gt,Zt="omission"in Ae?Su(Ae.omission):Zt}Se=ge(Se);var Er=Se.length;if(Vs(Se)){var an=cs(Se);Er=an.length}if(gt>=Er)return Se;var hn=gt-nl(Zt);if(hn<1)return Zt;var zn=an?Pd(an,0,hn).join(""):Se.slice(0,hn);if(mr===i)return zn+Zt;if(an&&(hn+=zn.length-hn),_i(mr)){if(Se.slice(hn).search(mr)){var xa,wa=zn;for(mr.global||(mr=Tc(mr.source,ge(Tt.exec(mr))+"g")),mr.lastIndex=0;xa=mr.exec(wa);)var La=xa.index;zn=zn.slice(0,La===i?hn:La)}}else if(Se.indexOf(Su(mr),hn)!=hn){var Ya=zn.lastIndexOf(mr);Ya>-1&&(zn=zn.slice(0,Ya))}return zn+Zt}function jy(Se){return Se=ge(Se),Se&&at.test(Se)?Se.replace(Ke,pu):Se}var Ky=Sh(function(Se,Ae,gt){return Se+(gt?" ":"")+Ae.toUpperCase()}),$f=oy("toUpperCase");function Is(Se,Ae,gt){return Se=ge(Se),Ae=gt?i:Ae,Ae===i?rl(Se)?Cl(Se):mo(Se):Se.match(Ae)||[]}var _p=xi(function(Se,Ae){try{return Ri(Se,i,Ae)}catch(gt){return rn(gt)?gt:new ui(gt)}}),y0=Hu(function(Se,Ae){return Ka(Ae,function(gt){gt=Zi(gt),we(Se,gt,Do(Se[gt],Se))}),Se});function Md(Se){var Ae=Se==null?0:Se.length,gt=wi();return Se=Ae?Ti(Se,function(Zt){if(typeof Zt[1]!="function")throw new gs(m);return[gt(Zt[0]),Zt[1]]}):[],xi(function(Zt){for(var mr=-1;++mr<Ae;){var Er=Se[mr];if(Ri(Er[0],this,Zt))return Ri(Er[1],this,Zt)}})}function gg(Se){return ot(Ie(Se,_))}function em(Se){return function(){return Se}}function fl(Se,Ae){return Se==null||Se!==Se?Ae:Se}var lc=Bp(),rd=Bp(!0);function ls(Se){return Se}function Lu(Se){return ji(typeof Se=="function"?Se:Ie(Se,_))}function Wd(Se){return Ai(Ie(Se,_))}function g0(Se,Ae){return Gi(Se,Ie(Ae,_))}var P2=xi(function(Se,Ae){return function(gt){return Wn(gt,Se,Ae)}}),F2=xi(function(Se,Ae){return function(gt){return Wn(Se,gt,Ae)}});function v0(Se,Ae,gt){var Zt=ba(Ae),mr=Hr(Ae,Zt);gt==null&&!(Xn(Ae)&&(mr.length||!Zt.length))&&(gt=Ae,Ae=Se,Se=this,mr=Hr(Ae,ba(Ae)));var Er=!(Xn(gt)&&"chain"in gt)||!!gt.chain,an=bn(Se);return Ka(mr,function(hn){var zn=Ae[hn];Se[hn]=zn,an&&(Se.prototype[hn]=function(){var xa=this.__chain__;if(Er||xa){var wa=Se(this.__wrapped__),La=wa.__actions__=Wc(this.__actions__);return La.push({func:zn,args:arguments,thisArg:Se}),wa.__chain__=xa,wa}return zn.apply(Se,zs([this.value()],arguments))})}),Se}function vg(){return On._===this&&(On._=Fl),this}function ap(){}function E2(Se){return Se=oi(Se),xi(function(Ae){return Uo(Ae,Se)})}var bg=Nf(Ti),xg=Nf(yl),R2=Nf(Ls);function M2(Se){return Zh(Se)?Zl(Zi(Se)):Tl(Se)}function wg(Se){return function(Ae){return Se==null?i:tn(Se,Ae)}}var W2=fp(),j2=fp(!0);function b0(){return[]}function Ay(){return!1}function x0(){return{}}function K2(){return""}function Iy(){return!0}function W5(Se,Ae){if(Se=oi(Se),Se<1||Se>R)return[];var gt=X,Zt=mi(Se,X);Ae=wi(Ae),Se-=X;for(var mr=Hc(Zt,Ae);++gt<Se;)Ae(gt);return mr}function A2(Se){return st(Se)?Ti(Se,Zi):Ii(Se)?[Se]:Wc($h(ge(Se)))}function j5(Se){var Ae=++is;return ge(Se)+Ae}var K5=hp(function(Se,Ae){return Se+Ae},0),A5=mp("ceil"),I5=hp(function(Se,Ae){return Se/Ae},1),X5=mp("floor");function D5(Se){return Se&&Se.length?Ct(Se,ls,Un):i}function J5(Se,Ae){return Se&&Se.length?Ct(Se,wi(Ae,2),Un):i}function G5(Se){return zl(Se,ls)}function Sp(Se,Ae){return zl(Se,wi(Ae,2))}function Xy(Se){return Se&&Se.length?Ct(Se,ls,Ki):i}function I2(Se,Ae){return Se&&Se.length?Ct(Se,wi(Ae,2),Ki):i}var w0=hp(function(Se,Ae){return Se*Ae},1),X2=mp("round"),tCe=hp(function(Se,Ae){return Se-Ae},0);function rCe(Se){return Se&&Se.length?lu(Se,ls):0}function nCe(Se,Ae){return Se&&Se.length?lu(Se,wi(Ae,2)):0}return dr.after=s0,dr.ary=Ss,dr.assign=Me,dr.assignIn=He,dr.assignInWith=$e,dr.assignWith=ft,dr.at=bt,dr.before=Hf,dr.bind=Do,dr.bindAll=y0,dr.bindKey=l0,dr.castArray=cf,dr.chain=ou,dr.chunk=Cu,dr.compact=Zm,dr.concat=gy,dr.cond=Md,dr.conforms=gg,dr.constant=em,dr.countBy=Cy,dr.create=Et,dr.curry=Yf,dr.curryRight=c0,dr.debounce=u0,dr.defaults=Xt,dr.defaultsDeep=$t,dr.defer=Ey,dr.delay=d0,dr.difference=ag,dr.differenceBy=vy,dr.differenceWith=ig,dr.drop=og,dr.dropRight=tf,dr.dropRightWhile=by,dr.dropWhile=sg,dr.fill=lg,dr.filter=fg,dr.flatMap=a0,dr.flatMapDeep=bp,dr.flatMapDepth=sf,dr.flatten=$p,dr.flattenDeep=xy,dr.flattenDepth=wy,dr.flip=tp,dr.flow=lc,dr.flowRight=rd,dr.fromPairs=C2,dr.functions=Sn,dr.functionsIn=on,dr.groupBy=Xf,dr.initial=Hm,dr.intersection=Ff,dr.intersectionBy=nu,dr.intersectionWith=rf,dr.invert=Ra,dr.invertBy=Qa,dr.invokeMap=Rd,dr.iteratee=Lu,dr.keyBy=xp,dr.keys=ba,dr.keysIn=Ma,dr.map=lf,dr.mapKeys=Xa,dr.mapValues=Pa,dr.matches=Wd,dr.matchesProperty=g0,dr.memoize=Ac,dr.merge=ua,dr.mergeWith=Da,dr.method=P2,dr.methodOf=F2,dr.mixin=v0,dr.negate=qh,dr.nthArg=E2,dr.omit=Ga,dr.omitBy=ci,dr.once=$s,dr.orderBy=o0,dr.over=bg,dr.overArgs=Uh,dr.overEvery=xg,dr.overSome=R2,dr.partial=Qu,dr.partialRight=zh,dr.partition=mg,dr.pick=To,dr.pickBy=bo,dr.property=M2,dr.propertyOf=wg,dr.pull=eh,dr.pullAll=bc,dr.pullAllBy=Ef,dr.pullAllWith=Rf,dr.pullAt=iu,dr.range=W2,dr.rangeRight=j2,dr.rearg=Ch,dr.reject=Jf,dr.remove=Sy,dr.rest=Ph,dr.reverse=Mf,dr.sampleSize=Gf,dr.set=Ic,dr.setWith=dl,dr.shuffle=Bf,dr.slice=af,dr.sortBy=Zf,dr.sortedUniq=th,dr.sortedUniqBy=xc,dr.split=td,dr.spread=ih,dr.tail=e0,dr.take=t0,dr.takeRight=Ty,dr.takeRightWhile=dg,dr.takeWhile=ky,dr.tap=n0,dr.throttle=dd,dr.thru=Fd,dr.toArray=Ol,dr.toPairs=Ks,dr.toPairsIn=wc,dr.toPath=A2,dr.toPlainObject=J,dr.transform=ic,dr.unary=p0,dr.union=Ly,dr.unionBy=Ny,dr.unionWith=Vy,dr.uniq=pg,dr.uniqBy=hg,dr.uniqWith=Oy,dr.unset=Ts,dr.unzip=rh,dr.unzipWith=Yu,dr.update=ys,dr.updateWith=Jl,dr.values=Qo,dr.valuesIn=pl,dr.without=r0,dr.words=Is,dr.wrap=ku,dr.xor=Vh,dr.xorBy=Wf,dr.xorWith=jf,dr.zip=Kf,dr.zipObject=Af,dr.zipObjectDeep=nh,dr.zipWith=qy,dr.entries=Ks,dr.entriesIn=wc,dr.extend=He,dr.extendWith=$e,v0(dr,dr),dr.add=K5,dr.attempt=_p,dr.camelCase=ks,dr.capitalize=Us,dr.ceil=A5,dr.clamp=oc,dr.clone=Vl,dr.cloneDeep=h0,dr.cloneDeepWith=M,dr.cloneWith=rp,dr.conformsTo=Z,dr.deburr=ro,dr.defaultTo=fl,dr.divide=I5,dr.endsWith=hl,dr.eq=pe,dr.escape=sc,dr.escapeRegExp=As,dr.every=Py,dr.find=of,dr.findIndex=cg,dr.findKey=ar,dr.findLast=If,dr.findLastIndex=Pf,dr.findLastKey=pr,dr.floor=X5,dr.forEach=No,dr.forEachRight=i0,dr.forIn=kr,dr.forInRight=br,dr.forOwn=Wr,dr.forOwnRight=Dr,dr.get=mn,dr.gt=Le,dr.gte=De,dr.has=Jn,dr.hasIn=Sa,dr.head=_y,dr.identity=ls,dr.includes=Ed,dr.indexOf=ug,dr.inRange=Xc,dr.invoke=za,dr.isArguments=Ye,dr.isArray=st,dr.isArrayBuffer=Nt,dr.isArrayLike=Kt,dr.isArrayLikeObject=er,dr.isBoolean=nr,dr.isBuffer=lr,dr.isDate=vr,dr.isElement=fr,dr.isEmpty=Fr,dr.isEqual=Kr,dr.isEqualWith=ln,dr.isError=rn,dr.isFinite=Tn,dr.isFunction=bn,dr.isInteger=Rn,dr.isLength=Dn,dr.isMap=ca,dr.isMatch=Na,dr.isMatchWith=Ea,dr.isNaN=di,dr.isNative=Ba,dr.isNil=$a,dr.isNull=ii,dr.isNumber=Ia,dr.isObject=Xn,dr.isObjectLike=ha,dr.isPlainObject=Ci,dr.isRegExp=_i,dr.isSafeInteger=Co,dr.isSet=ri,dr.isString=eo,dr.isSymbol=Ii,dr.isTypedArray=to,dr.isUndefined=Wo,dr.isWeakMap=Po,dr.isWeakSet=Ms,dr.join=Lh,dr.kebabCase=$u,dr.last=au,dr.lastIndexOf=Kc,dr.lowerCase=np,dr.lowerFirst=Dc,dr.lt=Jo,dr.lte=Ws,dr.max=D5,dr.maxBy=J5,dr.mean=G5,dr.meanBy=Sp,dr.min=Xy,dr.minBy=I2,dr.stubArray=b0,dr.stubFalse=Ay,dr.stubObject=x0,dr.stubString=K2,dr.stubTrue=Iy,dr.multiply=w0,dr.nth=nf,dr.noConflict=vg,dr.noop=ap,dr.now=ud,dr.pad=xo,dr.padEnd=ss,dr.padStart=Fu,dr.parseInt=ed,dr.random=_c,dr.reduce=yg,dr.reduceRight=Df,dr.repeat=Qf,dr.replace=f0,dr.result=js,dr.round=X2,dr.runInContext=yn,dr.sample=Fy,dr.size=ep,dr.snakeCase=uf,dr.some=wp,dr.sortedIndex=Nl,dr.sortedIndexBy=Ym,dr.sortedIndexOf=Nh,dr.sortedLastIndex=zo,dr.sortedLastIndexBy=Qm,dr.sortedLastIndexOf=$m,dr.startCase=Fh,dr.startsWith=Eu,dr.subtract=tCe,dr.sum=rCe,dr.sumBy=nCe,dr.template=df,dr.times=W5,dr.toFinite=Yo,dr.toInteger=oi,dr.toLength=Dl,dr.toLower=pf,dr.toNumber=Q,dr.toSafeInteger=se,dr.toString=ge,dr.toUpper=m0,dr.trim=Ry,dr.trimEnd=hf,dr.trimStart=My,dr.truncate=Wy,dr.unescape=jy,dr.uniqueId=j5,dr.upperCase=Ky,dr.upperFirst=$f,dr.each=No,dr.eachRight=i0,dr.first=_y,v0(dr,(function(){var Se={};return Ar(dr,function(Ae,gt){Ni.call(dr.prototype,gt)||(Se[gt]=Ae)}),Se})(),{chain:!1}),dr.VERSION=k,Ka(["bind","bindKey","curry","curryRight","partial","partialRight"],function(Se){dr[Se].placeholder=dr}),Ka(["drop","take"],function(Se,Ae){si.prototype[Se]=function(gt){gt=gt===i?1:Ui(oi(gt),0);var Zt=this.__filtered__&&!Ae?new si(this):this.clone();return Zt.__filtered__?Zt.__takeCount__=mi(gt,Zt.__takeCount__):Zt.__views__.push({size:mi(gt,X),type:Se+(Zt.__dir__<0?"Right":"")}),Zt},si.prototype[Se+"Right"]=function(gt){return this.reverse()[Se](gt).reverse()}}),Ka(["filter","map","takeWhile"],function(Se,Ae){var gt=Ae+1,Zt=gt==L||gt==S;si.prototype[Se]=function(mr){var Er=this.clone();return Er.__iteratees__.push({iteratee:wi(mr,3),type:gt}),Er.__filtered__=Er.__filtered__||Zt,Er}}),Ka(["head","last"],function(Se,Ae){var gt="take"+(Ae?"Right":"");si.prototype[Se]=function(){return this[gt](1).value()[0]}}),Ka(["initial","tail"],function(Se,Ae){var gt="drop"+(Ae?"":"Right");si.prototype[Se]=function(){return this.__filtered__?new si(this):this[gt](1)}}),si.prototype.compact=function(){return this.filter(ls)},si.prototype.find=function(Se){return this.filter(Se).head()},si.prototype.findLast=function(Se){return this.reverse().find(Se)},si.prototype.invokeMap=xi(function(Se,Ae){return typeof Se=="function"?new si(this):this.map(function(gt){return Wn(gt,Se,Ae)})}),si.prototype.reject=function(Se){return this.filter(qh(wi(Se)))},si.prototype.slice=function(Se,Ae){Se=oi(Se);var gt=this;return gt.__filtered__&&(Se>0||Ae<0)?new si(gt):(Se<0?gt=gt.takeRight(-Se):Se&&(gt=gt.drop(Se)),Ae!==i&&(Ae=oi(Ae),gt=Ae<0?gt.dropRight(-Ae):gt.take(Ae-Se)),gt)},si.prototype.takeRightWhile=function(Se){return this.reverse().takeWhile(Se).reverse()},si.prototype.toArray=function(){return this.take(X)},Ar(si.prototype,function(Se,Ae){var gt=/^(?:filter|find|map|reject)|While$/.test(Ae),Zt=/^(?:head|last)$/.test(Ae),mr=dr[Zt?"take"+(Ae=="last"?"Right":""):Ae],Er=Zt||/^find/.test(Ae);mr&&(dr.prototype[Ae]=function(){var an=this.__wrapped__,hn=Zt?[1]:arguments,zn=an instanceof si,xa=hn[0],wa=zn||st(an),La=function(Fo){var Go=mr.apply(dr,zs([Fo],hn));return Zt&&Ya?Go[0]:Go};wa&>&&typeof xa=="function"&&xa.length!=1&&(zn=wa=!1);var Ya=this.__chain__,fi=!!this.__actions__.length,Pi=Er&&!Ya,ko=zn&&!fi;if(!Er&&wa){an=ko?an:new si(this);var Fi=Se.apply(an,hn);return Fi.__actions__.push({func:Fd,args:[La],thisArg:i}),new _o(Fi,Ya)}return Pi&&ko?Se.apply(this,hn):(Fi=this.thru(La),Pi?Zt?Fi.value()[0]:Fi.value():Fi)})}),Ka(["pop","push","shift","sort","splice","unshift"],function(Se){var Ae=il[Se],gt=/^(?:push|sort|unshift)$/.test(Se)?"tap":"thru",Zt=/^(?:pop|shift)$/.test(Se);dr.prototype[Se]=function(){var mr=arguments;if(Zt&&!this.__chain__){var Er=this.value();return Ae.apply(st(Er)?Er:[],mr)}return this[gt](function(an){return Ae.apply(st(an)?an:[],mr)})}}),Ar(si.prototype,function(Se,Ae){var gt=dr[Ae];if(gt){var Zt=gt.name+"";Ni.call(Xi,Zt)||(Xi[Zt]=[]),Xi[Zt].push({name:Ae,func:gt})}}),Xi[Xh(i,p).name]=[{name:"wrapper",func:i}],si.prototype.clone=hs,si.prototype.reverse=mu,si.prototype.value=Va,dr.prototype.at=Pu,dr.prototype.chain=ah,dr.prototype.commit=Oh,dr.prototype.next=gp,dr.prototype.plant=cd,dr.prototype.reverse=Uy,dr.prototype.toJSON=dr.prototype.valueOf=dr.prototype.value=zy,dr.prototype.first=dr.prototype.head,Ko&&(dr.prototype[Ko]=vp),dr}),al=$l();ka?((ka.exports=al)._=al,Hn._=al):On._=al}).call(Owe)})(s2,s2.exports)),s2.exports}var v5=qwe();const Uwe=["x","y"],zwe=["fill"],Cwe={fill:"white","font-size":"8",x:"9.5",y:"10","font-family":"Montserrat-Regular","dominant-baseline":"middle","text-anchor":"middle"},l2={__name:"ChalkboardMarker",props:{x:Number,y:Number,color:String,jersey:Number,orientation:{type:String,default:"vertical"}},setup(e){return(a,i)=>(n.openBlock(),n.createElementBlock("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",x:`${e.x}%`,y:`${e.y}%`},[i[0]||(i[0]=n.createElementVNode("path",{opacity:"0.8",d:"M19.0921 9.65161C19.0921 4.54754 14.838 0.406006 9.59065 0.406006C4.34332 0.406006 0.09375 4.54754 0.09375 9.65161C0.09375 14.7557 4.34785 18.8972 9.59065 18.8972C14.8334 18.8972 19.0875 14.7557 19.0875 9.65161H19.0921Z",fill:"white"},null,-1)),n.createElementVNode("path",{d:"M9.58983 17.4931C14.0383 17.4931 17.6445 13.9824 17.6445 9.6516C17.6445 5.32084 14.0383 1.81006 9.58983 1.81006C5.14136 1.81006 1.53516 5.32084 1.53516 9.6516C1.53516 13.9824 5.14136 17.4931 9.58983 17.4931Z",fill:e.color},null,8,zwe),i[1]||(i[1]=n.createElementVNode("path",{style:{"mix-blend-mode":"multiply"},opacity:"1",d:"M18.2312 20.0011C18.2312 21.4228 14.2719 22.5708 9.38741 22.5708C4.50291 22.5708 0.539062 21.4184 0.539062 20.0011C0.539062 18.5838 4.49837 17.4314 9.38288 17.4314C14.2674 17.4314 18.2267 18.5838 18.2267 20.0011H18.2312Z",fill:"url(#paint0_radial_249_64014)"},null,-1)),n.createElementVNode("text",Cwe,n.toDisplayString(e.jersey),1),i[2]||(i[2]=n.createElementVNode("defs",null,[n.createElementVNode("radialGradient",{id:"paint0_radial_249_64014",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.76498 20.0631) scale(8.68186 2.33162)"},[n.createElementVNode("stop",{"stop-color":"#808080"}),n.createElementVNode("stop",{offset:"1","stop-color":"#CCCBCB","stop-opacity":"0"})])],-1))],8,Uwe))}},Pwe=["x","y"],Fwe=["fill"],Ewe=["href"],TL={__name:"ChalkboardMarkerLogo",props:{x:Number,y:Number,color:{type:String,default:"#FFFFFF"},logo:String,orientation:{type:String,default:"vertical"}},setup(e){return(a,i)=>(n.openBlock(),n.createElementBlock("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",x:`${e.x}%`,y:`${e.y}%`},[i[0]||(i[0]=n.createElementVNode("path",{opacity:"0.8",d:"M19.0921 9.65161C19.0921 4.54754 14.838 0.406006 9.59065 0.406006C4.34332 0.406006 0.09375 4.54754 0.09375 9.65161C0.09375 14.7557 4.34785 18.8972 9.59065 18.8972C14.8334 18.8972 19.0875 14.7557 19.0875 9.65161H19.0921Z",fill:"white"},null,-1)),n.createElementVNode("path",{d:"M9.58983 17.4931C14.0383 17.4931 17.6445 13.9824 17.6445 9.6516C17.6445 5.32084 14.0383 1.81006 9.58983 1.81006C5.14136 1.81006 1.53516 5.32084 1.53516 9.6516C1.53516 13.9824 5.14136 17.4931 9.58983 17.4931Z",fill:e.color},null,8,Fwe),i[1]||(i[1]=n.createElementVNode("path",{style:{"mix-blend-mode":"multiply"},opacity:"1",d:"M18.2312 20.0011C18.2312 21.4228 14.2719 22.5708 9.38741 22.5708C4.50291 22.5708 0.539062 21.4184 0.539062 20.0011C0.539062 18.5838 4.49837 17.4314 9.38288 17.4314C14.2674 17.4314 18.2267 18.5838 18.2267 20.0011H18.2312Z",fill:"url(#paint0_radial_249_64014)"},null,-1)),e.logo?(n.openBlock(),n.createElementBlock("image",{key:0,href:e.logo,x:"2",y:"2",width:"16",height:"16",preserveAspectRatio:"xMidYMid meet"},null,8,Ewe)):n.createCommentVNode("",!0),i[2]||(i[2]=n.createElementVNode("defs",null,[n.createElementVNode("radialGradient",{id:"paint0_radial_249_64014",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.76498 20.0631) scale(8.68186 2.33162)"},[n.createElementVNode("stop",{"stop-color":"#808080"}),n.createElementVNode("stop",{offset:"1","stop-color":"#CCCBCB","stop-opacity":"0"})])],-1))],8,Pwe))}},Rwe=["id"],Mwe=["fill"],kL={__name:"ChalkboardGraphic",props:{orientation:{type:String,required:!0},id:{type:String,required:!0},uniqueId:{type:String,required:!0}},setup(e){return(a,i)=>(n.openBlock(),n.createElementBlock("g",{id:e.id,class:n.normalizeClass(e.orientation)},[n.createElementVNode("rect",{opacity:"1",height:"411",width:"256",fill:`url(#${e.uniqueId}-fieldBackground)`},null,8,Mwe),i[0]||(i[0]=n.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="256" height="411" viewBox="0 0 256 411" fill="none"><rect x="0.53125" y="0.5" width="254.03" height="410" stroke="#fff"></rect><rect x="15.5312" y="14.5" width="224" height="382" stroke="#fff"></rect><rect x="69.5312" y="14.5" width="116" height="53" stroke="#fff"></rect><rect x="96.5312" y="14.5" width="62" height="29" stroke="#fff"></rect><rect x="69.5312" y="343.5" width="116" height="53" stroke="#fff"></rect><rect x="96.5312" y="367.5" width="62" height="29" stroke="#fff"></rect><path d="M15.5312 205.5H240.031" stroke="#fff"></path><circle cx="128.031" cy="206" r="36.5" stroke="#fff"></circle></svg>',1))],10,Rwe))}},Wwe=["viewBox"],jwe=["viewBox"],Kwe=["id"],Awe=["id"],Iwe=["fill"],Xwe=["id"],Dwe=["id"],Jwe=["id"],Gwe=["id"],Bwe=["id","onMouseover","onClick"],Zwe=["x1","y1","x2","y2","stroke"],Hwe=["x1","y1","x2","y2","stroke","marker-end"],Ywe={class:"is-pointer",transform:"translate(-11, -11)"},Qwe={key:0,class:"is-pointer",transform:"translate(-11, -11)"},$we=["id","onMouseover","onClick"],e5e=["x1","y1","x2","y2","stroke","marker-end"],t5e={class:"is-pointer",transform:"translate(-11, -11)"},r5e=["id","onMouseover","onClick"],n5e={class:"tooltip-data__title"},a5e={class:"tooltip-data__player"},i5e={class:"tooltip-data__content"},o5e={class:"tooltip-data__content"},s5e=["src"],l5e={key:0,class:"tooltip-data__content"},c5e={key:1,class:"tooltip-data__content"},u5e={class:"tooltip-data__button-play-container"},d5e={class:"tooltip-data__button-play"},Z0=250/2,p5e={__name:"XgChalkboard",props:{plays:{type:Array,require:!0},categories:{type:Array,required:!0},players:{type:Array,required:!0},games:{type:Array,default:()=>[]},team:{type:Number,default:0},playValuesIndex:{type:Object,required:!0},analysisType:{type:String,required:!1},sectionType:{type:String,required:!1,default:"team"},orientation:{type:String,required:!1,default:"horizontal"},canPlayVideos:{type:Boolean,default:!0},isAssistZoneVisible:{type:Boolean,default:!1},componentWidth:{type:Number,default:600},isTooltipAvailable:{type:Boolean,default:!1},uniqueId:{type:String,required:!0}},emits:["openmedia","change-xg","change-total-plays"],setup(e,{emit:a}){let i=null;const k=n.ref(null),W=n.ref(null);n.defineComponent({Tooltip:wL,ChalkboardMarker:l2,ChalkboardMarkerLogo:TL,ChalkboardGraphic:kL});const g=a,m=e,r=n.ref(!1),h=n.ref("red"),l=n.ref({x:0,y:0,visible:!1}),t=n.ref({playerName:"",minute:0,rivalLogo:"",categoryName:"",category:"",xGi:0,xGf:0,isOwnGoal:!1}),_=n.ref(!1),w=n.computed(()=>m.componentWidth<565),v=n.computed(()=>m.orientation==="horizontal"?m.componentWidth>384?"0 0 411 256":"0 0 784 490":m.componentWidth>384?"0 0 256 411":"0 0 490 784"),f=n.computed(()=>m.componentWidth<384),o=n.computed(()=>m.sectionType==="team"?[0,1,2,8]:X.value.position_id===1?[]:[0,3,4,10]),s=n.computed(()=>m.plays.map(H=>({playId:H[m.playValuesIndex.playId],gameId:H[m.playValuesIndex.gameId],teamId:H[m.playValuesIndex.teamId],playerId:H[m.playValuesIndex.playerId],momentOfPlay:H[m.playValuesIndex.momentOfPlay],categoryId:H[m.playValuesIndex.categoryId],categoryType:H[m.playValuesIndex.categoryType],matchLapse:H[m.playValuesIndex.matchLapse],section:H[m.playValuesIndex.section],matchResult:H[m.playValuesIndex.matchResult],playingAs:H[m.playValuesIndex.playingAs],total:H[m.playValuesIndex.total],x1:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate1Y]*100:H[m.playValuesIndex.coordinate1X]*100,y1:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate1X]*100:H[m.playValuesIndex.coordinate1Y]*100,x2:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate2Y]*100:H[m.playValuesIndex.coordinate2X]*100,y2:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate2X]*100:H[m.playValuesIndex.coordinate2Y]*100,x3:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate3Y]*100:H[m.playValuesIndex.coordinate3X]*100,y3:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate3X]*100:H[m.playValuesIndex.coordinate3Y]*100,xGi:H[m.playValuesIndex.xGi],xGf:H[m.playValuesIndex.xGf]}))),p=n.computed(()=>m.categories.map((H,ne)=>({id:ne,name:H.name,singleName:H.singleName,negative:H.negative||!1,color:H.color,points:H.points,numPoints:H.points.length,categories:H.categories,invert:H.invert||[]}))),c=n.computed(()=>m.isAssistZoneVisible?m.analysisType==="offensive"?2:3:1),d=n.computed(()=>{const H=p.value.filter(({numPoints:ne})=>ne===1).map(ne=>ne.categories).flat();return[...new Set(H)]}),b=n.computed(()=>{const H=p.value.filter(ne=>ne.numPoints===2).map(ne=>ne.categories).flat();return[...new Set(H)]}),x=n.computed(()=>{const H=p.value.filter(ne=>ne.numPoints===3).map(ne=>ne.categories).flat();return[...new Set(H)]}),T=n.computed(()=>{let H=d.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,G)=>{let re=p.value.find($=>C($.categories,G)),ee=m.players.find($=>$.player_id===G.playerId),Y=m.games.find($=>$?$.gameId===G.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,color:re.color,playId:G.playId,player:G.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:G.matchLapse,x1:re.invert.includes(G.categoryId)?100-G[`x${re.points[0]}`]:G[`x${re.points[0]}`],y1:re.invert.includes(G.categoryId)?100-G[`y${re.points[0]}`]:G[`y${re.points[0]}`],momentOfPlay:G.momentOfPlay,rivalLogo:q(Y,G)};m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=G.xGi,$.xGf=G.xGf),ne.push($)}return ne},[])}),N=n.computed(()=>{let H=b.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,G)=>{let re=p.value.find($=>C($.categories,G)),ee=m.players.find($=>$.player_id===G.playerId),Y=m.games.find($=>$?$.gameId===G.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,arrowColor:re.negative?h.value:re.color,arrowMarkerColor:re.negative?`url(#${m.uniqueId}-arrow-negative)`:`url(#${m.uniqueId}-arrow-${re.id})`,markerColor:re.color,playId:G.playId,player:G.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:G.matchLapse,x1:re.invert.includes(G.categoryId)?100-G[`x${re.points[0]}`]:G[`x${re.points[0]}`],y1:re.invert.includes(G.categoryId)?100-G[`y${re.points[0]}`]:G[`y${re.points[0]}`],x2:re.invert.includes(G.categoryId)?100-G[`x${re.points[1]}`]:G[`x${re.points[1]}`],y2:re.invert.includes(G.categoryId)?100-G[`y${re.points[1]}`]:G[`y${re.points[1]}`],momentOfPlay:G.momentOfPlay,rivalLogo:q(Y,G)};m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=G.xGi,$.xGf=G.xGf),ne.push($)}return ne},[])}),V=n.computed(()=>{let H=x.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,G)=>{let re=p.value.find($=>C($.categories,G)),ee=m.players.find($=>$.player_id===G.playerId),Y=m.games.find($=>$?$.gameId===G.gameId||$.game_id===G.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,arrowColor:re.negative?h.value:re.color,arrowMarkerColor:re.negative?`url(#${m.uniqueId}-arrow-negative)`:`url(#${m.uniqueId}-arrow-${re.id})`,markerColor:re.color,playId:G.playId,player:G.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:G.matchLapse,x1:re.invert.includes(G.categoryId)?100-G[`x${re.points[0]}`]:G[`x${re.points[0]}`],y1:re.invert.includes(G.categoryId)?100-G[`y${re.points[0]}`]:G[`y${re.points[0]}`],x2:re.invert.includes(G.categoryId)?100-G[`x${re.points[1]}`]:G[`x${re.points[1]}`],y2:re.invert.includes(G.categoryId)?100-G[`y${re.points[1]}`]:G[`y${re.points[1]}`],x3:re.invert.includes(G.categoryId)?100-G[`x${re.points[2]}`]:G[`x${re.points[2]}`],y3:re.invert.includes(G.categoryId)?100-G[`y${re.points[2]}`]:G[`y${re.points[2]}`],momentOfPlay:G.momentOfPlay,rivalLogo:q(Y,G)};re.id===0&&m.analysisType==="offensive"&&G.teamId?$.isOwnGoal=m.team!==G.teamId:re.id===0&&m.analysisType==="defensive"&&G.teamId?$.isOwnGoal=m.team===G.teamId:$.isOwnGoal=!1,m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=G.xGi,$.xGf=G.xGf),ne.push($)}return ne},[])}),U=()=>{!W.value||W.value.contains(event.target)||(f.value&&(r.value||z()),r.value=!1)},z=()=>{l.value.visible=!1},O=(H,ne,G=null)=>{const re=s.value.find(ue=>ue.playId===H.playId),ee=G!==null?m.categories[G].name:H.categoryName;let Y={};const $=m.categories.find(ue=>ue.id===H.category),le=$?$.categories:[];if(ne===2&&!f.value){const ue=m.sectionType==="team"&&m.analysisType==="defensive"&&ee.includes("recibidos");Y={seasonId:selectedSeasonIdFilterOptions.value,categoryIds:le,categorySingleName:"",mainSectionType:1,playListType:m.sectionType==="team"?3:2,matchResult:selectedGameResultsFilterOptions.value,playData:re||null,gameIds:selectedGamesIdsFilterOptions.value,isRivalSubject:ue,avoidCategorySingleName:ue,advancedFilter:{playListTitle:ee,mainCategoryId:{},playingAs:selectedPlayingAsFilterOptions.value?[selectedPlayingAsFilterOptions.value]:[1,2],timeSections:selectedGameTimePeriodsFilterOptions.value,fieldSections:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}}}if(ne===1){const ue=m.sectionType==="team"&&ee.includes("recibidos");Y={seasonId:selectedSeasonIdFilterOptions.value,categoryIds:le,categorySingleName:"",mainSectionType:1,playListType:m.sectionType==="team"?3:2,gameIds:selectedGamesIdsFilterOptions.value,matchResult:selectedGameResultsFilterOptions.value,playData:re||null,isRivalSubject:ue,avoidCategorySingleName:ue,advancedFilter:{playListTitle:ee,mainCategoryId:{},playingAs:selectedPlayingAsFilterOptions.value?[selectedPlayingAsFilterOptions.value]:[1,2],timeSections:selectedGameTimePeriodsFilterOptions.value,fieldSections:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}}}const ie=m.sectionType==="team";ne===1?ie&&teamId.value?(Y.playerIds=[],Y.teamId=teamId.value):ie||(Y.playerIds=re?[re.playerId]:null,Y.teamId=0):f.value||(ie&&teamId.value?(Y.playerIds=[],Y.teamId=teamId.value):ie||(Y.playerIds=re?[re.playerId]:null,Y.teamId=0)),ne===1?g("openmedia",Y):f.value||g("openmedia",Y)},C=(H,ne)=>H.find(G=>{let re=0;if(typeof G=="string"){if(ne.teamId)return re=Number(G.split("_").shift()),re===ne.categoryId&&ne.teamId!==m.team}else return ne.teamId?G===ne.categoryId&&m.team===ne.teamId:G===ne.categoryId;return!1}),q=(H,ne)=>m.sectionType==="team"?H.homeTeamId===m.team?H.visitingTeamLogo:H.homeTeamLogo:ne.playingAs===1?H.visitingTeamLogo:H.homeTeamLogo,L=()=>{if(window.ResizeObserver)i=new ResizeObserver(()=>{_.value=k.value&&k.value.clientWidth>524}),i.observe(k.value);else throw new Error("Resize observer not supported!")};function P(){w.value&&O(S.value.play,S.value.type)}const S=n.ref({play:null,type:null}),F=(H,ne,G)=>{m.isTooltipAvailable&&(r.value=!0,w.value?(S.value={play:ne,type:G},t.value.category=ne.category,t.value.playerName=ne.playerName||"",t.value.playerImage=ne.playerImage||"",t.value.minute=parseInt(ne.momentOfPlay.split(":")[0])||"",t.value.rivalLogo=ne.rivalLogo||"",t.value.categoryName=ne.categoryName||"",t.value.xGi=String(ne.xGi),t.value.xGf=String(ne.xGf),t.value.isOwnGoal=ne.isOwnGoal,l.value.x=H.layerX<Z0+5?5:H.layerX+Z0>k.value.clientWidth?k.value.clientWidth-Z0*2-5:H.layerX,l.value.y=H.layerY+20,l.value.visible=!0):O(ne,G))},R=(H,ne,G)=>{m.isTooltipAvailable&&(S.value={play:ne,type:G},w.value||(t.value.category=ne.category,t.value.playerName=ne.playerName||"",t.value.playerImage=ne.playerImage||"",t.value.minute=parseInt(ne.momentOfPlay.split(":")[0])||"",t.value.rivalLogo=ne.rivalLogo||"",t.value.categoryName=ne.categoryName||"",t.value.xGi=String(ne.xGi),t.value.xGf=String(ne.xGf),t.value.isOwnGoal=ne.isOwnGoal,l.value.x=H.layerX<Z0+5?5:H.layerX+Z0>k.value.clientWidth?k.value.clientWidth-Z0*2-5:H.layerX,l.value.y=H.layerY+20,l.value.visible=!0))},j=()=>{f.value||(l.value.visible=!1)},K=()=>{f.value&&(l.value.visible=!1)},X=n.ref({}),D=n.computed(()=>{const H=v5.groupBy(T.value,"momentOfPlay"),ne=v5.groupBy(N.value,"momentOfPlay"),G=v5.groupBy(V.value,"momentOfPlay");return{playsByMoment1:H,playsByMoment2:ne,playsByMoment3:G}});return n.watch(()=>D.value,H=>{const ne={...H.playsByMoment1,...H.playsByMoment2,...H.playsByMoment3};let G=0;Object.entries(ne).forEach(le=>{o.value.includes(le[1][0].category)&&!le.isOwnGoal&&(G+=Number(le[1][0].xGf))});let re=Object.keys(H.playsByMoment1).length,ee=Object.keys(H.playsByMoment2).length,Y=Object.keys(H.playsByMoment3).length;const $=re+ee+Y;g("change-xg",G),g("change-total-plays",$)},{immediate:!0}),n.onMounted(()=>{document.addEventListener("click",U),L()}),n.onBeforeUnmount(()=>{document.removeEventListener("click",U),i&&(i.disconnect(),i=null)}),(H,ne)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"soccerChalkboard",ref:k,class:n.normalizeClass(["chalkboard__container",e.orientation]),onMouseleave:K},[(n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:v.value,"xmlns:xlink":"http://www.w3.org/1999/xlink",class:"soccer-chalkboard"},[(n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e.orientation==="horizontal"?"0 0 411 256":"0 0 256 411","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"svg-soccer-chalkboard"},[n.createElementVNode("defs",null,[n.createElementVNode("marker",{id:`${e.uniqueId}-arrow-negative`,viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"6",markerHeight:"6",markerUnits:"strokeWidth",orient:"auto"},[...ne[0]||(ne[0]=[n.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z","stroke-width":"2",fill:"red"},null,-1)])],8,Kwe),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p.value,G=>(n.openBlock(),n.createElementBlock("marker",{key:`${e.uniqueId}-arrow-color-${G.id}`,id:`${e.uniqueId}-arrow-${G.id}`,viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"6",markerHeight:"6",markerUnits:"strokeWidth",orient:"auto"},[n.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z","stroke-width":"2",fill:G.color},null,8,Iwe)],8,Awe))),128)),n.createElementVNode("pattern",{id:`${e.uniqueId}-fieldBackground`,width:"1",height:"1",viewBox:"0 0 100 100",preserveAspectRatio:"none"},[c.value===1?(n.openBlock(),n.createElementBlock("image",{key:0,"xlink:href":Twe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Dwe)):c.value===2?(n.openBlock(),n.createElementBlock("image",{key:1,"xlink:href":kwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Jwe)):c.value===3?(n.openBlock(),n.createElementBlock("image",{key:2,"xlink:href":Lwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Gwe)):n.createCommentVNode("",!0)],8,Xwe)]),n.createVNode(kL,{id:"soccer-field",orientation:e.orientation,"unique-id":e.uniqueId},null,8,["orientation","unique-id"]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(V.value,G=>(n.openBlock(),n.createElementBlock("g",{key:G.id,id:`play-${G.playId}`,onMouseover:re=>R(re,G,2),onMouseleave:j,onClick:re=>F(re,G,2)},[n.createElementVNode("line",{x1:`${G.x1}%`,y1:`${G.y1}%`,x2:`${G.x2}%`,y2:`${G.y2}%`,stroke:G.arrowColor,"stroke-width":"2"},null,8,Zwe),n.createElementVNode("line",{x1:`${G.x2}%`,y1:`${G.y2}%`,x2:`${G.x3}%`,y2:`${G.y3}%`,stroke:G.arrowColor,"stroke-width":"2","marker-end":`${G.arrowMarkerColor}`},null,8,Hwe),n.createElementVNode("g",Ywe,[n.createVNode(l2,{jersey:G.jersey,color:G.markerColor,x:G.x1,y:G.y1,orientation:e.orientation},null,8,["jersey","color","x","y","orientation"])]),G.categoryName==="Atajadas"||G.categoryName==="Goles recibidos"?(n.openBlock(),n.createElementBlock("g",Qwe,[n.createVNode(TL,{color:"#FFFFFF",logo:G.rivalLogo,x:G.x2,y:G.y2,orientation:e.orientation},null,8,["logo","x","y","orientation"])])):n.createCommentVNode("",!0)],40,Bwe))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.value,G=>(n.openBlock(),n.createElementBlock("g",{key:G.id,id:`play-${G.playId}`,onMouseover:re=>R(re,G,2),onMouseleave:j,onClick:re=>F(re,G,2)},[n.createElementVNode("line",{x1:`${G.x1}%`,y1:`${G.y1}%`,x2:`${G.x2}%`,y2:`${G.y2}%`,"stroke-width":"2",stroke:G.arrowColor,"marker-end":`${G.arrowMarkerColor}`},null,8,e5e),n.createElementVNode("g",t5e,[n.createVNode(l2,{jersey:G.jersey,color:G.markerColor,x:G.x1,y:G.y1},null,8,["jersey","color","x","y"])])],40,$we))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(T.value,G=>(n.openBlock(),n.createElementBlock("g",{key:G.id,id:`play-${G.playId}`,class:"is-pointer",onMouseover:re=>R(re,G,2),onMouseleave:j,onClick:re=>F(re,G,2),transform:"translate(-11, -11)"},[n.createVNode(l2,{x:G.x1,y:G.y1,jersey:G.jersey,color:G.color},null,8,["x","y","jersey","color"])],40,r5e))),128))],8,jwe))],8,Wwe)),n.createVNode(wL,{"play-data":l.value,"is-mobile-device":w.value},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["tooltip-data",e.orientation])},[n.createElementVNode("p",n5e,n.toDisplayString(t.value.isOwnGoal?t.value.categoryName=="Goles recibidos"?t.value.categoryName:"Autogol":t.value.categoryName),1),n.createElementVNode("div",a5e,[n.createElementVNode("span",null,n.toDisplayString(t.value.playerName),1),n.createElementVNode("div",{class:"tooltip-data__player-image",style:n.normalizeStyle(`background-image: url(${t.value.playerImage})`)},null,4)]),n.createElementVNode("div",i5e,[n.createElementVNode("span",null,"Minuto: "+n.toDisplayString(t.value.minute),1)]),n.createElementVNode("div",o5e,[n.createElementVNode("span",null,"Rival: "+n.toDisplayString(t.value.rivalName),1),n.createElementVNode("img",{src:t.value.rivalLogo,width:"25",style:{"vertical-align":"middle"}},null,8,s5e)]),/^[+]?([0-1]+(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t.value.xGi)&&t.value.xGi<=1&&!t.value.isOwnGoal?(n.openBlock(),n.createElementBlock("div",l5e,[ne[1]||(ne[1]=n.createElementVNode("span",{class:"bold"},"xGi:",-1)),n.createTextVNode(" "+n.toDisplayString(n.unref(_L)(Number(t.value.xGi),4)),1)])):n.createCommentVNode("",!0),/^[+]?([0-1]+(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t.value.xGf)&&t.value.xGf<=1&&!t.value.isOwnGoal?(n.openBlock(),n.createElementBlock("div",c5e,[ne[2]||(ne[2]=n.createElementVNode("span",{class:"bold"},"xGf:",-1)),n.createTextVNode(" "+n.toDisplayString(n.unref(_L)(Number(t.value.xGf),4)),1)])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("div",u5e,[n.createElementVNode("div",d5e,[n.createElementVNode("div",{role:"button",class:"tooltip-data__button-play__button",onClick:n.withModifiers(P,["stop","prevent"])},[...ne[3]||(ne[3]=[n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none"},[n.createElementVNode("path",{d:"M3.0492 8.92004C2.9831 8.88243 2.92785 8.82624 2.88941 8.75753C2.85097 8.68882 2.83079 8.61018 2.83106 8.53011V1.46888C2.83115 1.38908 2.85146 1.3108 2.88982 1.24236C2.92819 1.17392 2.98318 1.11788 3.04895 1.08019C3.11472 1.0425 3.18881 1.02458 3.26334 1.02832C3.33788 1.03206 3.41007 1.05733 3.47225 1.10145L8.4249 4.63248C8.48147 4.67271 8.52786 4.72726 8.55995 4.79129C8.59204 4.85533 8.60883 4.92685 8.60883 4.9995C8.60883 5.07214 8.59204 5.14367 8.55995 5.2077C8.52786 5.27173 8.48147 5.32629 8.4249 5.36651L3.47225 8.89838C3.41016 8.94259 3.33803 8.96796 3.26352 8.97177C3.18902 8.97559 3.11495 8.95771 3.0492 8.92004ZM3.24397 8.53095L8.19663 4.99991L3.24397 8.53095Z",fill:"#CBEE6B"})],-1)])]),ne[4]||(ne[4]=n.createElementVNode("div",null,"Ver video",-1))])],512),[[n.vShow,w.value]])],2)]),_:1},8,["play-data","is-mobile-device"])],34))}},h5e=g5(p5e,[["__scopeId","data-v-00302137"]]);function f5e(e){return e.reduce((a,i,k)=>(a[i]=k,a),{})}const m5e=["playId","gameId","teamId","playerId","momentOfPlay","categoryId","categoryType","matchLapse","section","matchResult","playingAs","total","coordinate1X","coordinate1Y","coordinate2X","coordinate2Y","coordinate3X","coordinate3Y","xGi","xGf"];let b5=null;function y5e(){return b5||(b5=f5e(m5e)),b5}const g5e={class:"chalkboard-profile__field"},v5e={class:"chalkboard-profile__field__events"},b5e={__name:"GSC-LastTouch",props:{categories:{type:Array,default:()=>[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}]},seasonId:{type:Number,default:2010},isPreMatch:{type:Boolean,default:!1},howManyGames:{type:Number,default:1},analysisType:{type:String,default:"offensive"},sectionType:{type:String,default:"team"},orientation:{type:String,default:"vertical"},isFull:{type:Boolean,default:!1},isTotalXgfVisible:{type:Boolean,default:!0},canPlayVideos:{type:Boolean,default:!1},teamIdForAnalysis:{type:Number,default:1},isAssistZoneVisible:{type:Boolean,default:!1},gamesIdsForAnalysis:{type:Array,default:()=>[]},gameDateUTC:{type:String,default:""},token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},isTemplateMode:{type:Boolean,default:!1},isHomeTeamForAnalysis:{type:Boolean,default:!0}},emits:["openmedia"],setup(e,{emit:a}){let i=null;const k=a,W=e,g=n.ref(null),m=n.ref(1200),r=n.ref(0),h=n.ref("vertical");n.ref({});const l=n.ref(0),t=n.ref(0),_=n.ref([]),w=n.ref([]),v=n.ref([]),f=n.ref(`chalkboard-profile-${Math.random().toString(36).substring(2,11)}`),o=n.computed(()=>W.teamIdForAnalysis),s=n.computed(()=>({"--font-size-events":m.value<220?"9px":"12px"}));n.computed(()=>[1,2,3]),n.computed(()=>[1,2,3,4,5,6]),n.computed(()=>[1,2]);const p=n.computed(()=>y5e()),c=n.computed(()=>[...W.categories]),d=n.computed(()=>W.categories.reduce((q,L)=>(Array.isArray(L.categories)&&q.push(...L.categories),q),[]));n.watch(()=>W.categories,()=>{C()},{deep:!0}),n.watch(()=>W.analysisType,(q,L)=>{q!==L&&C()});function b(){i=new ResizeObserver(q=>{for(const L of q)m.value=L.contentRect.width}),i.observe(g.value)}function x(q){l.value=q}function T(q){t.value=q}n.onMounted(()=>{b()});function N(q){k("openmedia",q)}async function V(){try{const q=`https://d2oco6mqmc.execute-api.us-west-2.amazonaws.com/prod/teamsBySeason/${W.seasonId}`;return(await(await fetch(q,{headers:{Authorization:W.token}})).json()).teams||[]}catch(q){console.error("Error al obtener los equipos por temporada:",q)}}async function U(){try{const q=`https://pa3kubpuhg.execute-api.us-west-2.amazonaws.com/prod/playersByTeamAndSeason/${W.seasonId}/`,L=await(await fetch(q,{headers:{Authorization:W.token}})).json();return(L==null?void 0:L.reduce((P,S)=>(S.players&&Array.isArray(S.players)&&P.push(...S.players),P),[]))||[]}catch(q){console.error("Error al obtener los jugadores por temporada:",q)}}async function z(){try{const q=`https://8tvo5bp9ai.execute-api.us-west-2.amazonaws.com/prod/gamesBySeason/${W.seasonId}`;return(await(await fetch(q,{headers:{Authorization:W.token}})).json()).games||[]}catch(q){console.error("Error al obtener los partidos por temporada:",q)}}async function O(){try{const q=W.gamesIdsForAnalysis.length?W.gamesIdsForAnalysis.reduce((R,j,K)=>(R+=K===0?`game_id=${j}`:`&game_id=${j}`,R),""):"",L=d.value.reduce((R,j,K)=>(R+=K===0?`category_id=${j}`:`&category_id=${j}`,R),""),P=W.analysisType==="offensive"?2:3,S=`https://mabnn9axgb.execute-api.us-west-2.amazonaws.com/prod/seasons/${W.seasonId}/stats?${q}&team_id=${W.teamIdForAnalysis}&${L}&analysis_type=${P}&is_chalkboard=true`,F=await(await fetch(S,{headers:{Authorization:W.token}})).json();return Object.values(F).reduce((R,j)=>(j&&Array.isArray(j)&&R.push(...j),R),[])}catch(q){console.error("Error al obtener las estadísticas del equipo por temporada:",q)}}async function C(){try{const q=[];q.push(V),q.push(U),q.push(z),q.push(O);const[L,P,S,F]=await Promise.all(q.map(R=>R()));_.value=W.isTemplateMode?F.slice(0,3):F,w.value=P,v.value=S}catch(q){console.error("Error al llenar los datos del chalkboard:",q)}}return n.onMounted(async()=>{try{b(),await C()}catch(q){console.error("Error al cargar los datos del chalkboard:",q)}}),(q,L)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"chalkboardProfile",ref:g,class:"chalkboard-profile",style:n.normalizeStyle(s.value)},[n.createElementVNode("div",g5e,[(n.openBlock(),n.createBlock(h5e,{plays:_.value,categories:c.value,players:w.value,games:v.value,team:o.value,"play-values-index":p.value,"analysis-type":e.analysisType,"section-type":e.sectionType,orientation:h.value,key:r.value,"can-play-videos":e.canPlayVideos,"is-assist-zone-visible":e.isAssistZoneVisible,"component-width":m.value,"unique-id":f.value,onOpenmedia:N,onChangeTotalPlays:x,onChangeXg:T},null,8,["plays","categories","players","games","team","play-values-index","analysis-type","section-type","orientation","can-play-videos","is-assist-zone-visible","component-width","unique-id"])),n.createElementVNode("div",v5e,[e.isTotalXgfVisible?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(" xG: "+n.toDisplayString(t.value.toFixed(2))+" ",1),L[0]||(L[0]=n.createElementVNode("span",{class:"chalkboard-profile__field__events__separator"}," | ",-1))],64)):n.createCommentVNode("",!0),n.createTextVNode(" Eventos totales: "+n.toDisplayString(l.value),1)])])],4))}},LL=g5(b5e,[["__scopeId","data-v-5ba46eb8"]]),x5e={class:"tooltip-options"},w5e={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(e,{emit:a}){const i=e,k=a,W=n.computed(()=>i.optionsType==="page");function g(){k("close-tooltip")}function m(r){k(r),g()}return(r,h)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",{class:"tooltip-overlay",onClick:g}),n.createElementVNode("div",x5e,[n.createElementVNode("ul",null,[W.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("li",{class:"option",onClick:h[0]||(h[0]=l=>m("change-sort"))},[...h[4]||(h[4]=[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),n.createTextVNode(" Cambiar orden ",-1)])]),n.createElementVNode("li",{class:"option",onClick:h[1]||(h[1]=l=>m("delete-page"))},[...h[5]||(h[5]=[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),n.createTextVNode(" Eliminar ",-1)])])],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("li",{class:"option",onClick:h[2]||(h[2]=l=>m("edit"))},[...h[6]||(h[6]=[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),n.createTextVNode(" Editar ",-1)])]),n.createElementVNode("li",{class:"option",onClick:h[3]||(h[3]=l=>m("delete"))},[...h[7]||(h[7]=[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),n.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},NL=jd(w5e,[["__scopeId","data-v-998e2429"]]),_5e={class:"report-view"},S5e={class:"report-view__header"},T5e={key:0,class:"report-view__header__logo"},k5e=["src"],L5e={class:"report-view__header__name"},N5e={class:"report-view__content"},V5e={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(e,{emit:a}){const i=e,k=n.ref(!1),W=a,g=[1,2,3,4,6,8,14,13],m=n.computed(()=>!g.includes(i.viewId)),r=n.computed(()=>{if(i.game){const o=i.isHomeTeam?i.game.homeTeam:i.game.awayTeam;if(o&&o.logo)return o.logo}return""}),h=n.computed(()=>{const o=i.view.coreView;return o?o.id===9?i.view.w<4?i.view.title.replace("Mapeo de ",""):i.view.title:o.id===6?t(i.view):o.id===13?_(i.view):i.view.title:i.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function t(o){return i.isPostMatch?o.title:`${o.title} ${l.get(o.componentProps.gameNumber)+" partido"||""}`}function _(o){try{if(!o)return"Tabla por Categoría";const s=o.dynamicFilters||[];if(!Array.isArray(s)||s.length<2)return"Tabla por Categoría";const p=s[1]||[],c=s[0]||2;if(p&&p.length>0){const d=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:c==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:c==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:c==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:c==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],b=(x,T)=>{if(x.length!==T.length)return!1;const N=[...x].sort(),V=[...T].sort();return N.every((U,z)=>U===V[z])};for(const x of d)if(b(p,x.value))return x.label}return"Tabla por Categoría"}catch(s){return console.error("Error en getTableCategoryTitle:",s),"Tabla por Categoría"}}function w(){f(),W("edit")}function v(){f(),W("delete")}function f(){k.value=!1}return(o,s)=>(n.openBlock(),n.createElementBlock("div",_5e,[n.createElementVNode("div",S5e,[k.value?(n.openBlock(),n.createBlock(NL,{key:0,"options-type":"view",onClick:s[0]||(s[0]=n.withModifiers(p=>k.value=!1,["self"])),onMouseleave:s[1]||(s[1]=p=>k.value=!1),onCloseTooltip:f,onEdit:w,onDelete:v})):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"report-view__header__team-and-name",style:n.normalizeStyle(e.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[r.value&&m.value?(n.openBlock(),n.createElementBlock("div",T5e,[n.createElementVNode("img",{src:r.value,alt:""},null,8,k5e)])):n.createCommentVNode("",!0),n.createElementVNode("div",L5e,n.toDisplayString(h.value),1)],4),n.withDirectives(n.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:s[2]||(s[2]=p=>k.value=!0)},[...s[3]||(s[3]=[n.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])],512),[[n.vShow,e.isTemplateMode&&!e.isFilterVisible]])]),n.createElementVNode("div",N5e,[n.createElementVNode("div",{class:n.normalizeClass({"field-possession-component":e.viewId===8,"timeline-component":e.viewId===4,"field-data-by-zones-component":e.viewId===9})},[n.renderSlot(o.$slots,"default",{},void 0,!0)],2)])]))}},O5e=jd(V5e,[["__scopeId","data-v-150c2e28"]]);function q5e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c2={exports:{}},VL;function U5e(){if(VL)return c2.exports;VL=1;function e(){}return e.prototype={on:function(a,i,k){var W=this.e||(this.e={});return(W[a]||(W[a]=[])).push({fn:i,ctx:k}),this},once:function(a,i,k){var W=this;function g(){W.off(a,g),i.apply(k,arguments)}return g._=i,this.on(a,g,k)},emit:function(a){var i=[].slice.call(arguments,1),k=((this.e||(this.e={}))[a]||[]).slice(),W=0,g=k.length;for(W;W<g;W++)k[W].fn.apply(k[W].ctx,i);return this},off:function(a,i){var k=this.e||(this.e={}),W=k[a],g=[];if(W&&i)for(var m=0,r=W.length;m<r;m++)W[m].fn!==i&&W[m].fn._!==i&&g.push(W[m]);return g.length?k[a]=g:delete k[a],this}},c2.exports=e,c2.exports.TinyEmitter=e,c2.exports}var x5,OL;function z5e(){if(OL)return x5;OL=1;var e=U5e();return x5=new e,x5}var C5e=z5e();const Ua=q5e(C5e);function P5e(e,a,i,k,W){const g=(...m)=>(console.warn("gridstack.js: Function `"+i+"` is deprecated in "+W+" and has been replaced with `"+k+"`. It will be **removed** in a future release"),a.apply(e,m));return g.prototype=a.prototype,g}class Yn{static getElements(a,i=document){if(typeof a=="string"){const k="getElementById"in i?i:void 0;if(k&&!isNaN(+a[0])){const g=k.getElementById(a);return g?[g]:[]}let W=i.querySelectorAll(a);return!W.length&&a[0]!=="."&&a[0]!=="#"&&(W=i.querySelectorAll("."+a),W.length||(W=i.querySelectorAll("#"+a))),Array.from(W)}return[a]}static getElement(a,i=document){if(typeof a=="string"){const k="getElementById"in i?i:void 0;if(!a.length)return null;if(k&&a[0]==="#")return k.getElementById(a.substring(1));if(a[0]==="#"||a[0]==="."||a[0]==="[")return i.querySelector(a);if(k&&!isNaN(+a[0]))return k.getElementById(a);let W=i.querySelector(a);return k&&!W&&(W=k.getElementById(a)),W||(W=i.querySelector("."+a)),W}return a}static lazyLoad(a){var i,k;return a.lazyLoad||((k=(i=a.grid)==null?void 0:i.opts)==null?void 0:k.lazyLoad)&&a.lazyLoad!==!1}static createDiv(a,i){const k=document.createElement("div");return a.forEach(W=>{W&&k.classList.add(W)}),i==null||i.appendChild(k),k}static shouldSizeToContent(a,i=!1){return(a==null?void 0:a.grid)&&(i?a.sizeToContent===!0||a.grid.opts.sizeToContent===!0&&a.sizeToContent===void 0:!!a.sizeToContent||a.grid.opts.sizeToContent&&a.sizeToContent!==!1)}static isIntercepted(a,i){return!(a.y>=i.y+i.h||a.y+a.h<=i.y||a.x+a.w<=i.x||a.x>=i.x+i.w)}static isTouching(a,i){return Yn.isIntercepted(a,{x:i.x-.5,y:i.y-.5,w:i.w+1,h:i.h+1})}static areaIntercept(a,i){const k=a.x>i.x?a.x:i.x,W=a.x+a.w<i.x+i.w?a.x+a.w:i.x+i.w;if(W<=k)return 0;const g=a.y>i.y?a.y:i.y,m=a.y+a.h<i.y+i.h?a.y+a.h:i.y+i.h;return m<=g?0:(W-k)*(m-g)}static area(a){return a.w*a.h}static sort(a,i=1){return a.sort((k,W)=>{const g=i*((k.y??1e4)-(W.y??1e4));return g===0?i*((k.x??1e4)-(W.x??1e4)):g})}static find(a,i){return i?a.find(k=>k.id===i):void 0}static toBool(a){return typeof a=="boolean"?a:typeof a=="string"?(a=a.toLowerCase(),!(a===""||a==="no"||a==="false"||a==="0")):!!a}static toNumber(a){return a===null||a.length===0?void 0:Number(a)}static parseHeight(a){let i,k="px";if(typeof a=="string")if(a==="auto"||a==="")i=0;else{const W=a.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!W)throw new Error(`Invalid height val = ${a}`);k=W[2]||"px",i=parseFloat(W[1])}else i=a;return{h:i,unit:k}}static defaults(a,...i){return i.forEach(k=>{for(const W in k){if(!k.hasOwnProperty(W))return;a[W]===null||a[W]===void 0?a[W]=k[W]:typeof k[W]=="object"&&typeof a[W]=="object"&&Yn.defaults(a[W],k[W])}}),a}static same(a,i){if(typeof a!="object")return a==i;if(typeof a!=typeof i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const k in a)if(a[k]!==i[k])return!1;return!0}static copyPos(a,i,k=!1){return i.x!==void 0&&(a.x=i.x),i.y!==void 0&&(a.y=i.y),i.w!==void 0&&(a.w=i.w),i.h!==void 0&&(a.h=i.h),k&&(i.minW&&(a.minW=i.minW),i.minH&&(a.minH=i.minH),i.maxW&&(a.maxW=i.maxW),i.maxH&&(a.maxH=i.maxH)),a}static samePos(a,i){return a&&i&&a.x===i.x&&a.y===i.y&&(a.w||1)===(i.w||1)&&(a.h||1)===(i.h||1)}static sanitizeMinMax(a){a.minW||delete a.minW,a.minH||delete a.minH,a.maxW||delete a.maxW,a.maxH||delete a.maxH}static removeInternalAndSame(a,i){if(!(typeof a!="object"||typeof i!="object"))for(let k in a){const W=a[k],g=i[k];k[0]==="_"||W===g?delete a[k]:W&&typeof W=="object"&&g!==void 0&&(Yn.removeInternalAndSame(W,g),Object.keys(W).length||delete a[k])}}static removeInternalForSave(a,i=!0){for(let k in a)(k[0]==="_"||a[k]===null||a[k]===void 0)&&delete a[k];delete a.grid,i&&delete a.el,a.autoPosition||delete a.autoPosition,a.noResize||delete a.noResize,a.noMove||delete a.noMove,a.locked||delete a.locked,(a.w===1||a.w===a.minW)&&delete a.w,(a.h===1||a.h===a.minH)&&delete a.h}static throttle(a,i){let k=!1;return(...W)=>{k||(k=!0,setTimeout(()=>{a(...W),k=!1},i))}}static removePositioningStyles(a){const i=a.style;i.position&&i.removeProperty("position"),i.left&&i.removeProperty("left"),i.top&&i.removeProperty("top"),i.width&&i.removeProperty("width"),i.height&&i.removeProperty("height")}static getScrollElement(a){if(!a)return document.scrollingElement||document.documentElement;const i=getComputedStyle(a);return/(auto|scroll)/.test(i.overflow+i.overflowY)?a:Yn.getScrollElement(a.parentElement)}static updateScrollPosition(a,i,k){const W=Yn.getScrollElement(a);if(!W)return;const g=a.getBoundingClientRect(),m=W.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,h=g.bottom-Math.min(m.bottom,r),l=g.top-Math.max(m.top,0),t=W.scrollTop;l<0&&k<0?a.offsetHeight>m.height?W.scrollTop+=k:W.scrollTop+=Math.abs(l)>Math.abs(k)?k:l:h>0&&k>0&&(a.offsetHeight>m.height?W.scrollTop+=k:W.scrollTop+=h>k?k:h),i.top+=W.scrollTop-t}static updateScrollResize(a,i,k){const W=Yn.getScrollElement(i),g=W.clientHeight,m=W===Yn.getScrollElement()?0:W.getBoundingClientRect().top,r=a.clientY-m,h=r<k,l=r>g-k;h?W.scrollBy({behavior:"smooth",top:r-k}):l&&W.scrollBy({behavior:"smooth",top:k-(g-r)})}static clone(a){return a==null||typeof a!="object"?a:a instanceof Array?[...a]:{...a}}static cloneDeep(a){const i=["parentGrid","el","grid","subGrid","engine"],k=Yn.clone(a);for(const W in k)k.hasOwnProperty(W)&&typeof k[W]=="object"&&W.substring(0,2)!=="__"&&!i.find(g=>g===W)&&(k[W]=Yn.cloneDeep(a[W]));return k}static cloneNode(a){const i=a.cloneNode(!0);return i.removeAttribute("id"),i}static appendTo(a,i){let k;typeof i=="string"?k=Yn.getElement(i):k=i,k&&k.appendChild(a)}static addElStyles(a,i){if(i instanceof Object)for(const k in i)i.hasOwnProperty(k)&&(Array.isArray(i[k])?i[k].forEach(W=>{a.style[k]=W}):a.style[k]=i[k])}static initEvent(a,i){const k={type:i.type},W={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:i.target?i.target:a.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(g=>k[g]=a[g]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(g=>k[g]=a[g]),{...k,...W}}static simulateMouseEvent(a,i,k){const W=a,g=new MouseEvent(i,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:a.screenX,screenY:a.screenY,clientX:a.clientX,clientY:a.clientY,ctrlKey:W.ctrlKey??!1,altKey:W.altKey??!1,shiftKey:W.shiftKey??!1,metaKey:W.metaKey??!1,button:0,relatedTarget:a.target});(k||a.target).dispatchEvent(g)}static getValuesFromTransformedElement(a){const i=document.createElement("div");Yn.addElStyles(i,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),a.appendChild(i);const k=i.getBoundingClientRect();return a.removeChild(i),i.remove(),{xScale:1/k.width,yScale:1/k.height,xOffset:k.left,yOffset:k.top}}static swap(a,i,k){if(!a)return;const W=a[i];a[i]=a[k],a[k]=W}static canBeRotated(a){var i;return!(!a||a.w===a.h||a.locked||a.noResize||(i=a.grid)!=null&&i.opts.disableResize||a.minW&&a.minW===a.maxW||a.minH&&a.minH===a.maxH)}}class Mh{constructor(a={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=a.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=a.maxRow,this._float=a.float,this.nodes=a.nodes||[],this.onChange=a.onChange}batchUpdate(a=!0,i=!0){return!!this.batchMode===a?this:(this.batchMode=a,a?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,i&&this._packNodes(),this._notify()),this)}_useEntireRowArea(a,i){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!a._moving||a._skipDown||i.y<=a.y)}_fixCollisions(a,i=a,k,W={}){if(this.sortNodes(-1),k=k||this.collide(a,i),!k)return!1;if(a._moving&&!W.nested&&!this.float&&this.swap(a,k))return!0;let g=i;!this._loading&&this._useEntireRowArea(a,i)&&(g={x:0,w:this.column,y:i.y,h:i.h},k=this.collide(a,g,W.skip));let m=!1;const r={nested:!0,pack:!1};let h=0;for(;k=k||this.collide(a,g,W.skip);){if(h++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(k.locked||this._loading||a._moving&&!a._skipDown&&i.y>a.y&&!this.float&&(!this.collide(k,{...k,y:a.y},a)||!this.collide(k,{...k,y:i.y-k.h},a))){a._skipDown=a._skipDown||i.y>a.y;const t={...i,y:k.y+k.h,...r};l=this._loading&&Yn.samePos(a,t)?!0:this.moveNode(a,t),(k.locked||this._loading)&&l?Yn.copyPos(i,a):!k.locked&&l&&W.pack&&(this._packNodes(),i.y=k.y+k.h,Yn.copyPos(a,i)),m=m||l}else l=this.moveNode(k,{...k,y:i.y+i.h,skip:a,...r});if(!l)return m;k=void 0}return m}collide(a,i=a,k){const W=a._id,g=k==null?void 0:k._id;return this.nodes.find(m=>m._id!==W&&m._id!==g&&Yn.isIntercepted(m,i))}collideAll(a,i=a,k){const W=a._id,g=k==null?void 0:k._id;return this.nodes.filter(m=>m._id!==W&&m._id!==g&&Yn.isIntercepted(m,i))}directionCollideCoverage(a,i,k){if(!i.rect||!a._rect)return;const W=a._rect,g={...i.rect};g.y>W.y?(g.h+=g.y-W.y,g.y=W.y):g.h+=W.y-g.y,g.x>W.x?(g.w+=g.x-W.x,g.x=W.x):g.w+=W.x-g.x;let m,r=.5;for(let h of k){if(h.locked||!h._rect)break;const l=h._rect;let t=Number.MAX_VALUE,_=Number.MAX_VALUE;W.y<l.y?t=(g.y+g.h-l.y)/l.h:W.y+W.h>l.y+l.h&&(t=(l.y+l.h-g.y)/l.h),W.x<l.x?_=(g.x+g.w-l.x)/l.w:W.x+W.w>l.x+l.w&&(_=(l.x+l.w-g.x)/l.w);const w=Math.min(_,t);w>r&&(r=w,m=h)}return i.collide=m,m}cacheRects(a,i,k,W,g,m){return this.nodes.forEach(r=>r._rect={y:r.y*i+k,x:r.x*a+m,w:r.w*a-m-W,h:r.h*i-k-g}),this}swap(a,i){if(!i||i.locked||!a||a.locked)return!1;function k(){const g=i.x,m=i.y;return i.x=a.x,i.y=a.y,a.h!=i.h?(a.x=g,a.y=i.y+i.h):a.w!=i.w?(a.x=i.x+i.w,a.y=m):(a.x=g,a.y=m),a._dirty=i._dirty=!0,!0}let W;if(a.w===i.w&&a.h===i.h&&(a.x===i.x||a.y===i.y)&&(W=Yn.isTouching(a,i)))return k();if(W!==!1){if(a.w===i.w&&a.x===i.x&&(W||(W=Yn.isTouching(a,i)))){if(i.y<a.y){const g=a;a=i,i=g}return k()}if(W!==!1){if(a.h===i.h&&a.y===i.y&&(W||(W=Yn.isTouching(a,i)))){if(i.x<a.x){const g=a;a=i,i=g}return k()}return!1}}}isAreaEmpty(a,i,k,W){const g={x:a||0,y:i||0,w:k||1,h:W||1};return!this.collide(g)}compact(a="compact",i=!0){if(this.nodes.length===0)return this;i&&this.sortNodes();const k=this.batchMode;k||this.batchUpdate();const W=this._inColumnResize;W||(this._inColumnResize=!0);const g=this.nodes;return this.nodes=[],g.forEach((m,r,h)=>{let l;m.locked||(m.autoPosition=!0,a==="list"&&r&&(l=h[r-1])),this.addNode(m,!1,l)}),W||delete this._inColumnResize,k||this.batchUpdate(!1),this}set float(a){this._float!==a&&(this._float=a||!1,a||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(a=1){return this.nodes=Yn.sort(this.nodes,a),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(a=>{if(a._updating||a._orig===void 0||a.y===a._orig.y)return;let i=a.y;for(;i>a._orig.y;)--i,this.collide(a,{x:a.x,y:i,w:a.w,h:a.h})||(a._dirty=!0,a.y=i)}):this.nodes.forEach((a,i)=>{if(!a.locked)for(;a.y>0;){const k=i===0?0:a.y-1;if(!(i===0||!this.collide(a,{x:a.x,y:k,w:a.w,h:a.h})))break;a._dirty=a.y!==k,a.y=k}}),this)}prepareNode(a,i){a._id=a._id??Mh._idSeq++;const k=a.id;if(k){let g=1;for(;this.nodes.find(m=>m.id===a.id&&m!==a);)a.id=k+"_"+g++}(a.x===void 0||a.y===void 0||a.x===null||a.y===null)&&(a.autoPosition=!0);const W={x:0,y:0,w:1,h:1};return Yn.defaults(a,W),a.autoPosition||delete a.autoPosition,a.noResize||delete a.noResize,a.noMove||delete a.noMove,Yn.sanitizeMinMax(a),typeof a.x=="string"&&(a.x=Number(a.x)),typeof a.y=="string"&&(a.y=Number(a.y)),typeof a.w=="string"&&(a.w=Number(a.w)),typeof a.h=="string"&&(a.h=Number(a.h)),isNaN(a.x)&&(a.x=W.x,a.autoPosition=!0),isNaN(a.y)&&(a.y=W.y,a.autoPosition=!0),isNaN(a.w)&&(a.w=W.w),isNaN(a.h)&&(a.h=W.h),this.nodeBoundFix(a,i),a}nodeBoundFix(a,i){const k=a._orig||Yn.copyPos({},a);if(a.maxW&&(a.w=Math.min(a.w||1,a.maxW)),a.maxH&&(a.h=Math.min(a.h||1,a.maxH)),a.minW&&(a.w=Math.max(a.w||1,a.minW)),a.minH&&(a.h=Math.max(a.h||1,a.minH)),(a.x||0)+(a.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&a._id!=null&&this.findCacheLayout(a,this.defaultColumn)===-1){const W={...a};W.autoPosition||W.x===void 0?(delete W.x,delete W.y):W.x=Math.min(this.defaultColumn-1,W.x),W.w=Math.min(this.defaultColumn,W.w||1),this.cacheOneLayout(W,this.defaultColumn)}return a.w>this.column?a.w=this.column:a.w<1&&(a.w=1),this.maxRow&&a.h>this.maxRow?a.h=this.maxRow:a.h<1&&(a.h=1),a.x<0&&(a.x=0),a.y<0&&(a.y=0),a.x+a.w>this.column&&(i?a.w=this.column-a.x:a.x=this.column-a.w),this.maxRow&&a.y+a.h>this.maxRow&&(i?a.h=this.maxRow-a.y:a.y=this.maxRow-a.h),Yn.samePos(a,k)||(a._dirty=!0),this}getDirtyNodes(a){return a?this.nodes.filter(i=>i._dirty&&!Yn.samePos(i,i._orig)):this.nodes.filter(i=>i._dirty)}_notify(a){if(this.batchMode||!this.onChange)return this;const i=(a||[]).concat(this.getDirtyNodes());return this.onChange(i),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(a=>{delete a._dirty,delete a._lastTried}),this)}saveInitial(){return this.nodes.forEach(a=>{a._orig=Yn.copyPos({},a),delete a._dirty}),this._hasLocked=this.nodes.some(a=>a.locked),this}restoreInitial(){return this.nodes.forEach(a=>{!a._orig||Yn.samePos(a,a._orig)||(Yn.copyPos(a,a._orig),a._dirty=!0)}),this._notify(),this}findEmptyPosition(a,i=this.nodes,k=this.column,W){const g=W?W.y*k+(W.x+W.w):0;let m=!1;for(let r=g;!m;++r){const h=r%k,l=Math.floor(r/k);if(h+a.w>k)continue;const t={x:h,y:l,w:a.w,h:a.h};i.find(_=>Yn.isIntercepted(t,_))||((a.x!==h||a.y!==l)&&(a._dirty=!0),a.x=h,a.y=l,delete a.autoPosition,m=!0)}return m}addNode(a,i=!1,k){const W=this.nodes.find(m=>m._id===a._id);if(W)return W;this._inColumnResize?this.nodeBoundFix(a):this.prepareNode(a),delete a._temporaryRemoved,delete a._removeDOM;let g;return a.autoPosition&&this.findEmptyPosition(a,this.nodes,this.column,k)&&(delete a.autoPosition,g=!0),this.nodes.push(a),i&&this.addedNodes.push(a),g||this._fixCollisions(a),this.batchMode||this._packNodes()._notify(),a}removeNode(a,i=!0,k=!1){return this.nodes.find(W=>W._id===a._id)?(k&&this.removedNodes.push(a),i&&(a._removeDOM=!0),this.nodes=this.nodes.filter(W=>W._id!==a._id),a._isAboutToRemove||this._packNodes(),this._notify([a]),this):this}removeAll(a=!0,i=!0){if(delete this._layouts,!this.nodes.length)return this;a&&this.nodes.forEach(W=>W._removeDOM=!0);const k=this.nodes;return this.removedNodes=i?k:[],this.nodes=[],this._notify(k)}moveNodeCheck(a,i){if(!this.changedPosConstrain(a,i))return!1;if(i.pack=!0,!this.maxRow)return this.moveNode(a,i);let k;const W=new Mh({column:this.column,float:this.float,nodes:this.nodes.map(m=>m._id===a._id?(k={...m},k):{...m})});if(!k)return!1;const g=W.moveNode(k,i)&&W.getRow()<=Math.max(this.getRow(),this.maxRow);if(!g&&!i.resizing&&i.collide){const m=i.collide.el.gridstackNode;if(this.swap(a,m))return this._notify(),!0}return g?(W.nodes.filter(m=>m._dirty).forEach(m=>{const r=this.nodes.find(h=>h._id===m._id);r&&(Yn.copyPos(r,m),r._dirty=!0)}),this._notify(),!0):!1}willItFit(a){if(delete a._willFitPos,!this.maxRow)return!0;const i=new Mh({column:this.column,float:this.float,nodes:this.nodes.map(W=>({...W}))}),k={...a};return this.cleanupNode(k),delete k.el,delete k._id,delete k.content,delete k.grid,i.addNode(k),i.getRow()<=this.maxRow?(a._willFitPos=Yn.copyPos({},k),!0):!1}changedPosConstrain(a,i){return i.w=i.w||a.w,i.h=i.h||a.h,a.x!==i.x||a.y!==i.y?!0:(a.maxW&&(i.w=Math.min(i.w,a.maxW)),a.maxH&&(i.h=Math.min(i.h,a.maxH)),a.minW&&(i.w=Math.max(i.w,a.minW)),a.minH&&(i.h=Math.max(i.h,a.minH)),a.w!==i.w||a.h!==i.h)}moveNode(a,i){var k,W;if(!a||!i)return!1;let g;i.pack===void 0&&!this.batchMode&&(g=i.pack=!0),typeof i.x!="number"&&(i.x=a.x),typeof i.y!="number"&&(i.y=a.y),typeof i.w!="number"&&(i.w=a.w),typeof i.h!="number"&&(i.h=a.h);const m=a.w!==i.w||a.h!==i.h,r=Yn.copyPos({},a,!0);if(Yn.copyPos(r,i),this.nodeBoundFix(r,m),Yn.copyPos(i,r),!i.forceCollide&&Yn.samePos(a,i))return!1;const h=Yn.copyPos({},a),l=this.collideAll(a,r,i.skip);let t=!0;if(l.length){const _=a._moving&&!i.nested;let w=_?this.directionCollideCoverage(a,i,l):l[0];if(_&&w&&(W=(k=a.grid)==null?void 0:k.opts)!=null&&W.subGridDynamic&&!a.grid._isTemp){const v=Yn.areaIntercept(i.rect,w._rect),f=Yn.area(i.rect),o=Yn.area(w._rect);v/(f<o?f:o)>.8&&(w.grid.makeSubGrid(w.el,void 0,a),w=void 0)}w?t=!this._fixCollisions(a,r,w,i):(t=!1,g&&delete i.pack)}return t&&!Yn.samePos(a,r)&&(a._dirty=!0,Yn.copyPos(a,r)),i.pack&&this._packNodes()._notify(),!Yn.samePos(a,h)}getRow(){return this.nodes.reduce((a,i)=>Math.max(a,i.y+i.h),0)}beginUpdate(a){return a._updating||(a._updating=!0,delete a._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const a=this.nodes.find(i=>i._updating);return a&&(delete a._updating,delete a._skipDown),this}save(a=!0,i,k){var W;const g=((W=this._layouts)==null?void 0:W.length)||0;let m;g&&(k?k!==this.column&&(m=this._layouts[k]):this.column!==g-1&&(m=this._layouts[g-1]));const r=[];return this.sortNodes(),this.nodes.forEach(h=>{const l=m==null?void 0:m.find(_=>_._id===h._id),t={...h,...l||{}};Yn.removeInternalForSave(t,!a),i&&i(h,t),r.push(t)}),r}layoutsNodesChange(a){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((i,k)=>{if(!i||k===this.column)return this;if(k<this.column)this._layouts[k]=void 0;else{const W=k/this.column;a.forEach(g=>{if(!g._orig)return;const m=i.find(r=>r._id===g._id);m&&(m.y>=0&&g.y!==g._orig.y&&(m.y+=g.y-g._orig.y),g.x!==g._orig.x&&(m.x=Math.round(g.x*W)),g.w!==g._orig.w&&(m.w=Math.round(g.w*W)))})}}),this)}columnChanged(a,i,k="moveScale"){var W;if(!this.nodes.length||!i||a===i)return this;const g=k==="compact"||k==="list";g&&this.sortNodes(1),i<a&&this.cacheLayout(this.nodes,a),this.batchUpdate();let m=[],r=g?this.nodes:Yn.sort(this.nodes,-1);if(i>a&&this._layouts){const h=this._layouts[i]||[],l=this._layouts.length-1;!h.length&&a!==l&&(W=this._layouts[l])!=null&&W.length&&(a=l,this._layouts[l].forEach(t=>{const _=r.find(w=>w._id===t._id);_&&(!g&&!t.autoPosition&&(_.x=t.x??_.x,_.y=t.y??_.y),_.w=t.w??_.w,(t.x==null||t.y===void 0)&&(_.autoPosition=!0))})),h.forEach(t=>{const _=r.findIndex(w=>w._id===t._id);if(_!==-1){const w=r[_];if(g){w.w=t.w;return}(t.autoPosition||isNaN(t.x)||isNaN(t.y))&&this.findEmptyPosition(t,m),t.autoPosition||(w.x=t.x??w.x,w.y=t.y??w.y,w.w=t.w??w.w,m.push(w)),r.splice(_,1)}})}if(g)this.compact(k,!1);else{if(r.length)if(typeof k=="function")k(i,a,m,r);else{const h=g||k==="none"?1:i/a,l=k==="move"||k==="moveScale",t=k==="scale"||k==="moveScale";r.forEach(_=>{_.x=i===1?0:l?Math.round(_.x*h):Math.min(_.x,i-1),_.w=i===1||a===1?1:t?Math.round(_.w*h)||1:Math.min(_.w,i),m.push(_)}),r=[]}m=Yn.sort(m,-1),this._inColumnResize=!0,this.nodes=[],m.forEach(h=>{this.addNode(h,!1),delete h._orig})}return this.nodes.forEach(h=>delete h._orig),this.batchUpdate(!1,!g),delete this._inColumnResize,this}cacheLayout(a,i,k=!1){const W=[];return a.forEach((g,m)=>{if(g._id===void 0){const r=g.id?this.nodes.find(h=>h.id===g.id):void 0;g._id=(r==null?void 0:r._id)??Mh._idSeq++}W[m]={x:g.x,y:g.y,w:g.w,_id:g._id}}),this._layouts=k?[]:this._layouts||[],this._layouts[i]=W,this}cacheOneLayout(a,i){a._id=a._id??Mh._idSeq++;const k={x:a.x,y:a.y,w:a.w,_id:a._id};(a.autoPosition||a.x===void 0)&&(delete k.x,delete k.y,a.autoPosition&&(k.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[i]=this._layouts[i]||[];const W=this.findCacheLayout(a,i);return W===-1?this._layouts[i].push(k):this._layouts[i][W]=k,this}findCacheLayout(a,i){var k,W;return((W=(k=this._layouts)==null?void 0:k[i])==null?void 0:W.findIndex(g=>g._id===a._id))??-1}removeNodeFromLayoutCache(a){if(this._layouts)for(let i=0;i<this._layouts.length;i++){const k=this.findCacheLayout(a,i);k!==-1&&this._layouts[i].splice(k,1)}}cleanupNode(a){for(const i in a)i[0]==="_"&&i!=="_id"&&delete a[i];return this}}Mh._idSeq=0;const Id={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Ei{}const Kp=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class bh{}function u2(e,a){e.touches.length>1||(e.cancelable&&e.preventDefault(),Yn.simulateMouseEvent(e.changedTouches[0],a))}function qL(e,a){e.cancelable&&e.preventDefault(),Yn.simulateMouseEvent(e,a)}function d2(e){bh.touchHandled||(bh.touchHandled=!0,u2(e,"mousedown"))}function p2(e){bh.touchHandled&&u2(e,"mousemove")}function h2(e){if(!bh.touchHandled)return;bh.pointerLeaveTimeout&&(window.clearTimeout(bh.pointerLeaveTimeout),delete bh.pointerLeaveTimeout);const a=!!Ei.dragElement;u2(e,"mouseup"),a||u2(e,"click"),bh.touchHandled=!1}function f2(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function UL(e){Ei.dragElement&&e.pointerType!=="mouse"&&qL(e,"mouseenter")}function zL(e){Ei.dragElement&&e.pointerType!=="mouse"&&(bh.pointerLeaveTimeout=window.setTimeout(()=>{delete bh.pointerLeaveTimeout,qL(e,"mouseleave")},10))}class m2{constructor(a,i,k){this.host=a,this.dir=i,this.option=k,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const a=this.el=document.createElement("div");return a.classList.add("ui-resizable-handle"),a.classList.add(`${m2.prefix}${this.dir}`),a.style.zIndex="100",a.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Kp&&(this.el.addEventListener("touchstart",d2),this.el.addEventListener("pointerdown",f2)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Kp&&(this.el.removeEventListener("touchstart",d2),this.el.removeEventListener("pointerdown",f2)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(a){this.mouseDownEvent=a,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Kp&&(this.el.addEventListener("touchmove",p2),this.el.addEventListener("touchend",h2)),a.stopPropagation(),a.preventDefault()}_mouseMove(a){const i=this.mouseDownEvent;this.moving?this._triggerEvent("move",a):Math.abs(a.x-i.x)+Math.abs(a.y-i.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",a),document.addEventListener("keydown",this._keyEvent)),a.stopPropagation()}_mouseUp(a){this.moving&&(this._triggerEvent("stop",a),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Kp&&(this.el.removeEventListener("touchmove",p2),this.el.removeEventListener("touchend",h2)),delete this.moving,delete this.mouseDownEvent,a.stopPropagation(),a.preventDefault()}_keyEvent(a){var i,k;a.key==="Escape"&&((k=(i=this.host.gridstackNode)==null?void 0:i.grid)==null||k.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(a,i){return this.option[a]&&this.option[a](i),this}}m2.prefix="ui-resizable-";class w5{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(a,i){this._eventRegister[a]=i}off(a){delete this._eventRegister[a]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(a,i){if(!this.disabled&&this._eventRegister&&this._eventRegister[a])return this._eventRegister[a](i)}}class K1 extends w5{constructor(a,i={}){super(),this.el=a,this.option=i,this.rectScale={x:1,y:1},this._ui=()=>{const k=this.el.parentElement.getBoundingClientRect(),W={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=this.temporalRect||W;return{position:{left:(g.left-k.left)*this.rectScale.x,top:(g.top-k.top)*this.rectScale.y},size:{width:g.width*this.rectScale.x,height:g.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(a){const i=a.handles&&a.handles!==this.option.handles,k=a.autoHide&&a.autoHide!==this.option.autoHide;return Object.keys(a).forEach(W=>this.option[W]=a[W]),i&&(this._removeHandlers(),this._setupHandlers()),k&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(a){return a?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Ei.overResizeElement===this&&delete Ei.overResizeElement),this}_mouseOver(a){Ei.overResizeElement||Ei.dragElement||(Ei.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(a){Ei.overResizeElement===this&&(delete Ei.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(a=>a.trim()).map(a=>new m2(this.el,a,{start:i=>{this._resizeStart(i)},stop:i=>{this._resizeStop(i)},move:i=>{this._resizing(i,a)}})),this}_resizeStart(a){this.sizeToContent=Yn.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=Yn.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=a,this._setupHelper(),this._applyChange();const i=Yn.initEvent(a,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(i,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",i),this}_resizing(a,i){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(a,i),this._applyChange();const k=Yn.initEvent(a,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(k,this._ui()),this.triggerEvent("resize",k),this}_resizeStop(a){const i=Yn.initEvent(a,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(i),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",i),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=K1._originStyleProp.map(k=>this.el.style[k]),this.parentOriginStylePosition=this.el.parentElement.style.position;const a=this.el.parentElement,i=Yn.getValuesFromTransformedElement(a);return this.rectScale={x:i.xScale,y:i.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return K1._originStyleProp.forEach((a,i)=>{this.el.style[a]=this.elOriginStyleVal[i]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(a,i){const k=this.startEvent,W={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=a.clientX-k.clientX,m=this.sizeToContent?0:a.clientY-k.clientY;let r,h;i.indexOf("e")>-1?W.width+=g:i.indexOf("w")>-1&&(W.width-=g,W.left+=g,r=!0),i.indexOf("s")>-1?W.height+=m:i.indexOf("n")>-1&&(W.height-=m,W.top+=m,h=!0);const l=this._constrainSize(W.width,W.height,r,h);return Math.round(W.width)!==Math.round(l.width)&&(i.indexOf("w")>-1&&(W.left+=W.width-l.width),W.width=l.width),Math.round(W.height)!==Math.round(l.height)&&(i.indexOf("n")>-1&&(W.top+=W.height-l.height),W.height=l.height),W}_constrainSize(a,i,k,W){const g=this.option,m=(k?g.maxWidthMoveLeft:g.maxWidth)||Number.MAX_SAFE_INTEGER,r=g.minWidth/this.rectScale.x||a,h=(W?g.maxHeightMoveUp:g.maxHeight)||Number.MAX_SAFE_INTEGER,l=g.minHeight/this.rectScale.y||i,t=Math.min(m,Math.max(r,a)),_=Math.min(h,Math.max(l,i));return{width:t,height:_}}_applyChange(){let a={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const i=this.el.parentElement,{left:k,top:W}=i.getBoundingClientRect();a={left:k,top:W,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(i=>{const k=this.temporalRect[i],W=i==="width"||i==="left"?this.rectScale.x:i==="height"||i==="top"?this.rectScale.y:1;this.el.style[i]=(k-a[i])*W+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(a=>a.destroy()),delete this.handlers,this}}K1._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const F5e='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class A1 extends w5{constructor(a,i={}){var k;super(),this.el=a,this.option=i,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const W=(k=i==null?void 0:i.handle)==null?void 0:k.substring(1),g=a.gridstackNode;this.dragEls=!W||a.classList.contains(W)?[a]:g!=null&&g.subGrid?[a.querySelector(i.handle)||a]:Array.from(a.querySelectorAll(i.handle)),this.dragEls.length===0&&(this.dragEls=[a]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(a=>{a.addEventListener("mousedown",this._mouseDown),Kp&&(a.addEventListener("touchstart",d2),a.addEventListener("pointerdown",f2))}),this.el.classList.remove("ui-draggable-disabled"))}disable(a=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(i=>{i.removeEventListener("mousedown",this._mouseDown),Kp&&(i.removeEventListener("touchstart",d2),i.removeEventListener("pointerdown",f2))}),a||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(a){return Object.keys(a).forEach(i=>this.option[i]=a[i]),this}_mouseDown(a){if(!Ei.mouseHandled)return a.button!==0||!this.dragEls.find(i=>i===a.target)&&a.target.closest(F5e)||this.option.cancel&&a.target.closest(this.option.cancel)||(this.mouseDownEvent=a,delete this.dragging,delete Ei.dragElement,delete Ei.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Kp&&(a.currentTarget.addEventListener("touchmove",p2),a.currentTarget.addEventListener("touchend",h2)),a.preventDefault(),document.activeElement&&document.activeElement.blur(),Ei.mouseHandled=!0),!0}_callDrag(a){if(!this.dragging)return;const i=Yn.initEvent(a,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(i,this.ui()),this.triggerEvent("drag",i)}_mouseMove(a){var i;const k=this.mouseDownEvent;if(this.lastDrag=a,this.dragging)if(this._dragFollow(a),Ei.pauseDrag){const W=Number.isInteger(Ei.pauseDrag)?Ei.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(a),W)}else this._callDrag(a);else if(Math.abs(a.x-k.x)+Math.abs(a.y-k.y)>3){this.dragging=!0,Ei.dragElement=this;const W=(i=this.el.gridstackNode)==null?void 0:i.grid;W?Ei.dropElement=W.el.ddElement.ddDroppable:delete Ei.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=Yn.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(a,this.el,this.helperContainment),this._setupHelperStyle(a);const g=Yn.initEvent(a,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(g,this.ui()),this.triggerEvent("dragstart",g),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(a){var i,k;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Kp&&a.currentTarget&&(a.currentTarget.removeEventListener("touchmove",p2,!0),a.currentTarget.removeEventListener("touchend",h2,!0)),this.dragging){delete this.dragging,(i=this.el.gridstackNode)==null||delete i._origRotate,document.removeEventListener("keydown",this._keyEvent),((k=Ei.dropElement)==null?void 0:k.el)===this.el.parentElement&&delete Ei.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const W=Yn.initEvent(a,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(W),this.triggerEvent("dragstop",W),Ei.dropElement&&Ei.dropElement.drop(a)}delete this.helper,delete this.mouseDownEvent,delete Ei.dragElement,delete Ei.dropElement,delete Ei.mouseHandled,a.preventDefault()}_keyEvent(a){var i,k;const W=this.el.gridstackNode,g=(W==null?void 0:W.grid)||((k=(i=Ei.dropElement)==null?void 0:i.el)==null?void 0:k.gridstack);if(a.key==="Escape")W&&W._origRotate&&(W._orig=W._origRotate,delete W._origRotate),g==null||g.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(W&&g&&(a.key==="r"||a.key==="R")){if(!Yn.canBeRotated(W))return;W._origRotate=W._origRotate||{...W._orig},delete W._moving,g.setAnimation(!1).rotate(W.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),W._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,W.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",Yn.swap(W._orig,"w","h"),delete W._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let a=this.el;return typeof this.option.helper=="function"?a=this.option.helper(this.el):this.option.helper==="clone"&&(a=Yn.cloneNode(this.el)),a.parentElement||Yn.appendTo(a,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=A1.originStyleProp.map(i=>this.el.style[i]),a}_setupHelperStyle(a){var i,k;this.helper.classList.add("ui-draggable-dragging"),(k=(i=this.el.gridstackNode)==null?void 0:i.grid)==null||k.el.classList.add("grid-stack-dragging");const W=this.helper.style;return W.pointerEvents="none",W.width=this.dragOffset.width+"px",W.height=this.dragOffset.height+"px",W.willChange="left, top",W.position="fixed",this._dragFollow(a),W.transition="none",setTimeout(()=>{this.helper&&(W.transition=null)},0),this}_removeHelperStyle(){var a,i,k;this.helper.classList.remove("ui-draggable-dragging"),(i=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||i.el.classList.remove("grid-stack-dragging");const W=(k=this.helper)==null?void 0:k.gridstackNode;if(!(W!=null&&W._isAboutToRemove)&&this.dragElementOriginStyle){const g=this.helper,m=this.dragElementOriginStyle.transition||null;g.style.transition=this.dragElementOriginStyle.transition="none",A1.originStyleProp.forEach(r=>g.style[r]=this.dragElementOriginStyle[r]||null),setTimeout(()=>g.style.transition=m,50)}return delete this.dragElementOriginStyle,this}_dragFollow(a){const i={left:0,top:0},k=this.helper.style,W=this.dragOffset;k.left=(a.clientX+W.offsetLeft-i.left)*this.dragTransform.xScale+"px",k.top=(a.clientY+W.offsetTop-i.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(a,i,k){let W=0,g=0;k&&(W=this.dragTransform.xOffset,g=this.dragTransform.yOffset);const m=i.getBoundingClientRect();return{left:m.left,top:m.top,offsetLeft:-a.clientX+m.left-W,offsetTop:-a.clientY+m.top-g,width:m.width*this.dragTransform.xScale,height:m.height*this.dragTransform.yScale}}ui(){const a=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-a.top)*this.dragTransform.yScale,left:(i.left-a.left)*this.dragTransform.xScale}}}}A1.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class E5e extends w5{constructor(a,i={}){super(),this.el=a,this.option=i,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Kp&&(this.el.addEventListener("pointerenter",UL),this.el.addEventListener("pointerleave",zL)))}disable(a=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),a||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Kp&&(this.el.removeEventListener("pointerenter",UL),this.el.removeEventListener("pointerleave",zL)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(a){return Object.keys(a).forEach(i=>this.option[i]=a[i]),this._setupAccept(),this}_mouseEnter(a){if(!Ei.dragElement||!this._canDrop(Ei.dragElement.el))return;a.preventDefault(),a.stopPropagation(),Ei.dropElement&&Ei.dropElement!==this&&Ei.dropElement._mouseLeave(a,!0),Ei.dropElement=this;const i=Yn.initEvent(a,{target:this.el,type:"dropover"});this.option.over&&this.option.over(i,this._ui(Ei.dragElement)),this.triggerEvent("dropover",i),this.el.classList.add("ui-droppable-over")}_mouseLeave(a,i=!1){var k;if(!Ei.dragElement||Ei.dropElement!==this)return;a.preventDefault(),a.stopPropagation();const W=Yn.initEvent(a,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(W,this._ui(Ei.dragElement)),this.triggerEvent("dropout",W),Ei.dropElement===this&&(delete Ei.dropElement,!i)){let g,m=this.el.parentElement;for(;!g&&m;)g=(k=m.ddElement)==null?void 0:k.ddDroppable,m=m.parentElement;g&&g._mouseEnter(a)}}drop(a){a.preventDefault();const i=Yn.initEvent(a,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(i,this._ui(Ei.dragElement)),this.triggerEvent("drop",i)}_canDrop(a){return a&&(!this.accept||this.accept(a))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=a=>a.classList.contains(this.option.accept)||a.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(a){return{draggable:a.el,...a.ui()}}}class _5{static init(a){return a.ddElement||(a.ddElement=new _5(a)),a.ddElement}constructor(a){this.el=a}on(a,i){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.on(a,i):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.on(a,i):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.on(a,i),this}off(a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.off(a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.off(a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.off(a),this}setupDraggable(a){return this.ddDraggable?this.ddDraggable.updateOption(a):this.ddDraggable=new A1(this.el,a),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(a){return this.ddResizable?this.ddResizable.updateOption(a):this.ddResizable=new K1(this.el,a),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(a){return this.ddDroppable?this.ddDroppable.updateOption(a):this.ddDroppable=new E5e(this.el,a),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class R5e{resizable(a,i,k,W){return this._getDDElements(a,i).forEach(g=>{if(i==="disable"||i==="enable")g.ddResizable&&g.ddResizable[i]();else if(i==="destroy")g.ddResizable&&g.cleanResizable();else if(i==="option")g.setupResizable({[k]:W});else{const m=g.el.gridstackNode.grid;let r=g.el.getAttribute("gs-resize-handles")||m.opts.resizable.handles||"e,s,se";r==="all"&&(r="n,e,s,w,se,sw,ne,nw");const h=!m.opts.alwaysShowResizeHandle;g.setupResizable({...m.opts.resizable,handles:r,autoHide:h,start:i.start,stop:i.stop,resize:i.resize})}}),this}draggable(a,i,k,W){return this._getDDElements(a,i).forEach(g=>{if(i==="disable"||i==="enable")g.ddDraggable&&g.ddDraggable[i]();else if(i==="destroy")g.ddDraggable&&g.cleanDraggable();else if(i==="option")g.setupDraggable({[k]:W});else{const m=g.el.gridstackNode.grid;g.setupDraggable({...m.opts.draggable,start:i.start,stop:i.stop,drag:i.drag})}}),this}dragIn(a,i){return this._getDDElements(a).forEach(k=>k.setupDraggable(i)),this}droppable(a,i,k,W){return typeof i.accept=="function"&&!i._accept&&(i._accept=i.accept,i.accept=g=>i._accept(g)),this._getDDElements(a,i).forEach(g=>{i==="disable"||i==="enable"?g.ddDroppable&&g.ddDroppable[i]():i==="destroy"?g.ddDroppable&&g.cleanDroppable():i==="option"?g.setupDroppable({[k]:W}):g.setupDroppable(i)}),this}isDroppable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddDroppable&&!a.ddElement.ddDroppable.disabled)}isDraggable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddDraggable&&!a.ddElement.ddDraggable.disabled)}isResizable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddResizable&&!a.ddElement.ddResizable.disabled)}on(a,i,k){return this._getDDElements(a).forEach(W=>W.on(i,g=>{k(g,Ei.dragElement?Ei.dragElement.el:g.target,Ei.dragElement?Ei.dragElement.helper:null)})),this}off(a,i){return this._getDDElements(a).forEach(k=>k.off(i)),this}_getDDElements(a,i){const k=a.gridstack||i!=="destroy"&&i!=="disable",W=Yn.getElements(a);return W.length?W.map(g=>g.ddElement||(k?_5.init(g):null)).filter(g=>g):[]}}/*!
|
|
4118
|
+
}`;var ko=_p(function(){return hi(Er,fi+"return "+La).apply(i,an)});if(ko.source=La,rn(ko))throw ko;return ko}function pf(Se){return ge(Se).toLowerCase()}function m0(Se){return ge(Se).toUpperCase()}function Ry(Se,Ae,gt){if(Se=ge(Se),Se&&(gt||Ae===i))return bu(Se);if(!Se||!(Ae=Su(Ae)))return Se;var Zt=cs(Se),mr=cs(Ae),Er=Cd(Zt,mr),an=Bo(Zt,mr)+1;return Pd(Zt,Er,an).join("")}function hf(Se,Ae,gt){if(Se=ge(Se),Se&&(gt||Ae===i))return Se.slice(0,du(Se)+1);if(!Se||!(Ae=Su(Ae)))return Se;var Zt=cs(Se),mr=Bo(Zt,cs(Ae))+1;return Pd(Zt,0,mr).join("")}function My(Se,Ae,gt){if(Se=ge(Se),Se&&(gt||Ae===i))return Se.replace(vt,"");if(!Se||!(Ae=Su(Ae)))return Se;var Zt=cs(Se),mr=Cd(Zt,cs(Ae));return Pd(Zt,mr).join("")}function Wy(Se,Ae){var gt=z,Zt=O;if(Xn(Ae)){var mr="separator"in Ae?Ae.separator:mr;gt="length"in Ae?oi(Ae.length):gt,Zt="omission"in Ae?Su(Ae.omission):Zt}Se=ge(Se);var Er=Se.length;if(Vs(Se)){var an=cs(Se);Er=an.length}if(gt>=Er)return Se;var hn=gt-nl(Zt);if(hn<1)return Zt;var zn=an?Pd(an,0,hn).join(""):Se.slice(0,hn);if(mr===i)return zn+Zt;if(an&&(hn+=zn.length-hn),_i(mr)){if(Se.slice(hn).search(mr)){var xa,wa=zn;for(mr.global||(mr=Tc(mr.source,ge(Tt.exec(mr))+"g")),mr.lastIndex=0;xa=mr.exec(wa);)var La=xa.index;zn=zn.slice(0,La===i?hn:La)}}else if(Se.indexOf(Su(mr),hn)!=hn){var Ya=zn.lastIndexOf(mr);Ya>-1&&(zn=zn.slice(0,Ya))}return zn+Zt}function jy(Se){return Se=ge(Se),Se&&at.test(Se)?Se.replace(Ke,pu):Se}var Ky=Sh(function(Se,Ae,gt){return Se+(gt?" ":"")+Ae.toUpperCase()}),$f=oy("toUpperCase");function Is(Se,Ae,gt){return Se=ge(Se),Ae=gt?i:Ae,Ae===i?rl(Se)?Cl(Se):mo(Se):Se.match(Ae)||[]}var _p=xi(function(Se,Ae){try{return Ri(Se,i,Ae)}catch(gt){return rn(gt)?gt:new ui(gt)}}),y0=Hu(function(Se,Ae){return Ka(Ae,function(gt){gt=Zi(gt),we(Se,gt,Do(Se[gt],Se))}),Se});function Md(Se){var Ae=Se==null?0:Se.length,gt=wi();return Se=Ae?Ti(Se,function(Zt){if(typeof Zt[1]!="function")throw new gs(m);return[gt(Zt[0]),Zt[1]]}):[],xi(function(Zt){for(var mr=-1;++mr<Ae;){var Er=Se[mr];if(Ri(Er[0],this,Zt))return Ri(Er[1],this,Zt)}})}function gg(Se){return ot(Ie(Se,_))}function em(Se){return function(){return Se}}function fl(Se,Ae){return Se==null||Se!==Se?Ae:Se}var lc=Bp(),rd=Bp(!0);function ls(Se){return Se}function Lu(Se){return ji(typeof Se=="function"?Se:Ie(Se,_))}function Wd(Se){return Ai(Ie(Se,_))}function g0(Se,Ae){return Gi(Se,Ie(Ae,_))}var P2=xi(function(Se,Ae){return function(gt){return Wn(gt,Se,Ae)}}),F2=xi(function(Se,Ae){return function(gt){return Wn(Se,gt,Ae)}});function v0(Se,Ae,gt){var Zt=ba(Ae),mr=Hr(Ae,Zt);gt==null&&!(Xn(Ae)&&(mr.length||!Zt.length))&&(gt=Ae,Ae=Se,Se=this,mr=Hr(Ae,ba(Ae)));var Er=!(Xn(gt)&&"chain"in gt)||!!gt.chain,an=bn(Se);return Ka(mr,function(hn){var zn=Ae[hn];Se[hn]=zn,an&&(Se.prototype[hn]=function(){var xa=this.__chain__;if(Er||xa){var wa=Se(this.__wrapped__),La=wa.__actions__=Wc(this.__actions__);return La.push({func:zn,args:arguments,thisArg:Se}),wa.__chain__=xa,wa}return zn.apply(Se,zs([this.value()],arguments))})}),Se}function vg(){return On._===this&&(On._=Fl),this}function ap(){}function E2(Se){return Se=oi(Se),xi(function(Ae){return Uo(Ae,Se)})}var bg=Nf(Ti),xg=Nf(yl),R2=Nf(Ls);function M2(Se){return Zh(Se)?Zl(Zi(Se)):Tl(Se)}function wg(Se){return function(Ae){return Se==null?i:tn(Se,Ae)}}var W2=fp(),j2=fp(!0);function b0(){return[]}function Ay(){return!1}function x0(){return{}}function K2(){return""}function Iy(){return!0}function W5(Se,Ae){if(Se=oi(Se),Se<1||Se>R)return[];var gt=X,Zt=mi(Se,X);Ae=wi(Ae),Se-=X;for(var mr=Hc(Zt,Ae);++gt<Se;)Ae(gt);return mr}function A2(Se){return st(Se)?Ti(Se,Zi):Ii(Se)?[Se]:Wc($h(ge(Se)))}function j5(Se){var Ae=++is;return ge(Se)+Ae}var K5=hp(function(Se,Ae){return Se+Ae},0),A5=mp("ceil"),I5=hp(function(Se,Ae){return Se/Ae},1),X5=mp("floor");function D5(Se){return Se&&Se.length?Ct(Se,ls,Un):i}function J5(Se,Ae){return Se&&Se.length?Ct(Se,wi(Ae,2),Un):i}function G5(Se){return zl(Se,ls)}function Sp(Se,Ae){return zl(Se,wi(Ae,2))}function Xy(Se){return Se&&Se.length?Ct(Se,ls,Ki):i}function I2(Se,Ae){return Se&&Se.length?Ct(Se,wi(Ae,2),Ki):i}var w0=hp(function(Se,Ae){return Se*Ae},1),X2=mp("round"),tCe=hp(function(Se,Ae){return Se-Ae},0);function rCe(Se){return Se&&Se.length?lu(Se,ls):0}function nCe(Se,Ae){return Se&&Se.length?lu(Se,wi(Ae,2)):0}return dr.after=s0,dr.ary=Ss,dr.assign=Me,dr.assignIn=He,dr.assignInWith=$e,dr.assignWith=ft,dr.at=bt,dr.before=Hf,dr.bind=Do,dr.bindAll=y0,dr.bindKey=l0,dr.castArray=cf,dr.chain=ou,dr.chunk=Cu,dr.compact=Zm,dr.concat=gy,dr.cond=Md,dr.conforms=gg,dr.constant=em,dr.countBy=Cy,dr.create=Et,dr.curry=Yf,dr.curryRight=c0,dr.debounce=u0,dr.defaults=Xt,dr.defaultsDeep=$t,dr.defer=Ey,dr.delay=d0,dr.difference=ag,dr.differenceBy=vy,dr.differenceWith=ig,dr.drop=og,dr.dropRight=tf,dr.dropRightWhile=by,dr.dropWhile=sg,dr.fill=lg,dr.filter=fg,dr.flatMap=a0,dr.flatMapDeep=bp,dr.flatMapDepth=sf,dr.flatten=$p,dr.flattenDeep=xy,dr.flattenDepth=wy,dr.flip=tp,dr.flow=lc,dr.flowRight=rd,dr.fromPairs=C2,dr.functions=Sn,dr.functionsIn=on,dr.groupBy=Xf,dr.initial=Hm,dr.intersection=Ff,dr.intersectionBy=nu,dr.intersectionWith=rf,dr.invert=Ra,dr.invertBy=Qa,dr.invokeMap=Rd,dr.iteratee=Lu,dr.keyBy=xp,dr.keys=ba,dr.keysIn=Ma,dr.map=lf,dr.mapKeys=Xa,dr.mapValues=Pa,dr.matches=Wd,dr.matchesProperty=g0,dr.memoize=Ac,dr.merge=ua,dr.mergeWith=Da,dr.method=P2,dr.methodOf=F2,dr.mixin=v0,dr.negate=qh,dr.nthArg=E2,dr.omit=Ga,dr.omitBy=ci,dr.once=$s,dr.orderBy=o0,dr.over=bg,dr.overArgs=Uh,dr.overEvery=xg,dr.overSome=R2,dr.partial=Qu,dr.partialRight=zh,dr.partition=mg,dr.pick=To,dr.pickBy=bo,dr.property=M2,dr.propertyOf=wg,dr.pull=eh,dr.pullAll=bc,dr.pullAllBy=Ef,dr.pullAllWith=Rf,dr.pullAt=iu,dr.range=W2,dr.rangeRight=j2,dr.rearg=Ch,dr.reject=Jf,dr.remove=Sy,dr.rest=Ph,dr.reverse=Mf,dr.sampleSize=Gf,dr.set=Ic,dr.setWith=dl,dr.shuffle=Bf,dr.slice=af,dr.sortBy=Zf,dr.sortedUniq=th,dr.sortedUniqBy=xc,dr.split=td,dr.spread=ih,dr.tail=e0,dr.take=t0,dr.takeRight=Ty,dr.takeRightWhile=dg,dr.takeWhile=ky,dr.tap=n0,dr.throttle=dd,dr.thru=Fd,dr.toArray=Ol,dr.toPairs=Ks,dr.toPairsIn=wc,dr.toPath=A2,dr.toPlainObject=J,dr.transform=ic,dr.unary=p0,dr.union=Ly,dr.unionBy=Ny,dr.unionWith=Vy,dr.uniq=pg,dr.uniqBy=hg,dr.uniqWith=Oy,dr.unset=Ts,dr.unzip=rh,dr.unzipWith=Yu,dr.update=ys,dr.updateWith=Jl,dr.values=Qo,dr.valuesIn=pl,dr.without=r0,dr.words=Is,dr.wrap=ku,dr.xor=Vh,dr.xorBy=Wf,dr.xorWith=jf,dr.zip=Kf,dr.zipObject=Af,dr.zipObjectDeep=nh,dr.zipWith=qy,dr.entries=Ks,dr.entriesIn=wc,dr.extend=He,dr.extendWith=$e,v0(dr,dr),dr.add=K5,dr.attempt=_p,dr.camelCase=ks,dr.capitalize=Us,dr.ceil=A5,dr.clamp=oc,dr.clone=Vl,dr.cloneDeep=h0,dr.cloneDeepWith=M,dr.cloneWith=rp,dr.conformsTo=Z,dr.deburr=ro,dr.defaultTo=fl,dr.divide=I5,dr.endsWith=hl,dr.eq=pe,dr.escape=sc,dr.escapeRegExp=As,dr.every=Py,dr.find=of,dr.findIndex=cg,dr.findKey=ar,dr.findLast=If,dr.findLastIndex=Pf,dr.findLastKey=pr,dr.floor=X5,dr.forEach=No,dr.forEachRight=i0,dr.forIn=kr,dr.forInRight=br,dr.forOwn=Wr,dr.forOwnRight=Dr,dr.get=mn,dr.gt=Le,dr.gte=De,dr.has=Jn,dr.hasIn=Sa,dr.head=_y,dr.identity=ls,dr.includes=Ed,dr.indexOf=ug,dr.inRange=Xc,dr.invoke=za,dr.isArguments=Ye,dr.isArray=st,dr.isArrayBuffer=Nt,dr.isArrayLike=Kt,dr.isArrayLikeObject=er,dr.isBoolean=nr,dr.isBuffer=lr,dr.isDate=vr,dr.isElement=fr,dr.isEmpty=Fr,dr.isEqual=Kr,dr.isEqualWith=ln,dr.isError=rn,dr.isFinite=Tn,dr.isFunction=bn,dr.isInteger=Rn,dr.isLength=Dn,dr.isMap=ca,dr.isMatch=Na,dr.isMatchWith=Ea,dr.isNaN=di,dr.isNative=Ba,dr.isNil=$a,dr.isNull=ii,dr.isNumber=Ia,dr.isObject=Xn,dr.isObjectLike=ha,dr.isPlainObject=Ci,dr.isRegExp=_i,dr.isSafeInteger=Co,dr.isSet=ri,dr.isString=eo,dr.isSymbol=Ii,dr.isTypedArray=to,dr.isUndefined=Wo,dr.isWeakMap=Po,dr.isWeakSet=Ms,dr.join=Lh,dr.kebabCase=$u,dr.last=au,dr.lastIndexOf=Kc,dr.lowerCase=np,dr.lowerFirst=Dc,dr.lt=Jo,dr.lte=Ws,dr.max=D5,dr.maxBy=J5,dr.mean=G5,dr.meanBy=Sp,dr.min=Xy,dr.minBy=I2,dr.stubArray=b0,dr.stubFalse=Ay,dr.stubObject=x0,dr.stubString=K2,dr.stubTrue=Iy,dr.multiply=w0,dr.nth=nf,dr.noConflict=vg,dr.noop=ap,dr.now=ud,dr.pad=xo,dr.padEnd=ss,dr.padStart=Fu,dr.parseInt=ed,dr.random=_c,dr.reduce=yg,dr.reduceRight=Df,dr.repeat=Qf,dr.replace=f0,dr.result=js,dr.round=X2,dr.runInContext=yn,dr.sample=Fy,dr.size=ep,dr.snakeCase=uf,dr.some=wp,dr.sortedIndex=Nl,dr.sortedIndexBy=Ym,dr.sortedIndexOf=Nh,dr.sortedLastIndex=zo,dr.sortedLastIndexBy=Qm,dr.sortedLastIndexOf=$m,dr.startCase=Fh,dr.startsWith=Eu,dr.subtract=tCe,dr.sum=rCe,dr.sumBy=nCe,dr.template=df,dr.times=W5,dr.toFinite=Yo,dr.toInteger=oi,dr.toLength=Dl,dr.toLower=pf,dr.toNumber=Q,dr.toSafeInteger=se,dr.toString=ge,dr.toUpper=m0,dr.trim=Ry,dr.trimEnd=hf,dr.trimStart=My,dr.truncate=Wy,dr.unescape=jy,dr.uniqueId=j5,dr.upperCase=Ky,dr.upperFirst=$f,dr.each=No,dr.eachRight=i0,dr.first=_y,v0(dr,(function(){var Se={};return Ar(dr,function(Ae,gt){Ni.call(dr.prototype,gt)||(Se[gt]=Ae)}),Se})(),{chain:!1}),dr.VERSION=k,Ka(["bind","bindKey","curry","curryRight","partial","partialRight"],function(Se){dr[Se].placeholder=dr}),Ka(["drop","take"],function(Se,Ae){si.prototype[Se]=function(gt){gt=gt===i?1:Ui(oi(gt),0);var Zt=this.__filtered__&&!Ae?new si(this):this.clone();return Zt.__filtered__?Zt.__takeCount__=mi(gt,Zt.__takeCount__):Zt.__views__.push({size:mi(gt,X),type:Se+(Zt.__dir__<0?"Right":"")}),Zt},si.prototype[Se+"Right"]=function(gt){return this.reverse()[Se](gt).reverse()}}),Ka(["filter","map","takeWhile"],function(Se,Ae){var gt=Ae+1,Zt=gt==L||gt==S;si.prototype[Se]=function(mr){var Er=this.clone();return Er.__iteratees__.push({iteratee:wi(mr,3),type:gt}),Er.__filtered__=Er.__filtered__||Zt,Er}}),Ka(["head","last"],function(Se,Ae){var gt="take"+(Ae?"Right":"");si.prototype[Se]=function(){return this[gt](1).value()[0]}}),Ka(["initial","tail"],function(Se,Ae){var gt="drop"+(Ae?"":"Right");si.prototype[Se]=function(){return this.__filtered__?new si(this):this[gt](1)}}),si.prototype.compact=function(){return this.filter(ls)},si.prototype.find=function(Se){return this.filter(Se).head()},si.prototype.findLast=function(Se){return this.reverse().find(Se)},si.prototype.invokeMap=xi(function(Se,Ae){return typeof Se=="function"?new si(this):this.map(function(gt){return Wn(gt,Se,Ae)})}),si.prototype.reject=function(Se){return this.filter(qh(wi(Se)))},si.prototype.slice=function(Se,Ae){Se=oi(Se);var gt=this;return gt.__filtered__&&(Se>0||Ae<0)?new si(gt):(Se<0?gt=gt.takeRight(-Se):Se&&(gt=gt.drop(Se)),Ae!==i&&(Ae=oi(Ae),gt=Ae<0?gt.dropRight(-Ae):gt.take(Ae-Se)),gt)},si.prototype.takeRightWhile=function(Se){return this.reverse().takeWhile(Se).reverse()},si.prototype.toArray=function(){return this.take(X)},Ar(si.prototype,function(Se,Ae){var gt=/^(?:filter|find|map|reject)|While$/.test(Ae),Zt=/^(?:head|last)$/.test(Ae),mr=dr[Zt?"take"+(Ae=="last"?"Right":""):Ae],Er=Zt||/^find/.test(Ae);mr&&(dr.prototype[Ae]=function(){var an=this.__wrapped__,hn=Zt?[1]:arguments,zn=an instanceof si,xa=hn[0],wa=zn||st(an),La=function(Fo){var Go=mr.apply(dr,zs([Fo],hn));return Zt&&Ya?Go[0]:Go};wa&>&&typeof xa=="function"&&xa.length!=1&&(zn=wa=!1);var Ya=this.__chain__,fi=!!this.__actions__.length,Pi=Er&&!Ya,ko=zn&&!fi;if(!Er&&wa){an=ko?an:new si(this);var Fi=Se.apply(an,hn);return Fi.__actions__.push({func:Fd,args:[La],thisArg:i}),new _o(Fi,Ya)}return Pi&&ko?Se.apply(this,hn):(Fi=this.thru(La),Pi?Zt?Fi.value()[0]:Fi.value():Fi)})}),Ka(["pop","push","shift","sort","splice","unshift"],function(Se){var Ae=il[Se],gt=/^(?:push|sort|unshift)$/.test(Se)?"tap":"thru",Zt=/^(?:pop|shift)$/.test(Se);dr.prototype[Se]=function(){var mr=arguments;if(Zt&&!this.__chain__){var Er=this.value();return Ae.apply(st(Er)?Er:[],mr)}return this[gt](function(an){return Ae.apply(st(an)?an:[],mr)})}}),Ar(si.prototype,function(Se,Ae){var gt=dr[Ae];if(gt){var Zt=gt.name+"";Ni.call(Xi,Zt)||(Xi[Zt]=[]),Xi[Zt].push({name:Ae,func:gt})}}),Xi[Xh(i,p).name]=[{name:"wrapper",func:i}],si.prototype.clone=hs,si.prototype.reverse=mu,si.prototype.value=Va,dr.prototype.at=Pu,dr.prototype.chain=ah,dr.prototype.commit=Oh,dr.prototype.next=gp,dr.prototype.plant=cd,dr.prototype.reverse=Uy,dr.prototype.toJSON=dr.prototype.valueOf=dr.prototype.value=zy,dr.prototype.first=dr.prototype.head,Ko&&(dr.prototype[Ko]=vp),dr}),al=$l();ka?((ka.exports=al)._=al,Hn._=al):On._=al}).call(Owe)})(s2,s2.exports)),s2.exports}var v5=qwe();const Uwe=["x","y"],zwe=["fill"],Cwe={fill:"white","font-size":"8",x:"9.5",y:"10","font-family":"Montserrat-Regular","dominant-baseline":"middle","text-anchor":"middle"},l2={__name:"ChalkboardMarker",props:{x:Number,y:Number,color:String,jersey:Number,orientation:{type:String,default:"vertical"}},setup(e){return(a,i)=>(n.openBlock(),n.createElementBlock("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",x:`${e.x}%`,y:`${e.y}%`},[i[0]||(i[0]=n.createElementVNode("path",{opacity:"0.8",d:"M19.0921 9.65161C19.0921 4.54754 14.838 0.406006 9.59065 0.406006C4.34332 0.406006 0.09375 4.54754 0.09375 9.65161C0.09375 14.7557 4.34785 18.8972 9.59065 18.8972C14.8334 18.8972 19.0875 14.7557 19.0875 9.65161H19.0921Z",fill:"white"},null,-1)),n.createElementVNode("path",{d:"M9.58983 17.4931C14.0383 17.4931 17.6445 13.9824 17.6445 9.6516C17.6445 5.32084 14.0383 1.81006 9.58983 1.81006C5.14136 1.81006 1.53516 5.32084 1.53516 9.6516C1.53516 13.9824 5.14136 17.4931 9.58983 17.4931Z",fill:e.color},null,8,zwe),i[1]||(i[1]=n.createElementVNode("path",{style:{"mix-blend-mode":"multiply"},opacity:"1",d:"M18.2312 20.0011C18.2312 21.4228 14.2719 22.5708 9.38741 22.5708C4.50291 22.5708 0.539062 21.4184 0.539062 20.0011C0.539062 18.5838 4.49837 17.4314 9.38288 17.4314C14.2674 17.4314 18.2267 18.5838 18.2267 20.0011H18.2312Z",fill:"url(#paint0_radial_249_64014)"},null,-1)),n.createElementVNode("text",Cwe,n.toDisplayString(e.jersey),1),i[2]||(i[2]=n.createElementVNode("defs",null,[n.createElementVNode("radialGradient",{id:"paint0_radial_249_64014",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.76498 20.0631) scale(8.68186 2.33162)"},[n.createElementVNode("stop",{"stop-color":"#808080"}),n.createElementVNode("stop",{offset:"1","stop-color":"#CCCBCB","stop-opacity":"0"})])],-1))],8,Uwe))}},Pwe=["x","y"],Fwe=["fill"],Ewe=["href"],TL={__name:"ChalkboardMarkerLogo",props:{x:Number,y:Number,color:{type:String,default:"#FFFFFF"},logo:String,orientation:{type:String,default:"vertical"}},setup(e){return(a,i)=>(n.openBlock(),n.createElementBlock("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",x:`${e.x}%`,y:`${e.y}%`},[i[0]||(i[0]=n.createElementVNode("path",{opacity:"0.8",d:"M19.0921 9.65161C19.0921 4.54754 14.838 0.406006 9.59065 0.406006C4.34332 0.406006 0.09375 4.54754 0.09375 9.65161C0.09375 14.7557 4.34785 18.8972 9.59065 18.8972C14.8334 18.8972 19.0875 14.7557 19.0875 9.65161H19.0921Z",fill:"white"},null,-1)),n.createElementVNode("path",{d:"M9.58983 17.4931C14.0383 17.4931 17.6445 13.9824 17.6445 9.6516C17.6445 5.32084 14.0383 1.81006 9.58983 1.81006C5.14136 1.81006 1.53516 5.32084 1.53516 9.6516C1.53516 13.9824 5.14136 17.4931 9.58983 17.4931Z",fill:e.color},null,8,Fwe),i[1]||(i[1]=n.createElementVNode("path",{style:{"mix-blend-mode":"multiply"},opacity:"1",d:"M18.2312 20.0011C18.2312 21.4228 14.2719 22.5708 9.38741 22.5708C4.50291 22.5708 0.539062 21.4184 0.539062 20.0011C0.539062 18.5838 4.49837 17.4314 9.38288 17.4314C14.2674 17.4314 18.2267 18.5838 18.2267 20.0011H18.2312Z",fill:"url(#paint0_radial_249_64014)"},null,-1)),e.logo?(n.openBlock(),n.createElementBlock("image",{key:0,href:e.logo,x:"2",y:"2",width:"16",height:"16",preserveAspectRatio:"xMidYMid meet"},null,8,Ewe)):n.createCommentVNode("",!0),i[2]||(i[2]=n.createElementVNode("defs",null,[n.createElementVNode("radialGradient",{id:"paint0_radial_249_64014",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.76498 20.0631) scale(8.68186 2.33162)"},[n.createElementVNode("stop",{"stop-color":"#808080"}),n.createElementVNode("stop",{offset:"1","stop-color":"#CCCBCB","stop-opacity":"0"})])],-1))],8,Pwe))}},Rwe=["id"],Mwe=["fill"],kL={__name:"ChalkboardGraphic",props:{orientation:{type:String,required:!0},id:{type:String,required:!0},uniqueId:{type:String,required:!0}},setup(e){return(a,i)=>(n.openBlock(),n.createElementBlock("g",{id:e.id,class:n.normalizeClass(e.orientation)},[n.createElementVNode("rect",{opacity:"1",height:"411",width:"256",fill:`url(#${e.uniqueId}-fieldBackground)`},null,8,Mwe),i[0]||(i[0]=n.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="256" height="411" viewBox="0 0 256 411" fill="none"><rect x="0.53125" y="0.5" width="254.03" height="410" stroke="#fff"></rect><rect x="15.5312" y="14.5" width="224" height="382" stroke="#fff"></rect><rect x="69.5312" y="14.5" width="116" height="53" stroke="#fff"></rect><rect x="96.5312" y="14.5" width="62" height="29" stroke="#fff"></rect><rect x="69.5312" y="343.5" width="116" height="53" stroke="#fff"></rect><rect x="96.5312" y="367.5" width="62" height="29" stroke="#fff"></rect><path d="M15.5312 205.5H240.031" stroke="#fff"></path><circle cx="128.031" cy="206" r="36.5" stroke="#fff"></circle></svg>',1))],10,Rwe))}},Wwe=["viewBox"],jwe=["viewBox"],Kwe=["id"],Awe=["id"],Iwe=["fill"],Xwe=["id"],Dwe=["id"],Jwe=["id"],Gwe=["id"],Bwe=["id","onMouseover","onClick"],Zwe=["x1","y1","x2","y2","stroke"],Hwe=["x1","y1","x2","y2","stroke","marker-end"],Ywe={class:"is-pointer",transform:"translate(-11, -11)"},Qwe={key:0,class:"is-pointer",transform:"translate(-11, -11)"},$we=["id","onMouseover","onClick"],e5e=["x1","y1","x2","y2","stroke","marker-end"],t5e={class:"is-pointer",transform:"translate(-11, -11)"},r5e=["id","onMouseover","onClick"],n5e={class:"tooltip-data__title"},a5e={class:"tooltip-data__player"},i5e={class:"tooltip-data__content"},o5e={class:"tooltip-data__content"},s5e=["src"],l5e={key:0,class:"tooltip-data__content"},c5e={key:1,class:"tooltip-data__content"},u5e={class:"tooltip-data__button-play-container"},d5e={class:"tooltip-data__button-play"},Z0=250/2,p5e={__name:"XgChalkboard",props:{plays:{type:Array,require:!0},categories:{type:Array,required:!0},players:{type:Array,required:!0},games:{type:Array,default:()=>[]},team:{type:Number,default:0},playValuesIndex:{type:Object,required:!0},analysisType:{type:String,required:!1},sectionType:{type:String,required:!1,default:"team"},orientation:{type:String,required:!1,default:"horizontal"},canPlayVideos:{type:Boolean,default:!0},isAssistZoneVisible:{type:Boolean,default:!1},componentWidth:{type:Number,default:600},isTooltipAvailable:{type:Boolean,default:!1},uniqueId:{type:String,required:!0}},emits:["openmedia","change-xg","change-total-plays"],setup(e,{emit:a}){let i=null;const k=n.ref(null),W=n.ref(null);n.defineComponent({Tooltip:wL,ChalkboardMarker:l2,ChalkboardMarkerLogo:TL,ChalkboardGraphic:kL});const g=a,m=e,r=n.ref(!1),h=n.ref("red"),l=n.ref({x:0,y:0,visible:!1}),t=n.ref({playerName:"",minute:0,rivalLogo:"",categoryName:"",category:"",xGi:0,xGf:0,isOwnGoal:!1}),_=n.ref(!1),w=n.computed(()=>m.componentWidth<565),v=n.computed(()=>m.orientation==="horizontal"?m.componentWidth>384?"0 0 411 256":"0 0 784 490":m.componentWidth>384?"0 0 256 411":"0 0 490 784"),f=n.computed(()=>m.componentWidth<384),o=n.computed(()=>m.sectionType==="team"?[0,1,2,8]:X.value.position_id===1?[]:[0,3,4,10]),s=n.computed(()=>m.plays.map(H=>({playId:H[m.playValuesIndex.playId],gameId:H[m.playValuesIndex.gameId],teamId:H[m.playValuesIndex.teamId],playerId:H[m.playValuesIndex.playerId],momentOfPlay:H[m.playValuesIndex.momentOfPlay],categoryId:H[m.playValuesIndex.categoryId],categoryType:H[m.playValuesIndex.categoryType],matchLapse:H[m.playValuesIndex.matchLapse],section:H[m.playValuesIndex.section],matchResult:H[m.playValuesIndex.matchResult],playingAs:H[m.playValuesIndex.playingAs],total:H[m.playValuesIndex.total],x1:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate1Y]*100:H[m.playValuesIndex.coordinate1X]*100,y1:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate1X]*100:H[m.playValuesIndex.coordinate1Y]*100,x2:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate2Y]*100:H[m.playValuesIndex.coordinate2X]*100,y2:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate2X]*100:H[m.playValuesIndex.coordinate2Y]*100,x3:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate3Y]*100:H[m.playValuesIndex.coordinate3X]*100,y3:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate3X]*100:H[m.playValuesIndex.coordinate3Y]*100,xGi:H[m.playValuesIndex.xGi],xGf:H[m.playValuesIndex.xGf]}))),p=n.computed(()=>m.categories.map((H,ne)=>({id:ne,name:H.name,singleName:H.singleName,negative:H.negative||!1,color:H.color,points:H.points,numPoints:H.points.length,categories:H.categories,invert:H.invert||[]}))),c=n.computed(()=>m.isAssistZoneVisible?m.analysisType==="offensive"?2:3:1),d=n.computed(()=>{const H=p.value.filter(({numPoints:ne})=>ne===1).map(ne=>ne.categories).flat();return[...new Set(H)]}),b=n.computed(()=>{const H=p.value.filter(ne=>ne.numPoints===2).map(ne=>ne.categories).flat();return[...new Set(H)]}),x=n.computed(()=>{const H=p.value.filter(ne=>ne.numPoints===3).map(ne=>ne.categories).flat();return[...new Set(H)]}),T=n.computed(()=>{let H=d.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,G)=>{let re=p.value.find($=>C($.categories,G)),ee=m.players.find($=>$.player_id===G.playerId),Y=m.games.find($=>$?$.gameId===G.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,color:re.color,playId:G.playId,player:G.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:G.matchLapse,x1:re.invert.includes(G.categoryId)?100-G[`x${re.points[0]}`]:G[`x${re.points[0]}`],y1:re.invert.includes(G.categoryId)?100-G[`y${re.points[0]}`]:G[`y${re.points[0]}`],momentOfPlay:G.momentOfPlay,rivalLogo:q(Y,G)};m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=G.xGi,$.xGf=G.xGf),ne.push($)}return ne},[])}),N=n.computed(()=>{let H=b.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,G)=>{let re=p.value.find($=>C($.categories,G)),ee=m.players.find($=>$.player_id===G.playerId),Y=m.games.find($=>$?$.gameId===G.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,arrowColor:re.negative?h.value:re.color,arrowMarkerColor:re.negative?`url(#${m.uniqueId}-arrow-negative)`:`url(#${m.uniqueId}-arrow-${re.id})`,markerColor:re.color,playId:G.playId,player:G.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:G.matchLapse,x1:re.invert.includes(G.categoryId)?100-G[`x${re.points[0]}`]:G[`x${re.points[0]}`],y1:re.invert.includes(G.categoryId)?100-G[`y${re.points[0]}`]:G[`y${re.points[0]}`],x2:re.invert.includes(G.categoryId)?100-G[`x${re.points[1]}`]:G[`x${re.points[1]}`],y2:re.invert.includes(G.categoryId)?100-G[`y${re.points[1]}`]:G[`y${re.points[1]}`],momentOfPlay:G.momentOfPlay,rivalLogo:q(Y,G)};m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=G.xGi,$.xGf=G.xGf),ne.push($)}return ne},[])}),V=n.computed(()=>{let H=x.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,G)=>{let re=p.value.find($=>C($.categories,G)),ee=m.players.find($=>$.player_id===G.playerId),Y=m.games.find($=>$?$.gameId===G.gameId||$.game_id===G.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,arrowColor:re.negative?h.value:re.color,arrowMarkerColor:re.negative?`url(#${m.uniqueId}-arrow-negative)`:`url(#${m.uniqueId}-arrow-${re.id})`,markerColor:re.color,playId:G.playId,player:G.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:G.matchLapse,x1:re.invert.includes(G.categoryId)?100-G[`x${re.points[0]}`]:G[`x${re.points[0]}`],y1:re.invert.includes(G.categoryId)?100-G[`y${re.points[0]}`]:G[`y${re.points[0]}`],x2:re.invert.includes(G.categoryId)?100-G[`x${re.points[1]}`]:G[`x${re.points[1]}`],y2:re.invert.includes(G.categoryId)?100-G[`y${re.points[1]}`]:G[`y${re.points[1]}`],x3:re.invert.includes(G.categoryId)?100-G[`x${re.points[2]}`]:G[`x${re.points[2]}`],y3:re.invert.includes(G.categoryId)?100-G[`y${re.points[2]}`]:G[`y${re.points[2]}`],momentOfPlay:G.momentOfPlay,rivalLogo:q(Y,G)};re.id===0&&m.analysisType==="offensive"&&G.teamId?$.isOwnGoal=m.team!==G.teamId:re.id===0&&m.analysisType==="defensive"&&G.teamId?$.isOwnGoal=m.team===G.teamId:$.isOwnGoal=!1,m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=G.xGi,$.xGf=G.xGf),ne.push($)}return ne},[])}),U=()=>{!W.value||W.value.contains(event.target)||(f.value&&(r.value||z()),r.value=!1)},z=()=>{l.value.visible=!1},O=(H,ne,G=null)=>{const re=s.value.find(ue=>ue.playId===H.playId),ee=G!==null?m.categories[G].name:H.categoryName;let Y={};const $=m.categories.find(ue=>ue.id===H.category),le=$?$.categories:[];if(ne===2&&!f.value){const ue=m.sectionType==="team"&&m.analysisType==="defensive"&&ee.includes("recibidos");Y={seasonId:selectedSeasonIdFilterOptions.value,categoryIds:le,categorySingleName:"",mainSectionType:1,playListType:m.sectionType==="team"?3:2,matchResult:selectedGameResultsFilterOptions.value,playData:re||null,gameIds:selectedGamesIdsFilterOptions.value,isRivalSubject:ue,avoidCategorySingleName:ue,advancedFilter:{playListTitle:ee,mainCategoryId:{},playingAs:selectedPlayingAsFilterOptions.value?[selectedPlayingAsFilterOptions.value]:[1,2],timeSections:selectedGameTimePeriodsFilterOptions.value,fieldSections:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}}}if(ne===1){const ue=m.sectionType==="team"&&ee.includes("recibidos");Y={seasonId:selectedSeasonIdFilterOptions.value,categoryIds:le,categorySingleName:"",mainSectionType:1,playListType:m.sectionType==="team"?3:2,gameIds:selectedGamesIdsFilterOptions.value,matchResult:selectedGameResultsFilterOptions.value,playData:re||null,isRivalSubject:ue,avoidCategorySingleName:ue,advancedFilter:{playListTitle:ee,mainCategoryId:{},playingAs:selectedPlayingAsFilterOptions.value?[selectedPlayingAsFilterOptions.value]:[1,2],timeSections:selectedGameTimePeriodsFilterOptions.value,fieldSections:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}}}const ie=m.sectionType==="team";ne===1?ie&&teamId.value?(Y.playerIds=[],Y.teamId=teamId.value):ie||(Y.playerIds=re?[re.playerId]:null,Y.teamId=0):f.value||(ie&&teamId.value?(Y.playerIds=[],Y.teamId=teamId.value):ie||(Y.playerIds=re?[re.playerId]:null,Y.teamId=0)),ne===1?g("openmedia",Y):f.value||g("openmedia",Y)},C=(H,ne)=>H.find(G=>{let re=0;if(typeof G=="string"){if(ne.teamId)return re=Number(G.split("_").shift()),re===ne.categoryId&&ne.teamId!==m.team}else return ne.teamId?G===ne.categoryId&&m.team===ne.teamId:G===ne.categoryId;return!1}),q=(H,ne)=>m.sectionType==="team"?H.homeTeamId===m.team?H.visitingTeamLogo:H.homeTeamLogo:ne.playingAs===1?H.visitingTeamLogo:H.homeTeamLogo,L=()=>{if(window.ResizeObserver)i=new ResizeObserver(()=>{_.value=k.value&&k.value.clientWidth>524}),i.observe(k.value);else throw new Error("Resize observer not supported!")};function P(){w.value&&O(S.value.play,S.value.type)}const S=n.ref({play:null,type:null}),F=(H,ne,G)=>{m.isTooltipAvailable&&(r.value=!0,w.value?(S.value={play:ne,type:G},t.value.category=ne.category,t.value.playerName=ne.playerName||"",t.value.playerImage=ne.playerImage||"",t.value.minute=parseInt(ne.momentOfPlay.split(":")[0])||"",t.value.rivalLogo=ne.rivalLogo||"",t.value.categoryName=ne.categoryName||"",t.value.xGi=String(ne.xGi),t.value.xGf=String(ne.xGf),t.value.isOwnGoal=ne.isOwnGoal,l.value.x=H.layerX<Z0+5?5:H.layerX+Z0>k.value.clientWidth?k.value.clientWidth-Z0*2-5:H.layerX,l.value.y=H.layerY+20,l.value.visible=!0):O(ne,G))},R=(H,ne,G)=>{m.isTooltipAvailable&&(S.value={play:ne,type:G},w.value||(t.value.category=ne.category,t.value.playerName=ne.playerName||"",t.value.playerImage=ne.playerImage||"",t.value.minute=parseInt(ne.momentOfPlay.split(":")[0])||"",t.value.rivalLogo=ne.rivalLogo||"",t.value.categoryName=ne.categoryName||"",t.value.xGi=String(ne.xGi),t.value.xGf=String(ne.xGf),t.value.isOwnGoal=ne.isOwnGoal,l.value.x=H.layerX<Z0+5?5:H.layerX+Z0>k.value.clientWidth?k.value.clientWidth-Z0*2-5:H.layerX,l.value.y=H.layerY+20,l.value.visible=!0))},j=()=>{f.value||(l.value.visible=!1)},K=()=>{f.value&&(l.value.visible=!1)},X=n.ref({}),D=n.computed(()=>{const H=v5.groupBy(T.value,"momentOfPlay"),ne=v5.groupBy(N.value,"momentOfPlay"),G=v5.groupBy(V.value,"momentOfPlay");return{playsByMoment1:H,playsByMoment2:ne,playsByMoment3:G}});return n.watch(()=>D.value,H=>{const ne={...H.playsByMoment1,...H.playsByMoment2,...H.playsByMoment3};let G=0;Object.entries(ne).forEach(le=>{o.value.includes(le[1][0].category)&&!le.isOwnGoal&&(G+=Number(le[1][0].xGf))});let re=Object.keys(H.playsByMoment1).length,ee=Object.keys(H.playsByMoment2).length,Y=Object.keys(H.playsByMoment3).length;const $=re+ee+Y;g("change-xg",G),g("change-total-plays",$)},{immediate:!0}),n.onMounted(()=>{document.addEventListener("click",U),L()}),n.onBeforeUnmount(()=>{document.removeEventListener("click",U),i&&(i.disconnect(),i=null)}),(H,ne)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"soccerChalkboard",ref:k,class:n.normalizeClass(["chalkboard__container",e.orientation]),onMouseleave:K},[(n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:v.value,"xmlns:xlink":"http://www.w3.org/1999/xlink",class:"soccer-chalkboard"},[(n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e.orientation==="horizontal"?"0 0 411 256":"0 0 256 411","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"svg-soccer-chalkboard"},[n.createElementVNode("defs",null,[n.createElementVNode("marker",{id:`${e.uniqueId}-arrow-negative`,viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"6",markerHeight:"6",markerUnits:"strokeWidth",orient:"auto"},[...ne[0]||(ne[0]=[n.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z","stroke-width":"2",fill:"red"},null,-1)])],8,Kwe),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p.value,G=>(n.openBlock(),n.createElementBlock("marker",{key:`${e.uniqueId}-arrow-color-${G.id}`,id:`${e.uniqueId}-arrow-${G.id}`,viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"6",markerHeight:"6",markerUnits:"strokeWidth",orient:"auto"},[n.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z","stroke-width":"2",fill:G.color},null,8,Iwe)],8,Awe))),128)),n.createElementVNode("pattern",{id:`${e.uniqueId}-fieldBackground`,width:"1",height:"1",viewBox:"0 0 100 100",preserveAspectRatio:"none"},[c.value===1?(n.openBlock(),n.createElementBlock("image",{key:0,"xlink:href":Twe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Dwe)):c.value===2?(n.openBlock(),n.createElementBlock("image",{key:1,"xlink:href":kwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Jwe)):c.value===3?(n.openBlock(),n.createElementBlock("image",{key:2,"xlink:href":Lwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Gwe)):n.createCommentVNode("",!0)],8,Xwe)]),n.createVNode(kL,{id:"soccer-field",orientation:e.orientation,"unique-id":e.uniqueId},null,8,["orientation","unique-id"]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(V.value,G=>(n.openBlock(),n.createElementBlock("g",{key:G.id,id:`play-${G.playId}`,onMouseover:re=>R(re,G,2),onMouseleave:j,onClick:re=>F(re,G,2)},[n.createElementVNode("line",{x1:`${G.x1}%`,y1:`${G.y1}%`,x2:`${G.x2}%`,y2:`${G.y2}%`,stroke:G.arrowColor,"stroke-width":"2"},null,8,Zwe),n.createElementVNode("line",{x1:`${G.x2}%`,y1:`${G.y2}%`,x2:`${G.x3}%`,y2:`${G.y3}%`,stroke:G.arrowColor,"stroke-width":"2","marker-end":`${G.arrowMarkerColor}`},null,8,Hwe),n.createElementVNode("g",Ywe,[n.createVNode(l2,{jersey:G.jersey,color:G.markerColor,x:G.x1,y:G.y1,orientation:e.orientation},null,8,["jersey","color","x","y","orientation"])]),G.categoryName==="Atajadas"||G.categoryName==="Goles recibidos"?(n.openBlock(),n.createElementBlock("g",Qwe,[n.createVNode(TL,{color:"#FFFFFF",logo:G.rivalLogo,x:G.x2,y:G.y2,orientation:e.orientation},null,8,["logo","x","y","orientation"])])):n.createCommentVNode("",!0)],40,Bwe))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.value,G=>(n.openBlock(),n.createElementBlock("g",{key:G.id,id:`play-${G.playId}`,onMouseover:re=>R(re,G,2),onMouseleave:j,onClick:re=>F(re,G,2)},[n.createElementVNode("line",{x1:`${G.x1}%`,y1:`${G.y1}%`,x2:`${G.x2}%`,y2:`${G.y2}%`,"stroke-width":"2",stroke:G.arrowColor,"marker-end":`${G.arrowMarkerColor}`},null,8,e5e),n.createElementVNode("g",t5e,[n.createVNode(l2,{jersey:G.jersey,color:G.markerColor,x:G.x1,y:G.y1},null,8,["jersey","color","x","y"])])],40,$we))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(T.value,G=>(n.openBlock(),n.createElementBlock("g",{key:G.id,id:`play-${G.playId}`,class:"is-pointer",onMouseover:re=>R(re,G,2),onMouseleave:j,onClick:re=>F(re,G,2),transform:"translate(-11, -11)"},[n.createVNode(l2,{x:G.x1,y:G.y1,jersey:G.jersey,color:G.color},null,8,["x","y","jersey","color"])],40,r5e))),128))],8,jwe))],8,Wwe)),n.createVNode(wL,{"play-data":l.value,"is-mobile-device":w.value},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["tooltip-data",e.orientation])},[n.createElementVNode("p",n5e,n.toDisplayString(t.value.isOwnGoal?t.value.categoryName=="Goles recibidos"?t.value.categoryName:"Autogol":t.value.categoryName),1),n.createElementVNode("div",a5e,[n.createElementVNode("span",null,n.toDisplayString(t.value.playerName),1),n.createElementVNode("div",{class:"tooltip-data__player-image",style:n.normalizeStyle(`background-image: url(${t.value.playerImage})`)},null,4)]),n.createElementVNode("div",i5e,[n.createElementVNode("span",null,"Minuto: "+n.toDisplayString(t.value.minute),1)]),n.createElementVNode("div",o5e,[n.createElementVNode("span",null,"Rival: "+n.toDisplayString(t.value.rivalName),1),n.createElementVNode("img",{src:t.value.rivalLogo,width:"25",style:{"vertical-align":"middle"}},null,8,s5e)]),/^[+]?([0-1]+(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t.value.xGi)&&t.value.xGi<=1&&!t.value.isOwnGoal?(n.openBlock(),n.createElementBlock("div",l5e,[ne[1]||(ne[1]=n.createElementVNode("span",{class:"bold"},"xGi:",-1)),n.createTextVNode(" "+n.toDisplayString(n.unref(_L)(Number(t.value.xGi),4)),1)])):n.createCommentVNode("",!0),/^[+]?([0-1]+(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t.value.xGf)&&t.value.xGf<=1&&!t.value.isOwnGoal?(n.openBlock(),n.createElementBlock("div",c5e,[ne[2]||(ne[2]=n.createElementVNode("span",{class:"bold"},"xGf:",-1)),n.createTextVNode(" "+n.toDisplayString(n.unref(_L)(Number(t.value.xGf),4)),1)])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("div",u5e,[n.createElementVNode("div",d5e,[n.createElementVNode("div",{role:"button",class:"tooltip-data__button-play__button",onClick:n.withModifiers(P,["stop","prevent"])},[...ne[3]||(ne[3]=[n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none"},[n.createElementVNode("path",{d:"M3.0492 8.92004C2.9831 8.88243 2.92785 8.82624 2.88941 8.75753C2.85097 8.68882 2.83079 8.61018 2.83106 8.53011V1.46888C2.83115 1.38908 2.85146 1.3108 2.88982 1.24236C2.92819 1.17392 2.98318 1.11788 3.04895 1.08019C3.11472 1.0425 3.18881 1.02458 3.26334 1.02832C3.33788 1.03206 3.41007 1.05733 3.47225 1.10145L8.4249 4.63248C8.48147 4.67271 8.52786 4.72726 8.55995 4.79129C8.59204 4.85533 8.60883 4.92685 8.60883 4.9995C8.60883 5.07214 8.59204 5.14367 8.55995 5.2077C8.52786 5.27173 8.48147 5.32629 8.4249 5.36651L3.47225 8.89838C3.41016 8.94259 3.33803 8.96796 3.26352 8.97177C3.18902 8.97559 3.11495 8.95771 3.0492 8.92004ZM3.24397 8.53095L8.19663 4.99991L3.24397 8.53095Z",fill:"#CBEE6B"})],-1)])]),ne[4]||(ne[4]=n.createElementVNode("div",null,"Ver video",-1))])],512),[[n.vShow,w.value]])],2)]),_:1},8,["play-data","is-mobile-device"])],34))}},h5e=g5(p5e,[["__scopeId","data-v-00302137"]]);function f5e(e){return e.reduce((a,i,k)=>(a[i]=k,a),{})}const m5e=["playId","gameId","teamId","playerId","momentOfPlay","categoryId","categoryType","matchLapse","section","matchResult","playingAs","total","coordinate1X","coordinate1Y","coordinate2X","coordinate2Y","coordinate3X","coordinate3Y","xGi","xGf"];let b5=null;function y5e(){return b5||(b5=f5e(m5e)),b5}const g5e={class:"chalkboard-profile__field"},v5e={class:"chalkboard-profile__field__events"},b5e={__name:"GSC-LastTouch",props:{categories:{type:Array,default:()=>[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}]},seasonId:{type:Number,default:2010},isPreMatch:{type:Boolean,default:!1},howManyGames:{type:Number,default:1},analysisType:{type:String,default:"offensive"},sectionType:{type:String,default:"team"},orientation:{type:String,default:"vertical"},isFull:{type:Boolean,default:!1},isTotalXgfVisible:{type:Boolean,default:!0},canPlayVideos:{type:Boolean,default:!1},teamIdForAnalysis:{type:Number,default:1},isAssistZoneVisible:{type:Boolean,default:!1},gamesIdsForAnalysis:{type:Array,default:()=>[]},gameDateUTC:{type:String,default:""},token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},isTemplateMode:{type:Boolean,default:!1},isHomeTeamForAnalysis:{type:Boolean,default:!0}},emits:["openmedia"],setup(e,{emit:a}){let i=null;const k=a,W=e,g=n.ref(null),m=n.ref(1200),r=n.ref(0),h=n.ref("vertical");n.ref({});const l=n.ref(0),t=n.ref(0),_=n.ref([]),w=n.ref([]),v=n.ref([]),f=n.ref(`chalkboard-profile-${Math.random().toString(36).substring(2,11)}`),o=n.computed(()=>W.teamIdForAnalysis),s=n.computed(()=>({"--font-size-events":m.value<220?"9px":"12px"}));n.computed(()=>[1,2,3]),n.computed(()=>[1,2,3,4,5,6]),n.computed(()=>[1,2]);const p=n.computed(()=>y5e()),c=n.computed(()=>[...W.categories]),d=n.computed(()=>W.categories.reduce((q,L)=>(Array.isArray(L.categories)&&q.push(...L.categories),q),[]));n.watch(()=>W.categories,()=>{C()},{deep:!0}),n.watch(()=>W.analysisType,(q,L)=>{q!==L&&C()});function b(){i=new ResizeObserver(q=>{for(const L of q)m.value=L.contentRect.width}),i.observe(g.value)}function x(q){l.value=q}function T(q){t.value=q}n.onMounted(()=>{b()});function N(q){k("openmedia",q)}async function V(){try{const q=`https://d2oco6mqmc.execute-api.us-west-2.amazonaws.com/prod/teamsBySeason/${W.seasonId}`;return(await(await fetch(q,{headers:{Authorization:W.token}})).json()).teams||[]}catch(q){console.error("Error al obtener los equipos por temporada:",q)}}async function U(){try{const q=`https://pa3kubpuhg.execute-api.us-west-2.amazonaws.com/prod/playersByTeamAndSeason/${W.seasonId}/`,L=await(await fetch(q,{headers:{Authorization:W.token}})).json();return(L==null?void 0:L.reduce((P,S)=>(S.players&&Array.isArray(S.players)&&P.push(...S.players),P),[]))||[]}catch(q){console.error("Error al obtener los jugadores por temporada:",q)}}async function z(){try{const q=`https://8tvo5bp9ai.execute-api.us-west-2.amazonaws.com/prod/gamesBySeason/${W.seasonId}`;return(await(await fetch(q,{headers:{Authorization:W.token}})).json()).games||[]}catch(q){console.error("Error al obtener los partidos por temporada:",q)}}async function O(){try{const q=W.gamesIdsForAnalysis.length?W.gamesIdsForAnalysis.reduce((R,j,K)=>(R+=K===0?`game_id=${j}`:`&game_id=${j}`,R),""):"",L=d.value.reduce((R,j,K)=>(R+=K===0?`category_id=${j}`:`&category_id=${j}`,R),""),P=W.analysisType==="offensive"?2:3,S=`https://mabnn9axgb.execute-api.us-west-2.amazonaws.com/prod/seasons/${W.seasonId}/stats?${q}&team_id=${W.teamIdForAnalysis}&${L}&analysis_type=${P}&is_chalkboard=true`,F=await(await fetch(S,{headers:{Authorization:W.token}})).json();return Object.values(F).reduce((R,j)=>(j&&Array.isArray(j)&&R.push(...j),R),[])}catch(q){console.error("Error al obtener las estadísticas del equipo por temporada:",q)}}async function C(){try{const q=[];q.push(V),q.push(U),q.push(z),q.push(O);const[L,P,S,F]=await Promise.all(q.map(R=>R()));_.value=W.isTemplateMode?F.slice(0,3):F,w.value=P,v.value=S}catch(q){console.error("Error al llenar los datos del chalkboard:",q)}}return n.onMounted(async()=>{try{b(),await C()}catch(q){console.error("Error al cargar los datos del chalkboard:",q)}}),(q,L)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"chalkboardProfile",ref:g,class:"chalkboard-profile",style:n.normalizeStyle(s.value)},[n.createElementVNode("div",g5e,[(n.openBlock(),n.createBlock(h5e,{plays:_.value,categories:c.value,players:w.value,games:v.value,team:o.value,"play-values-index":p.value,"analysis-type":e.analysisType,"section-type":e.sectionType,orientation:h.value,key:r.value,"can-play-videos":e.canPlayVideos,"is-assist-zone-visible":e.isAssistZoneVisible,"component-width":m.value,"unique-id":f.value,onOpenmedia:N,onChangeTotalPlays:x,onChangeXg:T},null,8,["plays","categories","players","games","team","play-values-index","analysis-type","section-type","orientation","can-play-videos","is-assist-zone-visible","component-width","unique-id"])),n.createElementVNode("div",v5e,[e.isTotalXgfVisible&&e.analysisType==="offensive"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(" xG: "+n.toDisplayString(t.value.toFixed(2))+" ",1),L[0]||(L[0]=n.createElementVNode("span",{class:"chalkboard-profile__field__events__separator"}," | ",-1))],64)):n.createCommentVNode("",!0),n.createTextVNode(" Eventos totales: "+n.toDisplayString(l.value),1)])])],4))}},LL=g5(b5e,[["__scopeId","data-v-65b32a9e"]]),x5e={class:"tooltip-options"},w5e={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(e,{emit:a}){const i=e,k=a,W=n.computed(()=>i.optionsType==="page");function g(){k("close-tooltip")}function m(r){k(r),g()}return(r,h)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",{class:"tooltip-overlay",onClick:g}),n.createElementVNode("div",x5e,[n.createElementVNode("ul",null,[W.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("li",{class:"option",onClick:h[0]||(h[0]=l=>m("change-sort"))},[...h[4]||(h[4]=[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),n.createTextVNode(" Cambiar orden ",-1)])]),n.createElementVNode("li",{class:"option",onClick:h[1]||(h[1]=l=>m("delete-page"))},[...h[5]||(h[5]=[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),n.createTextVNode(" Eliminar ",-1)])])],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("li",{class:"option",onClick:h[2]||(h[2]=l=>m("edit"))},[...h[6]||(h[6]=[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),n.createTextVNode(" Editar ",-1)])]),n.createElementVNode("li",{class:"option",onClick:h[3]||(h[3]=l=>m("delete"))},[...h[7]||(h[7]=[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),n.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},NL=jd(w5e,[["__scopeId","data-v-998e2429"]]),_5e={class:"report-view"},S5e={class:"report-view__header"},T5e={key:0,class:"report-view__header__logo"},k5e=["src"],L5e={class:"report-view__header__name"},N5e={class:"report-view__content"},V5e={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(e,{emit:a}){const i=e,k=n.ref(!1),W=a,g=[1,2,3,4,6,8,14,13],m=n.computed(()=>!g.includes(i.viewId)),r=n.computed(()=>{if(i.game){const o=i.isHomeTeam?i.game.homeTeam:i.game.awayTeam;if(o&&o.logo)return o.logo}return""}),h=n.computed(()=>{const o=i.view.coreView;return o?o.id===9?i.view.w<4?i.view.title.replace("Mapeo de ",""):i.view.title:o.id===6?t(i.view):o.id===13?_(i.view):i.view.title:i.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function t(o){return i.isPostMatch?o.title:`${o.title} ${l.get(o.componentProps.gameNumber)+" partido"||""}`}function _(o){try{if(!o)return"Tabla por Categoría";const s=o.dynamicFilters||[];if(!Array.isArray(s)||s.length<2)return"Tabla por Categoría";const p=s[1]||[],c=s[0]||2;if(p&&p.length>0){const d=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:c==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:c==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:c==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:c==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],b=(x,T)=>{if(x.length!==T.length)return!1;const N=[...x].sort(),V=[...T].sort();return N.every((U,z)=>U===V[z])};for(const x of d)if(b(p,x.value))return x.label}return"Tabla por Categoría"}catch(s){return console.error("Error en getTableCategoryTitle:",s),"Tabla por Categoría"}}function w(){f(),W("edit")}function v(){f(),W("delete")}function f(){k.value=!1}return(o,s)=>(n.openBlock(),n.createElementBlock("div",_5e,[n.createElementVNode("div",S5e,[k.value?(n.openBlock(),n.createBlock(NL,{key:0,"options-type":"view",onClick:s[0]||(s[0]=n.withModifiers(p=>k.value=!1,["self"])),onMouseleave:s[1]||(s[1]=p=>k.value=!1),onCloseTooltip:f,onEdit:w,onDelete:v})):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"report-view__header__team-and-name",style:n.normalizeStyle(e.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[r.value&&m.value?(n.openBlock(),n.createElementBlock("div",T5e,[n.createElementVNode("img",{src:r.value,alt:""},null,8,k5e)])):n.createCommentVNode("",!0),n.createElementVNode("div",L5e,n.toDisplayString(h.value),1)],4),n.withDirectives(n.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:s[2]||(s[2]=p=>k.value=!0)},[...s[3]||(s[3]=[n.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])],512),[[n.vShow,e.isTemplateMode&&!e.isFilterVisible]])]),n.createElementVNode("div",N5e,[n.createElementVNode("div",{class:n.normalizeClass({"field-possession-component":e.viewId===8,"timeline-component":e.viewId===4,"field-data-by-zones-component":e.viewId===9})},[n.renderSlot(o.$slots,"default",{},void 0,!0)],2)])]))}},O5e=jd(V5e,[["__scopeId","data-v-150c2e28"]]);function q5e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c2={exports:{}},VL;function U5e(){if(VL)return c2.exports;VL=1;function e(){}return e.prototype={on:function(a,i,k){var W=this.e||(this.e={});return(W[a]||(W[a]=[])).push({fn:i,ctx:k}),this},once:function(a,i,k){var W=this;function g(){W.off(a,g),i.apply(k,arguments)}return g._=i,this.on(a,g,k)},emit:function(a){var i=[].slice.call(arguments,1),k=((this.e||(this.e={}))[a]||[]).slice(),W=0,g=k.length;for(W;W<g;W++)k[W].fn.apply(k[W].ctx,i);return this},off:function(a,i){var k=this.e||(this.e={}),W=k[a],g=[];if(W&&i)for(var m=0,r=W.length;m<r;m++)W[m].fn!==i&&W[m].fn._!==i&&g.push(W[m]);return g.length?k[a]=g:delete k[a],this}},c2.exports=e,c2.exports.TinyEmitter=e,c2.exports}var x5,OL;function z5e(){if(OL)return x5;OL=1;var e=U5e();return x5=new e,x5}var C5e=z5e();const Ua=q5e(C5e);function P5e(e,a,i,k,W){const g=(...m)=>(console.warn("gridstack.js: Function `"+i+"` is deprecated in "+W+" and has been replaced with `"+k+"`. It will be **removed** in a future release"),a.apply(e,m));return g.prototype=a.prototype,g}class Yn{static getElements(a,i=document){if(typeof a=="string"){const k="getElementById"in i?i:void 0;if(k&&!isNaN(+a[0])){const g=k.getElementById(a);return g?[g]:[]}let W=i.querySelectorAll(a);return!W.length&&a[0]!=="."&&a[0]!=="#"&&(W=i.querySelectorAll("."+a),W.length||(W=i.querySelectorAll("#"+a))),Array.from(W)}return[a]}static getElement(a,i=document){if(typeof a=="string"){const k="getElementById"in i?i:void 0;if(!a.length)return null;if(k&&a[0]==="#")return k.getElementById(a.substring(1));if(a[0]==="#"||a[0]==="."||a[0]==="[")return i.querySelector(a);if(k&&!isNaN(+a[0]))return k.getElementById(a);let W=i.querySelector(a);return k&&!W&&(W=k.getElementById(a)),W||(W=i.querySelector("."+a)),W}return a}static lazyLoad(a){var i,k;return a.lazyLoad||((k=(i=a.grid)==null?void 0:i.opts)==null?void 0:k.lazyLoad)&&a.lazyLoad!==!1}static createDiv(a,i){const k=document.createElement("div");return a.forEach(W=>{W&&k.classList.add(W)}),i==null||i.appendChild(k),k}static shouldSizeToContent(a,i=!1){return(a==null?void 0:a.grid)&&(i?a.sizeToContent===!0||a.grid.opts.sizeToContent===!0&&a.sizeToContent===void 0:!!a.sizeToContent||a.grid.opts.sizeToContent&&a.sizeToContent!==!1)}static isIntercepted(a,i){return!(a.y>=i.y+i.h||a.y+a.h<=i.y||a.x+a.w<=i.x||a.x>=i.x+i.w)}static isTouching(a,i){return Yn.isIntercepted(a,{x:i.x-.5,y:i.y-.5,w:i.w+1,h:i.h+1})}static areaIntercept(a,i){const k=a.x>i.x?a.x:i.x,W=a.x+a.w<i.x+i.w?a.x+a.w:i.x+i.w;if(W<=k)return 0;const g=a.y>i.y?a.y:i.y,m=a.y+a.h<i.y+i.h?a.y+a.h:i.y+i.h;return m<=g?0:(W-k)*(m-g)}static area(a){return a.w*a.h}static sort(a,i=1){return a.sort((k,W)=>{const g=i*((k.y??1e4)-(W.y??1e4));return g===0?i*((k.x??1e4)-(W.x??1e4)):g})}static find(a,i){return i?a.find(k=>k.id===i):void 0}static toBool(a){return typeof a=="boolean"?a:typeof a=="string"?(a=a.toLowerCase(),!(a===""||a==="no"||a==="false"||a==="0")):!!a}static toNumber(a){return a===null||a.length===0?void 0:Number(a)}static parseHeight(a){let i,k="px";if(typeof a=="string")if(a==="auto"||a==="")i=0;else{const W=a.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!W)throw new Error(`Invalid height val = ${a}`);k=W[2]||"px",i=parseFloat(W[1])}else i=a;return{h:i,unit:k}}static defaults(a,...i){return i.forEach(k=>{for(const W in k){if(!k.hasOwnProperty(W))return;a[W]===null||a[W]===void 0?a[W]=k[W]:typeof k[W]=="object"&&typeof a[W]=="object"&&Yn.defaults(a[W],k[W])}}),a}static same(a,i){if(typeof a!="object")return a==i;if(typeof a!=typeof i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const k in a)if(a[k]!==i[k])return!1;return!0}static copyPos(a,i,k=!1){return i.x!==void 0&&(a.x=i.x),i.y!==void 0&&(a.y=i.y),i.w!==void 0&&(a.w=i.w),i.h!==void 0&&(a.h=i.h),k&&(i.minW&&(a.minW=i.minW),i.minH&&(a.minH=i.minH),i.maxW&&(a.maxW=i.maxW),i.maxH&&(a.maxH=i.maxH)),a}static samePos(a,i){return a&&i&&a.x===i.x&&a.y===i.y&&(a.w||1)===(i.w||1)&&(a.h||1)===(i.h||1)}static sanitizeMinMax(a){a.minW||delete a.minW,a.minH||delete a.minH,a.maxW||delete a.maxW,a.maxH||delete a.maxH}static removeInternalAndSame(a,i){if(!(typeof a!="object"||typeof i!="object"))for(let k in a){const W=a[k],g=i[k];k[0]==="_"||W===g?delete a[k]:W&&typeof W=="object"&&g!==void 0&&(Yn.removeInternalAndSame(W,g),Object.keys(W).length||delete a[k])}}static removeInternalForSave(a,i=!0){for(let k in a)(k[0]==="_"||a[k]===null||a[k]===void 0)&&delete a[k];delete a.grid,i&&delete a.el,a.autoPosition||delete a.autoPosition,a.noResize||delete a.noResize,a.noMove||delete a.noMove,a.locked||delete a.locked,(a.w===1||a.w===a.minW)&&delete a.w,(a.h===1||a.h===a.minH)&&delete a.h}static throttle(a,i){let k=!1;return(...W)=>{k||(k=!0,setTimeout(()=>{a(...W),k=!1},i))}}static removePositioningStyles(a){const i=a.style;i.position&&i.removeProperty("position"),i.left&&i.removeProperty("left"),i.top&&i.removeProperty("top"),i.width&&i.removeProperty("width"),i.height&&i.removeProperty("height")}static getScrollElement(a){if(!a)return document.scrollingElement||document.documentElement;const i=getComputedStyle(a);return/(auto|scroll)/.test(i.overflow+i.overflowY)?a:Yn.getScrollElement(a.parentElement)}static updateScrollPosition(a,i,k){const W=Yn.getScrollElement(a);if(!W)return;const g=a.getBoundingClientRect(),m=W.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,h=g.bottom-Math.min(m.bottom,r),l=g.top-Math.max(m.top,0),t=W.scrollTop;l<0&&k<0?a.offsetHeight>m.height?W.scrollTop+=k:W.scrollTop+=Math.abs(l)>Math.abs(k)?k:l:h>0&&k>0&&(a.offsetHeight>m.height?W.scrollTop+=k:W.scrollTop+=h>k?k:h),i.top+=W.scrollTop-t}static updateScrollResize(a,i,k){const W=Yn.getScrollElement(i),g=W.clientHeight,m=W===Yn.getScrollElement()?0:W.getBoundingClientRect().top,r=a.clientY-m,h=r<k,l=r>g-k;h?W.scrollBy({behavior:"smooth",top:r-k}):l&&W.scrollBy({behavior:"smooth",top:k-(g-r)})}static clone(a){return a==null||typeof a!="object"?a:a instanceof Array?[...a]:{...a}}static cloneDeep(a){const i=["parentGrid","el","grid","subGrid","engine"],k=Yn.clone(a);for(const W in k)k.hasOwnProperty(W)&&typeof k[W]=="object"&&W.substring(0,2)!=="__"&&!i.find(g=>g===W)&&(k[W]=Yn.cloneDeep(a[W]));return k}static cloneNode(a){const i=a.cloneNode(!0);return i.removeAttribute("id"),i}static appendTo(a,i){let k;typeof i=="string"?k=Yn.getElement(i):k=i,k&&k.appendChild(a)}static addElStyles(a,i){if(i instanceof Object)for(const k in i)i.hasOwnProperty(k)&&(Array.isArray(i[k])?i[k].forEach(W=>{a.style[k]=W}):a.style[k]=i[k])}static initEvent(a,i){const k={type:i.type},W={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:i.target?i.target:a.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(g=>k[g]=a[g]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(g=>k[g]=a[g]),{...k,...W}}static simulateMouseEvent(a,i,k){const W=a,g=new MouseEvent(i,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:a.screenX,screenY:a.screenY,clientX:a.clientX,clientY:a.clientY,ctrlKey:W.ctrlKey??!1,altKey:W.altKey??!1,shiftKey:W.shiftKey??!1,metaKey:W.metaKey??!1,button:0,relatedTarget:a.target});(k||a.target).dispatchEvent(g)}static getValuesFromTransformedElement(a){const i=document.createElement("div");Yn.addElStyles(i,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),a.appendChild(i);const k=i.getBoundingClientRect();return a.removeChild(i),i.remove(),{xScale:1/k.width,yScale:1/k.height,xOffset:k.left,yOffset:k.top}}static swap(a,i,k){if(!a)return;const W=a[i];a[i]=a[k],a[k]=W}static canBeRotated(a){var i;return!(!a||a.w===a.h||a.locked||a.noResize||(i=a.grid)!=null&&i.opts.disableResize||a.minW&&a.minW===a.maxW||a.minH&&a.minH===a.maxH)}}class Mh{constructor(a={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=a.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=a.maxRow,this._float=a.float,this.nodes=a.nodes||[],this.onChange=a.onChange}batchUpdate(a=!0,i=!0){return!!this.batchMode===a?this:(this.batchMode=a,a?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,i&&this._packNodes(),this._notify()),this)}_useEntireRowArea(a,i){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!a._moving||a._skipDown||i.y<=a.y)}_fixCollisions(a,i=a,k,W={}){if(this.sortNodes(-1),k=k||this.collide(a,i),!k)return!1;if(a._moving&&!W.nested&&!this.float&&this.swap(a,k))return!0;let g=i;!this._loading&&this._useEntireRowArea(a,i)&&(g={x:0,w:this.column,y:i.y,h:i.h},k=this.collide(a,g,W.skip));let m=!1;const r={nested:!0,pack:!1};let h=0;for(;k=k||this.collide(a,g,W.skip);){if(h++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(k.locked||this._loading||a._moving&&!a._skipDown&&i.y>a.y&&!this.float&&(!this.collide(k,{...k,y:a.y},a)||!this.collide(k,{...k,y:i.y-k.h},a))){a._skipDown=a._skipDown||i.y>a.y;const t={...i,y:k.y+k.h,...r};l=this._loading&&Yn.samePos(a,t)?!0:this.moveNode(a,t),(k.locked||this._loading)&&l?Yn.copyPos(i,a):!k.locked&&l&&W.pack&&(this._packNodes(),i.y=k.y+k.h,Yn.copyPos(a,i)),m=m||l}else l=this.moveNode(k,{...k,y:i.y+i.h,skip:a,...r});if(!l)return m;k=void 0}return m}collide(a,i=a,k){const W=a._id,g=k==null?void 0:k._id;return this.nodes.find(m=>m._id!==W&&m._id!==g&&Yn.isIntercepted(m,i))}collideAll(a,i=a,k){const W=a._id,g=k==null?void 0:k._id;return this.nodes.filter(m=>m._id!==W&&m._id!==g&&Yn.isIntercepted(m,i))}directionCollideCoverage(a,i,k){if(!i.rect||!a._rect)return;const W=a._rect,g={...i.rect};g.y>W.y?(g.h+=g.y-W.y,g.y=W.y):g.h+=W.y-g.y,g.x>W.x?(g.w+=g.x-W.x,g.x=W.x):g.w+=W.x-g.x;let m,r=.5;for(let h of k){if(h.locked||!h._rect)break;const l=h._rect;let t=Number.MAX_VALUE,_=Number.MAX_VALUE;W.y<l.y?t=(g.y+g.h-l.y)/l.h:W.y+W.h>l.y+l.h&&(t=(l.y+l.h-g.y)/l.h),W.x<l.x?_=(g.x+g.w-l.x)/l.w:W.x+W.w>l.x+l.w&&(_=(l.x+l.w-g.x)/l.w);const w=Math.min(_,t);w>r&&(r=w,m=h)}return i.collide=m,m}cacheRects(a,i,k,W,g,m){return this.nodes.forEach(r=>r._rect={y:r.y*i+k,x:r.x*a+m,w:r.w*a-m-W,h:r.h*i-k-g}),this}swap(a,i){if(!i||i.locked||!a||a.locked)return!1;function k(){const g=i.x,m=i.y;return i.x=a.x,i.y=a.y,a.h!=i.h?(a.x=g,a.y=i.y+i.h):a.w!=i.w?(a.x=i.x+i.w,a.y=m):(a.x=g,a.y=m),a._dirty=i._dirty=!0,!0}let W;if(a.w===i.w&&a.h===i.h&&(a.x===i.x||a.y===i.y)&&(W=Yn.isTouching(a,i)))return k();if(W!==!1){if(a.w===i.w&&a.x===i.x&&(W||(W=Yn.isTouching(a,i)))){if(i.y<a.y){const g=a;a=i,i=g}return k()}if(W!==!1){if(a.h===i.h&&a.y===i.y&&(W||(W=Yn.isTouching(a,i)))){if(i.x<a.x){const g=a;a=i,i=g}return k()}return!1}}}isAreaEmpty(a,i,k,W){const g={x:a||0,y:i||0,w:k||1,h:W||1};return!this.collide(g)}compact(a="compact",i=!0){if(this.nodes.length===0)return this;i&&this.sortNodes();const k=this.batchMode;k||this.batchUpdate();const W=this._inColumnResize;W||(this._inColumnResize=!0);const g=this.nodes;return this.nodes=[],g.forEach((m,r,h)=>{let l;m.locked||(m.autoPosition=!0,a==="list"&&r&&(l=h[r-1])),this.addNode(m,!1,l)}),W||delete this._inColumnResize,k||this.batchUpdate(!1),this}set float(a){this._float!==a&&(this._float=a||!1,a||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(a=1){return this.nodes=Yn.sort(this.nodes,a),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(a=>{if(a._updating||a._orig===void 0||a.y===a._orig.y)return;let i=a.y;for(;i>a._orig.y;)--i,this.collide(a,{x:a.x,y:i,w:a.w,h:a.h})||(a._dirty=!0,a.y=i)}):this.nodes.forEach((a,i)=>{if(!a.locked)for(;a.y>0;){const k=i===0?0:a.y-1;if(!(i===0||!this.collide(a,{x:a.x,y:k,w:a.w,h:a.h})))break;a._dirty=a.y!==k,a.y=k}}),this)}prepareNode(a,i){a._id=a._id??Mh._idSeq++;const k=a.id;if(k){let g=1;for(;this.nodes.find(m=>m.id===a.id&&m!==a);)a.id=k+"_"+g++}(a.x===void 0||a.y===void 0||a.x===null||a.y===null)&&(a.autoPosition=!0);const W={x:0,y:0,w:1,h:1};return Yn.defaults(a,W),a.autoPosition||delete a.autoPosition,a.noResize||delete a.noResize,a.noMove||delete a.noMove,Yn.sanitizeMinMax(a),typeof a.x=="string"&&(a.x=Number(a.x)),typeof a.y=="string"&&(a.y=Number(a.y)),typeof a.w=="string"&&(a.w=Number(a.w)),typeof a.h=="string"&&(a.h=Number(a.h)),isNaN(a.x)&&(a.x=W.x,a.autoPosition=!0),isNaN(a.y)&&(a.y=W.y,a.autoPosition=!0),isNaN(a.w)&&(a.w=W.w),isNaN(a.h)&&(a.h=W.h),this.nodeBoundFix(a,i),a}nodeBoundFix(a,i){const k=a._orig||Yn.copyPos({},a);if(a.maxW&&(a.w=Math.min(a.w||1,a.maxW)),a.maxH&&(a.h=Math.min(a.h||1,a.maxH)),a.minW&&(a.w=Math.max(a.w||1,a.minW)),a.minH&&(a.h=Math.max(a.h||1,a.minH)),(a.x||0)+(a.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&a._id!=null&&this.findCacheLayout(a,this.defaultColumn)===-1){const W={...a};W.autoPosition||W.x===void 0?(delete W.x,delete W.y):W.x=Math.min(this.defaultColumn-1,W.x),W.w=Math.min(this.defaultColumn,W.w||1),this.cacheOneLayout(W,this.defaultColumn)}return a.w>this.column?a.w=this.column:a.w<1&&(a.w=1),this.maxRow&&a.h>this.maxRow?a.h=this.maxRow:a.h<1&&(a.h=1),a.x<0&&(a.x=0),a.y<0&&(a.y=0),a.x+a.w>this.column&&(i?a.w=this.column-a.x:a.x=this.column-a.w),this.maxRow&&a.y+a.h>this.maxRow&&(i?a.h=this.maxRow-a.y:a.y=this.maxRow-a.h),Yn.samePos(a,k)||(a._dirty=!0),this}getDirtyNodes(a){return a?this.nodes.filter(i=>i._dirty&&!Yn.samePos(i,i._orig)):this.nodes.filter(i=>i._dirty)}_notify(a){if(this.batchMode||!this.onChange)return this;const i=(a||[]).concat(this.getDirtyNodes());return this.onChange(i),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(a=>{delete a._dirty,delete a._lastTried}),this)}saveInitial(){return this.nodes.forEach(a=>{a._orig=Yn.copyPos({},a),delete a._dirty}),this._hasLocked=this.nodes.some(a=>a.locked),this}restoreInitial(){return this.nodes.forEach(a=>{!a._orig||Yn.samePos(a,a._orig)||(Yn.copyPos(a,a._orig),a._dirty=!0)}),this._notify(),this}findEmptyPosition(a,i=this.nodes,k=this.column,W){const g=W?W.y*k+(W.x+W.w):0;let m=!1;for(let r=g;!m;++r){const h=r%k,l=Math.floor(r/k);if(h+a.w>k)continue;const t={x:h,y:l,w:a.w,h:a.h};i.find(_=>Yn.isIntercepted(t,_))||((a.x!==h||a.y!==l)&&(a._dirty=!0),a.x=h,a.y=l,delete a.autoPosition,m=!0)}return m}addNode(a,i=!1,k){const W=this.nodes.find(m=>m._id===a._id);if(W)return W;this._inColumnResize?this.nodeBoundFix(a):this.prepareNode(a),delete a._temporaryRemoved,delete a._removeDOM;let g;return a.autoPosition&&this.findEmptyPosition(a,this.nodes,this.column,k)&&(delete a.autoPosition,g=!0),this.nodes.push(a),i&&this.addedNodes.push(a),g||this._fixCollisions(a),this.batchMode||this._packNodes()._notify(),a}removeNode(a,i=!0,k=!1){return this.nodes.find(W=>W._id===a._id)?(k&&this.removedNodes.push(a),i&&(a._removeDOM=!0),this.nodes=this.nodes.filter(W=>W._id!==a._id),a._isAboutToRemove||this._packNodes(),this._notify([a]),this):this}removeAll(a=!0,i=!0){if(delete this._layouts,!this.nodes.length)return this;a&&this.nodes.forEach(W=>W._removeDOM=!0);const k=this.nodes;return this.removedNodes=i?k:[],this.nodes=[],this._notify(k)}moveNodeCheck(a,i){if(!this.changedPosConstrain(a,i))return!1;if(i.pack=!0,!this.maxRow)return this.moveNode(a,i);let k;const W=new Mh({column:this.column,float:this.float,nodes:this.nodes.map(m=>m._id===a._id?(k={...m},k):{...m})});if(!k)return!1;const g=W.moveNode(k,i)&&W.getRow()<=Math.max(this.getRow(),this.maxRow);if(!g&&!i.resizing&&i.collide){const m=i.collide.el.gridstackNode;if(this.swap(a,m))return this._notify(),!0}return g?(W.nodes.filter(m=>m._dirty).forEach(m=>{const r=this.nodes.find(h=>h._id===m._id);r&&(Yn.copyPos(r,m),r._dirty=!0)}),this._notify(),!0):!1}willItFit(a){if(delete a._willFitPos,!this.maxRow)return!0;const i=new Mh({column:this.column,float:this.float,nodes:this.nodes.map(W=>({...W}))}),k={...a};return this.cleanupNode(k),delete k.el,delete k._id,delete k.content,delete k.grid,i.addNode(k),i.getRow()<=this.maxRow?(a._willFitPos=Yn.copyPos({},k),!0):!1}changedPosConstrain(a,i){return i.w=i.w||a.w,i.h=i.h||a.h,a.x!==i.x||a.y!==i.y?!0:(a.maxW&&(i.w=Math.min(i.w,a.maxW)),a.maxH&&(i.h=Math.min(i.h,a.maxH)),a.minW&&(i.w=Math.max(i.w,a.minW)),a.minH&&(i.h=Math.max(i.h,a.minH)),a.w!==i.w||a.h!==i.h)}moveNode(a,i){var k,W;if(!a||!i)return!1;let g;i.pack===void 0&&!this.batchMode&&(g=i.pack=!0),typeof i.x!="number"&&(i.x=a.x),typeof i.y!="number"&&(i.y=a.y),typeof i.w!="number"&&(i.w=a.w),typeof i.h!="number"&&(i.h=a.h);const m=a.w!==i.w||a.h!==i.h,r=Yn.copyPos({},a,!0);if(Yn.copyPos(r,i),this.nodeBoundFix(r,m),Yn.copyPos(i,r),!i.forceCollide&&Yn.samePos(a,i))return!1;const h=Yn.copyPos({},a),l=this.collideAll(a,r,i.skip);let t=!0;if(l.length){const _=a._moving&&!i.nested;let w=_?this.directionCollideCoverage(a,i,l):l[0];if(_&&w&&(W=(k=a.grid)==null?void 0:k.opts)!=null&&W.subGridDynamic&&!a.grid._isTemp){const v=Yn.areaIntercept(i.rect,w._rect),f=Yn.area(i.rect),o=Yn.area(w._rect);v/(f<o?f:o)>.8&&(w.grid.makeSubGrid(w.el,void 0,a),w=void 0)}w?t=!this._fixCollisions(a,r,w,i):(t=!1,g&&delete i.pack)}return t&&!Yn.samePos(a,r)&&(a._dirty=!0,Yn.copyPos(a,r)),i.pack&&this._packNodes()._notify(),!Yn.samePos(a,h)}getRow(){return this.nodes.reduce((a,i)=>Math.max(a,i.y+i.h),0)}beginUpdate(a){return a._updating||(a._updating=!0,delete a._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const a=this.nodes.find(i=>i._updating);return a&&(delete a._updating,delete a._skipDown),this}save(a=!0,i,k){var W;const g=((W=this._layouts)==null?void 0:W.length)||0;let m;g&&(k?k!==this.column&&(m=this._layouts[k]):this.column!==g-1&&(m=this._layouts[g-1]));const r=[];return this.sortNodes(),this.nodes.forEach(h=>{const l=m==null?void 0:m.find(_=>_._id===h._id),t={...h,...l||{}};Yn.removeInternalForSave(t,!a),i&&i(h,t),r.push(t)}),r}layoutsNodesChange(a){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((i,k)=>{if(!i||k===this.column)return this;if(k<this.column)this._layouts[k]=void 0;else{const W=k/this.column;a.forEach(g=>{if(!g._orig)return;const m=i.find(r=>r._id===g._id);m&&(m.y>=0&&g.y!==g._orig.y&&(m.y+=g.y-g._orig.y),g.x!==g._orig.x&&(m.x=Math.round(g.x*W)),g.w!==g._orig.w&&(m.w=Math.round(g.w*W)))})}}),this)}columnChanged(a,i,k="moveScale"){var W;if(!this.nodes.length||!i||a===i)return this;const g=k==="compact"||k==="list";g&&this.sortNodes(1),i<a&&this.cacheLayout(this.nodes,a),this.batchUpdate();let m=[],r=g?this.nodes:Yn.sort(this.nodes,-1);if(i>a&&this._layouts){const h=this._layouts[i]||[],l=this._layouts.length-1;!h.length&&a!==l&&(W=this._layouts[l])!=null&&W.length&&(a=l,this._layouts[l].forEach(t=>{const _=r.find(w=>w._id===t._id);_&&(!g&&!t.autoPosition&&(_.x=t.x??_.x,_.y=t.y??_.y),_.w=t.w??_.w,(t.x==null||t.y===void 0)&&(_.autoPosition=!0))})),h.forEach(t=>{const _=r.findIndex(w=>w._id===t._id);if(_!==-1){const w=r[_];if(g){w.w=t.w;return}(t.autoPosition||isNaN(t.x)||isNaN(t.y))&&this.findEmptyPosition(t,m),t.autoPosition||(w.x=t.x??w.x,w.y=t.y??w.y,w.w=t.w??w.w,m.push(w)),r.splice(_,1)}})}if(g)this.compact(k,!1);else{if(r.length)if(typeof k=="function")k(i,a,m,r);else{const h=g||k==="none"?1:i/a,l=k==="move"||k==="moveScale",t=k==="scale"||k==="moveScale";r.forEach(_=>{_.x=i===1?0:l?Math.round(_.x*h):Math.min(_.x,i-1),_.w=i===1||a===1?1:t?Math.round(_.w*h)||1:Math.min(_.w,i),m.push(_)}),r=[]}m=Yn.sort(m,-1),this._inColumnResize=!0,this.nodes=[],m.forEach(h=>{this.addNode(h,!1),delete h._orig})}return this.nodes.forEach(h=>delete h._orig),this.batchUpdate(!1,!g),delete this._inColumnResize,this}cacheLayout(a,i,k=!1){const W=[];return a.forEach((g,m)=>{if(g._id===void 0){const r=g.id?this.nodes.find(h=>h.id===g.id):void 0;g._id=(r==null?void 0:r._id)??Mh._idSeq++}W[m]={x:g.x,y:g.y,w:g.w,_id:g._id}}),this._layouts=k?[]:this._layouts||[],this._layouts[i]=W,this}cacheOneLayout(a,i){a._id=a._id??Mh._idSeq++;const k={x:a.x,y:a.y,w:a.w,_id:a._id};(a.autoPosition||a.x===void 0)&&(delete k.x,delete k.y,a.autoPosition&&(k.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[i]=this._layouts[i]||[];const W=this.findCacheLayout(a,i);return W===-1?this._layouts[i].push(k):this._layouts[i][W]=k,this}findCacheLayout(a,i){var k,W;return((W=(k=this._layouts)==null?void 0:k[i])==null?void 0:W.findIndex(g=>g._id===a._id))??-1}removeNodeFromLayoutCache(a){if(this._layouts)for(let i=0;i<this._layouts.length;i++){const k=this.findCacheLayout(a,i);k!==-1&&this._layouts[i].splice(k,1)}}cleanupNode(a){for(const i in a)i[0]==="_"&&i!=="_id"&&delete a[i];return this}}Mh._idSeq=0;const Id={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Ei{}const Kp=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class bh{}function u2(e,a){e.touches.length>1||(e.cancelable&&e.preventDefault(),Yn.simulateMouseEvent(e.changedTouches[0],a))}function qL(e,a){e.cancelable&&e.preventDefault(),Yn.simulateMouseEvent(e,a)}function d2(e){bh.touchHandled||(bh.touchHandled=!0,u2(e,"mousedown"))}function p2(e){bh.touchHandled&&u2(e,"mousemove")}function h2(e){if(!bh.touchHandled)return;bh.pointerLeaveTimeout&&(window.clearTimeout(bh.pointerLeaveTimeout),delete bh.pointerLeaveTimeout);const a=!!Ei.dragElement;u2(e,"mouseup"),a||u2(e,"click"),bh.touchHandled=!1}function f2(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function UL(e){Ei.dragElement&&e.pointerType!=="mouse"&&qL(e,"mouseenter")}function zL(e){Ei.dragElement&&e.pointerType!=="mouse"&&(bh.pointerLeaveTimeout=window.setTimeout(()=>{delete bh.pointerLeaveTimeout,qL(e,"mouseleave")},10))}class m2{constructor(a,i,k){this.host=a,this.dir=i,this.option=k,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const a=this.el=document.createElement("div");return a.classList.add("ui-resizable-handle"),a.classList.add(`${m2.prefix}${this.dir}`),a.style.zIndex="100",a.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Kp&&(this.el.addEventListener("touchstart",d2),this.el.addEventListener("pointerdown",f2)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Kp&&(this.el.removeEventListener("touchstart",d2),this.el.removeEventListener("pointerdown",f2)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(a){this.mouseDownEvent=a,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Kp&&(this.el.addEventListener("touchmove",p2),this.el.addEventListener("touchend",h2)),a.stopPropagation(),a.preventDefault()}_mouseMove(a){const i=this.mouseDownEvent;this.moving?this._triggerEvent("move",a):Math.abs(a.x-i.x)+Math.abs(a.y-i.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",a),document.addEventListener("keydown",this._keyEvent)),a.stopPropagation()}_mouseUp(a){this.moving&&(this._triggerEvent("stop",a),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Kp&&(this.el.removeEventListener("touchmove",p2),this.el.removeEventListener("touchend",h2)),delete this.moving,delete this.mouseDownEvent,a.stopPropagation(),a.preventDefault()}_keyEvent(a){var i,k;a.key==="Escape"&&((k=(i=this.host.gridstackNode)==null?void 0:i.grid)==null||k.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(a,i){return this.option[a]&&this.option[a](i),this}}m2.prefix="ui-resizable-";class w5{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(a,i){this._eventRegister[a]=i}off(a){delete this._eventRegister[a]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(a,i){if(!this.disabled&&this._eventRegister&&this._eventRegister[a])return this._eventRegister[a](i)}}class K1 extends w5{constructor(a,i={}){super(),this.el=a,this.option=i,this.rectScale={x:1,y:1},this._ui=()=>{const k=this.el.parentElement.getBoundingClientRect(),W={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=this.temporalRect||W;return{position:{left:(g.left-k.left)*this.rectScale.x,top:(g.top-k.top)*this.rectScale.y},size:{width:g.width*this.rectScale.x,height:g.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(a){const i=a.handles&&a.handles!==this.option.handles,k=a.autoHide&&a.autoHide!==this.option.autoHide;return Object.keys(a).forEach(W=>this.option[W]=a[W]),i&&(this._removeHandlers(),this._setupHandlers()),k&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(a){return a?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Ei.overResizeElement===this&&delete Ei.overResizeElement),this}_mouseOver(a){Ei.overResizeElement||Ei.dragElement||(Ei.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(a){Ei.overResizeElement===this&&(delete Ei.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(a=>a.trim()).map(a=>new m2(this.el,a,{start:i=>{this._resizeStart(i)},stop:i=>{this._resizeStop(i)},move:i=>{this._resizing(i,a)}})),this}_resizeStart(a){this.sizeToContent=Yn.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=Yn.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=a,this._setupHelper(),this._applyChange();const i=Yn.initEvent(a,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(i,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",i),this}_resizing(a,i){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(a,i),this._applyChange();const k=Yn.initEvent(a,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(k,this._ui()),this.triggerEvent("resize",k),this}_resizeStop(a){const i=Yn.initEvent(a,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(i),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",i),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=K1._originStyleProp.map(k=>this.el.style[k]),this.parentOriginStylePosition=this.el.parentElement.style.position;const a=this.el.parentElement,i=Yn.getValuesFromTransformedElement(a);return this.rectScale={x:i.xScale,y:i.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return K1._originStyleProp.forEach((a,i)=>{this.el.style[a]=this.elOriginStyleVal[i]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(a,i){const k=this.startEvent,W={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=a.clientX-k.clientX,m=this.sizeToContent?0:a.clientY-k.clientY;let r,h;i.indexOf("e")>-1?W.width+=g:i.indexOf("w")>-1&&(W.width-=g,W.left+=g,r=!0),i.indexOf("s")>-1?W.height+=m:i.indexOf("n")>-1&&(W.height-=m,W.top+=m,h=!0);const l=this._constrainSize(W.width,W.height,r,h);return Math.round(W.width)!==Math.round(l.width)&&(i.indexOf("w")>-1&&(W.left+=W.width-l.width),W.width=l.width),Math.round(W.height)!==Math.round(l.height)&&(i.indexOf("n")>-1&&(W.top+=W.height-l.height),W.height=l.height),W}_constrainSize(a,i,k,W){const g=this.option,m=(k?g.maxWidthMoveLeft:g.maxWidth)||Number.MAX_SAFE_INTEGER,r=g.minWidth/this.rectScale.x||a,h=(W?g.maxHeightMoveUp:g.maxHeight)||Number.MAX_SAFE_INTEGER,l=g.minHeight/this.rectScale.y||i,t=Math.min(m,Math.max(r,a)),_=Math.min(h,Math.max(l,i));return{width:t,height:_}}_applyChange(){let a={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const i=this.el.parentElement,{left:k,top:W}=i.getBoundingClientRect();a={left:k,top:W,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(i=>{const k=this.temporalRect[i],W=i==="width"||i==="left"?this.rectScale.x:i==="height"||i==="top"?this.rectScale.y:1;this.el.style[i]=(k-a[i])*W+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(a=>a.destroy()),delete this.handlers,this}}K1._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const F5e='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class A1 extends w5{constructor(a,i={}){var k;super(),this.el=a,this.option=i,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const W=(k=i==null?void 0:i.handle)==null?void 0:k.substring(1),g=a.gridstackNode;this.dragEls=!W||a.classList.contains(W)?[a]:g!=null&&g.subGrid?[a.querySelector(i.handle)||a]:Array.from(a.querySelectorAll(i.handle)),this.dragEls.length===0&&(this.dragEls=[a]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(a=>{a.addEventListener("mousedown",this._mouseDown),Kp&&(a.addEventListener("touchstart",d2),a.addEventListener("pointerdown",f2))}),this.el.classList.remove("ui-draggable-disabled"))}disable(a=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(i=>{i.removeEventListener("mousedown",this._mouseDown),Kp&&(i.removeEventListener("touchstart",d2),i.removeEventListener("pointerdown",f2))}),a||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(a){return Object.keys(a).forEach(i=>this.option[i]=a[i]),this}_mouseDown(a){if(!Ei.mouseHandled)return a.button!==0||!this.dragEls.find(i=>i===a.target)&&a.target.closest(F5e)||this.option.cancel&&a.target.closest(this.option.cancel)||(this.mouseDownEvent=a,delete this.dragging,delete Ei.dragElement,delete Ei.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Kp&&(a.currentTarget.addEventListener("touchmove",p2),a.currentTarget.addEventListener("touchend",h2)),a.preventDefault(),document.activeElement&&document.activeElement.blur(),Ei.mouseHandled=!0),!0}_callDrag(a){if(!this.dragging)return;const i=Yn.initEvent(a,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(i,this.ui()),this.triggerEvent("drag",i)}_mouseMove(a){var i;const k=this.mouseDownEvent;if(this.lastDrag=a,this.dragging)if(this._dragFollow(a),Ei.pauseDrag){const W=Number.isInteger(Ei.pauseDrag)?Ei.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(a),W)}else this._callDrag(a);else if(Math.abs(a.x-k.x)+Math.abs(a.y-k.y)>3){this.dragging=!0,Ei.dragElement=this;const W=(i=this.el.gridstackNode)==null?void 0:i.grid;W?Ei.dropElement=W.el.ddElement.ddDroppable:delete Ei.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=Yn.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(a,this.el,this.helperContainment),this._setupHelperStyle(a);const g=Yn.initEvent(a,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(g,this.ui()),this.triggerEvent("dragstart",g),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(a){var i,k;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Kp&&a.currentTarget&&(a.currentTarget.removeEventListener("touchmove",p2,!0),a.currentTarget.removeEventListener("touchend",h2,!0)),this.dragging){delete this.dragging,(i=this.el.gridstackNode)==null||delete i._origRotate,document.removeEventListener("keydown",this._keyEvent),((k=Ei.dropElement)==null?void 0:k.el)===this.el.parentElement&&delete Ei.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const W=Yn.initEvent(a,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(W),this.triggerEvent("dragstop",W),Ei.dropElement&&Ei.dropElement.drop(a)}delete this.helper,delete this.mouseDownEvent,delete Ei.dragElement,delete Ei.dropElement,delete Ei.mouseHandled,a.preventDefault()}_keyEvent(a){var i,k;const W=this.el.gridstackNode,g=(W==null?void 0:W.grid)||((k=(i=Ei.dropElement)==null?void 0:i.el)==null?void 0:k.gridstack);if(a.key==="Escape")W&&W._origRotate&&(W._orig=W._origRotate,delete W._origRotate),g==null||g.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(W&&g&&(a.key==="r"||a.key==="R")){if(!Yn.canBeRotated(W))return;W._origRotate=W._origRotate||{...W._orig},delete W._moving,g.setAnimation(!1).rotate(W.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),W._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,W.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",Yn.swap(W._orig,"w","h"),delete W._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let a=this.el;return typeof this.option.helper=="function"?a=this.option.helper(this.el):this.option.helper==="clone"&&(a=Yn.cloneNode(this.el)),a.parentElement||Yn.appendTo(a,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=A1.originStyleProp.map(i=>this.el.style[i]),a}_setupHelperStyle(a){var i,k;this.helper.classList.add("ui-draggable-dragging"),(k=(i=this.el.gridstackNode)==null?void 0:i.grid)==null||k.el.classList.add("grid-stack-dragging");const W=this.helper.style;return W.pointerEvents="none",W.width=this.dragOffset.width+"px",W.height=this.dragOffset.height+"px",W.willChange="left, top",W.position="fixed",this._dragFollow(a),W.transition="none",setTimeout(()=>{this.helper&&(W.transition=null)},0),this}_removeHelperStyle(){var a,i,k;this.helper.classList.remove("ui-draggable-dragging"),(i=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||i.el.classList.remove("grid-stack-dragging");const W=(k=this.helper)==null?void 0:k.gridstackNode;if(!(W!=null&&W._isAboutToRemove)&&this.dragElementOriginStyle){const g=this.helper,m=this.dragElementOriginStyle.transition||null;g.style.transition=this.dragElementOriginStyle.transition="none",A1.originStyleProp.forEach(r=>g.style[r]=this.dragElementOriginStyle[r]||null),setTimeout(()=>g.style.transition=m,50)}return delete this.dragElementOriginStyle,this}_dragFollow(a){const i={left:0,top:0},k=this.helper.style,W=this.dragOffset;k.left=(a.clientX+W.offsetLeft-i.left)*this.dragTransform.xScale+"px",k.top=(a.clientY+W.offsetTop-i.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(a,i,k){let W=0,g=0;k&&(W=this.dragTransform.xOffset,g=this.dragTransform.yOffset);const m=i.getBoundingClientRect();return{left:m.left,top:m.top,offsetLeft:-a.clientX+m.left-W,offsetTop:-a.clientY+m.top-g,width:m.width*this.dragTransform.xScale,height:m.height*this.dragTransform.yScale}}ui(){const a=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-a.top)*this.dragTransform.yScale,left:(i.left-a.left)*this.dragTransform.xScale}}}}A1.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class E5e extends w5{constructor(a,i={}){super(),this.el=a,this.option=i,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Kp&&(this.el.addEventListener("pointerenter",UL),this.el.addEventListener("pointerleave",zL)))}disable(a=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),a||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Kp&&(this.el.removeEventListener("pointerenter",UL),this.el.removeEventListener("pointerleave",zL)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(a){return Object.keys(a).forEach(i=>this.option[i]=a[i]),this._setupAccept(),this}_mouseEnter(a){if(!Ei.dragElement||!this._canDrop(Ei.dragElement.el))return;a.preventDefault(),a.stopPropagation(),Ei.dropElement&&Ei.dropElement!==this&&Ei.dropElement._mouseLeave(a,!0),Ei.dropElement=this;const i=Yn.initEvent(a,{target:this.el,type:"dropover"});this.option.over&&this.option.over(i,this._ui(Ei.dragElement)),this.triggerEvent("dropover",i),this.el.classList.add("ui-droppable-over")}_mouseLeave(a,i=!1){var k;if(!Ei.dragElement||Ei.dropElement!==this)return;a.preventDefault(),a.stopPropagation();const W=Yn.initEvent(a,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(W,this._ui(Ei.dragElement)),this.triggerEvent("dropout",W),Ei.dropElement===this&&(delete Ei.dropElement,!i)){let g,m=this.el.parentElement;for(;!g&&m;)g=(k=m.ddElement)==null?void 0:k.ddDroppable,m=m.parentElement;g&&g._mouseEnter(a)}}drop(a){a.preventDefault();const i=Yn.initEvent(a,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(i,this._ui(Ei.dragElement)),this.triggerEvent("drop",i)}_canDrop(a){return a&&(!this.accept||this.accept(a))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=a=>a.classList.contains(this.option.accept)||a.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(a){return{draggable:a.el,...a.ui()}}}class _5{static init(a){return a.ddElement||(a.ddElement=new _5(a)),a.ddElement}constructor(a){this.el=a}on(a,i){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.on(a,i):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.on(a,i):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.on(a,i),this}off(a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.off(a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.off(a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.off(a),this}setupDraggable(a){return this.ddDraggable?this.ddDraggable.updateOption(a):this.ddDraggable=new A1(this.el,a),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(a){return this.ddResizable?this.ddResizable.updateOption(a):this.ddResizable=new K1(this.el,a),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(a){return this.ddDroppable?this.ddDroppable.updateOption(a):this.ddDroppable=new E5e(this.el,a),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class R5e{resizable(a,i,k,W){return this._getDDElements(a,i).forEach(g=>{if(i==="disable"||i==="enable")g.ddResizable&&g.ddResizable[i]();else if(i==="destroy")g.ddResizable&&g.cleanResizable();else if(i==="option")g.setupResizable({[k]:W});else{const m=g.el.gridstackNode.grid;let r=g.el.getAttribute("gs-resize-handles")||m.opts.resizable.handles||"e,s,se";r==="all"&&(r="n,e,s,w,se,sw,ne,nw");const h=!m.opts.alwaysShowResizeHandle;g.setupResizable({...m.opts.resizable,handles:r,autoHide:h,start:i.start,stop:i.stop,resize:i.resize})}}),this}draggable(a,i,k,W){return this._getDDElements(a,i).forEach(g=>{if(i==="disable"||i==="enable")g.ddDraggable&&g.ddDraggable[i]();else if(i==="destroy")g.ddDraggable&&g.cleanDraggable();else if(i==="option")g.setupDraggable({[k]:W});else{const m=g.el.gridstackNode.grid;g.setupDraggable({...m.opts.draggable,start:i.start,stop:i.stop,drag:i.drag})}}),this}dragIn(a,i){return this._getDDElements(a).forEach(k=>k.setupDraggable(i)),this}droppable(a,i,k,W){return typeof i.accept=="function"&&!i._accept&&(i._accept=i.accept,i.accept=g=>i._accept(g)),this._getDDElements(a,i).forEach(g=>{i==="disable"||i==="enable"?g.ddDroppable&&g.ddDroppable[i]():i==="destroy"?g.ddDroppable&&g.cleanDroppable():i==="option"?g.setupDroppable({[k]:W}):g.setupDroppable(i)}),this}isDroppable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddDroppable&&!a.ddElement.ddDroppable.disabled)}isDraggable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddDraggable&&!a.ddElement.ddDraggable.disabled)}isResizable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddResizable&&!a.ddElement.ddResizable.disabled)}on(a,i,k){return this._getDDElements(a).forEach(W=>W.on(i,g=>{k(g,Ei.dragElement?Ei.dragElement.el:g.target,Ei.dragElement?Ei.dragElement.helper:null)})),this}off(a,i){return this._getDDElements(a).forEach(k=>k.off(i)),this}_getDDElements(a,i){const k=a.gridstack||i!=="destroy"&&i!=="disable",W=Yn.getElements(a);return W.length?W.map(g=>g.ddElement||(k?_5.init(g):null)).filter(g=>g):[]}}/*!
|
|
4119
4119
|
* GridStack 12.3.2
|
|
4120
4120
|
* https://gridstackjs.com/
|
|
4121
4121
|
*
|
|
@@ -4123,7 +4123,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
4123
4123
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
4124
4124
|
*/const nd=new R5e;class vi{static init(a={},i=".grid-stack"){if(typeof document>"u")return null;const k=vi.getGridElement(i);return k?(k.gridstack||(k.gridstack=new vi(k,Yn.cloneDeep(a))),k.gridstack):(console.error(typeof i=="string"?'GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
|
|
4125
4125
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(a={},i=".grid-stack"){const k=[];return typeof document>"u"||(vi.getGridElements(i).forEach(W=>{W.gridstack||(W.gridstack=new vi(W,Yn.cloneDeep(a))),k.push(W.gridstack)}),k.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
|
|
4126
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),k}static addGrid(a,i={}){if(!a)return null;let k=a;if(k.gridstack){const W=k.gridstack;return i&&(W.opts={...W.opts,...i}),i.children!==void 0&&W.load(i.children),W}return(!a.classList.contains("grid-stack")||vi.addRemoveCB)&&(vi.addRemoveCB?k=vi.addRemoveCB(a,i,!0,!0):k=Yn.createDiv(["grid-stack",i.class],a)),vi.init(i,k)}static registerEngine(a){vi.engineClass=a}get placeholder(){if(!this._placeholder){this._placeholder=Yn.createDiv([this.opts.placeholderClass,Id.itemClass,this.opts.itemClass]);const a=Yn.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(a.textContent=this.opts.placeholderText)}return this._placeholder}constructor(a,i={}){var k;this.el=a,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},a.gridstack=this,this.opts=i=i||{},a.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);const W=Yn.toNumber(a.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);const g=i.columnOpts;if(g){const t=g.breakpoints;!g.columnWidth&&!(t!=null&&t.length)?delete i.columnOpts:(g.columnMax=g.columnMax||12,(t==null?void 0:t.length)>1&&t.sort((_,w)=>(w.w||0)-(_.w||0)))}const m={...Yn.cloneDeep(Id),column:Yn.toNumber(a.getAttribute("gs-column"))||Id.column,minRow:W||Yn.toNumber(a.getAttribute("gs-min-row"))||Id.minRow,maxRow:W||Yn.toNumber(a.getAttribute("gs-max-row"))||Id.maxRow,staticGrid:Yn.toBool(a.getAttribute("gs-static"))||Id.staticGrid,sizeToContent:Yn.toBool(a.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||Id.draggable.handle},removableOptions:{accept:i.itemClass||Id.removableOptions.accept,decline:Id.removableOptions.decline}};a.getAttribute("gs-animate")&&(m.animate=Yn.toBool(a.getAttribute("gs-animate"))),i=Yn.defaults(i,m),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=a.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");const r=this.el.closest("."+Id.itemClass),h=r==null?void 0:r.gridstackNode;if(h&&(h.subGrid=this,this.parentGridNode=h,this.el.classList.add("grid-stack-nested"),h.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==Id.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);const t=i.cellHeight;delete i.cellHeight,this.cellHeight(t)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=Kp),this._setStaticClass();const l=i.engineClass||vi.engineClass||Mh;if(this.engine=new l({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:t=>{t.forEach(_=>{const w=_.el;w&&(_._removeDOM?(w&&w.remove(),delete _._removeDOM):this._writePosAttr(w,_))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(t=>this._prepareElement(t)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const t=i.children;delete i.children,t.length&&this.load(t)}this.setAnimation(),i.subGridDynamic&&!Ei.pauseDrag&&(Ei.pauseDrag=!0),((k=i.draggable)==null?void 0:k.pause)!==void 0&&(Ei.pauseDrag=i.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(a=this.opts){this.el.classList.add("gs-"+a.column),typeof a.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/a.column}%`)}addWidget(a){if(!a)return;if(typeof a=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(a.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(a);let i,k=a;if(k.grid=this,k.el?i=k.el:vi.addRemoveCB?i=vi.addRemoveCB(this.el,a,!0,!1):i=this.createWidgetDivs(k),!i)return;if(k=i.gridstackNode,k&&i.parentElement===this.el&&this.engine.nodes.find(g=>g._id===k._id))return i;const W=this._readAttr(i);return Yn.defaults(a,W),this.engine.prepareNode(a),this.el.appendChild(i),this.makeWidget(i,a),i}createWidgetDivs(a){const i=Yn.createDiv(["grid-stack-item",this.opts.itemClass]),k=Yn.createDiv(["grid-stack-item-content"],i);return Yn.lazyLoad(a)?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([W])=>{var g,m;W.isIntersecting&&((g=a.visibleObservable)==null||g.disconnect(),delete a.visibleObservable,vi.renderCB(k,a),(m=a.grid)==null||m.prepareDragDrop(a.el))}),window.setTimeout(()=>{var W;return(W=a.visibleObservable)==null?void 0:W.observe(i)})):vi.renderCB(k,a),i}makeSubGrid(a,i,k,W=!0){var g,m,r;let h=a.gridstackNode;if(h||(h=this.makeWidget(a).gridstackNode),(g=h.subGrid)!=null&&g.el)return h.subGrid;let l,t=this;for(;t&&!l;)l=(m=t.opts)==null?void 0:m.subGridOpts,t=(r=t.parentGridNode)==null?void 0:r.grid;i=Yn.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...i||h.subGridOpts||{}}),h.subGridOpts=i;let _;i.column==="auto"&&(_=!0,i.column=Math.max(h.w||1,(k==null?void 0:k.w)||1),delete i.columnOpts);let w=h.el.querySelector(".grid-stack-item-content"),v,f;if(W&&(this._removeDD(h.el),f={...h,x:0,y:0},Yn.removeInternalForSave(f),delete f.subGridOpts,h.content&&(f.content=h.content,delete h.content),vi.addRemoveCB?v=vi.addRemoveCB(this.el,f,!0,!1):(v=Yn.createDiv(["grid-stack-item"]),v.appendChild(w),w=Yn.createDiv(["grid-stack-item-content"],h.el)),this.prepareDragDrop(h.el)),k){const s=_?i.column:h.w,p=h.h+k.h,c=h.el.style;c.transition="none",this.update(h.el,{w:s,h:p}),setTimeout(()=>c.transition=null)}const o=h.subGrid=vi.addGrid(w,i);return k!=null&&k._moving&&(o._isTemp=!0),_&&(o._autoColumn=!0),W&&o.makeWidget(v,f),k&&(k._moving?window.setTimeout(()=>Yn.simulateMouseEvent(k._event,"mouseenter",o.el),0):o.makeWidget(h.el,h)),this.resizeToContentCheck(!1,h),o}removeAsSubGrid(a){var i;const k=(i=this.parentGridNode)==null?void 0:i.grid;k&&(k.batchUpdate(),k.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(W=>{W.x+=this.parentGridNode.x,W.y+=this.parentGridNode.y,k.makeWidget(W.el,W)}),k.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,a&&window.setTimeout(()=>Yn.simulateMouseEvent(a._event,"mouseenter",k.el),0))}save(a=!0,i=!1,k=vi.saveCB,W){const g=this.engine.save(a,k,W);if(g.forEach(m=>{var r;if(a&&m.el&&!m.subGrid&&!k){const h=m.el.querySelector(".grid-stack-item-content");m.content=h==null?void 0:h.innerHTML,m.content||delete m.content}else if(!a&&!k&&delete m.content,(r=m.subGrid)!=null&&r.el){const h=m.w||m.subGrid.getColumn(),l=m.subGrid.save(a,i,k,h);m.subGridOpts=i?l:{children:l},delete m.subGrid}delete m.el}),i){const m=Yn.cloneDeep(this.opts);m.marginBottom===m.marginTop&&m.marginRight===m.marginLeft&&m.marginTop===m.marginRight&&(m.margin=m.marginTop,delete m.marginTop,delete m.marginRight,delete m.marginBottom,delete m.marginLeft),m.rtl===(this.el.style.direction==="rtl")&&(m.rtl="auto"),this._isAutoCellHeight&&(m.cellHeight="auto"),this._autoColumn&&(m.column="auto");const r=m._alwaysShowResizeHandle;return delete m._alwaysShowResizeHandle,r!==void 0?m.alwaysShowResizeHandle=r:delete m.alwaysShowResizeHandle,Yn.removeInternalAndSame(m,Id),m.children=g,m}return g}load(a,i=vi.addRemoveCB||!0){a=Yn.cloneDeep(a);const k=this.getColumn();a.forEach(t=>{t.w=t.w||t.minW||1,t.h=t.h||t.minH||1}),a=Yn.sort(a),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let W=0;a.forEach(t=>{W=Math.max(W,(t.x||0)+t.w)}),W>this.engine.defaultColumn&&(this.engine.defaultColumn=W),W>k&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=a,this.engine.columnChanged(W,k,this.responseLayout),a=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(a,W,!0));const g=vi.addRemoveCB;typeof i=="function"&&(vi.addRemoveCB=i);const m=[];this.batchUpdate();const r=!this.engine.nodes.length,h=r&&this.opts.animate;h&&this.setAnimation(!1),!r&&i&&[...this.engine.nodes].forEach(t=>{t.id&&(Yn.find(a,t.id)||(vi.addRemoveCB&&vi.addRemoveCB(this.el,t,!1,!1),m.push(t),this.removeWidget(t.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(t=>Yn.find(a,t.id)?(l.push(t),!1):!0),a.forEach(t=>{var _;const w=Yn.find(l,t.id);if(w){if(Yn.shouldSizeToContent(w)&&(t.h=w.h),this.engine.nodeBoundFix(t),(t.autoPosition||t.x===void 0||t.y===void 0)&&(t.w=t.w||w.w,t.h=t.h||w.h,this.engine.findEmptyPosition(t)),this.engine.nodes.push(w),Yn.samePos(w,t)&&this.engine.nodes.length>1&&(this.moveNode(w,{...t,forceCollide:!0}),Yn.copyPos(t,w)),this.update(w.el,t),(_=t.subGridOpts)!=null&&_.children){const v=w.el.querySelector(".grid-stack");v&&v.gridstack&&v.gridstack.load(t.subGridOpts.children)}}else i&&this.addWidget(t)}),delete this.engine._loading,this.engine.removedNodes=m,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,g?vi.addRemoveCB=g:delete vi.addRemoveCB,h&&this.setAnimation(!0,!0),this}batchUpdate(a=!0){return this.engine.batchUpdate(a),a||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(a=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!a||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const i=this.el.querySelector("."+this.opts.itemClass);if(i){const W=Yn.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/W)}const k=parseInt(this.el.getAttribute("gs-current-row"));return k?Math.round(this.el.getBoundingClientRect().height/k):this.opts.cellHeight}cellHeight(a){if(a!==void 0&&this._isAutoCellHeight!==(a==="auto")&&(this._isAutoCellHeight=a==="auto",this._updateResizeEvent()),(a==="initial"||a==="auto")&&(a=void 0),a===void 0){const k=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;a=this.cellWidth()+k}const i=Yn.parseHeight(a);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(a=!1){var i;return a&&(i=this.opts.columnOpts)!=null&&i.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var a,i;const k=this.opts.columnOpts;if(!k||!k.columnWidth&&!((a=k.breakpoints)!=null&&a.length))return!1;const W=this.getColumn();let g=W;const m=this._widthOrContainer(!0);if(k.columnWidth)g=Math.min(Math.round(m/k.columnWidth)||1,k.columnMax);else{g=k.columnMax;let r=0;for(;r<k.breakpoints.length&&m<=k.breakpoints[r].w;)g=k.breakpoints[r++].c||W}if(g!==W){const r=(i=k.breakpoints)==null?void 0:i.find(h=>h.c===g);return this.column(g,(r==null?void 0:r.layout)||k.layout),!0}return!1}compact(a="compact",i=!0){return this.engine.compact(a,i),this._triggerChangeEvent(),this}column(a,i="moveScale"){if(!a||a<1||this.opts.column===a)return this;const k=this.getColumn();return this.opts.column=a,this.engine?(this.engine.column=a,this.el.classList.remove("gs-"+k),this._updateColumnVar(),this.engine.columnChanged(k,a,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(a=>a.matches("."+this.opts.itemClass)&&!a.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(a=!0){var i;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),a?this.el.parentNode.removeChild(this.el):(this.removeAll(a),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(i=this._placeholder)==null||delete i.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(a){return this.opts.float!==a&&(this.opts.float=this.engine.float=a,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(a,i=!1){const k=this.el.getBoundingClientRect();let W;i?W={top:k.top+document.documentElement.scrollTop,left:k.left}:W={top:this.el.offsetTop,left:this.el.offsetLeft};const g=a.left-W.left,m=a.top-W.top,r=k.width/this.getColumn(),h=k.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(g/r),y:Math.floor(m/h)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(a,i,k,W){return this.engine.isAreaEmpty(a,i,k,W)}makeWidget(a,i){const k=vi.getElement(a);if(!k||k.gridstackNode)return k;k.parentElement||this.el.appendChild(k),this._prepareElement(k,!0,i);const W=k.gridstackNode;this._updateContainerHeight(),W.subGridOpts&&this.makeSubGrid(k,W.subGridOpts,void 0,!1);let g;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(g=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),g&&delete this._ignoreLayoutsNodeChange,k}on(a,i){return a.indexOf(" ")!==-1?(a.split(" ").forEach(k=>this.on(k,i)),this):(a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable"?(a==="enable"||a==="disable"?this._gsEventHandler[a]=k=>i(k):this._gsEventHandler[a]=k=>{k.detail&&i(k,k.detail)},this.el.addEventListener(a,this._gsEventHandler[a])):a==="drag"||a==="dragstart"||a==="dragstop"||a==="resizestart"||a==="resize"||a==="resizestop"||a==="dropped"||a==="resizecontent"?this._gsEventHandler[a]=i:console.error("GridStack.on("+a+") event not supported"),this)}off(a){return a.indexOf(" ")!==-1?(a.split(" ").forEach(i=>this.off(i)),this):((a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable")&&this._gsEventHandler[a]&&this.el.removeEventListener(a,this._gsEventHandler[a]),delete this._gsEventHandler[a],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(a=>this.off(a)),this}removeWidget(a,i=!0,k=!0){return a?(vi.getElements(a).forEach(W=>{if(W.parentElement&&W.parentElement!==this.el)return;let g=W.gridstackNode;g||(g=this.engine.nodes.find(m=>W===m.el)),g&&(i&&vi.addRemoveCB&&vi.addRemoveCB(this.el,g,!1,!1),delete W.gridstackNode,this._removeDD(W),this.engine.removeNode(g,i,k),i&&W.parentElement&&W.remove())}),k&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(a=!0,i=!0){return this.engine.nodes.forEach(k=>{a&&vi.addRemoveCB&&vi.addRemoveCB(this.el,k,!1,!1),delete k.el.gridstackNode,this.opts.staticGrid||this._removeDD(k.el)}),this.engine.removeAll(a,i),i&&this._triggerRemoveEvent(),this}setAnimation(a=this.opts.animate,i){return i?setTimeout(()=>{this.opts&&this.setAnimation(a)}):a?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=a,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(a,i=!0,k=!0){return!!this.opts.staticGrid===a?this:(a?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(W=>{this.prepareDragDrop(W.el),W.subGrid&&k&&W.subGrid.setStatic(a,i,k)}),i&&this._setStaticClass(),this)}updateOptions(a){var i;const k=this.opts;return a===k?this:(a.acceptWidgets!==void 0&&(k.acceptWidgets=a.acceptWidgets,this._setupAcceptWidget()),a.animate!==void 0&&this.setAnimation(a.animate),a.cellHeight&&this.cellHeight(a.cellHeight),a.class!==void 0&&a.class!==k.class&&(k.class&&this.el.classList.remove(k.class),a.class&&this.el.classList.add(a.class)),a.columnOpts?(this.opts.columnOpts=a.columnOpts,this.checkDynamicColumn()):a.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof a.column=="number"&&this.column(a.column),a.margin!==void 0&&this.margin(a.margin),a.staticGrid!==void 0&&this.setStatic(a.staticGrid),a.disableDrag!==void 0&&!a.staticGrid&&this.enableMove(!a.disableDrag),a.disableResize!==void 0&&!a.staticGrid&&this.enableResize(!a.disableResize),a.float!==void 0&&this.float(a.float),a.row!==void 0?(k.minRow=k.maxRow=k.row=a.row,this._updateContainerHeight()):(a.minRow!==void 0&&(k.minRow=a.minRow,this._updateContainerHeight()),a.maxRow!==void 0&&(k.maxRow=a.maxRow)),(i=a.children)!=null&&i.length&&this.load(a.children),this)}update(a,i){return vi.getElements(a).forEach(k=>{var W;const g=k==null?void 0:k.gridstackNode;if(!g)return;const m={...Yn.copyPos({},g),...Yn.cloneDeep(i)};this.engine.nodeBoundFix(m),delete m.autoPosition;const r=["x","y","w","h"];let h;if(r.some(_=>m[_]!==void 0&&m[_]!==g[_])&&(h={},r.forEach(_=>{h[_]=m[_]!==void 0?m[_]:g[_],delete m[_]})),!h&&(m.minW||m.minH||m.maxW||m.maxH)&&(h={}),m.content!==void 0){const _=k.querySelector(".grid-stack-item-content");_&&_.textContent!==m.content&&(g.content=m.content,vi.renderCB(_,m),(W=g.subGrid)!=null&&W.el&&(_.appendChild(g.subGrid.el),g.subGrid._updateContainerHeight())),delete m.content}let l=!1,t=!1;for(const _ in m)_[0]!=="_"&&g[_]!==m[_]&&(g[_]=m[_],l=!0,t=t||!this.opts.staticGrid&&(_==="noResize"||_==="noMove"||_==="locked"));if(Yn.sanitizeMinMax(g),h){const _=h.w!==void 0&&h.w!==g.w;this.moveNode(g,h),_&&g.subGrid?g.subGrid.onResize(this.hasAnimationCSS()?g.w:void 0):this.resizeToContentCheck(_,g),delete g._orig}(h||l)&&this._writeAttr(k,g),t&&this.prepareDragDrop(g.el),vi.updateCB&&vi.updateCB(g)}),this}moveNode(a,i){const k=a._updating;k||this.engine.cleanNodes().beginUpdate(a),this.engine.moveNode(a,i),this._updateContainerHeight(),k||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(a){var i,k;if(!a||(a.classList.remove("size-to-content-max"),!a.clientHeight))return;const W=a.gridstackNode;if(!W)return;const g=W.grid;if(!g||a.parentElement!==g.el)return;const m=g.getCellHeight(!0);if(!m)return;let r=W.h?W.h*m:a.clientHeight,h;if(W.resizeToContentParent&&(h=a.querySelector(W.resizeToContentParent)),h||(h=a.querySelector(vi.resizeToContentParent)),!h)return;const l=a.clientHeight-h.clientHeight,t=W.h?W.h*m-l:h.clientHeight;let _;if(W.subGrid){_=W.subGrid.getRow()*W.subGrid.getCellHeight(!0);const f=W.subGrid.el.getBoundingClientRect(),o=a.getBoundingClientRect();_+=f.top-o.top}else{if((k=(i=W.subGridOpts)==null?void 0:i.children)!=null&&k.length)return;{const f=h.firstElementChild;if(!f){console.error(`Error: GridStack.resizeToContent() widget id:${W.id} '${vi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}_=f.getBoundingClientRect().height||t}}if(t===_)return;r+=_-t;let w=Math.ceil(r/m);const v=Number.isInteger(W.sizeToContent)?W.sizeToContent:0;v&&w>v&&(w=v,a.classList.add("size-to-content-max")),W.minH&&w<W.minH?w=W.minH:W.maxH&&w>W.maxH&&(w=W.maxH),w!==W.h&&(g._ignoreLayoutsNodeChange=!0,g.moveNode(W,{h:w}),delete g._ignoreLayoutsNodeChange)}resizeToContentCBCheck(a){vi.resizeToContentCB?vi.resizeToContentCB(a):this.resizeToContent(a)}rotate(a,i){return vi.getElements(a).forEach(k=>{const W=k.gridstackNode;if(!Yn.canBeRotated(W))return;const g={w:W.h,h:W.w,minH:W.minW,minW:W.minH,maxH:W.maxW,maxW:W.maxH};if(i){const r=i.left>0?Math.floor(i.left/this.cellWidth()):0,h=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;g.x=W.x+r-(W.h-(h+1)),g.y=W.y+h-r}Object.keys(g).forEach(r=>{g[r]===void 0&&delete g[r]});const m=W._orig;this.update(k,g),W._orig=m}),this}margin(a){if(!(typeof a=="string"&&a.split(" ").length>1)){const i=Yn.parseHeight(a);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=a,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(a){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const i=arguments;let k=0,W={x:i[k++],y:i[k++],w:i[k++],h:i[k++],autoPosition:i[k++]};return this.willItFit(W)}return this.engine.willItFit(a)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const a=this.engine.getDirtyNodes(!0);return a&&a.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(a),this._triggerEvent("change",a)),this.engine.saveInitial(),this}_triggerAddEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.addedNodes)!=null&&a.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(k=>{delete k._dirty});const i=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",i)}return this}_triggerRemoveEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.removedNodes)!=null&&a.length){const i=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",i)}return this}_triggerEvent(a,i){const k=i?new CustomEvent(a,{bubbles:!1,detail:i}):new Event(a);let W=this;for(;W.parentGridNode;)W=W.parentGridNode.grid;return W.el.dispatchEvent(k),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const a=this.parentGridNode;let i=this.getRow()+this._extraDragRow;const k=this.opts.cellHeight,W=this.opts.cellHeightUnit;if(!k)return this;if(!a&&!this.opts.minRow){const g=Yn.parseHeight(getComputedStyle(this.el).minHeight);if(g.h>0&&g.unit===W){const m=Math.floor(g.h/k);i<m&&(i=m)}}return this.el.setAttribute("gs-current-row",String(i)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),i&&(this.el.style[a?"minHeight":"height"]=i*k+W),a&&Yn.shouldSizeToContent(a)&&a.grid.resizeToContentCBCheck(a.el),this}_prepareElement(a,i=!1,k){k=k||this._readAttr(a),a.gridstackNode=k,k.el=a,k.grid=this,k=this.engine.addNode(k,i),this._writeAttr(a,k),a.classList.add(Id.itemClass,this.opts.itemClass);const W=Yn.shouldSizeToContent(k);return W?a.classList.add("size-to-content"):a.classList.remove("size-to-content"),W&&this.resizeToContentCheck(!1,k),Yn.lazyLoad(k)||this.prepareDragDrop(k.el),this}_writePosAttr(a,i){return(!i._moving&&!i._resizing||this._placeholder===a)&&(a.style.top=i.y?i.y===1?"var(--gs-cell-height)":`calc(${i.y} * var(--gs-cell-height))`:null,a.style.left=i.x?i.x===1?"var(--gs-column-width)":`calc(${i.x} * var(--gs-column-width))`:null,a.style.width=i.w>1?`calc(${i.w} * var(--gs-column-width))`:null,a.style.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null),i.x>0?a.setAttribute("gs-x",String(i.x)):a.removeAttribute("gs-x"),i.y>0?a.setAttribute("gs-y",String(i.y)):a.removeAttribute("gs-y"),i.w>1?a.setAttribute("gs-w",String(i.w)):a.removeAttribute("gs-w"),i.h>1?a.setAttribute("gs-h",String(i.h)):a.removeAttribute("gs-h"),this}_writeAttr(a,i){if(!i)return this;this._writePosAttr(a,i);const k={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const W in k)i[W]?a.setAttribute(k[W],String(i[W])):a.removeAttribute(k[W]);return this}_readAttr(a,i=!0){const k={};k.x=Yn.toNumber(a.getAttribute("gs-x")),k.y=Yn.toNumber(a.getAttribute("gs-y")),k.w=Yn.toNumber(a.getAttribute("gs-w")),k.h=Yn.toNumber(a.getAttribute("gs-h")),k.autoPosition=Yn.toBool(a.getAttribute("gs-auto-position")),k.noResize=Yn.toBool(a.getAttribute("gs-no-resize")),k.noMove=Yn.toBool(a.getAttribute("gs-no-move")),k.locked=Yn.toBool(a.getAttribute("gs-locked"));const W=a.getAttribute("gs-size-to-content");W&&(W==="true"||W==="false"?k.sizeToContent=Yn.toBool(W):k.sizeToContent=parseInt(W,10)),k.id=a.getAttribute("gs-id"),k.maxW=Yn.toNumber(a.getAttribute("gs-max-w")),k.minW=Yn.toNumber(a.getAttribute("gs-min-w")),k.maxH=Yn.toNumber(a.getAttribute("gs-max-h")),k.minH=Yn.toNumber(a.getAttribute("gs-min-h")),i&&(k.w===1&&a.removeAttribute("gs-w"),k.h===1&&a.removeAttribute("gs-h"),k.maxW&&a.removeAttribute("gs-max-w"),k.minW&&a.removeAttribute("gs-min-w"),k.maxH&&a.removeAttribute("gs-max-h"),k.minH&&a.removeAttribute("gs-min-h"));for(const g in k){if(!k.hasOwnProperty(g))return;!k[g]&&k[g]!==0&&g!=="sizeToContent"&&delete k[g]}return k}_setStaticClass(){const a=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...a),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...a),this.el.removeAttribute("gs-static")),this}onResize(a=(i=>(i=this.el)==null?void 0:i.clientWidth)()){if(!a||this.prevWidth===a)return;this.prevWidth=a,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(k=>{k.subGrid&&k.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(a=!1,i=void 0){if(this.engine){if(a&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);if(i)Yn.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(k=>Yn.shouldSizeToContent(k))){const k=[...this.engine.nodes];this.batchUpdate(),k.forEach(W=>{Yn.shouldSizeToContent(W)&&this.resizeToContentCBCheck(W.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}}_updateResizeEvent(a=!1){const i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(k=>k.sizeToContent));return!a&&i&&!this.resizeObserver?(this._sizeThrottle=Yn.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(a||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(a=".grid-stack-item"){return Yn.getElement(a)}static getElements(a=".grid-stack-item"){return Yn.getElements(a)}static getGridElement(a){return vi.getElement(a)}static getGridElements(a){return Yn.getElements(a)}_initMargin(){let a,i=0,k=[];typeof this.opts.margin=="string"&&(k=this.opts.margin.split(" ")),k.length===2?(this.opts.marginTop=this.opts.marginBottom=k[0],this.opts.marginLeft=this.opts.marginRight=k[1]):k.length===4?(this.opts.marginTop=k[0],this.opts.marginRight=k[1],this.opts.marginBottom=k[2],this.opts.marginLeft=k[3]):(a=Yn.parseHeight(this.opts.margin),this.opts.marginUnit=a.unit,i=this.opts.margin=a.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(g=>{this.opts[g]===void 0?this.opts[g]=i:(a=Yn.parseHeight(this.opts[g]),this.opts[g]=a.h,delete this.opts.margin)}),this.opts.marginUnit=a.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const W=this.el.style;return W.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),W.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),W.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),W.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return nd}static setupDragIn(a,i,k,W=document){(i==null?void 0:i.pause)!==void 0&&(Ei.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof a=="string"?Yn.getElements(a,W):a).forEach((g,m)=>{nd.isDraggable(g)||nd.dragIn(g,i),k!=null&&k[m]&&(g.gridstackNode=k[m])})}movable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const W=k.gridstackNode;W&&(i?delete W.noMove:W.noMove=!0,this.prepareDragDrop(W.el))}),this)}resizable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const W=k.gridstackNode;W&&(i?delete W.noResize:W.noResize=!0,this.prepareDragDrop(W.el))}),this)}disable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!1,a),this.enableResize(!1,a),this._triggerEvent("disable"),this}enable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!0,a),this.enableResize(!0,a),this._triggerEvent("enable"),this}enableMove(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableMove(a,i)}),this)}enableResize(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableResize(a,i)}),this)}cancelDrag(){var a;const i=(a=this._placeholder)==null?void 0:a.gridstackNode;i&&(i._isExternal?(i._isAboutToRemove=!0,this.engine.removeNode(i)):i._isAboutToRemove&&vi._itemRemoving(i.el,!1),this.engine.restoreInitial())}_removeDD(a){return nd.draggable(a,"destroy").resizable(a,"destroy"),a.gridstackNode&&delete a.gridstackNode._initDD,delete a.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return nd.droppable(this.el,"destroy"),this;let a,i;const k=(W,g,m)=>{var r;m=m||g;const h=m.gridstackNode;if(!h)return;if(!((r=h.grid)!=null&&r.el)){m.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const v=m.getBoundingClientRect();m.style.left=v.x+(this.dragTransform.xScale-1)*(W.clientX-v.x)/this.dragTransform.xScale+"px",m.style.top=v.y+(this.dragTransform.yScale-1)*(W.clientY-v.y)/this.dragTransform.yScale+"px",m.style.transformOrigin="0px 0px"}let{top:l,left:t}=m.getBoundingClientRect();const _=this.el.getBoundingClientRect();t-=_.left,l-=_.top;const w={position:{top:l*this.dragTransform.xScale,left:t*this.dragTransform.yScale}};if(h._temporaryRemoved){if(h.x=Math.max(0,Math.round(t/i)),h.y=Math.max(0,Math.round(l/a)),delete h.autoPosition,this.engine.nodeBoundFix(h),!this.engine.willItFit(h)){if(h.autoPosition=!0,!this.engine.willItFit(h)){nd.off(g,"drag");return}h._willFitPos&&(Yn.copyPos(h,h._willFitPos),delete h._willFitPos)}this._onStartMoving(m,W,w,h,i,a)}else this._dragOrResize(m,W,w,h,i,a)};return nd.droppable(this.el,{accept:W=>{const g=W.gridstackNode||this._readAttr(W,!1);if((g==null?void 0:g.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let m=!0;if(typeof this.opts.acceptWidgets=="function")m=this.opts.acceptWidgets(W);else{const r=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;m=W.matches(r)}if(m&&g&&this.opts.maxRow){const r={w:g.w,h:g.h,minW:g.minW,minH:g.minH};m=this.engine.willItFit(r)}return m}}).on(this.el,"dropover",(W,g,m)=>{let r=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((r==null?void 0:r.grid)===this&&!r._temporaryRemoved)return!1;if(r!=null&&r._sidebarOrig&&(r.w=r._sidebarOrig.w,r.h=r._sidebarOrig.h),r!=null&&r.grid&&r.grid!==this&&!r._temporaryRemoved&&r.grid._leave(g,m),m=m||g,i=this.cellWidth(),a=this.getCellHeight(!0),!r){const t=m.getAttribute("data-gs-widget")||m.getAttribute("gridstacknode");if(t){try{r=JSON.parse(t)}catch{console.error("Gridstack dropover: Bad JSON format: ",t)}m.removeAttribute("data-gs-widget"),m.removeAttribute("gridstacknode")}r||(r=this._readAttr(m)),r._sidebarOrig={w:r.w,h:r.h}}r.grid||(r.el||(r={...r}),r._isExternal=!0,m.gridstackNode=r);const h=r.w||Math.round(m.offsetWidth/i)||1,l=r.h||Math.round(m.offsetHeight/a)||1;return r.grid&&r.grid!==this?(g._gridstackNodeOrig||(g._gridstackNodeOrig=r),g.gridstackNode=r={...r,w:h,h:l,grid:this},delete r.x,delete r.y,this.engine.cleanupNode(r).nodeBoundFix(r),r._initDD=r._isExternal=r._temporaryRemoved=!0):(r.w=h,r.h=l,r._temporaryRemoved=!0),vi._itemRemoving(r.el,!1),nd.on(g,"drag",k),k(W,g,m),!1}).on(this.el,"dropout",(W,g,m)=>{const r=(m==null?void 0:m.gridstackNode)||g.gridstackNode;return r&&(!r.grid||r.grid===this)&&(this._leave(g,m),this._isTemp&&this.removeAsSubGrid(r)),!1}).on(this.el,"drop",(W,g,m)=>{var r,h,l;const t=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((t==null?void 0:t.grid)===this&&!t._isExternal)return!1;const _=!!this.placeholder.parentElement,w=g!==m;this.placeholder.remove(),delete this.placeholder.gridstackNode,_&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const v=g._gridstackNodeOrig;if(delete g._gridstackNodeOrig,_&&v!=null&&v.grid&&v.grid!==this){const o=v.grid;o.engine.removeNodeFromLayoutCache(v),o.engine.removedNodes.push(v),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!t||(_&&(this.engine.cleanupNode(t),t.grid=this),(r=t.grid)==null||delete r._isTemp,nd.off(g,"drag"),m!==g?(m.remove(),g=m):g.remove(),this._removeDD(g),!_))return!1;const f=(l=(h=t.subGrid)==null?void 0:h.el)==null?void 0:l.gridstack;return Yn.copyPos(t,this._readAttr(this.placeholder)),Yn.removePositioningStyles(g),w&&(t.content||t.subGridOpts||vi.addRemoveCB)?(delete t.el,g=this.addWidget(t)):(this._prepareElement(g,!0,t),this.el.appendChild(g),this.resizeToContentCheck(!1,t),f&&(f.parentGridNode=t),this._updateContainerHeight()),this.engine.addedNodes.push(t),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...W,type:"dropped"},v&&v.grid?v:void 0,t),!1}),this}static _itemRemoving(a,i){if(!a)return;const k=a?a.gridstackNode:void 0;!(k!=null&&k.grid)||a.classList.contains(k.grid.opts.removableOptions.decline)||(i?k._isAboutToRemove=!0:delete k._isAboutToRemove,i?a.classList.add("grid-stack-item-removing"):a.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const a=document.querySelector(this.opts.removable);return a?(!this.opts.staticGrid&&!nd.isDroppable(a)&&nd.droppable(a,this.opts.removableOptions).on(a,"dropover",(i,k)=>vi._itemRemoving(k,!0)).on(a,"dropout",(i,k)=>vi._itemRemoving(k,!1)),this):this}prepareDragDrop(a,i=!1){const k=a==null?void 0:a.gridstackNode;if(!k)return;const W=k.noMove||this.opts.disableDrag,g=k.noResize||this.opts.disableResize,m=this.opts.staticGrid||W&&g;if((i||m)&&(k._initDD&&(this._removeDD(a),delete k._initDD),m&&a.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!i))return this;if(!k._initDD){let r,h;const l=(w,v)=>{this.triggerEvent(w,w.target),r=this.cellWidth(),h=this.getCellHeight(!0),this._onStartMoving(a,w,v,k,r,h)},t=(w,v)=>{this._dragOrResize(a,w,v,k,r,h)},_=w=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete k._moving,delete k._resizing,delete k._event,delete k._lastTried;const v=k.w!==k._orig.w,f=w.target;if(!(!f.gridstackNode||f.gridstackNode.grid!==this)){if(k.el=f,k._isAboutToRemove){const o=a.gridstackNode.grid;o._gsEventHandler[w.type]&&o._gsEventHandler[w.type](w,f),o.engine.nodes.push(k),o.removeWidget(a,!0,!0)}else Yn.removePositioningStyles(f),k._temporaryRemoved?(this._writePosAttr(f,k),this.engine.addNode(k)):this._writePosAttr(f,k),this.triggerEvent(w,f);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),w.type==="resizestop"&&(Number.isInteger(k.sizeToContent)&&(k.sizeToContent=k.h),this.resizeToContentCheck(v,k))}};nd.draggable(a,{start:l,stop:_,drag:t}).resizable(a,{start:l,stop:_,resize:t}),k._initDD=!0}return nd.draggable(a,W?"disable":"enable").resizable(a,g?"disable":"enable"),this}_onStartMoving(a,i,k,W,g,m){var r;if(this.engine.cleanNodes().beginUpdate(W),this._writePosAttr(this.placeholder,W),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=W,(r=W.grid)!=null&&r.el)this.dragTransform=Yn.getValuesFromTransformedElement(a);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const h=this.placeholder.closest(".grid-stack");this.dragTransform=Yn.getValuesFromTransformedElement(h)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(W.el=this.placeholder,W._lastUiPosition=k.position,W._prevYPix=k.position.top,W._moving=i.type==="dragstart",W._resizing=i.type==="resizestart",delete W._lastTried,i.type==="dropover"&&W._temporaryRemoved&&(this.engine.addNode(W),W._moving=!0),this.engine.cacheRects(g,m,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){const h=this.getColumn()-W.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-W.y;nd.resizable(a,"option","minWidth",g*Math.min(W.minW||1,h)).resizable(a,"option","minHeight",m*Math.min(W.minH||1,l)).resizable(a,"option","maxWidth",g*Math.min(W.maxW||Number.MAX_SAFE_INTEGER,h)).resizable(a,"option","maxWidthMoveLeft",g*Math.min(W.maxW||Number.MAX_SAFE_INTEGER,W.x+W.w)).resizable(a,"option","maxHeight",m*Math.min(W.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(a,"option","maxHeightMoveUp",m*Math.min(W.maxH||Number.MAX_SAFE_INTEGER,W.y+W.h))}}_dragOrResize(a,i,k,W,g,m){const r={...W._orig};let h,l=this.opts.marginLeft,t=this.opts.marginRight,_=this.opts.marginTop,w=this.opts.marginBottom;const v=Math.round(m*.1),f=Math.round(g*.1);if(l=Math.min(l,f),t=Math.min(t,f),_=Math.min(_,v),w=Math.min(w,v),i.type==="drag"){if(W._temporaryRemoved)return;const s=k.position.top-W._prevYPix;W._prevYPix=k.position.top,this.opts.draggable.scroll!==!1&&Yn.updateScrollPosition(a,k.position,s);const p=k.position.left+(k.position.left>W._lastUiPosition.left?-t:l),c=k.position.top+(k.position.top>W._lastUiPosition.top?-w:_);r.x=Math.round(p/g),r.y=Math.round(c/m);const d=this._extraDragRow;if(this.engine.collide(W,r)){const b=this.getRow();let x=Math.max(0,r.y+W.h-b);this.opts.maxRow&&b+x>this.opts.maxRow&&(x=Math.max(0,this.opts.maxRow-b)),this._extraDragRow=x}else this._extraDragRow=0;if(this._extraDragRow!==d&&this._updateContainerHeight(),W.x===r.x&&W.y===r.y)return}else if(i.type==="resize"){if(r.x<0||(Yn.updateScrollResize(i,a,m),r.w=Math.round((k.size.width-l)/g),r.h=Math.round((k.size.height-_)/m),W.w===r.w&&W.h===r.h)||W._lastTried&&W._lastTried.w===r.w&&W._lastTried.h===r.h)return;const s=k.position.left+l,p=k.position.top+_;r.x=Math.round(s/g),r.y=Math.round(p/m),h=!0}W._event=i,W._lastTried=r;const o={x:k.position.left+l,y:k.position.top+_,w:(k.size?k.size.width:W.w*g)-l-t,h:(k.size?k.size.height:W.h*m)-_-w};if(this.engine.moveNodeCheck(W,{...r,cellWidth:g,cellHeight:m,rect:o,resizing:h})){W._lastUiPosition=k.position,this.engine.cacheRects(g,m,_,t,w,l),delete W._skipDown,h&&W.subGrid&&W.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const s=i.target;W._sidebarOrig||this._writePosAttr(s,W),this.triggerEvent(i,s)}}triggerEvent(a,i){let k=this;for(;k.parentGridNode;)k=k.parentGridNode.grid;k._gsEventHandler[a.type]&&k._gsEventHandler[a.type](a,i)}_leave(a,i){i=i||a;const k=i.gridstackNode;if(!k||(i.style.transform=i.style.transformOrigin=null,nd.off(a,"drag"),k._temporaryRemoved))return;k._temporaryRemoved=!0,this.engine.removeNode(k),k.el=k._isExternal&&i?i:a;const W=k._sidebarOrig;k._isExternal&&this.engine.cleanupNode(k),k._sidebarOrig=W,this.opts.removable===!0&&vi._itemRemoving(a,!0),a._gridstackNodeOrig?(a.gridstackNode=a._gridstackNodeOrig,delete a._gridstackNodeOrig):k._isExternal&&this.engine.restoreInitial()}commit(){return P5e(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}vi.renderCB=(e,a)=>{e&&a!=null&&a.content&&(e.textContent=a.content)},vi.resizeToContentParent=".grid-stack-item-content",vi.Utils=Yn,vi.Engine=Mh,vi.GDRev="12.3.2";const M5e=[{id:1,name:"Goles",isSelected:!1},{id:2,name:"Pases acertados",isSelected:!1},{id:23,name:"Tiros de Esquina",isSelected:!1},{id:3,name:"Balones recuperados en disputa",isSelected:!1},{id:4,name:"Asistencias",isSelected:!1},{id:5,name:"Participaciones en gol",isSelected:!1},{id:6,name:"Tiros a gol",isSelected:!1},{id:7,name:"Tiros a gol que llegaron a la portería",isSelected:!1},{id:8,name:"Cabeceos en área rival",isSelected:!1},{id:9,name:"Cabeceos en área propia",isSelected:!1},{id:10,name:"Centros",isSelected:!1},{id:11,name:"Centros acertados",isSelected:!1},{id:12,name:"1vs1 exitosos ofensivos",isSelected:!1},{id:13,name:"1vs1 exitosos ofensivos que terminaron en gol",isSelected:!1},{id:14,name:"1vs1 defensivos exitoso",isSelected:!1},{id:15,name:"Rechaces",isSelected:!1},{id:16,name:"Balones ganados en área propia",isSelected:!1},{id:17,name:"Balones ganados en área rival",isSelected:!1},{id:18,name:"Faltas cometidas",isSelected:!1},{id:19,name:"Faltas recibidas",isSelected:!1},{id:20,name:"Tarjetas amarillas",isSelected:!1},{id:21,name:"Tarjetas rojas",isSelected:!1},{id:22,name:"Atajadas",isSelected:!1},{id:24,name:"Oportunidades de gol",isSelected:!1},{id:25,name:"Balones recuperados en cancha rival",isSelected:!1}],Wh=e=>M5e.find(a=>a.id===e),jh=new Map([[9,{id:9,analysisTypes:new Map([["2-20",{analysisType:"successfulPasses",name:"Pases acertados",title:"Mapeo de pases acertados",titleShort:"Pases acertados"}],["3-21",{analysisType:"unsuccessfulPasses",name:"Pases no acertados",title:"Mapeo de pases no acertados",titleShort:"Pases no acertados"}],["222-223-224-225",{analysisType:"recoveredBalls",name:"Balones recuperados",title:"Mapeo de balones recuperados",titleShort:"Balones recuperados"}],["226-227-228-229",{analysisType:"lostBalls",name:"Balones perdidos",title:"Mapeo de balones perdidos",titleShort:"Balones perdidos"}]])}],[1,{general:"General",offensive:"Ofensivo",defensive:"Defensivo",possession:"Posesión",stoppedBall:"Balón parado",penalties:"Infracción"}]]);class H0{constructor(a,i=[],k,W=null,g=!1,m=!1,r=null,h=null,l=null){Tp(this,"id",""),Tp(this,"childViews",[]),Tp(this,"viewId",0),Tp(this,"dynamicFilters",null),Tp(this,"componentSpecificFilters",new Map),Tp(this,"isPostMatch",!1),Tp(this,"isTemplateMode",!1),Tp(this,"filtresJSON",null),Tp(this,"token",null),Tp(this,"_isUpdating",!1),Tp(this,"filters",null),this.id=a,this.viewId=k,this.childViews=i,this.dynamicFilters=W,this.isPostMatch=g,this.isTemplateMode=m,this.filtresJSON=r,this.token=h,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(a=>{a.view.filterAndViewsContainer=new H0(this.id,[a],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.event_type_id===i)}hasCategoryId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.category_id===i)}getId(){return this.id}setViewId(a){this.viewId=a}setFiltersJSON(a){this.filtresJSON=a}setDynamicFilters(a,i=null){i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a}setFilters(a){this.filters=a}getComponentDynamicFilters(a){return a&&this.componentSpecificFilters.has(a)?this.componentSpecificFilters.get(a):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(a=>a.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(a=>!a.view.isHomeTeam)}addLastTouch(a){if(a.view.componentProps&&this.filters){let i=null;const k=this.filters.selectedCategories.map(g=>g.value),W=this.filters.selectedTeam.value;if(W===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=!0,h.view.isHomeTeam=!0,h.view.filterMultiple&&(h.view.filterMultiple.isHomeTeam=!0)});const g=this.getHomeTeamViews(),m=this.getAwayTeamViews();let r=!0;for(let h=0;h<k.length;h++){i=k[h];const l=g.find(_=>_.view.componentProps.categories[0].name===i.name),t=m.find(_=>_.view.componentProps.categories[0].name===i.name);if(!l||!t){r=!l;break}}r?this.childViews.length===0?(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((h,l,t,_)=>{let w={categories:l.view.componentProps.categories,analysisType:l.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:l.view.title,isHomeTeamForAnalysis:l.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:l.view.isHomeTeam};return h&&(h.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[i],l.view.componentProps.analysisType=this.filters.selectedGamePhase.name,l.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,l.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,l.view.componentProps.isHomeTeamForAnalysis=!0,l.view.title=i.name,a.view.titleShort=i.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!h.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=h.categories,l.view.componentProps.analysisType=h.analysisType,l.view.componentProps.isHomeTeamForAnalysis=h.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=h.isAssistZoneVisible,l.view.componentProps.howManyGames=h.howManyGames,l.view.title=h.title,l.view.titleShort=h.titleShort,l.view.isHomeTeam=h.isHomeTeam,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:l.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),t===_.length-1&&(a.view.componentProps.categories=w.categories,a.view.componentProps.analysisType=w.analysisType,a.view.componentProps.isHomeTeamForAnalysis=w.isHomeTeamForAnalysis,a.view.componentProps.isAssistZoneVisible=w.isAssistZoneVisible,a.view.componentProps.howManyGames=w.howManyGames,a.view.title=w.title,a.view.titleShort=w.titleShort,a.view.isHomeTeam=w.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:a.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),w},null):(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const g=W===1,m=g?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=g,a.view.isHomeTeam=g;for(let r=0;r<k.length;r++){const h=k[r];if(!m.find(l=>l.view.componentProps.categories[0].name===h.name)){a.view.componentProps.categories=[h],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=h.name,a.view.titleShort=h.name,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:h,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}console.log("after addLastTouch view.view.filterMultiple",a)}addView(a,i=!1){var k,W,g,m,r,h,l,t,_,w;if(a.view.filterAndViewsContainer=this,Ua.emit("component-added-to-container",this),this.viewId===5&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===10&&a.view.componentProps&&!i&&(a.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,a.isHomeTeam=a.view.componentProps.isHomeTeamForAnalysis,a.view.filterMultiple={isHomeTeam:a.view.componentProps.isHomeTeamForAnalysis},a.view.filtersJSON=this.filtresJSON),this.viewId===7&&a.view.componentProps&&!i){const v=this.getComponentDynamicFilters(a.view.id),f=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=f[0]===1?"offensive":"defensive",s=f[1]===1;a.view.componentProps.analysisType=o,a.view.componentProps.isHomeTeamForAnalysis=s,a.isHomeTeam=s,a.view.filterMultiple={isHomeTeam:s},Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:f})}if(this.viewId===1&&a.view.componentProps&&!i){const v=this.dynamicFilters[0]||[];if(v&&v.length>0){let f;if(Array.isArray(v)){const s=this.childViews.map(c=>{var d;return(d=c.view.componentProps)==null?void 0:d.type}).filter(c=>c!==void 0),p=v.filter(c=>!s.includes(c));p.length>0?f=p[0]:f=v[0]}else f=v;const o=jh.get(this.viewId);a.view.componentProps.type=f,a.view.componentProps.default=!1,a.view.title=`Comparativa ${o[f]}`,a.view.filterMultiple={category:f}}}if(this.viewId===9&&a.view.componentProps&&!i){const v=this.dynamicFilters[0].map(p=>p.join("-"));let f="";const o=this.dynamicFilters[1],s=jh.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(x=>{x.view.componentProps.isHomeTeamForAnalysis=!0,x.view.isHomeTeam=!0,x.view.filterMultiple&&(x.view.filterMultiple.isHomeTeam=!0)});let p=null;const c=this.getHomeTeamViews(),d=this.getAwayTeamViews();let b=!0;for(let x=0;x<v.length;x++){f=v[x],p=s.analysisTypes.get(v[x]);const T=c.find(V=>V.view.componentProps.analysisType===p.analysisType),N=d.find(V=>V.view.componentProps.analysisType===p.analysisType);if(!T||!N){b=!T;break}}b?this.childViews.length===0?(a.view.componentProps.analysisType=p.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.title=p.title,a.view.titleShort=p.titleShort,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:f.split("-").map(x=>parseInt(x))}):this.childViews.reduce((x,T,N,V)=>{let U={analysisType:T.view.componentProps.analysisType,title:T.view.title,isHomeTeamForAnalysis:T.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:T.view.isHomeTeam};return x&&(x.isHomeTeam&&!T.view.isHomeTeam?(T.view.componentProps.analysisType=p.analysisType,T.view.componentProps.isHomeTeamForAnalysis=!0,T.view.title=p.title,a.view.titleShort=p.titleShort,T.view.isHomeTeam=!0,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:f.split("-").map(z=>parseInt(z))}):!x.isHomeTeam&&!T.view.isHomeTeam&&(T.view.componentProps.analysisType=x.analysisType,T.view.componentProps.isHomeTeamForAnalysis=x.isHomeTeamForAnalysis,T.view.title=x.title,T.view.titleShort=x.titleShort,T.view.isHomeTeam=x.isHomeTeam,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:f.split("-").map(z=>parseInt(z))}),N===V.length-1&&(a.view.componentProps.analysisType=U.analysisType,a.view.componentProps.isHomeTeamForAnalysis=U.isHomeTeamForAnalysis,a.view.title=U.title,a.view.titleShort=U.titleShort,a.view.isHomeTeam=U.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:f.split("-").map(z=>parseInt(z))})),U},null):(a.view.componentProps.analysisType=p.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.title=p.title,a.view.titleShort=p.titleShort,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:f.split("-").map(x=>parseInt(x))})}else{const p=o===1,c=p?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=p,a.view.isHomeTeam=p;for(let d=0;d<v.length;d++){const b=s.analysisTypes.get(v[d]);if(!c.find(x=>x.view.componentProps.analysisType===b.analysisType)){a.view.componentProps.analysisType=b.analysisType,a.view.title=b.title,a.view.titleShort=b.titleShort,a.view.filterMultiple={categoryIds:v[d].split("-").map(x=>parseInt(x)),isHomeTeam:a.view.isHomeTeam};break}}}}if(this.viewId===2&&!i&&a.view.componentProps){const v=this.getComponentDynamicFilters(a.view.id),f=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id),a.view.componentProps.game&&(a.view.componentProps.gameid=a.view.componentProps.game.id,a.view.componentProps.season=a.view.componentProps.game.season_id,a.view.componentProps.teamView=f[1]===2?a.view.componentProps.game.awayTeam.team_id:f[1]===1?a.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let s=null;if(Array.isArray(o)){if(o.length>0){const d=this.childViews.map(x=>{var T;const N=(T=x.view.componentProps)==null?void 0:T.categoryView;return N&&N.length>0?N[0].id:null}).filter(x=>x!==null),b=o.filter(x=>!d.includes(x));b.length>0&&(s=b[0])}}else{const d=o;d&&(this.childViews.find(b=>{var x;const T=(x=b.view.componentProps)==null?void 0:x.categoryView;return T&&T.length>0&&T[0].id===d})||(s=d))}let p=null;if(s)try{p=Wh(s)}catch{}const c=f&&f.length>1?f[1]:1;a.view.filterMultiple={categoryId:s,teamType:c},a.view.componentProps.categoryView=p?[{id:s,name:p.name}]:s?[{id:s,name:`Category ${s}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&a.view.componentProps&&!i&&a.view.game&&(a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,a.view.componentProps.game=(k=a.view)==null?void 0:k.game,a.view.componentProps.teamSelected={teamId:(g=(W=a.view)==null?void 0:W.game)==null?void 0:g.home_team},a.view.componentProps.isDefault=!1,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.seasonid=2010,a.view.teamids=[1,2],a.view.componentProps.categoryids=[20,2],a.view.componentProps.teamsshow=[1,2],a.view.componentProps.analysistype=1,a.view.componentProps.gameid="",a.view.componentProps.teams=[],a.view.componentProps.game=""),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.view=1,a.view.numitems=3,a.view.componentProps.token=this.token,a.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===14&&a.view.componentProps&&!i&&(a.view.componentProps.isReports=!0,a.view.componentProps.isDefault=!0,a.view.componentProps.type=0,a.view.componentProps.typeView=1,a.view.componentProps.showVideos=!1,a.view.componentProps.currentSeason=2010,a.view.componentProps.localTeam=2,a.view.componentProps.awayTeam=1),this.viewId===6&&a.view.componentProps&&!i){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(a.view.id),f=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=f&&f.length>0?f[0]:[];if(o&&o.length>0){let s=0;for(const p of o)if(!this.childViews.find(c=>c.view.componentProps.gameNumber===p)){s=p;break}s&&(a.view.componentProps.gameNumber=s,a.view.filterMultiple={gameNumber:s})}Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:f})}if(this.viewId===3&&a.view.componentProps&&!i&&a.view.game){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(a.view.id),f=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=f&&f.length>0?f[0]:!1;a.view.componentProps.desplegable=o,a.view.componentProps.key=o,a.view.componentProps.game=(m=a.view)==null?void 0:m.game,a.view.componentProps.defaultShields=!1,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:f})}if(this.viewId===4&&a.view.componentProps&&!i&&a.view.game){if(a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),this.isPostMatch){a.view.componentProps.key=!1,a.view.componentProps.isDefault=!1,a.view.componentProps.token=this.token,a.view.componentProps.gameId=(h=(r=a.view)==null?void 0:r.game)==null?void 0:h.game_id,a.view.componentProps.homeTeam=(t=(l=a.view)==null?void 0:l.game)==null?void 0:t.home_team,a.view.componentProps.awayTeam=(w=(_=a.view)==null?void 0:_.game)==null?void 0:w.visiting_team;const o=this.getComponentDynamicFilters(a.view.id),s=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const p=s&&s.length>0?s[0]:[],c=this.hasEventTypeId(p,1),d=this.hasCategoryId(p,8),b=this.hasCategoryId(p,9),x=this.hasEventTypeId(p,3);a.view.componentProps.goals=c,a.view.componentProps.yellowCards=d,a.view.componentProps.redCards=b,a.view.componentProps.substitutions=x}const v=this.getComponentDynamicFilters(a.view.id)||this.dynamicFilters,f=v&&v.length>0?v[0]:[];a.view.componentProps.selectedEvents=f,a.view.componentProps.key=f.length>0,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:v})}this.viewId===16&&this.addLastTouch(a),this.childViews.push(a),console.log("FilterAndViewsContainer addView child views:",this.childViews),Ua.emit("view-added")}getHowManyViewsToAdd(a,i=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const k=a[0];return k===2||k===3?k:1}if(this.viewId===4)return a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0?1:0;if(this.viewId===9){const k=a[0],W=a[1];if(W===1||W===2){const g=W===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&i){const k=i.selectedCategories||[],W=i.selectedTeam.value;if(W===1||W===2){const g=W===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const k=a[0]||[],W=a[1]||1;if(!k||k.length===0)return 0;if(Array.isArray(k)){const g=this.childViews.map(m=>{var r;const h=(r=m.view.componentProps)==null?void 0:r.categoryView;return h&&h.length>0?h[0].id:null}).filter(m=>m!==null);return k.filter(m=>!g.includes(m)).length}else{const g=k;return this.childViews.find(m=>{var r,h;const l=(r=m.view.componentProps)==null?void 0:r.categoryView,t=((h=m.view.filterMultiple)==null?void 0:h.teamType)||1;return l&&l.length>0&&l[0].id===g&&t===W})?0:1}}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return 0;if(Array.isArray(k)){const W=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!W.includes(g)).length}else{const W=k;return this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===W})?0:1}}return 0}getRequiresAddView(a,i){if(this.viewId===5)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===10)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return a[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const k=a[0];return k?k.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;return this.childViews.length===0&&k}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(a);if(this.viewId===16&&i){const k=[i.selectedCategories,i.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(k,i.totalCategoriesSelected)}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return!1;if(Array.isArray(k)){const W=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!W.includes(g)).length>0}else{const W=k;return!this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===W})}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){if(k.length>0){const W=this.childViews.map(g=>{var m;const r=(m=g.view.componentProps)==null?void 0:m.categoryView;return r&&r.length>0?r[0].id:null}).filter(g=>g!==null);return k.filter(g=>!W.includes(g)).length>0}return!1}else{const W=k,g=a[1]||1;return W?!this.childViews.find(m=>{var r,h;const l=(r=m.view.componentProps)==null?void 0:r.categoryView,t=((h=m.view.filterMultiple)==null?void 0:h.teamType)||1;return l&&l.length>0&&l[0].id===W&&t===g}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(a,i=null){const k=this.childViews.filter(l=>l.view.isHomeTeam),W=this.childViews.filter(l=>!l.view.isHomeTeam),g=i||a[0].length,m=a[1],r=g*(m===1||m===2?1:2),h=m===3?k.length+W.length:k.length||W.length;return r>h}getRequiresLessViews(a){if(this.viewId===5)return a[0]!==3&&this.childViews.length>1;if(this.viewId===15)return a[0]!==3&&this.childViews.length>1;if(this.viewId===6){const i=a[0];return i===2||i===3}return this.viewId,!1}updateSummary({dynamicFilters:a}){const i=this.childViews[0],k=document.querySelector(`[gs-id="${i.view.id}"]`),W=i.grid;if(i&&k&&W){const g=a[0],m=`min_column${g?"_2":""}`,r=`min_row${g?"_2":""}`,h=`max_column${g?"_2":""}`,l=`max_row${g?"_2":""}`,t=`colspan${g?"_2":""}`,_=`rowspan${g?"_2":""}`,w=i.view.coreView[t],v=i.view.coreView[_],f=i.view.coreView[m],o=i.view.coreView[r],s=i.view.coreView[h],p=i.view.coreView[l];i.view.w=w,i.view.h=v,i.view.maxWidth=s,i.view.maxHeight=p,i.view.minWidth=f,i.view.minHeight=o,k.setAttribute("gs-w",w),k.setAttribute("gs-h",v),k.setAttribute("gs-max-w",s),k.setAttribute("gs-max-h",p),k.setAttribute("gs-min-w",f),k.setAttribute("gs-min-h",o),W.update(k,{h:v,w,"gs-max-h":p,"gs-max-w":s,"gs-min-h":o,"gs-min-w":f})}}updateFilters(a){this.filters=a,this.viewId===16&&this.updateLastTouchFilters(a)}updateDynamicFilters(a,i=null){if(!this._isUpdating){this._isUpdating=!0,i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a,Ua.emit("component-added-to-container",this);try{if(this.viewId===5){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const W=this.childViews[0];W.view.componentProps&&(W.view.componentProps.preMatchType=k,W.view.filterMultiple={isHomeTeam:W.view.componentProps.preMatchType===1})}else{const W=this.childViews.pop(),g=W.grid,m=W.page,r=document.querySelector(`[gs-id="${W.view.id}"]`);if(g&&r&&(g.removeWidget(r),m)){const l=m.items.findIndex(t=>t.id===W.view.id);l!==-1&&m.items.splice(l,1)}const h=this.childViews[0];h.view.componentProps&&(h.view.componentProps.preMatchType=k,h.view.filterMultiple={isHomeTeam:h.view.componentProps.preMatchType})}else this.childViews.forEach((W,g)=>{W.view.componentProps.preMatchType=g+1,W.view.filterMultiple={isHomeTeam:W.view.componentProps.preMatchType}})}if(this.viewId===15){const k=a[0]||1;if(i){const W=this.childViews.find(g=>g.view.id===i);W&&W.view.componentProps&&(W.view.componentProps.preMatchType=k,W.view.filterMultiple={isHomeTeam:k===1})}else if(k<3){if(this.childViews.length===1){const W=this.childViews[0];W.view.componentProps&&(W.view.componentProps.preMatchType=k,W.view.filterMultiple={isHomeTeam:k===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const g=this.childViews.pop(),m=g.grid,r=g.page,h=document.querySelector(`[gs-id="${g.view.id}"]`);if(m&&h&&(m.removeWidget(h),r)){const l=r.items.findIndex(t=>t.id===g.view.id);l!==-1&&r.items.splice(l,1)}}const W=this.childViews[0];W.view.componentProps&&(W.view.componentProps.preMatchType=k,W.view.filterMultiple={isHomeTeam:k===1})}}else if(this.childViews.length===2)this.childViews.forEach((W,g)=>{W.view.componentProps&&(W.view.componentProps.preMatchType=g+1,W.view.filterMultiple={isHomeTeam:g===0})});else if(this.childViews.length<2)this.childViews.forEach((W,g)=>{W.view.componentProps&&(W.view.componentProps.preMatchType=g+1,W.view.filterMultiple={isHomeTeam:g===0})});else{for(;this.childViews.length>2;){const W=this.childViews.pop(),g=W.grid,m=W.page,r=document.querySelector(`[gs-id="${W.view.id}"]`);if(g&&r&&(g.removeWidget(r),m)){const h=m.items.findIndex(l=>l.id===W.view.id);h!==-1&&m.items.splice(h,1)}}this.childViews.forEach((W,g)=>{W.view.componentProps&&(W.view.componentProps.preMatchType=g+1,W.view.filterMultiple={isHomeTeam:g===0})})}}if(this.viewId===10){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const W=this.childViews[0];W.view.componentProps&&(W.view.componentProps.isHomeTeamForAnalysis=k===1,W.view.filterMultiple={isHomeTeam:W.view.componentProps.isHomeTeamForAnalysis})}else{const W=this.childViews.pop(),g=W.grid,m=W.page,r=document.querySelector(`[gs-id="${W.view.id}"]`);if(g&&r&&(g.removeWidget(r),m)){const l=m.items.findIndex(t=>t.id===W.view.id);l!==-1&&m.items.splice(l,1)}const h=this.childViews[0];h.view.componentProps&&(h.view.componentProps.isHomeTeamForAnalysis=k===1,h.view.filterMultiple={isHomeTeam:h.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((W,g)=>{W.view.componentProps.isHomeTeamForAnalysis=g%2===0,W.view.filterMultiple={isHomeTeam:W.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const k=a[1];if(k===3)this.childViews.forEach((W,g)=>{W.view.componentProps.isHomeTeamForAnalysis=g%2===0,W.view.isHomeTeam=g%2===0,W.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",W.view.filterMultiple={isHomeTeam:W.view.isHomeTeam}});else{const W=k===1;if(this.childViews.length>0){const g=this.childViews[0];g.view.componentProps.isHomeTeamForAnalysis=W,g.view.isHomeTeam=W,g.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",g.view.filterMultiple={isHomeTeam:W},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const k=a[0],W=a[1];if(W===3){if(this.childViews.length>k.length){const g=k.map(m=>{const r=m.join("-");return jh.get(this.viewId).analysisTypes.get(r).analysisType});this.childViews.reduce((m,r)=>(g.includes(r.view.componentProps.analysisType)||m.push(r.view.componentProps.analysisType),m),[]).forEach(m=>{const r=this.childViews.findIndex(h=>h.view.componentProps.analysisType===m);if(r!==-1){const h=this.childViews[r];this.removeChildView(h)}})}}else{const g=W===1,m=this.getHomeTeamViews(),r=this.getAwayTeamViews();if(g&&m.length===0)r.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=g,h.view.isHomeTeam=g,h.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(!g&&r.length===0)m.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=g,h.view.isHomeTeam=g,h.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(m.length===r.length)g||m.forEach(h=>{h.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}}),(g?r:m).forEach(h=>{this.removeChildView(h)});else{const h=g?this.getHomeTeamViews():this.getAwayTeamViews();if(h.length>k.length){const l=k.map(t=>{const _=t.join("-");return jh.get(this.viewId).analysisTypes.get(_).analysisType});h.forEach(t=>{l.includes(t.view.componentProps.analysisType)?t.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}:this.removeChildView(t)})}else h.forEach(l=>{l.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}})}}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){const W=this.childViews.map(g=>{var m,r;const h=(m=g.view.componentProps)==null?void 0:m.categoryView,l=((r=g.view.filterMultiple)==null?void 0:r.teamType)||1,t=h&&h.length>0?h[0].id:null;return t?{categoryId:t,teamType:l,viewId:g.view.id}:null}).filter(g=>g!==null);if(i){const g=this.childViews.find(m=>m.view.id===i);if(g){const m=a[1]||1,r=k[0];if(r){let h=null;try{h=Wh(r)}catch{}g.view.filterMultiple={categoryId:r,teamType:m},g.view.componentProps.game&&(m===1?g.view.componentProps.teamView=g.view.componentProps.game.homeTeam.team_id:m===2?g.view.componentProps.teamView=g.view.componentProps.game.awayTeam.team_id:g.view.componentProps.teamView=0),g.view.componentProps.categoryView=h?[{id:r,name:h.name}]:[{id:r,name:`Category ${r}`}]}}}if(!i){const g=a[1]||1;this.childViews.forEach(m=>{var r;const h=(r=m.view.componentProps)==null?void 0:r.categoryView;if(h&&h.length>0){const l=h[0].id;k.includes(l)&&(m.view.filterMultiple={categoryId:l,teamType:g})}})}if(W.map(g=>g.categoryId).filter(g=>!k.includes(g)).forEach(g=>{this.childViews.filter(m=>{var r;const h=(r=m.view.componentProps)==null?void 0:r.categoryView;return h&&h.length>0&&h[0].id===g}).forEach(m=>{this.removeChildView(m),Ua.emit("component-removed",{viewId:m.view.id,categoryId:g})})}),i){const g=k[0];if(g){const m=this.childViews.find(r=>r.view.id===i);if(m){let r=null;try{r=Wh(g)}catch{}const h=a[1]||1;m.view.filterMultiple={categoryId:g,teamType:h},m.view.componentProps.game&&(m.view.componentProps.teamView=h===2?m.view.componentProps.game.awayTeam.team_id:h===1?m.view.componentProps.game.homeTeam.team_id:0),m.view.componentProps.categoryView=r?[{id:g,name:r.name}]:[{id:g,name:`Category ${g}`}]}}}}else{const W=k;if(W&&i){const g=this.childViews.find(m=>m.view.id===i);if(g){let m=null;try{m=Wh(W)}catch{}const r=a[1]||1;g.view.filterMultiple={categoryId:W,teamType:r},g.view.componentProps.game&&(g.view.componentProps.teamView=r===2?g.view.componentProps.game.awayTeam.team_id:r===1?g.view.componentProps.game.homeTeam.team_id:0),g.view.componentProps.categoryView=m?[{id:W,name:m.name}]:[{id:W,name:`Category ${W}`}]}}}}if(this.viewId===8){const k=a[0]||!1;this.childViews.forEach(W=>{W.view.componentProps&&(W.view.componentProps._isReactive||(W.view.componentProps=n.reactive(W.view.componentProps),W.view.componentProps._isReactive=!0),W.view.componentProps.areInactiveVisible=k,W.view.componentProps.key=k,Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))})}if(this.viewId===1){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const W=this.childViews.find(g=>g.view.id===i);W&&this.updateComparative(W,a)}else if(this.childViews.reduce((W,g)=>(k.includes(g.view.componentProps.type)||W.push(g.view.componentProps.type),W),[]).forEach(W=>{const g=this.childViews.findIndex(m=>m.view.componentProps.type===W);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const r=this.childViews[m+1],h=this.childViews[m];r&&(h.view.componentProps.type=r.view.componentProps.type,h.view.title=r.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(k))this.childViews.length>0&&k.length>0&&this.childViews.forEach((W,g)=>{if(W.view.componentProps&&g<k.length){const m=k[g],r=jh.get(this.viewId);W.view.componentProps.type=m,W.view.componentProps.default=!1,W.view.title=`Comparativa ${r[m]}`,W.view.filterMultiple={category:m}}});else{const W=k;if(W&&this.childViews.length>0){const g=this.childViews[0];if(g.view.componentProps){const m=jh.get(this.viewId);g.view.componentProps.type=W,g.view.componentProps.default=!1,g.view.title=`Comparativa ${m[W]}`,g.view.filterMultiple={category:W}}}}}if(this.viewId===6){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const W=this.childViews.find(g=>g.view.id===i);W&&this.updateGSCLineupsReports(W,a)}else{if(Array.isArray(k))if(k.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((W,g)=>(k.includes(g.view.componentProps.gameNumber)||W.push(g.view.componentProps.gameNumber),W),[]).forEach(W=>{const g=this.childViews.findIndex(m=>m.view.componentProps.gameNumber===W);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const r=this.childViews[m+1],h=this.childViews[m];r&&(h.view.componentProps.gameNumber=r.view.componentProps.gameNumber,h.view.filterMultiple={gameNumber:r.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(W=>{W.view.componentProps&&(W.view.componentProps._isReactive||(W.view.componentProps=n.reactive(W.view.componentProps),W.view.componentProps._isReactive=!0),Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))})}}if(this.viewId===3){if(i){this.setDynamicFilters(a,i);const k=this.childViews.find(W=>W.view.id===i);k&&this.updateMatchSummary(k,a)}else{const k=a[0]||!1;this.childViews.forEach(W=>{W.view.componentProps&&(W.view.componentProps._isReactive||(W.view.componentProps=n.reactive(W.view.componentProps),W.view.componentProps._isReactive=!0),W.view.componentProps.desplegable=k,W.view.componentProps.key=k,Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))})}this.updateSummary({dynamicFilters:a})}if(this.viewId===13){const k=a[1]||[];if(i){this.setDynamicFilters(a,i);const W=this.childViews.find(g=>g.view.id===i);W&&(W.view.componentProps&&(W.view.componentProps.categoryids=k,W.view.componentProps.analysistype=a[0]||1,W.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],W.view.dynamicFilters=a,W.view._updateKey=Date.now()),Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))}else this.childViews.forEach(W=>{W.view.componentProps&&(W.view.componentProps._isReactive||(W.view.componentProps=n.reactive(W.view.componentProps),W.view.componentProps._isReactive=!0),W.view.componentProps.categoryids=k,W.view.componentProps.analysistype=a[0]||1,W.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],W.view.dynamicFilters=a,W.view._updateKey=Date.now(),Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))})}else if(this.viewId===15){const k=a[0]||1,W=a[3]!==void 0?a[3]:typeof a[1]=="number"?a[1]:null;if(i){this.setDynamicFilters(a,i);const g=this.childViews.find(m=>m.view.id===i);g&&g.view.componentProps&&(g.view.componentProps.analysistype=k,W!==null&&(g.view.componentProps.numitems=W),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),Ua.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))}else this.childViews.forEach(g=>{g.view.componentProps&&(g.view.componentProps._isReactive||(g.view.componentProps=n.reactive(g.view.componentProps),g.view.componentProps._isReactive=!0),g.view.componentProps.analysistype=k,W!==null&&(g.view.componentProps.numitems=W),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),Ua.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))})}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;if(i){const W=this.childViews.find(g=>g.view.id===i);W&&W.view.componentProps.selectedEvents}else if(!k&&this.childViews.length>0)this.childViews.forEach(W=>{this.removeChildView(W)});else if(k&&this.childViews.length===0){const W={pageId:null,view:{id:this.viewId,name:"Timeline",title:"Timeline",colspan:12,rowspan:6,max_column:12,max_row:12,min_column:6,min_row:4},filterAndWidgetContainer:this};Ua.emit("add-view",W)}else this.childViews.forEach(W=>{this.updateTimeline(W,a)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(a=>{this.removeChildView(a)})}removeChildView(a,i=!1){const k=this.childViews.findIndex(W=>W.view.id===a.view.id);if(k!==-1){const W=this.childViews[k];this.childViews.splice(k,1),W.view.id&&this.componentSpecificFilters.delete(W.view.id);const g=W.grid,m=W.page,r=document.querySelector(`[gs-id="${W.view.id}"]`);if(g&&r&&(g.removeWidget(r),m&&!i)){const h=m.items.findIndex(l=>l.id===W.view.id);h!==-1&&(m.items.splice(h,1),m.items.length===0&&Ua.emit("empty-page",m))}}}updateView({view:a,dynamicFilters:i,filtersJSON:k,filters:W}){this.setFiltersJSON(k),this.dynamicFilters=i;const g=this.childViews.find(m=>{var r;return((r=m.view)==null?void 0:r.id)===a.view.id});if(g){g.view.filtersJSON=k,g.view.coreView&&(g.view.coreView.filtersJSON=k);let m=i;if(this.viewId===4){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===8){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===3){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r),this.updateSummary({dynamicFilters:m})}else if(this.viewId===1){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===6){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===7){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===9){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}this.viewId===5?this.updateVolumetricField(g,m):this.viewId===7?this.updateGoalData(g,m):this.viewId===9?this.updateFieldDataByZones(g,i):this.viewId===10?this.updateXg(g,m):this.viewId===3?this.updateMatchSummary(g,m):this.viewId===4?this.updateTimeline(g,m):this.viewId===8?this.updateFieldPosesion(g,m):this.viewId===1?this.updateComparative(g,m):this.viewId===2?this.updateGSCtops(g,m):this.viewId===6?this.updateGSCLineupsReports(g,m):this.viewId===16&&this.updateLastTouchSingle(g,W)}}updateComparative(a,i){if(a.view.componentProps){const k=i[0]||[];if(k&&k.length>0){let W;if(Array.isArray(k)){const m=this.childViews.findIndex(r=>r.view.id===a.view.id);m>=0&&m<k.length?W=k[m]:W=k[0]}else W=k;const g=jh.get(this.viewId);a.view.componentProps.type=W,a.view.componentProps.default=!1,a.view.title=`Comparativa ${g[W]}`,a.view.filterMultiple={category:W}}Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateVolumetricField(a,i){if(a.view.componentProps){const k=i[0]||1;a.view.isHomeTeam=k===1,a.view.componentProps.preMatchType=k,a.view.filterMultiple={isHomeTeam:k},Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),Ua.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateGoalData(a,i){if(a.view.componentProps){const k=i[0]===1?"offensive":"defensive",W=i[1]===1;a.view.componentProps.analysisType=k,a.view.componentProps.isHomeTeamForAnalysis=W,a.view.isHomeTeam=W,a.view.filterMultiple={isHomeTeam:W},Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),Ua.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldDataByZones(a,i){if(a.view.componentProps){const k=i[0],W=i[1]===1;if(a.view.componentProps.isHomeTeamForAnalysis=W,a.view.isHomeTeam=W,a.view.filterMultiple={categoryIds:k,isHomeTeam:W},k&&k.length){const g=k.join("-"),m=jh.get(this.viewId).analysisTypes.get(g);m&&(a.view.componentProps.analysisType=m.analysisType,a.view.title=m.title,a.view.titleShort=m.titleShort)}}}updateXg(a,i){const k=i[0]===1;a.view.componentProps&&(a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.filtersJSON=this.filtresJSON,a.view.filterMultiple={isHomeTeam:k})}updateMatchSummary(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.desplegable=k,a.view.componentProps.key=k,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateTimeline(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=this.getComponentDynamicFilters(a.view.id)||i,W=k&&k.length>0?k[0]:[];a.view.componentProps.selectedEvents=W,a.view.componentProps.key=W.length>0;const g=this.hasEventTypeId(W,1),m=this.hasCategoryId(W,8),r=this.hasCategoryId(W,9),h=this.hasEventTypeId(W,3);a.view.componentProps.goals=g,a.view.componentProps.yellowCards=m,a.view.componentProps.redCards=r,a.view.componentProps.substitutions=h,a.view.componentProps._updateKey=Date.now(),Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:k}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:k}),Ua.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldPosesion(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.areInactiveVisible=k,a.view.componentProps.key=k,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateGSCtops(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const W=k[0];let g=null;try{g=Wh(W)}catch(r){console.warn("Error getting category by ID:",r)}const m=i[1]||1;a.view.filterMultiple={categoryId:W,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:W,name:g.name}]:[{id:W,name:`Category ${W}`}]}}else{const W=k;if(W){let g=null;try{g=Wh(W)}catch(r){console.warn("Error getting category by ID:",r)}const m=i[1]||1;a.view.filterMultiple={categoryId:W,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:W,name:g.name}]:[{id:W,name:`Category ${W}`}]}}}}updateGSCLineupsReports(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const W=k[0];a.view.filterMultiple={gameNumber:W},a.view.componentProps.gameNumber=W}}else{const W=k;W&&(a.view.filterMultiple={gameNumber:W},a.view.componentProps.gameNumber=W)}Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),Ua.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}getCategoryIdFromAnalysisType(a,i){if(!a||!i)return null;for(const k of i){const W=k.join("-"),g=jh.get(this.viewId);if(g&&g.analysisTypes){const m=g.analysisTypes.get(W);if(m&&m.analysisType===a)return k[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach(W=>{W.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,W.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,W.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,W.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const a=this.filters.selectedCategories.map(W=>W.value),i=a.map(W=>W.name),k=this.filters.selectedTeam.value;if(k===3)this.childViews.length>a&&this.childViews.reduce((W,g)=>(i.includes(g.view.componentProps.categories[0].name)||W.push(g.view.componentProps.categories[0].name),W),[]).forEach(W=>{const g=this.childViews.findIndex(m=>m.view.componentProps.categories[0].name===W);if(g!==-1){const m=this.childViews[g];this.removeChildView(m)}});else{const W=k===1,g=this.getHomeTeamViews(),m=this.getAwayTeamViews();if(W&&g.length===0)m.forEach(r=>{r.view.componentProps.isHomeTeamForAnalysis=W,r.view.isHomeTeam=W,r.view.filterMultiple.isHomeTeam=W});else if(!W&&m.length===0)g.forEach(r=>{r.view.componentProps.isHomeTeamForAnalysis=W,r.view.isHomeTeam=W,r.view.filterMultiple.isHomeTeam=W});else if(g.length===m.length)W||g.forEach(r=>{r.view.componentProps.isHomeTeamForAnalysis=W,r.view.isHomeTeam=W,r.view.filterMultiple.isHomeTeam=W}),(W?m:g).forEach(r=>{this.removeChildView(r)});else{const r=W?this.getHomeTeamViews():this.getAwayTeamViews();if(r.length>a.length){const h=a.map(l=>l.name);r.forEach(l=>{h.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=W:this.removeChildView(l)})}else r.forEach(h=>{h.view.filterMultiple.isHomeTeam=W})}}}updateLastTouchSingle(a,i){if(a.view.componentProps){const k=i.selectedTeam.value===1,W=i.selectedCategory.value;a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.componentProps.categories=[W],a.view.componentProps.analysisType=i.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=i.isAssistZoneVisible,a.view.componentProps.howManyGames=i.howManyGamesSelected.value,a.view.title=W.name,a.view.titleShort=W.name,a.view.isHomeTeam=k,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:W,selectedGamePhase:i.selectedGamePhase,howManyGamesSelected:i.howManyGamesSelected,isAssistZoneVisible:i.isAssistZoneVisible}}}}const W5e={class:"template-page__header"},j5e={class:"template-page__header__name"},K5e=["value"],A5e={class:"template-page__header__details"},I5e={class:"template-page__header__details__teams"},X5e={class:"template-page__header__details__teams__team"},D5e={key:0,class:"template-page__header__details__teams__team__logo"},J5e=["src"],G5e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B5e={class:"template-page__header__details__teams__team"},Z5e={key:0,class:"template-page__header__details__teams__team__logo"},H5e=["src"],Y5e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Q5e={class:"template-page__content"},$5e=["id"],e_e=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-max-w","gs-max-h","gs-min-w","gs-min-h","gs-no-resize","gs-no-move","gs-auto-position"],t_e=n.defineComponent({__name:"TemplateReportPage",props:{token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},game:{type:Object,default:()=>null},lastGames:{type:Array,default:()=>null},id:{type:[String,Number],default:()=>String(Date.now())},page:{type:Object,default:()=>({title:"Page 1",items:[{name:"Tabla jugadores",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]})},isPostMatch:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},isFilterVisible:{type:Boolean,default:!1}},emits:["intersection-changed","delete-page","change-sort","edit-view","view-changed","component-props-updated","delete-view","dynamic-filters-changed"],setup(e,{emit:a}){var i,k,W;const g=n.ref(null);let m=null;const r=e,h=n.ref(!1),l=a,t=n.computed(()=>r.page.items.reduce((j,K)=>(j.set(K.id,K),j),new Map)),_=n.computed(()=>{var j,K,X,D;return r.game&&r.game.homeTeam&&r.game.awayTeam?{homeTeam:{name:((j=r.game.homeTeam)==null?void 0:j.acronym)||"LOC",logo:((K=r.game.homeTeam)==null?void 0:K.logo)||null},awayTeam:{name:((X=r.game.awayTeam)==null?void 0:X.acronym)||"VIS",logo:((D=r.game.awayTeam)==null?void 0:D.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let w=null,v=null,f=!1,o=null,s=!1;const p=()=>{s=!0},c=()=>{s=!1};function d(){s||(f=!0,o&&clearTimeout(o),o=setTimeout(()=>{f=!1},150))}function b(){const j={root:null,rootMargin:"0px",threshold:.7};w=new IntersectionObserver(D=>{D.forEach(H=>{if(f){v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},100);return}v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},50)})},j);const K=g.value;K&&w.observe(K);const X=document.querySelector(".container-main");X&&X.addEventListener("scroll",d,{passive:!0}),document.addEventListener("programmatic-scroll-start",p),document.addEventListener("programmatic-scroll-end",c)}function x(j){r.page.title=j.target.value,l("view-changed")}const T={game_id:0,season_id:0,prematch:!1},N={gameId:90209,id:90209,seasonId:1909,regularSeasonId:1909,matchday_name:"Matchday 1",status:1,score:[1,3],game_status:1,dateTimeUTC:"2024-09-05T22:00:00Z",homeTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/2936.png",team_id:2936,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/2936.png",colloquial_name:"Guyana",acronym:"GUY",team_name:"Guyana"},awayTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/3279.png",team_id:3279,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/3279.png",colloquial_name:"Surinam",acronym:"SUR",team_name:"Surinam"},is_live:0,minutes:{home_goals_minutes:[],visiting_goals_minutes:[],home_yellow_cards_minutes:[],away_yellow_cards_minutes:[],home_red_cards_minutes:[],away_red_cards_minutes:[]}},V=new Map([[5,{component:ET,componentName:"GSCVolumetricField",props:{isGamePreMatch:!r.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:r.isTemplateMode,isTemplateMode:r.isTemplateMode,preMatchType:1}}],[2,{component:L4,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:r.game?r.game.id:N.gameId,game:r.game,season:r.game?(i=r==null?void 0:r.game)==null?void 0:i.season_id:N.seasonId,teamView:0,useDummyData:r.isTemplateMode}}],[8,{component:Ok,componentName:"FieldPosesion",props:{widthSection:600,game:N,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:C8,componentName:"GSCLineupsReports",props:{selectedOption:r.isPostMatch?"Postmatch":"Prematch",game:T,gamehome:T,gameaway:T}}],[3,{component:zk,componentName:"GSCMatchSummary",props:{game:N,defaultShields:!0,desplegable:!1}}],[4,{component:y7,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:N.gameId,homeTeam:N.homeTeam.team_id,awayTeam:N.awayTeam.team_id,token:r.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:w9,componentName:"GSCGoalData",props:{game:r.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!r.isPostMatch,analysisType:1}}],[9,{component:P8,componentName:"GSCFieldDataByZones",props:{game:r.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!r.isPostMatch,negative:!0}}],[10,{component:Qw,componentName:"GSCGameXg",props:{game:r.game,isHomeTeamForAnalysis:!0,isPostMatch:r.isPostMatch}}],[13,{component:DS,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:r.game?(k=r==null?void 0:r.game)==null?void 0:k.season_id:0,teamsIds:[8,13],categoryIds:[20,2],analysisType:1,teamsshow:[1],gameId:90401,teams:[{id:8,name:"MAZ",logo:"https://golstatsimages.blob.core.windows.net/teams-80/8.png"},{id:13,name:"SNL",logo:"https://golstatsimages.blob.core.windows.net/teams-80/13.png"}]}}],[14,{component:nS,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:xL,componentName:"GSCStrengths",props:{token:r.token,view:1,numitems:3,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[10,{component:Qw,componentName:"GSCGameXg",props:{game:r.game,isHomeTeamForAnalysis:!0,isPostMatch:r.isPostMatch}}],[1,{component:v9,componentName:"GSCComparativeReports",props:{gameId:r.game?r.game.id:"",homeLogo:r.game?r.game.homeTeam.logo:"",awayLogo:r.game?r.game.awayTeam.logo:"",seasonId:r.game?(W=r==null?void 0:r.game)==null?void 0:W.season_id:0,typeGame:r.isPostMatch,type:"stoppedBall",default:r.isTemplateMode}}],[16,{component:LL,componentName:"GSCLastTouch",props:{categories:[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}],gameIdsForAnalysis:[],isAssistZoneVisible:!1,seasonId:2010,analysisType:"offensive",teamIdForAnalysis:1,isHomeTeamForAnalysis:!0,isTemplateMode:r.isTemplateMode}}]]);function U(j){if(j)if(typeof j=="string"){let K=null;switch(j){case"GSCVolumetricField":K=ET;break;case"GSCGoalData":K=w9;break;case"GscTopPlayer":K=L4;break;case"FieldPosesion":K=Ok;break;case"GSCLineupsReports":K=C8;break;case"GSCMatchSummary":K=zk;break;case"GSCTimelineReports":K=y7;break;case"GSCFieldDataByZones":K=P8;break;case"GSCGeneraltable":K=nS;break;case"GSCTimelapseTable":K=DS;break;case"GSCGameXg":K=Qw;break;case"GSCComparativeReports":K=v9;break;case"GSCStrengths":K=xL;break;case"GSCLastTouch":K=LL;break;default:K=null}return K}else return j;return null}function z({pageId:j,view:K,filterAndWidgetContainer:X,applyMinimumSize:D=!1,dynamicFilters:H=[],filters:ne=null}){if(r.page.id===j&&m){let G=!1;K.id===3&&(G=H[0]);const re=`min_column${G?"_2":""}`,ee=`min_row${G?"_2":""}`,Y=`colspan${G?"_2":""}`,$=`rowspan${G?"_2":""}`,le={w:D?K[re]:K[Y],h:D?K[ee]:K[$]};if(m.willItFit(0,0,le.w,le.h,!0)){const ie=m.addWidget(le),ue=Number(ie.getAttribute("gs-x")||0),he=Number(ie.getAttribute("gs-y")||0);m.removeWidget(ie);const ae=V.get(K.id),de=n.reactive({...JSON.parse(JSON.stringify(ae.props))||{},_isReactive:!0}),ce=n.reactive({pageId:j,grid:m,page:r.page,view:{name:K.name,title:K.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ue,y:he,w:le.w,h:le.h,maxWidth:K.max_column,maxHeight:K.max_row,minWidth:K.min_column,minHeight:K.min_row,componentName:ae.componentName,componentProps:de,pageId:j,coreView:K}});X.addView(ce),Ua.emit("add-page-view",ce)}else Ua.emit("add-page-and-view",{pageId:j,view:K,filterAndWidgetContainer:X})}}function O(j){if(m){const K=document.querySelector(`[gs-id="${j.id}"]`);K&&(m.removeWidget(K),l("delete-view",j))}l("view-changed")}function C(j){if(!j.filterAndViewsContainer&&j.coreView){const K=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[j],j.coreView.id,j.dynamicFilters||[],r.isPostMatch,r.isTemplateMode,j.filtersJSON,null,j.filters);j.filterAndViewsContainer=K}l("edit-view",j)}function q(){l("delete-page",r.page)}function L(){Ua.emit("change-sort",r.page)}function P(j){if(f)return;const K=r.page.items.find(X=>X.id===j.itemId||X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps),K._updateKey=Date.now())}function S(j){if(f)return;const K=r.page.items.find(X=>X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps),K._updateKey=Date.now())}function F(j){if(f)return;const K=r.page.items.find(X=>X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps||{}),K._updateKey=Date.now())}const R=function(){Ua.off("add-view",z),Ua.off("force-component-update",P),Ua.off("component-props-updated",S),Ua.off("dynamic-filters-changed",F);const j=document.querySelector(".container-main");j&&j.removeEventListener("scroll",d),v&&clearTimeout(v),o&&clearTimeout(o)};return Ua.on("add-view",z),Ua.on("force-component-update",P),Ua.on("component-props-updated",S),Ua.on("dynamic-filters-changed",F),n.onMounted(async()=>{await n.nextTick(),m=vi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${r.id}`),m.on("change",(j,K)=>{const X=K[0];if(X){const D=t.value.get(X.id);D&&(D.x=X.x,D.y=X.y,D.w=X.w,D.h=X.h,l("view-changed"))}}),b(),r.page.grid=m,r.page.offListeners=R}),n.onUnmounted(()=>{w&&w.disconnect(),R(),v&&clearTimeout(v),o&&clearTimeout(o),document.removeEventListener("programmatic-scroll-start",p),document.removeEventListener("programmatic-scroll-end",c)}),(j,K)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"templatePage",ref:g,class:"template-page"},[n.createElementVNode("div",W5e,[h.value?(n.openBlock(),n.createBlock(NL,{key:0,"options-type":"page",onClick:K[0]||(K[0]=n.withModifiers(X=>h.value=!1,["self"])),onMouseleave:K[1]||(K[1]=X=>h.value=!1),onCloseTooltip:K[2]||(K[2]=X=>h.value=!1),onDeletePage:q,onChangeSort:L})):n.createCommentVNode("",!0),n.createElementVNode("div",j5e,[K[4]||(K[4]=n.createElementVNode("div",null,[n.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M11.2986 12.9994C7.62909 14.8341 4.11744 16.0178 1.35547 16.4518L9.18763 20.0029C9.34545 20.0818 9.60192 20.0818 9.74002 20.0029L17.8878 16.3137C18.0457 16.2348 18.164 16.0572 18.164 15.8797V8.75781C16.2898 10.2177 13.9422 11.6776 11.2986 12.9994Z",fill:"white"}),n.createElementVNode("path",{d:"M4.7152 8.89735C4.7152 8.89735 10.9494 3.76802 16.8482 1.20335C15.0529 0.946887 11.3637 0.43395 9.3711 0.453678C4.41928 0.493135 1.06546 1.34145 1.06546 1.34145C0.90763 1.3809 0.769531 1.55846 0.769531 1.71629V8.12795C3.01857 6.56942 5.34651 5.56329 5.34651 5.56329C5.34651 5.56329 2.72264 7.06263 0.769531 8.81844V9.41028V14.1648C3.09748 13.9675 6.62886 12.7641 10.3575 10.7321C13.6719 8.91707 16.4733 6.84562 18.17 5.05035V2.40677C14.3032 3.37346 4.7152 8.89735 4.7152 8.89735Z",fill:"white"})])],-1)),K[5]||(K[5]=n.createElementVNode("div",{class:"separator"},null,-1)),n.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:x},null,40,K5e)]),n.createElementVNode("div",A5e,[n.createElementVNode("div",I5e,[n.createElementVNode("div",X5e,[_.value.homeTeam.logo?(n.openBlock(),n.createElementBlock("div",D5e,[n.createElementVNode("img",{src:_.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,J5e)])):(n.openBlock(),n.createElementBlock("svg",G5e,[...K[6]||(K[6]=[n.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])])),n.createElementVNode("span",null,n.toDisplayString(_.value.homeTeam.name),1)]),K[8]||(K[8]=n.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),n.createElementVNode("div",B5e,[n.createElementVNode("span",null,n.toDisplayString(_.value.awayTeam.name),1),_.value.awayTeam.logo?(n.openBlock(),n.createElementBlock("div",Z5e,[n.createElementVNode("img",{src:_.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,H5e)])):(n.openBlock(),n.createElementBlock("svg",Y5e,[...K[7]||(K[7]=[n.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])]))])]),e.isTemplateMode&&!e.isFilterVisible?(n.openBlock(),n.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:K[3]||(K[3]=X=>h.value=!0)},[...K[9]||(K[9]=[n.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",Q5e,[n.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.page.items,X=>{var D,H,ne;return n.openBlock(),n.createElementBlock("div",{class:"grid-stack-item",key:X.key,"gs-id":X.id,"gs-x":X.x,"gs-y":X.y,"gs-w":X.w,"gs-h":X.h,"gs-max-w":X.maxWidth,"gs-max-h":X.maxHeight,"gs-min-w":X.minWidth,"gs-min-h":X.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!r.isTemplateMode,"gs-auto-position":X.x===0&&X.y===0},[n.createElementVNode("div",{class:n.normalizeClass(["grid-stack-item-content",{"is-selected":X.isSelected}])},[n.createVNode(O5e,{view:X,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":(D=X.componentProps)!=null&&D.preMatchType?((H=X.componentProps)==null?void 0:H.preMatchType)===1:X.isHomeTeam,"is-filter-visible":e.isFilterVisible,"view-id":((ne=X==null?void 0:X.coreView)==null?void 0:ne.id)||0,onEdit:G=>C(X),onDelete:G=>O(X)},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(U(X.componentName)),n.mergeProps({ref_for:!0},X.componentProps,{key:`${X.id}-${X._updateKey||0}`}),null,16))]),_:2},1032,["view","is-template-mode","is-post-match","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,e_e)}),128))],8,$5e)])],512))}}),r_e=jd(t_e,[["__scopeId","data-v-82a5f737"]]),n_e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},a_e={key:0,class:"cover__main-logo cover__main-logo__home"},i_e={key:0,class:"team-logo"},o_e=["src"],s_e={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l_e=["fill"],c_e={key:1,class:"cover__main-logo cover__main-logo__away"},u_e={key:0,class:"team-logo"},d_e=["src"],p_e={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h_e=["fill"],f_e={class:"cover__title-subtitle"},m_e={class:"cover__title-subtitle__title"},y_e={class:"cover__title-subtitle__subtitle"},g_e={key:2,class:"cover-type-one"},v_e={class:"team-info-one"},b_e={class:"team-data"},x_e={key:0,class:"team-logo"},w_e=["src"],__e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},S_e=["fill","opacity"],T_e={class:"team-name"},k_e={key:0,class:"team-events"},L_e={class:"score-one"},N_e={key:0},V_e={class:"team-info-one"},O_e={class:"team-data"},q_e={key:0,class:"team-logo"},U_e=["src"],z_e={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C_e=["fill","opacity"],P_e={class:"team-name"},F_e={key:0,class:"team-events"},E_e={key:3,class:"cover-type-two"},R_e={class:"team-data"},M_e={class:"team-info"},W_e={key:0,class:"team-logo"},j_e=["src"],K_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},A_e=["fill","opacity"],I_e={key:2,class:"team-score-two"},X_e={key:0,class:"team-goals"},D_e={class:"team-data"},J_e={class:"team-info"},G_e={key:0,class:"team-score-two"},B_e={key:1,class:"team-logo"},Z_e=["src"],H_e={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y_e=["fill","opacity"],Q_e={key:0,class:"team-goals"},$_e={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:a}){const i=e,k=a,W=n.ref(null),g=n.computed(()=>[1,2].includes(i.coverId)),m=n.computed(()=>[1,3].includes(i.coverId)),r=n.computed(()=>i.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:i.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),h=n.computed(()=>i.game&&i.game.score?i.game.score:["0","0"]),l=n.computed(()=>{var U,z,O,C,q,L,P,S;if(i.game&&i.game.homeTeam&&i.game.awayTeam){const F={homeTeam:{name:((U=i.game.homeTeam)==null?void 0:U.acronym)||"LOC",logo:((z=i.game.homeTeam)==null?void 0:z.logo)||null},awayTeam:{name:((O=i.game.awayTeam)==null?void 0:O.acronym)||"VIS",logo:((C=i.game.awayTeam)==null?void 0:C.logo)||null}};return g.value?(F.homeTeam.goalsMinutes=o(i.game.minutes.home_goals_minutes),F.homeTeam.totalYellowCards=((q=i.game.minutes.home_yellow_cards_minutes)==null?void 0:q.length)||0,F.homeTeam.totalRedCards=((L=i.game.minutes.home_red_cards_minutes)==null?void 0:L.length)||0,F.awayTeam.goalsMinutes=o(i.game.minutes.visiting_goals_minutes),F.awayTeam.totalYellowCards=((P=i.game.minutes.away_yellow_cards_minutes)==null?void 0:P.length)||0,F.awayTeam.totalRedCards=((S=i.game.minutes.away_red_cards_minutes)==null?void 0:S.length)||0):(F.homeTeam.goalsEvents=f(i.game.report_minutes.home_goals_minutes),F.awayTeam.goalsEvents=f(i.game.report_minutes.visiting_goals_minutes)),F}return{homeTeam:{name:"LOC",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]},awayTeam:{name:"VIS",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]}}}),t=n.computed(()=>({"--background-image":m.value?"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-01@2x.jpg)":"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-02@2x.jpg)","--grid-template-columns-type-one":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":i.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":i.isPostMatch?"100%":"fit-content"})),_=n.computed(()=>i.isPostMatch?"Postmatch":"Prematch"),w=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],v=n.computed(()=>{if(i.game){let U=n_e[i.game.matchday_abbreviation];U||(U=i.game.matchday_abbreviation.replace("M","J"));const[z,O,C]=i.game.date.split("-");return`${U} - ${C} ${w[Number(O)-1]}, ${z}`}return"Jornada - Día 00 Mes"});function f(U){return!U||!Array.isArray(U)||U.length===0?"":U.map(z=>{const O=z.split(", ");let C=O[0].replace("'","");C=C.replace("+",""),C=C.replace("’","");const q=C.split(" "),{strings:L,numbers:P}=q.reduce((R,j)=>(isNaN(Number(j))?R.strings.push(j):R.numbers.push(j),R),{strings:[],numbers:[]}),S=L.join(" "),F=P.length===1?`${P[0]}'`:`${P[0]}' ${P.slice(1).join(" + ")}'`;return{playerName:S,goalTime:O.length===1?F:`${F}, ${O.reduce((R,j,K)=>K===0?R:`${R}${j}${K<O.length-1?", ":""}`,"")}`}})}function o(U){return!U||!Array.isArray(U)||U.length===0?"":U.reduce((z,O,C)=>{const q=O.split(" ");let L="";return q.length===3?L=q[2]:q.length===5&&(L=`${q[2]} ${q[3]} ${q[4]}`),L&&(z+=`${L}${C<U.length-1?", ":""}`),z},"")}let s=null,p=null,c=!1,d=null,b=!1;const x=()=>{b=!0},T=()=>{b=!1};function N(){b||(c=!0,d&&clearTimeout(d),d=setTimeout(()=>{c=!1},150))}function V(){const U={root:null,rootMargin:"0px",threshold:.7};s=new IntersectionObserver(C=>{C.forEach(q=>{if(c){p&&clearTimeout(p),p=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},100);return}p&&clearTimeout(p),p=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},50)})},U);const z=W.value;z&&s.observe(z);const O=document.querySelector(".container-main");O&&O.addEventListener("scroll",N,{passive:!0}),document.addEventListener("programmatic-scroll-start",x),document.addEventListener("programmatic-scroll-end",T)}return n.onMounted(()=>{V()}),n.onUnmounted(()=>{s&&s.disconnect();const U=document.querySelector(".container-main");U&&U.removeEventListener("scroll",N),document.removeEventListener("programmatic-scroll-start",x),document.removeEventListener("programmatic-scroll-end",T),p&&clearTimeout(p),d&&clearTimeout(d)}),(U,z)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"coverPage",ref:W,class:"cover",style:n.normalizeStyle(t.value)},[g.value?(n.openBlock(),n.createElementBlock("div",a_e,[l.value.homeTeam.logo?(n.openBlock(),n.createElementBlock("div",i_e,[n.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,o_e)])):(n.openBlock(),n.createElementBlock("svg",s_e,[n.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:r.value.homeTeam},null,8,l_e)]))])):n.createCommentVNode("",!0),g.value?(n.openBlock(),n.createElementBlock("div",c_e,[l.value.awayTeam.logo?(n.openBlock(),n.createElementBlock("div",u_e,[n.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,d_e)])):(n.openBlock(),n.createElementBlock("svg",p_e,[n.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:r.value.awayTeam},null,8,h_e)]))])):n.createCommentVNode("",!0),n.createElementVNode("div",f_e,[n.createElementVNode("div",m_e,[z[0]||(z[0]=n.createElementVNode("div",null,"Análisis",-1)),n.createElementVNode("div",null,n.toDisplayString(_.value),1)]),n.createElementVNode("div",y_e,n.toDisplayString(v.value),1)]),g.value?(n.openBlock(),n.createElementBlock("div",g_e,[n.createElementVNode("div",v_e,[n.createElementVNode("div",b_e,[l.value.homeTeam.logo?(n.openBlock(),n.createElementBlock("div",x_e,[n.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,w_e)])):(n.openBlock(),n.createElementBlock("svg",__e,[n.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:r.value.homeTeam,opacity:r.value.opacity},null,8,S_e)])),n.createElementVNode("div",T_e,n.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",k_e,[z[1]||(z[1]=n.createStaticVNode('<svg class="ball" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),n.createElementVNode("div",null,n.toDisplayString(l.value.homeTeam.goalsMinutes),1),z[2]||(z[2]=n.createElementVNode("div",{class:"separator"},null,-1)),z[3]||(z[3]=n.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),n.createElementVNode("div",null,n.toDisplayString(l.value.homeTeam.totalYellowCards),1),z[4]||(z[4]=n.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),n.createElementVNode("div",null,n.toDisplayString(l.value.homeTeam.totalRedCards),1)])):n.createCommentVNode("",!0)]),n.createElementVNode("div",L_e,[e.isPostMatch?(n.openBlock(),n.createElementBlock("div",N_e,n.toDisplayString(h.value[0])+" : "+n.toDisplayString(h.value[1]),1)):n.createCommentVNode("",!0)]),n.createElementVNode("div",V_e,[n.createElementVNode("div",O_e,[l.value.awayTeam.logo?(n.openBlock(),n.createElementBlock("div",q_e,[n.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,U_e)])):(n.openBlock(),n.createElementBlock("svg",z_e,[n.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:r.value.awayTeam,opacity:r.value.opacity},null,8,C_e)])),n.createElementVNode("div",P_e,n.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",F_e,[n.createElementVNode("div",null,n.toDisplayString(l.value.awayTeam.totalYellowCards),1),z[5]||(z[5]=n.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),n.createElementVNode("div",null,n.toDisplayString(l.value.awayTeam.totalRedCards),1),z[6]||(z[6]=n.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),z[7]||(z[7]=n.createElementVNode("div",{class:"separator"},null,-1)),n.createElementVNode("div",null,n.toDisplayString(l.value.awayTeam.goalsMinutes),1),z[8]||(z[8]=n.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))])):n.createCommentVNode("",!0)])])):(n.openBlock(),n.createElementBlock("div",E_e,[n.createElementVNode("div",R_e,[n.createElementVNode("div",M_e,[l.value.homeTeam.logo?(n.openBlock(),n.createElementBlock("div",W_e,[n.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,j_e)])):(n.openBlock(),n.createElementBlock("svg",K_e,[n.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:r.value.homeTeam,opacity:r.value.opacity},null,8,A_e)])),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",I_e,n.toDisplayString(h.value[0]),1)):n.createCommentVNode("",!0)]),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",X_e,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value.homeTeam.goalsEvents,(O,C)=>(n.openBlock(),n.createElementBlock("div",{key:`goal-${C}`,class:"goal"},[n.createElementVNode("div",null,n.toDisplayString(O.playerName),1),z[9]||(z[9]=n.createElementVNode("div",{class:"bullet"},null,-1)),n.createElementVNode("div",null,n.toDisplayString(O.goalTime),1),z[10]||(z[10]=n.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))]))),128))])):n.createCommentVNode("",!0)]),z[13]||(z[13]=n.createElementVNode("div",{class:"separator"},null,-1)),n.createElementVNode("div",D_e,[n.createElementVNode("div",J_e,[e.isPostMatch?(n.openBlock(),n.createElementBlock("div",G_e,n.toDisplayString(h.value[1]),1)):n.createCommentVNode("",!0),l.value.awayTeam.logo?(n.openBlock(),n.createElementBlock("div",B_e,[n.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,Z_e)])):(n.openBlock(),n.createElementBlock("svg",H_e,[n.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:r.value.awayTeam,opacity:r.value.opacity},null,8,Y_e)]))]),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",Q_e,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value.awayTeam.goalsEvents,(O,C)=>(n.openBlock(),n.createElementBlock("div",{key:`goal-a-${C}`,class:"goal"},[z[11]||(z[11]=n.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),n.createElementVNode("div",null,n.toDisplayString(O.goalTime),1),z[12]||(z[12]=n.createElementVNode("div",{class:"bullet"},null,-1)),n.createElementVNode("div",null,n.toDisplayString(O.playerName),1)]))),128))])):n.createCommentVNode("",!0)])]))],4))}},eSe=jd($_e,[["__scopeId","data-v-6680cbcf"]]),tSe={class:"table-category-filters"},rSe={key:0,class:"custom-radio-group filter-inline"},nSe={class:"radio-label"},aSe={class:"radio-options"},iSe=["name","value","onUpdate:modelValue","onClick"],oSe=["data-filter-type","onClick","onMousedown","onMouseup"],sSe={class:"select-display"},lSe={class:"select-label"},cSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},uSe={class:"simple-select-scroll-area"},dSe=["onClick"],pSe={class:"option-content"},hSe={class:"option-title"},fSe={key:0,class:"option-checkmark"},mSe={key:2,class:"filter-separator"},ySe={__name:"TableCategoryFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:13}},emits:["filters-changed","filter-updated"],setup(e,{expose:a,emit:i}){const k=e,W=i,g=n.ref([]);let m=null;const r=(b,x)=>{if(!x)return!0;for(let T=0;T<b.length;T++)if(!h(b[T],x[T]))return!0;return!1},h=(b,x)=>{if(Array.isArray(b)&&Array.isArray(x)){if(b.length!==x.length)return!1;for(let T=0;T<b.length;T++)if(b[T]!==x[T])return!1;return!0}return b===x},l=n.ref(null),t=n.ref([]);let _=!1,w=null;const v=()=>{w=null},f=()=>{setTimeout(()=>{_=!1},1e3)},o=(b,x=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const T=k.filters[0].options,N=k.filters[1].options;b!=null?T.findIndex(V=>V.value===b)!==-1&&N[b]?(t.value=N[b],x&&!(()=>{const V=g.value[1];return V==null?!1:Array.isArray(V)?V.length>0:V!==""})()&&!_&&t.value.length>0&&(g.value[1]=t.value[0].value,n.nextTick(()=>{}))):(t.value=[],g.value[1]=null):(t.value=[],g.value[1]=null)}},s=()=>{k.initialValues&&k.initialValues.length>0?g.value=[...k.initialValues]:g.value=k.filters.map(b=>{var x,T,N,V;return b.type==="select"?[]:b.type==="check"?!1:b.type==="radio-button"?((T=(x=b.options)==null?void 0:x[0])==null?void 0:T.value)||null:b.type==="select-simple"&&((V=(N=b.options)==null?void 0:N[0])==null?void 0:V.value)||null}),k.componentId===13&&g.value.some(b=>b!=null&&(Array.isArray(b)?b.length>0:b!==!1&&b!==""))&&(m=[...g.value],W("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};s(),setTimeout(()=>{n.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!_){const b=!(()=>{const x=g.value[1];return x==null?!1:Array.isArray(x)?x.length>0:x!==""})();o(g.value[0],b)}})},300),n.watch(()=>k.initialValues,b=>{const x=!h(g.value,b),T=b&&b.length>0&&!_&&x,N=k.isEditMode&&_;T&&!N?g.value=[...b]:_?w&&w.length>0&&(g.value=[...w]):N&&w&&w.length>0&&(g.value=[...w])},{deep:!0}),n.watch(()=>k.isEditMode,(b,x)=>{x===!0&&b===!1&&v()},{immediate:!0}),n.watch(g,(b,x)=>{b.some(T=>T!=null&&(Array.isArray(T)?T.length>0:T!==!1&&T!==""))&&r(b,m)&&(m=[...b],W("filters-changed",{componentId:k.componentId,filters:b,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),n.watch(()=>g.value[0],(b,x)=>{b!==x&&x!==void 0?o(b,!0):x===void 0&&b!==null&&b!==void 0&&o(b,!1)},{immediate:!0}),n.watch(()=>g.value,(b,x)=>{k.filters.map((T,N)=>T.type==="radio-button"?N:-1).filter(T=>T!==-1).forEach(T=>{})},{deep:!0}),n.watch(t,()=>{},{deep:!0});const p=b=>{l.value===b?l.value=null:l.value=b},c=(b,x)=>{if(_=!0,f(),g.value[b]=x,(b===0||b===1)&&(w=[...g.value]),l.value=null,b===0){g.value[1]!==void 0&&(g.value[1]=null);const T=_;_=!1,o(x,!0),_=T,g.value[1]!==null&&g.value[1]!==void 0&&(w=[...g.value])}},d=()=>{_=!0,setTimeout(()=>{_=!1},1e3)};return a({getCurrentValues:()=>g.value,initializeValues:s}),(b,x)=>(n.openBlock(),n.createElementBlock("div",tSe,[e.filters&&e.filters.length>0?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.filters,(T,N)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:N},[T.type==="radio-button"?(n.openBlock(),n.createElementBlock("div",rSe,[n.createElementVNode("div",nSe,n.toDisplayString(T.label),1),n.createElementVNode("div",aSe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(T.options,V=>(n.openBlock(),n.createElementBlock("label",{key:V.value,class:n.normalizeClass(["radio-option-card",{active:g.value[N]===V.value}])},[n.withDirectives(n.createElementVNode("input",{type:"radio",name:"table-radio-"+N,value:V.value,"onUpdate:modelValue":U=>g.value[N]=U,onChange:x[0]||(x[0]=()=>{d()}),onClick:U=>console.log("Click en radio button",N,V.value,"Valor actual:",g.value[N])},null,40,iSe),[[n.vModelRadio,g.value[N]]]),n.createElementVNode("span",null,n.toDisplayString(V.label),1)],2))),128))])])):T.type==="select-simple"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":T.type,onClick:n.withModifiers(V=>p(N),["stop"]),onMousedown:V=>console.log("Mouse down en selector",N),onMouseup:V=>console.log("Mouse up en selector",N)},[n.createElementVNode("div",sSe,[x[2]||(x[2]=n.createElementVNode("span",{class:"select-icon select-analisis-icon"},[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),n.createElementVNode("span",lSe,n.toDisplayString(T.label||"Tipo de análisis"),1),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:l.value===N}])},[...x[1]||(x[1]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===N?(n.openBlock(),n.createElementBlock("div",cSe,[n.createElementVNode("div",uSe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N===1?t.value:T.options,V=>(n.openBlock(),n.createElementBlock("div",{key:V.value,class:n.normalizeClass(["option-card simple-select-option",{active:h(g.value[N],V.value)}]),onClick:n.withModifiers(U=>c(N,V.value),["stop"])},[n.createElementVNode("div",pSe,[n.createElementVNode("div",hSe,n.toDisplayString(V.label),1)]),h(g.value[N],V.value)?(n.openBlock(),n.createElementBlock("div",fSe,[...x[3]||(x[3]=[n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):n.createCommentVNode("",!0)],10,dSe))),128))])])):n.createCommentVNode("",!0)],40,oSe)):n.createCommentVNode("",!0),N===1&&e.filters.length>2?(n.openBlock(),n.createElementBlock("div",mSe)):n.createCommentVNode("",!0)],64))),128))],2)):n.createCommentVNode("",!0)]))}},gSe=jd(ySe,[["__scopeId","data-v-9d00f072"]]),vSe={class:"strengths-filters"},bSe={key:0,class:"custom-radio-group filter-inline"},xSe={class:"radio-label"},wSe={class:"radio-options"},_Se=["name","value","onUpdate:modelValue"],SSe={class:"filter-inline select-with-label"},TSe=["data-filter-type","onClick"],kSe={class:"select-display"},LSe={class:"select-label"},NSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},VSe={class:"simple-select-scroll-area"},OSe=["onClick"],qSe={class:"option-content"},USe={class:"option-title"},zSe={key:0,class:"option-checkmark"},CSe={key:2,class:"filter-separator"},PSe={__name:"StrengthsFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:15}},emits:["filters-changed","filter-updated"],setup(e,{expose:a,emit:i}){const k=e,W=i,g=n.ref([]);let m=null;const r=n.ref(null),h=n.ref([]);let l=!1,t=null;const _=(p,c)=>{if(Array.isArray(p)&&Array.isArray(c)){if(p.length!==c.length)return!1;for(let d=0;d<p.length;d++)if(p[d]!==c[d])return!1;return!0}return p===c},w=(p,c=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const d=k.filters[0].options,b=k.filters[1].options;p!=null?d.findIndex(x=>x.value===p)!==-1&&b[p]?(h.value=b[p],c&&!(()=>{const x=g.value[1];return x==null?!1:Array.isArray(x)?x.length>0:x!==""})()&&!l&&h.value.length>0&&(g.value[1]=h.value[0].value,n.nextTick(()=>{}))):(h.value=[],g.value[1]=null):(h.value=[],g.value[1]=null)}},v=()=>{if(k.initialValues&&k.initialValues.length>0){const c=k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",c),c?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",k.initialValues),g.value=[...k.initialValues]):k.isEditMode?g.value=k.filters.map((d,b)=>{var x,T,N,V,U,z,O,C,q,L;const P=k.initialValues[b];if(console.log(`StrengthsFilters initializeValues - filter[${b}]:`,d==null?void 0:d.type,"filterData:",P),!P)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${b}, usando valor por defecto`),d.type==="select"?[]:d.type==="check"?!1:d.type==="radio-button"?((T=(x=d.options)==null?void 0:x[0])==null?void 0:T.value)||null:d.type==="select-simple"&&((V=(N=d.options)==null?void 0:N[0])==null?void 0:V.value)||null;if(d.type==="radio-button"&&P.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",P.selectedOption,"index:",b);const S=P.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",S),S}else{if(d.type==="radio-button"&&!P.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",P,"index:",b),P.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",P.selectedValue),P.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((z=(U=d.options)==null?void 0:U[0])==null?void 0:z.value)||null);if(d.type==="select-simple"&&P.selectedValue!==void 0)return Array.isArray(P.selectedValue)?P.selectedValue[0]:P.selectedValue;if(d.type==="select"&&P.selectedOptions)return P.selectedOptions.map(S=>S.value);if(d.type==="check"&&P.isChecked!==void 0)return P.isChecked}return P.selectedValue!==void 0?P.selectedValue:d.type==="select"?[]:d.type==="check"?!1:d.type==="radio-button"?((C=(O=d.options)==null?void 0:O[0])==null?void 0:C.value)||null:d.type==="select-simple"&&((L=(q=d.options)==null?void 0:q[0])==null?void 0:L.value)||null}):g.value=[...k.initialValues]}else g.value=k.filters.map(c=>{var d,b,x,T;return c.type==="select"?[]:c.type==="check"?!1:c.type==="radio-button"?((b=(d=c.options)==null?void 0:d[0])==null?void 0:b.value)||null:c.type==="select-simple"&&((T=(x=c.options)==null?void 0:x[0])==null?void 0:T.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",g.value);const p=g.value.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",p),p&&(m=[...g.value],W("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};v(),setTimeout(()=>{n.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!l){const p=!(()=>{const c=g.value[1];return c==null?!1:Array.isArray(c)?c.length>0:c!==""})();w(g.value[0],p)}})},300),n.watch(()=>k.initialValues,(p,c)=>{if(!p||p.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",p),console.log("StrengthsFilters watch initialValues - oldValues:",c),console.log("StrengthsFilters watch initialValues - props.isEditMode:",k.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const d=p.length>0&&(typeof p[0]=="number"||typeof p[0]=="boolean"||p[0]===null||Array.isArray(p[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",d);const b=!_(g.value,p),x=p&&p.length>0&&!l&&b,T=k.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",b,"shouldUpdate:",x,"isEditModeProtection:",T),x&&!T?d?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",p),g.value=[...p]):k.isEditMode?g.value=k.filters.map((N,V)=>{const U=p[V];if(!U)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",V),g.value[V];if(N.type==="radio-button"&&U.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",U.selectedOption,"index:",V);const z=U.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",z),z}else{if(N.type==="select-simple"&&U.selectedValue!==void 0)return Array.isArray(U.selectedValue)?U.selectedValue[0]:U.selectedValue;if(N.type==="select"&&U.selectedOptions)return U.selectedOptions.map(z=>z.value);if(N.type==="check"&&U.isChecked!==void 0)return U.isChecked}return U.selectedValue!==void 0?U.selectedValue:g.value[V]}):g.value=[...p]:l?t&&t.length>0&&(g.value=[...t]):T&&t&&t.length>0&&(g.value=[...t])},{deep:!0}),n.watch(()=>k.isEditMode,(p,c)=>{c===!0&&p===!1&&(t=null)},{immediate:!0}),n.watch(g,p=>{p.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""))&&(()=>{if(!m)return!0;for(let c=0;c<p.length;c++)if(!_(p[c],m[c]))return!0;return!1})()&&(m=[...p],W("filters-changed",{componentId:k.componentId,filters:p,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),n.watch(()=>g.value[0],(p,c)=>{p!==c&&c!==void 0?w(p,!0):c===void 0&&p!==null&&p!==void 0&&w(p,!1)},{immediate:!0});const f=p=>{r.value===p?r.value=null:r.value=p},o=(p,c)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),g.value[p]=c,(p===0||p===1)&&(t=[...g.value]),r.value=null,p===0){g.value[1]!==void 0&&(g.value[1]=null);const d=l;l=!1,w(c,!0),l=d,g.value[1]!==null&&g.value[1]!==void 0&&(t=[...g.value])}},s=()=>{l=!0,setTimeout(()=>{l=!1},400)};return a({getCurrentValues:()=>g.value,initializeValues:v}),(p,c)=>(n.openBlock(),n.createElementBlock("div",vSe,[e.filters&&e.filters.length>0?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.filters,(d,b)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:b},[d.type==="radio-button"?(n.openBlock(),n.createElementBlock("div",bSe,[n.createElementVNode("div",xSe,n.toDisplayString(d.label),1),n.createElementVNode("div",wSe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.options,x=>(n.openBlock(),n.createElementBlock("label",{key:x.value,class:n.normalizeClass(["radio-option-card",{active:g.value[b]===x.value}])},[n.withDirectives(n.createElementVNode("input",{type:"radio",name:"strengths-radio-"+b,value:x.value,"onUpdate:modelValue":T=>g.value[b]=T,onChange:s},null,40,_Se),[[n.vModelRadio,g.value[b]]]),n.createElementVNode("span",null,n.toDisplayString(x.label),1)],2))),128))])])):d.type==="select-simple"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[c[4]||(c[4]=n.createElementVNode("div",{class:"filter-separator"},null,-1)),n.createElementVNode("div",SSe,[c[3]||(c[3]=n.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),n.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":d.type,onClick:n.withModifiers(x=>f(b),["stop"])},[n.createElementVNode("div",kSe,[c[1]||(c[1]=n.createElementVNode("span",{class:"select-icon select-analisis-icon"},[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),n.createElementVNode("span",LSe,n.toDisplayString(d.label||"Tipo de análisis"),1),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:r.value===b}])},[...c[0]||(c[0]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),r.value===b?(n.openBlock(),n.createElementBlock("div",NSe,[n.createElementVNode("div",VSe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.options,x=>(n.openBlock(),n.createElementBlock("div",{key:x.value,class:n.normalizeClass(["option-card simple-select-option",{active:_(g.value[b],x.value)}]),onClick:n.withModifiers(T=>o(b,x.value),["stop"])},[n.createElementVNode("div",qSe,[n.createElementVNode("div",USe,n.toDisplayString(x.label),1)]),_(g.value[b],x.value)?(n.openBlock(),n.createElementBlock("div",zSe,[...c[2]||(c[2]=[n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):n.createCommentVNode("",!0)],10,OSe))),128))])])):n.createCommentVNode("",!0)],8,TSe)])],64)):n.createCommentVNode("",!0),b===1&&e.filters.length>2?(n.openBlock(),n.createElementBlock("div",CSe)):n.createCommentVNode("",!0)],64))),128))],2)):n.createCommentVNode("",!0)]))}},FSe=jd(PSe,[["__scopeId","data-v-4c3876bd"]]),ESe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,W]of a)i[k]=W;return i},RSe={key:1},MSe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},WSe=["fill"],jSe={key:0,class:"checkbox__teams"},KSe={class:"checkbox__teams__logo"},ASe=["src"],ISe={class:"checkbox__teams__logo"},XSe=["src"],DSe={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:a}){const i=e;n.useCssVars(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const k=n.ref(!1),W=n.computed(()=>{const l={color:i.boxValueColor,"font-family":i.fontFamily,height:i.boxWidthAndHeight,width:i.boxWidthAndHeight,minWidth:i.boxWidthAndHeight,"border-radius":i.boxBorderRadius,"margin-top":i.boxMarginTop};return k.value?(l["background-color"]=i.boxBackgroundColor,l.border=`solid ${i.boxBorderWidth} ${i.boxBackgroundColor}`):l.border=`solid ${i.boxBorderWidth} ${i.boxBorderColor}`,l}),g=n.computed(()=>({"font-family":i.boxValueFontFamily,"font-size":i.boxValueFontSize,color:i.boxValueColor,"line-height":1})),m=n.computed(()=>{const l={color:i.labelColor,"font-family":i.fontFamily,"font-size":i.labelFontSize,"white-space":i.labelWhiteSpace,"text-align":i.boxPosition==="top"||i.boxPosition==="bottom"?"center":i.boxPosition};return(i.boxPosition==="left"||i.boxPosition==="right")&&(l[`margin-${i.boxPosition}`]=i.isBoxOnly?"0":i.teamsIds?"8px":"10px"),l});n.watch(()=>i.modelValue,l=>{l!==k.value&&(k.value=l)},{immediate:!0});function r(){i.avoidInteraction||!k.value&&i.avoidToCheck||(k.value=!k.value,a("update:modelValue",k.value))}function h(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,t)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:r},[n.createElementVNode("div",{class:"checkbox__box",style:n.normalizeStyle(W.value)},[k.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[i.boxValue?(n.openBlock(),n.createElementBlock("div",{key:0,class:"checkbox__box__value",style:n.normalizeStyle(g.value)},n.toDisplayString(e.boxValue),5)):(n.openBlock(),n.createElementBlock("div",RSe,[(n.openBlock(),n.createElementBlock("svg",MSe,[n.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,WSe)]))]))],64)):n.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(n.openBlock(),n.createElementBlock("div",jSe,[n.createElementVNode("div",KSe,[n.createElementVNode("img",{src:h(e.teamsIds[0]),alt:""},null,8,ASe)]),n.createElementVNode("div",ISe,[n.createElementVNode("img",{src:h(e.teamsIds[1]),alt:""},null,8,XSe)])])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"checkbox__label",style:n.normalizeStyle(m.value)},n.toDisplayString(e.label),5)],2))}},CL=ESe(DSe,[["__scopeId","data-v-b6f124d8"]]),JSe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,W]of a)i[k]=W;return i},S5={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},PL=()=>{n.useCssVars(e=>({"9d01acb4":e.height,"14e95081":e.borderWidthBtn,"38fec285":e.borderType,34353510:e.borderColor,"20d20dc6":e.borderRadius,17130967:e.width,"4ccb7d36":e.backgroundColor,"5d1e86a2":e.cursorType,ce65d4a2:e.fontSize,fe4ac47a:e.fontStyle,f98e44dc:e.fontFamily,"93b87770":e.marginLeftStat,c7f7beba:e.fontSizeStat}))},FL=S5.setup;S5.setup=FL?(e,a)=>(PL(),FL(e,a)):PL;const GSe=e=>(n.pushScopeId("data-v-f3ee6b2b"),e=e(),n.popScopeId(),e),BSe=["src"],ZSe={key:1,class:"text"},HSe=["src"],YSe={class:"stats"},QSe=GSe(()=>n.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),$Se={class:"numstats"},eTe={class:"leyend"};function tTe(e,a,i,k,W,g){return n.openBlock(),n.createElementBlock("div",null,[i.type==0?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["button",W.status&&i.typeOnOff&&"button-active"]),style:n.normalizeStyle([g.customStyle,W.status&&i.typeOnOff&&g.customActive]),onClick:a[0]||(a[0]=(...m)=>g.btnClick&&g.btnClick(...m))},[i.icon&&i.iconPosition.toLowerCase()==="left"?(n.openBlock(),n.createElementBlock("img",{key:0,class:"icon",style:n.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,BSe)):n.createCommentVNode("",!0),i.textValue?(n.openBlock(),n.createElementBlock("div",ZSe,n.toDisplayString(i.textValue),1)):n.createCommentVNode("",!0),i.icon&&i.iconPosition.toLowerCase()==="right"?(n.openBlock(),n.createElementBlock("img",{key:2,class:"icon",style:n.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,HSe)):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0),i.type==1?(n.openBlock(),n.createElementBlock("div",{key:1,class:"button-target",onClick:a[1]||(a[1]=(...m)=>g.btnClick&&g.btnClick(...m))},[n.createElementVNode("div",YSe,[QSe,n.createElementVNode("div",$Se,n.toDisplayString(i.textStat),1)]),n.createElementVNode("div",eTe,n.toDisplayString(i.textCategory),1)])):n.createCommentVNode("",!0)])}const rTe=JSe(S5,[["render",tTe],["__scopeId","data-v-f3ee6b2b"]]),nTe={class:"gsc-dropdown__main-container__item-selected"},aTe=["height","width"],iTe=["stroke"],oTe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sTe=["fill"],lTe={class:"gsc-dropdown__items-container"},cTe=["onClick"],uTe={key:0,class:"gsc-dropdown__items-footer"},y2={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(a=>a in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listMarginTop:{type:String,default:"0"},listContainerPadding:{type:String,default:"0"},listItemPadding:{type:String,default:"10px 12px"},listItemMargin:{type:String,default:"0"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},listItemBorderRadius:{type:String,default:"0"},listAlignment:{type:String,default:"left"},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1},iconType:{type:Number,default:1,validator:function(e){return[1,2].includes(e)}}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:a}){const i=e,k=n.ref({}),W=n.ref(null),g=n.ref(i.isMultipleOption?-1:0),m=n.ref(!1);n.watch(()=>i.items,(v,f)=>{if(!i.modelValue&&(!i.onlyFirstTime||!f||!f.length)&&v&&v.length){if(i.defaultItemByProp){const o=i.items.findIndex(s=>s[i.defaultItemByProp.propName]===i.defaultItemByProp.value);o!==-1?(g.value=o,k.value=v[o]):(g.value=0,k.value=v[0])}else k.value=v[i.defaultItemByIndex];a("input",k.value)}},{immediate:!0}),n.watch(()=>i.modelValue,v=>{if(v){const f=i.items.findIndex(o=>typeof v=="object"?JSON.stringify(o)===JSON.stringify(v):o===v);f!==-1&&(g.value=f,k.value=i.items[f],a("update:modelValue",k.value))}},{immediate:!0});const r=n.computed(()=>({height:i.height,width:i.width,backgroundColor:i.backgroundColor,borderRadius:`${i.borderRadius}px`,border:`${i.borderType} ${i.borderWidth}px ${i.borderColor}`,color:i.color,"--hover-background-color":i.hoverBackgroundColor,"--list-container-padding":i.listContainerPadding,"--list-item-padding":i.listItemPadding,"--list-item-margin":i.listItemMargin,"--list-background-color":i.listBackgroundColor,"--list-height":i.listHeight,"--list-item-border-radius":i.listItemBorderRadius,"--list-item-selected-color":i.listItemSelectedColor,"--list-item-selected-background-color":i.listItemSelectedBackgroundColor,"--list-item-color":i.listItemColor,"--list-border-radius":`${i.listBorderRadius}`,"--list-border-color":i.listBorderColor,"--list-width":i.isListSameWidth?i.width:"fit-content","--list-border-width":`${i.listBorderWidth}px`,"--list-margin-top":i.listMarginTop,"--list-left":i.listAlignment==="left"?"0":"auto","--list-right":i.listAlignment==="right"?"0":"auto","--footer-border":`${i.footerBorderWidth}px solid ${i.footerBorderColor}`,"--dropdown-opacity":i.isDisabled?"0.5":"1","--dropdown-cursor":i.isDisabled?"not-allowed":"pointer","--dropdown-font-size":i.fontSize?i.fontSize:"14px"})),h=n.computed(()=>({height:`${i.arrowHeight}px`,width:`${i.arrowWidth}px`}));function l(){i.isDisabled||(m.value=!m.value)}function t(v){W.value&&!W.value.contains(v.target)&&(m.value=!1)}function _(v,f){i.isMultipleOption?g.value=-1:(g.value=f,m.value=!1),k.value=v,a("input",k.value),a("update:modelValue",k.value)}function w(){m.value=!1,a("click-ready")}return n.onMounted(()=>{document.addEventListener("click",t)}),n.onBeforeMount(()=>{document.removeEventListener("click",t)}),(v,f)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"dropDown",ref:W,class:"gsc-dropdown",style:n.normalizeStyle(r.value)},[n.createElementVNode("div",{class:"gsc-dropdown__main-container",style:n.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:l},[n.createElementVNode("div",nTe,[n.renderSlot(v.$slots,"default",{selectedItem:k.value})]),n.createElementVNode("div",{class:n.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":m.value}]),style:n.normalizeStyle(h.value)},[e.iconType===1?(n.openBlock(),n.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,iTe)],8,aTe)):(n.openBlock(),n.createElementBlock("svg",oTe,[n.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z",fill:e.arrowColor},null,8,sTe)]))],6)],4),n.createVNode(n.Transition,null,{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("div",lTe,[n.createElementVNode("div",null,[n.createElementVNode("div",{class:"gsc-dropdown__items",style:n.normalizeStyle({"margin-top":`${i.borderWidth}px`})},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.items,(o,s)=>(n.openBlock(),n.createElementBlock("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["gsc-dropdown__items__item",{selected:s===g.value}]),key:s,onClick:p=>_(o,s)},[n.renderSlot(v.$slots,"availableItem",{item:o})],10,cTe)),[[n.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(n.openBlock(),n.createElementBlock("div",uTe,[n.createVNode(n.unref(rTe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:w})])):n.createCommentVNode("",!0)])],512),[[n.vShow,m.value]])]),_:3})],4))}},EL={borderType:"solid",listBackgroundColor:"#2E3B46",listBorderColor:"rgba(255, 255, 255, 0.2)",listBorderRadius:"5px",height:"38px",borderWidth:.8,borderColor:"rgba(255, 255, 255, 0.2)",backgroundColor:"#2E3B46",color:"white",listItemColor:"white",listItemSelectedBackgroundColor:"#2E3B46",arrowColor:"#fff",width:"100%",listHeight:"200px",isListSameWidth:!1,isFooterVisible:!1,hoverBackgroundColor:"#2E3B46",iconType:2},dTe=[{label:"Goles recibidos",value:{name:"Goles recibidos",color:"#336DFF",points:[1,2,3],categories:[40],invert:[57,326,56,60,59,55],negative:!1,translationKey:"chalkboard.defensive.team.goals_received",singleName:"Gol recibido"}},{label:"Tiros a gol recibidos",value:{name:"Tiros a gol recibidos",color:"#7ED321",points:[1,2,3],categories:["510_r"],invert:[510],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Tiros a gol recibidos (portería)",value:{name:"Tiros a gol recibidos (portería)",color:"#990BFF",points:[1,2,3],categories:["537_r","540_r","544_r","547_r"],invert:[537,540,544,547],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Centros totales recibidos",value:{name:"Centros totales recibidos",color:"#FF9226",points:[1,2,3],categories:["13_r","25_r"],invert:[13,25],negative:!1,translationKey:"chalkboard.defensive.team.total_centers_received",singleName:"Centro recibido"}},{label:"Centros acertados por el rival",value:{name:"Centros acertados por el rival",color:"#28A3B2",points:[1,2,3],categories:["98_r","101_r","104_r","105_r","109_r","112_r","115_r","116_r"],invert:[98,101,104,105,109,112,115,116],negative:!1,translationKey:"chalkboard.defensive.team.successful_centers_by_opponent",singleName:"Centro acertado"}},{label:"Fuera de lugar provocados",value:{name:"Fuera de lugar provocados",color:"#00DD00",points:[1,2,3],categories:["33_r"],invert:[33],negative:!1,translationKey:"chalkboard.defensive.team.offsides_caused",singleName:"Fuera de lugar"}},{label:"Balones recuperados (en disputa)",value:{name:"Balones recuperados (en disputa)",color:"#FF3399",points:[1,2,3],categories:[483],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_in_challenge",singleName:"Balón recuperado",isDefaultSelected:!0}},{label:"Balones recuperados (sin disputa)",value:{name:"Balones recuperados (sin disputa)",color:"#B4005A",points:[1,2,3],categories:[484],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_without_challenge",singleName:"Balón recuperado"}},{label:"1 vs 1 exitosos defensivos",value:{name:"1 vs 1 exitosos defensivos",color:"#3A3838",points:[1],categories:[5],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.successful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"1 vs 1 no exitosos defensivos",value:{name:"1 vs 1 no exitosos defensivos",color:"#008B31",points:[1],categories:[209],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.unsuccessful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"Balones ganados en área propia",value:{name:"Balones ganados en área propia",color:"#305496",points:[1,2],categories:[23],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_won_own_penalty_box",singleName:"Balón ganado"}},{label:"Juego aéreo resto del campo",value:{name:"Juego aéreo resto del campo",color:"#FF8A4C",points:[1,2,3],categories:[24],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.arial_game_rest_pitch",singleName:"Juego aéreo"}},{label:"Barridas",value:{name:"Barridas",color:"#700000",points:[1],categories:[518],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.slide_tackles",singleName:"Barrida"}},{label:"Rechaces",value:{name:"Rechaces",color:"#CC0000",points:[1,2,3],categories:[34],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.clearances",singleName:"Rechace"}}],pTe=[{label:"Goles",value:{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}},{label:"Tiros a gol",value:{name:"Tiros a gol",color:"#7ED321",points:[1,2,3],categories:[510],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal",singleName:"Tiro a gol",isDefaultSelected:!1}},{label:"Tiros a gol (portería)",value:{name:"Tiros a gol (portería)",color:"#990BFF",points:[1,2,3],categories:[537,540,544,547],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal_2",singleName:"Tiro a gol (portería)",isDefaultSelected:!1}},{label:"Centros totales",value:{name:"Centros totales",color:"#FF9226",points:[1,2,3],categories:[13,25],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.center_crosses",singleName:"Centro",isDefaultSelected:!1}},{label:"Centros acertados",value:{name:"Centros acertados",color:"#28A3B2",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_center_crosses",singleName:"Centro acertado",isDefaultSelected:!1}},{label:"Balones ganados en área rival",value:{name:"Balones ganados en área rival",color:"#FF0092",points:[1,2],categories:[11],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.balls_won_opponent_penalty_box",singleName:"Balón ganado",isDefaultSelected:!1}},{label:"1vs1 exitosos ofensivos",value:{name:"1vs1 exitosos ofensivos",color:"#3A3838",points:[1],categories:[4],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"1vs1 no exitosos ofensivos",value:{name:"1vs1 no exitosos ofensivos",color:"#008B31",points:[1],categories:[208],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.unsuccessful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"Remates con cabeza",value:{name:"Remates con cabeza",color:"#B4005A",points:[1,2,3],categories:[330,331,333,334,423,424,343,344],invert:[],negative:!1,translationKey:"",singleName:"Remate con cabeza",isDefaultSelected:!1}},{label:"Balón perdido en disputa",value:{name:"Balón perdido en disputa",color:"#9C08B0",points:[1,2,3],categories:[494],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido en disputa",isDefaultSelected:!1}},{label:"Balón perdido sin disputa",value:{name:"Balón perdido sin disputa",color:"#700000",points:[1,2,3],categories:[495],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido sin disputa",isDefaultSelected:!1}}],hTe={class:"last-touch"},fTe={class:"selected-item"},mTe={class:"available-item"},yTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gTe={class:"selected-item"},vTe={class:"available-item"},bTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xTe={key:1},wTe={class:"selected-item"},_Te={class:"available-item"},STe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},TTe={class:"last-touch__how-many-games"},kTe={class:"selected-item"},LTe={class:"available-item"},NTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},VTe={__name:"FilterLastTouch",props:{viewConfig:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},defaultFilters:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!0}},emits:["change","remove-views"],setup(e,{emit:a}){const i=e,k=a,W=n.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),g=n.ref({id:0,name:"Fases de juego",value:null}),m=n.ref(!1),r=n.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),h=n.ref(i.defaultFilters?null:r.value[0]),l=n.ref(null),t=n.computed(()=>({...EL})),_=n.computed(()=>({...EL,isFooterVisible:!i.isEditMode,isMultipleOption:!i.isEditMode})),w=n.computed(()=>{const K=[];return v.value.options.forEach(X=>{X.forEach(D=>{K.push(D)})}),K}),v=n.ref(null),f=n.ref(null),o=n.ref(null),s=n.ref(null);n.watch(()=>i.viewConfig,K=>{K.filters&&(v.value||p(),f.value||c(),o.value||d(),s.value||N())},{immediate:!0});function p(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="categories");K&&K.options&&(v.value={label:K.label,options:Object.entries(K.options).reduce((X,[D,H])=>(X.set(Number(D),H),X),new Map)})}v.value={label:"Tipo de jugada",options:new Map([[2,pTe],[3,dTe]])}}function c(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="gamePhases");if(K){f.value={label:K.label,options:K.options};return}}f.value={label:"Fases de juego",options:W.value}}function d(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="teamRadios");if(K){o.value={options:K.options},q(null,K.options[0]);return}}o.value={label:"Equipo",options:i.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},q(null,o.value.options[0])}const b=n.ref(i.defaultFilters?null:o.value.options[0]),x=n.ref(i.defaultFilters?null:f.value.options[0]),T=n.ref(i.defaultFilters?null:v.value.options.get(x.value.value)[0]);function N(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="assistZoneCheckbox");if(K){s.value={label:K.label},L(K.value);return}}s.value={label:"Zona de asistencia"}}const V=n.computed(()=>{const K={selectedGamePhase:x.value,selectedTeam:b.value,isAssistZoneVisible:m.value,howManyGamesSelected:h.value};return i.isEditMode?(K.selectedCategory=T.value,K.totalCategoriesSelected=1):(K.selectedCategories=l.value,K.totalCategoriesSelected=0,v.value.options.forEach(X=>{X.forEach(D=>{D.isSelected&&(K.totalCategoriesSelected+=1)})})),K}),U=n.computed(()=>x.value?v.value.options.get(x.value.value)||[]:[]);n.watch(()=>V.value,K=>{z()&&(console.log("before emit change:",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}),k("change",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}))},{deep:!0});function z(){return x.value&&(i.isEditMode&&T.value||!i.isEditMode&&l.value&&l.value.length)&&b.value&&h.value}function O(K){x.value=K,S(null)}function C(K){b.value=K}function q(K,X){console.log("onChangeRadio:",X.value)}function L(K){m.value=K}function P(K){h.value=K}function S(K){T.value=K}function F(K,X){X.isSelected=K,l.value=w.value.filter(D=>D.isSelected)}function R(){i.defaultFilters&&(m.value=i.defaultFilters.isAssistZoneVisible,h.value=r.value.find(K=>K.value===i.defaultFilters.howManyGamesSelected.value)||r.value[0],x.value=f.value.options.find(K=>K.value===i.defaultFilters.selectedGamePhase.value)||f.value.options[0],b.value=o.value.options.find(K=>K.value===(i.defaultFilters.isHomeTeam?1:2))||o.value.options[0],T.value=v.value.options.get(x.value.value).find(K=>K.value.name===i.defaultFilters.selectedCategory.name)||v.value.options.get(x.value.value)[0])}function j(){U.value.forEach(K=>{K.isSelected=!1}),m.value=!1,h.value=r.value[0],x.value=null,b.value=null,T.value=null,l.value=null}return n.onBeforeUnmount(()=>{j()}),n.onMounted(()=>{setTimeout(()=>{R()},500)}),(K,X)=>(n.openBlock(),n.createElementBlock("div",hTe,[n.createVNode(n.unref(y2),n.mergeProps(t.value,{items:f.value.options,"model-value":x.value,"onUpdate:modelValue":O}),{default:n.withCtx(()=>[n.createElementVNode("div",fTe,[X[0]||(X[0]=n.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),n.createElementVNode("div",null,n.toDisplayString(x.value?x.value.label:f.value.label||g.value.name),1)])]),availableItem:n.withCtx(({item:D})=>[n.createElementVNode("div",mTe,[n.createElementVNode("div",null,n.toDisplayString(D.label),1),n.createElementVNode("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("svg",yTe,[...X[1]||(X[1]=[n.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[n.vShow,x.value&&x.value.label===D.label]])])])]),_:1},16,["items","model-value"]),n.createVNode(n.unref(y2),n.mergeProps(_.value,{items:U.value,"model-value":T.value,"onUpdate:modelValue":S}),{default:n.withCtx(()=>[n.createElementVNode("div",gTe,[X[2]||(X[2]=n.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),n.createElementVNode("div",null,n.toDisplayString(v.value.label),1)])]),availableItem:n.withCtx(({item:D})=>[n.createElementVNode("div",vTe,[e.isEditMode?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",null,n.toDisplayString(D.label),1),n.createElementVNode("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("svg",bTe,[...X[3]||(X[3]=[n.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[n.vShow,T.value&&T.value.label===D.label]])])],64)):(n.openBlock(),n.createElementBlock("div",xTe,[n.createVNode(n.unref(CL),{"model-value":D.isSelected,label:D.label,"onUpdate:modelValue":H=>F(H,D)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),n.createVNode(n.unref(y2),n.mergeProps(t.value,{items:o.value.options,"model-value":b.value,"onUpdate:modelValue":C}),{default:n.withCtx(()=>[n.createElementVNode("div",wTe,[X[4]||(X[4]=n.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),n.createElementVNode("div",null,n.toDisplayString(b.value?b.value.label:o.value.label),1)])]),availableItem:n.withCtx(({item:D})=>[n.createElementVNode("div",_Te,[n.createElementVNode("div",null,n.toDisplayString(D.label),1),n.createElementVNode("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("svg",STe,[...X[5]||(X[5]=[n.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[n.vShow,b.value&&b.value.label===D.label]])])])]),_:1},16,["items","model-value"]),n.createVNode(n.unref(CL),{"model-value":m.value,label:s.value.label,"onUpdate:modelValue":L},null,8,["model-value","label"]),n.withDirectives(n.createElementVNode("div",TTe,[n.createVNode(n.unref(y2),n.mergeProps(t.value,{items:r.value,"model-value":h.value,"onUpdate:modelValue":P}),{default:n.withCtx(()=>[n.createElementVNode("div",kTe,[X[6]||(X[6]=n.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),n.createElementVNode("div",null,n.toDisplayString(h.value?h.value.name:"Seleccione"),1)])]),availableItem:n.withCtx(({item:D})=>[n.createElementVNode("div",LTe,[n.createElementVNode("div",null,n.toDisplayString(D.name),1),n.createElementVNode("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("svg",NTe,[...X[7]||(X[7]=[n.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[n.vShow,h.value&&h.value.name===D.name]])])])]),_:1},16,["items","model-value"])],512),[[n.vShow,!e.isPostMatch]])]))}},OTe=jd(VTe,[["__scopeId","data-v-4e32834b"]]),qTe={class:"floating-bar"},UTe={class:"tab active"},zTe={class:"select-display"},CTe={class:"select-icon"},PTe=["src"],FTe={key:1,src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png",alt:"icono",class:"option-img-default"},ETe={key:0,class:"select-placeholder select-label"},RTe={key:1,class:"select-label"},MTe={key:0,class:"dropdown-menu field-menu"},WTe=["onClick"],jTe={class:"option-icon"},KTe=["src","data-hover-src"],ATe={class:"option-content"},ITe={class:"option-title"},XTe={key:0,class:"option-description"},DTe={class:"select-display"},JTe={class:"select-icon"},GTe=["src"],BTe=["src"],ZTe={class:"select-label"},HTe={key:0,class:"dropdown-menu type-menu type-menu-grid"},YTe={class:"option-grid"},QTe=["onClick"],$Te={class:"option-grid-title"},e6e={class:"option-grid-icon"},t6e=["src"],r6e={key:1,class:"filter-separator"},n6e=["onClick"],a6e={class:"select-display"},i6e={key:0,class:"badge-categorias"},o6e={key:0,class:"dropdown-menu type-menu multi-select-menu"},s6e={class:"multi-select-scroll-area"},l6e={class:"select-all-checkbox"},c6e=["checked","indeterminate","onChange"],u6e={class:"option-checkbox"},d6e=["checked","onChange"],p6e=["onClick"],h6e={class:"option-title"},f6e={class:"multi-select-footer"},m6e={key:1,class:"custom-radio-group filter-inline"},y6e={class:"radio-label"},g6e={class:"radio-options"},v6e=["name","value","onUpdate:modelValue","disabled","onChange"],b6e={key:2,class:"check-group filter-inline"},x6e=["onUpdate:modelValue","checked"],w6e=["data-filter-type","onClick"],_6e={class:"select-display"},S6e={key:0,class:"dropdown-menu type-menu simple-select-menu"},T6e={class:"simple-select-scroll-area"},k6e=["onMouseenter","onClick"],L6e={class:"option-content"},N6e={class:"option-title"},V6e={key:0,class:"option-checkmark"},O6e={key:4,class:"filter-separator"},q6e=Object.assign({name:"FloatingFiltersBar"},{__name:"filters",props:{token:{type:String,required:!0},view:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!1},filters_edition_mode:{type:Array,default:()=>null}},emits:["filters-changed","close"],setup(e,{expose:a,emit:i}){const k=e,W=i,g=n.ref(new Map),m=n.ref([]);let r=null,h=null,l=null;const t=n.ref(!1),_=n.ref(!1),w=n.ref(!1),v=n.ref(!1),f=n.ref(!1),o=n.ref(!1),s=n.computed(()=>m.value),p=n.ref(null),c=n.computed(()=>s.value[p.value]||null),d=n.computed(()=>{var me;const Ue=((me=c.value)==null?void 0:me.views)||[];return q(Ue)}),b=n.ref(null),x=n.computed(()=>d.value.find(me=>me.id===b.value)||null),T=n.ref([]),N=n.computed(()=>{var me,Ue;return t.value?((me=x.value)==null?void 0:me.filters_edition_mode)||[]:((Ue=x.value)==null?void 0:Ue.filters)||[]});n.watch(t,me=>{me||(_.value=!1)}),n.watch(x,me=>{var Ue,Ee;if(!me){T.value=[];return}const Ke=me.id===6&&k.isPostMatch,nt=me.id===14;if(!Array.isArray(N.value)&&!Ke&&!nt){T.value=[];return}v.value||(Ke||nt?T.value=[]:T.value=N.value.map((at,pt)=>{var wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be,ut,xt,mt,Tt,Ut;if(at.type==="select"){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt){if(tt.selectedOptions&&Array.isArray(tt.selectedOptions))return tt.selectedOptions.map(Qe=>Qe.value);if(tt.selectedValue&&Array.isArray(tt.selectedValue))return tt.selectedValue.length>0&&tt.selectedValue[0]&&typeof tt.selectedValue[0]=="object"?We(tt.selectedValue):tt.selectedValue}}return me.id===4&&at.options&&Array.isArray(at.options)?at.options.map(tt=>tt.value):[]}else if(at.type==="radio-button"){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt&&tt.selectedOption)return tt.selectedOption.value}if(me.id===7&&t.value&&h!=null&&h.view){if(pt===0&&(wt=h.view.componentProps)!=null&&wt.analysisType)return h.view.componentProps.analysisType==="offensive"?1:2;if(pt===1&&((_t=h.view.filterMultiple)==null?void 0:_t.isHomeTeam)!==void 0)return h.view.filterMultiple.isHomeTeam?1:2}return((It=(Mt=at.options)==null?void 0:Mt[0])==null?void 0:It.value)??null}else if(at.type==="select-simple"){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt&&tt.selectedValue!==void 0){let Qe;return me.id===2&&(lt=(Jt=h==null?void 0:h.view)==null?void 0:Jt.filterMultiple)!=null&<.categoryId?Qe=h.view.filterMultiple.categoryId:me.id===1&&(dt=(rt=h==null?void 0:h.view)==null?void 0:rt.filterMultiple)!=null&&dt.category?Qe=h.view.filterMultiple.category:me.id===6&&(Ft=(vt=h==null?void 0:h.view)==null?void 0:vt.filterMultiple)!=null&&Ft.gameNumber?Qe=h.view.filterMultiple.gameNumber:Qe=Array.isArray(tt.selectedValue)?tt.selectedValue[0]:tt.selectedValue,Qe}}if(me.id===2&&t.value&&h!=null&&h.view){if(r&&h.view.id){const tt=r.getComponentDynamicFilters(h.view.id);if(tt&&tt[pt]!==void 0)return tt[pt]}if(h.view.filterMultiple){if(at.type==="select-simple"&&h.view.filterMultiple.categoryId){const tt=h.view.filterMultiple.categoryId;return(at.options||[]).find(Qe=>Qe.value==tt),tt}if(at.type==="radio-button"&&h.view.filterMultiple.teamType!==void 0){const tt=h.view.filterMultiple.teamType;return(at.options||[]).find(Qe=>Qe.value==tt),tt}}}if(me.id===1&&t.value&&(Vt=h==null?void 0:h.view)!=null&&Vt.filterMultiple&&h.view.filterMultiple.category){const tt=h.view.filterMultiple.category;return(at.options||[]).find(Qe=>Qe.value==tt),tt}if(me.id===9&&t.value&&(it=h==null?void 0:h.view)!=null&&it.filterMultiple&&at.type==="select-simple"&&h.view.filterMultiple.categoryIds){const tt=Array.isArray(h.view.filterMultiple.categoryIds)?h.view.filterMultiple.categoryIds:[h.view.filterMultiple.categoryIds],Qe=(at.options||[]).filter(kt=>Array.isArray(kt.value)?Fe(kt.value,tt):tt.includes(kt.value));return Qe.length>0?Qe[0].value:tt}if(me.id===6&&t.value&&(ct=h==null?void 0:h.view)!=null&&ct.filterMultiple&&h.view.filterMultiple.gameNumber){const tt=h.view.filterMultiple.gameNumber;return(at.options||[]).find(Qe=>Qe.value==tt),tt}if(me.id===5&&t.value&&(Be=h==null?void 0:h.view)!=null&&Be.filterMultiple&&h.view.filterMultiple.isHomeTeam!==void 0){const tt=h.view.filterMultiple.isHomeTeam;let Qe;if(typeof tt=="boolean"?Qe=tt?1:2:typeof tt=="number"?Qe=tt===1?1:2:Qe=1,(at.options||[]).find(kt=>kt.value==Qe),at.type==="radio-button"&&(at.label==="Equipo"||at.label==="Team"||at.label==="Equipo seleccionado"))return Qe}if(me.id===15&&t.value&&(ut=h==null?void 0:h.view)!=null&&ut.filterMultiple&&h.view.filterMultiple.isHomeTeam!==void 0&&at.type==="radio-button"&&pt===0){const tt=h.view.filterMultiple.isHomeTeam;let Qe;if(typeof tt=="boolean"?Qe=tt?1:2:typeof tt=="number"?Qe=tt===1?1:2:Qe=1,(at.options||[]).find(kt=>kt.value==Qe))return Qe}if(me.id===9&&t.value&&(xt=h==null?void 0:h.view)!=null&&xt.filterMultiple&&at.type==="radio-button"&&h.view.filterMultiple.isHomeTeam!==void 0){const tt=h.view.filterMultiple.isHomeTeam?1:2,Qe=((mt=at.options)==null?void 0:mt.map(kt=>kt.value))||[];return Qe.includes(tt)?tt:Qe[0]||1}return((Ut=(Tt=at.options)==null?void 0:Tt[0])==null?void 0:Ut.value)??null}else if(at.type==="check"){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt&&tt.isChecked!==void 0)return tt.isChecked}if(me.id===8)return!0;if(me.id===3){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt&&tt.isChecked!==void 0)return tt.isChecked}return!1}return!1}return null}),!((Ue=me.name)!=null&&Ue.toLowerCase().includes("tops players")||(Ee=me.title)!=null&&Ee.toLowerCase().includes("tops players"))&&(!t.value||Ke)&&n.nextTick(()=>{var at,pt;me.id===4&&t.value&&(at=h==null?void 0:h.view)!=null&&at.id&&r&&r.setDynamicFilters(T.value,h.view.id),me.id===3&&t.value&&(pt=h==null?void 0:h.view)!=null&&pt.id&&r&&r.setDynamicFilters(T.value,h.view.id),ae()}))},{immediate:!0}),n.watch(()=>r,me=>{me&&me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&(v.value=!0,T.value=[...me.dynamicFilters],n.nextTick(()=>{v.value=!1}))},{deep:!0}),n.watch(()=>r==null?void 0:r.dynamicFilters,me=>{if(me&&Array.isArray(me)){if(f.value)return;v.value=!0,T.value=[...me],n.nextTick(()=>{v.value=!1})}},{deep:!0}),n.watch(()=>x.value,me=>{if(t.value&&l&&me&&me.filters){if(v.value||o.value)return;if(me.id===3){if(f.value||o.value)return;const Ue=l.dynamicFilters.find(Ee=>Ee.filterType==="check");Ue&&Ue.isChecked!==void 0&&T.value&&T.value.length>0&&(f.value=!0,T.value[0]=Ue.isChecked,n.nextTick(()=>{T.value=[...T.value],f.value=!1}))}setTimeout(()=>{(!T.value||T.value.length===0)&&(Je(),Pe(),ve()),me.id===4&&Ce()},100)}},{deep:!0}),n.watch(()=>{var me;return(me=x.value)==null?void 0:me.id},me=>{if(t.value&&l&&me===4){if(v.value||o.value)return;setTimeout(()=>{Ce()},200)}}),n.watch(()=>T.value,me=>{if(t.value&&l&&me&&me.length>0){if(v.value||f.value||o.value)return;setTimeout(()=>{var Ue;ke()&&(Je(),Pe(),ve(),((Ue=x.value)==null?void 0:Ue.id)===4&&Ce())},50)}},{deep:!0});function V(me,Ue){var Ee,Ke,nt,at,pt;const wt=T.value[me];if((Ee=x.value)==null||Ee.id,(Ke=x.value)==null||Ke.id,Array.isArray(wt)){if(((nt=x.value)==null?void 0:nt.id)===4&&me===0){const _t=wt.some(Mt=>{if(Ue.category_id&&Ue.event_type_id){if(Mt.category_id&&Mt.event_type_id)return Mt.category_id===Ue.category_id&&Mt.event_type_id===Ue.event_type_id;if(Mt.event_type_id&&!Mt.category_id)return Mt.event_type_id===Ue.event_type_id;if(Mt.category_id&&!Mt.event_type_id)return Mt.category_id===Ue.category_id}else{if(Ue.event_type_id)return Mt.event_type_id===Ue.event_type_id;if(Ue.category_id)return Mt.category_id===Ue.category_id}return JSON.stringify(Mt)===JSON.stringify(Ue)});return(at=x.value)==null||at.id,_t}return wt.includes(Ue)}else if(wt!=null)return(pt=x.value)==null||pt.id,wt===Ue;return!1}function U(me,Ue){var Ee,Ke,nt;const at=(Ke=(Ee=x.value)==null?void 0:Ee.filters)==null?void 0:Ke[me];if((at==null?void 0:at.type)==="select-simple"){ie(me,Ue);return}Array.isArray(T.value[me])||(T.value[me]=[]);const pt=T.value[me];let wt=-1;((nt=x.value)==null?void 0:nt.id)===4&&me===0?wt=pt.findIndex(_t=>Ue.category_id&&Ue.event_type_id?_t.category_id===Ue.category_id&&_t.event_type_id===Ue.event_type_id:Ue.event_type_id?_t.event_type_id===Ue.event_type_id:Ue.category_id?_t.category_id===Ue.category_id:!1):wt=pt.indexOf(Ue),wt>-1?pt.splice(wt,1):pt.push(Ue),t.value&&qe(),ae()}function z(me){var Ue,Ee;const Ke=T.value[me],nt=(Ee=(Ue=x.value)==null?void 0:Ue.filters)==null?void 0:Ee[me];return(nt==null?void 0:nt.type)==="select-simple"||!nt||!nt.options||!Array.isArray(Ke)?!1:Ke.length===nt.options.length}function O(me){var Ue,Ee;const Ke=T.value[me],nt=(Ee=(Ue=x.value)==null?void 0:Ue.filters)==null?void 0:Ee[me];return(nt==null?void 0:nt.type)==="select-simple"||!nt||!nt.options||!Array.isArray(Ke)?!1:Ke.length>0&&Ke.length<nt.options.length}function C(){var me;return!(((me=x.value)==null?void 0:me.id)===6&&k.isPostMatch)}function q(me){return!me||!Array.isArray(me)?me:me.filter(Ue=>{const Ee=(Ue.name||Ue.title||"").toLowerCase();return k.isPostMatch?k.isPostMatch?!["fortalezas"].some(Ke=>Ee.includes(Ke)):!0:!["resumen general","timeline","datos relevantes"].some(Ke=>Ee.includes(Ke))})}function L(){var me,Ue;const Ee=((Ue=(me=c.value)==null?void 0:me.name)==null?void 0:Ue.toLowerCase())||"";return Ee.includes("cancha")||Ee.includes("volumétrica")||Ee.includes("volumetric")}function P(me,Ue){if(!t.value||!L())return!1;const Ee=String(me||"").toLowerCase(),Ke=String(Ue||"").toLowerCase();return Ee.includes("ambos")||Ke.includes("ambos")}function S(me){var Ue,Ee;const Ke=(Ee=(Ue=x.value)==null?void 0:Ue.filters)==null?void 0:Ee[me];if(!Ke||!Ke.options)return;const nt=Ke.options.map(at=>at.value);Array.isArray(T.value[me])||(T.value[me]=[]),z(me)?T.value[me]=[]:T.value[me]=[...nt],K.value=me,ae()}const F=n.ref("ambos"),R=n.ref(!1),j=n.ref(!1),K=n.ref(null),X=n.ref(null);function D(me,Ue=!1){const Ee="https://golstatsimages.blob.core.windows.net/images-library/",Ke="https://golstatsimages.blob.core.windows.net/reports-images/",nt={cancha:"icn_cancha",grafico:"icn_grafico",gráfico:"icn_grafico",chart:"icn_grafico",volumetrica:"icn_cancha",volumétrica:"icn_cancha",volumetric:"icn_cancha",tabla:"icn_tabla",tablas:"icn_tabla",Tablas:"icn_tabla"},at=Object.keys(nt).find(pt=>me==null?void 0:me.toLowerCase().includes(pt.toLowerCase()));if(at){const pt=nt[at],wt=Ue?"":"-def";return at.toLowerCase().includes("tabla")?`${Ke}${pt}${wt}@2x.png`:`${Ee}${pt}${wt}@2x.png`}return`${Ee}icn_default${Ue?"":"-def"}.png`}function H(){return c.value?c.value.name:"Tipo de vista"}function ne(){return x.value?x.value.name||x.value.title:"Visualización"}function G(){t.value||(R.value=!R.value,R.value&&(j.value=!1,n.nextTick(()=>{Oe()})))}function re(){t.value||c.value&&(j.value=!j.value,j.value&&(R.value=!1))}function ee(me){t.value||(p.value=me,R.value=!1,b.value=null,ae())}function Y(me){var Ue,Ee;t.value||(b.value=me.id,j.value=!1,(Ue=me.name)!=null&&Ue.toLowerCase().includes("tops players")||(Ee=me.title)==null||Ee.toLowerCase().includes("tops players"))}function $(me){var Ue;K.value=K.value===me?null:me,((Ue=x.value)==null?void 0:Ue.id)===4&&t.value&&me===0&&setTimeout(()=>{T.value=[...T.value]},50)}function le(me){X.value=X.value===me?null:me}function ie(me,Ue){var Ee,Ke,nt,at,pt;if(((Ee=x.value)==null?void 0:Ee.id)===2){const wt=N.value.findIndex(_t=>_t.type==="select-simple"&&_t.label==="Tipo de análisis");me===wt?T.value[0]=Ue:T.value[me]=Ue}else if(((Ke=x.value)==null?void 0:Ke.id)===1)T.value[0]=Ue;else if(((nt=x.value)==null?void 0:nt.id)===6)T.value[0]=Ue;else if(((at=x.value)==null?void 0:at.id)===9)if(me===0){Array.isArray(Ue)?T.value[me]=Ue:T.value[me]=[Ue];const wt=((pt=N.value[me])==null?void 0:pt.options)||[],_t=Array.isArray(Ue)?Ue:[Ue],Mt=wt.find(It=>Array.isArray(It.value)?Fe(It.value,_t):_t.includes(It.value));Mt?T.value[me]=Mt.value:T.value[me]=_t}else T.value[me]=Ue;else T.value[me]=Ue;X.value=null,t.value&&qe(),ae()}function ue(me){me.target.closest(".custom-select")||(R.value=!1,j.value=!1,X.value=null)}const he=[16];function ae(){var me,Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be,ut;if(he.includes((me=x.value)==null?void 0:me.id)||v.value)return;let xt=[],mt=[];x.value&&Array.isArray(N.value)&&N.value.forEach((Qe,kt)=>{if(Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2){const Wt=T.value[kt]||[];Array.isArray(Wt)&&Wt.length>0&&(xt=Wt.map(Rt=>{var qt;const Ht=(qt=Qe.options)==null?void 0:qt.find(At=>At.value===Rt);return{value:Rt,label:(Ht==null?void 0:Ht.label)||Rt}}))}});const Tt=((Ue=x.value)==null?void 0:Ue.id)===4;if(x.value&&Array.isArray(x.value.filters)&&x.value.filters.some(Qe=>Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2)&&xt.length===0&&!Tt)return;if(Tt&&T.value&&T.value.length>0){const Qe=T.value[0];Array.isArray(Qe)&&Qe.length>0}mt=((Ee=N.value)==null?void 0:Ee.map((Qe,kt)=>{var Wt,Rt,qt,Ht;const At=T.value[kt];let Yt=Qe.id||`filter_${kt}`;return((Wt=x.value)==null?void 0:Wt.id)===3&&t.value&&(Rt=h==null?void 0:h.view)!=null&&Rt.id&&(Yt=`filter_${kt}_component_${h.view.id}`),{filterId:Yt,filterType:Qe.type,filterLabel:Qe.label,filterIcon:Qe.icon||null,selectedValue:At,selectedOptions:Qe.type==="select"&&Array.isArray(At)&&At.length>0?At.map(Gt=>{var Bt;const or=(Bt=Qe.options)==null?void 0:Bt.find(sr=>sr.value===Gt);return{value:Gt,label:(or==null?void 0:or.label)||Gt,icon:(or==null?void 0:or.icon)||null}}):null,selectedOption:Qe.type==="radio-button"&&At!=null?{value:At,label:((Ht=(qt=Qe.options)==null?void 0:qt.find(Gt=>Gt.value===At))==null?void 0:Ht.label)||At}:null,isChecked:Qe.type==="check"?At:null}}))||[];const Ut={mainSelector:{id:((Ke=c.value)==null?void 0:Ke.id)||null,name:((nt=c.value)==null?void 0:nt.name)||null,url:((at=c.value)==null?void 0:at.url)||null},viewSelector:{id:((pt=x.value)==null?void 0:pt.id)||null,name:((wt=x.value)==null?void 0:wt.name)||((_t=x.value)==null?void 0:_t.title)||null,url:((Mt=x.value)==null?void 0:Mt.url)||null},team:F.value,dynamicFilters:mt,categoriasSeleccionadas:xt,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!x.value,totalDynamicFilters:((It=N.value)==null?void 0:It.length)||0,activeFilters:((Jt=N.value)==null?void 0:Jt.filter((Qe,kt)=>{const Wt=T.value[kt];return Array.isArray(Wt)?Wt.length>0:Wt!=null&&Wt!==!1}).length)||0}},tt={main:c.value,view:x.value,team:F.value,dynamicFilters:T.value,filtersJSON:Ut,filterAndViewsContainer:r,viewToEdit:h};if(W("filters-changed",tt),t.value&&h){if(l=Ut,((lt=x.value)==null?void 0:lt.id)===2){const Qe=l.dynamicFilters.findIndex(kt=>kt.filterType==="select-simple"&&kt.filterLabel==="Tipo de análisis");Qe!==-1&&(dt=(rt=h.view)==null?void 0:rt.filterMultiple)!=null&&dt.categoryId&&(l.dynamicFilters[Qe].selectedValue=h.view.filterMultiple.categoryId)}if(((vt=x.value)==null?void 0:vt.id)===1){const Qe=l.dynamicFilters.findIndex(kt=>kt.filterType==="select-simple"&&kt.filterLabel==="Tipo de análisis");Qe!==-1&&(Vt=(Ft=h.view)==null?void 0:Ft.filterMultiple)!=null&&Vt.category&&(l.dynamicFilters[Qe].selectedValue=h.view.filterMultiple.category)}}if(((it=x.value)==null?void 0:it.id)===6&&t.value&&(ct=h==null?void 0:h.view)!=null&&ct.filterMultiple&&h.view.filterMultiple.gameNumber&&l){const Qe=l.dynamicFilters.findIndex(kt=>kt.filterType==="select-simple"&&kt.filterLabel==="Número de juego");Qe!==-1&&(ut=(Be=h.view)==null?void 0:Be.filterMultiple)!=null&&ut.gameNumber&&(l.dynamicFilters[Qe].selectedValue=h.view.filterMultiple.gameNumber)}r&&!t.value?r.setDynamicFilters(T.value):r&&t.value}function de(){h=null,l=null,r=null,p.value=null,b.value=null,F.value="ambos",T.value=[],R.value=!1,j.value=!1,K.value=null,X.value=null,t.value=!1,_.value=!1,w.value=!1}function ce(me){if(me&&me.dynamicFilters){if(f.value)return;Array.isArray(me.dynamicFilters)&&me.dynamicFilters.length>0&&(v.value=!0,T.value=[...me.dynamicFilters],n.nextTick(()=>{v.value=!1}))}}function ye(me){if(t.value=!0,me.mainSelector&&me.mainSelector.id){const Ue=m.value.findIndex(Ee=>Ee.id===me.mainSelector.id);Ue!==-1&&(p.value=Ue)}me.viewSelector&&me.viewSelector.id&&c.value&&c.value.views.findIndex(Ue=>Ue.id===me.viewSelector.id)!==-1&&(b.value=me.viewSelector.id),me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&n.nextTick(()=>{setTimeout(()=>{var Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be,ut,xt,mt;if(x.value&&N.value){if(v.value)return;if(f.value=!0,me.dynamicFilters.forEach((Tt,Ut)=>{var tt,Qe,kt,Wt,Rt,qt,Ht,At,Yt,Gt,Bt,or,sr;if(Ut<N.value.length){const qr=N.value[Ut];if(((tt=x.value)==null?void 0:tt.id)===3&&t.value,qr.type==="check"){const zr=Tt.isChecked;typeof zr=="boolean"&&(T.value[Ut]=zr)}else if(qr.type==="select"&&Tt.selectedOptions){const zr=Tt.selectedOptions.map(Or=>Or.value);T.value[Ut]=zr}else if(qr.type==="select"&&Tt.selectedValue&&Array.isArray(Tt.selectedValue))if(Tt.selectedValue.length>0&&Tt.selectedValue[0]&&typeof Tt.selectedValue[0]=="object"){const zr=We(Tt.selectedValue);T.value[Ut]=zr}else T.value[Ut]=Tt.selectedValue;else if(qr.type==="radio-button"&&Tt.selectedOption)T.value[Ut]=Tt.selectedOption.value;else if(qr.type==="select-simple"&&Tt.selectedValue!==void 0){let zr;((Qe=x.value)==null?void 0:Qe.id)===2&&(Wt=(kt=h==null?void 0:h.view)==null?void 0:kt.filterMultiple)!=null&&Wt.categoryId?zr=h.view.filterMultiple.categoryId:((Rt=x.value)==null?void 0:Rt.id)===1&&(Ht=(qt=h==null?void 0:h.view)==null?void 0:qt.filterMultiple)!=null&&Ht.category?zr=h.view.filterMultiple.category:((At=x.value)==null?void 0:At.id)===6&&(Gt=(Yt=h==null?void 0:h.view)==null?void 0:Yt.filterMultiple)!=null&&Gt.gameNumber?zr=h.view.filterMultiple.gameNumber:((Bt=x.value)==null?void 0:Bt.id)===9&&(sr=(or=h==null?void 0:h.view)==null?void 0:or.filterMultiple)!=null&&sr.categoryIds?zr=h.view.filterMultiple.categoryIds:zr=Array.isArray(Tt.selectedValue)?Tt.selectedValue[0]:Tt.selectedValue,T.value[Ut]=zr}}}),((Ue=x.value)==null?void 0:Ue.id)===3&&t.value,((Ee=x.value)==null?void 0:Ee.id)===2&&t.value&&(Ke=h==null?void 0:h.view)!=null&&Ke.filterMultiple){if(h.view.filterMultiple.categoryId){const Tt=N.value.findIndex(Ut=>Ut.type==="select-simple"&&Ut.label==="Tipo de análisis");if(Tt!==-1){const Ut=h.view.filterMultiple.categoryId;if(T.value[0]=Ut,h.view.componentProps&&Ut){let tt=`Category ${Ut}`,Qe=null;try{Qe=Wh(Ut),Qe&&(tt=Qe.name)}catch{const kt=N.value.findIndex(Wt=>Wt.type==="select-simple"&&Wt.label==="Tipo de análisis");if(kt!==-1){const Wt=(((nt=N.value[kt])==null?void 0:nt.options)||[]).find(Rt=>Rt.value==Ut);Wt&&(tt=Wt.label)}}h.view.componentProps.categoryView=[{id:Ut,name:tt}]}(((at=N.value[Tt])==null?void 0:at.options)||[]).find(tt=>tt.value==Ut),n.nextTick(()=>{T.value=[...T.value]})}}if(h.view.filterMultiple.teamType!==void 0){const Tt=N.value.findIndex(Ut=>Ut.type==="radio-button");if(Tt!==-1){const Ut=h.view.filterMultiple.teamType;T.value[Tt]=Ut,(((pt=N.value[Tt])==null?void 0:pt.options)||[]).find(tt=>tt.value==Ut),n.nextTick(()=>{T.value=[...T.value]})}}}if(((wt=x.value)==null?void 0:wt.id)===9&&t.value&&(_t=h==null?void 0:h.view)!=null&&_t.filterMultiple){if(h.view.filterMultiple.categoryIds){const Tt=N.value.findIndex(Ut=>Ut.type==="select-simple");if(Tt!==-1){const Ut=Array.isArray(h.view.filterMultiple.categoryIds)?h.view.filterMultiple.categoryIds:[h.view.filterMultiple.categoryIds];T.value[0]=Ut;const tt=(((Mt=N.value[Tt])==null?void 0:Mt.options)||[]).filter(kt=>Array.isArray(kt.value)?Fe(kt.value,Ut):Ut.includes(kt.value));if(tt.length>0){const kt=tt[0].value;T.value[Tt]=kt}else T.value[Tt]=Ut;const Qe=T.value[Tt];Fe(Qe,Ut),n.nextTick(()=>{T.value=[...T.value]})}}if(h.view.filterMultiple.isHomeTeam!==void 0){const Tt=N.value.findIndex(Ut=>Ut.type==="radio-button");if(Tt!==-1){const Ut=h.view.filterMultiple.isHomeTeam;let tt;typeof Ut=="boolean"?tt=Ut?1:2:typeof Ut=="number"?tt=Ut===1?1:2:tt=1,T.value[Tt]=tt,(((It=N.value[Tt])==null?void 0:It.options)||[]).find(Qe=>Qe.value==tt),n.nextTick(()=>{T.value=[...T.value]})}}}if(((Jt=x.value)==null?void 0:Jt.id)===1&&t.value&&(lt=h==null?void 0:h.view)!=null&<.filterMultiple&&h.view.filterMultiple.category){const Tt=N.value.findIndex(Ut=>Ut.type==="select-simple"&&Ut.label==="Tipo de análisis");if(Tt!==-1){const Ut=h.view.filterMultiple.category;T.value[0]=Ut,h.view.componentProps&&Ut&&(h.view.componentProps.type=Ut),(((rt=N.value[Tt])==null?void 0:rt.options)||[]).find(tt=>tt.value==Ut),n.nextTick(()=>{T.value=[...T.value]})}}if(((dt=x.value)==null?void 0:dt.id)===6&&t.value&&(vt=h==null?void 0:h.view)!=null&&vt.filterMultiple&&h.view.filterMultiple.gameNumber){const Tt=N.value.findIndex(Ut=>Ut.type==="select-simple"&&Ut.label==="Número de juego");if(Tt!==-1){const Ut=h.view.filterMultiple.gameNumber;T.value[0]=Ut,h.view.componentProps&&Ut&&(h.view.componentProps.gameNumber=Ut),(((Ft=N.value[Tt])==null?void 0:Ft.options)||[]).find(tt=>tt.value==Ut),n.nextTick(()=>{T.value=[...T.value]})}}if(((Vt=x.value)==null?void 0:Vt.id)===7&&t.value&&h!=null&&h.view){if((it=h.view.componentProps)!=null&&it.analysisType&&N.value.length>0&&((ct=N.value[0])==null?void 0:ct.type)==="radio-button"){const Tt=h.view.componentProps.analysisType==="offensive"?1:2;T.value[0]=Tt}if(((Be=h.view.filterMultiple)==null?void 0:Be.isHomeTeam)!==void 0){const Tt=N.value.findIndex(Ut=>Ut.type==="radio-button"&&Ut.label==="Equipo");if(Tt!==-1){const Ut=h.view.filterMultiple.isHomeTeam?1:2;T.value[1]=Ut}else if(N.value.length>1&&((ut=N.value[1])==null?void 0:ut.type)==="radio-button"){const Ut=h.view.filterMultiple.isHomeTeam,tt=Ut?1:2;T.value[1]=tt,h.view.componentProps&&(h.view.componentProps.isHomeTeamForAnalysis=Ut),(((xt=N.value[1])==null?void 0:xt.options)||[]).find(Qe=>Qe.value==tt),n.nextTick(()=>{T.value=[...T.value]})}if(Tt!==-1&&h.view.componentProps){const Ut=h.view.filterMultiple.isHomeTeam,tt=Ut?1:2;h.view.componentProps.isHomeTeamForAnalysis=Ut,(((mt=N.value[Tt])==null?void 0:mt.options)||[]).find(Qe=>Qe.value==tt),n.nextTick(()=>{T.value=[...T.value]})}}}n.nextTick(()=>{f.value=!1})}},100)})}function xe(){var me,Ue,Ee,Ke,nt,at,pt,wt,_t,Mt;return{mainSelector:{id:((me=c.value)==null?void 0:me.id)||null,name:((Ue=c.value)==null?void 0:Ue.name)||null,url:((Ee=c.value)==null?void 0:Ee.url)||null},viewSelector:{id:((Ke=x.value)==null?void 0:Ke.id)||null,name:((nt=x.value)==null?void 0:nt.name)||((at=x.value)==null?void 0:at.title)||null,url:((pt=x.value)==null?void 0:pt.url)||null},team:F.value,dynamicFilters:((wt=N.value)==null?void 0:wt.map((It,Jt)=>{var lt,rt;const dt=T.value[Jt];return{filterId:It.id||`filter_${Jt}`,filterType:It.type,filterLabel:It.label,filterIcon:It.icon||null,selectedValue:dt,selectedOptions:It.type==="select"&&Array.isArray(dt)&&dt.length>0?dt.map(vt=>{var Ft;const Vt=(Ft=It.options)==null?void 0:Ft.find(it=>it.value===vt);return{value:vt,label:(Vt==null?void 0:Vt.label)||vt,icon:(Vt==null?void 0:Vt.icon)||null}}):null,selectedOption:It.type==="radio-button"&&dt?{value:dt,label:((rt=(lt=It.options)==null?void 0:lt.find(vt=>vt.value===dt))==null?void 0:rt.label)||dt}:null,isChecked:It.type==="check"?dt:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!x.value,totalDynamicFilters:((_t=N.value)==null?void 0:_t.length)||0,activeFilters:((Mt=N.value)==null?void 0:Mt.filter((It,Jt)=>{const lt=T.value[Jt];return Array.isArray(lt)?lt.length>0:lt!=null&<!==!1}).length)||0}}}a({getCurrentFiltersJSON:xe});function be(){de(),W("close",r)}function Te(){_.value=!1,be()}function Ve(me=!1){w.value&&(Ua.emit("filters-cancelled",r),w.value=!1),me||(_.value=!1,be())}n.onMounted(async()=>{document.addEventListener("click",ue),n.nextTick(()=>{Oe()});const me="https://fb78a14uud.execute-api.us-east-2.amazonaws.com/qa/views";try{const Ue=await(await fetch(me,{headers:{Authorization:`${k.token}`}})).json();m.value=Ue.data||[],g.value.clear(),m.value&&(g.value=m.value.reduce((Ee,Ke)=>(Ke.views&&Array.isArray(Ke.views)&&Ke.views.forEach(nt=>{nt.filters&&Array.isArray(nt.filters)&&Ee.set(nt.id,nt)}),Ee),new Map))}catch(Ue){console.error("Error al obtener datos:",Ue)}});function Oe(){document.querySelectorAll(".field-menu .option-card").forEach(me=>{const Ue=me.querySelector(".option-img");if(!Ue||!Ue.dataset.hoverSrc)return;const Ee=Ue.src,Ke=Ue.dataset.hoverSrc;me.addEventListener("mouseenter",()=>{Ue.src=Ke}),me.addEventListener("mouseleave",()=>{Ue.src=Ee})})}n.onUnmounted(()=>{document.removeEventListener("click",ue)}),Ua.on("set-filter-and-views-container",me=>{r=me,me&&ce(me)}),Ua.on("view-added",()=>{_.value=!0,w.value=!0}),Ua.on("component-added-to-container",me=>{(!t.value||r&&me.id===r.id)&&ce(me)}),Ua.on("edit-view",me=>{var Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be;h=me,r=((Ue=me.view)==null?void 0:Ue.filterAndViewsContainer)||null,l=null;const ut=[(Ke=(Ee=me.view)==null?void 0:Ee.coreView)==null?void 0:Ke.filtersJSON,(nt=me.view)==null?void 0:nt.filtersJSON,(at=me.coreView)==null?void 0:at.filtersJSON,me.filtersJSON,(wt=(pt=me.view)==null?void 0:pt.componentProps)==null?void 0:wt.filtersJSON];for(const xt of ut)if(xt){l=xt;break}if(r&&(r.viewId===4||r.viewId===8||r.viewId===3||r.viewId===1||r.viewId===2||r.viewId===13)&&(_t=me.view)!=null&&_t.id){const xt=r.getComponentDynamicFilters(me.view.id);if(xt){let mt="Unknown";r.viewId===4?mt="Timeline":r.viewId===8?mt="FieldPosesion":r.viewId===3?mt="GSCMatchSummary":r.viewId===1?mt="GSCComparativeReports":r.viewId===2?mt="GscTopPlayer":r.viewId===13&&(mt="GSCTimelapseTable"),l&&(r.viewId===13?l={...l,dynamicFilters:xt}:l={...l,dynamicFilters:xt.map((Tt,Ut)=>Array.isArray(Tt)?{selectedValue:Tt,selectedOptions:Tt.map(tt=>({value:tt,label:tt}))}:typeof Tt=="boolean"?{isChecked:Tt}:mt==="GSCComparativeReports"&&Ut===0?{selectedValue:Tt,selectedOptions:[{value:Tt,label:Tt}]}:mt==="GscTopPlayer"&&Ut===0?{selectedValue:Tt,selectedOptions:[{value:Tt,label:Tt}]}:mt==="GscTopPlayer"&&Ut===1?{selectedOption:{value:Tt,label:Tt}}:{selectedOption:{value:Tt,label:Tt}})})}}if(r&&r.viewId===2&&(Mt=me.view)!=null&&Mt.filterMultiple){if(me.view.filterMultiple.categoryId&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="select-simple"&&mt.filterLabel==="Tipo de análisis");xt!==-1&&(l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:me.view.filterMultiple.categoryId,selectedOptions:[{value:me.view.filterMultiple.categoryId,label:`Category ${me.view.filterMultiple.categoryId}`}]})}if(me.view.filterMultiple.teamType!==void 0&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button");if(xt!==-1){const mt=me.view.filterMultiple.teamType,Tt=mt===1?"Mi equipo":mt===2?"Rival":mt===3?"Ambos":"Equipo";l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:mt,label:Tt}}}}}if(r&&r.viewId===1&&(It=me.view)!=null&&It.filterMultiple&&me.view.filterMultiple.category&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="select-simple"&&mt.filterLabel==="Tipo de análisis");xt!==-1&&(l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:me.view.filterMultiple.category,selectedOptions:[{value:me.view.filterMultiple.category,label:me.view.filterMultiple.category}]})}if(r&&r.viewId===9&&(Jt=me.view)!=null&&Jt.filterMultiple){if(me.view.filterMultiple.categoryIds&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="select"&&mt.filterLabel==="Tipo de análisis");if(xt!==-1){const mt=Array.isArray(me.view.filterMultiple.categoryIds)?me.view.filterMultiple.categoryIds:[me.view.filterMultiple.categoryIds];l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:mt,selectedOptions:mt.map(tt=>({value:tt,label:`Category ${tt}`}))};const Tt=me.view.filterMultiple.categoryIds;Fe(Tt,mt);const Ut=(((lt=N.value[xt])==null?void 0:lt.options)||[]).filter(tt=>Array.isArray(tt.value)?Fe(tt.value,mt):mt.includes(tt.value));if(Ut.length>0){const tt=Ut[0];l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:tt.value,selectedOptions:[tt]}}}}if(me.view.filterMultiple.isHomeTeam!==void 0&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button");if(xt!==-1){const mt=me.view.filterMultiple.isHomeTeam;let Tt,Ut;typeof mt=="boolean"?(Tt=mt?1:2,Ut=mt?"Mi equipo":"Rival"):typeof mt=="number"?(Tt=mt===1?1:2,Ut=mt===1?"Mi equipo":"Rival"):(Tt=1,Ut="Mi equipo"),l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}}}if(r&&r.viewId===6&&(rt=me.view)!=null&&rt.filterMultiple&&me.view.filterMultiple.gameNumber&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="select-simple"&&mt.filterLabel==="Número de juego");xt!==-1&&(l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:me.view.filterMultiple.gameNumber,selectedOptions:[{value:me.view.filterMultiple.gameNumber,label:`Juego ${me.view.filterMultiple.gameNumber}`}]})}if(r&&r.viewId===7&&me.view&&l){if((dt=me.view.componentProps)!=null&&dt.analysisType){const xt=l.dynamicFilters.findIndex((mt,Tt)=>mt.filterType==="radio-button"&&Tt===0);if(xt!==-1){const mt=me.view.componentProps.analysisType,Tt=mt==="offensive"?1:2,Ut=mt==="offensive"?"A favor":"En contra";l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}}if(((vt=me.view.filterMultiple)==null?void 0:vt.isHomeTeam)!==void 0){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button"&&mt.filterLabel==="Equipo");if(xt!==-1){const mt=me.view.filterMultiple.isHomeTeam,Tt=mt?1:2,Ut=mt?"Equipo propio":"Equipo rival";l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}}}if(r&&r.viewId===10&&(Ft=me.view)!=null&&Ft.filterMultiple&&((it=(Vt=h==null?void 0:h.view)==null?void 0:Vt.coreView)==null?void 0:it.id)===10){const xt=me.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:xt})}if(r&&r.viewId===15&&(ct=me.view)!=null&&ct.filterMultiple&&me.view.filterMultiple.isHomeTeam!==void 0&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button"&&mt.filterLabel==="Mi equipo");if(xt!==-1){const mt=me.view.filterMultiple.isHomeTeam;let Tt,Ut;typeof mt=="boolean"?(Tt=mt?1:2,Ut=mt?"Local":"Visitante"):typeof mt=="number"?(Tt=mt===1?1:2,Ut=mt===1?"Local":"Visitante"):(Tt=1,Ut="Local"),l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}else l.dynamicFilters[0]=me.view.filterMultiple.isHomeTeam?1:2,l.dynamicFilters[1]=r.dynamicFilters[1]}if(r&&r.viewId===5&&(Be=me.view)!=null&&Be.filterMultiple&&me.view.filterMultiple.isHomeTeam!==void 0&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button"&&mt.filterLabel==="Equipo");if(xt!==-1){const mt=me.view.filterMultiple.isHomeTeam;let Tt,Ut;typeof mt=="boolean"?(Tt=mt?1:2,Ut=mt?"Equipo propio":"Equipo rival"):typeof mt=="number"?(Tt=mt===1?1:2,Ut=mt===1?"Equipo propio":"Equipo rival"):(Tt=1,Ut="Equipo propio"),l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}else{const mt=l.dynamicFilters.findIndex(Tt=>Tt.filterType==="radio-button");if(mt!==-1){const Tt=me.view.filterMultiple.isHomeTeam;let Ut,tt;typeof Tt=="boolean"?(Ut=Tt?1:2,tt=Tt?"Equipo propio":"Equipo rival"):typeof Tt=="number"?(Ut=Tt===1?1:2,tt=Tt===1?"Equipo propio":"Equipo rival"):(Ut=1,tt="Equipo propio"),l.dynamicFilters[mt]={...l.dynamicFilters[mt],selectedOption:{value:Ut,label:tt}}}}}l&&ye(l),_.value=!0});function _e(){K.value=null}function ze(me,Ue){var Ee;(Ee=x.value)==null||Ee.id}function Fe(me,Ue){if(!Array.isArray(me)||!Array.isArray(Ue)||me.length!==Ue.length)return!1;const Ee=[...me].sort((nt,at)=>nt-at),Ke=[...Ue].sort((nt,at)=>nt-at);return JSON.stringify(Ee)===JSON.stringify(Ke)}function Je(){if(t.value&&l&&l.dynamicFilters){if(o.value||v.value)return;o.value=!0,f.value=!0,l.dynamicFilters.forEach((me,Ue)=>{var Ee;if(me&&(Ee=N.value)!=null&&Ee[Ue]){const Ke=N.value[Ue];if(Ke.type==="check"&&me.isChecked!==void 0)T.value[Ue]=me.isChecked;else if(Ke.type==="select"&&me.selectedOptions){const nt=me.selectedOptions.map(at=>at.value);T.value[Ue]=nt}else Ke.type==="select"&&me.selectedValue&&Array.isArray(me.selectedValue)&&(T.value[Ue]=me.selectedValue)}}),n.nextTick(()=>{f.value=!1,o.value=!1})}}function Ce(){var me;if(t.value&&l&&l.dynamicFilters&&((me=x.value)==null?void 0:me.id)===4){if(o.value||v.value)return;o.value=!0,f.value=!0,l.dynamicFilters.forEach((Ue,Ee)=>{var Ke,nt;if(Ue&&((nt=(Ke=N.value)==null?void 0:Ke[Ee])==null?void 0:nt.type)==="select"){if(Ue.selectedOptions){const at=Ue.selectedOptions.map(pt=>pt.value);T.value[Ee]=at}else if(Ue.selectedValue&&Array.isArray(Ue.selectedValue))if(Ue.selectedValue.length>0&&Ue.selectedValue[0]&&typeof Ue.selectedValue[0]=="object"){const at=We(Ue.selectedValue);T.value[Ee]=at}else T.value[Ee]=Ue.selectedValue}}),setTimeout(()=>{var Ue;if(T.value=[...T.value],(Ue=h==null?void 0:h.view)!=null&&Ue.componentProps&&T.value&&T.value.length>0){const Ee=T.value[0];if(Array.isArray(Ee)&&Ee.length>0){const Ke=Ee.some(wt=>wt.event_type_id===1||typeof wt=="string"&&wt.includes("1")),nt=Ee.some(wt=>wt.category_id===8||typeof wt=="string"&&wt.includes("8")),at=Ee.some(wt=>wt.category_id===9||typeof wt=="string"&&wt.includes("9")),pt=Ee.some(wt=>wt.event_type_id===3||typeof wt=="string"&&wt.includes("3"));h.view.componentProps.selectedEvents=Ee,h.view.componentProps.goals=Ke,h.view.componentProps.yellowCards=nt,h.view.componentProps.redCards=at,h.view.componentProps.substitutions=pt,h.view.componentProps.key=Ee.length>0,h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps})}}},200),n.nextTick(()=>{f.value=!1,o.value=!1})}}function We(me){return!Array.isArray(me)||me.length===0?[]:me.map(Ue=>{if(Ue&&typeof Ue=="object"){if(Ue.event_type_id!==void 0||Ue.category_id!==void 0)return{event_type_id:Ue.event_type_id,category_id:Ue.category_id,...Ue.name&&{name:Ue.name},...Ue.label&&{label:Ue.label}};if(Ue.value&&typeof Ue.value=="object")return{event_type_id:Ue.value.event_type_id,category_id:Ue.value.category_id,...Ue.value.name&&{name:Ue.value.name},...Ue.value.label&&{label:Ue.value.label}};if(typeof Ue=="string"&&Ue.includes("-")){const[Ee,Ke]=Ue.split("-");return{category_id:parseInt(Ee),event_type_id:parseInt(Ke)}}}if(typeof Ue=="string")if(Ue.includes("-")){const[Ee,Ke]=Ue.split("-");return{category_id:parseInt(Ee),event_type_id:parseInt(Ke)}}else{const Ee=parseInt(Ue);if(!isNaN(Ee))return{event_type_id:Ee}}return Ue})}function Pe(){var me,Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt;if(t.value&&l&&l.dynamicFilters&&N.value){if(o.value||v.value)return;if(o.value=!0,f.value=!0,l.dynamicFilters.forEach((dt,vt)=>{var Ft,Vt,it,ct,Be,ut,xt,mt,Tt,Ut,tt;if(dt&&((Ft=N.value[vt])==null?void 0:Ft.type)==="select"){if(dt.selectedOptions){const Qe=dt.selectedOptions.map(kt=>kt.value);T.value[vt]=Qe}else if(dt.selectedValue&&Array.isArray(dt.selectedValue))if(dt.selectedValue.length>0&&dt.selectedValue[0]&&typeof dt.selectedValue[0]=="object"){const Qe=We(dt.selectedValue);T.value[vt]=Qe}else T.value[vt]=dt.selectedValue}else if(dt&&((Vt=N.value[vt])==null?void 0:Vt.type)==="select-simple"&&dt.selectedValue!==void 0){let Qe;((it=x.value)==null?void 0:it.id)===2&&(Be=(ct=h==null?void 0:h.view)==null?void 0:ct.filterMultiple)!=null&&Be.categoryId?Qe=h.view.filterMultiple.categoryId:((ut=x.value)==null?void 0:ut.id)===1&&(mt=(xt=h==null?void 0:h.view)==null?void 0:xt.filterMultiple)!=null&&mt.category?Qe=h.view.filterMultiple.category:((Tt=x.value)==null?void 0:Tt.id)===6&&(tt=(Ut=h==null?void 0:h.view)==null?void 0:Ut.filterMultiple)!=null&&tt.gameNumber?Qe=h.view.filterMultiple.gameNumber:Qe=Array.isArray(dt.selectedValue)?dt.selectedValue[0]:dt.selectedValue,T.value[vt]=Qe}}),((me=x.value)==null?void 0:me.id)===4&&setTimeout(()=>{var dt;if(T.value=[...T.value],(dt=h==null?void 0:h.view)!=null&&dt.componentProps&&T.value&&T.value.length>0){const vt=T.value[0];if(Array.isArray(vt)&&vt.length>0){const Ft=vt.some(Be=>Be.event_type_id===1||typeof Be=="string"&&Be.includes("1")),Vt=vt.some(Be=>Be.category_id===8||typeof Be=="string"&&Be.includes("8")),it=vt.some(Be=>Be.category_id===9||typeof Be=="string"&&Be.includes("9")),ct=vt.some(Be=>Be.event_type_id===3||typeof Be=="string"&&Be.includes("3"));h.view.componentProps.selectedEvents=vt,h.view.componentProps.goals=Ft,h.view.componentProps.yellowCards=Vt,h.view.componentProps.redCards=it,h.view.componentProps.substitutions=ct,h.view.componentProps.key=vt.length>0,h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps})}}},100),((Ue=x.value)==null?void 0:Ue.id)===2&&(Ee=h==null?void 0:h.view)!=null&&Ee.filterMultiple){if(h.view.filterMultiple.categoryId){const dt=N.value.findIndex(vt=>vt.type==="select-simple"&&vt.label==="Tipo de análisis");if(dt!==-1){const vt=h.view.filterMultiple.categoryId;if(T.value[0]=vt,h.view.componentProps&&vt){let Ft=`Category ${vt}`,Vt=null;try{Vt=Wh(vt),Vt&&(Ft=Vt.name)}catch{const it=N.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Tipo de análisis");if(it!==-1){const ct=(((Ke=N.value[it])==null?void 0:Ke.options)||[]).find(Be=>Be.value==vt);ct&&(Ft=ct.label)}}h.view.componentProps.categoryView=[{id:vt,name:Ft}]}(((nt=N.value[dt])==null?void 0:nt.options)||[]).find(Ft=>Ft.value==vt),n.nextTick(()=>{T.value=[...T.value]})}}if(h.view.filterMultiple.teamType!==void 0){const dt=N.value.findIndex(vt=>vt.type==="radio-button");if(dt!==-1){const vt=h.view.filterMultiple.teamType;T.value[dt]=vt,(((at=N.value[dt])==null?void 0:at.options)||[]).find(Ft=>Ft.value==vt),n.nextTick(()=>{T.value=[...T.value]})}}}if(((pt=x.value)==null?void 0:pt.id)===1&&(wt=h==null?void 0:h.view)!=null&&wt.filterMultiple&&h.view.filterMultiple.category&&N.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Tipo de análisis")!==-1){const dt=h.view.filterMultiple.category;T.value[0]=dt,h.view.componentProps&&dt&&(h.view.componentProps.type=dt),n.nextTick(()=>{T.value=[...T.value]})}if(((_t=x.value)==null?void 0:_t.id)===6&&(Mt=h==null?void 0:h.view)!=null&&Mt.filterMultiple&&h.view.filterMultiple.gameNumber&&N.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Número de juego")!==-1){const dt=h.view.filterMultiple.gameNumber;T.value[0]=dt,h.view.componentProps&&dt&&(h.view.componentProps.gameNumber=dt),n.nextTick(()=>{T.value=[...T.value]})}if(((It=x.value)==null?void 0:It.id)===5&&(Jt=h==null?void 0:h.view)!=null&&Jt.filterMultiple&&h.view.filterMultiple.isHomeTeam!==void 0)if(N.value.findIndex(dt=>dt.type==="radio-button"&&dt.label==="Equipo")!==-1){const dt=h.view.filterMultiple.isHomeTeam;let vt;typeof dt=="boolean"?vt=dt?1:2:typeof dt=="number"?vt=dt===1?1:2:vt=1,T.value[0]=vt,h.view.componentProps&&dt!==void 0&&(h.view.componentProps.isHomeTeamForAnalysis=dt===1),n.nextTick(()=>{T.value=[...T.value]})}else{const dt=N.value.findIndex(vt=>vt.type==="radio-button");if(dt!==-1){const vt=h.view.filterMultiple.isHomeTeam;let Ft;typeof vt=="boolean"?Ft=vt?1:2:typeof vt=="number"?Ft=vt===1?1:2:Ft=1,T.value[dt]=Ft,h.view.componentProps&&vt!==void 0&&(h.view.componentProps.preMatchType=vt),n.nextTick(()=>{T.value=[...T.value]})}}if(((lt=x.value)==null?void 0:lt.id)===15&&(rt=h==null?void 0:h.view)!=null&&rt.filterMultiple&&h.view.filterMultiple.isHomeTeam!==void 0){const dt=N.value.findIndex(vt=>vt.type==="radio-button");if(dt!==-1){const vt=h.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",vt,"type:",typeof vt);let Ft;typeof vt=="boolean"?Ft=vt?1:2:typeof vt=="number"?Ft=vt===1?1:2:Ft=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Ft,"teamFilterIndex:",dt),T.value[dt]=Ft,h.view.componentProps&&vt!==void 0&&(h.view.componentProps.preMatchType=Ft),n.nextTick(()=>{T.value=[...T.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",T.value)})}else{const vt=N.value.findIndex(Ft=>Ft.type==="radio-button");if(vt!==-1){const Ft=h.view.filterMultiple.isHomeTeam;let Vt;typeof Ft=="boolean"?Vt=Ft?1:2:typeof Ft=="number"?Vt=Ft===1?1:2:Vt=1,T.value[vt]=Vt,h.view.componentProps&&Ft!==void 0&&(h.view.componentProps.preMatchType=Vt),n.nextTick(()=>{T.value=[...T.value]})}}}n.nextTick(()=>{f.value=!1,o.value=!1})}}function ve(){if(!o.value&&t.value&&l&&l.dynamicFilters&&N.value){if(v.value)return;o.value=!0,f.value=!0,l.dynamicFilters.forEach((me,Ue)=>{var Ee;if(me&&((Ee=N.value[Ue])==null?void 0:Ee.type)==="radio-button"&&me.selectedOption&&me.selectedOption.value!==void 0){const Ke=me.selectedOption.value;T.value[Ue]=Ke}}),n.nextTick(()=>{f.value=!1,o.value=!1})}}function qe(){var me,Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be,ut,xt,mt,Tt,Ut,tt,Qe,kt,Wt,Rt,qt,Ht;if(r&&t.value&&h){if(v.value)return;if(f.value=!0,((me=x.value)==null?void 0:me.id)===4){if(r.setDynamicFilters(T.value,(Ue=h.view)==null?void 0:Ue.id),r.updateDynamicFilters(T.value,(Ee=h.view)==null?void 0:Ee.id),h.view.componentProps&&T.value&&T.value.length>0){const At=T.value[0];if(Array.isArray(At)&&At.length>0){const Yt=At.some(sr=>sr.event_type_id===1||typeof sr=="string"&&sr.includes("1")),Gt=At.some(sr=>sr.category_id===8||typeof sr=="string"&&sr.includes("8")),Bt=At.some(sr=>sr.category_id===9||typeof sr=="string"&&sr.includes("9")),or=At.some(sr=>sr.event_type_id===3||typeof sr=="string"&&sr.includes("3"));h.view.componentProps.selectedEvents=At,h.view.componentProps.goals=Yt,h.view.componentProps.yellowCards=Gt,h.view.componentProps.redCards=Bt,h.view.componentProps.substitutions=or,h.view.componentProps.key=At.length>0,h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps})}}}else if(((Ke=x.value)==null?void 0:Ke.id)===8)r.setDynamicFilters(T.value,(nt=h.view)==null?void 0:nt.id),r.updateDynamicFilters(T.value,(at=h.view)==null?void 0:at.id);else if(((pt=x.value)==null?void 0:pt.id)===3)r.setDynamicFilters(T.value,(wt=h.view)==null?void 0:wt.id),r.updateDynamicFilters(T.value,(_t=h.view)==null?void 0:_t.id);else if(((Mt=x.value)==null?void 0:Mt.id)===13){const At=(It=h.view)==null?void 0:It.id;r.setDynamicFilters(T.value,At),r.updateDynamicFilters(T.value,At),h.view.componentProps&&(h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps}))}else if(((Jt=x.value)==null?void 0:Jt.id)===15){const At=(lt=h.view)==null?void 0:lt.id;if(r.setDynamicFilters(T.value,At),r.updateDynamicFilters(T.value,At),h.view.componentProps){const Yt=Array.isArray(T.value)&&T.value[3]!==void 0?T.value[3]:null;Yt!==null&&(h.view.componentProps.numitems=Yt),h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps})}}else if(((rt=x.value)==null?void 0:rt.id)===2){r.setDynamicFilters(T.value,(dt=h.view)==null?void 0:dt.id),r.updateDynamicFilters(T.value,(vt=h.view)==null?void 0:vt.id);const At=T.value[0];if(At!==void 0&&(h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.categoryId,h.view.filterMultiple.categoryId=At,h.view.componentProps)){let Gt=`Category ${At}`,Bt=null;try{Bt=Wh(At),Bt&&(Gt=Bt.name)}catch{const or=N.value.findIndex(sr=>sr.type==="select-simple"&&sr.label==="Tipo de análisis");if(or!==-1){const sr=(((Ft=N.value[or])==null?void 0:Ft.options)||[]).find(qr=>qr.value==At);sr&&(Gt=sr.label)}}h.view.componentProps.categoryView=[{id:At,name:Gt}],Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple})}const Yt=T.value[1];Yt!==void 0&&(h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.teamType,h.view.filterMultiple.teamType=Yt,h.view.componentProps&&h.view.componentProps.game&&(Yt===1?h.view.componentProps.teamView=h.view.componentProps.game.homeTeam.team_id:Yt===2?h.view.componentProps.teamView=h.view.componentProps.game.awayTeam.team_id:h.view.componentProps.teamView=0),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}))}else if(((Vt=x.value)==null?void 0:Vt.id)===1){r.setDynamicFilters(T.value,(it=h.view)==null?void 0:it.id),r.updateDynamicFilters(T.value,(ct=h.view)==null?void 0:ct.id);const At=T.value[0];At!==void 0&&(h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.category,h.view.filterMultiple.category=At,h.view.componentProps&&(h.view.componentProps.type=At),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}))}else if(((Be=x.value)==null?void 0:Be.id)===6){r.setDynamicFilters(T.value,(ut=h.view)==null?void 0:ut.id),r.updateDynamicFilters(T.value,(xt=h.view)==null?void 0:xt.id);const At=T.value[0];At!==void 0&&(h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.gameNumber,h.view.filterMultiple.gameNumber=At,h.view.componentProps&&(h.view.componentProps.gameNumber=At,h.view._updateKey,h.view._updateKey=Date.now()),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}),Ua.emit("dynamic-filters-changed",{containerViewId:(mt=x.value)==null?void 0:mt.id,viewId:h.view.id,dynamicFilters:T.value}),Ua.emit("component-props-updated",{viewId:h.view.id,componentProps:h.view.componentProps,dynamicFilters:T.value}),n.nextTick(()=>{h.view.componentProps&&(h.view.componentProps={...h.view.componentProps})}))}else if(((Tt=x.value)==null?void 0:Tt.id)===7){r.setDynamicFilters(T.value,(Ut=h.view)==null?void 0:Ut.id),r.updateDynamicFilters(T.value,(tt=h.view)==null?void 0:tt.id);const At=T.value[0],Yt=T.value[1];if(At!==void 0&&h.view.componentProps){const Gt=At===1?"offensive":"defensive";h.view.componentProps.analysisType=Gt}if(Yt!==void 0){h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.isHomeTeam;const Gt=Yt===1;h.view.filterMultiple.isHomeTeam=Gt,h.view.componentProps&&(h.view.componentProps.isHomeTeamForAnalysis=Gt,h.view._updateKey,h.view._updateKey=Date.now()),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}),Ua.emit("dynamic-filters-changed",{containerViewId:(Qe=x.value)==null?void 0:Qe.id,viewId:h.view.id,dynamicFilters:T.value}),Ua.emit("component-props-updated",{viewId:h.view.id,componentProps:h.view.componentProps,dynamicFilters:T.value}),n.nextTick(()=>{h.view.componentProps&&(h.view.componentProps={...h.view.componentProps})})}}else if(((kt=x.value)==null?void 0:kt.id)===5){r.setDynamicFilters(T.value,(Wt=h.view)==null?void 0:Wt.id),r.updateDynamicFilters(T.value,(Rt=h.view)==null?void 0:Rt.id);const At=T.value[0];if(At!==void 0){h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.isHomeTeam;const Yt=At===1?1:2;h.view.filterMultiple.isHomeTeam=Yt,h.view.componentProps&&(h.view.componentProps.isHomeTeamForAnalysis=Yt===1,h.view._updateKey,h.view._updateKey=Date.now()),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}),Ua.emit("dynamic-filters-changed",{containerViewId:(qt=x.value)==null?void 0:qt.id,viewId:h.view.id,dynamicFilters:T.value}),Ua.emit("component-props-updated",{viewId:h.view.id,componentProps:h.view.componentProps,dynamicFilters:T.value}),n.nextTick(()=>{h.view.componentProps&&(h.view.componentProps={...h.view.componentProps})})}}else((Ht=x.value)==null?void 0:Ht.id)===9||(r.setDynamicFilters(T.value),r.updateDynamicFilters(T.value));n.nextTick(()=>{f.value=!1})}}function ke(){var me,Ue;if(!l||!l.dynamicFilters||!N.value)return!1;for(let Ee=0;Ee<l.dynamicFilters.length;Ee++){const Ke=l.dynamicFilters[Ee],nt=N.value[Ee],at=T.value[Ee];if(!(!Ke||!nt)){if(nt.type==="check"){if(Ke.isChecked!==at)return!0}else if(nt.type==="radio-button"){if(((me=Ke.selectedOption)==null?void 0:me.value)!==at)return!0}else if(nt.type==="select"){const pt=((Ue=Ke.selectedOptions)==null?void 0:Ue.map(_t=>_t.value))||Ke.selectedValue||[],wt=Array.isArray(at)?at:[];if(JSON.stringify(pt)!==JSON.stringify(wt))return!0}}}return!1}function Ge(me){var Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft;if(T.value=me.filters,r){const Vt=((Ue=h==null?void 0:h.view)==null?void 0:Ue.id)||null;r.setDynamicFilters(T.value,Vt),r.updateDynamicFilters(T.value,Vt)}if(t.value&&h&&(Ua.emit("activate-save-button"),Ua.emit("force-component-update",{itemId:((Ee=h==null?void 0:h.view)==null?void 0:Ee.id)||null,componentProps:h.view.componentProps}),Ua.emit("dynamic-filters-changed",{containerViewId:((Ke=h==null?void 0:h.view)==null?void 0:Ke.id)||null,viewId:((nt=h==null?void 0:h.view)==null?void 0:nt.id)||null,dynamicFilters:T.value}),Ua.emit("dynamic-filters-changed",{containerViewId:((at=h==null?void 0:h.view)==null?void 0:at.id)||null,viewId:((pt=h==null?void 0:h.view)==null?void 0:pt.id)||null,dynamicFilters:T.value}),n.nextTick(()=>{h.view.componentProps&&(h.view.componentProps={...h.view.componentProps})})),!t.value&&r&&((wt=x.value)==null?void 0:wt.id)===15&&r.getRequiresAddView(T.value)){r.setDynamicFilters(T.value),W("filters-changed",{main:c.value,view:x.value,team:F.value,dynamicFilters:T.value,filtersJSON:{mainSelector:{id:((_t=c.value)==null?void 0:_t.id)||null,name:((Mt=c.value)==null?void 0:Mt.name)||null,url:((It=c.value)==null?void 0:It.url)||null},viewSelector:{id:((Jt=x.value)==null?void 0:Jt.id)||null,name:((lt=x.value)==null?void 0:lt.name)||((rt=x.value)==null?void 0:rt.title)||null,url:((dt=x.value)==null?void 0:dt.url)||null},team:F.value,dynamicFilters:T.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!x.value,totalDynamicFilters:((vt=N.value)==null?void 0:vt.length)||0,activeFilters:((Ft=N.value)==null?void 0:Ft.filter((Vt,it)=>{const ct=T.value[it];return Array.isArray(ct)?ct.length>0:ct!=null&&ct!==!1}).length)||0}},filterAndViewsContainer:r,viewToEdit:h}),ae();return}qe()}function Re(me){me.filterIndex!==void 0&&me.value!==void 0&&(T.value[me.filterIndex]=me.value,t.value&&qe(),ae())}function Xe(){Ve(!0)}function Ze(me){var Ue,Ee,Ke,nt,at,pt,wt;console.log("33333333333333333333333333333333333333");const _t={mainSelector:{id:((Ue=c.value)==null?void 0:Ue.id)||null,name:((Ee=c.value)==null?void 0:Ee.name)||null,url:((Ke=c.value)==null?void 0:Ke.url)||null},viewSelector:{id:((nt=x.value)==null?void 0:nt.id)||null,name:((at=x.value)==null?void 0:at.name)||((pt=x.value)==null?void 0:pt.title)||null,url:((wt=x.value)==null?void 0:wt.url)||null}};W("filters-changed",{filters:me.filters,view:me.view,viewToEdit:h,filterAndViewsContainer:r,filtersJSON:_t,isAltMode:!0})}function et(me){return JSON.parse(JSON.stringify(me))}return(me,Ue)=>(n.openBlock(),n.createElementBlock("div",qTe,[n.createElementVNode("button",UTe,n.toDisplayString(t.value?"Editando visualización":"Nueva visualización"),1),n.createElementVNode("div",{class:n.normalizeClass(["custom-select main-select",{disabled:t.value}]),onClick:G},[n.createElementVNode("div",zTe,[n.createElementVNode("span",CTe,[c.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,PTe)):(n.openBlock(),n.createElementBlock("img",FTe))]),c.value?(n.openBlock(),n.createElementBlock("span",RTe,n.toDisplayString(H()),1)):(n.openBlock(),n.createElementBlock("span",ETe,"Tipo de vista")),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:R.value}])},[...Ue[5]||(Ue[5]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),R.value?(n.openBlock(),n.createElementBlock("div",MTe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,(Ee,Ke)=>(n.openBlock(),n.createElementBlock("div",{key:Ee.id,class:n.normalizeClass(["option-card",{active:p.value===Ke}]),onClick:n.withModifiers(nt=>ee(Ke),["stop"])},[n.createElementVNode("div",jTe,[n.createElementVNode("img",{src:D(Ee.name,!1),"data-hover-src":D(Ee.name,!0),alt:"icono",class:"option-img-34"},null,8,KTe)]),n.createElementVNode("div",ATe,[n.createElementVNode("div",ITe,n.toDisplayString(Ee.name),1),Ee.description?(n.openBlock(),n.createElementBlock("div",XTe,n.toDisplayString(Ee.description),1)):n.createCommentVNode("",!0)])],10,WTe))),128))])):n.createCommentVNode("",!0)],2),c.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["custom-select second-select",{disabled:t.value}]),onClick:re},[n.createElementVNode("div",DTe,[n.createElementVNode("span",JTe,[x.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:x.value.url,alt:"icono",class:"option-img-graph2"},null,8,GTe)):c.value?(n.openBlock(),n.createElementBlock("img",{key:1,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,BTe)):n.createCommentVNode("",!0)]),n.createElementVNode("span",ZTe,n.toDisplayString(ne()),1),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:j.value}])},[...Ue[6]||(Ue[6]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),j.value&&c.value?(n.openBlock(),n.createElementBlock("div",HTe,[n.createElementVNode("div",YTe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,Ee=>(n.openBlock(),n.createElementBlock("div",{key:Ee.id,class:n.normalizeClass(["option-card-grid",{active:b.value===Ee.id}]),onClick:n.withModifiers(Ke=>Y(Ee),["stop"])},[n.createElementVNode("div",$Te,n.toDisplayString(Ee.name||Ee.title),1),n.createElementVNode("div",e6e,[n.createElementVNode("img",{src:Ee.url,alt:"icono",class:"option-img-grid"},null,8,t6e)])],10,QTe))),128))])])):n.createCommentVNode("",!0)],2)):n.createCommentVNode("",!0),x.value?(n.openBlock(),n.createElementBlock("div",r6e)):n.createCommentVNode("",!0),x.value&&x.value.id===13?(n.openBlock(),n.createBlock(gSe,{key:2,filters:N.value,"initial-values":t.value?n.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":13,onFiltersChanged:Ge,onFilterUpdated:Re},null,8,["filters","initial-values","is-edit-mode"])):x.value&&x.value.id===16?(n.openBlock(),n.createBlock(OTe,{key:3,"view-config":et(g.value.get(16)),"default-filters":n.unref(h)?n.unref(h).view.filterMultiple:null,"is-edit-mode":!!n.unref(h),"is-post-match":e.isPostMatch,onChange:Ze,onRemoveViews:Xe},null,8,["view-config","default-filters","is-edit-mode","is-post-match"])):x.value&&x.value.id===15?(n.openBlock(),n.createBlock(FSe,{key:4,filters:N.value,"initial-values":t.value?n.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":15,onFiltersChanged:Ge,onFilterUpdated:Re},null,8,["filters","initial-values","is-edit-mode"])):x.value&&N.value&&C()?(n.openBlock(),n.createElementBlock("div",{key:5,class:n.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":N.value.length>=2}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.value,(Ee,Ke)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:Ke},[Ee.type==="select"?(n.openBlock(),n.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:n.withModifiers(nt=>$(Ke),["stop"])},[n.createElementVNode("div",a6e,[Ue[8]||(Ue[8]=n.createElementVNode("span",{class:"select-icon select-analisis-icon"},[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Ue[9]||(Ue[9]=n.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(T.value[Ke])&&T.value[Ke].length>0?(n.openBlock(),n.createElementBlock("span",i6e,n.toDisplayString(T.value[Ke].length),1)):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:K.value===Ke}])},[...Ue[7]||(Ue[7]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),K.value===Ke?(n.openBlock(),n.createElementBlock("div",o6e,[n.createElementVNode("div",s6e,[n.createElementVNode("div",{class:"multi-select-header",onClick:Ue[1]||(Ue[1]=n.withModifiers(()=>{},["stop"]))},[n.createElementVNode("label",l6e,[n.createElementVNode("input",{type:"checkbox",checked:z(Ke),indeterminate:O(Ke),onChange:n.withModifiers(nt=>S(Ke),["stop"]),onClick:Ue[0]||(Ue[0]=n.withModifiers(()=>{},["stop"]))},null,40,c6e),Ue[10]||(Ue[10]=n.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Ee.options,nt=>(n.openBlock(),n.createElementBlock("div",{key:nt.value,class:n.normalizeClass(["option-card multi-select-option",{active:V(Ke,nt.value)}]),onClick:Ue[2]||(Ue[2]=n.withModifiers(()=>{},["stop"]))},[n.createElementVNode("div",u6e,[n.createElementVNode("input",{type:"checkbox",checked:V(Ke,nt.value),onChange:n.withModifiers(at=>U(Ke,nt.value),["stop"])},null,40,d6e)]),n.createElementVNode("div",{class:"option-content",onClick:at=>U(Ke,nt.value)},[n.createElementVNode("div",h6e,n.toDisplayString(nt.label),1)],8,p6e)],2))),128))]),n.createElementVNode("div",f6e,[n.createElementVNode("button",{class:"btn-listo",onClick:Ue[3]||(Ue[3]=n.withModifiers(nt=>_e(),["stop"]))},"Listo")])])):n.createCommentVNode("",!0)],8,n6e)):Ee.type==="radio-button"?(n.openBlock(),n.createElementBlock("div",m6e,[n.createElementVNode("div",y6e,n.toDisplayString(Ee.label),1),n.createElementVNode("div",g6e,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Ee.options,nt=>(n.openBlock(),n.createElementBlock("label",{key:nt.value,class:n.normalizeClass(["radio-option-card",{active:T.value[Ke]===nt.value}])},[n.withDirectives(n.createElementVNode("input",{type:"radio",name:"dynamic-radio-"+Ke,value:nt.value,"onUpdate:modelValue":at=>T.value[Ke]=at,disabled:P(nt.value,nt.label),onChange:()=>{var at,pt,wt;if(((at=x.value.value)==null?void 0:at.id)===9&&t.value.value&&(wt=(pt=n.unref(h))==null?void 0:pt.view)!=null&&wt.filterMultiple){const _t=T.value[Ke]===1;n.unref(h).view.filterMultiple.isHomeTeam=_t}t.value.value&&qe(),ae()}},null,40,v6e),[[n.vModelRadio,T.value[Ke]]]),n.createElementVNode("span",null,n.toDisplayString(nt.label),1)],2))),128))])])):Ee.type==="check"?(n.openBlock(),n.createElementBlock("div",b6e,[n.createElementVNode("label",null,[n.withDirectives(n.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":nt=>T.value[Ke]=nt,checked:T.value[Ke],onChange:Ue[4]||(Ue[4]=()=>{t.value.value&&qe(),ae()})},null,40,x6e),[[n.vModelCheckbox,T.value[Ke]]]),n.createTextVNode(" "+n.toDisplayString(Ee.label),1)])])):Ee.type==="select-simple"?(n.openBlock(),n.createElementBlock("div",{key:3,class:"custom-select dynamic-select filter-inline","data-filter-type":Ee.type,onClick:n.withModifiers(nt=>le(Ke),["stop"])},[n.createElementVNode("div",_6e,[Ue[12]||(Ue[12]=n.createElementVNode("span",{class:"select-icon select-analisis-icon"},[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Ue[13]||(Ue[13]=n.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:X.value===Ke}])},[...Ue[11]||(Ue[11]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),X.value===Ke?(n.openBlock(),n.createElementBlock("div",S6e,[n.createElementVNode("div",T6e,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Ee.options,nt=>(n.openBlock(),n.createElementBlock("div",{key:nt.value,class:n.normalizeClass(["option-card simple-select-option",{active:T.value[Ke]===nt.value}]),onMouseenter:at=>ze(Ke,nt.value),onClick:n.withModifiers(at=>ie(Ke,nt.value),["stop"])},[n.createElementVNode("div",L6e,[n.createElementVNode("div",N6e,n.toDisplayString(nt.label),1)]),T.value[Ke]===nt.value?(n.openBlock(),n.createElementBlock("div",V6e,[...Ue[14]||(Ue[14]=[n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):n.createCommentVNode("",!0)],42,k6e))),128))])])):n.createCommentVNode("",!0)],8,w6e)):n.createCommentVNode("",!0),Ke===1&&N.value.length>2?(n.openBlock(),n.createElementBlock("div",O6e)):n.createCommentVNode("",!0)],64))),128))],2)):n.createCommentVNode("",!0),t.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:6,class:"cancel-btn",onClick:Ve},"Cancelar")),_.value?(n.openBlock(),n.createElementBlock("button",{key:7,class:"ok-btn",onClick:Te},"OK")):n.createCommentVNode("",!0)]))}}),U6e=jd(q6e,[["__scopeId","data-v-3b8c807a"]]),z6e={key:0,class:"modal-simple"},C6e={class:"modal-simple__content"},P6e={class:"modal-simple__content__header"},F6e={class:"modal-simple__content__body"},E6e={class:"modal-simple__content__footer"},R6e={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[e.modelValue?(n.openBlock(),n.createElementBlock("div",z6e,[n.createElementVNode("div",C6e,[n.createElementVNode("div",P6e,[n.renderSlot(a.$slots,"header",{},void 0,!0)]),n.createElementVNode("div",F6e,[n.renderSlot(a.$slots,"body",{},void 0,!0)]),n.createElementVNode("div",E6e,[n.renderSlot(a.$slots,"footer",{},void 0,!0)])])])):n.createCommentVNode("",!0)]))}},M6e=jd(R6e,[["__scopeId","data-v-1cc4f590"]]),W6e={class:"footer"},j6e={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:a}){const i=a;function k(g){i("update:modelValue",g)}function W(g){i("action",g),i("update:modelValue",!1)}return(g,m)=>(n.openBlock(),n.createBlock(M6e,{"modle-value":e.value,"onUpdate:modelValue":k},{header:n.withCtx(()=>[...m[2]||(m[2]=[n.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:n.withCtx(()=>[...m[3]||(m[3]=[n.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:n.withCtx(()=>[n.createElementVNode("div",W6e,[n.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:m[0]||(m[0]=r=>W(!1))}," Seguir editando "),n.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:m[1]||(m[1]=r=>W(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},K6e=jd(j6e,[["__scopeId","data-v-ed9b5088"]]),A6e={key:0,class:"modal-simple"},I6e={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[n.createVNode(n.Transition,null,{default:n.withCtx(()=>[e.modelValue?(n.openBlock(),n.createElementBlock("div",A6e,[...i[0]||(i[0]=[n.createElementVNode("div",{class:"modal-simple__content"},[n.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M29.3346 14.7823V16.0089C29.333 18.8842 28.402 21.6818 26.6804 23.9847C24.9589 26.2876 22.539 27.9722 19.7818 28.7875C17.0245 29.6027 14.0776 29.5048 11.3806 28.5084C8.68354 27.512 6.38084 25.6704 4.81592 23.2584C3.25099 20.8463 2.50769 17.993 2.69687 15.124C2.88605 12.255 3.99758 9.52404 5.86568 7.33836C7.73377 5.15269 10.2583 3.62944 13.0629 2.9958C15.8674 2.36215 18.8017 2.65205 21.428 3.82227",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),n.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):n.createCommentVNode("",!0)]),_:1})]))}},X6e=jd(I6e,[["__scopeId","data-v-2bc30783"]]),D6e={class:"template-maker__header"},J6e={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},G6e={class:"template-maker__content"},B6e={class:"template-maker__content__main"},Z6e={id:"containerMain",class:"container-main"},H6e={class:"template-maker__content__main__cover-selector"},Y6e=["id"],Q6e={class:"page-indicator"},$6e={class:"page-indicator__index"},e4e=["onClick"],t4e=["onClick"],r4e={key:0,class:"template-maker__content__main__footer"},n4e={class:"template-maker__content__main__footer__paginator"},a4e={class:"template-maker__content__main__footer__paginator__nav"},i4e={class:"template-maker__content__main__footer__paginator__numbers"},o4e=["onClick"],s4e={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:a,emit:i}){const k=new Map,W=n.ref([{title:"Page 1",id:String(Date.now()),items:[{name:"Volumetrica",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:6,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}},{name:"Volumetrica",id:String(Date.now()),x:4,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]}]),g=n.ref(null),m=n.ref(0),r=n.ref(!1),h=n.ref(null),l=n.ref(null),t=n.ref(!0),_=n.ref(!1),w=n.ref(!1),v=n.ref(0),f=n.ref(!1),o=n.ref(null),s=n.ref(new Map),p=n.ref(null),c=n.ref(null),d=n.ref(!1),b=n.ref(!1),x=n.ref(!1),T=new Map,N=n.computed(()=>({"--overflow-y-template-maker":_.value?"scroll":"hidden","--height-container-main":_.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(_.value,"0")})),V=n.computed(()=>m.value+1);n.watch(()=>r.value,_e=>{const ze=document.getElementById("app");_e?(m.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",ze&&(ze.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",ze&&(ze.style.overflow=""))});function U(_e){return _e<10?`0${_e}`:_e}async function z({templateId:_e,userId:ze}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${ze}/templates/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Fe){console.error("Error fetching template by ID:",Fe)}}async function O({reportId:_e,userId:ze}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${ze}/reports/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Fe){console.error("Error fetching report by ID:",Fe)}}let C=0;function q(_e){g.value=_e,C>0&&(d.value=!0),C++}function L(_e){_e&&ue(null,!0)}let P=null;function S(_e,ze){let Fe=_e.getBoundingClientRect(),Je={height:_e.clientHeight,width:_e.clientWidth},Ce=ze.getBoundingClientRect();if(!(Ce.top>=Fe.top&&Ce.bottom<=Fe.top+Je.height)){const We=Ce.top-Fe.top,Pe=Ce.bottom-Fe.bottom;Math.abs(We)<Math.abs(Pe)?_e.scrollTop+=We:_e.scrollTop+=Pe}}function F(_e,ze){let Fe=_e.getBoundingClientRect();const Je=ze.getBoundingClientRect().top-Fe.top;_e.scrollTop+=Je}function R(_e,ze=!1){const Fe={title:`Page ${W.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(xe(),_e!==void 0&&_e>=-1?W.value.splice(_e+1,0,Fe):W.value.push(Fe),n.nextTick(()=>{const Je=W.value.findIndex(We=>We.id===Fe.id),Ce=document.getElementById(`page-${Je+1}`);P||(P=document.getElementById("containerMain")),Ce&&P?S(P,Ce):console.error("Page element or container main element not found")}),ze)return Fe;d.value=!0}function j(_e){if(_e<0||_e>W.value.length)return;m.value=_e;const ze=document.getElementById(`page-${_e}`);if(P||(P=document.getElementById("containerMain")),ze&&P){const Fe=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Fe),F(P,ze),setTimeout(()=>{const Je=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Je)},300)}else console.error("Page element or container main element not found")}function K(_e){p.value=_e,f.value=!0}function X(_e,ze){const Fe=ze+1;_e&&m.value!==Fe&&(m.value=Fe)}function D(_e){f.value=!0,Ua.emit("edit-view",{view:_e})}async function H({templateReportId:_e,userId:ze,isTemplateMode:Fe}){try{return Fe?z({templateId:_e,userId:ze}):O({reportId:_e,userId:ze})}catch(Je){throw new Error("Error fetching template or report by ID: "+Je.message)}}function ne(){C=0,f.value=!1,m.value=0,p.value=null,c.value=null,s.value.clear(),P=null}async function G(_e){if(ne(),t.value=_e.isTemplateMode,_.value=!!_e.isPDFMode,_e.isPDFMode?h.value=await O({reportId:_e.reportId,userId:_e.userId}):(h.value=_e.template,h.value=await H({templateReportId:_e.template.id,userId:_e.template.user_id,isTemplateMode:_e.isTemplateMode})),!h.value)return;h.value&&h.value.game&&(h.value.game=ie(h.value.game)),l.value=JSON.parse(JSON.stringify(h.value)),w.value=h.value.template_type===2;const ze=h.value.pages.find(Fe=>Fe.is_front_page);v.value=ze?ze.type:1,r.value=!0,W.value=h.value.pages.reduce((Fe,Je,Ce)=>{if(!Je.is_front_page){Je.name||(Je.name="");const We=Ce,Pe={originalPage:JSON.parse(JSON.stringify(Je)),title:Je.name,id:`p-${Date.now()-Ce*9}`,items:[],components:Je.components};Je.components&&Je.components.length>0&&(Pe.items=Je.components.map((ve,qe)=>{const ke=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ve.coreView.id,ve.dynamicFilters,w.value,t.value,ve.filtersJSON||null,$.token,ve.filters),Ge={originalComponent:JSON.parse(JSON.stringify(ve)),title:ve.title,shortTitle:ve.shortTitle||ve.title,game:h.value.game,idAux:ve.id,id:`w-${Date.now()-qe*7}`,x:ve.column,y:ve.row,w:ve.colspan,h:ve.rowspan,maxWidth:ve.max_column,maxHeight:ve.max_row,minWidth:ve.min_column,minHeight:ve.min_row,noResize:!t.value,noMove:!t.value,coreView:ve.coreView||null,isTemplateMode:t.value,componentName:ve.componentName,componentProps:Y({currentProps:ve.componentProps,coreView:ve.coreView,isTemplateMode:t.value,templateToEdit:h.value,filterMultiple:ve.filterMultiple||null,game:h.value.game||null,dynamicFilters:ve.dynamicFilters,page:We,componentId:qe})||{},filterMultiple:ve.filterMultiple,isHomeTeam:ee({game:h.value.game,isTemplateMode:t.value,currentIsHomeTeam:ve.isHomeTeam||ve.componentProps.isHomeTeamForAnalysis}),filtersJSON:ve.filtersJSON||null,dynamicFilters:ve.dynamicFilters||[],filterAndViewsContainer:ke},Re=n.reactive({view:Ge});return ke.addView(Re,!0),s.value.set(ke.getId(),ke),Ge})),Fe.push(Pe)}return Fe},[])}function re({game:_e,isTemplateMode:ze}){const Fe=_e&&_e.homeTeam&&_e.awayTeam&&(_e.homeTeam.team_id===$.userTeamId||_e.awayTeam.team_id===$.userTeamId);return{isUserTeamHome:Fe&&_e.homeTeam.team_id===$.userTeamId,requiresUserTeamAdjustment:Fe&&!ze}}function ee({game:_e,isTemplateMode:ze,currentIsHomeTeam:Fe}){const{isUserTeamHome:Je,requiresUserTeamAdjustment:Ce}=re({game:_e,isTemplateMode:ze});return Ce?Fe?Je:!Je:Fe}function Y({currentProps:_e,coreView:ze,templateToEdit:Fe,isTemplateMode:Je,filterMultiple:Ce,game:We,dynamicFilters:Pe,page:ve,componentId:qe}){if(!_e||!ze)return _e||{};const{isUserTeamHome:ke,requiresUserTeamAdjustment:Ge}=re({game:We,isTemplateMode:Je}),Re={..._e};if(ze.id===5&&(Re.isGhostEffect=Je,Ge)){const Xe=Re.preMatchType===1;Re.preMatchType=Xe?ke?1:2:ke?2:1}if(ze.id===7&&Ge){const Xe=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Xe?ke:!ke}if(ze.id===9&&Ge){const Xe=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Xe?ke:!ke}if(ze.id===16){if(Ge){const Ze=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ze?ke:!ke}Re.seasonId=Fe.value.season_id,Re.teamIdForAnalysis=Re.isHomeTeamForAnalysis?Fe.value.game.home_team:Fe.value.game.visiting_team;const Xe=Re.isHomeTeamForAnalysis?Fe.value.last_games.last_home_games:Fe.value.last_games.last_visiting_games;Re.gamesIdsForAnalysis=w.value?[Fe.value.game.game_id]:Re.howManyGames?Xe.slice(0,Re.howManyGames).map(Ze=>Ze.game_id):[]}if(ze.id===10&&Ge){const Xe=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Xe?ke:!ke}if(ze.id===1&&(Re.gameId=We?We.id:"",Re.homeLogo=We?We.homeTeam.logo:"",Re.awayLogo=We?We.awayTeam.logo:"",Re.seasonId=We?We.season_id:0,Re.default=Je),ze.id===6&&(Re.game=We||"",Re.lastGames=Fe.last_games,Re.selectedOption=Fe.template_type===2?"Postmatch":"Prematch"),ze.id===13&&(Re.isdefault=Je,Re.seasonid=We?We.seasonId:2010,Re.datetimeutc=We?Fe.template_type===1?We?We.date_time_utc:"":null:"",Re.teamids=We?[We.home_team,We.visiting_team]:[1,2],Re.categoryids=Pe?Pe[1]:[20,2],Re.teamsshow=We?Pe?Pe[2]==1?[We.home_team]:Pe[2]==2?[We.visiting_team]:[We.home_team,We.visiting_team]:[1,2]:[1,2],Re.analysistype=Pe?Pe[0]:[],Re.gameid=Fe.template_type===1?null:We?We.id:"",Re.teams=We?[{id:We.home_team,name:We.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+We.home_team+".png"},{id:We.visiting_team,name:We.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+We.visiting_team+".png"}]:[]),ze.id===15&&(Re.view=1,Re.token=$.token,Re.numitems=Pe?Pe[1]:3,Re.isdefault=Je,Re.reportid=Fe!=null&&Fe.id?Fe.id:0,Re.userid=Fe!=null&&Fe.user_id?Fe.user_id:0,Re.page=ve+1,Re.componentid=qe+1,Re.data={season:We?We.seasonId:2010,type:2,game:We?We.id:0,team:We?We.home_team:2}),ze.id===14&&(Re.isReports=!0,Re.isDefault=Je,Re.type=Fe.tournament_type==1?1:0,Re.typeView=1,Re.tournament=Fe.tournament_id,Re.currentSeason=We?We.season_id:0,Re.currentSeasonId=We?We.season_id:0,Re.showVideos=!1,Re.localTeam=We?We.home_team:0,Re.awayTeam=We?We.visiting_team:0),ze.id===3&&(Re.defaultShields=Je),ze.id===2){let Xe=!0,Ze=0,et=0;We&&(Xe=Fe.main_team==We.home_team||Fe.main_team==We.visiting_team,Ze=Xe?Fe.main_team==(We==null?void 0:We.home_team)?We==null?void 0:We.home_team:We==null?void 0:We.visiting_team:We==null?void 0:We.home_team,et=Xe?Fe.main_team==(We==null?void 0:We.home_team)?We==null?void 0:We.visiting_team:We==null?void 0:We.home_team:We==null?void 0:We.visiting_team),Re.gamed=We?We.id:"",Re.game=We||"",Re.season=We?We.season_id:0,Re.teamView=Ce.teamType==3?0:Ce.teamType==1?Ze:et,Re.useDummyData=Je}return ze.id===8&&(Re.teamSelected=We?{teamId:We.home_team}:1,Re.isDefault=Je),ze.id===4&&(Re.gameId=We?We.id:"",Re.isDefault=Je,Re.homeTeam=We?We==null?void 0:We.home_team:"",Re.awayTeam=We?We==null?void 0:We.visiting_team:""),We&&(Re.game=We),Re}const $=e,le=i;n.watch(()=>$.token,(_e,ze)=>{},{immediate:!0}),a({show:G}),Ua.on("add-page-view",_e=>{k.set(_e.view.id,_e.view);const ze=W.value.find(Fe=>Fe.id===_e.pageId);ze&&(ze.items||(ze.items=[]),ze.items.push(_e.view),n.nextTick(()=>{const Fe=document.querySelector(`[gs-id="${_e.view.id}"]`);_e.grid.makeWidget(Fe)}))}),Ua.on("add-page-and-view",_e=>{const ze=W.value.findIndex(Fe=>Fe.id===_e.pageId);if(ze>-1){const Fe=R(ze,!0);setTimeout(()=>{Ua.emit("add-view",{pageId:Fe.id,view:_e.view,filterAndWidgetContainer:_e.filterAndWidgetContainer}),c.value&&(Fe.stepBackPage=c.value),c.value=Fe},500)}else console.error("Page not found for adding view:",_e.pageId)}),Ua.on("empty-page",_e=>{f.value&&p.value&&p.value.id===_e.id||(be(_e),c.value&&c.value.id===_e.id&&(c.value.stepBackPage?c.value=c.value.stepBackPage:c.value=null))}),Ua.on("filters-cancelled",_e=>{_e&&_e.removeAllChildViews()}),Ua.on("activate-save-button",()=>{d.value=!0});function ie(_e){return{..._e,gameId:_e.game_id,id:_e.game_id,seasonId:_e.season_id,status:_e.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.home_team}.png`,team_id:_e.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.home_team}.png`,colloquial_name:_e.home_team_name,acronym:_e.home_team_acronym,team_name:_e.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.visiting_team}.png`,team_id:_e.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.visiting_team}.png`,colloquial_name:_e.visiting_team_name,acronym:_e.visiting_team_acronym,team_name:_e.visiting_team_name}}}function ue(_e,ze=!1){ze||!t.value?(r.value=!1,ne(),le("close")):d.value?b.value=!0:(r.value=!1,ne(),le("close"))}function he(){o.value=null,f.value=!1}function ae({page:_e,view:ze,applyMinimumSize:Fe=!1}){const Je=_e.grid;if(!_e||!ze||!Je)return null;const Ce=Fe?{w:ze.min_column,h:ze.min_row}:{w:ze.colspan,h:ze.rowspan},We=Je.willItFit(0,0,Ce.w,Ce.h,!0);return We?{willFit:We,applyMinimumSize:Fe}:Fe?null:ae({page:_e,view:ze,applyMinimumSize:!0})}const de=new Set([9]);function ce(_e){var ze,Fe,Je,Ce,We,Pe,ve,qe,ke,Ge,Re,Xe,Ze,et;if(_e.dynamicFilters&&_e.dynamicFilters.length>0&&_e.viewToEdit&&_e.viewToEdit.view){const me=_e.viewToEdit.view.id;W.value.forEach(Ue=>{Ue.items.forEach(Ee=>{Ee.id===me&&Ee.coreView&&Ee.coreView.id===3&&(Ee.componentProps.desplegable=_e.dynamicFilters[0]||!1,Ee.componentProps.key=_e.dynamicFilters[0]||!1,n.nextTick(()=>{Ua.emit("force-component-update",{itemId:Ee.id,componentProps:Ee.componentProps})}))})})}if(_e.viewToEdit){if(!_e.viewToEdit.view.filterAndViewsContainer){const me=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[_e.viewToEdit],((ze=_e.viewToEdit.view.coreView)==null?void 0:ze.id)||_e.viewToEdit.view.id,_e.dynamicFilters||[],w.value,t.value,_e.filtersJSON,$.token,_e.filters);_e.viewToEdit.view.filterAndViewsContainer=me}_e.viewToEdit.view.filterAndViewsContainer.updateView({view:_e.viewToEdit,dynamicFilters:_e.dynamicFilters||[],filtersJSON:_e.filtersJSON||null,filters:_e.filters}),d.value=!0}else if(_e.view){_e.view.id&&_e.filterAndViewsContainer&&_e.view.id!==_e.filterAndViewsContainer.viewId&&(_e.filterAndViewsContainer.removeAllChildViews(),_e.filterAndViewsContainer.setViewId(_e.view.id),_e.filterAndViewsContainer.setFiltersJSON(_e.filtersJSON||null)),_e.view.id&&de.has(_e.view.id)&&_e.dynamicFilters[0]&&_e.dynamicFilters[0].length===0&&_e.filterAndViewsContainer&&(_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(Je=(Fe=_e.viewToEdit)==null?void 0:Fe.view)==null?void 0:Je.id),d.value=!0);const me=c.value||p.value,Ue=ae({page:me,view:_e.view,applyMinimumSize:!1});_e.view.filtersJSON=_e.filtersJSON||null;const Ee=_e.filterAndViewsContainer,Ke=W.value.findIndex(nt=>nt.id===me.id);if(Ee){const nt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);if(((Ce=_e.view)==null?void 0:Ce.id)===15){const at=(We=_e.filterAndViewsContainer)==null?void 0:We.getId();if(at&&T.has(at)){const pt=T.get(at);clearTimeout(pt),T.delete(at)}}if(nt){if(Ee.setFilters(_e.filters),Ee.setDynamicFilters(_e.dynamicFilters),Ue||Ke===W.value.length-1){Ua.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:Ee,avoidWillFit:!1,applyMinimumSize:Ue?Ue.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(ve=(Pe=_e.viewToEdit)==null?void 0:Pe.view)==null?void 0:ve.id),d.value=!0;let at=null;if(((qe=_e.view)==null?void 0:qe.id)===15?(n.nextTick(()=>{var pt;const wt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters),_t=(pt=_e.dynamicFilters)==null?void 0:pt[0];if(console.log("onFiltersChanged nextTick - stillRequiresAddView:",wt,"childViews.length:",_e.filterAndViewsContainer.childViews.length,"currentFilterValue:",_t),_t!==3){console.log("onFiltersChanged nextTick - El filtro cambió, cancelando. Valor actual:",_t);return}wt&&(console.log("onFiltersChanged nextTick - llamando recursivamente para crear siguiente componente"),ce(_e))}),at=setTimeout(()=>{var pt,wt;const _t=(pt=_e.filterAndViewsContainer)==null?void 0:pt.getId();_t&&T.delete(_t);const Mt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters),It=(wt=_e.dynamicFilters)==null?void 0:wt[0];if(console.log("onFiltersChanged setTimeout (backup) - stillRequiresAddView:",Mt,"childViews.length:",_e.filterAndViewsContainer.childViews.length,"currentFilterValue:",It),It!==3){console.log("onFiltersChanged setTimeout (backup) - El filtro cambió, cancelando. Valor actual:",It);return}Mt&&(console.log("onFiltersChanged setTimeout (backup) - llamando recursivamente para crear siguiente componente"),ce(_e))},200)):at=setTimeout(()=>{const pt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters);console.log("onFiltersChanged setTimeout - stillRequiresAddView:",pt,"childViews.length:",_e.filterAndViewsContainer.childViews.length),pt?(console.log("onFiltersChanged - llamando recursivamente para crear siguiente componente"),ce(_e)):console.log("onFiltersChanged - no more views needed, stopping recursion")},1e3),((ke=_e.view)==null?void 0:ke.id)===15&&at){const pt=(Ge=_e.filterAndViewsContainer)==null?void 0:Ge.getId();pt&&T.set(pt,at)}}}else _e.isAltMode?_e.viewToEdit||_e.filterAndViewsContainer.updateFilters(_e.filters,(Xe=(Re=_e.viewToEdit)==null?void 0:Re.view)==null?void 0:Xe.id):_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(et=(Ze=_e.viewToEdit)==null?void 0:Ze.view)==null?void 0:et.id),d.value=!0}else if(Ue||Ke===W.value.length-1){const nt=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],_e.view.id,_e.dynamicFilters,w.value,t.value,_e.filtersJSON,$.token,_e.filters);Ua.emit("set-filter-and-views-container",nt),s.value.set(nt.getId(),nt),_e.dynamicFilters&&Array.isArray(_e.dynamicFilters[0])?(_e.filterAndViewsContainer=nt,ce(_e)):Ua.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:nt,avoidWillFit:!1,applyMinimumSize:Ue?Ue.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),d.value=!0}}}async function ye(){if(d.value)try{const _e=[{is_front_page:!0,template_type:g.value.isPostMatch?2:1,type:g.value.id},...W.value.map(Fe=>({columns:Fe.originalPage?Fe.originalPage.columns:12,rows:Fe.originalPage?Fe.originalPage.rows:12,gap:Fe.originalPage?Fe.originalPage.gap:10,name:Fe.title,width:Fe.originalPage?Fe.originalPage.width:968,height:Fe.originalPage?Fe.originalPage.height:702,components:Fe.items.map(Je=>({min_column:Je.minWidth,min_row:Je.minHeight,max_column:Je.maxWidth,max_row:Je.maxHeight,column:Je.x,row:Je.y,colspan:Je.w,rowspan:Je.h,name:Je.name,title:Je.title,titleShort:Je.titleShort||Je.title,dynamicFilters:Je.filterAndViewsContainer.getComponentDynamicFilters(Je.id)||Je.filterAndViewsContainer.getDynamicFilters()||[],coreView:Je.coreView||null,componentName:Je.componentName,componentProps:Je.componentProps||{},isHomeTeam:Je.isHomeTeam||Je.componentProps.isHomeTeamForAnalysis,filterMultiple:Je.filterMultiple}))}))],ze=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${h.value.user_id}/templates/${h.value.id}/pages`,{method:"PATCH",headers:{Authorization:$.token},body:JSON.stringify({pages:_e})});x.value=!0,await ze.json(),d.value=!1,setTimeout(()=>{x.value=!1},2e3)}catch(_e){console.error("Error saving template:",_e)}}function xe(){W.value.forEach(_e=>{_e.offListeners&&_e.offListeners()})}function be(_e){const ze=W.value.findIndex(Fe=>Fe.id===_e.id);ze>-1&&(xe(),W.value=W.value.filter(Fe=>Fe.id!==_e.id),m.value>=ze&&(m.value=Math.max(0,m.value-1)),d.value=!0)}function Te(){d.value=!0}function Ve(_e){const ze=W.value.find(Fe=>Fe.items.some(Je=>Je.id===_e.id));if(ze){const Fe=ze.items.findIndex(Je=>Je.id===_e.id);Fe!==-1&&(ze.items.splice(Fe,1),d.value=!0)}}function Oe(_e){}return(_e,ze)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(K6e,{modelValue:b.value,"onUpdate:modelValue":ze[0]||(ze[0]=Fe=>b.value=Fe),onAction:L},null,8,["modelValue"]),n.createVNode(X6e,{"model-value":x.value},null,8,["model-value"]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[r.value&&h.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"template-maker",style:n.normalizeStyle(N.value)},[n.withDirectives(n.createVNode(U6e,{token:e.token,view:o.value,"is-post-match":w.value,onClose:he,onFiltersChanged:ce},null,8,["token","view","is-post-match"]),[[n.vShow,t.value&&f.value]]),n.createElementVNode("div",D6e,[n.createTextVNode(n.toDisplayString(h.value?h.value.name:"Nuevo template")+" ",1),n.createElementVNode("div",{class:"template-maker__header__close",onClick:ue},[_.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("svg",J6e,[...ze[6]||(ze[6]=[n.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),n.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),n.createElementVNode("div",G6e,[ze[13]||(ze[13]=n.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),n.createElementVNode("div",B6e,[n.createElementVNode("div",Z6e,[n.createElementVNode("div",H6e,[n.withDirectives(n.createVNode(GN,{"is-post-match":w.value,"initial-cover-id":v.value,onSelectCover:q},null,8,["is-post-match","initial-cover-id"]),[[n.vShow,t.value]])]),(n.openBlock(),n.createElementBlock("div",{class:"template-maker__content__main__pages",key:W.value.length},[g.value?(n.openBlock(),n.createBlock(eSe,{key:0,id:"page-0",game:h.value.game||null,"cover-id":g.value.id,"is-post-match":g.value.isPostMatch,onIntersectionChanged:ze[1]||(ze[1]=Fe=>X(Fe,-1))},null,8,["game","cover-id","is-post-match"])):n.createCommentVNode("",!0),t.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"new-items-buttons",style:n.normalizeStyle({"margin-bottom":W.value.length===0?"30px":"0"})},[f.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:ze[2]||(ze[2]=Fe=>R(-1))},[...ze[7]||(ze[7]=[n.createElementVNode("div",null,"+ Nueva página",-1),n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W.value,(Fe,Je)=>(n.openBlock(),n.createElementBlock("div",{key:Je,id:`page-${Je+1}`,class:"template-maker__content__main__pages__page"},[n.createElementVNode("div",Q6e,[n.createElementVNode("div",$6e,"Pag "+n.toDisplayString(U(Je+2)),1)]),g.value?(n.openBlock(),n.createBlock(r_e,{key:0,page:Fe,"is-template-mode":t.value,"is-post-match":g.value.isPostMatch,game:h.value.game||null,lastGames:h.value.lastGames||[],"is-filter-visible":f.value,onEditView:D,onIntersectionChanged:Ce=>X(Ce,Je),onChangeSort:Oe,onDeletePage:be,onViewChanged:Te,onDeleteView:Ve},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):n.createCommentVNode("",!0),t.value&&!f.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"new-items-buttons",style:n.normalizeStyle({"margin-bottom":Je+1===W.value.length?"30px":"0","margin-top":"10px"})},[n.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Ce=>R(Je)},[...ze[8]||(ze[8]=[n.createElementVNode("div",null,"+ Nueva página",-1),n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,e4e),n.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Ce=>K(Fe)},[...ze[9]||(ze[9]=[n.createElementVNode("div",null,"+ Agregar gráfico",-1),n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,t4e)],4)):n.createCommentVNode("",!0)],8,Y6e))),128))]))]),_.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",r4e,[n.createElementVNode("div",n4e,[n.createElementVNode("div",a4e,[n.createElementVNode("div",null,"Páginas "+n.toDisplayString(V.value),1),n.createElementVNode("div",{class:n.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value<=0}]),onClick:ze[3]||(ze[3]=Fe=>m.value>0&&j(m.value-1))},[...ze[10]||(ze[10]=[n.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.22444 5L5.29079 8.57741C5.56974 8.90285 5.56974 9.43049 5.29079 9.75592C5.01184 10.0814 4.55958 10.0814 4.28064 9.75592L0.709209 5.58926C0.430263 5.26382 0.430263 4.73618 0.709209 4.41074L4.28064 0.244078C4.55958 -0.0813593 5.01184 -0.0813592 5.29079 0.244078C5.56974 0.569515 5.56974 1.09715 5.29079 1.42259L2.22444 5Z",fill:"#92929D"})],-1)])],2),n.createElementVNode("div",{class:n.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value>=W.value.length}]),onClick:ze[4]||(ze[4]=Fe=>m.value<W.value.length&&j(m.value+1))},[...ze[11]||(ze[11]=[n.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.77556 5L0.70921 8.57741C0.430264 8.90285 0.430264 9.43049 0.70921 9.75592C0.988156 10.0814 1.44042 10.0814 1.71936 9.75592L5.29079 5.58926C5.56974 5.26382 5.56974 4.73618 5.29079 4.41074L1.71936 0.244078C1.44042 -0.0813593 0.988155 -0.0813592 0.709209 0.244078C0.430264 0.569515 0.430264 1.09715 0.70921 1.42259L3.77556 5Z",fill:"#92929D"})],-1)])],2)]),n.createElementVNode("div",i4e,[n.createElementVNode("div",{role:"button",class:n.normalizeClass({active:m.value===0}),onClick:ze[5]||(ze[5]=Fe=>j(0))},n.toDisplayString(U(1)),3),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W.value,(Fe,Je)=>(n.openBlock(),n.createElementBlock("div",{role:"button",key:Je,class:n.normalizeClass({active:Je+1===m.value}),onClick:Ce=>j(Je+1)},n.toDisplayString(U(Je+2)),11,o4e))),128))])]),t.value?(n.openBlock(),n.createElementBlock("div",{key:0,role:"button",class:n.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!d.value}]),onClick:ye},[...ze[12]||(ze[12]=[n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M12.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V3.33333C2 2.97971 2.14048 2.64057 2.39052 2.39052C2.64057 2.14048 2.97971 2 3.33333 2H10.6667L14 5.33333V12.6667C14 13.0203 13.8595 13.3594 13.6095 13.6095C13.3594 13.8595 13.0203 14 12.6667 14Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),n.createElementVNode("div",null,"Guardar",-1)])],2)):n.createCommentVNode("",!0)]))])])],4)):n.createCommentVNode("",!0)]))],64))}},l4e=jd(s4e,[["__scopeId","data-v-2492d688"]]);function RL(e,a){return function(){return e.apply(a,arguments)}}const{toString:c4e}=Object.prototype,{getPrototypeOf:T5}=Object,{iterator:g2,toStringTag:ML}=Symbol,v2=(e=>a=>{const i=c4e.call(a);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ap=e=>(e=e.toLowerCase(),a=>v2(a)===e),b2=e=>a=>typeof a===e,{isArray:Y0}=Array,Q0=b2("undefined");function I1(e){return e!==null&&!Q0(e)&&e.constructor!==null&&!Q0(e.constructor)&&Ud(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const WL=Ap("ArrayBuffer");function u4e(e){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(e):a=e&&e.buffer&&WL(e.buffer),a}const d4e=b2("string"),Ud=b2("function"),jL=b2("number"),X1=e=>e!==null&&typeof e=="object",p4e=e=>e===!0||e===!1,x2=e=>{if(v2(e)!=="object")return!1;const a=T5(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(ML in e)&&!(g2 in e)},h4e=e=>{if(!X1(e)||I1(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},f4e=Ap("Date"),m4e=Ap("File"),y4e=Ap("Blob"),g4e=Ap("FileList"),v4e=e=>X1(e)&&Ud(e.pipe),b4e=e=>{let a;return e&&(typeof FormData=="function"&&e instanceof FormData||Ud(e.append)&&((a=v2(e))==="formdata"||a==="object"&&Ud(e.toString)&&e.toString()==="[object FormData]"))},x4e=Ap("URLSearchParams"),[w4e,_4e,S4e,T4e]=["ReadableStream","Request","Response","Headers"].map(Ap),k4e=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function D1(e,a,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let k,W;if(typeof e!="object"&&(e=[e]),Y0(e))for(k=0,W=e.length;k<W;k++)a.call(null,e[k],k,e);else{if(I1(e))return;const g=i?Object.getOwnPropertyNames(e):Object.keys(e),m=g.length;let r;for(k=0;k<m;k++)r=g[k],a.call(null,e[r],r,e)}}function KL(e,a){if(I1(e))return null;a=a.toLowerCase();const i=Object.keys(e);let k=i.length,W;for(;k-- >0;)if(W=i[k],a===W.toLowerCase())return W;return null}const zm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,AL=e=>!Q0(e)&&e!==zm;function k5(){const{caseless:e,skipUndefined:a}=AL(this)&&this||{},i={},k=(W,g)=>{const m=e&&KL(i,g)||g;x2(i[m])&&x2(W)?i[m]=k5(i[m],W):x2(W)?i[m]=k5({},W):Y0(W)?i[m]=W.slice():(!a||!Q0(W))&&(i[m]=W)};for(let W=0,g=arguments.length;W<g;W++)arguments[W]&&D1(arguments[W],k);return i}const L4e=(e,a,i,{allOwnKeys:k}={})=>(D1(a,(W,g)=>{i&&Ud(W)?e[g]=RL(W,i):e[g]=W},{allOwnKeys:k}),e),N4e=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),V4e=(e,a,i,k)=>{e.prototype=Object.create(a.prototype,k),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:a.prototype}),i&&Object.assign(e.prototype,i)},O4e=(e,a,i,k)=>{let W,g,m;const r={};if(a=a||{},e==null)return a;do{for(W=Object.getOwnPropertyNames(e),g=W.length;g-- >0;)m=W[g],(!k||k(m,e,a))&&!r[m]&&(a[m]=e[m],r[m]=!0);e=i!==!1&&T5(e)}while(e&&(!i||i(e,a))&&e!==Object.prototype);return a},q4e=(e,a,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=a.length;const k=e.indexOf(a,i);return k!==-1&&k===i},U4e=e=>{if(!e)return null;if(Y0(e))return e;let a=e.length;if(!jL(a))return null;const i=new Array(a);for(;a-- >0;)i[a]=e[a];return i},z4e=(e=>a=>e&&a instanceof e)(typeof Uint8Array<"u"&&T5(Uint8Array)),C4e=(e,a)=>{const k=(e&&e[g2]).call(e);let W;for(;(W=k.next())&&!W.done;){const g=W.value;a.call(e,g[0],g[1])}},P4e=(e,a)=>{let i;const k=[];for(;(i=e.exec(a))!==null;)k.push(i);return k},F4e=Ap("HTMLFormElement"),E4e=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,k,W){return k.toUpperCase()+W}),IL=(({hasOwnProperty:e})=>(a,i)=>e.call(a,i))(Object.prototype),R4e=Ap("RegExp"),XL=(e,a)=>{const i=Object.getOwnPropertyDescriptors(e),k={};D1(i,(W,g)=>{let m;(m=a(W,g,e))!==!1&&(k[g]=m||W)}),Object.defineProperties(e,k)},M4e=e=>{XL(e,(a,i)=>{if(Ud(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const k=e[i];if(Ud(k)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},W4e=(e,a)=>{const i={},k=W=>{W.forEach(g=>{i[g]=!0})};return Y0(e)?k(e):k(String(e).split(a)),i},j4e=()=>{},K4e=(e,a)=>e!=null&&Number.isFinite(e=+e)?e:a;function A4e(e){return!!(e&&Ud(e.append)&&e[ML]==="FormData"&&e[g2])}const I4e=e=>{const a=new Array(10),i=(k,W)=>{if(X1(k)){if(a.indexOf(k)>=0)return;if(I1(k))return k;if(!("toJSON"in k)){a[W]=k;const g=Y0(k)?[]:{};return D1(k,(m,r)=>{const h=i(m,W+1);!Q0(h)&&(g[r]=h)}),a[W]=void 0,g}}return k};return i(e,0)},X4e=Ap("AsyncFunction"),D4e=e=>e&&(X1(e)||Ud(e))&&Ud(e.then)&&Ud(e.catch),DL=((e,a)=>e?setImmediate:a?((i,k)=>(zm.addEventListener("message",({source:W,data:g})=>{W===zm&&g===i&&k.length&&k.shift()()},!1),W=>{k.push(W),zm.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Ud(zm.postMessage)),J4e=typeof queueMicrotask<"u"?queueMicrotask.bind(zm):typeof process<"u"&&process.nextTick||DL,Qn={isArray:Y0,isArrayBuffer:WL,isBuffer:I1,isFormData:b4e,isArrayBufferView:u4e,isString:d4e,isNumber:jL,isBoolean:p4e,isObject:X1,isPlainObject:x2,isEmptyObject:h4e,isReadableStream:w4e,isRequest:_4e,isResponse:S4e,isHeaders:T4e,isUndefined:Q0,isDate:f4e,isFile:m4e,isBlob:y4e,isRegExp:R4e,isFunction:Ud,isStream:v4e,isURLSearchParams:x4e,isTypedArray:z4e,isFileList:g4e,forEach:D1,merge:k5,extend:L4e,trim:k4e,stripBOM:N4e,inherits:V4e,toFlatObject:O4e,kindOf:v2,kindOfTest:Ap,endsWith:q4e,toArray:U4e,forEachEntry:C4e,matchAll:P4e,isHTMLForm:F4e,hasOwnProperty:IL,hasOwnProp:IL,reduceDescriptors:XL,freezeMethods:M4e,toObjectSet:W4e,toCamelCase:E4e,noop:j4e,toFiniteNumber:K4e,findKey:KL,global:zm,isContextDefined:AL,isSpecCompliantForm:A4e,toJSONObject:I4e,isAsyncFn:X4e,isThenable:D4e,setImmediate:DL,asap:J4e,isIterable:e=>e!=null&&Ud(e[g2])};function fo(e,a,i,k,W){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",a&&(this.code=a),i&&(this.config=i),k&&(this.request=k),W&&(this.response=W,this.status=W.status?W.status:null)}Qn.inherits(fo,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Qn.toJSONObject(this.config),code:this.code,status:this.status}}});const JL=fo.prototype,GL={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{GL[e]={value:e}}),Object.defineProperties(fo,GL),Object.defineProperty(JL,"isAxiosError",{value:!0}),fo.from=(e,a,i,k,W,g)=>{const m=Object.create(JL);Qn.toFlatObject(e,m,function(t){return t!==Error.prototype},l=>l!=="isAxiosError");const r=e&&e.message?e.message:"Error",h=a==null&&e?e.code:a;return fo.call(m,r,h,i,k,W),e&&m.cause==null&&Object.defineProperty(m,"cause",{value:e,configurable:!0}),m.name=e&&e.name||"Error",g&&Object.assign(m,g),m};const G4e=null;function L5(e){return Qn.isPlainObject(e)||Qn.isArray(e)}function BL(e){return Qn.endsWith(e,"[]")?e.slice(0,-2):e}function ZL(e,a,i){return e?e.concat(a).map(function(W,g){return W=BL(W),!i&&g?"["+W+"]":W}).join(i?".":""):a}function B4e(e){return Qn.isArray(e)&&!e.some(L5)}const Z4e=Qn.toFlatObject(Qn,{},null,function(a){return/^is[A-Z]/.test(a)});function w2(e,a,i){if(!Qn.isObject(e))throw new TypeError("target must be an object");a=a||new FormData,i=Qn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,s){return!Qn.isUndefined(s[o])});const k=i.metaTokens,W=i.visitor||t,g=i.dots,m=i.indexes,h=(i.Blob||typeof Blob<"u"&&Blob)&&Qn.isSpecCompliantForm(a);if(!Qn.isFunction(W))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(Qn.isDate(f))return f.toISOString();if(Qn.isBoolean(f))return f.toString();if(!h&&Qn.isBlob(f))throw new fo("Blob is not supported. Use a Buffer instead.");return Qn.isArrayBuffer(f)||Qn.isTypedArray(f)?h&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function t(f,o,s){let p=f;if(f&&!s&&typeof f=="object"){if(Qn.endsWith(o,"{}"))o=k?o:o.slice(0,-2),f=JSON.stringify(f);else if(Qn.isArray(f)&&B4e(f)||(Qn.isFileList(f)||Qn.endsWith(o,"[]"))&&(p=Qn.toArray(f)))return o=BL(o),p.forEach(function(d,b){!(Qn.isUndefined(d)||d===null)&&a.append(m===!0?ZL([o],b,g):m===null?o:o+"[]",l(d))}),!1}return L5(f)?!0:(a.append(ZL(s,o,g),l(f)),!1)}const _=[],w=Object.assign(Z4e,{defaultVisitor:t,convertValue:l,isVisitable:L5});function v(f,o){if(!Qn.isUndefined(f)){if(_.indexOf(f)!==-1)throw Error("Circular reference detected in "+o.join("."));_.push(f),Qn.forEach(f,function(p,c){(!(Qn.isUndefined(p)||p===null)&&W.call(a,p,Qn.isString(c)?c.trim():c,o,w))===!0&&v(p,o?o.concat(c):[c])}),_.pop()}}if(!Qn.isObject(e))throw new TypeError("data must be an object");return v(e),a}function HL(e){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(k){return a[k]})}function N5(e,a){this._pairs=[],e&&w2(e,this,a)}const YL=N5.prototype;YL.append=function(a,i){this._pairs.push([a,i])},YL.toString=function(a){const i=a?function(k){return a.call(this,k,HL)}:HL;return this._pairs.map(function(W){return i(W[0])+"="+i(W[1])},"").join("&")};function H4e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function QL(e,a,i){if(!a)return e;const k=i&&i.encode||H4e;Qn.isFunction(i)&&(i={serialize:i});const W=i&&i.serialize;let g;if(W?g=W(a,i):g=Qn.isURLSearchParams(a)?a.toString():new N5(a,i).toString(k),g){const m=e.indexOf("#");m!==-1&&(e=e.slice(0,m)),e+=(e.indexOf("?")===-1?"?":"&")+g}return e}class $L{constructor(){this.handlers=[]}use(a,i,k){return this.handlers.push({fulfilled:a,rejected:i,synchronous:k?k.synchronous:!1,runWhen:k?k.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){Qn.forEach(this.handlers,function(k){k!==null&&a(k)})}}const eN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Y4e={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:N5,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},V5=typeof window<"u"&&typeof document<"u",O5=typeof navigator=="object"&&navigator||void 0,Q4e=V5&&(!O5||["ReactNative","NativeScript","NS"].indexOf(O5.product)<0),$4e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",eke=V5&&window.location.href||"http://localhost",Gu={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:V5,hasStandardBrowserEnv:Q4e,hasStandardBrowserWebWorkerEnv:$4e,navigator:O5,origin:eke},Symbol.toStringTag,{value:"Module"})),...Y4e};function tke(e,a){return w2(e,new Gu.classes.URLSearchParams,{visitor:function(i,k,W,g){return Gu.isNode&&Qn.isBuffer(i)?(this.append(k,i.toString("base64")),!1):g.defaultVisitor.apply(this,arguments)},...a})}function rke(e){return Qn.matchAll(/\w+|\[(\w*)]/g,e).map(a=>a[0]==="[]"?"":a[1]||a[0])}function nke(e){const a={},i=Object.keys(e);let k;const W=i.length;let g;for(k=0;k<W;k++)g=i[k],a[g]=e[g];return a}function tN(e){function a(i,k,W,g){let m=i[g++];if(m==="__proto__")return!0;const r=Number.isFinite(+m),h=g>=i.length;return m=!m&&Qn.isArray(W)?W.length:m,h?(Qn.hasOwnProp(W,m)?W[m]=[W[m],k]:W[m]=k,!r):((!W[m]||!Qn.isObject(W[m]))&&(W[m]=[]),a(i,k,W[m],g)&&Qn.isArray(W[m])&&(W[m]=nke(W[m])),!r)}if(Qn.isFormData(e)&&Qn.isFunction(e.entries)){const i={};return Qn.forEachEntry(e,(k,W)=>{a(rke(k),W,i,0)}),i}return null}function ake(e,a,i){if(Qn.isString(e))try{return(a||JSON.parse)(e),Qn.trim(e)}catch(k){if(k.name!=="SyntaxError")throw k}return(i||JSON.stringify)(e)}const J1={transitional:eN,adapter:["xhr","http","fetch"],transformRequest:[function(a,i){const k=i.getContentType()||"",W=k.indexOf("application/json")>-1,g=Qn.isObject(a);if(g&&Qn.isHTMLForm(a)&&(a=new FormData(a)),Qn.isFormData(a))return W?JSON.stringify(tN(a)):a;if(Qn.isArrayBuffer(a)||Qn.isBuffer(a)||Qn.isStream(a)||Qn.isFile(a)||Qn.isBlob(a)||Qn.isReadableStream(a))return a;if(Qn.isArrayBufferView(a))return a.buffer;if(Qn.isURLSearchParams(a))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),a.toString();let r;if(g){if(k.indexOf("application/x-www-form-urlencoded")>-1)return tke(a,this.formSerializer).toString();if((r=Qn.isFileList(a))||k.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return w2(r?{"files[]":a}:a,h&&new h,this.formSerializer)}}return g||W?(i.setContentType("application/json",!1),ake(a)):a}],transformResponse:[function(a){const i=this.transitional||J1.transitional,k=i&&i.forcedJSONParsing,W=this.responseType==="json";if(Qn.isResponse(a)||Qn.isReadableStream(a))return a;if(a&&Qn.isString(a)&&(k&&!this.responseType||W)){const m=!(i&&i.silentJSONParsing)&&W;try{return JSON.parse(a,this.parseReviver)}catch(r){if(m)throw r.name==="SyntaxError"?fo.from(r,fo.ERR_BAD_RESPONSE,this,null,this.response):r}}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gu.classes.FormData,Blob:Gu.classes.Blob},validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qn.forEach(["delete","get","head","post","put","patch"],e=>{J1.headers[e]={}});const ike=Qn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oke=e=>{const a={};let i,k,W;return e&&e.split(`
|
|
4126
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),k}static addGrid(a,i={}){if(!a)return null;let k=a;if(k.gridstack){const W=k.gridstack;return i&&(W.opts={...W.opts,...i}),i.children!==void 0&&W.load(i.children),W}return(!a.classList.contains("grid-stack")||vi.addRemoveCB)&&(vi.addRemoveCB?k=vi.addRemoveCB(a,i,!0,!0):k=Yn.createDiv(["grid-stack",i.class],a)),vi.init(i,k)}static registerEngine(a){vi.engineClass=a}get placeholder(){if(!this._placeholder){this._placeholder=Yn.createDiv([this.opts.placeholderClass,Id.itemClass,this.opts.itemClass]);const a=Yn.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(a.textContent=this.opts.placeholderText)}return this._placeholder}constructor(a,i={}){var k;this.el=a,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},a.gridstack=this,this.opts=i=i||{},a.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);const W=Yn.toNumber(a.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);const g=i.columnOpts;if(g){const t=g.breakpoints;!g.columnWidth&&!(t!=null&&t.length)?delete i.columnOpts:(g.columnMax=g.columnMax||12,(t==null?void 0:t.length)>1&&t.sort((_,w)=>(w.w||0)-(_.w||0)))}const m={...Yn.cloneDeep(Id),column:Yn.toNumber(a.getAttribute("gs-column"))||Id.column,minRow:W||Yn.toNumber(a.getAttribute("gs-min-row"))||Id.minRow,maxRow:W||Yn.toNumber(a.getAttribute("gs-max-row"))||Id.maxRow,staticGrid:Yn.toBool(a.getAttribute("gs-static"))||Id.staticGrid,sizeToContent:Yn.toBool(a.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||Id.draggable.handle},removableOptions:{accept:i.itemClass||Id.removableOptions.accept,decline:Id.removableOptions.decline}};a.getAttribute("gs-animate")&&(m.animate=Yn.toBool(a.getAttribute("gs-animate"))),i=Yn.defaults(i,m),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=a.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");const r=this.el.closest("."+Id.itemClass),h=r==null?void 0:r.gridstackNode;if(h&&(h.subGrid=this,this.parentGridNode=h,this.el.classList.add("grid-stack-nested"),h.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==Id.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);const t=i.cellHeight;delete i.cellHeight,this.cellHeight(t)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=Kp),this._setStaticClass();const l=i.engineClass||vi.engineClass||Mh;if(this.engine=new l({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:t=>{t.forEach(_=>{const w=_.el;w&&(_._removeDOM?(w&&w.remove(),delete _._removeDOM):this._writePosAttr(w,_))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(t=>this._prepareElement(t)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const t=i.children;delete i.children,t.length&&this.load(t)}this.setAnimation(),i.subGridDynamic&&!Ei.pauseDrag&&(Ei.pauseDrag=!0),((k=i.draggable)==null?void 0:k.pause)!==void 0&&(Ei.pauseDrag=i.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(a=this.opts){this.el.classList.add("gs-"+a.column),typeof a.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/a.column}%`)}addWidget(a){if(!a)return;if(typeof a=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(a.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(a);let i,k=a;if(k.grid=this,k.el?i=k.el:vi.addRemoveCB?i=vi.addRemoveCB(this.el,a,!0,!1):i=this.createWidgetDivs(k),!i)return;if(k=i.gridstackNode,k&&i.parentElement===this.el&&this.engine.nodes.find(g=>g._id===k._id))return i;const W=this._readAttr(i);return Yn.defaults(a,W),this.engine.prepareNode(a),this.el.appendChild(i),this.makeWidget(i,a),i}createWidgetDivs(a){const i=Yn.createDiv(["grid-stack-item",this.opts.itemClass]),k=Yn.createDiv(["grid-stack-item-content"],i);return Yn.lazyLoad(a)?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([W])=>{var g,m;W.isIntersecting&&((g=a.visibleObservable)==null||g.disconnect(),delete a.visibleObservable,vi.renderCB(k,a),(m=a.grid)==null||m.prepareDragDrop(a.el))}),window.setTimeout(()=>{var W;return(W=a.visibleObservable)==null?void 0:W.observe(i)})):vi.renderCB(k,a),i}makeSubGrid(a,i,k,W=!0){var g,m,r;let h=a.gridstackNode;if(h||(h=this.makeWidget(a).gridstackNode),(g=h.subGrid)!=null&&g.el)return h.subGrid;let l,t=this;for(;t&&!l;)l=(m=t.opts)==null?void 0:m.subGridOpts,t=(r=t.parentGridNode)==null?void 0:r.grid;i=Yn.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...i||h.subGridOpts||{}}),h.subGridOpts=i;let _;i.column==="auto"&&(_=!0,i.column=Math.max(h.w||1,(k==null?void 0:k.w)||1),delete i.columnOpts);let w=h.el.querySelector(".grid-stack-item-content"),v,f;if(W&&(this._removeDD(h.el),f={...h,x:0,y:0},Yn.removeInternalForSave(f),delete f.subGridOpts,h.content&&(f.content=h.content,delete h.content),vi.addRemoveCB?v=vi.addRemoveCB(this.el,f,!0,!1):(v=Yn.createDiv(["grid-stack-item"]),v.appendChild(w),w=Yn.createDiv(["grid-stack-item-content"],h.el)),this.prepareDragDrop(h.el)),k){const s=_?i.column:h.w,p=h.h+k.h,c=h.el.style;c.transition="none",this.update(h.el,{w:s,h:p}),setTimeout(()=>c.transition=null)}const o=h.subGrid=vi.addGrid(w,i);return k!=null&&k._moving&&(o._isTemp=!0),_&&(o._autoColumn=!0),W&&o.makeWidget(v,f),k&&(k._moving?window.setTimeout(()=>Yn.simulateMouseEvent(k._event,"mouseenter",o.el),0):o.makeWidget(h.el,h)),this.resizeToContentCheck(!1,h),o}removeAsSubGrid(a){var i;const k=(i=this.parentGridNode)==null?void 0:i.grid;k&&(k.batchUpdate(),k.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(W=>{W.x+=this.parentGridNode.x,W.y+=this.parentGridNode.y,k.makeWidget(W.el,W)}),k.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,a&&window.setTimeout(()=>Yn.simulateMouseEvent(a._event,"mouseenter",k.el),0))}save(a=!0,i=!1,k=vi.saveCB,W){const g=this.engine.save(a,k,W);if(g.forEach(m=>{var r;if(a&&m.el&&!m.subGrid&&!k){const h=m.el.querySelector(".grid-stack-item-content");m.content=h==null?void 0:h.innerHTML,m.content||delete m.content}else if(!a&&!k&&delete m.content,(r=m.subGrid)!=null&&r.el){const h=m.w||m.subGrid.getColumn(),l=m.subGrid.save(a,i,k,h);m.subGridOpts=i?l:{children:l},delete m.subGrid}delete m.el}),i){const m=Yn.cloneDeep(this.opts);m.marginBottom===m.marginTop&&m.marginRight===m.marginLeft&&m.marginTop===m.marginRight&&(m.margin=m.marginTop,delete m.marginTop,delete m.marginRight,delete m.marginBottom,delete m.marginLeft),m.rtl===(this.el.style.direction==="rtl")&&(m.rtl="auto"),this._isAutoCellHeight&&(m.cellHeight="auto"),this._autoColumn&&(m.column="auto");const r=m._alwaysShowResizeHandle;return delete m._alwaysShowResizeHandle,r!==void 0?m.alwaysShowResizeHandle=r:delete m.alwaysShowResizeHandle,Yn.removeInternalAndSame(m,Id),m.children=g,m}return g}load(a,i=vi.addRemoveCB||!0){a=Yn.cloneDeep(a);const k=this.getColumn();a.forEach(t=>{t.w=t.w||t.minW||1,t.h=t.h||t.minH||1}),a=Yn.sort(a),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let W=0;a.forEach(t=>{W=Math.max(W,(t.x||0)+t.w)}),W>this.engine.defaultColumn&&(this.engine.defaultColumn=W),W>k&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=a,this.engine.columnChanged(W,k,this.responseLayout),a=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(a,W,!0));const g=vi.addRemoveCB;typeof i=="function"&&(vi.addRemoveCB=i);const m=[];this.batchUpdate();const r=!this.engine.nodes.length,h=r&&this.opts.animate;h&&this.setAnimation(!1),!r&&i&&[...this.engine.nodes].forEach(t=>{t.id&&(Yn.find(a,t.id)||(vi.addRemoveCB&&vi.addRemoveCB(this.el,t,!1,!1),m.push(t),this.removeWidget(t.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(t=>Yn.find(a,t.id)?(l.push(t),!1):!0),a.forEach(t=>{var _;const w=Yn.find(l,t.id);if(w){if(Yn.shouldSizeToContent(w)&&(t.h=w.h),this.engine.nodeBoundFix(t),(t.autoPosition||t.x===void 0||t.y===void 0)&&(t.w=t.w||w.w,t.h=t.h||w.h,this.engine.findEmptyPosition(t)),this.engine.nodes.push(w),Yn.samePos(w,t)&&this.engine.nodes.length>1&&(this.moveNode(w,{...t,forceCollide:!0}),Yn.copyPos(t,w)),this.update(w.el,t),(_=t.subGridOpts)!=null&&_.children){const v=w.el.querySelector(".grid-stack");v&&v.gridstack&&v.gridstack.load(t.subGridOpts.children)}}else i&&this.addWidget(t)}),delete this.engine._loading,this.engine.removedNodes=m,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,g?vi.addRemoveCB=g:delete vi.addRemoveCB,h&&this.setAnimation(!0,!0),this}batchUpdate(a=!0){return this.engine.batchUpdate(a),a||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(a=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!a||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const i=this.el.querySelector("."+this.opts.itemClass);if(i){const W=Yn.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/W)}const k=parseInt(this.el.getAttribute("gs-current-row"));return k?Math.round(this.el.getBoundingClientRect().height/k):this.opts.cellHeight}cellHeight(a){if(a!==void 0&&this._isAutoCellHeight!==(a==="auto")&&(this._isAutoCellHeight=a==="auto",this._updateResizeEvent()),(a==="initial"||a==="auto")&&(a=void 0),a===void 0){const k=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;a=this.cellWidth()+k}const i=Yn.parseHeight(a);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(a=!1){var i;return a&&(i=this.opts.columnOpts)!=null&&i.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var a,i;const k=this.opts.columnOpts;if(!k||!k.columnWidth&&!((a=k.breakpoints)!=null&&a.length))return!1;const W=this.getColumn();let g=W;const m=this._widthOrContainer(!0);if(k.columnWidth)g=Math.min(Math.round(m/k.columnWidth)||1,k.columnMax);else{g=k.columnMax;let r=0;for(;r<k.breakpoints.length&&m<=k.breakpoints[r].w;)g=k.breakpoints[r++].c||W}if(g!==W){const r=(i=k.breakpoints)==null?void 0:i.find(h=>h.c===g);return this.column(g,(r==null?void 0:r.layout)||k.layout),!0}return!1}compact(a="compact",i=!0){return this.engine.compact(a,i),this._triggerChangeEvent(),this}column(a,i="moveScale"){if(!a||a<1||this.opts.column===a)return this;const k=this.getColumn();return this.opts.column=a,this.engine?(this.engine.column=a,this.el.classList.remove("gs-"+k),this._updateColumnVar(),this.engine.columnChanged(k,a,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(a=>a.matches("."+this.opts.itemClass)&&!a.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(a=!0){var i;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),a?this.el.parentNode.removeChild(this.el):(this.removeAll(a),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(i=this._placeholder)==null||delete i.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(a){return this.opts.float!==a&&(this.opts.float=this.engine.float=a,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(a,i=!1){const k=this.el.getBoundingClientRect();let W;i?W={top:k.top+document.documentElement.scrollTop,left:k.left}:W={top:this.el.offsetTop,left:this.el.offsetLeft};const g=a.left-W.left,m=a.top-W.top,r=k.width/this.getColumn(),h=k.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(g/r),y:Math.floor(m/h)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(a,i,k,W){return this.engine.isAreaEmpty(a,i,k,W)}makeWidget(a,i){const k=vi.getElement(a);if(!k||k.gridstackNode)return k;k.parentElement||this.el.appendChild(k),this._prepareElement(k,!0,i);const W=k.gridstackNode;this._updateContainerHeight(),W.subGridOpts&&this.makeSubGrid(k,W.subGridOpts,void 0,!1);let g;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(g=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),g&&delete this._ignoreLayoutsNodeChange,k}on(a,i){return a.indexOf(" ")!==-1?(a.split(" ").forEach(k=>this.on(k,i)),this):(a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable"?(a==="enable"||a==="disable"?this._gsEventHandler[a]=k=>i(k):this._gsEventHandler[a]=k=>{k.detail&&i(k,k.detail)},this.el.addEventListener(a,this._gsEventHandler[a])):a==="drag"||a==="dragstart"||a==="dragstop"||a==="resizestart"||a==="resize"||a==="resizestop"||a==="dropped"||a==="resizecontent"?this._gsEventHandler[a]=i:console.error("GridStack.on("+a+") event not supported"),this)}off(a){return a.indexOf(" ")!==-1?(a.split(" ").forEach(i=>this.off(i)),this):((a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable")&&this._gsEventHandler[a]&&this.el.removeEventListener(a,this._gsEventHandler[a]),delete this._gsEventHandler[a],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(a=>this.off(a)),this}removeWidget(a,i=!0,k=!0){return a?(vi.getElements(a).forEach(W=>{if(W.parentElement&&W.parentElement!==this.el)return;let g=W.gridstackNode;g||(g=this.engine.nodes.find(m=>W===m.el)),g&&(i&&vi.addRemoveCB&&vi.addRemoveCB(this.el,g,!1,!1),delete W.gridstackNode,this._removeDD(W),this.engine.removeNode(g,i,k),i&&W.parentElement&&W.remove())}),k&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(a=!0,i=!0){return this.engine.nodes.forEach(k=>{a&&vi.addRemoveCB&&vi.addRemoveCB(this.el,k,!1,!1),delete k.el.gridstackNode,this.opts.staticGrid||this._removeDD(k.el)}),this.engine.removeAll(a,i),i&&this._triggerRemoveEvent(),this}setAnimation(a=this.opts.animate,i){return i?setTimeout(()=>{this.opts&&this.setAnimation(a)}):a?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=a,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(a,i=!0,k=!0){return!!this.opts.staticGrid===a?this:(a?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(W=>{this.prepareDragDrop(W.el),W.subGrid&&k&&W.subGrid.setStatic(a,i,k)}),i&&this._setStaticClass(),this)}updateOptions(a){var i;const k=this.opts;return a===k?this:(a.acceptWidgets!==void 0&&(k.acceptWidgets=a.acceptWidgets,this._setupAcceptWidget()),a.animate!==void 0&&this.setAnimation(a.animate),a.cellHeight&&this.cellHeight(a.cellHeight),a.class!==void 0&&a.class!==k.class&&(k.class&&this.el.classList.remove(k.class),a.class&&this.el.classList.add(a.class)),a.columnOpts?(this.opts.columnOpts=a.columnOpts,this.checkDynamicColumn()):a.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof a.column=="number"&&this.column(a.column),a.margin!==void 0&&this.margin(a.margin),a.staticGrid!==void 0&&this.setStatic(a.staticGrid),a.disableDrag!==void 0&&!a.staticGrid&&this.enableMove(!a.disableDrag),a.disableResize!==void 0&&!a.staticGrid&&this.enableResize(!a.disableResize),a.float!==void 0&&this.float(a.float),a.row!==void 0?(k.minRow=k.maxRow=k.row=a.row,this._updateContainerHeight()):(a.minRow!==void 0&&(k.minRow=a.minRow,this._updateContainerHeight()),a.maxRow!==void 0&&(k.maxRow=a.maxRow)),(i=a.children)!=null&&i.length&&this.load(a.children),this)}update(a,i){return vi.getElements(a).forEach(k=>{var W;const g=k==null?void 0:k.gridstackNode;if(!g)return;const m={...Yn.copyPos({},g),...Yn.cloneDeep(i)};this.engine.nodeBoundFix(m),delete m.autoPosition;const r=["x","y","w","h"];let h;if(r.some(_=>m[_]!==void 0&&m[_]!==g[_])&&(h={},r.forEach(_=>{h[_]=m[_]!==void 0?m[_]:g[_],delete m[_]})),!h&&(m.minW||m.minH||m.maxW||m.maxH)&&(h={}),m.content!==void 0){const _=k.querySelector(".grid-stack-item-content");_&&_.textContent!==m.content&&(g.content=m.content,vi.renderCB(_,m),(W=g.subGrid)!=null&&W.el&&(_.appendChild(g.subGrid.el),g.subGrid._updateContainerHeight())),delete m.content}let l=!1,t=!1;for(const _ in m)_[0]!=="_"&&g[_]!==m[_]&&(g[_]=m[_],l=!0,t=t||!this.opts.staticGrid&&(_==="noResize"||_==="noMove"||_==="locked"));if(Yn.sanitizeMinMax(g),h){const _=h.w!==void 0&&h.w!==g.w;this.moveNode(g,h),_&&g.subGrid?g.subGrid.onResize(this.hasAnimationCSS()?g.w:void 0):this.resizeToContentCheck(_,g),delete g._orig}(h||l)&&this._writeAttr(k,g),t&&this.prepareDragDrop(g.el),vi.updateCB&&vi.updateCB(g)}),this}moveNode(a,i){const k=a._updating;k||this.engine.cleanNodes().beginUpdate(a),this.engine.moveNode(a,i),this._updateContainerHeight(),k||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(a){var i,k;if(!a||(a.classList.remove("size-to-content-max"),!a.clientHeight))return;const W=a.gridstackNode;if(!W)return;const g=W.grid;if(!g||a.parentElement!==g.el)return;const m=g.getCellHeight(!0);if(!m)return;let r=W.h?W.h*m:a.clientHeight,h;if(W.resizeToContentParent&&(h=a.querySelector(W.resizeToContentParent)),h||(h=a.querySelector(vi.resizeToContentParent)),!h)return;const l=a.clientHeight-h.clientHeight,t=W.h?W.h*m-l:h.clientHeight;let _;if(W.subGrid){_=W.subGrid.getRow()*W.subGrid.getCellHeight(!0);const f=W.subGrid.el.getBoundingClientRect(),o=a.getBoundingClientRect();_+=f.top-o.top}else{if((k=(i=W.subGridOpts)==null?void 0:i.children)!=null&&k.length)return;{const f=h.firstElementChild;if(!f){console.error(`Error: GridStack.resizeToContent() widget id:${W.id} '${vi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}_=f.getBoundingClientRect().height||t}}if(t===_)return;r+=_-t;let w=Math.ceil(r/m);const v=Number.isInteger(W.sizeToContent)?W.sizeToContent:0;v&&w>v&&(w=v,a.classList.add("size-to-content-max")),W.minH&&w<W.minH?w=W.minH:W.maxH&&w>W.maxH&&(w=W.maxH),w!==W.h&&(g._ignoreLayoutsNodeChange=!0,g.moveNode(W,{h:w}),delete g._ignoreLayoutsNodeChange)}resizeToContentCBCheck(a){vi.resizeToContentCB?vi.resizeToContentCB(a):this.resizeToContent(a)}rotate(a,i){return vi.getElements(a).forEach(k=>{const W=k.gridstackNode;if(!Yn.canBeRotated(W))return;const g={w:W.h,h:W.w,minH:W.minW,minW:W.minH,maxH:W.maxW,maxW:W.maxH};if(i){const r=i.left>0?Math.floor(i.left/this.cellWidth()):0,h=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;g.x=W.x+r-(W.h-(h+1)),g.y=W.y+h-r}Object.keys(g).forEach(r=>{g[r]===void 0&&delete g[r]});const m=W._orig;this.update(k,g),W._orig=m}),this}margin(a){if(!(typeof a=="string"&&a.split(" ").length>1)){const i=Yn.parseHeight(a);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=a,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(a){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const i=arguments;let k=0,W={x:i[k++],y:i[k++],w:i[k++],h:i[k++],autoPosition:i[k++]};return this.willItFit(W)}return this.engine.willItFit(a)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const a=this.engine.getDirtyNodes(!0);return a&&a.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(a),this._triggerEvent("change",a)),this.engine.saveInitial(),this}_triggerAddEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.addedNodes)!=null&&a.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(k=>{delete k._dirty});const i=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",i)}return this}_triggerRemoveEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.removedNodes)!=null&&a.length){const i=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",i)}return this}_triggerEvent(a,i){const k=i?new CustomEvent(a,{bubbles:!1,detail:i}):new Event(a);let W=this;for(;W.parentGridNode;)W=W.parentGridNode.grid;return W.el.dispatchEvent(k),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const a=this.parentGridNode;let i=this.getRow()+this._extraDragRow;const k=this.opts.cellHeight,W=this.opts.cellHeightUnit;if(!k)return this;if(!a&&!this.opts.minRow){const g=Yn.parseHeight(getComputedStyle(this.el).minHeight);if(g.h>0&&g.unit===W){const m=Math.floor(g.h/k);i<m&&(i=m)}}return this.el.setAttribute("gs-current-row",String(i)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),i&&(this.el.style[a?"minHeight":"height"]=i*k+W),a&&Yn.shouldSizeToContent(a)&&a.grid.resizeToContentCBCheck(a.el),this}_prepareElement(a,i=!1,k){k=k||this._readAttr(a),a.gridstackNode=k,k.el=a,k.grid=this,k=this.engine.addNode(k,i),this._writeAttr(a,k),a.classList.add(Id.itemClass,this.opts.itemClass);const W=Yn.shouldSizeToContent(k);return W?a.classList.add("size-to-content"):a.classList.remove("size-to-content"),W&&this.resizeToContentCheck(!1,k),Yn.lazyLoad(k)||this.prepareDragDrop(k.el),this}_writePosAttr(a,i){return(!i._moving&&!i._resizing||this._placeholder===a)&&(a.style.top=i.y?i.y===1?"var(--gs-cell-height)":`calc(${i.y} * var(--gs-cell-height))`:null,a.style.left=i.x?i.x===1?"var(--gs-column-width)":`calc(${i.x} * var(--gs-column-width))`:null,a.style.width=i.w>1?`calc(${i.w} * var(--gs-column-width))`:null,a.style.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null),i.x>0?a.setAttribute("gs-x",String(i.x)):a.removeAttribute("gs-x"),i.y>0?a.setAttribute("gs-y",String(i.y)):a.removeAttribute("gs-y"),i.w>1?a.setAttribute("gs-w",String(i.w)):a.removeAttribute("gs-w"),i.h>1?a.setAttribute("gs-h",String(i.h)):a.removeAttribute("gs-h"),this}_writeAttr(a,i){if(!i)return this;this._writePosAttr(a,i);const k={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const W in k)i[W]?a.setAttribute(k[W],String(i[W])):a.removeAttribute(k[W]);return this}_readAttr(a,i=!0){const k={};k.x=Yn.toNumber(a.getAttribute("gs-x")),k.y=Yn.toNumber(a.getAttribute("gs-y")),k.w=Yn.toNumber(a.getAttribute("gs-w")),k.h=Yn.toNumber(a.getAttribute("gs-h")),k.autoPosition=Yn.toBool(a.getAttribute("gs-auto-position")),k.noResize=Yn.toBool(a.getAttribute("gs-no-resize")),k.noMove=Yn.toBool(a.getAttribute("gs-no-move")),k.locked=Yn.toBool(a.getAttribute("gs-locked"));const W=a.getAttribute("gs-size-to-content");W&&(W==="true"||W==="false"?k.sizeToContent=Yn.toBool(W):k.sizeToContent=parseInt(W,10)),k.id=a.getAttribute("gs-id"),k.maxW=Yn.toNumber(a.getAttribute("gs-max-w")),k.minW=Yn.toNumber(a.getAttribute("gs-min-w")),k.maxH=Yn.toNumber(a.getAttribute("gs-max-h")),k.minH=Yn.toNumber(a.getAttribute("gs-min-h")),i&&(k.w===1&&a.removeAttribute("gs-w"),k.h===1&&a.removeAttribute("gs-h"),k.maxW&&a.removeAttribute("gs-max-w"),k.minW&&a.removeAttribute("gs-min-w"),k.maxH&&a.removeAttribute("gs-max-h"),k.minH&&a.removeAttribute("gs-min-h"));for(const g in k){if(!k.hasOwnProperty(g))return;!k[g]&&k[g]!==0&&g!=="sizeToContent"&&delete k[g]}return k}_setStaticClass(){const a=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...a),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...a),this.el.removeAttribute("gs-static")),this}onResize(a=(i=>(i=this.el)==null?void 0:i.clientWidth)()){if(!a||this.prevWidth===a)return;this.prevWidth=a,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(k=>{k.subGrid&&k.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(a=!1,i=void 0){if(this.engine){if(a&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);if(i)Yn.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(k=>Yn.shouldSizeToContent(k))){const k=[...this.engine.nodes];this.batchUpdate(),k.forEach(W=>{Yn.shouldSizeToContent(W)&&this.resizeToContentCBCheck(W.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}}_updateResizeEvent(a=!1){const i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(k=>k.sizeToContent));return!a&&i&&!this.resizeObserver?(this._sizeThrottle=Yn.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(a||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(a=".grid-stack-item"){return Yn.getElement(a)}static getElements(a=".grid-stack-item"){return Yn.getElements(a)}static getGridElement(a){return vi.getElement(a)}static getGridElements(a){return Yn.getElements(a)}_initMargin(){let a,i=0,k=[];typeof this.opts.margin=="string"&&(k=this.opts.margin.split(" ")),k.length===2?(this.opts.marginTop=this.opts.marginBottom=k[0],this.opts.marginLeft=this.opts.marginRight=k[1]):k.length===4?(this.opts.marginTop=k[0],this.opts.marginRight=k[1],this.opts.marginBottom=k[2],this.opts.marginLeft=k[3]):(a=Yn.parseHeight(this.opts.margin),this.opts.marginUnit=a.unit,i=this.opts.margin=a.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(g=>{this.opts[g]===void 0?this.opts[g]=i:(a=Yn.parseHeight(this.opts[g]),this.opts[g]=a.h,delete this.opts.margin)}),this.opts.marginUnit=a.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const W=this.el.style;return W.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),W.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),W.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),W.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return nd}static setupDragIn(a,i,k,W=document){(i==null?void 0:i.pause)!==void 0&&(Ei.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof a=="string"?Yn.getElements(a,W):a).forEach((g,m)=>{nd.isDraggable(g)||nd.dragIn(g,i),k!=null&&k[m]&&(g.gridstackNode=k[m])})}movable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const W=k.gridstackNode;W&&(i?delete W.noMove:W.noMove=!0,this.prepareDragDrop(W.el))}),this)}resizable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const W=k.gridstackNode;W&&(i?delete W.noResize:W.noResize=!0,this.prepareDragDrop(W.el))}),this)}disable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!1,a),this.enableResize(!1,a),this._triggerEvent("disable"),this}enable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!0,a),this.enableResize(!0,a),this._triggerEvent("enable"),this}enableMove(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableMove(a,i)}),this)}enableResize(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableResize(a,i)}),this)}cancelDrag(){var a;const i=(a=this._placeholder)==null?void 0:a.gridstackNode;i&&(i._isExternal?(i._isAboutToRemove=!0,this.engine.removeNode(i)):i._isAboutToRemove&&vi._itemRemoving(i.el,!1),this.engine.restoreInitial())}_removeDD(a){return nd.draggable(a,"destroy").resizable(a,"destroy"),a.gridstackNode&&delete a.gridstackNode._initDD,delete a.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return nd.droppable(this.el,"destroy"),this;let a,i;const k=(W,g,m)=>{var r;m=m||g;const h=m.gridstackNode;if(!h)return;if(!((r=h.grid)!=null&&r.el)){m.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const v=m.getBoundingClientRect();m.style.left=v.x+(this.dragTransform.xScale-1)*(W.clientX-v.x)/this.dragTransform.xScale+"px",m.style.top=v.y+(this.dragTransform.yScale-1)*(W.clientY-v.y)/this.dragTransform.yScale+"px",m.style.transformOrigin="0px 0px"}let{top:l,left:t}=m.getBoundingClientRect();const _=this.el.getBoundingClientRect();t-=_.left,l-=_.top;const w={position:{top:l*this.dragTransform.xScale,left:t*this.dragTransform.yScale}};if(h._temporaryRemoved){if(h.x=Math.max(0,Math.round(t/i)),h.y=Math.max(0,Math.round(l/a)),delete h.autoPosition,this.engine.nodeBoundFix(h),!this.engine.willItFit(h)){if(h.autoPosition=!0,!this.engine.willItFit(h)){nd.off(g,"drag");return}h._willFitPos&&(Yn.copyPos(h,h._willFitPos),delete h._willFitPos)}this._onStartMoving(m,W,w,h,i,a)}else this._dragOrResize(m,W,w,h,i,a)};return nd.droppable(this.el,{accept:W=>{const g=W.gridstackNode||this._readAttr(W,!1);if((g==null?void 0:g.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let m=!0;if(typeof this.opts.acceptWidgets=="function")m=this.opts.acceptWidgets(W);else{const r=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;m=W.matches(r)}if(m&&g&&this.opts.maxRow){const r={w:g.w,h:g.h,minW:g.minW,minH:g.minH};m=this.engine.willItFit(r)}return m}}).on(this.el,"dropover",(W,g,m)=>{let r=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((r==null?void 0:r.grid)===this&&!r._temporaryRemoved)return!1;if(r!=null&&r._sidebarOrig&&(r.w=r._sidebarOrig.w,r.h=r._sidebarOrig.h),r!=null&&r.grid&&r.grid!==this&&!r._temporaryRemoved&&r.grid._leave(g,m),m=m||g,i=this.cellWidth(),a=this.getCellHeight(!0),!r){const t=m.getAttribute("data-gs-widget")||m.getAttribute("gridstacknode");if(t){try{r=JSON.parse(t)}catch{console.error("Gridstack dropover: Bad JSON format: ",t)}m.removeAttribute("data-gs-widget"),m.removeAttribute("gridstacknode")}r||(r=this._readAttr(m)),r._sidebarOrig={w:r.w,h:r.h}}r.grid||(r.el||(r={...r}),r._isExternal=!0,m.gridstackNode=r);const h=r.w||Math.round(m.offsetWidth/i)||1,l=r.h||Math.round(m.offsetHeight/a)||1;return r.grid&&r.grid!==this?(g._gridstackNodeOrig||(g._gridstackNodeOrig=r),g.gridstackNode=r={...r,w:h,h:l,grid:this},delete r.x,delete r.y,this.engine.cleanupNode(r).nodeBoundFix(r),r._initDD=r._isExternal=r._temporaryRemoved=!0):(r.w=h,r.h=l,r._temporaryRemoved=!0),vi._itemRemoving(r.el,!1),nd.on(g,"drag",k),k(W,g,m),!1}).on(this.el,"dropout",(W,g,m)=>{const r=(m==null?void 0:m.gridstackNode)||g.gridstackNode;return r&&(!r.grid||r.grid===this)&&(this._leave(g,m),this._isTemp&&this.removeAsSubGrid(r)),!1}).on(this.el,"drop",(W,g,m)=>{var r,h,l;const t=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((t==null?void 0:t.grid)===this&&!t._isExternal)return!1;const _=!!this.placeholder.parentElement,w=g!==m;this.placeholder.remove(),delete this.placeholder.gridstackNode,_&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const v=g._gridstackNodeOrig;if(delete g._gridstackNodeOrig,_&&v!=null&&v.grid&&v.grid!==this){const o=v.grid;o.engine.removeNodeFromLayoutCache(v),o.engine.removedNodes.push(v),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!t||(_&&(this.engine.cleanupNode(t),t.grid=this),(r=t.grid)==null||delete r._isTemp,nd.off(g,"drag"),m!==g?(m.remove(),g=m):g.remove(),this._removeDD(g),!_))return!1;const f=(l=(h=t.subGrid)==null?void 0:h.el)==null?void 0:l.gridstack;return Yn.copyPos(t,this._readAttr(this.placeholder)),Yn.removePositioningStyles(g),w&&(t.content||t.subGridOpts||vi.addRemoveCB)?(delete t.el,g=this.addWidget(t)):(this._prepareElement(g,!0,t),this.el.appendChild(g),this.resizeToContentCheck(!1,t),f&&(f.parentGridNode=t),this._updateContainerHeight()),this.engine.addedNodes.push(t),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...W,type:"dropped"},v&&v.grid?v:void 0,t),!1}),this}static _itemRemoving(a,i){if(!a)return;const k=a?a.gridstackNode:void 0;!(k!=null&&k.grid)||a.classList.contains(k.grid.opts.removableOptions.decline)||(i?k._isAboutToRemove=!0:delete k._isAboutToRemove,i?a.classList.add("grid-stack-item-removing"):a.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const a=document.querySelector(this.opts.removable);return a?(!this.opts.staticGrid&&!nd.isDroppable(a)&&nd.droppable(a,this.opts.removableOptions).on(a,"dropover",(i,k)=>vi._itemRemoving(k,!0)).on(a,"dropout",(i,k)=>vi._itemRemoving(k,!1)),this):this}prepareDragDrop(a,i=!1){const k=a==null?void 0:a.gridstackNode;if(!k)return;const W=k.noMove||this.opts.disableDrag,g=k.noResize||this.opts.disableResize,m=this.opts.staticGrid||W&&g;if((i||m)&&(k._initDD&&(this._removeDD(a),delete k._initDD),m&&a.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!i))return this;if(!k._initDD){let r,h;const l=(w,v)=>{this.triggerEvent(w,w.target),r=this.cellWidth(),h=this.getCellHeight(!0),this._onStartMoving(a,w,v,k,r,h)},t=(w,v)=>{this._dragOrResize(a,w,v,k,r,h)},_=w=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete k._moving,delete k._resizing,delete k._event,delete k._lastTried;const v=k.w!==k._orig.w,f=w.target;if(!(!f.gridstackNode||f.gridstackNode.grid!==this)){if(k.el=f,k._isAboutToRemove){const o=a.gridstackNode.grid;o._gsEventHandler[w.type]&&o._gsEventHandler[w.type](w,f),o.engine.nodes.push(k),o.removeWidget(a,!0,!0)}else Yn.removePositioningStyles(f),k._temporaryRemoved?(this._writePosAttr(f,k),this.engine.addNode(k)):this._writePosAttr(f,k),this.triggerEvent(w,f);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),w.type==="resizestop"&&(Number.isInteger(k.sizeToContent)&&(k.sizeToContent=k.h),this.resizeToContentCheck(v,k))}};nd.draggable(a,{start:l,stop:_,drag:t}).resizable(a,{start:l,stop:_,resize:t}),k._initDD=!0}return nd.draggable(a,W?"disable":"enable").resizable(a,g?"disable":"enable"),this}_onStartMoving(a,i,k,W,g,m){var r;if(this.engine.cleanNodes().beginUpdate(W),this._writePosAttr(this.placeholder,W),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=W,(r=W.grid)!=null&&r.el)this.dragTransform=Yn.getValuesFromTransformedElement(a);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const h=this.placeholder.closest(".grid-stack");this.dragTransform=Yn.getValuesFromTransformedElement(h)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(W.el=this.placeholder,W._lastUiPosition=k.position,W._prevYPix=k.position.top,W._moving=i.type==="dragstart",W._resizing=i.type==="resizestart",delete W._lastTried,i.type==="dropover"&&W._temporaryRemoved&&(this.engine.addNode(W),W._moving=!0),this.engine.cacheRects(g,m,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){const h=this.getColumn()-W.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-W.y;nd.resizable(a,"option","minWidth",g*Math.min(W.minW||1,h)).resizable(a,"option","minHeight",m*Math.min(W.minH||1,l)).resizable(a,"option","maxWidth",g*Math.min(W.maxW||Number.MAX_SAFE_INTEGER,h)).resizable(a,"option","maxWidthMoveLeft",g*Math.min(W.maxW||Number.MAX_SAFE_INTEGER,W.x+W.w)).resizable(a,"option","maxHeight",m*Math.min(W.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(a,"option","maxHeightMoveUp",m*Math.min(W.maxH||Number.MAX_SAFE_INTEGER,W.y+W.h))}}_dragOrResize(a,i,k,W,g,m){const r={...W._orig};let h,l=this.opts.marginLeft,t=this.opts.marginRight,_=this.opts.marginTop,w=this.opts.marginBottom;const v=Math.round(m*.1),f=Math.round(g*.1);if(l=Math.min(l,f),t=Math.min(t,f),_=Math.min(_,v),w=Math.min(w,v),i.type==="drag"){if(W._temporaryRemoved)return;const s=k.position.top-W._prevYPix;W._prevYPix=k.position.top,this.opts.draggable.scroll!==!1&&Yn.updateScrollPosition(a,k.position,s);const p=k.position.left+(k.position.left>W._lastUiPosition.left?-t:l),c=k.position.top+(k.position.top>W._lastUiPosition.top?-w:_);r.x=Math.round(p/g),r.y=Math.round(c/m);const d=this._extraDragRow;if(this.engine.collide(W,r)){const b=this.getRow();let x=Math.max(0,r.y+W.h-b);this.opts.maxRow&&b+x>this.opts.maxRow&&(x=Math.max(0,this.opts.maxRow-b)),this._extraDragRow=x}else this._extraDragRow=0;if(this._extraDragRow!==d&&this._updateContainerHeight(),W.x===r.x&&W.y===r.y)return}else if(i.type==="resize"){if(r.x<0||(Yn.updateScrollResize(i,a,m),r.w=Math.round((k.size.width-l)/g),r.h=Math.round((k.size.height-_)/m),W.w===r.w&&W.h===r.h)||W._lastTried&&W._lastTried.w===r.w&&W._lastTried.h===r.h)return;const s=k.position.left+l,p=k.position.top+_;r.x=Math.round(s/g),r.y=Math.round(p/m),h=!0}W._event=i,W._lastTried=r;const o={x:k.position.left+l,y:k.position.top+_,w:(k.size?k.size.width:W.w*g)-l-t,h:(k.size?k.size.height:W.h*m)-_-w};if(this.engine.moveNodeCheck(W,{...r,cellWidth:g,cellHeight:m,rect:o,resizing:h})){W._lastUiPosition=k.position,this.engine.cacheRects(g,m,_,t,w,l),delete W._skipDown,h&&W.subGrid&&W.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const s=i.target;W._sidebarOrig||this._writePosAttr(s,W),this.triggerEvent(i,s)}}triggerEvent(a,i){let k=this;for(;k.parentGridNode;)k=k.parentGridNode.grid;k._gsEventHandler[a.type]&&k._gsEventHandler[a.type](a,i)}_leave(a,i){i=i||a;const k=i.gridstackNode;if(!k||(i.style.transform=i.style.transformOrigin=null,nd.off(a,"drag"),k._temporaryRemoved))return;k._temporaryRemoved=!0,this.engine.removeNode(k),k.el=k._isExternal&&i?i:a;const W=k._sidebarOrig;k._isExternal&&this.engine.cleanupNode(k),k._sidebarOrig=W,this.opts.removable===!0&&vi._itemRemoving(a,!0),a._gridstackNodeOrig?(a.gridstackNode=a._gridstackNodeOrig,delete a._gridstackNodeOrig):k._isExternal&&this.engine.restoreInitial()}commit(){return P5e(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}vi.renderCB=(e,a)=>{e&&a!=null&&a.content&&(e.textContent=a.content)},vi.resizeToContentParent=".grid-stack-item-content",vi.Utils=Yn,vi.Engine=Mh,vi.GDRev="12.3.2";const M5e=[{id:1,name:"Goles",isSelected:!1},{id:2,name:"Pases acertados",isSelected:!1},{id:23,name:"Tiros de Esquina",isSelected:!1},{id:3,name:"Balones recuperados en disputa",isSelected:!1},{id:4,name:"Asistencias",isSelected:!1},{id:5,name:"Participaciones en gol",isSelected:!1},{id:6,name:"Tiros a gol",isSelected:!1},{id:7,name:"Tiros a gol que llegaron a la portería",isSelected:!1},{id:8,name:"Cabeceos en área rival",isSelected:!1},{id:9,name:"Cabeceos en área propia",isSelected:!1},{id:10,name:"Centros",isSelected:!1},{id:11,name:"Centros acertados",isSelected:!1},{id:12,name:"1vs1 exitosos ofensivos",isSelected:!1},{id:13,name:"1vs1 exitosos ofensivos que terminaron en gol",isSelected:!1},{id:14,name:"1vs1 defensivos exitoso",isSelected:!1},{id:15,name:"Rechaces",isSelected:!1},{id:16,name:"Balones ganados en área propia",isSelected:!1},{id:17,name:"Balones ganados en área rival",isSelected:!1},{id:18,name:"Faltas cometidas",isSelected:!1},{id:19,name:"Faltas recibidas",isSelected:!1},{id:20,name:"Tarjetas amarillas",isSelected:!1},{id:21,name:"Tarjetas rojas",isSelected:!1},{id:22,name:"Atajadas",isSelected:!1},{id:24,name:"Oportunidades de gol",isSelected:!1},{id:25,name:"Balones recuperados en cancha rival",isSelected:!1}],Wh=e=>M5e.find(a=>a.id===e),jh=new Map([[9,{id:9,analysisTypes:new Map([["2-20",{analysisType:"successfulPasses",name:"Pases acertados",title:"Mapeo de pases acertados",titleShort:"Pases acertados"}],["3-21",{analysisType:"unsuccessfulPasses",name:"Pases no acertados",title:"Mapeo de pases no acertados",titleShort:"Pases no acertados"}],["222-223-224-225",{analysisType:"recoveredBalls",name:"Balones recuperados",title:"Mapeo de balones recuperados",titleShort:"Balones recuperados"}],["226-227-228-229",{analysisType:"lostBalls",name:"Balones perdidos",title:"Mapeo de balones perdidos",titleShort:"Balones perdidos"}]])}],[1,{general:"General",offensive:"Ofensivo",defensive:"Defensivo",possession:"Posesión",stoppedBall:"Balón parado",penalties:"Infracción"}]]);class H0{constructor(a,i=[],k,W=null,g=!1,m=!1,r=null,h=null,l=null){Tp(this,"id",""),Tp(this,"childViews",[]),Tp(this,"viewId",0),Tp(this,"dynamicFilters",null),Tp(this,"componentSpecificFilters",new Map),Tp(this,"isPostMatch",!1),Tp(this,"isTemplateMode",!1),Tp(this,"filtresJSON",null),Tp(this,"token",null),Tp(this,"_isUpdating",!1),Tp(this,"filters",null),this.id=a,this.viewId=k,this.childViews=i,this.dynamicFilters=W,this.isPostMatch=g,this.isTemplateMode=m,this.filtresJSON=r,this.token=h,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(a=>{a.view.filterAndViewsContainer=new H0(this.id,[a],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.event_type_id===i)}hasCategoryId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.category_id===i)}getId(){return this.id}setViewId(a){this.viewId=a}setFiltersJSON(a){this.filtresJSON=a}setDynamicFilters(a,i=null){i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a}setFilters(a){this.filters=a}getComponentDynamicFilters(a){return a&&this.componentSpecificFilters.has(a)?this.componentSpecificFilters.get(a):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(a=>a.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(a=>!a.view.isHomeTeam)}addLastTouch(a){if(a.view.componentProps&&this.filters){let i=null;const k=this.filters.selectedCategories.map(g=>g.value),W=this.filters.selectedTeam.value;if(W===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=!0,h.view.isHomeTeam=!0,h.view.filterMultiple&&(h.view.filterMultiple.isHomeTeam=!0)});const g=this.getHomeTeamViews(),m=this.getAwayTeamViews();let r=!0;for(let h=0;h<k.length;h++){i=k[h];const l=g.find(_=>_.view.componentProps.categories[0].name===i.name),t=m.find(_=>_.view.componentProps.categories[0].name===i.name);if(!l||!t){r=!l;break}}r?this.childViews.length===0?(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((h,l,t,_)=>{let w={categories:l.view.componentProps.categories,analysisType:l.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:l.view.title,isHomeTeamForAnalysis:l.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:l.view.isHomeTeam};return h&&(h.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[i],l.view.componentProps.analysisType=this.filters.selectedGamePhase.name,l.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,l.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,l.view.componentProps.isHomeTeamForAnalysis=!0,l.view.title=i.name,a.view.titleShort=i.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!h.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=h.categories,l.view.componentProps.analysisType=h.analysisType,l.view.componentProps.isHomeTeamForAnalysis=h.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=h.isAssistZoneVisible,l.view.componentProps.howManyGames=h.howManyGames,l.view.title=h.title,l.view.titleShort=h.titleShort,l.view.isHomeTeam=h.isHomeTeam,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:l.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),t===_.length-1&&(a.view.componentProps.categories=w.categories,a.view.componentProps.analysisType=w.analysisType,a.view.componentProps.isHomeTeamForAnalysis=w.isHomeTeamForAnalysis,a.view.componentProps.isAssistZoneVisible=w.isAssistZoneVisible,a.view.componentProps.howManyGames=w.howManyGames,a.view.title=w.title,a.view.titleShort=w.titleShort,a.view.isHomeTeam=w.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:a.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),w},null):(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const g=W===1,m=g?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=g,a.view.isHomeTeam=g;for(let r=0;r<k.length;r++){const h=k[r];if(!m.find(l=>l.view.componentProps.categories[0].name===h.name)){a.view.componentProps.categories=[h],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=h.name,a.view.titleShort=h.name,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:h,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}console.log("after addLastTouch view.view.filterMultiple",a)}addView(a,i=!1){var k,W,g,m,r,h,l,t,_,w;if(a.view.filterAndViewsContainer=this,Ua.emit("component-added-to-container",this),this.viewId===5&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===10&&a.view.componentProps&&!i&&(a.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,a.isHomeTeam=a.view.componentProps.isHomeTeamForAnalysis,a.view.filterMultiple={isHomeTeam:a.view.componentProps.isHomeTeamForAnalysis},a.view.filtersJSON=this.filtresJSON),this.viewId===7&&a.view.componentProps&&!i){const v=this.getComponentDynamicFilters(a.view.id),f=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=f[0]===1?"offensive":"defensive",s=f[1]===1;a.view.componentProps.analysisType=o,a.view.componentProps.isHomeTeamForAnalysis=s,a.isHomeTeam=s,a.view.filterMultiple={isHomeTeam:s},Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:f})}if(this.viewId===1&&a.view.componentProps&&!i){const v=this.dynamicFilters[0]||[];if(v&&v.length>0){let f;if(Array.isArray(v)){const s=this.childViews.map(c=>{var d;return(d=c.view.componentProps)==null?void 0:d.type}).filter(c=>c!==void 0),p=v.filter(c=>!s.includes(c));p.length>0?f=p[0]:f=v[0]}else f=v;const o=jh.get(this.viewId);a.view.componentProps.type=f,a.view.componentProps.default=!1,a.view.title=`Comparativa ${o[f]}`,a.view.filterMultiple={category:f}}}if(this.viewId===9&&a.view.componentProps&&!i){const v=this.dynamicFilters[0].map(p=>p.join("-"));let f="";const o=this.dynamicFilters[1],s=jh.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(x=>{x.view.componentProps.isHomeTeamForAnalysis=!0,x.view.isHomeTeam=!0,x.view.filterMultiple&&(x.view.filterMultiple.isHomeTeam=!0)});let p=null;const c=this.getHomeTeamViews(),d=this.getAwayTeamViews();let b=!0;for(let x=0;x<v.length;x++){f=v[x],p=s.analysisTypes.get(v[x]);const T=c.find(V=>V.view.componentProps.analysisType===p.analysisType),N=d.find(V=>V.view.componentProps.analysisType===p.analysisType);if(!T||!N){b=!T;break}}b?this.childViews.length===0?(a.view.componentProps.analysisType=p.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.title=p.title,a.view.titleShort=p.titleShort,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:f.split("-").map(x=>parseInt(x))}):this.childViews.reduce((x,T,N,V)=>{let U={analysisType:T.view.componentProps.analysisType,title:T.view.title,isHomeTeamForAnalysis:T.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:T.view.isHomeTeam};return x&&(x.isHomeTeam&&!T.view.isHomeTeam?(T.view.componentProps.analysisType=p.analysisType,T.view.componentProps.isHomeTeamForAnalysis=!0,T.view.title=p.title,a.view.titleShort=p.titleShort,T.view.isHomeTeam=!0,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:f.split("-").map(z=>parseInt(z))}):!x.isHomeTeam&&!T.view.isHomeTeam&&(T.view.componentProps.analysisType=x.analysisType,T.view.componentProps.isHomeTeamForAnalysis=x.isHomeTeamForAnalysis,T.view.title=x.title,T.view.titleShort=x.titleShort,T.view.isHomeTeam=x.isHomeTeam,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:f.split("-").map(z=>parseInt(z))}),N===V.length-1&&(a.view.componentProps.analysisType=U.analysisType,a.view.componentProps.isHomeTeamForAnalysis=U.isHomeTeamForAnalysis,a.view.title=U.title,a.view.titleShort=U.titleShort,a.view.isHomeTeam=U.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:f.split("-").map(z=>parseInt(z))})),U},null):(a.view.componentProps.analysisType=p.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.title=p.title,a.view.titleShort=p.titleShort,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:f.split("-").map(x=>parseInt(x))})}else{const p=o===1,c=p?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=p,a.view.isHomeTeam=p;for(let d=0;d<v.length;d++){const b=s.analysisTypes.get(v[d]);if(!c.find(x=>x.view.componentProps.analysisType===b.analysisType)){a.view.componentProps.analysisType=b.analysisType,a.view.title=b.title,a.view.titleShort=b.titleShort,a.view.filterMultiple={categoryIds:v[d].split("-").map(x=>parseInt(x)),isHomeTeam:a.view.isHomeTeam};break}}}}if(this.viewId===2&&!i&&a.view.componentProps){const v=this.getComponentDynamicFilters(a.view.id),f=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id),a.view.componentProps.game&&(a.view.componentProps.gameid=a.view.componentProps.game.id,a.view.componentProps.season=a.view.componentProps.game.season_id,a.view.componentProps.teamView=f[1]===2?a.view.componentProps.game.awayTeam.team_id:f[1]===1?a.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let s=null;if(Array.isArray(o)){if(o.length>0){const d=this.childViews.map(x=>{var T;const N=(T=x.view.componentProps)==null?void 0:T.categoryView;return N&&N.length>0?N[0].id:null}).filter(x=>x!==null),b=o.filter(x=>!d.includes(x));b.length>0&&(s=b[0])}}else{const d=o;d&&(this.childViews.find(b=>{var x;const T=(x=b.view.componentProps)==null?void 0:x.categoryView;return T&&T.length>0&&T[0].id===d})||(s=d))}let p=null;if(s)try{p=Wh(s)}catch{}const c=f&&f.length>1?f[1]:1;a.view.filterMultiple={categoryId:s,teamType:c},a.view.componentProps.categoryView=p?[{id:s,name:p.name}]:s?[{id:s,name:`Category ${s}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&a.view.componentProps&&!i&&a.view.game&&(a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,a.view.componentProps.game=(k=a.view)==null?void 0:k.game,a.view.componentProps.teamSelected={teamId:(g=(W=a.view)==null?void 0:W.game)==null?void 0:g.home_team},a.view.componentProps.isDefault=!1,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.seasonid=2010,a.view.teamids=[1,2],a.view.componentProps.categoryids=[20,2],a.view.componentProps.teamsshow=[1,2],a.view.componentProps.analysistype=1,a.view.componentProps.gameid="",a.view.componentProps.teams=[],a.view.componentProps.game=""),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.view=1,a.view.numitems=3,a.view.componentProps.token=this.token,a.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===14&&a.view.componentProps&&!i&&(a.view.componentProps.isReports=!0,a.view.componentProps.isDefault=!0,a.view.componentProps.type=0,a.view.componentProps.typeView=1,a.view.componentProps.showVideos=!1,a.view.componentProps.currentSeason=2010,a.view.componentProps.localTeam=2,a.view.componentProps.awayTeam=1),this.viewId===6&&a.view.componentProps&&!i){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(a.view.id),f=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=f&&f.length>0?f[0]:[];if(o&&o.length>0){let s=0;for(const p of o)if(!this.childViews.find(c=>c.view.componentProps.gameNumber===p)){s=p;break}s&&(a.view.componentProps.gameNumber=s,a.view.filterMultiple={gameNumber:s})}Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:f})}if(this.viewId===3&&a.view.componentProps&&!i&&a.view.game){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(a.view.id),f=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=f&&f.length>0?f[0]:!1;a.view.componentProps.desplegable=o,a.view.componentProps.key=o,a.view.componentProps.game=(m=a.view)==null?void 0:m.game,a.view.componentProps.defaultShields=!1,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:f})}if(this.viewId===4&&a.view.componentProps&&!i&&a.view.game){if(a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),this.isPostMatch){a.view.componentProps.key=!1,a.view.componentProps.isDefault=!1,a.view.componentProps.token=this.token,a.view.componentProps.gameId=(h=(r=a.view)==null?void 0:r.game)==null?void 0:h.game_id,a.view.componentProps.homeTeam=(t=(l=a.view)==null?void 0:l.game)==null?void 0:t.home_team,a.view.componentProps.awayTeam=(w=(_=a.view)==null?void 0:_.game)==null?void 0:w.visiting_team;const o=this.getComponentDynamicFilters(a.view.id),s=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const p=s&&s.length>0?s[0]:[],c=this.hasEventTypeId(p,1),d=this.hasCategoryId(p,8),b=this.hasCategoryId(p,9),x=this.hasEventTypeId(p,3);a.view.componentProps.goals=c,a.view.componentProps.yellowCards=d,a.view.componentProps.redCards=b,a.view.componentProps.substitutions=x}const v=this.getComponentDynamicFilters(a.view.id)||this.dynamicFilters,f=v&&v.length>0?v[0]:[];a.view.componentProps.selectedEvents=f,a.view.componentProps.key=f.length>0,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:v})}this.viewId===16&&this.addLastTouch(a),this.childViews.push(a),console.log("FilterAndViewsContainer addView child views:",this.childViews),Ua.emit("view-added")}getHowManyViewsToAdd(a,i=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const k=a[0];return k===2||k===3?k:1}if(this.viewId===4)return a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0?1:0;if(this.viewId===9){const k=a[0],W=a[1];if(W===1||W===2){const g=W===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&i){const k=i.selectedCategories||[],W=i.selectedTeam.value;if(W===1||W===2){const g=W===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const k=a[0]||[],W=a[1]||1;if(!k||k.length===0)return 0;if(Array.isArray(k)){const g=this.childViews.map(m=>{var r;const h=(r=m.view.componentProps)==null?void 0:r.categoryView;return h&&h.length>0?h[0].id:null}).filter(m=>m!==null);return k.filter(m=>!g.includes(m)).length}else{const g=k;return this.childViews.find(m=>{var r,h;const l=(r=m.view.componentProps)==null?void 0:r.categoryView,t=((h=m.view.filterMultiple)==null?void 0:h.teamType)||1;return l&&l.length>0&&l[0].id===g&&t===W})?0:1}}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return 0;if(Array.isArray(k)){const W=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!W.includes(g)).length}else{const W=k;return this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===W})?0:1}}return 0}getRequiresAddView(a,i){if(this.viewId===5)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===10)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return a[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const k=a[0];return k?k.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;return this.childViews.length===0&&k}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(a);if(this.viewId===16&&i){const k=[i.selectedCategories,i.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(k,i.totalCategoriesSelected)}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return!1;if(Array.isArray(k)){const W=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!W.includes(g)).length>0}else{const W=k;return!this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===W})}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){if(k.length>0){const W=this.childViews.map(g=>{var m;const r=(m=g.view.componentProps)==null?void 0:m.categoryView;return r&&r.length>0?r[0].id:null}).filter(g=>g!==null);return k.filter(g=>!W.includes(g)).length>0}return!1}else{const W=k,g=a[1]||1;return W?!this.childViews.find(m=>{var r,h;const l=(r=m.view.componentProps)==null?void 0:r.categoryView,t=((h=m.view.filterMultiple)==null?void 0:h.teamType)||1;return l&&l.length>0&&l[0].id===W&&t===g}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(a,i=null){const k=this.childViews.filter(l=>l.view.isHomeTeam),W=this.childViews.filter(l=>!l.view.isHomeTeam),g=i||a[0].length,m=a[1],r=g*(m===1||m===2?1:2),h=m===3?k.length+W.length:k.length||W.length;return r>h}getRequiresLessViews(a){if(this.viewId===5)return a[0]!==3&&this.childViews.length>1;if(this.viewId===15)return a[0]!==3&&this.childViews.length>1;if(this.viewId===6){const i=a[0];return i===2||i===3}return this.viewId,!1}updateSummary({dynamicFilters:a}){const i=this.childViews[0],k=document.querySelector(`[gs-id="${i.view.id}"]`),W=i.grid;if(i&&k&&W){const g=a[0],m=`min_column${g?"_2":""}`,r=`min_row${g?"_2":""}`,h=`max_column${g?"_2":""}`,l=`max_row${g?"_2":""}`,t=`colspan${g?"_2":""}`,_=`rowspan${g?"_2":""}`,w=i.view.coreView[t],v=i.view.coreView[_],f=i.view.coreView[m],o=i.view.coreView[r],s=i.view.coreView[h],p=i.view.coreView[l];i.view.w=w,i.view.h=v,i.view.maxWidth=s,i.view.maxHeight=p,i.view.minWidth=f,i.view.minHeight=o,k.setAttribute("gs-w",w),k.setAttribute("gs-h",v),k.setAttribute("gs-max-w",s),k.setAttribute("gs-max-h",p),k.setAttribute("gs-min-w",f),k.setAttribute("gs-min-h",o),W.update(k,{h:v,w,"gs-max-h":p,"gs-max-w":s,"gs-min-h":o,"gs-min-w":f})}}updateFilters(a){this.filters=a,this.viewId===16&&this.updateLastTouchFilters(a)}updateDynamicFilters(a,i=null){if(!this._isUpdating){this._isUpdating=!0,i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a,Ua.emit("component-added-to-container",this);try{if(this.viewId===5){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const W=this.childViews[0];W.view.componentProps&&(W.view.componentProps.preMatchType=k,W.view.filterMultiple={isHomeTeam:W.view.componentProps.preMatchType===1})}else{const W=this.childViews.pop(),g=W.grid,m=W.page,r=document.querySelector(`[gs-id="${W.view.id}"]`);if(g&&r&&(g.removeWidget(r),m)){const l=m.items.findIndex(t=>t.id===W.view.id);l!==-1&&m.items.splice(l,1)}const h=this.childViews[0];h.view.componentProps&&(h.view.componentProps.preMatchType=k,h.view.filterMultiple={isHomeTeam:h.view.componentProps.preMatchType})}else this.childViews.forEach((W,g)=>{W.view.componentProps.preMatchType=g+1,W.view.filterMultiple={isHomeTeam:W.view.componentProps.preMatchType}})}if(this.viewId===15){const k=a[0]||1;if(i){const W=this.childViews.find(g=>g.view.id===i);W&&W.view.componentProps&&(W.view.componentProps.preMatchType=k,W.view.filterMultiple={isHomeTeam:k===1})}else if(k<3){if(this.childViews.length===1){const W=this.childViews[0];W.view.componentProps&&(W.view.componentProps.preMatchType=k,W.view.filterMultiple={isHomeTeam:k===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const g=this.childViews.pop(),m=g.grid,r=g.page,h=document.querySelector(`[gs-id="${g.view.id}"]`);if(m&&h&&(m.removeWidget(h),r)){const l=r.items.findIndex(t=>t.id===g.view.id);l!==-1&&r.items.splice(l,1)}}const W=this.childViews[0];W.view.componentProps&&(W.view.componentProps.preMatchType=k,W.view.filterMultiple={isHomeTeam:k===1})}}else if(this.childViews.length===2)this.childViews.forEach((W,g)=>{W.view.componentProps&&(W.view.componentProps.preMatchType=g+1,W.view.filterMultiple={isHomeTeam:g===0})});else if(this.childViews.length<2)this.childViews.forEach((W,g)=>{W.view.componentProps&&(W.view.componentProps.preMatchType=g+1,W.view.filterMultiple={isHomeTeam:g===0})});else{for(;this.childViews.length>2;){const W=this.childViews.pop(),g=W.grid,m=W.page,r=document.querySelector(`[gs-id="${W.view.id}"]`);if(g&&r&&(g.removeWidget(r),m)){const h=m.items.findIndex(l=>l.id===W.view.id);h!==-1&&m.items.splice(h,1)}}this.childViews.forEach((W,g)=>{W.view.componentProps&&(W.view.componentProps.preMatchType=g+1,W.view.filterMultiple={isHomeTeam:g===0})})}}if(this.viewId===10){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const W=this.childViews[0];W.view.componentProps&&(W.view.componentProps.isHomeTeamForAnalysis=k===1,W.view.filterMultiple={isHomeTeam:W.view.componentProps.isHomeTeamForAnalysis})}else{const W=this.childViews.pop(),g=W.grid,m=W.page,r=document.querySelector(`[gs-id="${W.view.id}"]`);if(g&&r&&(g.removeWidget(r),m)){const l=m.items.findIndex(t=>t.id===W.view.id);l!==-1&&m.items.splice(l,1)}const h=this.childViews[0];h.view.componentProps&&(h.view.componentProps.isHomeTeamForAnalysis=k===1,h.view.filterMultiple={isHomeTeam:h.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((W,g)=>{W.view.componentProps.isHomeTeamForAnalysis=g%2===0,W.view.filterMultiple={isHomeTeam:W.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const k=a[1];if(k===3)this.childViews.forEach((W,g)=>{W.view.componentProps.isHomeTeamForAnalysis=g%2===0,W.view.isHomeTeam=g%2===0,W.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",W.view.filterMultiple={isHomeTeam:W.view.isHomeTeam}});else{const W=k===1;if(this.childViews.length>0){const g=this.childViews[0];g.view.componentProps.isHomeTeamForAnalysis=W,g.view.isHomeTeam=W,g.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",g.view.filterMultiple={isHomeTeam:W},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const k=a[0],W=a[1];if(W===3){if(this.childViews.length>k.length){const g=k.map(m=>{const r=m.join("-");return jh.get(this.viewId).analysisTypes.get(r).analysisType});this.childViews.reduce((m,r)=>(g.includes(r.view.componentProps.analysisType)||m.push(r.view.componentProps.analysisType),m),[]).forEach(m=>{const r=this.childViews.findIndex(h=>h.view.componentProps.analysisType===m);if(r!==-1){const h=this.childViews[r];this.removeChildView(h)}})}}else{const g=W===1,m=this.getHomeTeamViews(),r=this.getAwayTeamViews();if(g&&m.length===0)r.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=g,h.view.isHomeTeam=g,h.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(!g&&r.length===0)m.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=g,h.view.isHomeTeam=g,h.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(m.length===r.length)g||m.forEach(h=>{h.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}}),(g?r:m).forEach(h=>{this.removeChildView(h)});else{const h=g?this.getHomeTeamViews():this.getAwayTeamViews();if(h.length>k.length){const l=k.map(t=>{const _=t.join("-");return jh.get(this.viewId).analysisTypes.get(_).analysisType});h.forEach(t=>{l.includes(t.view.componentProps.analysisType)?t.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}:this.removeChildView(t)})}else h.forEach(l=>{l.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}})}}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){const W=this.childViews.map(g=>{var m,r;const h=(m=g.view.componentProps)==null?void 0:m.categoryView,l=((r=g.view.filterMultiple)==null?void 0:r.teamType)||1,t=h&&h.length>0?h[0].id:null;return t?{categoryId:t,teamType:l,viewId:g.view.id}:null}).filter(g=>g!==null);if(i){const g=this.childViews.find(m=>m.view.id===i);if(g){const m=a[1]||1,r=k[0];if(r){let h=null;try{h=Wh(r)}catch{}g.view.filterMultiple={categoryId:r,teamType:m},g.view.componentProps.game&&(m===1?g.view.componentProps.teamView=g.view.componentProps.game.homeTeam.team_id:m===2?g.view.componentProps.teamView=g.view.componentProps.game.awayTeam.team_id:g.view.componentProps.teamView=0),g.view.componentProps.categoryView=h?[{id:r,name:h.name}]:[{id:r,name:`Category ${r}`}]}}}if(!i){const g=a[1]||1;this.childViews.forEach(m=>{var r;const h=(r=m.view.componentProps)==null?void 0:r.categoryView;if(h&&h.length>0){const l=h[0].id;k.includes(l)&&(m.view.filterMultiple={categoryId:l,teamType:g})}})}if(W.map(g=>g.categoryId).filter(g=>!k.includes(g)).forEach(g=>{this.childViews.filter(m=>{var r;const h=(r=m.view.componentProps)==null?void 0:r.categoryView;return h&&h.length>0&&h[0].id===g}).forEach(m=>{this.removeChildView(m),Ua.emit("component-removed",{viewId:m.view.id,categoryId:g})})}),i){const g=k[0];if(g){const m=this.childViews.find(r=>r.view.id===i);if(m){let r=null;try{r=Wh(g)}catch{}const h=a[1]||1;m.view.filterMultiple={categoryId:g,teamType:h},m.view.componentProps.game&&(m.view.componentProps.teamView=h===2?m.view.componentProps.game.awayTeam.team_id:h===1?m.view.componentProps.game.homeTeam.team_id:0),m.view.componentProps.categoryView=r?[{id:g,name:r.name}]:[{id:g,name:`Category ${g}`}]}}}}else{const W=k;if(W&&i){const g=this.childViews.find(m=>m.view.id===i);if(g){let m=null;try{m=Wh(W)}catch{}const r=a[1]||1;g.view.filterMultiple={categoryId:W,teamType:r},g.view.componentProps.game&&(g.view.componentProps.teamView=r===2?g.view.componentProps.game.awayTeam.team_id:r===1?g.view.componentProps.game.homeTeam.team_id:0),g.view.componentProps.categoryView=m?[{id:W,name:m.name}]:[{id:W,name:`Category ${W}`}]}}}}if(this.viewId===8){const k=a[0]||!1;this.childViews.forEach(W=>{W.view.componentProps&&(W.view.componentProps._isReactive||(W.view.componentProps=n.reactive(W.view.componentProps),W.view.componentProps._isReactive=!0),W.view.componentProps.areInactiveVisible=k,W.view.componentProps.key=k,Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))})}if(this.viewId===1){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const W=this.childViews.find(g=>g.view.id===i);W&&this.updateComparative(W,a)}else if(this.childViews.reduce((W,g)=>(k.includes(g.view.componentProps.type)||W.push(g.view.componentProps.type),W),[]).forEach(W=>{const g=this.childViews.findIndex(m=>m.view.componentProps.type===W);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const r=this.childViews[m+1],h=this.childViews[m];r&&(h.view.componentProps.type=r.view.componentProps.type,h.view.title=r.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(k))this.childViews.length>0&&k.length>0&&this.childViews.forEach((W,g)=>{if(W.view.componentProps&&g<k.length){const m=k[g],r=jh.get(this.viewId);W.view.componentProps.type=m,W.view.componentProps.default=!1,W.view.title=`Comparativa ${r[m]}`,W.view.filterMultiple={category:m}}});else{const W=k;if(W&&this.childViews.length>0){const g=this.childViews[0];if(g.view.componentProps){const m=jh.get(this.viewId);g.view.componentProps.type=W,g.view.componentProps.default=!1,g.view.title=`Comparativa ${m[W]}`,g.view.filterMultiple={category:W}}}}}if(this.viewId===6){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const W=this.childViews.find(g=>g.view.id===i);W&&this.updateGSCLineupsReports(W,a)}else{if(Array.isArray(k))if(k.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((W,g)=>(k.includes(g.view.componentProps.gameNumber)||W.push(g.view.componentProps.gameNumber),W),[]).forEach(W=>{const g=this.childViews.findIndex(m=>m.view.componentProps.gameNumber===W);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const r=this.childViews[m+1],h=this.childViews[m];r&&(h.view.componentProps.gameNumber=r.view.componentProps.gameNumber,h.view.filterMultiple={gameNumber:r.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(W=>{W.view.componentProps&&(W.view.componentProps._isReactive||(W.view.componentProps=n.reactive(W.view.componentProps),W.view.componentProps._isReactive=!0),Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))})}}if(this.viewId===3){if(i){this.setDynamicFilters(a,i);const k=this.childViews.find(W=>W.view.id===i);k&&this.updateMatchSummary(k,a)}else{const k=a[0]||!1;this.childViews.forEach(W=>{W.view.componentProps&&(W.view.componentProps._isReactive||(W.view.componentProps=n.reactive(W.view.componentProps),W.view.componentProps._isReactive=!0),W.view.componentProps.desplegable=k,W.view.componentProps.key=k,Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))})}this.updateSummary({dynamicFilters:a})}if(this.viewId===13){const k=a[1]||[];if(i){this.setDynamicFilters(a,i);const W=this.childViews.find(g=>g.view.id===i);W&&(W.view.componentProps&&(W.view.componentProps.categoryids=k,W.view.componentProps.analysistype=a[0]||1,W.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],W.view.dynamicFilters=a,W.view._updateKey=Date.now()),Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))}else this.childViews.forEach(W=>{W.view.componentProps&&(W.view.componentProps._isReactive||(W.view.componentProps=n.reactive(W.view.componentProps),W.view.componentProps._isReactive=!0),W.view.componentProps.categoryids=k,W.view.componentProps.analysistype=a[0]||1,W.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],W.view.dynamicFilters=a,W.view._updateKey=Date.now(),Ua.emit("component-props-updated",{viewId:W.view.id,componentProps:W.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:W.view.id,dynamicFilters:a}))})}else if(this.viewId===15){const k=a[0]||1,W=a[3]!==void 0?a[3]:typeof a[1]=="number"?a[1]:null;if(i){this.setDynamicFilters(a,i);const g=this.childViews.find(m=>m.view.id===i);g&&g.view.componentProps&&(g.view.componentProps.analysistype=k,W!==null&&(g.view.componentProps.numitems=W),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),Ua.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))}else this.childViews.forEach(g=>{g.view.componentProps&&(g.view.componentProps._isReactive||(g.view.componentProps=n.reactive(g.view.componentProps),g.view.componentProps._isReactive=!0),g.view.componentProps.analysistype=k,W!==null&&(g.view.componentProps.numitems=W),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),Ua.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))})}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;if(i){const W=this.childViews.find(g=>g.view.id===i);W&&W.view.componentProps.selectedEvents}else if(!k&&this.childViews.length>0)this.childViews.forEach(W=>{this.removeChildView(W)});else if(k&&this.childViews.length===0){const W={pageId:null,view:{id:this.viewId,name:"Timeline",title:"Timeline",colspan:12,rowspan:6,max_column:12,max_row:12,min_column:6,min_row:4},filterAndWidgetContainer:this};Ua.emit("add-view",W)}else this.childViews.forEach(W=>{this.updateTimeline(W,a)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(a=>{this.removeChildView(a)})}removeChildView(a,i=!1){const k=this.childViews.findIndex(W=>W.view.id===a.view.id);if(k!==-1){const W=this.childViews[k];this.childViews.splice(k,1),W.view.id&&this.componentSpecificFilters.delete(W.view.id);const g=W.grid,m=W.page,r=document.querySelector(`[gs-id="${W.view.id}"]`);if(g&&r&&(g.removeWidget(r),m&&!i)){const h=m.items.findIndex(l=>l.id===W.view.id);h!==-1&&(m.items.splice(h,1),m.items.length===0&&Ua.emit("empty-page",m))}}}updateView({view:a,dynamicFilters:i,filtersJSON:k,filters:W}){this.setFiltersJSON(k),this.dynamicFilters=i;const g=this.childViews.find(m=>{var r;return((r=m.view)==null?void 0:r.id)===a.view.id});if(g){g.view.filtersJSON=k,g.view.coreView&&(g.view.coreView.filtersJSON=k);let m=i;if(this.viewId===4){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===8){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===3){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r),this.updateSummary({dynamicFilters:m})}else if(this.viewId===1){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===6){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===7){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}else if(this.viewId===9){const r=this.getComponentDynamicFilters(a.view.id);r&&(m=r)}this.viewId===5?this.updateVolumetricField(g,m):this.viewId===7?this.updateGoalData(g,m):this.viewId===9?this.updateFieldDataByZones(g,i):this.viewId===10?this.updateXg(g,m):this.viewId===3?this.updateMatchSummary(g,m):this.viewId===4?this.updateTimeline(g,m):this.viewId===8?this.updateFieldPosesion(g,m):this.viewId===1?this.updateComparative(g,m):this.viewId===2?this.updateGSCtops(g,m):this.viewId===6?this.updateGSCLineupsReports(g,m):this.viewId===16&&this.updateLastTouchSingle(g,W)}}updateComparative(a,i){if(a.view.componentProps){const k=i[0]||[];if(k&&k.length>0){let W;if(Array.isArray(k)){const m=this.childViews.findIndex(r=>r.view.id===a.view.id);m>=0&&m<k.length?W=k[m]:W=k[0]}else W=k;const g=jh.get(this.viewId);a.view.componentProps.type=W,a.view.componentProps.default=!1,a.view.title=`Comparativa ${g[W]}`,a.view.filterMultiple={category:W}}Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateVolumetricField(a,i){if(a.view.componentProps){const k=i[0]||1;a.view.isHomeTeam=k===1,a.view.componentProps.preMatchType=k,a.view.filterMultiple={isHomeTeam:k},Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),Ua.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateGoalData(a,i){if(a.view.componentProps){const k=i[0]===1?"offensive":"defensive",W=i[1]===1;a.view.componentProps.analysisType=k,a.view.componentProps.isHomeTeamForAnalysis=W,a.view.isHomeTeam=W,a.view.filterMultiple={isHomeTeam:W},Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),Ua.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldDataByZones(a,i){if(a.view.componentProps){const k=i[0],W=i[1]===1;if(a.view.componentProps.isHomeTeamForAnalysis=W,a.view.isHomeTeam=W,a.view.filterMultiple={categoryIds:k,isHomeTeam:W},k&&k.length){const g=k.join("-"),m=jh.get(this.viewId).analysisTypes.get(g);m&&(a.view.componentProps.analysisType=m.analysisType,a.view.title=m.title,a.view.titleShort=m.titleShort)}}}updateXg(a,i){const k=i[0]===1;a.view.componentProps&&(a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.filtersJSON=this.filtresJSON,a.view.filterMultiple={isHomeTeam:k})}updateMatchSummary(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.desplegable=k,a.view.componentProps.key=k,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateTimeline(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=this.getComponentDynamicFilters(a.view.id)||i,W=k&&k.length>0?k[0]:[];a.view.componentProps.selectedEvents=W,a.view.componentProps.key=W.length>0;const g=this.hasEventTypeId(W,1),m=this.hasCategoryId(W,8),r=this.hasCategoryId(W,9),h=this.hasEventTypeId(W,3);a.view.componentProps.goals=g,a.view.componentProps.yellowCards=m,a.view.componentProps.redCards=r,a.view.componentProps.substitutions=h,a.view.componentProps._updateKey=Date.now(),Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:k}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:k}),Ua.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldPosesion(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=n.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.areInactiveVisible=k,a.view.componentProps.key=k,Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateGSCtops(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const W=k[0];let g=null;try{g=Wh(W)}catch(r){console.warn("Error getting category by ID:",r)}const m=i[1]||1;a.view.filterMultiple={categoryId:W,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:W,name:g.name}]:[{id:W,name:`Category ${W}`}]}}else{const W=k;if(W){let g=null;try{g=Wh(W)}catch(r){console.warn("Error getting category by ID:",r)}const m=i[1]||1;a.view.filterMultiple={categoryId:W,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:W,name:g.name}]:[{id:W,name:`Category ${W}`}]}}}}updateGSCLineupsReports(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const W=k[0];a.view.filterMultiple={gameNumber:W},a.view.componentProps.gameNumber=W}}else{const W=k;W&&(a.view.filterMultiple={gameNumber:W},a.view.componentProps.gameNumber=W)}Ua.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),Ua.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),Ua.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}getCategoryIdFromAnalysisType(a,i){if(!a||!i)return null;for(const k of i){const W=k.join("-"),g=jh.get(this.viewId);if(g&&g.analysisTypes){const m=g.analysisTypes.get(W);if(m&&m.analysisType===a)return k[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach(W=>{W.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,W.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,W.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,W.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const a=this.filters.selectedCategories.map(W=>W.value),i=a.map(W=>W.name),k=this.filters.selectedTeam.value;if(k===3)this.childViews.length>a&&this.childViews.reduce((W,g)=>(i.includes(g.view.componentProps.categories[0].name)||W.push(g.view.componentProps.categories[0].name),W),[]).forEach(W=>{const g=this.childViews.findIndex(m=>m.view.componentProps.categories[0].name===W);if(g!==-1){const m=this.childViews[g];this.removeChildView(m)}});else{const W=k===1,g=this.getHomeTeamViews(),m=this.getAwayTeamViews();if(W&&g.length===0)m.forEach(r=>{r.view.componentProps.isHomeTeamForAnalysis=W,r.view.isHomeTeam=W,r.view.filterMultiple.isHomeTeam=W});else if(!W&&m.length===0)g.forEach(r=>{r.view.componentProps.isHomeTeamForAnalysis=W,r.view.isHomeTeam=W,r.view.filterMultiple.isHomeTeam=W});else if(g.length===m.length)W||g.forEach(r=>{r.view.componentProps.isHomeTeamForAnalysis=W,r.view.isHomeTeam=W,r.view.filterMultiple.isHomeTeam=W}),(W?m:g).forEach(r=>{this.removeChildView(r)});else{const r=W?this.getHomeTeamViews():this.getAwayTeamViews();if(r.length>a.length){const h=a.map(l=>l.name);r.forEach(l=>{h.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=W:this.removeChildView(l)})}else r.forEach(h=>{h.view.filterMultiple.isHomeTeam=W})}}}updateLastTouchSingle(a,i){if(a.view.componentProps){const k=i.selectedTeam.value===1,W=i.selectedCategory.value;a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.componentProps.categories=[W],a.view.componentProps.analysisType=i.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=i.isAssistZoneVisible,a.view.componentProps.howManyGames=i.howManyGamesSelected.value,a.view.title=W.name,a.view.titleShort=W.name,a.view.isHomeTeam=k,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:W,selectedGamePhase:i.selectedGamePhase,howManyGamesSelected:i.howManyGamesSelected,isAssistZoneVisible:i.isAssistZoneVisible}}}}const W5e={class:"template-page__header"},j5e={class:"template-page__header__name"},K5e=["value"],A5e={class:"template-page__header__details"},I5e={class:"template-page__header__details__teams"},X5e={class:"template-page__header__details__teams__team"},D5e={key:0,class:"template-page__header__details__teams__team__logo"},J5e=["src"],G5e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B5e={class:"template-page__header__details__teams__team"},Z5e={key:0,class:"template-page__header__details__teams__team__logo"},H5e=["src"],Y5e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Q5e={class:"template-page__content"},$5e=["id"],e_e=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-max-w","gs-max-h","gs-min-w","gs-min-h","gs-no-resize","gs-no-move","gs-auto-position"],t_e=n.defineComponent({__name:"TemplateReportPage",props:{token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},game:{type:Object,default:()=>null},lastGames:{type:Array,default:()=>null},id:{type:[String,Number],default:()=>String(Date.now())},page:{type:Object,default:()=>({title:"Page 1",items:[{name:"Tabla jugadores",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]})},isPostMatch:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},isFilterVisible:{type:Boolean,default:!1}},emits:["intersection-changed","delete-page","change-sort","edit-view","view-changed","component-props-updated","delete-view","dynamic-filters-changed"],setup(e,{emit:a}){var i,k,W;const g=n.ref(null);let m=null;const r=e,h=n.ref(!1),l=a,t=n.computed(()=>r.page.items.reduce((j,K)=>(j.set(K.id,K),j),new Map)),_=n.computed(()=>{var j,K,X,D;return r.game&&r.game.homeTeam&&r.game.awayTeam?{homeTeam:{name:((j=r.game.homeTeam)==null?void 0:j.acronym)||"LOC",logo:((K=r.game.homeTeam)==null?void 0:K.logo)||null},awayTeam:{name:((X=r.game.awayTeam)==null?void 0:X.acronym)||"VIS",logo:((D=r.game.awayTeam)==null?void 0:D.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let w=null,v=null,f=!1,o=null,s=!1;const p=()=>{s=!0},c=()=>{s=!1};function d(){s||(f=!0,o&&clearTimeout(o),o=setTimeout(()=>{f=!1},150))}function b(){const j={root:null,rootMargin:"0px",threshold:.7};w=new IntersectionObserver(D=>{D.forEach(H=>{if(f){v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},100);return}v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},50)})},j);const K=g.value;K&&w.observe(K);const X=document.querySelector(".container-main");X&&X.addEventListener("scroll",d,{passive:!0}),document.addEventListener("programmatic-scroll-start",p),document.addEventListener("programmatic-scroll-end",c)}function x(j){r.page.title=j.target.value,l("view-changed")}const T={game_id:0,season_id:0,prematch:!1},N={gameId:90209,id:90209,seasonId:1909,regularSeasonId:1909,matchday_name:"Matchday 1",status:1,score:[1,3],game_status:1,dateTimeUTC:"2024-09-05T22:00:00Z",homeTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/2936.png",team_id:2936,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/2936.png",colloquial_name:"Guyana",acronym:"GUY",team_name:"Guyana"},awayTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/3279.png",team_id:3279,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/3279.png",colloquial_name:"Surinam",acronym:"SUR",team_name:"Surinam"},is_live:0,minutes:{home_goals_minutes:[],visiting_goals_minutes:[],home_yellow_cards_minutes:[],away_yellow_cards_minutes:[],home_red_cards_minutes:[],away_red_cards_minutes:[]}},V=new Map([[5,{component:ET,componentName:"GSCVolumetricField",props:{isGamePreMatch:!r.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:r.isTemplateMode,isTemplateMode:r.isTemplateMode,preMatchType:1}}],[2,{component:L4,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:r.game?r.game.id:N.gameId,game:r.game,season:r.game?(i=r==null?void 0:r.game)==null?void 0:i.season_id:N.seasonId,teamView:0,useDummyData:r.isTemplateMode}}],[8,{component:Ok,componentName:"FieldPosesion",props:{widthSection:600,game:N,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:C8,componentName:"GSCLineupsReports",props:{selectedOption:r.isPostMatch?"Postmatch":"Prematch",game:T,gamehome:T,gameaway:T}}],[3,{component:zk,componentName:"GSCMatchSummary",props:{game:N,defaultShields:!0,desplegable:!1}}],[4,{component:y7,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:N.gameId,homeTeam:N.homeTeam.team_id,awayTeam:N.awayTeam.team_id,token:r.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:w9,componentName:"GSCGoalData",props:{game:r.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!r.isPostMatch,analysisType:1}}],[9,{component:P8,componentName:"GSCFieldDataByZones",props:{game:r.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!r.isPostMatch,negative:!0}}],[10,{component:Qw,componentName:"GSCGameXg",props:{game:r.game,isHomeTeamForAnalysis:!0,isPostMatch:r.isPostMatch}}],[13,{component:DS,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:r.game?(k=r==null?void 0:r.game)==null?void 0:k.season_id:0,teamsIds:[8,13],categoryIds:[20,2],analysisType:1,teamsshow:[1],gameId:90401,teams:[{id:8,name:"MAZ",logo:"https://golstatsimages.blob.core.windows.net/teams-80/8.png"},{id:13,name:"SNL",logo:"https://golstatsimages.blob.core.windows.net/teams-80/13.png"}]}}],[14,{component:nS,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:xL,componentName:"GSCStrengths",props:{token:r.token,view:1,numitems:3,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[10,{component:Qw,componentName:"GSCGameXg",props:{game:r.game,isHomeTeamForAnalysis:!0,isPostMatch:r.isPostMatch}}],[1,{component:v9,componentName:"GSCComparativeReports",props:{gameId:r.game?r.game.id:"",homeLogo:r.game?r.game.homeTeam.logo:"",awayLogo:r.game?r.game.awayTeam.logo:"",seasonId:r.game?(W=r==null?void 0:r.game)==null?void 0:W.season_id:0,typeGame:r.isPostMatch,type:"stoppedBall",default:r.isTemplateMode}}],[16,{component:LL,componentName:"GSCLastTouch",props:{categories:[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}],gameIdsForAnalysis:[],isAssistZoneVisible:!1,seasonId:2010,analysisType:"offensive",teamIdForAnalysis:1,isHomeTeamForAnalysis:!0,isTemplateMode:r.isTemplateMode}}]]);function U(j){if(j)if(typeof j=="string"){let K=null;switch(j){case"GSCVolumetricField":K=ET;break;case"GSCGoalData":K=w9;break;case"GscTopPlayer":K=L4;break;case"FieldPosesion":K=Ok;break;case"GSCLineupsReports":K=C8;break;case"GSCMatchSummary":K=zk;break;case"GSCTimelineReports":K=y7;break;case"GSCFieldDataByZones":K=P8;break;case"GSCGeneraltable":K=nS;break;case"GSCTimelapseTable":K=DS;break;case"GSCGameXg":K=Qw;break;case"GSCComparativeReports":K=v9;break;case"GSCStrengths":K=xL;break;case"GSCLastTouch":K=LL;break;default:K=null}return K}else return j;return null}function z({pageId:j,view:K,filterAndWidgetContainer:X,applyMinimumSize:D=!1,dynamicFilters:H=[],filters:ne=null}){if(r.page.id===j&&m){let G=!1;K.id===3&&(G=H[0]);const re=`min_column${G?"_2":""}`,ee=`min_row${G?"_2":""}`,Y=`colspan${G?"_2":""}`,$=`rowspan${G?"_2":""}`,le={w:D?K[re]:K[Y],h:D?K[ee]:K[$]};if(m.willItFit(0,0,le.w,le.h,!0)){const ie=m.addWidget(le),ue=Number(ie.getAttribute("gs-x")||0),he=Number(ie.getAttribute("gs-y")||0);m.removeWidget(ie);const ae=V.get(K.id),de=n.reactive({...JSON.parse(JSON.stringify(ae.props))||{},_isReactive:!0}),ce=n.reactive({pageId:j,grid:m,page:r.page,view:{name:K.name,title:K.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ue,y:he,w:le.w,h:le.h,maxWidth:K.max_column,maxHeight:K.max_row,minWidth:K.min_column,minHeight:K.min_row,componentName:ae.componentName,componentProps:de,pageId:j,coreView:K}});X.addView(ce),Ua.emit("add-page-view",ce)}else Ua.emit("add-page-and-view",{pageId:j,view:K,filterAndWidgetContainer:X})}}function O(j){if(m){const K=document.querySelector(`[gs-id="${j.id}"]`);K&&(m.removeWidget(K),l("delete-view",j))}l("view-changed")}function C(j){if(!j.filterAndViewsContainer&&j.coreView){const K=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[j],j.coreView.id,j.dynamicFilters||[],r.isPostMatch,r.isTemplateMode,j.filtersJSON,null,j.filters);j.filterAndViewsContainer=K}l("edit-view",j)}function q(){l("delete-page",r.page)}function L(){Ua.emit("change-sort",r.page)}function P(j){if(f)return;const K=r.page.items.find(X=>X.id===j.itemId||X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps),K._updateKey=Date.now())}function S(j){if(f)return;const K=r.page.items.find(X=>X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps),K._updateKey=Date.now())}function F(j){if(f)return;const K=r.page.items.find(X=>X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps||{}),K._updateKey=Date.now())}const R=function(){Ua.off("add-view",z),Ua.off("force-component-update",P),Ua.off("component-props-updated",S),Ua.off("dynamic-filters-changed",F);const j=document.querySelector(".container-main");j&&j.removeEventListener("scroll",d),v&&clearTimeout(v),o&&clearTimeout(o)};return Ua.on("add-view",z),Ua.on("force-component-update",P),Ua.on("component-props-updated",S),Ua.on("dynamic-filters-changed",F),n.onMounted(async()=>{await n.nextTick(),m=vi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${r.id}`),m.on("change",(j,K)=>{const X=K[0];if(X){const D=t.value.get(X.id);D&&(D.x=X.x,D.y=X.y,D.w=X.w,D.h=X.h,l("view-changed"))}}),b(),r.page.grid=m,r.page.offListeners=R}),n.onUnmounted(()=>{w&&w.disconnect(),R(),v&&clearTimeout(v),o&&clearTimeout(o),document.removeEventListener("programmatic-scroll-start",p),document.removeEventListener("programmatic-scroll-end",c)}),(j,K)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"templatePage",ref:g,class:"template-page"},[n.createElementVNode("div",W5e,[h.value?(n.openBlock(),n.createBlock(NL,{key:0,"options-type":"page",onClick:K[0]||(K[0]=n.withModifiers(X=>h.value=!1,["self"])),onMouseleave:K[1]||(K[1]=X=>h.value=!1),onCloseTooltip:K[2]||(K[2]=X=>h.value=!1),onDeletePage:q,onChangeSort:L})):n.createCommentVNode("",!0),n.createElementVNode("div",j5e,[K[4]||(K[4]=n.createElementVNode("div",null,[n.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M11.2986 12.9994C7.62909 14.8341 4.11744 16.0178 1.35547 16.4518L9.18763 20.0029C9.34545 20.0818 9.60192 20.0818 9.74002 20.0029L17.8878 16.3137C18.0457 16.2348 18.164 16.0572 18.164 15.8797V8.75781C16.2898 10.2177 13.9422 11.6776 11.2986 12.9994Z",fill:"white"}),n.createElementVNode("path",{d:"M4.7152 8.89735C4.7152 8.89735 10.9494 3.76802 16.8482 1.20335C15.0529 0.946887 11.3637 0.43395 9.3711 0.453678C4.41928 0.493135 1.06546 1.34145 1.06546 1.34145C0.90763 1.3809 0.769531 1.55846 0.769531 1.71629V8.12795C3.01857 6.56942 5.34651 5.56329 5.34651 5.56329C5.34651 5.56329 2.72264 7.06263 0.769531 8.81844V9.41028V14.1648C3.09748 13.9675 6.62886 12.7641 10.3575 10.7321C13.6719 8.91707 16.4733 6.84562 18.17 5.05035V2.40677C14.3032 3.37346 4.7152 8.89735 4.7152 8.89735Z",fill:"white"})])],-1)),K[5]||(K[5]=n.createElementVNode("div",{class:"separator"},null,-1)),n.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:x},null,40,K5e)]),n.createElementVNode("div",A5e,[n.createElementVNode("div",I5e,[n.createElementVNode("div",X5e,[_.value.homeTeam.logo?(n.openBlock(),n.createElementBlock("div",D5e,[n.createElementVNode("img",{src:_.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,J5e)])):(n.openBlock(),n.createElementBlock("svg",G5e,[...K[6]||(K[6]=[n.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])])),n.createElementVNode("span",null,n.toDisplayString(_.value.homeTeam.name),1)]),K[8]||(K[8]=n.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),n.createElementVNode("div",B5e,[n.createElementVNode("span",null,n.toDisplayString(_.value.awayTeam.name),1),_.value.awayTeam.logo?(n.openBlock(),n.createElementBlock("div",Z5e,[n.createElementVNode("img",{src:_.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,H5e)])):(n.openBlock(),n.createElementBlock("svg",Y5e,[...K[7]||(K[7]=[n.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])]))])]),e.isTemplateMode&&!e.isFilterVisible?(n.openBlock(),n.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:K[3]||(K[3]=X=>h.value=!0)},[...K[9]||(K[9]=[n.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",Q5e,[n.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.page.items,X=>{var D,H,ne;return n.openBlock(),n.createElementBlock("div",{class:"grid-stack-item",key:X.key,"gs-id":X.id,"gs-x":X.x,"gs-y":X.y,"gs-w":X.w,"gs-h":X.h,"gs-max-w":X.maxWidth,"gs-max-h":X.maxHeight,"gs-min-w":X.minWidth,"gs-min-h":X.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!r.isTemplateMode,"gs-auto-position":X.x===0&&X.y===0},[n.createElementVNode("div",{class:n.normalizeClass(["grid-stack-item-content",{"is-selected":X.isSelected}])},[n.createVNode(O5e,{view:X,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":(D=X.componentProps)!=null&&D.preMatchType?((H=X.componentProps)==null?void 0:H.preMatchType)===1:X.isHomeTeam,"is-filter-visible":e.isFilterVisible,"view-id":((ne=X==null?void 0:X.coreView)==null?void 0:ne.id)||0,onEdit:G=>C(X),onDelete:G=>O(X)},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(U(X.componentName)),n.mergeProps({ref_for:!0},X.componentProps,{key:`${X.id}-${X._updateKey||0}`}),null,16))]),_:2},1032,["view","is-template-mode","is-post-match","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,e_e)}),128))],8,$5e)])],512))}}),r_e=jd(t_e,[["__scopeId","data-v-82a5f737"]]),n_e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},a_e={key:0,class:"cover__main-logo cover__main-logo__home"},i_e={key:0,class:"team-logo"},o_e=["src"],s_e={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l_e=["fill"],c_e={key:1,class:"cover__main-logo cover__main-logo__away"},u_e={key:0,class:"team-logo"},d_e=["src"],p_e={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h_e=["fill"],f_e={class:"cover__title-subtitle"},m_e={class:"cover__title-subtitle__title"},y_e={class:"cover__title-subtitle__subtitle"},g_e={key:2,class:"cover-type-one"},v_e={class:"team-info-one"},b_e={class:"team-data"},x_e={key:0,class:"team-logo"},w_e=["src"],__e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},S_e=["fill","opacity"],T_e={class:"team-name"},k_e={key:0,class:"team-events"},L_e={class:"score-one"},N_e={key:0},V_e={class:"team-info-one"},O_e={class:"team-data"},q_e={key:0,class:"team-logo"},U_e=["src"],z_e={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C_e=["fill","opacity"],P_e={class:"team-name"},F_e={key:0,class:"team-events"},E_e={key:3,class:"cover-type-two"},R_e={class:"team-data"},M_e={class:"team-info"},W_e={key:0,class:"team-logo"},j_e=["src"],K_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},A_e=["fill","opacity"],I_e={key:2,class:"team-score-two"},X_e={key:0,class:"team-goals"},D_e={class:"team-data"},J_e={class:"team-info"},G_e={key:0,class:"team-score-two"},B_e={key:1,class:"team-logo"},Z_e=["src"],H_e={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y_e=["fill","opacity"],Q_e={key:0,class:"team-goals"},$_e={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:a}){const i=e,k=a,W=n.ref(null),g=n.computed(()=>[1,2].includes(i.coverId)),m=n.computed(()=>[1,3].includes(i.coverId)),r=n.computed(()=>i.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:i.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),h=n.computed(()=>i.game&&i.game.score?i.game.score:["0","0"]),l=n.computed(()=>{var U,z,O,C,q,L,P,S;if(i.game&&i.game.homeTeam&&i.game.awayTeam){const F={homeTeam:{name:((U=i.game.homeTeam)==null?void 0:U.acronym)||"LOC",logo:((z=i.game.homeTeam)==null?void 0:z.logo)||null},awayTeam:{name:((O=i.game.awayTeam)==null?void 0:O.acronym)||"VIS",logo:((C=i.game.awayTeam)==null?void 0:C.logo)||null}};return g.value?(F.homeTeam.goalsMinutes=o(i.game.minutes.home_goals_minutes),F.homeTeam.totalYellowCards=((q=i.game.minutes.home_yellow_cards_minutes)==null?void 0:q.length)||0,F.homeTeam.totalRedCards=((L=i.game.minutes.home_red_cards_minutes)==null?void 0:L.length)||0,F.awayTeam.goalsMinutes=o(i.game.minutes.visiting_goals_minutes),F.awayTeam.totalYellowCards=((P=i.game.minutes.away_yellow_cards_minutes)==null?void 0:P.length)||0,F.awayTeam.totalRedCards=((S=i.game.minutes.away_red_cards_minutes)==null?void 0:S.length)||0):(F.homeTeam.goalsEvents=f(i.game.report_minutes.home_goals_minutes),F.awayTeam.goalsEvents=f(i.game.report_minutes.visiting_goals_minutes)),F}return{homeTeam:{name:"LOC",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]},awayTeam:{name:"VIS",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]}}}),t=n.computed(()=>({"--background-image":m.value?"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-01@2x.jpg)":"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-02@2x.jpg)","--grid-template-columns-type-one":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":i.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":i.isPostMatch?"100%":"fit-content"})),_=n.computed(()=>i.isPostMatch?"Postmatch":"Prematch"),w=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],v=n.computed(()=>{if(i.game){let U=n_e[i.game.matchday_abbreviation];U||(U=i.game.matchday_abbreviation.replace("M","J"));const[z,O,C]=i.game.date.split("-");return`${U} - ${C} ${w[Number(O)-1]}, ${z}`}return"Jornada - Día 00 Mes"});function f(U){return!U||!Array.isArray(U)||U.length===0?"":U.map(z=>{const O=z.split(", ");let C=O[0].replace("'","");C=C.replace("+",""),C=C.replace("’","");const q=C.split(" "),{strings:L,numbers:P}=q.reduce((R,j)=>(isNaN(Number(j))?R.strings.push(j):R.numbers.push(j),R),{strings:[],numbers:[]}),S=L.join(" "),F=P.length===1?`${P[0]}'`:`${P[0]}' ${P.slice(1).join(" + ")}'`;return{playerName:S,goalTime:O.length===1?F:`${F}, ${O.reduce((R,j,K)=>K===0?R:`${R}${j}${K<O.length-1?", ":""}`,"")}`}})}function o(U){return!U||!Array.isArray(U)||U.length===0?"":U.reduce((z,O,C)=>{const q=O.split(" ");let L="";return q.length===3?L=q[2]:q.length===5&&(L=`${q[2]} ${q[3]} ${q[4]}`),L&&(z+=`${L}${C<U.length-1?", ":""}`),z},"")}let s=null,p=null,c=!1,d=null,b=!1;const x=()=>{b=!0},T=()=>{b=!1};function N(){b||(c=!0,d&&clearTimeout(d),d=setTimeout(()=>{c=!1},150))}function V(){const U={root:null,rootMargin:"0px",threshold:.7};s=new IntersectionObserver(C=>{C.forEach(q=>{if(c){p&&clearTimeout(p),p=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},100);return}p&&clearTimeout(p),p=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},50)})},U);const z=W.value;z&&s.observe(z);const O=document.querySelector(".container-main");O&&O.addEventListener("scroll",N,{passive:!0}),document.addEventListener("programmatic-scroll-start",x),document.addEventListener("programmatic-scroll-end",T)}return n.onMounted(()=>{V()}),n.onUnmounted(()=>{s&&s.disconnect();const U=document.querySelector(".container-main");U&&U.removeEventListener("scroll",N),document.removeEventListener("programmatic-scroll-start",x),document.removeEventListener("programmatic-scroll-end",T),p&&clearTimeout(p),d&&clearTimeout(d)}),(U,z)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"coverPage",ref:W,class:"cover",style:n.normalizeStyle(t.value)},[g.value?(n.openBlock(),n.createElementBlock("div",a_e,[l.value.homeTeam.logo?(n.openBlock(),n.createElementBlock("div",i_e,[n.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,o_e)])):(n.openBlock(),n.createElementBlock("svg",s_e,[n.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:r.value.homeTeam},null,8,l_e)]))])):n.createCommentVNode("",!0),g.value?(n.openBlock(),n.createElementBlock("div",c_e,[l.value.awayTeam.logo?(n.openBlock(),n.createElementBlock("div",u_e,[n.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,d_e)])):(n.openBlock(),n.createElementBlock("svg",p_e,[n.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:r.value.awayTeam},null,8,h_e)]))])):n.createCommentVNode("",!0),n.createElementVNode("div",f_e,[n.createElementVNode("div",m_e,[z[0]||(z[0]=n.createElementVNode("div",null,"Análisis",-1)),n.createElementVNode("div",null,n.toDisplayString(_.value),1)]),n.createElementVNode("div",y_e,n.toDisplayString(v.value),1)]),g.value?(n.openBlock(),n.createElementBlock("div",g_e,[n.createElementVNode("div",v_e,[n.createElementVNode("div",b_e,[l.value.homeTeam.logo?(n.openBlock(),n.createElementBlock("div",x_e,[n.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,w_e)])):(n.openBlock(),n.createElementBlock("svg",__e,[n.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:r.value.homeTeam,opacity:r.value.opacity},null,8,S_e)])),n.createElementVNode("div",T_e,n.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",k_e,[z[1]||(z[1]=n.createStaticVNode('<svg class="ball" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),n.createElementVNode("div",null,n.toDisplayString(l.value.homeTeam.goalsMinutes),1),z[2]||(z[2]=n.createElementVNode("div",{class:"separator"},null,-1)),z[3]||(z[3]=n.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),n.createElementVNode("div",null,n.toDisplayString(l.value.homeTeam.totalYellowCards),1),z[4]||(z[4]=n.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),n.createElementVNode("div",null,n.toDisplayString(l.value.homeTeam.totalRedCards),1)])):n.createCommentVNode("",!0)]),n.createElementVNode("div",L_e,[e.isPostMatch?(n.openBlock(),n.createElementBlock("div",N_e,n.toDisplayString(h.value[0])+" : "+n.toDisplayString(h.value[1]),1)):n.createCommentVNode("",!0)]),n.createElementVNode("div",V_e,[n.createElementVNode("div",O_e,[l.value.awayTeam.logo?(n.openBlock(),n.createElementBlock("div",q_e,[n.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,U_e)])):(n.openBlock(),n.createElementBlock("svg",z_e,[n.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:r.value.awayTeam,opacity:r.value.opacity},null,8,C_e)])),n.createElementVNode("div",P_e,n.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",F_e,[n.createElementVNode("div",null,n.toDisplayString(l.value.awayTeam.totalYellowCards),1),z[5]||(z[5]=n.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),n.createElementVNode("div",null,n.toDisplayString(l.value.awayTeam.totalRedCards),1),z[6]||(z[6]=n.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),z[7]||(z[7]=n.createElementVNode("div",{class:"separator"},null,-1)),n.createElementVNode("div",null,n.toDisplayString(l.value.awayTeam.goalsMinutes),1),z[8]||(z[8]=n.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))])):n.createCommentVNode("",!0)])])):(n.openBlock(),n.createElementBlock("div",E_e,[n.createElementVNode("div",R_e,[n.createElementVNode("div",M_e,[l.value.homeTeam.logo?(n.openBlock(),n.createElementBlock("div",W_e,[n.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,j_e)])):(n.openBlock(),n.createElementBlock("svg",K_e,[n.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:r.value.homeTeam,opacity:r.value.opacity},null,8,A_e)])),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",I_e,n.toDisplayString(h.value[0]),1)):n.createCommentVNode("",!0)]),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",X_e,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value.homeTeam.goalsEvents,(O,C)=>(n.openBlock(),n.createElementBlock("div",{key:`goal-${C}`,class:"goal"},[n.createElementVNode("div",null,n.toDisplayString(O.playerName),1),z[9]||(z[9]=n.createElementVNode("div",{class:"bullet"},null,-1)),n.createElementVNode("div",null,n.toDisplayString(O.goalTime),1),z[10]||(z[10]=n.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))]))),128))])):n.createCommentVNode("",!0)]),z[13]||(z[13]=n.createElementVNode("div",{class:"separator"},null,-1)),n.createElementVNode("div",D_e,[n.createElementVNode("div",J_e,[e.isPostMatch?(n.openBlock(),n.createElementBlock("div",G_e,n.toDisplayString(h.value[1]),1)):n.createCommentVNode("",!0),l.value.awayTeam.logo?(n.openBlock(),n.createElementBlock("div",B_e,[n.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,Z_e)])):(n.openBlock(),n.createElementBlock("svg",H_e,[n.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:r.value.awayTeam,opacity:r.value.opacity},null,8,Y_e)]))]),e.isPostMatch?(n.openBlock(),n.createElementBlock("div",Q_e,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value.awayTeam.goalsEvents,(O,C)=>(n.openBlock(),n.createElementBlock("div",{key:`goal-a-${C}`,class:"goal"},[z[11]||(z[11]=n.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),n.createElementVNode("div",null,n.toDisplayString(O.goalTime),1),z[12]||(z[12]=n.createElementVNode("div",{class:"bullet"},null,-1)),n.createElementVNode("div",null,n.toDisplayString(O.playerName),1)]))),128))])):n.createCommentVNode("",!0)])]))],4))}},eSe=jd($_e,[["__scopeId","data-v-6680cbcf"]]),tSe={class:"table-category-filters"},rSe={key:0,class:"custom-radio-group filter-inline"},nSe={class:"radio-label"},aSe={class:"radio-options"},iSe=["name","value","onUpdate:modelValue","onClick"],oSe=["data-filter-type","onClick","onMousedown","onMouseup"],sSe={class:"select-display"},lSe={class:"select-label"},cSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},uSe={class:"simple-select-scroll-area"},dSe=["onClick"],pSe={class:"option-content"},hSe={class:"option-title"},fSe={key:0,class:"option-checkmark"},mSe={key:2,class:"filter-separator"},ySe={__name:"TableCategoryFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:13}},emits:["filters-changed","filter-updated"],setup(e,{expose:a,emit:i}){const k=e,W=i,g=n.ref([]);let m=null;const r=(b,x)=>{if(!x)return!0;for(let T=0;T<b.length;T++)if(!h(b[T],x[T]))return!0;return!1},h=(b,x)=>{if(Array.isArray(b)&&Array.isArray(x)){if(b.length!==x.length)return!1;for(let T=0;T<b.length;T++)if(b[T]!==x[T])return!1;return!0}return b===x},l=n.ref(null),t=n.ref([]);let _=!1,w=null;const v=()=>{w=null},f=()=>{setTimeout(()=>{_=!1},1e3)},o=(b,x=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const T=k.filters[0].options,N=k.filters[1].options;b!=null?T.findIndex(V=>V.value===b)!==-1&&N[b]?(t.value=N[b],x&&!(()=>{const V=g.value[1];return V==null?!1:Array.isArray(V)?V.length>0:V!==""})()&&!_&&t.value.length>0&&(g.value[1]=t.value[0].value,n.nextTick(()=>{}))):(t.value=[],g.value[1]=null):(t.value=[],g.value[1]=null)}},s=()=>{k.initialValues&&k.initialValues.length>0?g.value=[...k.initialValues]:g.value=k.filters.map(b=>{var x,T,N,V;return b.type==="select"?[]:b.type==="check"?!1:b.type==="radio-button"?((T=(x=b.options)==null?void 0:x[0])==null?void 0:T.value)||null:b.type==="select-simple"&&((V=(N=b.options)==null?void 0:N[0])==null?void 0:V.value)||null}),k.componentId===13&&g.value.some(b=>b!=null&&(Array.isArray(b)?b.length>0:b!==!1&&b!==""))&&(m=[...g.value],W("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};s(),setTimeout(()=>{n.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!_){const b=!(()=>{const x=g.value[1];return x==null?!1:Array.isArray(x)?x.length>0:x!==""})();o(g.value[0],b)}})},300),n.watch(()=>k.initialValues,b=>{const x=!h(g.value,b),T=b&&b.length>0&&!_&&x,N=k.isEditMode&&_;T&&!N?g.value=[...b]:_?w&&w.length>0&&(g.value=[...w]):N&&w&&w.length>0&&(g.value=[...w])},{deep:!0}),n.watch(()=>k.isEditMode,(b,x)=>{x===!0&&b===!1&&v()},{immediate:!0}),n.watch(g,(b,x)=>{b.some(T=>T!=null&&(Array.isArray(T)?T.length>0:T!==!1&&T!==""))&&r(b,m)&&(m=[...b],W("filters-changed",{componentId:k.componentId,filters:b,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),n.watch(()=>g.value[0],(b,x)=>{b!==x&&x!==void 0?o(b,!0):x===void 0&&b!==null&&b!==void 0&&o(b,!1)},{immediate:!0}),n.watch(()=>g.value,(b,x)=>{k.filters.map((T,N)=>T.type==="radio-button"?N:-1).filter(T=>T!==-1).forEach(T=>{})},{deep:!0}),n.watch(t,()=>{},{deep:!0});const p=b=>{l.value===b?l.value=null:l.value=b},c=(b,x)=>{if(_=!0,f(),g.value[b]=x,(b===0||b===1)&&(w=[...g.value]),l.value=null,b===0){g.value[1]!==void 0&&(g.value[1]=null);const T=_;_=!1,o(x,!0),_=T,g.value[1]!==null&&g.value[1]!==void 0&&(w=[...g.value])}},d=()=>{_=!0,setTimeout(()=>{_=!1},1e3)};return a({getCurrentValues:()=>g.value,initializeValues:s}),(b,x)=>(n.openBlock(),n.createElementBlock("div",tSe,[e.filters&&e.filters.length>0?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.filters,(T,N)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:N},[T.type==="radio-button"?(n.openBlock(),n.createElementBlock("div",rSe,[n.createElementVNode("div",nSe,n.toDisplayString(T.label),1),n.createElementVNode("div",aSe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(T.options,V=>(n.openBlock(),n.createElementBlock("label",{key:V.value,class:n.normalizeClass(["radio-option-card",{active:g.value[N]===V.value}])},[n.withDirectives(n.createElementVNode("input",{type:"radio",name:"table-radio-"+N,value:V.value,"onUpdate:modelValue":U=>g.value[N]=U,onChange:x[0]||(x[0]=()=>{d()}),onClick:U=>console.log("Click en radio button",N,V.value,"Valor actual:",g.value[N])},null,40,iSe),[[n.vModelRadio,g.value[N]]]),n.createElementVNode("span",null,n.toDisplayString(V.label),1)],2))),128))])])):T.type==="select-simple"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":T.type,onClick:n.withModifiers(V=>p(N),["stop"]),onMousedown:V=>console.log("Mouse down en selector",N),onMouseup:V=>console.log("Mouse up en selector",N)},[n.createElementVNode("div",sSe,[x[2]||(x[2]=n.createElementVNode("span",{class:"select-icon select-analisis-icon"},[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),n.createElementVNode("span",lSe,n.toDisplayString(T.label||"Tipo de análisis"),1),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:l.value===N}])},[...x[1]||(x[1]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===N?(n.openBlock(),n.createElementBlock("div",cSe,[n.createElementVNode("div",uSe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N===1?t.value:T.options,V=>(n.openBlock(),n.createElementBlock("div",{key:V.value,class:n.normalizeClass(["option-card simple-select-option",{active:h(g.value[N],V.value)}]),onClick:n.withModifiers(U=>c(N,V.value),["stop"])},[n.createElementVNode("div",pSe,[n.createElementVNode("div",hSe,n.toDisplayString(V.label),1)]),h(g.value[N],V.value)?(n.openBlock(),n.createElementBlock("div",fSe,[...x[3]||(x[3]=[n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):n.createCommentVNode("",!0)],10,dSe))),128))])])):n.createCommentVNode("",!0)],40,oSe)):n.createCommentVNode("",!0),N===1&&e.filters.length>2?(n.openBlock(),n.createElementBlock("div",mSe)):n.createCommentVNode("",!0)],64))),128))],2)):n.createCommentVNode("",!0)]))}},gSe=jd(ySe,[["__scopeId","data-v-9d00f072"]]),vSe={class:"strengths-filters"},bSe={key:0,class:"custom-radio-group filter-inline"},xSe={class:"radio-label"},wSe={class:"radio-options"},_Se=["name","value","onUpdate:modelValue"],SSe={class:"filter-inline select-with-label"},TSe=["data-filter-type","onClick"],kSe={class:"select-display"},LSe={class:"select-label"},NSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},VSe={class:"simple-select-scroll-area"},OSe=["onClick"],qSe={class:"option-content"},USe={class:"option-title"},zSe={key:0,class:"option-checkmark"},CSe={key:2,class:"filter-separator"},PSe={__name:"StrengthsFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:15}},emits:["filters-changed","filter-updated"],setup(e,{expose:a,emit:i}){const k=e,W=i,g=n.ref([]);let m=null;const r=n.ref(null),h=n.ref([]);let l=!1,t=null;const _=(p,c)=>{if(Array.isArray(p)&&Array.isArray(c)){if(p.length!==c.length)return!1;for(let d=0;d<p.length;d++)if(p[d]!==c[d])return!1;return!0}return p===c},w=(p,c=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const d=k.filters[0].options,b=k.filters[1].options;p!=null?d.findIndex(x=>x.value===p)!==-1&&b[p]?(h.value=b[p],c&&!(()=>{const x=g.value[1];return x==null?!1:Array.isArray(x)?x.length>0:x!==""})()&&!l&&h.value.length>0&&(g.value[1]=h.value[0].value,n.nextTick(()=>{}))):(h.value=[],g.value[1]=null):(h.value=[],g.value[1]=null)}},v=()=>{if(k.initialValues&&k.initialValues.length>0){const c=k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",c),c?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",k.initialValues),g.value=[...k.initialValues]):k.isEditMode?g.value=k.filters.map((d,b)=>{var x,T,N,V,U,z,O,C,q,L;const P=k.initialValues[b];if(console.log(`StrengthsFilters initializeValues - filter[${b}]:`,d==null?void 0:d.type,"filterData:",P),!P)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${b}, usando valor por defecto`),d.type==="select"?[]:d.type==="check"?!1:d.type==="radio-button"?((T=(x=d.options)==null?void 0:x[0])==null?void 0:T.value)||null:d.type==="select-simple"&&((V=(N=d.options)==null?void 0:N[0])==null?void 0:V.value)||null;if(d.type==="radio-button"&&P.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",P.selectedOption,"index:",b);const S=P.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",S),S}else{if(d.type==="radio-button"&&!P.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",P,"index:",b),P.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",P.selectedValue),P.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((z=(U=d.options)==null?void 0:U[0])==null?void 0:z.value)||null);if(d.type==="select-simple"&&P.selectedValue!==void 0)return Array.isArray(P.selectedValue)?P.selectedValue[0]:P.selectedValue;if(d.type==="select"&&P.selectedOptions)return P.selectedOptions.map(S=>S.value);if(d.type==="check"&&P.isChecked!==void 0)return P.isChecked}return P.selectedValue!==void 0?P.selectedValue:d.type==="select"?[]:d.type==="check"?!1:d.type==="radio-button"?((C=(O=d.options)==null?void 0:O[0])==null?void 0:C.value)||null:d.type==="select-simple"&&((L=(q=d.options)==null?void 0:q[0])==null?void 0:L.value)||null}):g.value=[...k.initialValues]}else g.value=k.filters.map(c=>{var d,b,x,T;return c.type==="select"?[]:c.type==="check"?!1:c.type==="radio-button"?((b=(d=c.options)==null?void 0:d[0])==null?void 0:b.value)||null:c.type==="select-simple"&&((T=(x=c.options)==null?void 0:x[0])==null?void 0:T.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",g.value);const p=g.value.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",p),p&&(m=[...g.value],W("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};v(),setTimeout(()=>{n.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!l){const p=!(()=>{const c=g.value[1];return c==null?!1:Array.isArray(c)?c.length>0:c!==""})();w(g.value[0],p)}})},300),n.watch(()=>k.initialValues,(p,c)=>{if(!p||p.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",p),console.log("StrengthsFilters watch initialValues - oldValues:",c),console.log("StrengthsFilters watch initialValues - props.isEditMode:",k.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const d=p.length>0&&(typeof p[0]=="number"||typeof p[0]=="boolean"||p[0]===null||Array.isArray(p[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",d);const b=!_(g.value,p),x=p&&p.length>0&&!l&&b,T=k.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",b,"shouldUpdate:",x,"isEditModeProtection:",T),x&&!T?d?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",p),g.value=[...p]):k.isEditMode?g.value=k.filters.map((N,V)=>{const U=p[V];if(!U)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",V),g.value[V];if(N.type==="radio-button"&&U.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",U.selectedOption,"index:",V);const z=U.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",z),z}else{if(N.type==="select-simple"&&U.selectedValue!==void 0)return Array.isArray(U.selectedValue)?U.selectedValue[0]:U.selectedValue;if(N.type==="select"&&U.selectedOptions)return U.selectedOptions.map(z=>z.value);if(N.type==="check"&&U.isChecked!==void 0)return U.isChecked}return U.selectedValue!==void 0?U.selectedValue:g.value[V]}):g.value=[...p]:l?t&&t.length>0&&(g.value=[...t]):T&&t&&t.length>0&&(g.value=[...t])},{deep:!0}),n.watch(()=>k.isEditMode,(p,c)=>{c===!0&&p===!1&&(t=null)},{immediate:!0}),n.watch(g,p=>{p.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""))&&(()=>{if(!m)return!0;for(let c=0;c<p.length;c++)if(!_(p[c],m[c]))return!0;return!1})()&&(m=[...p],W("filters-changed",{componentId:k.componentId,filters:p,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),n.watch(()=>g.value[0],(p,c)=>{p!==c&&c!==void 0?w(p,!0):c===void 0&&p!==null&&p!==void 0&&w(p,!1)},{immediate:!0});const f=p=>{r.value===p?r.value=null:r.value=p},o=(p,c)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),g.value[p]=c,(p===0||p===1)&&(t=[...g.value]),r.value=null,p===0){g.value[1]!==void 0&&(g.value[1]=null);const d=l;l=!1,w(c,!0),l=d,g.value[1]!==null&&g.value[1]!==void 0&&(t=[...g.value])}},s=()=>{l=!0,setTimeout(()=>{l=!1},400)};return a({getCurrentValues:()=>g.value,initializeValues:v}),(p,c)=>(n.openBlock(),n.createElementBlock("div",vSe,[e.filters&&e.filters.length>0?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.filters,(d,b)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:b},[d.type==="radio-button"?(n.openBlock(),n.createElementBlock("div",bSe,[n.createElementVNode("div",xSe,n.toDisplayString(d.label),1),n.createElementVNode("div",wSe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.options,x=>(n.openBlock(),n.createElementBlock("label",{key:x.value,class:n.normalizeClass(["radio-option-card",{active:g.value[b]===x.value}])},[n.withDirectives(n.createElementVNode("input",{type:"radio",name:"strengths-radio-"+b,value:x.value,"onUpdate:modelValue":T=>g.value[b]=T,onChange:s},null,40,_Se),[[n.vModelRadio,g.value[b]]]),n.createElementVNode("span",null,n.toDisplayString(x.label),1)],2))),128))])])):d.type==="select-simple"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[c[4]||(c[4]=n.createElementVNode("div",{class:"filter-separator"},null,-1)),n.createElementVNode("div",SSe,[c[3]||(c[3]=n.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),n.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":d.type,onClick:n.withModifiers(x=>f(b),["stop"])},[n.createElementVNode("div",kSe,[c[1]||(c[1]=n.createElementVNode("span",{class:"select-icon select-analisis-icon"},[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),n.createElementVNode("span",LSe,n.toDisplayString(d.label||"Tipo de análisis"),1),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:r.value===b}])},[...c[0]||(c[0]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),r.value===b?(n.openBlock(),n.createElementBlock("div",NSe,[n.createElementVNode("div",VSe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.options,x=>(n.openBlock(),n.createElementBlock("div",{key:x.value,class:n.normalizeClass(["option-card simple-select-option",{active:_(g.value[b],x.value)}]),onClick:n.withModifiers(T=>o(b,x.value),["stop"])},[n.createElementVNode("div",qSe,[n.createElementVNode("div",USe,n.toDisplayString(x.label),1)]),_(g.value[b],x.value)?(n.openBlock(),n.createElementBlock("div",zSe,[...c[2]||(c[2]=[n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):n.createCommentVNode("",!0)],10,OSe))),128))])])):n.createCommentVNode("",!0)],8,TSe)])],64)):n.createCommentVNode("",!0),b===1&&e.filters.length>2?(n.openBlock(),n.createElementBlock("div",CSe)):n.createCommentVNode("",!0)],64))),128))],2)):n.createCommentVNode("",!0)]))}},FSe=jd(PSe,[["__scopeId","data-v-4c3876bd"]]),ESe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,W]of a)i[k]=W;return i},RSe={key:1},MSe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},WSe=["fill"],jSe={key:0,class:"checkbox__teams"},KSe={class:"checkbox__teams__logo"},ASe=["src"],ISe={class:"checkbox__teams__logo"},XSe=["src"],DSe={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:a}){const i=e;n.useCssVars(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const k=n.ref(!1),W=n.computed(()=>{const l={color:i.boxValueColor,"font-family":i.fontFamily,height:i.boxWidthAndHeight,width:i.boxWidthAndHeight,minWidth:i.boxWidthAndHeight,"border-radius":i.boxBorderRadius,"margin-top":i.boxMarginTop};return k.value?(l["background-color"]=i.boxBackgroundColor,l.border=`solid ${i.boxBorderWidth} ${i.boxBackgroundColor}`):l.border=`solid ${i.boxBorderWidth} ${i.boxBorderColor}`,l}),g=n.computed(()=>({"font-family":i.boxValueFontFamily,"font-size":i.boxValueFontSize,color:i.boxValueColor,"line-height":1})),m=n.computed(()=>{const l={color:i.labelColor,"font-family":i.fontFamily,"font-size":i.labelFontSize,"white-space":i.labelWhiteSpace,"text-align":i.boxPosition==="top"||i.boxPosition==="bottom"?"center":i.boxPosition};return(i.boxPosition==="left"||i.boxPosition==="right")&&(l[`margin-${i.boxPosition}`]=i.isBoxOnly?"0":i.teamsIds?"8px":"10px"),l});n.watch(()=>i.modelValue,l=>{l!==k.value&&(k.value=l)},{immediate:!0});function r(){i.avoidInteraction||!k.value&&i.avoidToCheck||(k.value=!k.value,a("update:modelValue",k.value))}function h(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,t)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:r},[n.createElementVNode("div",{class:"checkbox__box",style:n.normalizeStyle(W.value)},[k.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[i.boxValue?(n.openBlock(),n.createElementBlock("div",{key:0,class:"checkbox__box__value",style:n.normalizeStyle(g.value)},n.toDisplayString(e.boxValue),5)):(n.openBlock(),n.createElementBlock("div",RSe,[(n.openBlock(),n.createElementBlock("svg",MSe,[n.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,WSe)]))]))],64)):n.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(n.openBlock(),n.createElementBlock("div",jSe,[n.createElementVNode("div",KSe,[n.createElementVNode("img",{src:h(e.teamsIds[0]),alt:""},null,8,ASe)]),n.createElementVNode("div",ISe,[n.createElementVNode("img",{src:h(e.teamsIds[1]),alt:""},null,8,XSe)])])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"checkbox__label",style:n.normalizeStyle(m.value)},n.toDisplayString(e.label),5)],2))}},CL=ESe(DSe,[["__scopeId","data-v-b6f124d8"]]),JSe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,W]of a)i[k]=W;return i},S5={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},PL=()=>{n.useCssVars(e=>({"9d01acb4":e.height,"14e95081":e.borderWidthBtn,"38fec285":e.borderType,34353510:e.borderColor,"20d20dc6":e.borderRadius,17130967:e.width,"4ccb7d36":e.backgroundColor,"5d1e86a2":e.cursorType,ce65d4a2:e.fontSize,fe4ac47a:e.fontStyle,f98e44dc:e.fontFamily,"93b87770":e.marginLeftStat,c7f7beba:e.fontSizeStat}))},FL=S5.setup;S5.setup=FL?(e,a)=>(PL(),FL(e,a)):PL;const GSe=e=>(n.pushScopeId("data-v-f3ee6b2b"),e=e(),n.popScopeId(),e),BSe=["src"],ZSe={key:1,class:"text"},HSe=["src"],YSe={class:"stats"},QSe=GSe(()=>n.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),$Se={class:"numstats"},eTe={class:"leyend"};function tTe(e,a,i,k,W,g){return n.openBlock(),n.createElementBlock("div",null,[i.type==0?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["button",W.status&&i.typeOnOff&&"button-active"]),style:n.normalizeStyle([g.customStyle,W.status&&i.typeOnOff&&g.customActive]),onClick:a[0]||(a[0]=(...m)=>g.btnClick&&g.btnClick(...m))},[i.icon&&i.iconPosition.toLowerCase()==="left"?(n.openBlock(),n.createElementBlock("img",{key:0,class:"icon",style:n.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,BSe)):n.createCommentVNode("",!0),i.textValue?(n.openBlock(),n.createElementBlock("div",ZSe,n.toDisplayString(i.textValue),1)):n.createCommentVNode("",!0),i.icon&&i.iconPosition.toLowerCase()==="right"?(n.openBlock(),n.createElementBlock("img",{key:2,class:"icon",style:n.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,HSe)):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0),i.type==1?(n.openBlock(),n.createElementBlock("div",{key:1,class:"button-target",onClick:a[1]||(a[1]=(...m)=>g.btnClick&&g.btnClick(...m))},[n.createElementVNode("div",YSe,[QSe,n.createElementVNode("div",$Se,n.toDisplayString(i.textStat),1)]),n.createElementVNode("div",eTe,n.toDisplayString(i.textCategory),1)])):n.createCommentVNode("",!0)])}const rTe=JSe(S5,[["render",tTe],["__scopeId","data-v-f3ee6b2b"]]),nTe={class:"gsc-dropdown__main-container__item-selected"},aTe=["height","width"],iTe=["stroke"],oTe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sTe=["fill"],lTe={class:"gsc-dropdown__items-container"},cTe=["onClick"],uTe={key:0,class:"gsc-dropdown__items-footer"},y2={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(a=>a in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listMarginTop:{type:String,default:"0"},listContainerPadding:{type:String,default:"0"},listItemPadding:{type:String,default:"10px 12px"},listItemMargin:{type:String,default:"0"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},listItemBorderRadius:{type:String,default:"0"},listAlignment:{type:String,default:"left"},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1},iconType:{type:Number,default:1,validator:function(e){return[1,2].includes(e)}}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:a}){const i=e,k=n.ref({}),W=n.ref(null),g=n.ref(i.isMultipleOption?-1:0),m=n.ref(!1);n.watch(()=>i.items,(v,f)=>{if(!i.modelValue&&(!i.onlyFirstTime||!f||!f.length)&&v&&v.length){if(i.defaultItemByProp){const o=i.items.findIndex(s=>s[i.defaultItemByProp.propName]===i.defaultItemByProp.value);o!==-1?(g.value=o,k.value=v[o]):(g.value=0,k.value=v[0])}else k.value=v[i.defaultItemByIndex];a("input",k.value)}},{immediate:!0}),n.watch(()=>i.modelValue,v=>{if(v){const f=i.items.findIndex(o=>typeof v=="object"?JSON.stringify(o)===JSON.stringify(v):o===v);f!==-1&&(g.value=f,k.value=i.items[f],a("update:modelValue",k.value))}},{immediate:!0});const r=n.computed(()=>({height:i.height,width:i.width,backgroundColor:i.backgroundColor,borderRadius:`${i.borderRadius}px`,border:`${i.borderType} ${i.borderWidth}px ${i.borderColor}`,color:i.color,"--hover-background-color":i.hoverBackgroundColor,"--list-container-padding":i.listContainerPadding,"--list-item-padding":i.listItemPadding,"--list-item-margin":i.listItemMargin,"--list-background-color":i.listBackgroundColor,"--list-height":i.listHeight,"--list-item-border-radius":i.listItemBorderRadius,"--list-item-selected-color":i.listItemSelectedColor,"--list-item-selected-background-color":i.listItemSelectedBackgroundColor,"--list-item-color":i.listItemColor,"--list-border-radius":`${i.listBorderRadius}`,"--list-border-color":i.listBorderColor,"--list-width":i.isListSameWidth?i.width:"fit-content","--list-border-width":`${i.listBorderWidth}px`,"--list-margin-top":i.listMarginTop,"--list-left":i.listAlignment==="left"?"0":"auto","--list-right":i.listAlignment==="right"?"0":"auto","--footer-border":`${i.footerBorderWidth}px solid ${i.footerBorderColor}`,"--dropdown-opacity":i.isDisabled?"0.5":"1","--dropdown-cursor":i.isDisabled?"not-allowed":"pointer","--dropdown-font-size":i.fontSize?i.fontSize:"14px"})),h=n.computed(()=>({height:`${i.arrowHeight}px`,width:`${i.arrowWidth}px`}));function l(){i.isDisabled||(m.value=!m.value)}function t(v){W.value&&!W.value.contains(v.target)&&(m.value=!1)}function _(v,f){i.isMultipleOption?g.value=-1:(g.value=f,m.value=!1),k.value=v,a("input",k.value),a("update:modelValue",k.value)}function w(){m.value=!1,a("click-ready")}return n.onMounted(()=>{document.addEventListener("click",t)}),n.onBeforeMount(()=>{document.removeEventListener("click",t)}),(v,f)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"dropDown",ref:W,class:"gsc-dropdown",style:n.normalizeStyle(r.value)},[n.createElementVNode("div",{class:"gsc-dropdown__main-container",style:n.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:l},[n.createElementVNode("div",nTe,[n.renderSlot(v.$slots,"default",{selectedItem:k.value})]),n.createElementVNode("div",{class:n.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":m.value}]),style:n.normalizeStyle(h.value)},[e.iconType===1?(n.openBlock(),n.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,iTe)],8,aTe)):(n.openBlock(),n.createElementBlock("svg",oTe,[n.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z",fill:e.arrowColor},null,8,sTe)]))],6)],4),n.createVNode(n.Transition,null,{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("div",lTe,[n.createElementVNode("div",null,[n.createElementVNode("div",{class:"gsc-dropdown__items",style:n.normalizeStyle({"margin-top":`${i.borderWidth}px`})},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.items,(o,s)=>(n.openBlock(),n.createElementBlock("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["gsc-dropdown__items__item",{selected:s===g.value}]),key:s,onClick:p=>_(o,s)},[n.renderSlot(v.$slots,"availableItem",{item:o})],10,cTe)),[[n.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(n.openBlock(),n.createElementBlock("div",uTe,[n.createVNode(n.unref(rTe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:w})])):n.createCommentVNode("",!0)])],512),[[n.vShow,m.value]])]),_:3})],4))}},EL={borderType:"solid",listBackgroundColor:"#2E3B46",listBorderColor:"rgba(255, 255, 255, 0.2)",listBorderRadius:"5px",height:"38px",borderWidth:.8,borderColor:"rgba(255, 255, 255, 0.2)",backgroundColor:"#2E3B46",color:"white",listItemColor:"white",listItemSelectedBackgroundColor:"#2E3B46",arrowColor:"#fff",width:"100%",listHeight:"200px",isListSameWidth:!1,isFooterVisible:!1,hoverBackgroundColor:"#2E3B46",iconType:2},dTe=[{label:"Goles recibidos",value:{name:"Goles recibidos",color:"#336DFF",points:[1,2,3],categories:[40],invert:[57,326,56,60,59,55],negative:!1,translationKey:"chalkboard.defensive.team.goals_received",singleName:"Gol recibido"}},{label:"Tiros a gol recibidos",value:{name:"Tiros a gol recibidos",color:"#7ED321",points:[1,2,3],categories:["510_r"],invert:[510],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Tiros a gol recibidos (portería)",value:{name:"Tiros a gol recibidos (portería)",color:"#990BFF",points:[1,2,3],categories:["537_r","540_r","544_r","547_r"],invert:[537,540,544,547],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Centros totales recibidos",value:{name:"Centros totales recibidos",color:"#FF9226",points:[1,2,3],categories:["13_r","25_r"],invert:[13,25],negative:!1,translationKey:"chalkboard.defensive.team.total_centers_received",singleName:"Centro recibido"}},{label:"Centros acertados por el rival",value:{name:"Centros acertados por el rival",color:"#28A3B2",points:[1,2,3],categories:["98_r","101_r","104_r","105_r","109_r","112_r","115_r","116_r"],invert:[98,101,104,105,109,112,115,116],negative:!1,translationKey:"chalkboard.defensive.team.successful_centers_by_opponent",singleName:"Centro acertado"}},{label:"Fuera de lugar provocados",value:{name:"Fuera de lugar provocados",color:"#00DD00",points:[1,2,3],categories:["33_r"],invert:[33],negative:!1,translationKey:"chalkboard.defensive.team.offsides_caused",singleName:"Fuera de lugar"}},{label:"Balones recuperados (en disputa)",value:{name:"Balones recuperados (en disputa)",color:"#FF3399",points:[1,2,3],categories:[483],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_in_challenge",singleName:"Balón recuperado",isDefaultSelected:!0}},{label:"Balones recuperados (sin disputa)",value:{name:"Balones recuperados (sin disputa)",color:"#B4005A",points:[1,2,3],categories:[484],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_without_challenge",singleName:"Balón recuperado"}},{label:"1 vs 1 exitosos defensivos",value:{name:"1 vs 1 exitosos defensivos",color:"#3A3838",points:[1],categories:[5],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.successful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"1 vs 1 no exitosos defensivos",value:{name:"1 vs 1 no exitosos defensivos",color:"#008B31",points:[1],categories:[209],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.unsuccessful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"Balones ganados en área propia",value:{name:"Balones ganados en área propia",color:"#305496",points:[1,2],categories:[23],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_won_own_penalty_box",singleName:"Balón ganado"}},{label:"Juego aéreo resto del campo",value:{name:"Juego aéreo resto del campo",color:"#FF8A4C",points:[1,2,3],categories:[24],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.arial_game_rest_pitch",singleName:"Juego aéreo"}},{label:"Barridas",value:{name:"Barridas",color:"#700000",points:[1],categories:[518],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.slide_tackles",singleName:"Barrida"}},{label:"Rechaces",value:{name:"Rechaces",color:"#CC0000",points:[1,2,3],categories:[34],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.clearances",singleName:"Rechace"}}],pTe=[{label:"Goles",value:{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}},{label:"Tiros a gol",value:{name:"Tiros a gol",color:"#7ED321",points:[1,2,3],categories:[510],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal",singleName:"Tiro a gol",isDefaultSelected:!1}},{label:"Tiros a gol (portería)",value:{name:"Tiros a gol (portería)",color:"#990BFF",points:[1,2,3],categories:[537,540,544,547],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal_2",singleName:"Tiro a gol (portería)",isDefaultSelected:!1}},{label:"Centros totales",value:{name:"Centros totales",color:"#FF9226",points:[1,2,3],categories:[13,25],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.center_crosses",singleName:"Centro",isDefaultSelected:!1}},{label:"Centros acertados",value:{name:"Centros acertados",color:"#28A3B2",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_center_crosses",singleName:"Centro acertado",isDefaultSelected:!1}},{label:"Balones ganados en área rival",value:{name:"Balones ganados en área rival",color:"#FF0092",points:[1,2],categories:[11],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.balls_won_opponent_penalty_box",singleName:"Balón ganado",isDefaultSelected:!1}},{label:"1vs1 exitosos ofensivos",value:{name:"1vs1 exitosos ofensivos",color:"#3A3838",points:[1],categories:[4],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"1vs1 no exitosos ofensivos",value:{name:"1vs1 no exitosos ofensivos",color:"#008B31",points:[1],categories:[208],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.unsuccessful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"Remates con cabeza",value:{name:"Remates con cabeza",color:"#B4005A",points:[1,2,3],categories:[330,331,333,334,423,424,343,344],invert:[],negative:!1,translationKey:"",singleName:"Remate con cabeza",isDefaultSelected:!1}},{label:"Balón perdido en disputa",value:{name:"Balón perdido en disputa",color:"#9C08B0",points:[1,2,3],categories:[494],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido en disputa",isDefaultSelected:!1}},{label:"Balón perdido sin disputa",value:{name:"Balón perdido sin disputa",color:"#700000",points:[1,2,3],categories:[495],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido sin disputa",isDefaultSelected:!1}}],hTe={class:"last-touch"},fTe={class:"selected-item"},mTe={class:"available-item"},yTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gTe={class:"selected-item"},vTe={class:"available-item"},bTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xTe={key:1},wTe={class:"selected-item"},_Te={class:"available-item"},STe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},TTe={class:"last-touch__how-many-games"},kTe={class:"selected-item"},LTe={class:"available-item"},NTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},VTe={__name:"FilterLastTouch",props:{viewConfig:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},defaultFilters:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!0}},emits:["change","remove-views"],setup(e,{emit:a}){const i=e,k=a,W=n.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),g=n.ref({id:0,name:"Fases de juego",value:null}),m=n.ref(!1),r=n.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),h=n.ref(i.defaultFilters?null:r.value[0]),l=n.ref(null),t=n.computed(()=>({...EL})),_=n.computed(()=>({...EL,isFooterVisible:!i.isEditMode,isMultipleOption:!i.isEditMode})),w=n.computed(()=>{const K=[];return v.value.options.forEach(X=>{X.forEach(D=>{K.push(D)})}),K}),v=n.ref(null),f=n.ref(null),o=n.ref(null),s=n.ref(null);n.watch(()=>i.viewConfig,K=>{K.filters&&(v.value||p(),f.value||c(),o.value||d(),s.value||N())},{immediate:!0});function p(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="categories");K&&K.options&&(v.value={label:K.label,options:Object.entries(K.options).reduce((X,[D,H])=>(X.set(Number(D),H),X),new Map)})}v.value={label:"Tipo de jugada",options:new Map([[2,pTe],[3,dTe]])}}function c(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="gamePhases");if(K){f.value={label:K.label,options:K.options};return}}f.value={label:"Fases de juego",options:W.value}}function d(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="teamRadios");if(K){o.value={options:K.options},q(null,K.options[0]);return}}o.value={label:"Equipo",options:i.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},q(null,o.value.options[0])}const b=n.ref(i.defaultFilters?null:o.value.options[0]),x=n.ref(i.defaultFilters?null:f.value.options[0]),T=n.ref(i.defaultFilters?null:v.value.options.get(x.value.value)[0]);function N(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="assistZoneCheckbox");if(K){s.value={label:K.label},L(K.value);return}}s.value={label:"Zona de asistencia"}}const V=n.computed(()=>{const K={selectedGamePhase:x.value,selectedTeam:b.value,isAssistZoneVisible:m.value,howManyGamesSelected:h.value};return i.isEditMode?(K.selectedCategory=T.value,K.totalCategoriesSelected=1):(K.selectedCategories=l.value,K.totalCategoriesSelected=0,v.value.options.forEach(X=>{X.forEach(D=>{D.isSelected&&(K.totalCategoriesSelected+=1)})})),K}),U=n.computed(()=>x.value?v.value.options.get(x.value.value)||[]:[]);n.watch(()=>V.value,K=>{z()&&(console.log("before emit change:",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}),k("change",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}))},{deep:!0});function z(){return x.value&&(i.isEditMode&&T.value||!i.isEditMode&&l.value&&l.value.length)&&b.value&&h.value}function O(K){x.value=K,S(null)}function C(K){b.value=K}function q(K,X){console.log("onChangeRadio:",X.value)}function L(K){m.value=K}function P(K){h.value=K}function S(K){T.value=K}function F(K,X){X.isSelected=K,l.value=w.value.filter(D=>D.isSelected)}function R(){i.defaultFilters&&(m.value=i.defaultFilters.isAssistZoneVisible,h.value=r.value.find(K=>K.value===i.defaultFilters.howManyGamesSelected.value)||r.value[0],x.value=f.value.options.find(K=>K.value===i.defaultFilters.selectedGamePhase.value)||f.value.options[0],b.value=o.value.options.find(K=>K.value===(i.defaultFilters.isHomeTeam?1:2))||o.value.options[0],T.value=v.value.options.get(x.value.value).find(K=>K.value.name===i.defaultFilters.selectedCategory.name)||v.value.options.get(x.value.value)[0])}function j(){U.value.forEach(K=>{K.isSelected=!1}),m.value=!1,h.value=r.value[0],x.value=null,b.value=null,T.value=null,l.value=null}return n.onBeforeUnmount(()=>{j()}),n.onMounted(()=>{setTimeout(()=>{R()},500)}),(K,X)=>(n.openBlock(),n.createElementBlock("div",hTe,[n.createVNode(n.unref(y2),n.mergeProps(t.value,{items:f.value.options,"model-value":x.value,"onUpdate:modelValue":O}),{default:n.withCtx(()=>[n.createElementVNode("div",fTe,[X[0]||(X[0]=n.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),n.createElementVNode("div",null,n.toDisplayString(x.value?x.value.label:f.value.label||g.value.name),1)])]),availableItem:n.withCtx(({item:D})=>[n.createElementVNode("div",mTe,[n.createElementVNode("div",null,n.toDisplayString(D.label),1),n.createElementVNode("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("svg",yTe,[...X[1]||(X[1]=[n.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[n.vShow,x.value&&x.value.label===D.label]])])])]),_:1},16,["items","model-value"]),n.createVNode(n.unref(y2),n.mergeProps(_.value,{items:U.value,"model-value":T.value,"onUpdate:modelValue":S}),{default:n.withCtx(()=>[n.createElementVNode("div",gTe,[X[2]||(X[2]=n.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),n.createElementVNode("div",null,n.toDisplayString(v.value.label),1)])]),availableItem:n.withCtx(({item:D})=>[n.createElementVNode("div",vTe,[e.isEditMode?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",null,n.toDisplayString(D.label),1),n.createElementVNode("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("svg",bTe,[...X[3]||(X[3]=[n.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[n.vShow,T.value&&T.value.label===D.label]])])],64)):(n.openBlock(),n.createElementBlock("div",xTe,[n.createVNode(n.unref(CL),{"model-value":D.isSelected,label:D.label,"onUpdate:modelValue":H=>F(H,D)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),n.createVNode(n.unref(y2),n.mergeProps(t.value,{items:o.value.options,"model-value":b.value,"onUpdate:modelValue":C}),{default:n.withCtx(()=>[n.createElementVNode("div",wTe,[X[4]||(X[4]=n.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),n.createElementVNode("div",null,n.toDisplayString(b.value?b.value.label:o.value.label),1)])]),availableItem:n.withCtx(({item:D})=>[n.createElementVNode("div",_Te,[n.createElementVNode("div",null,n.toDisplayString(D.label),1),n.createElementVNode("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("svg",STe,[...X[5]||(X[5]=[n.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[n.vShow,b.value&&b.value.label===D.label]])])])]),_:1},16,["items","model-value"]),n.createVNode(n.unref(CL),{"model-value":m.value,label:s.value.label,"onUpdate:modelValue":L},null,8,["model-value","label"]),n.withDirectives(n.createElementVNode("div",TTe,[n.createVNode(n.unref(y2),n.mergeProps(t.value,{items:r.value,"model-value":h.value,"onUpdate:modelValue":P}),{default:n.withCtx(()=>[n.createElementVNode("div",kTe,[X[6]||(X[6]=n.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),n.createElementVNode("div",null,n.toDisplayString(h.value?h.value.name:"Seleccione"),1)])]),availableItem:n.withCtx(({item:D})=>[n.createElementVNode("div",LTe,[n.createElementVNode("div",null,n.toDisplayString(D.name),1),n.createElementVNode("div",null,[n.withDirectives((n.openBlock(),n.createElementBlock("svg",NTe,[...X[7]||(X[7]=[n.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[n.vShow,h.value&&h.value.name===D.name]])])])]),_:1},16,["items","model-value"])],512),[[n.vShow,!e.isPostMatch]])]))}},OTe=jd(VTe,[["__scopeId","data-v-4e32834b"]]),qTe={class:"floating-bar"},UTe={class:"tab active"},zTe={class:"select-display"},CTe={class:"select-icon"},PTe=["src"],FTe={key:1,src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png",alt:"icono",class:"option-img-default"},ETe={key:0,class:"select-placeholder select-label"},RTe={key:1,class:"select-label"},MTe={key:0,class:"dropdown-menu field-menu"},WTe=["onClick"],jTe={class:"option-icon"},KTe=["src","data-hover-src"],ATe={class:"option-content"},ITe={class:"option-title"},XTe={key:0,class:"option-description"},DTe={class:"select-display"},JTe={class:"select-icon"},GTe=["src"],BTe=["src"],ZTe={class:"select-label"},HTe={key:0,class:"dropdown-menu type-menu type-menu-grid"},YTe={class:"option-grid"},QTe=["onClick"],$Te={class:"option-grid-title"},e6e={class:"option-grid-icon"},t6e=["src"],r6e={key:1,class:"filter-separator"},n6e=["onClick"],a6e={class:"select-display"},i6e={key:0,class:"badge-categorias"},o6e={key:0,class:"dropdown-menu type-menu multi-select-menu"},s6e={class:"multi-select-scroll-area"},l6e={class:"select-all-checkbox"},c6e=["checked","indeterminate","onChange"],u6e={class:"option-checkbox"},d6e=["checked","onChange"],p6e=["onClick"],h6e={class:"option-title"},f6e={class:"multi-select-footer"},m6e={key:1,class:"custom-radio-group filter-inline"},y6e={class:"radio-label"},g6e={class:"radio-options"},v6e=["name","value","onUpdate:modelValue","disabled","onChange"],b6e={key:2,class:"check-group filter-inline"},x6e=["onUpdate:modelValue","checked"],w6e=["data-filter-type","onClick"],_6e={class:"select-display"},S6e={key:0,class:"dropdown-menu type-menu simple-select-menu"},T6e={class:"simple-select-scroll-area"},k6e=["onMouseenter","onClick"],L6e={class:"option-content"},N6e={class:"option-title"},V6e={key:0,class:"option-checkmark"},O6e={key:4,class:"filter-separator"},q6e=Object.assign({name:"FloatingFiltersBar"},{__name:"filters",props:{token:{type:String,required:!0},view:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!1},filters_edition_mode:{type:Array,default:()=>null}},emits:["filters-changed","close"],setup(e,{expose:a,emit:i}){const k=e,W=i,g=n.ref(new Map),m=n.ref([]);let r=null,h=null,l=null;const t=n.ref(!1),_=n.ref(!1),w=n.ref(!1),v=n.ref(!1),f=n.ref(!1),o=n.ref(!1),s=n.computed(()=>m.value),p=n.ref(null),c=n.computed(()=>s.value[p.value]||null),d=n.computed(()=>{var me;const Ue=((me=c.value)==null?void 0:me.views)||[];return q(Ue)}),b=n.ref(null),x=n.computed(()=>d.value.find(me=>me.id===b.value)||null),T=n.ref([]),N=n.computed(()=>{var me,Ue;return t.value?((me=x.value)==null?void 0:me.filters_edition_mode)||[]:((Ue=x.value)==null?void 0:Ue.filters)||[]});n.watch(t,me=>{me||(_.value=!1)}),n.watch(x,me=>{var Ue,Ee;if(!me){T.value=[];return}const Ke=me.id===6&&k.isPostMatch,nt=me.id===14;if(!Array.isArray(N.value)&&!Ke&&!nt){T.value=[];return}v.value||(Ke||nt?T.value=[]:T.value=N.value.map((at,pt)=>{var wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be,ut,xt,mt,Tt,Ut;if(at.type==="select"){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt){if(tt.selectedOptions&&Array.isArray(tt.selectedOptions))return tt.selectedOptions.map(Qe=>Qe.value);if(tt.selectedValue&&Array.isArray(tt.selectedValue))return tt.selectedValue.length>0&&tt.selectedValue[0]&&typeof tt.selectedValue[0]=="object"?We(tt.selectedValue):tt.selectedValue}}return me.id===4&&at.options&&Array.isArray(at.options)?at.options.map(tt=>tt.value):[]}else if(at.type==="radio-button"){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt&&tt.selectedOption)return tt.selectedOption.value}if(me.id===7&&t.value&&h!=null&&h.view){if(pt===0&&(wt=h.view.componentProps)!=null&&wt.analysisType)return h.view.componentProps.analysisType==="offensive"?1:2;if(pt===1&&((_t=h.view.filterMultiple)==null?void 0:_t.isHomeTeam)!==void 0)return h.view.filterMultiple.isHomeTeam?1:2}return((It=(Mt=at.options)==null?void 0:Mt[0])==null?void 0:It.value)??null}else if(at.type==="select-simple"){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt&&tt.selectedValue!==void 0){let Qe;return me.id===2&&(lt=(Jt=h==null?void 0:h.view)==null?void 0:Jt.filterMultiple)!=null&<.categoryId?Qe=h.view.filterMultiple.categoryId:me.id===1&&(dt=(rt=h==null?void 0:h.view)==null?void 0:rt.filterMultiple)!=null&&dt.category?Qe=h.view.filterMultiple.category:me.id===6&&(Ft=(vt=h==null?void 0:h.view)==null?void 0:vt.filterMultiple)!=null&&Ft.gameNumber?Qe=h.view.filterMultiple.gameNumber:Qe=Array.isArray(tt.selectedValue)?tt.selectedValue[0]:tt.selectedValue,Qe}}if(me.id===2&&t.value&&h!=null&&h.view){if(r&&h.view.id){const tt=r.getComponentDynamicFilters(h.view.id);if(tt&&tt[pt]!==void 0)return tt[pt]}if(h.view.filterMultiple){if(at.type==="select-simple"&&h.view.filterMultiple.categoryId){const tt=h.view.filterMultiple.categoryId;return(at.options||[]).find(Qe=>Qe.value==tt),tt}if(at.type==="radio-button"&&h.view.filterMultiple.teamType!==void 0){const tt=h.view.filterMultiple.teamType;return(at.options||[]).find(Qe=>Qe.value==tt),tt}}}if(me.id===1&&t.value&&(Vt=h==null?void 0:h.view)!=null&&Vt.filterMultiple&&h.view.filterMultiple.category){const tt=h.view.filterMultiple.category;return(at.options||[]).find(Qe=>Qe.value==tt),tt}if(me.id===9&&t.value&&(it=h==null?void 0:h.view)!=null&&it.filterMultiple&&at.type==="select-simple"&&h.view.filterMultiple.categoryIds){const tt=Array.isArray(h.view.filterMultiple.categoryIds)?h.view.filterMultiple.categoryIds:[h.view.filterMultiple.categoryIds],Qe=(at.options||[]).filter(kt=>Array.isArray(kt.value)?Fe(kt.value,tt):tt.includes(kt.value));return Qe.length>0?Qe[0].value:tt}if(me.id===6&&t.value&&(ct=h==null?void 0:h.view)!=null&&ct.filterMultiple&&h.view.filterMultiple.gameNumber){const tt=h.view.filterMultiple.gameNumber;return(at.options||[]).find(Qe=>Qe.value==tt),tt}if(me.id===5&&t.value&&(Be=h==null?void 0:h.view)!=null&&Be.filterMultiple&&h.view.filterMultiple.isHomeTeam!==void 0){const tt=h.view.filterMultiple.isHomeTeam;let Qe;if(typeof tt=="boolean"?Qe=tt?1:2:typeof tt=="number"?Qe=tt===1?1:2:Qe=1,(at.options||[]).find(kt=>kt.value==Qe),at.type==="radio-button"&&(at.label==="Equipo"||at.label==="Team"||at.label==="Equipo seleccionado"))return Qe}if(me.id===15&&t.value&&(ut=h==null?void 0:h.view)!=null&&ut.filterMultiple&&h.view.filterMultiple.isHomeTeam!==void 0&&at.type==="radio-button"&&pt===0){const tt=h.view.filterMultiple.isHomeTeam;let Qe;if(typeof tt=="boolean"?Qe=tt?1:2:typeof tt=="number"?Qe=tt===1?1:2:Qe=1,(at.options||[]).find(kt=>kt.value==Qe))return Qe}if(me.id===9&&t.value&&(xt=h==null?void 0:h.view)!=null&&xt.filterMultiple&&at.type==="radio-button"&&h.view.filterMultiple.isHomeTeam!==void 0){const tt=h.view.filterMultiple.isHomeTeam?1:2,Qe=((mt=at.options)==null?void 0:mt.map(kt=>kt.value))||[];return Qe.includes(tt)?tt:Qe[0]||1}return((Ut=(Tt=at.options)==null?void 0:Tt[0])==null?void 0:Ut.value)??null}else if(at.type==="check"){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt&&tt.isChecked!==void 0)return tt.isChecked}if(me.id===8)return!0;if(me.id===3){if(t.value&&l&&l.dynamicFilters){const tt=l.dynamicFilters[pt];if(tt&&tt.isChecked!==void 0)return tt.isChecked}return!1}return!1}return null}),!((Ue=me.name)!=null&&Ue.toLowerCase().includes("tops players")||(Ee=me.title)!=null&&Ee.toLowerCase().includes("tops players"))&&(!t.value||Ke)&&n.nextTick(()=>{var at,pt;me.id===4&&t.value&&(at=h==null?void 0:h.view)!=null&&at.id&&r&&r.setDynamicFilters(T.value,h.view.id),me.id===3&&t.value&&(pt=h==null?void 0:h.view)!=null&&pt.id&&r&&r.setDynamicFilters(T.value,h.view.id),ae()}))},{immediate:!0}),n.watch(()=>r,me=>{me&&me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&(v.value=!0,T.value=[...me.dynamicFilters],n.nextTick(()=>{v.value=!1}))},{deep:!0}),n.watch(()=>r==null?void 0:r.dynamicFilters,me=>{if(me&&Array.isArray(me)){if(f.value)return;v.value=!0,T.value=[...me],n.nextTick(()=>{v.value=!1})}},{deep:!0}),n.watch(()=>x.value,me=>{if(t.value&&l&&me&&me.filters){if(v.value||o.value)return;if(me.id===3){if(f.value||o.value)return;const Ue=l.dynamicFilters.find(Ee=>Ee.filterType==="check");Ue&&Ue.isChecked!==void 0&&T.value&&T.value.length>0&&(f.value=!0,T.value[0]=Ue.isChecked,n.nextTick(()=>{T.value=[...T.value],f.value=!1}))}setTimeout(()=>{(!T.value||T.value.length===0)&&(Je(),Pe(),ve()),me.id===4&&Ce()},100)}},{deep:!0}),n.watch(()=>{var me;return(me=x.value)==null?void 0:me.id},me=>{if(t.value&&l&&me===4){if(v.value||o.value)return;setTimeout(()=>{Ce()},200)}}),n.watch(()=>T.value,me=>{if(t.value&&l&&me&&me.length>0){if(v.value||f.value||o.value)return;setTimeout(()=>{var Ue;ke()&&(Je(),Pe(),ve(),((Ue=x.value)==null?void 0:Ue.id)===4&&Ce())},50)}},{deep:!0});function V(me,Ue){var Ee,Ke,nt,at,pt;const wt=T.value[me];if((Ee=x.value)==null||Ee.id,(Ke=x.value)==null||Ke.id,Array.isArray(wt)){if(((nt=x.value)==null?void 0:nt.id)===4&&me===0){const _t=wt.some(Mt=>{if(Ue.category_id&&Ue.event_type_id){if(Mt.category_id&&Mt.event_type_id)return Mt.category_id===Ue.category_id&&Mt.event_type_id===Ue.event_type_id;if(Mt.event_type_id&&!Mt.category_id)return Mt.event_type_id===Ue.event_type_id;if(Mt.category_id&&!Mt.event_type_id)return Mt.category_id===Ue.category_id}else{if(Ue.event_type_id)return Mt.event_type_id===Ue.event_type_id;if(Ue.category_id)return Mt.category_id===Ue.category_id}return JSON.stringify(Mt)===JSON.stringify(Ue)});return(at=x.value)==null||at.id,_t}return wt.includes(Ue)}else if(wt!=null)return(pt=x.value)==null||pt.id,wt===Ue;return!1}function U(me,Ue){var Ee,Ke,nt;const at=(Ke=(Ee=x.value)==null?void 0:Ee.filters)==null?void 0:Ke[me];if((at==null?void 0:at.type)==="select-simple"){ie(me,Ue);return}Array.isArray(T.value[me])||(T.value[me]=[]);const pt=T.value[me];let wt=-1;((nt=x.value)==null?void 0:nt.id)===4&&me===0?wt=pt.findIndex(_t=>Ue.category_id&&Ue.event_type_id?_t.category_id===Ue.category_id&&_t.event_type_id===Ue.event_type_id:Ue.event_type_id?_t.event_type_id===Ue.event_type_id:Ue.category_id?_t.category_id===Ue.category_id:!1):wt=pt.indexOf(Ue),wt>-1?pt.splice(wt,1):pt.push(Ue),t.value&&qe(),ae()}function z(me){var Ue,Ee;const Ke=T.value[me],nt=(Ee=(Ue=x.value)==null?void 0:Ue.filters)==null?void 0:Ee[me];return(nt==null?void 0:nt.type)==="select-simple"||!nt||!nt.options||!Array.isArray(Ke)?!1:Ke.length===nt.options.length}function O(me){var Ue,Ee;const Ke=T.value[me],nt=(Ee=(Ue=x.value)==null?void 0:Ue.filters)==null?void 0:Ee[me];return(nt==null?void 0:nt.type)==="select-simple"||!nt||!nt.options||!Array.isArray(Ke)?!1:Ke.length>0&&Ke.length<nt.options.length}function C(){var me;return!(((me=x.value)==null?void 0:me.id)===6&&k.isPostMatch)}function q(me){return!me||!Array.isArray(me)?me:me.filter(Ue=>{const Ee=(Ue.name||Ue.title||"").toLowerCase();return k.isPostMatch?k.isPostMatch?!["fortalezas"].some(Ke=>Ee.includes(Ke)):!0:!["resumen general","timeline","datos relevantes"].some(Ke=>Ee.includes(Ke))})}function L(){var me,Ue;const Ee=((Ue=(me=c.value)==null?void 0:me.name)==null?void 0:Ue.toLowerCase())||"";return Ee.includes("cancha")||Ee.includes("volumétrica")||Ee.includes("volumetric")}function P(me,Ue){if(!t.value||!L())return!1;const Ee=String(me||"").toLowerCase(),Ke=String(Ue||"").toLowerCase();return Ee.includes("ambos")||Ke.includes("ambos")}function S(me){var Ue,Ee;const Ke=(Ee=(Ue=x.value)==null?void 0:Ue.filters)==null?void 0:Ee[me];if(!Ke||!Ke.options)return;const nt=Ke.options.map(at=>at.value);Array.isArray(T.value[me])||(T.value[me]=[]),z(me)?T.value[me]=[]:T.value[me]=[...nt],K.value=me,ae()}const F=n.ref("ambos"),R=n.ref(!1),j=n.ref(!1),K=n.ref(null),X=n.ref(null);function D(me,Ue=!1){const Ee="https://golstatsimages.blob.core.windows.net/images-library/",Ke="https://golstatsimages.blob.core.windows.net/reports-images/",nt={cancha:"icn_cancha",grafico:"icn_grafico",gráfico:"icn_grafico",chart:"icn_grafico",volumetrica:"icn_cancha",volumétrica:"icn_cancha",volumetric:"icn_cancha",tabla:"icn_tabla",tablas:"icn_tabla",Tablas:"icn_tabla"},at=Object.keys(nt).find(pt=>me==null?void 0:me.toLowerCase().includes(pt.toLowerCase()));if(at){const pt=nt[at],wt=Ue?"":"-def";return at.toLowerCase().includes("tabla")?`${Ke}${pt}${wt}@2x.png`:`${Ee}${pt}${wt}@2x.png`}return`${Ee}icn_default${Ue?"":"-def"}.png`}function H(){return c.value?c.value.name:"Tipo de vista"}function ne(){return x.value?x.value.name||x.value.title:"Visualización"}function G(){t.value||(R.value=!R.value,R.value&&(j.value=!1,n.nextTick(()=>{Oe()})))}function re(){t.value||c.value&&(j.value=!j.value,j.value&&(R.value=!1))}function ee(me){t.value||(p.value=me,R.value=!1,b.value=null,ae())}function Y(me){var Ue,Ee;t.value||(b.value=me.id,j.value=!1,(Ue=me.name)!=null&&Ue.toLowerCase().includes("tops players")||(Ee=me.title)==null||Ee.toLowerCase().includes("tops players"))}function $(me){var Ue;K.value=K.value===me?null:me,((Ue=x.value)==null?void 0:Ue.id)===4&&t.value&&me===0&&setTimeout(()=>{T.value=[...T.value]},50)}function le(me){X.value=X.value===me?null:me}function ie(me,Ue){var Ee,Ke,nt,at,pt;if(((Ee=x.value)==null?void 0:Ee.id)===2){const wt=N.value.findIndex(_t=>_t.type==="select-simple"&&_t.label==="Tipo de análisis");me===wt?T.value[0]=Ue:T.value[me]=Ue}else if(((Ke=x.value)==null?void 0:Ke.id)===1)T.value[0]=Ue;else if(((nt=x.value)==null?void 0:nt.id)===6)T.value[0]=Ue;else if(((at=x.value)==null?void 0:at.id)===9)if(me===0){Array.isArray(Ue)?T.value[me]=Ue:T.value[me]=[Ue];const wt=((pt=N.value[me])==null?void 0:pt.options)||[],_t=Array.isArray(Ue)?Ue:[Ue],Mt=wt.find(It=>Array.isArray(It.value)?Fe(It.value,_t):_t.includes(It.value));Mt?T.value[me]=Mt.value:T.value[me]=_t}else T.value[me]=Ue;else T.value[me]=Ue;X.value=null,t.value&&qe(),ae()}function ue(me){me.target.closest(".custom-select")||(R.value=!1,j.value=!1,X.value=null)}const he=[16];function ae(){var me,Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be,ut;if(he.includes((me=x.value)==null?void 0:me.id)||v.value)return;let xt=[],mt=[];x.value&&Array.isArray(N.value)&&N.value.forEach((Qe,kt)=>{if(Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2){const Wt=T.value[kt]||[];Array.isArray(Wt)&&Wt.length>0&&(xt=Wt.map(Rt=>{var qt;const Ht=(qt=Qe.options)==null?void 0:qt.find(At=>At.value===Rt);return{value:Rt,label:(Ht==null?void 0:Ht.label)||Rt}}))}});const Tt=((Ue=x.value)==null?void 0:Ue.id)===4;if(x.value&&Array.isArray(x.value.filters)&&x.value.filters.some(Qe=>Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2)&&xt.length===0&&!Tt)return;if(Tt&&T.value&&T.value.length>0){const Qe=T.value[0];Array.isArray(Qe)&&Qe.length>0}mt=((Ee=N.value)==null?void 0:Ee.map((Qe,kt)=>{var Wt,Rt,qt,Ht;const At=T.value[kt];let Yt=Qe.id||`filter_${kt}`;return((Wt=x.value)==null?void 0:Wt.id)===3&&t.value&&(Rt=h==null?void 0:h.view)!=null&&Rt.id&&(Yt=`filter_${kt}_component_${h.view.id}`),{filterId:Yt,filterType:Qe.type,filterLabel:Qe.label,filterIcon:Qe.icon||null,selectedValue:At,selectedOptions:Qe.type==="select"&&Array.isArray(At)&&At.length>0?At.map(Gt=>{var Bt;const or=(Bt=Qe.options)==null?void 0:Bt.find(sr=>sr.value===Gt);return{value:Gt,label:(or==null?void 0:or.label)||Gt,icon:(or==null?void 0:or.icon)||null}}):null,selectedOption:Qe.type==="radio-button"&&At!=null?{value:At,label:((Ht=(qt=Qe.options)==null?void 0:qt.find(Gt=>Gt.value===At))==null?void 0:Ht.label)||At}:null,isChecked:Qe.type==="check"?At:null}}))||[];const Ut={mainSelector:{id:((Ke=c.value)==null?void 0:Ke.id)||null,name:((nt=c.value)==null?void 0:nt.name)||null,url:((at=c.value)==null?void 0:at.url)||null},viewSelector:{id:((pt=x.value)==null?void 0:pt.id)||null,name:((wt=x.value)==null?void 0:wt.name)||((_t=x.value)==null?void 0:_t.title)||null,url:((Mt=x.value)==null?void 0:Mt.url)||null},team:F.value,dynamicFilters:mt,categoriasSeleccionadas:xt,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!x.value,totalDynamicFilters:((It=N.value)==null?void 0:It.length)||0,activeFilters:((Jt=N.value)==null?void 0:Jt.filter((Qe,kt)=>{const Wt=T.value[kt];return Array.isArray(Wt)?Wt.length>0:Wt!=null&&Wt!==!1}).length)||0}},tt={main:c.value,view:x.value,team:F.value,dynamicFilters:T.value,filtersJSON:Ut,filterAndViewsContainer:r,viewToEdit:h};if(W("filters-changed",tt),t.value&&h){if(l=Ut,((lt=x.value)==null?void 0:lt.id)===2){const Qe=l.dynamicFilters.findIndex(kt=>kt.filterType==="select-simple"&&kt.filterLabel==="Tipo de análisis");Qe!==-1&&(dt=(rt=h.view)==null?void 0:rt.filterMultiple)!=null&&dt.categoryId&&(l.dynamicFilters[Qe].selectedValue=h.view.filterMultiple.categoryId)}if(((vt=x.value)==null?void 0:vt.id)===1){const Qe=l.dynamicFilters.findIndex(kt=>kt.filterType==="select-simple"&&kt.filterLabel==="Tipo de análisis");Qe!==-1&&(Vt=(Ft=h.view)==null?void 0:Ft.filterMultiple)!=null&&Vt.category&&(l.dynamicFilters[Qe].selectedValue=h.view.filterMultiple.category)}}if(((it=x.value)==null?void 0:it.id)===6&&t.value&&(ct=h==null?void 0:h.view)!=null&&ct.filterMultiple&&h.view.filterMultiple.gameNumber&&l){const Qe=l.dynamicFilters.findIndex(kt=>kt.filterType==="select-simple"&&kt.filterLabel==="Número de juego");Qe!==-1&&(ut=(Be=h.view)==null?void 0:Be.filterMultiple)!=null&&ut.gameNumber&&(l.dynamicFilters[Qe].selectedValue=h.view.filterMultiple.gameNumber)}r&&!t.value?r.setDynamicFilters(T.value):r&&t.value}function de(){h=null,l=null,r=null,p.value=null,b.value=null,F.value="ambos",T.value=[],R.value=!1,j.value=!1,K.value=null,X.value=null,t.value=!1,_.value=!1,w.value=!1}function ce(me){if(me&&me.dynamicFilters){if(f.value)return;Array.isArray(me.dynamicFilters)&&me.dynamicFilters.length>0&&(v.value=!0,T.value=[...me.dynamicFilters],n.nextTick(()=>{v.value=!1}))}}function ye(me){if(t.value=!0,me.mainSelector&&me.mainSelector.id){const Ue=m.value.findIndex(Ee=>Ee.id===me.mainSelector.id);Ue!==-1&&(p.value=Ue)}me.viewSelector&&me.viewSelector.id&&c.value&&c.value.views.findIndex(Ue=>Ue.id===me.viewSelector.id)!==-1&&(b.value=me.viewSelector.id),me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&n.nextTick(()=>{setTimeout(()=>{var Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be,ut,xt,mt;if(x.value&&N.value){if(v.value)return;if(f.value=!0,me.dynamicFilters.forEach((Tt,Ut)=>{var tt,Qe,kt,Wt,Rt,qt,Ht,At,Yt,Gt,Bt,or,sr;if(Ut<N.value.length){const qr=N.value[Ut];if(((tt=x.value)==null?void 0:tt.id)===3&&t.value,qr.type==="check"){const zr=Tt.isChecked;typeof zr=="boolean"&&(T.value[Ut]=zr)}else if(qr.type==="select"&&Tt.selectedOptions){const zr=Tt.selectedOptions.map(Or=>Or.value);T.value[Ut]=zr}else if(qr.type==="select"&&Tt.selectedValue&&Array.isArray(Tt.selectedValue))if(Tt.selectedValue.length>0&&Tt.selectedValue[0]&&typeof Tt.selectedValue[0]=="object"){const zr=We(Tt.selectedValue);T.value[Ut]=zr}else T.value[Ut]=Tt.selectedValue;else if(qr.type==="radio-button"&&Tt.selectedOption)T.value[Ut]=Tt.selectedOption.value;else if(qr.type==="select-simple"&&Tt.selectedValue!==void 0){let zr;((Qe=x.value)==null?void 0:Qe.id)===2&&(Wt=(kt=h==null?void 0:h.view)==null?void 0:kt.filterMultiple)!=null&&Wt.categoryId?zr=h.view.filterMultiple.categoryId:((Rt=x.value)==null?void 0:Rt.id)===1&&(Ht=(qt=h==null?void 0:h.view)==null?void 0:qt.filterMultiple)!=null&&Ht.category?zr=h.view.filterMultiple.category:((At=x.value)==null?void 0:At.id)===6&&(Gt=(Yt=h==null?void 0:h.view)==null?void 0:Yt.filterMultiple)!=null&&Gt.gameNumber?zr=h.view.filterMultiple.gameNumber:((Bt=x.value)==null?void 0:Bt.id)===9&&(sr=(or=h==null?void 0:h.view)==null?void 0:or.filterMultiple)!=null&&sr.categoryIds?zr=h.view.filterMultiple.categoryIds:zr=Array.isArray(Tt.selectedValue)?Tt.selectedValue[0]:Tt.selectedValue,T.value[Ut]=zr}}}),((Ue=x.value)==null?void 0:Ue.id)===3&&t.value,((Ee=x.value)==null?void 0:Ee.id)===2&&t.value&&(Ke=h==null?void 0:h.view)!=null&&Ke.filterMultiple){if(h.view.filterMultiple.categoryId){const Tt=N.value.findIndex(Ut=>Ut.type==="select-simple"&&Ut.label==="Tipo de análisis");if(Tt!==-1){const Ut=h.view.filterMultiple.categoryId;if(T.value[0]=Ut,h.view.componentProps&&Ut){let tt=`Category ${Ut}`,Qe=null;try{Qe=Wh(Ut),Qe&&(tt=Qe.name)}catch{const kt=N.value.findIndex(Wt=>Wt.type==="select-simple"&&Wt.label==="Tipo de análisis");if(kt!==-1){const Wt=(((nt=N.value[kt])==null?void 0:nt.options)||[]).find(Rt=>Rt.value==Ut);Wt&&(tt=Wt.label)}}h.view.componentProps.categoryView=[{id:Ut,name:tt}]}(((at=N.value[Tt])==null?void 0:at.options)||[]).find(tt=>tt.value==Ut),n.nextTick(()=>{T.value=[...T.value]})}}if(h.view.filterMultiple.teamType!==void 0){const Tt=N.value.findIndex(Ut=>Ut.type==="radio-button");if(Tt!==-1){const Ut=h.view.filterMultiple.teamType;T.value[Tt]=Ut,(((pt=N.value[Tt])==null?void 0:pt.options)||[]).find(tt=>tt.value==Ut),n.nextTick(()=>{T.value=[...T.value]})}}}if(((wt=x.value)==null?void 0:wt.id)===9&&t.value&&(_t=h==null?void 0:h.view)!=null&&_t.filterMultiple){if(h.view.filterMultiple.categoryIds){const Tt=N.value.findIndex(Ut=>Ut.type==="select-simple");if(Tt!==-1){const Ut=Array.isArray(h.view.filterMultiple.categoryIds)?h.view.filterMultiple.categoryIds:[h.view.filterMultiple.categoryIds];T.value[0]=Ut;const tt=(((Mt=N.value[Tt])==null?void 0:Mt.options)||[]).filter(kt=>Array.isArray(kt.value)?Fe(kt.value,Ut):Ut.includes(kt.value));if(tt.length>0){const kt=tt[0].value;T.value[Tt]=kt}else T.value[Tt]=Ut;const Qe=T.value[Tt];Fe(Qe,Ut),n.nextTick(()=>{T.value=[...T.value]})}}if(h.view.filterMultiple.isHomeTeam!==void 0){const Tt=N.value.findIndex(Ut=>Ut.type==="radio-button");if(Tt!==-1){const Ut=h.view.filterMultiple.isHomeTeam;let tt;typeof Ut=="boolean"?tt=Ut?1:2:typeof Ut=="number"?tt=Ut===1?1:2:tt=1,T.value[Tt]=tt,(((It=N.value[Tt])==null?void 0:It.options)||[]).find(Qe=>Qe.value==tt),n.nextTick(()=>{T.value=[...T.value]})}}}if(((Jt=x.value)==null?void 0:Jt.id)===1&&t.value&&(lt=h==null?void 0:h.view)!=null&<.filterMultiple&&h.view.filterMultiple.category){const Tt=N.value.findIndex(Ut=>Ut.type==="select-simple"&&Ut.label==="Tipo de análisis");if(Tt!==-1){const Ut=h.view.filterMultiple.category;T.value[0]=Ut,h.view.componentProps&&Ut&&(h.view.componentProps.type=Ut),(((rt=N.value[Tt])==null?void 0:rt.options)||[]).find(tt=>tt.value==Ut),n.nextTick(()=>{T.value=[...T.value]})}}if(((dt=x.value)==null?void 0:dt.id)===6&&t.value&&(vt=h==null?void 0:h.view)!=null&&vt.filterMultiple&&h.view.filterMultiple.gameNumber){const Tt=N.value.findIndex(Ut=>Ut.type==="select-simple"&&Ut.label==="Número de juego");if(Tt!==-1){const Ut=h.view.filterMultiple.gameNumber;T.value[0]=Ut,h.view.componentProps&&Ut&&(h.view.componentProps.gameNumber=Ut),(((Ft=N.value[Tt])==null?void 0:Ft.options)||[]).find(tt=>tt.value==Ut),n.nextTick(()=>{T.value=[...T.value]})}}if(((Vt=x.value)==null?void 0:Vt.id)===7&&t.value&&h!=null&&h.view){if((it=h.view.componentProps)!=null&&it.analysisType&&N.value.length>0&&((ct=N.value[0])==null?void 0:ct.type)==="radio-button"){const Tt=h.view.componentProps.analysisType==="offensive"?1:2;T.value[0]=Tt}if(((Be=h.view.filterMultiple)==null?void 0:Be.isHomeTeam)!==void 0){const Tt=N.value.findIndex(Ut=>Ut.type==="radio-button"&&Ut.label==="Equipo");if(Tt!==-1){const Ut=h.view.filterMultiple.isHomeTeam?1:2;T.value[1]=Ut}else if(N.value.length>1&&((ut=N.value[1])==null?void 0:ut.type)==="radio-button"){const Ut=h.view.filterMultiple.isHomeTeam,tt=Ut?1:2;T.value[1]=tt,h.view.componentProps&&(h.view.componentProps.isHomeTeamForAnalysis=Ut),(((xt=N.value[1])==null?void 0:xt.options)||[]).find(Qe=>Qe.value==tt),n.nextTick(()=>{T.value=[...T.value]})}if(Tt!==-1&&h.view.componentProps){const Ut=h.view.filterMultiple.isHomeTeam,tt=Ut?1:2;h.view.componentProps.isHomeTeamForAnalysis=Ut,(((mt=N.value[Tt])==null?void 0:mt.options)||[]).find(Qe=>Qe.value==tt),n.nextTick(()=>{T.value=[...T.value]})}}}n.nextTick(()=>{f.value=!1})}},100)})}function xe(){var me,Ue,Ee,Ke,nt,at,pt,wt,_t,Mt;return{mainSelector:{id:((me=c.value)==null?void 0:me.id)||null,name:((Ue=c.value)==null?void 0:Ue.name)||null,url:((Ee=c.value)==null?void 0:Ee.url)||null},viewSelector:{id:((Ke=x.value)==null?void 0:Ke.id)||null,name:((nt=x.value)==null?void 0:nt.name)||((at=x.value)==null?void 0:at.title)||null,url:((pt=x.value)==null?void 0:pt.url)||null},team:F.value,dynamicFilters:((wt=N.value)==null?void 0:wt.map((It,Jt)=>{var lt,rt;const dt=T.value[Jt];return{filterId:It.id||`filter_${Jt}`,filterType:It.type,filterLabel:It.label,filterIcon:It.icon||null,selectedValue:dt,selectedOptions:It.type==="select"&&Array.isArray(dt)&&dt.length>0?dt.map(vt=>{var Ft;const Vt=(Ft=It.options)==null?void 0:Ft.find(it=>it.value===vt);return{value:vt,label:(Vt==null?void 0:Vt.label)||vt,icon:(Vt==null?void 0:Vt.icon)||null}}):null,selectedOption:It.type==="radio-button"&&dt?{value:dt,label:((rt=(lt=It.options)==null?void 0:lt.find(vt=>vt.value===dt))==null?void 0:rt.label)||dt}:null,isChecked:It.type==="check"?dt:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!x.value,totalDynamicFilters:((_t=N.value)==null?void 0:_t.length)||0,activeFilters:((Mt=N.value)==null?void 0:Mt.filter((It,Jt)=>{const lt=T.value[Jt];return Array.isArray(lt)?lt.length>0:lt!=null&<!==!1}).length)||0}}}a({getCurrentFiltersJSON:xe});function be(){de(),W("close",r)}function Te(){_.value=!1,be()}function Ve(){w.value&&(Ua.emit("filters-cancelled",r),w.value=!1),_.value=!1,be()}n.onMounted(async()=>{document.addEventListener("click",ue),n.nextTick(()=>{Oe()});const me="https://fb78a14uud.execute-api.us-east-2.amazonaws.com/qa/views";try{const Ue=await(await fetch(me,{headers:{Authorization:`${k.token}`}})).json();m.value=Ue.data||[],g.value.clear(),m.value&&(g.value=m.value.reduce((Ee,Ke)=>(Ke.views&&Array.isArray(Ke.views)&&Ke.views.forEach(nt=>{nt.filters&&Array.isArray(nt.filters)&&Ee.set(nt.id,nt)}),Ee),new Map))}catch(Ue){console.error("Error al obtener datos:",Ue)}});function Oe(){document.querySelectorAll(".field-menu .option-card").forEach(me=>{const Ue=me.querySelector(".option-img");if(!Ue||!Ue.dataset.hoverSrc)return;const Ee=Ue.src,Ke=Ue.dataset.hoverSrc;me.addEventListener("mouseenter",()=>{Ue.src=Ke}),me.addEventListener("mouseleave",()=>{Ue.src=Ee})})}n.onUnmounted(()=>{document.removeEventListener("click",ue)}),Ua.on("set-filter-and-views-container",me=>{r=me,me&&ce(me)}),Ua.on("view-added",()=>{_.value=!0,w.value=!0}),Ua.on("component-added-to-container",me=>{(!t.value||r&&me.id===r.id)&&ce(me)}),Ua.on("edit-view",me=>{var Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be;h=me,r=((Ue=me.view)==null?void 0:Ue.filterAndViewsContainer)||null,l=null;const ut=[(Ke=(Ee=me.view)==null?void 0:Ee.coreView)==null?void 0:Ke.filtersJSON,(nt=me.view)==null?void 0:nt.filtersJSON,(at=me.coreView)==null?void 0:at.filtersJSON,me.filtersJSON,(wt=(pt=me.view)==null?void 0:pt.componentProps)==null?void 0:wt.filtersJSON];for(const xt of ut)if(xt){l=xt;break}if(r&&(r.viewId===4||r.viewId===8||r.viewId===3||r.viewId===1||r.viewId===2||r.viewId===13)&&(_t=me.view)!=null&&_t.id){const xt=r.getComponentDynamicFilters(me.view.id);if(xt){let mt="Unknown";r.viewId===4?mt="Timeline":r.viewId===8?mt="FieldPosesion":r.viewId===3?mt="GSCMatchSummary":r.viewId===1?mt="GSCComparativeReports":r.viewId===2?mt="GscTopPlayer":r.viewId===13&&(mt="GSCTimelapseTable"),l&&(r.viewId===13?l={...l,dynamicFilters:xt}:l={...l,dynamicFilters:xt.map((Tt,Ut)=>Array.isArray(Tt)?{selectedValue:Tt,selectedOptions:Tt.map(tt=>({value:tt,label:tt}))}:typeof Tt=="boolean"?{isChecked:Tt}:mt==="GSCComparativeReports"&&Ut===0?{selectedValue:Tt,selectedOptions:[{value:Tt,label:Tt}]}:mt==="GscTopPlayer"&&Ut===0?{selectedValue:Tt,selectedOptions:[{value:Tt,label:Tt}]}:mt==="GscTopPlayer"&&Ut===1?{selectedOption:{value:Tt,label:Tt}}:{selectedOption:{value:Tt,label:Tt}})})}}if(r&&r.viewId===2&&(Mt=me.view)!=null&&Mt.filterMultiple){if(me.view.filterMultiple.categoryId&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="select-simple"&&mt.filterLabel==="Tipo de análisis");xt!==-1&&(l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:me.view.filterMultiple.categoryId,selectedOptions:[{value:me.view.filterMultiple.categoryId,label:`Category ${me.view.filterMultiple.categoryId}`}]})}if(me.view.filterMultiple.teamType!==void 0&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button");if(xt!==-1){const mt=me.view.filterMultiple.teamType,Tt=mt===1?"Mi equipo":mt===2?"Rival":mt===3?"Ambos":"Equipo";l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:mt,label:Tt}}}}}if(r&&r.viewId===1&&(It=me.view)!=null&&It.filterMultiple&&me.view.filterMultiple.category&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="select-simple"&&mt.filterLabel==="Tipo de análisis");xt!==-1&&(l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:me.view.filterMultiple.category,selectedOptions:[{value:me.view.filterMultiple.category,label:me.view.filterMultiple.category}]})}if(r&&r.viewId===9&&(Jt=me.view)!=null&&Jt.filterMultiple){if(me.view.filterMultiple.categoryIds&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="select"&&mt.filterLabel==="Tipo de análisis");if(xt!==-1){const mt=Array.isArray(me.view.filterMultiple.categoryIds)?me.view.filterMultiple.categoryIds:[me.view.filterMultiple.categoryIds];l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:mt,selectedOptions:mt.map(tt=>({value:tt,label:`Category ${tt}`}))};const Tt=me.view.filterMultiple.categoryIds;Fe(Tt,mt);const Ut=(((lt=N.value[xt])==null?void 0:lt.options)||[]).filter(tt=>Array.isArray(tt.value)?Fe(tt.value,mt):mt.includes(tt.value));if(Ut.length>0){const tt=Ut[0];l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:tt.value,selectedOptions:[tt]}}}}if(me.view.filterMultiple.isHomeTeam!==void 0&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button");if(xt!==-1){const mt=me.view.filterMultiple.isHomeTeam;let Tt,Ut;typeof mt=="boolean"?(Tt=mt?1:2,Ut=mt?"Mi equipo":"Rival"):typeof mt=="number"?(Tt=mt===1?1:2,Ut=mt===1?"Mi equipo":"Rival"):(Tt=1,Ut="Mi equipo"),l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}}}if(r&&r.viewId===6&&(rt=me.view)!=null&&rt.filterMultiple&&me.view.filterMultiple.gameNumber&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="select-simple"&&mt.filterLabel==="Número de juego");xt!==-1&&(l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedValue:me.view.filterMultiple.gameNumber,selectedOptions:[{value:me.view.filterMultiple.gameNumber,label:`Juego ${me.view.filterMultiple.gameNumber}`}]})}if(r&&r.viewId===7&&me.view&&l){if((dt=me.view.componentProps)!=null&&dt.analysisType){const xt=l.dynamicFilters.findIndex((mt,Tt)=>mt.filterType==="radio-button"&&Tt===0);if(xt!==-1){const mt=me.view.componentProps.analysisType,Tt=mt==="offensive"?1:2,Ut=mt==="offensive"?"A favor":"En contra";l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}}if(((vt=me.view.filterMultiple)==null?void 0:vt.isHomeTeam)!==void 0){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button"&&mt.filterLabel==="Equipo");if(xt!==-1){const mt=me.view.filterMultiple.isHomeTeam,Tt=mt?1:2,Ut=mt?"Equipo propio":"Equipo rival";l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}}}if(r&&r.viewId===10&&(Ft=me.view)!=null&&Ft.filterMultiple&&((it=(Vt=h==null?void 0:h.view)==null?void 0:Vt.coreView)==null?void 0:it.id)===10){const xt=me.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:xt})}if(r&&r.viewId===15&&(ct=me.view)!=null&&ct.filterMultiple&&me.view.filterMultiple.isHomeTeam!==void 0&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button"&&mt.filterLabel==="Mi equipo");if(xt!==-1){const mt=me.view.filterMultiple.isHomeTeam;let Tt,Ut;typeof mt=="boolean"?(Tt=mt?1:2,Ut=mt?"Local":"Visitante"):typeof mt=="number"?(Tt=mt===1?1:2,Ut=mt===1?"Local":"Visitante"):(Tt=1,Ut="Local"),l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}else l.dynamicFilters[0]=me.view.filterMultiple.isHomeTeam?1:2,l.dynamicFilters[1]=r.dynamicFilters[1]}if(r&&r.viewId===5&&(Be=me.view)!=null&&Be.filterMultiple&&me.view.filterMultiple.isHomeTeam!==void 0&&l){const xt=l.dynamicFilters.findIndex(mt=>mt.filterType==="radio-button"&&mt.filterLabel==="Equipo");if(xt!==-1){const mt=me.view.filterMultiple.isHomeTeam;let Tt,Ut;typeof mt=="boolean"?(Tt=mt?1:2,Ut=mt?"Equipo propio":"Equipo rival"):typeof mt=="number"?(Tt=mt===1?1:2,Ut=mt===1?"Equipo propio":"Equipo rival"):(Tt=1,Ut="Equipo propio"),l.dynamicFilters[xt]={...l.dynamicFilters[xt],selectedOption:{value:Tt,label:Ut}}}else{const mt=l.dynamicFilters.findIndex(Tt=>Tt.filterType==="radio-button");if(mt!==-1){const Tt=me.view.filterMultiple.isHomeTeam;let Ut,tt;typeof Tt=="boolean"?(Ut=Tt?1:2,tt=Tt?"Equipo propio":"Equipo rival"):typeof Tt=="number"?(Ut=Tt===1?1:2,tt=Tt===1?"Equipo propio":"Equipo rival"):(Ut=1,tt="Equipo propio"),l.dynamicFilters[mt]={...l.dynamicFilters[mt],selectedOption:{value:Ut,label:tt}}}}}l&&ye(l),_.value=!0});function _e(){K.value=null}function ze(me,Ue){var Ee;(Ee=x.value)==null||Ee.id}function Fe(me,Ue){if(!Array.isArray(me)||!Array.isArray(Ue)||me.length!==Ue.length)return!1;const Ee=[...me].sort((nt,at)=>nt-at),Ke=[...Ue].sort((nt,at)=>nt-at);return JSON.stringify(Ee)===JSON.stringify(Ke)}function Je(){if(t.value&&l&&l.dynamicFilters){if(o.value||v.value)return;o.value=!0,f.value=!0,l.dynamicFilters.forEach((me,Ue)=>{var Ee;if(me&&(Ee=N.value)!=null&&Ee[Ue]){const Ke=N.value[Ue];if(Ke.type==="check"&&me.isChecked!==void 0)T.value[Ue]=me.isChecked;else if(Ke.type==="select"&&me.selectedOptions){const nt=me.selectedOptions.map(at=>at.value);T.value[Ue]=nt}else Ke.type==="select"&&me.selectedValue&&Array.isArray(me.selectedValue)&&(T.value[Ue]=me.selectedValue)}}),n.nextTick(()=>{f.value=!1,o.value=!1})}}function Ce(){var me;if(t.value&&l&&l.dynamicFilters&&((me=x.value)==null?void 0:me.id)===4){if(o.value||v.value)return;o.value=!0,f.value=!0,l.dynamicFilters.forEach((Ue,Ee)=>{var Ke,nt;if(Ue&&((nt=(Ke=N.value)==null?void 0:Ke[Ee])==null?void 0:nt.type)==="select"){if(Ue.selectedOptions){const at=Ue.selectedOptions.map(pt=>pt.value);T.value[Ee]=at}else if(Ue.selectedValue&&Array.isArray(Ue.selectedValue))if(Ue.selectedValue.length>0&&Ue.selectedValue[0]&&typeof Ue.selectedValue[0]=="object"){const at=We(Ue.selectedValue);T.value[Ee]=at}else T.value[Ee]=Ue.selectedValue}}),setTimeout(()=>{var Ue;if(T.value=[...T.value],(Ue=h==null?void 0:h.view)!=null&&Ue.componentProps&&T.value&&T.value.length>0){const Ee=T.value[0];if(Array.isArray(Ee)&&Ee.length>0){const Ke=Ee.some(wt=>wt.event_type_id===1||typeof wt=="string"&&wt.includes("1")),nt=Ee.some(wt=>wt.category_id===8||typeof wt=="string"&&wt.includes("8")),at=Ee.some(wt=>wt.category_id===9||typeof wt=="string"&&wt.includes("9")),pt=Ee.some(wt=>wt.event_type_id===3||typeof wt=="string"&&wt.includes("3"));h.view.componentProps.selectedEvents=Ee,h.view.componentProps.goals=Ke,h.view.componentProps.yellowCards=nt,h.view.componentProps.redCards=at,h.view.componentProps.substitutions=pt,h.view.componentProps.key=Ee.length>0,h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps})}}},200),n.nextTick(()=>{f.value=!1,o.value=!1})}}function We(me){return!Array.isArray(me)||me.length===0?[]:me.map(Ue=>{if(Ue&&typeof Ue=="object"){if(Ue.event_type_id!==void 0||Ue.category_id!==void 0)return{event_type_id:Ue.event_type_id,category_id:Ue.category_id,...Ue.name&&{name:Ue.name},...Ue.label&&{label:Ue.label}};if(Ue.value&&typeof Ue.value=="object")return{event_type_id:Ue.value.event_type_id,category_id:Ue.value.category_id,...Ue.value.name&&{name:Ue.value.name},...Ue.value.label&&{label:Ue.value.label}};if(typeof Ue=="string"&&Ue.includes("-")){const[Ee,Ke]=Ue.split("-");return{category_id:parseInt(Ee),event_type_id:parseInt(Ke)}}}if(typeof Ue=="string")if(Ue.includes("-")){const[Ee,Ke]=Ue.split("-");return{category_id:parseInt(Ee),event_type_id:parseInt(Ke)}}else{const Ee=parseInt(Ue);if(!isNaN(Ee))return{event_type_id:Ee}}return Ue})}function Pe(){var me,Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt;if(t.value&&l&&l.dynamicFilters&&N.value){if(o.value||v.value)return;if(o.value=!0,f.value=!0,l.dynamicFilters.forEach((dt,vt)=>{var Ft,Vt,it,ct,Be,ut,xt,mt,Tt,Ut,tt;if(dt&&((Ft=N.value[vt])==null?void 0:Ft.type)==="select"){if(dt.selectedOptions){const Qe=dt.selectedOptions.map(kt=>kt.value);T.value[vt]=Qe}else if(dt.selectedValue&&Array.isArray(dt.selectedValue))if(dt.selectedValue.length>0&&dt.selectedValue[0]&&typeof dt.selectedValue[0]=="object"){const Qe=We(dt.selectedValue);T.value[vt]=Qe}else T.value[vt]=dt.selectedValue}else if(dt&&((Vt=N.value[vt])==null?void 0:Vt.type)==="select-simple"&&dt.selectedValue!==void 0){let Qe;((it=x.value)==null?void 0:it.id)===2&&(Be=(ct=h==null?void 0:h.view)==null?void 0:ct.filterMultiple)!=null&&Be.categoryId?Qe=h.view.filterMultiple.categoryId:((ut=x.value)==null?void 0:ut.id)===1&&(mt=(xt=h==null?void 0:h.view)==null?void 0:xt.filterMultiple)!=null&&mt.category?Qe=h.view.filterMultiple.category:((Tt=x.value)==null?void 0:Tt.id)===6&&(tt=(Ut=h==null?void 0:h.view)==null?void 0:Ut.filterMultiple)!=null&&tt.gameNumber?Qe=h.view.filterMultiple.gameNumber:Qe=Array.isArray(dt.selectedValue)?dt.selectedValue[0]:dt.selectedValue,T.value[vt]=Qe}}),((me=x.value)==null?void 0:me.id)===4&&setTimeout(()=>{var dt;if(T.value=[...T.value],(dt=h==null?void 0:h.view)!=null&&dt.componentProps&&T.value&&T.value.length>0){const vt=T.value[0];if(Array.isArray(vt)&&vt.length>0){const Ft=vt.some(Be=>Be.event_type_id===1||typeof Be=="string"&&Be.includes("1")),Vt=vt.some(Be=>Be.category_id===8||typeof Be=="string"&&Be.includes("8")),it=vt.some(Be=>Be.category_id===9||typeof Be=="string"&&Be.includes("9")),ct=vt.some(Be=>Be.event_type_id===3||typeof Be=="string"&&Be.includes("3"));h.view.componentProps.selectedEvents=vt,h.view.componentProps.goals=Ft,h.view.componentProps.yellowCards=Vt,h.view.componentProps.redCards=it,h.view.componentProps.substitutions=ct,h.view.componentProps.key=vt.length>0,h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps})}}},100),((Ue=x.value)==null?void 0:Ue.id)===2&&(Ee=h==null?void 0:h.view)!=null&&Ee.filterMultiple){if(h.view.filterMultiple.categoryId){const dt=N.value.findIndex(vt=>vt.type==="select-simple"&&vt.label==="Tipo de análisis");if(dt!==-1){const vt=h.view.filterMultiple.categoryId;if(T.value[0]=vt,h.view.componentProps&&vt){let Ft=`Category ${vt}`,Vt=null;try{Vt=Wh(vt),Vt&&(Ft=Vt.name)}catch{const it=N.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Tipo de análisis");if(it!==-1){const ct=(((Ke=N.value[it])==null?void 0:Ke.options)||[]).find(Be=>Be.value==vt);ct&&(Ft=ct.label)}}h.view.componentProps.categoryView=[{id:vt,name:Ft}]}(((nt=N.value[dt])==null?void 0:nt.options)||[]).find(Ft=>Ft.value==vt),n.nextTick(()=>{T.value=[...T.value]})}}if(h.view.filterMultiple.teamType!==void 0){const dt=N.value.findIndex(vt=>vt.type==="radio-button");if(dt!==-1){const vt=h.view.filterMultiple.teamType;T.value[dt]=vt,(((at=N.value[dt])==null?void 0:at.options)||[]).find(Ft=>Ft.value==vt),n.nextTick(()=>{T.value=[...T.value]})}}}if(((pt=x.value)==null?void 0:pt.id)===1&&(wt=h==null?void 0:h.view)!=null&&wt.filterMultiple&&h.view.filterMultiple.category&&N.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Tipo de análisis")!==-1){const dt=h.view.filterMultiple.category;T.value[0]=dt,h.view.componentProps&&dt&&(h.view.componentProps.type=dt),n.nextTick(()=>{T.value=[...T.value]})}if(((_t=x.value)==null?void 0:_t.id)===6&&(Mt=h==null?void 0:h.view)!=null&&Mt.filterMultiple&&h.view.filterMultiple.gameNumber&&N.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Número de juego")!==-1){const dt=h.view.filterMultiple.gameNumber;T.value[0]=dt,h.view.componentProps&&dt&&(h.view.componentProps.gameNumber=dt),n.nextTick(()=>{T.value=[...T.value]})}if(((It=x.value)==null?void 0:It.id)===5&&(Jt=h==null?void 0:h.view)!=null&&Jt.filterMultiple&&h.view.filterMultiple.isHomeTeam!==void 0)if(N.value.findIndex(dt=>dt.type==="radio-button"&&dt.label==="Equipo")!==-1){const dt=h.view.filterMultiple.isHomeTeam;let vt;typeof dt=="boolean"?vt=dt?1:2:typeof dt=="number"?vt=dt===1?1:2:vt=1,T.value[0]=vt,h.view.componentProps&&dt!==void 0&&(h.view.componentProps.isHomeTeamForAnalysis=dt===1),n.nextTick(()=>{T.value=[...T.value]})}else{const dt=N.value.findIndex(vt=>vt.type==="radio-button");if(dt!==-1){const vt=h.view.filterMultiple.isHomeTeam;let Ft;typeof vt=="boolean"?Ft=vt?1:2:typeof vt=="number"?Ft=vt===1?1:2:Ft=1,T.value[dt]=Ft,h.view.componentProps&&vt!==void 0&&(h.view.componentProps.preMatchType=vt),n.nextTick(()=>{T.value=[...T.value]})}}if(((lt=x.value)==null?void 0:lt.id)===15&&(rt=h==null?void 0:h.view)!=null&&rt.filterMultiple&&h.view.filterMultiple.isHomeTeam!==void 0){const dt=N.value.findIndex(vt=>vt.type==="radio-button");if(dt!==-1){const vt=h.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",vt,"type:",typeof vt);let Ft;typeof vt=="boolean"?Ft=vt?1:2:typeof vt=="number"?Ft=vt===1?1:2:Ft=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Ft,"teamFilterIndex:",dt),T.value[dt]=Ft,h.view.componentProps&&vt!==void 0&&(h.view.componentProps.preMatchType=Ft),n.nextTick(()=>{T.value=[...T.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",T.value)})}else{const vt=N.value.findIndex(Ft=>Ft.type==="radio-button");if(vt!==-1){const Ft=h.view.filterMultiple.isHomeTeam;let Vt;typeof Ft=="boolean"?Vt=Ft?1:2:typeof Ft=="number"?Vt=Ft===1?1:2:Vt=1,T.value[vt]=Vt,h.view.componentProps&&Ft!==void 0&&(h.view.componentProps.preMatchType=Vt),n.nextTick(()=>{T.value=[...T.value]})}}}n.nextTick(()=>{f.value=!1,o.value=!1})}}function ve(){if(!o.value&&t.value&&l&&l.dynamicFilters&&N.value){if(v.value)return;o.value=!0,f.value=!0,l.dynamicFilters.forEach((me,Ue)=>{var Ee;if(me&&((Ee=N.value[Ue])==null?void 0:Ee.type)==="radio-button"&&me.selectedOption&&me.selectedOption.value!==void 0){const Ke=me.selectedOption.value;T.value[Ue]=Ke}}),n.nextTick(()=>{f.value=!1,o.value=!1})}}function qe(){var me,Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft,Vt,it,ct,Be,ut,xt,mt,Tt,Ut,tt,Qe,kt,Wt,Rt,qt,Ht;if(r&&t.value&&h){if(v.value)return;if(f.value=!0,((me=x.value)==null?void 0:me.id)===4){if(r.setDynamicFilters(T.value,(Ue=h.view)==null?void 0:Ue.id),r.updateDynamicFilters(T.value,(Ee=h.view)==null?void 0:Ee.id),h.view.componentProps&&T.value&&T.value.length>0){const At=T.value[0];if(Array.isArray(At)&&At.length>0){const Yt=At.some(sr=>sr.event_type_id===1||typeof sr=="string"&&sr.includes("1")),Gt=At.some(sr=>sr.category_id===8||typeof sr=="string"&&sr.includes("8")),Bt=At.some(sr=>sr.category_id===9||typeof sr=="string"&&sr.includes("9")),or=At.some(sr=>sr.event_type_id===3||typeof sr=="string"&&sr.includes("3"));h.view.componentProps.selectedEvents=At,h.view.componentProps.goals=Yt,h.view.componentProps.yellowCards=Gt,h.view.componentProps.redCards=Bt,h.view.componentProps.substitutions=or,h.view.componentProps.key=At.length>0,h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps})}}}else if(((Ke=x.value)==null?void 0:Ke.id)===8)r.setDynamicFilters(T.value,(nt=h.view)==null?void 0:nt.id),r.updateDynamicFilters(T.value,(at=h.view)==null?void 0:at.id);else if(((pt=x.value)==null?void 0:pt.id)===3)r.setDynamicFilters(T.value,(wt=h.view)==null?void 0:wt.id),r.updateDynamicFilters(T.value,(_t=h.view)==null?void 0:_t.id);else if(((Mt=x.value)==null?void 0:Mt.id)===13){const At=(It=h.view)==null?void 0:It.id;r.setDynamicFilters(T.value,At),r.updateDynamicFilters(T.value,At),h.view.componentProps&&(h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps}))}else if(((Jt=x.value)==null?void 0:Jt.id)===15){const At=(lt=h.view)==null?void 0:lt.id;if(r.setDynamicFilters(T.value,At),r.updateDynamicFilters(T.value,At),h.view.componentProps){const Yt=Array.isArray(T.value)&&T.value[3]!==void 0?T.value[3]:null;Yt!==null&&(h.view.componentProps.numitems=Yt),h.view.componentProps._updateKey=Date.now(),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps})}}else if(((rt=x.value)==null?void 0:rt.id)===2){r.setDynamicFilters(T.value,(dt=h.view)==null?void 0:dt.id),r.updateDynamicFilters(T.value,(vt=h.view)==null?void 0:vt.id);const At=T.value[0];if(At!==void 0&&(h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.categoryId,h.view.filterMultiple.categoryId=At,h.view.componentProps)){let Gt=`Category ${At}`,Bt=null;try{Bt=Wh(At),Bt&&(Gt=Bt.name)}catch{const or=N.value.findIndex(sr=>sr.type==="select-simple"&&sr.label==="Tipo de análisis");if(or!==-1){const sr=(((Ft=N.value[or])==null?void 0:Ft.options)||[]).find(qr=>qr.value==At);sr&&(Gt=sr.label)}}h.view.componentProps.categoryView=[{id:At,name:Gt}],Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple})}const Yt=T.value[1];Yt!==void 0&&(h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.teamType,h.view.filterMultiple.teamType=Yt,h.view.componentProps&&h.view.componentProps.game&&(Yt===1?h.view.componentProps.teamView=h.view.componentProps.game.homeTeam.team_id:Yt===2?h.view.componentProps.teamView=h.view.componentProps.game.awayTeam.team_id:h.view.componentProps.teamView=0),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}))}else if(((Vt=x.value)==null?void 0:Vt.id)===1){r.setDynamicFilters(T.value,(it=h.view)==null?void 0:it.id),r.updateDynamicFilters(T.value,(ct=h.view)==null?void 0:ct.id);const At=T.value[0];At!==void 0&&(h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.category,h.view.filterMultiple.category=At,h.view.componentProps&&(h.view.componentProps.type=At),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}))}else if(((Be=x.value)==null?void 0:Be.id)===6){r.setDynamicFilters(T.value,(ut=h.view)==null?void 0:ut.id),r.updateDynamicFilters(T.value,(xt=h.view)==null?void 0:xt.id);const At=T.value[0];At!==void 0&&(h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.gameNumber,h.view.filterMultiple.gameNumber=At,h.view.componentProps&&(h.view.componentProps.gameNumber=At,h.view._updateKey,h.view._updateKey=Date.now()),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}),Ua.emit("dynamic-filters-changed",{containerViewId:(mt=x.value)==null?void 0:mt.id,viewId:h.view.id,dynamicFilters:T.value}),Ua.emit("component-props-updated",{viewId:h.view.id,componentProps:h.view.componentProps,dynamicFilters:T.value}),n.nextTick(()=>{h.view.componentProps&&(h.view.componentProps={...h.view.componentProps})}))}else if(((Tt=x.value)==null?void 0:Tt.id)===7){r.setDynamicFilters(T.value,(Ut=h.view)==null?void 0:Ut.id),r.updateDynamicFilters(T.value,(tt=h.view)==null?void 0:tt.id);const At=T.value[0],Yt=T.value[1];if(At!==void 0&&h.view.componentProps){const Gt=At===1?"offensive":"defensive";h.view.componentProps.analysisType=Gt}if(Yt!==void 0){h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.isHomeTeam;const Gt=Yt===1;h.view.filterMultiple.isHomeTeam=Gt,h.view.componentProps&&(h.view.componentProps.isHomeTeamForAnalysis=Gt,h.view._updateKey,h.view._updateKey=Date.now()),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}),Ua.emit("dynamic-filters-changed",{containerViewId:(Qe=x.value)==null?void 0:Qe.id,viewId:h.view.id,dynamicFilters:T.value}),Ua.emit("component-props-updated",{viewId:h.view.id,componentProps:h.view.componentProps,dynamicFilters:T.value}),n.nextTick(()=>{h.view.componentProps&&(h.view.componentProps={...h.view.componentProps})})}}else if(((kt=x.value)==null?void 0:kt.id)===5){r.setDynamicFilters(T.value,(Wt=h.view)==null?void 0:Wt.id),r.updateDynamicFilters(T.value,(Rt=h.view)==null?void 0:Rt.id);const At=T.value[0];if(At!==void 0){h.view.filterMultiple||(h.view.filterMultiple={}),h.view.filterMultiple.isHomeTeam;const Yt=At===1?1:2;h.view.filterMultiple.isHomeTeam=Yt,h.view.componentProps&&(h.view.componentProps.isHomeTeamForAnalysis=Yt===1,h.view._updateKey,h.view._updateKey=Date.now()),Ua.emit("force-component-update",{itemId:h.view.id,componentProps:h.view.componentProps,filterMultiple:h.view.filterMultiple}),Ua.emit("dynamic-filters-changed",{containerViewId:(qt=x.value)==null?void 0:qt.id,viewId:h.view.id,dynamicFilters:T.value}),Ua.emit("component-props-updated",{viewId:h.view.id,componentProps:h.view.componentProps,dynamicFilters:T.value}),n.nextTick(()=>{h.view.componentProps&&(h.view.componentProps={...h.view.componentProps})})}}else((Ht=x.value)==null?void 0:Ht.id)===9||(r.setDynamicFilters(T.value),r.updateDynamicFilters(T.value));n.nextTick(()=>{f.value=!1})}}function ke(){var me,Ue;if(!l||!l.dynamicFilters||!N.value)return!1;for(let Ee=0;Ee<l.dynamicFilters.length;Ee++){const Ke=l.dynamicFilters[Ee],nt=N.value[Ee],at=T.value[Ee];if(!(!Ke||!nt)){if(nt.type==="check"){if(Ke.isChecked!==at)return!0}else if(nt.type==="radio-button"){if(((me=Ke.selectedOption)==null?void 0:me.value)!==at)return!0}else if(nt.type==="select"){const pt=((Ue=Ke.selectedOptions)==null?void 0:Ue.map(_t=>_t.value))||Ke.selectedValue||[],wt=Array.isArray(at)?at:[];if(JSON.stringify(pt)!==JSON.stringify(wt))return!0}}}return!1}function Ge(me){var Ue,Ee,Ke,nt,at,pt,wt,_t,Mt,It,Jt,lt,rt,dt,vt,Ft;if(T.value=me.filters,r){const Vt=((Ue=h==null?void 0:h.view)==null?void 0:Ue.id)||null;r.setDynamicFilters(T.value,Vt),r.updateDynamicFilters(T.value,Vt)}if(t.value&&h&&(Ua.emit("activate-save-button"),Ua.emit("force-component-update",{itemId:((Ee=h==null?void 0:h.view)==null?void 0:Ee.id)||null,componentProps:h.view.componentProps}),Ua.emit("dynamic-filters-changed",{containerViewId:((Ke=h==null?void 0:h.view)==null?void 0:Ke.id)||null,viewId:((nt=h==null?void 0:h.view)==null?void 0:nt.id)||null,dynamicFilters:T.value}),Ua.emit("dynamic-filters-changed",{containerViewId:((at=h==null?void 0:h.view)==null?void 0:at.id)||null,viewId:((pt=h==null?void 0:h.view)==null?void 0:pt.id)||null,dynamicFilters:T.value}),n.nextTick(()=>{h.view.componentProps&&(h.view.componentProps={...h.view.componentProps})})),!t.value&&r&&((wt=x.value)==null?void 0:wt.id)===15&&r.getRequiresAddView(T.value)){r.setDynamicFilters(T.value),W("filters-changed",{main:c.value,view:x.value,team:F.value,dynamicFilters:T.value,filtersJSON:{mainSelector:{id:((_t=c.value)==null?void 0:_t.id)||null,name:((Mt=c.value)==null?void 0:Mt.name)||null,url:((It=c.value)==null?void 0:It.url)||null},viewSelector:{id:((Jt=x.value)==null?void 0:Jt.id)||null,name:((lt=x.value)==null?void 0:lt.name)||((rt=x.value)==null?void 0:rt.title)||null,url:((dt=x.value)==null?void 0:dt.url)||null},team:F.value,dynamicFilters:T.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!x.value,totalDynamicFilters:((vt=N.value)==null?void 0:vt.length)||0,activeFilters:((Ft=N.value)==null?void 0:Ft.filter((Vt,it)=>{const ct=T.value[it];return Array.isArray(ct)?ct.length>0:ct!=null&&ct!==!1}).length)||0}},filterAndViewsContainer:r,viewToEdit:h}),ae();return}qe()}function Re(me){me.filterIndex!==void 0&&me.value!==void 0&&(T.value[me.filterIndex]=me.value,t.value&&qe(),ae())}function Xe(){Ve()}function Ze(me){var Ue,Ee,Ke,nt,at,pt,wt;console.log("33333333333333333333333333333333333333");const _t={mainSelector:{id:((Ue=c.value)==null?void 0:Ue.id)||null,name:((Ee=c.value)==null?void 0:Ee.name)||null,url:((Ke=c.value)==null?void 0:Ke.url)||null},viewSelector:{id:((nt=x.value)==null?void 0:nt.id)||null,name:((at=x.value)==null?void 0:at.name)||((pt=x.value)==null?void 0:pt.title)||null,url:((wt=x.value)==null?void 0:wt.url)||null}};W("filters-changed",{filters:me.filters,view:me.view,viewToEdit:h,filterAndViewsContainer:r,filtersJSON:_t,isAltMode:!0})}function et(me){return JSON.parse(JSON.stringify(me))}return(me,Ue)=>(n.openBlock(),n.createElementBlock("div",qTe,[n.createElementVNode("button",UTe,n.toDisplayString(t.value?"Editando visualización":"Nueva visualización"),1),n.createElementVNode("div",{class:n.normalizeClass(["custom-select main-select",{disabled:t.value}]),onClick:G},[n.createElementVNode("div",zTe,[n.createElementVNode("span",CTe,[c.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,PTe)):(n.openBlock(),n.createElementBlock("img",FTe))]),c.value?(n.openBlock(),n.createElementBlock("span",RTe,n.toDisplayString(H()),1)):(n.openBlock(),n.createElementBlock("span",ETe,"Tipo de vista")),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:R.value}])},[...Ue[5]||(Ue[5]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),R.value?(n.openBlock(),n.createElementBlock("div",MTe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,(Ee,Ke)=>(n.openBlock(),n.createElementBlock("div",{key:Ee.id,class:n.normalizeClass(["option-card",{active:p.value===Ke}]),onClick:n.withModifiers(nt=>ee(Ke),["stop"])},[n.createElementVNode("div",jTe,[n.createElementVNode("img",{src:D(Ee.name,!1),"data-hover-src":D(Ee.name,!0),alt:"icono",class:"option-img-34"},null,8,KTe)]),n.createElementVNode("div",ATe,[n.createElementVNode("div",ITe,n.toDisplayString(Ee.name),1),Ee.description?(n.openBlock(),n.createElementBlock("div",XTe,n.toDisplayString(Ee.description),1)):n.createCommentVNode("",!0)])],10,WTe))),128))])):n.createCommentVNode("",!0)],2),c.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["custom-select second-select",{disabled:t.value}]),onClick:re},[n.createElementVNode("div",DTe,[n.createElementVNode("span",JTe,[x.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:x.value.url,alt:"icono",class:"option-img-graph2"},null,8,GTe)):c.value?(n.openBlock(),n.createElementBlock("img",{key:1,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,BTe)):n.createCommentVNode("",!0)]),n.createElementVNode("span",ZTe,n.toDisplayString(ne()),1),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:j.value}])},[...Ue[6]||(Ue[6]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),j.value&&c.value?(n.openBlock(),n.createElementBlock("div",HTe,[n.createElementVNode("div",YTe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,Ee=>(n.openBlock(),n.createElementBlock("div",{key:Ee.id,class:n.normalizeClass(["option-card-grid",{active:b.value===Ee.id}]),onClick:n.withModifiers(Ke=>Y(Ee),["stop"])},[n.createElementVNode("div",$Te,n.toDisplayString(Ee.name||Ee.title),1),n.createElementVNode("div",e6e,[n.createElementVNode("img",{src:Ee.url,alt:"icono",class:"option-img-grid"},null,8,t6e)])],10,QTe))),128))])])):n.createCommentVNode("",!0)],2)):n.createCommentVNode("",!0),x.value?(n.openBlock(),n.createElementBlock("div",r6e)):n.createCommentVNode("",!0),x.value&&x.value.id===13?(n.openBlock(),n.createBlock(gSe,{key:2,filters:N.value,"initial-values":t.value?n.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":13,onFiltersChanged:Ge,onFilterUpdated:Re},null,8,["filters","initial-values","is-edit-mode"])):x.value&&x.value.id===16?(n.openBlock(),n.createBlock(OTe,{key:3,"view-config":et(g.value.get(16)),"default-filters":n.unref(h)?n.unref(h).view.filterMultiple:null,"is-edit-mode":!!n.unref(h),"is-post-match":e.isPostMatch,onChange:Ze,onRemoveViews:Xe},null,8,["view-config","default-filters","is-edit-mode","is-post-match"])):x.value&&x.value.id===15?(n.openBlock(),n.createBlock(FSe,{key:4,filters:N.value,"initial-values":t.value?n.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":15,onFiltersChanged:Ge,onFilterUpdated:Re},null,8,["filters","initial-values","is-edit-mode"])):x.value&&N.value&&C()?(n.openBlock(),n.createElementBlock("div",{key:5,class:n.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":N.value.length>=2}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.value,(Ee,Ke)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:Ke},[Ee.type==="select"?(n.openBlock(),n.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:n.withModifiers(nt=>$(Ke),["stop"])},[n.createElementVNode("div",a6e,[Ue[8]||(Ue[8]=n.createElementVNode("span",{class:"select-icon select-analisis-icon"},[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Ue[9]||(Ue[9]=n.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(T.value[Ke])&&T.value[Ke].length>0?(n.openBlock(),n.createElementBlock("span",i6e,n.toDisplayString(T.value[Ke].length),1)):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:K.value===Ke}])},[...Ue[7]||(Ue[7]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),K.value===Ke?(n.openBlock(),n.createElementBlock("div",o6e,[n.createElementVNode("div",s6e,[n.createElementVNode("div",{class:"multi-select-header",onClick:Ue[1]||(Ue[1]=n.withModifiers(()=>{},["stop"]))},[n.createElementVNode("label",l6e,[n.createElementVNode("input",{type:"checkbox",checked:z(Ke),indeterminate:O(Ke),onChange:n.withModifiers(nt=>S(Ke),["stop"]),onClick:Ue[0]||(Ue[0]=n.withModifiers(()=>{},["stop"]))},null,40,c6e),Ue[10]||(Ue[10]=n.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Ee.options,nt=>(n.openBlock(),n.createElementBlock("div",{key:nt.value,class:n.normalizeClass(["option-card multi-select-option",{active:V(Ke,nt.value)}]),onClick:Ue[2]||(Ue[2]=n.withModifiers(()=>{},["stop"]))},[n.createElementVNode("div",u6e,[n.createElementVNode("input",{type:"checkbox",checked:V(Ke,nt.value),onChange:n.withModifiers(at=>U(Ke,nt.value),["stop"])},null,40,d6e)]),n.createElementVNode("div",{class:"option-content",onClick:at=>U(Ke,nt.value)},[n.createElementVNode("div",h6e,n.toDisplayString(nt.label),1)],8,p6e)],2))),128))]),n.createElementVNode("div",f6e,[n.createElementVNode("button",{class:"btn-listo",onClick:Ue[3]||(Ue[3]=n.withModifiers(nt=>_e(),["stop"]))},"Listo")])])):n.createCommentVNode("",!0)],8,n6e)):Ee.type==="radio-button"?(n.openBlock(),n.createElementBlock("div",m6e,[n.createElementVNode("div",y6e,n.toDisplayString(Ee.label),1),n.createElementVNode("div",g6e,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Ee.options,nt=>(n.openBlock(),n.createElementBlock("label",{key:nt.value,class:n.normalizeClass(["radio-option-card",{active:T.value[Ke]===nt.value}])},[n.withDirectives(n.createElementVNode("input",{type:"radio",name:"dynamic-radio-"+Ke,value:nt.value,"onUpdate:modelValue":at=>T.value[Ke]=at,disabled:P(nt.value,nt.label),onChange:()=>{var at,pt,wt;if(((at=x.value.value)==null?void 0:at.id)===9&&t.value.value&&(wt=(pt=n.unref(h))==null?void 0:pt.view)!=null&&wt.filterMultiple){const _t=T.value[Ke]===1;n.unref(h).view.filterMultiple.isHomeTeam=_t}t.value.value&&qe(),ae()}},null,40,v6e),[[n.vModelRadio,T.value[Ke]]]),n.createElementVNode("span",null,n.toDisplayString(nt.label),1)],2))),128))])])):Ee.type==="check"?(n.openBlock(),n.createElementBlock("div",b6e,[n.createElementVNode("label",null,[n.withDirectives(n.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":nt=>T.value[Ke]=nt,checked:T.value[Ke],onChange:Ue[4]||(Ue[4]=()=>{t.value.value&&qe(),ae()})},null,40,x6e),[[n.vModelCheckbox,T.value[Ke]]]),n.createTextVNode(" "+n.toDisplayString(Ee.label),1)])])):Ee.type==="select-simple"?(n.openBlock(),n.createElementBlock("div",{key:3,class:"custom-select dynamic-select filter-inline","data-filter-type":Ee.type,onClick:n.withModifiers(nt=>le(Ke),["stop"])},[n.createElementVNode("div",_6e,[Ue[12]||(Ue[12]=n.createElementVNode("span",{class:"select-icon select-analisis-icon"},[n.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Ue[13]||(Ue[13]=n.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),n.createElementVNode("span",{class:n.normalizeClass(["arrow",{open:X.value===Ke}])},[...Ue[11]||(Ue[11]=[n.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[n.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),X.value===Ke?(n.openBlock(),n.createElementBlock("div",S6e,[n.createElementVNode("div",T6e,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Ee.options,nt=>(n.openBlock(),n.createElementBlock("div",{key:nt.value,class:n.normalizeClass(["option-card simple-select-option",{active:T.value[Ke]===nt.value}]),onMouseenter:at=>ze(Ke,nt.value),onClick:n.withModifiers(at=>ie(Ke,nt.value),["stop"])},[n.createElementVNode("div",L6e,[n.createElementVNode("div",N6e,n.toDisplayString(nt.label),1)]),T.value[Ke]===nt.value?(n.openBlock(),n.createElementBlock("div",V6e,[...Ue[14]||(Ue[14]=[n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):n.createCommentVNode("",!0)],42,k6e))),128))])])):n.createCommentVNode("",!0)],8,w6e)):n.createCommentVNode("",!0),Ke===1&&N.value.length>2?(n.openBlock(),n.createElementBlock("div",O6e)):n.createCommentVNode("",!0)],64))),128))],2)):n.createCommentVNode("",!0),t.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:6,class:"cancel-btn",onClick:Ve},"Cancelar")),_.value?(n.openBlock(),n.createElementBlock("button",{key:7,class:"ok-btn",onClick:Te},"OK")):n.createCommentVNode("",!0)]))}}),U6e=jd(q6e,[["__scopeId","data-v-9dd6abcb"]]),z6e={key:0,class:"modal-simple"},C6e={class:"modal-simple__content"},P6e={class:"modal-simple__content__header"},F6e={class:"modal-simple__content__body"},E6e={class:"modal-simple__content__footer"},R6e={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[e.modelValue?(n.openBlock(),n.createElementBlock("div",z6e,[n.createElementVNode("div",C6e,[n.createElementVNode("div",P6e,[n.renderSlot(a.$slots,"header",{},void 0,!0)]),n.createElementVNode("div",F6e,[n.renderSlot(a.$slots,"body",{},void 0,!0)]),n.createElementVNode("div",E6e,[n.renderSlot(a.$slots,"footer",{},void 0,!0)])])])):n.createCommentVNode("",!0)]))}},M6e=jd(R6e,[["__scopeId","data-v-1cc4f590"]]),W6e={class:"footer"},j6e={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:a}){const i=a;function k(g){i("update:modelValue",g)}function W(g){i("action",g),i("update:modelValue",!1)}return(g,m)=>(n.openBlock(),n.createBlock(M6e,{"modle-value":e.value,"onUpdate:modelValue":k},{header:n.withCtx(()=>[...m[2]||(m[2]=[n.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:n.withCtx(()=>[...m[3]||(m[3]=[n.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:n.withCtx(()=>[n.createElementVNode("div",W6e,[n.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:m[0]||(m[0]=r=>W(!1))}," Seguir editando "),n.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:m[1]||(m[1]=r=>W(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},K6e=jd(j6e,[["__scopeId","data-v-ed9b5088"]]),A6e={key:0,class:"modal-simple"},I6e={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[n.createVNode(n.Transition,null,{default:n.withCtx(()=>[e.modelValue?(n.openBlock(),n.createElementBlock("div",A6e,[...i[0]||(i[0]=[n.createElementVNode("div",{class:"modal-simple__content"},[n.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M29.3346 14.7823V16.0089C29.333 18.8842 28.402 21.6818 26.6804 23.9847C24.9589 26.2876 22.539 27.9722 19.7818 28.7875C17.0245 29.6027 14.0776 29.5048 11.3806 28.5084C8.68354 27.512 6.38084 25.6704 4.81592 23.2584C3.25099 20.8463 2.50769 17.993 2.69687 15.124C2.88605 12.255 3.99758 9.52404 5.86568 7.33836C7.73377 5.15269 10.2583 3.62944 13.0629 2.9958C15.8674 2.36215 18.8017 2.65205 21.428 3.82227",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),n.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):n.createCommentVNode("",!0)]),_:1})]))}},X6e=jd(I6e,[["__scopeId","data-v-2bc30783"]]),D6e={class:"template-maker__header"},J6e={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},G6e={class:"template-maker__content"},B6e={class:"template-maker__content__main"},Z6e={id:"containerMain",class:"container-main"},H6e={class:"template-maker__content__main__cover-selector"},Y6e=["id"],Q6e={class:"page-indicator"},$6e={class:"page-indicator__index"},e4e=["onClick"],t4e=["onClick"],r4e={key:0,class:"template-maker__content__main__footer"},n4e={class:"template-maker__content__main__footer__paginator"},a4e={class:"template-maker__content__main__footer__paginator__nav"},i4e={class:"template-maker__content__main__footer__paginator__numbers"},o4e=["onClick"],s4e={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:a,emit:i}){const k=new Map,W=n.ref([{title:"Page 1",id:String(Date.now()),items:[{name:"Volumetrica",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:6,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}},{name:"Volumetrica",id:String(Date.now()),x:4,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]}]),g=n.ref(null),m=n.ref(0),r=n.ref(!1),h=n.ref(null),l=n.ref(null),t=n.ref(!0),_=n.ref(!1),w=n.ref(!1),v=n.ref(0),f=n.ref(!1),o=n.ref(null),s=n.ref(new Map),p=n.ref(null),c=n.ref(null),d=n.ref(!1),b=n.ref(!1),x=n.ref(!1),T=new Map,N=n.computed(()=>({"--overflow-y-template-maker":_.value?"scroll":"hidden","--height-container-main":_.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(_.value,"0")})),V=n.computed(()=>m.value+1);n.watch(()=>r.value,_e=>{const ze=document.getElementById("app");_e?(m.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",ze&&(ze.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",ze&&(ze.style.overflow=""))});function U(_e){return _e<10?`0${_e}`:_e}async function z({templateId:_e,userId:ze}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${ze}/templates/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Fe){console.error("Error fetching template by ID:",Fe)}}async function O({reportId:_e,userId:ze}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${ze}/reports/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Fe){console.error("Error fetching report by ID:",Fe)}}let C=0;function q(_e){g.value=_e,C>0&&(d.value=!0),C++}function L(_e){_e&&ue(null,!0)}let P=null;function S(_e,ze){let Fe=_e.getBoundingClientRect(),Je={height:_e.clientHeight,width:_e.clientWidth},Ce=ze.getBoundingClientRect();if(!(Ce.top>=Fe.top&&Ce.bottom<=Fe.top+Je.height)){const We=Ce.top-Fe.top,Pe=Ce.bottom-Fe.bottom;Math.abs(We)<Math.abs(Pe)?_e.scrollTop+=We:_e.scrollTop+=Pe}}function F(_e,ze){let Fe=_e.getBoundingClientRect();const Je=ze.getBoundingClientRect().top-Fe.top;_e.scrollTop+=Je}function R(_e,ze=!1){const Fe={title:`Page ${W.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(xe(),_e!==void 0&&_e>=-1?W.value.splice(_e+1,0,Fe):W.value.push(Fe),n.nextTick(()=>{const Je=W.value.findIndex(We=>We.id===Fe.id),Ce=document.getElementById(`page-${Je+1}`);P||(P=document.getElementById("containerMain")),Ce&&P?S(P,Ce):console.error("Page element or container main element not found")}),ze)return Fe;d.value=!0}function j(_e){if(_e<0||_e>W.value.length)return;m.value=_e;const ze=document.getElementById(`page-${_e}`);if(P||(P=document.getElementById("containerMain")),ze&&P){const Fe=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Fe),F(P,ze),setTimeout(()=>{const Je=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Je)},300)}else console.error("Page element or container main element not found")}function K(_e){p.value=_e,f.value=!0}function X(_e,ze){const Fe=ze+1;_e&&m.value!==Fe&&(m.value=Fe)}function D(_e){f.value=!0,Ua.emit("edit-view",{view:_e})}async function H({templateReportId:_e,userId:ze,isTemplateMode:Fe}){try{return Fe?z({templateId:_e,userId:ze}):O({reportId:_e,userId:ze})}catch(Je){throw new Error("Error fetching template or report by ID: "+Je.message)}}function ne(){C=0,f.value=!1,m.value=0,p.value=null,c.value=null,s.value.clear(),P=null}async function G(_e){if(ne(),t.value=_e.isTemplateMode,_.value=!!_e.isPDFMode,_e.isPDFMode?h.value=await O({reportId:_e.reportId,userId:_e.userId}):(h.value=_e.template,h.value=await H({templateReportId:_e.template.id,userId:_e.template.user_id,isTemplateMode:_e.isTemplateMode})),!h.value)return;h.value&&h.value.game&&(h.value.game=ie(h.value.game)),l.value=JSON.parse(JSON.stringify(h.value)),w.value=h.value.template_type===2;const ze=h.value.pages.find(Fe=>Fe.is_front_page);v.value=ze?ze.type:1,r.value=!0,W.value=h.value.pages.reduce((Fe,Je,Ce)=>{if(!Je.is_front_page){Je.name||(Je.name="");const We=Ce,Pe={originalPage:JSON.parse(JSON.stringify(Je)),title:Je.name,id:`p-${Date.now()-Ce*9}`,items:[],components:Je.components};Je.components&&Je.components.length>0&&(Pe.items=Je.components.map((ve,qe)=>{const ke=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ve.coreView.id,ve.dynamicFilters,w.value,t.value,ve.filtersJSON||null,$.token,ve.filters),Ge={originalComponent:JSON.parse(JSON.stringify(ve)),title:ve.title,shortTitle:ve.shortTitle||ve.title,game:h.value.game,idAux:ve.id,id:`w-${Date.now()-qe*7}`,x:ve.column,y:ve.row,w:ve.colspan,h:ve.rowspan,maxWidth:ve.max_column,maxHeight:ve.max_row,minWidth:ve.min_column,minHeight:ve.min_row,noResize:!t.value,noMove:!t.value,coreView:ve.coreView||null,isTemplateMode:t.value,componentName:ve.componentName,componentProps:Y({currentProps:ve.componentProps,coreView:ve.coreView,isTemplateMode:t.value,templateToEdit:h.value,filterMultiple:ve.filterMultiple||null,game:h.value.game||null,dynamicFilters:ve.dynamicFilters,page:We,componentId:qe})||{},filterMultiple:ve.filterMultiple,isHomeTeam:ee({game:h.value.game,isTemplateMode:t.value,currentIsHomeTeam:ve.isHomeTeam||ve.componentProps.isHomeTeamForAnalysis}),filtersJSON:ve.filtersJSON||null,dynamicFilters:ve.dynamicFilters||[],filterAndViewsContainer:ke},Re=n.reactive({view:Ge});return ke.addView(Re,!0),s.value.set(ke.getId(),ke),Ge})),Fe.push(Pe)}return Fe},[])}function re({game:_e,isTemplateMode:ze}){const Fe=_e&&_e.homeTeam&&_e.awayTeam&&(_e.homeTeam.team_id===$.userTeamId||_e.awayTeam.team_id===$.userTeamId);return{isUserTeamHome:Fe&&_e.homeTeam.team_id===$.userTeamId,requiresUserTeamAdjustment:Fe&&!ze}}function ee({game:_e,isTemplateMode:ze,currentIsHomeTeam:Fe}){const{isUserTeamHome:Je,requiresUserTeamAdjustment:Ce}=re({game:_e,isTemplateMode:ze});return Ce?Fe?Je:!Je:Fe}function Y({currentProps:_e,coreView:ze,templateToEdit:Fe,isTemplateMode:Je,filterMultiple:Ce,game:We,dynamicFilters:Pe,page:ve,componentId:qe}){if(!_e||!ze)return _e||{};const{isUserTeamHome:ke,requiresUserTeamAdjustment:Ge}=re({game:We,isTemplateMode:Je}),Re={..._e};if(ze.id===5&&(Re.isGhostEffect=Je,Ge)){const Xe=Re.preMatchType===1;Re.preMatchType=Xe?ke?1:2:ke?2:1}if(ze.id===7&&Ge){const Xe=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Xe?ke:!ke}if(ze.id===9&&Ge){const Xe=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Xe?ke:!ke}if(ze.id===16){if(Ge){const Ze=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ze?ke:!ke}Re.isTemplateMode=Je,Re.seasonId=Fe.season_id,Re.teamIdForAnalysis=Re.isHomeTeamForAnalysis?Fe.game.home_team:Fe.game.visiting_team;const Xe=Re.isHomeTeamForAnalysis?Fe.last_games.last_home_games:Fe.last_games.last_visiting_games;Re.gamesIdsForAnalysis=w.value?[Fe.game.game_id]:Re.howManyGames?Xe.slice(0,Re.howManyGames).map(Ze=>Ze.game_id):[]}if(ze.id===10&&Ge){const Xe=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Xe?ke:!ke}if(ze.id===1&&(Re.gameId=We?We.id:"",Re.homeLogo=We?We.homeTeam.logo:"",Re.awayLogo=We?We.awayTeam.logo:"",Re.seasonId=We?We.season_id:0,Re.default=Je),ze.id===6&&(Re.game=We||"",Re.lastGames=Fe.last_games,Re.selectedOption=Fe.template_type===2?"Postmatch":"Prematch"),ze.id===13&&(Re.isdefault=Je,Re.seasonid=We?We.seasonId:2010,Re.datetimeutc=We?Fe.template_type===1?We?We.date_time_utc:"":null:"",Re.teamids=We?[We.home_team,We.visiting_team]:[1,2],Re.categoryids=Pe?Pe[1]:[20,2],Re.teamsshow=We?Pe?Pe[2]==1?[We.home_team]:Pe[2]==2?[We.visiting_team]:[We.home_team,We.visiting_team]:[1,2]:[1,2],Re.analysistype=Pe?Pe[0]:[],Re.gameid=Fe.template_type===1?null:We?We.id:"",Re.teams=We?[{id:We.home_team,name:We.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+We.home_team+".png"},{id:We.visiting_team,name:We.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+We.visiting_team+".png"}]:[]),ze.id===15&&(Re.view=1,Re.token=$.token,Re.numitems=Pe?Pe[1]:3,Re.isdefault=Je,Re.reportid=Fe!=null&&Fe.id?Fe.id:0,Re.userid=Fe!=null&&Fe.user_id?Fe.user_id:0,Re.page=ve+1,Re.componentid=qe+1,Re.data={season:We?We.seasonId:2010,type:2,game:We?We.id:0,team:We?We.home_team:2}),ze.id===14&&(Re.isReports=!0,Re.isDefault=Je,Re.type=Fe.tournament_type==1?1:0,Re.typeView=1,Re.tournament=Fe.tournament_id,Re.currentSeason=We?We.season_id:0,Re.currentSeasonId=We?We.season_id:0,Re.showVideos=!1,Re.localTeam=We?We.home_team:0,Re.awayTeam=We?We.visiting_team:0),ze.id===3&&(Re.defaultShields=Je),ze.id===2){let Xe=!0,Ze=0,et=0;We&&(Xe=Fe.main_team==We.home_team||Fe.main_team==We.visiting_team,Ze=Xe?Fe.main_team==(We==null?void 0:We.home_team)?We==null?void 0:We.home_team:We==null?void 0:We.visiting_team:We==null?void 0:We.home_team,et=Xe?Fe.main_team==(We==null?void 0:We.home_team)?We==null?void 0:We.visiting_team:We==null?void 0:We.home_team:We==null?void 0:We.visiting_team),Re.gamed=We?We.id:"",Re.game=We||"",Re.season=We?We.season_id:0,Re.teamView=Ce.teamType==3?0:Ce.teamType==1?Ze:et,Re.useDummyData=Je}return ze.id===8&&(Re.teamSelected=We?{teamId:We.home_team}:1,Re.isDefault=Je),ze.id===4&&(Re.gameId=We?We.id:"",Re.isDefault=Je,Re.homeTeam=We?We==null?void 0:We.home_team:"",Re.awayTeam=We?We==null?void 0:We.visiting_team:""),We&&(Re.game=We),Re}const $=e,le=i;n.watch(()=>$.token,(_e,ze)=>{},{immediate:!0}),a({show:G}),Ua.on("add-page-view",_e=>{k.set(_e.view.id,_e.view);const ze=W.value.find(Fe=>Fe.id===_e.pageId);ze&&(ze.items||(ze.items=[]),ze.items.push(_e.view),n.nextTick(()=>{const Fe=document.querySelector(`[gs-id="${_e.view.id}"]`);_e.grid.makeWidget(Fe)}))}),Ua.on("add-page-and-view",_e=>{const ze=W.value.findIndex(Fe=>Fe.id===_e.pageId);if(ze>-1){const Fe=R(ze,!0);setTimeout(()=>{Ua.emit("add-view",{pageId:Fe.id,view:_e.view,filterAndWidgetContainer:_e.filterAndWidgetContainer}),c.value&&(Fe.stepBackPage=c.value),c.value=Fe},500)}else console.error("Page not found for adding view:",_e.pageId)}),Ua.on("empty-page",_e=>{f.value&&p.value&&p.value.id===_e.id||(be(_e),c.value&&c.value.id===_e.id&&(c.value.stepBackPage?c.value=c.value.stepBackPage:c.value=null))}),Ua.on("filters-cancelled",_e=>{_e&&_e.removeAllChildViews()}),Ua.on("activate-save-button",()=>{d.value=!0});function ie(_e){return{..._e,gameId:_e.game_id,id:_e.game_id,seasonId:_e.season_id,status:_e.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.home_team}.png`,team_id:_e.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.home_team}.png`,colloquial_name:_e.home_team_name,acronym:_e.home_team_acronym,team_name:_e.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.visiting_team}.png`,team_id:_e.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.visiting_team}.png`,colloquial_name:_e.visiting_team_name,acronym:_e.visiting_team_acronym,team_name:_e.visiting_team_name}}}function ue(_e,ze=!1){ze||!t.value?(r.value=!1,ne(),le("close")):d.value?b.value=!0:(r.value=!1,ne(),le("close"))}function he(){o.value=null,f.value=!1}function ae({page:_e,view:ze,applyMinimumSize:Fe=!1}){const Je=_e.grid;if(!_e||!ze||!Je)return null;const Ce=Fe?{w:ze.min_column,h:ze.min_row}:{w:ze.colspan,h:ze.rowspan},We=Je.willItFit(0,0,Ce.w,Ce.h,!0);return We?{willFit:We,applyMinimumSize:Fe}:Fe?null:ae({page:_e,view:ze,applyMinimumSize:!0})}const de=new Set([9]);function ce(_e){var ze,Fe,Je,Ce,We,Pe,ve,qe,ke,Ge,Re,Xe,Ze,et;if(_e.dynamicFilters&&_e.dynamicFilters.length>0&&_e.viewToEdit&&_e.viewToEdit.view){const me=_e.viewToEdit.view.id;W.value.forEach(Ue=>{Ue.items.forEach(Ee=>{Ee.id===me&&Ee.coreView&&Ee.coreView.id===3&&(Ee.componentProps.desplegable=_e.dynamicFilters[0]||!1,Ee.componentProps.key=_e.dynamicFilters[0]||!1,n.nextTick(()=>{Ua.emit("force-component-update",{itemId:Ee.id,componentProps:Ee.componentProps})}))})})}if(_e.viewToEdit){if(!_e.viewToEdit.view.filterAndViewsContainer){const me=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[_e.viewToEdit],((ze=_e.viewToEdit.view.coreView)==null?void 0:ze.id)||_e.viewToEdit.view.id,_e.dynamicFilters||[],w.value,t.value,_e.filtersJSON,$.token,_e.filters);_e.viewToEdit.view.filterAndViewsContainer=me}_e.viewToEdit.view.filterAndViewsContainer.updateView({view:_e.viewToEdit,dynamicFilters:_e.dynamicFilters||[],filtersJSON:_e.filtersJSON||null,filters:_e.filters}),d.value=!0}else if(_e.view){_e.view.id&&_e.filterAndViewsContainer&&_e.view.id!==_e.filterAndViewsContainer.viewId&&(_e.filterAndViewsContainer.removeAllChildViews(),_e.filterAndViewsContainer.setViewId(_e.view.id),_e.filterAndViewsContainer.setFiltersJSON(_e.filtersJSON||null)),_e.view.id&&de.has(_e.view.id)&&_e.dynamicFilters[0]&&_e.dynamicFilters[0].length===0&&_e.filterAndViewsContainer&&(_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(Je=(Fe=_e.viewToEdit)==null?void 0:Fe.view)==null?void 0:Je.id),d.value=!0);const me=c.value||p.value,Ue=ae({page:me,view:_e.view,applyMinimumSize:!1});_e.view.filtersJSON=_e.filtersJSON||null;const Ee=_e.filterAndViewsContainer,Ke=W.value.findIndex(nt=>nt.id===me.id);if(Ee){const nt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);if(((Ce=_e.view)==null?void 0:Ce.id)===15){const at=(We=_e.filterAndViewsContainer)==null?void 0:We.getId();if(at&&T.has(at)){const pt=T.get(at);clearTimeout(pt),T.delete(at)}}if(nt){if(Ee.setFilters(_e.filters),Ee.setDynamicFilters(_e.dynamicFilters),Ue||Ke===W.value.length-1){Ua.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:Ee,avoidWillFit:!1,applyMinimumSize:Ue?Ue.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(ve=(Pe=_e.viewToEdit)==null?void 0:Pe.view)==null?void 0:ve.id),d.value=!0;let at=null;if(((qe=_e.view)==null?void 0:qe.id)===15?(n.nextTick(()=>{var pt;const wt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters),_t=(pt=_e.dynamicFilters)==null?void 0:pt[0];if(console.log("onFiltersChanged nextTick - stillRequiresAddView:",wt,"childViews.length:",_e.filterAndViewsContainer.childViews.length,"currentFilterValue:",_t),_t!==3){console.log("onFiltersChanged nextTick - El filtro cambió, cancelando. Valor actual:",_t);return}wt&&(console.log("onFiltersChanged nextTick - llamando recursivamente para crear siguiente componente"),ce(_e))}),at=setTimeout(()=>{var pt,wt;const _t=(pt=_e.filterAndViewsContainer)==null?void 0:pt.getId();_t&&T.delete(_t);const Mt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters),It=(wt=_e.dynamicFilters)==null?void 0:wt[0];if(console.log("onFiltersChanged setTimeout (backup) - stillRequiresAddView:",Mt,"childViews.length:",_e.filterAndViewsContainer.childViews.length,"currentFilterValue:",It),It!==3){console.log("onFiltersChanged setTimeout (backup) - El filtro cambió, cancelando. Valor actual:",It);return}Mt&&(console.log("onFiltersChanged setTimeout (backup) - llamando recursivamente para crear siguiente componente"),ce(_e))},200)):at=setTimeout(()=>{const pt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters);console.log("onFiltersChanged setTimeout - stillRequiresAddView:",pt,"childViews.length:",_e.filterAndViewsContainer.childViews.length),pt?(console.log("onFiltersChanged - llamando recursivamente para crear siguiente componente"),ce(_e)):console.log("onFiltersChanged - no more views needed, stopping recursion")},1e3),((ke=_e.view)==null?void 0:ke.id)===15&&at){const pt=(Ge=_e.filterAndViewsContainer)==null?void 0:Ge.getId();pt&&T.set(pt,at)}}}else _e.isAltMode?_e.viewToEdit||_e.filterAndViewsContainer.updateFilters(_e.filters,(Xe=(Re=_e.viewToEdit)==null?void 0:Re.view)==null?void 0:Xe.id):_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(et=(Ze=_e.viewToEdit)==null?void 0:Ze.view)==null?void 0:et.id),d.value=!0}else if(Ue||Ke===W.value.length-1){const nt=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],_e.view.id,_e.dynamicFilters,w.value,t.value,_e.filtersJSON,$.token,_e.filters);Ua.emit("set-filter-and-views-container",nt),s.value.set(nt.getId(),nt),_e.dynamicFilters&&Array.isArray(_e.dynamicFilters[0])?(_e.filterAndViewsContainer=nt,ce(_e)):Ua.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:nt,avoidWillFit:!1,applyMinimumSize:Ue?Ue.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),d.value=!0}}}async function ye(){if(d.value)try{const _e=[{is_front_page:!0,template_type:g.value.isPostMatch?2:1,type:g.value.id},...W.value.map(Fe=>({columns:Fe.originalPage?Fe.originalPage.columns:12,rows:Fe.originalPage?Fe.originalPage.rows:12,gap:Fe.originalPage?Fe.originalPage.gap:10,name:Fe.title,width:Fe.originalPage?Fe.originalPage.width:968,height:Fe.originalPage?Fe.originalPage.height:702,components:Fe.items.map(Je=>({min_column:Je.minWidth,min_row:Je.minHeight,max_column:Je.maxWidth,max_row:Je.maxHeight,column:Je.x,row:Je.y,colspan:Je.w,rowspan:Je.h,name:Je.name,title:Je.title,titleShort:Je.titleShort||Je.title,dynamicFilters:Je.filterAndViewsContainer.getComponentDynamicFilters(Je.id)||Je.filterAndViewsContainer.getDynamicFilters()||[],coreView:Je.coreView||null,componentName:Je.componentName,componentProps:Je.componentProps||{},isHomeTeam:Je.isHomeTeam||Je.componentProps.isHomeTeamForAnalysis,filterMultiple:Je.filterMultiple}))}))],ze=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${h.value.user_id}/templates/${h.value.id}/pages`,{method:"PATCH",headers:{Authorization:$.token},body:JSON.stringify({pages:_e})});x.value=!0,await ze.json(),d.value=!1,setTimeout(()=>{x.value=!1},2e3)}catch(_e){console.error("Error saving template:",_e)}}function xe(){W.value.forEach(_e=>{_e.offListeners&&_e.offListeners()})}function be(_e){const ze=W.value.findIndex(Fe=>Fe.id===_e.id);ze>-1&&(xe(),W.value=W.value.filter(Fe=>Fe.id!==_e.id),m.value>=ze&&(m.value=Math.max(0,m.value-1)),d.value=!0)}function Te(){d.value=!0}function Ve(_e){const ze=W.value.find(Fe=>Fe.items.some(Je=>Je.id===_e.id));if(ze){const Fe=ze.items.findIndex(Je=>Je.id===_e.id);Fe!==-1&&(ze.items.splice(Fe,1),d.value=!0)}}function Oe(_e){}return(_e,ze)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(K6e,{modelValue:b.value,"onUpdate:modelValue":ze[0]||(ze[0]=Fe=>b.value=Fe),onAction:L},null,8,["modelValue"]),n.createVNode(X6e,{"model-value":x.value},null,8,["model-value"]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[r.value&&h.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"template-maker",style:n.normalizeStyle(N.value)},[n.withDirectives(n.createVNode(U6e,{token:e.token,view:o.value,"is-post-match":w.value,onClose:he,onFiltersChanged:ce},null,8,["token","view","is-post-match"]),[[n.vShow,t.value&&f.value]]),n.createElementVNode("div",D6e,[n.createTextVNode(n.toDisplayString(h.value?h.value.name:"Nuevo template")+" ",1),n.createElementVNode("div",{class:"template-maker__header__close",onClick:ue},[_.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("svg",J6e,[...ze[6]||(ze[6]=[n.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),n.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),n.createElementVNode("div",G6e,[ze[13]||(ze[13]=n.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),n.createElementVNode("div",B6e,[n.createElementVNode("div",Z6e,[n.createElementVNode("div",H6e,[n.withDirectives(n.createVNode(GN,{"is-post-match":w.value,"initial-cover-id":v.value,onSelectCover:q},null,8,["is-post-match","initial-cover-id"]),[[n.vShow,t.value]])]),(n.openBlock(),n.createElementBlock("div",{class:"template-maker__content__main__pages",key:W.value.length},[g.value?(n.openBlock(),n.createBlock(eSe,{key:0,id:"page-0",game:h.value.game||null,"cover-id":g.value.id,"is-post-match":g.value.isPostMatch,onIntersectionChanged:ze[1]||(ze[1]=Fe=>X(Fe,-1))},null,8,["game","cover-id","is-post-match"])):n.createCommentVNode("",!0),t.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"new-items-buttons",style:n.normalizeStyle({"margin-bottom":W.value.length===0?"30px":"0"})},[f.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:ze[2]||(ze[2]=Fe=>R(-1))},[...ze[7]||(ze[7]=[n.createElementVNode("div",null,"+ Nueva página",-1),n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W.value,(Fe,Je)=>(n.openBlock(),n.createElementBlock("div",{key:Je,id:`page-${Je+1}`,class:"template-maker__content__main__pages__page"},[n.createElementVNode("div",Q6e,[n.createElementVNode("div",$6e,"Pag "+n.toDisplayString(U(Je+2)),1)]),g.value?(n.openBlock(),n.createBlock(r_e,{key:0,page:Fe,"is-template-mode":t.value,"is-post-match":g.value.isPostMatch,game:h.value.game||null,lastGames:h.value.lastGames||[],"is-filter-visible":f.value,onEditView:D,onIntersectionChanged:Ce=>X(Ce,Je),onChangeSort:Oe,onDeletePage:be,onViewChanged:Te,onDeleteView:Ve},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):n.createCommentVNode("",!0),t.value&&!f.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"new-items-buttons",style:n.normalizeStyle({"margin-bottom":Je+1===W.value.length?"30px":"0","margin-top":"10px"})},[n.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Ce=>R(Je)},[...ze[8]||(ze[8]=[n.createElementVNode("div",null,"+ Nueva página",-1),n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,e4e),n.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Ce=>K(Fe)},[...ze[9]||(ze[9]=[n.createElementVNode("div",null,"+ Agregar gráfico",-1),n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,t4e)],4)):n.createCommentVNode("",!0)],8,Y6e))),128))]))]),_.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",r4e,[n.createElementVNode("div",n4e,[n.createElementVNode("div",a4e,[n.createElementVNode("div",null,"Páginas "+n.toDisplayString(V.value),1),n.createElementVNode("div",{class:n.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value<=0}]),onClick:ze[3]||(ze[3]=Fe=>m.value>0&&j(m.value-1))},[...ze[10]||(ze[10]=[n.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.22444 5L5.29079 8.57741C5.56974 8.90285 5.56974 9.43049 5.29079 9.75592C5.01184 10.0814 4.55958 10.0814 4.28064 9.75592L0.709209 5.58926C0.430263 5.26382 0.430263 4.73618 0.709209 4.41074L4.28064 0.244078C4.55958 -0.0813593 5.01184 -0.0813592 5.29079 0.244078C5.56974 0.569515 5.56974 1.09715 5.29079 1.42259L2.22444 5Z",fill:"#92929D"})],-1)])],2),n.createElementVNode("div",{class:n.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value>=W.value.length}]),onClick:ze[4]||(ze[4]=Fe=>m.value<W.value.length&&j(m.value+1))},[...ze[11]||(ze[11]=[n.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.77556 5L0.70921 8.57741C0.430264 8.90285 0.430264 9.43049 0.70921 9.75592C0.988156 10.0814 1.44042 10.0814 1.71936 9.75592L5.29079 5.58926C5.56974 5.26382 5.56974 4.73618 5.29079 4.41074L1.71936 0.244078C1.44042 -0.0813593 0.988155 -0.0813592 0.709209 0.244078C0.430264 0.569515 0.430264 1.09715 0.70921 1.42259L3.77556 5Z",fill:"#92929D"})],-1)])],2)]),n.createElementVNode("div",i4e,[n.createElementVNode("div",{role:"button",class:n.normalizeClass({active:m.value===0}),onClick:ze[5]||(ze[5]=Fe=>j(0))},n.toDisplayString(U(1)),3),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W.value,(Fe,Je)=>(n.openBlock(),n.createElementBlock("div",{role:"button",key:Je,class:n.normalizeClass({active:Je+1===m.value}),onClick:Ce=>j(Je+1)},n.toDisplayString(U(Je+2)),11,o4e))),128))])]),t.value?(n.openBlock(),n.createElementBlock("div",{key:0,role:"button",class:n.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!d.value}]),onClick:ye},[...ze[12]||(ze[12]=[n.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n.createElementVNode("path",{d:"M12.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V3.33333C2 2.97971 2.14048 2.64057 2.39052 2.39052C2.64057 2.14048 2.97971 2 3.33333 2H10.6667L14 5.33333V12.6667C14 13.0203 13.8595 13.3594 13.6095 13.6095C13.3594 13.8595 13.0203 14 12.6667 14Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),n.createElementVNode("div",null,"Guardar",-1)])],2)):n.createCommentVNode("",!0)]))])])],4)):n.createCommentVNode("",!0)]))],64))}},l4e=jd(s4e,[["__scopeId","data-v-0334a53f"]]);function RL(e,a){return function(){return e.apply(a,arguments)}}const{toString:c4e}=Object.prototype,{getPrototypeOf:T5}=Object,{iterator:g2,toStringTag:ML}=Symbol,v2=(e=>a=>{const i=c4e.call(a);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ap=e=>(e=e.toLowerCase(),a=>v2(a)===e),b2=e=>a=>typeof a===e,{isArray:Y0}=Array,Q0=b2("undefined");function I1(e){return e!==null&&!Q0(e)&&e.constructor!==null&&!Q0(e.constructor)&&Ud(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const WL=Ap("ArrayBuffer");function u4e(e){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(e):a=e&&e.buffer&&WL(e.buffer),a}const d4e=b2("string"),Ud=b2("function"),jL=b2("number"),X1=e=>e!==null&&typeof e=="object",p4e=e=>e===!0||e===!1,x2=e=>{if(v2(e)!=="object")return!1;const a=T5(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(ML in e)&&!(g2 in e)},h4e=e=>{if(!X1(e)||I1(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},f4e=Ap("Date"),m4e=Ap("File"),y4e=Ap("Blob"),g4e=Ap("FileList"),v4e=e=>X1(e)&&Ud(e.pipe),b4e=e=>{let a;return e&&(typeof FormData=="function"&&e instanceof FormData||Ud(e.append)&&((a=v2(e))==="formdata"||a==="object"&&Ud(e.toString)&&e.toString()==="[object FormData]"))},x4e=Ap("URLSearchParams"),[w4e,_4e,S4e,T4e]=["ReadableStream","Request","Response","Headers"].map(Ap),k4e=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function D1(e,a,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let k,W;if(typeof e!="object"&&(e=[e]),Y0(e))for(k=0,W=e.length;k<W;k++)a.call(null,e[k],k,e);else{if(I1(e))return;const g=i?Object.getOwnPropertyNames(e):Object.keys(e),m=g.length;let r;for(k=0;k<m;k++)r=g[k],a.call(null,e[r],r,e)}}function KL(e,a){if(I1(e))return null;a=a.toLowerCase();const i=Object.keys(e);let k=i.length,W;for(;k-- >0;)if(W=i[k],a===W.toLowerCase())return W;return null}const zm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,AL=e=>!Q0(e)&&e!==zm;function k5(){const{caseless:e,skipUndefined:a}=AL(this)&&this||{},i={},k=(W,g)=>{const m=e&&KL(i,g)||g;x2(i[m])&&x2(W)?i[m]=k5(i[m],W):x2(W)?i[m]=k5({},W):Y0(W)?i[m]=W.slice():(!a||!Q0(W))&&(i[m]=W)};for(let W=0,g=arguments.length;W<g;W++)arguments[W]&&D1(arguments[W],k);return i}const L4e=(e,a,i,{allOwnKeys:k}={})=>(D1(a,(W,g)=>{i&&Ud(W)?e[g]=RL(W,i):e[g]=W},{allOwnKeys:k}),e),N4e=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),V4e=(e,a,i,k)=>{e.prototype=Object.create(a.prototype,k),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:a.prototype}),i&&Object.assign(e.prototype,i)},O4e=(e,a,i,k)=>{let W,g,m;const r={};if(a=a||{},e==null)return a;do{for(W=Object.getOwnPropertyNames(e),g=W.length;g-- >0;)m=W[g],(!k||k(m,e,a))&&!r[m]&&(a[m]=e[m],r[m]=!0);e=i!==!1&&T5(e)}while(e&&(!i||i(e,a))&&e!==Object.prototype);return a},q4e=(e,a,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=a.length;const k=e.indexOf(a,i);return k!==-1&&k===i},U4e=e=>{if(!e)return null;if(Y0(e))return e;let a=e.length;if(!jL(a))return null;const i=new Array(a);for(;a-- >0;)i[a]=e[a];return i},z4e=(e=>a=>e&&a instanceof e)(typeof Uint8Array<"u"&&T5(Uint8Array)),C4e=(e,a)=>{const k=(e&&e[g2]).call(e);let W;for(;(W=k.next())&&!W.done;){const g=W.value;a.call(e,g[0],g[1])}},P4e=(e,a)=>{let i;const k=[];for(;(i=e.exec(a))!==null;)k.push(i);return k},F4e=Ap("HTMLFormElement"),E4e=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,k,W){return k.toUpperCase()+W}),IL=(({hasOwnProperty:e})=>(a,i)=>e.call(a,i))(Object.prototype),R4e=Ap("RegExp"),XL=(e,a)=>{const i=Object.getOwnPropertyDescriptors(e),k={};D1(i,(W,g)=>{let m;(m=a(W,g,e))!==!1&&(k[g]=m||W)}),Object.defineProperties(e,k)},M4e=e=>{XL(e,(a,i)=>{if(Ud(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const k=e[i];if(Ud(k)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},W4e=(e,a)=>{const i={},k=W=>{W.forEach(g=>{i[g]=!0})};return Y0(e)?k(e):k(String(e).split(a)),i},j4e=()=>{},K4e=(e,a)=>e!=null&&Number.isFinite(e=+e)?e:a;function A4e(e){return!!(e&&Ud(e.append)&&e[ML]==="FormData"&&e[g2])}const I4e=e=>{const a=new Array(10),i=(k,W)=>{if(X1(k)){if(a.indexOf(k)>=0)return;if(I1(k))return k;if(!("toJSON"in k)){a[W]=k;const g=Y0(k)?[]:{};return D1(k,(m,r)=>{const h=i(m,W+1);!Q0(h)&&(g[r]=h)}),a[W]=void 0,g}}return k};return i(e,0)},X4e=Ap("AsyncFunction"),D4e=e=>e&&(X1(e)||Ud(e))&&Ud(e.then)&&Ud(e.catch),DL=((e,a)=>e?setImmediate:a?((i,k)=>(zm.addEventListener("message",({source:W,data:g})=>{W===zm&&g===i&&k.length&&k.shift()()},!1),W=>{k.push(W),zm.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Ud(zm.postMessage)),J4e=typeof queueMicrotask<"u"?queueMicrotask.bind(zm):typeof process<"u"&&process.nextTick||DL,Qn={isArray:Y0,isArrayBuffer:WL,isBuffer:I1,isFormData:b4e,isArrayBufferView:u4e,isString:d4e,isNumber:jL,isBoolean:p4e,isObject:X1,isPlainObject:x2,isEmptyObject:h4e,isReadableStream:w4e,isRequest:_4e,isResponse:S4e,isHeaders:T4e,isUndefined:Q0,isDate:f4e,isFile:m4e,isBlob:y4e,isRegExp:R4e,isFunction:Ud,isStream:v4e,isURLSearchParams:x4e,isTypedArray:z4e,isFileList:g4e,forEach:D1,merge:k5,extend:L4e,trim:k4e,stripBOM:N4e,inherits:V4e,toFlatObject:O4e,kindOf:v2,kindOfTest:Ap,endsWith:q4e,toArray:U4e,forEachEntry:C4e,matchAll:P4e,isHTMLForm:F4e,hasOwnProperty:IL,hasOwnProp:IL,reduceDescriptors:XL,freezeMethods:M4e,toObjectSet:W4e,toCamelCase:E4e,noop:j4e,toFiniteNumber:K4e,findKey:KL,global:zm,isContextDefined:AL,isSpecCompliantForm:A4e,toJSONObject:I4e,isAsyncFn:X4e,isThenable:D4e,setImmediate:DL,asap:J4e,isIterable:e=>e!=null&&Ud(e[g2])};function fo(e,a,i,k,W){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",a&&(this.code=a),i&&(this.config=i),k&&(this.request=k),W&&(this.response=W,this.status=W.status?W.status:null)}Qn.inherits(fo,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Qn.toJSONObject(this.config),code:this.code,status:this.status}}});const JL=fo.prototype,GL={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{GL[e]={value:e}}),Object.defineProperties(fo,GL),Object.defineProperty(JL,"isAxiosError",{value:!0}),fo.from=(e,a,i,k,W,g)=>{const m=Object.create(JL);Qn.toFlatObject(e,m,function(t){return t!==Error.prototype},l=>l!=="isAxiosError");const r=e&&e.message?e.message:"Error",h=a==null&&e?e.code:a;return fo.call(m,r,h,i,k,W),e&&m.cause==null&&Object.defineProperty(m,"cause",{value:e,configurable:!0}),m.name=e&&e.name||"Error",g&&Object.assign(m,g),m};const G4e=null;function L5(e){return Qn.isPlainObject(e)||Qn.isArray(e)}function BL(e){return Qn.endsWith(e,"[]")?e.slice(0,-2):e}function ZL(e,a,i){return e?e.concat(a).map(function(W,g){return W=BL(W),!i&&g?"["+W+"]":W}).join(i?".":""):a}function B4e(e){return Qn.isArray(e)&&!e.some(L5)}const Z4e=Qn.toFlatObject(Qn,{},null,function(a){return/^is[A-Z]/.test(a)});function w2(e,a,i){if(!Qn.isObject(e))throw new TypeError("target must be an object");a=a||new FormData,i=Qn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,s){return!Qn.isUndefined(s[o])});const k=i.metaTokens,W=i.visitor||t,g=i.dots,m=i.indexes,h=(i.Blob||typeof Blob<"u"&&Blob)&&Qn.isSpecCompliantForm(a);if(!Qn.isFunction(W))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(Qn.isDate(f))return f.toISOString();if(Qn.isBoolean(f))return f.toString();if(!h&&Qn.isBlob(f))throw new fo("Blob is not supported. Use a Buffer instead.");return Qn.isArrayBuffer(f)||Qn.isTypedArray(f)?h&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function t(f,o,s){let p=f;if(f&&!s&&typeof f=="object"){if(Qn.endsWith(o,"{}"))o=k?o:o.slice(0,-2),f=JSON.stringify(f);else if(Qn.isArray(f)&&B4e(f)||(Qn.isFileList(f)||Qn.endsWith(o,"[]"))&&(p=Qn.toArray(f)))return o=BL(o),p.forEach(function(d,b){!(Qn.isUndefined(d)||d===null)&&a.append(m===!0?ZL([o],b,g):m===null?o:o+"[]",l(d))}),!1}return L5(f)?!0:(a.append(ZL(s,o,g),l(f)),!1)}const _=[],w=Object.assign(Z4e,{defaultVisitor:t,convertValue:l,isVisitable:L5});function v(f,o){if(!Qn.isUndefined(f)){if(_.indexOf(f)!==-1)throw Error("Circular reference detected in "+o.join("."));_.push(f),Qn.forEach(f,function(p,c){(!(Qn.isUndefined(p)||p===null)&&W.call(a,p,Qn.isString(c)?c.trim():c,o,w))===!0&&v(p,o?o.concat(c):[c])}),_.pop()}}if(!Qn.isObject(e))throw new TypeError("data must be an object");return v(e),a}function HL(e){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(k){return a[k]})}function N5(e,a){this._pairs=[],e&&w2(e,this,a)}const YL=N5.prototype;YL.append=function(a,i){this._pairs.push([a,i])},YL.toString=function(a){const i=a?function(k){return a.call(this,k,HL)}:HL;return this._pairs.map(function(W){return i(W[0])+"="+i(W[1])},"").join("&")};function H4e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function QL(e,a,i){if(!a)return e;const k=i&&i.encode||H4e;Qn.isFunction(i)&&(i={serialize:i});const W=i&&i.serialize;let g;if(W?g=W(a,i):g=Qn.isURLSearchParams(a)?a.toString():new N5(a,i).toString(k),g){const m=e.indexOf("#");m!==-1&&(e=e.slice(0,m)),e+=(e.indexOf("?")===-1?"?":"&")+g}return e}class $L{constructor(){this.handlers=[]}use(a,i,k){return this.handlers.push({fulfilled:a,rejected:i,synchronous:k?k.synchronous:!1,runWhen:k?k.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){Qn.forEach(this.handlers,function(k){k!==null&&a(k)})}}const eN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Y4e={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:N5,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},V5=typeof window<"u"&&typeof document<"u",O5=typeof navigator=="object"&&navigator||void 0,Q4e=V5&&(!O5||["ReactNative","NativeScript","NS"].indexOf(O5.product)<0),$4e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",eke=V5&&window.location.href||"http://localhost",Gu={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:V5,hasStandardBrowserEnv:Q4e,hasStandardBrowserWebWorkerEnv:$4e,navigator:O5,origin:eke},Symbol.toStringTag,{value:"Module"})),...Y4e};function tke(e,a){return w2(e,new Gu.classes.URLSearchParams,{visitor:function(i,k,W,g){return Gu.isNode&&Qn.isBuffer(i)?(this.append(k,i.toString("base64")),!1):g.defaultVisitor.apply(this,arguments)},...a})}function rke(e){return Qn.matchAll(/\w+|\[(\w*)]/g,e).map(a=>a[0]==="[]"?"":a[1]||a[0])}function nke(e){const a={},i=Object.keys(e);let k;const W=i.length;let g;for(k=0;k<W;k++)g=i[k],a[g]=e[g];return a}function tN(e){function a(i,k,W,g){let m=i[g++];if(m==="__proto__")return!0;const r=Number.isFinite(+m),h=g>=i.length;return m=!m&&Qn.isArray(W)?W.length:m,h?(Qn.hasOwnProp(W,m)?W[m]=[W[m],k]:W[m]=k,!r):((!W[m]||!Qn.isObject(W[m]))&&(W[m]=[]),a(i,k,W[m],g)&&Qn.isArray(W[m])&&(W[m]=nke(W[m])),!r)}if(Qn.isFormData(e)&&Qn.isFunction(e.entries)){const i={};return Qn.forEachEntry(e,(k,W)=>{a(rke(k),W,i,0)}),i}return null}function ake(e,a,i){if(Qn.isString(e))try{return(a||JSON.parse)(e),Qn.trim(e)}catch(k){if(k.name!=="SyntaxError")throw k}return(i||JSON.stringify)(e)}const J1={transitional:eN,adapter:["xhr","http","fetch"],transformRequest:[function(a,i){const k=i.getContentType()||"",W=k.indexOf("application/json")>-1,g=Qn.isObject(a);if(g&&Qn.isHTMLForm(a)&&(a=new FormData(a)),Qn.isFormData(a))return W?JSON.stringify(tN(a)):a;if(Qn.isArrayBuffer(a)||Qn.isBuffer(a)||Qn.isStream(a)||Qn.isFile(a)||Qn.isBlob(a)||Qn.isReadableStream(a))return a;if(Qn.isArrayBufferView(a))return a.buffer;if(Qn.isURLSearchParams(a))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),a.toString();let r;if(g){if(k.indexOf("application/x-www-form-urlencoded")>-1)return tke(a,this.formSerializer).toString();if((r=Qn.isFileList(a))||k.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return w2(r?{"files[]":a}:a,h&&new h,this.formSerializer)}}return g||W?(i.setContentType("application/json",!1),ake(a)):a}],transformResponse:[function(a){const i=this.transitional||J1.transitional,k=i&&i.forcedJSONParsing,W=this.responseType==="json";if(Qn.isResponse(a)||Qn.isReadableStream(a))return a;if(a&&Qn.isString(a)&&(k&&!this.responseType||W)){const m=!(i&&i.silentJSONParsing)&&W;try{return JSON.parse(a,this.parseReviver)}catch(r){if(m)throw r.name==="SyntaxError"?fo.from(r,fo.ERR_BAD_RESPONSE,this,null,this.response):r}}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gu.classes.FormData,Blob:Gu.classes.Blob},validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qn.forEach(["delete","get","head","post","put","patch"],e=>{J1.headers[e]={}});const ike=Qn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oke=e=>{const a={};let i,k,W;return e&&e.split(`
|
|
4127
4127
|
`).forEach(function(m){W=m.indexOf(":"),i=m.substring(0,W).trim().toLowerCase(),k=m.substring(W+1).trim(),!(!i||a[i]&&ike[i])&&(i==="set-cookie"?a[i]?a[i].push(k):a[i]=[k]:a[i]=a[i]?a[i]+", "+k:k)}),a},rN=Symbol("internals");function G1(e){return e&&String(e).trim().toLowerCase()}function _2(e){return e===!1||e==null?e:Qn.isArray(e)?e.map(_2):String(e)}function ske(e){const a=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let k;for(;k=i.exec(e);)a[k[1]]=k[2];return a}const lke=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function q5(e,a,i,k,W){if(Qn.isFunction(k))return k.call(this,a,i);if(W&&(a=i),!!Qn.isString(a)){if(Qn.isString(k))return a.indexOf(k)!==-1;if(Qn.isRegExp(k))return k.test(a)}}function cke(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(a,i,k)=>i.toUpperCase()+k)}function uke(e,a){const i=Qn.toCamelCase(" "+a);["get","set","has"].forEach(k=>{Object.defineProperty(e,k+i,{value:function(W,g,m){return this[k].call(this,a,W,g,m)},configurable:!0})})}let zd=class{constructor(a){a&&this.set(a)}set(a,i,k){const W=this;function g(r,h,l){const t=G1(h);if(!t)throw new Error("header name must be a non-empty string");const _=Qn.findKey(W,t);(!_||W[_]===void 0||l===!0||l===void 0&&W[_]!==!1)&&(W[_||h]=_2(r))}const m=(r,h)=>Qn.forEach(r,(l,t)=>g(l,t,h));if(Qn.isPlainObject(a)||a instanceof this.constructor)m(a,i);else if(Qn.isString(a)&&(a=a.trim())&&!lke(a))m(oke(a),i);else if(Qn.isObject(a)&&Qn.isIterable(a)){let r={},h,l;for(const t of a){if(!Qn.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[l=t[0]]=(h=r[l])?Qn.isArray(h)?[...h,t[1]]:[h,t[1]]:t[1]}m(r,i)}else a!=null&&g(i,a,k);return this}get(a,i){if(a=G1(a),a){const k=Qn.findKey(this,a);if(k){const W=this[k];if(!i)return W;if(i===!0)return ske(W);if(Qn.isFunction(i))return i.call(this,W,k);if(Qn.isRegExp(i))return i.exec(W);throw new TypeError("parser must be boolean|regexp|function")}}}has(a,i){if(a=G1(a),a){const k=Qn.findKey(this,a);return!!(k&&this[k]!==void 0&&(!i||q5(this,this[k],k,i)))}return!1}delete(a,i){const k=this;let W=!1;function g(m){if(m=G1(m),m){const r=Qn.findKey(k,m);r&&(!i||q5(k,k[r],r,i))&&(delete k[r],W=!0)}}return Qn.isArray(a)?a.forEach(g):g(a),W}clear(a){const i=Object.keys(this);let k=i.length,W=!1;for(;k--;){const g=i[k];(!a||q5(this,this[g],g,a,!0))&&(delete this[g],W=!0)}return W}normalize(a){const i=this,k={};return Qn.forEach(this,(W,g)=>{const m=Qn.findKey(k,g);if(m){i[m]=_2(W),delete i[g];return}const r=a?cke(g):String(g).trim();r!==g&&delete i[g],i[r]=_2(W),k[r]=!0}),this}concat(...a){return this.constructor.concat(this,...a)}toJSON(a){const i=Object.create(null);return Qn.forEach(this,(k,W)=>{k!=null&&k!==!1&&(i[W]=a&&Qn.isArray(k)?k.join(", "):k)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([a,i])=>a+": "+i).join(`
|
|
4128
4128
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a,...i){const k=new this(a);return i.forEach(W=>k.set(W)),k}static accessor(a){const k=(this[rN]=this[rN]={accessors:{}}).accessors,W=this.prototype;function g(m){const r=G1(m);k[r]||(uke(W,m),k[r]=!0)}return Qn.isArray(a)?a.forEach(g):g(a),this}};zd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Qn.reduceDescriptors(zd.prototype,({value:e},a)=>{let i=a[0].toUpperCase()+a.slice(1);return{get:()=>e,set(k){this[i]=k}}}),Qn.freezeMethods(zd);function U5(e,a){const i=this||J1,k=a||i,W=zd.from(k.headers);let g=k.data;return Qn.forEach(e,function(r){g=r.call(i,g,W.normalize(),a?a.status:void 0)}),W.normalize(),g}function nN(e){return!!(e&&e.__CANCEL__)}function $0(e,a,i){fo.call(this,e??"canceled",fo.ERR_CANCELED,a,i),this.name="CanceledError"}Qn.inherits($0,fo,{__CANCEL__:!0});function aN(e,a,i){const k=i.config.validateStatus;!i.status||!k||k(i.status)?e(i):a(new fo("Request failed with status code "+i.status,[fo.ERR_BAD_REQUEST,fo.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function dke(e){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return a&&a[1]||""}function pke(e,a){e=e||10;const i=new Array(e),k=new Array(e);let W=0,g=0,m;return a=a!==void 0?a:1e3,function(h){const l=Date.now(),t=k[g];m||(m=l),i[W]=h,k[W]=l;let _=g,w=0;for(;_!==W;)w+=i[_++],_=_%e;if(W=(W+1)%e,W===g&&(g=(g+1)%e),l-m<a)return;const v=t&&l-t;return v?Math.round(w*1e3/v):void 0}}function hke(e,a){let i=0,k=1e3/a,W,g;const m=(l,t=Date.now())=>{i=t,W=null,g&&(clearTimeout(g),g=null),e(...l)};return[(...l)=>{const t=Date.now(),_=t-i;_>=k?m(l,t):(W=l,g||(g=setTimeout(()=>{g=null,m(W)},k-_)))},()=>W&&m(W)]}const S2=(e,a,i=3)=>{let k=0;const W=pke(50,250);return hke(g=>{const m=g.loaded,r=g.lengthComputable?g.total:void 0,h=m-k,l=W(h),t=m<=r;k=m;const _={loaded:m,total:r,progress:r?m/r:void 0,bytes:h,rate:l||void 0,estimated:l&&r&&t?(r-m)/l:void 0,event:g,lengthComputable:r!=null,[a?"download":"upload"]:!0};e(_)},i)},iN=(e,a)=>{const i=e!=null;return[k=>a[0]({lengthComputable:i,total:e,loaded:k}),a[1]]},oN=e=>(...a)=>Qn.asap(()=>e(...a)),fke=Gu.hasStandardBrowserEnv?((e,a)=>i=>(i=new URL(i,Gu.origin),e.protocol===i.protocol&&e.host===i.host&&(a||e.port===i.port)))(new URL(Gu.origin),Gu.navigator&&/(msie|trident)/i.test(Gu.navigator.userAgent)):()=>!0,mke=Gu.hasStandardBrowserEnv?{write(e,a,i,k,W,g,m){if(typeof document>"u")return;const r=[`${e}=${encodeURIComponent(a)}`];Qn.isNumber(i)&&r.push(`expires=${new Date(i).toUTCString()}`),Qn.isString(k)&&r.push(`path=${k}`),Qn.isString(W)&&r.push(`domain=${W}`),g===!0&&r.push("secure"),Qn.isString(m)&&r.push(`SameSite=${m}`),document.cookie=r.join("; ")},read(e){if(typeof document>"u")return null;const a=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return a?decodeURIComponent(a[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function yke(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function gke(e,a){return a?e.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):e}function sN(e,a,i){let k=!yke(a);return e&&(k||i==!1)?gke(e,a):a}const lN=e=>e instanceof zd?{...e}:e;function Cm(e,a){a=a||{};const i={};function k(l,t,_,w){return Qn.isPlainObject(l)&&Qn.isPlainObject(t)?Qn.merge.call({caseless:w},l,t):Qn.isPlainObject(t)?Qn.merge({},t):Qn.isArray(t)?t.slice():t}function W(l,t,_,w){if(Qn.isUndefined(t)){if(!Qn.isUndefined(l))return k(void 0,l,_,w)}else return k(l,t,_,w)}function g(l,t){if(!Qn.isUndefined(t))return k(void 0,t)}function m(l,t){if(Qn.isUndefined(t)){if(!Qn.isUndefined(l))return k(void 0,l)}else return k(void 0,t)}function r(l,t,_){if(_ in a)return k(l,t);if(_ in e)return k(void 0,l)}const h={url:g,method:g,data:g,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:r,headers:(l,t,_)=>W(lN(l),lN(t),_,!0)};return Qn.forEach(Object.keys({...e,...a}),function(t){const _=h[t]||W,w=_(e[t],a[t],t);Qn.isUndefined(w)&&_!==r||(i[t]=w)}),i}const cN=e=>{const a=Cm({},e);let{data:i,withXSRFToken:k,xsrfHeaderName:W,xsrfCookieName:g,headers:m,auth:r}=a;if(a.headers=m=zd.from(m),a.url=QL(sN(a.baseURL,a.url,a.allowAbsoluteUrls),e.params,e.paramsSerializer),r&&m.set("Authorization","Basic "+btoa((r.username||"")+":"+(r.password?unescape(encodeURIComponent(r.password)):""))),Qn.isFormData(i)){if(Gu.hasStandardBrowserEnv||Gu.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(Qn.isFunction(i.getHeaders)){const h=i.getHeaders(),l=["content-type","content-length"];Object.entries(h).forEach(([t,_])=>{l.includes(t.toLowerCase())&&m.set(t,_)})}}if(Gu.hasStandardBrowserEnv&&(k&&Qn.isFunction(k)&&(k=k(a)),k||k!==!1&&fke(a.url))){const h=W&&g&&mke.read(g);h&&m.set(W,h)}return a},vke=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(i,k){const W=cN(e);let g=W.data;const m=zd.from(W.headers).normalize();let{responseType:r,onUploadProgress:h,onDownloadProgress:l}=W,t,_,w,v,f;function o(){v&&v(),f&&f(),W.cancelToken&&W.cancelToken.unsubscribe(t),W.signal&&W.signal.removeEventListener("abort",t)}let s=new XMLHttpRequest;s.open(W.method.toUpperCase(),W.url,!0),s.timeout=W.timeout;function p(){if(!s)return;const d=zd.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),x={data:!r||r==="text"||r==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:d,config:e,request:s};aN(function(N){i(N),o()},function(N){k(N),o()},x),s=null}"onloadend"in s?s.onloadend=p:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(p)},s.onabort=function(){s&&(k(new fo("Request aborted",fo.ECONNABORTED,e,s)),s=null)},s.onerror=function(b){const x=b&&b.message?b.message:"Network Error",T=new fo(x,fo.ERR_NETWORK,e,s);T.event=b||null,k(T),s=null},s.ontimeout=function(){let b=W.timeout?"timeout of "+W.timeout+"ms exceeded":"timeout exceeded";const x=W.transitional||eN;W.timeoutErrorMessage&&(b=W.timeoutErrorMessage),k(new fo(b,x.clarifyTimeoutError?fo.ETIMEDOUT:fo.ECONNABORTED,e,s)),s=null},g===void 0&&m.setContentType(null),"setRequestHeader"in s&&Qn.forEach(m.toJSON(),function(b,x){s.setRequestHeader(x,b)}),Qn.isUndefined(W.withCredentials)||(s.withCredentials=!!W.withCredentials),r&&r!=="json"&&(s.responseType=W.responseType),l&&([w,f]=S2(l,!0),s.addEventListener("progress",w)),h&&s.upload&&([_,v]=S2(h),s.upload.addEventListener("progress",_),s.upload.addEventListener("loadend",v)),(W.cancelToken||W.signal)&&(t=d=>{s&&(k(!d||d.type?new $0(null,e,s):d),s.abort(),s=null)},W.cancelToken&&W.cancelToken.subscribe(t),W.signal&&(W.signal.aborted?t():W.signal.addEventListener("abort",t)));const c=dke(W.url);if(c&&Gu.protocols.indexOf(c)===-1){k(new fo("Unsupported protocol "+c+":",fo.ERR_BAD_REQUEST,e));return}s.send(g||null)})},bke=(e,a)=>{const{length:i}=e=e?e.filter(Boolean):[];if(a||i){let k=new AbortController,W;const g=function(l){if(!W){W=!0,r();const t=l instanceof Error?l:this.reason;k.abort(t instanceof fo?t:new $0(t instanceof Error?t.message:t))}};let m=a&&setTimeout(()=>{m=null,g(new fo(`timeout ${a} of ms exceeded`,fo.ETIMEDOUT))},a);const r=()=>{e&&(m&&clearTimeout(m),m=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(g):l.removeEventListener("abort",g)}),e=null)};e.forEach(l=>l.addEventListener("abort",g));const{signal:h}=k;return h.unsubscribe=()=>Qn.asap(r),h}},xke=function*(e,a){let i=e.byteLength;if(i<a){yield e;return}let k=0,W;for(;k<i;)W=k+a,yield e.slice(k,W),k=W},wke=async function*(e,a){for await(const i of _ke(e))yield*xke(i,a)},_ke=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const a=e.getReader();try{for(;;){const{done:i,value:k}=await a.read();if(i)break;yield k}}finally{await a.cancel()}},uN=(e,a,i,k)=>{const W=wke(e,a);let g=0,m,r=h=>{m||(m=!0,k&&k(h))};return new ReadableStream({async pull(h){try{const{done:l,value:t}=await W.next();if(l){r(),h.close();return}let _=t.byteLength;if(i){let w=g+=_;i(w)}h.enqueue(new Uint8Array(t))}catch(l){throw r(l),l}},cancel(h){return r(h),W.return()}},{highWaterMark:2})},dN=64*1024,{isFunction:T2}=Qn,Ske=(({Request:e,Response:a})=>({Request:e,Response:a}))(Qn.global),{ReadableStream:pN,TextEncoder:hN}=Qn.global,fN=(e,...a)=>{try{return!!e(...a)}catch{return!1}},Tke=e=>{e=Qn.merge.call({skipUndefined:!0},Ske,e);const{fetch:a,Request:i,Response:k}=e,W=a?T2(a):typeof fetch=="function",g=T2(i),m=T2(k);if(!W)return!1;const r=W&&T2(pN),h=W&&(typeof hN=="function"?(f=>o=>f.encode(o))(new hN):async f=>new Uint8Array(await new i(f).arrayBuffer())),l=g&&r&&fN(()=>{let f=!1;const o=new i(Gu.origin,{body:new pN,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!o}),t=m&&r&&fN(()=>Qn.isReadableStream(new k("").body)),_={stream:t&&(f=>f.body)};W&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!_[f]&&(_[f]=(o,s)=>{let p=o&&o[f];if(p)return p.call(o);throw new fo(`Response type '${f}' is not supported`,fo.ERR_NOT_SUPPORT,s)})});const w=async f=>{if(f==null)return 0;if(Qn.isBlob(f))return f.size;if(Qn.isSpecCompliantForm(f))return(await new i(Gu.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(Qn.isArrayBufferView(f)||Qn.isArrayBuffer(f))return f.byteLength;if(Qn.isURLSearchParams(f)&&(f=f+""),Qn.isString(f))return(await h(f)).byteLength},v=async(f,o)=>{const s=Qn.toFiniteNumber(f.getContentLength());return s??w(o)};return async f=>{let{url:o,method:s,data:p,signal:c,cancelToken:d,timeout:b,onDownloadProgress:x,onUploadProgress:T,responseType:N,headers:V,withCredentials:U="same-origin",fetchOptions:z}=cN(f),O=a||fetch;N=N?(N+"").toLowerCase():"text";let C=bke([c,d&&d.toAbortSignal()],b),q=null;const L=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let P;try{if(T&&l&&s!=="get"&&s!=="head"&&(P=await v(V,p))!==0){let X=new i(o,{method:"POST",body:p,duplex:"half"}),D;if(Qn.isFormData(p)&&(D=X.headers.get("content-type"))&&V.setContentType(D),X.body){const[H,ne]=iN(P,S2(oN(T)));p=uN(X.body,dN,H,ne)}}Qn.isString(U)||(U=U?"include":"omit");const S=g&&"credentials"in i.prototype,F={...z,signal:C,method:s.toUpperCase(),headers:V.normalize().toJSON(),body:p,duplex:"half",credentials:S?U:void 0};q=g&&new i(o,F);let R=await(g?O(q,z):O(o,F));const j=t&&(N==="stream"||N==="response");if(t&&(x||j&&L)){const X={};["status","statusText","headers"].forEach(G=>{X[G]=R[G]});const D=Qn.toFiniteNumber(R.headers.get("content-length")),[H,ne]=x&&iN(D,S2(oN(x),!0))||[];R=new k(uN(R.body,dN,H,()=>{ne&&ne(),L&&L()}),X)}N=N||"text";let K=await _[Qn.findKey(_,N)||"text"](R,f);return!j&&L&&L(),await new Promise((X,D)=>{aN(X,D,{data:K,headers:zd.from(R.headers),status:R.status,statusText:R.statusText,config:f,request:q})})}catch(S){throw L&&L(),S&&S.name==="TypeError"&&/Load failed|fetch/i.test(S.message)?Object.assign(new fo("Network Error",fo.ERR_NETWORK,f,q),{cause:S.cause||S}):fo.from(S,S&&S.code,f,q)}}},kke=new Map,mN=e=>{let a=e&&e.env||{};const{fetch:i,Request:k,Response:W}=a,g=[k,W,i];let m=g.length,r=m,h,l,t=kke;for(;r--;)h=g[r],l=t.get(h),l===void 0&&t.set(h,l=r?new Map:Tke(a)),t=l;return l};mN();const z5={http:G4e,xhr:vke,fetch:{get:mN}};Qn.forEach(z5,(e,a)=>{if(e){try{Object.defineProperty(e,"name",{value:a})}catch{}Object.defineProperty(e,"adapterName",{value:a})}});const yN=e=>`- ${e}`,Lke=e=>Qn.isFunction(e)||e===null||e===!1;function Nke(e,a){e=Qn.isArray(e)?e:[e];const{length:i}=e;let k,W;const g={};for(let m=0;m<i;m++){k=e[m];let r;if(W=k,!Lke(k)&&(W=z5[(r=String(k)).toLowerCase()],W===void 0))throw new fo(`Unknown adapter '${r}'`);if(W&&(Qn.isFunction(W)||(W=W.get(a))))break;g[r||"#"+m]=W}if(!W){const m=Object.entries(g).map(([h,l])=>`adapter ${h} `+(l===!1?"is not supported by the environment":"is not available in the build"));let r=i?m.length>1?`since :
|
|
4129
4129
|
`+m.map(yN).join(`
|