@golstats/gsc-reports 1.0.133 → 1.0.134

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.
@@ -7990,7 +7990,7 @@ uniform ${gi} ${vi} u_${$i};
7990
7990
  * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
7991
7991
  */const d_=new pHt;class Rh{static init(r={},n=".grid-stack"){if(typeof document>"u")return null;const y=Rh.getGridElement(n);return y?(y.gridstack||(y.gridstack=new Rh(y,ru.cloneDeep(r))),y.gridstack):(console.error(typeof n=="string"?'GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
7992
7992
  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(r={},n=".grid-stack"){const y=[];return typeof document>"u"||(Rh.getGridElements(n).forEach($=>{$.gridstack||($.gridstack=new Rh($,ru.cloneDeep(r))),y.push($.gridstack)}),y.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
7993
- Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),y}static addGrid(r,n={}){if(!r)return null;let y=r;if(y.gridstack){const $=y.gridstack;return n&&($.opts={...$.opts,...n}),n.children!==void 0&&$.load(n.children),$}return(!r.classList.contains("grid-stack")||Rh.addRemoveCB)&&(Rh.addRemoveCB?y=Rh.addRemoveCB(r,n,!0,!0):y=ru.createDiv(["grid-stack",n.class],r)),Rh.init(n,y)}static registerEngine(r){Rh.engineClass=r}get placeholder(){if(!this._placeholder){this._placeholder=ru.createDiv([this.opts.placeholderClass,S3.itemClass,this.opts.itemClass]);const r=ru.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(r.textContent=this.opts.placeholderText)}return this._placeholder}constructor(r,n={}){var y;this.el=r,this.opts=n,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},r.gridstack=this,this.opts=n=n||{},r.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),n.row&&(n.minRow=n.maxRow=n.row,delete n.row);const $=ru.toNumber(r.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const f=n.columnOpts;if(f){const a=f.breakpoints;!f.columnWidth&&!(a!=null&&a.length)?delete n.columnOpts:(f.columnMax=f.columnMax||12,(a==null?void 0:a.length)>1&&a.sort((S,T)=>(T.w||0)-(S.w||0)))}const u={...ru.cloneDeep(S3),column:ru.toNumber(r.getAttribute("gs-column"))||S3.column,minRow:$||ru.toNumber(r.getAttribute("gs-min-row"))||S3.minRow,maxRow:$||ru.toNumber(r.getAttribute("gs-max-row"))||S3.maxRow,staticGrid:ru.toBool(r.getAttribute("gs-static"))||S3.staticGrid,sizeToContent:ru.toBool(r.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||S3.draggable.handle},removableOptions:{accept:n.itemClass||S3.removableOptions.accept,decline:S3.removableOptions.decline}};r.getAttribute("gs-animate")&&(u.animate=ru.toBool(r.getAttribute("gs-animate"))),n=ru.defaults(n,u),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(n),n.rtl==="auto"&&(n.rtl=r.style.direction==="rtl"),n.rtl&&this.el.classList.add("grid-stack-rtl");const i=this.el.closest("."+S3.itemClass),d=i==null?void 0:i.gridstackNode;if(d&&(d.subGrid=this,this.parentGridNode=d,this.el.classList.add("grid-stack-nested"),d.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=n.cellHeight==="auto",this._isAutoCellHeight||n.cellHeight==="initial")this.cellHeight(void 0);else{typeof n.cellHeight=="number"&&n.cellHeightUnit&&n.cellHeightUnit!==S3.cellHeightUnit&&(n.cellHeight=n.cellHeight+n.cellHeightUnit,delete n.cellHeightUnit);const a=n.cellHeight;delete n.cellHeight,this.cellHeight(a)}n.alwaysShowResizeHandle==="mobile"&&(n.alwaysShowResizeHandle=Hw),this._setStaticClass();const l=n.engineClass||Rh.engineClass||A4;if(this.engine=new l({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:a=>{a.forEach(S=>{const T=S.el;T&&(S._removeDOM?(T&&T.remove(),delete S._removeDOM):this._writePosAttr(T,S))}),this._updateContainerHeight()}}),n.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(a=>this._prepareElement(a)),delete this.engine._loading,this.batchUpdate(!1)),n.children){const a=n.children;delete n.children,a.length&&this.load(a)}this.setAnimation(),n.subGridDynamic&&!Of.pauseDrag&&(Of.pauseDrag=!0),((y=n.draggable)==null?void 0:y.pause)!==void 0&&(Of.pauseDrag=n.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(r=this.opts){this.el.classList.add("gs-"+r.column),typeof r.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/r.column}%`)}addWidget(r){if(!r)return;if(typeof r=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(r.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(r);let n,y=r;if(y.grid=this,y.el?n=y.el:Rh.addRemoveCB?n=Rh.addRemoveCB(this.el,r,!0,!1):n=this.createWidgetDivs(y),!n)return;if(y=n.gridstackNode,y&&n.parentElement===this.el&&this.engine.nodes.find(f=>f._id===y._id))return n;const $=this._readAttr(n);return ru.defaults(r,$),this.engine.prepareNode(r),this.el.appendChild(n),this.makeWidget(n,r),n}createWidgetDivs(r){const n=ru.createDiv(["grid-stack-item",this.opts.itemClass]),y=ru.createDiv(["grid-stack-item-content"],n);return ru.lazyLoad(r)?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([$])=>{var f,u;$.isIntersecting&&((f=r.visibleObservable)==null||f.disconnect(),delete r.visibleObservable,Rh.renderCB(y,r),(u=r.grid)==null||u.prepareDragDrop(r.el))}),window.setTimeout(()=>{var $;return($=r.visibleObservable)==null?void 0:$.observe(n)})):Rh.renderCB(y,r),n}makeSubGrid(r,n,y,$=!0){var f,u,i;let d=r.gridstackNode;if(d||(d=this.makeWidget(r).gridstackNode),(f=d.subGrid)!=null&&f.el)return d.subGrid;let l,a=this;for(;a&&!l;)l=(u=a.opts)==null?void 0:u.subGridOpts,a=(i=a.parentGridNode)==null?void 0:i.grid;n=ru.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...n||d.subGridOpts||{}}),d.subGridOpts=n;let S;n.column==="auto"&&(S=!0,n.column=Math.max(d.w||1,(y==null?void 0:y.w)||1),delete n.columnOpts);let T=d.el.querySelector(".grid-stack-item-content"),b,p;if($&&(this._removeDD(d.el),p={...d,x:0,y:0},ru.removeInternalForSave(p),delete p.subGridOpts,d.content&&(p.content=d.content,delete d.content),Rh.addRemoveCB?b=Rh.addRemoveCB(this.el,p,!0,!1):(b=ru.createDiv(["grid-stack-item"]),b.appendChild(T),T=ru.createDiv(["grid-stack-item-content"],d.el)),this.prepareDragDrop(d.el)),y){const c=S?n.column:d.w,o=d.h+y.h,h=d.el.style;h.transition="none",this.update(d.el,{w:c,h:o}),setTimeout(()=>h.transition=null)}const s=d.subGrid=Rh.addGrid(T,n);return y!=null&&y._moving&&(s._isTemp=!0),S&&(s._autoColumn=!0),$&&s.makeWidget(b,p),y&&(y._moving?window.setTimeout(()=>ru.simulateMouseEvent(y._event,"mouseenter",s.el),0):s.makeWidget(d.el,d)),this.resizeToContentCheck(!1,d),s}removeAsSubGrid(r){var n;const y=(n=this.parentGridNode)==null?void 0:n.grid;y&&(y.batchUpdate(),y.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach($=>{$.x+=this.parentGridNode.x,$.y+=this.parentGridNode.y,y.makeWidget($.el,$)}),y.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,r&&window.setTimeout(()=>ru.simulateMouseEvent(r._event,"mouseenter",y.el),0))}save(r=!0,n=!1,y=Rh.saveCB,$){const f=this.engine.save(r,y,$);if(f.forEach(u=>{var i;if(r&&u.el&&!u.subGrid&&!y){const d=u.el.querySelector(".grid-stack-item-content");u.content=d==null?void 0:d.innerHTML,u.content||delete u.content}else if(!r&&!y&&delete u.content,(i=u.subGrid)!=null&&i.el){const d=u.w||u.subGrid.getColumn(),l=u.subGrid.save(r,n,y,d);u.subGridOpts=n?l:{children:l},delete u.subGrid}delete u.el}),n){const u=ru.cloneDeep(this.opts);u.marginBottom===u.marginTop&&u.marginRight===u.marginLeft&&u.marginTop===u.marginRight&&(u.margin=u.marginTop,delete u.marginTop,delete u.marginRight,delete u.marginBottom,delete u.marginLeft),u.rtl===(this.el.style.direction==="rtl")&&(u.rtl="auto"),this._isAutoCellHeight&&(u.cellHeight="auto"),this._autoColumn&&(u.column="auto");const i=u._alwaysShowResizeHandle;return delete u._alwaysShowResizeHandle,i!==void 0?u.alwaysShowResizeHandle=i:delete u.alwaysShowResizeHandle,ru.removeInternalAndSame(u,S3),u.children=f,u}return f}load(r,n=Rh.addRemoveCB||!0){r=ru.cloneDeep(r);const y=this.getColumn();r.forEach(a=>{a.w=a.w||a.minW||1,a.h=a.h||a.minH||1}),r=ru.sort(r),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let $=0;r.forEach(a=>{$=Math.max($,(a.x||0)+a.w)}),$>this.engine.defaultColumn&&(this.engine.defaultColumn=$),$>y&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=r,this.engine.columnChanged($,y,this.responseLayout),r=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(r,$,!0));const f=Rh.addRemoveCB;typeof n=="function"&&(Rh.addRemoveCB=n);const u=[];this.batchUpdate();const i=!this.engine.nodes.length,d=i&&this.opts.animate;d&&this.setAnimation(!1),!i&&n&&[...this.engine.nodes].forEach(a=>{a.id&&(ru.find(r,a.id)||(Rh.addRemoveCB&&Rh.addRemoveCB(this.el,a,!1,!1),u.push(a),this.removeWidget(a.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(a=>ru.find(r,a.id)?(l.push(a),!1):!0),r.forEach(a=>{var S;const T=ru.find(l,a.id);if(T){if(ru.shouldSizeToContent(T)&&(a.h=T.h),this.engine.nodeBoundFix(a),(a.autoPosition||a.x===void 0||a.y===void 0)&&(a.w=a.w||T.w,a.h=a.h||T.h,this.engine.findEmptyPosition(a)),this.engine.nodes.push(T),ru.samePos(T,a)&&this.engine.nodes.length>1&&(this.moveNode(T,{...a,forceCollide:!0}),ru.copyPos(a,T)),this.update(T.el,a),(S=a.subGridOpts)!=null&&S.children){const b=T.el.querySelector(".grid-stack");b&&b.gridstack&&b.gridstack.load(a.subGridOpts.children)}}else n&&this.addWidget(a)}),delete this.engine._loading,this.engine.removedNodes=u,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,f?Rh.addRemoveCB=f:delete Rh.addRemoveCB,d&&this.setAnimation(!0,!0),this}batchUpdate(r=!0){return this.engine.batchUpdate(r),r||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(r=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!r||!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 n=this.el.querySelector("."+this.opts.itemClass);if(n){const $=ru.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/$)}const y=parseInt(this.el.getAttribute("gs-current-row"));return y?Math.round(this.el.getBoundingClientRect().height/y):this.opts.cellHeight}cellHeight(r){if(r!==void 0&&this._isAutoCellHeight!==(r==="auto")&&(this._isAutoCellHeight=r==="auto",this._updateResizeEvent()),(r==="initial"||r==="auto")&&(r=void 0),r===void 0){const y=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;r=this.cellWidth()+y}const n=ru.parseHeight(r);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h?this:(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.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(r=!1){var n;return r&&(n=this.opts.columnOpts)!=null&&n.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var r,n;const y=this.opts.columnOpts;if(!y||!y.columnWidth&&!((r=y.breakpoints)!=null&&r.length))return!1;const $=this.getColumn();let f=$;const u=this._widthOrContainer(!0);if(y.columnWidth)f=Math.min(Math.round(u/y.columnWidth)||1,y.columnMax);else{f=y.columnMax;let i=0;for(;i<y.breakpoints.length&&u<=y.breakpoints[i].w;)f=y.breakpoints[i++].c||$}if(f!==$){const i=(n=y.breakpoints)==null?void 0:n.find(d=>d.c===f);return this.column(f,(i==null?void 0:i.layout)||y.layout),!0}return!1}compact(r="compact",n=!0){return this.engine.compact(r,n),this._triggerChangeEvent(),this}column(r,n="moveScale"){if(!r||r<1||this.opts.column===r)return this;const y=this.getColumn();return this.opts.column=r,this.engine?(this.engine.column=r,this.el.classList.remove("gs-"+y),this._updateColumnVar(),this.engine.columnChanged(y,r,n),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=n,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(r=>r.matches("."+this.opts.itemClass)&&!r.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(r=!0){var n;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),r?this.el.parentNode.removeChild(this.el):(this.removeAll(r),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(n=this._placeholder)==null||delete n.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(r){return this.opts.float!==r&&(this.opts.float=this.engine.float=r,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(r,n=!1){const y=this.el.getBoundingClientRect();let $;n?$={top:y.top+document.documentElement.scrollTop,left:y.left}:$={top:this.el.offsetTop,left:this.el.offsetLeft};const f=r.left-$.left,u=r.top-$.top,i=y.width/this.getColumn(),d=y.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(f/i),y:Math.floor(u/d)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(r,n,y,$){return this.engine.isAreaEmpty(r,n,y,$)}makeWidget(r,n){const y=Rh.getElement(r);if(!y||y.gridstackNode)return y;y.parentElement||this.el.appendChild(y),this._prepareElement(y,!0,n);const $=y.gridstackNode;this._updateContainerHeight(),$.subGridOpts&&this.makeSubGrid(y,$.subGridOpts,void 0,!1);let f;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(f=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),f&&delete this._ignoreLayoutsNodeChange,y}on(r,n){return r.indexOf(" ")!==-1?(r.split(" ").forEach(y=>this.on(y,n)),this):(r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable"?(r==="enable"||r==="disable"?this._gsEventHandler[r]=y=>n(y):this._gsEventHandler[r]=y=>{y.detail&&n(y,y.detail)},this.el.addEventListener(r,this._gsEventHandler[r])):r==="drag"||r==="dragstart"||r==="dragstop"||r==="resizestart"||r==="resize"||r==="resizestop"||r==="dropped"||r==="resizecontent"?this._gsEventHandler[r]=n:console.error("GridStack.on("+r+") event not supported"),this)}off(r){return r.indexOf(" ")!==-1?(r.split(" ").forEach(n=>this.off(n)),this):((r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable")&&this._gsEventHandler[r]&&this.el.removeEventListener(r,this._gsEventHandler[r]),delete this._gsEventHandler[r],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(r=>this.off(r)),this}removeWidget(r,n=!0,y=!0){return r?(Rh.getElements(r).forEach($=>{if($.parentElement&&$.parentElement!==this.el)return;let f=$.gridstackNode;f||(f=this.engine.nodes.find(u=>$===u.el)),f&&(n&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,f,!1,!1),delete $.gridstackNode,this._removeDD($),this.engine.removeNode(f,n,y),n&&$.parentElement&&$.remove())}),y&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(r=!0,n=!0){return this.engine.nodes.forEach(y=>{r&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,y,!1,!1),delete y.el.gridstackNode,this.opts.staticGrid||this._removeDD(y.el)}),this.engine.removeAll(r,n),n&&this._triggerRemoveEvent(),this}setAnimation(r=this.opts.animate,n){return n?setTimeout(()=>{this.opts&&this.setAnimation(r)}):r?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=r,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(r,n=!0,y=!0){return!!this.opts.staticGrid===r?this:(r?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach($=>{this.prepareDragDrop($.el),$.subGrid&&y&&$.subGrid.setStatic(r,n,y)}),n&&this._setStaticClass(),this)}updateOptions(r){var n;const y=this.opts;return r===y?this:(r.acceptWidgets!==void 0&&(y.acceptWidgets=r.acceptWidgets,this._setupAcceptWidget()),r.animate!==void 0&&this.setAnimation(r.animate),r.cellHeight&&this.cellHeight(r.cellHeight),r.class!==void 0&&r.class!==y.class&&(y.class&&this.el.classList.remove(y.class),r.class&&this.el.classList.add(r.class)),r.columnOpts?(this.opts.columnOpts=r.columnOpts,this.checkDynamicColumn()):r.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof r.column=="number"&&this.column(r.column),r.margin!==void 0&&this.margin(r.margin),r.staticGrid!==void 0&&this.setStatic(r.staticGrid),r.disableDrag!==void 0&&!r.staticGrid&&this.enableMove(!r.disableDrag),r.disableResize!==void 0&&!r.staticGrid&&this.enableResize(!r.disableResize),r.float!==void 0&&this.float(r.float),r.row!==void 0?(y.minRow=y.maxRow=y.row=r.row,this._updateContainerHeight()):(r.minRow!==void 0&&(y.minRow=r.minRow,this._updateContainerHeight()),r.maxRow!==void 0&&(y.maxRow=r.maxRow)),r.lazyLoad!==void 0&&(y.lazyLoad=r.lazyLoad),(n=r.children)!=null&&n.length&&this.load(r.children),this)}update(r,n){return Rh.getElements(r).forEach(y=>{var $;const f=y==null?void 0:y.gridstackNode;if(!f)return;const u={...ru.copyPos({},f),...ru.cloneDeep(n)};this.engine.nodeBoundFix(u),delete u.autoPosition;const i=["x","y","w","h"];let d;if(i.some(S=>u[S]!==void 0&&u[S]!==f[S])&&(d={},i.forEach(S=>{d[S]=u[S]!==void 0?u[S]:f[S],delete u[S]})),!d&&(u.minW||u.minH||u.maxW||u.maxH)&&(d={}),u.content!==void 0){const S=y.querySelector(".grid-stack-item-content");S&&S.textContent!==u.content&&(f.content=u.content,Rh.renderCB(S,u),($=f.subGrid)!=null&&$.el&&(S.appendChild(f.subGrid.el),f.subGrid._updateContainerHeight())),delete u.content}let l=!1,a=!1;for(const S in u)S[0]!=="_"&&f[S]!==u[S]&&(f[S]=u[S],l=!0,a=a||!this.opts.staticGrid&&(S==="noResize"||S==="noMove"||S==="locked"));if(ru.sanitizeMinMax(f),d){const S=d.w!==void 0&&d.w!==f.w;this.moveNode(f,d),S&&f.subGrid?f.subGrid.onResize(this.hasAnimationCSS()?f.w:void 0):this.resizeToContentCheck(S,f),delete f._orig}(d||l)&&this._writeAttr(y,f),a&&this.prepareDragDrop(f.el),Rh.updateCB&&Rh.updateCB(f)}),this}moveNode(r,n){const y=r._updating;y||this.engine.cleanNodes().beginUpdate(r),this.engine.moveNode(r,n),this._updateContainerHeight(),y||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(r){var n,y;if(!r||(r.classList.remove("size-to-content-max"),!r.clientHeight))return;const $=r.gridstackNode;if(!$)return;const f=$.grid;if(!f||r.parentElement!==f.el)return;const u=f.getCellHeight(!0);if(!u)return;let i=$.h?$.h*u:r.clientHeight,d;if($.resizeToContentParent&&(d=r.querySelector($.resizeToContentParent)),d||(d=r.querySelector(Rh.resizeToContentParent)),!d)return;const l=r.clientHeight-d.clientHeight,a=$.h?$.h*u-l:d.clientHeight;let S;if($.subGrid){S=$.subGrid.getRow()*$.subGrid.getCellHeight(!0);const p=$.subGrid.el.getBoundingClientRect(),s=r.getBoundingClientRect();S+=p.top-s.top}else{if((y=(n=$.subGridOpts)==null?void 0:n.children)!=null&&y.length)return;{const p=d.firstElementChild;if(!p){console.error(`Error: GridStack.resizeToContent() widget id:${$.id} '${Rh.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}S=p.getBoundingClientRect().height||a}}if(a===S)return;i+=S-a;let T=Math.ceil(i/u);const b=Number.isInteger($.sizeToContent)?$.sizeToContent:0;b&&T>b&&(T=b,r.classList.add("size-to-content-max")),$.minH&&T<$.minH?T=$.minH:$.maxH&&T>$.maxH&&(T=$.maxH),T!==$.h&&(f._ignoreLayoutsNodeChange=!0,f.moveNode($,{h:T}),delete f._ignoreLayoutsNodeChange)}resizeToContentCBCheck(r){Rh.resizeToContentCB?Rh.resizeToContentCB(r):this.resizeToContent(r)}rotate(r,n){return Rh.getElements(r).forEach(y=>{const $=y.gridstackNode;if(!ru.canBeRotated($))return;const f={w:$.h,h:$.w,minH:$.minW,minW:$.minH,maxH:$.maxW,maxW:$.maxH};if(n){const i=n.left>0?Math.floor(n.left/this.cellWidth()):0,d=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;f.x=$.x+i-($.h-(d+1)),f.y=$.y+d-i}Object.keys(f).forEach(i=>{f[i]===void 0&&delete f[i]});const u=$._orig;this.update(y,f),$._orig=u}),this}margin(r){if(!(typeof r=="string"&&r.split(" ").length>1)){const n=ru.parseHeight(r);if(this.opts.marginUnit===n.unit&&this.opts.margin===n.h)return}return this.opts.margin=r,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(r){return this.engine.willItFit(r)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const r=this.engine.getDirtyNodes(!0);return r&&r.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(r),this._triggerEvent("change",r)),this.engine.saveInitial(),this}_triggerAddEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.addedNodes)!=null&&r.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(y=>{delete y._dirty});const n=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",n)}return this}_triggerRemoveEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.removedNodes)!=null&&r.length){const n=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",n)}return this}_triggerEvent(r,n){const y=n?new CustomEvent(r,{bubbles:!1,detail:n}):new Event(r);let $=this;for(;$.parentGridNode;)$=$.parentGridNode.grid;return $.el.dispatchEvent(y),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const r=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const y=this.opts.cellHeight,$=this.opts.cellHeightUnit;if(!y)return this;if(!r&&!this.opts.minRow){const f=ru.parseHeight(getComputedStyle(this.el).minHeight);if(f.h>0&&f.unit===$){const u=Math.floor(f.h/y);n<u&&(n=u)}}return this.el.setAttribute("gs-current-row",String(n)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),n&&(this.el.style[r?"minHeight":"height"]=n*y+$),r&&ru.shouldSizeToContent(r)&&r.grid.resizeToContentCBCheck(r.el),this}_prepareElement(r,n=!1,y){y=y||this._readAttr(r),r.gridstackNode=y,y.el=r,y.grid=this,y=this.engine.addNode(y,n),this._writeAttr(r,y),r.classList.add(S3.itemClass,this.opts.itemClass);const $=ru.shouldSizeToContent(y);return $?r.classList.add("size-to-content"):r.classList.remove("size-to-content"),$&&this.resizeToContentCheck(!1,y),ru.lazyLoad(y)||this.prepareDragDrop(y.el),this}_writePosAttr(r,n){return(!n._moving&&!n._resizing||this._placeholder===r)&&(r.style.top=n.y?n.y===1?"var(--gs-cell-height)":`calc(${n.y} * var(--gs-cell-height))`:null,r.style.left=n.x?n.x===1?"var(--gs-column-width)":`calc(${n.x} * var(--gs-column-width))`:null,r.style.width=n.w>1?`calc(${n.w} * var(--gs-column-width))`:null,r.style.height=n.h>1?`calc(${n.h} * var(--gs-cell-height))`:null),r.setAttribute("gs-x",String(n.x)),r.setAttribute("gs-y",String(n.y)),n.w>1?r.setAttribute("gs-w",String(n.w)):r.removeAttribute("gs-w"),n.h>1?r.setAttribute("gs-h",String(n.h)):r.removeAttribute("gs-h"),this}_writeAttr(r,n){if(!n)return this;this._writePosAttr(r,n);const y={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const $ in y)n[$]?r.setAttribute(y[$],String(n[$])):r.removeAttribute(y[$]);return this}_readAttr(r,n=!0){const y={};y.x=ru.toNumber(r.getAttribute("gs-x")),y.y=ru.toNumber(r.getAttribute("gs-y")),y.w=ru.toNumber(r.getAttribute("gs-w")),y.h=ru.toNumber(r.getAttribute("gs-h")),y.autoPosition=ru.toBool(r.getAttribute("gs-auto-position")),y.noResize=ru.toBool(r.getAttribute("gs-no-resize")),y.noMove=ru.toBool(r.getAttribute("gs-no-move")),y.locked=ru.toBool(r.getAttribute("gs-locked"));const $=r.getAttribute("gs-size-to-content");$&&($==="true"||$==="false"?y.sizeToContent=ru.toBool($):y.sizeToContent=parseInt($,10)),y.id=r.getAttribute("gs-id"),y.maxW=ru.toNumber(r.getAttribute("gs-max-w")),y.minW=ru.toNumber(r.getAttribute("gs-min-w")),y.maxH=ru.toNumber(r.getAttribute("gs-max-h")),y.minH=ru.toNumber(r.getAttribute("gs-min-h")),n&&(y.w===1&&r.removeAttribute("gs-w"),y.h===1&&r.removeAttribute("gs-h"),y.maxW&&r.removeAttribute("gs-max-w"),y.minW&&r.removeAttribute("gs-min-w"),y.maxH&&r.removeAttribute("gs-max-h"),y.minH&&r.removeAttribute("gs-min-h"));for(const f in y){if(!y.hasOwnProperty(f))return;!y[f]&&y[f]!==0&&f!=="sizeToContent"&&delete y[f]}return y}_setStaticClass(){const r=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...r),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...r),this.el.removeAttribute("gs-static")),this}onResize(r=(n=>(n=this.el)==null?void 0:n.clientWidth)()){if(!r||this.prevWidth===r)return;this.prevWidth=r,this.batchUpdate();let n=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),n=!0):n=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(y=>{y.subGrid&&y.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(n),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(r=!1,n=void 0){if(this.engine){if(r&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,n),this.animationDelay);if(n)ru.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(y=>ru.shouldSizeToContent(y))){const y=[...this.engine.nodes];this.batchUpdate(),y.forEach($=>{ru.shouldSizeToContent($)&&this.resizeToContentCBCheck($.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,n?[n]:this.engine.nodes)}}_updateResizeEvent(r=!1){const n=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(y=>y.sizeToContent));return!r&&n&&!this.resizeObserver?(this._sizeThrottle=ru.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(r||!n)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(r=".grid-stack-item"){return ru.getElement(r)}static getElements(r=".grid-stack-item"){return ru.getElements(r)}static getGridElement(r){return Rh.getElement(r)}static getGridElements(r){return ru.getElements(r)}_initMargin(){let r,n=0,y=[];typeof this.opts.margin=="string"&&(y=this.opts.margin.split(" ")),y.length===2?(this.opts.marginTop=this.opts.marginBottom=y[0],this.opts.marginLeft=this.opts.marginRight=y[1]):y.length===4?(this.opts.marginTop=y[0],this.opts.marginRight=y[1],this.opts.marginBottom=y[2],this.opts.marginLeft=y[3]):(r=ru.parseHeight(this.opts.margin),this.opts.marginUnit=r.unit,n=this.opts.margin=r.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(f=>{this.opts[f]===void 0?this.opts[f]=n:(r=ru.parseHeight(this.opts[f]),this.opts[f]=r.h,delete this.opts.margin)}),this.opts.marginUnit=r.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 $=this.el.style;return $.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return d_}static setupDragIn(r,n,y,$=document){(n==null?void 0:n.pause)!==void 0&&(Of.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof r=="string"?ru.getElements(r,$):r).forEach((f,u)=>{d_.isDraggable(f)||d_.dragIn(f,n),y!=null&&y[u]&&(f.gridstackNode=y[u])})}movable(r,n){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(y=>{const $=y.gridstackNode;$&&(n?delete $.noMove:$.noMove=!0,this.prepareDragDrop($.el))}),this)}resizable(r,n){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(y=>{const $=y.gridstackNode;$&&(n?delete $.noResize:$.noResize=!0,this.prepareDragDrop($.el))}),this)}disable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!1,r),this.enableResize(!1,r),this._triggerEvent("disable"),this}enable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!0,r),this.enableResize(!0,r),this._triggerEvent("enable"),this}enableMove(r,n=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(y=>{this.prepareDragDrop(y.el),y.subGrid&&n&&y.subGrid.enableMove(r,n)}),this)}enableResize(r,n=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(y=>{this.prepareDragDrop(y.el),y.subGrid&&n&&y.subGrid.enableResize(r,n)}),this)}cancelDrag(){var r;const n=(r=this._placeholder)==null?void 0:r.gridstackNode;n&&(n._isExternal?(n._isAboutToRemove=!0,this.engine.removeNode(n)):n._isAboutToRemove&&Rh._itemRemoving(n.el,!1),this.engine.restoreInitial())}_removeDD(r){return d_.draggable(r,"destroy").resizable(r,"destroy"),r.gridstackNode&&delete r.gridstackNode._initDD,delete r.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return d_.droppable(this.el,"destroy"),this;let r,n;const y=($,f,u)=>{var i;u=u||f;const d=u.gridstackNode;if(!d)return;if(!((i=d.grid)!=null&&i.el)){u.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const b=u.getBoundingClientRect();u.style.left=b.x+(this.dragTransform.xScale-1)*($.clientX-b.x)/this.dragTransform.xScale+"px",u.style.top=b.y+(this.dragTransform.yScale-1)*($.clientY-b.y)/this.dragTransform.yScale+"px",u.style.transformOrigin="0px 0px"}let{top:l,left:a}=u.getBoundingClientRect();const S=this.el.getBoundingClientRect();a-=S.left,l-=S.top;const T={position:{top:l*this.dragTransform.xScale,left:a*this.dragTransform.yScale}};if(d._temporaryRemoved){if(d.x=Math.max(0,Math.round(a/n)),d.y=Math.max(0,Math.round(l/r)),delete d.autoPosition,this.engine.nodeBoundFix(d),!this.engine.willItFit(d)){if(d.autoPosition=!0,!this.engine.willItFit(d)){d_.off(f,"drag");return}d._willFitPos&&(ru.copyPos(d,d._willFitPos),delete d._willFitPos)}this._onStartMoving(u,$,T,d,n,r)}else this._dragOrResize(u,$,T,d,n,r)};return d_.droppable(this.el,{accept:$=>{const f=$.gridstackNode||this._readAttr($,!1);if((f==null?void 0:f.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let u=!0;if(typeof this.opts.acceptWidgets=="function")u=this.opts.acceptWidgets($);else{const i=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;u=$.matches(i)}if(u&&f&&this.opts.maxRow){const i={w:f.w,h:f.h,minW:f.minW,minH:f.minH};u=this.engine.willItFit(i)}return u}}).on(this.el,"dropover",($,f,u)=>{let i=(u==null?void 0:u.gridstackNode)||f.gridstackNode;if((i==null?void 0:i.grid)===this&&!i._temporaryRemoved)return!1;if(i!=null&&i._sidebarOrig&&(i.w=i._sidebarOrig.w,i.h=i._sidebarOrig.h),i!=null&&i.grid&&i.grid!==this&&!i._temporaryRemoved&&i.grid._leave(f,u),u=u||f,n=this.cellWidth(),r=this.getCellHeight(!0),!i){const a=u.getAttribute("data-gs-widget")||u.getAttribute("gridstacknode");if(a){try{i=JSON.parse(a)}catch{console.error("Gridstack dropover: Bad JSON format: ",a)}u.removeAttribute("data-gs-widget"),u.removeAttribute("gridstacknode")}i||(i=this._readAttr(u)),i._sidebarOrig={w:i.w,h:i.h}}i.grid||(i.el||(i={...i}),i._isExternal=!0,u.gridstackNode=i);const d=i.w||Math.round(u.offsetWidth/n)||1,l=i.h||Math.round(u.offsetHeight/r)||1;return i.grid&&i.grid!==this?(f._gridstackNodeOrig||(f._gridstackNodeOrig=i),f.gridstackNode=i={...i,w:d,h:l,grid:this},delete i.x,delete i.y,this.engine.cleanupNode(i).nodeBoundFix(i),i._initDD=i._isExternal=i._temporaryRemoved=!0):(i.w=d,i.h=l,i._temporaryRemoved=!0),Rh._itemRemoving(i.el,!1),d_.on(f,"drag",y),y($,f,u),!1}).on(this.el,"dropout",($,f,u)=>{const i=(u==null?void 0:u.gridstackNode)||f.gridstackNode;return i&&(!i.grid||i.grid===this)&&(this._leave(f,u),this._isTemp&&this.removeAsSubGrid(i)),!1}).on(this.el,"drop",($,f,u)=>{var i,d,l;const a=(u==null?void 0:u.gridstackNode)||f.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._isExternal)return!1;const S=!!this.placeholder.parentElement,T=f!==u;this.placeholder.remove(),delete this.placeholder.gridstackNode,S&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const b=f._gridstackNodeOrig;if(delete f._gridstackNodeOrig,S&&b!=null&&b.grid&&b.grid!==this){const s=b.grid;s.engine.removeNodeFromLayoutCache(b),s.engine.removedNodes.push(b),s._triggerRemoveEvent()._triggerChangeEvent(),s.parentGridNode&&!s.engine.nodes.length&&s.opts.subGridDynamic&&s.removeAsSubGrid()}if(!a||(S&&(this.engine.cleanupNode(a),a.grid=this),(i=a.grid)==null||delete i._isTemp,d_.off(f,"drag"),u!==f?(u.remove(),f=u):f.remove(),this._removeDD(f),!S))return!1;const p=(l=(d=a.subGrid)==null?void 0:d.el)==null?void 0:l.gridstack;return ru.copyPos(a,this._readAttr(this.placeholder)),ru.removePositioningStyles(f),T&&(a.content||a.subGridOpts||Rh.addRemoveCB)?(delete a.el,f=this.addWidget(a)):(this._prepareElement(f,!0,a),this.el.appendChild(f),this.resizeToContentCheck(!1,a),p&&(p.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...$,type:"dropped"},b&&b.grid?b:void 0,a),!1}),this}static _itemRemoving(r,n){if(!r)return;const y=r?r.gridstackNode:void 0;!(y!=null&&y.grid)||r.classList.contains(y.grid.opts.removableOptions.decline)||(n?y._isAboutToRemove=!0:delete y._isAboutToRemove,n?r.classList.add("grid-stack-item-removing"):r.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const r=document.querySelector(this.opts.removable);return r?(!this.opts.staticGrid&&!d_.isDroppable(r)&&d_.droppable(r,this.opts.removableOptions).on(r,"dropover",(n,y)=>Rh._itemRemoving(y,!0)).on(r,"dropout",(n,y)=>Rh._itemRemoving(y,!1)),this):this}prepareDragDrop(r,n=!1){const y=r==null?void 0:r.gridstackNode;if(!y)return;const $=y.noMove||this.opts.disableDrag,f=y.noResize||this.opts.disableResize,u=this.opts.staticGrid||$&&f;if((n||u)&&(y._initDD&&(this._removeDD(r),delete y._initDD),u&&r.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!y._initDD){let i,d;const l=(T,b)=>{this.triggerEvent(T,T.target),i=this.cellWidth(),d=this.getCellHeight(!0),this._onStartMoving(r,T,b,y,i,d)},a=(T,b)=>{this._dragOrResize(r,T,b,y,i,d)},S=T=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete y._moving,delete y._resizing,delete y._event,delete y._lastTried;const b=y.w!==y._orig.w,p=T.target;if(!(!p.gridstackNode||p.gridstackNode.grid!==this)){if(y.el=p,y._isAboutToRemove){const s=r.gridstackNode.grid;s._gsEventHandler[T.type]&&s._gsEventHandler[T.type](T,p),s.engine.nodes.push(y),s.removeWidget(r,!0,!0)}else ru.removePositioningStyles(p),y._temporaryRemoved?(this._writePosAttr(p,y),this.engine.addNode(y)):this._writePosAttr(p,y),this.triggerEvent(T,p);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),T.type==="resizestop"&&(Number.isInteger(y.sizeToContent)&&(y.sizeToContent=y.h),this.resizeToContentCheck(b,y))}};d_.draggable(r,{start:l,stop:S,drag:a}).resizable(r,{start:l,stop:S,resize:a}),y._initDD=!0}return d_.draggable(r,$?"disable":"enable").resizable(r,f?"disable":"enable"),this}_onStartMoving(r,n,y,$,f,u){var i;if(this.engine.cleanNodes().beginUpdate($),this._writePosAttr(this.placeholder,$),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=$,(i=$.grid)!=null&&i.el)this.dragTransform=ru.getValuesFromTransformedElement(r);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const d=this.placeholder.closest(".grid-stack");this.dragTransform=ru.getValuesFromTransformedElement(d)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if($.el=this.placeholder,$._lastUiPosition=y.position,$._prevYPix=y.position.top,$._moving=n.type==="dragstart",$._resizing=n.type==="resizestart",delete $._lastTried,n.type==="dropover"&&$._temporaryRemoved&&(this.engine.addNode($),$._moving=!0),this.engine.cacheRects(f,u,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const d=this.getColumn()-$.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-$.y;d_.resizable(r,"option","minWidth",f*Math.min($.minW||1,d)).resizable(r,"option","minHeight",u*Math.min($.minH||1,l)).resizable(r,"option","maxWidth",f*Math.min($.maxW||Number.MAX_SAFE_INTEGER,d)).resizable(r,"option","maxWidthMoveLeft",f*Math.min($.maxW||Number.MAX_SAFE_INTEGER,$.x+$.w)).resizable(r,"option","maxHeight",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(r,"option","maxHeightMoveUp",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,$.y+$.h))}}_dragOrResize(r,n,y,$,f,u){const i={...$._orig};let d,l=this.opts.marginLeft,a=this.opts.marginRight,S=this.opts.marginTop,T=this.opts.marginBottom;const b=Math.round(u*.1),p=Math.round(f*.1);if(l=Math.min(l,p),a=Math.min(a,p),S=Math.min(S,b),T=Math.min(T,b),n.type==="drag"){if($._temporaryRemoved)return;const c=y.position.top-$._prevYPix;$._prevYPix=y.position.top,this.opts.draggable.scroll!==!1&&ru.updateScrollPosition(r,y.position,c);const o=y.position.left+(y.position.left>$._lastUiPosition.left?-a:l),h=y.position.top+(y.position.top>$._lastUiPosition.top?-T:S);i.x=Math.round(o/f),i.y=Math.round(h/u);const v=this._extraDragRow;if(this.engine.collide($,i)){const k=this.getRow();let L=Math.max(0,i.y+$.h-k);this.opts.maxRow&&k+L>this.opts.maxRow&&(L=Math.max(0,this.opts.maxRow-k)),this._extraDragRow=L}else this._extraDragRow=0;if(this._extraDragRow!==v&&this._updateContainerHeight(),$.x===i.x&&$.y===i.y)return}else if(n.type==="resize"){if(i.x<0||(ru.updateScrollResize(n,r,u),i.w=Math.round((y.size.width-l)/f),i.h=Math.round((y.size.height-S)/u),$.w===i.w&&$.h===i.h)||$._lastTried&&$._lastTried.w===i.w&&$._lastTried.h===i.h)return;const c=y.position.left+l,o=y.position.top+S;i.x=Math.round(c/f),i.y=Math.round(o/u),d=!0}$._event=n,$._lastTried=i;const s={x:y.position.left+l,y:y.position.top+S,w:(y.size?y.size.width:$.w*f)-l-a,h:(y.size?y.size.height:$.h*u)-S-T};if(this.engine.moveNodeCheck($,{...i,cellWidth:f,cellHeight:u,rect:s,resizing:d})){$._lastUiPosition=y.position,this.engine.cacheRects(f,u,S,a,T,l),delete $._skipDown,d&&$.subGrid&&$.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const c=n.target;$._sidebarOrig||this._writePosAttr(c,$),this.triggerEvent(n,c)}}triggerEvent(r,n){let y=this;for(;y.parentGridNode;)y=y.parentGridNode.grid;y._gsEventHandler[r.type]&&y._gsEventHandler[r.type](r,n)}_leave(r,n){n=n||r;const y=n.gridstackNode;if(!y||(n.style.transform=n.style.transformOrigin=null,d_.off(r,"drag"),y._temporaryRemoved))return;y._temporaryRemoved=!0,this.engine.removeNode(y),y.el=y._isExternal&&n?n:r;const $=y._sidebarOrig;y._isExternal&&this.engine.cleanupNode(y),y._sidebarOrig=$,this.opts.removable===!0&&Rh._itemRemoving(r,!0),r._gridstackNodeOrig?(r.gridstackNode=r._gridstackNodeOrig,delete r._gridstackNodeOrig):y._isExternal&&this.engine.restoreInitial()}}Rh.renderCB=(t,r)=>{t&&r!=null&&r.content&&(t.textContent=r.content)},Rh.resizeToContentParent=".grid-stack-item-content",Rh.Utils=ru,Rh.Engine=A4,Rh.GDRev="12.4.2";const hHt=[{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}],R4=t=>hHt.find(r=>r.id===t),F4=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 Yk{constructor(r,n=[],y,$=null,f=!1,u=!1,i=null,d=null,l=null){Ew(this,"id",""),Ew(this,"childViews",[]),Ew(this,"viewId",0),Ew(this,"dynamicFilters",null),Ew(this,"componentSpecificFilters",new Map),Ew(this,"isPostMatch",!1),Ew(this,"isTemplateMode",!1),Ew(this,"filtresJSON",null),Ew(this,"token",null),Ew(this,"_isUpdating",!1),Ew(this,"filters",null),this.id=r,this.viewId=y,this.childViews=n,this.dynamicFilters=$,this.isPostMatch=f,this.isTemplateMode=u,this.filtresJSON=i,this.token=d,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(r=>{r.view.filterAndViewsContainer=new Yk(this.id,[r],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(r,n){return!r||!Array.isArray(r)?!1:r.some(y=>y&&y.event_type_id===n)}hasCategoryId(r,n){return!r||!Array.isArray(r)?!1:r.some(y=>y&&y.category_id===n)}getId(){return this.id}setViewId(r){this.viewId=r}setFiltersJSON(r){this.filtresJSON=r}setDynamicFilters(r,n=null){n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r}setFilters(r){this.filters=r}getComponentDynamicFilters(r){return r&&this.componentSpecificFilters.has(r)?this.componentSpecificFilters.get(r):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(r=>r.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(r=>!r.view.isHomeTeam)}addSpecificPlays(r){if(r.view.componentProps&&this.filters){const n=this.filters.selectedTeam.value;if(n===3){const y=this.getHomeTeamViews().length,$=this.getAwayTeamViews().length;y===0&&$>0&&this.getAwayTeamViews().forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=!0,f.view.isHomeTeam=!0,f.view.filterMultiple&&(f.view.filterMultiple.isHomeTeam=!0)}),y<this.filters.howManyCorners?this.childViews.length===0?(r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.howManyCorners=this.filters.howManyCorners,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):this.childViews.reduce((f,u,i,d)=>{let l={isAgainstMode:u.view.isAgainstMode,advancedFilters:u.view.componentProps.advancedFilters,isHomeTeamForAnalysis:u.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:u.view.isHomeTeam};return f&&(f.isHomeTeam&&!u.view.isHomeTeam?(u.view.componentProps.isAgainstMode=this.filters.isAgainstMode,u.view.componentProps.advancedFilters=this.filters.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=!0,u.view.isHomeTeam=!0,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):!f.isHomeTeam&&!u.view.isHomeTeam&&(u.view.componentProps.isAgainstMode=f.isAgainstMode,u.view.componentProps.advancedFilters=f.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=f.isHomeTeamForAnalysis,u.view.isHomeTeam=f.isHomeTeam,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,selectedCategory:u.view.componentProps.categories[0],advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}),i===d.length-1&&(r.view.componentProps.advancedFilters=l.advancedFilters,r.view.componentProps.isAgainstMode=l.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=l.isHomeTeamForAnalysis,r.view.isHomeTeam=l.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})),l},null):(r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})}else{const y=n===1;r.view.componentProps.isHomeTeamForAnalysis=y,r.view.isHomeTeam=y,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}}}}addLastTouch(r){if(r.view.componentProps&&this.filters){let n=null;const y=this.filters.selectedCategories.map(f=>f.value),$=this.filters.selectedTeam.value;if($===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(d=>{d.view.componentProps.isHomeTeamForAnalysis=!0,d.view.isHomeTeam=!0,d.view.filterMultiple&&(d.view.filterMultiple.isHomeTeam=!0)});const f=this.getHomeTeamViews(),u=this.getAwayTeamViews();let i=!0;for(let d=0;d<y.length;d++){n=y[d];const l=f.find(S=>S.view.componentProps.categories[0].name===n.name),a=u.find(S=>S.view.componentProps.categories[0].name===n.name);if(!l||!a){i=!l;break}}i?this.childViews.length===0?(r.view.componentProps.categories=[n],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=n.name,r.view.titleShort=n.name,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((d,l,a,S)=>{let T={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 d&&(d.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[n],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=n.name,r.view.titleShort=n.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!d.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=d.categories,l.view.componentProps.analysisType=d.analysisType,l.view.componentProps.isHomeTeamForAnalysis=d.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=d.isAssistZoneVisible,l.view.componentProps.howManyGames=d.howManyGames,l.view.title=d.title,l.view.titleShort=d.titleShort,l.view.isHomeTeam=d.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}),a===S.length-1&&(r.view.componentProps.categories=T.categories,r.view.componentProps.analysisType=T.analysisType,r.view.componentProps.isHomeTeamForAnalysis=T.isHomeTeamForAnalysis,r.view.componentProps.isAssistZoneVisible=T.isAssistZoneVisible,r.view.componentProps.howManyGames=T.howManyGames,r.view.title=T.title,r.view.titleShort=T.titleShort,r.view.isHomeTeam=T.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:r.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),T},null):(r.view.componentProps.categories=[n],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=n.name,r.view.titleShort=n.name,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const f=$===1,u=f?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=f,r.view.isHomeTeam=f;for(let i=0;i<y.length;i++){const d=y[i];if(!u.find(l=>l.view.componentProps.categories[0].name===d.name)){r.view.componentProps.categories=[d],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=d.name,r.view.titleShort=d.name,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:d,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(r,n=!1){var y,$,f,u,i,d,l,a;if(r.view.filterAndViewsContainer=this,Sd.emit("component-added-to-container",this),this.viewId===5&&r.view.componentProps&&!n&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===15&&r.view.componentProps&&!n&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===17&&r.view.componentProps&&!n){this.dynamicFilters[0]!==void 0&&(r.view.componentProps.infavoragainstteam=!this.dynamicFilters[0]),this.dynamicFilters[1]!==void 0&&(r.view.componentProps.lateralidad=this.dynamicFilters[1]===32?"right":"left");const S=this.dynamicFilters[2]!==void 0?this.dynamicFilters[2]:this.dynamicFilters[0]||1,T=r.view.componentProps.game;if(S===3){const b=this.childViews.filter(p=>{var s;return((s=p.view.filterMultiple)==null?void 0:s.isHomeTeam)===!0}).length===0;T&&(r.view.componentProps.teamselected=b?T.home_team:T.away_team),r.view.filterMultiple={isHomeTeam:b}}else T&&(r.view.componentProps.teamselected=S===2?T.away_team:T.home_team),r.view.filterMultiple={isHomeTeam:S===1}}if(this.viewId===10&&r.view.componentProps&&!n&&(r.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,r.isHomeTeam=r.view.componentProps.isHomeTeamForAnalysis,r.view.filterMultiple={isHomeTeam:r.view.componentProps.isHomeTeamForAnalysis},r.view.filtersJSON=this.filtresJSON),this.viewId===7&&r.view.componentProps&&!n){const S=this.getComponentDynamicFilters(r.view.id),T=S||this.dynamicFilters;!S&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const b=T[0]===1?"offensive":"defensive",p=T[1]===1;r.view.componentProps.analysisType=b,r.view.componentProps.isHomeTeamForAnalysis=p,r.isHomeTeam=p,r.view.filterMultiple={isHomeTeam:p},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:T})}if(this.viewId===1&&r.view.componentProps&&!n){const S=this.dynamicFilters[0]||[];if(S&&S.length>0){let T;if(Array.isArray(S)){const p=this.childViews.map(c=>{var o;return(o=c.view.componentProps)==null?void 0:o.type}).filter(c=>c!==void 0),s=S.filter(c=>!p.includes(c));s.length>0?T=s[0]:T=S[0]}else T=S;const b=F4.get(this.viewId);r.view.componentProps.type=T,r.view.componentProps.default=!1,r.view.title=`Comparativa ${b[T]}`,r.view.filterMultiple={category:T}}}if(this.viewId===9&&r.view.componentProps&&!n){const S=this.dynamicFilters[0].map(s=>s.join("-"));let T="";const b=this.dynamicFilters[1],p=F4.get(this.viewId);if(b===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(v=>{v.view.componentProps.isHomeTeamForAnalysis=!0,v.view.isHomeTeam=!0,v.view.filterMultiple&&(v.view.filterMultiple.isHomeTeam=!0)});let s=null;const c=this.getHomeTeamViews(),o=this.getAwayTeamViews();let h=!0;for(let v=0;v<S.length;v++){T=S[v],s=p.analysisTypes.get(S[v]);const k=c.find(E=>E.view.componentProps.analysisType===s.analysisType),L=o.find(E=>E.view.componentProps.analysisType===s.analysisType);if(!k||!L){h=!k;break}}h?this.childViews.length===0?(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:T.split("-").map(v=>parseInt(v))}):this.childViews.reduce((v,k,L,E)=>{let P={analysisType:k.view.componentProps.analysisType,title:k.view.title,isHomeTeamForAnalysis:k.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:k.view.isHomeTeam};return v&&(v.isHomeTeam&&!k.view.isHomeTeam?(k.view.componentProps.analysisType=s.analysisType,k.view.componentProps.isHomeTeamForAnalysis=!0,k.view.title=s.title,r.view.titleShort=s.titleShort,k.view.isHomeTeam=!0,k.view.filterMultiple={isHomeTeam:k.view.isHomeTeam,categoryIds:T.split("-").map(V=>parseInt(V))}):!v.isHomeTeam&&!k.view.isHomeTeam&&(k.view.componentProps.analysisType=v.analysisType,k.view.componentProps.isHomeTeamForAnalysis=v.isHomeTeamForAnalysis,k.view.title=v.title,k.view.titleShort=v.titleShort,k.view.isHomeTeam=v.isHomeTeam,k.view.filterMultiple={isHomeTeam:k.view.isHomeTeam,categoryIds:T.split("-").map(V=>parseInt(V))}),L===E.length-1&&(r.view.componentProps.analysisType=P.analysisType,r.view.componentProps.isHomeTeamForAnalysis=P.isHomeTeamForAnalysis,r.view.title=P.title,r.view.titleShort=P.titleShort,r.view.isHomeTeam=P.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:T.split("-").map(V=>parseInt(V))})),P},null):(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:T.split("-").map(v=>parseInt(v))})}else{const s=b===1,c=s?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=s,r.view.isHomeTeam=s;for(let o=0;o<S.length;o++){const h=p.analysisTypes.get(S[o]);if(!c.find(v=>v.view.componentProps.analysisType===h.analysisType)){r.view.componentProps.analysisType=h.analysisType,r.view.title=h.title,r.view.titleShort=h.titleShort,r.view.filterMultiple={categoryIds:S[o].split("-").map(v=>parseInt(v)),isHomeTeam:r.view.isHomeTeam};break}}}}if(this.viewId===2&&!n&&r.view.componentProps){const S=this.getComponentDynamicFilters(r.view.id),T=S||this.dynamicFilters;!S&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id),r.view.componentProps.game&&(r.view.componentProps.gameid=r.view.componentProps.game.id,r.view.componentProps.season=r.view.componentProps.game.season_id,r.view.componentProps.teamView=T[1]===2?r.view.componentProps.game.awayTeam.team_id:T[1]===1?r.view.componentProps.game.homeTeam.team_id:0);const b=this.dynamicFilters[0]||[];let p=null;if(Array.isArray(b)){if(b.length>0){const o=this.childViews.map(v=>{var k;const L=(k=v.view.componentProps)==null?void 0:k.categoryView;return L&&L.length>0?L[0].id:null}).filter(v=>v!==null),h=b.filter(v=>!o.includes(v));h.length>0&&(p=h[0])}}else{const o=b;o&&(this.childViews.find(h=>{var v;const k=(v=h.view.componentProps)==null?void 0:v.categoryView;return k&&k.length>0&&k[0].id===o})||(p=o))}let s=null;if(p)try{s=R4(p)}catch{}const c=T&&T.length>1?T[1]:1;r.view.filterMultiple={categoryId:p,teamType:c},r.view.componentProps.categoryView=s?[{id:p,name:s.name}]:p?[{id:p,name:`Category ${p}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&r.view.componentProps&&!n&&r.view.game){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),r.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,r.view.componentProps.game=(y=r.view)==null?void 0:y.game,r.view.componentProps.isDefault=!1;const S=this.dynamicFilters[1],T=r.view.componentProps.game;if(S===3){const b=this.childViews.filter(p=>{var s;return((s=p.view.filterMultiple)==null?void 0:s.isHomeTeam)===!0}).length===0;r.view.componentProps.teamSelected={teamId:b?T==null?void 0:T.home_team:T==null?void 0:T.away_team},r.view.filterMultiple={isHomeTeam:b}}else r.view.componentProps.teamSelected={teamId:S===1?T==null?void 0:T.home_team:T==null?void 0:T.away_team},r.view.filterMultiple={isHomeTeam:S===1};Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:this.dynamicFilters})}if(this.viewId===13&&r.view.componentProps&&!n&&(r.view.componentProps.isdefault=!0,r.view.componentProps.seasonid=2010,r.view.teamids=[1,2],r.view.componentProps.categoryids=[20,2],r.view.componentProps.teamsshow=[1,2],r.view.componentProps.analysistype=1,r.view.componentProps.gameid="",r.view.componentProps.teams=[],r.view.componentProps.game=""),this.viewId===15&&r.view.componentProps&&!n&&(r.view.componentProps.isdefault=!0,r.view.componentProps.view=1,r.view.numitems=3,r.view.typegame=1,r.view.componentProps.token=this.token,r.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===17&&r.view.componentProps&&!n&&(r.view.componentProps.forseason=!1,r.view.componentProps.forteam=!0,r.view.componentProps.tournamentselected={id:1},r.view.componentProps.forgame=!1,r.view.componentProps.filters={},r.view.componentProps.showBallGo=!0,r.view.componentProps.showHeatMap=!0,r.view.componentProps.ballOnOff=!1,r.view.componentProps.showdefault=!0),this.viewId===14&&r.view.componentProps&&!n&&(r.view.componentProps.isReports=!0,r.view.componentProps.isDefault=!0,r.view.componentProps.type=0,r.view.componentProps.typeView=1,r.view.componentProps.showVideos=!1,r.view.componentProps.currentSeason=2010,r.view.componentProps.localTeam=2,r.view.componentProps.awayTeam=1),this.viewId===6&&r.view.componentProps&&!n){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const S=this.getComponentDynamicFilters(r.view.id),T=S||this.dynamicFilters;!S&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const b=T&&T.length>0?T[0]:[];if(b&&b.length>0){let p=0;for(const s of b)if(!this.childViews.find(c=>c.view.componentProps.gameNumber===s)){p=s;break}p&&(r.view.componentProps.gameNumber=p,r.view.filterMultiple={gameNumber:p})}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:T})}if(this.viewId===3&&r.view.componentProps&&!n&&r.view.game){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const S=this.getComponentDynamicFilters(r.view.id),T=S||this.dynamicFilters;!S&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const b=T&&T.length>0?T[0]:!1;r.view.componentProps.desplegable=b,r.view.componentProps.key=b,r.view.componentProps.game=($=r.view)==null?void 0:$.game,r.view.componentProps.defaultShields=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:T})}if(this.viewId===4&&r.view.componentProps&&!n&&r.view.game){if(r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),this.isPostMatch){r.view.componentProps.key=!1,r.view.componentProps.isDefault=!1,r.view.componentProps.token=this.token,r.view.componentProps.gameId=(u=(f=r.view)==null?void 0:f.game)==null?void 0:u.game_id,r.view.componentProps.homeTeam=(d=(i=r.view)==null?void 0:i.game)==null?void 0:d.home_team,r.view.componentProps.awayTeam=(a=(l=r.view)==null?void 0:l.game)==null?void 0:a.visiting_team;const b=this.getComponentDynamicFilters(r.view.id),p=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const s=p&&p.length>0?p[0]:[],c=this.hasEventTypeId(s,1),o=this.hasCategoryId(s,8),h=this.hasCategoryId(s,9),v=this.hasEventTypeId(s,3);r.view.componentProps.goals=c,r.view.componentProps.yellowCards=o,r.view.componentProps.redCards=h,r.view.componentProps.substitutions=v}const S=this.getComponentDynamicFilters(r.view.id)||this.dynamicFilters,T=S&&S.length>0?S[0]:[];r.view.componentProps.selectedEvents=T,r.view.componentProps.key=T.length>0,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:S})}this.viewId===16&&this.addLastTouch(r),this.viewId===18&&this.addSpecificPlays(r),this.childViews.push(r),Sd.emit("view-added")}getHowManyViewsToAdd(r,n=null){if(this.viewId===5||this.viewId===8||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const y=r[0];return y===2||y===3?y:1}if(this.viewId===4)return r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0?1:0;if(this.viewId===9){const y=r[0],$=r[1];if($===1||$===2){const f=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return y.length-f.length}else return y*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&n){const y=n.selectedCategories||[],$=n.selectedTeam.value;if($===1||$===2){const f=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return y.length-f.length}else return y.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const y=r[0]||[],$=r[1]||1;if(!y||y.length===0)return 0;if(Array.isArray(y)){const f=this.childViews.map(u=>{var i;const d=(i=u.view.componentProps)==null?void 0:i.categoryView;return d&&d.length>0?d[0].id:null}).filter(u=>u!==null);return y.filter(u=>!f.includes(u)).length}else{const f=y;return this.childViews.find(u=>{var i,d;const l=(i=u.view.componentProps)==null?void 0:i.categoryView,a=((d=u.view.filterMultiple)==null?void 0:d.teamType)||1;return l&&l.length>0&&l[0].id===f&&a===$})?0:1}}if(this.viewId===1){const y=r[0]||[];if(!y||y.length===0)return 0;if(Array.isArray(y)){const $=this.childViews.map(f=>{var u;return(u=f.view.componentProps)==null?void 0:u.type}).filter(f=>f!==void 0);return y.filter(f=>!$.includes(f)).length}else{const $=y;return this.childViews.find(f=>{var u;return((u=f.view.componentProps)==null?void 0:u.type)===$})?0:1}}return 0}getRequiresAddView(r,n){if(this.viewId===5)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===17){const y=r[2]||1,$=r[2];return y===3||$===3?this.childViews.length<2:this.childViews.length===0}if(this.viewId===10)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return r[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const y=r[0];return y?y.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const y=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;return this.childViews.length===0&&y}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(r);if(this.viewId===16&&n){const y=[n.selectedCategories,n.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(y,n.totalCategoriesSelected)}if(this.viewId===18&&n){const y=[n.howManyCorners,n.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(y,n.howManyCorners)}if(this.viewId===1){const y=r[0]||[];if(!y||y.length===0)return!1;if(Array.isArray(y)){const $=this.childViews.map(f=>{var u;return(u=f.view.componentProps)==null?void 0:u.type}).filter(f=>f!==void 0);return y.filter(f=>!$.includes(f)).length>0}else{const $=y;return!this.childViews.find(f=>{var u;return((u=f.view.componentProps)==null?void 0:u.type)===$})}}if(this.viewId===2){const y=r[0]||[];if(Array.isArray(y)){if(y.length>0){const $=this.childViews.map(f=>{var u;const i=(u=f.view.componentProps)==null?void 0:u.categoryView;return i&&i.length>0?i[0].id:null}).filter(f=>f!==null);return y.filter(f=>!$.includes(f)).length>0}return!1}else{const $=y,f=r[1]||1;return $?!this.childViews.find(u=>{var i,d;const l=(i=u.view.componentProps)==null?void 0:i.categoryView,a=((d=u.view.filterMultiple)==null?void 0:d.teamType)||1;return l&&l.length>0&&l[0].id===$&&a===f}):!1}}return this.viewId===8?r[1]===3?this.childViews.length<2:this.childViews.length===0:this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(r,n=null){const y=this.childViews.filter(l=>l.view.isHomeTeam),$=this.childViews.filter(l=>!l.view.isHomeTeam),f=n||r[0].length,u=r[1],i=f*(u===1||u===2?1:2),d=u===3?y.length+$.length:y.length||$.length;return i>d}getRequiresLessViews(r){if(this.viewId===5)return r[0]!==3&&this.childViews.length>1;if(this.viewId===15)return r[0]!==3&&this.childViews.length>1;if(this.viewId===8)return r[1]!==3&&this.childViews.length>1;if(this.viewId===17)return r[0]!==3&&this.childViews.length>1;if(this.viewId===6){const n=r[0];return n===2||n===3}return this.viewId,!1}updateSummary({dynamicFilters:r}){const n=this.childViews[0],y=document.querySelector(`[gs-id="${n.view.id}"]`),$=n.grid;if(n&&y&&$){const f=r[0],u=`min_column${f?"_2":""}`,i=`min_row${f?"_2":""}`,d=`max_column${f?"_2":""}`,l=`max_row${f?"_2":""}`,a=`colspan${f?"_2":""}`,S=`rowspan${f?"_2":""}`,T=n.view.coreView[a],b=n.view.coreView[S],p=n.view.coreView[u],s=n.view.coreView[i],c=n.view.coreView[d],o=n.view.coreView[l];n.view.w=T,n.view.h=b,n.view.maxWidth=c,n.view.maxHeight=o,n.view.minWidth=p,n.view.minHeight=s,y.setAttribute("gs-w",T),y.setAttribute("gs-h",b),y.setAttribute("gs-max-w",c),y.setAttribute("gs-max-h",o),y.setAttribute("gs-min-w",p),y.setAttribute("gs-min-h",s),$.update(y,{h:b,w:T,"gs-max-h":o,"gs-max-w":c,"gs-min-h":s,"gs-min-w":p})}}updateFilters(r){this.filters=r,this.viewId===16?this.updateLastTouchFilters(r):this.viewId===18&&this.updateSpecificPlaysFilters(r)}updateDynamicFilters(r,n=null){var y,$,f,u;if(!this._isUpdating){this._isUpdating=!0,n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r,Sd.emit("component-added-to-container",this);try{if(this.viewId===5){const i=r[0]||1;if(i<3)if(this.childViews.length===1){const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.preMatchType=i,d.view.filterMultiple={isHomeTeam:d.view.componentProps.preMatchType===1})}else{const d=this.childViews.pop(),l=d.grid,a=d.page,S=document.querySelector(`[gs-id="${d.view.id}"]`);if(l&&S&&(l.removeWidget(S),a)){const b=a.items.findIndex(p=>p.id===d.view.id);b!==-1&&a.items.splice(b,1)}const T=this.childViews[0];T.view.componentProps&&(T.view.componentProps.preMatchType=i,T.view.filterMultiple={isHomeTeam:T.view.componentProps.preMatchType})}else this.childViews.forEach((d,l)=>{d.view.componentProps.preMatchType=l+1,d.view.filterMultiple={isHomeTeam:d.view.componentProps.preMatchType}})}if(this.viewId===15){const i=r[0]||1;if(n){const d=this.childViews.find(l=>l.view.id===n);d&&d.view.componentProps&&(d.view.componentProps.preMatchType=i,d.view.filterMultiple={isHomeTeam:i===1})}else if(i<3){if(this.childViews.length===1){const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.preMatchType=i,d.view.filterMultiple={isHomeTeam:i===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const l=this.childViews.pop(),a=l.grid,S=l.page,T=document.querySelector(`[gs-id="${l.view.id}"]`);if(a&&T&&(a.removeWidget(T),S)){const b=S.items.findIndex(p=>p.id===l.view.id);b!==-1&&S.items.splice(b,1)}}const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.preMatchType=i,d.view.filterMultiple={isHomeTeam:i===1})}}else if(this.childViews.length===2)this.childViews.forEach((d,l)=>{d.view.componentProps&&(d.view.componentProps.preMatchType=l+1,d.view.filterMultiple={isHomeTeam:l===0})});else if(this.childViews.length<2)this.childViews.forEach((d,l)=>{d.view.componentProps&&(d.view.componentProps.preMatchType=l+1,d.view.filterMultiple={isHomeTeam:l===0})});else{for(;this.childViews.length>2;){const d=this.childViews.pop(),l=d.grid,a=d.page,S=document.querySelector(`[gs-id="${d.view.id}"]`);if(l&&S&&(l.removeWidget(S),a)){const T=a.items.findIndex(b=>b.id===d.view.id);T!==-1&&a.items.splice(T,1)}}this.childViews.forEach((d,l)=>{d.view.componentProps&&(d.view.componentProps.preMatchType=l+1,d.view.filterMultiple={isHomeTeam:l===0})})}}if(this.viewId===17){const i=r[0]||1,d=r[2],l=i===3||d===3;if(n){const a=this.childViews.find(S=>S.view.id===n);if(a&&a.view.componentProps&&(r[0]!==void 0&&(a.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(a.view.componentProps.lateralidad=r[1]===32?"right":"left"),r[2]!==void 0)){const S=r[2],T=a.view.componentProps.game;if(S===3){if(((y=a.view.filterMultiple)==null?void 0:y.isHomeTeam)!==void 0){const b=a.view.filterMultiple.isHomeTeam;T&&(a.view.componentProps.teamselected=(typeof b=="boolean"?b:b===1)?T.home_team:T.away_team)}}else T&&(a.view.componentProps.teamselected=S===2?T.away_team:T.home_team);a.view.filterMultiple={isHomeTeam:S===1||S===3&&(($=a.view.filterMultiple)==null?void 0:$.isHomeTeam)}}}else if(l)if(this.childViews.length===2)this.childViews.forEach((a,S)=>{a.view.componentProps&&(a.view.componentProps.teamselected=S+1,a.view.filterMultiple={isHomeTeam:S===0})});else if(this.childViews.length<2)this.childViews.forEach((a,S)=>{a.view.componentProps&&(a.view.componentProps.teamselected=S+1,a.view.filterMultiple={isHomeTeam:S===0})});else{for(;this.childViews.length>2;){const a=this.childViews.pop(),S=a.grid,T=a.page,b=document.querySelector(`[gs-id="${a.view.id}"]`);if(S&&b&&(S.removeWidget(b),T)){const p=T.items.findIndex(s=>s.id===a.view.id);p!==-1&&T.items.splice(p,1)}}this.childViews.forEach((a,S)=>{a.view.componentProps&&(a.view.componentProps.teamselected=S+1,a.view.filterMultiple={isHomeTeam:S===0})})}else if(this.childViews.length===1){const a=this.childViews[0];if(a.view.componentProps){r[0]!==void 0&&(a.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(a.view.componentProps.lateralidad=r[1]===32?"right":"left");const S=a.view.componentProps.game;if(r[2]!==void 0&&S){const T=r[2];a.view.componentProps.teamselected=T===2?S.away_team:S.home_team}a.view.filterMultiple={isHomeTeam:i===1}}}else if(this.childViews.length>1){for(;this.childViews.length>1;){const S=this.childViews.pop(),T=S.grid,b=S.page,p=document.querySelector(`[gs-id="${S.view.id}"]`);if(T&&p&&(T.removeWidget(p),b)){const s=b.items.findIndex(c=>c.id===S.view.id);s!==-1&&b.items.splice(s,1)}}const a=this.childViews[0];if(a.view.componentProps){r[0]!==void 0&&(a.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(a.view.componentProps.lateralidad=r[1]===32?"right":"left");const S=a.view.componentProps.game;if(r[2]!==void 0&&S){const T=r[2];a.view.componentProps.teamselected=T===2?S.away_team:S.home_team}a.view.filterMultiple={isHomeTeam:i===1}}}}if(this.viewId===10){const i=r[0]||1;if(i<3)if(this.childViews.length===1){const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=i===1,d.view.filterMultiple={isHomeTeam:d.view.componentProps.isHomeTeamForAnalysis})}else{const d=this.childViews.pop(),l=d.grid,a=d.page,S=document.querySelector(`[gs-id="${d.view.id}"]`);if(l&&S&&(l.removeWidget(S),a)){const b=a.items.findIndex(p=>p.id===d.view.id);b!==-1&&a.items.splice(b,1)}const T=this.childViews[0];T.view.componentProps&&(T.view.componentProps.isHomeTeamForAnalysis=i===1,T.view.filterMultiple={isHomeTeam:T.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((d,l)=>{d.view.componentProps.isHomeTeamForAnalysis=l%2===0,d.view.filterMultiple={isHomeTeam:d.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const i=r[1];if(i===3)this.childViews.forEach((d,l)=>{d.view.componentProps.isHomeTeamForAnalysis=l%2===0,d.view.isHomeTeam=l%2===0,d.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",d.view.filterMultiple={isHomeTeam:d.view.isHomeTeam}});else{const d=i===1;if(this.childViews.length>0){const l=this.childViews[0];l.view.componentProps.isHomeTeamForAnalysis=d,l.view.isHomeTeam=d,l.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",l.view.filterMultiple={isHomeTeam:d},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const i=r[0],d=r[1];if(d===3){if(this.childViews.length>i.length){const l=i.map(a=>{const S=a.join("-");return F4.get(this.viewId).analysisTypes.get(S).analysisType});this.childViews.reduce((a,S)=>(l.includes(S.view.componentProps.analysisType)||a.push(S.view.componentProps.analysisType),a),[]).forEach(a=>{const S=this.childViews.findIndex(T=>T.view.componentProps.analysisType===a);if(S!==-1){const T=this.childViews[S];this.removeChildView(T)}})}}else{const l=d===1,a=this.getHomeTeamViews(),S=this.getAwayTeamViews();if(l&&a.length===0)S.forEach(T=>{T.view.componentProps.isHomeTeamForAnalysis=l,T.view.isHomeTeam=l,T.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}});else if(!l&&S.length===0)a.forEach(T=>{T.view.componentProps.isHomeTeamForAnalysis=l,T.view.isHomeTeam=l,T.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}});else if(a.length===S.length)l||a.forEach(T=>{T.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}}),(l?S:a).forEach(T=>{this.removeChildView(T)});else{const T=l?this.getHomeTeamViews():this.getAwayTeamViews();if(T.length>i.length){const b=i.map(p=>{const s=p.join("-");return F4.get(this.viewId).analysisTypes.get(s).analysisType});T.forEach(p=>{b.includes(p.view.componentProps.analysisType)?p.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}:this.removeChildView(p)})}else T.forEach(b=>{b.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}})}}}if(this.viewId===2){const i=r[0]||[];if(Array.isArray(i)){const d=this.childViews.map(l=>{var a,S;const T=(a=l.view.componentProps)==null?void 0:a.categoryView,b=((S=l.view.filterMultiple)==null?void 0:S.teamType)||1,p=T&&T.length>0?T[0].id:null;return p?{categoryId:p,teamType:b,viewId:l.view.id}:null}).filter(l=>l!==null);if(n){const l=this.childViews.find(a=>a.view.id===n);if(l){const a=r[1]||1,S=i[0];if(S){let T=null;try{T=R4(S)}catch{}l.view.filterMultiple={categoryId:S,teamType:a},l.view.componentProps.game&&(a===1?l.view.componentProps.teamView=l.view.componentProps.game.homeTeam.team_id:a===2?l.view.componentProps.teamView=l.view.componentProps.game.awayTeam.team_id:l.view.componentProps.teamView=0),l.view.componentProps.categoryView=T?[{id:S,name:T.name}]:[{id:S,name:`Category ${S}`}]}}}if(!n){const l=r[1]||1;this.childViews.forEach(a=>{var S;const T=(S=a.view.componentProps)==null?void 0:S.categoryView;if(T&&T.length>0){const b=T[0].id;i.includes(b)&&(a.view.filterMultiple={categoryId:b,teamType:l})}})}if(d.map(l=>l.categoryId).filter(l=>!i.includes(l)).forEach(l=>{this.childViews.filter(a=>{var S;const T=(S=a.view.componentProps)==null?void 0:S.categoryView;return T&&T.length>0&&T[0].id===l}).forEach(a=>{this.removeChildView(a),Sd.emit("component-removed",{viewId:a.view.id,categoryId:l})})}),n){const l=i[0];if(l){const a=this.childViews.find(S=>S.view.id===n);if(a){let S=null;try{S=R4(l)}catch{}const T=r[1]||1;a.view.filterMultiple={categoryId:l,teamType:T},a.view.componentProps.game&&(a.view.componentProps.teamView=T===2?a.view.componentProps.game.awayTeam.team_id:T===1?a.view.componentProps.game.homeTeam.team_id:0),a.view.componentProps.categoryView=S?[{id:l,name:S.name}]:[{id:l,name:`Category ${l}`}]}}}}else{const d=i;if(d&&n){const l=this.childViews.find(a=>a.view.id===n);if(l){let a=null;try{a=R4(d)}catch{}const S=r[1]||1;l.view.filterMultiple={categoryId:d,teamType:S},l.view.componentProps.game&&(l.view.componentProps.teamView=S===2?l.view.componentProps.game.awayTeam.team_id:S===1?l.view.componentProps.game.homeTeam.team_id:0),l.view.componentProps.categoryView=a?[{id:d,name:a.name}]:[{id:d,name:`Category ${d}`}]}}}}if(this.viewId===8){const i=r[0]||!1,d=r[1],l=(a,S)=>{a.view.componentProps&&(a.view.componentProps._isReactive||(a.view.componentProps=e.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=S.areInactiveVisible,a.view.componentProps.key=S.areInactiveVisible,S.isHomeTeam!==void 0&&(a.view.filterMultiple={...a.view.filterMultiple||{},isHomeTeam:S.isHomeTeam}),S.teamId!==void 0&&a.view.componentProps.game&&(a.view.componentProps.teamSelected={teamId:S.teamId}),Sd.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:r}))};if(n){const a=this.childViews.find(S=>S.view.id===n);a&&l(a,{areInactiveVisible:i})}else if(this.childViews.forEach(a=>{l(a,{areInactiveVisible:i})}),d===3){if(this.childViews.length===2)this.childViews.forEach((a,S)=>{var T;const b=(T=a.view.componentProps)==null?void 0:T.game;a.view.filterMultiple={isHomeTeam:S===0},b&&(a.view.componentProps.teamSelected={teamId:S===0?b.home_team:b.away_team})});else if(this.childViews.length>2){for(;this.childViews.length>2;){const a=this.childViews.pop(),S=a.grid,T=a.page,b=document.querySelector(`[gs-id="${a.view.id}"]`);if(S&&b&&(S.removeWidget(b),T)){const p=T.items.findIndex(s=>s.id===a.view.id);p!==-1&&T.items.splice(p,1)}}this.childViews.forEach((a,S)=>{var T;a.view.filterMultiple={isHomeTeam:S===0},(T=a.view.componentProps)!=null&&T.game&&(a.view.componentProps.teamSelected={teamId:S===0?a.view.componentProps.game.home_team:a.view.componentProps.game.away_team})})}}else if(this.childViews.length===1){const a=this.childViews[0],S=(f=a.view.componentProps)==null?void 0:f.game;a.view.filterMultiple={isHomeTeam:d===1},S&&(a.view.componentProps.teamSelected={teamId:d===1?S.home_team:S.away_team})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const T=this.childViews.pop(),b=T.grid,p=T.page,s=document.querySelector(`[gs-id="${T.view.id}"]`);if(b&&s&&(b.removeWidget(s),p)){const c=p.items.findIndex(o=>o.id===T.view.id);c!==-1&&p.items.splice(c,1)}}const a=this.childViews[0],S=(u=a.view.componentProps)==null?void 0:u.game;a.view.filterMultiple={isHomeTeam:d===1},S&&(a.view.componentProps.teamSelected={teamId:d===1?S.home_team:S.away_team})}}if(this.viewId===1){const i=r[0]||[];if(n){this.setDynamicFilters(r,n);const d=this.childViews.find(l=>l.view.id===n);d&&this.updateComparative(d,r)}else if(this.childViews.reduce((d,l)=>(i.includes(l.view.componentProps.type)||d.push(l.view.componentProps.type),d),[]).forEach(d=>{const l=this.childViews.findIndex(a=>a.view.componentProps.type===d);if(l!==-1){for(let a=l;a<this.childViews.length;a++){const S=this.childViews[a+1],T=this.childViews[a];S&&(T.view.componentProps.type=S.view.componentProps.type,T.view.title=S.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(i))this.childViews.length>0&&i.length>0&&this.childViews.forEach((d,l)=>{if(d.view.componentProps&&l<i.length){const a=i[l],S=F4.get(this.viewId);d.view.componentProps.type=a,d.view.componentProps.default=!1,d.view.title=`Comparativa ${S[a]}`,d.view.filterMultiple={category:a}}});else{const d=i;if(d&&this.childViews.length>0){const l=this.childViews[0];if(l.view.componentProps){const a=F4.get(this.viewId);l.view.componentProps.type=d,l.view.componentProps.default=!1,l.view.title=`Comparativa ${a[d]}`,l.view.filterMultiple={category:d}}}}}if(this.viewId===6){const i=r[0]||[];if(n){this.setDynamicFilters(r,n);const d=this.childViews.find(l=>l.view.id===n);d&&this.updateGSCLineupsReports(d,r)}else{if(Array.isArray(i))if(i.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((d,l)=>(i.includes(l.view.componentProps.gameNumber)||d.push(l.view.componentProps.gameNumber),d),[]).forEach(d=>{const l=this.childViews.findIndex(a=>a.view.componentProps.gameNumber===d);if(l!==-1){for(let a=l;a<this.childViews.length;a++){const S=this.childViews[a+1],T=this.childViews[a];S&&(T.view.componentProps.gameNumber=S.view.componentProps.gameNumber,T.view.filterMultiple={gameNumber:S.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(d=>{d.view.componentProps&&(d.view.componentProps._isReactive||(d.view.componentProps=e.reactive(d.view.componentProps),d.view.componentProps._isReactive=!0),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:d.view.id,dynamicFilters:r}))})}}if(this.viewId===3){if(n){this.setDynamicFilters(r,n);const i=this.childViews.find(d=>d.view.id===n);i&&this.updateMatchSummary(i,r)}else{const i=r[0]||!1;this.childViews.forEach(d=>{d.view.componentProps&&(d.view.componentProps._isReactive||(d.view.componentProps=e.reactive(d.view.componentProps),d.view.componentProps._isReactive=!0),d.view.componentProps.desplegable=i,d.view.componentProps.key=i,Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:d.view.id,dynamicFilters:r}))})}this.updateSummary({dynamicFilters:r})}if(this.viewId===13){const i=r[1]||[];if(n){this.setDynamicFilters(r,n);const d=this.childViews.find(l=>l.view.id===n);d&&(d.view.componentProps&&(d.view.componentProps.categoryids=i,d.view.componentProps.analysistype=r[0]||1,d.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],d.view.dynamicFilters=r,d.view._updateKey=Date.now()),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:d.view.id,dynamicFilters:r}))}else this.childViews.forEach(d=>{d.view.componentProps&&(d.view.componentProps._isReactive||(d.view.componentProps=e.reactive(d.view.componentProps),d.view.componentProps._isReactive=!0),d.view.componentProps.categoryids=i,d.view.componentProps.analysistype=r[0]||1,d.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],d.view.dynamicFilters=r,d.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:d.view.id,dynamicFilters:r}))})}else if(this.viewId===15){const i=r[0]||1,d=r[3]!==void 0?r[3]:typeof r[1]=="number"?r[1]:null;if(n){this.setDynamicFilters(r,n);const l=this.childViews.find(a=>a.view.id===n);l&&l.view.componentProps&&(l.view.componentProps.analysistype=i,d!==null&&(l.view.componentProps.numitems=d),l.view.dynamicFilters=r,l.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:l.view.id,componentProps:l.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:l.view.id,dynamicFilters:r}))}else this.childViews.forEach(l=>{l.view.componentProps&&(l.view.componentProps._isReactive||(l.view.componentProps=e.reactive(l.view.componentProps),l.view.componentProps._isReactive=!0),l.view.componentProps.analysistype=i,d!==null&&(l.view.componentProps.numitems=d),l.view.dynamicFilters=r,l.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:l.view.id,componentProps:l.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:l.view.id,dynamicFilters:r}))})}if(this.viewId===4){const i=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;if(n){const d=this.childViews.find(l=>l.view.id===n);d&&d.view.componentProps.selectedEvents}else if(!i&&this.childViews.length>0)this.childViews.forEach(d=>{this.removeChildView(d)});else if(i&&this.childViews.length===0){const d={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};Sd.emit("add-view",d)}else this.childViews.forEach(d=>{this.updateTimeline(d,r)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(r=>{this.removeChildView(r)})}removeChildView(r,n=!1){const y=this.childViews.findIndex($=>$.view.id===r.view.id);if(y!==-1){const $=this.childViews[y];this.childViews.splice(y,1),$.view.id&&this.componentSpecificFilters.delete($.view.id);const f=$.grid,u=$.page,i=document.querySelector(`[gs-id="${$.view.id}"]`);if(f&&i&&(f.removeWidget(i),u&&!n)){const d=u.items.findIndex(l=>l.id===$.view.id);d!==-1&&(u.items.splice(d,1),u.items.length===0&&Sd.emit("empty-page",u))}}}updateView({view:r,dynamicFilters:n,filtersJSON:y,filters:$}){this.setFiltersJSON(y),this.dynamicFilters=n;const f=this.childViews.find(u=>{var i;return((i=u.view)==null?void 0:i.id)===r.view.id});if(f){f.view.filtersJSON=y,f.view.coreView&&(f.view.coreView.filtersJSON=y);let u=n;if(this.viewId===4){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===8){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===3){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i),this.updateSummary({dynamicFilters:u})}else if(this.viewId===1){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===6){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===7){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===9){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}this.viewId===5?this.updateVolumetricField(f,u):this.viewId===7?this.updateGoalData(f,u):this.viewId===9?this.updateFieldDataByZones(f,n):this.viewId===10?this.updateXg(f,u):this.viewId===3?this.updateMatchSummary(f,u):this.viewId===4?this.updateTimeline(f,u):this.viewId===8?this.updateFieldPosesion(f,u):this.viewId===1?this.updateComparative(f,u):this.viewId===2?this.updateGSCtops(f,u):this.viewId===6?this.updateGSCLineupsReports(f,u):this.viewId===16?this.updateLastTouchSingle(f,$):this.viewId===18&&this.updateSpecificPlaysFiltersSingle(f,$)}}updateComparative(r,n){if(r.view.componentProps){const y=n[0]||[];if(y&&y.length>0){let $;if(Array.isArray(y)){const u=this.childViews.findIndex(i=>i.view.id===r.view.id);u>=0&&u<y.length?$=y[u]:$=y[0]}else $=y;const f=F4.get(this.viewId);r.view.componentProps.type=$,r.view.componentProps.default=!1,r.view.title=`Comparativa ${f[$]}`,r.view.filterMultiple={category:$}}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateVolumetricField(r,n){if(r.view.componentProps){const y=n[0]||1;r.view.isHomeTeam=y===1,r.view.componentProps.preMatchType=y,r.view.filterMultiple={isHomeTeam:y},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateGoalData(r,n){if(r.view.componentProps){const y=n[0]===1?"offensive":"defensive",$=n[1]===1;r.view.componentProps.analysisType=y,r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={isHomeTeam:$},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldDataByZones(r,n){if(r.view.componentProps){const y=n[0],$=n[1]===1;if(r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={categoryIds:y,isHomeTeam:$},y&&y.length){const f=y.join("-"),u=F4.get(this.viewId).analysisTypes.get(f);u&&(r.view.componentProps.analysisType=u.analysisType,r.view.title=u.title,r.view.titleShort=u.titleShort)}}}updateXg(r,n){const y=n[0]===1;r.view.componentProps&&(r.view.isHomeTeam=y,r.view.componentProps.isHomeTeamForAnalysis=y,r.view.filtersJSON=this.filtresJSON,r.view.filterMultiple={isHomeTeam:y})}updateMatchSummary(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const y=n&&n.length>0?n[0]:!1;r.view.componentProps.desplegable=y,r.view.componentProps.key=y,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateTimeline(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const y=this.getComponentDynamicFilters(r.view.id)||n,$=y&&y.length>0?y[0]:[];r.view.componentProps.selectedEvents=$,r.view.componentProps.key=$.length>0;const f=this.hasEventTypeId($,1),u=this.hasCategoryId($,8),i=this.hasCategoryId($,9),d=this.hasEventTypeId($,3);r.view.componentProps.goals=f,r.view.componentProps.yellowCards=u,r.view.componentProps.redCards=i,r.view.componentProps.substitutions=d,r.view.componentProps._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:y}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:y}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldPosesion(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const y=n&&n.length>0?n[0]:!1;r.view.componentProps.areInactiveVisible=y,r.view.componentProps.key=y,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateGSCtops(r,n){if(r.view.componentProps){const y=n[0]||[];if(Array.isArray(y)){if(y.length>0){const $=y[0];let f=null;try{f=R4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=n[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=f?[{id:$,name:f.name}]:[{id:$,name:`Category ${$}`}]}}else{const $=y;if($){let f=null;try{f=R4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=n[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=f?[{id:$,name:f.name}]:[{id:$,name:`Category ${$}`}]}}}}updateGSCLineupsReports(r,n){if(r.view.componentProps){const y=n[0]||[];if(Array.isArray(y)){if(y.length>0){const $=y[0];r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$}}else{const $=y;$&&(r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$)}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}getCategoryIdFromAnalysisType(r,n){if(!r||!n)return null;for(const y of n){const $=y.join("-"),f=F4.get(this.viewId);if(f&&f.analysisTypes){const u=f.analysisTypes.get($);if(u&&u.analysisType===r)return y[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach($=>{$.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,$.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,$.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,$.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const r=this.filters.selectedCategories.map($=>$.value),n=r.map($=>$.name),y=this.filters.selectedTeam.value;if(y===3)this.childViews.length>r&&this.childViews.reduce(($,f)=>(n.includes(f.view.componentProps.categories[0].name)||$.push(f.view.componentProps.categories[0].name),$),[]).forEach($=>{const f=this.childViews.findIndex(u=>u.view.componentProps.categories[0].name===$);if(f!==-1){const u=this.childViews[f];this.removeChildView(u)}});else{const $=y===1,f=this.getHomeTeamViews(),u=this.getAwayTeamViews();if($&&f.length===0)u.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(!$&&u.length===0)f.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(f.length===u.length)$||f.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$}),($?u:f).forEach(i=>{this.removeChildView(i)});else{const i=$?this.getHomeTeamViews():this.getAwayTeamViews();if(i.length>r.length){const d=r.map(l=>l.name);i.forEach(l=>{d.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=$:this.removeChildView(l)})}else i.forEach(d=>{d.view.filterMultiple.isHomeTeam=$})}}}updateLastTouchSingle(r,n){if(r.view.componentProps){const y=n.selectedTeam.value===1,$=n.selectedCategory.value;r.view.isHomeTeam=y,r.view.componentProps.isHomeTeamForAnalysis=y,r.view.componentProps.categories=[$],r.view.componentProps.analysisType=n.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=n.isAssistZoneVisible,r.view.componentProps.howManyGames=n.howManyGamesSelected.value,r.view.title=$.name,r.view.titleShort=$.name,r.view.isHomeTeam=y,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:$,selectedGamePhase:n.selectedGamePhase,howManyGamesSelected:n.howManyGamesSelected,isAssistZoneVisible:n.isAssistZoneVisible}}}updateSpecificPlaysFilters(){if(!this.filters)return;this.childViews.forEach(n=>{n.view.componentProps.advancedFilters=this.filters.advancedFilters,n.view.componentProps.howManyCorners=this.filters.howManyCorners,n.view.componentProps.isAgainstMode=this.filters.isAgainstMode,n.view.filterMultiple.advancedFilters=this.filters.advancedFilters,n.view.filterMultiple.isAgainstMode=this.filters.isAgainstMode});const r=this.filters.selectedTeam.value;if(r===3){const n=this.getHomeTeamViews(),y=this.getAwayTeamViews();if(n.length+y.length>this.filters.howManyCorners*2){const $=[];n.forEach((f,u)=>{u>=this.filters.howManyCorners&&$.push(f)}),y.forEach((f,u)=>{u>=this.filters.howManyCorners&&$.push(f)}),$.forEach(f=>{this.removeChildView(f)})}}else{const n=r===1,y=this.getHomeTeamViews(),$=this.getAwayTeamViews();if(n&&y.length===0)$.forEach(f=>{console.log("awayView before update:",f),f.view.componentProps.isHomeTeamForAnalysis=n,f.view.isHomeTeam=n,f.view.filterMultiple.isHomeTeam=n});else if(!n&&$.length===0)y.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=n,f.view.isHomeTeam=n,f.view.filterMultiple.isHomeTeam=n});else if(y.length===$.length)n||y.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=n,f.view.isHomeTeam=n,f.view.filterMultiple.isHomeTeam=n}),(n?$:y).forEach(f=>{this.removeChildView(f)});else{const f=n?this.getHomeTeamViews():this.getAwayTeamViews();f.length>this.filters.howManyCorners?f.forEach((u,i)=>{i>=this.filters.howManyCorners?this.removeChildView(u):u.view.filterMultiple.isHomeTeam=n}):f.forEach(u=>{u.view.filterMultiple.isHomeTeam=n})}}}updateSpecificPlaysFiltersSingle(r,n){if(n.selectedTeam&&r.view.componentProps){const y=n.selectedTeam.value===1;r.view.isHomeTeam=y,r.view.componentProps.isHomeTeamForAnalysis=y,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.advancedFilters=n.advancedFilters,r.view.componentProps.isAgainstMode=n.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:n.advancedFilters,isAgainstMode:n.isAgainstMode}}}}const fHt={class:"template-page__header"},mHt={class:"template-page__header__name"},yHt=["value"],gHt={class:"template-page__header__details"},vHt={class:"template-page__header__details__teams"},bHt={class:"template-page__header__details__teams__team"},xHt={key:0,class:"template-page__header__details__teams__team__logo"},_Ht=["src"],wHt={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},THt={class:"template-page__header__details__teams__team"},SHt={key:0,class:"template-page__header__details__teams__team__logo"},kHt=["src"],LHt={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},CHt={class:"template-page__content"},NHt=["id"],OHt=["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"],EHt=e.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(t,{emit:r}){var n,y,$,f,u,i,d;const l=e.ref(null);let a=null;const S=t,T=e.ref(!1),b=r,p=e.computed(()=>S.page.items.reduce((qt,_t)=>(qt.set(_t.id,_t),qt),new Map)),s=e.computed(()=>{var qt,_t,It,jt;return S.game&&S.game.homeTeam&&S.game.awayTeam?{homeTeam:{name:((qt=S.game.homeTeam)==null?void 0:qt.acronym)||"LOC",logo:((_t=S.game.homeTeam)==null?void 0:_t.logo)||null},awayTeam:{name:((It=S.game.awayTeam)==null?void 0:It.acronym)||"VIS",logo:((jt=S.game.awayTeam)==null?void 0:jt.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let c=null,o=null,h=!1,v=null,k=!1;const L=()=>{k=!0},E=()=>{k=!1};function P(){k||(h=!0,v&&clearTimeout(v),v=setTimeout(()=>{h=!1},150))}function V(){const qt={root:null,rootMargin:"0px",threshold:.7};c=new IntersectionObserver(jt=>{jt.forEach(Rt=>{if(h){o&&clearTimeout(o),o=setTimeout(()=>{b("intersection-changed",Rt.isIntersecting)},100);return}o&&clearTimeout(o),o=setTimeout(()=>{b("intersection-changed",Rt.isIntersecting)},50)})},qt);const _t=l.value;_t&&c.observe(_t);const It=document.querySelector(".container-main");It&&It.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}function I(qt){S.page.title=qt.target.value,b("view-changed")}const j={game_id:0,season_id:0,prematch:!1},F={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:[]}},D=new Map([[5,{component:BI,componentName:"GSCVolumetricField",props:{isGamePreMatch:!S.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:S.isTemplateMode,isTemplateMode:S.isTemplateMode,preMatchType:1}}],[2,{component:Pj,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:S.game?S.game.id:F.gameId,game:S.game,season:S.game?(n=S==null?void 0:S.game)==null?void 0:n.season_id:F.seasonId,teamView:0,useDummyData:S.isTemplateMode}}],[8,{component:FD,componentName:"FieldPosesion",props:{widthSection:600,game:F,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:jB,componentName:"GSCLineupsReports",props:{selectedOption:S.isPostMatch?"Postmatch":"Prematch",game:j,gamehome:j,gameaway:j}}],[3,{component:qD,componentName:"GSCMatchSummary",props:{game:F,defaultShields:!0,desplegable:!1}}],[4,{component:SW,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:F.gameId,homeTeam:F.homeTeam.team_id,awayTeam:F.awayTeam.team_id,token:S.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:MK,componentName:"GSCGoalData",props:{game:S.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!S.isPostMatch,analysisType:1}}],[9,{component:KB,componentName:"GSCFieldDataByZones",props:{game:S.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!S.isPostMatch,negative:!0}}],[10,{component:oP,componentName:"GSCGameXg",props:{game:S.game,isHomeTeamForAnalysis:!0,isPostMatch:S.isPostMatch}}],[13,{component:$U,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:S.game?(y=S==null?void 0:S.game)==null?void 0:y.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:hU,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:EX,componentName:"GSCStrengths",props:{token:S.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[17,{component:DG,componentName:"GSCCornersGeneralTrend",props:{game:S.game?{id:S.game.id||S.game.game_id||S.game.gameId||null,home_team:S.game.home_team||null,away_team:S.game.visiting_team||null,season:S.game.seasonId||S.game.season_id||null,game_status:S.game.game_status||S.game.status||null,home_acronym:S.game.home_team_acronym||(($=S.game.homeTeam)==null?void 0:$.acronym)||null,away_acronym:S.game.visiting_team_acronym||((f=S.game.awayTeam)==null?void 0:f.acronym)||null,logo_home:((u=S.game.homeTeam)==null?void 0:u.logo)||null,logo_away:((i=S.game.awayTeam)==null?void 0:i.logo)||null}:null,infavoragainstteam:!0,forseason:!1,forteam:!0,showdefault:!0,tournamentselected:{id:1},forgame:!1,lateralidad:"right",teamselected:2,filters:{},showBallGo:!0,showHeatMap:!0,ballOnOff:!1}}],[10,{component:oP,componentName:"GSCGameXg",props:{game:S.game,isHomeTeamForAnalysis:!0,isPostMatch:S.isPostMatch}}],[1,{component:OK,componentName:"GSCComparativeReports",props:{gameId:S.game?S.game.id:"",homeLogo:S.game?S.game.homeTeam.logo:"",awayLogo:S.game?S.game.awayTeam.logo:"",seasonId:S.game?(d=S==null?void 0:S.game)==null?void 0:d.season_id:0,typeGame:S.isPostMatch,type:"stoppedBall",default:S.isTemplateMode}}],[16,{component:FX,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:17,gameDataUTC:"2025-11-08T03:00:00Z",isHomeTeamForAnalysis:!0,isTemplateMode:S.isTemplateMode,isPreMatch:!S.isPostMatch}}],[18,{component:AZ,componentName:"GSCSpecificPlays",props:{isHomeTeamForAnalysis:!0,isTemplateMode:S.isTemplateMode,isPreMatch:!S.isPostMatch,seasonIdForAnalysis:1325,selectedCategory:31,teamIdForAnalysis:1,isAgainstMode:!1,game:{id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"},advancedFilters:{areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0}}}]]);function U(qt){var _t,It,jt;if(((_t=qt==null?void 0:qt.coreView)==null?void 0:_t.id)===17&&qt.dynamicFilters&&qt.dynamicFilters[2]!==void 0){const Rt=qt.dynamicFilters[2];if(Rt===1)return!0;if(Rt===2)return!1;if(Rt===3&&((It=qt.filterMultiple)==null?void 0:It.isHomeTeam)!==void 0)return typeof qt.filterMultiple.isHomeTeam=="boolean"?qt.filterMultiple.isHomeTeam:qt.filterMultiple.isHomeTeam===1}return(jt=qt.componentProps)!=null&&jt.preMatchType?qt.componentProps.preMatchType===1:qt.isHomeTeam}function M(qt){if(qt)if(typeof qt=="string"){let _t=null;switch(qt){case"GSCVolumetricField":_t=BI;break;case"GSCGoalData":_t=MK;break;case"GscTopPlayer":_t=Pj;break;case"FieldPosesion":_t=FD;break;case"GSCLineupsReports":_t=jB;break;case"GSCMatchSummary":_t=qD;break;case"GSCTimelineReports":_t=SW;break;case"GSCFieldDataByZones":_t=KB;break;case"GSCGeneraltable":_t=hU;break;case"GSCTimelapseTable":_t=$U;break;case"GSCGameXg":_t=oP;break;case"GSCComparativeReports":_t=OK;break;case"GSCStrengths":_t=EX;break;case"GSCCornersGeneralTrend":_t=DG;break;case"GSCLastTouch":_t=FX;break;case"GSCSpecificPlays":_t=AZ;break;default:_t=null}return _t}else return qt;return null}function X({pageId:qt,view:_t,filterAndWidgetContainer:It,applyMinimumSize:jt=!1,dynamicFilters:Rt=[],filters:Wt=null}){if(S.page.id===qt&&a){let re=!1;_t.id===3&&(re=Rt[0]);const le=`min_column${re?"_2":""}`,he=`min_row${re?"_2":""}`,de=`colspan${re?"_2":""}`,Jt=`rowspan${re?"_2":""}`,te={w:jt?_t[le]:_t[de],h:jt?_t[he]:_t[Jt]};if(a.willItFit(te)){const ne=a.addWidget(te),Le=Number(ne.getAttribute("gs-x")||0),Oe=Number(ne.getAttribute("gs-y")||0);a.removeWidget(ne);const Ne=D.get(_t.id),Pe=e.reactive({...JSON.parse(JSON.stringify(Ne.props))||{},_isReactive:!0}),Xe=e.reactive({pageId:qt,grid:a,page:S.page,view:{name:_t.name,title:_t.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:Le,y:Oe,w:te.w,h:te.h,maxWidth:_t.max_column,maxHeight:_t.max_row,minWidth:_t.min_column,minHeight:_t.min_row,componentName:Ne.componentName,componentProps:Pe,pageId:qt,coreView:_t}});It.addView(Xe),Sd.emit("add-page-view",Xe)}else Sd.emit("add-page-and-view",{pageId:qt,view:_t,filterAndWidgetContainer:It})}}function O(qt){if(a){const _t=document.querySelector(`[gs-id="${qt.id}"]`);_t&&(a.removeWidget(_t),b("delete-view",qt))}}function Y(qt){if(!qt.filterAndViewsContainer&&qt.coreView){const _t=new Yk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[qt],qt.coreView.id,qt.dynamicFilters||[],S.isPostMatch,S.isTemplateMode,qt.filtersJSON,null,qt.filters);qt.filterAndViewsContainer=_t}b("edit-view",qt)}function st(){b("delete-page",S.page)}function mt(){Sd.emit("change-sort",S.page)}function yt(qt){if(h)return;const _t=S.page.items.find(It=>It.id===qt.itemId||It.id===qt.viewId);_t&&(Object.assign(_t.componentProps,qt.componentProps),_t._updateKey=Date.now())}function bt(qt){if(h)return;const _t=S.page.items.find(It=>It.id===qt.viewId);_t&&(Object.assign(_t.componentProps,qt.componentProps),_t._updateKey=Date.now())}function xt(qt){if(h)return;const _t=S.page.items.find(It=>It.id===qt.viewId);_t&&(Object.assign(_t.componentProps,qt.componentProps||{}),_t._updateKey=Date.now())}const Pt=function(){Sd.off("add-view",X),Sd.off("force-component-update",yt),Sd.off("component-props-updated",bt),Sd.off("dynamic-filters-changed",xt);const qt=document.querySelector(".container-main");qt&&qt.removeEventListener("scroll",P),o&&clearTimeout(o),v&&clearTimeout(v)};return Sd.on("add-view",X),Sd.on("force-component-update",yt),Sd.on("component-props-updated",bt),Sd.on("dynamic-filters-changed",xt),e.onMounted(async()=>{await e.nextTick(),a=Rh.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${S.id}`),a.on("change",(qt,_t)=>{const It=_t[0];if(It){const jt=p.value.get(It.id);jt&&(jt.x=It.x,jt.y=It.y,jt.w=It.w,jt.h=It.h,b("view-changed"))}}),V(),S.page.grid=a,S.page.offListeners=Pt}),e.onUnmounted(()=>{c&&c.disconnect(),Pt(),o&&clearTimeout(o),v&&clearTimeout(v),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E)}),(qt,_t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"templatePage",ref:l,class:"template-page"},[e.createElementVNode("div",fHt,[T.value?(e.openBlock(),e.createBlock(RZ,{key:0,"options-type":"page",onClick:_t[0]||(_t[0]=e.withModifiers(It=>T.value=!1,["self"])),onMouseleave:_t[1]||(_t[1]=It=>T.value=!1),onCloseTooltip:_t[2]||(_t[2]=It=>T.value=!1),onDeletePage:st,onChangeSort:mt})):e.createCommentVNode("",!0),e.createElementVNode("div",mHt,[_t[4]||(_t[4]=e.createElementVNode("div",null,[e.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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)),_t[5]||(_t[5]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("input",{value:t.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:I},null,40,yHt)]),e.createElementVNode("div",gHt,[e.createElementVNode("div",vHt,[e.createElementVNode("div",bHt,[s.value.homeTeam.logo?(e.openBlock(),e.createElementBlock("div",xHt,[e.createElementVNode("img",{src:s.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,_Ht)])):(e.openBlock(),e.createElementBlock("svg",wHt,[..._t[6]||(_t[6]=[e.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.createElementVNode("span",null,e.toDisplayString(s.value.homeTeam.name),1)]),_t[8]||(_t[8]=e.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),e.createElementVNode("div",THt,[e.createElementVNode("span",null,e.toDisplayString(s.value.awayTeam.name),1),s.value.awayTeam.logo?(e.openBlock(),e.createElementBlock("div",SHt,[e.createElementVNode("img",{src:s.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,kHt)])):(e.openBlock(),e.createElementBlock("svg",LHt,[..._t[7]||(_t[7]=[e.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)])]))])]),t.isTemplateMode&&!t.isFilterVisible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:_t[3]||(_t[3]=It=>T.value=!0)},[..._t[9]||(_t[9]=[e.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",CHt,[e.createElementVNode("div",{id:`grid-stack-${t.id}`,class:"grid-stack"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.page.items,It=>{var jt;return e.openBlock(),e.createElementBlock("div",{class:"grid-stack-item",key:It.key,"gs-id":It.id,"gs-x":It.x,"gs-y":It.y,"gs-w":It.w,"gs-h":It.h,"gs-max-w":It.maxWidth,"gs-max-h":It.maxHeight,"gs-min-w":It.minWidth,"gs-min-h":It.minHeight,"gs-no-resize":!t.isTemplateMode,"gs-no-move":!S.isTemplateMode,"gs-auto-position":It.x===0&&It.y===0},[e.createElementVNode("div",{class:e.normalizeClass(["grid-stack-item-content",{"is-selected":It.isSelected}])},[e.createVNode(iHt,{view:It,"is-template-mode":t.isTemplateMode,"is-post-match":t.isPostMatch,game:t.game,lastGames:t.lastGames,"is-home-team":U(It),"is-filter-visible":t.isFilterVisible,"view-id":((jt=It==null?void 0:It.coreView)==null?void 0:jt.id)||0,onEdit:Rt=>Y(It),onDelete:Rt=>O(It)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(M(It.componentName)),e.mergeProps({ref_for:!0},It.componentProps,{key:`${It.id}-${It._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,OHt)}),128))],8,NHt)])],512))}}),zHt=e2(EHt,[["__scopeId","data-v-9e61e7d4"]]),MHt={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},VHt={key:0,class:"cover__main-logo cover__main-logo__home"},PHt={key:0,class:"team-logo"},AHt=["src"],RHt={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},FHt=["fill"],UHt={key:1,class:"cover__main-logo cover__main-logo__away"},IHt={key:0,class:"team-logo"},qHt=["src"],jHt={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DHt=["fill"],WHt={class:"cover__title-subtitle"},BHt={class:"cover__title-subtitle__title"},KHt={class:"cover__title-subtitle__subtitle"},XHt={key:2,class:"cover-type-one"},GHt={class:"team-info-one"},ZHt={class:"team-data"},JHt={key:0,class:"team-logo"},HHt=["src"],YHt={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},QHt=["fill","opacity"],$Ht={class:"team-name"},tYt={key:0,class:"team-events"},eYt={class:"score-one"},rYt={key:0},nYt={class:"team-info-one"},aYt={class:"team-data"},iYt={key:0,class:"team-logo"},oYt=["src"],sYt={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lYt=["fill","opacity"],cYt={class:"team-name"},uYt={key:0,class:"team-events"},dYt={key:3,class:"cover-type-two"},pYt={class:"team-data"},hYt={class:"team-info"},fYt={key:0,class:"team-logo"},mYt=["src"],yYt={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gYt=["fill","opacity"],vYt={key:2,class:"team-score-two"},bYt={key:0,class:"team-goals"},xYt={class:"team-data"},_Yt={class:"team-info"},wYt={key:0,class:"team-score-two"},TYt={key:1,class:"team-logo"},SYt=["src"],kYt={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},LYt=["fill","opacity"],CYt={key:0,class:"team-goals"},NYt={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(null),f=e.computed(()=>[1,2].includes(n.coverId)),u=e.computed(()=>[1,3].includes(n.coverId)),i=e.computed(()=>n.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:n.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),d=e.computed(()=>n.game&&n.game.score?n.game.score:["0","0"]),l=e.computed(()=>{var I,j,F,D,U,M,X,O;if(n.game&&n.game.homeTeam&&n.game.awayTeam){const Y={homeTeam:{name:((I=n.game.homeTeam)==null?void 0:I.acronym)||"LOC",logo:((j=n.game.homeTeam)==null?void 0:j.logo)||null},awayTeam:{name:((F=n.game.awayTeam)==null?void 0:F.acronym)||"VIS",logo:((D=n.game.awayTeam)==null?void 0:D.logo)||null}};return f.value?(Y.homeTeam.goalsMinutes=s(n.game.minutes.home_goals_minutes),Y.homeTeam.totalYellowCards=((U=n.game.minutes.home_yellow_cards_minutes)==null?void 0:U.length)||0,Y.homeTeam.totalRedCards=((M=n.game.minutes.home_red_cards_minutes)==null?void 0:M.length)||0,Y.awayTeam.goalsMinutes=s(n.game.minutes.visiting_goals_minutes),Y.awayTeam.totalYellowCards=((X=n.game.minutes.away_yellow_cards_minutes)==null?void 0:X.length)||0,Y.awayTeam.totalRedCards=((O=n.game.minutes.away_red_cards_minutes)==null?void 0:O.length)||0):(Y.homeTeam.goalsEvents=p(n.game.report_minutes.home_goals_minutes),Y.awayTeam.goalsEvents=p(n.game.report_minutes.visiting_goals_minutes)),Y}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'"}]}}}),a=e.computed(()=>({"--background-image":u.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":n.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":n.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":n.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":n.isPostMatch?"100%":"fit-content"})),S=e.computed(()=>n.isPostMatch?"Postmatch":"Prematch"),T=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],b=e.computed(()=>{if(n.game){let I=MHt[n.game.matchday_abbreviation];I||(I=n.game.matchday_abbreviation.replace("M","J"));const[j,F,D]=n.game.date.split("-");return`${I} - ${D} ${T[Number(F)-1]}, ${j}`}return"Jornada - Día 00 Mes"});function p(I){return!I||!Array.isArray(I)||I.length===0?"":I.map(j=>{const F=j.split(", ");let D=F[0].replace("'","");D=D.replace("+",""),D=D.replace("’","");const U=D.split(" "),{strings:M,numbers:X}=U.reduce((st,mt)=>(isNaN(Number(mt))?st.strings.push(mt):st.numbers.push(mt),st),{strings:[],numbers:[]}),O=M.join(" "),Y=X.length===1?`${X[0]}'`:`${X[0]}' ${X.slice(1).join(" + ")}'`;return{playerName:O,goalTime:F.length===1?Y:`${Y}, ${F.reduce((st,mt,yt)=>yt===0?st:`${st}${mt}${yt<F.length-1?", ":""}`,"")}`}})}function s(I){return!I||!Array.isArray(I)||I.length===0?"":I.reduce((j,F,D)=>{const U=F.split(" ");let M="";return U.length===3?M=U[2]:U.length===5&&(M=`${U[2]} ${U[3]} ${U[4]}`),M&&(j+=`${M}${D<I.length-1?", ":""}`),j},"")}let c=null,o=null,h=!1,v=null,k=!1;const L=()=>{k=!0},E=()=>{k=!1};function P(){k||(h=!0,v&&clearTimeout(v),v=setTimeout(()=>{h=!1},150))}function V(){const I={root:null,rootMargin:"0px",threshold:.7};c=new IntersectionObserver(D=>{D.forEach(U=>{if(h){o&&clearTimeout(o),o=setTimeout(()=>{y("intersection-changed",U.isIntersecting)},100);return}o&&clearTimeout(o),o=setTimeout(()=>{y("intersection-changed",U.isIntersecting)},50)})},I);const j=$.value;j&&c.observe(j);const F=document.querySelector(".container-main");F&&F.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}return e.onMounted(()=>{V()}),e.onUnmounted(()=>{c&&c.disconnect();const I=document.querySelector(".container-main");I&&I.removeEventListener("scroll",P),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E),o&&clearTimeout(o),v&&clearTimeout(v)}),(I,j)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"coverPage",ref:$,class:"cover",style:e.normalizeStyle(a.value)},[f.value?(e.openBlock(),e.createElementBlock("div",VHt,[l.value.homeTeam.logo?(e.openBlock(),e.createElementBlock("div",PHt,[e.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,AHt)])):(e.openBlock(),e.createElementBlock("svg",RHt,[e.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:i.value.homeTeam},null,8,FHt)]))])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("div",UHt,[l.value.awayTeam.logo?(e.openBlock(),e.createElementBlock("div",IHt,[e.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,qHt)])):(e.openBlock(),e.createElementBlock("svg",jHt,[e.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:i.value.awayTeam},null,8,DHt)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",WHt,[e.createElementVNode("div",BHt,[j[0]||(j[0]=e.createElementVNode("div",null,"Análisis",-1)),e.createElementVNode("div",null,e.toDisplayString(S.value),1)]),e.createElementVNode("div",KHt,e.toDisplayString(b.value),1)]),f.value?(e.openBlock(),e.createElementBlock("div",XHt,[e.createElementVNode("div",GHt,[e.createElementVNode("div",ZHt,[l.value.homeTeam.logo?(e.openBlock(),e.createElementBlock("div",JHt,[e.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,HHt)])):(e.openBlock(),e.createElementBlock("svg",YHt,[e.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:i.value.homeTeam,opacity:i.value.opacity},null,8,QHt)])),e.createElementVNode("div",$Ht,e.toDisplayString(l.value.homeTeam.name),1)]),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",tYt,[j[1]||(j[1]=e.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)),e.createElementVNode("div",null,e.toDisplayString(l.value.homeTeam.goalsMinutes),1),j[2]||(j[2]=e.createElementVNode("div",{class:"separator"},null,-1)),j[3]||(j[3]=e.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),e.createElementVNode("div",null,e.toDisplayString(l.value.homeTeam.totalYellowCards),1),j[4]||(j[4]=e.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),e.createElementVNode("div",null,e.toDisplayString(l.value.homeTeam.totalRedCards),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",eYt,[t.isPostMatch?(e.openBlock(),e.createElementBlock("div",rYt,e.toDisplayString(d.value[0])+" : "+e.toDisplayString(d.value[1]),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",nYt,[e.createElementVNode("div",aYt,[l.value.awayTeam.logo?(e.openBlock(),e.createElementBlock("div",iYt,[e.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,oYt)])):(e.openBlock(),e.createElementBlock("svg",sYt,[e.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:i.value.awayTeam,opacity:i.value.opacity},null,8,lYt)])),e.createElementVNode("div",cYt,e.toDisplayString(l.value.awayTeam.name),1)]),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",uYt,[e.createElementVNode("div",null,e.toDisplayString(l.value.awayTeam.totalYellowCards),1),j[5]||(j[5]=e.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),e.createElementVNode("div",null,e.toDisplayString(l.value.awayTeam.totalRedCards),1),j[6]||(j[6]=e.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),j[7]||(j[7]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("div",null,e.toDisplayString(l.value.awayTeam.goalsMinutes),1),j[8]||(j[8]=e.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))])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",dYt,[e.createElementVNode("div",pYt,[e.createElementVNode("div",hYt,[l.value.homeTeam.logo?(e.openBlock(),e.createElementBlock("div",fYt,[e.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,mYt)])):(e.openBlock(),e.createElementBlock("svg",yYt,[e.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:i.value.homeTeam,opacity:i.value.opacity},null,8,gYt)])),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",vYt,e.toDisplayString(d.value[0]),1)):e.createCommentVNode("",!0)]),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",bYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.homeTeam.goalsEvents,(F,D)=>(e.openBlock(),e.createElementBlock("div",{key:`goal-${D}`,class:"goal"},[e.createElementVNode("div",null,e.toDisplayString(F.playerName),1),j[9]||(j[9]=e.createElementVNode("div",{class:"bullet"},null,-1)),e.createElementVNode("div",null,e.toDisplayString(F.goalTime),1),j[10]||(j[10]=e.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))])):e.createCommentVNode("",!0)]),j[13]||(j[13]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("div",xYt,[e.createElementVNode("div",_Yt,[t.isPostMatch?(e.openBlock(),e.createElementBlock("div",wYt,e.toDisplayString(d.value[1]),1)):e.createCommentVNode("",!0),l.value.awayTeam.logo?(e.openBlock(),e.createElementBlock("div",TYt,[e.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,SYt)])):(e.openBlock(),e.createElementBlock("svg",kYt,[e.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:i.value.awayTeam,opacity:i.value.opacity},null,8,LYt)]))]),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",CYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.awayTeam.goalsEvents,(F,D)=>(e.openBlock(),e.createElementBlock("div",{key:`goal-a-${D}`,class:"goal"},[j[11]||(j[11]=e.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)),e.createElementVNode("div",null,e.toDisplayString(F.goalTime),1),j[12]||(j[12]=e.createElementVNode("div",{class:"bullet"},null,-1)),e.createElementVNode("div",null,e.toDisplayString(F.playerName),1)]))),128))])):e.createCommentVNode("",!0)])]))],4))}},OYt=e2(NYt,[["__scopeId","data-v-6680cbcf"]]),EYt={class:"table-category-filters"},zYt={key:0,class:"custom-radio-group filter-inline"},MYt={class:"radio-label"},VYt={class:"radio-options"},PYt=["name","value","onUpdate:modelValue"],AYt=["data-filter-type","onClick"],RYt={class:"select-display"},FYt={class:"select-label"},UYt={key:0,class:"dropdown-menu type-menu simple-select-menu"},IYt={class:"simple-select-scroll-area"},qYt=["onClick"],jYt={class:"option-content"},DYt={class:"option-title"},WYt={key:0,class:"option-checkmark"},BYt={key:2,class:"filter-separator"},KYt={__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(t,{expose:r,emit:n}){const y=t,$=n,f=e.ref([]);let u=null;const i=(k,L)=>{if(!L)return!0;for(let E=0;E<k.length;E++)if(!d(k[E],L[E]))return!0;return!1},d=(k,L)=>{if(Array.isArray(k)&&Array.isArray(L)){if(k.length!==L.length)return!1;for(let E=0;E<k.length;E++)if(k[E]!==L[E])return!1;return!0}return k===L},l=e.ref(null),a=e.ref([]);let S=!1,T=null;const b=()=>{T=null},p=()=>{setTimeout(()=>{S=!1},1e3)},s=(k,L=!0)=>{if(y.filters&&y.filters[0]&&y.filters[1]&&y.filters[1].options){const E=y.filters[0].options,P=y.filters[1].options;k!=null?E.findIndex(V=>V.value===k)!==-1&&P[k]?(a.value=P[k],L&&!(()=>{const V=f.value[1];return V==null?!1:Array.isArray(V)?V.length>0:V!==""})()&&!S&&a.value.length>0&&(f.value[1]=a.value[0].value,e.nextTick(()=>{}))):(a.value=[],f.value[1]=null):(a.value=[],f.value[1]=null)}},c=()=>{y.initialValues&&y.initialValues.length>0?f.value=[...y.initialValues]:f.value=y.filters.map(k=>{var L,E,P,V;return k.type==="select"?[]:k.type==="check"?!1:k.type==="radio-button"?((E=(L=k.options)==null?void 0:L[0])==null?void 0:E.value)||null:k.type==="select-simple"&&((V=(P=k.options)==null?void 0:P[0])==null?void 0:V.value)||null}),y.componentId===13&&f.value.some(k=>k!=null&&(Array.isArray(k)?k.length>0:k!==!1&&k!==""))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))};c(),setTimeout(()=>{e.nextTick(()=>{if(f.value[0]!==null&&f.value[0]!==void 0&&!S){const k=!(()=>{const L=f.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})();s(f.value[0],k)}})},300),e.watch(()=>y.initialValues,k=>{const L=!d(f.value,k),E=k&&k.length>0&&!S&&L,P=y.isEditMode&&S;E&&!P?f.value=[...k]:S?T&&T.length>0&&(f.value=[...T]):P&&T&&T.length>0&&(f.value=[...T])},{deep:!0}),e.watch(()=>y.isEditMode,(k,L)=>{L===!0&&k===!1&&b()},{immediate:!0}),e.watch(f,(k,L)=>{k.some(E=>E!=null&&(Array.isArray(E)?E.length>0:E!==!1&&E!==""))&&i(k,u)&&(u=[...k],$("filters-changed",{componentId:y.componentId,filters:k,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),e.watch(()=>f.value[0],(k,L)=>{k!==L&&L!==void 0?s(k,!0):L===void 0&&k!==null&&k!==void 0&&s(k,!1)},{immediate:!0}),e.watch(()=>f.value,(k,L)=>{y.filters.map((E,P)=>E.type==="radio-button"?P:-1).filter(E=>E!==-1)},{deep:!0}),e.watch(a,()=>{},{deep:!0});const o=k=>{l.value===k?l.value=null:l.value=k},h=(k,L)=>{if(S=!0,p(),f.value[k]=L,(k===0||k===1)&&(T=[...f.value]),l.value=null,k===0){f.value[1]!==void 0&&(f.value[1]=null);const E=S;S=!1,s(L,!0),S=E,f.value[1]!==null&&f.value[1]!==void 0&&(T=[...f.value])}},v=()=>{S=!0,setTimeout(()=>{S=!1},1e3)};return r({getCurrentValues:()=>f.value,initializeValues:c}),(k,L)=>(e.openBlock(),e.createElementBlock("div",EYt,[t.filters&&t.filters.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":t.filters.length>=2}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filters,(E,P)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:P},[E.type==="radio-button"?(e.openBlock(),e.createElementBlock("div",zYt,[e.createElementVNode("div",MYt,e.toDisplayString(E.label),1),e.createElementVNode("div",VYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.options,V=>(e.openBlock(),e.createElementBlock("label",{key:V.value,class:e.normalizeClass(["radio-option-card",{active:f.value[P]===V.value}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"table-radio-"+P,value:V.value,"onUpdate:modelValue":I=>f.value[P]=I,onChange:L[0]||(L[0]=()=>{v()})},null,40,PYt),[[e.vModelRadio,f.value[P]]]),e.createElementVNode("span",null,e.toDisplayString(V.label),1)],2))),128))])])):E.type==="select-simple"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":E.type,onClick:e.withModifiers(V=>o(P),["stop"])},[e.createElementVNode("div",RYt,[L[2]||(L[2]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.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)),e.createElementVNode("span",FYt,e.toDisplayString(E.label||"Tipo de análisis"),1),e.createElementVNode("span",{class:e.normalizeClass(["arrow",{open:l.value===P}])},[...L[1]||(L[1]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===P?(e.openBlock(),e.createElementBlock("div",UYt,[e.createElementVNode("div",IYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P===1?a.value:E.options,V=>(e.openBlock(),e.createElementBlock("div",{key:V.value,class:e.normalizeClass(["option-card simple-select-option",{active:d(f.value[P],V.value)}]),onClick:e.withModifiers(I=>h(P,V.value),["stop"])},[e.createElementVNode("div",jYt,[e.createElementVNode("div",DYt,e.toDisplayString(V.label),1)]),d(f.value[P],V.value)?(e.openBlock(),e.createElementBlock("div",WYt,[...L[3]||(L[3]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[e.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):e.createCommentVNode("",!0)],10,qYt))),128))])])):e.createCommentVNode("",!0)],8,AYt)):e.createCommentVNode("",!0),P===1&&t.filters.length>2?(e.openBlock(),e.createElementBlock("div",BYt)):e.createCommentVNode("",!0)],64))),128))],2)):e.createCommentVNode("",!0)]))}},XYt=e2(KYt,[["__scopeId","data-v-fd7f7425"]]),GYt={class:"strengths-filters"},ZYt={key:0,class:"custom-radio-group filter-inline"},JYt={class:"radio-label"},HYt={class:"radio-options"},YYt=["name","value","onUpdate:modelValue"],QYt={class:"filter-inline select-with-label"},$Yt=["data-filter-type","onClick"],tQt={class:"select-display"},eQt={class:"select-label"},rQt={key:0,class:"dropdown-menu type-menu simple-select-menu"},nQt={class:"simple-select-scroll-area"},aQt=["onClick"],iQt={class:"option-content"},oQt={class:"option-title"},sQt={key:0,class:"option-checkmark"},lQt={key:2,class:"filter-separator"},cQt={__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(t,{expose:r,emit:n}){const y=t,$=n,f=e.ref([]);let u=null;const i=e.ref(null),d=e.ref([]);let l=!1,a=null;const S=(o,h)=>{if(Array.isArray(o)&&Array.isArray(h)){if(o.length!==h.length)return!1;for(let v=0;v<o.length;v++)if(o[v]!==h[v])return!1;return!0}return o===h},T=(o,h=!0)=>{if(y.filters&&y.filters[0]&&y.filters[1]&&y.filters[1].options){const v=y.filters[0].options,k=y.filters[1].options;o!=null?v.findIndex(L=>L.value===o)!==-1&&k[o]?(d.value=k[o],h&&!(()=>{const L=f.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})()&&!l&&d.value.length>0&&(f.value[1]=d.value[0].value,e.nextTick(()=>{}))):(d.value=[],f.value[1]=null):(d.value=[],f.value[1]=null)}},b=()=>{y.initialValues&&y.initialValues.length>0?y.initialValues.length>0&&(typeof y.initialValues[0]=="number"||typeof y.initialValues[0]=="boolean"||y.initialValues[0]===null||Array.isArray(y.initialValues[0]))?f.value=[...y.initialValues]:y.isEditMode?f.value=y.filters.map((o,h)=>{var v,k,L,E,P,V,I,j,F,D;const U=y.initialValues[h];return U?o.type==="radio-button"&&U.selectedOption?U.selectedOption.value:o.type==="radio-button"&&!U.selectedOption?U.selectedValue!==void 0?U.selectedValue:((V=(P=o.options)==null?void 0:P[0])==null?void 0:V.value)||null:o.type==="select-simple"&&U.selectedValue!==void 0?Array.isArray(U.selectedValue)?U.selectedValue[0]:U.selectedValue:o.type==="select"&&U.selectedOptions?U.selectedOptions.map(M=>M.value):o.type==="check"&&U.isChecked!==void 0?U.isChecked:U.selectedValue!==void 0?U.selectedValue:o.type==="select"?[]:o.type==="check"?!1:o.type==="radio-button"?((j=(I=o.options)==null?void 0:I[0])==null?void 0:j.value)||null:o.type==="select-simple"&&((D=(F=o.options)==null?void 0:F[0])==null?void 0:D.value)||null:o.type==="select"?[]:o.type==="check"?!1:o.type==="radio-button"?((k=(v=o.options)==null?void 0:v[0])==null?void 0:k.value)||null:o.type==="select-simple"&&((E=(L=o.options)==null?void 0:L[0])==null?void 0:E.value)||null}):f.value=[...y.initialValues]:f.value=y.filters.map(o=>{var h,v,k,L;return o.type==="select"?[]:o.type==="check"?!1:o.type==="radio-button"?((v=(h=o.options)==null?void 0:h[0])==null?void 0:v.value)||null:o.type==="select-simple"&&((L=(k=o.options)==null?void 0:k[0])==null?void 0:L.value)||null}),f.value.some(o=>o!=null&&(Array.isArray(o)?o.length>0:o!==!1&&o!==""))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))};b(),setTimeout(()=>{e.nextTick(()=>{if(f.value[0]!==null&&f.value[0]!==void 0&&!l){const o=!(()=>{const h=f.value[1];return h==null?!1:Array.isArray(h)?h.length>0:h!==""})();T(f.value[0],o)}})},300),e.watch(()=>y.initialValues,(o,h)=>{if(!o||o.length===0)return;const v=o.length>0&&(typeof o[0]=="number"||typeof o[0]=="boolean"||o[0]===null||Array.isArray(o[0])),k=!S(f.value,o),L=o&&o.length>0&&!l&&k,E=y.isEditMode&&l;L&&!E?v?f.value=[...o]:y.isEditMode?f.value=y.filters.map((P,V)=>{const I=o[V];return I?P.type==="radio-button"&&I.selectedOption?I.selectedOption.value:P.type==="select-simple"&&I.selectedValue!==void 0?Array.isArray(I.selectedValue)?I.selectedValue[0]:I.selectedValue:P.type==="select"&&I.selectedOptions?I.selectedOptions.map(j=>j.value):P.type==="check"&&I.isChecked!==void 0?I.isChecked:I.selectedValue!==void 0?I.selectedValue:f.value[V]:f.value[V]}):f.value=[...o]:l?a&&a.length>0&&(f.value=[...a]):E&&a&&a.length>0&&(f.value=[...a])},{deep:!0}),e.watch(()=>y.isEditMode,(o,h)=>{h===!0&&o===!1&&(a=null)},{immediate:!0}),e.watch(f,o=>{o.some(h=>h!=null&&(Array.isArray(h)?h.length>0:h!==!1&&h!==""))&&(()=>{if(!u)return!0;for(let h=0;h<o.length;h++)if(!S(o[h],u[h]))return!0;return!1})()&&(u=[...o],$("filters-changed",{componentId:y.componentId,filters:o,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),e.watch(()=>f.value[0],(o,h)=>{o!==h&&h!==void 0?T(o,!0):h===void 0&&o!==null&&o!==void 0&&T(o,!1)},{immediate:!0});const p=o=>{i.value===o?i.value=null:i.value=o},s=(o,h)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),f.value[o]=h,(o===0||o===1)&&(a=[...f.value]),i.value=null,o===0){f.value[1]!==void 0&&(f.value[1]=null);const v=l;l=!1,T(h,!0),l=v,f.value[1]!==null&&f.value[1]!==void 0&&(a=[...f.value])}},c=()=>{l=!0,setTimeout(()=>{l=!1},400)};return r({getCurrentValues:()=>f.value,initializeValues:b}),(o,h)=>(e.openBlock(),e.createElementBlock("div",GYt,[t.filters&&t.filters.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":t.filters.length>=2}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filters,(v,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:k},[v.type==="radio-button"?(e.openBlock(),e.createElementBlock("div",ZYt,[e.createElementVNode("div",JYt,e.toDisplayString(v.label),1),e.createElementVNode("div",HYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.options,L=>(e.openBlock(),e.createElementBlock("label",{key:L.value,class:e.normalizeClass(["radio-option-card",{active:f.value[k]===L.value}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"strengths-radio-"+k,value:L.value,"onUpdate:modelValue":E=>f.value[k]=E,onChange:c},null,40,YYt),[[e.vModelRadio,f.value[k]]]),e.createElementVNode("span",null,e.toDisplayString(L.label),1)],2))),128))])])):v.type==="select-simple"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[h[4]||(h[4]=e.createElementVNode("div",{class:"filter-separator"},null,-1)),e.createElementVNode("div",QYt,[h[3]||(h[3]=e.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),e.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":v.type,onClick:e.withModifiers(L=>p(k),["stop"])},[e.createElementVNode("div",tQt,[h[1]||(h[1]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.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)),e.createElementVNode("span",eQt,e.toDisplayString(v.label||"Tipo de análisis"),1),e.createElementVNode("span",{class:e.normalizeClass(["arrow",{open:i.value===k}])},[...h[0]||(h[0]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===k?(e.openBlock(),e.createElementBlock("div",rQt,[e.createElementVNode("div",nQt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.options,L=>(e.openBlock(),e.createElementBlock("div",{key:L.value,class:e.normalizeClass(["option-card simple-select-option",{active:S(f.value[k],L.value)}]),onClick:e.withModifiers(E=>s(k,L.value),["stop"])},[e.createElementVNode("div",iQt,[e.createElementVNode("div",oQt,e.toDisplayString(L.label),1)]),S(f.value[k],L.value)?(e.openBlock(),e.createElementBlock("div",sQt,[...h[2]||(h[2]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[e.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):e.createCommentVNode("",!0)],10,aQt))),128))])])):e.createCommentVNode("",!0)],8,$Yt)])],64)):e.createCommentVNode("",!0),k===1&&t.filters.length>2?(e.openBlock(),e.createElementBlock("div",lQt)):e.createCommentVNode("",!0)],64))),128))],2)):e.createCommentVNode("",!0)]))}},uQt=e2(cQt,[["__scopeId","data-v-700ac1f0"]]),dQt=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},pQt={key:1},hQt={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fQt=["fill"],mQt={key:0,class:"checkbox__teams"},yQt={class:"checkbox__teams__logo"},gQt=["src"],vQt={class:"checkbox__teams__logo"},bQt=["src"],xQt={__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(t){return["left","right","top","bottom"].includes(t)}},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(t,{emit:r}){const n=t;e.useCssVars(l=>({"7bd9d47b":t.width,"34dc7ddc":t.height}));const y=e.ref(!1),$=e.computed(()=>{const l={color:n.boxValueColor,"font-family":n.fontFamily,height:n.boxWidthAndHeight,width:n.boxWidthAndHeight,minWidth:n.boxWidthAndHeight,"border-radius":n.boxBorderRadius,"margin-top":n.boxMarginTop};return y.value?(l["background-color"]=n.boxBackgroundColor,l.border=`solid ${n.boxBorderWidth} ${n.boxBackgroundColor}`):l.border=`solid ${n.boxBorderWidth} ${n.boxBorderColor}`,l}),f=e.computed(()=>({"font-family":n.boxValueFontFamily,"font-size":n.boxValueFontSize,color:n.boxValueColor,"line-height":1})),u=e.computed(()=>{const l={color:n.labelColor,"font-family":n.fontFamily,"font-size":n.labelFontSize,"white-space":n.labelWhiteSpace,"text-align":n.boxPosition==="top"||n.boxPosition==="bottom"?"center":n.boxPosition};return(n.boxPosition==="left"||n.boxPosition==="right")&&(l[`margin-${n.boxPosition}`]=n.isBoxOnly?"0":n.teamsIds?"8px":"10px"),l});e.watch(()=>n.modelValue,l=>{l!==y.value&&(y.value=l)},{immediate:!0});function i(){n.avoidInteraction||!y.value&&n.avoidToCheck||(y.value=!y.value,r("update:modelValue",y.value))}function d(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["checkbox",`box-${t.boxPosition}`]),onClick:i},[e.createElementVNode("div",{class:"checkbox__box",style:e.normalizeStyle($.value)},[y.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.boxValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"checkbox__box__value",style:e.normalizeStyle(f.value)},e.toDisplayString(t.boxValue),5)):(e.openBlock(),e.createElementBlock("div",pQt,[(e.openBlock(),e.createElementBlock("svg",hQt,[e.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:t.boxValueColor},null,8,fQt)]))]))],64)):e.createCommentVNode("",!0)],4),t.teamsIds&&t.teamsIds.length?(e.openBlock(),e.createElementBlock("div",mQt,[e.createElementVNode("div",yQt,[e.createElementVNode("img",{src:d(t.teamsIds[0]),alt:""},null,8,gQt)]),e.createElementVNode("div",vQt,[e.createElementVNode("img",{src:d(t.teamsIds[1]),alt:""},null,8,bQt)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"checkbox__label",style:e.normalizeStyle(u.value)},e.toDisplayString(t.label),5)],2))}},lA=dQt(xQt,[["__scopeId","data-v-b6f124d8"]]),_Qt=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},cA={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(t){this.status=t}}},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(t){this.$emit("click",t),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},DZ=()=>{e.useCssVars(t=>({"9d01acb4":t.height,"14e95081":t.borderWidthBtn,"38fec285":t.borderType,34353510:t.borderColor,"20d20dc6":t.borderRadius,17130967:t.width,"4ccb7d36":t.backgroundColor,"5d1e86a2":t.cursorType,ce65d4a2:t.fontSize,fe4ac47a:t.fontStyle,f98e44dc:t.fontFamily,"93b87770":t.marginLeftStat,c7f7beba:t.fontSizeStat}))},WZ=cA.setup;cA.setup=WZ?(t,r)=>(DZ(),WZ(t,r)):DZ;const wQt=t=>(e.pushScopeId("data-v-f3ee6b2b"),t=t(),e.popScopeId(),t),TQt=["src"],SQt={key:1,class:"text"},kQt=["src"],LQt={class:"stats"},CQt=wQt(()=>e.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),NQt={class:"numstats"},OQt={class:"leyend"};function EQt(t,r,n,y,$,f){return e.openBlock(),e.createElementBlock("div",null,[n.type==0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["button",$.status&&n.typeOnOff&&"button-active"]),style:e.normalizeStyle([f.customStyle,$.status&&n.typeOnOff&&f.customActive]),onClick:r[0]||(r[0]=(...u)=>f.btnClick&&f.btnClick(...u))},[n.icon&&n.iconPosition.toLowerCase()==="left"?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",style:e.normalizeStyle({width:n.iconSize}),src:n.icon},null,12,TQt)):e.createCommentVNode("",!0),n.textValue?(e.openBlock(),e.createElementBlock("div",SQt,e.toDisplayString(n.textValue),1)):e.createCommentVNode("",!0),n.icon&&n.iconPosition.toLowerCase()==="right"?(e.openBlock(),e.createElementBlock("img",{key:2,class:"icon",style:e.normalizeStyle({width:n.iconSize}),src:n.icon},null,12,kQt)):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0),n.type==1?(e.openBlock(),e.createElementBlock("div",{key:1,class:"button-target",onClick:r[1]||(r[1]=(...u)=>f.btnClick&&f.btnClick(...u))},[e.createElementVNode("div",LQt,[CQt,e.createElementVNode("div",NQt,e.toDisplayString(n.textStat),1)]),e.createElementVNode("div",OQt,e.toDisplayString(n.textCategory),1)])):e.createCommentVNode("",!0)])}const zQt=_Qt(cA,[["render",EQt],["__scopeId","data-v-f3ee6b2b"]]),MQt={class:"gsc-dropdown__main-container__item-selected"},VQt=["height","width"],PQt=["stroke"],AQt={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},RQt=["fill"],FQt={class:"gsc-dropdown__items-container"},UQt=["onClick"],IQt={key:0,class:"gsc-dropdown__items-footer"},Qk={__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(t){return["solid","dotted","dashed"].includes(t)}},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:t=>["propName","value"].every(r=>r in t)},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(t){return[1,2].includes(t)}}},emits:["input","click-ready","update:modelValue"],setup(t,{emit:r}){const n=t,y=e.ref({}),$=e.ref(null),f=e.ref(n.isMultipleOption?-1:0),u=e.ref(!1);e.watch(()=>n.items,(b,p)=>{if(!n.modelValue&&(!n.onlyFirstTime||!p||!p.length)&&b&&b.length){if(n.defaultItemByProp){const s=n.items.findIndex(c=>c[n.defaultItemByProp.propName]===n.defaultItemByProp.value);s!==-1?(f.value=s,y.value=b[s]):(f.value=0,y.value=b[0])}else y.value=b[n.defaultItemByIndex];r("input",y.value)}},{immediate:!0}),e.watch(()=>n.modelValue,b=>{if(b){const p=n.items.findIndex(s=>typeof b=="object"?JSON.stringify(s)===JSON.stringify(b):s===b);p!==-1&&(f.value=p,y.value=n.items[p],r("update:modelValue",y.value))}},{immediate:!0});const i=e.computed(()=>({height:n.height,width:n.width,backgroundColor:n.backgroundColor,borderRadius:`${n.borderRadius}px`,border:`${n.borderType} ${n.borderWidth}px ${n.borderColor}`,color:n.color,"--hover-background-color":n.hoverBackgroundColor,"--list-container-padding":n.listContainerPadding,"--list-item-padding":n.listItemPadding,"--list-item-margin":n.listItemMargin,"--list-background-color":n.listBackgroundColor,"--list-height":n.listHeight,"--list-item-border-radius":n.listItemBorderRadius,"--list-item-selected-color":n.listItemSelectedColor,"--list-item-selected-background-color":n.listItemSelectedBackgroundColor,"--list-item-color":n.listItemColor,"--list-border-radius":`${n.listBorderRadius}`,"--list-border-color":n.listBorderColor,"--list-width":n.isListSameWidth?n.width:"fit-content","--list-border-width":`${n.listBorderWidth}px`,"--list-margin-top":n.listMarginTop,"--list-left":n.listAlignment==="left"?"0":"auto","--list-right":n.listAlignment==="right"?"0":"auto","--footer-border":`${n.footerBorderWidth}px solid ${n.footerBorderColor}`,"--dropdown-opacity":n.isDisabled?"0.5":"1","--dropdown-cursor":n.isDisabled?"not-allowed":"pointer","--dropdown-font-size":n.fontSize?n.fontSize:"14px"})),d=e.computed(()=>({height:`${n.arrowHeight}px`,width:`${n.arrowWidth}px`}));function l(){n.isDisabled||(u.value=!u.value)}function a(b){$.value&&!$.value.contains(b.target)&&(u.value=!1)}function S(b,p){n.isMultipleOption?f.value=-1:(f.value=p,u.value=!1),y.value=b,r("input",y.value),r("update:modelValue",y.value)}function T(){u.value=!1,r("click-ready")}return e.onMounted(()=>{document.addEventListener("click",a)}),e.onBeforeMount(()=>{document.removeEventListener("click",a)}),(b,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dropDown",ref:$,class:"gsc-dropdown",style:e.normalizeStyle(i.value)},[e.createElementVNode("div",{class:"gsc-dropdown__main-container",style:e.normalizeStyle({"padding-right":`${t.arrowWidth+8}px`}),onClick:l},[e.createElementVNode("div",MQt,[e.renderSlot(b.$slots,"default",{selectedItem:y.value})]),e.createElementVNode("div",{class:e.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":u.value}]),style:e.normalizeStyle(d.value)},[t.iconType===1?(e.openBlock(),e.createElementBlock("svg",{key:0,height:t.arrowHeight,width:t.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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:t.arrowColor},null,8,PQt)],8,VQt)):(e.openBlock(),e.createElementBlock("svg",AQt,[e.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:t.arrowColor},null,8,RQt)]))],6)],4),e.createVNode(e.Transition,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",FQt,[e.createElementVNode("div",null,[e.createElementVNode("div",{class:"gsc-dropdown__items",style:e.normalizeStyle({"margin-top":`${n.borderWidth}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(s,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["gsc-dropdown__items__item",{selected:c===f.value}]),key:c,onClick:o=>S(s,c)},[e.renderSlot(b.$slots,"availableItem",{item:s})],10,UQt)),[[e.vShow,!s.isHidden]])]))),256))],4),t.isFooterVisible?(e.openBlock(),e.createElementBlock("div",IQt,[e.createVNode(e.unref(zQt),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:T})])):e.createCommentVNode("",!0)])],512),[[e.vShow,u.value]])]),_:3})],4))}},uA={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},qQt=[{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"}}],jQt=[{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}}],DQt={class:"last-touch"},WQt={class:"selected-item"},BQt={class:"available-item"},KQt={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},XQt={class:"selected-item"},GQt={class:"available-item"},ZQt={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},JQt={key:1},HQt={class:"selected-item"},YQt={class:"available-item"},QQt={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$Qt={class:"last-touch__how-many-games"},t$t={class:"selected-item"},e$t={class:"available-item"},r$t={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n$t={__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(t,{emit:r}){const n=t,y=r,$=e.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),f=e.ref({id:0,name:"Fases de juego",value:null}),u=e.ref(!1),i=e.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),d=e.ref(n.defaultFilters?null:i.value[0]),l=e.ref(null),a=e.computed(()=>({...uA})),S=e.computed(()=>({...uA,isFooterVisible:!n.isEditMode,isMultipleOption:!n.isEditMode})),T=e.computed(()=>{const yt=[];return b.value.options.forEach(bt=>{bt.forEach(xt=>{yt.push(xt)})}),yt}),b=e.ref(null),p=e.ref(null),s=e.ref(null),c=e.ref(null);e.watch(()=>n.viewConfig,yt=>{yt.filters&&(b.value||o(),p.value||h(),s.value||v(),c.value||P())},{immediate:!0});function o(){if(n.viewConfig&&n.viewConfig.filters){const yt=n.viewConfig.filters.find(bt=>bt.key==="categories");yt&&yt.options&&(b.value={label:yt.label,options:Object.entries(yt.options).reduce((bt,[xt,Pt])=>(bt.set(Number(xt),Pt),bt),new Map)})}b.value={label:"Tipo de jugada",options:new Map([[2,jQt],[3,qQt]])}}function h(){if(n.viewConfig&&n.viewConfig.filters){const yt=n.viewConfig.filters.find(bt=>bt.key==="gamePhases");if(yt){p.value={label:yt.label,options:yt.options};return}}p.value={label:"Fases de juego",options:$.value}}function v(){if(n.viewConfig&&n.viewConfig.filters){const yt=n.viewConfig.filters.find(bt=>bt.key==="teamRadios");if(yt){s.value={options:yt.options},U(null,yt.options[0]);return}}s.value={label:"Equipo",options:n.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},U(null,s.value.options[0])}const k=e.ref(n.defaultFilters?null:s.value.options[0]),L=e.ref(n.defaultFilters?null:p.value.options[0]),E=e.ref(n.defaultFilters?null:b.value.options.get(L.value.value)[0]);function P(){if(n.viewConfig&&n.viewConfig.filters){const yt=n.viewConfig.filters.find(bt=>bt.key==="assistZoneCheckbox");if(yt){c.value={label:yt.label},M(yt.value);return}}c.value={label:"Zona de asistencia"}}const V=e.computed(()=>{const yt={selectedGamePhase:L.value,selectedTeam:k.value,isAssistZoneVisible:u.value,howManyGamesSelected:d.value};return n.isEditMode?(yt.selectedCategory=E.value,yt.totalCategoriesSelected=1):(yt.selectedCategories=l.value,yt.totalCategoriesSelected=0,b.value.options.forEach(bt=>{bt.forEach(xt=>{xt.isSelected&&(yt.totalCategoriesSelected+=1)})})),yt}),I=e.computed(()=>L.value?b.value.options.get(L.value.value)||[]:[]);e.watch(()=>V.value,yt=>{j()&&y("change",{areAllFiltersFilled:j(),filters:yt,view:n.viewConfig})},{deep:!0});function j(){return L.value&&(n.isEditMode&&E.value||!n.isEditMode&&l.value&&l.value.length)&&k.value&&d.value}function F(yt){L.value=yt,O(null)}function D(yt){k.value=yt}function U(yt,bt){console.log("onChangeRadio:",bt.value)}function M(yt){u.value=yt}function X(yt){d.value=yt}function O(yt){E.value=yt}function Y(yt,bt){bt.isSelected=yt,l.value=T.value.filter(xt=>xt.isSelected)}function st(){n.defaultFilters&&(u.value=n.defaultFilters.isAssistZoneVisible,d.value=i.value.find(yt=>yt.value===n.defaultFilters.howManyGamesSelected.value)||i.value[0],L.value=p.value.options.find(yt=>yt.value===n.defaultFilters.selectedGamePhase.value)||p.value.options[0],k.value=s.value.options.find(yt=>yt.value===(n.defaultFilters.isHomeTeam?1:2))||s.value.options[0],E.value=b.value.options.get(L.value.value).find(yt=>yt.value.name===n.defaultFilters.selectedCategory.name)||b.value.options.get(L.value.value)[0])}function mt(){I.value.forEach(yt=>{yt.isSelected=!1}),u.value=!1,d.value=i.value[0],L.value=null,k.value=null,E.value=null,l.value=null}return e.onBeforeUnmount(()=>{mt()}),e.onMounted(()=>{setTimeout(()=>{st()},500)}),(yt,bt)=>(e.openBlock(),e.createElementBlock("div",DQt,[e.createVNode(e.unref(Qk),e.mergeProps(a.value,{items:p.value.options,"model-value":L.value,"onUpdate:modelValue":F}),{default:e.withCtx(()=>[e.createElementVNode("div",WQt,[bt[0]||(bt[0]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(L.value?L.value.label:p.value.label||f.value.name),1)])]),availableItem:e.withCtx(({item:xt})=>[e.createElementVNode("div",BQt,[e.createElementVNode("div",null,e.toDisplayString(xt.label),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",KQt,[...bt[1]||(bt[1]=[e.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)),[[e.vShow,L.value&&L.value.label===xt.label]])])])]),_:1},16,["items","model-value"]),e.createVNode(e.unref(Qk),e.mergeProps(S.value,{items:I.value,"model-value":E.value,"onUpdate:modelValue":O}),{default:e.withCtx(()=>[e.createElementVNode("div",XQt,[bt[2]||(bt[2]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(b.value.label),1)])]),availableItem:e.withCtx(({item:xt})=>[e.createElementVNode("div",GQt,[t.isEditMode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",null,e.toDisplayString(xt.label),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",ZQt,[...bt[3]||(bt[3]=[e.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)),[[e.vShow,E.value&&E.value.label===xt.label]])])],64)):(e.openBlock(),e.createElementBlock("div",JQt,[e.createVNode(e.unref(lA),{"model-value":xt.isSelected,label:xt.label,"onUpdate:modelValue":Pt=>Y(Pt,xt)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),e.createVNode(e.unref(Qk),e.mergeProps(a.value,{items:s.value.options,"model-value":k.value,"onUpdate:modelValue":D}),{default:e.withCtx(()=>[e.createElementVNode("div",HQt,[bt[4]||(bt[4]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(k.value?k.value.label:s.value.label),1)])]),availableItem:e.withCtx(({item:xt})=>[e.createElementVNode("div",YQt,[e.createElementVNode("div",null,e.toDisplayString(xt.label),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",QQt,[...bt[5]||(bt[5]=[e.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)),[[e.vShow,k.value&&k.value.label===xt.label]])])])]),_:1},16,["items","model-value"]),e.createVNode(e.unref(lA),{"model-value":u.value,label:c.value.label,"onUpdate:modelValue":M},null,8,["model-value","label"]),e.withDirectives(e.createElementVNode("div",$Qt,[e.createVNode(e.unref(Qk),e.mergeProps(a.value,{items:i.value,"model-value":d.value,"onUpdate:modelValue":X}),{default:e.withCtx(()=>[e.createElementVNode("div",t$t,[bt[6]||(bt[6]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(d.value?d.value.name:"Seleccione"),1)])]),availableItem:e.withCtx(({item:xt})=>[e.createElementVNode("div",e$t,[e.createElementVNode("div",null,e.toDisplayString(xt.name),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",r$t,[...bt[7]||(bt[7]=[e.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)),[[e.vShow,d.value&&d.value.name===xt.name]])])])]),_:1},16,["items","model-value"])],512),[[e.vShow,!t.isPostMatch]])]))}},a$t=e2(n$t,[["__scopeId","data-v-7e67f3f8"]]),i$t=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},o$t={__name:"GSC-Menu",props:{menuMarginTop:{type:Number,default:0,validator(t){return!Number.isNaN(t)}},modelValue:{type:Boolean,default:!1},width:{type:String,default:"fit-content"},menuWidth:{type:String,default:"fit-content"},zIndexOpen:{type:Number,default:3},leftMenu:{type:String,default:"unset"}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t;e.useCssVars(b=>({"6263632b":t.width,"252e289a":d.value,d3c8b2e8:t.menuWidth}));const y=e.ref(null),$=e.ref(!1),f=e.ref(null),u=e.ref({}),i=e.ref({top:"0px",left:n.leftMenu,width:n.menuWidth}),d=e.computed(()=>$.value?n.zIndexOpen:1);e.watch(()=>n.modelValue,b=>{b!==$.value&&($.value=b)},{immediate:!0}),e.watch($,async b=>{var p;if(b){await e.nextTick();const s=(p=f.value)==null?void 0:p.getBoundingClientRect();s&&setTimeout(()=>{l({boundingClientRect:s})},1e3)}else setTimeout(()=>{u.value["--translate-x"]="0px"},500)});function l(b){const p=window.innerWidth,s=b.boundingClientRect.x,c=b.boundingClientRect.x+b.boundingClientRect.width,o=s<=0?Math.abs(s)+10:c>=p?p-(c+30):0;if(u.value["--translate-x"]=`${o}px`,y.value){const h=y.value.getBoundingClientRect();i.value.top=`${h.height+n.menuMarginTop}px`}}function a(){new IntersectionObserver(b=>{b[0].intersectionRatio>0&&l(b[0])}).observe(f.value)}function S(){$.value=!$.value,r("update:modelValue",$.value)}function T(){$.value=!1,r("update:modelValue",$.value)}return e.onMounted(()=>{e.nextTick(()=>{a()})}),(b,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[$.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:"menu-overlay",onClick:T})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"menu-container",style:e.normalizeStyle(u.value)},[e.createElementVNode("div",{ref_key:"trigger",ref:y,class:"menu-container__trigger",onClick:S},[e.renderSlot(b.$slots,"trigger",{},void 0,!0)],512),e.createVNode(e.Transition,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"menu",ref:f,class:"menu-container__menu",style:e.normalizeStyle(i.value)},[e.renderSlot(b.$slots,"menu",{},void 0,!0)],4),[[e.vShow,$.value]])]),_:3})],4)],64))}},s$t=i$t(o$t,[["__scopeId","data-v-419c8567"]]),Bb={CORNERS_ADVANCED:"cornersAdvanced"},l$t={key:0,class:"button__icon"},c$t={key:0,width:"19",height:"17",viewBox:"0 0 19 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u$t=["stroke"],d$t=["stroke"],p$t=["stroke"],h$t={key:1,width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f$t=["stroke"],m$t=["stroke"],y$t=["fill"],g$t={key:2,width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v$t=["fill"],b$t={key:3,width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x$t=["stroke"],_$t=["stroke"],w$t=["stroke"],T$t=["stroke"],S$t=["stroke"],k$t={key:4,width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},L$t={key:5,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C$t={key:6,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},N$t={key:7,width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},O$t={key:8,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},E$t={class:"button__text"},z$t={key:0,class:"info-container"},M$t={key:1,style:{width:"20px"}},V$t={width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P$t=["fill"],A$t={__name:"ButtonFilter",props:{isActive:{type:Boolean,default:!1},showBadge:{type:Boolean,default:!0},showBadgeOnFilterFull:{type:Boolean,default:!0},text:{type:String,default:""},infoValue:{type:[String,Number],default:""},filtersTotal:{type:Number,default:0},textFontFamily:{type:String,default:"sans-serif"},textFontSize:{type:String,default:"14px"},fontColor:{type:String,default:"white"},infoBackgroundColor:{type:String,default:"#424D58"},infoFontColor:{type:String,default:"#CBEE6B"},infoFontFamily:{type:String,default:"sans-serif"},infoFontSize:{type:String,default:"10px"},infoBorderColor:{type:String,default:"#0D1D29"},infoBorderRadius:{type:String,default:"4px"},infoHeight:{type:String,default:"20px"},infoWidth:{type:String,default:"20px"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},backgroundColor:{type:String,default:"#0D1D29"},borderRadius:{type:String,default:"8px"},borderColor:{type:String,default:"#172531"},borderColorActive:{type:String,default:"white"},borderWidth:{type:String,default:"1px"},padding:{type:String,default:"12px"},arrowColor:{type:String,default:"#92929D"},iconColor:{type:String,default:"#92929D"},iconType:{type:String,default:"productivity"},showIcon:{type:Boolean,default:!0}},setup(t){const r=t,n=e.computed(()=>({"--height":r.height,"--width":r.width,"--text-font-family":r.textFontFamily,"--text-font-size":r.textFontSize,"--background-color":r.backgroundColor,"--border-radius":r.borderRadius,"--border-color":r.isActive?r.borderColorActive:r.borderColor,"--border-width":r.borderWidth,"--padding":r.padding,"--font-color":r.fontColor})),y=e.computed(()=>({"--info-background-color":r.infoValue?r.infoBackgroundColor:"transparent","--info-border-color":r.infoValue?r.infoBorderColor:"transparent","--info-border-radius":r.infoBorderRadius,"--info-font-family":r.infoFontFamily,"--info-font-size":r.infoFontSize,"--info-font-color":r.infoFontColor,"--info-height":r.infoHeight,"--info-width":r.infoWidth})),$=e.computed(()=>[Bb.PLAYS_TYPES,Bb.GOLSTATS,Bb.TOURNAMENTS,Bb.PLAYS,Bb.RESULTS,Bb.RESULTS_BY_TIME].includes(r.iconType)),f=e.computed(()=>[Bb.FIELD,Bb.GAMES].includes(r.iconType)),u=e.computed(()=>[Bb.DETAILS,Bb.UNIVERSE].includes(r.iconType)),i=e.computed(()=>[Bb.PERSONAL_DATA].includes(r.iconType)),d=e.computed(()=>[Bb.PRODUCTIVITY].includes(r.iconType)),l=e.computed(()=>[Bb.CORNERS_ADVANCED].includes(r.iconType)),a=e.computed(()=>[Bb.HOW_WAS_CORNER].includes(r.iconType)),S=e.computed(()=>[Bb.TAKEN_CORNERS].includes(r.iconType)),T=e.computed(()=>[Bb.ZONE].includes(r.iconType)),b=e.computed(()=>[Bb.WHAT_HAPPENED].includes(r.iconType));return(p,s)=>(e.openBlock(),e.createElementBlock("div",{class:"button",style:e.normalizeStyle(n.value)},[t.showIcon?(e.openBlock(),e.createElementBlock("div",l$t,[i.value?(e.openBlock(),e.createElementBlock("svg",c$t,[e.createElementVNode("path",{d:"M12.6665 16.0001V14.3334C12.6665 13.4494 12.3153 12.6015 11.6902 11.9764C11.0651 11.3513 10.2173 11.0001 9.33323 11.0001H4.33329C3.44925 11.0001 2.60141 11.3513 1.9763 11.9764C1.35119 12.6015 1 13.4494 1 14.3334V16.0001",stroke:t.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,u$t),e.createElementVNode("path",{d:"M6.83329 7.66658C8.67422 7.66658 10.1666 6.17422 10.1666 4.33329C10.1666 2.49237 8.67422 1 6.83329 1C4.99237 1 3.5 2.49237 3.5 4.33329C3.5 6.17422 4.99237 7.66658 6.83329 7.66658Z",stroke:t.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,d$t),e.createElementVNode("path",{d:"M15.164 5.16663V10.1666M17.664 7.66659H12.6641",stroke:t.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,p$t)])):e.createCommentVNode("",!0),$.value||l.value?(e.openBlock(),e.createElementBlock("svg",h$t,[e.createElementVNode("path",{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:t.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,f$t),e.createElementVNode("path",{d:"M15.9996 16.8727L14.8359 15.7091",stroke:t.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,m$t),e.createElementVNode("path",{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:t.iconColor,stroke:"#353F47","stroke-width":"0.3"},null,8,y$t)])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("svg",g$t,[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 0C13.1944 0 17 3.80558 17 8.5C17 13.1944 13.1944 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 0 8.5 0ZM8.49751 1.54553C4.65662 1.54553 1.54297 4.65919 1.54297 8.50008C1.54297 12.341 4.65662 15.4546 8.49751 15.4546C12.3384 15.4546 15.4521 12.341 15.4521 8.50008C15.4521 4.65919 12.3384 1.54553 8.49751 1.54553ZM8.49929 3.09082C8.92605 3.09082 9.27202 3.43678 9.27202 3.86355V8.12198L12.451 10.5945C12.7878 10.8565 12.8485 11.342 12.5865 11.6789C12.3245 12.0157 11.839 12.0764 11.5022 11.8144L8.02488 9.10986C7.83666 8.96347 7.72656 8.73837 7.72656 8.49991V3.86355C7.72656 3.43678 8.07252 3.09082 8.49929 3.09082Z",fill:t.iconColor},null,8,v$t)])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",b$t,[e.createElementVNode("rect",{x:"1.16772",y:"1.16699",width:"19",height:"15.6667",stroke:t.iconColor},null,8,x$t),e.createElementVNode("rect",{x:"16.1677",y:"6.16699",width:"4",height:"5.66667",stroke:t.iconColor},null,8,_$t),e.createElementVNode("rect",{x:"1.16772",y:"6.16699",width:"4",height:"5.66667",stroke:t.iconColor},null,8,w$t),e.createElementVNode("path",{d:"M10.6677 0.666992V16.5003",stroke:t.iconColor},null,8,T$t),e.createElementVNode("path",{d:"M13.5033 9.00032C13.5033 10.5651 12.2348 11.8337 10.67 11.8337C9.1052 11.8337 7.83667 10.5651 7.83667 9.00032C7.83667 7.43552 9.1052 6.16699 10.67 6.16699C12.2348 6.16699 13.5033 7.43552 13.5033 9.00032Z",stroke:t.iconColor},null,8,S$t)])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("svg",k$t,[...s[0]||(s[0]=[e.createElementVNode("path",{d:"M1.85113 13.0897C1.9303 13.2137 2.01739 13.3404 2.10447 13.4617C2.30239 13.7361 2.51878 14 2.74837 14.2507C3.74589 15.3298 5.01785 16.1504 6.41385 16.5963C6.4719 16.6148 6.52996 16.6332 6.58802 16.6491C6.60385 16.6544 6.61704 16.657 6.63024 16.6623C6.70413 16.6834 6.77538 16.7045 6.84927 16.723C7.54859 16.9077 8.27429 17 9.00264 17C9.73098 17 10.4593 16.9077 11.1586 16.7256C11.3064 16.686 11.4542 16.6438 11.5967 16.5989C11.9187 16.496 12.2353 16.372 12.5414 16.2322C12.7895 16.1187 13.0296 15.9921 13.2645 15.8549C14.2963 15.2533 15.2041 14.438 15.9034 13.467C15.9668 13.3799 16.0301 13.2876 16.0908 13.1926C16.1119 13.1609 16.133 13.1293 16.1541 13.095C16.9432 11.8681 17.405 10.4486 17.4868 8.98945C17.4947 8.84169 17.5 8.69393 17.5 8.54618C17.5 8.53034 17.5 8.51715 17.5 8.50132C17.5 6.90765 17.0646 5.37995 16.2386 4.04222C16.1198 3.85224 15.9932 3.66491 15.8612 3.48021C15.8586 3.47493 15.8559 3.4723 15.8533 3.46702C15.8084 3.40633 15.7636 3.34565 15.7161 3.2876C15.6712 3.22955 15.6237 3.1715 15.5789 3.1161C14.6526 1.98417 13.4466 1.10818 12.0928 0.580475C11.9556 0.525066 11.8105 0.474934 11.668 0.42744C10.8103 0.145118 9.91307 0 9.00264 0C8.09221 0 7.19497 0.14248 6.33732 0.424802C6.19482 0.472295 6.04967 0.525066 5.91245 0.577836C4.55604 1.10554 3.35005 1.98417 2.42378 3.11346C2.37364 3.17678 2.32086 3.24011 2.27072 3.30607C2.2285 3.35884 2.18892 3.41161 2.14933 3.46702C2.14933 3.46702 2.14933 3.46966 2.14669 3.4723C2.14669 3.47493 2.14405 3.47757 2.14142 3.48021C1.43418 4.44591 0.94598 5.53034 0.69792 6.68074C0.660975 6.85224 0.626669 7.02639 0.600279 7.20053C0.571251 7.39578 0.547501 7.59103 0.531667 7.78892C0.521111 7.91293 0.513195 8.03694 0.507917 8.16095C0.502639 8.27441 0.5 8.38786 0.5 8.50132V8.61214C0.502639 8.73615 0.507917 8.8628 0.513195 8.98945C0.595002 10.4486 1.05681 11.8681 1.84586 13.0923L1.85113 13.0897ZM1.82738 7.64908C1.82738 7.63325 1.83002 7.62005 1.83266 7.60422C1.84322 7.52771 1.85377 7.45119 1.86433 7.37731C1.86433 7.36412 1.86697 7.35092 1.86961 7.33773C1.8828 7.25594 1.89863 7.1715 1.91447 7.08971C1.91711 7.07124 1.92238 7.05541 1.92502 7.03694C1.94086 6.95778 1.95933 6.87599 1.9778 6.79683V6.78628C1.99891 6.70449 2.02266 6.62269 2.04378 6.5409C2.04905 6.52243 2.05433 6.5066 2.05961 6.48813C2.08336 6.40897 2.10711 6.32718 2.1335 6.24802L2.14142 6.22164C2.16517 6.14776 2.19156 6.07652 2.21794 6.00264C2.22322 5.98681 2.23114 5.97098 2.23642 5.95515C2.26545 5.87863 2.29711 5.79947 2.32878 5.72559C2.33406 5.70976 2.34197 5.69657 2.34725 5.68338C2.37628 5.61478 2.40795 5.54617 2.43962 5.47757C2.44489 5.46702 2.45017 5.45383 2.45545 5.44063C2.48975 5.36676 2.5267 5.29024 2.56628 5.21636C2.5742 5.20053 2.58212 5.1847 2.59267 5.16887C2.63226 5.09499 2.6692 5.02375 2.71143 4.94987V4.94195H2.7167L3.2656 6.63061L1.82738 7.67546C1.82738 7.67546 1.82738 7.65699 1.83002 7.64908H1.82738ZM4.08367 7.6095L5.62745 8.31926L6.52204 11.0712L5.62481 12.1108H2.74309C2.23642 11.2348 1.92238 10.2612 1.81683 9.25594L4.08367 7.6095ZM7.58026 1.41161C7.65942 1.39578 7.74123 1.37995 7.8204 1.36675C7.84151 1.36412 7.86262 1.35884 7.88109 1.3562C7.96026 1.34301 8.03679 1.33245 8.11596 1.32454C8.13971 1.3219 8.16346 1.31926 8.18721 1.31662C8.24791 1.30871 8.30596 1.30343 8.36666 1.29815C8.39305 1.29815 8.42207 1.29288 8.44846 1.29024C8.52235 1.28496 8.59361 1.27968 8.6675 1.27705C8.69916 1.27705 8.73347 1.27441 8.76514 1.27177C8.82319 1.27177 8.88125 1.26913 8.94194 1.26913C8.98153 1.26913 9.01847 1.26913 9.05806 1.26913C9.11611 1.26913 9.17681 1.26913 9.23487 1.27177C9.26653 1.27177 9.30084 1.27177 9.33251 1.27705C9.4064 1.27968 9.48029 1.28496 9.55154 1.29024C9.58057 1.29024 9.60696 1.29551 9.63334 1.29815C9.69404 1.30343 9.75473 1.30871 9.81279 1.31662C9.83654 1.31926 9.86029 1.3219 9.88668 1.32454C9.96585 1.33509 10.045 1.34565 10.1215 1.3562L10.1849 1.36675C10.264 1.37995 10.3459 1.39314 10.425 1.41161C10.4277 1.41161 10.4303 1.41161 10.4356 1.41161H10.4382L9 2.45646L7.56178 1.41161H7.56442C7.56442 1.41161 7.5697 1.41161 7.57234 1.41161H7.58026ZM9.00528 6.56728L11.1138 8.10026L10.3089 10.5805H7.70165L6.89677 8.10026L9.00528 6.56728ZM15.3018 4.94459V4.94987C15.3466 5.02111 15.3862 5.09499 15.4232 5.16887L15.4469 5.21636C15.4839 5.29024 15.5208 5.36676 15.5577 5.44063C15.563 5.45119 15.5683 5.46438 15.5736 5.47493C15.6052 5.54354 15.6369 5.61214 15.6659 5.68338C15.6712 5.69657 15.6791 5.7124 15.6844 5.72559C15.7161 5.80211 15.7478 5.87863 15.7768 5.95778C15.7821 5.97361 15.79 5.98945 15.7953 6.00528C15.8216 6.07916 15.848 6.1504 15.8718 6.22428C15.8744 6.23219 15.8771 6.24011 15.8797 6.25066C15.9061 6.32982 15.9298 6.40897 15.9536 6.49077C15.9589 6.50923 15.9641 6.52771 15.9694 6.54618C15.9905 6.62797 16.0143 6.70976 16.0328 6.78892C16.0328 6.7942 16.0328 6.79683 16.0328 6.80211C16.0512 6.88127 16.0697 6.96042 16.0855 7.03958L16.0961 7.09235C16.1119 7.17414 16.1278 7.25594 16.141 7.33773C16.141 7.35092 16.1462 7.36412 16.1462 7.37731C16.1568 7.45119 16.1673 7.52771 16.1779 7.60422C16.1779 7.62005 16.1805 7.63325 16.1832 7.64908C16.1832 7.65699 16.1832 7.66755 16.1858 7.67546L14.7476 6.63061L15.2965 4.93931L15.3018 4.94459ZM13.9295 7.61214L16.1937 9.25858C16.0882 10.2639 15.7715 11.2401 15.2675 12.1135H12.3858L11.4912 11.0739L12.3858 8.3219L13.9295 7.61214ZM14.3306 13.3879C14.3306 13.3879 14.3254 13.3931 14.3227 13.3958C14.2673 13.4565 14.2093 13.5172 14.1512 13.5752C14.138 13.5884 14.1248 13.6016 14.1116 13.6148C14.0536 13.6728 13.9929 13.7309 13.9322 13.7889C13.9216 13.7995 13.9111 13.81 13.8979 13.8206C13.8424 13.8707 13.7844 13.9235 13.729 13.971C13.7184 13.9789 13.7079 13.9894 13.6973 14C13.634 14.0554 13.5706 14.1055 13.5047 14.1583C13.4888 14.1715 13.473 14.1821 13.4598 14.1953C13.3938 14.2454 13.3278 14.2955 13.2619 14.3456C13.2619 14.3456 13.2566 14.3483 13.2566 14.3509C13.188 14.4011 13.1194 14.4486 13.0481 14.496C13.0323 14.5066 13.0165 14.5172 12.998 14.5277C12.9294 14.5726 12.8581 14.6174 12.7895 14.6623C12.7763 14.6702 12.7658 14.6781 12.7526 14.6834C12.6892 14.723 12.6233 14.7599 12.5573 14.7968C12.5441 14.8048 12.5283 14.8127 12.5151 14.8206C12.4438 14.8602 12.3699 14.8997 12.296 14.9367C12.2802 14.9446 12.2617 14.9525 12.2459 14.9631C12.1746 15 12.1007 15.0343 12.0295 15.0686C12.0242 15.0686 12.0189 15.0739 12.0137 15.0765H12.0084L12.5573 13.3879H14.3306ZM6.00217 15.0765L5.98898 15.0712C5.91509 15.0369 5.8412 15 5.76731 14.9631C5.75147 14.9551 5.73564 14.9472 5.71981 14.9393C5.64592 14.9024 5.57203 14.8628 5.49814 14.8206C5.48494 14.8127 5.47175 14.8048 5.45855 14.7995C5.39258 14.7625 5.32661 14.723 5.26063 14.6834C5.25008 14.6781 5.23688 14.6702 5.22633 14.6623C5.15508 14.6201 5.08646 14.5726 5.01521 14.5277C4.99938 14.5172 4.98355 14.5066 4.96771 14.496C4.89646 14.4486 4.82785 14.4011 4.75924 14.3509H4.75396C4.68799 14.2982 4.61937 14.248 4.5534 14.1953C4.53757 14.1821 4.52437 14.1715 4.50854 14.1583C4.44256 14.1055 4.37923 14.0554 4.3159 14C4.30534 13.9894 4.29478 13.9815 4.28159 13.971C4.22353 13.9208 4.16812 13.8707 4.1127 13.8206C4.10214 13.81 4.08895 13.7995 4.07839 13.7889C4.0177 13.7335 3.957 13.6755 3.89894 13.6148C3.88575 13.6016 3.87256 13.5884 3.85936 13.5752C3.8013 13.5172 3.74589 13.4591 3.69047 13.3984C3.68783 13.3958 3.68519 13.3931 3.67991 13.3879H5.45328L6.00217 15.0765C6.00217 15.0765 5.99954 15.0765 5.9969 15.0765H6.00217ZM7.50636 15.5726L6.63552 12.8971L7.53012 11.8602H10.4804L11.375 12.8971L10.5042 15.5726C9.52251 15.7784 8.48805 15.781 7.50373 15.5726H7.50636ZM14.3755 3.66755L13.4809 6.41953L11.9371 7.12929L9.6439 5.46174V3.57784L11.9503 1.90237C12.8713 2.31135 13.6999 2.91557 14.3781 3.66755H14.3755ZM6.06287 1.90237L8.3693 3.57784V5.46174L6.07606 7.12929L4.53229 6.41953L3.63769 3.66755C4.3159 2.91557 5.14452 2.31398 6.06551 1.90237H6.06287Z",fill:"#979DA2"},null,-1)])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("svg",L$t,[...s[1]||(s[1]=[e.createElementVNode("path",{d:"M17.182 5.9a.538.538 0 0 0-.13-.416L14.24 2.109a.558.558 0 0 0-.433-.203h-2.25c-.017 0-.034.012-.056.012a.557.557 0 0 0-.563.41 1.68 1.68 0 0 1-1.63 1.266 1.68 1.68 0 0 1-1.632-1.266.55.55 0 0 0-.563-.41c-.017 0-.033-.012-.056-.012h-2.25a.558.558 0 0 0-.433.203L1.561 5.484a.586.586 0 0 0-.129.416c.017.152.09.287.208.382l2.605 2.082v8.167c0 .31.253.563.562.563h9c.31 0 .563-.253.563-.563V8.364l2.604-2.082a.59.59 0 0 0 .208-.382zm-3.937 4.444H5.37V9.78h7.875v.563zM5.37 15.969v-4.5h7.875v4.5H5.37zm9-9.045v-.518a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v2.25H5.37v-2.25a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v.518L2.793 5.765l2.278-2.734h1.66A2.802 2.802 0 0 0 9.307 4.72a2.803 2.803 0 0 0 2.576-1.688h1.66l2.278 2.734-1.451 1.159z",fill:"#98A2B3"},null,-1)])])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("svg",C$t,[...s[2]||(s[2]=[e.createElementVNode("path",{d:"M15.426 3.353a2.384 2.384 0 0 0-2.381 2.381 2.384 2.384 0 0 0 2.381 2.382 2.384 2.384 0 0 0 2.381-2.382 2.384 2.384 0 0 0-2.381-2.38zm0 3.766a1.386 1.386 0 0 1-1.385-1.385c0-.763.622-1.384 1.385-1.384s1.385.621 1.385 1.384c0 .764-.622 1.385-1.385 1.385zM1.424 6.558a.497.497 0 0 0 .704 0l1.295-1.296L4.72 6.558a.497.497 0 0 0 .704 0 .498.498 0 0 0 0-.705L4.128 4.558l1.295-1.295a.498.498 0 0 0-.705-.705L3.423 3.853 2.128 2.558a.499.499 0 0 0-.704.705l1.295 1.295-1.295 1.295a.498.498 0 0 0 0 .705zM13.013 12.443a.498.498 0 0 0-.705 0l-1.295 1.295-1.295-1.295a.499.499 0 0 0-.704.704l1.295 1.295-1.295 1.295a.499.499 0 0 0 .704.705l1.295-1.295 1.295 1.295a.497.497 0 0 0 .705 0 .498.498 0 0 0 0-.705l-1.295-1.295 1.295-1.295a.498.498 0 0 0 0-.704zM12.052 5.455l-2.01-1.747a.498.498 0 0 0-.654.753l1.066.926c-3.145.411-5.008 2.055-6.043 3.444a9.569 9.569 0 0 0-1.501 3.012 2.384 2.384 0 0 0-2.103 2.364 2.384 2.384 0 0 0 2.381 2.381 2.384 2.384 0 0 0 2.381-2.381 2.385 2.385 0 0 0-1.647-2.265 8.674 8.674 0 0 1 1.312-2.547C6.53 7.674 8.33 6.66 10.594 6.372l-.992 1.142a.498.498 0 0 0 .752.654l1.747-2.01a.498.498 0 0 0-.05-.703zm-7.48 8.752c0 .763-.62 1.384-1.384 1.384a1.386 1.386 0 0 1-1.384-1.384c0-.764.62-1.385 1.384-1.385.763 0 1.385.622 1.385 1.385z",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":".3"},null,-1)])])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("svg",N$t,[...s[3]||(s[3]=[e.createElementVNode("rect",{x:".707",y:".9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),e.createElementVNode("rect",{x:"8.707",y:".9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),e.createElementVNode("rect",{x:".707",y:"8.9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),e.createElementVNode("rect",{x:"8.707",y:"8.9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1)])])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",O$t,[...s[4]||(s[4]=[e.createStaticVNode('<g clip-path="url(#gpdeo9cu3a)" fill="#98A2B3" data-v-610fe7ec><path d="M9.307.5C4.505.5.598 4.407.598 9.209c0 2 .69 3.938 1.946 5.486l-.754 3.159a.524.524 0 0 0 .727.599l3.038-1.384a8.743 8.743 0 0 0 3.752.848c4.802 0 8.709-3.907 8.709-8.708C18.016 4.407 14.109.5 9.307.5zm0 16.368a7.574 7.574 0 0 1-3.502-.845.525.525 0 0 0-.457-.011l-2.289 1.042.566-2.372a.524.524 0 0 0-.113-.465A7.657 7.657 0 0 1 1.647 9.21c0-4.224 3.436-7.66 7.66-7.66s7.66 3.436 7.66 7.66c0 4.223-3.436 7.66-7.66 7.66z" data-v-610fe7ec></path><path d="M9.68 5.199c-1.094-.115-2.459.397-3.041 1.797a.524.524 0 0 0 .968.403c.375-.902 1.255-1.231 1.964-1.157.721.075 1.232.542 1.365 1.25.13.693-.136 1.097-1.097 1.662-1.042.613-1.372.874-1.372 2.27a.524.524 0 0 0 1.049 0c0-.479.033-.715.118-.843.094-.14.33-.283.737-.523.666-.392 1.905-1.12 1.596-2.76-.221-1.171-1.098-1.975-2.288-2.1zM9.145 12.673a.608.608 0 0 0-.506.17c-.13.13-.19.31-.17.505a.525.525 0 0 0 .939.263.523.523 0 0 0-.263-.938z" data-v-610fe7ec></path></g><defs data-v-610fe7ec><clipPath id="gpdeo9cu3a" data-v-610fe7ec><path fill="#fff" transform="translate(.307 .5)" d="M0 0h18v18H0z" data-v-610fe7ec></path></clipPath></defs>',2)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",E$t,e.toDisplayString(t.text),1),t.showBadge?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.showBadgeOnFilterFull?(e.openBlock(),e.createElementBlock("div",z$t,[e.createElementVNode("div",{class:"button__info",style:e.normalizeStyle(y.value)},[e.withDirectives(e.createElementVNode("span",null,e.toDisplayString(t.infoValue),513),[[e.vShow,t.infoValue]])],4)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.filtersTotal>0&&t.filtersTotal!=parseInt(t.infoValue)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"button__info",style:e.normalizeStyle(y.value)},[e.withDirectives(e.createElementVNode("span",null,e.toDisplayString(t.infoValue),513),[[e.vShow,t.infoValue]])],4)):t.filtersTotal>0?(e.openBlock(),e.createElementBlock("div",M$t)):e.createCommentVNode("",!0)],64))],64)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["button__arrow",{"rotated-180":t.isActive}])},[(e.openBlock(),e.createElementBlock("svg",V$t,[e.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:t.arrowColor},null,8,P$t)]))],2)],4))}},R$t=e2(A$t,[["__scopeId","data-v-610fe7ec"]]),F$t={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(null);e.watch(()=>n.modelValue,()=>{f()},{immediate:!0});function f(){$.value&&($.value.checked=n.modelValue)}function u(i){y("update:modelValue",i.target.checked)}return e.onMounted(()=>{f()}),(i,d)=>(e.openBlock(),e.createElementBlock("input",{ref_key:"switchCustom",ref:$,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:u},null,544))}},dA=e2(F$t,[["__scopeId","data-v-e3a6ae4e"]]),U$t={class:"corners"},I$t={class:"corners-type"},q$t={class:"selected-item"},j$t={class:"available-item"},D$t={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W$t={class:"advanced-filters-menu"},B$t={class:"toggle-group"},K$t={class:"toggle-group"},X$t={key:0,class:"time-control"},G$t={class:"stepper-container"},Z$t={class:"stepper"},J$t={class:"stepper-value"},H$t={class:"time-control"},Y$t={class:"stepper-container"},Q$t={class:"stepper"},$$t={class:"stepper-value"},tte={class:"time-control"},ete={class:"stepper-container"},rte={class:"stepper"},nte={class:"stepper-value"},ate={class:"corners__how-many-games"},ite={class:"selected-item"},ote={class:"available-item"},ste={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lte={__name:"FilterCorners",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(t,{emit:r}){var n;const y=Array.from({length:10}).map((P,V)=>({id:V+1,name:`${V+1} ${V===0?"corner":"corners"}`,value:V+1})),$=t,f=r,u=e.ref([...y]),i=e.ref(u.value[0]),d=e.ref(c()),l=e.ref({backgroundColor:"#2e3b46",width:"96.2%",borderColor:"rgba(255, 255, 255, 0.20)",infoBorderColor:"rgba(255, 255, 255, 0.20)",height:"40px",padding:"0 4px",textFontFamily:"'Poppins-Regular'",showIcon:!1}),a=e.ref({label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}),S=e.ref(!1),T=e.ref($.defaultFilters?$.defaultFilters.isAgainstMode:!1),b=e.ref($.defaultFilters?null:(n=a.value)==null?void 0:n.options[0]),p=e.computed(()=>({...uA}));e.watch(()=>$.viewConfig,P=>{P.filters&&(a.value||o())},{immediate:!0});const s=e.computed(()=>({isAgainstMode:T.value,selectedTeam:b.value,howManyCorners:i.value?i.value.value:null,advancedFilters:{...d.value}}));e.watch(()=>s.value,P=>{f("change",{filters:{...P,advancedFilters:{...P.advancedFilters,areConnectionsVisible:!P.advancedFilters.areConnectionsVisible,arePathsVisible:!P.advancedFilters.arePathsVisible}},view:$.viewConfig})},{deep:!0,immediate:!0});function c(){return{areConnectionsVisible:!0,arePathsVisible:!0,secondsBefore:-1,secondsAfter:0,secondsBeforeAndAfter:0}}function o(){if($.viewConfig&&$.viewConfig.filters){const P=$.viewConfig.filters.find(V=>V.key==="teamRadios");if(P){a.value={options:P.options};return}}a.value={label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}}function h(){$.defaultFilters&&(b.value=a.value.options.find(P=>P.value===($.defaultFilters.isHomeTeam?1:2))||a.value.options[0],d.value={...$.defaultFilters.advancedFilters,areConnectionsVisible:!$.defaultFilters.advancedFilters.areConnectionsVisible,arePathsVisible:!$.defaultFilters.advancedFilters.arePathsVisible})}function v(P){b.value=P}function k(P){i.value=P}function L(P,V){const I=d.value[V]+P;if(!(I<-5||I>10)){if(["secondsBefore","secondsAfter"].includes(V)){if(V==="secondsBefore"){if(d.value.secondsAfter<I)return}else if(d.value.secondsBefore>I)return}d.value[V]=I}}function E(){S.value=!1}return e.onBeforeUnmount(()=>{}),e.onMounted(()=>{setTimeout(()=>{h()},500)}),(P,V)=>(e.openBlock(),e.createElementBlock("div",U$t,[e.withDirectives(e.createElementVNode("div",I$t,[e.createElementVNode("div",{class:e.normalizeClass(["label",{"switch-selected":!T.value}])}," A favor ",2),e.createVNode(dA,{modelValue:T.value,"onUpdate:modelValue":V[0]||(V[0]=I=>T.value=I)},null,8,["modelValue"]),e.createElementVNode("div",{class:e.normalizeClass(["label",{"switch-selected":T.value}])}," En contra ",2)],512),[[e.vShow,!t.isPostMatch]]),e.createVNode(e.unref(Qk),e.mergeProps(p.value,{items:a.value.options,"model-value":b.value,"onUpdate:modelValue":v}),{default:e.withCtx(()=>[e.createElementVNode("div",q$t,[V[10]||(V[10]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(b.value?b.value.label:a.value.label),1)])]),availableItem:e.withCtx(({item:I})=>[e.createElementVNode("div",j$t,[e.createElementVNode("div",null,e.toDisplayString(I.label),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",D$t,[...V[11]||(V[11]=[e.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)),[[e.vShow,b.value&&b.value.label===I.label]])])])]),_:1},16,["items","model-value"]),e.createVNode(e.unref(s$t),{modelValue:S.value,"onUpdate:modelValue":V[9]||(V[9]=I=>S.value=I),width:"250px","left-menu":"0","menu-margin-top":18},{trigger:e.withCtx(()=>[e.createVNode(R$t,e.mergeProps(l.value,{text:"Filtros avanzados","show-badge-on-filter-full":!1,"filters-total":0,"is-active":S.value,"show-icon":!0,"icon-type":e.unref(Bb).CORNERS_ADVANCED}),null,16,["is-active","icon-type"])]),menu:e.withCtx(()=>[e.createElementVNode("div",W$t,[V[22]||(V[22]=e.createElementVNode("h2",{class:"menu-title"},"Mostrar Conexiones",-1)),e.createElementVNode("div",B$t,[V[12]||(V[12]=e.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),e.createVNode(dA,{modelValue:d.value.areConnectionsVisible,"onUpdate:modelValue":V[1]||(V[1]=I=>d.value.areConnectionsVisible=I)},null,8,["modelValue"]),V[13]||(V[13]=e.createElementVNode("label",{class:"toggle-label"},"No",-1))]),V[23]||(V[23]=e.createElementVNode("hr",{class:"separator"},null,-1)),V[24]||(V[24]=e.createElementVNode("h2",{class:"menu-title"},"Mostrar recorridos",-1)),e.createElementVNode("div",K$t,[V[14]||(V[14]=e.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),e.createVNode(dA,{modelValue:d.value.arePathsVisible,"onUpdate:modelValue":V[2]||(V[2]=I=>d.value.arePathsVisible=I)},null,8,["modelValue"]),V[15]||(V[15]=e.createElementVNode("label",{class:"toggle-label"},"No",-1))]),d.value.arePathsVisible?(e.openBlock(),e.createElementBlock("div",X$t,[V[17]||(V[17]=e.createElementVNode("label",{class:"time-label"},[e.createTextVNode(" Segundos "),e.createElementVNode("span",{class:"highlight"},"antes"),e.createTextVNode(" / "),e.createElementVNode("span",{class:"highlight"},"después"),e.createTextVNode(" del cobro: ")],-1)),e.createElementVNode("div",G$t,[e.createElementVNode("div",Z$t,[e.createElementVNode("button",{class:"stepper-btn",onClick:V[3]||(V[3]=I=>L(-1,"secondsBeforeAndAfter"))},"−"),e.createElementVNode("span",J$t,e.toDisplayString(d.value.secondsBeforeAndAfter),1),e.createElementVNode("button",{class:"stepper-btn",onClick:V[4]||(V[4]=I=>L(1,"secondsBeforeAndAfter"))},"+")]),V[16]||(V[16]=e.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",H$t,[V[19]||(V[19]=e.createElementVNode("label",{class:"time-label"},[e.createTextVNode(" Segundos "),e.createElementVNode("span",{class:"highlight"},"antes"),e.createTextVNode(" del cobro: ")],-1)),e.createElementVNode("div",Y$t,[e.createElementVNode("div",Q$t,[e.createElementVNode("button",{class:"stepper-btn",onClick:V[5]||(V[5]=I=>L(-1,"secondsBefore"))},"−"),e.createElementVNode("span",$$t,e.toDisplayString(d.value.secondsBefore),1),e.createElementVNode("button",{class:"stepper-btn",onClick:V[6]||(V[6]=I=>L(1,"secondsBefore"))},"+")]),V[18]||(V[18]=e.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])]),e.createElementVNode("div",tte,[V[21]||(V[21]=e.createElementVNode("label",{class:"time-label"},[e.createTextVNode(" Segundos "),e.createElementVNode("span",{class:"highlight"},"después"),e.createTextVNode(" del cobro: ")],-1)),e.createElementVNode("div",ete,[e.createElementVNode("div",rte,[e.createElementVNode("button",{class:"stepper-btn",onClick:V[7]||(V[7]=I=>L(-1,"secondsAfter"))},"−"),e.createElementVNode("span",nte,e.toDisplayString(d.value.secondsAfter),1),e.createElementVNode("button",{class:"stepper-btn",onClick:V[8]||(V[8]=I=>L(1,"secondsAfter"))},"+")]),V[20]||(V[20]=e.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])],64)),V[25]||(V[25]=e.createElementVNode("hr",{class:"separator"},null,-1)),e.createElementVNode("button",{class:"btn-ready",onClick:E},"Listo")])]),_:1},8,["modelValue"]),e.withDirectives(e.createElementVNode("div",ate,[e.createVNode(e.unref(Qk),e.mergeProps(p.value,{items:u.value,"model-value":i.value,"onUpdate:modelValue":k}),{default:e.withCtx(()=>[e.createElementVNode("div",ite,[V[26]||(V[26]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(i.value?i.value.name:"Seleccione"),1)])]),availableItem:e.withCtx(({item:I})=>[e.createElementVNode("div",ote,[e.createElementVNode("div",null,e.toDisplayString(I.name),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",ste,[...V[27]||(V[27]=[e.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)),[[e.vShow,i.value&&i.value.name===I.name]])])])]),_:1},16,["items","model-value"])],512),[[e.vShow,!t.defaultFilters]])]))}},cte=e2(lte,[["__scopeId","data-v-75e86cac"]]),ute={class:"resultados-filter"},dte={class:"filter-checkboxes"},pte=["checked","disabled","onChange"],hte={class:"checkbox-label"},fte={class:"filter-actions"},mte={__name:"ResultadosFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=[{value:"iba-ganando",label:"Iba ganando"},{value:"iba-perdiendo",label:"Iba perdiendo"},{value:"iba-empatado",label:"Iba empatado"}],f=e.ref([]);e.watch(()=>n.selectedValues,S=>{var T;if(console.log("[ResultadosFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:S,filterValue:S==null?void 0:S[n.filterIndex],optionValue:(T=S==null?void 0:S[n.filterIndex])==null?void 0:T[n.optionIndex],isArray:Array.isArray(S),filterValueType:typeof(S==null?void 0:S[n.filterIndex])}),!S||!Array.isArray(S)){f.value.length===0&&(console.log("[ResultadosFilter] No hay valores en props, usando valores por defecto"),f.value=["iba-ganando","iba-perdiendo","iba-empatado"]);return}const b=S[n.filterIndex];if(b&&typeof b=="object"&&!Array.isArray(b))if(b[n.optionIndex]!==void 0){const p=Array.isArray(b[n.optionIndex])?b[n.optionIndex]:[];console.log("[ResultadosFilter] Valores encontrados para sincronizar:",p,"localSelectedValues actual:",f.value);const s=JSON.stringify(f.value.sort()),c=JSON.stringify(p.sort());s!==c?(console.log("[ResultadosFilter] Actualizando localSelectedValues con:",p),f.value=p.length>0?[...p]:[]):console.log("[ResultadosFilter] Los valores ya están sincronizados, no se actualiza");return}else console.log("[ResultadosFilter] filterValue existe pero no tiene optionIndex",n.optionIndex,"filterValue keys:",Object.keys(b));else console.log("[ResultadosFilter] filterValue no es un objeto válido:",b);f.value.length===0&&(console.log("[ResultadosFilter] No se encontraron valores guardados, usando valores por defecto"),f.value=["iba-ganando","iba-perdiendo","iba-empatado"])},{immediate:!0,deep:!0}),e.onMounted(()=>{var S,T,b;console.log("[ResultadosFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(S=n.selectedValues)==null?void 0:S[n.filterIndex],optionValue:(b=(T=n.selectedValues)==null?void 0:T[n.filterIndex])==null?void 0:b[n.optionIndex]}),e.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const p=n.selectedValues[n.filterIndex];if(p&&typeof p=="object"&&!Array.isArray(p)&&p[n.optionIndex]!==void 0){const s=Array.isArray(p[n.optionIndex])?p[n.optionIndex]:[];if(console.log("[ResultadosFilter] onMounted - Valores encontrados:",s),s.length>0){console.log("[ResultadosFilter] onMounted - Actualizando localSelectedValues con:",s),f.value=[...s];return}}}f.value.length===0&&(console.log("[ResultadosFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),f.value=["iba-ganando","iba-perdiendo","iba-empatado"])})});const u=S=>f.value.includes(S),i=S=>f.value.length===1&&f.value.includes(S),d=(S,T)=>{let b=[...f.value];if(T)b.includes(S)||b.push(S);else{if(b.length===1)return;b=b.filter(p=>p!==S)}b.length===0&&(b=[$[0].value]),f.value=b,y("update-selection",{optionIndex:n.optionIndex,values:b})},l=()=>{const S=$.map(T=>T.value);f.value=[...S],y("update-selection",{optionIndex:n.optionIndex,values:[...S]})},a=()=>{y("done")};return(S,T)=>(e.openBlock(),e.createElementBlock("div",ute,[e.createElementVNode("div",dte,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList($,b=>e.createElementVNode("label",{key:b.value,class:"checkbox-item"},[e.createElementVNode("input",{type:"checkbox",checked:u(b.value),disabled:i(b.value),onChange:e.withModifiers(p=>d(b.value,p.target.checked),["stop"])},null,40,pte),e.createElementVNode("span",hte,e.toDisplayString(b.label),1)])),64))]),e.createElementVNode("div",fte,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(l,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(a,["stop"])}," Listo ")])]))}},kO=e2(mte,[["__scopeId","data-v-6b648e3f"]]),yte={class:"detalles-filter"},gte={class:"filter-header"},vte={class:"checkbox-todos"},bte=["checked"],xte={class:"time-section"},_te={class:"time-buttons"},wte=["onClick"],Tte={class:"time-section"},Ste={class:"time-buttons"},kte=["onClick"],Lte={class:"filter-actions"},Cte={__name:"DetallesFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=[{value:"0-15",label:"0-15"},{value:"16-30",label:"16-30"},{value:"31-45",label:"31-45"}],f=[{value:"46-60",label:"46-60"},{value:"61-75",label:"61-75"},{value:"76-90",label:"76-90"}],u=[...$,...f].map(p=>p.value),i=e.ref([]);e.watch(()=>n.selectedValues,p=>{var s;if(console.log("[DetallesFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:p,filterValue:p==null?void 0:p[n.filterIndex],optionValue:(s=p==null?void 0:p[n.filterIndex])==null?void 0:s[n.optionIndex]}),!p||!Array.isArray(p))return;const c=p[n.filterIndex];if(c&&typeof c=="object"&&!Array.isArray(c)&&c[n.optionIndex]!==void 0){const o=Array.isArray(c[n.optionIndex])?c[n.optionIndex]:[];if(console.log("[DetallesFilter] Valores encontrados para sincronizar:",o),o.length>0){const h=JSON.stringify(i.value.sort()),v=JSON.stringify(o.sort());h!==v&&(console.log("[DetallesFilter] Actualizando localSelectedValues con:",o),i.value=[...o])}}},{immediate:!0,deep:!0});const d=e.computed(()=>[...$,...f].map(p=>p.value).every(p=>i.value.includes(p)));e.onMounted(()=>{var p,s,c;console.log("[DetallesFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(p=n.selectedValues)==null?void 0:p[n.filterIndex],optionValue:(c=(s=n.selectedValues)==null?void 0:s[n.filterIndex])==null?void 0:c[n.optionIndex]}),e.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const o=n.selectedValues[n.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)&&o[n.optionIndex]!==void 0){const h=Array.isArray(o[n.optionIndex])?o[n.optionIndex]:[];if(console.log("[DetallesFilter] onMounted - Valores encontrados:",h),h.length>0){console.log("[DetallesFilter] onMounted - Actualizando localSelectedValues con:",h),i.value=[...h];return}}}i.value.length===0&&(console.log("[DetallesFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),i.value=[...u])})});const l=p=>i.value.includes(p),a=p=>{const s=p.target.checked;let c=[];s?c=[...$,...f].map(o=>o.value):c=[u[0]],i.value=c,y("update-selection",{optionIndex:n.optionIndex,values:c})},S=p=>{let s=[...i.value];if(s.includes(p))if(s.length>1)s=s.filter(c=>c!==p);else return;else s.includes(p)||s.push(p);s.length===0&&(s=[u[0]]),i.value=s,y("update-selection",{optionIndex:n.optionIndex,values:s})},T=()=>{const p=[u[0]];i.value=p,y("update-selection",{optionIndex:n.optionIndex,values:p})},b=()=>{y("done")};return(p,s)=>(e.openBlock(),e.createElementBlock("div",yte,[e.createElementVNode("div",gte,[s[1]||(s[1]=e.createElementVNode("span",{class:"filter-title"},"En: (Elige el lapso de tiempo)",-1)),e.createElementVNode("label",vte,[e.createElementVNode("input",{type:"checkbox",checked:d.value,onChange:e.withModifiers(a,["stop"])},null,40,bte),s[0]||(s[0]=e.createElementVNode("span",{class:"checkbox-label"},"Todos",-1))])]),e.createElementVNode("div",xte,[s[2]||(s[2]=e.createElementVNode("div",{class:"time-label"},"1er tiempo",-1)),e.createElementVNode("div",_te,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList($,c=>e.createElementVNode("button",{key:c.value,class:e.normalizeClass(["time-button",{active:l(c.value)}]),onClick:e.withModifiers(o=>S(c.value),["stop"])},e.toDisplayString(c.label),11,wte)),64))])]),e.createElementVNode("div",Tte,[s[3]||(s[3]=e.createElementVNode("div",{class:"time-label"},"2do tiempo",-1)),e.createElementVNode("div",Ste,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(f,c=>e.createElementVNode("button",{key:c.value,class:e.normalizeClass(["time-button",{active:l(c.value)}]),onClick:e.withModifiers(o=>S(c.value),["stop"])},e.toDisplayString(c.label),11,kte)),64))])]),e.createElementVNode("div",Lte,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(T,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(b,["stop"])}," Listo ")])]))}},pA=e2(Cte,[["__scopeId","data-v-7bea3520"]]),Nte={class:"como-fue-cobrado-filter"},Ote={class:"cobro-grid"},Ete=["onClick"],zte={class:"cobro-image-container"},Mte=["src","alt"],Vte={class:"cobro-footer"},Pte={class:"cobro-label"},Ate={class:"filter-actions"},Rte={__name:"ComoFueCobradoFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=[{value:"comba-afuera",label:"Comba hacia afuera",image:"https://golstatsimages.blob.core.windows.net/content/comba-afuera-izquierda.png",count:10},{value:"comba-adentro",label:"Comba hacia adentro",image:"https://golstatsimages.blob.core.windows.net/content/comba-adentro-izquierda.png",count:2},{value:"raz-area",label:"Raz de área",image:"https://golstatsimages.blob.core.windows.net/content/raz-area-izquierda.png",count:0},{value:"en-corto",label:"En corto",image:"https://golstatsimages.blob.core.windows.net/content/en-corto-izquierda.png",count:1}],f=e.ref([]);e.watch(()=>n.selectedValues,a=>{var S;if(console.log("[ComoFueCobradoFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:a,filterValue:a==null?void 0:a[n.filterIndex],optionValue:(S=a==null?void 0:a[n.filterIndex])==null?void 0:S[n.optionIndex]}),!a||!Array.isArray(a)){f.value.length===0&&(f.value=[...$.map(b=>b.value)]);return}const T=a[n.filterIndex];if(T&&typeof T=="object"&&!Array.isArray(T)&&T[n.optionIndex]!==void 0){const b=Array.isArray(T[n.optionIndex])?T[n.optionIndex]:[];console.log("[ComoFueCobradoFilter] Valores encontrados para sincronizar:",b);const p=JSON.stringify(f.value.sort()),s=JSON.stringify(b.sort());p!==s&&(f.value=b.length>0?[...b]:[]);return}f.value.length===0&&(f.value=[...$.map(b=>b.value)])},{immediate:!0,deep:!0});const u=a=>f.value.includes(a),i=a=>{let S=[...f.value];S.includes(a)?S=S.filter(T=>T!==a):S.push(a),S.length===0&&(S=[...$.map(T=>T.value)]),f.value=S,y("update-selection",{optionIndex:n.optionIndex,values:S})};e.onMounted(()=>{var a,S,T;console.log("[ComoFueCobradoFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(a=n.selectedValues)==null?void 0:a[n.filterIndex],optionValue:(T=(S=n.selectedValues)==null?void 0:S[n.filterIndex])==null?void 0:T[n.optionIndex]}),e.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const b=n.selectedValues[n.filterIndex];if(b&&typeof b=="object"&&!Array.isArray(b)&&b[n.optionIndex]!==void 0){const p=Array.isArray(b[n.optionIndex])?b[n.optionIndex]:[];if(console.log("[ComoFueCobradoFilter] onMounted - Valores encontrados:",p),p.length>0){console.log("[ComoFueCobradoFilter] onMounted - Actualizando localSelectedValues con:",p),f.value=[...p];return}}}f.value.length===0&&(console.log("[ComoFueCobradoFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),f.value=["izquierda",...$.map(b=>b.value)])})});const d=()=>{const a=[...$.map(S=>S.value)];f.value=a,y("update-selection",{optionIndex:n.optionIndex,values:a})},l=()=>{y("done")};return(a,S)=>(e.openBlock(),e.createElementBlock("div",Nte,[e.createElementVNode("div",Ote,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList($,T=>e.createElementVNode("div",{key:T.value,class:e.normalizeClass(["cobro-item",{active:u(T.value)}]),onClick:e.withModifiers(b=>i(T.value),["stop"])},[e.createElementVNode("div",zte,[e.createElementVNode("img",{src:T.image,alt:T.label,class:"cobro-image"},null,8,Mte)]),e.createElementVNode("div",Vte,[e.createElementVNode("span",Pte,e.toDisplayString(T.label),1)])],10,Ete)),64))]),e.createElementVNode("div",Ate,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(d,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(l,["stop"])}," Listo ")])]))}},LO=e2(Rte,[["__scopeId","data-v-fb6f9ab9"]]),Fte={class:"zona-filter"},Ute={class:"template-zone"},Ite={class:"controls-zone-container"},qte={class:"controls-zone-container-title-checkcon"},jte={class:"controls-zone-container-title-checkcon-check"},Dte={class:"gsc-field-img-container"},Wte=["fill"],Bte=["fill"],Kte=["fill"],Xte=["fill"],Gte=["fill"],Zte=["fill"],Jte=["fill"],Hte=["fill"],Yte=["fill"],Qte=["fill"],$te=["fill"],tee=["fill"],eee=["fill"],ree=["fill"],nee=["fill"],aee=["fill"],iee=["fill"],oee=["fill"],see=["fill"],lee=["fill"],cee=["fill"],uee=["fill"],dee=["fill"],pee=["fill"],hee=["fill"],fee=["fill"],mee=["fill"],yee=["fill"],gee=["fill"],vee=["fill"],bee=["fill"],xee=["fill"],_ee=["fill"],wee=["fill"],Tee=["fill"],See=["id"],kee=["mask"],Lee={class:"filter-actions"},Cee={__name:"ZonaFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=Array.from({length:35},(b,p)=>p+1),f=e.ref(!0),u=e.ref([]),i=e.computed(()=>u.value),d=e.computed(()=>new Date().getTime());e.watch(()=>n.selectedValues,b=>{var p;if(console.log("[ZonaFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:b,filterValue:b==null?void 0:b[n.filterIndex],optionValue:(p=b==null?void 0:b[n.filterIndex])==null?void 0:p[n.optionIndex]}),!b||!Array.isArray(b)){u.value.length===0&&(console.log("[ZonaFilter] No hay valores en props, usando valores por defecto"),u.value=[...$],f.value=!0);return}const s=b[n.filterIndex];if(s&&typeof s=="object"&&!Array.isArray(s)){if(s[n.optionIndex]!==void 0){const c=Array.isArray(s[n.optionIndex])?s[n.optionIndex]:[];console.log("[ZonaFilter] Valores encontrados para sincronizar:",c);const o=JSON.stringify(u.value.sort((v,k)=>v-k)),h=JSON.stringify(c.sort((v,k)=>v-k));o!==h&&(console.log("[ZonaFilter] Actualizando zonesLocal con:",c),u.value=c.length>0?[...c]:[],f.value=c.length===35);return}}else if(Array.isArray(s)&&s.length>0){console.log("[ZonaFilter] filterValue es array directo:",s);const c=JSON.stringify(u.value.sort((h,v)=>h-v)),o=JSON.stringify(s.sort((h,v)=>h-v));c!==o&&(console.log("[ZonaFilter] Actualizando zonesLocal con array directo:",s),u.value=[...s],f.value=s.length===35);return}u.value.length===0&&(console.log("[ZonaFilter] No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],f.value=!0)},{immediate:!0,deep:!0}),e.watch(u,b=>{f.value=b.length===35,y("update-selection",{optionIndex:n.optionIndex,values:b})},{deep:!0});function l(b){b?(u.value=[...$],f.value=!0):(u.value=[1],f.value=!1)}function a(b){u.value.includes(b)?u.value=u.value.filter(p=>p!==b):u.value.push(b),f.value=u.value.length===35}const S=()=>{u.value=[...$],f.value=!0},T=()=>{y("done")};return e.onMounted(()=>{var b,p,s;if(console.log("[ZonaFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(b=n.selectedValues)==null?void 0:b[n.filterIndex],optionValue:(s=(p=n.selectedValues)==null?void 0:p[n.filterIndex])==null?void 0:s[n.optionIndex]}),n.selectedValues&&Array.isArray(n.selectedValues)){const c=n.selectedValues[n.filterIndex];if(c&&typeof c=="object"&&!Array.isArray(c)&&c[n.optionIndex]!==void 0){const o=Array.isArray(c[n.optionIndex])?c[n.optionIndex]:[];if(console.log("[ZonaFilter] onMounted - Valores encontrados:",o),o.length>0){console.log("[ZonaFilter] onMounted - Actualizando zonesLocal con:",o),u.value=[...o],f.value=o.length===35;return}}}u.value.length===0&&(console.log("[ZonaFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],f.value=!0)}),(b,p)=>(e.openBlock(),e.createElementBlock("div",Fte,[e.createElementVNode("div",Ute,[e.createElementVNode("div",Ite,[p[36]||(p[36]=e.createElementVNode("div",{class:"controls-zone-container-title"}," ¿A dónde fue el balón?: ",-1)),p[37]||(p[37]=e.createElementVNode("div",{class:"separator-line"},null,-1)),e.createElementVNode("div",qte,[p[35]||(p[35]=e.createElementVNode("div",{class:"controls-zone-container-title-checkcon-label"}," Todas las zonas ",-1)),e.createElementVNode("div",jte,[e.createVNode(e.unref(lA),{label:"",fontFamily:"Poppins-Regular",labelFontSize:"11px","label-color":"#FFF","model-value":f.value,"onUpdate:modelValue":l},null,8,["model-value"])])])]),e.createElementVNode("div",Dte,[(e.openBlock(),e.createElementBlock("svg",{key:`field-${u.value.length}`,width:"100%",height:"177",viewBox:"0 0 380 177",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{onClick:p[0]||(p[0]=s=>a(1)),class:"sector-field",x:"0.347042",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:i.value.includes(1)?"#FFFF0030":"#2e3b46"},null,8,Wte),e.createElementVNode("rect",{onClick:p[1]||(p[1]=s=>a(9)),class:"sector-field",x:"288.347",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(9)?"#FFFF0030":"#2e3b46"},null,8,Bte),e.createElementVNode("rect",{onClick:p[2]||(p[2]=s=>a(17)),class:"sector-field",x:"0.347042",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(17)?"#FFFF0030":"#2e3b46"},null,8,Kte),e.createElementVNode("rect",{onClick:p[3]||(p[3]=s=>a(25)),class:"sector-field",x:"288.347",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(25)?"#FFFF0030":"#2e3b46"},null,8,Xte),e.createElementVNode("rect",{onClick:p[4]||(p[4]=s=>a(26)),class:"sector-field",x:"0.347042",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(26)?"#FFFF0030":"#2e3b46"},null,8,Gte),e.createElementVNode("rect",{onClick:p[5]||(p[5]=s=>a(27)),class:"sector-field",x:"91.347",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(27)?"#FFFF0030":"#2e3b46"},null,8,Zte),e.createElementVNode("rect",{onClick:p[6]||(p[6]=s=>a(28)),class:"sector-field",x:"157.015",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(28)?"#FFFF0030":"#2e3b46"},null,8,Jte),e.createElementVNode("rect",{onClick:p[7]||(p[7]=s=>a(29)),class:"sector-field",x:"222.679",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(29)?"#FFFF0030":"#2e3b46"},null,8,Hte),e.createElementVNode("rect",{onClick:p[8]||(p[8]=s=>a(30)),class:"sector-field",x:"288.347",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(30)?"#FFFF0030":"#2e3b46"},null,8,Yte),e.createElementVNode("rect",{onClick:p[9]||(p[9]=s=>a(31)),class:"sector-field",x:"0.347042",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(31)?"#FFFF0030":"#2e3b46"},null,8,Qte),e.createElementVNode("rect",{onClick:p[10]||(p[10]=s=>a(32)),class:"sector-field",x:"91.347",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(32)?"#FFFF0030":"#2e3b46"},null,8,$te),e.createElementVNode("rect",{onClick:p[11]||(p[11]=s=>a(33)),class:"sector-field",x:"157.015",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(33)?"#FFFF0030":"#2e3b46"},null,8,tee),e.createElementVNode("rect",{onClick:p[12]||(p[12]=s=>a(34)),class:"sector-field",x:"222.679",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(34)?"#FFFF0030":"#2e3b46"},null,8,eee),e.createElementVNode("rect",{onClick:p[13]||(p[13]=s=>a(35)),class:"sector-field",x:"288.347",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(35)?"#FFFF0030":"#2e3b46"},null,8,ree),e.createElementVNode("rect",{onClick:p[14]||(p[14]=s=>a(2)),class:"sector-field",x:"91.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(2)?"#FFFF0030":"#2e3b46"},null,8,nee),e.createElementVNode("rect",{onClick:p[15]||(p[15]=s=>a(3)),class:"sector-field",x:"114.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(3)?"#FFFF0030":"#2e3b46"},null,8,aee),e.createElementVNode("rect",{onClick:p[16]||(p[16]=s=>a(4)),class:"sector-field",x:"137.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(4)?"#FFFF0030":"#2e3b46"},null,8,iee),e.createElementVNode("rect",{onClick:p[17]||(p[17]=s=>a(5)),class:"sector-field",x:"172.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(5)?"#FFFF0030":"#2e3b46"},null,8,oee),e.createElementVNode("rect",{onClick:p[18]||(p[18]=s=>a(6)),class:"sector-field",x:"207.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(6)?"#FFFF0030":"#2e3b46"},null,8,see),e.createElementVNode("rect",{onClick:p[19]||(p[19]=s=>a(7)),class:"sector-field",x:"242.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(7)?"#FFFF0030":"#2e3b46"},null,8,lee),e.createElementVNode("rect",{onClick:p[20]||(p[20]=s=>a(8)),class:"sector-field",x:"265.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(8)?"#FFFF0030":"#2e3b46"},null,8,cee),e.createElementVNode("rect",{onClick:p[21]||(p[21]=s=>a(10)),class:"sector-field",x:"91.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(10)?"#FFFF0030":"#2e3b46"},null,8,uee),e.createElementVNode("rect",{onClick:p[22]||(p[22]=s=>a(11)),class:"sector-field",x:"114.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(11)?"#FFFF0030":"#2e3b46"},null,8,dee),e.createElementVNode("rect",{onClick:p[23]||(p[23]=s=>a(12)),class:"sector-field",x:"137.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(12)?"#FFFF0030":"#2e3b46"},null,8,pee),e.createElementVNode("rect",{onClick:p[24]||(p[24]=s=>a(13)),class:"sector-field",x:"172.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(13)?"#FFFF0030":"#2e3b46"},null,8,hee),e.createElementVNode("rect",{onClick:p[25]||(p[25]=s=>a(14)),class:"sector-field",x:"207.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(14)?"#FFFF0030":"#2e3b46"},null,8,fee),e.createElementVNode("rect",{onClick:p[26]||(p[26]=s=>a(15)),class:"sector-field",x:"242.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(15)?"#FFFF0030":"#2e3b46"},null,8,mee),e.createElementVNode("rect",{onClick:p[27]||(p[27]=s=>a(16)),class:"sector-field",x:"265.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(16)?"#FFFF0030":"#2e3b46"},null,8,yee),e.createElementVNode("rect",{onClick:p[28]||(p[28]=s=>a(18)),class:"sector-field",x:"91.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(18)?"#FFFF0030":"#2e3b46"},null,8,gee),e.createElementVNode("rect",{onClick:p[29]||(p[29]=s=>a(19)),class:"sector-field",x:"114.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(19)?"#FFFF0030":"#2e3b46"},null,8,vee),e.createElementVNode("rect",{onClick:p[30]||(p[30]=s=>a(20)),class:"sector-field",x:"137.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(20)?"#FFFF0030":"#2e3b46"},null,8,bee),e.createElementVNode("rect",{onClick:p[31]||(p[31]=s=>a(21)),class:"sector-field",x:"172.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(21)?"#FFFF0030":"#2e3b46"},null,8,xee),e.createElementVNode("rect",{onClick:p[32]||(p[32]=s=>a(22)),class:"sector-field",x:"207.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(22)?"#FFFF0030":"#2e3b46"},null,8,_ee),e.createElementVNode("rect",{onClick:p[33]||(p[33]=s=>a(23)),class:"sector-field",x:"242.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(23)?"#FFFF0030":"#2e3b46"},null,8,wee),e.createElementVNode("rect",{onClick:p[34]||(p[34]=s=>a(24)),class:"sector-field",x:"265.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(24)?"#FFFF0030":"#2e3b46"},null,8,Tee),p[40]||(p[40]=e.createElementVNode("rect",{x:"91.6",y:"0.6",width:"196.8",height:"87.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),p[41]||(p[41]=e.createElementVNode("rect",{x:"137.6",y:"0.782404",width:"104.8",height:"28.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),e.createElementVNode("mask",{id:d.value,style:{"mask-type":"alpha"},maskUnits:"userSpaceOnUse",x:"91",y:"88",width:"198",height:"25"},[...p[38]||(p[38]=[e.createElementVNode("rect",{width:"197.746",height:"24.6043",transform:"matrix(1 0 0 -1 91 113)",fill:"#D9D9D9"},null,-1)])],8,See),e.createElementVNode("g",{mask:`url(#${d.value})`},[...p[39]||(p[39]=[e.createElementVNode("circle",{cx:"185.329",cy:"56.5046",r:"52.6152",stroke:"#DFE3E2","stroke-width":"1.38817"},null,-1)])],8,kee),p[42]||(p[42]=e.createElementVNode("circle",{cx:"190.278",cy:"66.2782",r:"2.27817",fill:"white"},null,-1)),p[43]||(p[43]=e.createElementVNode("rect",{x:"0.7",y:"0.7",width:"378.6",height:"175.6",stroke:"#DFE3E2","stroke-width":"1.4"},null,-1))]))])]),e.createElementVNode("div",Lee,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(S,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(T,["stop"])}," Listo ")])]))}},hA=e2(Cee,[["__scopeId","data-v-b0bc264a"]]),Nee={class:"que-sucedio-filter"},Oee={class:"filter-header"},Eee={class:"checkbox-item todos-header"},zee=["checked"],Mee={class:"filter-section"},Vee={class:"checkbox-item main-option"},Pee=["checked"],Aee={class:"sub-options"},Ree={class:"checkbox-item sub-option"},Fee=["checked"],Uee={class:"checkbox-item sub-option"},Iee=["checked"],qee={class:"filter-section"},jee={class:"checkbox-item main-option"},Dee=["checked"],Wee={class:"sub-options"},Bee={class:"checkbox-item sub-option"},Kee=["checked"],Xee={class:"checkbox-item sub-option"},Gee=["checked"],Zee={class:"checkbox-item sub-option"},Jee=["checked"],Hee={class:"filter-actions"},Yee={__name:"QueSucedioFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],f={"rematado-destino-porteria":["fue-gol","no-fue-gol"],"rematado-sin-destino-porteria":["ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"]},u=e.ref([]);e.watch(()=>n.selectedValues,p=>{if(!p||!Array.isArray(p))return;const s=p[n.filterIndex];if(s&&typeof s=="object"&&!Array.isArray(s)&&s[n.optionIndex]!==void 0){const c=Array.isArray(s[n.optionIndex])?s[n.optionIndex]:[];if(c.length>0){const o=JSON.stringify(u.value.sort()),h=JSON.stringify(c.sort());o!==h&&(u.value=[...c])}}},{immediate:!0,deep:!0}),e.onMounted(()=>{e.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const p=n.selectedValues[n.filterIndex];if(p&&typeof p=="object"&&!Array.isArray(p)&&p[n.optionIndex]!==void 0){const s=Array.isArray(p[n.optionIndex])?p[n.optionIndex]:[];if(s.length>0){u.value=[...s];return}}}u.value.length===0&&(u.value=[...$])})});const i=e.computed(()=>$.every(p=>u.value.includes(p))),d=p=>u.value.includes(p),l=p=>{p.target.checked?u.value=[...$]:u.value=[],y("update-selection",{optionIndex:n.optionIndex,values:[...u.value]})},a=(p,s)=>{let c=[...u.value];const o=f[p]||[];s?(c.includes(p)||c.push(p),o.forEach(h=>{c.includes(h)||c.push(h)})):c=c.filter(h=>h!==p&&!o.includes(h)),u.value=c,y("update-selection",{optionIndex:n.optionIndex,values:c})},S=(p,s)=>{let c=[...u.value];const o=Object.keys(f).find(h=>f[h].includes(p));s?(c.includes(p)||c.push(p),o&&f[o].every(h=>c.includes(h))&&!c.includes(o)&&c.push(o)):(c=c.filter(h=>h!==p),o&&c.includes(o)&&(c=c.filter(h=>h!==o))),u.value=c,y("update-selection",{optionIndex:n.optionIndex,values:c})},T=()=>{u.value=[...$],y("update-selection",{optionIndex:n.optionIndex,values:[...$]})},b=()=>{y("done")};return(p,s)=>(e.openBlock(),e.createElementBlock("div",Nee,[e.createElementVNode("div",Oee,[e.createElementVNode("label",Eee,[s[7]||(s[7]=e.createElementVNode("span",{class:"checkbox-label"},"Todos",-1)),e.createElementVNode("input",{type:"checkbox",checked:i.value,onChange:e.withModifiers(l,["stop"])},null,40,zee)])]),s[15]||(s[15]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("div",Mee,[e.createElementVNode("label",Vee,[e.createElementVNode("input",{type:"checkbox",checked:d("rematado-destino-porteria"),onChange:s[0]||(s[0]=e.withModifiers(c=>a("rematado-destino-porteria",c.target.checked),["stop"]))},null,40,Pee),s[8]||(s[8]=e.createElementVNode("span",{class:"checkbox-label"},"Rematado con destino a portería",-1))]),e.createElementVNode("div",Aee,[e.createElementVNode("label",Ree,[e.createElementVNode("input",{type:"checkbox",checked:d("fue-gol"),onChange:s[1]||(s[1]=e.withModifiers(c=>S("fue-gol",c.target.checked),["stop"]))},null,40,Fee),s[9]||(s[9]=e.createElementVNode("span",{class:"checkbox-label"},"Fue gol",-1))]),e.createElementVNode("label",Uee,[e.createElementVNode("input",{type:"checkbox",checked:d("no-fue-gol"),onChange:s[2]||(s[2]=e.withModifiers(c=>S("no-fue-gol",c.target.checked),["stop"]))},null,40,Iee),s[10]||(s[10]=e.createElementVNode("span",{class:"checkbox-label"},"No fue gol",-1))])])]),s[16]||(s[16]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("div",qee,[e.createElementVNode("label",jee,[e.createElementVNode("input",{type:"checkbox",checked:d("rematado-sin-destino-porteria"),onChange:s[3]||(s[3]=e.withModifiers(c=>a("rematado-sin-destino-porteria",c.target.checked),["stop"]))},null,40,Dee),s[11]||(s[11]=e.createElementVNode("span",{class:"checkbox-label"},"Rematado sin destino a portería",-1))]),e.createElementVNode("div",Wee,[e.createElementVNode("label",Bee,[e.createElementVNode("input",{type:"checkbox",checked:d("ganados-por-portero-rival"),onChange:s[4]||(s[4]=e.withModifiers(c=>S("ganados-por-portero-rival",c.target.checked),["stop"]))},null,40,Kee),s[12]||(s[12]=e.createElementVNode("span",{class:"checkbox-label"},"Ganados por portero rival",-1))]),e.createElementVNode("label",Xee,[e.createElementVNode("input",{type:"checkbox",checked:d("ganados-por-jugador-rival"),onChange:s[5]||(s[5]=e.withModifiers(c=>S("ganados-por-jugador-rival",c.target.checked),["stop"]))},null,40,Gee),s[13]||(s[13]=e.createElementVNode("span",{class:"checkbox-label"},"Ganados por jugador rival",-1))]),e.createElementVNode("label",Zee,[e.createElementVNode("input",{type:"checkbox",checked:d("sin-destino"),onChange:s[6]||(s[6]=e.withModifiers(c=>S("sin-destino",c.target.checked),["stop"]))},null,40,Jee),s[14]||(s[14]=e.createElementVNode("span",{class:"checkbox-label"},"Sin destino",-1))])])]),e.createElementVNode("div",Hee,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(T,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(b,["stop"])}," Listo ")])]))}},u9=e2(Yee,[["__scopeId","data-v-e3994cc8"]]),Qee={class:"advanced-select-accordion"},$ee=["onClick"],tre={class:"accordion-header-left"},ere={class:"accordion-icon"},rre=["src","alt"],nre={class:"accordion-title"},are={class:"accordion-header-right"},ire={key:0,class:"accordion-badge"},ore={key:0,class:"accordion-content"},sre={class:"accordion-footer"},lre={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(t,{emit:r}){const n=t;e.watch(()=>n.selectedValues,b=>{console.log("Acorden inicla 55555555555v [AdvancedSelectAccordion] selectedValues recibidos:",{filterIndex:n.filterIndex,selectedValues:b,filterValue:b==null?void 0:b[n.filterIndex],filterValueType:typeof(b==null?void 0:b[n.filterIndex]),isArray:Array.isArray(b==null?void 0:b[n.filterIndex]),filterValueKeys:b!=null&&b[n.filterIndex]&&typeof(b==null?void 0:b[n.filterIndex])=="object"?Object.keys(b[n.filterIndex]):null})},{immediate:!0,deep:!0});const y=r,$=e.ref({}),f=b=>{$.value[b]?$.value[b]=!1:(Object.keys($.value).forEach(p=>{$.value[p]=!1}),$.value[b]=!0)},u=b=>{const p=n.filter.options[b];if(!p||!p.filters)return 0;const s=n.selectedValues[n.filterIndex];if(!s||!s[b])return 0;const c=s[b];return Array.isArray(c)?c.length:0},i=(b,p)=>b.icon?b.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${p+1}.png`,d=b=>b==="Qué sucedió?"||b==="Qué sucedió"?"¿Qué sucedió?":b,l=b=>{const p={resultados:kO,detalles:pA,"como-fue-cobrado":LO,"como fue cobrado":LO,zona:hA,"que-sucedio":u9,"qué sucedió":u9,"que sucedio":u9},s=typeof b.value=="string"?b.value:String(b.value||""),c=typeof b.label=="string"?b.label:String(b.label||""),o=s.toLowerCase().trim(),h=c.toLowerCase().trim();if(o&&p[o])return p[o];if(h&&p[h])return p[h];const v=h.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,k=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[k]||k);return v&&p[v]?p[v]:kO},a=b=>{y("update-selection",{filterIndex:n.filterIndex,optionIndex:b.optionIndex,values:b.values})},S=b=>{$.value[b]=!1},T=()=>{y("close")};return(b,p)=>(e.openBlock(),e.createElementBlock("div",Qee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filter.options,(s,c)=>(e.openBlock(),e.createElementBlock("div",{key:s.value||c,class:"accordion-item"},[e.createElementVNode("div",{class:"accordion-header",onClick:e.withModifiers(o=>f(c),["stop"])},[e.createElementVNode("div",tre,[e.createElementVNode("span",ere,[e.createElementVNode("img",{src:i(s,c),alt:s.label},null,8,rre)]),e.createElementVNode("span",nre,e.toDisplayString(d(s.label)),1)]),e.createElementVNode("div",are,[u(c)>0?(e.openBlock(),e.createElementBlock("span",ire,e.toDisplayString(u(c)),1)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["accordion-chevron",{open:$.value[c]}])},[...p[0]||(p[0]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,$ee),e.createVNode(e.Transition,{name:"accordion"},{default:e.withCtx(()=>[$.value[c]?(e.openBlock(),e.createElementBlock("div",ore,[l(s)===kO?(e.openBlock(),e.createBlock(kO,{key:0,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(s)===pA?(e.openBlock(),e.createBlock(pA,{key:1,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(s)===LO?(e.openBlock(),e.createBlock(LO,{key:2,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(s)===hA?(e.openBlock(),e.createBlock(hA,{key:3,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(s)===u9?(e.openBlock(),e.createBlock(u9,{key:4,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:2},1024)]))),128)),e.createElementVNode("div",sre,[p[1]||(p[1]=e.createElementVNode("div",{class:"footer-separator"},null,-1)),e.createElementVNode("button",{class:"btn-done-footer",onClick:e.withModifiers(T,["stop"])}," Listo ")])]))}},cre=e2(lre,[["__scopeId","data-v-92b4e8ad"]]),ure={class:"corners-zone-filters"},dre={key:0,class:"custom-radio-group"},pre={class:"radio-label"},hre={class:"radio-options"},fre=["name","value","onUpdate:modelValue"],mre={key:0,class:"filter-separator"},yre={class:"filter-inline select-with-label"},gre=["data-filter-type","onClick"],vre={class:"select-display"},bre={class:"select-label"},xre={key:0,class:"dropdown-menu type-menu simple-select-menu"},_re={class:"simple-select-scroll-area"},wre=["onClick"],Tre={class:"option-content"},Sre={class:"option-title"},kre={key:0,class:"option-checkmark"},Lre={class:"switch-group"},Cre={class:"switch-label"},Nre=["onClick"],Ore={key:0,class:"filter-separator"},Ere={key:3,class:"filter-inline advanced-select-wrapper"},zre=["data-filter-type","onClick"],Mre={class:"select-display"},Vre={class:"select-label"},Pre={__name:"CornersZoneFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:17},viewConfig:{type:Object,default:()=>({})},defaultFilters:{type:Object,default:()=>null}},emits:["filters-changed","filter-updated","change","remove-views"],setup(t,{expose:r,emit:n}){const y=t,$=n,f=e.ref([]);let u=null;const i=e.ref(null),d=e.ref(null),l=e.ref([]);let a=!1,S=null;const T=(I,j)=>{if(Array.isArray(I)&&Array.isArray(j)){if(I.length!==j.length)return!1;for(let F=0;F<I.length;F++)if(I[F]!==j[F])return!1;return!0}return I===j},b=(I,j=!0)=>{if(y.filters&&y.filters[0]&&y.filters[1]){const F=y.filters[0],D=y.filters[1],U=F.options,M=D.options;U&&Array.isArray(U)&&M?I!=null?U.findIndex(X=>X.value===I)!==-1&&M[I]?(l.value=M[I],j&&!(()=>{const X=f.value[1];return X==null?!1:Array.isArray(X)?X.length>0:X!==""})()&&!a&&l.value.length>0&&(f.value[1]=l.value[0].value,e.nextTick(()=>{}))):(l.value=[],f.value[1]=null):(l.value=[],f.value[1]=null):l.value=[]}},p=()=>{y.initialValues&&y.initialValues.length>0?y.initialValues.length>0&&(typeof y.initialValues[0]=="number"||typeof y.initialValues[0]=="boolean"||y.initialValues[0]===null||Array.isArray(y.initialValues[0]))?f.value=y.filters.map((F,D)=>{var U,M,X,O;const Y=y.initialValues[D];if(Y!=null)return F.type==="switch"&&y.filters.findIndex(st=>st.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor desde initialValues en índice ${D} (formato simple):`,Y),Y;if(F.type==="radio-button")return((M=(U=F.options)==null?void 0:U[0])==null?void 0:M.value)||null;if(F.type==="advanced-select"){const st={};let mt=!1;return F.options&&Array.isArray(F.options)&&F.options.forEach((yt,bt)=>{var xt,Pt,qt,_t,It,jt,Rt;yt.value==="zona"||(xt=yt.label)!=null&&xt.toLowerCase().includes("zona")?(st[bt]=Array.from({length:35},(Wt,re)=>re+1),mt=!0):yt.value==="resultados"||(Pt=yt.label)!=null&&Pt.toLowerCase().includes("resultados")?(st[bt]=["iba-ganando","iba-perdiendo","iba-empatado"],mt=!0):yt.value==="que-sucedio"||yt.value==="que sucedio"||(qt=yt.label)!=null&&qt.toLowerCase().includes("qué sucedió")||(_t=yt.label)!=null&&_t.toLowerCase().includes("que sucedio")?(st[bt]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],mt=!0):yt.value==="detalles"||(It=yt.label)!=null&&It.toLowerCase().includes("detalles")?(st[bt]=["0-15","16-30","31-45","46-60","61-75","76-90"],mt=!0):(yt.value==="como-fue-cobrado"||yt.value==="como fue cobrado"||(jt=yt.label)!=null&&jt.toLowerCase().includes("cómo fue cobrado")||(Rt=yt.label)!=null&&Rt.toLowerCase().includes("como fue cobrado"))&&(st[bt]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],mt=!0)}),mt?st:{}}return F.type==="select"?[]:F.type==="check"?!1:F.type==="switch"?(y.filters.findIndex(st=>st.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (formato simple):`,!1),!1):F.type==="select-simple"&&((O=(X=F.options)==null?void 0:X[0])==null?void 0:O.value)||null}):y.isEditMode?f.value=y.filters.map((F,D)=>{var U,M,X,O,Y,st,mt,yt,bt,xt;const Pt=y.initialValues[D];if(D===3&&console.log(`[CornersZoneFilters] Procesando filtro en índice ${D} (FILTRO AVANZADO):`,{filterType:F.type,filterData:Pt,hasFilterData:!!Pt,filterDataKeys:Pt?Object.keys(Pt):null,selectedValue:Pt==null?void 0:Pt.selectedValue,selectedValueType:typeof(Pt==null?void 0:Pt.selectedValue),isDirectObject:Pt&&typeof Pt=="object"&&!Array.isArray(Pt)&&!Pt.selectedValue&&!Pt.selectedOption&&!Pt.isChecked}),!Pt)return F.type==="select"?[]:F.type==="check"?!1:F.type==="switch"?(y.filters.findIndex(qt=>qt.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (modo edición):`,!1),!1):F.type==="radio-button"?((M=(U=F.options)==null?void 0:U[0])==null?void 0:M.value)||null:F.type==="select-simple"?((O=(X=F.options)==null?void 0:X[0])==null?void 0:O.value)||null:F.type==="advanced-select"?{}:null;if(F.type==="advanced-select"){if(console.log(`[CornersZoneFilters] Modo edición - Filtro avanzado en índice ${D}:`,{filterIndex:D,filterType:F.type,filterData:Pt,selectedValue:Pt==null?void 0:Pt.selectedValue,selectedValueType:typeof(Pt==null?void 0:Pt.selectedValue),isArray:Array.isArray(Pt==null?void 0:Pt.selectedValue),isDirectObject:typeof Pt=="object"&&!Array.isArray(Pt)&&!Pt.selectedValue&&!Pt.selectedOption&&!Pt.isChecked}),Pt.selectedValue!==void 0&&Pt.selectedValue!==null){if(typeof Pt.selectedValue=="object"&&!Array.isArray(Pt.selectedValue)){const qt=Object.keys(Pt.selectedValue).some(_t=>{const It=Number(_t);return!isNaN(It)&&It>=0});return console.log(`[CornersZoneFilters] Filtro avanzado ${D} - hasCorrectStructure:`,qt,"selectedValue:",Pt.selectedValue),qt&&console.log(`[CornersZoneFilters] Filtro avanzado ${D} - Retornando selectedValue directamente:`,Pt.selectedValue),Pt.selectedValue}else if(Array.isArray(Pt.selectedValue)){const qt={};return Pt.selectedValue.forEach((_t,It)=>{qt[It]=_t}),qt}}return typeof Pt=="object"&&!Array.isArray(Pt)&&!Pt.selectedValue&&!Pt.selectedOption&&!Pt.isChecked&&Pt!==null&&Object.keys(Pt).some(qt=>{const _t=Number(qt);return!isNaN(_t)&&_t>=0})?(console.log(`[CornersZoneFilters] Filtro avanzado ${D} - filterData es objeto directo guardado, retornando:`,Pt),Pt):(console.log(`[CornersZoneFilters] Filtro avanzado ${D} - No hay valores guardados, retornando objeto vacío`),{})}return F.type==="radio-button"&&Pt.selectedOption?Pt.selectedOption.value:F.type==="radio-button"&&!Pt.selectedOption?Pt.selectedValue!==void 0?Pt.selectedValue:((st=(Y=F.options)==null?void 0:Y[0])==null?void 0:st.value)||null:F.type==="select-simple"&&Pt.selectedValue!==void 0?Array.isArray(Pt.selectedValue)?Pt.selectedValue[0]:Pt.selectedValue:F.type==="select"&&Pt.selectedOptions?Pt.selectedOptions.map(qt=>qt.value):F.type==="check"&&Pt.isChecked!==void 0?Pt.isChecked:F.type==="switch"&&(Pt.isChecked!==void 0||Pt.selectedValue!==void 0)?Pt.isChecked!==void 0?Pt.isChecked:Pt.selectedValue:Pt.selectedValue!==void 0?Pt.selectedValue:F.type==="select"?[]:F.type==="check"||F.type==="switch"?!1:F.type==="radio-button"?((yt=(mt=F.options)==null?void 0:mt[0])==null?void 0:yt.value)||null:F.type==="select-simple"?((xt=(bt=F.options)==null?void 0:bt[0])==null?void 0:xt.value)||null:F.type==="advanced-select"?{}:null}):f.value=y.filters.map((F,D)=>{var U,M,X,O;const Y=y.initialValues[D];if(Y!=null)return Y;if(F.type==="radio-button")return((M=(U=F.options)==null?void 0:U[0])==null?void 0:M.value)||null;if(F.type==="advanced-select"){const st={};let mt=!1;return F.options&&Array.isArray(F.options)&&F.options.forEach((yt,bt)=>{var xt,Pt,qt,_t,It,jt,Rt;yt.value==="zona"||(xt=yt.label)!=null&&xt.toLowerCase().includes("zona")?(st[bt]=Array.from({length:35},(Wt,re)=>re+1),mt=!0):yt.value==="resultados"||(Pt=yt.label)!=null&&Pt.toLowerCase().includes("resultados")?(st[bt]=["iba-ganando","iba-perdiendo","iba-empatado"],mt=!0):yt.value==="que-sucedio"||yt.value==="que sucedio"||(qt=yt.label)!=null&&qt.toLowerCase().includes("qué sucedió")||(_t=yt.label)!=null&&_t.toLowerCase().includes("que sucedio")?(st[bt]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],mt=!0):yt.value==="detalles"||(It=yt.label)!=null&&It.toLowerCase().includes("detalles")?(st[bt]=["0-15","16-30","31-45","46-60","61-75","76-90"],mt=!0):(yt.value==="como-fue-cobrado"||yt.value==="como fue cobrado"||(jt=yt.label)!=null&&jt.toLowerCase().includes("cómo fue cobrado")||(Rt=yt.label)!=null&&Rt.toLowerCase().includes("como fue cobrado"))&&(st[bt]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],mt=!0)}),mt?st:{}}return F.type==="select"?[]:F.type==="check"?!1:F.type==="switch"?(y.filters.findIndex(st=>st.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (modo agregar):`,!1),!1):F.type==="select-simple"&&((O=(X=F.options)==null?void 0:X[0])==null?void 0:O.value)||null}):f.value=y.filters.map((F,D)=>{var U,M,X,O;return F.type==="select"?[]:F.type==="check"?!1:F.type==="switch"?(y.filters.findIndex(Y=>Y.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (sin initialValues):`,!1),!1):F.type==="radio-button"?((M=(U=F.options)==null?void 0:U[0])==null?void 0:M.value)||null:F.type==="select-simple"?((O=(X=F.options)==null?void 0:X[0])==null?void 0:O.value)||null:F.type==="advanced-select"?{}:null});const I=f.value.some(F=>F!=null&&(Array.isArray(F)?F.length>0:typeof F=="object"&&!Array.isArray(F)?Object.keys(F).length>0:F!==!1&&F!=="")),j=y.filters.map((F,D)=>({index:D,type:F.type,label:F.label||F.label_1||F.label_2||`Filtro ${D}`,value:f.value[D]}));console.log("??????????????????????????????????? ---- ???????????????????????????????????"),console.log("Valores de filtros seteados:",j),console.log("selectedValues:",f.value),console.log("props.filters:",y.filters),console.log("??????????????????????????????????? ---- ???????????????????????????????????"),I&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))};p(),setTimeout(()=>{e.nextTick(()=>{if(f.value[0]!==null&&f.value[0]!==void 0&&!a){const I=!(()=>{const j=f.value[1];return j==null?!1:Array.isArray(j)?j.length>0:j!==""})();b(f.value[0],I),e.nextTick(()=>{f.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(!u||f.value.length!==u.length||f.value.some((j,F)=>!T(j,u[F])))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))})}else setTimeout(()=>{f.value.some(I=>I!=null&&(Array.isArray(I)?I.length>0:typeof I=="object"&&!Array.isArray(I)?Object.keys(I).length>0:I!==!1&&I!==""))&&(!u||f.value.length!==u.length||f.value.some((I,j)=>!T(I,u[j])))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))},100)})},300),e.watch(()=>y.initialValues,I=>{if(!I||I.length===0)return;const j=I.length>0&&(typeof I[0]=="number"||typeof I[0]=="boolean"||I[0]===null||Array.isArray(I[0])),F=!T(f.value,I),D=I&&I.length>0&&!a&&F,U=y.isEditMode&&a;if(D&&!U)if(j){const M=y.filters.findIndex(X=>X.type==="switch");M!==-1&&I[M]!==void 0&&console.log(`[Primer Switch] Se setea valor desde watcher initialValues (formato simple) en índice ${M}:`,I[M]),f.value=[...I]}else y.isEditMode?f.value=y.filters.map((M,X)=>{const O=I[X];return O?M.type==="radio-button"&&O.selectedOption?O.selectedOption.value:M.type==="select-simple"&&O.selectedValue!==void 0?Array.isArray(O.selectedValue)?O.selectedValue[0]:O.selectedValue:M.type==="select"&&O.selectedOptions?O.selectedOptions.map(Y=>Y.value):M.type==="check"&&O.isChecked!==void 0?O.isChecked:M.type==="switch"&&O.isChecked!==void 0?(y.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde isChecked en índice ${X} (modo edición):`,O.isChecked),O.isChecked):M.type==="switch"&&O.selectedValue!==void 0?(y.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde selectedValue en índice ${X} (modo edición):`,O.selectedValue),O.selectedValue):M.type==="advanced-select"&&O.selectedValue!==void 0||O.selectedValue!==void 0?O.selectedValue:f.value[X]:f.value[X]}):f.value=[...I];else a?S&&S.length>0&&(f.value=[...S]):U&&S&&S.length>0&&(f.value=[...S])},{deep:!0}),e.watch(()=>y.isEditMode,(I,j)=>{j===!0&&I===!1&&(S=null)},{immediate:!0}),e.watch(f,I=>{if(I.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))){const j=[...I];if(u){for(;j.length<u.length;)j.push(void 0);for(let F=0;F<u.length;F++)u[F]!==void 0&&u[F]!==null&&(j[F]===void 0||j[F]===null)&&(j[F]=u[F])}if((()=>{if(!u||j.length!==u.length)return!0;for(let F=0;F<j.length;F++)if(!T(j[F],u[F]))return!0;return!1})()){u=[...j];const F=y.filters.map((D,U)=>({index:U,type:D.type,label:D.label||D.label_1||D.label_2||`Filtro ${U}`,value:j[U]}));console.log("Valores de filtros actualizados:",F),$("filters-changed",{componentId:y.componentId,filters:j,timestamp:new Date().toISOString()})}}},{deep:!0}),e.watch(()=>f.value[0],(I,j)=>{var F;if(I==null){const U=y.filters[0];if(U&&U.type==="radio-button"&&U.options&&U.options.length>0){const M=U.options[0].value;f.value[0]=M;return}}const D=(F=y.filters)==null?void 0:F[0];D&&D.type==="select-simple"&&(I!==j&&j!==void 0?b(I,!0):j===void 0&&I!==null&&I!==void 0&&b(I,!1))},{immediate:!0});const s=I=>{i.value===I?i.value=null:(i.value=I,d.value=null)},c=I=>{d.value===I?d.value=null:(d.value=I,i.value=null)},o=(I,j)=>{if(a=!0,setTimeout(()=>{a=!1},1e3),f.value[I]=j,(I===0||I===1)&&(S=[...f.value]),i.value=null,I===0){f.value[1]!==void 0&&(f.value[1]=null);const F=a;a=!1,b(j,!0),a=F,f.value[1]!==null&&f.value[1]!==void 0&&(S=[...f.value])}},h=()=>{a=!0,setTimeout(()=>{a=!1},400)},v=I=>{a=!0,setTimeout(()=>{a=!1},400);const j=f.value[I],F=!j;f.value[I]=F,y.filters.findIndex(D=>D.type==="switch")===I&&console.log(`[Primer Switch] Se setea valor en índice ${I} desde toggleSwitch:`,F,"(valor anterior:",j,")")},k=I=>{a=!0,setTimeout(()=>{a=!1},400),f.value[I.filterIndex]||(f.value[I.filterIndex]={}),f.value[I.filterIndex]={...f.value[I.filterIndex],[I.optionIndex]:I.values},e.nextTick(()=>{f.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))})},L=()=>f.value,E=(I,j)=>{const F=f.value[j];if(F==null)return null;if(j===1&&l.value.length>0){const D=l.value.find(U=>U.value===F);return D?D.label:null}if(I.options&&Array.isArray(I.options)){const D=I.options.find(U=>U.value===F);return D?D.label:null}return null},P=(I,j)=>{const F=f.value[j];if(!F||typeof F!="object"||Array.isArray(F))return null;const D=Object.values(F).reduce((U,M)=>Array.isArray(M)&&M.length>0?U+M.length:U,0);return D>0?`${D} seleccionado${D>1?"s":""}`:null},V=I=>{const j=I.target,F=j.closest(".advanced-select-dropdown"),D=j.closest(".advanced-select-menu"),U=j.closest(".advanced-select-accordion"),M=j.closest(".advanced-select-content"),X=j.closest(".custom-select.dynamic-select"),O=j.closest(".simple-select-menu");!(F||D||U||M)&&!(X||O)&&(d.value=null,i.value=null)};return e.onMounted(()=>{document.addEventListener("click",V)}),e.onUnmounted(()=>{document.removeEventListener("click",V)}),r({getCurrentValues:L,initializeValues:p}),(I,j)=>(e.openBlock(),e.createElementBlock("div",ure,[t.filters&&t.filters.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":t.filters.length>=2}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filters,(F,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:D},[F.type==="radio-button"?(e.openBlock(),e.createElementBlock("div",dre,[e.createElementVNode("div",pre,e.toDisplayString(F.label),1),e.createElementVNode("div",hre,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.options,U=>(e.openBlock(),e.createElementBlock("label",{key:U.value,class:e.normalizeClass(["radio-option-card",{active:f.value[D]===U.value}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+D,value:U.value,"onUpdate:modelValue":M=>f.value[D]=M,onChange:h},null,40,fre),[[e.vModelRadio,f.value[D]]]),e.createElementVNode("span",null,e.toDisplayString(U.label),1)],2))),128))])])):F.type==="select-simple"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[D==2?(e.openBlock(),e.createElementBlock("div",mre)):e.createCommentVNode("",!0),e.createElementVNode("div",yre,[e.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":F.type,onClick:e.withModifiers(U=>s(D),["stop"])},[e.createElementVNode("div",vre,[j[3]||(j[3]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.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)),e.createElementVNode("span",bre,e.toDisplayString(E(F,D)||F.label_2||F.label||"Tipo de análisis"),1),e.createElementVNode("span",{class:e.normalizeClass(["arrow",{open:i.value===D}])},[...j[2]||(j[2]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===D?(e.openBlock(),e.createElementBlock("div",xre,[e.createElementVNode("div",_re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D===1?l.value:F.options,U=>(e.openBlock(),e.createElementBlock("div",{key:U.value,class:e.normalizeClass(["option-card simple-select-option",{active:T(f.value[D],U.value)}]),onClick:e.withModifiers(M=>o(D,U.value),["stop"])},[e.createElementVNode("div",Tre,[e.createElementVNode("div",Sre,e.toDisplayString(U.label),1)]),T(f.value[D],U.value)?(e.openBlock(),e.createElementBlock("div",kre,[...j[4]||(j[4]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[e.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):e.createCommentVNode("",!0)],10,wre))),128))])])):e.createCommentVNode("",!0)],8,gre)])],64)):F.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Lre,[e.createElementVNode("label",Cre,[F.label_1?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["switch-text switch-text-left",{"switch-text-selected":!f.value[D]}])},e.toDisplayString(F.label_1),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"switch",onClick:U=>v(D)},[e.createElementVNode("div",{class:e.normalizeClass(["switch-track",{"switch-on":f.value[D]}])},[e.createElementVNode("div",{class:e.normalizeClass(["switch-thumb",{on:f.value[D]}])},null,2)],2)],8,Nre),F.label_2?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["switch-text switch-text-right",{"switch-text-selected":f.value[D]}])},e.toDisplayString(F.label_2),3)):e.createCommentVNode("",!0)])]),D>=0?(e.openBlock(),e.createElementBlock("div",Ore)):e.createCommentVNode("",!0)],64)):F.type==="advanced-select"?(e.openBlock(),e.createElementBlock("div",Ere,[e.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":F.type,onClick:e.withModifiers(U=>c(D),["stop"])},[e.createElementVNode("div",Mre,[j[6]||(j[6]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.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)),e.createElementVNode("span",Vre,e.toDisplayString(P(F,D)||F.label||"Seleccionar"),1),e.createElementVNode("span",{class:e.normalizeClass(["arrow",{open:d.value===D}])},[...j[5]||(j[5]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),d.value===D?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dropdown-menu type-menu advanced-select-menu",onClick:j[1]||(j[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"advanced-select-content",onClick:j[0]||(j[0]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(cre,{filter:F,"filter-index":D,"selected-values":f.value,onUpdateSelection:k,onClose:U=>c(D)},null,8,["filter","filter-index","selected-values","onClose"])])])):e.createCommentVNode("",!0)],8,zre)])):e.createCommentVNode("",!0)],64))),128))],2)):e.createCommentVNode("",!0)]))}},Are=e2(Pre,[["__scopeId","data-v-32afcda4"]]),Rre={class:"floating-bar"},Fre={class:"tab active"},Ure={class:"select-display"},Ire={class:"select-icon"},qre=["src"],jre={key:1,alt:"icono",class:"option-img-default",src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png"},Dre={key:0,class:"select-placeholder select-label"},Wre={key:1,class:"select-label"},Bre={key:0,class:"dropdown-menu field-menu"},Kre=["onClick"],Xre={class:"option-icon"},Gre=["data-hover-src","src"],Zre={class:"option-content"},Jre={class:"option-title"},Hre={key:0,class:"option-description"},Yre={class:"select-display"},Qre={class:"select-icon"},$re=["src"],tne=["src"],ene={class:"select-label"},rne={key:0,class:"dropdown-menu type-menu type-menu-grid"},nne={class:"option-grid"},ane=["onClick"],ine={key:0,class:"option-grid-title"},one={key:1,class:"option-grid-title"},sne={key:2,class:"option-grid-title"},lne={class:"option-grid-icon"},cne=["src"],une={key:1,class:"filter-separator"},dne=["onClick"],pne={class:"select-display"},hne={key:0,class:"badge-categorias"},fne={key:0,class:"dropdown-menu type-menu multi-select-menu"},mne={class:"multi-select-scroll-area"},yne={class:"select-all-checkbox"},gne=["checked","indeterminate","onChange"],vne={class:"option-checkbox"},bne=["checked","onChange"],xne=["onClick"],_ne={class:"option-title"},wne={class:"multi-select-footer"},Tne={key:1,class:"custom-radio-group filter-inline"},Sne={class:"radio-label"},kne={class:"radio-options"},Lne=["onUpdate:modelValue","disabled","name","value","onChange"],Cne={key:2,class:"check-group filter-inline"},Nne=["onUpdate:modelValue","checked"],One=["data-filter-type","onClick"],Ene={class:"select-display"},zne={key:0,class:"dropdown-menu type-menu simple-select-menu"},Mne={class:"simple-select-scroll-area"},Vne=["onMouseenter","onClick"],Pne={class:"option-content"},Ane={class:"option-title"},Rne={key:0,class:"option-checkmark"},Fne={key:4,class:"filter-separator"},Une=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(t,{expose:r,emit:n}){const y=t,$=n,f=e.ref(new Map),u=e.ref([]);let i=null,d=null,l=null;const a=e.ref(!1),S=e.ref(!1),T=e.ref(!1),b=e.ref(!1),p=e.ref(!1),s=e.ref(!1),c=e.computed(()=>u.value),o=e.ref(null),h=e.computed(()=>c.value[o.value]||null),v=e.computed(()=>{var Ge;const Je=((Ge=h.value)==null?void 0:Ge.views)||[];return U(Je)}),k=e.ref(null),L=e.computed(()=>v.value.find(Ge=>Ge.id===k.value)||null),E=e.ref([]),P=e.computed(()=>{var Ge,Je;return a.value?((Ge=L.value)==null?void 0:Ge.filters_edition_mode)||[]:((Je=L.value)==null?void 0:Je.filters)||[]});e.watch(a,Ge=>{Ge||(S.value=!1)}),e.watch(L,Ge=>{var Je,hr;if(!Ge){E.value=[];return}const Nr=Ge.id===6&&y.isPostMatch,Ir=Ge.id===14;if(!Array.isArray(P.value)&&!Nr&&!Ir){E.value=[];return}b.value||(Nr||Ir?E.value=[]:E.value=P.value.map((ln,Nn)=>{var En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn,An,ya,va,jr,wr,Wn,ha,ra;if(ln.type==="select"){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn){if(jn.selectedOptions&&Array.isArray(jn.selectedOptions))return jn.selectedOptions.map(qa=>qa.value);if(jn.selectedValue&&Array.isArray(jn.selectedValue))return jn.selectedValue.length>0&&jn.selectedValue[0]&&typeof jn.selectedValue[0]=="object"?Ye(jn.selectedValue):jn.selectedValue}}return Ge.id===4&&ln.options&&Array.isArray(ln.options)?ln.options.map(jn=>jn.value):[]}else if(ln.type==="radio-button"){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn&&jn.selectedOption){let qa=jn.selectedOption.value;if(Ge.id===15&&Nn===0&&qa===3&&((Gn=(En=d==null?void 0:d.view)==null?void 0:En.filterMultiple)==null?void 0:Gn.isHomeTeam)!==void 0){const Oa=d.view.filterMultiple.isHomeTeam;typeof Oa=="boolean"?qa=Oa?1:2:typeof Oa=="number"&&(qa=Oa===1?1:2)}if(Ge.id===8&&qa===3&&((ka=($n=d==null?void 0:d.view)==null?void 0:$n.filterMultiple)==null?void 0:ka.isHomeTeam)!==void 0){const Oa=d.view.filterMultiple.isHomeTeam;qa=(typeof Oa=="boolean"?Oa:Oa===1)?1:2}return qa}}if(Ge.id===7&&a.value&&d!=null&&d.view){if(Nn===0&&(Hr=d.view.componentProps)!=null&&Hr.analysisType)return d.view.componentProps.analysisType==="offensive"?1:2;if(Nn===1&&((Rr=d.view.filterMultiple)==null?void 0:Rr.isHomeTeam)!==void 0)return d.view.filterMultiple.isHomeTeam?1:2}return((Mn=(dn=ln.options)==null?void 0:dn[0])==null?void 0:Mn.value)??null}else if(ln.type==="select-simple"){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn&&jn.selectedValue!==void 0){let qa;return Ge.id===2&&(Un=(da=d==null?void 0:d.view)==null?void 0:da.filterMultiple)!=null&&Un.categoryId?qa=d.view.filterMultiple.categoryId:Ge.id===1&&(sn=(Xr=d==null?void 0:d.view)==null?void 0:Xr.filterMultiple)!=null&&sn.category?qa=d.view.filterMultiple.category:Ge.id===6&&(pn=(Sr=d==null?void 0:d.view)==null?void 0:Sr.filterMultiple)!=null&&pn.gameNumber?qa=d.view.filterMultiple.gameNumber:qa=Array.isArray(jn.selectedValue)?jn.selectedValue[0]:jn.selectedValue,qa}}if(Ge.id===2&&a.value&&d!=null&&d.view){if(i&&d.view.id){const jn=i.getComponentDynamicFilters(d.view.id);if(jn&&jn[Nn]!==void 0)return jn[Nn]}if(d.view.filterMultiple){if(ln.type==="select-simple"&&d.view.filterMultiple.categoryId){const jn=d.view.filterMultiple.categoryId;return(ln.options||[]).find(qa=>qa.value==jn),jn}if(ln.type==="radio-button"&&d.view.filterMultiple.teamType!==void 0){const jn=d.view.filterMultiple.teamType;return(ln.options||[]).find(qa=>qa.value==jn),jn}}}if(Ge.id===1&&a.value&&(Hn=d==null?void 0:d.view)!=null&&Hn.filterMultiple&&d.view.filterMultiple.category){const jn=d.view.filterMultiple.category;return(ln.options||[]).find(qa=>qa.value==jn),jn}if(Ge.id===9&&a.value&&(An=d==null?void 0:d.view)!=null&&An.filterMultiple&&ln.type==="select-simple"&&d.view.filterMultiple.categoryIds){const jn=Array.isArray(d.view.filterMultiple.categoryIds)?d.view.filterMultiple.categoryIds:[d.view.filterMultiple.categoryIds],qa=(ln.options||[]).filter(Oa=>Array.isArray(Oa.value)?tr(Oa.value,jn):jn.includes(Oa.value));return qa.length>0?qa[0].value:jn}if(Ge.id===6&&a.value&&(ya=d==null?void 0:d.view)!=null&&ya.filterMultiple&&d.view.filterMultiple.gameNumber){const jn=d.view.filterMultiple.gameNumber;return(ln.options||[]).find(qa=>qa.value==jn),jn}if(Ge.id===5&&a.value&&(va=d==null?void 0:d.view)!=null&&va.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const jn=d.view.filterMultiple.isHomeTeam;let qa;if(typeof jn=="boolean"?qa=jn?1:2:typeof jn=="number"?qa=jn===1?1:2:qa=1,(ln.options||[]).find(Oa=>Oa.value==qa),ln.type==="radio-button"&&(ln.label==="Equipo"||ln.label==="Team"||ln.label==="Equipo seleccionado"))return qa}if(Ge.id===15&&a.value&&(jr=d==null?void 0:d.view)!=null&&jr.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0&&ln.type==="radio-button"&&Nn===0){const jn=d.view.filterMultiple.isHomeTeam;let qa;if(typeof jn=="boolean"?qa=jn?1:2:typeof jn=="number"?qa=jn===1?1:2:qa=1,(ln.options||[]).find(Oa=>Oa.value==qa))return qa}if(Ge.id===9&&a.value&&(wr=d==null?void 0:d.view)!=null&&wr.filterMultiple&&ln.type==="radio-button"&&d.view.filterMultiple.isHomeTeam!==void 0){const jn=d.view.filterMultiple.isHomeTeam?1:2,qa=((Wn=ln.options)==null?void 0:Wn.map(Oa=>Oa.value))||[];return qa.includes(jn)?jn:qa[0]||1}return((ra=(ha=ln.options)==null?void 0:ha[0])==null?void 0:ra.value)??null}else if(ln.type==="check"){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn&&jn.isChecked!==void 0)return jn.isChecked}if(Ge.id===8)return!0;if(Ge.id===3){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn&&jn.isChecked!==void 0)return jn.isChecked}return!1}return!1}return null}),!((Je=Ge.name)!=null&&Je.toLowerCase().includes("tops players")||(hr=Ge.title)!=null&&hr.toLowerCase().includes("tops players"))&&(!a.value||Nr)&&e.nextTick(()=>{var ln,Nn;Ge.id===4&&a.value&&(ln=d==null?void 0:d.view)!=null&&ln.id&&i&&i.setDynamicFilters(E.value,d.view.id),Ge.id===3&&a.value&&(Nn=d==null?void 0:d.view)!=null&&Nn.id&&i&&i.setDynamicFilters(E.value,d.view.id),te()}))},{immediate:!0}),e.watch(()=>i,Ge=>{Ge&&Ge.dynamicFilters&&Array.isArray(Ge.dynamicFilters)&&(b.value=!0,E.value=[...Ge.dynamicFilters],e.nextTick(()=>{b.value=!1}))},{deep:!0}),e.watch(()=>i==null?void 0:i.dynamicFilters,Ge=>{if(Ge&&Array.isArray(Ge)){if(p.value)return;b.value=!0,E.value=[...Ge],e.nextTick(()=>{b.value=!1})}},{deep:!0}),e.watch(()=>L.value,Ge=>{if(a.value&&l&&Ge&&Ge.filters){if(b.value||s.value)return;if(Ge.id===3){if(p.value||s.value)return;const Je=l.dynamicFilters.find(hr=>hr.filterType==="check");Je&&Je.isChecked!==void 0&&E.value&&E.value.length>0&&(p.value=!0,E.value[0]=Je.isChecked,e.nextTick(()=>{E.value=[...E.value],p.value=!1}))}setTimeout(()=>{(!E.value||E.value.length===0)&&(Fe(),Te(),Re()),Ge.id===4&&sr()},100)}},{deep:!0}),e.watch(()=>{var Ge;return(Ge=L.value)==null?void 0:Ge.id},Ge=>{if(a.value&&l&&Ge===4){if(b.value||s.value)return;setTimeout(()=>{sr()},200)}}),e.watch(()=>E.value,Ge=>{if(a.value&&l&&Ge&&Ge.length>0){if(b.value||p.value||s.value)return;setTimeout(()=>{var Je;br()&&(Fe(),Te(),Re(),((Je=L.value)==null?void 0:Je.id)===4&&sr())},50)}},{deep:!0});function V(Ge,Je){var hr,Nr,Ir,ln,Nn;const En=E.value[Ge];if((hr=L.value)==null||hr.id,(Nr=L.value)==null||Nr.id,Array.isArray(En)){if(((Ir=L.value)==null?void 0:Ir.id)===4&&Ge===0){const Gn=En.some($n=>{if(Je.category_id&&Je.event_type_id){if($n.category_id&&$n.event_type_id)return $n.category_id===Je.category_id&&$n.event_type_id===Je.event_type_id;if($n.event_type_id&&!$n.category_id)return $n.event_type_id===Je.event_type_id;if($n.category_id&&!$n.event_type_id)return $n.category_id===Je.category_id}else{if(Je.event_type_id)return $n.event_type_id===Je.event_type_id;if(Je.category_id)return $n.category_id===Je.category_id}return JSON.stringify($n)===JSON.stringify(Je)});return(ln=L.value)==null||ln.id,Gn}return En.includes(Je)}else if(En!=null)return(Nn=L.value)==null||Nn.id,En===Je;return!1}function I(Ge,Je){var hr,Nr,Ir;const ln=(Nr=(hr=L.value)==null?void 0:hr.filters)==null?void 0:Nr[Ge];if((ln==null?void 0:ln.type)==="select-simple"){le(Ge,Je);return}Array.isArray(E.value[Ge])||(E.value[Ge]=[]);const Nn=E.value[Ge];let En=-1;((Ir=L.value)==null?void 0:Ir.id)===4&&Ge===0?En=Nn.findIndex(Gn=>Je.category_id&&Je.event_type_id?Gn.category_id===Je.category_id&&Gn.event_type_id===Je.event_type_id:Je.event_type_id?Gn.event_type_id===Je.event_type_id:Je.category_id?Gn.category_id===Je.category_id:!1):En=Nn.indexOf(Je),En>-1?Nn.splice(En,1):Nn.push(Je),a.value&&Ve(),te()}function j(Ge){var Je,hr;const Nr=E.value[Ge],Ir=(hr=(Je=L.value)==null?void 0:Je.filters)==null?void 0:hr[Ge];return(Ir==null?void 0:Ir.type)==="select-simple"||!Ir||!Ir.options||!Array.isArray(Nr)?!1:Nr.length===Ir.options.length}function F(Ge){var Je,hr;const Nr=E.value[Ge],Ir=(hr=(Je=L.value)==null?void 0:Je.filters)==null?void 0:hr[Ge];return(Ir==null?void 0:Ir.type)==="select-simple"||!Ir||!Ir.options||!Array.isArray(Nr)?!1:Nr.length>0&&Nr.length<Ir.options.length}function D(){var Ge;return!(((Ge=L.value)==null?void 0:Ge.id)===6&&y.isPostMatch)}function U(Ge){return!Ge||!Array.isArray(Ge)?Ge:Ge.filter(Je=>{const hr=(Je.name||Je.title||"").toLowerCase();return y.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(Nr=>hr.includes(Nr))})}function M(){var Ge,Je;const hr=((Je=(Ge=h.value)==null?void 0:Ge.name)==null?void 0:Je.toLowerCase())||"";return hr.includes("cancha")||hr.includes("volumétrica")||hr.includes("volumetric")}function X(Ge,Je){if(!a.value||!M())return!1;const hr=String(Ge||"").toLowerCase(),Nr=String(Je||"").toLowerCase();return hr.includes("ambos")||Nr.includes("ambos")}function O(Ge){var Je,hr;const Nr=(hr=(Je=L.value)==null?void 0:Je.filters)==null?void 0:hr[Ge];if(!Nr||!Nr.options)return;const Ir=Nr.options.map(ln=>ln.value);Array.isArray(E.value[Ge])||(E.value[Ge]=[]),j(Ge)?E.value[Ge]=[]:E.value[Ge]=[...Ir],yt.value=Ge,te()}const Y=e.ref("ambos"),st=e.ref(!1),mt=e.ref(!1),yt=e.ref(null),bt=e.ref(null);function xt(Ge,Je=!1){const hr="https://golstatsimages.blob.core.windows.net/images-library/",Nr="https://golstatsimages.blob.core.windows.net/reports-images/",Ir={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"},ln=Object.keys(Ir).find(Nn=>Ge==null?void 0:Ge.toLowerCase().includes(Nn.toLowerCase()));if(ln){const Nn=Ir[ln],En=Je?"":"-def";return ln.toLowerCase().includes("tabla")?`${Nr}${Nn}${En}@2x.png`:`${hr}${Nn}${En}@2x.png`}return`${hr}icn_default${Je?"":"-def"}.png`}function Pt(){return h.value?h.value.name:"Tipo de vista"}function qt(){return L.value?L.value.name||L.value.title:"Visualización"}function _t(){a.value||(st.value=!st.value,st.value&&(mt.value=!1,e.nextTick(()=>{$e()})))}function It(){a.value||h.value&&(mt.value=!mt.value,mt.value&&(st.value=!1))}function jt(Ge){a.value||(o.value=Ge,st.value=!1,k.value=null,te())}function Rt(Ge){var Je,hr;a.value||(k.value=Ge.id,mt.value=!1,(Je=Ge.name)!=null&&Je.toLowerCase().includes("tops players")||(hr=Ge.title)==null||hr.toLowerCase().includes("tops players"))}function Wt(Ge){var Je;yt.value=yt.value===Ge?null:Ge,((Je=L.value)==null?void 0:Je.id)===4&&a.value&&Ge===0&&setTimeout(()=>{E.value=[...E.value]},50)}function re(Ge){bt.value=bt.value===Ge?null:Ge}function le(Ge,Je){var hr,Nr,Ir,ln,Nn;if(((hr=L.value)==null?void 0:hr.id)===2){const En=P.value.findIndex(Gn=>Gn.type==="select-simple"&&Gn.label==="Tipo de análisis");Ge===En?E.value[0]=Je:E.value[Ge]=Je}else if(((Nr=L.value)==null?void 0:Nr.id)===1)E.value[0]=Je;else if(((Ir=L.value)==null?void 0:Ir.id)===6)E.value[0]=Je;else if(((ln=L.value)==null?void 0:ln.id)===9)if(Ge===0){Array.isArray(Je)?E.value[Ge]=Je:E.value[Ge]=[Je];const En=((Nn=P.value[Ge])==null?void 0:Nn.options)||[],Gn=Array.isArray(Je)?Je:[Je],$n=En.find(ka=>Array.isArray(ka.value)?tr(ka.value,Gn):Gn.includes(ka.value));$n?E.value[Ge]=$n.value:E.value[Ge]=Gn}else E.value[Ge]=Je;else E.value[Ge]=Je;bt.value=null,a.value&&Ve(),te()}function he(Ge){Ge.target.closest(".custom-select")||(st.value=!1,mt.value=!1,bt.value=null)}const de=[16,18];function Jt(){var Ge;return((Ge=L.value)==null?void 0:Ge.id)===8&&y.isPostMatch?P.value.map((Je,hr)=>({filter:Je,index:hr})).filter(({filter:Je})=>Je.type!=="radio-button").map(({index:Je})=>E.value[Je]):E.value}function te(){var Ge,Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn;if(de.includes((Ge=L.value)==null?void 0:Ge.id)||b.value)return;let An=[],ya=[];L.value&&Array.isArray(P.value)&&P.value.forEach((ra,jn)=>{if(ra.type==="select"&&ra.label==="Tipo de análisis"&&ra.id===2){const qa=E.value[jn]||[];Array.isArray(qa)&&qa.length>0&&(An=qa.map(Oa=>{var ti;const Ka=(ti=ra.options)==null?void 0:ti.find(Ra=>Ra.value===Oa);return{value:Oa,label:(Ka==null?void 0:Ka.label)||Oa}}))}});const va=((Je=L.value)==null?void 0:Je.id)===4;if(L.value&&Array.isArray(L.value.filters)&&L.value.filters.some(ra=>ra.type==="select"&&ra.label==="Tipo de análisis"&&ra.id===2)&&An.length===0&&!va)return;if(va&&E.value&&E.value.length>0){const ra=E.value[0];Array.isArray(ra)&&ra.length>0}const jr=((hr=L.value)==null?void 0:hr.id)===8&&y.isPostMatch?P.value.filter(ra=>ra.type!=="radio-button"):P.value;ya=(jr==null?void 0:jr.map((ra,jn)=>{var qa,Oa,ti,Ka;const Ra=P.value.findIndex(No=>No===ra),ki=E.value[Ra];let zi=ra.id||`filter_${jn}`;return((qa=L.value)==null?void 0:qa.id)===3&&a.value&&(Oa=d==null?void 0:d.view)!=null&&Oa.id&&(zi=`filter_${jn}_component_${d.view.id}`),{filterId:zi,filterType:ra.type,filterLabel:ra.label,filterIcon:ra.icon||null,selectedValue:ki,selectedOptions:ra.type==="select"&&Array.isArray(ki)&&ki.length>0?ki.map(No=>{var Po;const ho=(Po=ra.options)==null?void 0:Po.find(to=>to.value===No);return{value:No,label:(ho==null?void 0:ho.label)||No,icon:(ho==null?void 0:ho.icon)||null}}):null,selectedOption:ra.type==="radio-button"&&ki!=null?{value:ki,label:((Ka=(ti=ra.options)==null?void 0:ti.find(No=>No.value===ki))==null?void 0:Ka.label)||ki}:null,isChecked:ra.type==="check"?ki:null}}))||[];const wr={mainSelector:{id:((Nr=h.value)==null?void 0:Nr.id)||null,name:((Ir=h.value)==null?void 0:Ir.name)||null,url:((ln=h.value)==null?void 0:ln.url)||null},viewSelector:{id:((Nn=L.value)==null?void 0:Nn.id)||null,name:((En=L.value)==null?void 0:En.name)||((Gn=L.value)==null?void 0:Gn.title)||null,url:(($n=L.value)==null?void 0:$n.url)||null},team:Y.value,dynamicFilters:ya,categoriasSeleccionadas:An,timestamp:new Date().toISOString(),summary:{mainSelected:!!h.value,viewSelected:!!L.value,totalDynamicFilters:((ka=P.value)==null?void 0:ka.length)||0,activeFilters:((Hr=P.value)==null?void 0:Hr.filter((ra,jn)=>{const qa=E.value[jn];return Array.isArray(qa)?qa.length>0:qa!=null&&qa!==!1}).length)||0}},Wn=Jt(),ha={main:h.value,view:L.value,team:Y.value,dynamicFilters:Wn,filtersJSON:wr,filterAndViewsContainer:i,viewToEdit:d};if($("filters-changed",ha),a.value&&d){if(l=wr,((Rr=L.value)==null?void 0:Rr.id)===2){const ra=l.dynamicFilters.findIndex(jn=>jn.filterType==="select-simple"&&jn.filterLabel==="Tipo de análisis");ra!==-1&&(Mn=(dn=d.view)==null?void 0:dn.filterMultiple)!=null&&Mn.categoryId&&(l.dynamicFilters[ra].selectedValue=d.view.filterMultiple.categoryId)}if(((da=L.value)==null?void 0:da.id)===1){const ra=l.dynamicFilters.findIndex(jn=>jn.filterType==="select-simple"&&jn.filterLabel==="Tipo de análisis");ra!==-1&&(Xr=(Un=d.view)==null?void 0:Un.filterMultiple)!=null&&Xr.category&&(l.dynamicFilters[ra].selectedValue=d.view.filterMultiple.category)}}if(((sn=L.value)==null?void 0:sn.id)===6&&a.value&&(Sr=d==null?void 0:d.view)!=null&&Sr.filterMultiple&&d.view.filterMultiple.gameNumber&&l){const ra=l.dynamicFilters.findIndex(jn=>jn.filterType==="select-simple"&&jn.filterLabel==="Número de juego");ra!==-1&&(Hn=(pn=d.view)==null?void 0:pn.filterMultiple)!=null&&Hn.gameNumber&&(l.dynamicFilters[ra].selectedValue=d.view.filterMultiple.gameNumber)}i&&!a.value?i.setDynamicFilters(E.value):i&&a.value}function ne(){d=null,l=null,i=null,o.value=null,k.value=null,Y.value="ambos",E.value=[],st.value=!1,mt.value=!1,yt.value=null,bt.value=null,a.value=!1,S.value=!1,T.value=!1}function Le(Ge){if(Ge&&Ge.dynamicFilters){if(p.value)return;Array.isArray(Ge.dynamicFilters)&&Ge.dynamicFilters.length>0&&(b.value=!0,E.value=[...Ge.dynamicFilters],e.nextTick(()=>{b.value=!1}))}}function Oe(Ge){if(a.value=!0,Ge.mainSelector&&Ge.mainSelector.id){const Je=u.value.findIndex(hr=>hr.id===Ge.mainSelector.id);Je!==-1&&(o.value=Je)}Ge.viewSelector&&Ge.viewSelector.id&&h.value&&h.value.views.findIndex(Je=>Je.id===Ge.viewSelector.id)!==-1&&(k.value=Ge.viewSelector.id),Ge.dynamicFilters&&Array.isArray(Ge.dynamicFilters)&&e.nextTick(()=>{setTimeout(()=>{var Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn,An,ya;if(L.value&&P.value){if(b.value)return;if(p.value=!0,Ge.dynamicFilters.forEach((va,jr)=>{var wr,Wn,ha,ra,jn,qa,Oa,ti,Ka,Ra,ki,zi,No;if(jr<P.value.length){const Po=P.value[jr];if(((wr=L.value)==null?void 0:wr.id)===3&&a.value,Po.type==="check"){const ho=va.isChecked;typeof ho=="boolean"&&(E.value[jr]=ho)}else if(Po.type==="select"&&va.selectedOptions){const ho=va.selectedOptions.map(to=>to.value);E.value[jr]=ho}else if(Po.type==="select"&&va.selectedValue&&Array.isArray(va.selectedValue))if(va.selectedValue.length>0&&va.selectedValue[0]&&typeof va.selectedValue[0]=="object"){const ho=Ye(va.selectedValue);E.value[jr]=ho}else E.value[jr]=va.selectedValue;else if(Po.type==="radio-button"&&va.selectedOption)E.value[jr]=va.selectedOption.value;else if(Po.type==="select-simple"&&va.selectedValue!==void 0){let ho;((Wn=L.value)==null?void 0:Wn.id)===2&&(ra=(ha=d==null?void 0:d.view)==null?void 0:ha.filterMultiple)!=null&&ra.categoryId?ho=d.view.filterMultiple.categoryId:((jn=L.value)==null?void 0:jn.id)===1&&(Oa=(qa=d==null?void 0:d.view)==null?void 0:qa.filterMultiple)!=null&&Oa.category?ho=d.view.filterMultiple.category:((ti=L.value)==null?void 0:ti.id)===6&&(Ra=(Ka=d==null?void 0:d.view)==null?void 0:Ka.filterMultiple)!=null&&Ra.gameNumber?ho=d.view.filterMultiple.gameNumber:((ki=L.value)==null?void 0:ki.id)===9&&(No=(zi=d==null?void 0:d.view)==null?void 0:zi.filterMultiple)!=null&&No.categoryIds?ho=d.view.filterMultiple.categoryIds:ho=Array.isArray(va.selectedValue)?va.selectedValue[0]:va.selectedValue,E.value[jr]=ho}}}),((Je=L.value)==null?void 0:Je.id)===3&&a.value,((hr=L.value)==null?void 0:hr.id)===2&&a.value&&(Nr=d==null?void 0:d.view)!=null&&Nr.filterMultiple){if(d.view.filterMultiple.categoryId){const va=P.value.findIndex(jr=>jr.type==="select-simple"&&jr.label==="Tipo de análisis");if(va!==-1){const jr=d.view.filterMultiple.categoryId;if(E.value[0]=jr,d.view.componentProps&&jr){let wr=`Category ${jr}`,Wn=null;try{Wn=R4(jr),Wn&&(wr=Wn.name)}catch{const ha=P.value.findIndex(ra=>ra.type==="select-simple"&&ra.label==="Tipo de análisis");if(ha!==-1){const ra=(((Ir=P.value[ha])==null?void 0:Ir.options)||[]).find(jn=>jn.value==jr);ra&&(wr=ra.label)}}d.view.componentProps.categoryView=[{id:jr,name:wr}]}(((ln=P.value[va])==null?void 0:ln.options)||[]).find(wr=>wr.value==jr),e.nextTick(()=>{E.value=[...E.value]})}}if(d.view.filterMultiple.teamType!==void 0){const va=P.value.findIndex(jr=>jr.type==="radio-button");if(va!==-1){const jr=d.view.filterMultiple.teamType;E.value[va]=jr,(((Nn=P.value[va])==null?void 0:Nn.options)||[]).find(wr=>wr.value==jr),e.nextTick(()=>{E.value=[...E.value]})}}}if(((En=L.value)==null?void 0:En.id)===9&&a.value&&(Gn=d==null?void 0:d.view)!=null&&Gn.filterMultiple){if(d.view.filterMultiple.categoryIds){const va=P.value.findIndex(jr=>jr.type==="select-simple");if(va!==-1){const jr=Array.isArray(d.view.filterMultiple.categoryIds)?d.view.filterMultiple.categoryIds:[d.view.filterMultiple.categoryIds];E.value[0]=jr;const wr=((($n=P.value[va])==null?void 0:$n.options)||[]).filter(ha=>Array.isArray(ha.value)?tr(ha.value,jr):jr.includes(ha.value));if(wr.length>0){const ha=wr[0].value;E.value[va]=ha}else E.value[va]=jr;const Wn=E.value[va];tr(Wn,jr),e.nextTick(()=>{E.value=[...E.value]})}}if(d.view.filterMultiple.isHomeTeam!==void 0){const va=P.value.findIndex(jr=>jr.type==="radio-button");if(va!==-1){const jr=d.view.filterMultiple.isHomeTeam;let wr;typeof jr=="boolean"?wr=jr?1:2:typeof jr=="number"?wr=jr===1?1:2:wr=1,E.value[va]=wr,(((ka=P.value[va])==null?void 0:ka.options)||[]).find(Wn=>Wn.value==wr),e.nextTick(()=>{E.value=[...E.value]})}}}if(((Hr=L.value)==null?void 0:Hr.id)===1&&a.value&&(Rr=d==null?void 0:d.view)!=null&&Rr.filterMultiple&&d.view.filterMultiple.category){const va=P.value.findIndex(jr=>jr.type==="select-simple"&&jr.label==="Tipo de análisis");if(va!==-1){const jr=d.view.filterMultiple.category;E.value[0]=jr,d.view.componentProps&&jr&&(d.view.componentProps.type=jr),(((dn=P.value[va])==null?void 0:dn.options)||[]).find(wr=>wr.value==jr),e.nextTick(()=>{E.value=[...E.value]})}}if(((Mn=L.value)==null?void 0:Mn.id)===6&&a.value&&(da=d==null?void 0:d.view)!=null&&da.filterMultiple&&d.view.filterMultiple.gameNumber){const va=P.value.findIndex(jr=>jr.type==="select-simple"&&jr.label==="Número de juego");if(va!==-1){const jr=d.view.filterMultiple.gameNumber;E.value[0]=jr,d.view.componentProps&&jr&&(d.view.componentProps.gameNumber=jr),(((Un=P.value[va])==null?void 0:Un.options)||[]).find(wr=>wr.value==jr),e.nextTick(()=>{E.value=[...E.value]})}}if(((Xr=L.value)==null?void 0:Xr.id)===7&&a.value&&d!=null&&d.view){if((sn=d.view.componentProps)!=null&&sn.analysisType&&P.value.length>0&&((Sr=P.value[0])==null?void 0:Sr.type)==="radio-button"){const va=d.view.componentProps.analysisType==="offensive"?1:2;E.value[0]=va}if(((pn=d.view.filterMultiple)==null?void 0:pn.isHomeTeam)!==void 0){const va=P.value.findIndex(jr=>jr.type==="radio-button"&&jr.label==="Equipo");if(va!==-1){const jr=d.view.filterMultiple.isHomeTeam?1:2;E.value[1]=jr}else if(P.value.length>1&&((Hn=P.value[1])==null?void 0:Hn.type)==="radio-button"){const jr=d.view.filterMultiple.isHomeTeam,wr=jr?1:2;E.value[1]=wr,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=jr),(((An=P.value[1])==null?void 0:An.options)||[]).find(Wn=>Wn.value==wr),e.nextTick(()=>{E.value=[...E.value]})}if(va!==-1&&d.view.componentProps){const jr=d.view.filterMultiple.isHomeTeam,wr=jr?1:2;d.view.componentProps.isHomeTeamForAnalysis=jr,(((ya=P.value[va])==null?void 0:ya.options)||[]).find(Wn=>Wn.value==wr),e.nextTick(()=>{E.value=[...E.value]})}}}e.nextTick(()=>{p.value=!1})}},100)})}function Ne(){var Ge,Je,hr,Nr,Ir,ln,Nn,En,Gn,$n;return{mainSelector:{id:((Ge=h.value)==null?void 0:Ge.id)||null,name:((Je=h.value)==null?void 0:Je.name)||null,url:((hr=h.value)==null?void 0:hr.url)||null},viewSelector:{id:((Nr=L.value)==null?void 0:Nr.id)||null,name:((Ir=L.value)==null?void 0:Ir.name)||((ln=L.value)==null?void 0:ln.title)||null,url:((Nn=L.value)==null?void 0:Nn.url)||null},team:Y.value,dynamicFilters:((En=P.value)==null?void 0:En.map((ka,Hr)=>{var Rr,dn;const Mn=E.value[Hr];return{filterId:ka.id||`filter_${Hr}`,filterType:ka.type,filterLabel:ka.label,filterIcon:ka.icon||null,selectedValue:Mn,selectedOptions:ka.type==="select"&&Array.isArray(Mn)&&Mn.length>0?Mn.map(da=>{var Un;const Xr=(Un=ka.options)==null?void 0:Un.find(sn=>sn.value===da);return{value:da,label:(Xr==null?void 0:Xr.label)||da,icon:(Xr==null?void 0:Xr.icon)||null}}):null,selectedOption:ka.type==="radio-button"&&Mn?{value:Mn,label:((dn=(Rr=ka.options)==null?void 0:Rr.find(da=>da.value===Mn))==null?void 0:dn.label)||Mn}:null,isChecked:ka.type==="check"?Mn:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!h.value,viewSelected:!!L.value,totalDynamicFilters:((Gn=P.value)==null?void 0:Gn.length)||0,activeFilters:(($n=P.value)==null?void 0:$n.filter((ka,Hr)=>{const Rr=E.value[Hr];return Array.isArray(Rr)?Rr.length>0:Rr!=null&&Rr!==!1}).length)||0}}}r({getCurrentFiltersJSON:Ne});function Pe(){ne(),$("close",i)}function Xe(){S.value=!1,Pe()}function He(){T.value&&(Sd.emit("filters-cancelled",i),T.value=!1),S.value=!1,Pe()}e.onMounted(async()=>{document.addEventListener("click",he),e.nextTick(()=>{$e()});const Ge="https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/views";try{const Je=await(await fetch(Ge,{headers:{Authorization:`${y.token}`}})).json();u.value=Je.data||[],f.value.clear(),u.value&&(f.value=u.value.reduce((hr,Nr)=>(Nr.views&&Array.isArray(Nr.views)&&Nr.views.forEach(Ir=>{Ir.filters&&Array.isArray(Ir.filters)&&hr.set(Ir.id,Ir)}),hr),new Map))}catch(Je){console.error("Error al obtener datos:",Je)}});function $e(){document.querySelectorAll(".field-menu .option-card").forEach(Ge=>{const Je=Ge.querySelector(".option-img");if(!Je||!Je.dataset.hoverSrc)return;const hr=Je.src,Nr=Je.dataset.hoverSrc;Ge.addEventListener("mouseenter",()=>{Je.src=Nr}),Ge.addEventListener("mouseleave",()=>{Je.src=hr})})}e.onUnmounted(()=>{document.removeEventListener("click",he)}),Sd.on("set-filter-and-views-container",Ge=>{i=Ge,Ge&&Le(Ge)}),Sd.on("view-added",()=>{S.value=!0,T.value=!0}),Sd.on("component-added-to-container",Ge=>{(!a.value||i&&Ge.id===i.id)&&Le(Ge)}),Sd.on("edit-view",Ge=>{var Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn,An,ya;console.log("on edit-view event received for view:",Ge),d=Ge,i=((Je=Ge.view)==null?void 0:Je.filterAndViewsContainer)||null,l=null;const va=[(Nr=(hr=Ge.view)==null?void 0:hr.coreView)==null?void 0:Nr.filtersJSON,(Ir=Ge.view)==null?void 0:Ir.filtersJSON,(ln=Ge.coreView)==null?void 0:ln.filtersJSON,Ge.filtersJSON,(En=(Nn=Ge.view)==null?void 0:Nn.componentProps)==null?void 0:En.filtersJSON];for(const jr of va)if(jr){l=jr;break}if(i&&(i.viewId===4||i.viewId===8||i.viewId===3||i.viewId===1||i.viewId===2||i.viewId===13)&&(Gn=Ge.view)!=null&&Gn.id){const jr=i.getComponentDynamicFilters(Ge.view.id);if(jr){let wr="Unknown";i.viewId===4?wr="Timeline":i.viewId===8?wr="FieldPosesion":i.viewId===3?wr="GSCMatchSummary":i.viewId===1?wr="GSCComparativeReports":i.viewId===2?wr="GscTopPlayer":i.viewId===13&&(wr="GSCTimelapseTable"),l&&(i.viewId===13?l={...l,dynamicFilters:jr}:l={...l,dynamicFilters:jr.map((Wn,ha)=>{var ra,jn;if(Array.isArray(Wn))return{selectedValue:Wn,selectedOptions:Wn.map(qa=>({value:qa,label:qa}))};if(typeof Wn=="boolean")return{isChecked:Wn};if(wr==="GSCComparativeReports"&&ha===0)return{selectedValue:Wn,selectedOptions:[{value:Wn,label:Wn}]};if(wr==="GscTopPlayer"&&ha===0)return{selectedValue:Wn,selectedOptions:[{value:Wn,label:Wn}]};if(wr==="GscTopPlayer"&&ha===1)return{selectedOption:{value:Wn,label:Wn}};if(wr==="FieldPosesion"&&ha===1){const qa=(jn=(ra=Ge.view)==null?void 0:ra.filterMultiple)==null?void 0:jn.isHomeTeam,Oa=Wn===3&&qa!==void 0?(typeof qa=="boolean"?qa:qa===1)?1:2:Wn,ti=Oa===1?"Mi equipo":Oa===2?"Rival":Oa===3?"Ambos":String(Oa);return{selectedOption:{value:Oa,label:ti}}}else return{selectedOption:{value:Wn,label:Wn}}})})}}if(i&&i.viewId===2&&($n=Ge.view)!=null&&$n.filterMultiple){if(Ge.view.filterMultiple.categoryId&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="select-simple"&&wr.filterLabel==="Tipo de análisis");jr!==-1&&(l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:Ge.view.filterMultiple.categoryId,selectedOptions:[{value:Ge.view.filterMultiple.categoryId,label:`Category ${Ge.view.filterMultiple.categoryId}`}]})}if(Ge.view.filterMultiple.teamType!==void 0&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(jr!==-1){const wr=Ge.view.filterMultiple.teamType,Wn=wr===1?"Mi equipo":wr===2?"Rival":wr===3?"Ambos":"Equipo";l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:wr,label:Wn}}}}}if(i&&i.viewId===1&&(ka=Ge.view)!=null&&ka.filterMultiple&&Ge.view.filterMultiple.category&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="select-simple"&&wr.filterLabel==="Tipo de análisis");jr!==-1&&(l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:Ge.view.filterMultiple.category,selectedOptions:[{value:Ge.view.filterMultiple.category,label:Ge.view.filterMultiple.category}]})}if(i&&i.viewId===9&&(Hr=Ge.view)!=null&&Hr.filterMultiple){if(Ge.view.filterMultiple.categoryIds&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="select"&&wr.filterLabel==="Tipo de análisis");if(jr!==-1){const wr=Array.isArray(Ge.view.filterMultiple.categoryIds)?Ge.view.filterMultiple.categoryIds:[Ge.view.filterMultiple.categoryIds];l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:wr,selectedOptions:wr.map(ra=>({value:ra,label:`Category ${ra}`}))};const Wn=Ge.view.filterMultiple.categoryIds;tr(Wn,wr);const ha=(((Rr=P.value[jr])==null?void 0:Rr.options)||[]).filter(ra=>Array.isArray(ra.value)?tr(ra.value,wr):wr.includes(ra.value));if(ha.length>0){const ra=ha[0];l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:ra.value,selectedOptions:[ra]}}}}if(Ge.view.filterMultiple.isHomeTeam!==void 0&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(jr!==-1){const wr=Ge.view.filterMultiple.isHomeTeam;let Wn,ha;typeof wr=="boolean"?(Wn=wr?1:2,ha=wr?"Mi equipo":"Rival"):typeof wr=="number"?(Wn=wr===1?1:2,ha=wr===1?"Mi equipo":"Rival"):(Wn=1,ha="Mi equipo"),l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:Wn,label:ha}}}}}if(i&&i.viewId===6&&(dn=Ge.view)!=null&&dn.filterMultiple&&Ge.view.filterMultiple.gameNumber&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="select-simple"&&wr.filterLabel==="Número de juego");jr!==-1&&(l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:Ge.view.filterMultiple.gameNumber,selectedOptions:[{value:Ge.view.filterMultiple.gameNumber,label:`Juego ${Ge.view.filterMultiple.gameNumber}`}]})}if(i&&i.viewId===7&&Ge.view&&l){if((Mn=Ge.view.componentProps)!=null&&Mn.analysisType){const jr=l.dynamicFilters.findIndex((wr,Wn)=>wr.filterType==="radio-button"&&Wn===0);if(jr!==-1){const wr=Ge.view.componentProps.analysisType,Wn=wr==="offensive"?1:2,ha=wr==="offensive"?"A favor":"En contra";l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:Wn,label:ha}}}}if(((da=Ge.view.filterMultiple)==null?void 0:da.isHomeTeam)!==void 0){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button"&&wr.filterLabel==="Equipo");if(jr!==-1){const wr=Ge.view.filterMultiple.isHomeTeam,Wn=wr?1:2,ha=wr?"Equipo propio":"Equipo rival";l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:Wn,label:ha}}}}}if(i&&i.viewId===10&&(Un=Ge.view)!=null&&Un.filterMultiple&&((sn=(Xr=d==null?void 0:d.view)==null?void 0:Xr.coreView)==null?void 0:sn.id)===10){const jr=Ge.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:jr})}if(i&&i.viewId===15&&(Sr=Ge.view)!=null&&Sr.id){const jr=i.getComponentDynamicFilters(Ge.view.id);if(jr&&l)l={...l,dynamicFilters:jr.map((wr,Wn)=>{var ha,ra;if(Wn===0){let jn=wr;if(wr===3&&((ra=(ha=Ge.view)==null?void 0:ha.filterMultiple)==null?void 0:ra.isHomeTeam)!==void 0){const qa=Ge.view.filterMultiple.isHomeTeam;typeof qa=="boolean"?jn=qa?1:2:typeof qa=="number"&&(jn=qa===1?1:2)}return{selectedOption:{value:jn,label:jn===1?"Mi equipo":"Rival"}}}else if(Wn===1)return{selectedValue:wr,selectedOptions:[{value:wr,label:`${wr} fortalezas`}]};return typeof wr=="number"?{selectedValue:wr}:{selectedOption:{value:wr,label:String(wr)}}})};else if((pn=Ge.view)!=null&&pn.filterMultiple&&l&&Ge.view.filterMultiple.isHomeTeam!==void 0){const wr=l.dynamicFilters.findIndex(Wn=>Wn.filterType==="radio-button"&&Wn.filterLabel==="Mi equipo");if(wr!==-1){const Wn=Ge.view.filterMultiple.isHomeTeam;let ha,ra;typeof Wn=="boolean"?(ha=Wn?1:2,ra=Wn?"Local":"Visitante"):typeof Wn=="number"?(ha=Wn===1?1:2,ra=Wn===1?"Local":"Visitante"):(ha=1,ra="Local"),l.dynamicFilters[wr]={...l.dynamicFilters[wr],selectedOption:{value:ha,label:ra}}}}}if(i&&i.viewId===17&&(Hn=Ge.view)!=null&&Hn.id){const jr=i.getComponentDynamicFilters(Ge.view.id);if(jr&&l)l={...l,dynamicFilters:jr.map((wr,Wn)=>{var ha,ra,jn,qa,Oa,ti;const Ka=(ha=P.value)==null?void 0:ha[Wn];if(Ka&&Ka.type==="radio-button"){let Ra=wr;if(wr===3&&((jn=(ra=Ge.view)==null?void 0:ra.filterMultiple)==null?void 0:jn.isHomeTeam)!==void 0){const ki=Ge.view.filterMultiple.isHomeTeam;typeof ki=="boolean"?Ra=ki?1:2:typeof ki=="number"&&(Ra=ki===1?1:2)}return{selectedOption:{value:Ra,label:Ra===1?"Mi equipo":Ra===2?"Rival":"Ambos"}}}else if(Wn===2){let Ra=wr;if((wr===3||wr!==1&&wr!==2&&(qa=Ge.view)!=null&&qa.filterMultiple)&&((ti=(Oa=Ge.view)==null?void 0:Oa.filterMultiple)==null?void 0:ti.isHomeTeam)!==void 0){const ki=Ge.view.filterMultiple.isHomeTeam;typeof ki=="boolean"?Ra=ki?1:2:typeof ki=="number"&&(Ra=ki===1?1:2)}return Ka&&Ka.type==="select-simple"?{selectedValue:Ra,selectedOptions:[{value:Ra,label:String(Ra)}]}:Ka&&Ka.type==="radio-button"?{selectedOption:{value:Ra,label:Ra===1?"Mi equipo":Ra===2?"Rival":"Ambos"}}:typeof Ra=="number"?{selectedValue:Ra}:{selectedOption:{value:Ra,label:String(Ra)}}}else{if(Ka&&Ka.type==="switch")return typeof wr=="boolean"?{selectedValue:wr}:{selectedValue:wr};if(Ka&&Ka.type==="check")return typeof wr=="boolean"?{selectedValue:wr}:{selectedValue:wr}}return Array.isArray(wr)?{selectedValue:wr,selectedOptions:wr.map(Ra=>({value:Ra,label:String(Ra)}))}:typeof wr=="boolean"?{selectedValue:wr}:typeof wr=="object"&&wr!==null?wr:typeof wr=="number"?{selectedValue:wr}:{selectedOption:{value:wr,label:String(wr)}}})};else if((An=Ge.view)!=null&&An.filterMultiple&&l&&Ge.view.filterMultiple.isHomeTeam!==void 0){const wr=l.dynamicFilters.findIndex(Wn=>Wn.filterType==="radio-button");if(wr!==-1){const Wn=Ge.view.filterMultiple.isHomeTeam;let ha,ra;typeof Wn=="boolean"?(ha=Wn?1:2,ra=Wn?"Mi equipo":"Rival"):typeof Wn=="number"?(ha=Wn===1?1:2,ra=Wn===1?"Mi equipo":"Rival"):(ha=1,ra="Mi equipo"),l.dynamicFilters[wr]={...l.dynamicFilters[wr],selectedOption:{value:ha,label:ra}}}}}if(i&&i.viewId===5&&(ya=Ge.view)!=null&&ya.filterMultiple&&Ge.view.filterMultiple.isHomeTeam!==void 0&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button"&&wr.filterLabel==="Equipo");if(jr!==-1){const wr=Ge.view.filterMultiple.isHomeTeam;let Wn,ha;typeof wr=="boolean"?(Wn=wr?1:2,ha=wr?"Equipo propio":"Equipo rival"):typeof wr=="number"?(Wn=wr===1?1:2,ha=wr===1?"Equipo propio":"Equipo rival"):(Wn=1,ha="Equipo propio"),l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:Wn,label:ha}}}else{const wr=l.dynamicFilters.findIndex(Wn=>Wn.filterType==="radio-button");if(wr!==-1){const Wn=Ge.view.filterMultiple.isHomeTeam;let ha,ra;typeof Wn=="boolean"?(ha=Wn?1:2,ra=Wn?"Equipo propio":"Equipo rival"):typeof Wn=="number"?(ha=Wn===1?1:2,ra=Wn===1?"Equipo propio":"Equipo rival"):(ha=1,ra="Equipo propio"),l.dynamicFilters[wr]={...l.dynamicFilters[wr],selectedOption:{value:ha,label:ra}}}}}l&&Oe(l),S.value=!0});function ir(){yt.value=null}function pr(Ge,Je){var hr;(hr=L.value)==null||hr.id}function tr(Ge,Je){if(!Array.isArray(Ge)||!Array.isArray(Je)||Ge.length!==Je.length)return!1;const hr=[...Ge].sort((Ir,ln)=>Ir-ln),Nr=[...Je].sort((Ir,ln)=>Ir-ln);return JSON.stringify(hr)===JSON.stringify(Nr)}function Fe(){if(a.value&&l&&l.dynamicFilters){if(s.value||b.value)return;s.value=!0,p.value=!0,l.dynamicFilters.forEach((Ge,Je)=>{var hr;if(Ge&&(hr=P.value)!=null&&hr[Je]){const Nr=P.value[Je];if(Nr.type==="check"&&Ge.isChecked!==void 0)E.value[Je]=Ge.isChecked;else if(Nr.type==="select"&&Ge.selectedOptions){const Ir=Ge.selectedOptions.map(ln=>ln.value);E.value[Je]=Ir}else Nr.type==="select"&&Ge.selectedValue&&Array.isArray(Ge.selectedValue)&&(E.value[Je]=Ge.selectedValue)}}),e.nextTick(()=>{p.value=!1,s.value=!1})}}function sr(){var Ge;if(a.value&&l&&l.dynamicFilters&&((Ge=L.value)==null?void 0:Ge.id)===4){if(s.value||b.value)return;s.value=!0,p.value=!0,l.dynamicFilters.forEach((Je,hr)=>{var Nr,Ir;if(Je&&((Ir=(Nr=P.value)==null?void 0:Nr[hr])==null?void 0:Ir.type)==="select"){if(Je.selectedOptions){const ln=Je.selectedOptions.map(Nn=>Nn.value);E.value[hr]=ln}else if(Je.selectedValue&&Array.isArray(Je.selectedValue))if(Je.selectedValue.length>0&&Je.selectedValue[0]&&typeof Je.selectedValue[0]=="object"){const ln=Ye(Je.selectedValue);E.value[hr]=ln}else E.value[hr]=Je.selectedValue}}),setTimeout(()=>{var Je;if(E.value=[...E.value],(Je=d==null?void 0:d.view)!=null&&Je.componentProps&&E.value&&E.value.length>0){const hr=E.value[0];if(Array.isArray(hr)&&hr.length>0){const Nr=hr.some(En=>En.event_type_id===1||typeof En=="string"&&En.includes("1")),Ir=hr.some(En=>En.category_id===8||typeof En=="string"&&En.includes("8")),ln=hr.some(En=>En.category_id===9||typeof En=="string"&&En.includes("9")),Nn=hr.some(En=>En.event_type_id===3||typeof En=="string"&&En.includes("3"));d.view.componentProps.selectedEvents=hr,d.view.componentProps.goals=Nr,d.view.componentProps.yellowCards=Ir,d.view.componentProps.redCards=ln,d.view.componentProps.substitutions=Nn,d.view.componentProps.key=hr.length>0,d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}},200),e.nextTick(()=>{p.value=!1,s.value=!1})}}function Ye(Ge){return!Array.isArray(Ge)||Ge.length===0?[]:Ge.map(Je=>{if(Je&&typeof Je=="object"){if(Je.event_type_id!==void 0||Je.category_id!==void 0)return{event_type_id:Je.event_type_id,category_id:Je.category_id,...Je.name&&{name:Je.name},...Je.label&&{label:Je.label}};if(Je.value&&typeof Je.value=="object")return{event_type_id:Je.value.event_type_id,category_id:Je.value.category_id,...Je.value.name&&{name:Je.value.name},...Je.value.label&&{label:Je.value.label}};if(typeof Je=="string"&&Je.includes("-")){const[hr,Nr]=Je.split("-");return{category_id:parseInt(hr),event_type_id:parseInt(Nr)}}}if(typeof Je=="string")if(Je.includes("-")){const[hr,Nr]=Je.split("-");return{category_id:parseInt(hr),event_type_id:parseInt(Nr)}}else{const hr=parseInt(Je);if(!isNaN(hr))return{event_type_id:hr}}return Je})}function Te(){var Ge,Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da;if(a.value&&l&&l.dynamicFilters&&P.value){if(s.value||b.value)return;if(s.value=!0,p.value=!0,l.dynamicFilters.forEach((Un,Xr)=>{var sn,Sr,pn,Hn,An,ya,va,jr,wr,Wn,ha;if(Un&&((sn=P.value[Xr])==null?void 0:sn.type)==="select"){if(Un.selectedOptions){const ra=Un.selectedOptions.map(jn=>jn.value);E.value[Xr]=ra}else if(Un.selectedValue&&Array.isArray(Un.selectedValue))if(Un.selectedValue.length>0&&Un.selectedValue[0]&&typeof Un.selectedValue[0]=="object"){const ra=Ye(Un.selectedValue);E.value[Xr]=ra}else E.value[Xr]=Un.selectedValue}else if(Un&&((Sr=P.value[Xr])==null?void 0:Sr.type)==="select-simple"&&Un.selectedValue!==void 0){let ra;((pn=L.value)==null?void 0:pn.id)===2&&(An=(Hn=d==null?void 0:d.view)==null?void 0:Hn.filterMultiple)!=null&&An.categoryId?ra=d.view.filterMultiple.categoryId:((ya=L.value)==null?void 0:ya.id)===1&&(jr=(va=d==null?void 0:d.view)==null?void 0:va.filterMultiple)!=null&&jr.category?ra=d.view.filterMultiple.category:((wr=L.value)==null?void 0:wr.id)===6&&(ha=(Wn=d==null?void 0:d.view)==null?void 0:Wn.filterMultiple)!=null&&ha.gameNumber?ra=d.view.filterMultiple.gameNumber:ra=Array.isArray(Un.selectedValue)?Un.selectedValue[0]:Un.selectedValue,E.value[Xr]=ra}}),((Ge=L.value)==null?void 0:Ge.id)===4&&setTimeout(()=>{var Un;if(E.value=[...E.value],(Un=d==null?void 0:d.view)!=null&&Un.componentProps&&E.value&&E.value.length>0){const Xr=E.value[0];if(Array.isArray(Xr)&&Xr.length>0){const sn=Xr.some(An=>An.event_type_id===1||typeof An=="string"&&An.includes("1")),Sr=Xr.some(An=>An.category_id===8||typeof An=="string"&&An.includes("8")),pn=Xr.some(An=>An.category_id===9||typeof An=="string"&&An.includes("9")),Hn=Xr.some(An=>An.event_type_id===3||typeof An=="string"&&An.includes("3"));d.view.componentProps.selectedEvents=Xr,d.view.componentProps.goals=sn,d.view.componentProps.yellowCards=Sr,d.view.componentProps.redCards=pn,d.view.componentProps.substitutions=Hn,d.view.componentProps.key=Xr.length>0,d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}},100),((Je=L.value)==null?void 0:Je.id)===2&&(hr=d==null?void 0:d.view)!=null&&hr.filterMultiple){if(d.view.filterMultiple.categoryId){const Un=P.value.findIndex(Xr=>Xr.type==="select-simple"&&Xr.label==="Tipo de análisis");if(Un!==-1){const Xr=d.view.filterMultiple.categoryId;if(E.value[0]=Xr,d.view.componentProps&&Xr){let sn=`Category ${Xr}`,Sr=null;try{Sr=R4(Xr),Sr&&(sn=Sr.name)}catch{const pn=P.value.findIndex(Hn=>Hn.type==="select-simple"&&Hn.label==="Tipo de análisis");if(pn!==-1){const Hn=(((Nr=P.value[pn])==null?void 0:Nr.options)||[]).find(An=>An.value==Xr);Hn&&(sn=Hn.label)}}d.view.componentProps.categoryView=[{id:Xr,name:sn}]}(((Ir=P.value[Un])==null?void 0:Ir.options)||[]).find(sn=>sn.value==Xr),e.nextTick(()=>{E.value=[...E.value]})}}if(d.view.filterMultiple.teamType!==void 0){const Un=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Un!==-1){const Xr=d.view.filterMultiple.teamType;E.value[Un]=Xr,(((ln=P.value[Un])==null?void 0:ln.options)||[]).find(sn=>sn.value==Xr),e.nextTick(()=>{E.value=[...E.value]})}}}if(((Nn=L.value)==null?void 0:Nn.id)===1&&(En=d==null?void 0:d.view)!=null&&En.filterMultiple&&d.view.filterMultiple.category&&P.value.findIndex(Un=>Un.type==="select-simple"&&Un.label==="Tipo de análisis")!==-1){const Un=d.view.filterMultiple.category;E.value[0]=Un,d.view.componentProps&&Un&&(d.view.componentProps.type=Un),e.nextTick(()=>{E.value=[...E.value]})}if(((Gn=L.value)==null?void 0:Gn.id)===6&&($n=d==null?void 0:d.view)!=null&&$n.filterMultiple&&d.view.filterMultiple.gameNumber&&P.value.findIndex(Un=>Un.type==="select-simple"&&Un.label==="Número de juego")!==-1){const Un=d.view.filterMultiple.gameNumber;E.value[0]=Un,d.view.componentProps&&Un&&(d.view.componentProps.gameNumber=Un),e.nextTick(()=>{E.value=[...E.value]})}if(((ka=L.value)==null?void 0:ka.id)===5&&(Hr=d==null?void 0:d.view)!=null&&Hr.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0)if(P.value.findIndex(Un=>Un.type==="radio-button"&&Un.label==="Equipo")!==-1){const Un=d.view.filterMultiple.isHomeTeam;let Xr;typeof Un=="boolean"?Xr=Un?1:2:typeof Un=="number"?Xr=Un===1?1:2:Xr=1,E.value[0]=Xr,d.view.componentProps&&Un!==void 0&&(d.view.componentProps.isHomeTeamForAnalysis=Un===1),e.nextTick(()=>{E.value=[...E.value]})}else{const Un=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Un!==-1){const Xr=d.view.filterMultiple.isHomeTeam;let sn;typeof Xr=="boolean"?sn=Xr?1:2:typeof Xr=="number"?sn=Xr===1?1:2:sn=1,E.value[Un]=sn,d.view.componentProps&&Xr!==void 0&&(d.view.componentProps.preMatchType=Xr),e.nextTick(()=>{E.value=[...E.value]})}}if(((Rr=L.value)==null?void 0:Rr.id)===15&&(dn=d==null?void 0:d.view)!=null&&dn.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const Un=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Un!==-1){const Xr=d.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",Xr,"type:",typeof Xr);let sn;typeof Xr=="boolean"?sn=Xr?1:2:typeof Xr=="number"?sn=Xr===1?1:2:sn=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",sn,"teamFilterIndex:",Un),E.value[Un]=sn,d.view.componentProps&&Xr!==void 0&&(d.view.componentProps.preMatchType=sn),e.nextTick(()=>{E.value=[...E.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",E.value)})}else{const Xr=P.value.findIndex(sn=>sn.type==="radio-button");if(Xr!==-1){const sn=d.view.filterMultiple.isHomeTeam;let Sr;typeof sn=="boolean"?Sr=sn?1:2:typeof sn=="number"?Sr=sn===1?1:2:Sr=1,E.value[Xr]=Sr,d.view.componentProps&&sn!==void 0&&(d.view.componentProps.preMatchType=Sr),e.nextTick(()=>{E.value=[...E.value]})}}}if(((Mn=L.value)==null?void 0:Mn.id)===17&&(da=d==null?void 0:d.view)!=null&&da.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const Un=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Un!==-1){const Xr=d.view.filterMultiple.isHomeTeam;let sn;typeof Xr=="boolean"?sn=Xr?1:2:typeof Xr=="number"?sn=Xr===1?1:2:sn=1,E.value[Un]=sn,d.view.componentProps&&Xr!==void 0&&(d.view.componentProps.teamselected=sn),e.nextTick(()=>{E.value=[...E.value]})}else{const Xr=P.value.findIndex(sn=>sn.type==="radio-button");if(Xr!==-1){const sn=d.view.filterMultiple.isHomeTeam;let Sr;typeof sn=="boolean"?Sr=sn?1:2:typeof sn=="number"?Sr=sn===1?1:2:Sr=1,E.value[Xr]=Sr,d.view.componentProps&&sn!==void 0&&(d.view.componentProps.teamselected=Sr),e.nextTick(()=>{E.value=[...E.value]})}}}e.nextTick(()=>{p.value=!1,s.value=!1})}}function Re(){if(!s.value&&a.value&&l&&l.dynamicFilters&&P.value){if(b.value)return;s.value=!0,p.value=!0,l.dynamicFilters.forEach((Ge,Je)=>{var hr;if(Ge&&((hr=P.value[Je])==null?void 0:hr.type)==="radio-button"&&Ge.selectedOption&&Ge.selectedOption.value!==void 0){const Nr=Ge.selectedOption.value;E.value[Je]=Nr}}),e.nextTick(()=>{p.value=!1,s.value=!1})}}function Ve(){var Ge,Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn,An,ya,va,jr,wr,Wn,ha,ra,jn,qa,Oa,ti,Ka;if(i&&a.value&&d){if(b.value)return;if(p.value=!0,((Ge=L.value)==null?void 0:Ge.id)===4){if(i.setDynamicFilters(E.value,(Je=d.view)==null?void 0:Je.id),i.updateDynamicFilters(E.value,(hr=d.view)==null?void 0:hr.id),d.view.componentProps&&E.value&&E.value.length>0){const Ra=E.value[0];if(Array.isArray(Ra)&&Ra.length>0){const ki=Ra.some(ho=>ho.event_type_id===1||typeof ho=="string"&&ho.includes("1")),zi=Ra.some(ho=>ho.category_id===8||typeof ho=="string"&&ho.includes("8")),No=Ra.some(ho=>ho.category_id===9||typeof ho=="string"&&ho.includes("9")),Po=Ra.some(ho=>ho.event_type_id===3||typeof ho=="string"&&ho.includes("3"));d.view.componentProps.selectedEvents=Ra,d.view.componentProps.goals=ki,d.view.componentProps.yellowCards=zi,d.view.componentProps.redCards=No,d.view.componentProps.substitutions=Po,d.view.componentProps.key=Ra.length>0,d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}}else if(((Nr=L.value)==null?void 0:Nr.id)===8){const Ra=Jt();i.setDynamicFilters(Ra,(Ir=d.view)==null?void 0:Ir.id),i.updateDynamicFilters(Ra,(ln=d.view)==null?void 0:ln.id)}else if(((Nn=L.value)==null?void 0:Nn.id)===3)i.setDynamicFilters(E.value,(En=d.view)==null?void 0:En.id),i.updateDynamicFilters(E.value,(Gn=d.view)==null?void 0:Gn.id);else if((($n=L.value)==null?void 0:$n.id)===13){const Ra=(ka=d.view)==null?void 0:ka.id;i.setDynamicFilters(E.value,Ra),i.updateDynamicFilters(E.value,Ra),d.view.componentProps&&(d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps}))}else if(((Hr=L.value)==null?void 0:Hr.id)===15){const Ra=(Rr=d.view)==null?void 0:Rr.id;if(i.setDynamicFilters(E.value,Ra),i.updateDynamicFilters(E.value,Ra),d.view.componentProps){const ki=Array.isArray(E.value)&&E.value[3]!==void 0?E.value[3]:null;ki!==null&&(d.view.componentProps.numitems=ki),d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}else if(((dn=L.value)==null?void 0:dn.id)===17){const Ra=(Mn=d==null?void 0:d.view)==null?void 0:Mn.id;i.setDynamicFilters(E.value,Ra),i.updateDynamicFilters(E.value,Ra);const ki=(zi,No)=>{if(!zi)return;const Po=E.value[0];Po!==void 0&&(zi.infavoragainstteam=!Po);const ho=E.value[1];ho!==void 0&&(zi.lateralidad=ho===32?"right":"left");const to=E.value[2];to!==void 0&&No&&(to===3||(zi.teamselected=to===2?No.away_team:No.home_team)),zi._updateKey=Date.now()};if(d&&d.view&&d.view.componentProps){const zi=d.view.componentProps.game;ki(d.view.componentProps,zi),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}else if(((da=L.value)==null?void 0:da.id)===2){i.setDynamicFilters(E.value,(Un=d.view)==null?void 0:Un.id),i.updateDynamicFilters(E.value,(Xr=d.view)==null?void 0:Xr.id);const Ra=E.value[0];if(Ra!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.categoryId,d.view.filterMultiple.categoryId=Ra,d.view.componentProps)){let zi=`Category ${Ra}`,No=null;try{No=R4(Ra),No&&(zi=No.name)}catch{const Po=P.value.findIndex(ho=>ho.type==="select-simple"&&ho.label==="Tipo de análisis");if(Po!==-1){const ho=(((sn=P.value[Po])==null?void 0:sn.options)||[]).find(to=>to.value==Ra);ho&&(zi=ho.label)}}d.view.componentProps.categoryView=[{id:Ra,name:zi}],Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple})}const ki=E.value[1];ki!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.teamType,d.view.filterMultiple.teamType=ki,d.view.componentProps&&d.view.componentProps.game&&(ki===1?d.view.componentProps.teamView=d.view.componentProps.game.homeTeam.team_id:ki===2?d.view.componentProps.teamView=d.view.componentProps.game.awayTeam.team_id:d.view.componentProps.teamView=0),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}))}else if(((Sr=L.value)==null?void 0:Sr.id)===1){i.setDynamicFilters(E.value,(pn=d.view)==null?void 0:pn.id),i.updateDynamicFilters(E.value,(Hn=d.view)==null?void 0:Hn.id);const Ra=E.value[0];Ra!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.category,d.view.filterMultiple.category=Ra,d.view.componentProps&&(d.view.componentProps.type=Ra),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}))}else if(((An=L.value)==null?void 0:An.id)===6){i.setDynamicFilters(E.value,(ya=d.view)==null?void 0:ya.id),i.updateDynamicFilters(E.value,(va=d.view)==null?void 0:va.id);const Ra=E.value[0];Ra!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.gameNumber,d.view.filterMultiple.gameNumber=Ra,d.view.componentProps&&(d.view.componentProps.gameNumber=Ra,d.view._updateKey,d.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(jr=L.value)==null?void 0:jr.id,viewId:d.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:E.value}),e.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})}))}else if(((wr=L.value)==null?void 0:wr.id)===7){i.setDynamicFilters(E.value,(Wn=d.view)==null?void 0:Wn.id),i.updateDynamicFilters(E.value,(ha=d.view)==null?void 0:ha.id);const Ra=E.value[0],ki=E.value[1];if(Ra!==void 0&&d.view.componentProps){const zi=Ra===1?"offensive":"defensive";d.view.componentProps.analysisType=zi}if(ki!==void 0){d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.isHomeTeam;const zi=ki===1;d.view.filterMultiple.isHomeTeam=zi,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=zi,d.view._updateKey,d.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(ra=L.value)==null?void 0:ra.id,viewId:d.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:E.value}),e.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}}else if(((jn=L.value)==null?void 0:jn.id)===5){i.setDynamicFilters(E.value,(qa=d.view)==null?void 0:qa.id),i.updateDynamicFilters(E.value,(Oa=d.view)==null?void 0:Oa.id);const Ra=E.value[0];if(Ra!==void 0){d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.isHomeTeam;const ki=Ra===1?1:2;d.view.filterMultiple.isHomeTeam=ki,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=ki===1,d.view._updateKey,d.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(ti=L.value)==null?void 0:ti.id,viewId:d.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:E.value}),e.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}}else((Ka=L.value)==null?void 0:Ka.id)===9||(i.setDynamicFilters(E.value),i.updateDynamicFilters(E.value));e.nextTick(()=>{p.value=!1})}}function br(){var Ge,Je;if(!l||!l.dynamicFilters||!P.value)return!1;for(let hr=0;hr<l.dynamicFilters.length;hr++){const Nr=l.dynamicFilters[hr],Ir=P.value[hr],ln=E.value[hr];if(!(!Nr||!Ir)){if(Ir.type==="check"){if(Nr.isChecked!==ln)return!0}else if(Ir.type==="radio-button"){if(((Ge=Nr.selectedOption)==null?void 0:Ge.value)!==ln)return!0}else if(Ir.type==="select"){const Nn=((Je=Nr.selectedOptions)==null?void 0:Je.map(Gn=>Gn.value))||Nr.selectedValue||[],En=Array.isArray(ln)?ln:[];if(JSON.stringify(Nn)!==JSON.stringify(En))return!0}}}return!1}function cr(Ge){var Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr;if(E.value=Ge.filters,i){const pn=((Je=d==null?void 0:d.view)==null?void 0:Je.id)||null,Hn=((hr=L.value)==null?void 0:hr.id)===8&&y.isPostMatch?Jt():E.value;i.setDynamicFilters(Hn,pn),i.updateDynamicFilters(Hn,pn)}if(a.value&&d){Sd.emit("activate-save-button"),Sd.emit("force-component-update",{itemId:((Nr=d==null?void 0:d.view)==null?void 0:Nr.id)||null,componentProps:d.view.componentProps});const pn=((Ir=L.value)==null?void 0:Ir.id)===8&&y.isPostMatch?Jt():E.value;Sd.emit("dynamic-filters-changed",{containerViewId:((ln=d==null?void 0:d.view)==null?void 0:ln.id)||null,viewId:((Nn=d==null?void 0:d.view)==null?void 0:Nn.id)||null,dynamicFilters:pn}),Sd.emit("dynamic-filters-changed",{containerViewId:((En=d==null?void 0:d.view)==null?void 0:En.id)||null,viewId:((Gn=d==null?void 0:d.view)==null?void 0:Gn.id)||null,dynamicFilters:pn}),e.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}if(!a.value&&i&&((($n=L.value)==null?void 0:$n.id)===15||((ka=L.value)==null?void 0:ka.id)===17)&&i.getRequiresAddView(E.value,P.value)){i.setDynamicFilters(E.value),$("filters-changed",{main:h.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:{mainSelector:{id:((Hr=h.value)==null?void 0:Hr.id)||null,name:((Rr=h.value)==null?void 0:Rr.name)||null,url:((dn=h.value)==null?void 0:dn.url)||null},viewSelector:{id:((Mn=L.value)==null?void 0:Mn.id)||null,name:((da=L.value)==null?void 0:da.name)||((Un=L.value)==null?void 0:Un.title)||null,url:((Xr=L.value)==null?void 0:Xr.url)||null},team:Y.value,dynamicFilters:E.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!h.value,viewSelected:!!L.value,totalDynamicFilters:((sn=P.value)==null?void 0:sn.length)||0,activeFilters:((Sr=P.value)==null?void 0:Sr.filter((pn,Hn)=>{const An=E.value[Hn];return Array.isArray(An)?An.length>0:An!=null&&An!==!1}).length)||0}},filterAndViewsContainer:i,viewToEdit:d}),te();return}Ve()}function gr(Ge){Ge.filterIndex!==void 0&&Ge.value!==void 0&&(E.value[Ge.filterIndex]=Ge.value,a.value&&Ve(),te())}function Tr(){He()}function Pr(Ge){var Je,hr,Nr,Ir,ln,Nn,En;console.log("newFilters in onChangeFiltersAltMode:",Ge);const Gn={mainSelector:{id:((Je=h.value)==null?void 0:Je.id)||null,name:((hr=h.value)==null?void 0:hr.name)||null,url:((Nr=h.value)==null?void 0:Nr.url)||null},viewSelector:{id:((Ir=L.value)==null?void 0:Ir.id)||null,name:((ln=L.value)==null?void 0:ln.name)||((Nn=L.value)==null?void 0:Nn.title)||null,url:((En=L.value)==null?void 0:En.url)||null}};$("filters-changed",{filters:Ge.filters,view:Ge.view,viewToEdit:d,filterAndViewsContainer:i,filtersJSON:Gn,isAltMode:!0})}function qe(Ge){return JSON.parse(JSON.stringify(Ge))}return(Ge,Je)=>{var hr;return e.openBlock(),e.createElementBlock("div",Rre,[e.createElementVNode("button",Fre,e.toDisplayString(a.value?"Editando visualización":"Nueva visualización"),1),e.createElementVNode("div",{class:e.normalizeClass([{disabled:a.value},"custom-select main-select"]),onClick:_t},[e.createElementVNode("div",Ure,[e.createElementVNode("span",Ire,[h.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:xt(h.value.name,!1),alt:"icono",class:"option-img"},null,8,qre)):(e.openBlock(),e.createElementBlock("img",jre))]),h.value?(e.openBlock(),e.createElementBlock("span",Wre,e.toDisplayString(Pt()),1)):(e.openBlock(),e.createElementBlock("span",Dre,"Tipo de vista")),e.createElementVNode("span",{class:e.normalizeClass([{open:st.value},"arrow"])},[...Je[5]||(Je[5]=[e.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),st.value?(e.openBlock(),e.createElementBlock("div",Bre,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(Nr,Ir)=>(e.openBlock(),e.createElementBlock("div",{key:Nr.id,class:e.normalizeClass([{active:o.value===Ir},"option-card"]),onClick:e.withModifiers(ln=>jt(Ir),["stop"])},[e.createElementVNode("div",Xre,[e.createElementVNode("img",{"data-hover-src":xt(Nr.name,!0),src:xt(Nr.name,!1),alt:"icono",class:"option-img-34"},null,8,Gre)]),e.createElementVNode("div",Zre,[e.createElementVNode("div",Jre,e.toDisplayString(Nr.name),1),Nr.description?(e.openBlock(),e.createElementBlock("div",Hre,e.toDisplayString(Nr.description),1)):e.createCommentVNode("",!0)])],10,Kre))),128))])):e.createCommentVNode("",!0)],2),h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{disabled:a.value},"custom-select second-select"]),onClick:It},[e.createElementVNode("div",Yre,[e.createElementVNode("span",Qre,[L.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:L.value.url,alt:"icono",class:"option-img-graph2"},null,8,$re)):h.value?(e.openBlock(),e.createElementBlock("img",{key:1,src:xt(h.value.name,!1),alt:"icono",class:"option-img"},null,8,tne)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ene,e.toDisplayString(qt()),1),e.createElementVNode("span",{class:e.normalizeClass([{open:mt.value},"arrow"])},[...Je[6]||(Je[6]=[e.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),mt.value&&h.value?(e.openBlock(),e.createElementBlock("div",rne,[e.createElementVNode("div",nne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,Nr=>(e.openBlock(),e.createElementBlock("div",{key:Nr.id,class:e.normalizeClass([{active:k.value===Nr.id},"option-card-grid"]),onClick:e.withModifiers(Ir=>Rt(Nr),["stop"])},[Nr.id===17?(e.openBlock(),e.createElementBlock("div",ine,[...Je[7]||(Je[7]=[e.createElementVNode("div",null,"Tiros de esquina",-1),e.createElementVNode("div",null,"tendencia general",-1)])])):Nr.id===18?(e.openBlock(),e.createElementBlock("div",one,[...Je[8]||(Je[8]=[e.createElementVNode("div",null,"Tactica fija",-1),e.createElementVNode("div",null,"jugadas especificas",-1)])])):(e.openBlock(),e.createElementBlock("div",sne,e.toDisplayString(Nr.name||Nr.title),1)),e.createElementVNode("div",lne,[e.createElementVNode("img",{src:Nr.url,alt:"icono",class:"option-img-grid"},null,8,cne)])],10,ane))),128))])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("div",une)):e.createCommentVNode("",!0),L.value&&L.value.id===13?(e.openBlock(),e.createBlock(XYt,{key:2,"component-id":13,filters:P.value,"initial-values":a.value?e.unref(l).dynamicFilters:E.value,"is-edit-mode":a.value,onFiltersChanged:cr,onFilterUpdated:gr},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===16?(e.openBlock(),e.createBlock(a$t,{key:3,"default-filters":e.unref(d)?e.unref(d).view.filterMultiple:null,"is-edit-mode":!!e.unref(d),"is-post-match":t.isPostMatch,"view-config":qe(f.value.get(16)),onChange:Pr,onRemoveViews:Tr},null,8,["default-filters","is-edit-mode","is-post-match","view-config"])):L.value&&L.value.id===18?(e.openBlock(),e.createBlock(cte,{key:4,"default-filters":e.unref(d)?e.unref(d).view.filterMultiple:null,"view-config":qe(f.value.get(18)),"is-post-match":t.isPostMatch,onChange:Pr,onRemoveViews:Tr},null,8,["default-filters","view-config","is-post-match"])):L.value&&L.value.id===15?(e.openBlock(),e.createBlock(uQt,{key:5,"component-id":15,filters:P.value,"initial-values":a.value?e.unref(l).dynamicFilters:E.value,"is-edit-mode":a.value,onFiltersChanged:cr,onFilterUpdated:gr},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===17?(e.openBlock(),e.createBlock(Are,{key:6,"component-id":17,"default-filters":e.unref(d)?e.unref(d).view.filterMultiple:null,filters:P.value,"initial-values":a.value?e.unref(l).dynamicFilters:E.value,"is-edit-mode":a.value,"view-config":qe(f.value.get(17)),onChange:Pr,onFiltersChanged:cr,onFilterUpdated:gr,onRemoveViews:Tr},null,8,["default-filters","filters","initial-values","is-edit-mode","view-config"])):L.value&&P.value&&D()?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":P.value.length>=2&&!(((hr=L.value)==null?void 0:hr.id)===8&&t.isPostMatch)}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(Nr,Ir)=>{var ln;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Ir},[Nr.type==="select"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:e.withModifiers(Nn=>Wt(Ir),["stop"])},[e.createElementVNode("div",pne,[Je[10]||(Je[10]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Je[11]||(Je[11]=e.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(E.value[Ir])&&E.value[Ir].length>0?(e.openBlock(),e.createElementBlock("span",hne,e.toDisplayString(E.value[Ir].length),1)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass([{open:yt.value===Ir},"arrow"])},[...Je[9]||(Je[9]=[e.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),yt.value===Ir?(e.openBlock(),e.createElementBlock("div",fne,[e.createElementVNode("div",mne,[e.createElementVNode("div",{class:"multi-select-header",onClick:Je[1]||(Je[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",yne,[e.createElementVNode("input",{checked:j(Ir),indeterminate:F(Ir),type:"checkbox",onChange:e.withModifiers(Nn=>O(Ir),["stop"]),onClick:Je[0]||(Je[0]=e.withModifiers(()=>{},["stop"]))},null,40,gne),Je[12]||(Je[12]=e.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nr.options,Nn=>(e.openBlock(),e.createElementBlock("div",{key:Nn.value,class:e.normalizeClass([{active:V(Ir,Nn.value)},"option-card multi-select-option"]),onClick:Je[2]||(Je[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",vne,[e.createElementVNode("input",{checked:V(Ir,Nn.value),type:"checkbox",onChange:e.withModifiers(En=>I(Ir,Nn.value),["stop"])},null,40,bne)]),e.createElementVNode("div",{class:"option-content",onClick:En=>I(Ir,Nn.value)},[e.createElementVNode("div",_ne,e.toDisplayString(Nn.label),1)],8,xne)],2))),128))]),e.createElementVNode("div",wne,[e.createElementVNode("button",{class:"btn-listo",onClick:Je[3]||(Je[3]=e.withModifiers(Nn=>ir(),["stop"]))},"Listo")])])):e.createCommentVNode("",!0)],8,dne)):Nr.type==="radio-button"&&!(((ln=L.value)==null?void 0:ln.id)===8&&t.isPostMatch)?(e.openBlock(),e.createElementBlock("div",Tne,[e.createElementVNode("div",Sne,e.toDisplayString(Nr.label),1),e.createElementVNode("div",kne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nr.options,Nn=>(e.openBlock(),e.createElementBlock("label",{key:Nn.value,class:e.normalizeClass([{active:E.value[Ir]===Nn.value},"radio-option-card"])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":En=>E.value[Ir]=En,disabled:X(Nn.value,Nn.label),name:"dynamic-radio-"+Ir,value:Nn.value,type:"radio",onChange:()=>{var En,Gn,$n;if(((En=L.value.value)==null?void 0:En.id)===9&&a.value.value&&($n=(Gn=e.unref(d))==null?void 0:Gn.view)!=null&&$n.filterMultiple){const ka=E.value[Ir]===1;e.unref(d).view.filterMultiple.isHomeTeam=ka}a.value.value&&Ve(),te()}},null,40,Lne),[[e.vModelRadio,E.value[Ir]]]),e.createElementVNode("span",null,e.toDisplayString(Nn.label),1)],2))),128))])])):Nr.type==="check"?(e.openBlock(),e.createElementBlock("div",Cne,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Nn=>E.value[Ir]=Nn,checked:E.value[Ir],type:"checkbox",onChange:Je[4]||(Je[4]=()=>{a.value.value&&Ve(),te()})},null,40,Nne),[[e.vModelCheckbox,E.value[Ir]]]),e.createTextVNode(" "+e.toDisplayString(Nr.label),1)])])):Nr.type==="select-simple"?(e.openBlock(),e.createElementBlock("div",{key:3,"data-filter-type":Nr.type,class:"custom-select dynamic-select filter-inline",onClick:e.withModifiers(Nn=>re(Ir),["stop"])},[e.createElementVNode("div",Ene,[Je[14]||(Je[14]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Je[15]||(Je[15]=e.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),e.createElementVNode("span",{class:e.normalizeClass([{open:bt.value===Ir},"arrow"])},[...Je[13]||(Je[13]=[e.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),bt.value===Ir?(e.openBlock(),e.createElementBlock("div",zne,[e.createElementVNode("div",Mne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nr.options,Nn=>(e.openBlock(),e.createElementBlock("div",{key:Nn.value,class:e.normalizeClass([{active:E.value[Ir]===Nn.value},"option-card simple-select-option"]),onMouseenter:En=>pr(Ir,Nn.value),onClick:e.withModifiers(En=>le(Ir,Nn.value),["stop"])},[e.createElementVNode("div",Pne,[e.createElementVNode("div",Ane,e.toDisplayString(Nn.label),1)]),E.value[Ir]===Nn.value?(e.openBlock(),e.createElementBlock("div",Rne,[...Je[16]||(Je[16]=[e.createElementVNode("svg",{fill:"none",height:"16",viewBox:"0 0 16 16",width:"16"},[e.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])])):e.createCommentVNode("",!0)],42,Vne))),128))])])):e.createCommentVNode("",!0)],8,One)):e.createCommentVNode("",!0),Ir===1&&P.value.length>2?(e.openBlock(),e.createElementBlock("div",Fne)):e.createCommentVNode("",!0)],64)}),128))],2)):e.createCommentVNode("",!0),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:8,class:"cancel-btn",onClick:He},"Cancelar")),S.value?(e.openBlock(),e.createElementBlock("button",{key:9,class:"ok-btn",onClick:Xe},"OK")):e.createCommentVNode("",!0)])}}}),Ine=e2(Une,[["__scopeId","data-v-863a4862"]]),qne={key:0,class:"modal-simple"},jne={class:"modal-simple__content"},Dne={class:"modal-simple__content__header"},Wne={class:"modal-simple__content__body"},Bne={class:"modal-simple__content__footer"},Kne={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(t){return(r,n)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.modelValue?(e.openBlock(),e.createElementBlock("div",qne,[e.createElementVNode("div",jne,[e.createElementVNode("div",Dne,[e.renderSlot(r.$slots,"header",{},void 0,!0)]),e.createElementVNode("div",Wne,[e.renderSlot(r.$slots,"body",{},void 0,!0)]),e.createElementVNode("div",Bne,[e.renderSlot(r.$slots,"footer",{},void 0,!0)])])])):e.createCommentVNode("",!0)]))}},Xne=e2(Kne,[["__scopeId","data-v-1cc4f590"]]),Gne={class:"footer"},Zne={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(t,{emit:r}){const n=r;function y(f){n("update:modelValue",f)}function $(f){n("action",f),n("update:modelValue",!1)}return(f,u)=>(e.openBlock(),e.createBlock(Xne,{"modle-value":t.value,"onUpdate:modelValue":y},{header:e.withCtx(()=>[...u[2]||(u[2]=[e.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:e.withCtx(()=>[...u[3]||(u[3]=[e.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:e.withCtx(()=>[e.createElementVNode("div",Gne,[e.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:u[0]||(u[0]=i=>$(!1))}," Seguir editando "),e.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:u[1]||(u[1]=i=>$(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},Jne=e2(Zne,[["__scopeId","data-v-ed9b5088"]]),Hne={key:0,class:"modal-simple"},Yne={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(t){return(r,n)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,null,{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",Hne,[...n[0]||(n[0]=[e.createElementVNode("div",{class:"modal-simple__content"},[e.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),e.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):e.createCommentVNode("",!0)]),_:1})]))}},Qne=e2(Yne,[["__scopeId","data-v-2bc30783"]]),$ne={class:"template-maker__header"},tae={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eae={class:"template-maker__content"},rae={class:"template-maker__content__main"},nae={id:"containerMain",class:"container-main"},aae={class:"template-maker__content__main__cover-selector"},iae=["id"],oae={class:"page-indicator"},sae={class:"page-indicator__index"},lae=["onClick"],cae=["onClick"],uae={key:0,class:"template-maker__content__main__footer"},dae={class:"template-maker__content__main__footer__paginator"},pae={class:"template-maker__content__main__footer__paginator__nav"},hae={class:"template-maker__content__main__footer__paginator__numbers"},fae=["onClick"],mae={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(t,{expose:r,emit:n}){const y=new Map,$=e.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:{}}]}]),f=e.ref(null),u=e.ref(0),i=e.ref(!1),d=e.ref(null),l=e.ref(null),a=e.ref(!0),S=e.ref(!1),T=e.ref(!1),b=e.ref(0),p=e.ref(!1),s=e.ref(null),c=e.ref(new Map),o=e.ref(null),h=e.ref(null),v=e.ref(!1),k=e.ref(!1),L=e.ref(!1),E=new Map,P=new Map,V=e.computed(()=>({"--overflow-y-template-maker":S.value?"scroll":"hidden","--height-container-main":S.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(S.value,"0")})),I=e.computed(()=>u.value+1);e.watch(()=>i.value,tr=>{const Fe=document.getElementById("app");tr?(u.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Fe&&(Fe.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Fe&&(Fe.style.overflow=""))});function j(tr){return tr<10?`0${tr}`:tr}async function F({templateId:tr,userId:Fe}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Fe}/templates/${tr}`,{method:"GET",headers:{Authorization:he.token}})).json()).data}catch(sr){console.error("Error fetching template by ID:",sr)}}async function D({reportId:tr,userId:Fe}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Fe}/reports/${tr}`,{method:"GET",headers:{Authorization:he.token}})).json()).data}catch(sr){console.error("Error fetching report by ID:",sr)}}let U=0;function M(tr){f.value=tr,U>0&&(v.value=!0),U++}function X(tr){tr&&te(null,!0)}let O=null;function Y(tr,Fe){let sr=tr.getBoundingClientRect(),Ye={height:tr.clientHeight,width:tr.clientWidth},Te=Fe.getBoundingClientRect();if(!(Te.top>=sr.top&&Te.bottom<=sr.top+Ye.height)){const Re=Te.top-sr.top,Ve=Te.bottom-sr.bottom;Math.abs(Re)<Math.abs(Ve)?tr.scrollTop+=Re:tr.scrollTop+=Ve}}function st(tr,Fe){let sr=tr.getBoundingClientRect();const Ye=Fe.getBoundingClientRect().top-sr.top;tr.scrollTop+=Ye}function mt(tr,Fe=!1){const sr={title:`Page ${$.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(Xe(),tr!==void 0&&tr>=-1?$.value.splice(tr+1,0,sr):$.value.push(sr),e.nextTick(()=>{const Ye=$.value.findIndex(Re=>Re.id===sr.id),Te=document.getElementById(`page-${Ye+1}`);O||(O=document.getElementById("containerMain")),Te&&O?Y(O,Te):console.error("Page element or container main element not found")}),Fe)return sr;v.value=!0}function yt(tr){if(tr<0||tr>$.value.length)return;u.value=tr;const Fe=document.getElementById(`page-${tr}`);if(O||(O=document.getElementById("containerMain")),Fe&&O){const sr=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(sr),st(O,Fe),setTimeout(()=>{const Ye=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Ye)},300)}else console.error("Page element or container main element not found")}function bt(tr){o.value=tr,p.value=!0}function xt(tr,Fe){const sr=Fe+1;tr&&u.value!==sr&&(u.value=sr)}function Pt(tr){p.value=!0,Sd.emit("edit-view",{view:tr})}async function qt({templateReportId:tr,userId:Fe,isTemplateMode:sr}){try{return sr?F({templateId:tr,userId:Fe}):D({reportId:tr,userId:Fe})}catch(Ye){throw new Error("Error fetching template or report by ID: "+Ye.message)}}function _t(){U=0,p.value=!1,u.value=0,o.value=null,h.value=null,c.value.clear(),O=null,d.value=null,l.value=null,f.value=null,b.value=0,$.value=[],T.value=!1,v.value=!1,k.value=!1,L.value=!1,E.forEach(tr=>clearTimeout(tr)),E.clear(),P.forEach(tr=>clearTimeout(tr)),P.clear(),It=[],y.clear()}let It=[];async function jt(tr){if(_t(),a.value=tr.isTemplateMode,S.value=!!tr.isPDFMode,tr.isPDFMode?d.value=await D({reportId:tr.reportId,userId:tr.userId}):(d.value=tr.template,d.value=await qt({templateReportId:tr.template.id,userId:tr.template.user_id,isTemplateMode:tr.isTemplateMode})),!d.value)return;d.value&&d.value.game&&(d.value.game=Jt(d.value.game)),l.value=JSON.parse(JSON.stringify(d.value)),T.value=d.value.template_type===2;const Fe=d.value.pages.find(sr=>sr.is_front_page);b.value=Fe?Fe.type:1,i.value=!0,tr.isTemplateMode||(It=await le(d.value)),$.value=d.value.pages.reduce((sr,Ye,Te)=>{if(!Ye.is_front_page){Ye.name||(Ye.name="");const Re=Te,Ve={originalPage:JSON.parse(JSON.stringify(Ye)),title:Ye.name,id:`p-${Date.now()-Te*9}`,items:[],components:Ye.components};Ye.components&&Ye.components.length>0&&(Ve.items=Ye.components.reduce((br,cr,gr)=>{const Tr=new Yk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],cr.coreView.id,cr.dynamicFilters,T.value,a.value,cr.filtersJSON||null,he.token,cr.filters),Pr={originalComponent:JSON.parse(JSON.stringify(cr)),title:cr.title,shortTitle:cr.shortTitle||cr.title,game:d.value.game,idAux:cr.id,id:`w-${Date.now()-gr*7}`,x:cr.column,y:cr.row,w:cr.colspan,h:cr.rowspan,maxWidth:cr.max_column,maxHeight:cr.max_row,minWidth:cr.min_column,minHeight:cr.min_row,noResize:!a.value,noMove:!a.value,coreView:cr.coreView||null,isTemplateMode:a.value,componentName:cr.componentName,componentProps:re({currentProps:cr.componentProps,coreView:cr.coreView,isTemplateMode:a.value,templateToEdit:d.value,filterMultiple:cr.filterMultiple||null,game:d.value.game||null,dynamicFilters:cr.dynamicFilters,page:Re,componentId:gr})||{},filterMultiple:cr.filterMultiple,isHomeTeam:Wt({game:d.value.game,isTemplateMode:a.value,currentIsHomeTeam:cr.isHomeTeam||cr.componentProps.isHomeTeamForAnalysis}),filtersJSON:cr.filtersJSON||null,dynamicFilters:cr.dynamicFilters||[],filterAndViewsContainer:Tr};if(Pr.componentProps.isViewNull)return br;const qe=e.reactive({view:Pr});return Tr.addView(qe,!0),c.value.set(Tr.getId(),Tr),br.push(Pr),br},[])),sr.push(Ve)}return sr},[])}function Rt({game:tr,isTemplateMode:Fe}){const sr=tr&&tr.homeTeam&&tr.awayTeam&&(tr.homeTeam.team_id===he.userTeamId||tr.awayTeam.team_id===he.userTeamId);return{isUserTeamHome:sr&&tr.homeTeam.team_id===he.userTeamId,requiresUserTeamAdjustment:sr&&!Fe}}function Wt({game:tr,isTemplateMode:Fe,currentIsHomeTeam:sr}){const{isUserTeamHome:Ye,requiresUserTeamAdjustment:Te}=Rt({game:tr,isTemplateMode:Fe});return Te?sr?Ye:!Ye:sr}function re({currentProps:tr,coreView:Fe,templateToEdit:sr,isTemplateMode:Ye,filterMultiple:Te,game:Re,dynamicFilters:Ve,page:br,componentId:cr}){var gr,Tr,Pr,qe,Ge,Je,hr,Nr,Ir,ln;if(!tr||!Fe)return tr||{};const{isUserTeamHome:Nn,requiresUserTeamAdjustment:En}=Rt({game:Re,isTemplateMode:Ye});let Gn={...tr};if(Fe.id===5){if(Gn.isGhostEffect=Ye,En){const $n=Gn.preMatchType===1;Gn.preMatchType=$n?Nn?1:2:Nn?2:1}Re&&(Gn.game=Re)}if(Fe.id===7){if(En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}Re&&(Gn.game=Re)}if(Fe.id===9){if(En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}Re&&(Gn.game=Re)}if(Fe.id===18){if(!Ye&&En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}if(!Ye){Gn.teamIdForAnalysis=Gn.isHomeTeamForAnalysis?Re.home_team:Re.visiting_team;const $n=It.findIndex(Hr=>((Gn.isAgainstMode?1:0)===Hr.is_against||Hr.is_against===Gn.isAgainstMode)&&Gn.teamIdForAnalysis===Hr.team_id);let ka=null;$n!==-1&&(ka={...It[$n]},It.splice($n,1)),ka?(Gn.specificPlaysCornersData=ka,Gn.playIdForAnalysis=ka.play_id,Gn.gameIdForAnalysis=ka.game_id,Gn.seasonIdForAnalysis=ka.season_id||Re.season_id,Gn.isTemplateMode=Ye,Gn.isGameOnly=!0,Gn.isCornerInfoVisible=!0):(Gn.isNullCornerData=!0,Gn.isViewNull=!0)}}if(Fe.id===16){if(!Ye&&En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}if(!Ye){Gn.isPreMatch=!T.value,Gn.isTemplateMode=Ye,Gn.seasonId=sr.season_id,Gn.teamIdForAnalysis=Gn.isHomeTeamForAnalysis?sr.game.home_team:sr.game.visiting_team;const $n=Gn.isHomeTeamForAnalysis?sr.last_games.last_home_games:sr.last_games.last_visiting_games;T.value?Gn.gamesIdsForAnalysis=[sr.game.game_id]:Gn.howManyGames?Gn.gamesIdsForAnalysis=$n.slice(0,Gn.howManyGames).map(ka=>ka.game_id):(Gn.gamesIdsForAnalysis=[],Gn.gameDataUTC=sr.game.date_time_utc)}}if(Fe.id===10){if(En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}Re&&(Gn.game=Re)}if(Fe.id===1&&(Gn.gameId=Re?Re.id:"",Gn.homeLogo=Re?Re.homeTeam.logo:"",Gn.awayLogo=Re?Re.awayTeam.logo:"",Gn.seasonId=Re?Re.season_id:0,Gn.default=Ye),Fe.id===6&&(Gn.game=Re||"",Gn.lastGames=sr.last_games,Gn.selectedOption=sr.template_type===2?"Postmatch":"Prematch"),Fe.id===13){Gn.isdefault=Ye,Gn.seasonid=Re?Re.seasonId:2010,Gn.datetimeutc=Re?sr.template_type===1?Re?Re.date_time_utc:"":null:"",Gn.teamids=Re?[Re.home_team,Re.visiting_team]:[1,2],Gn.categoryids=Ve?Ve[1]:[20,2];const $n=((gr=sr==null?void 0:sr.game)==null?void 0:gr.home_team)||(Re==null?void 0:Re.home_team)||0,ka=((Tr=sr==null?void 0:sr.game)==null?void 0:Tr.visiting_team)||(Re==null?void 0:Re.visiting_team)||0;let Hr=[1,2];if(Re&&Ve&&Ve[2]!==void 0?Ve[2]===3?Te&&Te.isHomeTeam!==void 0?Te.isHomeTeam?Hr=[En?Nn?$n:ka:$n]:Hr=[En?Nn?ka:$n:ka]:Hr=En?[Nn?$n:ka,Nn?ka:$n]:[$n,ka]:Ve[2]===1?Hr=[En?Nn?$n:ka:$n]:Ve[2]===2&&(Hr=[En?Nn?ka:$n:ka]):Ve&&Ve[2]!==void 0?Hr=Ve[2]===3?[1,2]:[Ve[2]]:Hr=[1,2],Gn.teamsshow=Hr,Gn.analysistype=Ve?Ve[0]:[],Gn.gameid=sr.template_type===1?null:Re?Re.id:"",Re){const Rr=[{id:Re.home_team,name:Re.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Re.home_team+".png"},{id:Re.visiting_team,name:Re.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Re.visiting_team+".png"}],dn=new Map(Rr.map(Mn=>[Mn.id,Mn]));Gn.teams=Hr.map(Mn=>dn.get(Mn)).filter(Mn=>Mn!==void 0)}else Gn.teams=[]}if(Fe.id===15){const $n=((Pr=sr==null?void 0:sr.game)==null?void 0:Pr.home_team)||(Re==null?void 0:Re.home_team)||0,ka=((qe=sr==null?void 0:sr.game)==null?void 0:qe.visiting_team)||(Re==null?void 0:Re.visiting_team)||0;let Hr=2;!Ye&&Re&&(Te&&Te.isHomeTeam!==void 0?Te.isHomeTeam?Hr=En?Nn?$n:ka:$n:Hr=En?Nn?ka:$n:ka:Ve&&Ve[2]!==void 0&&(Ve[2]===1?Hr=En?Nn?$n:ka:$n:Ve[2]===2&&(Hr=En?Nn?ka:$n:ka))),Gn.view=1,Gn.token=he.token,Gn.numitems=Ve?Ve[1]:3,Gn.isdefault=Ye,Gn.reportid=sr!=null&&sr.id?sr.id:0,Gn.userid=sr!=null&&sr.user_id?sr.user_id:0,Gn.page=br+1,Gn.typegame=T.value?2:1,Gn.componentid=cr+1,Gn.data={season:Re?Re.seasonId:2010,type:2,game:Re?Re.id:0,team:Hr}}if(Fe.id===17){Gn.game=Re?{id:Re.id||Re.game_id||Re.gameId||null,home_team:Re.home_team||null,away_team:Re.visiting_team||null,season:Re.seasonId||Re.season_id||null,game_status:Re.game_status||Re.status||null,home_acronym:Re.home_team_acronym||((Ge=Re.homeTeam)==null?void 0:Ge.acronym)||null,away_acronym:Re.visiting_team_acronym||((Je=Re.awayTeam)==null?void 0:Je.acronym)||null,logo_home:((hr=Re.homeTeam)==null?void 0:hr.logo)||null,logo_away:((Nr=Re.awayTeam)==null?void 0:Nr.logo)||null}:null,Gn.infavoragainstteam=Ve?!Ve[0]:!0,Gn.forseason=!T.value,Gn.forteam=!1,Gn.tournamentselected=sr!=null&&sr.tournament_id?{id:sr.tournament_id}:{id:1},Gn.forgame=!!T.value,Gn.lateralidad=Ve&&Ve[1]==32?"right":"left";const $n=((Ir=sr==null?void 0:sr.game)==null?void 0:Ir.home_team)||(Re==null?void 0:Re.home_team)||0,ka=((ln=sr==null?void 0:sr.game)==null?void 0:ln.visiting_team)||(Re==null?void 0:Re.visiting_team)||0;let Hr=0;Ve&&Ve[2]!==void 0&&(Ve[2]===3?Te&&Te.isHomeTeam!==void 0&&(Te.isHomeTeam?Hr=En?Nn?$n:ka:$n:Hr=En?Nn?ka:$n:ka):Ve[2]===1?Hr=En?Nn?$n:ka:$n:Ve[2]===2&&(Hr=En?Nn?ka:$n:ka)),Gn.teamselected=Hr;const Rr=Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][4]!==void 0?Array.isArray(Ve[3][4])?Ve[3][4].filter(dn=>dn!=="rematado-destino-porteria").reduce((dn,Mn)=>(Mn==="fue-gol"?dn.push(583,585,587,589):Mn==="no-fue-gol"?dn.push(584,586,588,590):Mn==="rematado-sin-destino-porteria"?dn.push(125,131,139,145):Mn==="sin-destino"?dn.push(122,128,136,142):Mn==="ganados-por-portero-rival"?dn.push(123,129,137,143):Mn==="ganados-por-jugador-rival"&&dn.push(124,130,138,144),dn),[]):[]:[];Gn.filters={isMoment:!0,final:[1,2,3],moment:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][0]!==void 0?Array.isArray(Ve[3][0])?Ve[3][0].map(dn=>dn==="iba-ganando"?1:dn==="iba-empatado"?3:dn==="iba-perdiendo"?2:dn):[]:[],playingAs:[1,2],sections:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][1]!==void 0?Array.isArray(Ve[3][1])?Ve[3][1].map(dn=>dn==="0-15"?1:dn==="16-30"?2:dn==="31-45"?3:dn==="46-60"?4:dn==="61-75"?5:dn==="76-90"?6:dn):[]:[],games:T.value?[Re==null?void 0:Re.game_id]:[],players:[],cornertype:Ve&&Ve[1]!==void 0?Ve[1]:null,howWas:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][2]!==void 0?Array.isArray(Ve[3][2])?Ve[3][2].filter(dn=>dn!=="izquierda"&&dn!=="derecha").map(dn=>{const Mn=Ve[1];return dn==="comba-afuera"?Mn==32?134:120:dn==="comba-adentro"?Mn==32?140:126:dn==="raz-area"?Mn==32?146:327:dn==="en-corto"?Mn==32?147:133:dn}):[]:[],zona:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][3]!==void 0?Array.isArray(Ve[3][3])?Ve[3][3]:[]:[],whathappened:Rr,isWhatHappenedFull:Array.isArray(Rr)&&Rr.length===24,isZoneFull:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][3]!==void 0&&Array.isArray(Ve[3][3])?Ve[3][3].length===35:!1},Gn.showBallGo=!0,Gn.showHeatMap=!0,Gn.ballOnOff="OFF",Gn.showdefault=Ye}if(Fe.id===14&&(Gn.isReports=!0,Gn.isDefault=Ye,Gn.type=sr.tournament_type==1?1:0,Gn.typeView=1,Gn.tournament=sr.tournament_id,Gn.currentSeason=Re?Re.season_id:0,Gn.currentSeasonId=Re?Re.season_id:0,Gn.showVideos=!1,Gn.localTeam=Re?Re.home_team:0,Gn.awayTeam=Re?Re.visiting_team:0),Fe.id===3&&(Gn.defaultShields=Ye,Re&&(Gn.game=Re)),Fe.id===2){let $n=!0,ka=0,Hr=0;Re&&($n=sr.main_team==Re.home_team||sr.main_team==Re.visiting_team,ka=$n?sr.main_team==(Re==null?void 0:Re.home_team)?Re==null?void 0:Re.home_team:Re==null?void 0:Re.visiting_team:Re==null?void 0:Re.home_team,Hr=$n?sr.main_team==(Re==null?void 0:Re.home_team)?Re==null?void 0:Re.visiting_team:Re==null?void 0:Re.home_team:Re==null?void 0:Re.visiting_team),Gn.gamed=Re?Re.id:"",Gn.game=Re||"",Gn.season=Re?Re.season_id:0,Gn.teamView=Te.teamType==3?0:Te.teamType==1?ka:Hr,Gn.useDummyData=Ye}if(Fe.id===8&&(Gn.isDefault=Ye,Re)){Gn.game=Re;const $n=Re.home_team||0,ka=Re.visiting_team||Re.away_team||0;let Hr=$n;Te&&Te.isHomeTeam!==void 0&&Ve&&Ve[1]===3?Te&&Te.isHomeTeam!==void 0&&(Te.isHomeTeam?Hr=En?Nn?$n:ka:$n:Hr=En?Nn?ka:$n:ka):Ve&&Ve[1]!==void 0&&(Ve[1]===1?Hr=En?Nn?$n:ka:$n:Ve[1]===2&&(Hr=En?Nn?ka:$n:ka)),Gn.teamSelected={teamId:Hr}}return Fe.id===4&&(Gn.gameId=Re?Re.id:"",Gn.isDefault=Ye,Gn.homeTeam=Re?Re==null?void 0:Re.home_team:"",Gn.awayTeam=Re?Re==null?void 0:Re.visiting_team:""),Gn}async function le(tr){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${tr.user_id}/reports/${tr.id}/specific-plays-corners`,{method:"GET",headers:{Authorization:he.token}})).json()).data}catch(Fe){return console.error("Error fetching specific plays:",Fe),[]}}const he=t,de=n;e.watch(()=>he.token,(tr,Fe)=>{},{immediate:!0}),r({show:jt}),Sd.on("add-page-view",tr=>{y.set(tr.view.id,tr.view);const Fe=$.value.find(sr=>sr.id===tr.pageId);Fe&&(Fe.items||(Fe.items=[]),Fe.items.push(tr.view),e.nextTick(()=>{const sr=document.querySelector(`[gs-id="${tr.view.id}"]`);tr.grid.makeWidget(sr)}))}),Sd.on("add-page-and-view",tr=>{const Fe=$.value.findIndex(sr=>sr.id===tr.pageId);if(Fe>-1){const sr=mt(Fe,!0);setTimeout(()=>{Sd.emit("add-view",{pageId:sr.id,view:tr.view,filterAndWidgetContainer:tr.filterAndWidgetContainer}),h.value&&(sr.stepBackPage=h.value),h.value=sr},500)}else console.error("Page not found for adding view:",tr.pageId)}),Sd.on("empty-page",tr=>{p.value&&o.value&&o.value.id===tr.id||(He(tr),h.value&&h.value.id===tr.id&&(h.value.stepBackPage?h.value=h.value.stepBackPage:h.value=null))}),Sd.on("filters-cancelled",tr=>{tr&&tr.removeAllChildViews()}),Sd.on("activate-save-button",()=>{v.value=!0});function Jt(tr){return{...tr,gameId:tr.game_id,id:tr.game_id,seasonId:tr.season_id,status:tr.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${tr.home_team}.png`,team_id:tr.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${tr.home_team}.png`,colloquial_name:tr.home_team_name,acronym:tr.home_team_acronym,team_name:tr.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${tr.visiting_team}.png`,team_id:tr.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${tr.visiting_team}.png`,colloquial_name:tr.visiting_team_name,acronym:tr.visiting_team_acronym,team_name:tr.visiting_team_name}}}function te(tr,Fe=!1){Fe||!a.value?(i.value=!1,_t(),de("close")):v.value?k.value=!0:(i.value=!1,_t(),de("close"))}function ne(){s.value=null,p.value=!1}function Le({page:tr,view:Fe,applyMinimumSize:sr=!1}){const Ye=tr.grid;if(!tr||!Fe||!Ye)return null;const Te=sr?{w:Fe.min_column,h:Fe.min_row}:{w:Fe.colspan,h:Fe.rowspan},Re=Ye.willItFit(Te);return Re?{willFit:Re,applyMinimumSize:sr}:sr?null:Le({page:tr,view:Fe,applyMinimumSize:!0})}const Oe=new Set([9]);function Ne(tr){var Fe,sr,Ye,Te,Re,Ve,br,cr,gr,Tr,Pr,qe,Ge,Je,hr,Nr,Ir,ln,Nn;if(tr.dynamicFilters&&tr.dynamicFilters.length>0&&tr.viewToEdit&&tr.viewToEdit.view){const En=tr.viewToEdit.view.id;$.value.forEach(Gn=>{Gn.items.forEach($n=>{$n.id===En&&$n.coreView&&$n.coreView.id===3&&($n.componentProps.desplegable=tr.dynamicFilters[0]||!1,$n.componentProps.key=tr.dynamicFilters[0]||!1,e.nextTick(()=>{Sd.emit("force-component-update",{itemId:$n.id,componentProps:$n.componentProps})}))})})}if(tr.viewToEdit){if(!tr.viewToEdit.view.filterAndViewsContainer){const En=new Yk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[tr.viewToEdit],((Fe=tr.viewToEdit.view.coreView)==null?void 0:Fe.id)||tr.viewToEdit.view.id,tr.dynamicFilters||[],T.value,a.value,tr.filtersJSON,he.token,tr.filters);tr.viewToEdit.view.filterAndViewsContainer=En}tr.viewToEdit.view.filterAndViewsContainer.updateView({view:tr.viewToEdit,dynamicFilters:tr.dynamicFilters||[],filtersJSON:tr.filtersJSON||null,filters:tr.filters}),v.value=!0}else if(tr.view){tr.view.id&&tr.filterAndViewsContainer&&tr.view.id!==tr.filterAndViewsContainer.viewId&&(tr.filterAndViewsContainer.removeAllChildViews(),tr.filterAndViewsContainer.setViewId(tr.view.id),tr.filterAndViewsContainer.setFiltersJSON(tr.filtersJSON||null)),tr.view.id&&Oe.has(tr.view.id)&&tr.dynamicFilters[0]&&tr.dynamicFilters[0].length===0&&tr.filterAndViewsContainer&&(tr.filterAndViewsContainer.updateDynamicFilters(tr.dynamicFilters,(Ye=(sr=tr.viewToEdit)==null?void 0:sr.view)==null?void 0:Ye.id),v.value=!0);const En=h.value||o.value,Gn=Le({page:En,view:tr.view,applyMinimumSize:!1});tr.view.filtersJSON=tr.filtersJSON||null;const $n=tr.filterAndViewsContainer,ka=$.value.findIndex(Hr=>Hr.id===En.id);if($n){const Hr=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters,tr.filters);if(((Te=tr.view)==null?void 0:Te.id)===15){const Rr=(Re=tr.filterAndViewsContainer)==null?void 0:Re.getId();if(Rr&&E.has(Rr)){const dn=E.get(Rr);clearTimeout(dn),E.delete(Rr)}}if(((Ve=tr.view)==null?void 0:Ve.id)===17){const Rr=(br=tr.filterAndViewsContainer)==null?void 0:br.getId();if(Rr&&P.has(Rr)){const dn=P.get(Rr);clearTimeout(dn),P.delete(Rr)}}if(Hr){if($n.setFilters(tr.filters),$n.setDynamicFilters(tr.dynamicFilters),Gn||ka===$.value.length-1){Sd.emit("add-view",{pageId:En.id,view:tr.view,filterAndWidgetContainer:$n,avoidWillFit:!1,applyMinimumSize:Gn?Gn.applyMinimumSize:!1,dynamicFilters:tr.dynamicFilters,filters:tr.filters}),tr.filterAndViewsContainer.updateDynamicFilters(tr.dynamicFilters,(gr=(cr=tr.viewToEdit)==null?void 0:cr.view)==null?void 0:gr.id),v.value=!0;let Rr=null;if(((Tr=tr.view)==null?void 0:Tr.id)===15?(e.nextTick(()=>{var dn;const Mn=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters,tr.filters);((dn=tr.dynamicFilters)==null?void 0:dn[0])===3&&Mn&&Ne(tr)}),Rr=setTimeout(()=>{var dn,Mn;const da=(dn=tr.filterAndViewsContainer)==null?void 0:dn.getId();da&&E.delete(da);const Un=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters);((Mn=tr.dynamicFilters)==null?void 0:Mn[0])===3&&Un&&Ne(tr)},200)):((Pr=tr.view)==null?void 0:Pr.id)===17?(e.nextTick(()=>{var dn,Mn;const da=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters,tr.filters),Un=(dn=tr.dynamicFilters)==null?void 0:dn[0],Xr=(Mn=tr.dynamicFilters)==null?void 0:Mn[2];(Un===3||Xr===3)&&da&&Ne(tr)}),Rr=setTimeout(()=>{var dn,Mn,da;const Un=(dn=tr.filterAndViewsContainer)==null?void 0:dn.getId();Un&&P.delete(Un);const Xr=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters),sn=(Mn=tr.dynamicFilters)==null?void 0:Mn[0],Sr=(da=tr.dynamicFilters)==null?void 0:da[2];(sn===3||Sr===3)&&Xr&&Ne(tr)},200)):Rr=setTimeout(()=>{tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters,tr.filters)&&Ne(tr)},1e3),((qe=tr.view)==null?void 0:qe.id)===15&&Rr){const dn=(Ge=tr.filterAndViewsContainer)==null?void 0:Ge.getId();dn&&E.set(dn,Rr)}if(((Je=tr.view)==null?void 0:Je.id)===17&&Rr){const dn=(hr=tr.filterAndViewsContainer)==null?void 0:hr.getId();dn&&P.set(dn,Rr)}}}else tr.isAltMode?tr.viewToEdit||tr.filterAndViewsContainer.updateFilters(tr.filters,(Ir=(Nr=tr.viewToEdit)==null?void 0:Nr.view)==null?void 0:Ir.id):tr.filterAndViewsContainer.updateDynamicFilters(tr.dynamicFilters,(Nn=(ln=tr.viewToEdit)==null?void 0:ln.view)==null?void 0:Nn.id),v.value=!0}else if(Gn||ka===$.value.length-1){const Hr=new Yk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],tr.view.id,tr.dynamicFilters,T.value,a.value,tr.filtersJSON,he.token,tr.filters);Sd.emit("set-filter-and-views-container",Hr),c.value.set(Hr.getId(),Hr);const Rr=tr.dynamicFilters&&(tr.dynamicFilters[0]===3||tr.dynamicFilters[2]===3)&&(tr.view.id===15||tr.view.id===17);tr.dynamicFilters&&(Array.isArray(tr.dynamicFilters[0])||Rr)?(tr.filterAndViewsContainer=Hr,Ne(tr)):Sd.emit("add-view",{pageId:En.id,view:tr.view,filterAndWidgetContainer:Hr,avoidWillFit:!1,applyMinimumSize:Gn?Gn.applyMinimumSize:!1,dynamicFilters:tr.dynamicFilters,filters:tr.filters}),v.value=!0}}}async function Pe(){if(v.value)try{const tr=[{is_front_page:!0,template_type:f.value.isPostMatch?2:1,type:f.value.id},...$.value.map(sr=>({columns:sr.originalPage?sr.originalPage.columns:12,rows:sr.originalPage?sr.originalPage.rows:12,gap:sr.originalPage?sr.originalPage.gap:10,name:sr.title,width:sr.originalPage?sr.originalPage.width:968,height:sr.originalPage?sr.originalPage.height:702,components:sr.items.reduce((Ye,Te)=>(Te.isDeleted||Ye.push({min_column:Te.minWidth,min_row:Te.minHeight,max_column:Te.maxWidth,max_row:Te.maxHeight,column:Te.x,row:Te.y,colspan:Te.w,rowspan:Te.h,name:Te.name,title:Te.title,titleShort:Te.titleShort||Te.title,dynamicFilters:Te.filterAndViewsContainer.getComponentDynamicFilters(Te.id)||Te.filterAndViewsContainer.getDynamicFilters()||[],coreView:Te.coreView||null,componentName:Te.componentName,componentProps:Te.componentProps||{},isHomeTeam:Te.isHomeTeam||Te.componentProps.isHomeTeamForAnalysis,filterMultiple:Te.filterMultiple}),Ye),[])}))];console.log("pagesAux to save:",tr);const Fe=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${d.value.user_id}/templates/${d.value.id}/pages`,{method:"PATCH",headers:{Authorization:he.token},body:JSON.stringify({pages:tr})});L.value=!0,await Fe.json(),v.value=!1,setTimeout(()=>{L.value=!1},2e3)}catch(tr){console.error("Error saving template:",tr)}}function Xe(){$.value.forEach(tr=>{tr.offListeners&&tr.offListeners()})}function He(tr){const Fe=$.value.findIndex(sr=>sr.id===tr.id);Fe>-1&&(Xe(),$.value=$.value.filter(sr=>sr.id!==tr.id),u.value>=Fe&&(u.value=Math.max(0,u.value-1)),v.value=!0)}function $e(){v.value=!0}function ir(tr){const Fe=$.value.find(sr=>sr.items.some(Ye=>Ye.id===tr.id));if(Fe){const sr=Fe.items.find(Ye=>Ye.id===tr.id);sr&&(sr.isDeleted=!0,v.value=!0)}}function pr(tr){}return(tr,Fe)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Jne,{modelValue:k.value,"onUpdate:modelValue":Fe[0]||(Fe[0]=sr=>k.value=sr),onAction:X},null,8,["modelValue"]),e.createVNode(Qne,{"model-value":L.value},null,8,["model-value"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.value&&d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"template-maker",style:e.normalizeStyle(V.value)},[e.withDirectives(e.createVNode(Ine,{token:t.token,view:s.value,"is-post-match":T.value,onClose:ne,onFiltersChanged:Ne},null,8,["token","view","is-post-match"]),[[e.vShow,a.value&&p.value]]),e.createElementVNode("div",$ne,[e.createTextVNode(e.toDisplayString(d.value?d.value.name:"Nuevo template")+" ",1),e.createElementVNode("div",{class:"template-maker__header__close",onClick:te},[S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",tae,[...Fe[6]||(Fe[6]=[e.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),e.createElementVNode("div",eae,[Fe[13]||(Fe[13]=e.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),e.createElementVNode("div",rae,[e.createElementVNode("div",nae,[e.createElementVNode("div",aae,[e.withDirectives(e.createVNode(_Q,{"is-post-match":T.value,"initial-cover-id":b.value,onSelectCover:M},null,8,["is-post-match","initial-cover-id"]),[[e.vShow,a.value]])]),(e.openBlock(),e.createElementBlock("div",{class:"template-maker__content__main__pages",key:$.value.length},[f.value?(e.openBlock(),e.createBlock(OYt,{key:0,id:"page-0",game:d.value.game||null,"cover-id":f.value.id,"is-post-match":f.value.isPostMatch,onIntersectionChanged:Fe[1]||(Fe[1]=sr=>xt(sr,-1))},null,8,["game","cover-id","is-post-match"])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"new-items-buttons",style:e.normalizeStyle({"margin-bottom":$.value.length===0?"30px":"0"})},[p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Fe[2]||(Fe[2]=sr=>mt(-1))},[...Fe[7]||(Fe[7]=[e.createElementVNode("div",null,"+ Nueva página",-1),e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(sr,Ye)=>(e.openBlock(),e.createElementBlock("div",{key:Ye,id:`page-${Ye+1}`,class:"template-maker__content__main__pages__page"},[e.createElementVNode("div",oae,[e.createElementVNode("div",sae,"Pag "+e.toDisplayString(j(Ye+2)),1)]),f.value?(e.openBlock(),e.createBlock(zHt,{key:0,page:sr,"is-template-mode":a.value,"is-post-match":f.value.isPostMatch,game:d.value.game||null,lastGames:d.value.lastGames||[],"is-filter-visible":p.value,onEditView:Pt,onIntersectionChanged:Te=>xt(Te,Ye),onChangeSort:pr,onDeletePage:He,onViewChanged:$e,onDeleteView:ir},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):e.createCommentVNode("",!0),a.value&&!p.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"new-items-buttons",style:e.normalizeStyle({"margin-bottom":Ye+1===$.value.length?"30px":"0","margin-top":"10px"})},[e.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Te=>mt(Ye)},[...Fe[8]||(Fe[8]=[e.createElementVNode("div",null,"+ Nueva página",-1),e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,lae),e.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Te=>bt(sr)},[...Fe[9]||(Fe[9]=[e.createElementVNode("div",null,"+ Agregar gráfico",-1),e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,cae)],4)):e.createCommentVNode("",!0)],8,iae))),128))]))]),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",uae,[e.createElementVNode("div",dae,[e.createElementVNode("div",pae,[e.createElementVNode("div",null,"Páginas "+e.toDisplayString(I.value),1),e.createElementVNode("div",{class:e.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value<=0}]),onClick:Fe[3]||(Fe[3]=sr=>u.value>0&&yt(u.value-1))},[...Fe[10]||(Fe[10]=[e.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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),e.createElementVNode("div",{class:e.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value>=$.value.length}]),onClick:Fe[4]||(Fe[4]=sr=>u.value<$.value.length&&yt(u.value+1))},[...Fe[11]||(Fe[11]=[e.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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)]),e.createElementVNode("div",hae,[e.createElementVNode("div",{role:"button",class:e.normalizeClass({active:u.value===0}),onClick:Fe[5]||(Fe[5]=sr=>yt(0))},e.toDisplayString(j(1)),3),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(sr,Ye)=>(e.openBlock(),e.createElementBlock("div",{role:"button",key:Ye,class:e.normalizeClass({active:Ye+1===u.value}),onClick:Te=>yt(Ye+1)},e.toDisplayString(j(Ye+2)),11,fae))),128))])]),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,role:"button",class:e.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!v.value}]),onClick:Pe},[...Fe[12]||(Fe[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),e.createElementVNode("div",null,"Guardar",-1)])],2)):e.createCommentVNode("",!0)]))])])],4)):e.createCommentVNode("",!0)]))],64))}},yae=e2(mae,[["__scopeId","data-v-9f0e485c"]]);function BZ(t,r){return function(){return t.apply(r,arguments)}}const{toString:gae}=Object.prototype,{getPrototypeOf:fA}=Object,{iterator:CO,toStringTag:KZ}=Symbol,NO=(t=>r=>{const n=gae.call(r);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Yw=t=>(t=t.toLowerCase(),r=>NO(r)===t),OO=t=>r=>typeof r===t,{isArray:$k}=Array,t7=OO("undefined");function d9(t){return t!==null&&!t7(t)&&t.constructor!==null&&!t7(t.constructor)&&Q_(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const XZ=Yw("ArrayBuffer");function vae(t){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(t):r=t&&t.buffer&&XZ(t.buffer),r}const bae=OO("string"),Q_=OO("function"),GZ=OO("number"),p9=t=>t!==null&&typeof t=="object",xae=t=>t===!0||t===!1,EO=t=>{if(NO(t)!=="object")return!1;const r=fA(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(KZ in t)&&!(CO in t)},_ae=t=>{if(!p9(t)||d9(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},wae=Yw("Date"),Tae=Yw("File"),Sae=t=>!!(t&&typeof t.uri<"u"),kae=t=>t&&typeof t.getParts<"u",Lae=Yw("Blob"),Cae=Yw("FileList"),Nae=t=>p9(t)&&Q_(t.pipe);function Oae(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const ZZ=Oae(),JZ=typeof ZZ.FormData<"u"?ZZ.FormData:void 0,Eae=t=>{let r;return t&&(JZ&&t instanceof JZ||Q_(t.append)&&((r=NO(t))==="formdata"||r==="object"&&Q_(t.toString)&&t.toString()==="[object FormData]"))},zae=Yw("URLSearchParams"),[Mae,Vae,Pae,Aae]=["ReadableStream","Request","Response","Headers"].map(Yw),Rae=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function h9(t,r,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let y,$;if(typeof t!="object"&&(t=[t]),$k(t))for(y=0,$=t.length;y<$;y++)r.call(null,t[y],y,t);else{if(d9(t))return;const f=n?Object.getOwnPropertyNames(t):Object.keys(t),u=f.length;let i;for(y=0;y<u;y++)i=f[y],r.call(null,t[i],i,t)}}function HZ(t,r){if(d9(t))return null;r=r.toLowerCase();const n=Object.keys(t);let y=n.length,$;for(;y-- >0;)if($=n[y],r===$.toLowerCase())return $;return null}const OS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,YZ=t=>!t7(t)&&t!==OS;function mA(){const{caseless:t,skipUndefined:r}=YZ(this)&&this||{},n={},y=($,f)=>{if(f==="__proto__"||f==="constructor"||f==="prototype")return;const u=t&&HZ(n,f)||f;EO(n[u])&&EO($)?n[u]=mA(n[u],$):EO($)?n[u]=mA({},$):$k($)?n[u]=$.slice():(!r||!t7($))&&(n[u]=$)};for(let $=0,f=arguments.length;$<f;$++)arguments[$]&&h9(arguments[$],y);return n}const Fae=(t,r,n,{allOwnKeys:y}={})=>(h9(r,($,f)=>{n&&Q_($)?Object.defineProperty(t,f,{value:BZ($,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,f,{value:$,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:y}),t),Uae=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Iae=(t,r,n,y)=>{t.prototype=Object.create(r.prototype,y),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:r.prototype}),n&&Object.assign(t.prototype,n)},qae=(t,r,n,y)=>{let $,f,u;const i={};if(r=r||{},t==null)return r;do{for($=Object.getOwnPropertyNames(t),f=$.length;f-- >0;)u=$[f],(!y||y(u,t,r))&&!i[u]&&(r[u]=t[u],i[u]=!0);t=n!==!1&&fA(t)}while(t&&(!n||n(t,r))&&t!==Object.prototype);return r},jae=(t,r,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=r.length;const y=t.indexOf(r,n);return y!==-1&&y===n},Dae=t=>{if(!t)return null;if($k(t))return t;let r=t.length;if(!GZ(r))return null;const n=new Array(r);for(;r-- >0;)n[r]=t[r];return n},Wae=(t=>r=>t&&r instanceof t)(typeof Uint8Array<"u"&&fA(Uint8Array)),Bae=(t,r)=>{const y=(t&&t[CO]).call(t);let $;for(;($=y.next())&&!$.done;){const f=$.value;r.call(t,f[0],f[1])}},Kae=(t,r)=>{let n;const y=[];for(;(n=t.exec(r))!==null;)y.push(n);return y},Xae=Yw("HTMLFormElement"),Gae=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,y,$){return y.toUpperCase()+$}),QZ=(({hasOwnProperty:t})=>(r,n)=>t.call(r,n))(Object.prototype),Zae=Yw("RegExp"),$Z=(t,r)=>{const n=Object.getOwnPropertyDescriptors(t),y={};h9(n,($,f)=>{let u;(u=r($,f,t))!==!1&&(y[f]=u||$)}),Object.defineProperties(t,y)},Jae=t=>{$Z(t,(r,n)=>{if(Q_(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const y=t[n];if(Q_(y)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Hae=(t,r)=>{const n={},y=$=>{$.forEach(f=>{n[f]=!0})};return $k(t)?y(t):y(String(t).split(r)),n},Yae=()=>{},Qae=(t,r)=>t!=null&&Number.isFinite(t=+t)?t:r;function $ae(t){return!!(t&&Q_(t.append)&&t[KZ]==="FormData"&&t[CO])}const tie=t=>{const r=new Array(10),n=(y,$)=>{if(p9(y)){if(r.indexOf(y)>=0)return;if(d9(y))return y;if(!("toJSON"in y)){r[$]=y;const f=$k(y)?[]:{};return h9(y,(u,i)=>{const d=n(u,$+1);!t7(d)&&(f[i]=d)}),r[$]=void 0,f}}return y};return n(t,0)},eie=Yw("AsyncFunction"),rie=t=>t&&(p9(t)||Q_(t))&&Q_(t.then)&&Q_(t.catch),tJ=((t,r)=>t?setImmediate:r?((n,y)=>(OS.addEventListener("message",({source:$,data:f})=>{$===OS&&f===n&&y.length&&y.shift()()},!1),$=>{y.push($),OS.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Q_(OS.postMessage)),nie=typeof queueMicrotask<"u"?queueMicrotask.bind(OS):typeof process<"u"&&process.nextTick||tJ,nu={isArray:$k,isArrayBuffer:XZ,isBuffer:d9,isFormData:Eae,isArrayBufferView:vae,isString:bae,isNumber:GZ,isBoolean:xae,isObject:p9,isPlainObject:EO,isEmptyObject:_ae,isReadableStream:Mae,isRequest:Vae,isResponse:Pae,isHeaders:Aae,isUndefined:t7,isDate:wae,isFile:Tae,isReactNativeBlob:Sae,isReactNative:kae,isBlob:Lae,isRegExp:Zae,isFunction:Q_,isStream:Nae,isURLSearchParams:zae,isTypedArray:Wae,isFileList:Cae,forEach:h9,merge:mA,extend:Fae,trim:Rae,stripBOM:Uae,inherits:Iae,toFlatObject:qae,kindOf:NO,kindOfTest:Yw,endsWith:jae,toArray:Dae,forEachEntry:Bae,matchAll:Kae,isHTMLForm:Xae,hasOwnProperty:QZ,hasOwnProp:QZ,reduceDescriptors:$Z,freezeMethods:Jae,toObjectSet:Hae,toCamelCase:Gae,noop:Yae,toFiniteNumber:Qae,findKey:HZ,global:OS,isContextDefined:YZ,isSpecCompliantForm:$ae,toJSONObject:tie,isAsyncFn:eie,isThenable:rie,setImmediate:tJ,asap:nie,isIterable:t=>t!=null&&Q_(t[CO])};let Rf=class pQ extends Error{static from(r,n,y,$,f,u){const i=new pQ(r.message,n||r.code,y,$,f);return i.cause=r,i.name=r.name,r.status!=null&&i.status==null&&(i.status=r.status),u&&Object.assign(i,u),i}constructor(r,n,y,$,f){super(r),Object.defineProperty(this,"message",{value:r,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),y&&(this.config=y),$&&(this.request=$),f&&(this.response=f,this.status=f.status)}toJSON(){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:nu.toJSONObject(this.config),code:this.code,status:this.status}}};Rf.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Rf.ERR_BAD_OPTION="ERR_BAD_OPTION",Rf.ECONNABORTED="ECONNABORTED",Rf.ETIMEDOUT="ETIMEDOUT",Rf.ERR_NETWORK="ERR_NETWORK",Rf.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Rf.ERR_DEPRECATED="ERR_DEPRECATED",Rf.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Rf.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Rf.ERR_CANCELED="ERR_CANCELED",Rf.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Rf.ERR_INVALID_URL="ERR_INVALID_URL";const aie=null;function yA(t){return nu.isPlainObject(t)||nu.isArray(t)}function eJ(t){return nu.endsWith(t,"[]")?t.slice(0,-2):t}function gA(t,r,n){return t?t.concat(r).map(function($,f){return $=eJ($),!n&&f?"["+$+"]":$}).join(n?".":""):r}function iie(t){return nu.isArray(t)&&!t.some(yA)}const oie=nu.toFlatObject(nu,{},null,function(r){return/^is[A-Z]/.test(r)});function zO(t,r,n){if(!nu.isObject(t))throw new TypeError("target must be an object");r=r||new FormData,n=nu.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(s,c){return!nu.isUndefined(c[s])});const y=n.metaTokens,$=n.visitor||a,f=n.dots,u=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&nu.isSpecCompliantForm(r);if(!nu.isFunction($))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(nu.isDate(p))return p.toISOString();if(nu.isBoolean(p))return p.toString();if(!d&&nu.isBlob(p))throw new Rf("Blob is not supported. Use a Buffer instead.");return nu.isArrayBuffer(p)||nu.isTypedArray(p)?d&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function a(p,s,c){let o=p;if(nu.isReactNative(r)&&nu.isReactNativeBlob(p))return r.append(gA(c,s,f),l(p)),!1;if(p&&!c&&typeof p=="object"){if(nu.endsWith(s,"{}"))s=y?s:s.slice(0,-2),p=JSON.stringify(p);else if(nu.isArray(p)&&iie(p)||(nu.isFileList(p)||nu.endsWith(s,"[]"))&&(o=nu.toArray(p)))return s=eJ(s),o.forEach(function(v,k){!(nu.isUndefined(v)||v===null)&&r.append(u===!0?gA([s],k,f):u===null?s:s+"[]",l(v))}),!1}return yA(p)?!0:(r.append(gA(c,s,f),l(p)),!1)}const S=[],T=Object.assign(oie,{defaultVisitor:a,convertValue:l,isVisitable:yA});function b(p,s){if(!nu.isUndefined(p)){if(S.indexOf(p)!==-1)throw Error("Circular reference detected in "+s.join("."));S.push(p),nu.forEach(p,function(o,h){(!(nu.isUndefined(o)||o===null)&&$.call(r,o,nu.isString(h)?h.trim():h,s,T))===!0&&b(o,s?s.concat(h):[h])}),S.pop()}}if(!nu.isObject(t))throw new TypeError("data must be an object");return b(t),r}function rJ(t){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(y){return r[y]})}function vA(t,r){this._pairs=[],t&&zO(t,this,r)}const nJ=vA.prototype;nJ.append=function(r,n){this._pairs.push([r,n])},nJ.toString=function(r){const n=r?function(y){return r.call(this,y,rJ)}:rJ;return this._pairs.map(function($){return n($[0])+"="+n($[1])},"").join("&")};function sie(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aJ(t,r,n){if(!r)return t;const y=n&&n.encode||sie,$=nu.isFunction(n)?{serialize:n}:n,f=$&&$.serialize;let u;if(f?u=f(r,$):u=nu.isURLSearchParams(r)?r.toString():new vA(r,$).toString(y),u){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+u}return t}class iJ{constructor(){this.handlers=[]}use(r,n,y){return this.handlers.push({fulfilled:r,rejected:n,synchronous:y?y.synchronous:!1,runWhen:y?y.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){nu.forEach(this.handlers,function(y){y!==null&&r(y)})}}const bA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},lie={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:vA,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xA=typeof window<"u"&&typeof document<"u",_A=typeof navigator=="object"&&navigator||void 0,cie=xA&&(!_A||["ReactNative","NativeScript","NS"].indexOf(_A.product)<0),uie=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",die=xA&&window.location.href||"http://localhost",Wx={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xA,hasStandardBrowserEnv:cie,hasStandardBrowserWebWorkerEnv:uie,navigator:_A,origin:die},Symbol.toStringTag,{value:"Module"})),...lie};function pie(t,r){return zO(t,new Wx.classes.URLSearchParams,{visitor:function(n,y,$,f){return Wx.isNode&&nu.isBuffer(n)?(this.append(y,n.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)},...r})}function hie(t){return nu.matchAll(/\w+|\[(\w*)]/g,t).map(r=>r[0]==="[]"?"":r[1]||r[0])}function fie(t){const r={},n=Object.keys(t);let y;const $=n.length;let f;for(y=0;y<$;y++)f=n[y],r[f]=t[f];return r}function oJ(t){function r(n,y,$,f){let u=n[f++];if(u==="__proto__")return!0;const i=Number.isFinite(+u),d=f>=n.length;return u=!u&&nu.isArray($)?$.length:u,d?(nu.hasOwnProp($,u)?$[u]=[$[u],y]:$[u]=y,!i):((!$[u]||!nu.isObject($[u]))&&($[u]=[]),r(n,y,$[u],f)&&nu.isArray($[u])&&($[u]=fie($[u])),!i)}if(nu.isFormData(t)&&nu.isFunction(t.entries)){const n={};return nu.forEachEntry(t,(y,$)=>{r(hie(y),$,n,0)}),n}return null}function mie(t,r,n){if(nu.isString(t))try{return(r||JSON.parse)(t),nu.trim(t)}catch(y){if(y.name!=="SyntaxError")throw y}return(n||JSON.stringify)(t)}const f9={transitional:bA,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){const y=n.getContentType()||"",$=y.indexOf("application/json")>-1,f=nu.isObject(r);if(f&&nu.isHTMLForm(r)&&(r=new FormData(r)),nu.isFormData(r))return $?JSON.stringify(oJ(r)):r;if(nu.isArrayBuffer(r)||nu.isBuffer(r)||nu.isStream(r)||nu.isFile(r)||nu.isBlob(r)||nu.isReadableStream(r))return r;if(nu.isArrayBufferView(r))return r.buffer;if(nu.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let i;if(f){if(y.indexOf("application/x-www-form-urlencoded")>-1)return pie(r,this.formSerializer).toString();if((i=nu.isFileList(r))||y.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return zO(i?{"files[]":r}:r,d&&new d,this.formSerializer)}}return f||$?(n.setContentType("application/json",!1),mie(r)):r}],transformResponse:[function(r){const n=this.transitional||f9.transitional,y=n&&n.forcedJSONParsing,$=this.responseType==="json";if(nu.isResponse(r)||nu.isReadableStream(r))return r;if(r&&nu.isString(r)&&(y&&!this.responseType||$)){const u=!(n&&n.silentJSONParsing)&&$;try{return JSON.parse(r,this.parseReviver)}catch(i){if(u)throw i.name==="SyntaxError"?Rf.from(i,Rf.ERR_BAD_RESPONSE,this,null,this.response):i}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wx.classes.FormData,Blob:Wx.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};nu.forEach(["delete","get","head","post","put","patch"],t=>{f9.headers[t]={}});const yie=nu.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"]),gie=t=>{const r={};let n,y,$;return t&&t.split(`
7993
+ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),y}static addGrid(r,n={}){if(!r)return null;let y=r;if(y.gridstack){const $=y.gridstack;return n&&($.opts={...$.opts,...n}),n.children!==void 0&&$.load(n.children),$}return(!r.classList.contains("grid-stack")||Rh.addRemoveCB)&&(Rh.addRemoveCB?y=Rh.addRemoveCB(r,n,!0,!0):y=ru.createDiv(["grid-stack",n.class],r)),Rh.init(n,y)}static registerEngine(r){Rh.engineClass=r}get placeholder(){if(!this._placeholder){this._placeholder=ru.createDiv([this.opts.placeholderClass,S3.itemClass,this.opts.itemClass]);const r=ru.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(r.textContent=this.opts.placeholderText)}return this._placeholder}constructor(r,n={}){var y;this.el=r,this.opts=n,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},r.gridstack=this,this.opts=n=n||{},r.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),n.row&&(n.minRow=n.maxRow=n.row,delete n.row);const $=ru.toNumber(r.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const f=n.columnOpts;if(f){const a=f.breakpoints;!f.columnWidth&&!(a!=null&&a.length)?delete n.columnOpts:(f.columnMax=f.columnMax||12,(a==null?void 0:a.length)>1&&a.sort((S,T)=>(T.w||0)-(S.w||0)))}const u={...ru.cloneDeep(S3),column:ru.toNumber(r.getAttribute("gs-column"))||S3.column,minRow:$||ru.toNumber(r.getAttribute("gs-min-row"))||S3.minRow,maxRow:$||ru.toNumber(r.getAttribute("gs-max-row"))||S3.maxRow,staticGrid:ru.toBool(r.getAttribute("gs-static"))||S3.staticGrid,sizeToContent:ru.toBool(r.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||S3.draggable.handle},removableOptions:{accept:n.itemClass||S3.removableOptions.accept,decline:S3.removableOptions.decline}};r.getAttribute("gs-animate")&&(u.animate=ru.toBool(r.getAttribute("gs-animate"))),n=ru.defaults(n,u),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(n),n.rtl==="auto"&&(n.rtl=r.style.direction==="rtl"),n.rtl&&this.el.classList.add("grid-stack-rtl");const i=this.el.closest("."+S3.itemClass),d=i==null?void 0:i.gridstackNode;if(d&&(d.subGrid=this,this.parentGridNode=d,this.el.classList.add("grid-stack-nested"),d.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=n.cellHeight==="auto",this._isAutoCellHeight||n.cellHeight==="initial")this.cellHeight(void 0);else{typeof n.cellHeight=="number"&&n.cellHeightUnit&&n.cellHeightUnit!==S3.cellHeightUnit&&(n.cellHeight=n.cellHeight+n.cellHeightUnit,delete n.cellHeightUnit);const a=n.cellHeight;delete n.cellHeight,this.cellHeight(a)}n.alwaysShowResizeHandle==="mobile"&&(n.alwaysShowResizeHandle=Hw),this._setStaticClass();const l=n.engineClass||Rh.engineClass||A4;if(this.engine=new l({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:a=>{a.forEach(S=>{const T=S.el;T&&(S._removeDOM?(T&&T.remove(),delete S._removeDOM):this._writePosAttr(T,S))}),this._updateContainerHeight()}}),n.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(a=>this._prepareElement(a)),delete this.engine._loading,this.batchUpdate(!1)),n.children){const a=n.children;delete n.children,a.length&&this.load(a)}this.setAnimation(),n.subGridDynamic&&!Of.pauseDrag&&(Of.pauseDrag=!0),((y=n.draggable)==null?void 0:y.pause)!==void 0&&(Of.pauseDrag=n.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(r=this.opts){this.el.classList.add("gs-"+r.column),typeof r.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/r.column}%`)}addWidget(r){if(!r)return;if(typeof r=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(r.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(r);let n,y=r;if(y.grid=this,y.el?n=y.el:Rh.addRemoveCB?n=Rh.addRemoveCB(this.el,r,!0,!1):n=this.createWidgetDivs(y),!n)return;if(y=n.gridstackNode,y&&n.parentElement===this.el&&this.engine.nodes.find(f=>f._id===y._id))return n;const $=this._readAttr(n);return ru.defaults(r,$),this.engine.prepareNode(r),this.el.appendChild(n),this.makeWidget(n,r),n}createWidgetDivs(r){const n=ru.createDiv(["grid-stack-item",this.opts.itemClass]),y=ru.createDiv(["grid-stack-item-content"],n);return ru.lazyLoad(r)?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([$])=>{var f,u;$.isIntersecting&&((f=r.visibleObservable)==null||f.disconnect(),delete r.visibleObservable,Rh.renderCB(y,r),(u=r.grid)==null||u.prepareDragDrop(r.el))}),window.setTimeout(()=>{var $;return($=r.visibleObservable)==null?void 0:$.observe(n)})):Rh.renderCB(y,r),n}makeSubGrid(r,n,y,$=!0){var f,u,i;let d=r.gridstackNode;if(d||(d=this.makeWidget(r).gridstackNode),(f=d.subGrid)!=null&&f.el)return d.subGrid;let l,a=this;for(;a&&!l;)l=(u=a.opts)==null?void 0:u.subGridOpts,a=(i=a.parentGridNode)==null?void 0:i.grid;n=ru.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...n||d.subGridOpts||{}}),d.subGridOpts=n;let S;n.column==="auto"&&(S=!0,n.column=Math.max(d.w||1,(y==null?void 0:y.w)||1),delete n.columnOpts);let T=d.el.querySelector(".grid-stack-item-content"),b,p;if($&&(this._removeDD(d.el),p={...d,x:0,y:0},ru.removeInternalForSave(p),delete p.subGridOpts,d.content&&(p.content=d.content,delete d.content),Rh.addRemoveCB?b=Rh.addRemoveCB(this.el,p,!0,!1):(b=ru.createDiv(["grid-stack-item"]),b.appendChild(T),T=ru.createDiv(["grid-stack-item-content"],d.el)),this.prepareDragDrop(d.el)),y){const c=S?n.column:d.w,o=d.h+y.h,h=d.el.style;h.transition="none",this.update(d.el,{w:c,h:o}),setTimeout(()=>h.transition=null)}const s=d.subGrid=Rh.addGrid(T,n);return y!=null&&y._moving&&(s._isTemp=!0),S&&(s._autoColumn=!0),$&&s.makeWidget(b,p),y&&(y._moving?window.setTimeout(()=>ru.simulateMouseEvent(y._event,"mouseenter",s.el),0):s.makeWidget(d.el,d)),this.resizeToContentCheck(!1,d),s}removeAsSubGrid(r){var n;const y=(n=this.parentGridNode)==null?void 0:n.grid;y&&(y.batchUpdate(),y.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach($=>{$.x+=this.parentGridNode.x,$.y+=this.parentGridNode.y,y.makeWidget($.el,$)}),y.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,r&&window.setTimeout(()=>ru.simulateMouseEvent(r._event,"mouseenter",y.el),0))}save(r=!0,n=!1,y=Rh.saveCB,$){const f=this.engine.save(r,y,$);if(f.forEach(u=>{var i;if(r&&u.el&&!u.subGrid&&!y){const d=u.el.querySelector(".grid-stack-item-content");u.content=d==null?void 0:d.innerHTML,u.content||delete u.content}else if(!r&&!y&&delete u.content,(i=u.subGrid)!=null&&i.el){const d=u.w||u.subGrid.getColumn(),l=u.subGrid.save(r,n,y,d);u.subGridOpts=n?l:{children:l},delete u.subGrid}delete u.el}),n){const u=ru.cloneDeep(this.opts);u.marginBottom===u.marginTop&&u.marginRight===u.marginLeft&&u.marginTop===u.marginRight&&(u.margin=u.marginTop,delete u.marginTop,delete u.marginRight,delete u.marginBottom,delete u.marginLeft),u.rtl===(this.el.style.direction==="rtl")&&(u.rtl="auto"),this._isAutoCellHeight&&(u.cellHeight="auto"),this._autoColumn&&(u.column="auto");const i=u._alwaysShowResizeHandle;return delete u._alwaysShowResizeHandle,i!==void 0?u.alwaysShowResizeHandle=i:delete u.alwaysShowResizeHandle,ru.removeInternalAndSame(u,S3),u.children=f,u}return f}load(r,n=Rh.addRemoveCB||!0){r=ru.cloneDeep(r);const y=this.getColumn();r.forEach(a=>{a.w=a.w||a.minW||1,a.h=a.h||a.minH||1}),r=ru.sort(r),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let $=0;r.forEach(a=>{$=Math.max($,(a.x||0)+a.w)}),$>this.engine.defaultColumn&&(this.engine.defaultColumn=$),$>y&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=r,this.engine.columnChanged($,y,this.responseLayout),r=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(r,$,!0));const f=Rh.addRemoveCB;typeof n=="function"&&(Rh.addRemoveCB=n);const u=[];this.batchUpdate();const i=!this.engine.nodes.length,d=i&&this.opts.animate;d&&this.setAnimation(!1),!i&&n&&[...this.engine.nodes].forEach(a=>{a.id&&(ru.find(r,a.id)||(Rh.addRemoveCB&&Rh.addRemoveCB(this.el,a,!1,!1),u.push(a),this.removeWidget(a.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(a=>ru.find(r,a.id)?(l.push(a),!1):!0),r.forEach(a=>{var S;const T=ru.find(l,a.id);if(T){if(ru.shouldSizeToContent(T)&&(a.h=T.h),this.engine.nodeBoundFix(a),(a.autoPosition||a.x===void 0||a.y===void 0)&&(a.w=a.w||T.w,a.h=a.h||T.h,this.engine.findEmptyPosition(a)),this.engine.nodes.push(T),ru.samePos(T,a)&&this.engine.nodes.length>1&&(this.moveNode(T,{...a,forceCollide:!0}),ru.copyPos(a,T)),this.update(T.el,a),(S=a.subGridOpts)!=null&&S.children){const b=T.el.querySelector(".grid-stack");b&&b.gridstack&&b.gridstack.load(a.subGridOpts.children)}}else n&&this.addWidget(a)}),delete this.engine._loading,this.engine.removedNodes=u,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,f?Rh.addRemoveCB=f:delete Rh.addRemoveCB,d&&this.setAnimation(!0,!0),this}batchUpdate(r=!0){return this.engine.batchUpdate(r),r||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(r=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!r||!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 n=this.el.querySelector("."+this.opts.itemClass);if(n){const $=ru.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/$)}const y=parseInt(this.el.getAttribute("gs-current-row"));return y?Math.round(this.el.getBoundingClientRect().height/y):this.opts.cellHeight}cellHeight(r){if(r!==void 0&&this._isAutoCellHeight!==(r==="auto")&&(this._isAutoCellHeight=r==="auto",this._updateResizeEvent()),(r==="initial"||r==="auto")&&(r=void 0),r===void 0){const y=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;r=this.cellWidth()+y}const n=ru.parseHeight(r);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h?this:(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.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(r=!1){var n;return r&&(n=this.opts.columnOpts)!=null&&n.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var r,n;const y=this.opts.columnOpts;if(!y||!y.columnWidth&&!((r=y.breakpoints)!=null&&r.length))return!1;const $=this.getColumn();let f=$;const u=this._widthOrContainer(!0);if(y.columnWidth)f=Math.min(Math.round(u/y.columnWidth)||1,y.columnMax);else{f=y.columnMax;let i=0;for(;i<y.breakpoints.length&&u<=y.breakpoints[i].w;)f=y.breakpoints[i++].c||$}if(f!==$){const i=(n=y.breakpoints)==null?void 0:n.find(d=>d.c===f);return this.column(f,(i==null?void 0:i.layout)||y.layout),!0}return!1}compact(r="compact",n=!0){return this.engine.compact(r,n),this._triggerChangeEvent(),this}column(r,n="moveScale"){if(!r||r<1||this.opts.column===r)return this;const y=this.getColumn();return this.opts.column=r,this.engine?(this.engine.column=r,this.el.classList.remove("gs-"+y),this._updateColumnVar(),this.engine.columnChanged(y,r,n),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=n,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(r=>r.matches("."+this.opts.itemClass)&&!r.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(r=!0){var n;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),r?this.el.parentNode.removeChild(this.el):(this.removeAll(r),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(n=this._placeholder)==null||delete n.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(r){return this.opts.float!==r&&(this.opts.float=this.engine.float=r,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(r,n=!1){const y=this.el.getBoundingClientRect();let $;n?$={top:y.top+document.documentElement.scrollTop,left:y.left}:$={top:this.el.offsetTop,left:this.el.offsetLeft};const f=r.left-$.left,u=r.top-$.top,i=y.width/this.getColumn(),d=y.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(f/i),y:Math.floor(u/d)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(r,n,y,$){return this.engine.isAreaEmpty(r,n,y,$)}makeWidget(r,n){const y=Rh.getElement(r);if(!y||y.gridstackNode)return y;y.parentElement||this.el.appendChild(y),this._prepareElement(y,!0,n);const $=y.gridstackNode;this._updateContainerHeight(),$.subGridOpts&&this.makeSubGrid(y,$.subGridOpts,void 0,!1);let f;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(f=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),f&&delete this._ignoreLayoutsNodeChange,y}on(r,n){return r.indexOf(" ")!==-1?(r.split(" ").forEach(y=>this.on(y,n)),this):(r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable"?(r==="enable"||r==="disable"?this._gsEventHandler[r]=y=>n(y):this._gsEventHandler[r]=y=>{y.detail&&n(y,y.detail)},this.el.addEventListener(r,this._gsEventHandler[r])):r==="drag"||r==="dragstart"||r==="dragstop"||r==="resizestart"||r==="resize"||r==="resizestop"||r==="dropped"||r==="resizecontent"?this._gsEventHandler[r]=n:console.error("GridStack.on("+r+") event not supported"),this)}off(r){return r.indexOf(" ")!==-1?(r.split(" ").forEach(n=>this.off(n)),this):((r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable")&&this._gsEventHandler[r]&&this.el.removeEventListener(r,this._gsEventHandler[r]),delete this._gsEventHandler[r],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(r=>this.off(r)),this}removeWidget(r,n=!0,y=!0){return r?(Rh.getElements(r).forEach($=>{if($.parentElement&&$.parentElement!==this.el)return;let f=$.gridstackNode;f||(f=this.engine.nodes.find(u=>$===u.el)),f&&(n&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,f,!1,!1),delete $.gridstackNode,this._removeDD($),this.engine.removeNode(f,n,y),n&&$.parentElement&&$.remove())}),y&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(r=!0,n=!0){return this.engine.nodes.forEach(y=>{r&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,y,!1,!1),delete y.el.gridstackNode,this.opts.staticGrid||this._removeDD(y.el)}),this.engine.removeAll(r,n),n&&this._triggerRemoveEvent(),this}setAnimation(r=this.opts.animate,n){return n?setTimeout(()=>{this.opts&&this.setAnimation(r)}):r?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=r,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(r,n=!0,y=!0){return!!this.opts.staticGrid===r?this:(r?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach($=>{this.prepareDragDrop($.el),$.subGrid&&y&&$.subGrid.setStatic(r,n,y)}),n&&this._setStaticClass(),this)}updateOptions(r){var n;const y=this.opts;return r===y?this:(r.acceptWidgets!==void 0&&(y.acceptWidgets=r.acceptWidgets,this._setupAcceptWidget()),r.animate!==void 0&&this.setAnimation(r.animate),r.cellHeight&&this.cellHeight(r.cellHeight),r.class!==void 0&&r.class!==y.class&&(y.class&&this.el.classList.remove(y.class),r.class&&this.el.classList.add(r.class)),r.columnOpts?(this.opts.columnOpts=r.columnOpts,this.checkDynamicColumn()):r.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof r.column=="number"&&this.column(r.column),r.margin!==void 0&&this.margin(r.margin),r.staticGrid!==void 0&&this.setStatic(r.staticGrid),r.disableDrag!==void 0&&!r.staticGrid&&this.enableMove(!r.disableDrag),r.disableResize!==void 0&&!r.staticGrid&&this.enableResize(!r.disableResize),r.float!==void 0&&this.float(r.float),r.row!==void 0?(y.minRow=y.maxRow=y.row=r.row,this._updateContainerHeight()):(r.minRow!==void 0&&(y.minRow=r.minRow,this._updateContainerHeight()),r.maxRow!==void 0&&(y.maxRow=r.maxRow)),r.lazyLoad!==void 0&&(y.lazyLoad=r.lazyLoad),(n=r.children)!=null&&n.length&&this.load(r.children),this)}update(r,n){return Rh.getElements(r).forEach(y=>{var $;const f=y==null?void 0:y.gridstackNode;if(!f)return;const u={...ru.copyPos({},f),...ru.cloneDeep(n)};this.engine.nodeBoundFix(u),delete u.autoPosition;const i=["x","y","w","h"];let d;if(i.some(S=>u[S]!==void 0&&u[S]!==f[S])&&(d={},i.forEach(S=>{d[S]=u[S]!==void 0?u[S]:f[S],delete u[S]})),!d&&(u.minW||u.minH||u.maxW||u.maxH)&&(d={}),u.content!==void 0){const S=y.querySelector(".grid-stack-item-content");S&&S.textContent!==u.content&&(f.content=u.content,Rh.renderCB(S,u),($=f.subGrid)!=null&&$.el&&(S.appendChild(f.subGrid.el),f.subGrid._updateContainerHeight())),delete u.content}let l=!1,a=!1;for(const S in u)S[0]!=="_"&&f[S]!==u[S]&&(f[S]=u[S],l=!0,a=a||!this.opts.staticGrid&&(S==="noResize"||S==="noMove"||S==="locked"));if(ru.sanitizeMinMax(f),d){const S=d.w!==void 0&&d.w!==f.w;this.moveNode(f,d),S&&f.subGrid?f.subGrid.onResize(this.hasAnimationCSS()?f.w:void 0):this.resizeToContentCheck(S,f),delete f._orig}(d||l)&&this._writeAttr(y,f),a&&this.prepareDragDrop(f.el),Rh.updateCB&&Rh.updateCB(f)}),this}moveNode(r,n){const y=r._updating;y||this.engine.cleanNodes().beginUpdate(r),this.engine.moveNode(r,n),this._updateContainerHeight(),y||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(r){var n,y;if(!r||(r.classList.remove("size-to-content-max"),!r.clientHeight))return;const $=r.gridstackNode;if(!$)return;const f=$.grid;if(!f||r.parentElement!==f.el)return;const u=f.getCellHeight(!0);if(!u)return;let i=$.h?$.h*u:r.clientHeight,d;if($.resizeToContentParent&&(d=r.querySelector($.resizeToContentParent)),d||(d=r.querySelector(Rh.resizeToContentParent)),!d)return;const l=r.clientHeight-d.clientHeight,a=$.h?$.h*u-l:d.clientHeight;let S;if($.subGrid){S=$.subGrid.getRow()*$.subGrid.getCellHeight(!0);const p=$.subGrid.el.getBoundingClientRect(),s=r.getBoundingClientRect();S+=p.top-s.top}else{if((y=(n=$.subGridOpts)==null?void 0:n.children)!=null&&y.length)return;{const p=d.firstElementChild;if(!p){console.error(`Error: GridStack.resizeToContent() widget id:${$.id} '${Rh.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}S=p.getBoundingClientRect().height||a}}if(a===S)return;i+=S-a;let T=Math.ceil(i/u);const b=Number.isInteger($.sizeToContent)?$.sizeToContent:0;b&&T>b&&(T=b,r.classList.add("size-to-content-max")),$.minH&&T<$.minH?T=$.minH:$.maxH&&T>$.maxH&&(T=$.maxH),T!==$.h&&(f._ignoreLayoutsNodeChange=!0,f.moveNode($,{h:T}),delete f._ignoreLayoutsNodeChange)}resizeToContentCBCheck(r){Rh.resizeToContentCB?Rh.resizeToContentCB(r):this.resizeToContent(r)}rotate(r,n){return Rh.getElements(r).forEach(y=>{const $=y.gridstackNode;if(!ru.canBeRotated($))return;const f={w:$.h,h:$.w,minH:$.minW,minW:$.minH,maxH:$.maxW,maxW:$.maxH};if(n){const i=n.left>0?Math.floor(n.left/this.cellWidth()):0,d=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;f.x=$.x+i-($.h-(d+1)),f.y=$.y+d-i}Object.keys(f).forEach(i=>{f[i]===void 0&&delete f[i]});const u=$._orig;this.update(y,f),$._orig=u}),this}margin(r){if(!(typeof r=="string"&&r.split(" ").length>1)){const n=ru.parseHeight(r);if(this.opts.marginUnit===n.unit&&this.opts.margin===n.h)return}return this.opts.margin=r,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(r){return this.engine.willItFit(r)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const r=this.engine.getDirtyNodes(!0);return r&&r.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(r),this._triggerEvent("change",r)),this.engine.saveInitial(),this}_triggerAddEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.addedNodes)!=null&&r.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(y=>{delete y._dirty});const n=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",n)}return this}_triggerRemoveEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.removedNodes)!=null&&r.length){const n=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",n)}return this}_triggerEvent(r,n){const y=n?new CustomEvent(r,{bubbles:!1,detail:n}):new Event(r);let $=this;for(;$.parentGridNode;)$=$.parentGridNode.grid;return $.el.dispatchEvent(y),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const r=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const y=this.opts.cellHeight,$=this.opts.cellHeightUnit;if(!y)return this;if(!r&&!this.opts.minRow){const f=ru.parseHeight(getComputedStyle(this.el).minHeight);if(f.h>0&&f.unit===$){const u=Math.floor(f.h/y);n<u&&(n=u)}}return this.el.setAttribute("gs-current-row",String(n)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),n&&(this.el.style[r?"minHeight":"height"]=n*y+$),r&&ru.shouldSizeToContent(r)&&r.grid.resizeToContentCBCheck(r.el),this}_prepareElement(r,n=!1,y){y=y||this._readAttr(r),r.gridstackNode=y,y.el=r,y.grid=this,y=this.engine.addNode(y,n),this._writeAttr(r,y),r.classList.add(S3.itemClass,this.opts.itemClass);const $=ru.shouldSizeToContent(y);return $?r.classList.add("size-to-content"):r.classList.remove("size-to-content"),$&&this.resizeToContentCheck(!1,y),ru.lazyLoad(y)||this.prepareDragDrop(y.el),this}_writePosAttr(r,n){return(!n._moving&&!n._resizing||this._placeholder===r)&&(r.style.top=n.y?n.y===1?"var(--gs-cell-height)":`calc(${n.y} * var(--gs-cell-height))`:null,r.style.left=n.x?n.x===1?"var(--gs-column-width)":`calc(${n.x} * var(--gs-column-width))`:null,r.style.width=n.w>1?`calc(${n.w} * var(--gs-column-width))`:null,r.style.height=n.h>1?`calc(${n.h} * var(--gs-cell-height))`:null),r.setAttribute("gs-x",String(n.x)),r.setAttribute("gs-y",String(n.y)),n.w>1?r.setAttribute("gs-w",String(n.w)):r.removeAttribute("gs-w"),n.h>1?r.setAttribute("gs-h",String(n.h)):r.removeAttribute("gs-h"),this}_writeAttr(r,n){if(!n)return this;this._writePosAttr(r,n);const y={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const $ in y)n[$]?r.setAttribute(y[$],String(n[$])):r.removeAttribute(y[$]);return this}_readAttr(r,n=!0){const y={};y.x=ru.toNumber(r.getAttribute("gs-x")),y.y=ru.toNumber(r.getAttribute("gs-y")),y.w=ru.toNumber(r.getAttribute("gs-w")),y.h=ru.toNumber(r.getAttribute("gs-h")),y.autoPosition=ru.toBool(r.getAttribute("gs-auto-position")),y.noResize=ru.toBool(r.getAttribute("gs-no-resize")),y.noMove=ru.toBool(r.getAttribute("gs-no-move")),y.locked=ru.toBool(r.getAttribute("gs-locked"));const $=r.getAttribute("gs-size-to-content");$&&($==="true"||$==="false"?y.sizeToContent=ru.toBool($):y.sizeToContent=parseInt($,10)),y.id=r.getAttribute("gs-id"),y.maxW=ru.toNumber(r.getAttribute("gs-max-w")),y.minW=ru.toNumber(r.getAttribute("gs-min-w")),y.maxH=ru.toNumber(r.getAttribute("gs-max-h")),y.minH=ru.toNumber(r.getAttribute("gs-min-h")),n&&(y.w===1&&r.removeAttribute("gs-w"),y.h===1&&r.removeAttribute("gs-h"),y.maxW&&r.removeAttribute("gs-max-w"),y.minW&&r.removeAttribute("gs-min-w"),y.maxH&&r.removeAttribute("gs-max-h"),y.minH&&r.removeAttribute("gs-min-h"));for(const f in y){if(!y.hasOwnProperty(f))return;!y[f]&&y[f]!==0&&f!=="sizeToContent"&&delete y[f]}return y}_setStaticClass(){const r=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...r),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...r),this.el.removeAttribute("gs-static")),this}onResize(r=(n=>(n=this.el)==null?void 0:n.clientWidth)()){if(!r||this.prevWidth===r)return;this.prevWidth=r,this.batchUpdate();let n=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),n=!0):n=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(y=>{y.subGrid&&y.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(n),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(r=!1,n=void 0){if(this.engine){if(r&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,n),this.animationDelay);if(n)ru.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(y=>ru.shouldSizeToContent(y))){const y=[...this.engine.nodes];this.batchUpdate(),y.forEach($=>{ru.shouldSizeToContent($)&&this.resizeToContentCBCheck($.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,n?[n]:this.engine.nodes)}}_updateResizeEvent(r=!1){const n=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(y=>y.sizeToContent));return!r&&n&&!this.resizeObserver?(this._sizeThrottle=ru.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(r||!n)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(r=".grid-stack-item"){return ru.getElement(r)}static getElements(r=".grid-stack-item"){return ru.getElements(r)}static getGridElement(r){return Rh.getElement(r)}static getGridElements(r){return ru.getElements(r)}_initMargin(){let r,n=0,y=[];typeof this.opts.margin=="string"&&(y=this.opts.margin.split(" ")),y.length===2?(this.opts.marginTop=this.opts.marginBottom=y[0],this.opts.marginLeft=this.opts.marginRight=y[1]):y.length===4?(this.opts.marginTop=y[0],this.opts.marginRight=y[1],this.opts.marginBottom=y[2],this.opts.marginLeft=y[3]):(r=ru.parseHeight(this.opts.margin),this.opts.marginUnit=r.unit,n=this.opts.margin=r.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(f=>{this.opts[f]===void 0?this.opts[f]=n:(r=ru.parseHeight(this.opts[f]),this.opts[f]=r.h,delete this.opts.margin)}),this.opts.marginUnit=r.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 $=this.el.style;return $.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return d_}static setupDragIn(r,n,y,$=document){(n==null?void 0:n.pause)!==void 0&&(Of.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof r=="string"?ru.getElements(r,$):r).forEach((f,u)=>{d_.isDraggable(f)||d_.dragIn(f,n),y!=null&&y[u]&&(f.gridstackNode=y[u])})}movable(r,n){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(y=>{const $=y.gridstackNode;$&&(n?delete $.noMove:$.noMove=!0,this.prepareDragDrop($.el))}),this)}resizable(r,n){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(y=>{const $=y.gridstackNode;$&&(n?delete $.noResize:$.noResize=!0,this.prepareDragDrop($.el))}),this)}disable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!1,r),this.enableResize(!1,r),this._triggerEvent("disable"),this}enable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!0,r),this.enableResize(!0,r),this._triggerEvent("enable"),this}enableMove(r,n=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(y=>{this.prepareDragDrop(y.el),y.subGrid&&n&&y.subGrid.enableMove(r,n)}),this)}enableResize(r,n=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(y=>{this.prepareDragDrop(y.el),y.subGrid&&n&&y.subGrid.enableResize(r,n)}),this)}cancelDrag(){var r;const n=(r=this._placeholder)==null?void 0:r.gridstackNode;n&&(n._isExternal?(n._isAboutToRemove=!0,this.engine.removeNode(n)):n._isAboutToRemove&&Rh._itemRemoving(n.el,!1),this.engine.restoreInitial())}_removeDD(r){return d_.draggable(r,"destroy").resizable(r,"destroy"),r.gridstackNode&&delete r.gridstackNode._initDD,delete r.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return d_.droppable(this.el,"destroy"),this;let r,n;const y=($,f,u)=>{var i;u=u||f;const d=u.gridstackNode;if(!d)return;if(!((i=d.grid)!=null&&i.el)){u.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const b=u.getBoundingClientRect();u.style.left=b.x+(this.dragTransform.xScale-1)*($.clientX-b.x)/this.dragTransform.xScale+"px",u.style.top=b.y+(this.dragTransform.yScale-1)*($.clientY-b.y)/this.dragTransform.yScale+"px",u.style.transformOrigin="0px 0px"}let{top:l,left:a}=u.getBoundingClientRect();const S=this.el.getBoundingClientRect();a-=S.left,l-=S.top;const T={position:{top:l*this.dragTransform.xScale,left:a*this.dragTransform.yScale}};if(d._temporaryRemoved){if(d.x=Math.max(0,Math.round(a/n)),d.y=Math.max(0,Math.round(l/r)),delete d.autoPosition,this.engine.nodeBoundFix(d),!this.engine.willItFit(d)){if(d.autoPosition=!0,!this.engine.willItFit(d)){d_.off(f,"drag");return}d._willFitPos&&(ru.copyPos(d,d._willFitPos),delete d._willFitPos)}this._onStartMoving(u,$,T,d,n,r)}else this._dragOrResize(u,$,T,d,n,r)};return d_.droppable(this.el,{accept:$=>{const f=$.gridstackNode||this._readAttr($,!1);if((f==null?void 0:f.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let u=!0;if(typeof this.opts.acceptWidgets=="function")u=this.opts.acceptWidgets($);else{const i=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;u=$.matches(i)}if(u&&f&&this.opts.maxRow){const i={w:f.w,h:f.h,minW:f.minW,minH:f.minH};u=this.engine.willItFit(i)}return u}}).on(this.el,"dropover",($,f,u)=>{let i=(u==null?void 0:u.gridstackNode)||f.gridstackNode;if((i==null?void 0:i.grid)===this&&!i._temporaryRemoved)return!1;if(i!=null&&i._sidebarOrig&&(i.w=i._sidebarOrig.w,i.h=i._sidebarOrig.h),i!=null&&i.grid&&i.grid!==this&&!i._temporaryRemoved&&i.grid._leave(f,u),u=u||f,n=this.cellWidth(),r=this.getCellHeight(!0),!i){const a=u.getAttribute("data-gs-widget")||u.getAttribute("gridstacknode");if(a){try{i=JSON.parse(a)}catch{console.error("Gridstack dropover: Bad JSON format: ",a)}u.removeAttribute("data-gs-widget"),u.removeAttribute("gridstacknode")}i||(i=this._readAttr(u)),i._sidebarOrig={w:i.w,h:i.h}}i.grid||(i.el||(i={...i}),i._isExternal=!0,u.gridstackNode=i);const d=i.w||Math.round(u.offsetWidth/n)||1,l=i.h||Math.round(u.offsetHeight/r)||1;return i.grid&&i.grid!==this?(f._gridstackNodeOrig||(f._gridstackNodeOrig=i),f.gridstackNode=i={...i,w:d,h:l,grid:this},delete i.x,delete i.y,this.engine.cleanupNode(i).nodeBoundFix(i),i._initDD=i._isExternal=i._temporaryRemoved=!0):(i.w=d,i.h=l,i._temporaryRemoved=!0),Rh._itemRemoving(i.el,!1),d_.on(f,"drag",y),y($,f,u),!1}).on(this.el,"dropout",($,f,u)=>{const i=(u==null?void 0:u.gridstackNode)||f.gridstackNode;return i&&(!i.grid||i.grid===this)&&(this._leave(f,u),this._isTemp&&this.removeAsSubGrid(i)),!1}).on(this.el,"drop",($,f,u)=>{var i,d,l;const a=(u==null?void 0:u.gridstackNode)||f.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._isExternal)return!1;const S=!!this.placeholder.parentElement,T=f!==u;this.placeholder.remove(),delete this.placeholder.gridstackNode,S&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const b=f._gridstackNodeOrig;if(delete f._gridstackNodeOrig,S&&b!=null&&b.grid&&b.grid!==this){const s=b.grid;s.engine.removeNodeFromLayoutCache(b),s.engine.removedNodes.push(b),s._triggerRemoveEvent()._triggerChangeEvent(),s.parentGridNode&&!s.engine.nodes.length&&s.opts.subGridDynamic&&s.removeAsSubGrid()}if(!a||(S&&(this.engine.cleanupNode(a),a.grid=this),(i=a.grid)==null||delete i._isTemp,d_.off(f,"drag"),u!==f?(u.remove(),f=u):f.remove(),this._removeDD(f),!S))return!1;const p=(l=(d=a.subGrid)==null?void 0:d.el)==null?void 0:l.gridstack;return ru.copyPos(a,this._readAttr(this.placeholder)),ru.removePositioningStyles(f),T&&(a.content||a.subGridOpts||Rh.addRemoveCB)?(delete a.el,f=this.addWidget(a)):(this._prepareElement(f,!0,a),this.el.appendChild(f),this.resizeToContentCheck(!1,a),p&&(p.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...$,type:"dropped"},b&&b.grid?b:void 0,a),!1}),this}static _itemRemoving(r,n){if(!r)return;const y=r?r.gridstackNode:void 0;!(y!=null&&y.grid)||r.classList.contains(y.grid.opts.removableOptions.decline)||(n?y._isAboutToRemove=!0:delete y._isAboutToRemove,n?r.classList.add("grid-stack-item-removing"):r.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const r=document.querySelector(this.opts.removable);return r?(!this.opts.staticGrid&&!d_.isDroppable(r)&&d_.droppable(r,this.opts.removableOptions).on(r,"dropover",(n,y)=>Rh._itemRemoving(y,!0)).on(r,"dropout",(n,y)=>Rh._itemRemoving(y,!1)),this):this}prepareDragDrop(r,n=!1){const y=r==null?void 0:r.gridstackNode;if(!y)return;const $=y.noMove||this.opts.disableDrag,f=y.noResize||this.opts.disableResize,u=this.opts.staticGrid||$&&f;if((n||u)&&(y._initDD&&(this._removeDD(r),delete y._initDD),u&&r.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!y._initDD){let i,d;const l=(T,b)=>{this.triggerEvent(T,T.target),i=this.cellWidth(),d=this.getCellHeight(!0),this._onStartMoving(r,T,b,y,i,d)},a=(T,b)=>{this._dragOrResize(r,T,b,y,i,d)},S=T=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete y._moving,delete y._resizing,delete y._event,delete y._lastTried;const b=y.w!==y._orig.w,p=T.target;if(!(!p.gridstackNode||p.gridstackNode.grid!==this)){if(y.el=p,y._isAboutToRemove){const s=r.gridstackNode.grid;s._gsEventHandler[T.type]&&s._gsEventHandler[T.type](T,p),s.engine.nodes.push(y),s.removeWidget(r,!0,!0)}else ru.removePositioningStyles(p),y._temporaryRemoved?(this._writePosAttr(p,y),this.engine.addNode(y)):this._writePosAttr(p,y),this.triggerEvent(T,p);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),T.type==="resizestop"&&(Number.isInteger(y.sizeToContent)&&(y.sizeToContent=y.h),this.resizeToContentCheck(b,y))}};d_.draggable(r,{start:l,stop:S,drag:a}).resizable(r,{start:l,stop:S,resize:a}),y._initDD=!0}return d_.draggable(r,$?"disable":"enable").resizable(r,f?"disable":"enable"),this}_onStartMoving(r,n,y,$,f,u){var i;if(this.engine.cleanNodes().beginUpdate($),this._writePosAttr(this.placeholder,$),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=$,(i=$.grid)!=null&&i.el)this.dragTransform=ru.getValuesFromTransformedElement(r);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const d=this.placeholder.closest(".grid-stack");this.dragTransform=ru.getValuesFromTransformedElement(d)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if($.el=this.placeholder,$._lastUiPosition=y.position,$._prevYPix=y.position.top,$._moving=n.type==="dragstart",$._resizing=n.type==="resizestart",delete $._lastTried,n.type==="dropover"&&$._temporaryRemoved&&(this.engine.addNode($),$._moving=!0),this.engine.cacheRects(f,u,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const d=this.getColumn()-$.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-$.y;d_.resizable(r,"option","minWidth",f*Math.min($.minW||1,d)).resizable(r,"option","minHeight",u*Math.min($.minH||1,l)).resizable(r,"option","maxWidth",f*Math.min($.maxW||Number.MAX_SAFE_INTEGER,d)).resizable(r,"option","maxWidthMoveLeft",f*Math.min($.maxW||Number.MAX_SAFE_INTEGER,$.x+$.w)).resizable(r,"option","maxHeight",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(r,"option","maxHeightMoveUp",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,$.y+$.h))}}_dragOrResize(r,n,y,$,f,u){const i={...$._orig};let d,l=this.opts.marginLeft,a=this.opts.marginRight,S=this.opts.marginTop,T=this.opts.marginBottom;const b=Math.round(u*.1),p=Math.round(f*.1);if(l=Math.min(l,p),a=Math.min(a,p),S=Math.min(S,b),T=Math.min(T,b),n.type==="drag"){if($._temporaryRemoved)return;const c=y.position.top-$._prevYPix;$._prevYPix=y.position.top,this.opts.draggable.scroll!==!1&&ru.updateScrollPosition(r,y.position,c);const o=y.position.left+(y.position.left>$._lastUiPosition.left?-a:l),h=y.position.top+(y.position.top>$._lastUiPosition.top?-T:S);i.x=Math.round(o/f),i.y=Math.round(h/u);const v=this._extraDragRow;if(this.engine.collide($,i)){const k=this.getRow();let L=Math.max(0,i.y+$.h-k);this.opts.maxRow&&k+L>this.opts.maxRow&&(L=Math.max(0,this.opts.maxRow-k)),this._extraDragRow=L}else this._extraDragRow=0;if(this._extraDragRow!==v&&this._updateContainerHeight(),$.x===i.x&&$.y===i.y)return}else if(n.type==="resize"){if(i.x<0||(ru.updateScrollResize(n,r,u),i.w=Math.round((y.size.width-l)/f),i.h=Math.round((y.size.height-S)/u),$.w===i.w&&$.h===i.h)||$._lastTried&&$._lastTried.w===i.w&&$._lastTried.h===i.h)return;const c=y.position.left+l,o=y.position.top+S;i.x=Math.round(c/f),i.y=Math.round(o/u),d=!0}$._event=n,$._lastTried=i;const s={x:y.position.left+l,y:y.position.top+S,w:(y.size?y.size.width:$.w*f)-l-a,h:(y.size?y.size.height:$.h*u)-S-T};if(this.engine.moveNodeCheck($,{...i,cellWidth:f,cellHeight:u,rect:s,resizing:d})){$._lastUiPosition=y.position,this.engine.cacheRects(f,u,S,a,T,l),delete $._skipDown,d&&$.subGrid&&$.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const c=n.target;$._sidebarOrig||this._writePosAttr(c,$),this.triggerEvent(n,c)}}triggerEvent(r,n){let y=this;for(;y.parentGridNode;)y=y.parentGridNode.grid;y._gsEventHandler[r.type]&&y._gsEventHandler[r.type](r,n)}_leave(r,n){n=n||r;const y=n.gridstackNode;if(!y||(n.style.transform=n.style.transformOrigin=null,d_.off(r,"drag"),y._temporaryRemoved))return;y._temporaryRemoved=!0,this.engine.removeNode(y),y.el=y._isExternal&&n?n:r;const $=y._sidebarOrig;y._isExternal&&this.engine.cleanupNode(y),y._sidebarOrig=$,this.opts.removable===!0&&Rh._itemRemoving(r,!0),r._gridstackNodeOrig?(r.gridstackNode=r._gridstackNodeOrig,delete r._gridstackNodeOrig):y._isExternal&&this.engine.restoreInitial()}}Rh.renderCB=(t,r)=>{t&&r!=null&&r.content&&(t.textContent=r.content)},Rh.resizeToContentParent=".grid-stack-item-content",Rh.Utils=ru,Rh.Engine=A4,Rh.GDRev="12.4.2";const hHt=[{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}],R4=t=>hHt.find(r=>r.id===t),F4=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 Yk{constructor(r,n=[],y,$=null,f=!1,u=!1,i=null,d=null,l=null){Ew(this,"id",""),Ew(this,"childViews",[]),Ew(this,"viewId",0),Ew(this,"dynamicFilters",null),Ew(this,"componentSpecificFilters",new Map),Ew(this,"isPostMatch",!1),Ew(this,"isTemplateMode",!1),Ew(this,"filtresJSON",null),Ew(this,"token",null),Ew(this,"_isUpdating",!1),Ew(this,"filters",null),this.id=r,this.viewId=y,this.childViews=n,this.dynamicFilters=$,this.isPostMatch=f,this.isTemplateMode=u,this.filtresJSON=i,this.token=d,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(r=>{r.view.filterAndViewsContainer=new Yk(this.id,[r],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(r,n){return!r||!Array.isArray(r)?!1:r.some(y=>y&&y.event_type_id===n)}hasCategoryId(r,n){return!r||!Array.isArray(r)?!1:r.some(y=>y&&y.category_id===n)}getId(){return this.id}setViewId(r){this.viewId=r}setFiltersJSON(r){this.filtresJSON=r}setDynamicFilters(r,n=null){n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r}setFilters(r){this.filters=r}getComponentDynamicFilters(r){return r&&this.componentSpecificFilters.has(r)?this.componentSpecificFilters.get(r):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(r=>r.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(r=>!r.view.isHomeTeam)}addSpecificPlays(r){if(r.view.componentProps&&this.filters){const n=this.filters.selectedTeam.value;if(n===3){const y=this.getHomeTeamViews().length,$=this.getAwayTeamViews().length;y===0&&$>0&&this.getAwayTeamViews().forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=!0,f.view.isHomeTeam=!0,f.view.filterMultiple&&(f.view.filterMultiple.isHomeTeam=!0)}),y<this.filters.howManyCorners?this.childViews.length===0?(r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.howManyCorners=this.filters.howManyCorners,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):this.childViews.reduce((f,u,i,d)=>{let l={isAgainstMode:u.view.isAgainstMode,advancedFilters:u.view.componentProps.advancedFilters,isHomeTeamForAnalysis:u.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:u.view.isHomeTeam};return f&&(f.isHomeTeam&&!u.view.isHomeTeam?(u.view.componentProps.isAgainstMode=this.filters.isAgainstMode,u.view.componentProps.advancedFilters=this.filters.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=!0,u.view.isHomeTeam=!0,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):!f.isHomeTeam&&!u.view.isHomeTeam&&(u.view.componentProps.isAgainstMode=f.isAgainstMode,u.view.componentProps.advancedFilters=f.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=f.isHomeTeamForAnalysis,u.view.isHomeTeam=f.isHomeTeam,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,selectedCategory:u.view.componentProps.categories[0],advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}),i===d.length-1&&(r.view.componentProps.advancedFilters=l.advancedFilters,r.view.componentProps.isAgainstMode=l.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=l.isHomeTeamForAnalysis,r.view.isHomeTeam=l.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})),l},null):(r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})}else{const y=n===1;r.view.componentProps.isHomeTeamForAnalysis=y,r.view.isHomeTeam=y,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}}}}addLastTouch(r){if(r.view.componentProps&&this.filters){let n=null;const y=this.filters.selectedCategories.map(f=>f.value),$=this.filters.selectedTeam.value;if($===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(d=>{d.view.componentProps.isHomeTeamForAnalysis=!0,d.view.isHomeTeam=!0,d.view.filterMultiple&&(d.view.filterMultiple.isHomeTeam=!0)});const f=this.getHomeTeamViews(),u=this.getAwayTeamViews();let i=!0;for(let d=0;d<y.length;d++){n=y[d];const l=f.find(S=>S.view.componentProps.categories[0].name===n.name),a=u.find(S=>S.view.componentProps.categories[0].name===n.name);if(!l||!a){i=!l;break}}i?this.childViews.length===0?(r.view.componentProps.categories=[n],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=n.name,r.view.titleShort=n.name,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((d,l,a,S)=>{let T={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 d&&(d.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[n],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=n.name,r.view.titleShort=n.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!d.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=d.categories,l.view.componentProps.analysisType=d.analysisType,l.view.componentProps.isHomeTeamForAnalysis=d.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=d.isAssistZoneVisible,l.view.componentProps.howManyGames=d.howManyGames,l.view.title=d.title,l.view.titleShort=d.titleShort,l.view.isHomeTeam=d.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}),a===S.length-1&&(r.view.componentProps.categories=T.categories,r.view.componentProps.analysisType=T.analysisType,r.view.componentProps.isHomeTeamForAnalysis=T.isHomeTeamForAnalysis,r.view.componentProps.isAssistZoneVisible=T.isAssistZoneVisible,r.view.componentProps.howManyGames=T.howManyGames,r.view.title=T.title,r.view.titleShort=T.titleShort,r.view.isHomeTeam=T.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:r.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),T},null):(r.view.componentProps.categories=[n],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=n.name,r.view.titleShort=n.name,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const f=$===1,u=f?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=f,r.view.isHomeTeam=f;for(let i=0;i<y.length;i++){const d=y[i];if(!u.find(l=>l.view.componentProps.categories[0].name===d.name)){r.view.componentProps.categories=[d],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=d.name,r.view.titleShort=d.name,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:d,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(r,n=!1){var y,$,f,u,i,d,l,a;if(r.view.filterAndViewsContainer=this,Sd.emit("component-added-to-container",this),this.viewId===5&&r.view.componentProps&&!n&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===15&&r.view.componentProps&&!n&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===17&&r.view.componentProps&&!n){this.dynamicFilters[0]!==void 0&&(r.view.componentProps.infavoragainstteam=!this.dynamicFilters[0]),this.dynamicFilters[1]!==void 0&&(r.view.componentProps.lateralidad=this.dynamicFilters[1]===32?"right":"left");const S=this.dynamicFilters[2]!==void 0?this.dynamicFilters[2]:this.dynamicFilters[0]||1,T=r.view.componentProps.game;if(S===3){const b=this.childViews.filter(p=>{var s;return((s=p.view.filterMultiple)==null?void 0:s.isHomeTeam)===!0}).length===0;T&&(r.view.componentProps.teamselected=b?T.home_team:T.away_team),r.view.filterMultiple={isHomeTeam:b}}else T&&(r.view.componentProps.teamselected=S===2?T.away_team:T.home_team),r.view.filterMultiple={isHomeTeam:S===1}}if(this.viewId===10&&r.view.componentProps&&!n&&(r.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,r.isHomeTeam=r.view.componentProps.isHomeTeamForAnalysis,r.view.filterMultiple={isHomeTeam:r.view.componentProps.isHomeTeamForAnalysis},r.view.filtersJSON=this.filtresJSON),this.viewId===7&&r.view.componentProps&&!n){const S=this.getComponentDynamicFilters(r.view.id),T=S||this.dynamicFilters;!S&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const b=T[0]===1?"offensive":"defensive",p=T[1]===1;r.view.componentProps.analysisType=b,r.view.componentProps.isHomeTeamForAnalysis=p,r.isHomeTeam=p,r.view.filterMultiple={isHomeTeam:p},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:T})}if(this.viewId===1&&r.view.componentProps&&!n){const S=this.dynamicFilters[0]||[];if(S&&S.length>0){let T;if(Array.isArray(S)){const p=this.childViews.map(c=>{var o;return(o=c.view.componentProps)==null?void 0:o.type}).filter(c=>c!==void 0),s=S.filter(c=>!p.includes(c));s.length>0?T=s[0]:T=S[0]}else T=S;const b=F4.get(this.viewId);r.view.componentProps.type=T,r.view.componentProps.default=!1,r.view.title=`Comparativa ${b[T]}`,r.view.filterMultiple={category:T}}}if(this.viewId===9&&r.view.componentProps&&!n){const S=this.dynamicFilters[0].map(s=>s.join("-"));let T="";const b=this.dynamicFilters[1],p=F4.get(this.viewId);if(b===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(v=>{v.view.componentProps.isHomeTeamForAnalysis=!0,v.view.isHomeTeam=!0,v.view.filterMultiple&&(v.view.filterMultiple.isHomeTeam=!0)});let s=null;const c=this.getHomeTeamViews(),o=this.getAwayTeamViews();let h=!0;for(let v=0;v<S.length;v++){T=S[v],s=p.analysisTypes.get(S[v]);const k=c.find(E=>E.view.componentProps.analysisType===s.analysisType),L=o.find(E=>E.view.componentProps.analysisType===s.analysisType);if(!k||!L){h=!k;break}}h?this.childViews.length===0?(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:T.split("-").map(v=>parseInt(v))}):this.childViews.reduce((v,k,L,E)=>{let P={analysisType:k.view.componentProps.analysisType,title:k.view.title,isHomeTeamForAnalysis:k.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:k.view.isHomeTeam};return v&&(v.isHomeTeam&&!k.view.isHomeTeam?(k.view.componentProps.analysisType=s.analysisType,k.view.componentProps.isHomeTeamForAnalysis=!0,k.view.title=s.title,r.view.titleShort=s.titleShort,k.view.isHomeTeam=!0,k.view.filterMultiple={isHomeTeam:k.view.isHomeTeam,categoryIds:T.split("-").map(V=>parseInt(V))}):!v.isHomeTeam&&!k.view.isHomeTeam&&(k.view.componentProps.analysisType=v.analysisType,k.view.componentProps.isHomeTeamForAnalysis=v.isHomeTeamForAnalysis,k.view.title=v.title,k.view.titleShort=v.titleShort,k.view.isHomeTeam=v.isHomeTeam,k.view.filterMultiple={isHomeTeam:k.view.isHomeTeam,categoryIds:T.split("-").map(V=>parseInt(V))}),L===E.length-1&&(r.view.componentProps.analysisType=P.analysisType,r.view.componentProps.isHomeTeamForAnalysis=P.isHomeTeamForAnalysis,r.view.title=P.title,r.view.titleShort=P.titleShort,r.view.isHomeTeam=P.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:T.split("-").map(V=>parseInt(V))})),P},null):(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:T.split("-").map(v=>parseInt(v))})}else{const s=b===1,c=s?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=s,r.view.isHomeTeam=s;for(let o=0;o<S.length;o++){const h=p.analysisTypes.get(S[o]);if(!c.find(v=>v.view.componentProps.analysisType===h.analysisType)){r.view.componentProps.analysisType=h.analysisType,r.view.title=h.title,r.view.titleShort=h.titleShort,r.view.filterMultiple={categoryIds:S[o].split("-").map(v=>parseInt(v)),isHomeTeam:r.view.isHomeTeam};break}}}}if(this.viewId===2&&!n&&r.view.componentProps){const S=this.getComponentDynamicFilters(r.view.id),T=S||this.dynamicFilters;!S&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id),r.view.componentProps.game&&(r.view.componentProps.gameid=r.view.componentProps.game.id,r.view.componentProps.season=r.view.componentProps.game.season_id,r.view.componentProps.teamView=T[1]===2?r.view.componentProps.game.awayTeam.team_id:T[1]===1?r.view.componentProps.game.homeTeam.team_id:0);const b=this.dynamicFilters[0]||[];let p=null;if(Array.isArray(b)){if(b.length>0){const o=this.childViews.map(v=>{var k;const L=(k=v.view.componentProps)==null?void 0:k.categoryView;return L&&L.length>0?L[0].id:null}).filter(v=>v!==null),h=b.filter(v=>!o.includes(v));h.length>0&&(p=h[0])}}else{const o=b;o&&(this.childViews.find(h=>{var v;const k=(v=h.view.componentProps)==null?void 0:v.categoryView;return k&&k.length>0&&k[0].id===o})||(p=o))}let s=null;if(p)try{s=R4(p)}catch{}const c=T&&T.length>1?T[1]:1;r.view.filterMultiple={categoryId:p,teamType:c},r.view.componentProps.categoryView=s?[{id:p,name:s.name}]:p?[{id:p,name:`Category ${p}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&r.view.componentProps&&!n&&r.view.game){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),r.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,r.view.componentProps.game=(y=r.view)==null?void 0:y.game,r.view.componentProps.isDefault=!1;const S=this.dynamicFilters[1],T=r.view.componentProps.game;if(S===3){const b=this.childViews.filter(p=>{var s;return((s=p.view.filterMultiple)==null?void 0:s.isHomeTeam)===!0}).length===0;r.view.componentProps.teamSelected={teamId:b?T==null?void 0:T.home_team:T==null?void 0:T.away_team},r.view.filterMultiple={isHomeTeam:b}}else r.view.componentProps.teamSelected={teamId:S===1?T==null?void 0:T.home_team:T==null?void 0:T.away_team},r.view.filterMultiple={isHomeTeam:S===1};Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:this.dynamicFilters})}if(this.viewId===13&&r.view.componentProps&&!n&&(r.view.componentProps.isdefault=!0,r.view.componentProps.seasonid=2010,r.view.teamids=[1,2],r.view.componentProps.categoryids=[20,2],r.view.componentProps.teamsshow=[1,2],r.view.componentProps.analysistype=1,r.view.componentProps.gameid="",r.view.componentProps.teams=[],r.view.componentProps.game=""),this.viewId===15&&r.view.componentProps&&!n&&(r.view.componentProps.isdefault=!0,r.view.componentProps.view=1,r.view.numitems=3,r.view.typegame=1,r.view.componentProps.token=this.token,r.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===17&&r.view.componentProps&&!n&&(r.view.componentProps.forseason=!1,r.view.componentProps.forteam=!0,r.view.componentProps.tournamentselected={id:1},r.view.componentProps.forgame=!1,r.view.componentProps.filters={},r.view.componentProps.showBallGo=!0,r.view.componentProps.showHeatMap=!0,r.view.componentProps.ballOnOff=!1,r.view.componentProps.showdefault=!0),this.viewId===14&&r.view.componentProps&&!n&&(r.view.componentProps.isReports=!0,r.view.componentProps.isDefault=!0,r.view.componentProps.type=0,r.view.componentProps.typeView=1,r.view.componentProps.showVideos=!1,r.view.componentProps.currentSeason=2010,r.view.componentProps.localTeam=2,r.view.componentProps.awayTeam=1),this.viewId===6&&r.view.componentProps&&!n){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const S=this.getComponentDynamicFilters(r.view.id),T=S||this.dynamicFilters;!S&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const b=T&&T.length>0?T[0]:[];if(b&&b.length>0){let p=0;for(const s of b)if(!this.childViews.find(c=>c.view.componentProps.gameNumber===s)){p=s;break}p&&(r.view.componentProps.gameNumber=p,r.view.filterMultiple={gameNumber:p})}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:T})}if(this.viewId===3&&r.view.componentProps&&!n&&r.view.game){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const S=this.getComponentDynamicFilters(r.view.id),T=S||this.dynamicFilters;!S&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const b=T&&T.length>0?T[0]:!1;r.view.componentProps.desplegable=b,r.view.componentProps.key=b,r.view.componentProps.game=($=r.view)==null?void 0:$.game,r.view.componentProps.defaultShields=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:T})}if(this.viewId===4&&r.view.componentProps&&!n&&r.view.game){if(r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),this.isPostMatch){r.view.componentProps.key=!1,r.view.componentProps.isDefault=!1,r.view.componentProps.token=this.token,r.view.componentProps.gameId=(u=(f=r.view)==null?void 0:f.game)==null?void 0:u.game_id,r.view.componentProps.homeTeam=(d=(i=r.view)==null?void 0:i.game)==null?void 0:d.home_team,r.view.componentProps.awayTeam=(a=(l=r.view)==null?void 0:l.game)==null?void 0:a.visiting_team;const b=this.getComponentDynamicFilters(r.view.id),p=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const s=p&&p.length>0?p[0]:[],c=this.hasEventTypeId(s,1),o=this.hasCategoryId(s,8),h=this.hasCategoryId(s,9),v=this.hasEventTypeId(s,3);r.view.componentProps.goals=c,r.view.componentProps.yellowCards=o,r.view.componentProps.redCards=h,r.view.componentProps.substitutions=v}const S=this.getComponentDynamicFilters(r.view.id)||this.dynamicFilters,T=S&&S.length>0?S[0]:[];r.view.componentProps.selectedEvents=T,r.view.componentProps.key=T.length>0,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:S})}this.viewId===16&&this.addLastTouch(r),this.viewId===18&&this.addSpecificPlays(r),this.childViews.push(r),Sd.emit("view-added")}getHowManyViewsToAdd(r,n=null){if(this.viewId===5||this.viewId===8||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const y=r[0];return y===2||y===3?y:1}if(this.viewId===4)return r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0?1:0;if(this.viewId===9){const y=r[0],$=r[1];if($===1||$===2){const f=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return y.length-f.length}else return y*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&n){const y=n.selectedCategories||[],$=n.selectedTeam.value;if($===1||$===2){const f=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return y.length-f.length}else return y.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const y=r[0]||[],$=r[1]||1;if(!y||y.length===0)return 0;if(Array.isArray(y)){const f=this.childViews.map(u=>{var i;const d=(i=u.view.componentProps)==null?void 0:i.categoryView;return d&&d.length>0?d[0].id:null}).filter(u=>u!==null);return y.filter(u=>!f.includes(u)).length}else{const f=y;return this.childViews.find(u=>{var i,d;const l=(i=u.view.componentProps)==null?void 0:i.categoryView,a=((d=u.view.filterMultiple)==null?void 0:d.teamType)||1;return l&&l.length>0&&l[0].id===f&&a===$})?0:1}}if(this.viewId===1){const y=r[0]||[];if(!y||y.length===0)return 0;if(Array.isArray(y)){const $=this.childViews.map(f=>{var u;return(u=f.view.componentProps)==null?void 0:u.type}).filter(f=>f!==void 0);return y.filter(f=>!$.includes(f)).length}else{const $=y;return this.childViews.find(f=>{var u;return((u=f.view.componentProps)==null?void 0:u.type)===$})?0:1}}return 0}getRequiresAddView(r,n){if(this.viewId===5)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===17){const y=r[2]||1,$=r[2];return y===3||$===3?this.childViews.length<2:this.childViews.length===0}if(this.viewId===10)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return r[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const y=r[0];return y?y.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const y=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;return this.childViews.length===0&&y}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(r);if(this.viewId===16&&n){const y=[n.selectedCategories,n.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(y,n.totalCategoriesSelected)}if(this.viewId===18&&n){const y=[n.howManyCorners,n.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(y,n.howManyCorners)}if(this.viewId===1){const y=r[0]||[];if(!y||y.length===0)return!1;if(Array.isArray(y)){const $=this.childViews.map(f=>{var u;return(u=f.view.componentProps)==null?void 0:u.type}).filter(f=>f!==void 0);return y.filter(f=>!$.includes(f)).length>0}else{const $=y;return!this.childViews.find(f=>{var u;return((u=f.view.componentProps)==null?void 0:u.type)===$})}}if(this.viewId===2){const y=r[0]||[];if(Array.isArray(y)){if(y.length>0){const $=this.childViews.map(f=>{var u;const i=(u=f.view.componentProps)==null?void 0:u.categoryView;return i&&i.length>0?i[0].id:null}).filter(f=>f!==null);return y.filter(f=>!$.includes(f)).length>0}return!1}else{const $=y,f=r[1]||1;return $?!this.childViews.find(u=>{var i,d;const l=(i=u.view.componentProps)==null?void 0:i.categoryView,a=((d=u.view.filterMultiple)==null?void 0:d.teamType)||1;return l&&l.length>0&&l[0].id===$&&a===f}):!1}}return this.viewId===8?r[1]===3?this.childViews.length<2:this.childViews.length===0:this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(r,n=null){const y=this.childViews.filter(l=>l.view.isHomeTeam),$=this.childViews.filter(l=>!l.view.isHomeTeam),f=n||r[0].length,u=r[1],i=f*(u===1||u===2?1:2),d=u===3?y.length+$.length:y.length||$.length;return i>d}getRequiresLessViews(r){if(this.viewId===5)return r[0]!==3&&this.childViews.length>1;if(this.viewId===15)return r[0]!==3&&this.childViews.length>1;if(this.viewId===8)return r[1]!==3&&this.childViews.length>1;if(this.viewId===17)return r[0]!==3&&this.childViews.length>1;if(this.viewId===6){const n=r[0];return n===2||n===3}return this.viewId,!1}updateSummary({dynamicFilters:r}){const n=this.childViews[0],y=document.querySelector(`[gs-id="${n.view.id}"]`),$=n.grid;if(n&&y&&$){const f=r[0],u=`min_column${f?"_2":""}`,i=`min_row${f?"_2":""}`,d=`max_column${f?"_2":""}`,l=`max_row${f?"_2":""}`,a=`colspan${f?"_2":""}`,S=`rowspan${f?"_2":""}`,T=n.view.coreView[a],b=n.view.coreView[S],p=n.view.coreView[u],s=n.view.coreView[i],c=n.view.coreView[d],o=n.view.coreView[l];n.view.w=T,n.view.h=b,n.view.maxWidth=c,n.view.maxHeight=o,n.view.minWidth=p,n.view.minHeight=s,y.setAttribute("gs-w",T),y.setAttribute("gs-h",b),y.setAttribute("gs-max-w",c),y.setAttribute("gs-max-h",o),y.setAttribute("gs-min-w",p),y.setAttribute("gs-min-h",s),$.update(y,{h:b,w:T,"gs-max-h":o,"gs-max-w":c,"gs-min-h":s,"gs-min-w":p})}}updateFilters(r){this.filters=r,this.viewId===16?this.updateLastTouchFilters(r):this.viewId===18&&this.updateSpecificPlaysFilters(r)}updateDynamicFilters(r,n=null){var y,$,f,u;if(!this._isUpdating){this._isUpdating=!0,n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r,Sd.emit("component-added-to-container",this);try{if(this.viewId===5){const i=r[0]||1;if(i<3)if(this.childViews.length===1){const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.preMatchType=i,d.view.filterMultiple={isHomeTeam:d.view.componentProps.preMatchType===1})}else{const d=this.childViews.pop(),l=d.grid,a=d.page,S=document.querySelector(`[gs-id="${d.view.id}"]`);if(l&&S&&(l.removeWidget(S),a)){const b=a.items.findIndex(p=>p.id===d.view.id);b!==-1&&a.items.splice(b,1)}const T=this.childViews[0];T.view.componentProps&&(T.view.componentProps.preMatchType=i,T.view.filterMultiple={isHomeTeam:T.view.componentProps.preMatchType})}else this.childViews.forEach((d,l)=>{d.view.componentProps.preMatchType=l+1,d.view.filterMultiple={isHomeTeam:d.view.componentProps.preMatchType}})}if(this.viewId===15){const i=r[0]||1;if(n){const d=this.childViews.find(l=>l.view.id===n);d&&d.view.componentProps&&(d.view.componentProps.preMatchType=i,d.view.filterMultiple={isHomeTeam:i===1})}else if(i<3){if(this.childViews.length===1){const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.preMatchType=i,d.view.filterMultiple={isHomeTeam:i===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const l=this.childViews.pop(),a=l.grid,S=l.page,T=document.querySelector(`[gs-id="${l.view.id}"]`);if(a&&T&&(a.removeWidget(T),S)){const b=S.items.findIndex(p=>p.id===l.view.id);b!==-1&&S.items.splice(b,1)}}const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.preMatchType=i,d.view.filterMultiple={isHomeTeam:i===1})}}else if(this.childViews.length===2)this.childViews.forEach((d,l)=>{d.view.componentProps&&(d.view.componentProps.preMatchType=l+1,d.view.filterMultiple={isHomeTeam:l===0})});else if(this.childViews.length<2)this.childViews.forEach((d,l)=>{d.view.componentProps&&(d.view.componentProps.preMatchType=l+1,d.view.filterMultiple={isHomeTeam:l===0})});else{for(;this.childViews.length>2;){const d=this.childViews.pop(),l=d.grid,a=d.page,S=document.querySelector(`[gs-id="${d.view.id}"]`);if(l&&S&&(l.removeWidget(S),a)){const T=a.items.findIndex(b=>b.id===d.view.id);T!==-1&&a.items.splice(T,1)}}this.childViews.forEach((d,l)=>{d.view.componentProps&&(d.view.componentProps.preMatchType=l+1,d.view.filterMultiple={isHomeTeam:l===0})})}}if(this.viewId===17){const i=r[0]||1,d=r[2],l=i===3||d===3;if(n){const a=this.childViews.find(S=>S.view.id===n);if(a&&a.view.componentProps&&(r[0]!==void 0&&(a.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(a.view.componentProps.lateralidad=r[1]===32?"right":"left"),r[2]!==void 0)){const S=r[2],T=a.view.componentProps.game;if(S===3){if(((y=a.view.filterMultiple)==null?void 0:y.isHomeTeam)!==void 0){const b=a.view.filterMultiple.isHomeTeam;T&&(a.view.componentProps.teamselected=(typeof b=="boolean"?b:b===1)?T.home_team:T.away_team)}}else T&&(a.view.componentProps.teamselected=S===2?T.away_team:T.home_team);a.view.filterMultiple={isHomeTeam:S===1||S===3&&(($=a.view.filterMultiple)==null?void 0:$.isHomeTeam)}}}else if(l)if(this.childViews.length===2)this.childViews.forEach((a,S)=>{a.view.componentProps&&(a.view.componentProps.teamselected=S+1,a.view.filterMultiple={isHomeTeam:S===0})});else if(this.childViews.length<2)this.childViews.forEach((a,S)=>{a.view.componentProps&&(a.view.componentProps.teamselected=S+1,a.view.filterMultiple={isHomeTeam:S===0})});else{for(;this.childViews.length>2;){const a=this.childViews.pop(),S=a.grid,T=a.page,b=document.querySelector(`[gs-id="${a.view.id}"]`);if(S&&b&&(S.removeWidget(b),T)){const p=T.items.findIndex(s=>s.id===a.view.id);p!==-1&&T.items.splice(p,1)}}this.childViews.forEach((a,S)=>{a.view.componentProps&&(a.view.componentProps.teamselected=S+1,a.view.filterMultiple={isHomeTeam:S===0})})}else if(this.childViews.length===1){const a=this.childViews[0];if(a.view.componentProps){r[0]!==void 0&&(a.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(a.view.componentProps.lateralidad=r[1]===32?"right":"left");const S=a.view.componentProps.game;if(r[2]!==void 0&&S){const T=r[2];a.view.componentProps.teamselected=T===2?S.away_team:S.home_team}a.view.filterMultiple={isHomeTeam:i===1}}}else if(this.childViews.length>1){for(;this.childViews.length>1;){const S=this.childViews.pop(),T=S.grid,b=S.page,p=document.querySelector(`[gs-id="${S.view.id}"]`);if(T&&p&&(T.removeWidget(p),b)){const s=b.items.findIndex(c=>c.id===S.view.id);s!==-1&&b.items.splice(s,1)}}const a=this.childViews[0];if(a.view.componentProps){r[0]!==void 0&&(a.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(a.view.componentProps.lateralidad=r[1]===32?"right":"left");const S=a.view.componentProps.game;if(r[2]!==void 0&&S){const T=r[2];a.view.componentProps.teamselected=T===2?S.away_team:S.home_team}a.view.filterMultiple={isHomeTeam:i===1}}}}if(this.viewId===10){const i=r[0]||1;if(i<3)if(this.childViews.length===1){const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=i===1,d.view.filterMultiple={isHomeTeam:d.view.componentProps.isHomeTeamForAnalysis})}else{const d=this.childViews.pop(),l=d.grid,a=d.page,S=document.querySelector(`[gs-id="${d.view.id}"]`);if(l&&S&&(l.removeWidget(S),a)){const b=a.items.findIndex(p=>p.id===d.view.id);b!==-1&&a.items.splice(b,1)}const T=this.childViews[0];T.view.componentProps&&(T.view.componentProps.isHomeTeamForAnalysis=i===1,T.view.filterMultiple={isHomeTeam:T.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((d,l)=>{d.view.componentProps.isHomeTeamForAnalysis=l%2===0,d.view.filterMultiple={isHomeTeam:d.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const i=r[1];if(i===3)this.childViews.forEach((d,l)=>{d.view.componentProps.isHomeTeamForAnalysis=l%2===0,d.view.isHomeTeam=l%2===0,d.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",d.view.filterMultiple={isHomeTeam:d.view.isHomeTeam}});else{const d=i===1;if(this.childViews.length>0){const l=this.childViews[0];l.view.componentProps.isHomeTeamForAnalysis=d,l.view.isHomeTeam=d,l.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",l.view.filterMultiple={isHomeTeam:d},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const i=r[0],d=r[1];if(d===3){if(this.childViews.length>i.length){const l=i.map(a=>{const S=a.join("-");return F4.get(this.viewId).analysisTypes.get(S).analysisType});this.childViews.reduce((a,S)=>(l.includes(S.view.componentProps.analysisType)||a.push(S.view.componentProps.analysisType),a),[]).forEach(a=>{const S=this.childViews.findIndex(T=>T.view.componentProps.analysisType===a);if(S!==-1){const T=this.childViews[S];this.removeChildView(T)}})}}else{const l=d===1,a=this.getHomeTeamViews(),S=this.getAwayTeamViews();if(l&&a.length===0)S.forEach(T=>{T.view.componentProps.isHomeTeamForAnalysis=l,T.view.isHomeTeam=l,T.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}});else if(!l&&S.length===0)a.forEach(T=>{T.view.componentProps.isHomeTeamForAnalysis=l,T.view.isHomeTeam=l,T.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}});else if(a.length===S.length)l||a.forEach(T=>{T.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}}),(l?S:a).forEach(T=>{this.removeChildView(T)});else{const T=l?this.getHomeTeamViews():this.getAwayTeamViews();if(T.length>i.length){const b=i.map(p=>{const s=p.join("-");return F4.get(this.viewId).analysisTypes.get(s).analysisType});T.forEach(p=>{b.includes(p.view.componentProps.analysisType)?p.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}:this.removeChildView(p)})}else T.forEach(b=>{b.view.filterMultiple={categoryIds:i[0],isHomeTeam:l}})}}}if(this.viewId===2){const i=r[0]||[];if(Array.isArray(i)){const d=this.childViews.map(l=>{var a,S;const T=(a=l.view.componentProps)==null?void 0:a.categoryView,b=((S=l.view.filterMultiple)==null?void 0:S.teamType)||1,p=T&&T.length>0?T[0].id:null;return p?{categoryId:p,teamType:b,viewId:l.view.id}:null}).filter(l=>l!==null);if(n){const l=this.childViews.find(a=>a.view.id===n);if(l){const a=r[1]||1,S=i[0];if(S){let T=null;try{T=R4(S)}catch{}l.view.filterMultiple={categoryId:S,teamType:a},l.view.componentProps.game&&(a===1?l.view.componentProps.teamView=l.view.componentProps.game.homeTeam.team_id:a===2?l.view.componentProps.teamView=l.view.componentProps.game.awayTeam.team_id:l.view.componentProps.teamView=0),l.view.componentProps.categoryView=T?[{id:S,name:T.name}]:[{id:S,name:`Category ${S}`}]}}}if(!n){const l=r[1]||1;this.childViews.forEach(a=>{var S;const T=(S=a.view.componentProps)==null?void 0:S.categoryView;if(T&&T.length>0){const b=T[0].id;i.includes(b)&&(a.view.filterMultiple={categoryId:b,teamType:l})}})}if(d.map(l=>l.categoryId).filter(l=>!i.includes(l)).forEach(l=>{this.childViews.filter(a=>{var S;const T=(S=a.view.componentProps)==null?void 0:S.categoryView;return T&&T.length>0&&T[0].id===l}).forEach(a=>{this.removeChildView(a),Sd.emit("component-removed",{viewId:a.view.id,categoryId:l})})}),n){const l=i[0];if(l){const a=this.childViews.find(S=>S.view.id===n);if(a){let S=null;try{S=R4(l)}catch{}const T=r[1]||1;a.view.filterMultiple={categoryId:l,teamType:T},a.view.componentProps.game&&(a.view.componentProps.teamView=T===2?a.view.componentProps.game.awayTeam.team_id:T===1?a.view.componentProps.game.homeTeam.team_id:0),a.view.componentProps.categoryView=S?[{id:l,name:S.name}]:[{id:l,name:`Category ${l}`}]}}}}else{const d=i;if(d&&n){const l=this.childViews.find(a=>a.view.id===n);if(l){let a=null;try{a=R4(d)}catch{}const S=r[1]||1;l.view.filterMultiple={categoryId:d,teamType:S},l.view.componentProps.game&&(l.view.componentProps.teamView=S===2?l.view.componentProps.game.awayTeam.team_id:S===1?l.view.componentProps.game.homeTeam.team_id:0),l.view.componentProps.categoryView=a?[{id:d,name:a.name}]:[{id:d,name:`Category ${d}`}]}}}}if(this.viewId===8){const i=r[0]||!1,d=r[1],l=(a,S)=>{a.view.componentProps&&(a.view.componentProps._isReactive||(a.view.componentProps=e.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=S.areInactiveVisible,a.view.componentProps.key=S.areInactiveVisible,S.isHomeTeam!==void 0&&(a.view.filterMultiple={...a.view.filterMultiple||{},isHomeTeam:S.isHomeTeam}),S.teamId!==void 0&&a.view.componentProps.game&&(a.view.componentProps.teamSelected={teamId:S.teamId}),Sd.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:r}))};if(n){const a=this.childViews.find(S=>S.view.id===n);a&&l(a,{areInactiveVisible:i})}else if(this.childViews.forEach(a=>{l(a,{areInactiveVisible:i})}),d===3){if(this.childViews.length===2)this.childViews.forEach((a,S)=>{var T;const b=(T=a.view.componentProps)==null?void 0:T.game;a.view.filterMultiple={isHomeTeam:S===0},b&&(a.view.componentProps.teamSelected={teamId:S===0?b.home_team:b.away_team})});else if(this.childViews.length>2){for(;this.childViews.length>2;){const a=this.childViews.pop(),S=a.grid,T=a.page,b=document.querySelector(`[gs-id="${a.view.id}"]`);if(S&&b&&(S.removeWidget(b),T)){const p=T.items.findIndex(s=>s.id===a.view.id);p!==-1&&T.items.splice(p,1)}}this.childViews.forEach((a,S)=>{var T;a.view.filterMultiple={isHomeTeam:S===0},(T=a.view.componentProps)!=null&&T.game&&(a.view.componentProps.teamSelected={teamId:S===0?a.view.componentProps.game.home_team:a.view.componentProps.game.away_team})})}}else if(this.childViews.length===1){const a=this.childViews[0],S=(f=a.view.componentProps)==null?void 0:f.game;a.view.filterMultiple={isHomeTeam:d===1},S&&(a.view.componentProps.teamSelected={teamId:d===1?S.home_team:S.away_team})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const T=this.childViews.pop(),b=T.grid,p=T.page,s=document.querySelector(`[gs-id="${T.view.id}"]`);if(b&&s&&(b.removeWidget(s),p)){const c=p.items.findIndex(o=>o.id===T.view.id);c!==-1&&p.items.splice(c,1)}}const a=this.childViews[0],S=(u=a.view.componentProps)==null?void 0:u.game;a.view.filterMultiple={isHomeTeam:d===1},S&&(a.view.componentProps.teamSelected={teamId:d===1?S.home_team:S.away_team})}}if(this.viewId===1){const i=r[0]||[];if(n){this.setDynamicFilters(r,n);const d=this.childViews.find(l=>l.view.id===n);d&&this.updateComparative(d,r)}else if(this.childViews.reduce((d,l)=>(i.includes(l.view.componentProps.type)||d.push(l.view.componentProps.type),d),[]).forEach(d=>{const l=this.childViews.findIndex(a=>a.view.componentProps.type===d);if(l!==-1){for(let a=l;a<this.childViews.length;a++){const S=this.childViews[a+1],T=this.childViews[a];S&&(T.view.componentProps.type=S.view.componentProps.type,T.view.title=S.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(i))this.childViews.length>0&&i.length>0&&this.childViews.forEach((d,l)=>{if(d.view.componentProps&&l<i.length){const a=i[l],S=F4.get(this.viewId);d.view.componentProps.type=a,d.view.componentProps.default=!1,d.view.title=`Comparativa ${S[a]}`,d.view.filterMultiple={category:a}}});else{const d=i;if(d&&this.childViews.length>0){const l=this.childViews[0];if(l.view.componentProps){const a=F4.get(this.viewId);l.view.componentProps.type=d,l.view.componentProps.default=!1,l.view.title=`Comparativa ${a[d]}`,l.view.filterMultiple={category:d}}}}}if(this.viewId===6){const i=r[0]||[];if(n){this.setDynamicFilters(r,n);const d=this.childViews.find(l=>l.view.id===n);d&&this.updateGSCLineupsReports(d,r)}else{if(Array.isArray(i))if(i.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((d,l)=>(i.includes(l.view.componentProps.gameNumber)||d.push(l.view.componentProps.gameNumber),d),[]).forEach(d=>{const l=this.childViews.findIndex(a=>a.view.componentProps.gameNumber===d);if(l!==-1){for(let a=l;a<this.childViews.length;a++){const S=this.childViews[a+1],T=this.childViews[a];S&&(T.view.componentProps.gameNumber=S.view.componentProps.gameNumber,T.view.filterMultiple={gameNumber:S.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(d=>{d.view.componentProps&&(d.view.componentProps._isReactive||(d.view.componentProps=e.reactive(d.view.componentProps),d.view.componentProps._isReactive=!0),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:d.view.id,dynamicFilters:r}))})}}if(this.viewId===3){if(n){this.setDynamicFilters(r,n);const i=this.childViews.find(d=>d.view.id===n);i&&this.updateMatchSummary(i,r)}else{const i=r[0]||!1;this.childViews.forEach(d=>{d.view.componentProps&&(d.view.componentProps._isReactive||(d.view.componentProps=e.reactive(d.view.componentProps),d.view.componentProps._isReactive=!0),d.view.componentProps.desplegable=i,d.view.componentProps.key=i,Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:d.view.id,dynamicFilters:r}))})}this.updateSummary({dynamicFilters:r})}if(this.viewId===13){const i=r[1]||[];if(n){this.setDynamicFilters(r,n);const d=this.childViews.find(l=>l.view.id===n);d&&(d.view.componentProps&&(d.view.componentProps.categoryids=i,d.view.componentProps.analysistype=r[0]||1,d.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],d.view.dynamicFilters=r,d.view._updateKey=Date.now()),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:d.view.id,dynamicFilters:r}))}else this.childViews.forEach(d=>{d.view.componentProps&&(d.view.componentProps._isReactive||(d.view.componentProps=e.reactive(d.view.componentProps),d.view.componentProps._isReactive=!0),d.view.componentProps.categoryids=i,d.view.componentProps.analysistype=r[0]||1,d.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],d.view.dynamicFilters=r,d.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:d.view.id,dynamicFilters:r}))})}else if(this.viewId===15){const i=r[0]||1,d=r[3]!==void 0?r[3]:typeof r[1]=="number"?r[1]:null;if(n){this.setDynamicFilters(r,n);const l=this.childViews.find(a=>a.view.id===n);l&&l.view.componentProps&&(l.view.componentProps.analysistype=i,d!==null&&(l.view.componentProps.numitems=d),l.view.dynamicFilters=r,l.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:l.view.id,componentProps:l.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:l.view.id,dynamicFilters:r}))}else this.childViews.forEach(l=>{l.view.componentProps&&(l.view.componentProps._isReactive||(l.view.componentProps=e.reactive(l.view.componentProps),l.view.componentProps._isReactive=!0),l.view.componentProps.analysistype=i,d!==null&&(l.view.componentProps.numitems=d),l.view.dynamicFilters=r,l.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:l.view.id,componentProps:l.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:l.view.id,dynamicFilters:r}))})}if(this.viewId===4){const i=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;if(n){const d=this.childViews.find(l=>l.view.id===n);d&&d.view.componentProps.selectedEvents}else if(!i&&this.childViews.length>0)this.childViews.forEach(d=>{this.removeChildView(d)});else if(i&&this.childViews.length===0){const d={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};Sd.emit("add-view",d)}else this.childViews.forEach(d=>{this.updateTimeline(d,r)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(r=>{this.removeChildView(r)})}removeChildView(r,n=!1){const y=this.childViews.findIndex($=>$.view.id===r.view.id);if(y!==-1){const $=this.childViews[y];this.childViews.splice(y,1),$.view.id&&this.componentSpecificFilters.delete($.view.id);const f=$.grid,u=$.page,i=document.querySelector(`[gs-id="${$.view.id}"]`);if(f&&i&&(f.removeWidget(i),u&&!n)){const d=u.items.findIndex(l=>l.id===$.view.id);d!==-1&&(u.items.splice(d,1),u.items.length===0&&Sd.emit("empty-page",u))}}}updateView({view:r,dynamicFilters:n,filtersJSON:y,filters:$}){this.setFiltersJSON(y),this.dynamicFilters=n;const f=this.childViews.find(u=>{var i;return((i=u.view)==null?void 0:i.id)===r.view.id});if(f){f.view.filtersJSON=y,f.view.coreView&&(f.view.coreView.filtersJSON=y);let u=n;if(this.viewId===4){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===8){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===3){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i),this.updateSummary({dynamicFilters:u})}else if(this.viewId===1){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===6){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===7){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===9){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}this.viewId===5?this.updateVolumetricField(f,u):this.viewId===7?this.updateGoalData(f,u):this.viewId===9?this.updateFieldDataByZones(f,n):this.viewId===10?this.updateXg(f,u):this.viewId===3?this.updateMatchSummary(f,u):this.viewId===4?this.updateTimeline(f,u):this.viewId===8?this.updateFieldPosesion(f,u):this.viewId===1?this.updateComparative(f,u):this.viewId===2?this.updateGSCtops(f,u):this.viewId===6?this.updateGSCLineupsReports(f,u):this.viewId===16?this.updateLastTouchSingle(f,$):this.viewId===18&&this.updateSpecificPlaysFiltersSingle(f,$)}}updateComparative(r,n){if(r.view.componentProps){const y=n[0]||[];if(y&&y.length>0){let $;if(Array.isArray(y)){const u=this.childViews.findIndex(i=>i.view.id===r.view.id);u>=0&&u<y.length?$=y[u]:$=y[0]}else $=y;const f=F4.get(this.viewId);r.view.componentProps.type=$,r.view.componentProps.default=!1,r.view.title=`Comparativa ${f[$]}`,r.view.filterMultiple={category:$}}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateVolumetricField(r,n){if(r.view.componentProps){const y=n[0]||1;r.view.isHomeTeam=y===1,r.view.componentProps.preMatchType=y,r.view.filterMultiple={isHomeTeam:y},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateGoalData(r,n){if(r.view.componentProps){const y=n[0]===1?"offensive":"defensive",$=n[1]===1;r.view.componentProps.analysisType=y,r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={isHomeTeam:$},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldDataByZones(r,n){if(r.view.componentProps){const y=n[0],$=n[1]===1;if(r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={categoryIds:y,isHomeTeam:$},y&&y.length){const f=y.join("-"),u=F4.get(this.viewId).analysisTypes.get(f);u&&(r.view.componentProps.analysisType=u.analysisType,r.view.title=u.title,r.view.titleShort=u.titleShort)}}}updateXg(r,n){const y=n[0]===1;r.view.componentProps&&(r.view.isHomeTeam=y,r.view.componentProps.isHomeTeamForAnalysis=y,r.view.filtersJSON=this.filtresJSON,r.view.filterMultiple={isHomeTeam:y})}updateMatchSummary(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const y=n&&n.length>0?n[0]:!1;r.view.componentProps.desplegable=y,r.view.componentProps.key=y,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateTimeline(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const y=this.getComponentDynamicFilters(r.view.id)||n,$=y&&y.length>0?y[0]:[];r.view.componentProps.selectedEvents=$,r.view.componentProps.key=$.length>0;const f=this.hasEventTypeId($,1),u=this.hasCategoryId($,8),i=this.hasCategoryId($,9),d=this.hasEventTypeId($,3);r.view.componentProps.goals=f,r.view.componentProps.yellowCards=u,r.view.componentProps.redCards=i,r.view.componentProps.substitutions=d,r.view.componentProps._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:y}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:y}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldPosesion(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=e.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const y=n&&n.length>0?n[0]:!1;r.view.componentProps.areInactiveVisible=y,r.view.componentProps.key=y,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateGSCtops(r,n){if(r.view.componentProps){const y=n[0]||[];if(Array.isArray(y)){if(y.length>0){const $=y[0];let f=null;try{f=R4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=n[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=f?[{id:$,name:f.name}]:[{id:$,name:`Category ${$}`}]}}else{const $=y;if($){let f=null;try{f=R4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=n[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=f?[{id:$,name:f.name}]:[{id:$,name:`Category ${$}`}]}}}}updateGSCLineupsReports(r,n){if(r.view.componentProps){const y=n[0]||[];if(Array.isArray(y)){if(y.length>0){const $=y[0];r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$}}else{const $=y;$&&(r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$)}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}getCategoryIdFromAnalysisType(r,n){if(!r||!n)return null;for(const y of n){const $=y.join("-"),f=F4.get(this.viewId);if(f&&f.analysisTypes){const u=f.analysisTypes.get($);if(u&&u.analysisType===r)return y[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach($=>{$.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,$.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,$.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,$.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const r=this.filters.selectedCategories.map($=>$.value),n=r.map($=>$.name),y=this.filters.selectedTeam.value;if(y===3)this.childViews.length>r&&this.childViews.reduce(($,f)=>(n.includes(f.view.componentProps.categories[0].name)||$.push(f.view.componentProps.categories[0].name),$),[]).forEach($=>{const f=this.childViews.findIndex(u=>u.view.componentProps.categories[0].name===$);if(f!==-1){const u=this.childViews[f];this.removeChildView(u)}});else{const $=y===1,f=this.getHomeTeamViews(),u=this.getAwayTeamViews();if($&&f.length===0)u.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(!$&&u.length===0)f.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(f.length===u.length)$||f.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$}),($?u:f).forEach(i=>{this.removeChildView(i)});else{const i=$?this.getHomeTeamViews():this.getAwayTeamViews();if(i.length>r.length){const d=r.map(l=>l.name);i.forEach(l=>{d.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=$:this.removeChildView(l)})}else i.forEach(d=>{d.view.filterMultiple.isHomeTeam=$})}}}updateLastTouchSingle(r,n){if(r.view.componentProps){const y=n.selectedTeam.value===1,$=n.selectedCategory.value;r.view.isHomeTeam=y,r.view.componentProps.isHomeTeamForAnalysis=y,r.view.componentProps.categories=[$],r.view.componentProps.analysisType=n.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=n.isAssistZoneVisible,r.view.componentProps.howManyGames=n.howManyGamesSelected.value,r.view.title=$.name,r.view.titleShort=$.name,r.view.isHomeTeam=y,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:$,selectedGamePhase:n.selectedGamePhase,howManyGamesSelected:n.howManyGamesSelected,isAssistZoneVisible:n.isAssistZoneVisible}}}updateSpecificPlaysFilters(){if(!this.filters)return;this.childViews.forEach(n=>{n.view.componentProps.advancedFilters=this.filters.advancedFilters,n.view.componentProps.howManyCorners=this.filters.howManyCorners,n.view.componentProps.isAgainstMode=this.filters.isAgainstMode,n.view.filterMultiple.advancedFilters=this.filters.advancedFilters,n.view.filterMultiple.isAgainstMode=this.filters.isAgainstMode});const r=this.filters.selectedTeam.value;if(r===3){const n=this.getHomeTeamViews(),y=this.getAwayTeamViews();if(n.length+y.length>this.filters.howManyCorners*2){const $=[];n.forEach((f,u)=>{u>=this.filters.howManyCorners&&$.push(f)}),y.forEach((f,u)=>{u>=this.filters.howManyCorners&&$.push(f)}),$.forEach(f=>{this.removeChildView(f)})}}else{const n=r===1,y=this.getHomeTeamViews(),$=this.getAwayTeamViews();if(n&&y.length===0)$.forEach(f=>{console.log("awayView before update:",f),f.view.componentProps.isHomeTeamForAnalysis=n,f.view.isHomeTeam=n,f.view.filterMultiple.isHomeTeam=n});else if(!n&&$.length===0)y.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=n,f.view.isHomeTeam=n,f.view.filterMultiple.isHomeTeam=n});else if(y.length===$.length)n||y.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=n,f.view.isHomeTeam=n,f.view.filterMultiple.isHomeTeam=n}),(n?$:y).forEach(f=>{this.removeChildView(f)});else{const f=n?this.getHomeTeamViews():this.getAwayTeamViews();f.length>this.filters.howManyCorners?f.forEach((u,i)=>{i>=this.filters.howManyCorners?this.removeChildView(u):u.view.filterMultiple.isHomeTeam=n}):f.forEach(u=>{u.view.filterMultiple.isHomeTeam=n})}}}updateSpecificPlaysFiltersSingle(r,n){if(n.selectedTeam&&r.view.componentProps){const y=n.selectedTeam.value===1;r.view.isHomeTeam=y,r.view.componentProps.isHomeTeamForAnalysis=y,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.advancedFilters=n.advancedFilters,r.view.componentProps.isAgainstMode=n.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:n.advancedFilters,isAgainstMode:n.isAgainstMode}}}}const fHt={class:"template-page__header"},mHt={class:"template-page__header__name"},yHt=["value"],gHt={class:"template-page__header__details"},vHt={class:"template-page__header__details__teams"},bHt={class:"template-page__header__details__teams__team"},xHt={key:0,class:"template-page__header__details__teams__team__logo"},_Ht=["src"],wHt={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},THt={class:"template-page__header__details__teams__team"},SHt={key:0,class:"template-page__header__details__teams__team__logo"},kHt=["src"],LHt={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},CHt={class:"template-page__content"},NHt=["id"],OHt=["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"],EHt=e.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(t,{emit:r}){var n,y,$,f,u,i,d;const l=e.ref(null);let a=null;const S=t,T=e.ref(!1),b=r,p=e.computed(()=>S.page.items.reduce((qt,_t)=>(qt.set(_t.id,_t),qt),new Map)),s=e.computed(()=>{var qt,_t,It,jt;return S.game&&S.game.homeTeam&&S.game.awayTeam?{homeTeam:{name:((qt=S.game.homeTeam)==null?void 0:qt.acronym)||"LOC",logo:((_t=S.game.homeTeam)==null?void 0:_t.logo)||null},awayTeam:{name:((It=S.game.awayTeam)==null?void 0:It.acronym)||"VIS",logo:((jt=S.game.awayTeam)==null?void 0:jt.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let c=null,o=null,h=!1,v=null,k=!1;const L=()=>{k=!0},E=()=>{k=!1};function P(){k||(h=!0,v&&clearTimeout(v),v=setTimeout(()=>{h=!1},150))}function V(){const qt={root:null,rootMargin:"0px",threshold:.7};c=new IntersectionObserver(jt=>{jt.forEach(Rt=>{if(h){o&&clearTimeout(o),o=setTimeout(()=>{b("intersection-changed",Rt.isIntersecting)},100);return}o&&clearTimeout(o),o=setTimeout(()=>{b("intersection-changed",Rt.isIntersecting)},50)})},qt);const _t=l.value;_t&&c.observe(_t);const It=document.querySelector(".container-main");It&&It.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}function I(qt){S.page.title=qt.target.value,b("view-changed")}const j={game_id:0,season_id:0,prematch:!1},F={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:[]}},D=new Map([[5,{component:BI,componentName:"GSCVolumetricField",props:{isGamePreMatch:!S.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:S.isTemplateMode,isTemplateMode:S.isTemplateMode,preMatchType:1}}],[2,{component:Pj,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:S.game?S.game.id:F.gameId,game:S.game,season:S.game?(n=S==null?void 0:S.game)==null?void 0:n.season_id:F.seasonId,teamView:0,useDummyData:S.isTemplateMode}}],[8,{component:FD,componentName:"FieldPosesion",props:{widthSection:600,game:F,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:jB,componentName:"GSCLineupsReports",props:{selectedOption:S.isPostMatch?"Postmatch":"Prematch",game:j,gamehome:j,gameaway:j}}],[3,{component:qD,componentName:"GSCMatchSummary",props:{game:F,defaultShields:!0,desplegable:!1}}],[4,{component:SW,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:F.gameId,homeTeam:F.homeTeam.team_id,awayTeam:F.awayTeam.team_id,token:S.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:MK,componentName:"GSCGoalData",props:{game:S.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!S.isPostMatch,analysisType:1}}],[9,{component:KB,componentName:"GSCFieldDataByZones",props:{game:S.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!S.isPostMatch,negative:!0}}],[10,{component:oP,componentName:"GSCGameXg",props:{game:S.game,isHomeTeamForAnalysis:!0,isPostMatch:S.isPostMatch}}],[13,{component:$U,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:S.game?(y=S==null?void 0:S.game)==null?void 0:y.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:hU,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:EX,componentName:"GSCStrengths",props:{token:S.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[17,{component:DG,componentName:"GSCCornersGeneralTrend",props:{game:S.game?{id:S.game.id||S.game.game_id||S.game.gameId||null,home_team:S.game.home_team||null,away_team:S.game.visiting_team||null,season:S.game.seasonId||S.game.season_id||null,game_status:S.game.game_status||S.game.status||null,home_acronym:S.game.home_team_acronym||(($=S.game.homeTeam)==null?void 0:$.acronym)||null,away_acronym:S.game.visiting_team_acronym||((f=S.game.awayTeam)==null?void 0:f.acronym)||null,logo_home:((u=S.game.homeTeam)==null?void 0:u.logo)||null,logo_away:((i=S.game.awayTeam)==null?void 0:i.logo)||null}:null,infavoragainstteam:!0,forseason:!1,forteam:!0,showdefault:!0,tournamentselected:{id:1},forgame:!1,lateralidad:"right",teamselected:2,filters:{},showBallGo:!0,showHeatMap:!0,ballOnOff:!1}}],[10,{component:oP,componentName:"GSCGameXg",props:{game:S.game,isHomeTeamForAnalysis:!0,isPostMatch:S.isPostMatch}}],[1,{component:OK,componentName:"GSCComparativeReports",props:{gameId:S.game?S.game.id:"",homeLogo:S.game?S.game.homeTeam.logo:"",awayLogo:S.game?S.game.awayTeam.logo:"",seasonId:S.game?(d=S==null?void 0:S.game)==null?void 0:d.season_id:0,typeGame:S.isPostMatch,type:"stoppedBall",default:S.isTemplateMode}}],[16,{component:FX,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:17,gameDataUTC:"2025-11-08T03:00:00Z",isHomeTeamForAnalysis:!0,isTemplateMode:S.isTemplateMode,isPreMatch:!S.isPostMatch}}],[18,{component:AZ,componentName:"GSCSpecificPlays",props:{isHomeTeamForAnalysis:!0,isTemplateMode:S.isTemplateMode,isPreMatch:!S.isPostMatch,seasonIdForAnalysis:1325,selectedCategory:31,teamIdForAnalysis:1,isAgainstMode:!1,game:{id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"},advancedFilters:{areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0}}}]]);function U(qt){var _t,It,jt;if(((_t=qt==null?void 0:qt.coreView)==null?void 0:_t.id)===17&&qt.dynamicFilters&&qt.dynamicFilters[2]!==void 0){const Rt=qt.dynamicFilters[2];if(Rt===1)return!0;if(Rt===2)return!1;if(Rt===3&&((It=qt.filterMultiple)==null?void 0:It.isHomeTeam)!==void 0)return typeof qt.filterMultiple.isHomeTeam=="boolean"?qt.filterMultiple.isHomeTeam:qt.filterMultiple.isHomeTeam===1}return(jt=qt.componentProps)!=null&&jt.preMatchType?qt.componentProps.preMatchType===1:qt.isHomeTeam}function M(qt){if(qt)if(typeof qt=="string"){let _t=null;switch(qt){case"GSCVolumetricField":_t=BI;break;case"GSCGoalData":_t=MK;break;case"GscTopPlayer":_t=Pj;break;case"FieldPosesion":_t=FD;break;case"GSCLineupsReports":_t=jB;break;case"GSCMatchSummary":_t=qD;break;case"GSCTimelineReports":_t=SW;break;case"GSCFieldDataByZones":_t=KB;break;case"GSCGeneraltable":_t=hU;break;case"GSCTimelapseTable":_t=$U;break;case"GSCGameXg":_t=oP;break;case"GSCComparativeReports":_t=OK;break;case"GSCStrengths":_t=EX;break;case"GSCCornersGeneralTrend":_t=DG;break;case"GSCLastTouch":_t=FX;break;case"GSCSpecificPlays":_t=AZ;break;default:_t=null}return _t}else return qt;return null}function X({pageId:qt,view:_t,filterAndWidgetContainer:It,applyMinimumSize:jt=!1,dynamicFilters:Rt=[],filters:Wt=null}){if(S.page.id===qt&&a){let re=!1;_t.id===3&&(re=Rt[0]);const le=`min_column${re?"_2":""}`,he=`min_row${re?"_2":""}`,de=`colspan${re?"_2":""}`,Jt=`rowspan${re?"_2":""}`,te={w:jt?_t[le]:_t[de],h:jt?_t[he]:_t[Jt]};if(a.willItFit(te)){const ne=a.addWidget(te),Le=Number(ne.getAttribute("gs-x")||0),Oe=Number(ne.getAttribute("gs-y")||0);a.removeWidget(ne);const Ne=D.get(_t.id),Pe=e.reactive({...JSON.parse(JSON.stringify(Ne.props))||{},_isReactive:!0}),Xe=e.reactive({pageId:qt,grid:a,page:S.page,view:{name:_t.name,title:_t.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:Le,y:Oe,w:te.w,h:te.h,maxWidth:_t.max_column,maxHeight:_t.max_row,minWidth:_t.min_column,minHeight:_t.min_row,componentName:Ne.componentName,componentProps:Pe,pageId:qt,coreView:_t}});It.addView(Xe),Sd.emit("add-page-view",Xe)}else Sd.emit("add-page-and-view",{pageId:qt,view:_t,filterAndWidgetContainer:It})}}function O(qt){if(a){const _t=document.querySelector(`[gs-id="${qt.id}"]`);_t&&(a.removeWidget(_t),b("delete-view",qt))}}function Y(qt){if(!qt.filterAndViewsContainer&&qt.coreView){const _t=new Yk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[qt],qt.coreView.id,qt.dynamicFilters||[],S.isPostMatch,S.isTemplateMode,qt.filtersJSON,null,qt.filters);qt.filterAndViewsContainer=_t}b("edit-view",qt)}function st(){b("delete-page",S.page)}function mt(){Sd.emit("change-sort",S.page)}function yt(qt){if(h)return;const _t=S.page.items.find(It=>It.id===qt.itemId||It.id===qt.viewId);_t&&(Object.assign(_t.componentProps,qt.componentProps),_t._updateKey=Date.now())}function bt(qt){if(h)return;const _t=S.page.items.find(It=>It.id===qt.viewId);_t&&(Object.assign(_t.componentProps,qt.componentProps),_t._updateKey=Date.now())}function xt(qt){if(h)return;const _t=S.page.items.find(It=>It.id===qt.viewId);_t&&(Object.assign(_t.componentProps,qt.componentProps||{}),_t._updateKey=Date.now())}const Pt=function(){Sd.off("add-view",X),Sd.off("force-component-update",yt),Sd.off("component-props-updated",bt),Sd.off("dynamic-filters-changed",xt);const qt=document.querySelector(".container-main");qt&&qt.removeEventListener("scroll",P),o&&clearTimeout(o),v&&clearTimeout(v)};return Sd.on("add-view",X),Sd.on("force-component-update",yt),Sd.on("component-props-updated",bt),Sd.on("dynamic-filters-changed",xt),e.onMounted(async()=>{await e.nextTick(),a=Rh.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${S.id}`),a.on("change",(qt,_t)=>{const It=_t[0];if(It){const jt=p.value.get(It.id);jt&&(jt.x=It.x,jt.y=It.y,jt.w=It.w,jt.h=It.h,b("view-changed"))}}),V(),S.page.grid=a,S.page.offListeners=Pt}),e.onUnmounted(()=>{c&&c.disconnect(),Pt(),o&&clearTimeout(o),v&&clearTimeout(v),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E)}),(qt,_t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"templatePage",ref:l,class:"template-page"},[e.createElementVNode("div",fHt,[T.value?(e.openBlock(),e.createBlock(RZ,{key:0,"options-type":"page",onClick:_t[0]||(_t[0]=e.withModifiers(It=>T.value=!1,["self"])),onMouseleave:_t[1]||(_t[1]=It=>T.value=!1),onCloseTooltip:_t[2]||(_t[2]=It=>T.value=!1),onDeletePage:st,onChangeSort:mt})):e.createCommentVNode("",!0),e.createElementVNode("div",mHt,[_t[4]||(_t[4]=e.createElementVNode("div",null,[e.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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)),_t[5]||(_t[5]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("input",{value:t.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:I},null,40,yHt)]),e.createElementVNode("div",gHt,[e.createElementVNode("div",vHt,[e.createElementVNode("div",bHt,[s.value.homeTeam.logo?(e.openBlock(),e.createElementBlock("div",xHt,[e.createElementVNode("img",{src:s.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,_Ht)])):(e.openBlock(),e.createElementBlock("svg",wHt,[..._t[6]||(_t[6]=[e.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.createElementVNode("span",null,e.toDisplayString(s.value.homeTeam.name),1)]),_t[8]||(_t[8]=e.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),e.createElementVNode("div",THt,[e.createElementVNode("span",null,e.toDisplayString(s.value.awayTeam.name),1),s.value.awayTeam.logo?(e.openBlock(),e.createElementBlock("div",SHt,[e.createElementVNode("img",{src:s.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,kHt)])):(e.openBlock(),e.createElementBlock("svg",LHt,[..._t[7]||(_t[7]=[e.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)])]))])]),t.isTemplateMode&&!t.isFilterVisible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:_t[3]||(_t[3]=It=>T.value=!0)},[..._t[9]||(_t[9]=[e.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",CHt,[e.createElementVNode("div",{id:`grid-stack-${t.id}`,class:"grid-stack"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.page.items,It=>{var jt;return e.openBlock(),e.createElementBlock("div",{class:"grid-stack-item",key:It.key,"gs-id":It.id,"gs-x":It.x,"gs-y":It.y,"gs-w":It.w,"gs-h":It.h,"gs-max-w":It.maxWidth,"gs-max-h":It.maxHeight,"gs-min-w":It.minWidth,"gs-min-h":It.minHeight,"gs-no-resize":!t.isTemplateMode,"gs-no-move":!S.isTemplateMode,"gs-auto-position":It.x===0&&It.y===0},[e.createElementVNode("div",{class:e.normalizeClass(["grid-stack-item-content",{"is-selected":It.isSelected}])},[e.createVNode(iHt,{view:It,"is-template-mode":t.isTemplateMode,"is-post-match":t.isPostMatch,game:t.game,lastGames:t.lastGames,"is-home-team":U(It),"is-filter-visible":t.isFilterVisible,"view-id":((jt=It==null?void 0:It.coreView)==null?void 0:jt.id)||0,onEdit:Rt=>Y(It),onDelete:Rt=>O(It)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(M(It.componentName)),e.mergeProps({ref_for:!0},It.componentProps,{key:`${It.id}-${It._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,OHt)}),128))],8,NHt)])],512))}}),zHt=e2(EHt,[["__scopeId","data-v-9e61e7d4"]]),MHt={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},VHt={key:0,class:"cover__main-logo cover__main-logo__home"},PHt={key:0,class:"team-logo"},AHt=["src"],RHt={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},FHt=["fill"],UHt={key:1,class:"cover__main-logo cover__main-logo__away"},IHt={key:0,class:"team-logo"},qHt=["src"],jHt={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DHt=["fill"],WHt={class:"cover__title-subtitle"},BHt={class:"cover__title-subtitle__title"},KHt={class:"cover__title-subtitle__subtitle"},XHt={key:2,class:"cover-type-one"},GHt={class:"team-info-one"},ZHt={class:"team-data"},JHt={key:0,class:"team-logo"},HHt=["src"],YHt={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},QHt=["fill","opacity"],$Ht={class:"team-name"},tYt={key:0,class:"team-events"},eYt={class:"score-one"},rYt={key:0},nYt={class:"team-info-one"},aYt={class:"team-data"},iYt={key:0,class:"team-logo"},oYt=["src"],sYt={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lYt=["fill","opacity"],cYt={class:"team-name"},uYt={key:0,class:"team-events"},dYt={key:3,class:"cover-type-two"},pYt={class:"team-data"},hYt={class:"team-info"},fYt={key:0,class:"team-logo"},mYt=["src"],yYt={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gYt=["fill","opacity"],vYt={key:2,class:"team-score-two"},bYt={key:0,class:"team-goals"},xYt={class:"team-data"},_Yt={class:"team-info"},wYt={key:0,class:"team-score-two"},TYt={key:1,class:"team-logo"},SYt=["src"],kYt={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},LYt=["fill","opacity"],CYt={key:0,class:"team-goals"},NYt={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(null),f=e.computed(()=>[1,2].includes(n.coverId)),u=e.computed(()=>[1,3].includes(n.coverId)),i=e.computed(()=>n.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:n.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),d=e.computed(()=>n.game&&n.game.score?n.game.score:["0","0"]),l=e.computed(()=>{var I,j,F,D,U,M,X,O;if(n.game&&n.game.homeTeam&&n.game.awayTeam){const Y={homeTeam:{name:((I=n.game.homeTeam)==null?void 0:I.acronym)||"LOC",logo:((j=n.game.homeTeam)==null?void 0:j.logo)||null},awayTeam:{name:((F=n.game.awayTeam)==null?void 0:F.acronym)||"VIS",logo:((D=n.game.awayTeam)==null?void 0:D.logo)||null}};return f.value?(Y.homeTeam.goalsMinutes=s(n.game.minutes.home_goals_minutes),Y.homeTeam.totalYellowCards=((U=n.game.minutes.home_yellow_cards_minutes)==null?void 0:U.length)||0,Y.homeTeam.totalRedCards=((M=n.game.minutes.home_red_cards_minutes)==null?void 0:M.length)||0,Y.awayTeam.goalsMinutes=s(n.game.minutes.visiting_goals_minutes),Y.awayTeam.totalYellowCards=((X=n.game.minutes.away_yellow_cards_minutes)==null?void 0:X.length)||0,Y.awayTeam.totalRedCards=((O=n.game.minutes.away_red_cards_minutes)==null?void 0:O.length)||0):(Y.homeTeam.goalsEvents=p(n.game.report_minutes.home_goals_minutes),Y.awayTeam.goalsEvents=p(n.game.report_minutes.visiting_goals_minutes)),Y}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'"}]}}}),a=e.computed(()=>({"--background-image":u.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":n.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":n.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":n.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":n.isPostMatch?"100%":"fit-content"})),S=e.computed(()=>n.isPostMatch?"Postmatch":"Prematch"),T=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],b=e.computed(()=>{if(n.game){let I=MHt[n.game.matchday_abbreviation];I||(I=n.game.matchday_abbreviation.replace("M","J"));const[j,F,D]=n.game.date.split("-");return`${I} - ${D} ${T[Number(F)-1]}, ${j}`}return"Jornada - Día 00 Mes"});function p(I){return!I||!Array.isArray(I)||I.length===0?"":I.map(j=>{const F=j.split(", ");let D=F[0].replace("'","");D=D.replace("+",""),D=D.replace("’","");const U=D.split(" "),{strings:M,numbers:X}=U.reduce((st,mt)=>(isNaN(Number(mt))?st.strings.push(mt):st.numbers.push(mt),st),{strings:[],numbers:[]}),O=M.join(" "),Y=X.length===1?`${X[0]}'`:`${X[0]}' ${X.slice(1).join(" + ")}'`;return{playerName:O,goalTime:F.length===1?Y:`${Y}, ${F.reduce((st,mt,yt)=>yt===0?st:`${st}${mt}${yt<F.length-1?", ":""}`,"")}`}})}function s(I){return!I||!Array.isArray(I)||I.length===0?"":I.reduce((j,F,D)=>{const U=F.split(" ");let M="";return U.length===3?M=U[2]:U.length===5&&(M=`${U[2]} ${U[3]} ${U[4]}`),M&&(j+=`${M}${D<I.length-1?", ":""}`),j},"")}let c=null,o=null,h=!1,v=null,k=!1;const L=()=>{k=!0},E=()=>{k=!1};function P(){k||(h=!0,v&&clearTimeout(v),v=setTimeout(()=>{h=!1},150))}function V(){const I={root:null,rootMargin:"0px",threshold:.7};c=new IntersectionObserver(D=>{D.forEach(U=>{if(h){o&&clearTimeout(o),o=setTimeout(()=>{y("intersection-changed",U.isIntersecting)},100);return}o&&clearTimeout(o),o=setTimeout(()=>{y("intersection-changed",U.isIntersecting)},50)})},I);const j=$.value;j&&c.observe(j);const F=document.querySelector(".container-main");F&&F.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}return e.onMounted(()=>{V()}),e.onUnmounted(()=>{c&&c.disconnect();const I=document.querySelector(".container-main");I&&I.removeEventListener("scroll",P),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E),o&&clearTimeout(o),v&&clearTimeout(v)}),(I,j)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"coverPage",ref:$,class:"cover",style:e.normalizeStyle(a.value)},[f.value?(e.openBlock(),e.createElementBlock("div",VHt,[l.value.homeTeam.logo?(e.openBlock(),e.createElementBlock("div",PHt,[e.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,AHt)])):(e.openBlock(),e.createElementBlock("svg",RHt,[e.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:i.value.homeTeam},null,8,FHt)]))])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("div",UHt,[l.value.awayTeam.logo?(e.openBlock(),e.createElementBlock("div",IHt,[e.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,qHt)])):(e.openBlock(),e.createElementBlock("svg",jHt,[e.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:i.value.awayTeam},null,8,DHt)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",WHt,[e.createElementVNode("div",BHt,[j[0]||(j[0]=e.createElementVNode("div",null,"Análisis",-1)),e.createElementVNode("div",null,e.toDisplayString(S.value),1)]),e.createElementVNode("div",KHt,e.toDisplayString(b.value),1)]),f.value?(e.openBlock(),e.createElementBlock("div",XHt,[e.createElementVNode("div",GHt,[e.createElementVNode("div",ZHt,[l.value.homeTeam.logo?(e.openBlock(),e.createElementBlock("div",JHt,[e.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,HHt)])):(e.openBlock(),e.createElementBlock("svg",YHt,[e.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:i.value.homeTeam,opacity:i.value.opacity},null,8,QHt)])),e.createElementVNode("div",$Ht,e.toDisplayString(l.value.homeTeam.name),1)]),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",tYt,[j[1]||(j[1]=e.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)),e.createElementVNode("div",null,e.toDisplayString(l.value.homeTeam.goalsMinutes),1),j[2]||(j[2]=e.createElementVNode("div",{class:"separator"},null,-1)),j[3]||(j[3]=e.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),e.createElementVNode("div",null,e.toDisplayString(l.value.homeTeam.totalYellowCards),1),j[4]||(j[4]=e.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),e.createElementVNode("div",null,e.toDisplayString(l.value.homeTeam.totalRedCards),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",eYt,[t.isPostMatch?(e.openBlock(),e.createElementBlock("div",rYt,e.toDisplayString(d.value[0])+" : "+e.toDisplayString(d.value[1]),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",nYt,[e.createElementVNode("div",aYt,[l.value.awayTeam.logo?(e.openBlock(),e.createElementBlock("div",iYt,[e.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,oYt)])):(e.openBlock(),e.createElementBlock("svg",sYt,[e.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:i.value.awayTeam,opacity:i.value.opacity},null,8,lYt)])),e.createElementVNode("div",cYt,e.toDisplayString(l.value.awayTeam.name),1)]),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",uYt,[e.createElementVNode("div",null,e.toDisplayString(l.value.awayTeam.totalYellowCards),1),j[5]||(j[5]=e.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),e.createElementVNode("div",null,e.toDisplayString(l.value.awayTeam.totalRedCards),1),j[6]||(j[6]=e.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),j[7]||(j[7]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("div",null,e.toDisplayString(l.value.awayTeam.goalsMinutes),1),j[8]||(j[8]=e.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))])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",dYt,[e.createElementVNode("div",pYt,[e.createElementVNode("div",hYt,[l.value.homeTeam.logo?(e.openBlock(),e.createElementBlock("div",fYt,[e.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,mYt)])):(e.openBlock(),e.createElementBlock("svg",yYt,[e.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:i.value.homeTeam,opacity:i.value.opacity},null,8,gYt)])),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",vYt,e.toDisplayString(d.value[0]),1)):e.createCommentVNode("",!0)]),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",bYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.homeTeam.goalsEvents,(F,D)=>(e.openBlock(),e.createElementBlock("div",{key:`goal-${D}`,class:"goal"},[e.createElementVNode("div",null,e.toDisplayString(F.playerName),1),j[9]||(j[9]=e.createElementVNode("div",{class:"bullet"},null,-1)),e.createElementVNode("div",null,e.toDisplayString(F.goalTime),1),j[10]||(j[10]=e.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))])):e.createCommentVNode("",!0)]),j[13]||(j[13]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("div",xYt,[e.createElementVNode("div",_Yt,[t.isPostMatch?(e.openBlock(),e.createElementBlock("div",wYt,e.toDisplayString(d.value[1]),1)):e.createCommentVNode("",!0),l.value.awayTeam.logo?(e.openBlock(),e.createElementBlock("div",TYt,[e.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,SYt)])):(e.openBlock(),e.createElementBlock("svg",kYt,[e.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:i.value.awayTeam,opacity:i.value.opacity},null,8,LYt)]))]),t.isPostMatch?(e.openBlock(),e.createElementBlock("div",CYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.awayTeam.goalsEvents,(F,D)=>(e.openBlock(),e.createElementBlock("div",{key:`goal-a-${D}`,class:"goal"},[j[11]||(j[11]=e.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)),e.createElementVNode("div",null,e.toDisplayString(F.goalTime),1),j[12]||(j[12]=e.createElementVNode("div",{class:"bullet"},null,-1)),e.createElementVNode("div",null,e.toDisplayString(F.playerName),1)]))),128))])):e.createCommentVNode("",!0)])]))],4))}},OYt=e2(NYt,[["__scopeId","data-v-6680cbcf"]]),EYt={class:"table-category-filters"},zYt={key:0,class:"custom-radio-group filter-inline"},MYt={class:"radio-label"},VYt={class:"radio-options"},PYt=["name","value","onUpdate:modelValue"],AYt=["data-filter-type","onClick"],RYt={class:"select-display"},FYt={class:"select-label"},UYt={key:0,class:"dropdown-menu type-menu simple-select-menu"},IYt={class:"simple-select-scroll-area"},qYt=["onClick"],jYt={class:"option-content"},DYt={class:"option-title"},WYt={key:0,class:"option-checkmark"},BYt={key:2,class:"filter-separator"},KYt={__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(t,{expose:r,emit:n}){const y=t,$=n,f=e.ref([]);let u=null;const i=(k,L)=>{if(!L)return!0;for(let E=0;E<k.length;E++)if(!d(k[E],L[E]))return!0;return!1},d=(k,L)=>{if(Array.isArray(k)&&Array.isArray(L)){if(k.length!==L.length)return!1;for(let E=0;E<k.length;E++)if(k[E]!==L[E])return!1;return!0}return k===L},l=e.ref(null),a=e.ref([]);let S=!1,T=null;const b=()=>{T=null},p=()=>{setTimeout(()=>{S=!1},1e3)},s=(k,L=!0)=>{if(y.filters&&y.filters[0]&&y.filters[1]&&y.filters[1].options){const E=y.filters[0].options,P=y.filters[1].options;k!=null?E.findIndex(V=>V.value===k)!==-1&&P[k]?(a.value=P[k],L&&!(()=>{const V=f.value[1];return V==null?!1:Array.isArray(V)?V.length>0:V!==""})()&&!S&&a.value.length>0&&(f.value[1]=a.value[0].value,e.nextTick(()=>{}))):(a.value=[],f.value[1]=null):(a.value=[],f.value[1]=null)}},c=()=>{y.initialValues&&y.initialValues.length>0?f.value=[...y.initialValues]:f.value=y.filters.map(k=>{var L,E,P,V;return k.type==="select"?[]:k.type==="check"?!1:k.type==="radio-button"?((E=(L=k.options)==null?void 0:L[0])==null?void 0:E.value)||null:k.type==="select-simple"&&((V=(P=k.options)==null?void 0:P[0])==null?void 0:V.value)||null}),y.componentId===13&&f.value.some(k=>k!=null&&(Array.isArray(k)?k.length>0:k!==!1&&k!==""))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))};c(),setTimeout(()=>{e.nextTick(()=>{if(f.value[0]!==null&&f.value[0]!==void 0&&!S){const k=!(()=>{const L=f.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})();s(f.value[0],k)}})},300),e.watch(()=>y.initialValues,k=>{const L=!d(f.value,k),E=k&&k.length>0&&!S&&L,P=y.isEditMode&&S;E&&!P?f.value=[...k]:S?T&&T.length>0&&(f.value=[...T]):P&&T&&T.length>0&&(f.value=[...T])},{deep:!0}),e.watch(()=>y.isEditMode,(k,L)=>{L===!0&&k===!1&&b()},{immediate:!0}),e.watch(f,(k,L)=>{k.some(E=>E!=null&&(Array.isArray(E)?E.length>0:E!==!1&&E!==""))&&i(k,u)&&(u=[...k],$("filters-changed",{componentId:y.componentId,filters:k,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),e.watch(()=>f.value[0],(k,L)=>{k!==L&&L!==void 0?s(k,!0):L===void 0&&k!==null&&k!==void 0&&s(k,!1)},{immediate:!0}),e.watch(()=>f.value,(k,L)=>{y.filters.map((E,P)=>E.type==="radio-button"?P:-1).filter(E=>E!==-1)},{deep:!0}),e.watch(a,()=>{},{deep:!0});const o=k=>{l.value===k?l.value=null:l.value=k},h=(k,L)=>{if(S=!0,p(),f.value[k]=L,(k===0||k===1)&&(T=[...f.value]),l.value=null,k===0){f.value[1]!==void 0&&(f.value[1]=null);const E=S;S=!1,s(L,!0),S=E,f.value[1]!==null&&f.value[1]!==void 0&&(T=[...f.value])}},v=()=>{S=!0,setTimeout(()=>{S=!1},1e3)};return r({getCurrentValues:()=>f.value,initializeValues:c}),(k,L)=>(e.openBlock(),e.createElementBlock("div",EYt,[t.filters&&t.filters.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":t.filters.length>=2}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filters,(E,P)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:P},[E.type==="radio-button"?(e.openBlock(),e.createElementBlock("div",zYt,[e.createElementVNode("div",MYt,e.toDisplayString(E.label),1),e.createElementVNode("div",VYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.options,V=>(e.openBlock(),e.createElementBlock("label",{key:V.value,class:e.normalizeClass(["radio-option-card",{active:f.value[P]===V.value}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"table-radio-"+P,value:V.value,"onUpdate:modelValue":I=>f.value[P]=I,onChange:L[0]||(L[0]=()=>{v()})},null,40,PYt),[[e.vModelRadio,f.value[P]]]),e.createElementVNode("span",null,e.toDisplayString(V.label),1)],2))),128))])])):E.type==="select-simple"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":E.type,onClick:e.withModifiers(V=>o(P),["stop"])},[e.createElementVNode("div",RYt,[L[2]||(L[2]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.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)),e.createElementVNode("span",FYt,e.toDisplayString(E.label||"Tipo de análisis"),1),e.createElementVNode("span",{class:e.normalizeClass(["arrow",{open:l.value===P}])},[...L[1]||(L[1]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===P?(e.openBlock(),e.createElementBlock("div",UYt,[e.createElementVNode("div",IYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P===1?a.value:E.options,V=>(e.openBlock(),e.createElementBlock("div",{key:V.value,class:e.normalizeClass(["option-card simple-select-option",{active:d(f.value[P],V.value)}]),onClick:e.withModifiers(I=>h(P,V.value),["stop"])},[e.createElementVNode("div",jYt,[e.createElementVNode("div",DYt,e.toDisplayString(V.label),1)]),d(f.value[P],V.value)?(e.openBlock(),e.createElementBlock("div",WYt,[...L[3]||(L[3]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[e.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):e.createCommentVNode("",!0)],10,qYt))),128))])])):e.createCommentVNode("",!0)],8,AYt)):e.createCommentVNode("",!0),P===1&&t.filters.length>2?(e.openBlock(),e.createElementBlock("div",BYt)):e.createCommentVNode("",!0)],64))),128))],2)):e.createCommentVNode("",!0)]))}},XYt=e2(KYt,[["__scopeId","data-v-fd7f7425"]]),GYt={class:"strengths-filters"},ZYt={key:0,class:"custom-radio-group filter-inline"},JYt={class:"radio-label"},HYt={class:"radio-options"},YYt=["name","value","onUpdate:modelValue"],QYt={class:"filter-inline select-with-label"},$Yt=["data-filter-type","onClick"],tQt={class:"select-display"},eQt={class:"select-label"},rQt={key:0,class:"dropdown-menu type-menu simple-select-menu"},nQt={class:"simple-select-scroll-area"},aQt=["onClick"],iQt={class:"option-content"},oQt={class:"option-title"},sQt={key:0,class:"option-checkmark"},lQt={key:2,class:"filter-separator"},cQt={__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(t,{expose:r,emit:n}){const y=t,$=n,f=e.ref([]);let u=null;const i=e.ref(null),d=e.ref([]);let l=!1,a=null;const S=(o,h)=>{if(Array.isArray(o)&&Array.isArray(h)){if(o.length!==h.length)return!1;for(let v=0;v<o.length;v++)if(o[v]!==h[v])return!1;return!0}return o===h},T=(o,h=!0)=>{if(y.filters&&y.filters[0]&&y.filters[1]&&y.filters[1].options){const v=y.filters[0].options,k=y.filters[1].options;o!=null?v.findIndex(L=>L.value===o)!==-1&&k[o]?(d.value=k[o],h&&!(()=>{const L=f.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})()&&!l&&d.value.length>0&&(f.value[1]=d.value[0].value,e.nextTick(()=>{}))):(d.value=[],f.value[1]=null):(d.value=[],f.value[1]=null)}},b=()=>{y.initialValues&&y.initialValues.length>0?y.initialValues.length>0&&(typeof y.initialValues[0]=="number"||typeof y.initialValues[0]=="boolean"||y.initialValues[0]===null||Array.isArray(y.initialValues[0]))?f.value=[...y.initialValues]:y.isEditMode?f.value=y.filters.map((o,h)=>{var v,k,L,E,P,V,I,j,F,D;const U=y.initialValues[h];return U?o.type==="radio-button"&&U.selectedOption?U.selectedOption.value:o.type==="radio-button"&&!U.selectedOption?U.selectedValue!==void 0?U.selectedValue:((V=(P=o.options)==null?void 0:P[0])==null?void 0:V.value)||null:o.type==="select-simple"&&U.selectedValue!==void 0?Array.isArray(U.selectedValue)?U.selectedValue[0]:U.selectedValue:o.type==="select"&&U.selectedOptions?U.selectedOptions.map(M=>M.value):o.type==="check"&&U.isChecked!==void 0?U.isChecked:U.selectedValue!==void 0?U.selectedValue:o.type==="select"?[]:o.type==="check"?!1:o.type==="radio-button"?((j=(I=o.options)==null?void 0:I[0])==null?void 0:j.value)||null:o.type==="select-simple"&&((D=(F=o.options)==null?void 0:F[0])==null?void 0:D.value)||null:o.type==="select"?[]:o.type==="check"?!1:o.type==="radio-button"?((k=(v=o.options)==null?void 0:v[0])==null?void 0:k.value)||null:o.type==="select-simple"&&((E=(L=o.options)==null?void 0:L[0])==null?void 0:E.value)||null}):f.value=[...y.initialValues]:f.value=y.filters.map(o=>{var h,v,k,L;return o.type==="select"?[]:o.type==="check"?!1:o.type==="radio-button"?((v=(h=o.options)==null?void 0:h[0])==null?void 0:v.value)||null:o.type==="select-simple"&&((L=(k=o.options)==null?void 0:k[0])==null?void 0:L.value)||null}),f.value.some(o=>o!=null&&(Array.isArray(o)?o.length>0:o!==!1&&o!==""))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))};b(),setTimeout(()=>{e.nextTick(()=>{if(f.value[0]!==null&&f.value[0]!==void 0&&!l){const o=!(()=>{const h=f.value[1];return h==null?!1:Array.isArray(h)?h.length>0:h!==""})();T(f.value[0],o)}})},300),e.watch(()=>y.initialValues,(o,h)=>{if(!o||o.length===0)return;const v=o.length>0&&(typeof o[0]=="number"||typeof o[0]=="boolean"||o[0]===null||Array.isArray(o[0])),k=!S(f.value,o),L=o&&o.length>0&&!l&&k,E=y.isEditMode&&l;L&&!E?v?f.value=[...o]:y.isEditMode?f.value=y.filters.map((P,V)=>{const I=o[V];return I?P.type==="radio-button"&&I.selectedOption?I.selectedOption.value:P.type==="select-simple"&&I.selectedValue!==void 0?Array.isArray(I.selectedValue)?I.selectedValue[0]:I.selectedValue:P.type==="select"&&I.selectedOptions?I.selectedOptions.map(j=>j.value):P.type==="check"&&I.isChecked!==void 0?I.isChecked:I.selectedValue!==void 0?I.selectedValue:f.value[V]:f.value[V]}):f.value=[...o]:l?a&&a.length>0&&(f.value=[...a]):E&&a&&a.length>0&&(f.value=[...a])},{deep:!0}),e.watch(()=>y.isEditMode,(o,h)=>{h===!0&&o===!1&&(a=null)},{immediate:!0}),e.watch(f,o=>{o.some(h=>h!=null&&(Array.isArray(h)?h.length>0:h!==!1&&h!==""))&&(()=>{if(!u)return!0;for(let h=0;h<o.length;h++)if(!S(o[h],u[h]))return!0;return!1})()&&(u=[...o],$("filters-changed",{componentId:y.componentId,filters:o,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),e.watch(()=>f.value[0],(o,h)=>{o!==h&&h!==void 0?T(o,!0):h===void 0&&o!==null&&o!==void 0&&T(o,!1)},{immediate:!0});const p=o=>{i.value===o?i.value=null:i.value=o},s=(o,h)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),f.value[o]=h,(o===0||o===1)&&(a=[...f.value]),i.value=null,o===0){f.value[1]!==void 0&&(f.value[1]=null);const v=l;l=!1,T(h,!0),l=v,f.value[1]!==null&&f.value[1]!==void 0&&(a=[...f.value])}},c=()=>{l=!0,setTimeout(()=>{l=!1},400)};return r({getCurrentValues:()=>f.value,initializeValues:b}),(o,h)=>(e.openBlock(),e.createElementBlock("div",GYt,[t.filters&&t.filters.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":t.filters.length>=2}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filters,(v,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:k},[v.type==="radio-button"?(e.openBlock(),e.createElementBlock("div",ZYt,[e.createElementVNode("div",JYt,e.toDisplayString(v.label),1),e.createElementVNode("div",HYt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.options,L=>(e.openBlock(),e.createElementBlock("label",{key:L.value,class:e.normalizeClass(["radio-option-card",{active:f.value[k]===L.value}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"strengths-radio-"+k,value:L.value,"onUpdate:modelValue":E=>f.value[k]=E,onChange:c},null,40,YYt),[[e.vModelRadio,f.value[k]]]),e.createElementVNode("span",null,e.toDisplayString(L.label),1)],2))),128))])])):v.type==="select-simple"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[h[4]||(h[4]=e.createElementVNode("div",{class:"filter-separator"},null,-1)),e.createElementVNode("div",QYt,[h[3]||(h[3]=e.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),e.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":v.type,onClick:e.withModifiers(L=>p(k),["stop"])},[e.createElementVNode("div",tQt,[h[1]||(h[1]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.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)),e.createElementVNode("span",eQt,e.toDisplayString(v.label||"Tipo de análisis"),1),e.createElementVNode("span",{class:e.normalizeClass(["arrow",{open:i.value===k}])},[...h[0]||(h[0]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===k?(e.openBlock(),e.createElementBlock("div",rQt,[e.createElementVNode("div",nQt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.options,L=>(e.openBlock(),e.createElementBlock("div",{key:L.value,class:e.normalizeClass(["option-card simple-select-option",{active:S(f.value[k],L.value)}]),onClick:e.withModifiers(E=>s(k,L.value),["stop"])},[e.createElementVNode("div",iQt,[e.createElementVNode("div",oQt,e.toDisplayString(L.label),1)]),S(f.value[k],L.value)?(e.openBlock(),e.createElementBlock("div",sQt,[...h[2]||(h[2]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[e.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):e.createCommentVNode("",!0)],10,aQt))),128))])])):e.createCommentVNode("",!0)],8,$Yt)])],64)):e.createCommentVNode("",!0),k===1&&t.filters.length>2?(e.openBlock(),e.createElementBlock("div",lQt)):e.createCommentVNode("",!0)],64))),128))],2)):e.createCommentVNode("",!0)]))}},uQt=e2(cQt,[["__scopeId","data-v-700ac1f0"]]),dQt=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},pQt={key:1},hQt={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fQt=["fill"],mQt={key:0,class:"checkbox__teams"},yQt={class:"checkbox__teams__logo"},gQt=["src"],vQt={class:"checkbox__teams__logo"},bQt=["src"],xQt={__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(t){return["left","right","top","bottom"].includes(t)}},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(t,{emit:r}){const n=t;e.useCssVars(l=>({"7bd9d47b":t.width,"34dc7ddc":t.height}));const y=e.ref(!1),$=e.computed(()=>{const l={color:n.boxValueColor,"font-family":n.fontFamily,height:n.boxWidthAndHeight,width:n.boxWidthAndHeight,minWidth:n.boxWidthAndHeight,"border-radius":n.boxBorderRadius,"margin-top":n.boxMarginTop};return y.value?(l["background-color"]=n.boxBackgroundColor,l.border=`solid ${n.boxBorderWidth} ${n.boxBackgroundColor}`):l.border=`solid ${n.boxBorderWidth} ${n.boxBorderColor}`,l}),f=e.computed(()=>({"font-family":n.boxValueFontFamily,"font-size":n.boxValueFontSize,color:n.boxValueColor,"line-height":1})),u=e.computed(()=>{const l={color:n.labelColor,"font-family":n.fontFamily,"font-size":n.labelFontSize,"white-space":n.labelWhiteSpace,"text-align":n.boxPosition==="top"||n.boxPosition==="bottom"?"center":n.boxPosition};return(n.boxPosition==="left"||n.boxPosition==="right")&&(l[`margin-${n.boxPosition}`]=n.isBoxOnly?"0":n.teamsIds?"8px":"10px"),l});e.watch(()=>n.modelValue,l=>{l!==y.value&&(y.value=l)},{immediate:!0});function i(){n.avoidInteraction||!y.value&&n.avoidToCheck||(y.value=!y.value,r("update:modelValue",y.value))}function d(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["checkbox",`box-${t.boxPosition}`]),onClick:i},[e.createElementVNode("div",{class:"checkbox__box",style:e.normalizeStyle($.value)},[y.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.boxValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"checkbox__box__value",style:e.normalizeStyle(f.value)},e.toDisplayString(t.boxValue),5)):(e.openBlock(),e.createElementBlock("div",pQt,[(e.openBlock(),e.createElementBlock("svg",hQt,[e.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:t.boxValueColor},null,8,fQt)]))]))],64)):e.createCommentVNode("",!0)],4),t.teamsIds&&t.teamsIds.length?(e.openBlock(),e.createElementBlock("div",mQt,[e.createElementVNode("div",yQt,[e.createElementVNode("img",{src:d(t.teamsIds[0]),alt:""},null,8,gQt)]),e.createElementVNode("div",vQt,[e.createElementVNode("img",{src:d(t.teamsIds[1]),alt:""},null,8,bQt)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"checkbox__label",style:e.normalizeStyle(u.value)},e.toDisplayString(t.label),5)],2))}},lA=dQt(xQt,[["__scopeId","data-v-b6f124d8"]]),_Qt=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},cA={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(t){this.status=t}}},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(t){this.$emit("click",t),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},DZ=()=>{e.useCssVars(t=>({"9d01acb4":t.height,"14e95081":t.borderWidthBtn,"38fec285":t.borderType,34353510:t.borderColor,"20d20dc6":t.borderRadius,17130967:t.width,"4ccb7d36":t.backgroundColor,"5d1e86a2":t.cursorType,ce65d4a2:t.fontSize,fe4ac47a:t.fontStyle,f98e44dc:t.fontFamily,"93b87770":t.marginLeftStat,c7f7beba:t.fontSizeStat}))},WZ=cA.setup;cA.setup=WZ?(t,r)=>(DZ(),WZ(t,r)):DZ;const wQt=t=>(e.pushScopeId("data-v-f3ee6b2b"),t=t(),e.popScopeId(),t),TQt=["src"],SQt={key:1,class:"text"},kQt=["src"],LQt={class:"stats"},CQt=wQt(()=>e.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),NQt={class:"numstats"},OQt={class:"leyend"};function EQt(t,r,n,y,$,f){return e.openBlock(),e.createElementBlock("div",null,[n.type==0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["button",$.status&&n.typeOnOff&&"button-active"]),style:e.normalizeStyle([f.customStyle,$.status&&n.typeOnOff&&f.customActive]),onClick:r[0]||(r[0]=(...u)=>f.btnClick&&f.btnClick(...u))},[n.icon&&n.iconPosition.toLowerCase()==="left"?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",style:e.normalizeStyle({width:n.iconSize}),src:n.icon},null,12,TQt)):e.createCommentVNode("",!0),n.textValue?(e.openBlock(),e.createElementBlock("div",SQt,e.toDisplayString(n.textValue),1)):e.createCommentVNode("",!0),n.icon&&n.iconPosition.toLowerCase()==="right"?(e.openBlock(),e.createElementBlock("img",{key:2,class:"icon",style:e.normalizeStyle({width:n.iconSize}),src:n.icon},null,12,kQt)):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0),n.type==1?(e.openBlock(),e.createElementBlock("div",{key:1,class:"button-target",onClick:r[1]||(r[1]=(...u)=>f.btnClick&&f.btnClick(...u))},[e.createElementVNode("div",LQt,[CQt,e.createElementVNode("div",NQt,e.toDisplayString(n.textStat),1)]),e.createElementVNode("div",OQt,e.toDisplayString(n.textCategory),1)])):e.createCommentVNode("",!0)])}const zQt=_Qt(cA,[["render",EQt],["__scopeId","data-v-f3ee6b2b"]]),MQt={class:"gsc-dropdown__main-container__item-selected"},VQt=["height","width"],PQt=["stroke"],AQt={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},RQt=["fill"],FQt={class:"gsc-dropdown__items-container"},UQt=["onClick"],IQt={key:0,class:"gsc-dropdown__items-footer"},Qk={__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(t){return["solid","dotted","dashed"].includes(t)}},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:t=>["propName","value"].every(r=>r in t)},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(t){return[1,2].includes(t)}}},emits:["input","click-ready","update:modelValue"],setup(t,{emit:r}){const n=t,y=e.ref({}),$=e.ref(null),f=e.ref(n.isMultipleOption?-1:0),u=e.ref(!1);e.watch(()=>n.items,(b,p)=>{if(!n.modelValue&&(!n.onlyFirstTime||!p||!p.length)&&b&&b.length){if(n.defaultItemByProp){const s=n.items.findIndex(c=>c[n.defaultItemByProp.propName]===n.defaultItemByProp.value);s!==-1?(f.value=s,y.value=b[s]):(f.value=0,y.value=b[0])}else y.value=b[n.defaultItemByIndex];r("input",y.value)}},{immediate:!0}),e.watch(()=>n.modelValue,b=>{if(b){const p=n.items.findIndex(s=>typeof b=="object"?JSON.stringify(s)===JSON.stringify(b):s===b);p!==-1&&(f.value=p,y.value=n.items[p],r("update:modelValue",y.value))}},{immediate:!0});const i=e.computed(()=>({height:n.height,width:n.width,backgroundColor:n.backgroundColor,borderRadius:`${n.borderRadius}px`,border:`${n.borderType} ${n.borderWidth}px ${n.borderColor}`,color:n.color,"--hover-background-color":n.hoverBackgroundColor,"--list-container-padding":n.listContainerPadding,"--list-item-padding":n.listItemPadding,"--list-item-margin":n.listItemMargin,"--list-background-color":n.listBackgroundColor,"--list-height":n.listHeight,"--list-item-border-radius":n.listItemBorderRadius,"--list-item-selected-color":n.listItemSelectedColor,"--list-item-selected-background-color":n.listItemSelectedBackgroundColor,"--list-item-color":n.listItemColor,"--list-border-radius":`${n.listBorderRadius}`,"--list-border-color":n.listBorderColor,"--list-width":n.isListSameWidth?n.width:"fit-content","--list-border-width":`${n.listBorderWidth}px`,"--list-margin-top":n.listMarginTop,"--list-left":n.listAlignment==="left"?"0":"auto","--list-right":n.listAlignment==="right"?"0":"auto","--footer-border":`${n.footerBorderWidth}px solid ${n.footerBorderColor}`,"--dropdown-opacity":n.isDisabled?"0.5":"1","--dropdown-cursor":n.isDisabled?"not-allowed":"pointer","--dropdown-font-size":n.fontSize?n.fontSize:"14px"})),d=e.computed(()=>({height:`${n.arrowHeight}px`,width:`${n.arrowWidth}px`}));function l(){n.isDisabled||(u.value=!u.value)}function a(b){$.value&&!$.value.contains(b.target)&&(u.value=!1)}function S(b,p){n.isMultipleOption?f.value=-1:(f.value=p,u.value=!1),y.value=b,r("input",y.value),r("update:modelValue",y.value)}function T(){u.value=!1,r("click-ready")}return e.onMounted(()=>{document.addEventListener("click",a)}),e.onBeforeMount(()=>{document.removeEventListener("click",a)}),(b,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dropDown",ref:$,class:"gsc-dropdown",style:e.normalizeStyle(i.value)},[e.createElementVNode("div",{class:"gsc-dropdown__main-container",style:e.normalizeStyle({"padding-right":`${t.arrowWidth+8}px`}),onClick:l},[e.createElementVNode("div",MQt,[e.renderSlot(b.$slots,"default",{selectedItem:y.value})]),e.createElementVNode("div",{class:e.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":u.value}]),style:e.normalizeStyle(d.value)},[t.iconType===1?(e.openBlock(),e.createElementBlock("svg",{key:0,height:t.arrowHeight,width:t.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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:t.arrowColor},null,8,PQt)],8,VQt)):(e.openBlock(),e.createElementBlock("svg",AQt,[e.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:t.arrowColor},null,8,RQt)]))],6)],4),e.createVNode(e.Transition,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",FQt,[e.createElementVNode("div",null,[e.createElementVNode("div",{class:"gsc-dropdown__items",style:e.normalizeStyle({"margin-top":`${n.borderWidth}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(s,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["gsc-dropdown__items__item",{selected:c===f.value}]),key:c,onClick:o=>S(s,c)},[e.renderSlot(b.$slots,"availableItem",{item:s})],10,UQt)),[[e.vShow,!s.isHidden]])]))),256))],4),t.isFooterVisible?(e.openBlock(),e.createElementBlock("div",IQt,[e.createVNode(e.unref(zQt),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:T})])):e.createCommentVNode("",!0)])],512),[[e.vShow,u.value]])]),_:3})],4))}},uA={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},qQt=[{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"}}],jQt=[{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}}],DQt={class:"last-touch"},WQt={class:"selected-item"},BQt={class:"available-item"},KQt={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},XQt={class:"selected-item"},GQt={class:"available-item"},ZQt={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},JQt={key:1},HQt={class:"selected-item"},YQt={class:"available-item"},QQt={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$Qt={class:"last-touch__how-many-games"},t$t={class:"selected-item"},e$t={class:"available-item"},r$t={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n$t={__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(t,{emit:r}){const n=t,y=r,$=e.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),f=e.ref({id:0,name:"Fases de juego",value:null}),u=e.ref(!1),i=e.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),d=e.ref(n.defaultFilters?null:i.value[0]),l=e.ref(null),a=e.computed(()=>({...uA})),S=e.computed(()=>({...uA,isFooterVisible:!n.isEditMode,isMultipleOption:!n.isEditMode})),T=e.computed(()=>{const yt=[];return b.value.options.forEach(bt=>{bt.forEach(xt=>{yt.push(xt)})}),yt}),b=e.ref(null),p=e.ref(null),s=e.ref(null),c=e.ref(null);e.watch(()=>n.viewConfig,yt=>{yt.filters&&(b.value||o(),p.value||h(),s.value||v(),c.value||P())},{immediate:!0});function o(){if(n.viewConfig&&n.viewConfig.filters){const yt=n.viewConfig.filters.find(bt=>bt.key==="categories");yt&&yt.options&&(b.value={label:yt.label,options:Object.entries(yt.options).reduce((bt,[xt,Pt])=>(bt.set(Number(xt),Pt),bt),new Map)})}b.value={label:"Tipo de jugada",options:new Map([[2,jQt],[3,qQt]])}}function h(){if(n.viewConfig&&n.viewConfig.filters){const yt=n.viewConfig.filters.find(bt=>bt.key==="gamePhases");if(yt){p.value={label:yt.label,options:yt.options};return}}p.value={label:"Fases de juego",options:$.value}}function v(){if(n.viewConfig&&n.viewConfig.filters){const yt=n.viewConfig.filters.find(bt=>bt.key==="teamRadios");if(yt){s.value={options:yt.options},U(null,yt.options[0]);return}}s.value={label:"Equipo",options:n.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},U(null,s.value.options[0])}const k=e.ref(n.defaultFilters?null:s.value.options[0]),L=e.ref(n.defaultFilters?null:p.value.options[0]),E=e.ref(n.defaultFilters?null:b.value.options.get(L.value.value)[0]);function P(){if(n.viewConfig&&n.viewConfig.filters){const yt=n.viewConfig.filters.find(bt=>bt.key==="assistZoneCheckbox");if(yt){c.value={label:yt.label},M(yt.value);return}}c.value={label:"Zona de asistencia"}}const V=e.computed(()=>{const yt={selectedGamePhase:L.value,selectedTeam:k.value,isAssistZoneVisible:u.value,howManyGamesSelected:d.value};return n.isEditMode?(yt.selectedCategory=E.value,yt.totalCategoriesSelected=1):(yt.selectedCategories=l.value,yt.totalCategoriesSelected=0,b.value.options.forEach(bt=>{bt.forEach(xt=>{xt.isSelected&&(yt.totalCategoriesSelected+=1)})})),yt}),I=e.computed(()=>L.value?b.value.options.get(L.value.value)||[]:[]);e.watch(()=>V.value,yt=>{j()&&y("change",{areAllFiltersFilled:j(),filters:yt,view:n.viewConfig})},{deep:!0});function j(){return L.value&&(n.isEditMode&&E.value||!n.isEditMode&&l.value&&l.value.length)&&k.value&&d.value}function F(yt){L.value=yt,O(null)}function D(yt){k.value=yt}function U(yt,bt){console.log("onChangeRadio:",bt.value)}function M(yt){u.value=yt}function X(yt){d.value=yt}function O(yt){E.value=yt}function Y(yt,bt){bt.isSelected=yt,l.value=T.value.filter(xt=>xt.isSelected)}function st(){n.defaultFilters&&(u.value=n.defaultFilters.isAssistZoneVisible,d.value=i.value.find(yt=>yt.value===n.defaultFilters.howManyGamesSelected.value)||i.value[0],L.value=p.value.options.find(yt=>yt.value===n.defaultFilters.selectedGamePhase.value)||p.value.options[0],k.value=s.value.options.find(yt=>yt.value===(n.defaultFilters.isHomeTeam?1:2))||s.value.options[0],E.value=b.value.options.get(L.value.value).find(yt=>yt.value.name===n.defaultFilters.selectedCategory.name)||b.value.options.get(L.value.value)[0])}function mt(){I.value.forEach(yt=>{yt.isSelected=!1}),u.value=!1,d.value=i.value[0],L.value=null,k.value=null,E.value=null,l.value=null}return e.onBeforeUnmount(()=>{mt()}),e.onMounted(()=>{setTimeout(()=>{st()},500)}),(yt,bt)=>(e.openBlock(),e.createElementBlock("div",DQt,[e.createVNode(e.unref(Qk),e.mergeProps(a.value,{items:p.value.options,"model-value":L.value,"onUpdate:modelValue":F}),{default:e.withCtx(()=>[e.createElementVNode("div",WQt,[bt[0]||(bt[0]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(L.value?L.value.label:p.value.label||f.value.name),1)])]),availableItem:e.withCtx(({item:xt})=>[e.createElementVNode("div",BQt,[e.createElementVNode("div",null,e.toDisplayString(xt.label),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",KQt,[...bt[1]||(bt[1]=[e.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)),[[e.vShow,L.value&&L.value.label===xt.label]])])])]),_:1},16,["items","model-value"]),e.createVNode(e.unref(Qk),e.mergeProps(S.value,{items:I.value,"model-value":E.value,"onUpdate:modelValue":O}),{default:e.withCtx(()=>[e.createElementVNode("div",XQt,[bt[2]||(bt[2]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(b.value.label),1)])]),availableItem:e.withCtx(({item:xt})=>[e.createElementVNode("div",GQt,[t.isEditMode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",null,e.toDisplayString(xt.label),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",ZQt,[...bt[3]||(bt[3]=[e.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)),[[e.vShow,E.value&&E.value.label===xt.label]])])],64)):(e.openBlock(),e.createElementBlock("div",JQt,[e.createVNode(e.unref(lA),{"model-value":xt.isSelected,label:xt.label,"onUpdate:modelValue":Pt=>Y(Pt,xt)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),e.createVNode(e.unref(Qk),e.mergeProps(a.value,{items:s.value.options,"model-value":k.value,"onUpdate:modelValue":D}),{default:e.withCtx(()=>[e.createElementVNode("div",HQt,[bt[4]||(bt[4]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(k.value?k.value.label:s.value.label),1)])]),availableItem:e.withCtx(({item:xt})=>[e.createElementVNode("div",YQt,[e.createElementVNode("div",null,e.toDisplayString(xt.label),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",QQt,[...bt[5]||(bt[5]=[e.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)),[[e.vShow,k.value&&k.value.label===xt.label]])])])]),_:1},16,["items","model-value"]),e.createVNode(e.unref(lA),{"model-value":u.value,label:c.value.label,"onUpdate:modelValue":M},null,8,["model-value","label"]),e.withDirectives(e.createElementVNode("div",$Qt,[e.createVNode(e.unref(Qk),e.mergeProps(a.value,{items:i.value,"model-value":d.value,"onUpdate:modelValue":X}),{default:e.withCtx(()=>[e.createElementVNode("div",t$t,[bt[6]||(bt[6]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(d.value?d.value.name:"Seleccione"),1)])]),availableItem:e.withCtx(({item:xt})=>[e.createElementVNode("div",e$t,[e.createElementVNode("div",null,e.toDisplayString(xt.name),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",r$t,[...bt[7]||(bt[7]=[e.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)),[[e.vShow,d.value&&d.value.name===xt.name]])])])]),_:1},16,["items","model-value"])],512),[[e.vShow,!t.isPostMatch]])]))}},a$t=e2(n$t,[["__scopeId","data-v-7e67f3f8"]]),i$t=(t,r)=>{const n=t.__vccOpts||t;for(const[y,$]of r)n[y]=$;return n},o$t={__name:"GSC-Menu",props:{menuMarginTop:{type:Number,default:0,validator(t){return!Number.isNaN(t)}},modelValue:{type:Boolean,default:!1},width:{type:String,default:"fit-content"},menuWidth:{type:String,default:"fit-content"},zIndexOpen:{type:Number,default:3},leftMenu:{type:String,default:"unset"}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t;e.useCssVars(b=>({"6263632b":t.width,"252e289a":d.value,d3c8b2e8:t.menuWidth}));const y=e.ref(null),$=e.ref(!1),f=e.ref(null),u=e.ref({}),i=e.ref({top:"0px",left:n.leftMenu,width:n.menuWidth}),d=e.computed(()=>$.value?n.zIndexOpen:1);e.watch(()=>n.modelValue,b=>{b!==$.value&&($.value=b)},{immediate:!0}),e.watch($,async b=>{var p;if(b){await e.nextTick();const s=(p=f.value)==null?void 0:p.getBoundingClientRect();s&&setTimeout(()=>{l({boundingClientRect:s})},1e3)}else setTimeout(()=>{u.value["--translate-x"]="0px"},500)});function l(b){const p=window.innerWidth,s=b.boundingClientRect.x,c=b.boundingClientRect.x+b.boundingClientRect.width,o=s<=0?Math.abs(s)+10:c>=p?p-(c+30):0;if(u.value["--translate-x"]=`${o}px`,y.value){const h=y.value.getBoundingClientRect();i.value.top=`${h.height+n.menuMarginTop}px`}}function a(){new IntersectionObserver(b=>{b[0].intersectionRatio>0&&l(b[0])}).observe(f.value)}function S(){$.value=!$.value,r("update:modelValue",$.value)}function T(){$.value=!1,r("update:modelValue",$.value)}return e.onMounted(()=>{e.nextTick(()=>{a()})}),(b,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[$.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:"menu-overlay",onClick:T})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"menu-container",style:e.normalizeStyle(u.value)},[e.createElementVNode("div",{ref_key:"trigger",ref:y,class:"menu-container__trigger",onClick:S},[e.renderSlot(b.$slots,"trigger",{},void 0,!0)],512),e.createVNode(e.Transition,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"menu",ref:f,class:"menu-container__menu",style:e.normalizeStyle(i.value)},[e.renderSlot(b.$slots,"menu",{},void 0,!0)],4),[[e.vShow,$.value]])]),_:3})],4)],64))}},s$t=i$t(o$t,[["__scopeId","data-v-419c8567"]]),Bb={CORNERS_ADVANCED:"cornersAdvanced"},l$t={key:0,class:"button__icon"},c$t={key:0,width:"19",height:"17",viewBox:"0 0 19 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u$t=["stroke"],d$t=["stroke"],p$t=["stroke"],h$t={key:1,width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f$t=["stroke"],m$t=["stroke"],y$t=["fill"],g$t={key:2,width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v$t=["fill"],b$t={key:3,width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x$t=["stroke"],_$t=["stroke"],w$t=["stroke"],T$t=["stroke"],S$t=["stroke"],k$t={key:4,width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},L$t={key:5,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C$t={key:6,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},N$t={key:7,width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},O$t={key:8,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},E$t={class:"button__text"},z$t={key:0,class:"info-container"},M$t={key:1,style:{width:"20px"}},V$t={width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P$t=["fill"],A$t={__name:"ButtonFilter",props:{isActive:{type:Boolean,default:!1},showBadge:{type:Boolean,default:!0},showBadgeOnFilterFull:{type:Boolean,default:!0},text:{type:String,default:""},infoValue:{type:[String,Number],default:""},filtersTotal:{type:Number,default:0},textFontFamily:{type:String,default:"sans-serif"},textFontSize:{type:String,default:"14px"},fontColor:{type:String,default:"white"},infoBackgroundColor:{type:String,default:"#424D58"},infoFontColor:{type:String,default:"#CBEE6B"},infoFontFamily:{type:String,default:"sans-serif"},infoFontSize:{type:String,default:"10px"},infoBorderColor:{type:String,default:"#0D1D29"},infoBorderRadius:{type:String,default:"4px"},infoHeight:{type:String,default:"20px"},infoWidth:{type:String,default:"20px"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},backgroundColor:{type:String,default:"#0D1D29"},borderRadius:{type:String,default:"8px"},borderColor:{type:String,default:"#172531"},borderColorActive:{type:String,default:"white"},borderWidth:{type:String,default:"1px"},padding:{type:String,default:"12px"},arrowColor:{type:String,default:"#92929D"},iconColor:{type:String,default:"#92929D"},iconType:{type:String,default:"productivity"},showIcon:{type:Boolean,default:!0}},setup(t){const r=t,n=e.computed(()=>({"--height":r.height,"--width":r.width,"--text-font-family":r.textFontFamily,"--text-font-size":r.textFontSize,"--background-color":r.backgroundColor,"--border-radius":r.borderRadius,"--border-color":r.isActive?r.borderColorActive:r.borderColor,"--border-width":r.borderWidth,"--padding":r.padding,"--font-color":r.fontColor})),y=e.computed(()=>({"--info-background-color":r.infoValue?r.infoBackgroundColor:"transparent","--info-border-color":r.infoValue?r.infoBorderColor:"transparent","--info-border-radius":r.infoBorderRadius,"--info-font-family":r.infoFontFamily,"--info-font-size":r.infoFontSize,"--info-font-color":r.infoFontColor,"--info-height":r.infoHeight,"--info-width":r.infoWidth})),$=e.computed(()=>[Bb.PLAYS_TYPES,Bb.GOLSTATS,Bb.TOURNAMENTS,Bb.PLAYS,Bb.RESULTS,Bb.RESULTS_BY_TIME].includes(r.iconType)),f=e.computed(()=>[Bb.FIELD,Bb.GAMES].includes(r.iconType)),u=e.computed(()=>[Bb.DETAILS,Bb.UNIVERSE].includes(r.iconType)),i=e.computed(()=>[Bb.PERSONAL_DATA].includes(r.iconType)),d=e.computed(()=>[Bb.PRODUCTIVITY].includes(r.iconType)),l=e.computed(()=>[Bb.CORNERS_ADVANCED].includes(r.iconType)),a=e.computed(()=>[Bb.HOW_WAS_CORNER].includes(r.iconType)),S=e.computed(()=>[Bb.TAKEN_CORNERS].includes(r.iconType)),T=e.computed(()=>[Bb.ZONE].includes(r.iconType)),b=e.computed(()=>[Bb.WHAT_HAPPENED].includes(r.iconType));return(p,s)=>(e.openBlock(),e.createElementBlock("div",{class:"button",style:e.normalizeStyle(n.value)},[t.showIcon?(e.openBlock(),e.createElementBlock("div",l$t,[i.value?(e.openBlock(),e.createElementBlock("svg",c$t,[e.createElementVNode("path",{d:"M12.6665 16.0001V14.3334C12.6665 13.4494 12.3153 12.6015 11.6902 11.9764C11.0651 11.3513 10.2173 11.0001 9.33323 11.0001H4.33329C3.44925 11.0001 2.60141 11.3513 1.9763 11.9764C1.35119 12.6015 1 13.4494 1 14.3334V16.0001",stroke:t.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,u$t),e.createElementVNode("path",{d:"M6.83329 7.66658C8.67422 7.66658 10.1666 6.17422 10.1666 4.33329C10.1666 2.49237 8.67422 1 6.83329 1C4.99237 1 3.5 2.49237 3.5 4.33329C3.5 6.17422 4.99237 7.66658 6.83329 7.66658Z",stroke:t.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,d$t),e.createElementVNode("path",{d:"M15.164 5.16663V10.1666M17.664 7.66659H12.6641",stroke:t.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,p$t)])):e.createCommentVNode("",!0),$.value||l.value?(e.openBlock(),e.createElementBlock("svg",h$t,[e.createElementVNode("path",{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:t.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,f$t),e.createElementVNode("path",{d:"M15.9996 16.8727L14.8359 15.7091",stroke:t.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,m$t),e.createElementVNode("path",{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:t.iconColor,stroke:"#353F47","stroke-width":"0.3"},null,8,y$t)])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("svg",g$t,[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 0C13.1944 0 17 3.80558 17 8.5C17 13.1944 13.1944 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 0 8.5 0ZM8.49751 1.54553C4.65662 1.54553 1.54297 4.65919 1.54297 8.50008C1.54297 12.341 4.65662 15.4546 8.49751 15.4546C12.3384 15.4546 15.4521 12.341 15.4521 8.50008C15.4521 4.65919 12.3384 1.54553 8.49751 1.54553ZM8.49929 3.09082C8.92605 3.09082 9.27202 3.43678 9.27202 3.86355V8.12198L12.451 10.5945C12.7878 10.8565 12.8485 11.342 12.5865 11.6789C12.3245 12.0157 11.839 12.0764 11.5022 11.8144L8.02488 9.10986C7.83666 8.96347 7.72656 8.73837 7.72656 8.49991V3.86355C7.72656 3.43678 8.07252 3.09082 8.49929 3.09082Z",fill:t.iconColor},null,8,v$t)])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",b$t,[e.createElementVNode("rect",{x:"1.16772",y:"1.16699",width:"19",height:"15.6667",stroke:t.iconColor},null,8,x$t),e.createElementVNode("rect",{x:"16.1677",y:"6.16699",width:"4",height:"5.66667",stroke:t.iconColor},null,8,_$t),e.createElementVNode("rect",{x:"1.16772",y:"6.16699",width:"4",height:"5.66667",stroke:t.iconColor},null,8,w$t),e.createElementVNode("path",{d:"M10.6677 0.666992V16.5003",stroke:t.iconColor},null,8,T$t),e.createElementVNode("path",{d:"M13.5033 9.00032C13.5033 10.5651 12.2348 11.8337 10.67 11.8337C9.1052 11.8337 7.83667 10.5651 7.83667 9.00032C7.83667 7.43552 9.1052 6.16699 10.67 6.16699C12.2348 6.16699 13.5033 7.43552 13.5033 9.00032Z",stroke:t.iconColor},null,8,S$t)])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("svg",k$t,[...s[0]||(s[0]=[e.createElementVNode("path",{d:"M1.85113 13.0897C1.9303 13.2137 2.01739 13.3404 2.10447 13.4617C2.30239 13.7361 2.51878 14 2.74837 14.2507C3.74589 15.3298 5.01785 16.1504 6.41385 16.5963C6.4719 16.6148 6.52996 16.6332 6.58802 16.6491C6.60385 16.6544 6.61704 16.657 6.63024 16.6623C6.70413 16.6834 6.77538 16.7045 6.84927 16.723C7.54859 16.9077 8.27429 17 9.00264 17C9.73098 17 10.4593 16.9077 11.1586 16.7256C11.3064 16.686 11.4542 16.6438 11.5967 16.5989C11.9187 16.496 12.2353 16.372 12.5414 16.2322C12.7895 16.1187 13.0296 15.9921 13.2645 15.8549C14.2963 15.2533 15.2041 14.438 15.9034 13.467C15.9668 13.3799 16.0301 13.2876 16.0908 13.1926C16.1119 13.1609 16.133 13.1293 16.1541 13.095C16.9432 11.8681 17.405 10.4486 17.4868 8.98945C17.4947 8.84169 17.5 8.69393 17.5 8.54618C17.5 8.53034 17.5 8.51715 17.5 8.50132C17.5 6.90765 17.0646 5.37995 16.2386 4.04222C16.1198 3.85224 15.9932 3.66491 15.8612 3.48021C15.8586 3.47493 15.8559 3.4723 15.8533 3.46702C15.8084 3.40633 15.7636 3.34565 15.7161 3.2876C15.6712 3.22955 15.6237 3.1715 15.5789 3.1161C14.6526 1.98417 13.4466 1.10818 12.0928 0.580475C11.9556 0.525066 11.8105 0.474934 11.668 0.42744C10.8103 0.145118 9.91307 0 9.00264 0C8.09221 0 7.19497 0.14248 6.33732 0.424802C6.19482 0.472295 6.04967 0.525066 5.91245 0.577836C4.55604 1.10554 3.35005 1.98417 2.42378 3.11346C2.37364 3.17678 2.32086 3.24011 2.27072 3.30607C2.2285 3.35884 2.18892 3.41161 2.14933 3.46702C2.14933 3.46702 2.14933 3.46966 2.14669 3.4723C2.14669 3.47493 2.14405 3.47757 2.14142 3.48021C1.43418 4.44591 0.94598 5.53034 0.69792 6.68074C0.660975 6.85224 0.626669 7.02639 0.600279 7.20053C0.571251 7.39578 0.547501 7.59103 0.531667 7.78892C0.521111 7.91293 0.513195 8.03694 0.507917 8.16095C0.502639 8.27441 0.5 8.38786 0.5 8.50132V8.61214C0.502639 8.73615 0.507917 8.8628 0.513195 8.98945C0.595002 10.4486 1.05681 11.8681 1.84586 13.0923L1.85113 13.0897ZM1.82738 7.64908C1.82738 7.63325 1.83002 7.62005 1.83266 7.60422C1.84322 7.52771 1.85377 7.45119 1.86433 7.37731C1.86433 7.36412 1.86697 7.35092 1.86961 7.33773C1.8828 7.25594 1.89863 7.1715 1.91447 7.08971C1.91711 7.07124 1.92238 7.05541 1.92502 7.03694C1.94086 6.95778 1.95933 6.87599 1.9778 6.79683V6.78628C1.99891 6.70449 2.02266 6.62269 2.04378 6.5409C2.04905 6.52243 2.05433 6.5066 2.05961 6.48813C2.08336 6.40897 2.10711 6.32718 2.1335 6.24802L2.14142 6.22164C2.16517 6.14776 2.19156 6.07652 2.21794 6.00264C2.22322 5.98681 2.23114 5.97098 2.23642 5.95515C2.26545 5.87863 2.29711 5.79947 2.32878 5.72559C2.33406 5.70976 2.34197 5.69657 2.34725 5.68338C2.37628 5.61478 2.40795 5.54617 2.43962 5.47757C2.44489 5.46702 2.45017 5.45383 2.45545 5.44063C2.48975 5.36676 2.5267 5.29024 2.56628 5.21636C2.5742 5.20053 2.58212 5.1847 2.59267 5.16887C2.63226 5.09499 2.6692 5.02375 2.71143 4.94987V4.94195H2.7167L3.2656 6.63061L1.82738 7.67546C1.82738 7.67546 1.82738 7.65699 1.83002 7.64908H1.82738ZM4.08367 7.6095L5.62745 8.31926L6.52204 11.0712L5.62481 12.1108H2.74309C2.23642 11.2348 1.92238 10.2612 1.81683 9.25594L4.08367 7.6095ZM7.58026 1.41161C7.65942 1.39578 7.74123 1.37995 7.8204 1.36675C7.84151 1.36412 7.86262 1.35884 7.88109 1.3562C7.96026 1.34301 8.03679 1.33245 8.11596 1.32454C8.13971 1.3219 8.16346 1.31926 8.18721 1.31662C8.24791 1.30871 8.30596 1.30343 8.36666 1.29815C8.39305 1.29815 8.42207 1.29288 8.44846 1.29024C8.52235 1.28496 8.59361 1.27968 8.6675 1.27705C8.69916 1.27705 8.73347 1.27441 8.76514 1.27177C8.82319 1.27177 8.88125 1.26913 8.94194 1.26913C8.98153 1.26913 9.01847 1.26913 9.05806 1.26913C9.11611 1.26913 9.17681 1.26913 9.23487 1.27177C9.26653 1.27177 9.30084 1.27177 9.33251 1.27705C9.4064 1.27968 9.48029 1.28496 9.55154 1.29024C9.58057 1.29024 9.60696 1.29551 9.63334 1.29815C9.69404 1.30343 9.75473 1.30871 9.81279 1.31662C9.83654 1.31926 9.86029 1.3219 9.88668 1.32454C9.96585 1.33509 10.045 1.34565 10.1215 1.3562L10.1849 1.36675C10.264 1.37995 10.3459 1.39314 10.425 1.41161C10.4277 1.41161 10.4303 1.41161 10.4356 1.41161H10.4382L9 2.45646L7.56178 1.41161H7.56442C7.56442 1.41161 7.5697 1.41161 7.57234 1.41161H7.58026ZM9.00528 6.56728L11.1138 8.10026L10.3089 10.5805H7.70165L6.89677 8.10026L9.00528 6.56728ZM15.3018 4.94459V4.94987C15.3466 5.02111 15.3862 5.09499 15.4232 5.16887L15.4469 5.21636C15.4839 5.29024 15.5208 5.36676 15.5577 5.44063C15.563 5.45119 15.5683 5.46438 15.5736 5.47493C15.6052 5.54354 15.6369 5.61214 15.6659 5.68338C15.6712 5.69657 15.6791 5.7124 15.6844 5.72559C15.7161 5.80211 15.7478 5.87863 15.7768 5.95778C15.7821 5.97361 15.79 5.98945 15.7953 6.00528C15.8216 6.07916 15.848 6.1504 15.8718 6.22428C15.8744 6.23219 15.8771 6.24011 15.8797 6.25066C15.9061 6.32982 15.9298 6.40897 15.9536 6.49077C15.9589 6.50923 15.9641 6.52771 15.9694 6.54618C15.9905 6.62797 16.0143 6.70976 16.0328 6.78892C16.0328 6.7942 16.0328 6.79683 16.0328 6.80211C16.0512 6.88127 16.0697 6.96042 16.0855 7.03958L16.0961 7.09235C16.1119 7.17414 16.1278 7.25594 16.141 7.33773C16.141 7.35092 16.1462 7.36412 16.1462 7.37731C16.1568 7.45119 16.1673 7.52771 16.1779 7.60422C16.1779 7.62005 16.1805 7.63325 16.1832 7.64908C16.1832 7.65699 16.1832 7.66755 16.1858 7.67546L14.7476 6.63061L15.2965 4.93931L15.3018 4.94459ZM13.9295 7.61214L16.1937 9.25858C16.0882 10.2639 15.7715 11.2401 15.2675 12.1135H12.3858L11.4912 11.0739L12.3858 8.3219L13.9295 7.61214ZM14.3306 13.3879C14.3306 13.3879 14.3254 13.3931 14.3227 13.3958C14.2673 13.4565 14.2093 13.5172 14.1512 13.5752C14.138 13.5884 14.1248 13.6016 14.1116 13.6148C14.0536 13.6728 13.9929 13.7309 13.9322 13.7889C13.9216 13.7995 13.9111 13.81 13.8979 13.8206C13.8424 13.8707 13.7844 13.9235 13.729 13.971C13.7184 13.9789 13.7079 13.9894 13.6973 14C13.634 14.0554 13.5706 14.1055 13.5047 14.1583C13.4888 14.1715 13.473 14.1821 13.4598 14.1953C13.3938 14.2454 13.3278 14.2955 13.2619 14.3456C13.2619 14.3456 13.2566 14.3483 13.2566 14.3509C13.188 14.4011 13.1194 14.4486 13.0481 14.496C13.0323 14.5066 13.0165 14.5172 12.998 14.5277C12.9294 14.5726 12.8581 14.6174 12.7895 14.6623C12.7763 14.6702 12.7658 14.6781 12.7526 14.6834C12.6892 14.723 12.6233 14.7599 12.5573 14.7968C12.5441 14.8048 12.5283 14.8127 12.5151 14.8206C12.4438 14.8602 12.3699 14.8997 12.296 14.9367C12.2802 14.9446 12.2617 14.9525 12.2459 14.9631C12.1746 15 12.1007 15.0343 12.0295 15.0686C12.0242 15.0686 12.0189 15.0739 12.0137 15.0765H12.0084L12.5573 13.3879H14.3306ZM6.00217 15.0765L5.98898 15.0712C5.91509 15.0369 5.8412 15 5.76731 14.9631C5.75147 14.9551 5.73564 14.9472 5.71981 14.9393C5.64592 14.9024 5.57203 14.8628 5.49814 14.8206C5.48494 14.8127 5.47175 14.8048 5.45855 14.7995C5.39258 14.7625 5.32661 14.723 5.26063 14.6834C5.25008 14.6781 5.23688 14.6702 5.22633 14.6623C5.15508 14.6201 5.08646 14.5726 5.01521 14.5277C4.99938 14.5172 4.98355 14.5066 4.96771 14.496C4.89646 14.4486 4.82785 14.4011 4.75924 14.3509H4.75396C4.68799 14.2982 4.61937 14.248 4.5534 14.1953C4.53757 14.1821 4.52437 14.1715 4.50854 14.1583C4.44256 14.1055 4.37923 14.0554 4.3159 14C4.30534 13.9894 4.29478 13.9815 4.28159 13.971C4.22353 13.9208 4.16812 13.8707 4.1127 13.8206C4.10214 13.81 4.08895 13.7995 4.07839 13.7889C4.0177 13.7335 3.957 13.6755 3.89894 13.6148C3.88575 13.6016 3.87256 13.5884 3.85936 13.5752C3.8013 13.5172 3.74589 13.4591 3.69047 13.3984C3.68783 13.3958 3.68519 13.3931 3.67991 13.3879H5.45328L6.00217 15.0765C6.00217 15.0765 5.99954 15.0765 5.9969 15.0765H6.00217ZM7.50636 15.5726L6.63552 12.8971L7.53012 11.8602H10.4804L11.375 12.8971L10.5042 15.5726C9.52251 15.7784 8.48805 15.781 7.50373 15.5726H7.50636ZM14.3755 3.66755L13.4809 6.41953L11.9371 7.12929L9.6439 5.46174V3.57784L11.9503 1.90237C12.8713 2.31135 13.6999 2.91557 14.3781 3.66755H14.3755ZM6.06287 1.90237L8.3693 3.57784V5.46174L6.07606 7.12929L4.53229 6.41953L3.63769 3.66755C4.3159 2.91557 5.14452 2.31398 6.06551 1.90237H6.06287Z",fill:"#979DA2"},null,-1)])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("svg",L$t,[...s[1]||(s[1]=[e.createElementVNode("path",{d:"M17.182 5.9a.538.538 0 0 0-.13-.416L14.24 2.109a.558.558 0 0 0-.433-.203h-2.25c-.017 0-.034.012-.056.012a.557.557 0 0 0-.563.41 1.68 1.68 0 0 1-1.63 1.266 1.68 1.68 0 0 1-1.632-1.266.55.55 0 0 0-.563-.41c-.017 0-.033-.012-.056-.012h-2.25a.558.558 0 0 0-.433.203L1.561 5.484a.586.586 0 0 0-.129.416c.017.152.09.287.208.382l2.605 2.082v8.167c0 .31.253.563.562.563h9c.31 0 .563-.253.563-.563V8.364l2.604-2.082a.59.59 0 0 0 .208-.382zm-3.937 4.444H5.37V9.78h7.875v.563zM5.37 15.969v-4.5h7.875v4.5H5.37zm9-9.045v-.518a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v2.25H5.37v-2.25a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v.518L2.793 5.765l2.278-2.734h1.66A2.802 2.802 0 0 0 9.307 4.72a2.803 2.803 0 0 0 2.576-1.688h1.66l2.278 2.734-1.451 1.159z",fill:"#98A2B3"},null,-1)])])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("svg",C$t,[...s[2]||(s[2]=[e.createElementVNode("path",{d:"M15.426 3.353a2.384 2.384 0 0 0-2.381 2.381 2.384 2.384 0 0 0 2.381 2.382 2.384 2.384 0 0 0 2.381-2.382 2.384 2.384 0 0 0-2.381-2.38zm0 3.766a1.386 1.386 0 0 1-1.385-1.385c0-.763.622-1.384 1.385-1.384s1.385.621 1.385 1.384c0 .764-.622 1.385-1.385 1.385zM1.424 6.558a.497.497 0 0 0 .704 0l1.295-1.296L4.72 6.558a.497.497 0 0 0 .704 0 .498.498 0 0 0 0-.705L4.128 4.558l1.295-1.295a.498.498 0 0 0-.705-.705L3.423 3.853 2.128 2.558a.499.499 0 0 0-.704.705l1.295 1.295-1.295 1.295a.498.498 0 0 0 0 .705zM13.013 12.443a.498.498 0 0 0-.705 0l-1.295 1.295-1.295-1.295a.499.499 0 0 0-.704.704l1.295 1.295-1.295 1.295a.499.499 0 0 0 .704.705l1.295-1.295 1.295 1.295a.497.497 0 0 0 .705 0 .498.498 0 0 0 0-.705l-1.295-1.295 1.295-1.295a.498.498 0 0 0 0-.704zM12.052 5.455l-2.01-1.747a.498.498 0 0 0-.654.753l1.066.926c-3.145.411-5.008 2.055-6.043 3.444a9.569 9.569 0 0 0-1.501 3.012 2.384 2.384 0 0 0-2.103 2.364 2.384 2.384 0 0 0 2.381 2.381 2.384 2.384 0 0 0 2.381-2.381 2.385 2.385 0 0 0-1.647-2.265 8.674 8.674 0 0 1 1.312-2.547C6.53 7.674 8.33 6.66 10.594 6.372l-.992 1.142a.498.498 0 0 0 .752.654l1.747-2.01a.498.498 0 0 0-.05-.703zm-7.48 8.752c0 .763-.62 1.384-1.384 1.384a1.386 1.386 0 0 1-1.384-1.384c0-.764.62-1.385 1.384-1.385.763 0 1.385.622 1.385 1.385z",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":".3"},null,-1)])])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("svg",N$t,[...s[3]||(s[3]=[e.createElementVNode("rect",{x:".707",y:".9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),e.createElementVNode("rect",{x:"8.707",y:".9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),e.createElementVNode("rect",{x:".707",y:"8.9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),e.createElementVNode("rect",{x:"8.707",y:"8.9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1)])])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",O$t,[...s[4]||(s[4]=[e.createStaticVNode('<g clip-path="url(#gpdeo9cu3a)" fill="#98A2B3" data-v-610fe7ec><path d="M9.307.5C4.505.5.598 4.407.598 9.209c0 2 .69 3.938 1.946 5.486l-.754 3.159a.524.524 0 0 0 .727.599l3.038-1.384a8.743 8.743 0 0 0 3.752.848c4.802 0 8.709-3.907 8.709-8.708C18.016 4.407 14.109.5 9.307.5zm0 16.368a7.574 7.574 0 0 1-3.502-.845.525.525 0 0 0-.457-.011l-2.289 1.042.566-2.372a.524.524 0 0 0-.113-.465A7.657 7.657 0 0 1 1.647 9.21c0-4.224 3.436-7.66 7.66-7.66s7.66 3.436 7.66 7.66c0 4.223-3.436 7.66-7.66 7.66z" data-v-610fe7ec></path><path d="M9.68 5.199c-1.094-.115-2.459.397-3.041 1.797a.524.524 0 0 0 .968.403c.375-.902 1.255-1.231 1.964-1.157.721.075 1.232.542 1.365 1.25.13.693-.136 1.097-1.097 1.662-1.042.613-1.372.874-1.372 2.27a.524.524 0 0 0 1.049 0c0-.479.033-.715.118-.843.094-.14.33-.283.737-.523.666-.392 1.905-1.12 1.596-2.76-.221-1.171-1.098-1.975-2.288-2.1zM9.145 12.673a.608.608 0 0 0-.506.17c-.13.13-.19.31-.17.505a.525.525 0 0 0 .939.263.523.523 0 0 0-.263-.938z" data-v-610fe7ec></path></g><defs data-v-610fe7ec><clipPath id="gpdeo9cu3a" data-v-610fe7ec><path fill="#fff" transform="translate(.307 .5)" d="M0 0h18v18H0z" data-v-610fe7ec></path></clipPath></defs>',2)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",E$t,e.toDisplayString(t.text),1),t.showBadge?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.showBadgeOnFilterFull?(e.openBlock(),e.createElementBlock("div",z$t,[e.createElementVNode("div",{class:"button__info",style:e.normalizeStyle(y.value)},[e.withDirectives(e.createElementVNode("span",null,e.toDisplayString(t.infoValue),513),[[e.vShow,t.infoValue]])],4)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.filtersTotal>0&&t.filtersTotal!=parseInt(t.infoValue)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"button__info",style:e.normalizeStyle(y.value)},[e.withDirectives(e.createElementVNode("span",null,e.toDisplayString(t.infoValue),513),[[e.vShow,t.infoValue]])],4)):t.filtersTotal>0?(e.openBlock(),e.createElementBlock("div",M$t)):e.createCommentVNode("",!0)],64))],64)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["button__arrow",{"rotated-180":t.isActive}])},[(e.openBlock(),e.createElementBlock("svg",V$t,[e.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:t.arrowColor},null,8,P$t)]))],2)],4))}},R$t=e2(A$t,[["__scopeId","data-v-610fe7ec"]]),F$t={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t,y=r,$=e.ref(null);e.watch(()=>n.modelValue,()=>{f()},{immediate:!0});function f(){$.value&&($.value.checked=n.modelValue)}function u(i){y("update:modelValue",i.target.checked)}return e.onMounted(()=>{f()}),(i,d)=>(e.openBlock(),e.createElementBlock("input",{ref_key:"switchCustom",ref:$,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:u},null,544))}},dA=e2(F$t,[["__scopeId","data-v-e3a6ae4e"]]),U$t={class:"corners"},I$t={class:"corners-type"},q$t={class:"selected-item"},j$t={class:"available-item"},D$t={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W$t={class:"advanced-filters-menu"},B$t={class:"toggle-group"},K$t={class:"toggle-group"},X$t={key:0,class:"time-control"},G$t={class:"stepper-container"},Z$t={class:"stepper"},J$t={class:"stepper-value"},H$t={class:"time-control"},Y$t={class:"stepper-container"},Q$t={class:"stepper"},$$t={class:"stepper-value"},tte={class:"time-control"},ete={class:"stepper-container"},rte={class:"stepper"},nte={class:"stepper-value"},ate={class:"corners__how-many-games"},ite={class:"selected-item"},ote={class:"available-item"},ste={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lte={__name:"FilterCorners",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(t,{emit:r}){var n;const y=Array.from({length:10}).map((P,V)=>({id:V+1,name:`${V+1} ${V===0?"corner":"corners"}`,value:V+1})),$=t,f=r,u=e.ref([...y]),i=e.ref(u.value[0]),d=e.ref(c()),l=e.ref({backgroundColor:"#2e3b46",width:"96.2%",borderColor:"rgba(255, 255, 255, 0.20)",infoBorderColor:"rgba(255, 255, 255, 0.20)",height:"40px",padding:"0 4px",textFontFamily:"'Poppins-Regular'",showIcon:!1}),a=e.ref({label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}),S=e.ref(!1),T=e.ref($.defaultFilters?$.defaultFilters.isAgainstMode:!1),b=e.ref($.defaultFilters?null:(n=a.value)==null?void 0:n.options[0]),p=e.computed(()=>({...uA}));e.watch(()=>$.viewConfig,P=>{P.filters&&(a.value||o())},{immediate:!0});const s=e.computed(()=>({isAgainstMode:T.value,selectedTeam:b.value,howManyCorners:i.value?i.value.value:null,advancedFilters:{...d.value}}));e.watch(()=>s.value,P=>{f("change",{filters:{...P,advancedFilters:{...P.advancedFilters,areConnectionsVisible:!P.advancedFilters.areConnectionsVisible,arePathsVisible:!P.advancedFilters.arePathsVisible}},view:$.viewConfig})},{deep:!0,immediate:!0});function c(){return{areConnectionsVisible:!0,arePathsVisible:!0,secondsBefore:-1,secondsAfter:0,secondsBeforeAndAfter:0}}function o(){if($.viewConfig&&$.viewConfig.filters){const P=$.viewConfig.filters.find(V=>V.key==="teamRadios");if(P){a.value={options:P.options};return}}a.value={label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}}function h(){$.defaultFilters&&(b.value=a.value.options.find(P=>P.value===($.defaultFilters.isHomeTeam?1:2))||a.value.options[0],d.value={...$.defaultFilters.advancedFilters,areConnectionsVisible:!$.defaultFilters.advancedFilters.areConnectionsVisible,arePathsVisible:!$.defaultFilters.advancedFilters.arePathsVisible})}function v(P){b.value=P}function k(P){i.value=P}function L(P,V){const I=d.value[V]+P;if(!(I<-5||I>10)){if(["secondsBefore","secondsAfter"].includes(V)){if(V==="secondsBefore"){if(d.value.secondsAfter<I)return}else if(d.value.secondsBefore>I)return}d.value[V]=I}}function E(){S.value=!1}return e.onBeforeUnmount(()=>{}),e.onMounted(()=>{setTimeout(()=>{h()},500)}),(P,V)=>(e.openBlock(),e.createElementBlock("div",U$t,[e.withDirectives(e.createElementVNode("div",I$t,[e.createElementVNode("div",{class:e.normalizeClass(["label",{"switch-selected":!T.value}])}," A favor ",2),e.createVNode(dA,{modelValue:T.value,"onUpdate:modelValue":V[0]||(V[0]=I=>T.value=I)},null,8,["modelValue"]),e.createElementVNode("div",{class:e.normalizeClass(["label",{"switch-selected":T.value}])}," En contra ",2)],512),[[e.vShow,!t.isPostMatch]]),e.createVNode(e.unref(Qk),e.mergeProps(p.value,{items:a.value.options,"model-value":b.value,"onUpdate:modelValue":v}),{default:e.withCtx(()=>[e.createElementVNode("div",q$t,[V[10]||(V[10]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(b.value?b.value.label:a.value.label),1)])]),availableItem:e.withCtx(({item:I})=>[e.createElementVNode("div",j$t,[e.createElementVNode("div",null,e.toDisplayString(I.label),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",D$t,[...V[11]||(V[11]=[e.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)),[[e.vShow,b.value&&b.value.label===I.label]])])])]),_:1},16,["items","model-value"]),e.createVNode(e.unref(s$t),{modelValue:S.value,"onUpdate:modelValue":V[9]||(V[9]=I=>S.value=I),width:"250px","left-menu":"0","menu-margin-top":18},{trigger:e.withCtx(()=>[e.createVNode(R$t,e.mergeProps(l.value,{text:"Filtros avanzados","show-badge-on-filter-full":!1,"filters-total":0,"is-active":S.value,"show-icon":!0,"icon-type":e.unref(Bb).CORNERS_ADVANCED}),null,16,["is-active","icon-type"])]),menu:e.withCtx(()=>[e.createElementVNode("div",W$t,[V[22]||(V[22]=e.createElementVNode("h2",{class:"menu-title"},"Mostrar Conexiones",-1)),e.createElementVNode("div",B$t,[V[12]||(V[12]=e.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),e.createVNode(dA,{modelValue:d.value.areConnectionsVisible,"onUpdate:modelValue":V[1]||(V[1]=I=>d.value.areConnectionsVisible=I)},null,8,["modelValue"]),V[13]||(V[13]=e.createElementVNode("label",{class:"toggle-label"},"No",-1))]),V[23]||(V[23]=e.createElementVNode("hr",{class:"separator"},null,-1)),V[24]||(V[24]=e.createElementVNode("h2",{class:"menu-title"},"Mostrar recorridos",-1)),e.createElementVNode("div",K$t,[V[14]||(V[14]=e.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),e.createVNode(dA,{modelValue:d.value.arePathsVisible,"onUpdate:modelValue":V[2]||(V[2]=I=>d.value.arePathsVisible=I)},null,8,["modelValue"]),V[15]||(V[15]=e.createElementVNode("label",{class:"toggle-label"},"No",-1))]),d.value.arePathsVisible?(e.openBlock(),e.createElementBlock("div",X$t,[V[17]||(V[17]=e.createElementVNode("label",{class:"time-label"},[e.createTextVNode(" Segundos "),e.createElementVNode("span",{class:"highlight"},"antes"),e.createTextVNode(" / "),e.createElementVNode("span",{class:"highlight"},"después"),e.createTextVNode(" del cobro: ")],-1)),e.createElementVNode("div",G$t,[e.createElementVNode("div",Z$t,[e.createElementVNode("button",{class:"stepper-btn",onClick:V[3]||(V[3]=I=>L(-1,"secondsBeforeAndAfter"))},"−"),e.createElementVNode("span",J$t,e.toDisplayString(d.value.secondsBeforeAndAfter),1),e.createElementVNode("button",{class:"stepper-btn",onClick:V[4]||(V[4]=I=>L(1,"secondsBeforeAndAfter"))},"+")]),V[16]||(V[16]=e.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",H$t,[V[19]||(V[19]=e.createElementVNode("label",{class:"time-label"},[e.createTextVNode(" Segundos "),e.createElementVNode("span",{class:"highlight"},"antes"),e.createTextVNode(" del cobro: ")],-1)),e.createElementVNode("div",Y$t,[e.createElementVNode("div",Q$t,[e.createElementVNode("button",{class:"stepper-btn",onClick:V[5]||(V[5]=I=>L(-1,"secondsBefore"))},"−"),e.createElementVNode("span",$$t,e.toDisplayString(d.value.secondsBefore),1),e.createElementVNode("button",{class:"stepper-btn",onClick:V[6]||(V[6]=I=>L(1,"secondsBefore"))},"+")]),V[18]||(V[18]=e.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])]),e.createElementVNode("div",tte,[V[21]||(V[21]=e.createElementVNode("label",{class:"time-label"},[e.createTextVNode(" Segundos "),e.createElementVNode("span",{class:"highlight"},"después"),e.createTextVNode(" del cobro: ")],-1)),e.createElementVNode("div",ete,[e.createElementVNode("div",rte,[e.createElementVNode("button",{class:"stepper-btn",onClick:V[7]||(V[7]=I=>L(-1,"secondsAfter"))},"−"),e.createElementVNode("span",nte,e.toDisplayString(d.value.secondsAfter),1),e.createElementVNode("button",{class:"stepper-btn",onClick:V[8]||(V[8]=I=>L(1,"secondsAfter"))},"+")]),V[20]||(V[20]=e.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])],64)),V[25]||(V[25]=e.createElementVNode("hr",{class:"separator"},null,-1)),e.createElementVNode("button",{class:"btn-ready",onClick:E},"Listo")])]),_:1},8,["modelValue"]),e.withDirectives(e.createElementVNode("div",ate,[e.createVNode(e.unref(Qk),e.mergeProps(p.value,{items:u.value,"model-value":i.value,"onUpdate:modelValue":k}),{default:e.withCtx(()=>[e.createElementVNode("div",ite,[V[26]||(V[26]=e.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.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"}),e.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)),e.createElementVNode("div",null,e.toDisplayString(i.value?i.value.name:"Seleccione"),1)])]),availableItem:e.withCtx(({item:I})=>[e.createElementVNode("div",ote,[e.createElementVNode("div",null,e.toDisplayString(I.name),1),e.createElementVNode("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",ste,[...V[27]||(V[27]=[e.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)),[[e.vShow,i.value&&i.value.name===I.name]])])])]),_:1},16,["items","model-value"])],512),[[e.vShow,!t.defaultFilters]])]))}},cte=e2(lte,[["__scopeId","data-v-75e86cac"]]),ute={class:"resultados-filter"},dte={class:"filter-checkboxes"},pte=["checked","disabled","onChange"],hte={class:"checkbox-label"},fte={class:"filter-actions"},mte={__name:"ResultadosFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=[{value:"iba-ganando",label:"Iba ganando"},{value:"iba-perdiendo",label:"Iba perdiendo"},{value:"iba-empatado",label:"Iba empatado"}],f=e.ref([]);e.watch(()=>n.selectedValues,S=>{var T;if(console.log("[ResultadosFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:S,filterValue:S==null?void 0:S[n.filterIndex],optionValue:(T=S==null?void 0:S[n.filterIndex])==null?void 0:T[n.optionIndex],isArray:Array.isArray(S),filterValueType:typeof(S==null?void 0:S[n.filterIndex])}),!S||!Array.isArray(S)){f.value.length===0&&(console.log("[ResultadosFilter] No hay valores en props, usando valores por defecto"),f.value=["iba-ganando","iba-perdiendo","iba-empatado"]);return}const b=S[n.filterIndex];if(b&&typeof b=="object"&&!Array.isArray(b))if(b[n.optionIndex]!==void 0){const p=Array.isArray(b[n.optionIndex])?b[n.optionIndex]:[];console.log("[ResultadosFilter] Valores encontrados para sincronizar:",p,"localSelectedValues actual:",f.value);const s=JSON.stringify(f.value.sort()),c=JSON.stringify(p.sort());s!==c?(console.log("[ResultadosFilter] Actualizando localSelectedValues con:",p),f.value=p.length>0?[...p]:[]):console.log("[ResultadosFilter] Los valores ya están sincronizados, no se actualiza");return}else console.log("[ResultadosFilter] filterValue existe pero no tiene optionIndex",n.optionIndex,"filterValue keys:",Object.keys(b));else console.log("[ResultadosFilter] filterValue no es un objeto válido:",b);f.value.length===0&&(console.log("[ResultadosFilter] No se encontraron valores guardados, usando valores por defecto"),f.value=["iba-ganando","iba-perdiendo","iba-empatado"])},{immediate:!0,deep:!0}),e.onMounted(()=>{var S,T,b;console.log("[ResultadosFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(S=n.selectedValues)==null?void 0:S[n.filterIndex],optionValue:(b=(T=n.selectedValues)==null?void 0:T[n.filterIndex])==null?void 0:b[n.optionIndex]}),e.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const p=n.selectedValues[n.filterIndex];if(p&&typeof p=="object"&&!Array.isArray(p)&&p[n.optionIndex]!==void 0){const s=Array.isArray(p[n.optionIndex])?p[n.optionIndex]:[];if(console.log("[ResultadosFilter] onMounted - Valores encontrados:",s),s.length>0){console.log("[ResultadosFilter] onMounted - Actualizando localSelectedValues con:",s),f.value=[...s];return}}}f.value.length===0&&(console.log("[ResultadosFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),f.value=["iba-ganando","iba-perdiendo","iba-empatado"])})});const u=S=>f.value.includes(S),i=S=>f.value.length===1&&f.value.includes(S),d=(S,T)=>{let b=[...f.value];if(T)b.includes(S)||b.push(S);else{if(b.length===1)return;b=b.filter(p=>p!==S)}b.length===0&&(b=[$[0].value]),f.value=b,y("update-selection",{optionIndex:n.optionIndex,values:b})},l=()=>{const S=$.map(T=>T.value);f.value=[...S],y("update-selection",{optionIndex:n.optionIndex,values:[...S]})},a=()=>{y("done")};return(S,T)=>(e.openBlock(),e.createElementBlock("div",ute,[e.createElementVNode("div",dte,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList($,b=>e.createElementVNode("label",{key:b.value,class:"checkbox-item"},[e.createElementVNode("input",{type:"checkbox",checked:u(b.value),disabled:i(b.value),onChange:e.withModifiers(p=>d(b.value,p.target.checked),["stop"])},null,40,pte),e.createElementVNode("span",hte,e.toDisplayString(b.label),1)])),64))]),e.createElementVNode("div",fte,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(l,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(a,["stop"])}," Listo ")])]))}},kO=e2(mte,[["__scopeId","data-v-6b648e3f"]]),yte={class:"detalles-filter"},gte={class:"filter-header"},vte={class:"checkbox-todos"},bte=["checked"],xte={class:"time-section"},_te={class:"time-buttons"},wte=["onClick"],Tte={class:"time-section"},Ste={class:"time-buttons"},kte=["onClick"],Lte={class:"filter-actions"},Cte={__name:"DetallesFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=[{value:"0-15",label:"0-15"},{value:"16-30",label:"16-30"},{value:"31-45",label:"31-45"}],f=[{value:"46-60",label:"46-60"},{value:"61-75",label:"61-75"},{value:"76-90",label:"76-90"}],u=[...$,...f].map(p=>p.value),i=e.ref([]);e.watch(()=>n.selectedValues,p=>{var s;if(console.log("[DetallesFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:p,filterValue:p==null?void 0:p[n.filterIndex],optionValue:(s=p==null?void 0:p[n.filterIndex])==null?void 0:s[n.optionIndex]}),!p||!Array.isArray(p))return;const c=p[n.filterIndex];if(c&&typeof c=="object"&&!Array.isArray(c)&&c[n.optionIndex]!==void 0){const o=Array.isArray(c[n.optionIndex])?c[n.optionIndex]:[];if(console.log("[DetallesFilter] Valores encontrados para sincronizar:",o),o.length>0){const h=JSON.stringify(i.value.sort()),v=JSON.stringify(o.sort());h!==v&&(console.log("[DetallesFilter] Actualizando localSelectedValues con:",o),i.value=[...o])}}},{immediate:!0,deep:!0});const d=e.computed(()=>[...$,...f].map(p=>p.value).every(p=>i.value.includes(p)));e.onMounted(()=>{var p,s,c;console.log("[DetallesFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(p=n.selectedValues)==null?void 0:p[n.filterIndex],optionValue:(c=(s=n.selectedValues)==null?void 0:s[n.filterIndex])==null?void 0:c[n.optionIndex]}),e.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const o=n.selectedValues[n.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)&&o[n.optionIndex]!==void 0){const h=Array.isArray(o[n.optionIndex])?o[n.optionIndex]:[];if(console.log("[DetallesFilter] onMounted - Valores encontrados:",h),h.length>0){console.log("[DetallesFilter] onMounted - Actualizando localSelectedValues con:",h),i.value=[...h];return}}}i.value.length===0&&(console.log("[DetallesFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),i.value=[...u])})});const l=p=>i.value.includes(p),a=p=>{const s=p.target.checked;let c=[];s?c=[...$,...f].map(o=>o.value):c=[u[0]],i.value=c,y("update-selection",{optionIndex:n.optionIndex,values:c})},S=p=>{let s=[...i.value];if(s.includes(p))if(s.length>1)s=s.filter(c=>c!==p);else return;else s.includes(p)||s.push(p);s.length===0&&(s=[u[0]]),i.value=s,y("update-selection",{optionIndex:n.optionIndex,values:s})},T=()=>{const p=[u[0]];i.value=p,y("update-selection",{optionIndex:n.optionIndex,values:p})},b=()=>{y("done")};return(p,s)=>(e.openBlock(),e.createElementBlock("div",yte,[e.createElementVNode("div",gte,[s[1]||(s[1]=e.createElementVNode("span",{class:"filter-title"},"En: (Elige el lapso de tiempo)",-1)),e.createElementVNode("label",vte,[e.createElementVNode("input",{type:"checkbox",checked:d.value,onChange:e.withModifiers(a,["stop"])},null,40,bte),s[0]||(s[0]=e.createElementVNode("span",{class:"checkbox-label"},"Todos",-1))])]),e.createElementVNode("div",xte,[s[2]||(s[2]=e.createElementVNode("div",{class:"time-label"},"1er tiempo",-1)),e.createElementVNode("div",_te,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList($,c=>e.createElementVNode("button",{key:c.value,class:e.normalizeClass(["time-button",{active:l(c.value)}]),onClick:e.withModifiers(o=>S(c.value),["stop"])},e.toDisplayString(c.label),11,wte)),64))])]),e.createElementVNode("div",Tte,[s[3]||(s[3]=e.createElementVNode("div",{class:"time-label"},"2do tiempo",-1)),e.createElementVNode("div",Ste,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(f,c=>e.createElementVNode("button",{key:c.value,class:e.normalizeClass(["time-button",{active:l(c.value)}]),onClick:e.withModifiers(o=>S(c.value),["stop"])},e.toDisplayString(c.label),11,kte)),64))])]),e.createElementVNode("div",Lte,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(T,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(b,["stop"])}," Listo ")])]))}},pA=e2(Cte,[["__scopeId","data-v-7bea3520"]]),Nte={class:"como-fue-cobrado-filter"},Ote={class:"cobro-grid"},Ete=["onClick"],zte={class:"cobro-image-container"},Mte=["src","alt"],Vte={class:"cobro-footer"},Pte={class:"cobro-label"},Ate={class:"filter-actions"},Rte={__name:"ComoFueCobradoFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=[{value:"comba-afuera",label:"Comba hacia afuera",image:"https://golstatsimages.blob.core.windows.net/content/comba-afuera-izquierda.png",count:10},{value:"comba-adentro",label:"Comba hacia adentro",image:"https://golstatsimages.blob.core.windows.net/content/comba-adentro-izquierda.png",count:2},{value:"raz-area",label:"Raz de área",image:"https://golstatsimages.blob.core.windows.net/content/raz-area-izquierda.png",count:0},{value:"en-corto",label:"En corto",image:"https://golstatsimages.blob.core.windows.net/content/en-corto-izquierda.png",count:1}],f=e.ref([]);e.watch(()=>n.selectedValues,a=>{var S;if(console.log("[ComoFueCobradoFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:a,filterValue:a==null?void 0:a[n.filterIndex],optionValue:(S=a==null?void 0:a[n.filterIndex])==null?void 0:S[n.optionIndex]}),!a||!Array.isArray(a)){f.value.length===0&&(f.value=[...$.map(b=>b.value)]);return}const T=a[n.filterIndex];if(T&&typeof T=="object"&&!Array.isArray(T)&&T[n.optionIndex]!==void 0){const b=Array.isArray(T[n.optionIndex])?T[n.optionIndex]:[];console.log("[ComoFueCobradoFilter] Valores encontrados para sincronizar:",b);const p=JSON.stringify(f.value.sort()),s=JSON.stringify(b.sort());p!==s&&(f.value=b.length>0?[...b]:[]);return}f.value.length===0&&(f.value=[...$.map(b=>b.value)])},{immediate:!0,deep:!0});const u=a=>f.value.includes(a),i=a=>{let S=[...f.value];S.includes(a)?S=S.filter(T=>T!==a):S.push(a),S.length===0&&(S=[...$.map(T=>T.value)]),f.value=S,y("update-selection",{optionIndex:n.optionIndex,values:S})};e.onMounted(()=>{var a,S,T;console.log("[ComoFueCobradoFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(a=n.selectedValues)==null?void 0:a[n.filterIndex],optionValue:(T=(S=n.selectedValues)==null?void 0:S[n.filterIndex])==null?void 0:T[n.optionIndex]}),e.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const b=n.selectedValues[n.filterIndex];if(b&&typeof b=="object"&&!Array.isArray(b)&&b[n.optionIndex]!==void 0){const p=Array.isArray(b[n.optionIndex])?b[n.optionIndex]:[];if(console.log("[ComoFueCobradoFilter] onMounted - Valores encontrados:",p),p.length>0){console.log("[ComoFueCobradoFilter] onMounted - Actualizando localSelectedValues con:",p),f.value=[...p];return}}}f.value.length===0&&(console.log("[ComoFueCobradoFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),f.value=["izquierda",...$.map(b=>b.value)])})});const d=()=>{const a=[...$.map(S=>S.value)];f.value=a,y("update-selection",{optionIndex:n.optionIndex,values:a})},l=()=>{y("done")};return(a,S)=>(e.openBlock(),e.createElementBlock("div",Nte,[e.createElementVNode("div",Ote,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList($,T=>e.createElementVNode("div",{key:T.value,class:e.normalizeClass(["cobro-item",{active:u(T.value)}]),onClick:e.withModifiers(b=>i(T.value),["stop"])},[e.createElementVNode("div",zte,[e.createElementVNode("img",{src:T.image,alt:T.label,class:"cobro-image"},null,8,Mte)]),e.createElementVNode("div",Vte,[e.createElementVNode("span",Pte,e.toDisplayString(T.label),1)])],10,Ete)),64))]),e.createElementVNode("div",Ate,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(d,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(l,["stop"])}," Listo ")])]))}},LO=e2(Rte,[["__scopeId","data-v-fb6f9ab9"]]),Fte={class:"zona-filter"},Ute={class:"template-zone"},Ite={class:"controls-zone-container"},qte={class:"controls-zone-container-title-checkcon"},jte={class:"controls-zone-container-title-checkcon-check"},Dte={class:"gsc-field-img-container"},Wte=["fill"],Bte=["fill"],Kte=["fill"],Xte=["fill"],Gte=["fill"],Zte=["fill"],Jte=["fill"],Hte=["fill"],Yte=["fill"],Qte=["fill"],$te=["fill"],tee=["fill"],eee=["fill"],ree=["fill"],nee=["fill"],aee=["fill"],iee=["fill"],oee=["fill"],see=["fill"],lee=["fill"],cee=["fill"],uee=["fill"],dee=["fill"],pee=["fill"],hee=["fill"],fee=["fill"],mee=["fill"],yee=["fill"],gee=["fill"],vee=["fill"],bee=["fill"],xee=["fill"],_ee=["fill"],wee=["fill"],Tee=["fill"],See=["id"],kee=["mask"],Lee={class:"filter-actions"},Cee={__name:"ZonaFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=Array.from({length:35},(b,p)=>p+1),f=e.ref(!0),u=e.ref([]),i=e.computed(()=>u.value),d=e.computed(()=>new Date().getTime());e.watch(()=>n.selectedValues,b=>{var p;if(console.log("[ZonaFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:b,filterValue:b==null?void 0:b[n.filterIndex],optionValue:(p=b==null?void 0:b[n.filterIndex])==null?void 0:p[n.optionIndex]}),!b||!Array.isArray(b)){u.value.length===0&&(console.log("[ZonaFilter] No hay valores en props, usando valores por defecto"),u.value=[...$],f.value=!0);return}const s=b[n.filterIndex];if(s&&typeof s=="object"&&!Array.isArray(s)){if(s[n.optionIndex]!==void 0){const c=Array.isArray(s[n.optionIndex])?s[n.optionIndex]:[];console.log("[ZonaFilter] Valores encontrados para sincronizar:",c);const o=JSON.stringify(u.value.sort((v,k)=>v-k)),h=JSON.stringify(c.sort((v,k)=>v-k));o!==h&&(console.log("[ZonaFilter] Actualizando zonesLocal con:",c),u.value=c.length>0?[...c]:[],f.value=c.length===35);return}}else if(Array.isArray(s)&&s.length>0){console.log("[ZonaFilter] filterValue es array directo:",s);const c=JSON.stringify(u.value.sort((h,v)=>h-v)),o=JSON.stringify(s.sort((h,v)=>h-v));c!==o&&(console.log("[ZonaFilter] Actualizando zonesLocal con array directo:",s),u.value=[...s],f.value=s.length===35);return}u.value.length===0&&(console.log("[ZonaFilter] No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],f.value=!0)},{immediate:!0,deep:!0}),e.watch(u,b=>{f.value=b.length===35,y("update-selection",{optionIndex:n.optionIndex,values:b})},{deep:!0});function l(b){b?(u.value=[...$],f.value=!0):(u.value=[1],f.value=!1)}function a(b){u.value.includes(b)?u.value=u.value.filter(p=>p!==b):u.value.push(b),f.value=u.value.length===35}const S=()=>{u.value=[...$],f.value=!0},T=()=>{y("done")};return e.onMounted(()=>{var b,p,s;if(console.log("[ZonaFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(b=n.selectedValues)==null?void 0:b[n.filterIndex],optionValue:(s=(p=n.selectedValues)==null?void 0:p[n.filterIndex])==null?void 0:s[n.optionIndex]}),n.selectedValues&&Array.isArray(n.selectedValues)){const c=n.selectedValues[n.filterIndex];if(c&&typeof c=="object"&&!Array.isArray(c)&&c[n.optionIndex]!==void 0){const o=Array.isArray(c[n.optionIndex])?c[n.optionIndex]:[];if(console.log("[ZonaFilter] onMounted - Valores encontrados:",o),o.length>0){console.log("[ZonaFilter] onMounted - Actualizando zonesLocal con:",o),u.value=[...o],f.value=o.length===35;return}}}u.value.length===0&&(console.log("[ZonaFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],f.value=!0)}),(b,p)=>(e.openBlock(),e.createElementBlock("div",Fte,[e.createElementVNode("div",Ute,[e.createElementVNode("div",Ite,[p[36]||(p[36]=e.createElementVNode("div",{class:"controls-zone-container-title"}," ¿A dónde fue el balón?: ",-1)),p[37]||(p[37]=e.createElementVNode("div",{class:"separator-line"},null,-1)),e.createElementVNode("div",qte,[p[35]||(p[35]=e.createElementVNode("div",{class:"controls-zone-container-title-checkcon-label"}," Todas las zonas ",-1)),e.createElementVNode("div",jte,[e.createVNode(e.unref(lA),{label:"",fontFamily:"Poppins-Regular",labelFontSize:"11px","label-color":"#FFF","model-value":f.value,"onUpdate:modelValue":l},null,8,["model-value"])])])]),e.createElementVNode("div",Dte,[(e.openBlock(),e.createElementBlock("svg",{key:`field-${u.value.length}`,width:"100%",height:"177",viewBox:"0 0 380 177",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{onClick:p[0]||(p[0]=s=>a(1)),class:"sector-field",x:"0.347042",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:i.value.includes(1)?"#FFFF0030":"#2e3b46"},null,8,Wte),e.createElementVNode("rect",{onClick:p[1]||(p[1]=s=>a(9)),class:"sector-field",x:"288.347",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(9)?"#FFFF0030":"#2e3b46"},null,8,Bte),e.createElementVNode("rect",{onClick:p[2]||(p[2]=s=>a(17)),class:"sector-field",x:"0.347042",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(17)?"#FFFF0030":"#2e3b46"},null,8,Kte),e.createElementVNode("rect",{onClick:p[3]||(p[3]=s=>a(25)),class:"sector-field",x:"288.347",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(25)?"#FFFF0030":"#2e3b46"},null,8,Xte),e.createElementVNode("rect",{onClick:p[4]||(p[4]=s=>a(26)),class:"sector-field",x:"0.347042",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(26)?"#FFFF0030":"#2e3b46"},null,8,Gte),e.createElementVNode("rect",{onClick:p[5]||(p[5]=s=>a(27)),class:"sector-field",x:"91.347",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(27)?"#FFFF0030":"#2e3b46"},null,8,Zte),e.createElementVNode("rect",{onClick:p[6]||(p[6]=s=>a(28)),class:"sector-field",x:"157.015",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(28)?"#FFFF0030":"#2e3b46"},null,8,Jte),e.createElementVNode("rect",{onClick:p[7]||(p[7]=s=>a(29)),class:"sector-field",x:"222.679",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(29)?"#FFFF0030":"#2e3b46"},null,8,Hte),e.createElementVNode("rect",{onClick:p[8]||(p[8]=s=>a(30)),class:"sector-field",x:"288.347",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(30)?"#FFFF0030":"#2e3b46"},null,8,Yte),e.createElementVNode("rect",{onClick:p[9]||(p[9]=s=>a(31)),class:"sector-field",x:"0.347042",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(31)?"#FFFF0030":"#2e3b46"},null,8,Qte),e.createElementVNode("rect",{onClick:p[10]||(p[10]=s=>a(32)),class:"sector-field",x:"91.347",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(32)?"#FFFF0030":"#2e3b46"},null,8,$te),e.createElementVNode("rect",{onClick:p[11]||(p[11]=s=>a(33)),class:"sector-field",x:"157.015",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(33)?"#FFFF0030":"#2e3b46"},null,8,tee),e.createElementVNode("rect",{onClick:p[12]||(p[12]=s=>a(34)),class:"sector-field",x:"222.679",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(34)?"#FFFF0030":"#2e3b46"},null,8,eee),e.createElementVNode("rect",{onClick:p[13]||(p[13]=s=>a(35)),class:"sector-field",x:"288.347",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(35)?"#FFFF0030":"#2e3b46"},null,8,ree),e.createElementVNode("rect",{onClick:p[14]||(p[14]=s=>a(2)),class:"sector-field",x:"91.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(2)?"#FFFF0030":"#2e3b46"},null,8,nee),e.createElementVNode("rect",{onClick:p[15]||(p[15]=s=>a(3)),class:"sector-field",x:"114.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(3)?"#FFFF0030":"#2e3b46"},null,8,aee),e.createElementVNode("rect",{onClick:p[16]||(p[16]=s=>a(4)),class:"sector-field",x:"137.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(4)?"#FFFF0030":"#2e3b46"},null,8,iee),e.createElementVNode("rect",{onClick:p[17]||(p[17]=s=>a(5)),class:"sector-field",x:"172.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(5)?"#FFFF0030":"#2e3b46"},null,8,oee),e.createElementVNode("rect",{onClick:p[18]||(p[18]=s=>a(6)),class:"sector-field",x:"207.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(6)?"#FFFF0030":"#2e3b46"},null,8,see),e.createElementVNode("rect",{onClick:p[19]||(p[19]=s=>a(7)),class:"sector-field",x:"242.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(7)?"#FFFF0030":"#2e3b46"},null,8,lee),e.createElementVNode("rect",{onClick:p[20]||(p[20]=s=>a(8)),class:"sector-field",x:"265.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(8)?"#FFFF0030":"#2e3b46"},null,8,cee),e.createElementVNode("rect",{onClick:p[21]||(p[21]=s=>a(10)),class:"sector-field",x:"91.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(10)?"#FFFF0030":"#2e3b46"},null,8,uee),e.createElementVNode("rect",{onClick:p[22]||(p[22]=s=>a(11)),class:"sector-field",x:"114.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(11)?"#FFFF0030":"#2e3b46"},null,8,dee),e.createElementVNode("rect",{onClick:p[23]||(p[23]=s=>a(12)),class:"sector-field",x:"137.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(12)?"#FFFF0030":"#2e3b46"},null,8,pee),e.createElementVNode("rect",{onClick:p[24]||(p[24]=s=>a(13)),class:"sector-field",x:"172.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(13)?"#FFFF0030":"#2e3b46"},null,8,hee),e.createElementVNode("rect",{onClick:p[25]||(p[25]=s=>a(14)),class:"sector-field",x:"207.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(14)?"#FFFF0030":"#2e3b46"},null,8,fee),e.createElementVNode("rect",{onClick:p[26]||(p[26]=s=>a(15)),class:"sector-field",x:"242.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(15)?"#FFFF0030":"#2e3b46"},null,8,mee),e.createElementVNode("rect",{onClick:p[27]||(p[27]=s=>a(16)),class:"sector-field",x:"265.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(16)?"#FFFF0030":"#2e3b46"},null,8,yee),e.createElementVNode("rect",{onClick:p[28]||(p[28]=s=>a(18)),class:"sector-field",x:"91.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(18)?"#FFFF0030":"#2e3b46"},null,8,gee),e.createElementVNode("rect",{onClick:p[29]||(p[29]=s=>a(19)),class:"sector-field",x:"114.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(19)?"#FFFF0030":"#2e3b46"},null,8,vee),e.createElementVNode("rect",{onClick:p[30]||(p[30]=s=>a(20)),class:"sector-field",x:"137.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(20)?"#FFFF0030":"#2e3b46"},null,8,bee),e.createElementVNode("rect",{onClick:p[31]||(p[31]=s=>a(21)),class:"sector-field",x:"172.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(21)?"#FFFF0030":"#2e3b46"},null,8,xee),e.createElementVNode("rect",{onClick:p[32]||(p[32]=s=>a(22)),class:"sector-field",x:"207.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(22)?"#FFFF0030":"#2e3b46"},null,8,_ee),e.createElementVNode("rect",{onClick:p[33]||(p[33]=s=>a(23)),class:"sector-field",x:"242.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(23)?"#FFFF0030":"#2e3b46"},null,8,wee),e.createElementVNode("rect",{onClick:p[34]||(p[34]=s=>a(24)),class:"sector-field",x:"265.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(24)?"#FFFF0030":"#2e3b46"},null,8,Tee),p[40]||(p[40]=e.createElementVNode("rect",{x:"91.6",y:"0.6",width:"196.8",height:"87.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),p[41]||(p[41]=e.createElementVNode("rect",{x:"137.6",y:"0.782404",width:"104.8",height:"28.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),e.createElementVNode("mask",{id:d.value,style:{"mask-type":"alpha"},maskUnits:"userSpaceOnUse",x:"91",y:"88",width:"198",height:"25"},[...p[38]||(p[38]=[e.createElementVNode("rect",{width:"197.746",height:"24.6043",transform:"matrix(1 0 0 -1 91 113)",fill:"#D9D9D9"},null,-1)])],8,See),e.createElementVNode("g",{mask:`url(#${d.value})`},[...p[39]||(p[39]=[e.createElementVNode("circle",{cx:"185.329",cy:"56.5046",r:"52.6152",stroke:"#DFE3E2","stroke-width":"1.38817"},null,-1)])],8,kee),p[42]||(p[42]=e.createElementVNode("circle",{cx:"190.278",cy:"66.2782",r:"2.27817",fill:"white"},null,-1)),p[43]||(p[43]=e.createElementVNode("rect",{x:"0.7",y:"0.7",width:"378.6",height:"175.6",stroke:"#DFE3E2","stroke-width":"1.4"},null,-1))]))])]),e.createElementVNode("div",Lee,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(S,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(T,["stop"])}," Listo ")])]))}},hA=e2(Cee,[["__scopeId","data-v-b0bc264a"]]),Nee={class:"que-sucedio-filter"},Oee={class:"filter-header"},Eee={class:"checkbox-item todos-header"},zee=["checked"],Mee={class:"filter-section"},Vee={class:"checkbox-item main-option"},Pee=["checked"],Aee={class:"sub-options"},Ree={class:"checkbox-item sub-option"},Fee=["checked"],Uee={class:"checkbox-item sub-option"},Iee=["checked"],qee={class:"filter-section"},jee={class:"checkbox-item main-option"},Dee=["checked"],Wee={class:"sub-options"},Bee={class:"checkbox-item sub-option"},Kee=["checked"],Xee={class:"checkbox-item sub-option"},Gee=["checked"],Zee={class:"checkbox-item sub-option"},Jee=["checked"],Hee={class:"filter-actions"},Yee={__name:"QueSucedioFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(t,{emit:r}){const n=t,y=r,$=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],f={"rematado-destino-porteria":["fue-gol","no-fue-gol"],"rematado-sin-destino-porteria":["ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"]},u=e.ref([]);e.watch(()=>n.selectedValues,p=>{if(!p||!Array.isArray(p))return;const s=p[n.filterIndex];if(s&&typeof s=="object"&&!Array.isArray(s)&&s[n.optionIndex]!==void 0){const c=Array.isArray(s[n.optionIndex])?s[n.optionIndex]:[];if(c.length>0){const o=JSON.stringify(u.value.sort()),h=JSON.stringify(c.sort());o!==h&&(u.value=[...c])}}},{immediate:!0,deep:!0}),e.onMounted(()=>{e.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const p=n.selectedValues[n.filterIndex];if(p&&typeof p=="object"&&!Array.isArray(p)&&p[n.optionIndex]!==void 0){const s=Array.isArray(p[n.optionIndex])?p[n.optionIndex]:[];if(s.length>0){u.value=[...s];return}}}u.value.length===0&&(u.value=[...$])})});const i=e.computed(()=>$.every(p=>u.value.includes(p))),d=p=>u.value.includes(p),l=p=>{p.target.checked?u.value=[...$]:u.value=[],y("update-selection",{optionIndex:n.optionIndex,values:[...u.value]})},a=(p,s)=>{let c=[...u.value];const o=f[p]||[];s?(c.includes(p)||c.push(p),o.forEach(h=>{c.includes(h)||c.push(h)})):c=c.filter(h=>h!==p&&!o.includes(h)),u.value=c,y("update-selection",{optionIndex:n.optionIndex,values:c})},S=(p,s)=>{let c=[...u.value];const o=Object.keys(f).find(h=>f[h].includes(p));s?(c.includes(p)||c.push(p),o&&f[o].every(h=>c.includes(h))&&!c.includes(o)&&c.push(o)):(c=c.filter(h=>h!==p),o&&c.includes(o)&&(c=c.filter(h=>h!==o))),u.value=c,y("update-selection",{optionIndex:n.optionIndex,values:c})},T=()=>{u.value=[...$],y("update-selection",{optionIndex:n.optionIndex,values:[...$]})},b=()=>{y("done")};return(p,s)=>(e.openBlock(),e.createElementBlock("div",Nee,[e.createElementVNode("div",Oee,[e.createElementVNode("label",Eee,[s[7]||(s[7]=e.createElementVNode("span",{class:"checkbox-label"},"Todos",-1)),e.createElementVNode("input",{type:"checkbox",checked:i.value,onChange:e.withModifiers(l,["stop"])},null,40,zee)])]),s[15]||(s[15]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("div",Mee,[e.createElementVNode("label",Vee,[e.createElementVNode("input",{type:"checkbox",checked:d("rematado-destino-porteria"),onChange:s[0]||(s[0]=e.withModifiers(c=>a("rematado-destino-porteria",c.target.checked),["stop"]))},null,40,Pee),s[8]||(s[8]=e.createElementVNode("span",{class:"checkbox-label"},"Rematado con destino a portería",-1))]),e.createElementVNode("div",Aee,[e.createElementVNode("label",Ree,[e.createElementVNode("input",{type:"checkbox",checked:d("fue-gol"),onChange:s[1]||(s[1]=e.withModifiers(c=>S("fue-gol",c.target.checked),["stop"]))},null,40,Fee),s[9]||(s[9]=e.createElementVNode("span",{class:"checkbox-label"},"Fue gol",-1))]),e.createElementVNode("label",Uee,[e.createElementVNode("input",{type:"checkbox",checked:d("no-fue-gol"),onChange:s[2]||(s[2]=e.withModifiers(c=>S("no-fue-gol",c.target.checked),["stop"]))},null,40,Iee),s[10]||(s[10]=e.createElementVNode("span",{class:"checkbox-label"},"No fue gol",-1))])])]),s[16]||(s[16]=e.createElementVNode("div",{class:"separator"},null,-1)),e.createElementVNode("div",qee,[e.createElementVNode("label",jee,[e.createElementVNode("input",{type:"checkbox",checked:d("rematado-sin-destino-porteria"),onChange:s[3]||(s[3]=e.withModifiers(c=>a("rematado-sin-destino-porteria",c.target.checked),["stop"]))},null,40,Dee),s[11]||(s[11]=e.createElementVNode("span",{class:"checkbox-label"},"Rematado sin destino a portería",-1))]),e.createElementVNode("div",Wee,[e.createElementVNode("label",Bee,[e.createElementVNode("input",{type:"checkbox",checked:d("ganados-por-portero-rival"),onChange:s[4]||(s[4]=e.withModifiers(c=>S("ganados-por-portero-rival",c.target.checked),["stop"]))},null,40,Kee),s[12]||(s[12]=e.createElementVNode("span",{class:"checkbox-label"},"Ganados por portero rival",-1))]),e.createElementVNode("label",Xee,[e.createElementVNode("input",{type:"checkbox",checked:d("ganados-por-jugador-rival"),onChange:s[5]||(s[5]=e.withModifiers(c=>S("ganados-por-jugador-rival",c.target.checked),["stop"]))},null,40,Gee),s[13]||(s[13]=e.createElementVNode("span",{class:"checkbox-label"},"Ganados por jugador rival",-1))]),e.createElementVNode("label",Zee,[e.createElementVNode("input",{type:"checkbox",checked:d("sin-destino"),onChange:s[6]||(s[6]=e.withModifiers(c=>S("sin-destino",c.target.checked),["stop"]))},null,40,Jee),s[14]||(s[14]=e.createElementVNode("span",{class:"checkbox-label"},"Sin destino",-1))])])]),e.createElementVNode("div",Hee,[e.createElementVNode("button",{class:"btn-remove-filters",onClick:e.withModifiers(T,["stop"])}," Quitar filtros "),e.createElementVNode("button",{class:"btn-done",onClick:e.withModifiers(b,["stop"])}," Listo ")])]))}},u9=e2(Yee,[["__scopeId","data-v-e3994cc8"]]),Qee={class:"advanced-select-accordion"},$ee=["onClick"],tre={class:"accordion-header-left"},ere={class:"accordion-icon"},rre=["src","alt"],nre={class:"accordion-title"},are={class:"accordion-header-right"},ire={key:0,class:"accordion-badge"},ore={key:0,class:"accordion-content"},sre={class:"accordion-footer"},lre={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(t,{emit:r}){const n=t;e.watch(()=>n.selectedValues,b=>{console.log("Acorden inicla 55555555555v [AdvancedSelectAccordion] selectedValues recibidos:",{filterIndex:n.filterIndex,selectedValues:b,filterValue:b==null?void 0:b[n.filterIndex],filterValueType:typeof(b==null?void 0:b[n.filterIndex]),isArray:Array.isArray(b==null?void 0:b[n.filterIndex]),filterValueKeys:b!=null&&b[n.filterIndex]&&typeof(b==null?void 0:b[n.filterIndex])=="object"?Object.keys(b[n.filterIndex]):null})},{immediate:!0,deep:!0});const y=r,$=e.ref({}),f=b=>{$.value[b]?$.value[b]=!1:(Object.keys($.value).forEach(p=>{$.value[p]=!1}),$.value[b]=!0)},u=b=>{const p=n.filter.options[b];if(!p||!p.filters)return 0;const s=n.selectedValues[n.filterIndex];if(!s||!s[b])return 0;const c=s[b];return Array.isArray(c)?c.length:0},i=(b,p)=>b.icon?b.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${p+1}.png`,d=b=>b==="Qué sucedió?"||b==="Qué sucedió"?"¿Qué sucedió?":b,l=b=>{const p={resultados:kO,detalles:pA,"como-fue-cobrado":LO,"como fue cobrado":LO,zona:hA,"que-sucedio":u9,"qué sucedió":u9,"que sucedio":u9},s=typeof b.value=="string"?b.value:String(b.value||""),c=typeof b.label=="string"?b.label:String(b.label||""),o=s.toLowerCase().trim(),h=c.toLowerCase().trim();if(o&&p[o])return p[o];if(h&&p[h])return p[h];const v=h.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,k=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[k]||k);return v&&p[v]?p[v]:kO},a=b=>{y("update-selection",{filterIndex:n.filterIndex,optionIndex:b.optionIndex,values:b.values})},S=b=>{$.value[b]=!1},T=()=>{y("close")};return(b,p)=>(e.openBlock(),e.createElementBlock("div",Qee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filter.options,(s,c)=>(e.openBlock(),e.createElementBlock("div",{key:s.value||c,class:"accordion-item"},[e.createElementVNode("div",{class:"accordion-header",onClick:e.withModifiers(o=>f(c),["stop"])},[e.createElementVNode("div",tre,[e.createElementVNode("span",ere,[e.createElementVNode("img",{src:i(s,c),alt:s.label},null,8,rre)]),e.createElementVNode("span",nre,e.toDisplayString(d(s.label)),1)]),e.createElementVNode("div",are,[u(c)>0?(e.openBlock(),e.createElementBlock("span",ire,e.toDisplayString(u(c)),1)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["accordion-chevron",{open:$.value[c]}])},[...p[0]||(p[0]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,$ee),e.createVNode(e.Transition,{name:"accordion"},{default:e.withCtx(()=>[$.value[c]?(e.openBlock(),e.createElementBlock("div",ore,[l(s)===kO?(e.openBlock(),e.createBlock(kO,{key:0,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(s)===pA?(e.openBlock(),e.createBlock(pA,{key:1,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(s)===LO?(e.openBlock(),e.createBlock(LO,{key:2,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(s)===hA?(e.openBlock(),e.createBlock(hA,{key:3,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(s)===u9?(e.openBlock(),e.createBlock(u9,{key:4,option:s,"filter-index":t.filterIndex,"option-index":c,"selected-values":t.selectedValues,onUpdateSelection:a,onDone:()=>S(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:2},1024)]))),128)),e.createElementVNode("div",sre,[p[1]||(p[1]=e.createElementVNode("div",{class:"footer-separator"},null,-1)),e.createElementVNode("button",{class:"btn-done-footer",onClick:e.withModifiers(T,["stop"])}," Listo ")])]))}},cre=e2(lre,[["__scopeId","data-v-92b4e8ad"]]),ure={class:"corners-zone-filters"},dre={key:0,class:"custom-radio-group"},pre={class:"radio-label"},hre={class:"radio-options"},fre=["name","value","onUpdate:modelValue"],mre={key:0,class:"filter-separator"},yre={class:"filter-inline select-with-label"},gre=["data-filter-type","onClick"],vre={class:"select-display"},bre={class:"select-label"},xre={key:0,class:"dropdown-menu type-menu simple-select-menu"},_re={class:"simple-select-scroll-area"},wre=["onClick"],Tre={class:"option-content"},Sre={class:"option-title"},kre={key:0,class:"option-checkmark"},Lre={class:"switch-group"},Cre={class:"switch-label"},Nre=["onClick"],Ore={key:0,class:"filter-separator"},Ere={key:3,class:"filter-inline advanced-select-wrapper"},zre=["data-filter-type","onClick"],Mre={class:"select-display"},Vre={class:"select-label"},Pre={__name:"CornersZoneFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:17},viewConfig:{type:Object,default:()=>({})},defaultFilters:{type:Object,default:()=>null}},emits:["filters-changed","filter-updated","change","remove-views"],setup(t,{expose:r,emit:n}){const y=t,$=n,f=e.ref([]);let u=null;const i=e.ref(null),d=e.ref(null),l=e.ref([]);let a=!1,S=null;const T=(I,j)=>{if(Array.isArray(I)&&Array.isArray(j)){if(I.length!==j.length)return!1;for(let F=0;F<I.length;F++)if(I[F]!==j[F])return!1;return!0}return I===j},b=(I,j=!0)=>{if(y.filters&&y.filters[0]&&y.filters[1]){const F=y.filters[0],D=y.filters[1],U=F.options,M=D.options;U&&Array.isArray(U)&&M?I!=null?U.findIndex(X=>X.value===I)!==-1&&M[I]?(l.value=M[I],j&&!(()=>{const X=f.value[1];return X==null?!1:Array.isArray(X)?X.length>0:X!==""})()&&!a&&l.value.length>0&&(f.value[1]=l.value[0].value,e.nextTick(()=>{}))):(l.value=[],f.value[1]=null):(l.value=[],f.value[1]=null):l.value=[]}},p=()=>{y.initialValues&&y.initialValues.length>0?y.initialValues.length>0&&(typeof y.initialValues[0]=="number"||typeof y.initialValues[0]=="boolean"||y.initialValues[0]===null||Array.isArray(y.initialValues[0]))?f.value=y.filters.map((F,D)=>{var U,M,X,O;const Y=y.initialValues[D];if(Y!=null)return F.type==="switch"&&y.filters.findIndex(st=>st.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor desde initialValues en índice ${D} (formato simple):`,Y),Y;if(F.type==="radio-button")return((M=(U=F.options)==null?void 0:U[0])==null?void 0:M.value)||null;if(F.type==="advanced-select"){const st={};let mt=!1;return F.options&&Array.isArray(F.options)&&F.options.forEach((yt,bt)=>{var xt,Pt,qt,_t,It,jt,Rt;yt.value==="zona"||(xt=yt.label)!=null&&xt.toLowerCase().includes("zona")?(st[bt]=Array.from({length:35},(Wt,re)=>re+1),mt=!0):yt.value==="resultados"||(Pt=yt.label)!=null&&Pt.toLowerCase().includes("resultados")?(st[bt]=["iba-ganando","iba-perdiendo","iba-empatado"],mt=!0):yt.value==="que-sucedio"||yt.value==="que sucedio"||(qt=yt.label)!=null&&qt.toLowerCase().includes("qué sucedió")||(_t=yt.label)!=null&&_t.toLowerCase().includes("que sucedio")?(st[bt]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],mt=!0):yt.value==="detalles"||(It=yt.label)!=null&&It.toLowerCase().includes("detalles")?(st[bt]=["0-15","16-30","31-45","46-60","61-75","76-90"],mt=!0):(yt.value==="como-fue-cobrado"||yt.value==="como fue cobrado"||(jt=yt.label)!=null&&jt.toLowerCase().includes("cómo fue cobrado")||(Rt=yt.label)!=null&&Rt.toLowerCase().includes("como fue cobrado"))&&(st[bt]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],mt=!0)}),mt?st:{}}return F.type==="select"?[]:F.type==="check"?!1:F.type==="switch"?(y.filters.findIndex(st=>st.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (formato simple):`,!1),!1):F.type==="select-simple"&&((O=(X=F.options)==null?void 0:X[0])==null?void 0:O.value)||null}):y.isEditMode?f.value=y.filters.map((F,D)=>{var U,M,X,O,Y,st,mt,yt,bt,xt;const Pt=y.initialValues[D];if(D===3&&console.log(`[CornersZoneFilters] Procesando filtro en índice ${D} (FILTRO AVANZADO):`,{filterType:F.type,filterData:Pt,hasFilterData:!!Pt,filterDataKeys:Pt?Object.keys(Pt):null,selectedValue:Pt==null?void 0:Pt.selectedValue,selectedValueType:typeof(Pt==null?void 0:Pt.selectedValue),isDirectObject:Pt&&typeof Pt=="object"&&!Array.isArray(Pt)&&!Pt.selectedValue&&!Pt.selectedOption&&!Pt.isChecked}),!Pt)return F.type==="select"?[]:F.type==="check"?!1:F.type==="switch"?(y.filters.findIndex(qt=>qt.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (modo edición):`,!1),!1):F.type==="radio-button"?((M=(U=F.options)==null?void 0:U[0])==null?void 0:M.value)||null:F.type==="select-simple"?((O=(X=F.options)==null?void 0:X[0])==null?void 0:O.value)||null:F.type==="advanced-select"?{}:null;if(F.type==="advanced-select"){if(console.log(`[CornersZoneFilters] Modo edición - Filtro avanzado en índice ${D}:`,{filterIndex:D,filterType:F.type,filterData:Pt,selectedValue:Pt==null?void 0:Pt.selectedValue,selectedValueType:typeof(Pt==null?void 0:Pt.selectedValue),isArray:Array.isArray(Pt==null?void 0:Pt.selectedValue),isDirectObject:typeof Pt=="object"&&!Array.isArray(Pt)&&!Pt.selectedValue&&!Pt.selectedOption&&!Pt.isChecked}),Pt.selectedValue!==void 0&&Pt.selectedValue!==null){if(typeof Pt.selectedValue=="object"&&!Array.isArray(Pt.selectedValue)){const qt=Object.keys(Pt.selectedValue).some(_t=>{const It=Number(_t);return!isNaN(It)&&It>=0});return console.log(`[CornersZoneFilters] Filtro avanzado ${D} - hasCorrectStructure:`,qt,"selectedValue:",Pt.selectedValue),qt&&console.log(`[CornersZoneFilters] Filtro avanzado ${D} - Retornando selectedValue directamente:`,Pt.selectedValue),Pt.selectedValue}else if(Array.isArray(Pt.selectedValue)){const qt={};return Pt.selectedValue.forEach((_t,It)=>{qt[It]=_t}),qt}}return typeof Pt=="object"&&!Array.isArray(Pt)&&!Pt.selectedValue&&!Pt.selectedOption&&!Pt.isChecked&&Pt!==null&&Object.keys(Pt).some(qt=>{const _t=Number(qt);return!isNaN(_t)&&_t>=0})?(console.log(`[CornersZoneFilters] Filtro avanzado ${D} - filterData es objeto directo guardado, retornando:`,Pt),Pt):(console.log(`[CornersZoneFilters] Filtro avanzado ${D} - No hay valores guardados, retornando objeto vacío`),{})}return F.type==="radio-button"&&Pt.selectedOption?Pt.selectedOption.value:F.type==="radio-button"&&!Pt.selectedOption?Pt.selectedValue!==void 0?Pt.selectedValue:((st=(Y=F.options)==null?void 0:Y[0])==null?void 0:st.value)||null:F.type==="select-simple"&&Pt.selectedValue!==void 0?Array.isArray(Pt.selectedValue)?Pt.selectedValue[0]:Pt.selectedValue:F.type==="select"&&Pt.selectedOptions?Pt.selectedOptions.map(qt=>qt.value):F.type==="check"&&Pt.isChecked!==void 0?Pt.isChecked:F.type==="switch"&&(Pt.isChecked!==void 0||Pt.selectedValue!==void 0)?Pt.isChecked!==void 0?Pt.isChecked:Pt.selectedValue:Pt.selectedValue!==void 0?Pt.selectedValue:F.type==="select"?[]:F.type==="check"||F.type==="switch"?!1:F.type==="radio-button"?((yt=(mt=F.options)==null?void 0:mt[0])==null?void 0:yt.value)||null:F.type==="select-simple"?((xt=(bt=F.options)==null?void 0:bt[0])==null?void 0:xt.value)||null:F.type==="advanced-select"?{}:null}):f.value=y.filters.map((F,D)=>{var U,M,X,O;const Y=y.initialValues[D];if(Y!=null)return Y;if(F.type==="radio-button")return((M=(U=F.options)==null?void 0:U[0])==null?void 0:M.value)||null;if(F.type==="advanced-select"){const st={};let mt=!1;return F.options&&Array.isArray(F.options)&&F.options.forEach((yt,bt)=>{var xt,Pt,qt,_t,It,jt,Rt;yt.value==="zona"||(xt=yt.label)!=null&&xt.toLowerCase().includes("zona")?(st[bt]=Array.from({length:35},(Wt,re)=>re+1),mt=!0):yt.value==="resultados"||(Pt=yt.label)!=null&&Pt.toLowerCase().includes("resultados")?(st[bt]=["iba-ganando","iba-perdiendo","iba-empatado"],mt=!0):yt.value==="que-sucedio"||yt.value==="que sucedio"||(qt=yt.label)!=null&&qt.toLowerCase().includes("qué sucedió")||(_t=yt.label)!=null&&_t.toLowerCase().includes("que sucedio")?(st[bt]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],mt=!0):yt.value==="detalles"||(It=yt.label)!=null&&It.toLowerCase().includes("detalles")?(st[bt]=["0-15","16-30","31-45","46-60","61-75","76-90"],mt=!0):(yt.value==="como-fue-cobrado"||yt.value==="como fue cobrado"||(jt=yt.label)!=null&&jt.toLowerCase().includes("cómo fue cobrado")||(Rt=yt.label)!=null&&Rt.toLowerCase().includes("como fue cobrado"))&&(st[bt]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],mt=!0)}),mt?st:{}}return F.type==="select"?[]:F.type==="check"?!1:F.type==="switch"?(y.filters.findIndex(st=>st.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (modo agregar):`,!1),!1):F.type==="select-simple"&&((O=(X=F.options)==null?void 0:X[0])==null?void 0:O.value)||null}):f.value=y.filters.map((F,D)=>{var U,M,X,O;return F.type==="select"?[]:F.type==="check"?!1:F.type==="switch"?(y.filters.findIndex(Y=>Y.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (sin initialValues):`,!1),!1):F.type==="radio-button"?((M=(U=F.options)==null?void 0:U[0])==null?void 0:M.value)||null:F.type==="select-simple"?((O=(X=F.options)==null?void 0:X[0])==null?void 0:O.value)||null:F.type==="advanced-select"?{}:null});const I=f.value.some(F=>F!=null&&(Array.isArray(F)?F.length>0:typeof F=="object"&&!Array.isArray(F)?Object.keys(F).length>0:F!==!1&&F!=="")),j=y.filters.map((F,D)=>({index:D,type:F.type,label:F.label||F.label_1||F.label_2||`Filtro ${D}`,value:f.value[D]}));console.log("??????????????????????????????????? ---- ???????????????????????????????????"),console.log("Valores de filtros seteados:",j),console.log("selectedValues:",f.value),console.log("props.filters:",y.filters),console.log("??????????????????????????????????? ---- ???????????????????????????????????"),I&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))};p(),setTimeout(()=>{e.nextTick(()=>{if(f.value[0]!==null&&f.value[0]!==void 0&&!a){const I=!(()=>{const j=f.value[1];return j==null?!1:Array.isArray(j)?j.length>0:j!==""})();b(f.value[0],I),e.nextTick(()=>{f.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(!u||f.value.length!==u.length||f.value.some((j,F)=>!T(j,u[F])))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))})}else setTimeout(()=>{f.value.some(I=>I!=null&&(Array.isArray(I)?I.length>0:typeof I=="object"&&!Array.isArray(I)?Object.keys(I).length>0:I!==!1&&I!==""))&&(!u||f.value.length!==u.length||f.value.some((I,j)=>!T(I,u[j])))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))},100)})},300),e.watch(()=>y.initialValues,I=>{if(!I||I.length===0)return;const j=I.length>0&&(typeof I[0]=="number"||typeof I[0]=="boolean"||I[0]===null||Array.isArray(I[0])),F=!T(f.value,I),D=I&&I.length>0&&!a&&F,U=y.isEditMode&&a;if(D&&!U)if(j){const M=y.filters.findIndex(X=>X.type==="switch");M!==-1&&I[M]!==void 0&&console.log(`[Primer Switch] Se setea valor desde watcher initialValues (formato simple) en índice ${M}:`,I[M]),f.value=[...I]}else y.isEditMode?f.value=y.filters.map((M,X)=>{const O=I[X];return O?M.type==="radio-button"&&O.selectedOption?O.selectedOption.value:M.type==="select-simple"&&O.selectedValue!==void 0?Array.isArray(O.selectedValue)?O.selectedValue[0]:O.selectedValue:M.type==="select"&&O.selectedOptions?O.selectedOptions.map(Y=>Y.value):M.type==="check"&&O.isChecked!==void 0?O.isChecked:M.type==="switch"&&O.isChecked!==void 0?(y.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde isChecked en índice ${X} (modo edición):`,O.isChecked),O.isChecked):M.type==="switch"&&O.selectedValue!==void 0?(y.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde selectedValue en índice ${X} (modo edición):`,O.selectedValue),O.selectedValue):M.type==="advanced-select"&&O.selectedValue!==void 0||O.selectedValue!==void 0?O.selectedValue:f.value[X]:f.value[X]}):f.value=[...I];else a?S&&S.length>0&&(f.value=[...S]):U&&S&&S.length>0&&(f.value=[...S])},{deep:!0}),e.watch(()=>y.isEditMode,(I,j)=>{j===!0&&I===!1&&(S=null)},{immediate:!0}),e.watch(f,I=>{if(I.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))){const j=[...I];if(u){for(;j.length<u.length;)j.push(void 0);for(let F=0;F<u.length;F++)u[F]!==void 0&&u[F]!==null&&(j[F]===void 0||j[F]===null)&&(j[F]=u[F])}if((()=>{if(!u||j.length!==u.length)return!0;for(let F=0;F<j.length;F++)if(!T(j[F],u[F]))return!0;return!1})()){u=[...j];const F=y.filters.map((D,U)=>({index:U,type:D.type,label:D.label||D.label_1||D.label_2||`Filtro ${U}`,value:j[U]}));console.log("Valores de filtros actualizados:",F),$("filters-changed",{componentId:y.componentId,filters:j,timestamp:new Date().toISOString()})}}},{deep:!0}),e.watch(()=>f.value[0],(I,j)=>{var F;if(I==null){const U=y.filters[0];if(U&&U.type==="radio-button"&&U.options&&U.options.length>0){const M=U.options[0].value;f.value[0]=M;return}}const D=(F=y.filters)==null?void 0:F[0];D&&D.type==="select-simple"&&(I!==j&&j!==void 0?b(I,!0):j===void 0&&I!==null&&I!==void 0&&b(I,!1))},{immediate:!0});const s=I=>{i.value===I?i.value=null:(i.value=I,d.value=null)},c=I=>{d.value===I?d.value=null:(d.value=I,i.value=null)},o=(I,j)=>{if(a=!0,setTimeout(()=>{a=!1},1e3),f.value[I]=j,(I===0||I===1)&&(S=[...f.value]),i.value=null,I===0){f.value[1]!==void 0&&(f.value[1]=null);const F=a;a=!1,b(j,!0),a=F,f.value[1]!==null&&f.value[1]!==void 0&&(S=[...f.value])}},h=()=>{a=!0,setTimeout(()=>{a=!1},400)},v=I=>{a=!0,setTimeout(()=>{a=!1},400);const j=f.value[I],F=!j;f.value[I]=F,y.filters.findIndex(D=>D.type==="switch")===I&&console.log(`[Primer Switch] Se setea valor en índice ${I} desde toggleSwitch:`,F,"(valor anterior:",j,")")},k=I=>{a=!0,setTimeout(()=>{a=!1},400),f.value[I.filterIndex]||(f.value[I.filterIndex]={}),f.value[I.filterIndex]={...f.value[I.filterIndex],[I.optionIndex]:I.values},e.nextTick(()=>{f.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(u=[...f.value],$("filters-changed",{componentId:y.componentId,filters:f.value,timestamp:new Date().toISOString()}))})},L=()=>f.value,E=(I,j)=>{const F=f.value[j];if(F==null)return null;if(j===1&&l.value.length>0){const D=l.value.find(U=>U.value===F);return D?D.label:null}if(I.options&&Array.isArray(I.options)){const D=I.options.find(U=>U.value===F);return D?D.label:null}return null},P=(I,j)=>{const F=f.value[j];if(!F||typeof F!="object"||Array.isArray(F))return null;const D=Object.values(F).reduce((U,M)=>Array.isArray(M)&&M.length>0?U+M.length:U,0);return D>0?`${D} seleccionado${D>1?"s":""}`:null},V=I=>{const j=I.target,F=j.closest(".advanced-select-dropdown"),D=j.closest(".advanced-select-menu"),U=j.closest(".advanced-select-accordion"),M=j.closest(".advanced-select-content"),X=j.closest(".custom-select.dynamic-select"),O=j.closest(".simple-select-menu");!(F||D||U||M)&&!(X||O)&&(d.value=null,i.value=null)};return e.onMounted(()=>{document.addEventListener("click",V)}),e.onUnmounted(()=>{document.removeEventListener("click",V)}),r({getCurrentValues:L,initializeValues:p}),(I,j)=>(e.openBlock(),e.createElementBlock("div",ure,[t.filters&&t.filters.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":t.filters.length>=2}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filters,(F,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:D},[F.type==="radio-button"?(e.openBlock(),e.createElementBlock("div",dre,[e.createElementVNode("div",pre,e.toDisplayString(F.label),1),e.createElementVNode("div",hre,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.options,U=>(e.openBlock(),e.createElementBlock("label",{key:U.value,class:e.normalizeClass(["radio-option-card",{active:f.value[D]===U.value}])},[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+D,value:U.value,"onUpdate:modelValue":M=>f.value[D]=M,onChange:h},null,40,fre),[[e.vModelRadio,f.value[D]]]),e.createElementVNode("span",null,e.toDisplayString(U.label),1)],2))),128))])])):F.type==="select-simple"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[D==2?(e.openBlock(),e.createElementBlock("div",mre)):e.createCommentVNode("",!0),e.createElementVNode("div",yre,[e.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":F.type,onClick:e.withModifiers(U=>s(D),["stop"])},[e.createElementVNode("div",vre,[j[3]||(j[3]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.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)),e.createElementVNode("span",bre,e.toDisplayString(E(F,D)||F.label_2||F.label||"Tipo de análisis"),1),e.createElementVNode("span",{class:e.normalizeClass(["arrow",{open:i.value===D}])},[...j[2]||(j[2]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===D?(e.openBlock(),e.createElementBlock("div",xre,[e.createElementVNode("div",_re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D===1?l.value:F.options,U=>(e.openBlock(),e.createElementBlock("div",{key:U.value,class:e.normalizeClass(["option-card simple-select-option",{active:T(f.value[D],U.value)}]),onClick:e.withModifiers(M=>o(D,U.value),["stop"])},[e.createElementVNode("div",Tre,[e.createElementVNode("div",Sre,e.toDisplayString(U.label),1)]),T(f.value[D],U.value)?(e.openBlock(),e.createElementBlock("div",kre,[...j[4]||(j[4]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[e.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):e.createCommentVNode("",!0)],10,wre))),128))])])):e.createCommentVNode("",!0)],8,gre)])],64)):F.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Lre,[e.createElementVNode("label",Cre,[F.label_1?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["switch-text switch-text-left",{"switch-text-selected":!f.value[D]}])},e.toDisplayString(F.label_1),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"switch",onClick:U=>v(D)},[e.createElementVNode("div",{class:e.normalizeClass(["switch-track",{"switch-on":f.value[D]}])},[e.createElementVNode("div",{class:e.normalizeClass(["switch-thumb",{on:f.value[D]}])},null,2)],2)],8,Nre),F.label_2?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["switch-text switch-text-right",{"switch-text-selected":f.value[D]}])},e.toDisplayString(F.label_2),3)):e.createCommentVNode("",!0)])]),D>=0?(e.openBlock(),e.createElementBlock("div",Ore)):e.createCommentVNode("",!0)],64)):F.type==="advanced-select"?(e.openBlock(),e.createElementBlock("div",Ere,[e.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":F.type,onClick:e.withModifiers(U=>c(D),["stop"])},[e.createElementVNode("div",Mre,[j[6]||(j[6]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.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)),e.createElementVNode("span",Vre,e.toDisplayString(P(F,D)||F.label||"Seleccionar"),1),e.createElementVNode("span",{class:e.normalizeClass(["arrow",{open:d.value===D}])},[...j[5]||(j[5]=[e.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),d.value===D?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dropdown-menu type-menu advanced-select-menu",onClick:j[1]||(j[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"advanced-select-content",onClick:j[0]||(j[0]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(cre,{filter:F,"filter-index":D,"selected-values":f.value,onUpdateSelection:k,onClose:U=>c(D)},null,8,["filter","filter-index","selected-values","onClose"])])])):e.createCommentVNode("",!0)],8,zre)])):e.createCommentVNode("",!0)],64))),128))],2)):e.createCommentVNode("",!0)]))}},Are=e2(Pre,[["__scopeId","data-v-32afcda4"]]),Rre={class:"floating-bar"},Fre={class:"tab active"},Ure={class:"select-display"},Ire={class:"select-icon"},qre=["src"],jre={key:1,alt:"icono",class:"option-img-default",src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png"},Dre={key:0,class:"select-placeholder select-label"},Wre={key:1,class:"select-label"},Bre={key:0,class:"dropdown-menu field-menu"},Kre=["onClick"],Xre={class:"option-icon"},Gre=["data-hover-src","src"],Zre={class:"option-content"},Jre={class:"option-title"},Hre={key:0,class:"option-description"},Yre={class:"select-display"},Qre={class:"select-icon"},$re=["src"],tne=["src"],ene={class:"select-label"},rne={key:0,class:"dropdown-menu type-menu type-menu-grid"},nne={class:"option-grid"},ane=["onClick"],ine={key:0,class:"option-grid-title"},one={key:1,class:"option-grid-title"},sne={key:2,class:"option-grid-title"},lne={class:"option-grid-icon"},cne=["src"],une={key:1,class:"filter-separator"},dne=["onClick"],pne={class:"select-display"},hne={key:0,class:"badge-categorias"},fne={key:0,class:"dropdown-menu type-menu multi-select-menu"},mne={class:"multi-select-scroll-area"},yne={class:"select-all-checkbox"},gne=["checked","indeterminate","onChange"],vne={class:"option-checkbox"},bne=["checked","onChange"],xne=["onClick"],_ne={class:"option-title"},wne={class:"multi-select-footer"},Tne={key:1,class:"custom-radio-group filter-inline"},Sne={class:"radio-label"},kne={class:"radio-options"},Lne=["onUpdate:modelValue","disabled","name","value","onChange"],Cne={key:2,class:"check-group filter-inline"},Nne=["onUpdate:modelValue","checked"],One=["data-filter-type","onClick"],Ene={class:"select-display"},zne={key:0,class:"dropdown-menu type-menu simple-select-menu"},Mne={class:"simple-select-scroll-area"},Vne=["onMouseenter","onClick"],Pne={class:"option-content"},Ane={class:"option-title"},Rne={key:0,class:"option-checkmark"},Fne={key:4,class:"filter-separator"},Une=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(t,{expose:r,emit:n}){const y=t,$=n,f=e.ref(new Map),u=e.ref([]);let i=null,d=null,l=null;const a=e.ref(!1),S=e.ref(!1),T=e.ref(!1),b=e.ref(!1),p=e.ref(!1),s=e.ref(!1),c=e.computed(()=>u.value),o=e.ref(null),h=e.computed(()=>c.value[o.value]||null),v=e.computed(()=>{var Ge;const Je=((Ge=h.value)==null?void 0:Ge.views)||[];return U(Je)}),k=e.ref(null),L=e.computed(()=>v.value.find(Ge=>Ge.id===k.value)||null),E=e.ref([]),P=e.computed(()=>{var Ge,Je;return a.value?((Ge=L.value)==null?void 0:Ge.filters_edition_mode)||[]:((Je=L.value)==null?void 0:Je.filters)||[]});e.watch(a,Ge=>{Ge||(S.value=!1)}),e.watch(L,Ge=>{var Je,hr;if(!Ge){E.value=[];return}const Nr=Ge.id===6&&y.isPostMatch,Ir=Ge.id===14;if(!Array.isArray(P.value)&&!Nr&&!Ir){E.value=[];return}b.value||(Nr||Ir?E.value=[]:E.value=P.value.map((ln,Nn)=>{var En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn,An,ya,va,jr,wr,Wn,ha,ra;if(ln.type==="select"){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn){if(jn.selectedOptions&&Array.isArray(jn.selectedOptions))return jn.selectedOptions.map(qa=>qa.value);if(jn.selectedValue&&Array.isArray(jn.selectedValue))return jn.selectedValue.length>0&&jn.selectedValue[0]&&typeof jn.selectedValue[0]=="object"?Ye(jn.selectedValue):jn.selectedValue}}return Ge.id===4&&ln.options&&Array.isArray(ln.options)?ln.options.map(jn=>jn.value):[]}else if(ln.type==="radio-button"){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn&&jn.selectedOption){let qa=jn.selectedOption.value;if(Ge.id===15&&Nn===0&&qa===3&&((Gn=(En=d==null?void 0:d.view)==null?void 0:En.filterMultiple)==null?void 0:Gn.isHomeTeam)!==void 0){const Oa=d.view.filterMultiple.isHomeTeam;typeof Oa=="boolean"?qa=Oa?1:2:typeof Oa=="number"&&(qa=Oa===1?1:2)}if(Ge.id===8&&qa===3&&((ka=($n=d==null?void 0:d.view)==null?void 0:$n.filterMultiple)==null?void 0:ka.isHomeTeam)!==void 0){const Oa=d.view.filterMultiple.isHomeTeam;qa=(typeof Oa=="boolean"?Oa:Oa===1)?1:2}return qa}}if(Ge.id===7&&a.value&&d!=null&&d.view){if(Nn===0&&(Hr=d.view.componentProps)!=null&&Hr.analysisType)return d.view.componentProps.analysisType==="offensive"?1:2;if(Nn===1&&((Rr=d.view.filterMultiple)==null?void 0:Rr.isHomeTeam)!==void 0)return d.view.filterMultiple.isHomeTeam?1:2}return((Mn=(dn=ln.options)==null?void 0:dn[0])==null?void 0:Mn.value)??null}else if(ln.type==="select-simple"){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn&&jn.selectedValue!==void 0){let qa;return Ge.id===2&&(Un=(da=d==null?void 0:d.view)==null?void 0:da.filterMultiple)!=null&&Un.categoryId?qa=d.view.filterMultiple.categoryId:Ge.id===1&&(sn=(Xr=d==null?void 0:d.view)==null?void 0:Xr.filterMultiple)!=null&&sn.category?qa=d.view.filterMultiple.category:Ge.id===6&&(pn=(Sr=d==null?void 0:d.view)==null?void 0:Sr.filterMultiple)!=null&&pn.gameNumber?qa=d.view.filterMultiple.gameNumber:qa=Array.isArray(jn.selectedValue)?jn.selectedValue[0]:jn.selectedValue,qa}}if(Ge.id===2&&a.value&&d!=null&&d.view){if(i&&d.view.id){const jn=i.getComponentDynamicFilters(d.view.id);if(jn&&jn[Nn]!==void 0)return jn[Nn]}if(d.view.filterMultiple){if(ln.type==="select-simple"&&d.view.filterMultiple.categoryId){const jn=d.view.filterMultiple.categoryId;return(ln.options||[]).find(qa=>qa.value==jn),jn}if(ln.type==="radio-button"&&d.view.filterMultiple.teamType!==void 0){const jn=d.view.filterMultiple.teamType;return(ln.options||[]).find(qa=>qa.value==jn),jn}}}if(Ge.id===1&&a.value&&(Hn=d==null?void 0:d.view)!=null&&Hn.filterMultiple&&d.view.filterMultiple.category){const jn=d.view.filterMultiple.category;return(ln.options||[]).find(qa=>qa.value==jn),jn}if(Ge.id===9&&a.value&&(An=d==null?void 0:d.view)!=null&&An.filterMultiple&&ln.type==="select-simple"&&d.view.filterMultiple.categoryIds){const jn=Array.isArray(d.view.filterMultiple.categoryIds)?d.view.filterMultiple.categoryIds:[d.view.filterMultiple.categoryIds],qa=(ln.options||[]).filter(Oa=>Array.isArray(Oa.value)?tr(Oa.value,jn):jn.includes(Oa.value));return qa.length>0?qa[0].value:jn}if(Ge.id===6&&a.value&&(ya=d==null?void 0:d.view)!=null&&ya.filterMultiple&&d.view.filterMultiple.gameNumber){const jn=d.view.filterMultiple.gameNumber;return(ln.options||[]).find(qa=>qa.value==jn),jn}if(Ge.id===5&&a.value&&(va=d==null?void 0:d.view)!=null&&va.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const jn=d.view.filterMultiple.isHomeTeam;let qa;if(typeof jn=="boolean"?qa=jn?1:2:typeof jn=="number"?qa=jn===1?1:2:qa=1,(ln.options||[]).find(Oa=>Oa.value==qa),ln.type==="radio-button"&&(ln.label==="Equipo"||ln.label==="Team"||ln.label==="Equipo seleccionado"))return qa}if(Ge.id===15&&a.value&&(jr=d==null?void 0:d.view)!=null&&jr.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0&&ln.type==="radio-button"&&Nn===0){const jn=d.view.filterMultiple.isHomeTeam;let qa;if(typeof jn=="boolean"?qa=jn?1:2:typeof jn=="number"?qa=jn===1?1:2:qa=1,(ln.options||[]).find(Oa=>Oa.value==qa))return qa}if(Ge.id===9&&a.value&&(wr=d==null?void 0:d.view)!=null&&wr.filterMultiple&&ln.type==="radio-button"&&d.view.filterMultiple.isHomeTeam!==void 0){const jn=d.view.filterMultiple.isHomeTeam?1:2,qa=((Wn=ln.options)==null?void 0:Wn.map(Oa=>Oa.value))||[];return qa.includes(jn)?jn:qa[0]||1}return((ra=(ha=ln.options)==null?void 0:ha[0])==null?void 0:ra.value)??null}else if(ln.type==="check"){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn&&jn.isChecked!==void 0)return jn.isChecked}if(Ge.id===8)return!0;if(Ge.id===3){if(a.value&&l&&l.dynamicFilters){const jn=l.dynamicFilters[Nn];if(jn&&jn.isChecked!==void 0)return jn.isChecked}return!1}return!1}return null}),!((Je=Ge.name)!=null&&Je.toLowerCase().includes("tops players")||(hr=Ge.title)!=null&&hr.toLowerCase().includes("tops players"))&&(!a.value||Nr)&&e.nextTick(()=>{var ln,Nn;Ge.id===4&&a.value&&(ln=d==null?void 0:d.view)!=null&&ln.id&&i&&i.setDynamicFilters(E.value,d.view.id),Ge.id===3&&a.value&&(Nn=d==null?void 0:d.view)!=null&&Nn.id&&i&&i.setDynamicFilters(E.value,d.view.id),te()}))},{immediate:!0}),e.watch(()=>i,Ge=>{Ge&&Ge.dynamicFilters&&Array.isArray(Ge.dynamicFilters)&&(b.value=!0,E.value=[...Ge.dynamicFilters],e.nextTick(()=>{b.value=!1}))},{deep:!0}),e.watch(()=>i==null?void 0:i.dynamicFilters,Ge=>{if(Ge&&Array.isArray(Ge)){if(p.value)return;b.value=!0,E.value=[...Ge],e.nextTick(()=>{b.value=!1})}},{deep:!0}),e.watch(()=>L.value,Ge=>{if(a.value&&l&&Ge&&Ge.filters){if(b.value||s.value)return;if(Ge.id===3){if(p.value||s.value)return;const Je=l.dynamicFilters.find(hr=>hr.filterType==="check");Je&&Je.isChecked!==void 0&&E.value&&E.value.length>0&&(p.value=!0,E.value[0]=Je.isChecked,e.nextTick(()=>{E.value=[...E.value],p.value=!1}))}setTimeout(()=>{(!E.value||E.value.length===0)&&(Fe(),Te(),Re()),Ge.id===4&&sr()},100)}},{deep:!0}),e.watch(()=>{var Ge;return(Ge=L.value)==null?void 0:Ge.id},Ge=>{if(a.value&&l&&Ge===4){if(b.value||s.value)return;setTimeout(()=>{sr()},200)}}),e.watch(()=>E.value,Ge=>{if(a.value&&l&&Ge&&Ge.length>0){if(b.value||p.value||s.value)return;setTimeout(()=>{var Je;br()&&(Fe(),Te(),Re(),((Je=L.value)==null?void 0:Je.id)===4&&sr())},50)}},{deep:!0});function V(Ge,Je){var hr,Nr,Ir,ln,Nn;const En=E.value[Ge];if((hr=L.value)==null||hr.id,(Nr=L.value)==null||Nr.id,Array.isArray(En)){if(((Ir=L.value)==null?void 0:Ir.id)===4&&Ge===0){const Gn=En.some($n=>{if(Je.category_id&&Je.event_type_id){if($n.category_id&&$n.event_type_id)return $n.category_id===Je.category_id&&$n.event_type_id===Je.event_type_id;if($n.event_type_id&&!$n.category_id)return $n.event_type_id===Je.event_type_id;if($n.category_id&&!$n.event_type_id)return $n.category_id===Je.category_id}else{if(Je.event_type_id)return $n.event_type_id===Je.event_type_id;if(Je.category_id)return $n.category_id===Je.category_id}return JSON.stringify($n)===JSON.stringify(Je)});return(ln=L.value)==null||ln.id,Gn}return En.includes(Je)}else if(En!=null)return(Nn=L.value)==null||Nn.id,En===Je;return!1}function I(Ge,Je){var hr,Nr,Ir;const ln=(Nr=(hr=L.value)==null?void 0:hr.filters)==null?void 0:Nr[Ge];if((ln==null?void 0:ln.type)==="select-simple"){le(Ge,Je);return}Array.isArray(E.value[Ge])||(E.value[Ge]=[]);const Nn=E.value[Ge];let En=-1;((Ir=L.value)==null?void 0:Ir.id)===4&&Ge===0?En=Nn.findIndex(Gn=>Je.category_id&&Je.event_type_id?Gn.category_id===Je.category_id&&Gn.event_type_id===Je.event_type_id:Je.event_type_id?Gn.event_type_id===Je.event_type_id:Je.category_id?Gn.category_id===Je.category_id:!1):En=Nn.indexOf(Je),En>-1?Nn.splice(En,1):Nn.push(Je),a.value&&Ve(),te()}function j(Ge){var Je,hr;const Nr=E.value[Ge],Ir=(hr=(Je=L.value)==null?void 0:Je.filters)==null?void 0:hr[Ge];return(Ir==null?void 0:Ir.type)==="select-simple"||!Ir||!Ir.options||!Array.isArray(Nr)?!1:Nr.length===Ir.options.length}function F(Ge){var Je,hr;const Nr=E.value[Ge],Ir=(hr=(Je=L.value)==null?void 0:Je.filters)==null?void 0:hr[Ge];return(Ir==null?void 0:Ir.type)==="select-simple"||!Ir||!Ir.options||!Array.isArray(Nr)?!1:Nr.length>0&&Nr.length<Ir.options.length}function D(){var Ge;return!(((Ge=L.value)==null?void 0:Ge.id)===6&&y.isPostMatch)}function U(Ge){return!Ge||!Array.isArray(Ge)?Ge:Ge.filter(Je=>{const hr=(Je.name||Je.title||"").toLowerCase();return y.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(Nr=>hr.includes(Nr))})}function M(){var Ge,Je;const hr=((Je=(Ge=h.value)==null?void 0:Ge.name)==null?void 0:Je.toLowerCase())||"";return hr.includes("cancha")||hr.includes("volumétrica")||hr.includes("volumetric")}function X(Ge,Je){if(!a.value||!M())return!1;const hr=String(Ge||"").toLowerCase(),Nr=String(Je||"").toLowerCase();return hr.includes("ambos")||Nr.includes("ambos")}function O(Ge){var Je,hr;const Nr=(hr=(Je=L.value)==null?void 0:Je.filters)==null?void 0:hr[Ge];if(!Nr||!Nr.options)return;const Ir=Nr.options.map(ln=>ln.value);Array.isArray(E.value[Ge])||(E.value[Ge]=[]),j(Ge)?E.value[Ge]=[]:E.value[Ge]=[...Ir],yt.value=Ge,te()}const Y=e.ref("ambos"),st=e.ref(!1),mt=e.ref(!1),yt=e.ref(null),bt=e.ref(null);function xt(Ge,Je=!1){const hr="https://golstatsimages.blob.core.windows.net/images-library/",Nr="https://golstatsimages.blob.core.windows.net/reports-images/",Ir={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"},ln=Object.keys(Ir).find(Nn=>Ge==null?void 0:Ge.toLowerCase().includes(Nn.toLowerCase()));if(ln){const Nn=Ir[ln],En=Je?"":"-def";return ln.toLowerCase().includes("tabla")?`${Nr}${Nn}${En}@2x.png`:`${hr}${Nn}${En}@2x.png`}return`${hr}icn_default${Je?"":"-def"}.png`}function Pt(){return h.value?h.value.name:"Tipo de vista"}function qt(){return L.value?L.value.name||L.value.title:"Visualización"}function _t(){a.value||(st.value=!st.value,st.value&&(mt.value=!1,e.nextTick(()=>{$e()})))}function It(){a.value||h.value&&(mt.value=!mt.value,mt.value&&(st.value=!1))}function jt(Ge){a.value||(o.value=Ge,st.value=!1,k.value=null,te())}function Rt(Ge){var Je,hr;a.value||(k.value=Ge.id,mt.value=!1,(Je=Ge.name)!=null&&Je.toLowerCase().includes("tops players")||(hr=Ge.title)==null||hr.toLowerCase().includes("tops players"))}function Wt(Ge){var Je;yt.value=yt.value===Ge?null:Ge,((Je=L.value)==null?void 0:Je.id)===4&&a.value&&Ge===0&&setTimeout(()=>{E.value=[...E.value]},50)}function re(Ge){bt.value=bt.value===Ge?null:Ge}function le(Ge,Je){var hr,Nr,Ir,ln,Nn;if(((hr=L.value)==null?void 0:hr.id)===2){const En=P.value.findIndex(Gn=>Gn.type==="select-simple"&&Gn.label==="Tipo de análisis");Ge===En?E.value[0]=Je:E.value[Ge]=Je}else if(((Nr=L.value)==null?void 0:Nr.id)===1)E.value[0]=Je;else if(((Ir=L.value)==null?void 0:Ir.id)===6)E.value[0]=Je;else if(((ln=L.value)==null?void 0:ln.id)===9)if(Ge===0){Array.isArray(Je)?E.value[Ge]=Je:E.value[Ge]=[Je];const En=((Nn=P.value[Ge])==null?void 0:Nn.options)||[],Gn=Array.isArray(Je)?Je:[Je],$n=En.find(ka=>Array.isArray(ka.value)?tr(ka.value,Gn):Gn.includes(ka.value));$n?E.value[Ge]=$n.value:E.value[Ge]=Gn}else E.value[Ge]=Je;else E.value[Ge]=Je;bt.value=null,a.value&&Ve(),te()}function he(Ge){Ge.target.closest(".custom-select")||(st.value=!1,mt.value=!1,bt.value=null)}const de=[16,18];function Jt(){var Ge;return((Ge=L.value)==null?void 0:Ge.id)===8&&y.isPostMatch?P.value.map((Je,hr)=>({filter:Je,index:hr})).filter(({filter:Je})=>Je.type!=="radio-button").map(({index:Je})=>E.value[Je]):E.value}function te(){var Ge,Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn;if(de.includes((Ge=L.value)==null?void 0:Ge.id)||b.value)return;let An=[],ya=[];L.value&&Array.isArray(P.value)&&P.value.forEach((ra,jn)=>{if(ra.type==="select"&&ra.label==="Tipo de análisis"&&ra.id===2){const qa=E.value[jn]||[];Array.isArray(qa)&&qa.length>0&&(An=qa.map(Oa=>{var ti;const Ka=(ti=ra.options)==null?void 0:ti.find(Ra=>Ra.value===Oa);return{value:Oa,label:(Ka==null?void 0:Ka.label)||Oa}}))}});const va=((Je=L.value)==null?void 0:Je.id)===4;if(L.value&&Array.isArray(L.value.filters)&&L.value.filters.some(ra=>ra.type==="select"&&ra.label==="Tipo de análisis"&&ra.id===2)&&An.length===0&&!va)return;if(va&&E.value&&E.value.length>0){const ra=E.value[0];Array.isArray(ra)&&ra.length>0}const jr=((hr=L.value)==null?void 0:hr.id)===8&&y.isPostMatch?P.value.filter(ra=>ra.type!=="radio-button"):P.value;ya=(jr==null?void 0:jr.map((ra,jn)=>{var qa,Oa,ti,Ka;const Ra=P.value.findIndex(No=>No===ra),ki=E.value[Ra];let zi=ra.id||`filter_${jn}`;return((qa=L.value)==null?void 0:qa.id)===3&&a.value&&(Oa=d==null?void 0:d.view)!=null&&Oa.id&&(zi=`filter_${jn}_component_${d.view.id}`),{filterId:zi,filterType:ra.type,filterLabel:ra.label,filterIcon:ra.icon||null,selectedValue:ki,selectedOptions:ra.type==="select"&&Array.isArray(ki)&&ki.length>0?ki.map(No=>{var Po;const ho=(Po=ra.options)==null?void 0:Po.find(to=>to.value===No);return{value:No,label:(ho==null?void 0:ho.label)||No,icon:(ho==null?void 0:ho.icon)||null}}):null,selectedOption:ra.type==="radio-button"&&ki!=null?{value:ki,label:((Ka=(ti=ra.options)==null?void 0:ti.find(No=>No.value===ki))==null?void 0:Ka.label)||ki}:null,isChecked:ra.type==="check"?ki:null}}))||[];const wr={mainSelector:{id:((Nr=h.value)==null?void 0:Nr.id)||null,name:((Ir=h.value)==null?void 0:Ir.name)||null,url:((ln=h.value)==null?void 0:ln.url)||null},viewSelector:{id:((Nn=L.value)==null?void 0:Nn.id)||null,name:((En=L.value)==null?void 0:En.name)||((Gn=L.value)==null?void 0:Gn.title)||null,url:(($n=L.value)==null?void 0:$n.url)||null},team:Y.value,dynamicFilters:ya,categoriasSeleccionadas:An,timestamp:new Date().toISOString(),summary:{mainSelected:!!h.value,viewSelected:!!L.value,totalDynamicFilters:((ka=P.value)==null?void 0:ka.length)||0,activeFilters:((Hr=P.value)==null?void 0:Hr.filter((ra,jn)=>{const qa=E.value[jn];return Array.isArray(qa)?qa.length>0:qa!=null&&qa!==!1}).length)||0}},Wn=Jt(),ha={main:h.value,view:L.value,team:Y.value,dynamicFilters:Wn,filtersJSON:wr,filterAndViewsContainer:i,viewToEdit:d};if($("filters-changed",ha),a.value&&d){if(l=wr,((Rr=L.value)==null?void 0:Rr.id)===2){const ra=l.dynamicFilters.findIndex(jn=>jn.filterType==="select-simple"&&jn.filterLabel==="Tipo de análisis");ra!==-1&&(Mn=(dn=d.view)==null?void 0:dn.filterMultiple)!=null&&Mn.categoryId&&(l.dynamicFilters[ra].selectedValue=d.view.filterMultiple.categoryId)}if(((da=L.value)==null?void 0:da.id)===1){const ra=l.dynamicFilters.findIndex(jn=>jn.filterType==="select-simple"&&jn.filterLabel==="Tipo de análisis");ra!==-1&&(Xr=(Un=d.view)==null?void 0:Un.filterMultiple)!=null&&Xr.category&&(l.dynamicFilters[ra].selectedValue=d.view.filterMultiple.category)}}if(((sn=L.value)==null?void 0:sn.id)===6&&a.value&&(Sr=d==null?void 0:d.view)!=null&&Sr.filterMultiple&&d.view.filterMultiple.gameNumber&&l){const ra=l.dynamicFilters.findIndex(jn=>jn.filterType==="select-simple"&&jn.filterLabel==="Número de juego");ra!==-1&&(Hn=(pn=d.view)==null?void 0:pn.filterMultiple)!=null&&Hn.gameNumber&&(l.dynamicFilters[ra].selectedValue=d.view.filterMultiple.gameNumber)}i&&!a.value?i.setDynamicFilters(E.value):i&&a.value}function ne(){d=null,l=null,i=null,o.value=null,k.value=null,Y.value="ambos",E.value=[],st.value=!1,mt.value=!1,yt.value=null,bt.value=null,a.value=!1,S.value=!1,T.value=!1}function Le(Ge){if(Ge&&Ge.dynamicFilters){if(p.value)return;Array.isArray(Ge.dynamicFilters)&&Ge.dynamicFilters.length>0&&(b.value=!0,E.value=[...Ge.dynamicFilters],e.nextTick(()=>{b.value=!1}))}}function Oe(Ge){if(a.value=!0,Ge.mainSelector&&Ge.mainSelector.id){const Je=u.value.findIndex(hr=>hr.id===Ge.mainSelector.id);Je!==-1&&(o.value=Je)}Ge.viewSelector&&Ge.viewSelector.id&&h.value&&h.value.views.findIndex(Je=>Je.id===Ge.viewSelector.id)!==-1&&(k.value=Ge.viewSelector.id),Ge.dynamicFilters&&Array.isArray(Ge.dynamicFilters)&&e.nextTick(()=>{setTimeout(()=>{var Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn,An,ya;if(L.value&&P.value){if(b.value)return;if(p.value=!0,Ge.dynamicFilters.forEach((va,jr)=>{var wr,Wn,ha,ra,jn,qa,Oa,ti,Ka,Ra,ki,zi,No;if(jr<P.value.length){const Po=P.value[jr];if(((wr=L.value)==null?void 0:wr.id)===3&&a.value,Po.type==="check"){const ho=va.isChecked;typeof ho=="boolean"&&(E.value[jr]=ho)}else if(Po.type==="select"&&va.selectedOptions){const ho=va.selectedOptions.map(to=>to.value);E.value[jr]=ho}else if(Po.type==="select"&&va.selectedValue&&Array.isArray(va.selectedValue))if(va.selectedValue.length>0&&va.selectedValue[0]&&typeof va.selectedValue[0]=="object"){const ho=Ye(va.selectedValue);E.value[jr]=ho}else E.value[jr]=va.selectedValue;else if(Po.type==="radio-button"&&va.selectedOption)E.value[jr]=va.selectedOption.value;else if(Po.type==="select-simple"&&va.selectedValue!==void 0){let ho;((Wn=L.value)==null?void 0:Wn.id)===2&&(ra=(ha=d==null?void 0:d.view)==null?void 0:ha.filterMultiple)!=null&&ra.categoryId?ho=d.view.filterMultiple.categoryId:((jn=L.value)==null?void 0:jn.id)===1&&(Oa=(qa=d==null?void 0:d.view)==null?void 0:qa.filterMultiple)!=null&&Oa.category?ho=d.view.filterMultiple.category:((ti=L.value)==null?void 0:ti.id)===6&&(Ra=(Ka=d==null?void 0:d.view)==null?void 0:Ka.filterMultiple)!=null&&Ra.gameNumber?ho=d.view.filterMultiple.gameNumber:((ki=L.value)==null?void 0:ki.id)===9&&(No=(zi=d==null?void 0:d.view)==null?void 0:zi.filterMultiple)!=null&&No.categoryIds?ho=d.view.filterMultiple.categoryIds:ho=Array.isArray(va.selectedValue)?va.selectedValue[0]:va.selectedValue,E.value[jr]=ho}}}),((Je=L.value)==null?void 0:Je.id)===3&&a.value,((hr=L.value)==null?void 0:hr.id)===2&&a.value&&(Nr=d==null?void 0:d.view)!=null&&Nr.filterMultiple){if(d.view.filterMultiple.categoryId){const va=P.value.findIndex(jr=>jr.type==="select-simple"&&jr.label==="Tipo de análisis");if(va!==-1){const jr=d.view.filterMultiple.categoryId;if(E.value[0]=jr,d.view.componentProps&&jr){let wr=`Category ${jr}`,Wn=null;try{Wn=R4(jr),Wn&&(wr=Wn.name)}catch{const ha=P.value.findIndex(ra=>ra.type==="select-simple"&&ra.label==="Tipo de análisis");if(ha!==-1){const ra=(((Ir=P.value[ha])==null?void 0:Ir.options)||[]).find(jn=>jn.value==jr);ra&&(wr=ra.label)}}d.view.componentProps.categoryView=[{id:jr,name:wr}]}(((ln=P.value[va])==null?void 0:ln.options)||[]).find(wr=>wr.value==jr),e.nextTick(()=>{E.value=[...E.value]})}}if(d.view.filterMultiple.teamType!==void 0){const va=P.value.findIndex(jr=>jr.type==="radio-button");if(va!==-1){const jr=d.view.filterMultiple.teamType;E.value[va]=jr,(((Nn=P.value[va])==null?void 0:Nn.options)||[]).find(wr=>wr.value==jr),e.nextTick(()=>{E.value=[...E.value]})}}}if(((En=L.value)==null?void 0:En.id)===9&&a.value&&(Gn=d==null?void 0:d.view)!=null&&Gn.filterMultiple){if(d.view.filterMultiple.categoryIds){const va=P.value.findIndex(jr=>jr.type==="select-simple");if(va!==-1){const jr=Array.isArray(d.view.filterMultiple.categoryIds)?d.view.filterMultiple.categoryIds:[d.view.filterMultiple.categoryIds];E.value[0]=jr;const wr=((($n=P.value[va])==null?void 0:$n.options)||[]).filter(ha=>Array.isArray(ha.value)?tr(ha.value,jr):jr.includes(ha.value));if(wr.length>0){const ha=wr[0].value;E.value[va]=ha}else E.value[va]=jr;const Wn=E.value[va];tr(Wn,jr),e.nextTick(()=>{E.value=[...E.value]})}}if(d.view.filterMultiple.isHomeTeam!==void 0){const va=P.value.findIndex(jr=>jr.type==="radio-button");if(va!==-1){const jr=d.view.filterMultiple.isHomeTeam;let wr;typeof jr=="boolean"?wr=jr?1:2:typeof jr=="number"?wr=jr===1?1:2:wr=1,E.value[va]=wr,(((ka=P.value[va])==null?void 0:ka.options)||[]).find(Wn=>Wn.value==wr),e.nextTick(()=>{E.value=[...E.value]})}}}if(((Hr=L.value)==null?void 0:Hr.id)===1&&a.value&&(Rr=d==null?void 0:d.view)!=null&&Rr.filterMultiple&&d.view.filterMultiple.category){const va=P.value.findIndex(jr=>jr.type==="select-simple"&&jr.label==="Tipo de análisis");if(va!==-1){const jr=d.view.filterMultiple.category;E.value[0]=jr,d.view.componentProps&&jr&&(d.view.componentProps.type=jr),(((dn=P.value[va])==null?void 0:dn.options)||[]).find(wr=>wr.value==jr),e.nextTick(()=>{E.value=[...E.value]})}}if(((Mn=L.value)==null?void 0:Mn.id)===6&&a.value&&(da=d==null?void 0:d.view)!=null&&da.filterMultiple&&d.view.filterMultiple.gameNumber){const va=P.value.findIndex(jr=>jr.type==="select-simple"&&jr.label==="Número de juego");if(va!==-1){const jr=d.view.filterMultiple.gameNumber;E.value[0]=jr,d.view.componentProps&&jr&&(d.view.componentProps.gameNumber=jr),(((Un=P.value[va])==null?void 0:Un.options)||[]).find(wr=>wr.value==jr),e.nextTick(()=>{E.value=[...E.value]})}}if(((Xr=L.value)==null?void 0:Xr.id)===7&&a.value&&d!=null&&d.view){if((sn=d.view.componentProps)!=null&&sn.analysisType&&P.value.length>0&&((Sr=P.value[0])==null?void 0:Sr.type)==="radio-button"){const va=d.view.componentProps.analysisType==="offensive"?1:2;E.value[0]=va}if(((pn=d.view.filterMultiple)==null?void 0:pn.isHomeTeam)!==void 0){const va=P.value.findIndex(jr=>jr.type==="radio-button"&&jr.label==="Equipo");if(va!==-1){const jr=d.view.filterMultiple.isHomeTeam?1:2;E.value[1]=jr}else if(P.value.length>1&&((Hn=P.value[1])==null?void 0:Hn.type)==="radio-button"){const jr=d.view.filterMultiple.isHomeTeam,wr=jr?1:2;E.value[1]=wr,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=jr),(((An=P.value[1])==null?void 0:An.options)||[]).find(Wn=>Wn.value==wr),e.nextTick(()=>{E.value=[...E.value]})}if(va!==-1&&d.view.componentProps){const jr=d.view.filterMultiple.isHomeTeam,wr=jr?1:2;d.view.componentProps.isHomeTeamForAnalysis=jr,(((ya=P.value[va])==null?void 0:ya.options)||[]).find(Wn=>Wn.value==wr),e.nextTick(()=>{E.value=[...E.value]})}}}e.nextTick(()=>{p.value=!1})}},100)})}function Ne(){var Ge,Je,hr,Nr,Ir,ln,Nn,En,Gn,$n;return{mainSelector:{id:((Ge=h.value)==null?void 0:Ge.id)||null,name:((Je=h.value)==null?void 0:Je.name)||null,url:((hr=h.value)==null?void 0:hr.url)||null},viewSelector:{id:((Nr=L.value)==null?void 0:Nr.id)||null,name:((Ir=L.value)==null?void 0:Ir.name)||((ln=L.value)==null?void 0:ln.title)||null,url:((Nn=L.value)==null?void 0:Nn.url)||null},team:Y.value,dynamicFilters:((En=P.value)==null?void 0:En.map((ka,Hr)=>{var Rr,dn;const Mn=E.value[Hr];return{filterId:ka.id||`filter_${Hr}`,filterType:ka.type,filterLabel:ka.label,filterIcon:ka.icon||null,selectedValue:Mn,selectedOptions:ka.type==="select"&&Array.isArray(Mn)&&Mn.length>0?Mn.map(da=>{var Un;const Xr=(Un=ka.options)==null?void 0:Un.find(sn=>sn.value===da);return{value:da,label:(Xr==null?void 0:Xr.label)||da,icon:(Xr==null?void 0:Xr.icon)||null}}):null,selectedOption:ka.type==="radio-button"&&Mn?{value:Mn,label:((dn=(Rr=ka.options)==null?void 0:Rr.find(da=>da.value===Mn))==null?void 0:dn.label)||Mn}:null,isChecked:ka.type==="check"?Mn:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!h.value,viewSelected:!!L.value,totalDynamicFilters:((Gn=P.value)==null?void 0:Gn.length)||0,activeFilters:(($n=P.value)==null?void 0:$n.filter((ka,Hr)=>{const Rr=E.value[Hr];return Array.isArray(Rr)?Rr.length>0:Rr!=null&&Rr!==!1}).length)||0}}}r({getCurrentFiltersJSON:Ne});function Pe(){ne(),$("close",i)}function Xe(){S.value=!1,Pe()}function He(){T.value&&(Sd.emit("filters-cancelled",i),T.value=!1),S.value=!1,Pe()}e.onMounted(async()=>{document.addEventListener("click",he),e.nextTick(()=>{$e()});const Ge="https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/views";try{const Je=await(await fetch(Ge,{headers:{Authorization:`${y.token}`}})).json();u.value=Je.data||[],f.value.clear(),u.value&&(f.value=u.value.reduce((hr,Nr)=>(Nr.views&&Array.isArray(Nr.views)&&Nr.views.forEach(Ir=>{Ir.filters&&Array.isArray(Ir.filters)&&hr.set(Ir.id,Ir)}),hr),new Map))}catch(Je){console.error("Error al obtener datos:",Je)}});function $e(){document.querySelectorAll(".field-menu .option-card").forEach(Ge=>{const Je=Ge.querySelector(".option-img");if(!Je||!Je.dataset.hoverSrc)return;const hr=Je.src,Nr=Je.dataset.hoverSrc;Ge.addEventListener("mouseenter",()=>{Je.src=Nr}),Ge.addEventListener("mouseleave",()=>{Je.src=hr})})}e.onUnmounted(()=>{document.removeEventListener("click",he)}),Sd.on("set-filter-and-views-container",Ge=>{i=Ge,Ge&&Le(Ge)}),Sd.on("view-added",()=>{S.value=!0,T.value=!0}),Sd.on("component-added-to-container",Ge=>{(!a.value||i&&Ge.id===i.id)&&Le(Ge)}),Sd.on("edit-view",Ge=>{var Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn,An,ya;console.log("on edit-view event received for view:",Ge),d=Ge,i=((Je=Ge.view)==null?void 0:Je.filterAndViewsContainer)||null,l=null;const va=[(Nr=(hr=Ge.view)==null?void 0:hr.coreView)==null?void 0:Nr.filtersJSON,(Ir=Ge.view)==null?void 0:Ir.filtersJSON,(ln=Ge.coreView)==null?void 0:ln.filtersJSON,Ge.filtersJSON,(En=(Nn=Ge.view)==null?void 0:Nn.componentProps)==null?void 0:En.filtersJSON];for(const jr of va)if(jr){l=jr;break}if(i&&(i.viewId===4||i.viewId===8||i.viewId===3||i.viewId===1||i.viewId===2||i.viewId===13)&&(Gn=Ge.view)!=null&&Gn.id){const jr=i.getComponentDynamicFilters(Ge.view.id);if(jr){let wr="Unknown";i.viewId===4?wr="Timeline":i.viewId===8?wr="FieldPosesion":i.viewId===3?wr="GSCMatchSummary":i.viewId===1?wr="GSCComparativeReports":i.viewId===2?wr="GscTopPlayer":i.viewId===13&&(wr="GSCTimelapseTable"),l&&(i.viewId===13?l={...l,dynamicFilters:jr}:l={...l,dynamicFilters:jr.map((Wn,ha)=>{var ra,jn;if(Array.isArray(Wn))return{selectedValue:Wn,selectedOptions:Wn.map(qa=>({value:qa,label:qa}))};if(typeof Wn=="boolean")return{isChecked:Wn};if(wr==="GSCComparativeReports"&&ha===0)return{selectedValue:Wn,selectedOptions:[{value:Wn,label:Wn}]};if(wr==="GscTopPlayer"&&ha===0)return{selectedValue:Wn,selectedOptions:[{value:Wn,label:Wn}]};if(wr==="GscTopPlayer"&&ha===1)return{selectedOption:{value:Wn,label:Wn}};if(wr==="FieldPosesion"&&ha===1){const qa=(jn=(ra=Ge.view)==null?void 0:ra.filterMultiple)==null?void 0:jn.isHomeTeam,Oa=Wn===3&&qa!==void 0?(typeof qa=="boolean"?qa:qa===1)?1:2:Wn,ti=Oa===1?"Mi equipo":Oa===2?"Rival":Oa===3?"Ambos":String(Oa);return{selectedOption:{value:Oa,label:ti}}}else return{selectedOption:{value:Wn,label:Wn}}})})}}if(i&&i.viewId===2&&($n=Ge.view)!=null&&$n.filterMultiple){if(Ge.view.filterMultiple.categoryId&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="select-simple"&&wr.filterLabel==="Tipo de análisis");jr!==-1&&(l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:Ge.view.filterMultiple.categoryId,selectedOptions:[{value:Ge.view.filterMultiple.categoryId,label:`Category ${Ge.view.filterMultiple.categoryId}`}]})}if(Ge.view.filterMultiple.teamType!==void 0&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(jr!==-1){const wr=Ge.view.filterMultiple.teamType,Wn=wr===1?"Mi equipo":wr===2?"Rival":wr===3?"Ambos":"Equipo";l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:wr,label:Wn}}}}}if(i&&i.viewId===1&&(ka=Ge.view)!=null&&ka.filterMultiple&&Ge.view.filterMultiple.category&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="select-simple"&&wr.filterLabel==="Tipo de análisis");jr!==-1&&(l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:Ge.view.filterMultiple.category,selectedOptions:[{value:Ge.view.filterMultiple.category,label:Ge.view.filterMultiple.category}]})}if(i&&i.viewId===9&&(Hr=Ge.view)!=null&&Hr.filterMultiple){if(Ge.view.filterMultiple.categoryIds&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="select"&&wr.filterLabel==="Tipo de análisis");if(jr!==-1){const wr=Array.isArray(Ge.view.filterMultiple.categoryIds)?Ge.view.filterMultiple.categoryIds:[Ge.view.filterMultiple.categoryIds];l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:wr,selectedOptions:wr.map(ra=>({value:ra,label:`Category ${ra}`}))};const Wn=Ge.view.filterMultiple.categoryIds;tr(Wn,wr);const ha=(((Rr=P.value[jr])==null?void 0:Rr.options)||[]).filter(ra=>Array.isArray(ra.value)?tr(ra.value,wr):wr.includes(ra.value));if(ha.length>0){const ra=ha[0];l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:ra.value,selectedOptions:[ra]}}}}if(Ge.view.filterMultiple.isHomeTeam!==void 0&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(jr!==-1){const wr=Ge.view.filterMultiple.isHomeTeam;let Wn,ha;typeof wr=="boolean"?(Wn=wr?1:2,ha=wr?"Mi equipo":"Rival"):typeof wr=="number"?(Wn=wr===1?1:2,ha=wr===1?"Mi equipo":"Rival"):(Wn=1,ha="Mi equipo"),l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:Wn,label:ha}}}}}if(i&&i.viewId===6&&(dn=Ge.view)!=null&&dn.filterMultiple&&Ge.view.filterMultiple.gameNumber&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="select-simple"&&wr.filterLabel==="Número de juego");jr!==-1&&(l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedValue:Ge.view.filterMultiple.gameNumber,selectedOptions:[{value:Ge.view.filterMultiple.gameNumber,label:`Juego ${Ge.view.filterMultiple.gameNumber}`}]})}if(i&&i.viewId===7&&Ge.view&&l){if((Mn=Ge.view.componentProps)!=null&&Mn.analysisType){const jr=l.dynamicFilters.findIndex((wr,Wn)=>wr.filterType==="radio-button"&&Wn===0);if(jr!==-1){const wr=Ge.view.componentProps.analysisType,Wn=wr==="offensive"?1:2,ha=wr==="offensive"?"A favor":"En contra";l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:Wn,label:ha}}}}if(((da=Ge.view.filterMultiple)==null?void 0:da.isHomeTeam)!==void 0){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button"&&wr.filterLabel==="Equipo");if(jr!==-1){const wr=Ge.view.filterMultiple.isHomeTeam,Wn=wr?1:2,ha=wr?"Equipo propio":"Equipo rival";l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:Wn,label:ha}}}}}if(i&&i.viewId===10&&(Un=Ge.view)!=null&&Un.filterMultiple&&((sn=(Xr=d==null?void 0:d.view)==null?void 0:Xr.coreView)==null?void 0:sn.id)===10){const jr=Ge.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:jr})}if(i&&i.viewId===15&&(Sr=Ge.view)!=null&&Sr.id){const jr=i.getComponentDynamicFilters(Ge.view.id);if(jr&&l)l={...l,dynamicFilters:jr.map((wr,Wn)=>{var ha,ra;if(Wn===0){let jn=wr;if(wr===3&&((ra=(ha=Ge.view)==null?void 0:ha.filterMultiple)==null?void 0:ra.isHomeTeam)!==void 0){const qa=Ge.view.filterMultiple.isHomeTeam;typeof qa=="boolean"?jn=qa?1:2:typeof qa=="number"&&(jn=qa===1?1:2)}return{selectedOption:{value:jn,label:jn===1?"Mi equipo":"Rival"}}}else if(Wn===1)return{selectedValue:wr,selectedOptions:[{value:wr,label:`${wr} fortalezas`}]};return typeof wr=="number"?{selectedValue:wr}:{selectedOption:{value:wr,label:String(wr)}}})};else if((pn=Ge.view)!=null&&pn.filterMultiple&&l&&Ge.view.filterMultiple.isHomeTeam!==void 0){const wr=l.dynamicFilters.findIndex(Wn=>Wn.filterType==="radio-button"&&Wn.filterLabel==="Mi equipo");if(wr!==-1){const Wn=Ge.view.filterMultiple.isHomeTeam;let ha,ra;typeof Wn=="boolean"?(ha=Wn?1:2,ra=Wn?"Local":"Visitante"):typeof Wn=="number"?(ha=Wn===1?1:2,ra=Wn===1?"Local":"Visitante"):(ha=1,ra="Local"),l.dynamicFilters[wr]={...l.dynamicFilters[wr],selectedOption:{value:ha,label:ra}}}}}if(i&&i.viewId===17&&(Hn=Ge.view)!=null&&Hn.id){const jr=i.getComponentDynamicFilters(Ge.view.id);if(jr&&l)l={...l,dynamicFilters:jr.map((wr,Wn)=>{var ha,ra,jn,qa,Oa,ti;const Ka=(ha=P.value)==null?void 0:ha[Wn];if(Ka&&Ka.type==="radio-button"){let Ra=wr;if(wr===3&&((jn=(ra=Ge.view)==null?void 0:ra.filterMultiple)==null?void 0:jn.isHomeTeam)!==void 0){const ki=Ge.view.filterMultiple.isHomeTeam;typeof ki=="boolean"?Ra=ki?1:2:typeof ki=="number"&&(Ra=ki===1?1:2)}return{selectedOption:{value:Ra,label:Ra===1?"Mi equipo":Ra===2?"Rival":"Ambos"}}}else if(Wn===2){let Ra=wr;if((wr===3||wr!==1&&wr!==2&&(qa=Ge.view)!=null&&qa.filterMultiple)&&((ti=(Oa=Ge.view)==null?void 0:Oa.filterMultiple)==null?void 0:ti.isHomeTeam)!==void 0){const ki=Ge.view.filterMultiple.isHomeTeam;typeof ki=="boolean"?Ra=ki?1:2:typeof ki=="number"&&(Ra=ki===1?1:2)}return Ka&&Ka.type==="select-simple"?{selectedValue:Ra,selectedOptions:[{value:Ra,label:String(Ra)}]}:Ka&&Ka.type==="radio-button"?{selectedOption:{value:Ra,label:Ra===1?"Mi equipo":Ra===2?"Rival":"Ambos"}}:typeof Ra=="number"?{selectedValue:Ra}:{selectedOption:{value:Ra,label:String(Ra)}}}else{if(Ka&&Ka.type==="switch")return typeof wr=="boolean"?{selectedValue:wr}:{selectedValue:wr};if(Ka&&Ka.type==="check")return typeof wr=="boolean"?{selectedValue:wr}:{selectedValue:wr}}return Array.isArray(wr)?{selectedValue:wr,selectedOptions:wr.map(Ra=>({value:Ra,label:String(Ra)}))}:typeof wr=="boolean"?{selectedValue:wr}:typeof wr=="object"&&wr!==null?wr:typeof wr=="number"?{selectedValue:wr}:{selectedOption:{value:wr,label:String(wr)}}})};else if((An=Ge.view)!=null&&An.filterMultiple&&l&&Ge.view.filterMultiple.isHomeTeam!==void 0){const wr=l.dynamicFilters.findIndex(Wn=>Wn.filterType==="radio-button");if(wr!==-1){const Wn=Ge.view.filterMultiple.isHomeTeam;let ha,ra;typeof Wn=="boolean"?(ha=Wn?1:2,ra=Wn?"Mi equipo":"Rival"):typeof Wn=="number"?(ha=Wn===1?1:2,ra=Wn===1?"Mi equipo":"Rival"):(ha=1,ra="Mi equipo"),l.dynamicFilters[wr]={...l.dynamicFilters[wr],selectedOption:{value:ha,label:ra}}}}}if(i&&i.viewId===5&&(ya=Ge.view)!=null&&ya.filterMultiple&&Ge.view.filterMultiple.isHomeTeam!==void 0&&l){const jr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button"&&wr.filterLabel==="Equipo");if(jr!==-1){const wr=Ge.view.filterMultiple.isHomeTeam;let Wn,ha;typeof wr=="boolean"?(Wn=wr?1:2,ha=wr?"Equipo propio":"Equipo rival"):typeof wr=="number"?(Wn=wr===1?1:2,ha=wr===1?"Equipo propio":"Equipo rival"):(Wn=1,ha="Equipo propio"),l.dynamicFilters[jr]={...l.dynamicFilters[jr],selectedOption:{value:Wn,label:ha}}}else{const wr=l.dynamicFilters.findIndex(Wn=>Wn.filterType==="radio-button");if(wr!==-1){const Wn=Ge.view.filterMultiple.isHomeTeam;let ha,ra;typeof Wn=="boolean"?(ha=Wn?1:2,ra=Wn?"Equipo propio":"Equipo rival"):typeof Wn=="number"?(ha=Wn===1?1:2,ra=Wn===1?"Equipo propio":"Equipo rival"):(ha=1,ra="Equipo propio"),l.dynamicFilters[wr]={...l.dynamicFilters[wr],selectedOption:{value:ha,label:ra}}}}}l&&Oe(l),S.value=!0});function ir(){yt.value=null}function pr(Ge,Je){var hr;(hr=L.value)==null||hr.id}function tr(Ge,Je){if(!Array.isArray(Ge)||!Array.isArray(Je)||Ge.length!==Je.length)return!1;const hr=[...Ge].sort((Ir,ln)=>Ir-ln),Nr=[...Je].sort((Ir,ln)=>Ir-ln);return JSON.stringify(hr)===JSON.stringify(Nr)}function Fe(){if(a.value&&l&&l.dynamicFilters){if(s.value||b.value)return;s.value=!0,p.value=!0,l.dynamicFilters.forEach((Ge,Je)=>{var hr;if(Ge&&(hr=P.value)!=null&&hr[Je]){const Nr=P.value[Je];if(Nr.type==="check"&&Ge.isChecked!==void 0)E.value[Je]=Ge.isChecked;else if(Nr.type==="select"&&Ge.selectedOptions){const Ir=Ge.selectedOptions.map(ln=>ln.value);E.value[Je]=Ir}else Nr.type==="select"&&Ge.selectedValue&&Array.isArray(Ge.selectedValue)&&(E.value[Je]=Ge.selectedValue)}}),e.nextTick(()=>{p.value=!1,s.value=!1})}}function sr(){var Ge;if(a.value&&l&&l.dynamicFilters&&((Ge=L.value)==null?void 0:Ge.id)===4){if(s.value||b.value)return;s.value=!0,p.value=!0,l.dynamicFilters.forEach((Je,hr)=>{var Nr,Ir;if(Je&&((Ir=(Nr=P.value)==null?void 0:Nr[hr])==null?void 0:Ir.type)==="select"){if(Je.selectedOptions){const ln=Je.selectedOptions.map(Nn=>Nn.value);E.value[hr]=ln}else if(Je.selectedValue&&Array.isArray(Je.selectedValue))if(Je.selectedValue.length>0&&Je.selectedValue[0]&&typeof Je.selectedValue[0]=="object"){const ln=Ye(Je.selectedValue);E.value[hr]=ln}else E.value[hr]=Je.selectedValue}}),setTimeout(()=>{var Je;if(E.value=[...E.value],(Je=d==null?void 0:d.view)!=null&&Je.componentProps&&E.value&&E.value.length>0){const hr=E.value[0];if(Array.isArray(hr)&&hr.length>0){const Nr=hr.some(En=>En.event_type_id===1||typeof En=="string"&&En.includes("1")),Ir=hr.some(En=>En.category_id===8||typeof En=="string"&&En.includes("8")),ln=hr.some(En=>En.category_id===9||typeof En=="string"&&En.includes("9")),Nn=hr.some(En=>En.event_type_id===3||typeof En=="string"&&En.includes("3"));d.view.componentProps.selectedEvents=hr,d.view.componentProps.goals=Nr,d.view.componentProps.yellowCards=Ir,d.view.componentProps.redCards=ln,d.view.componentProps.substitutions=Nn,d.view.componentProps.key=hr.length>0,d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}},200),e.nextTick(()=>{p.value=!1,s.value=!1})}}function Ye(Ge){return!Array.isArray(Ge)||Ge.length===0?[]:Ge.map(Je=>{if(Je&&typeof Je=="object"){if(Je.event_type_id!==void 0||Je.category_id!==void 0)return{event_type_id:Je.event_type_id,category_id:Je.category_id,...Je.name&&{name:Je.name},...Je.label&&{label:Je.label}};if(Je.value&&typeof Je.value=="object")return{event_type_id:Je.value.event_type_id,category_id:Je.value.category_id,...Je.value.name&&{name:Je.value.name},...Je.value.label&&{label:Je.value.label}};if(typeof Je=="string"&&Je.includes("-")){const[hr,Nr]=Je.split("-");return{category_id:parseInt(hr),event_type_id:parseInt(Nr)}}}if(typeof Je=="string")if(Je.includes("-")){const[hr,Nr]=Je.split("-");return{category_id:parseInt(hr),event_type_id:parseInt(Nr)}}else{const hr=parseInt(Je);if(!isNaN(hr))return{event_type_id:hr}}return Je})}function Te(){var Ge,Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da;if(a.value&&l&&l.dynamicFilters&&P.value){if(s.value||b.value)return;if(s.value=!0,p.value=!0,l.dynamicFilters.forEach((Un,Xr)=>{var sn,Sr,pn,Hn,An,ya,va,jr,wr,Wn,ha;if(Un&&((sn=P.value[Xr])==null?void 0:sn.type)==="select"){if(Un.selectedOptions){const ra=Un.selectedOptions.map(jn=>jn.value);E.value[Xr]=ra}else if(Un.selectedValue&&Array.isArray(Un.selectedValue))if(Un.selectedValue.length>0&&Un.selectedValue[0]&&typeof Un.selectedValue[0]=="object"){const ra=Ye(Un.selectedValue);E.value[Xr]=ra}else E.value[Xr]=Un.selectedValue}else if(Un&&((Sr=P.value[Xr])==null?void 0:Sr.type)==="select-simple"&&Un.selectedValue!==void 0){let ra;((pn=L.value)==null?void 0:pn.id)===2&&(An=(Hn=d==null?void 0:d.view)==null?void 0:Hn.filterMultiple)!=null&&An.categoryId?ra=d.view.filterMultiple.categoryId:((ya=L.value)==null?void 0:ya.id)===1&&(jr=(va=d==null?void 0:d.view)==null?void 0:va.filterMultiple)!=null&&jr.category?ra=d.view.filterMultiple.category:((wr=L.value)==null?void 0:wr.id)===6&&(ha=(Wn=d==null?void 0:d.view)==null?void 0:Wn.filterMultiple)!=null&&ha.gameNumber?ra=d.view.filterMultiple.gameNumber:ra=Array.isArray(Un.selectedValue)?Un.selectedValue[0]:Un.selectedValue,E.value[Xr]=ra}}),((Ge=L.value)==null?void 0:Ge.id)===4&&setTimeout(()=>{var Un;if(E.value=[...E.value],(Un=d==null?void 0:d.view)!=null&&Un.componentProps&&E.value&&E.value.length>0){const Xr=E.value[0];if(Array.isArray(Xr)&&Xr.length>0){const sn=Xr.some(An=>An.event_type_id===1||typeof An=="string"&&An.includes("1")),Sr=Xr.some(An=>An.category_id===8||typeof An=="string"&&An.includes("8")),pn=Xr.some(An=>An.category_id===9||typeof An=="string"&&An.includes("9")),Hn=Xr.some(An=>An.event_type_id===3||typeof An=="string"&&An.includes("3"));d.view.componentProps.selectedEvents=Xr,d.view.componentProps.goals=sn,d.view.componentProps.yellowCards=Sr,d.view.componentProps.redCards=pn,d.view.componentProps.substitutions=Hn,d.view.componentProps.key=Xr.length>0,d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}},100),((Je=L.value)==null?void 0:Je.id)===2&&(hr=d==null?void 0:d.view)!=null&&hr.filterMultiple){if(d.view.filterMultiple.categoryId){const Un=P.value.findIndex(Xr=>Xr.type==="select-simple"&&Xr.label==="Tipo de análisis");if(Un!==-1){const Xr=d.view.filterMultiple.categoryId;if(E.value[0]=Xr,d.view.componentProps&&Xr){let sn=`Category ${Xr}`,Sr=null;try{Sr=R4(Xr),Sr&&(sn=Sr.name)}catch{const pn=P.value.findIndex(Hn=>Hn.type==="select-simple"&&Hn.label==="Tipo de análisis");if(pn!==-1){const Hn=(((Nr=P.value[pn])==null?void 0:Nr.options)||[]).find(An=>An.value==Xr);Hn&&(sn=Hn.label)}}d.view.componentProps.categoryView=[{id:Xr,name:sn}]}(((Ir=P.value[Un])==null?void 0:Ir.options)||[]).find(sn=>sn.value==Xr),e.nextTick(()=>{E.value=[...E.value]})}}if(d.view.filterMultiple.teamType!==void 0){const Un=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Un!==-1){const Xr=d.view.filterMultiple.teamType;E.value[Un]=Xr,(((ln=P.value[Un])==null?void 0:ln.options)||[]).find(sn=>sn.value==Xr),e.nextTick(()=>{E.value=[...E.value]})}}}if(((Nn=L.value)==null?void 0:Nn.id)===1&&(En=d==null?void 0:d.view)!=null&&En.filterMultiple&&d.view.filterMultiple.category&&P.value.findIndex(Un=>Un.type==="select-simple"&&Un.label==="Tipo de análisis")!==-1){const Un=d.view.filterMultiple.category;E.value[0]=Un,d.view.componentProps&&Un&&(d.view.componentProps.type=Un),e.nextTick(()=>{E.value=[...E.value]})}if(((Gn=L.value)==null?void 0:Gn.id)===6&&($n=d==null?void 0:d.view)!=null&&$n.filterMultiple&&d.view.filterMultiple.gameNumber&&P.value.findIndex(Un=>Un.type==="select-simple"&&Un.label==="Número de juego")!==-1){const Un=d.view.filterMultiple.gameNumber;E.value[0]=Un,d.view.componentProps&&Un&&(d.view.componentProps.gameNumber=Un),e.nextTick(()=>{E.value=[...E.value]})}if(((ka=L.value)==null?void 0:ka.id)===5&&(Hr=d==null?void 0:d.view)!=null&&Hr.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0)if(P.value.findIndex(Un=>Un.type==="radio-button"&&Un.label==="Equipo")!==-1){const Un=d.view.filterMultiple.isHomeTeam;let Xr;typeof Un=="boolean"?Xr=Un?1:2:typeof Un=="number"?Xr=Un===1?1:2:Xr=1,E.value[0]=Xr,d.view.componentProps&&Un!==void 0&&(d.view.componentProps.isHomeTeamForAnalysis=Un===1),e.nextTick(()=>{E.value=[...E.value]})}else{const Un=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Un!==-1){const Xr=d.view.filterMultiple.isHomeTeam;let sn;typeof Xr=="boolean"?sn=Xr?1:2:typeof Xr=="number"?sn=Xr===1?1:2:sn=1,E.value[Un]=sn,d.view.componentProps&&Xr!==void 0&&(d.view.componentProps.preMatchType=Xr),e.nextTick(()=>{E.value=[...E.value]})}}if(((Rr=L.value)==null?void 0:Rr.id)===15&&(dn=d==null?void 0:d.view)!=null&&dn.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const Un=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Un!==-1){const Xr=d.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",Xr,"type:",typeof Xr);let sn;typeof Xr=="boolean"?sn=Xr?1:2:typeof Xr=="number"?sn=Xr===1?1:2:sn=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",sn,"teamFilterIndex:",Un),E.value[Un]=sn,d.view.componentProps&&Xr!==void 0&&(d.view.componentProps.preMatchType=sn),e.nextTick(()=>{E.value=[...E.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",E.value)})}else{const Xr=P.value.findIndex(sn=>sn.type==="radio-button");if(Xr!==-1){const sn=d.view.filterMultiple.isHomeTeam;let Sr;typeof sn=="boolean"?Sr=sn?1:2:typeof sn=="number"?Sr=sn===1?1:2:Sr=1,E.value[Xr]=Sr,d.view.componentProps&&sn!==void 0&&(d.view.componentProps.preMatchType=Sr),e.nextTick(()=>{E.value=[...E.value]})}}}if(((Mn=L.value)==null?void 0:Mn.id)===17&&(da=d==null?void 0:d.view)!=null&&da.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const Un=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Un!==-1){const Xr=d.view.filterMultiple.isHomeTeam;let sn;typeof Xr=="boolean"?sn=Xr?1:2:typeof Xr=="number"?sn=Xr===1?1:2:sn=1,E.value[Un]=sn,d.view.componentProps&&Xr!==void 0&&(d.view.componentProps.teamselected=sn),e.nextTick(()=>{E.value=[...E.value]})}else{const Xr=P.value.findIndex(sn=>sn.type==="radio-button");if(Xr!==-1){const sn=d.view.filterMultiple.isHomeTeam;let Sr;typeof sn=="boolean"?Sr=sn?1:2:typeof sn=="number"?Sr=sn===1?1:2:Sr=1,E.value[Xr]=Sr,d.view.componentProps&&sn!==void 0&&(d.view.componentProps.teamselected=Sr),e.nextTick(()=>{E.value=[...E.value]})}}}e.nextTick(()=>{p.value=!1,s.value=!1})}}function Re(){if(!s.value&&a.value&&l&&l.dynamicFilters&&P.value){if(b.value)return;s.value=!0,p.value=!0,l.dynamicFilters.forEach((Ge,Je)=>{var hr;if(Ge&&((hr=P.value[Je])==null?void 0:hr.type)==="radio-button"&&Ge.selectedOption&&Ge.selectedOption.value!==void 0){const Nr=Ge.selectedOption.value;E.value[Je]=Nr}}),e.nextTick(()=>{p.value=!1,s.value=!1})}}function Ve(){var Ge,Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr,pn,Hn,An,ya,va,jr,wr,Wn,ha,ra,jn,qa,Oa,ti,Ka;if(i&&a.value&&d){if(b.value)return;if(p.value=!0,((Ge=L.value)==null?void 0:Ge.id)===4){if(i.setDynamicFilters(E.value,(Je=d.view)==null?void 0:Je.id),i.updateDynamicFilters(E.value,(hr=d.view)==null?void 0:hr.id),d.view.componentProps&&E.value&&E.value.length>0){const Ra=E.value[0];if(Array.isArray(Ra)&&Ra.length>0){const ki=Ra.some(ho=>ho.event_type_id===1||typeof ho=="string"&&ho.includes("1")),zi=Ra.some(ho=>ho.category_id===8||typeof ho=="string"&&ho.includes("8")),No=Ra.some(ho=>ho.category_id===9||typeof ho=="string"&&ho.includes("9")),Po=Ra.some(ho=>ho.event_type_id===3||typeof ho=="string"&&ho.includes("3"));d.view.componentProps.selectedEvents=Ra,d.view.componentProps.goals=ki,d.view.componentProps.yellowCards=zi,d.view.componentProps.redCards=No,d.view.componentProps.substitutions=Po,d.view.componentProps.key=Ra.length>0,d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}}else if(((Nr=L.value)==null?void 0:Nr.id)===8){const Ra=Jt();i.setDynamicFilters(Ra,(Ir=d.view)==null?void 0:Ir.id),i.updateDynamicFilters(Ra,(ln=d.view)==null?void 0:ln.id)}else if(((Nn=L.value)==null?void 0:Nn.id)===3)i.setDynamicFilters(E.value,(En=d.view)==null?void 0:En.id),i.updateDynamicFilters(E.value,(Gn=d.view)==null?void 0:Gn.id);else if((($n=L.value)==null?void 0:$n.id)===13){const Ra=(ka=d.view)==null?void 0:ka.id;i.setDynamicFilters(E.value,Ra),i.updateDynamicFilters(E.value,Ra),d.view.componentProps&&(d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps}))}else if(((Hr=L.value)==null?void 0:Hr.id)===15){const Ra=(Rr=d.view)==null?void 0:Rr.id;if(i.setDynamicFilters(E.value,Ra),i.updateDynamicFilters(E.value,Ra),d.view.componentProps){const ki=Array.isArray(E.value)&&E.value[3]!==void 0?E.value[3]:null;ki!==null&&(d.view.componentProps.numitems=ki),d.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}else if(((dn=L.value)==null?void 0:dn.id)===17){const Ra=(Mn=d==null?void 0:d.view)==null?void 0:Mn.id;i.setDynamicFilters(E.value,Ra),i.updateDynamicFilters(E.value,Ra);const ki=(zi,No)=>{if(!zi)return;const Po=E.value[0];Po!==void 0&&(zi.infavoragainstteam=!Po);const ho=E.value[1];ho!==void 0&&(zi.lateralidad=ho===32?"right":"left");const to=E.value[2];to!==void 0&&No&&(to===3||(zi.teamselected=to===2?No.away_team:No.home_team)),zi._updateKey=Date.now()};if(d&&d.view&&d.view.componentProps){const zi=d.view.componentProps.game;ki(d.view.componentProps,zi),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}else if(((da=L.value)==null?void 0:da.id)===2){i.setDynamicFilters(E.value,(Un=d.view)==null?void 0:Un.id),i.updateDynamicFilters(E.value,(Xr=d.view)==null?void 0:Xr.id);const Ra=E.value[0];if(Ra!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.categoryId,d.view.filterMultiple.categoryId=Ra,d.view.componentProps)){let zi=`Category ${Ra}`,No=null;try{No=R4(Ra),No&&(zi=No.name)}catch{const Po=P.value.findIndex(ho=>ho.type==="select-simple"&&ho.label==="Tipo de análisis");if(Po!==-1){const ho=(((sn=P.value[Po])==null?void 0:sn.options)||[]).find(to=>to.value==Ra);ho&&(zi=ho.label)}}d.view.componentProps.categoryView=[{id:Ra,name:zi}],Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple})}const ki=E.value[1];ki!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.teamType,d.view.filterMultiple.teamType=ki,d.view.componentProps&&d.view.componentProps.game&&(ki===1?d.view.componentProps.teamView=d.view.componentProps.game.homeTeam.team_id:ki===2?d.view.componentProps.teamView=d.view.componentProps.game.awayTeam.team_id:d.view.componentProps.teamView=0),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}))}else if(((Sr=L.value)==null?void 0:Sr.id)===1){i.setDynamicFilters(E.value,(pn=d.view)==null?void 0:pn.id),i.updateDynamicFilters(E.value,(Hn=d.view)==null?void 0:Hn.id);const Ra=E.value[0];Ra!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.category,d.view.filterMultiple.category=Ra,d.view.componentProps&&(d.view.componentProps.type=Ra),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}))}else if(((An=L.value)==null?void 0:An.id)===6){i.setDynamicFilters(E.value,(ya=d.view)==null?void 0:ya.id),i.updateDynamicFilters(E.value,(va=d.view)==null?void 0:va.id);const Ra=E.value[0];Ra!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.gameNumber,d.view.filterMultiple.gameNumber=Ra,d.view.componentProps&&(d.view.componentProps.gameNumber=Ra,d.view._updateKey,d.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(jr=L.value)==null?void 0:jr.id,viewId:d.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:E.value}),e.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})}))}else if(((wr=L.value)==null?void 0:wr.id)===7){i.setDynamicFilters(E.value,(Wn=d.view)==null?void 0:Wn.id),i.updateDynamicFilters(E.value,(ha=d.view)==null?void 0:ha.id);const Ra=E.value[0],ki=E.value[1];if(Ra!==void 0&&d.view.componentProps){const zi=Ra===1?"offensive":"defensive";d.view.componentProps.analysisType=zi}if(ki!==void 0){d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.isHomeTeam;const zi=ki===1;d.view.filterMultiple.isHomeTeam=zi,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=zi,d.view._updateKey,d.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(ra=L.value)==null?void 0:ra.id,viewId:d.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:E.value}),e.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}}else if(((jn=L.value)==null?void 0:jn.id)===5){i.setDynamicFilters(E.value,(qa=d.view)==null?void 0:qa.id),i.updateDynamicFilters(E.value,(Oa=d.view)==null?void 0:Oa.id);const Ra=E.value[0];if(Ra!==void 0){d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.isHomeTeam;const ki=Ra===1?1:2;d.view.filterMultiple.isHomeTeam=ki,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=ki===1,d.view._updateKey,d.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(ti=L.value)==null?void 0:ti.id,viewId:d.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:E.value}),e.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}}else((Ka=L.value)==null?void 0:Ka.id)===9||(i.setDynamicFilters(E.value),i.updateDynamicFilters(E.value));e.nextTick(()=>{p.value=!1})}}function br(){var Ge,Je;if(!l||!l.dynamicFilters||!P.value)return!1;for(let hr=0;hr<l.dynamicFilters.length;hr++){const Nr=l.dynamicFilters[hr],Ir=P.value[hr],ln=E.value[hr];if(!(!Nr||!Ir)){if(Ir.type==="check"){if(Nr.isChecked!==ln)return!0}else if(Ir.type==="radio-button"){if(((Ge=Nr.selectedOption)==null?void 0:Ge.value)!==ln)return!0}else if(Ir.type==="select"){const Nn=((Je=Nr.selectedOptions)==null?void 0:Je.map(Gn=>Gn.value))||Nr.selectedValue||[],En=Array.isArray(ln)?ln:[];if(JSON.stringify(Nn)!==JSON.stringify(En))return!0}}}return!1}function cr(Ge){var Je,hr,Nr,Ir,ln,Nn,En,Gn,$n,ka,Hr,Rr,dn,Mn,da,Un,Xr,sn,Sr;if(E.value=Ge.filters,i){const pn=((Je=d==null?void 0:d.view)==null?void 0:Je.id)||null,Hn=((hr=L.value)==null?void 0:hr.id)===8&&y.isPostMatch?Jt():E.value;i.setDynamicFilters(Hn,pn),i.updateDynamicFilters(Hn,pn)}if(a.value&&d){Sd.emit("activate-save-button"),Sd.emit("force-component-update",{itemId:((Nr=d==null?void 0:d.view)==null?void 0:Nr.id)||null,componentProps:d.view.componentProps});const pn=((Ir=L.value)==null?void 0:Ir.id)===8&&y.isPostMatch?Jt():E.value;Sd.emit("dynamic-filters-changed",{containerViewId:((ln=d==null?void 0:d.view)==null?void 0:ln.id)||null,viewId:((Nn=d==null?void 0:d.view)==null?void 0:Nn.id)||null,dynamicFilters:pn}),Sd.emit("dynamic-filters-changed",{containerViewId:((En=d==null?void 0:d.view)==null?void 0:En.id)||null,viewId:((Gn=d==null?void 0:d.view)==null?void 0:Gn.id)||null,dynamicFilters:pn}),e.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}if(!a.value&&i&&((($n=L.value)==null?void 0:$n.id)===15||((ka=L.value)==null?void 0:ka.id)===17)&&i.getRequiresAddView(E.value,P.value)){i.setDynamicFilters(E.value),$("filters-changed",{main:h.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:{mainSelector:{id:((Hr=h.value)==null?void 0:Hr.id)||null,name:((Rr=h.value)==null?void 0:Rr.name)||null,url:((dn=h.value)==null?void 0:dn.url)||null},viewSelector:{id:((Mn=L.value)==null?void 0:Mn.id)||null,name:((da=L.value)==null?void 0:da.name)||((Un=L.value)==null?void 0:Un.title)||null,url:((Xr=L.value)==null?void 0:Xr.url)||null},team:Y.value,dynamicFilters:E.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!h.value,viewSelected:!!L.value,totalDynamicFilters:((sn=P.value)==null?void 0:sn.length)||0,activeFilters:((Sr=P.value)==null?void 0:Sr.filter((pn,Hn)=>{const An=E.value[Hn];return Array.isArray(An)?An.length>0:An!=null&&An!==!1}).length)||0}},filterAndViewsContainer:i,viewToEdit:d}),te();return}Ve()}function gr(Ge){Ge.filterIndex!==void 0&&Ge.value!==void 0&&(E.value[Ge.filterIndex]=Ge.value,a.value&&Ve(),te())}function Tr(){He()}function Pr(Ge){var Je,hr,Nr,Ir,ln,Nn,En;console.log("newFilters in onChangeFiltersAltMode:",Ge);const Gn={mainSelector:{id:((Je=h.value)==null?void 0:Je.id)||null,name:((hr=h.value)==null?void 0:hr.name)||null,url:((Nr=h.value)==null?void 0:Nr.url)||null},viewSelector:{id:((Ir=L.value)==null?void 0:Ir.id)||null,name:((ln=L.value)==null?void 0:ln.name)||((Nn=L.value)==null?void 0:Nn.title)||null,url:((En=L.value)==null?void 0:En.url)||null}};$("filters-changed",{filters:Ge.filters,view:Ge.view,viewToEdit:d,filterAndViewsContainer:i,filtersJSON:Gn,isAltMode:!0})}function qe(Ge){return JSON.parse(JSON.stringify(Ge))}return(Ge,Je)=>{var hr;return e.openBlock(),e.createElementBlock("div",Rre,[e.createElementVNode("button",Fre,e.toDisplayString(a.value?"Editando visualización":"Nueva visualización"),1),e.createElementVNode("div",{class:e.normalizeClass([{disabled:a.value},"custom-select main-select"]),onClick:_t},[e.createElementVNode("div",Ure,[e.createElementVNode("span",Ire,[h.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:xt(h.value.name,!1),alt:"icono",class:"option-img"},null,8,qre)):(e.openBlock(),e.createElementBlock("img",jre))]),h.value?(e.openBlock(),e.createElementBlock("span",Wre,e.toDisplayString(Pt()),1)):(e.openBlock(),e.createElementBlock("span",Dre,"Tipo de vista")),e.createElementVNode("span",{class:e.normalizeClass([{open:st.value},"arrow"])},[...Je[5]||(Je[5]=[e.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),st.value?(e.openBlock(),e.createElementBlock("div",Bre,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(Nr,Ir)=>(e.openBlock(),e.createElementBlock("div",{key:Nr.id,class:e.normalizeClass([{active:o.value===Ir},"option-card"]),onClick:e.withModifiers(ln=>jt(Ir),["stop"])},[e.createElementVNode("div",Xre,[e.createElementVNode("img",{"data-hover-src":xt(Nr.name,!0),src:xt(Nr.name,!1),alt:"icono",class:"option-img-34"},null,8,Gre)]),e.createElementVNode("div",Zre,[e.createElementVNode("div",Jre,e.toDisplayString(Nr.name),1),Nr.description?(e.openBlock(),e.createElementBlock("div",Hre,e.toDisplayString(Nr.description),1)):e.createCommentVNode("",!0)])],10,Kre))),128))])):e.createCommentVNode("",!0)],2),h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{disabled:a.value},"custom-select second-select"]),onClick:It},[e.createElementVNode("div",Yre,[e.createElementVNode("span",Qre,[L.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:L.value.url,alt:"icono",class:"option-img-graph2"},null,8,$re)):h.value?(e.openBlock(),e.createElementBlock("img",{key:1,src:xt(h.value.name,!1),alt:"icono",class:"option-img"},null,8,tne)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ene,e.toDisplayString(qt()),1),e.createElementVNode("span",{class:e.normalizeClass([{open:mt.value},"arrow"])},[...Je[6]||(Je[6]=[e.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),mt.value&&h.value?(e.openBlock(),e.createElementBlock("div",rne,[e.createElementVNode("div",nne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,Nr=>(e.openBlock(),e.createElementBlock("div",{key:Nr.id,class:e.normalizeClass([{active:k.value===Nr.id},"option-card-grid"]),onClick:e.withModifiers(Ir=>Rt(Nr),["stop"])},[Nr.id===17?(e.openBlock(),e.createElementBlock("div",ine,[...Je[7]||(Je[7]=[e.createElementVNode("div",null,"Tiros de esquina",-1),e.createElementVNode("div",null,"tendencia general",-1)])])):Nr.id===18?(e.openBlock(),e.createElementBlock("div",one,[...Je[8]||(Je[8]=[e.createElementVNode("div",null,"Tactica fija",-1),e.createElementVNode("div",null,"jugadas especificas",-1)])])):(e.openBlock(),e.createElementBlock("div",sne,e.toDisplayString(Nr.name||Nr.title),1)),e.createElementVNode("div",lne,[e.createElementVNode("img",{src:Nr.url,alt:"icono",class:"option-img-grid"},null,8,cne)])],10,ane))),128))])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("div",une)):e.createCommentVNode("",!0),L.value&&L.value.id===13?(e.openBlock(),e.createBlock(XYt,{key:2,"component-id":13,filters:P.value,"initial-values":a.value?e.unref(l).dynamicFilters:E.value,"is-edit-mode":a.value,onFiltersChanged:cr,onFilterUpdated:gr},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===16?(e.openBlock(),e.createBlock(a$t,{key:3,"default-filters":e.unref(d)?e.unref(d).view.filterMultiple:null,"is-edit-mode":!!e.unref(d),"is-post-match":t.isPostMatch,"view-config":qe(f.value.get(16)),onChange:Pr,onRemoveViews:Tr},null,8,["default-filters","is-edit-mode","is-post-match","view-config"])):L.value&&L.value.id===18?(e.openBlock(),e.createBlock(cte,{key:4,"default-filters":e.unref(d)?e.unref(d).view.filterMultiple:null,"view-config":qe(f.value.get(18)),"is-post-match":t.isPostMatch,onChange:Pr,onRemoveViews:Tr},null,8,["default-filters","view-config","is-post-match"])):L.value&&L.value.id===15?(e.openBlock(),e.createBlock(uQt,{key:5,"component-id":15,filters:P.value,"initial-values":a.value?e.unref(l).dynamicFilters:E.value,"is-edit-mode":a.value,onFiltersChanged:cr,onFilterUpdated:gr},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===17?(e.openBlock(),e.createBlock(Are,{key:6,"component-id":17,"default-filters":e.unref(d)?e.unref(d).view.filterMultiple:null,filters:P.value,"initial-values":a.value?e.unref(l).dynamicFilters:E.value,"is-edit-mode":a.value,"view-config":qe(f.value.get(17)),onChange:Pr,onFiltersChanged:cr,onFilterUpdated:gr,onRemoveViews:Tr},null,8,["default-filters","filters","initial-values","is-edit-mode","view-config"])):L.value&&P.value&&D()?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":P.value.length>=2&&!(((hr=L.value)==null?void 0:hr.id)===8&&t.isPostMatch)}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(Nr,Ir)=>{var ln;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Ir},[Nr.type==="select"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:e.withModifiers(Nn=>Wt(Ir),["stop"])},[e.createElementVNode("div",pne,[Je[10]||(Je[10]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Je[11]||(Je[11]=e.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(E.value[Ir])&&E.value[Ir].length>0?(e.openBlock(),e.createElementBlock("span",hne,e.toDisplayString(E.value[Ir].length),1)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass([{open:yt.value===Ir},"arrow"])},[...Je[9]||(Je[9]=[e.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),yt.value===Ir?(e.openBlock(),e.createElementBlock("div",fne,[e.createElementVNode("div",mne,[e.createElementVNode("div",{class:"multi-select-header",onClick:Je[1]||(Je[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",yne,[e.createElementVNode("input",{checked:j(Ir),indeterminate:F(Ir),type:"checkbox",onChange:e.withModifiers(Nn=>O(Ir),["stop"]),onClick:Je[0]||(Je[0]=e.withModifiers(()=>{},["stop"]))},null,40,gne),Je[12]||(Je[12]=e.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nr.options,Nn=>(e.openBlock(),e.createElementBlock("div",{key:Nn.value,class:e.normalizeClass([{active:V(Ir,Nn.value)},"option-card multi-select-option"]),onClick:Je[2]||(Je[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",vne,[e.createElementVNode("input",{checked:V(Ir,Nn.value),type:"checkbox",onChange:e.withModifiers(En=>I(Ir,Nn.value),["stop"])},null,40,bne)]),e.createElementVNode("div",{class:"option-content",onClick:En=>I(Ir,Nn.value)},[e.createElementVNode("div",_ne,e.toDisplayString(Nn.label),1)],8,xne)],2))),128))]),e.createElementVNode("div",wne,[e.createElementVNode("button",{class:"btn-listo",onClick:Je[3]||(Je[3]=e.withModifiers(Nn=>ir(),["stop"]))},"Listo")])])):e.createCommentVNode("",!0)],8,dne)):Nr.type==="radio-button"&&!(((ln=L.value)==null?void 0:ln.id)===8&&t.isPostMatch)?(e.openBlock(),e.createElementBlock("div",Tne,[e.createElementVNode("div",Sne,e.toDisplayString(Nr.label),1),e.createElementVNode("div",kne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nr.options,Nn=>(e.openBlock(),e.createElementBlock("label",{key:Nn.value,class:e.normalizeClass([{active:E.value[Ir]===Nn.value},"radio-option-card"])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":En=>E.value[Ir]=En,disabled:X(Nn.value,Nn.label),name:"dynamic-radio-"+Ir,value:Nn.value,type:"radio",onChange:()=>{var En,Gn,$n;if(((En=L.value.value)==null?void 0:En.id)===9&&a.value.value&&($n=(Gn=e.unref(d))==null?void 0:Gn.view)!=null&&$n.filterMultiple){const ka=E.value[Ir]===1;e.unref(d).view.filterMultiple.isHomeTeam=ka}a.value.value&&Ve(),te()}},null,40,Lne),[[e.vModelRadio,E.value[Ir]]]),e.createElementVNode("span",null,e.toDisplayString(Nn.label),1)],2))),128))])])):Nr.type==="check"?(e.openBlock(),e.createElementBlock("div",Cne,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Nn=>E.value[Ir]=Nn,checked:E.value[Ir],type:"checkbox",onChange:Je[4]||(Je[4]=()=>{a.value.value&&Ve(),te()})},null,40,Nne),[[e.vModelCheckbox,E.value[Ir]]]),e.createTextVNode(" "+e.toDisplayString(Nr.label),1)])])):Nr.type==="select-simple"?(e.openBlock(),e.createElementBlock("div",{key:3,"data-filter-type":Nr.type,class:"custom-select dynamic-select filter-inline",onClick:e.withModifiers(Nn=>re(Ir),["stop"])},[e.createElementVNode("div",Ene,[Je[14]||(Je[14]=e.createElementVNode("span",{class:"select-icon select-analisis-icon"},[e.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Je[15]||(Je[15]=e.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),e.createElementVNode("span",{class:e.normalizeClass([{open:bt.value===Ir},"arrow"])},[...Je[13]||(Je[13]=[e.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[e.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),bt.value===Ir?(e.openBlock(),e.createElementBlock("div",zne,[e.createElementVNode("div",Mne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nr.options,Nn=>(e.openBlock(),e.createElementBlock("div",{key:Nn.value,class:e.normalizeClass([{active:E.value[Ir]===Nn.value},"option-card simple-select-option"]),onMouseenter:En=>pr(Ir,Nn.value),onClick:e.withModifiers(En=>le(Ir,Nn.value),["stop"])},[e.createElementVNode("div",Pne,[e.createElementVNode("div",Ane,e.toDisplayString(Nn.label),1)]),E.value[Ir]===Nn.value?(e.openBlock(),e.createElementBlock("div",Rne,[...Je[16]||(Je[16]=[e.createElementVNode("svg",{fill:"none",height:"16",viewBox:"0 0 16 16",width:"16"},[e.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])])):e.createCommentVNode("",!0)],42,Vne))),128))])])):e.createCommentVNode("",!0)],8,One)):e.createCommentVNode("",!0),Ir===1&&P.value.length>2?(e.openBlock(),e.createElementBlock("div",Fne)):e.createCommentVNode("",!0)],64)}),128))],2)):e.createCommentVNode("",!0),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:8,class:"cancel-btn",onClick:He},"Cancelar")),S.value?(e.openBlock(),e.createElementBlock("button",{key:9,class:"ok-btn",onClick:Xe},"OK")):e.createCommentVNode("",!0)])}}}),Ine=e2(Une,[["__scopeId","data-v-863a4862"]]),qne={key:0,class:"modal-simple"},jne={class:"modal-simple__content"},Dne={class:"modal-simple__content__header"},Wne={class:"modal-simple__content__body"},Bne={class:"modal-simple__content__footer"},Kne={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(t){return(r,n)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.modelValue?(e.openBlock(),e.createElementBlock("div",qne,[e.createElementVNode("div",jne,[e.createElementVNode("div",Dne,[e.renderSlot(r.$slots,"header",{},void 0,!0)]),e.createElementVNode("div",Wne,[e.renderSlot(r.$slots,"body",{},void 0,!0)]),e.createElementVNode("div",Bne,[e.renderSlot(r.$slots,"footer",{},void 0,!0)])])])):e.createCommentVNode("",!0)]))}},Xne=e2(Kne,[["__scopeId","data-v-1cc4f590"]]),Gne={class:"footer"},Zne={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(t,{emit:r}){const n=r;function y(f){n("update:modelValue",f)}function $(f){n("action",f),n("update:modelValue",!1)}return(f,u)=>(e.openBlock(),e.createBlock(Xne,{"modle-value":t.value,"onUpdate:modelValue":y},{header:e.withCtx(()=>[...u[2]||(u[2]=[e.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:e.withCtx(()=>[...u[3]||(u[3]=[e.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:e.withCtx(()=>[e.createElementVNode("div",Gne,[e.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:u[0]||(u[0]=i=>$(!1))}," Seguir editando "),e.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:u[1]||(u[1]=i=>$(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},Jne=e2(Zne,[["__scopeId","data-v-ed9b5088"]]),Hne={key:0,class:"modal-simple"},Yne={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(t){return(r,n)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,null,{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",Hne,[...n[0]||(n[0]=[e.createElementVNode("div",{class:"modal-simple__content"},[e.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),e.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):e.createCommentVNode("",!0)]),_:1})]))}},Qne=e2(Yne,[["__scopeId","data-v-2bc30783"]]),$ne={class:"template-maker__header"},tae={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eae={class:"template-maker__content"},rae={class:"template-maker__content__main"},nae={id:"containerMain",class:"container-main"},aae={class:"template-maker__content__main__cover-selector"},iae=["id"],oae={class:"page-indicator"},sae={class:"page-indicator__index"},lae=["onClick"],cae=["onClick"],uae={key:0,class:"template-maker__content__main__footer"},dae={class:"template-maker__content__main__footer__paginator"},pae={class:"template-maker__content__main__footer__paginator__nav"},hae={class:"template-maker__content__main__footer__paginator__numbers"},fae=["onClick"],mae={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(t,{expose:r,emit:n}){const y=new Map,$=e.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:{}}]}]),f=e.ref(null),u=e.ref(0),i=e.ref(!1),d=e.ref(null),l=e.ref(null),a=e.ref(!0),S=e.ref(!1),T=e.ref(!1),b=e.ref(0),p=e.ref(!1),s=e.ref(null),c=e.ref(new Map),o=e.ref(null),h=e.ref(null),v=e.ref(!1),k=e.ref(!1),L=e.ref(!1),E=new Map,P=new Map,V=e.computed(()=>({"--overflow-y-template-maker":S.value?"scroll":"hidden","--height-container-main":S.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(S.value,"0")})),I=e.computed(()=>u.value+1);e.watch(()=>i.value,tr=>{const Fe=document.getElementById("app");tr?(u.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Fe&&(Fe.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Fe&&(Fe.style.overflow=""))});function j(tr){return tr<10?`0${tr}`:tr}async function F({templateId:tr,userId:Fe}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Fe}/templates/${tr}`,{method:"GET",headers:{Authorization:he.token}})).json()).data}catch(sr){console.error("Error fetching template by ID:",sr)}}async function D({reportId:tr,userId:Fe}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Fe}/reports/${tr}`,{method:"GET",headers:{Authorization:he.token}})).json()).data}catch(sr){console.error("Error fetching report by ID:",sr)}}let U=0;function M(tr){f.value=tr,U>0&&(v.value=!0),U++}function X(tr){tr&&te(null,!0)}let O=null;function Y(tr,Fe){let sr=tr.getBoundingClientRect(),Ye={height:tr.clientHeight,width:tr.clientWidth},Te=Fe.getBoundingClientRect();if(!(Te.top>=sr.top&&Te.bottom<=sr.top+Ye.height)){const Re=Te.top-sr.top,Ve=Te.bottom-sr.bottom;Math.abs(Re)<Math.abs(Ve)?tr.scrollTop+=Re:tr.scrollTop+=Ve}}function st(tr,Fe){let sr=tr.getBoundingClientRect();const Ye=Fe.getBoundingClientRect().top-sr.top;tr.scrollTop+=Ye}function mt(tr,Fe=!1){const sr={title:`Page ${$.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(Xe(),tr!==void 0&&tr>=-1?$.value.splice(tr+1,0,sr):$.value.push(sr),e.nextTick(()=>{const Ye=$.value.findIndex(Re=>Re.id===sr.id),Te=document.getElementById(`page-${Ye+1}`);O||(O=document.getElementById("containerMain")),Te&&O?Y(O,Te):console.error("Page element or container main element not found")}),Fe)return sr;v.value=!0}function yt(tr){if(tr<0||tr>$.value.length)return;u.value=tr;const Fe=document.getElementById(`page-${tr}`);if(O||(O=document.getElementById("containerMain")),Fe&&O){const sr=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(sr),st(O,Fe),setTimeout(()=>{const Ye=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Ye)},300)}else console.error("Page element or container main element not found")}function bt(tr){h.value=null,o.value=tr,p.value=!0}function xt(tr,Fe){const sr=Fe+1;tr&&u.value!==sr&&(u.value=sr)}function Pt(tr){p.value=!0,Sd.emit("edit-view",{view:tr})}async function qt({templateReportId:tr,userId:Fe,isTemplateMode:sr}){try{return sr?F({templateId:tr,userId:Fe}):D({reportId:tr,userId:Fe})}catch(Ye){throw new Error("Error fetching template or report by ID: "+Ye.message)}}function _t(){U=0,p.value=!1,u.value=0,o.value=null,h.value=null,c.value.clear(),O=null,d.value=null,l.value=null,f.value=null,b.value=0,$.value=[],T.value=!1,v.value=!1,k.value=!1,L.value=!1,E.forEach(tr=>clearTimeout(tr)),E.clear(),P.forEach(tr=>clearTimeout(tr)),P.clear(),It=[],y.clear()}let It=[];async function jt(tr){if(_t(),a.value=tr.isTemplateMode,S.value=!!tr.isPDFMode,tr.isPDFMode?d.value=await D({reportId:tr.reportId,userId:tr.userId}):(d.value=tr.template,d.value=await qt({templateReportId:tr.template.id,userId:tr.template.user_id,isTemplateMode:tr.isTemplateMode})),!d.value)return;d.value&&d.value.game&&(d.value.game=Jt(d.value.game)),l.value=JSON.parse(JSON.stringify(d.value)),T.value=d.value.template_type===2;const Fe=d.value.pages.find(sr=>sr.is_front_page);b.value=Fe?Fe.type:1,i.value=!0,tr.isTemplateMode||(It=await le(d.value)),$.value=d.value.pages.reduce((sr,Ye,Te)=>{if(!Ye.is_front_page){Ye.name||(Ye.name="");const Re=Te,Ve={originalPage:JSON.parse(JSON.stringify(Ye)),title:Ye.name,id:`p-${Date.now()-Te*9}`,items:[],components:Ye.components};Ye.components&&Ye.components.length>0&&(Ve.items=Ye.components.reduce((br,cr,gr)=>{const Tr=new Yk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],cr.coreView.id,cr.dynamicFilters,T.value,a.value,cr.filtersJSON||null,he.token,cr.filters),Pr={originalComponent:JSON.parse(JSON.stringify(cr)),title:cr.title,shortTitle:cr.shortTitle||cr.title,game:d.value.game,idAux:cr.id,id:`w-${Date.now()-gr*7}`,x:cr.column,y:cr.row,w:cr.colspan,h:cr.rowspan,maxWidth:cr.max_column,maxHeight:cr.max_row,minWidth:cr.min_column,minHeight:cr.min_row,noResize:!a.value,noMove:!a.value,coreView:cr.coreView||null,isTemplateMode:a.value,componentName:cr.componentName,componentProps:re({currentProps:cr.componentProps,coreView:cr.coreView,isTemplateMode:a.value,templateToEdit:d.value,filterMultiple:cr.filterMultiple||null,game:d.value.game||null,dynamicFilters:cr.dynamicFilters,page:Re,componentId:gr})||{},filterMultiple:cr.filterMultiple,isHomeTeam:Wt({game:d.value.game,isTemplateMode:a.value,currentIsHomeTeam:cr.isHomeTeam||cr.componentProps.isHomeTeamForAnalysis}),filtersJSON:cr.filtersJSON||null,dynamicFilters:cr.dynamicFilters||[],filterAndViewsContainer:Tr};if(Pr.componentProps.isViewNull)return br;const qe=e.reactive({view:Pr});return Tr.addView(qe,!0),c.value.set(Tr.getId(),Tr),br.push(Pr),br},[])),sr.push(Ve)}return sr},[])}function Rt({game:tr,isTemplateMode:Fe}){const sr=tr&&tr.homeTeam&&tr.awayTeam&&(tr.homeTeam.team_id===he.userTeamId||tr.awayTeam.team_id===he.userTeamId);return{isUserTeamHome:sr&&tr.homeTeam.team_id===he.userTeamId,requiresUserTeamAdjustment:sr&&!Fe}}function Wt({game:tr,isTemplateMode:Fe,currentIsHomeTeam:sr}){const{isUserTeamHome:Ye,requiresUserTeamAdjustment:Te}=Rt({game:tr,isTemplateMode:Fe});return Te?sr?Ye:!Ye:sr}function re({currentProps:tr,coreView:Fe,templateToEdit:sr,isTemplateMode:Ye,filterMultiple:Te,game:Re,dynamicFilters:Ve,page:br,componentId:cr}){var gr,Tr,Pr,qe,Ge,Je,hr,Nr,Ir,ln;if(!tr||!Fe)return tr||{};const{isUserTeamHome:Nn,requiresUserTeamAdjustment:En}=Rt({game:Re,isTemplateMode:Ye});let Gn={...tr};if(Fe.id===5){if(Gn.isGhostEffect=Ye,En){const $n=Gn.preMatchType===1;Gn.preMatchType=$n?Nn?1:2:Nn?2:1}Re&&(Gn.game=Re)}if(Fe.id===7){if(En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}Re&&(Gn.game=Re)}if(Fe.id===9){if(En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}Re&&(Gn.game=Re)}if(Fe.id===18){if(!Ye&&En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}if(!Ye){Gn.teamIdForAnalysis=Gn.isHomeTeamForAnalysis?Re.home_team:Re.visiting_team;const $n=It.findIndex(Hr=>((Gn.isAgainstMode?1:0)===Hr.is_against||Hr.is_against===Gn.isAgainstMode)&&Gn.teamIdForAnalysis===Hr.team_id);let ka=null;$n!==-1&&(ka={...It[$n]},It.splice($n,1)),ka?(Gn.specificPlaysCornersData=ka,Gn.playIdForAnalysis=ka.play_id,Gn.gameIdForAnalysis=ka.game_id,Gn.seasonIdForAnalysis=ka.season_id||Re.season_id,Gn.isTemplateMode=Ye,Gn.isGameOnly=!0,Gn.isCornerInfoVisible=!0):(Gn.isNullCornerData=!0,Gn.isViewNull=!0)}}if(Fe.id===16){if(!Ye&&En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}if(!Ye){Gn.isPreMatch=!T.value,Gn.isTemplateMode=Ye,Gn.seasonId=sr.season_id,Gn.teamIdForAnalysis=Gn.isHomeTeamForAnalysis?sr.game.home_team:sr.game.visiting_team;const $n=Gn.isHomeTeamForAnalysis?sr.last_games.last_home_games:sr.last_games.last_visiting_games;T.value?Gn.gamesIdsForAnalysis=[sr.game.game_id]:Gn.howManyGames?Gn.gamesIdsForAnalysis=$n.slice(0,Gn.howManyGames).map(ka=>ka.game_id):(Gn.gamesIdsForAnalysis=[],Gn.gameDataUTC=sr.game.date_time_utc)}}if(Fe.id===10){if(En){const $n=Gn.isHomeTeamForAnalysis;Gn.isHomeTeamForAnalysis=$n?Nn:!Nn}Re&&(Gn.game=Re)}if(Fe.id===1&&(Gn.gameId=Re?Re.id:"",Gn.homeLogo=Re?Re.homeTeam.logo:"",Gn.awayLogo=Re?Re.awayTeam.logo:"",Gn.seasonId=Re?Re.season_id:0,Gn.default=Ye),Fe.id===6&&(Gn.game=Re||"",Gn.lastGames=sr.last_games,Gn.selectedOption=sr.template_type===2?"Postmatch":"Prematch"),Fe.id===13){Gn.isdefault=Ye,Gn.seasonid=Re?Re.seasonId:2010,Gn.datetimeutc=Re?sr.template_type===1?Re?Re.date_time_utc:"":null:"",Gn.teamids=Re?[Re.home_team,Re.visiting_team]:[1,2],Gn.categoryids=Ve?Ve[1]:[20,2];const $n=((gr=sr==null?void 0:sr.game)==null?void 0:gr.home_team)||(Re==null?void 0:Re.home_team)||0,ka=((Tr=sr==null?void 0:sr.game)==null?void 0:Tr.visiting_team)||(Re==null?void 0:Re.visiting_team)||0;let Hr=[1,2];if(Re&&Ve&&Ve[2]!==void 0?Ve[2]===3?Te&&Te.isHomeTeam!==void 0?Te.isHomeTeam?Hr=[En?Nn?$n:ka:$n]:Hr=[En?Nn?ka:$n:ka]:Hr=En?[Nn?$n:ka,Nn?ka:$n]:[$n,ka]:Ve[2]===1?Hr=[En?Nn?$n:ka:$n]:Ve[2]===2&&(Hr=[En?Nn?ka:$n:ka]):Ve&&Ve[2]!==void 0?Hr=Ve[2]===3?[1,2]:[Ve[2]]:Hr=[1,2],Gn.teamsshow=Hr,Gn.analysistype=Ve?Ve[0]:[],Gn.gameid=sr.template_type===1?null:Re?Re.id:"",Re){const Rr=[{id:Re.home_team,name:Re.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Re.home_team+".png"},{id:Re.visiting_team,name:Re.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Re.visiting_team+".png"}],dn=new Map(Rr.map(Mn=>[Mn.id,Mn]));Gn.teams=Hr.map(Mn=>dn.get(Mn)).filter(Mn=>Mn!==void 0)}else Gn.teams=[]}if(Fe.id===15){const $n=((Pr=sr==null?void 0:sr.game)==null?void 0:Pr.home_team)||(Re==null?void 0:Re.home_team)||0,ka=((qe=sr==null?void 0:sr.game)==null?void 0:qe.visiting_team)||(Re==null?void 0:Re.visiting_team)||0;let Hr=2;!Ye&&Re&&(Te&&Te.isHomeTeam!==void 0?Te.isHomeTeam?Hr=En?Nn?$n:ka:$n:Hr=En?Nn?ka:$n:ka:Ve&&Ve[2]!==void 0&&(Ve[2]===1?Hr=En?Nn?$n:ka:$n:Ve[2]===2&&(Hr=En?Nn?ka:$n:ka))),Gn.view=1,Gn.token=he.token,Gn.numitems=Ve?Ve[1]:3,Gn.isdefault=Ye,Gn.reportid=sr!=null&&sr.id?sr.id:0,Gn.userid=sr!=null&&sr.user_id?sr.user_id:0,Gn.page=br+1,Gn.typegame=T.value?2:1,Gn.componentid=cr+1,Gn.data={season:Re?Re.seasonId:2010,type:2,game:Re?Re.id:0,team:Hr}}if(Fe.id===17){Gn.game=Re?{id:Re.id||Re.game_id||Re.gameId||null,home_team:Re.home_team||null,away_team:Re.visiting_team||null,season:Re.seasonId||Re.season_id||null,game_status:Re.game_status||Re.status||null,home_acronym:Re.home_team_acronym||((Ge=Re.homeTeam)==null?void 0:Ge.acronym)||null,away_acronym:Re.visiting_team_acronym||((Je=Re.awayTeam)==null?void 0:Je.acronym)||null,logo_home:((hr=Re.homeTeam)==null?void 0:hr.logo)||null,logo_away:((Nr=Re.awayTeam)==null?void 0:Nr.logo)||null}:null,Gn.infavoragainstteam=Ve?!Ve[0]:!0,Gn.forseason=!T.value,Gn.forteam=!1,Gn.tournamentselected=sr!=null&&sr.tournament_id?{id:sr.tournament_id}:{id:1},Gn.forgame=!!T.value,Gn.lateralidad=Ve&&Ve[1]==32?"right":"left";const $n=((Ir=sr==null?void 0:sr.game)==null?void 0:Ir.home_team)||(Re==null?void 0:Re.home_team)||0,ka=((ln=sr==null?void 0:sr.game)==null?void 0:ln.visiting_team)||(Re==null?void 0:Re.visiting_team)||0;let Hr=0;Ve&&Ve[2]!==void 0&&(Ve[2]===3?Te&&Te.isHomeTeam!==void 0&&(Te.isHomeTeam?Hr=En?Nn?$n:ka:$n:Hr=En?Nn?ka:$n:ka):Ve[2]===1?Hr=En?Nn?$n:ka:$n:Ve[2]===2&&(Hr=En?Nn?ka:$n:ka)),Gn.teamselected=Hr;const Rr=Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][4]!==void 0?Array.isArray(Ve[3][4])?Ve[3][4].filter(dn=>dn!=="rematado-destino-porteria").reduce((dn,Mn)=>(Mn==="fue-gol"?dn.push(583,585,587,589):Mn==="no-fue-gol"?dn.push(584,586,588,590):Mn==="rematado-sin-destino-porteria"?dn.push(125,131,139,145):Mn==="sin-destino"?dn.push(122,128,136,142):Mn==="ganados-por-portero-rival"?dn.push(123,129,137,143):Mn==="ganados-por-jugador-rival"&&dn.push(124,130,138,144),dn),[]):[]:[];Gn.filters={isMoment:!0,final:[1,2,3],moment:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][0]!==void 0?Array.isArray(Ve[3][0])?Ve[3][0].map(dn=>dn==="iba-ganando"?1:dn==="iba-empatado"?3:dn==="iba-perdiendo"?2:dn):[]:[],playingAs:[1,2],sections:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][1]!==void 0?Array.isArray(Ve[3][1])?Ve[3][1].map(dn=>dn==="0-15"?1:dn==="16-30"?2:dn==="31-45"?3:dn==="46-60"?4:dn==="61-75"?5:dn==="76-90"?6:dn):[]:[],games:T.value?[Re==null?void 0:Re.game_id]:[],players:[],cornertype:Ve&&Ve[1]!==void 0?Ve[1]:null,howWas:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][2]!==void 0?Array.isArray(Ve[3][2])?Ve[3][2].filter(dn=>dn!=="izquierda"&&dn!=="derecha").map(dn=>{const Mn=Ve[1];return dn==="comba-afuera"?Mn==32?134:120:dn==="comba-adentro"?Mn==32?140:126:dn==="raz-area"?Mn==32?146:327:dn==="en-corto"?Mn==32?147:133:dn}):[]:[],zona:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][3]!==void 0?Array.isArray(Ve[3][3])?Ve[3][3]:[]:[],whathappened:Rr,isWhatHappenedFull:Array.isArray(Rr)&&Rr.length===24,isZoneFull:Ve&&Ve[3]&&typeof Ve[3]=="object"&&!Array.isArray(Ve[3])&&Ve[3][3]!==void 0&&Array.isArray(Ve[3][3])?Ve[3][3].length===35:!1},Gn.showBallGo=!0,Gn.showHeatMap=!0,Gn.ballOnOff="OFF",Gn.showdefault=Ye}if(Fe.id===14&&(Gn.isReports=!0,Gn.isDefault=Ye,Gn.type=sr.tournament_type==1?1:0,Gn.typeView=1,Gn.tournament=sr.tournament_id,Gn.currentSeason=Re?Re.season_id:0,Gn.currentSeasonId=Re?Re.season_id:0,Gn.showVideos=!1,Gn.localTeam=Re?Re.home_team:0,Gn.awayTeam=Re?Re.visiting_team:0),Fe.id===3&&(Gn.defaultShields=Ye,Re&&(Gn.game=Re)),Fe.id===2){let $n=!0,ka=0,Hr=0;Re&&($n=sr.main_team==Re.home_team||sr.main_team==Re.visiting_team,ka=$n?sr.main_team==(Re==null?void 0:Re.home_team)?Re==null?void 0:Re.home_team:Re==null?void 0:Re.visiting_team:Re==null?void 0:Re.home_team,Hr=$n?sr.main_team==(Re==null?void 0:Re.home_team)?Re==null?void 0:Re.visiting_team:Re==null?void 0:Re.home_team:Re==null?void 0:Re.visiting_team),Gn.gamed=Re?Re.id:"",Gn.game=Re||"",Gn.season=Re?Re.season_id:0,Gn.teamView=Te.teamType==3?0:Te.teamType==1?ka:Hr,Gn.useDummyData=Ye}if(Fe.id===8&&(Gn.isDefault=Ye,Re)){Gn.game=Re;const $n=Re.home_team||0,ka=Re.visiting_team||Re.away_team||0;let Hr=$n;Te&&Te.isHomeTeam!==void 0&&Ve&&Ve[1]===3?Te&&Te.isHomeTeam!==void 0&&(Te.isHomeTeam?Hr=En?Nn?$n:ka:$n:Hr=En?Nn?ka:$n:ka):Ve&&Ve[1]!==void 0&&(Ve[1]===1?Hr=En?Nn?$n:ka:$n:Ve[1]===2&&(Hr=En?Nn?ka:$n:ka)),Gn.teamSelected={teamId:Hr}}return Fe.id===4&&(Gn.gameId=Re?Re.id:"",Gn.isDefault=Ye,Gn.homeTeam=Re?Re==null?void 0:Re.home_team:"",Gn.awayTeam=Re?Re==null?void 0:Re.visiting_team:""),Gn}async function le(tr){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${tr.user_id}/reports/${tr.id}/specific-plays-corners`,{method:"GET",headers:{Authorization:he.token}})).json()).data}catch(Fe){return console.error("Error fetching specific plays:",Fe),[]}}const he=t,de=n;e.watch(()=>he.token,(tr,Fe)=>{},{immediate:!0}),r({show:jt}),Sd.on("add-page-view",tr=>{y.set(tr.view.id,tr.view);const Fe=$.value.find(sr=>sr.id===tr.pageId);Fe&&(Fe.items||(Fe.items=[]),Fe.items.push(tr.view),e.nextTick(()=>{const sr=document.querySelector(`[gs-id="${tr.view.id}"]`);tr.grid.makeWidget(sr)}))}),Sd.on("add-page-and-view",tr=>{const Fe=$.value.findIndex(sr=>sr.id===tr.pageId);if(Fe>-1){const sr=mt(Fe,!0);setTimeout(()=>{Sd.emit("add-view",{pageId:sr.id,view:tr.view,filterAndWidgetContainer:tr.filterAndWidgetContainer}),h.value&&(sr.stepBackPage=h.value),h.value=sr},500)}else console.error("Page not found for adding view:",tr.pageId)}),Sd.on("empty-page",tr=>{p.value&&o.value&&o.value.id===tr.id||(He(tr),h.value&&h.value.id===tr.id&&(h.value.stepBackPage?h.value=h.value.stepBackPage:h.value=null))}),Sd.on("filters-cancelled",tr=>{tr&&tr.removeAllChildViews()}),Sd.on("activate-save-button",()=>{v.value=!0});function Jt(tr){return{...tr,gameId:tr.game_id,id:tr.game_id,seasonId:tr.season_id,status:tr.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${tr.home_team}.png`,team_id:tr.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${tr.home_team}.png`,colloquial_name:tr.home_team_name,acronym:tr.home_team_acronym,team_name:tr.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${tr.visiting_team}.png`,team_id:tr.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${tr.visiting_team}.png`,colloquial_name:tr.visiting_team_name,acronym:tr.visiting_team_acronym,team_name:tr.visiting_team_name}}}function te(tr,Fe=!1){Fe||!a.value?(i.value=!1,_t(),de("close")):v.value?k.value=!0:(i.value=!1,_t(),de("close"))}function ne(){s.value=null,p.value=!1}function Le({page:tr,view:Fe,applyMinimumSize:sr=!1}){const Ye=tr.grid;if(!tr||!Fe||!Ye)return null;const Te=sr?{w:Fe.min_column,h:Fe.min_row}:{w:Fe.colspan,h:Fe.rowspan},Re=Ye.willItFit(Te);return Re?{willFit:Re,applyMinimumSize:sr}:sr?null:Le({page:tr,view:Fe,applyMinimumSize:!0})}const Oe=new Set([9]);function Ne(tr){var Fe,sr,Ye,Te,Re,Ve,br,cr,gr,Tr,Pr,qe,Ge,Je,hr,Nr,Ir,ln,Nn;if(tr.dynamicFilters&&tr.dynamicFilters.length>0&&tr.viewToEdit&&tr.viewToEdit.view){const En=tr.viewToEdit.view.id;$.value.forEach(Gn=>{Gn.items.forEach($n=>{$n.id===En&&$n.coreView&&$n.coreView.id===3&&($n.componentProps.desplegable=tr.dynamicFilters[0]||!1,$n.componentProps.key=tr.dynamicFilters[0]||!1,e.nextTick(()=>{Sd.emit("force-component-update",{itemId:$n.id,componentProps:$n.componentProps})}))})})}if(tr.viewToEdit){if(!tr.viewToEdit.view.filterAndViewsContainer){const En=new Yk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[tr.viewToEdit],((Fe=tr.viewToEdit.view.coreView)==null?void 0:Fe.id)||tr.viewToEdit.view.id,tr.dynamicFilters||[],T.value,a.value,tr.filtersJSON,he.token,tr.filters);tr.viewToEdit.view.filterAndViewsContainer=En}tr.viewToEdit.view.filterAndViewsContainer.updateView({view:tr.viewToEdit,dynamicFilters:tr.dynamicFilters||[],filtersJSON:tr.filtersJSON||null,filters:tr.filters}),v.value=!0}else if(tr.view){tr.view.id&&tr.filterAndViewsContainer&&tr.view.id!==tr.filterAndViewsContainer.viewId&&(tr.filterAndViewsContainer.removeAllChildViews(),tr.filterAndViewsContainer.setViewId(tr.view.id),tr.filterAndViewsContainer.setFiltersJSON(tr.filtersJSON||null)),tr.view.id&&Oe.has(tr.view.id)&&tr.dynamicFilters[0]&&tr.dynamicFilters[0].length===0&&tr.filterAndViewsContainer&&(tr.filterAndViewsContainer.updateDynamicFilters(tr.dynamicFilters,(Ye=(sr=tr.viewToEdit)==null?void 0:sr.view)==null?void 0:Ye.id),v.value=!0);const En=h.value||o.value,Gn=Le({page:En,view:tr.view,applyMinimumSize:!1});tr.view.filtersJSON=tr.filtersJSON||null;const $n=tr.filterAndViewsContainer,ka=$.value.findIndex(Hr=>Hr.id===En.id);if($n){const Hr=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters,tr.filters);if(((Te=tr.view)==null?void 0:Te.id)===15){const Rr=(Re=tr.filterAndViewsContainer)==null?void 0:Re.getId();if(Rr&&E.has(Rr)){const dn=E.get(Rr);clearTimeout(dn),E.delete(Rr)}}if(((Ve=tr.view)==null?void 0:Ve.id)===17){const Rr=(br=tr.filterAndViewsContainer)==null?void 0:br.getId();if(Rr&&P.has(Rr)){const dn=P.get(Rr);clearTimeout(dn),P.delete(Rr)}}if(Hr){if($n.setFilters(tr.filters),$n.setDynamicFilters(tr.dynamicFilters),Gn||ka===$.value.length-1){Sd.emit("add-view",{pageId:En.id,view:tr.view,filterAndWidgetContainer:$n,avoidWillFit:!1,applyMinimumSize:Gn?Gn.applyMinimumSize:!1,dynamicFilters:tr.dynamicFilters,filters:tr.filters}),tr.filterAndViewsContainer.updateDynamicFilters(tr.dynamicFilters,(gr=(cr=tr.viewToEdit)==null?void 0:cr.view)==null?void 0:gr.id),v.value=!0;let Rr=null;if(((Tr=tr.view)==null?void 0:Tr.id)===15?(e.nextTick(()=>{var dn;const Mn=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters,tr.filters);((dn=tr.dynamicFilters)==null?void 0:dn[0])===3&&Mn&&Ne(tr)}),Rr=setTimeout(()=>{var dn,Mn;const da=(dn=tr.filterAndViewsContainer)==null?void 0:dn.getId();da&&E.delete(da);const Un=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters);((Mn=tr.dynamicFilters)==null?void 0:Mn[0])===3&&Un&&Ne(tr)},200)):((Pr=tr.view)==null?void 0:Pr.id)===17?(e.nextTick(()=>{var dn,Mn;const da=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters,tr.filters),Un=(dn=tr.dynamicFilters)==null?void 0:dn[0],Xr=(Mn=tr.dynamicFilters)==null?void 0:Mn[2];(Un===3||Xr===3)&&da&&Ne(tr)}),Rr=setTimeout(()=>{var dn,Mn,da;const Un=(dn=tr.filterAndViewsContainer)==null?void 0:dn.getId();Un&&P.delete(Un);const Xr=tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters),sn=(Mn=tr.dynamicFilters)==null?void 0:Mn[0],Sr=(da=tr.dynamicFilters)==null?void 0:da[2];(sn===3||Sr===3)&&Xr&&Ne(tr)},200)):Rr=setTimeout(()=>{tr.filterAndViewsContainer.getRequiresAddView(tr.dynamicFilters,tr.filters)&&Ne(tr)},1e3),((qe=tr.view)==null?void 0:qe.id)===15&&Rr){const dn=(Ge=tr.filterAndViewsContainer)==null?void 0:Ge.getId();dn&&E.set(dn,Rr)}if(((Je=tr.view)==null?void 0:Je.id)===17&&Rr){const dn=(hr=tr.filterAndViewsContainer)==null?void 0:hr.getId();dn&&P.set(dn,Rr)}}}else tr.isAltMode?tr.viewToEdit||tr.filterAndViewsContainer.updateFilters(tr.filters,(Ir=(Nr=tr.viewToEdit)==null?void 0:Nr.view)==null?void 0:Ir.id):tr.filterAndViewsContainer.updateDynamicFilters(tr.dynamicFilters,(Nn=(ln=tr.viewToEdit)==null?void 0:ln.view)==null?void 0:Nn.id),v.value=!0}else if(Gn||ka===$.value.length-1){const Hr=new Yk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],tr.view.id,tr.dynamicFilters,T.value,a.value,tr.filtersJSON,he.token,tr.filters);Sd.emit("set-filter-and-views-container",Hr),c.value.set(Hr.getId(),Hr);const Rr=tr.dynamicFilters&&(tr.dynamicFilters[0]===3||tr.dynamicFilters[2]===3)&&(tr.view.id===15||tr.view.id===17);tr.dynamicFilters&&(Array.isArray(tr.dynamicFilters[0])||Rr)?(tr.filterAndViewsContainer=Hr,Ne(tr)):Sd.emit("add-view",{pageId:En.id,view:tr.view,filterAndWidgetContainer:Hr,avoidWillFit:!1,applyMinimumSize:Gn?Gn.applyMinimumSize:!1,dynamicFilters:tr.dynamicFilters,filters:tr.filters}),v.value=!0}}}async function Pe(){if(v.value)try{const tr=[{is_front_page:!0,template_type:f.value.isPostMatch?2:1,type:f.value.id},...$.value.map(sr=>({columns:sr.originalPage?sr.originalPage.columns:12,rows:sr.originalPage?sr.originalPage.rows:12,gap:sr.originalPage?sr.originalPage.gap:10,name:sr.title,width:sr.originalPage?sr.originalPage.width:968,height:sr.originalPage?sr.originalPage.height:702,components:sr.items.reduce((Ye,Te)=>(Te.isDeleted||Ye.push({min_column:Te.minWidth,min_row:Te.minHeight,max_column:Te.maxWidth,max_row:Te.maxHeight,column:Te.x,row:Te.y,colspan:Te.w,rowspan:Te.h,name:Te.name,title:Te.title,titleShort:Te.titleShort||Te.title,dynamicFilters:Te.filterAndViewsContainer.getComponentDynamicFilters(Te.id)||Te.filterAndViewsContainer.getDynamicFilters()||[],coreView:Te.coreView||null,componentName:Te.componentName,componentProps:Te.componentProps||{},isHomeTeam:Te.isHomeTeam||Te.componentProps.isHomeTeamForAnalysis,filterMultiple:Te.filterMultiple}),Ye),[])}))];console.log("pagesAux to save:",tr);const Fe=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${d.value.user_id}/templates/${d.value.id}/pages`,{method:"PATCH",headers:{Authorization:he.token},body:JSON.stringify({pages:tr})});L.value=!0,await Fe.json(),v.value=!1,setTimeout(()=>{L.value=!1},2e3)}catch(tr){console.error("Error saving template:",tr)}}function Xe(){$.value.forEach(tr=>{tr.offListeners&&tr.offListeners()})}function He(tr){const Fe=$.value.findIndex(sr=>sr.id===tr.id);Fe>-1&&(Xe(),$.value=$.value.filter(sr=>sr.id!==tr.id),u.value>=Fe&&(u.value=Math.max(0,u.value-1)),v.value=!0)}function $e(){v.value=!0}function ir(tr){const Fe=$.value.find(sr=>sr.items.some(Ye=>Ye.id===tr.id));if(Fe){const sr=Fe.items.find(Ye=>Ye.id===tr.id);sr&&(sr.isDeleted=!0,v.value=!0)}}function pr(tr){}return(tr,Fe)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Jne,{modelValue:k.value,"onUpdate:modelValue":Fe[0]||(Fe[0]=sr=>k.value=sr),onAction:X},null,8,["modelValue"]),e.createVNode(Qne,{"model-value":L.value},null,8,["model-value"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.value&&d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"template-maker",style:e.normalizeStyle(V.value)},[e.withDirectives(e.createVNode(Ine,{token:t.token,view:s.value,"is-post-match":T.value,onClose:ne,onFiltersChanged:Ne},null,8,["token","view","is-post-match"]),[[e.vShow,a.value&&p.value]]),e.createElementVNode("div",$ne,[e.createTextVNode(e.toDisplayString(d.value?d.value.name:"Nuevo template")+" ",1),e.createElementVNode("div",{class:"template-maker__header__close",onClick:te},[S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",tae,[...Fe[6]||(Fe[6]=[e.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),e.createElementVNode("div",eae,[Fe[13]||(Fe[13]=e.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),e.createElementVNode("div",rae,[e.createElementVNode("div",nae,[e.createElementVNode("div",aae,[e.withDirectives(e.createVNode(_Q,{"is-post-match":T.value,"initial-cover-id":b.value,onSelectCover:M},null,8,["is-post-match","initial-cover-id"]),[[e.vShow,a.value]])]),(e.openBlock(),e.createElementBlock("div",{class:"template-maker__content__main__pages",key:$.value.length},[f.value?(e.openBlock(),e.createBlock(OYt,{key:0,id:"page-0",game:d.value.game||null,"cover-id":f.value.id,"is-post-match":f.value.isPostMatch,onIntersectionChanged:Fe[1]||(Fe[1]=sr=>xt(sr,-1))},null,8,["game","cover-id","is-post-match"])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"new-items-buttons",style:e.normalizeStyle({"margin-bottom":$.value.length===0?"30px":"0"})},[p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Fe[2]||(Fe[2]=sr=>mt(-1))},[...Fe[7]||(Fe[7]=[e.createElementVNode("div",null,"+ Nueva página",-1),e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(sr,Ye)=>(e.openBlock(),e.createElementBlock("div",{key:Ye,id:`page-${Ye+1}`,class:"template-maker__content__main__pages__page"},[e.createElementVNode("div",oae,[e.createElementVNode("div",sae,"Pag "+e.toDisplayString(j(Ye+2)),1)]),f.value?(e.openBlock(),e.createBlock(zHt,{key:0,page:sr,"is-template-mode":a.value,"is-post-match":f.value.isPostMatch,game:d.value.game||null,lastGames:d.value.lastGames||[],"is-filter-visible":p.value,onEditView:Pt,onIntersectionChanged:Te=>xt(Te,Ye),onChangeSort:pr,onDeletePage:He,onViewChanged:$e,onDeleteView:ir},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):e.createCommentVNode("",!0),a.value&&!p.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"new-items-buttons",style:e.normalizeStyle({"margin-bottom":Ye+1===$.value.length?"30px":"0","margin-top":"10px"})},[e.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Te=>mt(Ye)},[...Fe[8]||(Fe[8]=[e.createElementVNode("div",null,"+ Nueva página",-1),e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,lae),e.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Te=>bt(sr)},[...Fe[9]||(Fe[9]=[e.createElementVNode("div",null,"+ Agregar gráfico",-1),e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,cae)],4)):e.createCommentVNode("",!0)],8,iae))),128))]))]),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",uae,[e.createElementVNode("div",dae,[e.createElementVNode("div",pae,[e.createElementVNode("div",null,"Páginas "+e.toDisplayString(I.value),1),e.createElementVNode("div",{class:e.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value<=0}]),onClick:Fe[3]||(Fe[3]=sr=>u.value>0&&yt(u.value-1))},[...Fe[10]||(Fe[10]=[e.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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),e.createElementVNode("div",{class:e.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value>=$.value.length}]),onClick:Fe[4]||(Fe[4]=sr=>u.value<$.value.length&&yt(u.value+1))},[...Fe[11]||(Fe[11]=[e.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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)]),e.createElementVNode("div",hae,[e.createElementVNode("div",{role:"button",class:e.normalizeClass({active:u.value===0}),onClick:Fe[5]||(Fe[5]=sr=>yt(0))},e.toDisplayString(j(1)),3),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(sr,Ye)=>(e.openBlock(),e.createElementBlock("div",{role:"button",key:Ye,class:e.normalizeClass({active:Ye+1===u.value}),onClick:Te=>yt(Ye+1)},e.toDisplayString(j(Ye+2)),11,fae))),128))])]),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,role:"button",class:e.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!v.value}]),onClick:Pe},[...Fe[12]||(Fe[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.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"}),e.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),e.createElementVNode("div",null,"Guardar",-1)])],2)):e.createCommentVNode("",!0)]))])])],4)):e.createCommentVNode("",!0)]))],64))}},yae=e2(mae,[["__scopeId","data-v-152de9bc"]]);function BZ(t,r){return function(){return t.apply(r,arguments)}}const{toString:gae}=Object.prototype,{getPrototypeOf:fA}=Object,{iterator:CO,toStringTag:KZ}=Symbol,NO=(t=>r=>{const n=gae.call(r);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Yw=t=>(t=t.toLowerCase(),r=>NO(r)===t),OO=t=>r=>typeof r===t,{isArray:$k}=Array,t7=OO("undefined");function d9(t){return t!==null&&!t7(t)&&t.constructor!==null&&!t7(t.constructor)&&Q_(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const XZ=Yw("ArrayBuffer");function vae(t){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(t):r=t&&t.buffer&&XZ(t.buffer),r}const bae=OO("string"),Q_=OO("function"),GZ=OO("number"),p9=t=>t!==null&&typeof t=="object",xae=t=>t===!0||t===!1,EO=t=>{if(NO(t)!=="object")return!1;const r=fA(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(KZ in t)&&!(CO in t)},_ae=t=>{if(!p9(t)||d9(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},wae=Yw("Date"),Tae=Yw("File"),Sae=t=>!!(t&&typeof t.uri<"u"),kae=t=>t&&typeof t.getParts<"u",Lae=Yw("Blob"),Cae=Yw("FileList"),Nae=t=>p9(t)&&Q_(t.pipe);function Oae(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const ZZ=Oae(),JZ=typeof ZZ.FormData<"u"?ZZ.FormData:void 0,Eae=t=>{let r;return t&&(JZ&&t instanceof JZ||Q_(t.append)&&((r=NO(t))==="formdata"||r==="object"&&Q_(t.toString)&&t.toString()==="[object FormData]"))},zae=Yw("URLSearchParams"),[Mae,Vae,Pae,Aae]=["ReadableStream","Request","Response","Headers"].map(Yw),Rae=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function h9(t,r,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let y,$;if(typeof t!="object"&&(t=[t]),$k(t))for(y=0,$=t.length;y<$;y++)r.call(null,t[y],y,t);else{if(d9(t))return;const f=n?Object.getOwnPropertyNames(t):Object.keys(t),u=f.length;let i;for(y=0;y<u;y++)i=f[y],r.call(null,t[i],i,t)}}function HZ(t,r){if(d9(t))return null;r=r.toLowerCase();const n=Object.keys(t);let y=n.length,$;for(;y-- >0;)if($=n[y],r===$.toLowerCase())return $;return null}const OS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,YZ=t=>!t7(t)&&t!==OS;function mA(){const{caseless:t,skipUndefined:r}=YZ(this)&&this||{},n={},y=($,f)=>{if(f==="__proto__"||f==="constructor"||f==="prototype")return;const u=t&&HZ(n,f)||f;EO(n[u])&&EO($)?n[u]=mA(n[u],$):EO($)?n[u]=mA({},$):$k($)?n[u]=$.slice():(!r||!t7($))&&(n[u]=$)};for(let $=0,f=arguments.length;$<f;$++)arguments[$]&&h9(arguments[$],y);return n}const Fae=(t,r,n,{allOwnKeys:y}={})=>(h9(r,($,f)=>{n&&Q_($)?Object.defineProperty(t,f,{value:BZ($,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,f,{value:$,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:y}),t),Uae=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Iae=(t,r,n,y)=>{t.prototype=Object.create(r.prototype,y),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:r.prototype}),n&&Object.assign(t.prototype,n)},qae=(t,r,n,y)=>{let $,f,u;const i={};if(r=r||{},t==null)return r;do{for($=Object.getOwnPropertyNames(t),f=$.length;f-- >0;)u=$[f],(!y||y(u,t,r))&&!i[u]&&(r[u]=t[u],i[u]=!0);t=n!==!1&&fA(t)}while(t&&(!n||n(t,r))&&t!==Object.prototype);return r},jae=(t,r,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=r.length;const y=t.indexOf(r,n);return y!==-1&&y===n},Dae=t=>{if(!t)return null;if($k(t))return t;let r=t.length;if(!GZ(r))return null;const n=new Array(r);for(;r-- >0;)n[r]=t[r];return n},Wae=(t=>r=>t&&r instanceof t)(typeof Uint8Array<"u"&&fA(Uint8Array)),Bae=(t,r)=>{const y=(t&&t[CO]).call(t);let $;for(;($=y.next())&&!$.done;){const f=$.value;r.call(t,f[0],f[1])}},Kae=(t,r)=>{let n;const y=[];for(;(n=t.exec(r))!==null;)y.push(n);return y},Xae=Yw("HTMLFormElement"),Gae=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,y,$){return y.toUpperCase()+$}),QZ=(({hasOwnProperty:t})=>(r,n)=>t.call(r,n))(Object.prototype),Zae=Yw("RegExp"),$Z=(t,r)=>{const n=Object.getOwnPropertyDescriptors(t),y={};h9(n,($,f)=>{let u;(u=r($,f,t))!==!1&&(y[f]=u||$)}),Object.defineProperties(t,y)},Jae=t=>{$Z(t,(r,n)=>{if(Q_(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const y=t[n];if(Q_(y)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Hae=(t,r)=>{const n={},y=$=>{$.forEach(f=>{n[f]=!0})};return $k(t)?y(t):y(String(t).split(r)),n},Yae=()=>{},Qae=(t,r)=>t!=null&&Number.isFinite(t=+t)?t:r;function $ae(t){return!!(t&&Q_(t.append)&&t[KZ]==="FormData"&&t[CO])}const tie=t=>{const r=new Array(10),n=(y,$)=>{if(p9(y)){if(r.indexOf(y)>=0)return;if(d9(y))return y;if(!("toJSON"in y)){r[$]=y;const f=$k(y)?[]:{};return h9(y,(u,i)=>{const d=n(u,$+1);!t7(d)&&(f[i]=d)}),r[$]=void 0,f}}return y};return n(t,0)},eie=Yw("AsyncFunction"),rie=t=>t&&(p9(t)||Q_(t))&&Q_(t.then)&&Q_(t.catch),tJ=((t,r)=>t?setImmediate:r?((n,y)=>(OS.addEventListener("message",({source:$,data:f})=>{$===OS&&f===n&&y.length&&y.shift()()},!1),$=>{y.push($),OS.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Q_(OS.postMessage)),nie=typeof queueMicrotask<"u"?queueMicrotask.bind(OS):typeof process<"u"&&process.nextTick||tJ,nu={isArray:$k,isArrayBuffer:XZ,isBuffer:d9,isFormData:Eae,isArrayBufferView:vae,isString:bae,isNumber:GZ,isBoolean:xae,isObject:p9,isPlainObject:EO,isEmptyObject:_ae,isReadableStream:Mae,isRequest:Vae,isResponse:Pae,isHeaders:Aae,isUndefined:t7,isDate:wae,isFile:Tae,isReactNativeBlob:Sae,isReactNative:kae,isBlob:Lae,isRegExp:Zae,isFunction:Q_,isStream:Nae,isURLSearchParams:zae,isTypedArray:Wae,isFileList:Cae,forEach:h9,merge:mA,extend:Fae,trim:Rae,stripBOM:Uae,inherits:Iae,toFlatObject:qae,kindOf:NO,kindOfTest:Yw,endsWith:jae,toArray:Dae,forEachEntry:Bae,matchAll:Kae,isHTMLForm:Xae,hasOwnProperty:QZ,hasOwnProp:QZ,reduceDescriptors:$Z,freezeMethods:Jae,toObjectSet:Hae,toCamelCase:Gae,noop:Yae,toFiniteNumber:Qae,findKey:HZ,global:OS,isContextDefined:YZ,isSpecCompliantForm:$ae,toJSONObject:tie,isAsyncFn:eie,isThenable:rie,setImmediate:tJ,asap:nie,isIterable:t=>t!=null&&Q_(t[CO])};let Rf=class pQ extends Error{static from(r,n,y,$,f,u){const i=new pQ(r.message,n||r.code,y,$,f);return i.cause=r,i.name=r.name,r.status!=null&&i.status==null&&(i.status=r.status),u&&Object.assign(i,u),i}constructor(r,n,y,$,f){super(r),Object.defineProperty(this,"message",{value:r,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),y&&(this.config=y),$&&(this.request=$),f&&(this.response=f,this.status=f.status)}toJSON(){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:nu.toJSONObject(this.config),code:this.code,status:this.status}}};Rf.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Rf.ERR_BAD_OPTION="ERR_BAD_OPTION",Rf.ECONNABORTED="ECONNABORTED",Rf.ETIMEDOUT="ETIMEDOUT",Rf.ERR_NETWORK="ERR_NETWORK",Rf.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Rf.ERR_DEPRECATED="ERR_DEPRECATED",Rf.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Rf.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Rf.ERR_CANCELED="ERR_CANCELED",Rf.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Rf.ERR_INVALID_URL="ERR_INVALID_URL";const aie=null;function yA(t){return nu.isPlainObject(t)||nu.isArray(t)}function eJ(t){return nu.endsWith(t,"[]")?t.slice(0,-2):t}function gA(t,r,n){return t?t.concat(r).map(function($,f){return $=eJ($),!n&&f?"["+$+"]":$}).join(n?".":""):r}function iie(t){return nu.isArray(t)&&!t.some(yA)}const oie=nu.toFlatObject(nu,{},null,function(r){return/^is[A-Z]/.test(r)});function zO(t,r,n){if(!nu.isObject(t))throw new TypeError("target must be an object");r=r||new FormData,n=nu.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(s,c){return!nu.isUndefined(c[s])});const y=n.metaTokens,$=n.visitor||a,f=n.dots,u=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&nu.isSpecCompliantForm(r);if(!nu.isFunction($))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(nu.isDate(p))return p.toISOString();if(nu.isBoolean(p))return p.toString();if(!d&&nu.isBlob(p))throw new Rf("Blob is not supported. Use a Buffer instead.");return nu.isArrayBuffer(p)||nu.isTypedArray(p)?d&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function a(p,s,c){let o=p;if(nu.isReactNative(r)&&nu.isReactNativeBlob(p))return r.append(gA(c,s,f),l(p)),!1;if(p&&!c&&typeof p=="object"){if(nu.endsWith(s,"{}"))s=y?s:s.slice(0,-2),p=JSON.stringify(p);else if(nu.isArray(p)&&iie(p)||(nu.isFileList(p)||nu.endsWith(s,"[]"))&&(o=nu.toArray(p)))return s=eJ(s),o.forEach(function(v,k){!(nu.isUndefined(v)||v===null)&&r.append(u===!0?gA([s],k,f):u===null?s:s+"[]",l(v))}),!1}return yA(p)?!0:(r.append(gA(c,s,f),l(p)),!1)}const S=[],T=Object.assign(oie,{defaultVisitor:a,convertValue:l,isVisitable:yA});function b(p,s){if(!nu.isUndefined(p)){if(S.indexOf(p)!==-1)throw Error("Circular reference detected in "+s.join("."));S.push(p),nu.forEach(p,function(o,h){(!(nu.isUndefined(o)||o===null)&&$.call(r,o,nu.isString(h)?h.trim():h,s,T))===!0&&b(o,s?s.concat(h):[h])}),S.pop()}}if(!nu.isObject(t))throw new TypeError("data must be an object");return b(t),r}function rJ(t){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(y){return r[y]})}function vA(t,r){this._pairs=[],t&&zO(t,this,r)}const nJ=vA.prototype;nJ.append=function(r,n){this._pairs.push([r,n])},nJ.toString=function(r){const n=r?function(y){return r.call(this,y,rJ)}:rJ;return this._pairs.map(function($){return n($[0])+"="+n($[1])},"").join("&")};function sie(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aJ(t,r,n){if(!r)return t;const y=n&&n.encode||sie,$=nu.isFunction(n)?{serialize:n}:n,f=$&&$.serialize;let u;if(f?u=f(r,$):u=nu.isURLSearchParams(r)?r.toString():new vA(r,$).toString(y),u){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+u}return t}class iJ{constructor(){this.handlers=[]}use(r,n,y){return this.handlers.push({fulfilled:r,rejected:n,synchronous:y?y.synchronous:!1,runWhen:y?y.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){nu.forEach(this.handlers,function(y){y!==null&&r(y)})}}const bA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},lie={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:vA,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xA=typeof window<"u"&&typeof document<"u",_A=typeof navigator=="object"&&navigator||void 0,cie=xA&&(!_A||["ReactNative","NativeScript","NS"].indexOf(_A.product)<0),uie=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",die=xA&&window.location.href||"http://localhost",Wx={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xA,hasStandardBrowserEnv:cie,hasStandardBrowserWebWorkerEnv:uie,navigator:_A,origin:die},Symbol.toStringTag,{value:"Module"})),...lie};function pie(t,r){return zO(t,new Wx.classes.URLSearchParams,{visitor:function(n,y,$,f){return Wx.isNode&&nu.isBuffer(n)?(this.append(y,n.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)},...r})}function hie(t){return nu.matchAll(/\w+|\[(\w*)]/g,t).map(r=>r[0]==="[]"?"":r[1]||r[0])}function fie(t){const r={},n=Object.keys(t);let y;const $=n.length;let f;for(y=0;y<$;y++)f=n[y],r[f]=t[f];return r}function oJ(t){function r(n,y,$,f){let u=n[f++];if(u==="__proto__")return!0;const i=Number.isFinite(+u),d=f>=n.length;return u=!u&&nu.isArray($)?$.length:u,d?(nu.hasOwnProp($,u)?$[u]=[$[u],y]:$[u]=y,!i):((!$[u]||!nu.isObject($[u]))&&($[u]=[]),r(n,y,$[u],f)&&nu.isArray($[u])&&($[u]=fie($[u])),!i)}if(nu.isFormData(t)&&nu.isFunction(t.entries)){const n={};return nu.forEachEntry(t,(y,$)=>{r(hie(y),$,n,0)}),n}return null}function mie(t,r,n){if(nu.isString(t))try{return(r||JSON.parse)(t),nu.trim(t)}catch(y){if(y.name!=="SyntaxError")throw y}return(n||JSON.stringify)(t)}const f9={transitional:bA,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){const y=n.getContentType()||"",$=y.indexOf("application/json")>-1,f=nu.isObject(r);if(f&&nu.isHTMLForm(r)&&(r=new FormData(r)),nu.isFormData(r))return $?JSON.stringify(oJ(r)):r;if(nu.isArrayBuffer(r)||nu.isBuffer(r)||nu.isStream(r)||nu.isFile(r)||nu.isBlob(r)||nu.isReadableStream(r))return r;if(nu.isArrayBufferView(r))return r.buffer;if(nu.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let i;if(f){if(y.indexOf("application/x-www-form-urlencoded")>-1)return pie(r,this.formSerializer).toString();if((i=nu.isFileList(r))||y.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return zO(i?{"files[]":r}:r,d&&new d,this.formSerializer)}}return f||$?(n.setContentType("application/json",!1),mie(r)):r}],transformResponse:[function(r){const n=this.transitional||f9.transitional,y=n&&n.forcedJSONParsing,$=this.responseType==="json";if(nu.isResponse(r)||nu.isReadableStream(r))return r;if(r&&nu.isString(r)&&(y&&!this.responseType||$)){const u=!(n&&n.silentJSONParsing)&&$;try{return JSON.parse(r,this.parseReviver)}catch(i){if(u)throw i.name==="SyntaxError"?Rf.from(i,Rf.ERR_BAD_RESPONSE,this,null,this.response):i}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wx.classes.FormData,Blob:Wx.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};nu.forEach(["delete","get","head","post","put","patch"],t=>{f9.headers[t]={}});const yie=nu.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"]),gie=t=>{const r={};let n,y,$;return t&&t.split(`
7994
7994
  `).forEach(function(u){$=u.indexOf(":"),n=u.substring(0,$).trim().toLowerCase(),y=u.substring($+1).trim(),!(!n||r[n]&&yie[n])&&(n==="set-cookie"?r[n]?r[n].push(y):r[n]=[y]:r[n]=r[n]?r[n]+", "+y:y)}),r},sJ=Symbol("internals");function m9(t){return t&&String(t).trim().toLowerCase()}function MO(t){return t===!1||t==null?t:nu.isArray(t)?t.map(MO):String(t)}function vie(t){const r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let y;for(;y=n.exec(t);)r[y[1]]=y[2];return r}const bie=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function wA(t,r,n,y,$){if(nu.isFunction(y))return y.call(this,r,n);if($&&(r=n),!!nu.isString(r)){if(nu.isString(y))return r.indexOf(y)!==-1;if(nu.isRegExp(y))return y.test(r)}}function xie(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,n,y)=>n.toUpperCase()+y)}function _ie(t,r){const n=nu.toCamelCase(" "+r);["get","set","has"].forEach(y=>{Object.defineProperty(t,y+n,{value:function($,f,u){return this[y].call(this,r,$,f,u)},configurable:!0})})}let $_=class{constructor(r){r&&this.set(r)}set(r,n,y){const $=this;function f(i,d,l){const a=m9(d);if(!a)throw new Error("header name must be a non-empty string");const S=nu.findKey($,a);(!S||$[S]===void 0||l===!0||l===void 0&&$[S]!==!1)&&($[S||d]=MO(i))}const u=(i,d)=>nu.forEach(i,(l,a)=>f(l,a,d));if(nu.isPlainObject(r)||r instanceof this.constructor)u(r,n);else if(nu.isString(r)&&(r=r.trim())&&!bie(r))u(gie(r),n);else if(nu.isObject(r)&&nu.isIterable(r)){let i={},d,l;for(const a of r){if(!nu.isArray(a))throw TypeError("Object iterator must return a key-value pair");i[l=a[0]]=(d=i[l])?nu.isArray(d)?[...d,a[1]]:[d,a[1]]:a[1]}u(i,n)}else r!=null&&f(n,r,y);return this}get(r,n){if(r=m9(r),r){const y=nu.findKey(this,r);if(y){const $=this[y];if(!n)return $;if(n===!0)return vie($);if(nu.isFunction(n))return n.call(this,$,y);if(nu.isRegExp(n))return n.exec($);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,n){if(r=m9(r),r){const y=nu.findKey(this,r);return!!(y&&this[y]!==void 0&&(!n||wA(this,this[y],y,n)))}return!1}delete(r,n){const y=this;let $=!1;function f(u){if(u=m9(u),u){const i=nu.findKey(y,u);i&&(!n||wA(y,y[i],i,n))&&(delete y[i],$=!0)}}return nu.isArray(r)?r.forEach(f):f(r),$}clear(r){const n=Object.keys(this);let y=n.length,$=!1;for(;y--;){const f=n[y];(!r||wA(this,this[f],f,r,!0))&&(delete this[f],$=!0)}return $}normalize(r){const n=this,y={};return nu.forEach(this,($,f)=>{const u=nu.findKey(y,f);if(u){n[u]=MO($),delete n[f];return}const i=r?xie(f):String(f).trim();i!==f&&delete n[f],n[i]=MO($),y[i]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const n=Object.create(null);return nu.forEach(this,(y,$)=>{y!=null&&y!==!1&&(n[$]=r&&nu.isArray(y)?y.join(", "):y)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,n])=>r+": "+n).join(`
7995
7995
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...n){const y=new this(r);return n.forEach($=>y.set($)),y}static accessor(r){const y=(this[sJ]=this[sJ]={accessors:{}}).accessors,$=this.prototype;function f(u){const i=m9(u);y[i]||(_ie($,u),y[i]=!0)}return nu.isArray(r)?r.forEach(f):f(r),this}};$_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),nu.reduceDescriptors($_.prototype,({value:t},r)=>{let n=r[0].toUpperCase()+r.slice(1);return{get:()=>t,set(y){this[n]=y}}}),nu.freezeMethods($_);function TA(t,r){const n=this||f9,y=r||n,$=$_.from(y.headers);let f=y.data;return nu.forEach(t,function(i){f=i.call(n,f,$.normalize(),r?r.status:void 0)}),$.normalize(),f}function lJ(t){return!!(t&&t.__CANCEL__)}let y9=class extends Rf{constructor(r,n,y){super(r??"canceled",Rf.ERR_CANCELED,n,y),this.name="CanceledError",this.__CANCEL__=!0}};function cJ(t,r,n){const y=n.config.validateStatus;!n.status||!y||y(n.status)?t(n):r(new Rf("Request failed with status code "+n.status,[Rf.ERR_BAD_REQUEST,Rf.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function wie(t){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""}function Tie(t,r){t=t||10;const n=new Array(t),y=new Array(t);let $=0,f=0,u;return r=r!==void 0?r:1e3,function(d){const l=Date.now(),a=y[f];u||(u=l),n[$]=d,y[$]=l;let S=f,T=0;for(;S!==$;)T+=n[S++],S=S%t;if($=($+1)%t,$===f&&(f=(f+1)%t),l-u<r)return;const b=a&&l-a;return b?Math.round(T*1e3/b):void 0}}function Sie(t,r){let n=0,y=1e3/r,$,f;const u=(l,a=Date.now())=>{n=a,$=null,f&&(clearTimeout(f),f=null),t(...l)};return[(...l)=>{const a=Date.now(),S=a-n;S>=y?u(l,a):($=l,f||(f=setTimeout(()=>{f=null,u($)},y-S)))},()=>$&&u($)]}const VO=(t,r,n=3)=>{let y=0;const $=Tie(50,250);return Sie(f=>{const u=f.loaded,i=f.lengthComputable?f.total:void 0,d=u-y,l=$(d),a=u<=i;y=u;const S={loaded:u,total:i,progress:i?u/i:void 0,bytes:d,rate:l||void 0,estimated:l&&i&&a?(i-u)/l:void 0,event:f,lengthComputable:i!=null,[r?"download":"upload"]:!0};t(S)},n)},uJ=(t,r)=>{const n=t!=null;return[y=>r[0]({lengthComputable:n,total:t,loaded:y}),r[1]]},dJ=t=>(...r)=>nu.asap(()=>t(...r)),kie=Wx.hasStandardBrowserEnv?((t,r)=>n=>(n=new URL(n,Wx.origin),t.protocol===n.protocol&&t.host===n.host&&(r||t.port===n.port)))(new URL(Wx.origin),Wx.navigator&&/(msie|trident)/i.test(Wx.navigator.userAgent)):()=>!0,Lie=Wx.hasStandardBrowserEnv?{write(t,r,n,y,$,f,u){if(typeof document>"u")return;const i=[`${t}=${encodeURIComponent(r)}`];nu.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),nu.isString(y)&&i.push(`path=${y}`),nu.isString($)&&i.push(`domain=${$}`),f===!0&&i.push("secure"),nu.isString(u)&&i.push(`SameSite=${u}`),document.cookie=i.join("; ")},read(t){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Cie(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Nie(t,r){return r?t.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):t}function pJ(t,r,n){let y=!Cie(r);return t&&(y||n==!1)?Nie(t,r):r}const hJ=t=>t instanceof $_?{...t}:t;function ES(t,r){r=r||{};const n={};function y(l,a,S,T){return nu.isPlainObject(l)&&nu.isPlainObject(a)?nu.merge.call({caseless:T},l,a):nu.isPlainObject(a)?nu.merge({},a):nu.isArray(a)?a.slice():a}function $(l,a,S,T){if(nu.isUndefined(a)){if(!nu.isUndefined(l))return y(void 0,l,S,T)}else return y(l,a,S,T)}function f(l,a){if(!nu.isUndefined(a))return y(void 0,a)}function u(l,a){if(nu.isUndefined(a)){if(!nu.isUndefined(l))return y(void 0,l)}else return y(void 0,a)}function i(l,a,S){if(S in r)return y(l,a);if(S in t)return y(void 0,l)}const d={url:f,method:f,data:f,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:i,headers:(l,a,S)=>$(hJ(l),hJ(a),S,!0)};return nu.forEach(Object.keys({...t,...r}),function(a){if(a==="__proto__"||a==="constructor"||a==="prototype")return;const S=nu.hasOwnProp(d,a)?d[a]:$,T=S(t[a],r[a],a);nu.isUndefined(T)&&S!==i||(n[a]=T)}),n}const fJ=t=>{const r=ES({},t);let{data:n,withXSRFToken:y,xsrfHeaderName:$,xsrfCookieName:f,headers:u,auth:i}=r;if(r.headers=u=$_.from(u),r.url=aJ(pJ(r.baseURL,r.url,r.allowAbsoluteUrls),t.params,t.paramsSerializer),i&&u.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),nu.isFormData(n)){if(Wx.hasStandardBrowserEnv||Wx.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(nu.isFunction(n.getHeaders)){const d=n.getHeaders(),l=["content-type","content-length"];Object.entries(d).forEach(([a,S])=>{l.includes(a.toLowerCase())&&u.set(a,S)})}}if(Wx.hasStandardBrowserEnv&&(y&&nu.isFunction(y)&&(y=y(r)),y||y!==!1&&kie(r.url))){const d=$&&f&&Lie.read(f);d&&u.set($,d)}return r},Oie=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,y){const $=fJ(t);let f=$.data;const u=$_.from($.headers).normalize();let{responseType:i,onUploadProgress:d,onDownloadProgress:l}=$,a,S,T,b,p;function s(){b&&b(),p&&p(),$.cancelToken&&$.cancelToken.unsubscribe(a),$.signal&&$.signal.removeEventListener("abort",a)}let c=new XMLHttpRequest;c.open($.method.toUpperCase(),$.url,!0),c.timeout=$.timeout;function o(){if(!c)return;const v=$_.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),L={data:!i||i==="text"||i==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:v,config:t,request:c};cJ(function(P){n(P),s()},function(P){y(P),s()},L),c=null}"onloadend"in c?c.onloadend=o:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(o)},c.onabort=function(){c&&(y(new Rf("Request aborted",Rf.ECONNABORTED,t,c)),c=null)},c.onerror=function(k){const L=k&&k.message?k.message:"Network Error",E=new Rf(L,Rf.ERR_NETWORK,t,c);E.event=k||null,y(E),c=null},c.ontimeout=function(){let k=$.timeout?"timeout of "+$.timeout+"ms exceeded":"timeout exceeded";const L=$.transitional||bA;$.timeoutErrorMessage&&(k=$.timeoutErrorMessage),y(new Rf(k,L.clarifyTimeoutError?Rf.ETIMEDOUT:Rf.ECONNABORTED,t,c)),c=null},f===void 0&&u.setContentType(null),"setRequestHeader"in c&&nu.forEach(u.toJSON(),function(k,L){c.setRequestHeader(L,k)}),nu.isUndefined($.withCredentials)||(c.withCredentials=!!$.withCredentials),i&&i!=="json"&&(c.responseType=$.responseType),l&&([T,p]=VO(l,!0),c.addEventListener("progress",T)),d&&c.upload&&([S,b]=VO(d),c.upload.addEventListener("progress",S),c.upload.addEventListener("loadend",b)),($.cancelToken||$.signal)&&(a=v=>{c&&(y(!v||v.type?new y9(null,t,c):v),c.abort(),c=null)},$.cancelToken&&$.cancelToken.subscribe(a),$.signal&&($.signal.aborted?a():$.signal.addEventListener("abort",a)));const h=wie($.url);if(h&&Wx.protocols.indexOf(h)===-1){y(new Rf("Unsupported protocol "+h+":",Rf.ERR_BAD_REQUEST,t));return}c.send(f||null)})},Eie=(t,r)=>{const{length:n}=t=t?t.filter(Boolean):[];if(r||n){let y=new AbortController,$;const f=function(l){if(!$){$=!0,i();const a=l instanceof Error?l:this.reason;y.abort(a instanceof Rf?a:new y9(a instanceof Error?a.message:a))}};let u=r&&setTimeout(()=>{u=null,f(new Rf(`timeout of ${r}ms exceeded`,Rf.ETIMEDOUT))},r);const i=()=>{t&&(u&&clearTimeout(u),u=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(f):l.removeEventListener("abort",f)}),t=null)};t.forEach(l=>l.addEventListener("abort",f));const{signal:d}=y;return d.unsubscribe=()=>nu.asap(i),d}},zie=function*(t,r){let n=t.byteLength;if(n<r){yield t;return}let y=0,$;for(;y<n;)$=y+r,yield t.slice(y,$),y=$},Mie=async function*(t,r){for await(const n of Vie(t))yield*zie(n,r)},Vie=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const r=t.getReader();try{for(;;){const{done:n,value:y}=await r.read();if(n)break;yield y}}finally{await r.cancel()}},mJ=(t,r,n,y)=>{const $=Mie(t,r);let f=0,u,i=d=>{u||(u=!0,y&&y(d))};return new ReadableStream({async pull(d){try{const{done:l,value:a}=await $.next();if(l){i(),d.close();return}let S=a.byteLength;if(n){let T=f+=S;n(T)}d.enqueue(new Uint8Array(a))}catch(l){throw i(l),l}},cancel(d){return i(d),$.return()}},{highWaterMark:2})},yJ=64*1024,{isFunction:PO}=nu,Pie=(({Request:t,Response:r})=>({Request:t,Response:r}))(nu.global),{ReadableStream:gJ,TextEncoder:vJ}=nu.global,bJ=(t,...r)=>{try{return!!t(...r)}catch{return!1}},Aie=t=>{t=nu.merge.call({skipUndefined:!0},Pie,t);const{fetch:r,Request:n,Response:y}=t,$=r?PO(r):typeof fetch=="function",f=PO(n),u=PO(y);if(!$)return!1;const i=$&&PO(gJ),d=$&&(typeof vJ=="function"?(p=>s=>p.encode(s))(new vJ):async p=>new Uint8Array(await new n(p).arrayBuffer())),l=f&&i&&bJ(()=>{let p=!1;const s=new n(Wx.origin,{body:new gJ,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!s}),a=u&&i&&bJ(()=>nu.isReadableStream(new y("").body)),S={stream:a&&(p=>p.body)};$&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!S[p]&&(S[p]=(s,c)=>{let o=s&&s[p];if(o)return o.call(s);throw new Rf(`Response type '${p}' is not supported`,Rf.ERR_NOT_SUPPORT,c)})});const T=async p=>{if(p==null)return 0;if(nu.isBlob(p))return p.size;if(nu.isSpecCompliantForm(p))return(await new n(Wx.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(nu.isArrayBufferView(p)||nu.isArrayBuffer(p))return p.byteLength;if(nu.isURLSearchParams(p)&&(p=p+""),nu.isString(p))return(await d(p)).byteLength},b=async(p,s)=>{const c=nu.toFiniteNumber(p.getContentLength());return c??T(s)};return async p=>{let{url:s,method:c,data:o,signal:h,cancelToken:v,timeout:k,onDownloadProgress:L,onUploadProgress:E,responseType:P,headers:V,withCredentials:I="same-origin",fetchOptions:j}=fJ(p),F=r||fetch;P=P?(P+"").toLowerCase():"text";let D=Eie([h,v&&v.toAbortSignal()],k),U=null;const M=D&&D.unsubscribe&&(()=>{D.unsubscribe()});let X;try{if(E&&l&&c!=="get"&&c!=="head"&&(X=await b(V,o))!==0){let bt=new n(s,{method:"POST",body:o,duplex:"half"}),xt;if(nu.isFormData(o)&&(xt=bt.headers.get("content-type"))&&V.setContentType(xt),bt.body){const[Pt,qt]=uJ(X,VO(dJ(E)));o=mJ(bt.body,yJ,Pt,qt)}}nu.isString(I)||(I=I?"include":"omit");const O=f&&"credentials"in n.prototype,Y={...j,signal:D,method:c.toUpperCase(),headers:V.normalize().toJSON(),body:o,duplex:"half",credentials:O?I:void 0};U=f&&new n(s,Y);let st=await(f?F(U,j):F(s,Y));const mt=a&&(P==="stream"||P==="response");if(a&&(L||mt&&M)){const bt={};["status","statusText","headers"].forEach(_t=>{bt[_t]=st[_t]});const xt=nu.toFiniteNumber(st.headers.get("content-length")),[Pt,qt]=L&&uJ(xt,VO(dJ(L),!0))||[];st=new y(mJ(st.body,yJ,Pt,()=>{qt&&qt(),M&&M()}),bt)}P=P||"text";let yt=await S[nu.findKey(S,P)||"text"](st,p);return!mt&&M&&M(),await new Promise((bt,xt)=>{cJ(bt,xt,{data:yt,headers:$_.from(st.headers),status:st.status,statusText:st.statusText,config:p,request:U})})}catch(O){throw M&&M(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new Rf("Network Error",Rf.ERR_NETWORK,p,U,O&&O.response),{cause:O.cause||O}):Rf.from(O,O&&O.code,p,U,O&&O.response)}}},Rie=new Map,xJ=t=>{let r=t&&t.env||{};const{fetch:n,Request:y,Response:$}=r,f=[y,$,n];let u=f.length,i=u,d,l,a=Rie;for(;i--;)d=f[i],l=a.get(d),l===void 0&&a.set(d,l=i?new Map:Aie(r)),a=l;return l};xJ();const SA={http:aie,xhr:Oie,fetch:{get:xJ}};nu.forEach(SA,(t,r)=>{if(t){try{Object.defineProperty(t,"name",{value:r})}catch{}Object.defineProperty(t,"adapterName",{value:r})}});const _J=t=>`- ${t}`,Fie=t=>nu.isFunction(t)||t===null||t===!1;function Uie(t,r){t=nu.isArray(t)?t:[t];const{length:n}=t;let y,$;const f={};for(let u=0;u<n;u++){y=t[u];let i;if($=y,!Fie(y)&&($=SA[(i=String(y)).toLowerCase()],$===void 0))throw new Rf(`Unknown adapter '${i}'`);if($&&(nu.isFunction($)||($=$.get(r))))break;f[i||"#"+u]=$}if(!$){const u=Object.entries(f).map(([d,l])=>`adapter ${d} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=n?u.length>1?`since :
7996
7996
  `+u.map(_J).join(`