@golstats/gsc-reports 1.0.111 → 1.0.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FilterConditions-55d68355-DMqzcKBO-Dmc6GtF3-B2eli6C0.js → FilterConditions-55d68355-DMqzcKBO-BP3T-S5X-BNQBxe_x.js} +1 -1
- package/dist/{FilterField-59a73e38-CNaE03Ge-DJly2NDi-BfN5fAh8.js → FilterField-59a73e38-CNaE03Ge-CWGsvphp-CaynxT4U.js} +1 -1
- package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-aw9A8mpy-woAxs_HE.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-DpQ3voNn-CjTBBZvu.js} +1 -1
- package/dist/gsc-reports.css +1 -1
- package/dist/gsc-reports.es.js +1 -1
- package/dist/gsc-reports.umd.js +1 -1
- package/dist/{index-BcjBCxxB.js → index-vdEA6u28.js} +28 -10
- package/package.json +2 -2
package/dist/gsc-reports.es.js
CHANGED
package/dist/gsc-reports.umd.js
CHANGED
|
@@ -7982,7 +7982,7 @@ uniform ${gi} ${vi} u_${$i};
|
|
|
7982
7982
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const a=new this(e);return r.forEach(v=>a.set(v)),a}static accessor(e){const r=(this[dZ]=this[dZ]={accessors:{}}).accessors,a=this.prototype;function v($){const h=s9($);r[h]||(aZe(a,$),r[h]=!0)}return tu.isArray(e)?e.forEach(v):v(e),this}};H_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),tu.reduceDescriptors(H_.prototype,({value:e},r)=>{let a=r[0].toUpperCase()+r.slice(1);return{get:()=>e,set(v){this[a]=v}}}),tu.freezeMethods(H_);function HP(e,r){const a=this||o9,v=r||a,$=H_.from(v.headers);let h=v.data;return tu.forEach(e,function(u){h=u.call(a,h,$.normalize(),r?r.status:void 0)}),$.normalize(),h}function pZ(e){return!!(e&&e.__CANCEL__)}function Yk(e,r,a){Am.call(this,e??"canceled",Am.ERR_CANCELED,r,a),this.name="CanceledError"}tu.inherits(Yk,Am,{__CANCEL__:!0});function hZ(e,r,a){const v=a.config.validateStatus;!a.status||!v||v(a.status)?e(a):r(new Am("Request failed with status code "+a.status,[Am.ERR_BAD_REQUEST,Am.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function nZe(e){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}function iZe(e,r){e=e||10;const a=new Array(e),v=new Array(e);let $=0,h=0,u;return r=r!==void 0?r:1e3,function(i){const p=Date.now(),l=v[h];u||(u=p),a[$]=i,v[$]=p;let n=h,k=0;for(;n!==$;)k+=a[n++],n=n%e;if($=($+1)%e,$===h&&(h=(h+1)%e),p-u<r)return;const T=l&&p-l;return T?Math.round(k*1e3/T):void 0}}function oZe(e,r){let a=0,v=1e3/r,$,h;const u=(i,p=Date.now())=>{a=p,$=null,h&&(clearTimeout(h),h=null),e(...i)};return[(...i)=>{const p=Date.now(),l=p-a;l>=v?u(i,p):($=i,h||(h=setTimeout(()=>{h=null,u($)},v-l)))},()=>$&&u($)]}const dN=(e,r,a=3)=>{let v=0;const $=iZe(50,250);return oZe(h=>{const u=h.loaded,i=h.lengthComputable?h.total:void 0,p=u-v,l=$(p),n=u<=i;v=u;const k={loaded:u,total:i,progress:i?u/i:void 0,bytes:p,rate:l||void 0,estimated:l&&i&&n?(i-u)/l:void 0,event:h,lengthComputable:i!=null,[r?"download":"upload"]:!0};e(k)},a)},fZ=(e,r)=>{const a=e!=null;return[v=>r[0]({lengthComputable:a,total:e,loaded:v}),r[1]]},mZ=e=>(...r)=>tu.asap(()=>e(...r)),sZe=Wx.hasStandardBrowserEnv?((e,r)=>a=>(a=new URL(a,Wx.origin),e.protocol===a.protocol&&e.host===a.host&&(r||e.port===a.port)))(new URL(Wx.origin),Wx.navigator&&/(msie|trident)/i.test(Wx.navigator.userAgent)):()=>!0,lZe=Wx.hasStandardBrowserEnv?{write(e,r,a,v,$,h,u){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(r)}`];tu.isNumber(a)&&i.push(`expires=${new Date(a).toUTCString()}`),tu.isString(v)&&i.push(`path=${v}`),tu.isString($)&&i.push(`domain=${$}`),h===!0&&i.push("secure"),tu.isString(u)&&i.push(`SameSite=${u}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function cZe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function uZe(e,r){return r?e.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):e}function yZ(e,r,a){let v=!cZe(r);return e&&(v||a==!1)?uZe(e,r):r}const gZ=e=>e instanceof H_?{...e}:e;function LS(e,r){r=r||{};const a={};function v(l,n,k,T){return tu.isPlainObject(l)&&tu.isPlainObject(n)?tu.merge.call({caseless:T},l,n):tu.isPlainObject(n)?tu.merge({},n):tu.isArray(n)?n.slice():n}function $(l,n,k,T){if(tu.isUndefined(n)){if(!tu.isUndefined(l))return v(void 0,l,k,T)}else return v(l,n,k,T)}function h(l,n){if(!tu.isUndefined(n))return v(void 0,n)}function u(l,n){if(tu.isUndefined(n)){if(!tu.isUndefined(l))return v(void 0,l)}else return v(void 0,n)}function i(l,n,k){if(k in r)return v(l,n);if(k in e)return v(void 0,l)}const p={url:h,method:h,data:h,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,n,k)=>$(gZ(l),gZ(n),k,!0)};return tu.forEach(Object.keys({...e,...r}),function(l){const n=p[l]||$,k=n(e[l],r[l],l);tu.isUndefined(k)&&n!==i||(a[l]=k)}),a}const vZ=e=>{const r=LS({},e);let{data:a,withXSRFToken:v,xsrfHeaderName:$,xsrfCookieName:h,headers:u,auth:i}=r;if(r.headers=u=H_.from(u),r.url=sZ(yZ(r.baseURL,r.url,r.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&u.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),tu.isFormData(a)){if(Wx.hasStandardBrowserEnv||Wx.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(tu.isFunction(a.getHeaders)){const p=a.getHeaders(),l=["content-type","content-length"];Object.entries(p).forEach(([n,k])=>{l.includes(n.toLowerCase())&&u.set(n,k)})}}if(Wx.hasStandardBrowserEnv&&(v&&tu.isFunction(v)&&(v=v(r)),v||v!==!1&&sZe(r.url))){const p=$&&h&&lZe.read(h);p&&u.set($,p)}return r},dZe=typeof XMLHttpRequest<"u",pZe=dZe&&function(e){return new Promise(function(r,a){const v=vZ(e);let $=v.data;const h=H_.from(v.headers).normalize();let{responseType:u,onUploadProgress:i,onDownloadProgress:p}=v,l,n,k,T,x;function d(){T&&T(),x&&x(),v.cancelToken&&v.cancelToken.unsubscribe(l),v.signal&&v.signal.removeEventListener("abort",l)}let o=new XMLHttpRequest;o.open(v.method.toUpperCase(),v.url,!0),o.timeout=v.timeout;function c(){if(!o)return;const f=H_.from("getAllResponseHeaders"in o&&o.getAllResponseHeaders()),g={data:!u||u==="text"||u==="json"?o.responseText:o.response,status:o.status,statusText:o.statusText,headers:f,config:e,request:o};hZ(function(S){r(S),d()},function(S){a(S),d()},g),o=null}"onloadend"in o?o.onloadend=c:o.onreadystatechange=function(){!o||o.readyState!==4||o.status===0&&!(o.responseURL&&o.responseURL.indexOf("file:")===0)||setTimeout(c)},o.onabort=function(){o&&(a(new Am("Request aborted",Am.ECONNABORTED,e,o)),o=null)},o.onerror=function(f){const g=f&&f.message?f.message:"Network Error",S=new Am(g,Am.ERR_NETWORK,e,o);S.event=f||null,a(S),o=null},o.ontimeout=function(){let f=v.timeout?"timeout of "+v.timeout+"ms exceeded":"timeout exceeded";const g=v.transitional||cZ;v.timeoutErrorMessage&&(f=v.timeoutErrorMessage),a(new Am(f,g.clarifyTimeoutError?Am.ETIMEDOUT:Am.ECONNABORTED,e,o)),o=null},$===void 0&&h.setContentType(null),"setRequestHeader"in o&&tu.forEach(h.toJSON(),function(f,g){o.setRequestHeader(g,f)}),tu.isUndefined(v.withCredentials)||(o.withCredentials=!!v.withCredentials),u&&u!=="json"&&(o.responseType=v.responseType),p&&([k,x]=dN(p,!0),o.addEventListener("progress",k)),i&&o.upload&&([n,T]=dN(i),o.upload.addEventListener("progress",n),o.upload.addEventListener("loadend",T)),(v.cancelToken||v.signal)&&(l=f=>{o&&(a(!f||f.type?new Yk(null,e,o):f),o.abort(),o=null)},v.cancelToken&&v.cancelToken.subscribe(l),v.signal&&(v.signal.aborted?l():v.signal.addEventListener("abort",l)));const s=nZe(v.url);if(s&&Wx.protocols.indexOf(s)===-1){a(new Am("Unsupported protocol "+s+":",Am.ERR_BAD_REQUEST,e));return}o.send($||null)})},hZe=(e,r)=>{const{length:a}=e=e?e.filter(Boolean):[];if(r||a){let v=new AbortController,$;const h=function(l){if(!$){$=!0,i();const n=l instanceof Error?l:this.reason;v.abort(n instanceof Am?n:new Yk(n instanceof Error?n.message:n))}};let u=r&&setTimeout(()=>{u=null,h(new Am(`timeout ${r} of ms exceeded`,Am.ETIMEDOUT))},r);const i=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(h):l.removeEventListener("abort",h)}),e=null)};e.forEach(l=>l.addEventListener("abort",h));const{signal:p}=v;return p.unsubscribe=()=>tu.asap(i),p}},fZe=function*(e,r){let a=e.byteLength;if(a<r){yield e;return}let v=0,$;for(;v<a;)$=v+r,yield e.slice(v,$),v=$},mZe=async function*(e,r){for await(const a of yZe(e))yield*fZe(a,r)},yZe=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const r=e.getReader();try{for(;;){const{done:a,value:v}=await r.read();if(a)break;yield v}}finally{await r.cancel()}},bZ=(e,r,a,v)=>{const $=mZe(e,r);let h=0,u,i=p=>{u||(u=!0,v&&v(p))};return new ReadableStream({async pull(p){try{const{done:l,value:n}=await $.next();if(l){i(),p.close();return}let k=n.byteLength;if(a){let T=h+=k;a(T)}p.enqueue(new Uint8Array(n))}catch(l){throw i(l),l}},cancel(p){return i(p),$.return()}},{highWaterMark:2})},xZ=64*1024,{isFunction:pN}=tu,gZe=(({Request:e,Response:r})=>({Request:e,Response:r}))(tu.global),{ReadableStream:_Z,TextEncoder:wZ}=tu.global,TZ=(e,...r)=>{try{return!!e(...r)}catch{return!1}},vZe=e=>{e=tu.merge.call({skipUndefined:!0},gZe,e);const{fetch:r,Request:a,Response:v}=e,$=r?pN(r):typeof fetch=="function",h=pN(a),u=pN(v);if(!$)return!1;const i=$&&pN(_Z),p=$&&(typeof wZ=="function"?(d=>o=>d.encode(o))(new wZ):async d=>new Uint8Array(await new a(d).arrayBuffer())),l=h&&i&&TZ(()=>{let d=!1;const o=new a(Wx.origin,{body:new _Z,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!o}),n=u&&i&&TZ(()=>tu.isReadableStream(new v("").body)),k={stream:n&&(d=>d.body)};$&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!k[d]&&(k[d]=(o,c)=>{let s=o&&o[d];if(s)return s.call(o);throw new Am(`Response type '${d}' is not supported`,Am.ERR_NOT_SUPPORT,c)})});const T=async d=>{if(d==null)return 0;if(tu.isBlob(d))return d.size;if(tu.isSpecCompliantForm(d))return(await new a(Wx.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(tu.isArrayBufferView(d)||tu.isArrayBuffer(d))return d.byteLength;if(tu.isURLSearchParams(d)&&(d=d+""),tu.isString(d))return(await p(d)).byteLength},x=async(d,o)=>tu.toFiniteNumber(d.getContentLength())??T(o);return async d=>{let{url:o,method:c,data:s,signal:f,cancelToken:g,timeout:S,onDownloadProgress:L,onUploadProgress:E,responseType:P,headers:V,withCredentials:I="same-origin",fetchOptions:j}=vZ(d),F=r||fetch;P=P?(P+"").toLowerCase():"text";let W=hZe([f,g&&g.toAbortSignal()],S),U=null;const z=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let X;try{if(E&&l&&c!=="get"&&c!=="head"&&(X=await x(V,s))!==0){let be=new a(o,{method:"POST",body:s,duplex:"half"}),xe;if(tu.isFormData(s)&&(xe=be.headers.get("content-type"))&&V.setContentType(xe),be.body){const[Ae,je]=fZ(X,dN(mZ(E)));s=bZ(be.body,xZ,Ae,je)}}tu.isString(I)||(I=I?"include":"omit");const N=h&&"credentials"in a.prototype,Y={...j,signal:W,method:c.toUpperCase(),headers:V.normalize().toJSON(),body:s,duplex:"half",credentials:N?I:void 0};U=h&&new a(o,Y);let se=await(h?F(U,j):F(o,Y));const me=n&&(P==="stream"||P==="response");if(n&&(L||me&&z)){const be={};["status","statusText","headers"].forEach(_e=>{be[_e]=se[_e]});const xe=tu.toFiniteNumber(se.headers.get("content-length")),[Ae,je]=L&&fZ(xe,dN(mZ(L),!0))||[];se=new v(bZ(se.body,xZ,Ae,()=>{je&&je(),z&&z()}),be)}P=P||"text";let ge=await k[tu.findKey(k,P)||"text"](se,d);return!me&&z&&z(),await new Promise((be,xe)=>{hZ(be,xe,{data:ge,headers:H_.from(se.headers),status:se.status,statusText:se.statusText,config:d,request:U})})}catch(N){throw z&&z(),N&&N.name==="TypeError"&&/Load failed|fetch/i.test(N.message)?Object.assign(new Am("Network Error",Am.ERR_NETWORK,d,U),{cause:N.cause||N}):Am.from(N,N&&N.code,d,U)}}},bZe=new Map,SZ=e=>{let r=e&&e.env||{};const{fetch:a,Request:v,Response:$}=r,h=[v,$,a];let u=h.length,i=u,p,l,n=bZe;for(;i--;)p=h[i],l=n.get(p),l===void 0&&n.set(p,l=i?new Map:vZe(r)),n=l;return l};SZ();const YP={http:RGe,xhr:pZe,fetch:{get:SZ}};tu.forEach(YP,(e,r)=>{if(e){try{Object.defineProperty(e,"name",{value:r})}catch{}Object.defineProperty(e,"adapterName",{value:r})}});const kZ=e=>`- ${e}`,xZe=e=>tu.isFunction(e)||e===null||e===!1;function _Ze(e,r){e=tu.isArray(e)?e:[e];const{length:a}=e;let v,$;const h={};for(let u=0;u<a;u++){v=e[u];let i;if($=v,!xZe(v)&&($=YP[(i=String(v)).toLowerCase()],$===void 0))throw new Am(`Unknown adapter '${i}'`);if($&&(tu.isFunction($)||($=$.get(r))))break;h[i||"#"+u]=$}if(!$){const u=Object.entries(h).map(([p,l])=>`adapter ${p} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=a?u.length>1?`since :
|
|
7983
7983
|
`+u.map(kZ).join(`
|
|
7984
7984
|
`):" "+kZ(u[0]):"as no adapter specified";throw new Am("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return $}const LZ={getAdapter:_Ze,adapters:YP};function QP(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Yk(null,e)}function CZ(e){return QP(e),e.headers=H_.from(e.headers),e.data=HP.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),LZ.getAdapter(e.adapter||o9.adapter,e)(e).then(function(r){return QP(e),r.data=HP.call(e,e.transformResponse,r),r.headers=H_.from(r.headers),r},function(r){return pZ(r)||(QP(e),r&&r.response&&(r.response.data=HP.call(e,e.transformResponse,r.response),r.response.headers=H_.from(r.response.headers))),Promise.reject(r)})}const OZ="1.13.0",hN={};["object","boolean","number","function","string","symbol"].forEach((e,r)=>{hN[e]=function(a){return typeof a===e||"a"+(r<1?"n ":" ")+e}});const NZ={};hN.transitional=function(e,r,a){function v($,h){return"[Axios v"+OZ+"] Transitional option '"+$+"'"+h+(a?". "+a:"")}return($,h,u)=>{if(e===!1)throw new Am(v(h," has been removed"+(r?" in "+r:"")),Am.ERR_DEPRECATED);return r&&!NZ[h]&&(NZ[h]=!0,console.warn(v(h," has been deprecated since v"+r+" and will be removed in the near future"))),e?e($,h,u):!0}},hN.spelling=function(e){return(r,a)=>(console.warn(`${a} is likely a misspelling of ${e}`),!0)};function wZe(e,r,a){if(typeof e!="object")throw new Am("options must be an object",Am.ERR_BAD_OPTION_VALUE);const v=Object.keys(e);let $=v.length;for(;$-- >0;){const h=v[$],u=r[h];if(u){const i=e[h],p=i===void 0||u(i,h,e);if(p!==!0)throw new Am("option "+h+" must be "+p,Am.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new Am("Unknown option "+h,Am.ERR_BAD_OPTION)}}const fN={assertOptions:wZe,validators:hN},A5=fN.validators;let CS=class{constructor(e){this.defaults=e||{},this.interceptors={request:new lZ,response:new lZ}}async request(e,r){try{return await this._request(e,r)}catch(a){if(a instanceof Error){let v={};Error.captureStackTrace?Error.captureStackTrace(v):v=new Error;const $=v.stack?v.stack.replace(/^.+\n/,""):"";try{a.stack?$&&!String(a.stack).endsWith($.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
7985
|
-
`+$):a.stack=$}catch{}}throw a}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=LS(this.defaults,r);const{transitional:a,paramsSerializer:v,headers:$}=r;a!==void 0&&fN.assertOptions(a,{silentJSONParsing:A5.transitional(A5.boolean),forcedJSONParsing:A5.transitional(A5.boolean),clarifyTimeoutError:A5.transitional(A5.boolean)},!1),v!=null&&(tu.isFunction(v)?r.paramsSerializer={serialize:v}:fN.assertOptions(v,{encode:A5.function,serialize:A5.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),fN.assertOptions(r,{baseUrl:A5.spelling("baseURL"),withXsrfToken:A5.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let h=$&&tu.merge($.common,$[r.method]);$&&tu.forEach(["delete","get","head","post","put","patch","common"],x=>{delete $[x]}),r.headers=H_.concat(h,$);const u=[];let i=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(i=i&&x.synchronous,u.unshift(x.fulfilled,x.rejected))});const p=[];this.interceptors.response.forEach(function(x){p.push(x.fulfilled,x.rejected)});let l,n=0,k;if(!i){const x=[CZ.bind(this),void 0];for(x.unshift(...u),x.push(...p),k=x.length,l=Promise.resolve(r);n<k;)l=l.then(x[n++],x[n++]);return l}k=u.length;let T=r;for(;n<k;){const x=u[n++],d=u[n++];try{T=x(T)}catch(o){d.call(this,o);break}}try{l=CZ.call(this,T)}catch(x){return Promise.reject(x)}for(n=0,k=p.length;n<k;)l=l.then(p[n++],p[n++]);return l}getUri(e){e=LS(this.defaults,e);const r=yZ(e.baseURL,e.url,e.allowAbsoluteUrls);return sZ(r,e.params,e.paramsSerializer)}};tu.forEach(["delete","get","head","options"],function(e){CS.prototype[e]=function(r,a){return this.request(LS(a||{},{method:e,url:r,data:(a||{}).data}))}}),tu.forEach(["post","put","patch"],function(e){function r(a){return function(v,$,h){return this.request(LS(h||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:v,data:$}))}}CS.prototype[e]=r(),CS.prototype[e+"Form"]=r(!0)});let TZe=class sQ{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function($){a=$});const v=this;this.promise.then($=>{if(!v._listeners)return;let h=v._listeners.length;for(;h-- >0;)v._listeners[h]($);v._listeners=null}),this.promise.then=$=>{let h;const u=new Promise(i=>{v.subscribe(i),h=i}).then($);return u.cancel=function(){v.unsubscribe(h)},u},r(function($,h,u){v.reason||(v.reason=new Yk($,h,u),a(v.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const a=this._listeners.indexOf(r);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const r=new AbortController,a=v=>{r.abort(v)};return this.subscribe(a),r.signal.unsubscribe=()=>this.unsubscribe(a),r.signal}static source(){let r;return{token:new sQ(function(a){r=a}),cancel:r}}};function SZe(e){return function(r){return e.apply(null,r)}}function kZe(e){return tu.isObject(e)&&e.isAxiosError===!0}const $P={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($P).forEach(([e,r])=>{$P[r]=e});function EZ(e){const r=new CS(e),a=XG(CS.prototype.request,r);return tu.extend(a,CS.prototype,r,{allOwnKeys:!0}),tu.extend(a,r,null,{allOwnKeys:!0}),a.create=function(v){return EZ(LS(e,v))},a}const xv=EZ(o9);xv.Axios=CS,xv.CanceledError=Yk,xv.CancelToken=TZe,xv.isCancel=pZ,xv.VERSION=OZ,xv.toFormData=cN,xv.AxiosError=Am,xv.Cancel=xv.CanceledError,xv.all=function(e){return Promise.all(e)},xv.spread=SZe,xv.isAxiosError=kZe,xv.mergeConfig=LS,xv.AxiosHeaders=H_,xv.formToJSON=e=>uZ(tu.isHTMLForm(e)?new FormData(e):e),xv.getAdapter=LZ.getAdapter,xv.HttpStatusCode=$P,xv.default=xv;const{Axios:Zwt,AxiosError:Jwt,CanceledError:Hwt,isCancel:Ywt,CancelToken:Qwt,VERSION:$wt,all:e5t,Cancel:t5t,isAxiosError:r5t,spread:a5t,toFormData:n5t,AxiosHeaders:i5t,HttpStatusCode:o5t,formToJSON:s5t,getAdapter:l5t,mergeConfig:c5t}=xv,LZe=["gameId","playerId","teamId","x","y","momentOfPlay","section","playId","timeSection"];let eA=null;function CZe(){return eA||(eA=LZe.reduce((e,r,a)=>(e[a]=r,e),{})),eA}const OZe=["playId","playerId","teamId","gameId","categoryId","relatedCategoriesIds","x1","y1","x2","y2","x3","y3","fieldSection","momentOfPlay","playingAs","matchLapse","matchResult","matchResultAtMomentOfPlay","relatedPlayId","touchOrder","timeSection"];let tA=null;function NZe(){return tA||(tA=OZe.reduce((e,r,a)=>(e[a]=r,e),{})),tA}const mN={TO_RIGHT:"toRight",TO_LEFT:"toLeft"},EZe={class:"modal-confirmation"},zZe={class:"modal-confirmation__container"},MZe={class:"modal-confirmation__title"},VZe={class:"modal-confirmation"},PZe={class:"modal-confirmation__container"},AZe={class:"modal-confirmation__title"},RZe={class:"specific-plays-titlecontainer"},UZe={class:"specific-plays-title"},FZe={key:0,class:"specific-plays-title-elegibility"},IZe={key:1},qZe={class:"specific-plays-controls"},jZe={class:"specific-plays-controls11"},WZe={class:"radio-container"},DZe={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},KZe={class:"radio-label"},BZe=["src"],XZe={class:"radio-container"},GZe={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZZe={class:"radio-label"},JZe=["src"],HZe={class:"cont-app-value-incement-second"},YZe={class:"contappvalueincementsecond-value"},QZe={key:0},$Ze={class:"contappvalueincementsecond-controls-container"},eJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},tJe={class:"text-icon-info"},rJe={class:"cont-app-value-incement-second"},aJe={class:"contappvalueincementsecond-value"},nJe={key:0},iJe={class:"contappvalueincementsecond-controls-container"},oJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},sJe={class:"text-icon-info"},lJe={class:"cont-app-value-incement-second"},cJe={class:"contappvalueincementsecond-value"},uJe={key:0},dJe={class:"contappvalueincementsecond-controls-container"},pJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},hJe={class:"specific-plays-field__soccer-field"},fJe={class:"game-teams"},mJe={class:"game-teams__team home"},yJe={key:0,class:"team-logo"},gJe=["src"],vJe={class:"game-teams__team away"},bJe={key:0,class:"team-logo"},xJe=["src"],_Je={class:"specific-plays-field__play-buttons__container"},wJe={key:1,class:"specific-plays-radio-container-movil"},TJe={class:"radio-container"},SJe={class:"radio-label"},kJe=["src"],LJe={class:"radio-container"},CJe={class:"radio-label"},OJe=["src"],NJe={key:0,class:"h-separator"},EJe={key:1,class:"corner-info"},zJe={class:"corner-info__team"},MJe=["src"],VJe={class:"corner-info__details"},PJe={class:"corner-info__details__player"},AJe={class:"corner-info__details__how-was"},yN=.6,RJe=5,UJe=10,FJe=600,IJe=600,qJe=5,jJe={__name:"GSCSpecificPlays",props:{widthContainer:{type:Number,default:1280},selectedCategoryId:{type:Number,default:31},teamIdForAnalysis:{type:Number,default:1},playIdForAnalysis:{type:Number,default:null},seasonIdForAnalysis:{type:Number,default:1325},tournamentSelected:{type:Object,default:()=>({})},advancedFilters:{type:Object,default:()=>({areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0})},filters:{type:Object,default:()=>({isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0})},isGameOnly:{type:Boolean,default:!1},game:{type:Object,default:()=>({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"})},gameIdForAnalysis:{type:Number,default:null},isAgainstMode:{type:Boolean,default:!1},areFiltersOpen:{type:Boolean,default:!1},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])},isFieldOnly:{type:Boolean,default:!0},isTemplateMode:{type:Boolean,default:!1},isCornerInfoVisible:{type:Boolean,default:!1},isNullCornerData:{type:Boolean,default:!1}},emits:["open-media-player","corners-filled","changelateralidad"],setup(e,{emit:r}){let a=0;const v=e,$=CZe(),h=NZe(),u=[{text:"Rematado fue gol",categoriesIds:[583,585,587,589]},{text:"Rematado no fue gol",categoriesIds:[584,586,588,590]},{text:"Rematado sin destino",categoriesIds:[122,128,136,142]},{text:v.tournamentSelected.is_female==1?"Ganado por portera rival":"Ganado por portero rival",categoriesIds:[123,129,137,143]},{text:v.tournamentSelected.is_female==1?"Ganado por jugadora rival":"Ganado por jugador rival",categoriesIds:[124,130,138,144]},{text:"Sin destino",categoriesIds:[125,131,139,145]}],i=new Map([[120,"Comba hacia afuera"],[134,"Comba hacia afuera"],[126,"Comba hacia adentro"],[140,"Comba hacia adentro"],[327,"Raz de área"],[146,"Raz de área"],[133,"En corto"],[147,"En corto"]]),p=u.reduce(($t,Rt)=>(Rt.categoriesIds.forEach(sr=>{$t.set(sr,Rt.text)}),$t),new Map),l={headers:{Authorization:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},n=r,k=t.ref(null),T=t.ref("0"),x=t.ref(["-1","0"]),d=t.ref(new Map),o=t.ref(!v.isTacticVisible),c=t.ref(!1),s=t.ref([]),f=t.ref(!0),g=t.ref(!0),S=t.ref(!1),L=t.ref(!1),E=t.ref(new Map),P=t.computed(()=>{if(v.gameIdForAnalysis&&v.playIdForAnalysis&&s.value){const $t=s.value.find(Rt=>Rt.game_id===v.gameIdForAnalysis);if($t){if($t.corners.find(Rt=>Rt.play_id===v.playIdForAnalysis))return!1;if($t.cornersAgainstTeam.find(Rt=>Rt.play_id===v.playIdForAnalysis))return!0}}return v.isAgainstMode}),V=t.computed(()=>{const $t=[];return U.value&&(f.value&&$t.push(v.teamIdForAnalysis),g.value&&$t.push(v.teamIdForAnalysis!==U.value.home_team?U.value.home_team:U.value.visiting_team)),$t}),I=t.computed(()=>v.widthContainer<=768?"cont-data768":"cont-data"),j=t.computed(()=>{const $t=v.widthContainer;return $t<=768?"cont-collectors768":$t<=900?"cont-collectors900":"cont-collectors"}),F=t.computed(()=>{const $t=v.widthContainer;return $t<=768?"cont-who-connected768":$t<=900?"cont-who-connected900":"cont-who-connected"}),W=t.computed(()=>s.value?s.value.findIndex($t=>$t.isSelected):null),U=t.computed(()=>s.value?s.value[W.value]:null),z=t.ref(null),X=t.computed(()=>{const $t=s.value[W.value];let Rt=!1;if($t){const sr=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(Zt=>Zt.isSelected);if(sr&&sr.playConnections){ge(sr);const Zt=sr.playConnections;let Tt=[Zt.mainPlay];return Zt.relatedPlays&&Tt.push(...Zt.relatedPlays),Tt.sort((Pt,Ut)=>Pt.touchOrder-Ut.touchOrder),Tt=Tt.filter(Pt=>{let Ut=!0;return Rt?!1:(N.value?Ut=!Pt.isTeamForAnalysis&&Pt.y1<=yN||Pt.isTeamForAnalysis&&Pt.y1>=yN:Ut=Pt.isTeamForAnalysis&&Pt.y1<=yN||!Pt.isTeamForAnalysis&&Pt.y1>=yN,Rt=!Ut,Ut)}),Tt.forEach((Pt,Ut)=>{Ut>0&&(Pt.previousPlayConnection=Tt[Ut-1]),Ut===Tt.length-1&&(Pt.isLastPlay=!0)}),Tt}}return[]}),N=t.computed(()=>{const $t=s.value[W.value];if($t){const Rt=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Rt?Rt.isAgainst:!1}return!1}),Y=t.computed(()=>{const $t=s.value[W.value];if($t){me($t);const Rt=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Rt?Rt.fieldPositions:null}return null}),se=t.ref({});function me($t){se.value=$t}function ge($t){z.value=$t}const be=t.computed(()=>Y.value?Y.value.get(T.value):[]),xe=t.computed(()=>{if(Y.value){const $t=Number(x.value[0]),Rt=Number(x.value[1]),sr=[];if(Rt!==$t)for(let Zt=$t;Zt<Rt;Zt++){const Tt=Y.value.get(Zt.toString()),Pt=Y.value.get((Zt+1).toString());Tt&&Pt&&sr.push({playersPositions:Tt,finalPlayersPositions:Pt,areFirstPositions:Zt===$t,areFinalPositions:Zt===Rt-1})}else sr.push({playersPositions:Y.value.get(x.value[0]),finalPlayersPositions:Y.value.get(x.value[0]),areFirstPositions:!0,areFinalPositions:!0});return sr}return[]}),Ae=t.computed(()=>Y.value?Array.from(Y.value.keys()):[]);t.watch(()=>v.advancedFilters,$t=>{o.value=$t.areConnectionsVisible,c.value=$t.arePathsVisible;const Rt=$t.secondsBeforeAndAfter.toString(),sr=$t.secondsBefore.toString(),Zt=$t.secondsAfter.toString();Ae.value.includes(Rt)&&(T.value=Rt),Ae.value.includes(sr)&&(x.value[0]=sr),Ae.value.includes(Zt)&&(x.value[1]=Zt)},{immediate:!0,deep:!0}),t.watch(()=>P.value,()=>{v.isNullCornerData||Et()}),t.watch(()=>v.teamIdForAnalysis,$t=>{$t&&!v.isNullCornerData&&Mt()},{immediate:!0});const je=t.computed(()=>U.value?v.teamIdForAnalysis===U.value.home_team:!0);t.watch(()=>W.value,($t,Rt)=>{if($t!==Rt&&(T.value="0",x.value=["-1","0"],U.value)){U.value.corners.forEach(Zt=>{Zt.isSelected=!1}),U.value.cornersAgainstTeam.forEach(Zt=>{Zt.isSelected=!1});const sr=(P.value?U.value.cornersAgainstTeam:U.value.corners).filter(Zt=>Zt.isVisible);sr.length>0&&(sr[0].isSelected=!0)}}),t.watch(()=>v.filters,$t=>{$t&&Ue()},{deep:!0,immediate:!0}),t.watch(()=>v.isTacticVisible,$t=>{o.value=!$t});function _e($t){n("changelateralidad",$t)}function Ue(){if(s.value)if(v.isSynchronization)s.value.forEach(($t,Rt)=>{$t.isVisible=!0,Rt===0&&($t.isSelected=!0,$t.isExpanded=!0,$t.corners.forEach(sr=>{sr.isVisible=!0}),$t.cornersAgainstTeam.forEach(sr=>{sr.isVisible=!0}))});else{let $t=!1;s.value.forEach(Rt=>{if(Rt.isSelected=!1,P.value&&Rt.isSoccerFieldDataRivalLoaded||!P.value&&Rt.isSoccerFieldDataLoaded){const sr=P.value?Rt.cornersAgainstTeam:Rt.corners;if((!v.filters.games.length||v.filters.games.includes(Rt.game_id))&&v.filters.playingAs.includes(Rt.playingAs)&&(v.filters.isMoment||v.filters.final.includes(Rt.finalResult))){let Zt=0;for(const Tt of sr){if(Tt.isSelected=!1,v.playIdForAnalysis&&Tt.play_id===v.playIdForAnalysis){Tt.isVisible=!0,Tt.isSelected=!0,Zt++;break}if(v.filters.cornertype!==Tt.init_category_id){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!v.filters.howWas.some(Pt=>Tt.relatedCategoriesIds.has(Pt))){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!P.value&&v.filters.players.length&&!v.filters.players.includes(Tt.player_id)){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(Tt.playConnections){if(!v.filters.sections.includes(Tt.playConnections.mainPlay.timeSection)){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!v.filters.moment.includes(Tt.playConnections.mainPlay.matchResultAtMomentOfPlay)){Tt.isVisible=!1,Tt.isSelected=!1;continue}const Pt=Tt.playConnections.mainPlay;if(Pt&&!v.filters.isZoneFull&&!v.filters.zona.includes(Pt.fieldSection)){Tt.isVisible=!1,Tt.isSelected=!1;continue}}if(!v.filters.isWhatHappenedFull&&Tt.relatedCategoriesIds&&!v.filters.whathappened.some(Pt=>Tt.relatedCategoriesIds.has(Pt))){Tt.isVisible=!1,Tt.isSelected=!1;continue}Tt.isVisible=!0,Zt===0&&(Tt.isSelected=!0),Zt++}Rt.isVisible=Zt>0,Rt.isVisible&&!$t?(Rt.isSelected=!0,Rt.isExpanded=!0,$t=!0):Rt.isSelected=!1}else Rt.isVisible=!1,sr.forEach(Zt=>{Zt.isVisible=!1,Zt.isSelected=!1})}})}}function qe([$t,Rt]){const sr=Math.round(Number(Rt));if(sr===60){const Zt=Number($t)+1;return`${Zt<100?Zt<10?"00":"0":""}${Zt}:00.000`}return`${$t}:${sr<10?"0":""}${sr}.000`}function Re($t,Rt,sr,Zt){$t&&$t.forEach(Tt=>{Tt.isHomeTeam=Tt.teamId===U.value.home_team,Tt.attackDirection=Zt.get(Tt.playId).mainPlay.attackDirection,Tt.player=Rt.get(Tt.playerId)||sr.get(Tt.playerId)})}function De($t,Rt){const sr=Number(x.value[Rt])+$t;if(Ae.value.includes(sr.toString())){const Zt=[...x.value];Zt[Rt]=sr.toString(),Number(Zt[1])-Number(Zt[0])>=0&&(x.value=[...Zt])}}function Qe($t){const Rt=Number(T.value)+$t;Ae.value.includes(Rt.toString())&&(T.value=Rt.toString())}function rt($t){if(!$t.teams||$t.teams.length===0)return;const Rt=$t.teams[0].team_id,sr=$t.teams[1].team_id;if(v.teamIdForAnalysis===Rt&&$t.home_atk_direction===1||v.teamIdForAnalysis===sr&&$t.visiting_atk_direction===1)for(let Zt=1;Zt<5;Zt++)d.value.set(Zt,Zt%2===0?mN.TO_LEFT:mN.TO_RIGHT);else for(let Zt=1;Zt<5;Zt++)d.value.set(Zt,Zt%2===0?mN.TO_RIGHT:mN.TO_LEFT)}function dt(){L.value=!0}function ct(){L.value=!1}async function Ye(){try{if(U.value){const $t={messages:[{queue:"gs3.tendency",message:{key:"postmatch",action:"season",data:{season_id:v.seasonIdForAnalysis,game_id:U.value.game_id}}}]};await xv.post("https://6xh1ym8shh.execute-api.us-west-2.amazonaws.com/prod/pushInternalData",$t,l)}}catch($t){throw new Error($t)}finally{ct()}}function st(){S.value=!0}function lt(){S.value=!1}async function Ot(){try{if(U.value){const $t=U.value[`${P.value?"cornersAgainstTeam":"corners"}`].find(Rt=>Rt.isSelected);if($t){const Rt={play_id:$t.play_id,game_id:U.value.game_id,season_id:v.seasonIdForAnalysis,seconds:Number(T.value),moment_of_play:$t.moment_of_play};await xv.post(" https://bqsyfm7sij.execute-api.us-east-2.amazonaws.com/prod/sync",Rt,l)}}}catch($t){throw new Error($t)}finally{lt()}}async function Mt($t){try{const Rt=E.value.get(v.teamIdForAnalysis);if(Rt){s.value=Rt,Ue();return}a=$t||v.seasonIdForAnalysis;const sr=(await xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${a}/games/teams/${v.teamIdForAnalysis}/corners`,l)).data,Zt={corners:0,cornersAgainst:0};s.value=sr.games?sr.games.reduce((Tt,Pt)=>{if(v.isGameOnly&&v.gameIdForAnalysis!==Pt.game_id)return Tt;const Ut={againstTeam:[],team:[]},vr=Pt.score[1]-Pt.score[0];Pt.dateMillis=new Date(Pt.date_time_utc),Pt.isVisible=!0,Pt.playingAs=Pt.home_team===v.teamIdForAnalysis?1:2,Pt.finalResult=vr===0?3:Pt.playingAs===1?vr>0?2:1:vr<0?2:1,Pt.corners.forEach(Tr=>{const Rr=Tr.team_id===v.teamIdForAnalysis;Tr.isAgainst=!Rr,(!v.playIdForAnalysis||v.playIdForAnalysis===Tr.play_id)&&(Rr?Ut.team.push(Tr):Ut.againstTeam.push(Tr))}),Pt.corners=Ut.team,Pt.cornersAgainstTeam=Ut.againstTeam;const ur=Pt.home_team===v.teamIdForAnalysis?1:2;Zt.corners+=Pt.corners.length,Zt.cornersAgainst+=Pt.cornersAgainstTeam.length;const gr={...Pt,isSelected:Tt.length===0,isExpanded:!1,isTeamForAnalysisHomeTeam:Pt.home_team===v.teamIdForAnalysis,canPlayVideos:v.canPlayVideos&&v.videoPrivilegesPlayingAs.has(ur)};return Tt.push(gr),Tt},[]):[],s.value=s.value.sort((Tt,Pt)=>Pt.dateMillis-Tt.dateMillis),qt(),n("corners-filled",Zt),await Et(),s.value.forEach(Tt=>{Tt.corners.concat(Tt.cornersAgainstTeam).forEach(Pt=>{if(Pt.playConnections){const[Ut,vr]=Pt.moment_of_play.split(":"),[ur,gr]=vr.split("."),Tr=Number(Ut)+45*Pt.playConnections.mainPlay.matchLapse;Pt.isSelected=!1,Pt.orderValue=+`${Tr}${ur}${gr}`}}),Tt.corners=Tt.corners.sort((Pt,Ut)=>Pt.orderValue-Ut.orderValue),Tt.cornersAgainstTeam=Tt.cornersAgainstTeam.sort((Pt,Ut)=>Pt.orderValue-Ut.orderValue)}),Ue()}catch(Rt){throw new Error(Rt)}}async function Et(){try{const $t=[];s.value.forEach(Rt=>{(P.value&&!Rt.isSoccerFieldDataRivalLoaded||!P.value&&!Rt.isSoccerFieldDataLoaded)&&$t.push(Gt(Rt))}),$t.length>0&&((await Promise.all($t)).forEach((Rt,sr)=>{lr(s.value[sr],Rt)}),Ue()),qt()}catch($t){throw new Error($t)}}function qt(){E.value.get(v.teamIdForAnalysis)||E.value.set(v.teamIdForAnalysis,s.value)}function Gt($t){return v.isSynchronization?xv.get(`https://golstats-microservices.s3.us-west-2.amazonaws.com/tendency/corners-${P.value?"received":"commited"}-${a}-${v.teamIdForAnalysis}-${$t.game_id}-large.json`):xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${a}/corners/trends/teams/${v.teamIdForAnalysis}/${$t.game_id}${P.value?"?isR=1":""}`,l)}function Jt($t){const[Rt,sr]=$t.split(", ");let Zt="";const Tt=Rt.split(" ");for(const Pt of Tt)if(Zt+=` ${Pt}`,Pt.length>3)break;return sr&&Rt?`${sr.trim().charAt(0)}.${Zt}`:""}function Qt($t){let[Rt,sr]=$t.split(", ");sr=(sr==null?void 0:sr.trim())||"";let Zt="";const Tt=Rt.split(" "),Pt=sr.includes(" ")?sr.split(" ")[0]:sr;for(const Ut of Tt)if(Zt+=` ${Ut}`,Ut.length>3)break;return Pt&&Rt?`${Pt} ${Zt}`:""}async function lr($t,Rt){try{if($t&&Rt&&(!$t.isSoccerFieldDataLoaded||!$t.isSoccerFieldDataRivalLoaded)){const sr=new Map,Zt=new Map,Tt=new Map;rt(Rt.data),Rt.data.players&&Rt.data.players.forEach(ur=>{ur.shortName=Jt(ur.name),ur.firstNameAndFirstLastName=Qt(ur.name),Zt.set(ur.player_id,ur)}),Rt.data.rival_players&&Rt.data.rival_players.forEach(ur=>{ur.shortName=Jt(ur.name),ur.firstNameAndFirstLastName=Qt(ur.name),Tt.set(ur.player_id,ur)}),k.value=Rt.data.teams.find(ur=>ur.team_id===v.teamIdForAnalysis),k.value&&(k.value.rival=Rt.data.teams.find(ur=>ur.team_id!==v.teamIdForAnalysis));const Pt=Rt.data.data.reduce((ur,gr)=>{const Tr=gr.reduce((or,Or,Pr)=>(or[h[Pr]]=Or,or.isHomeTeam=or.teamId===$t.home_team,or),{}),Rr=Tr.playId===Tr.relatedPlayId,St=ur.get(Tr.relatedPlayId),Yt=Tr.momentOfPlay.split(":"),er=qe(Yt);return Tr.player=Zt.get(Tr.playerId)||Tt.get(Tr.playerId),Tr.isTeamForAnalysis=Tr.teamId===v.teamIdForAnalysis,Rr&&(Tr.attackDirection=d.value.get(Tr.matchLapse),sr.set(Tr.playId,er)),St?Rr?St.mainPlay=Tr:St.relatedPlays.length<qJe&&(St.relatedPlays.push(Tr),St.relatedPlays.length>1&&St.relatedPlays.sort((or,Or)=>or.touchOrder-Or.touchOrder)):ur.set(Tr.playId,{mainPlay:Rr?Tr:null,relatedPlays:Rr?[]:[Tr]}),ur},new Map),Ut=Rt.data.field_positions.reduce((ur,gr)=>{const Tr=gr.reduce((St,Yt,er)=>(St[$[er]]=Yt,St),{});Tr.isTeamForAnalysis=Tr.teamId===v.teamIdForAnalysis;const Rr=ur.get(Tr.playId);if(Rr){const St=Rr.get(Tr.momentOfPlay);St?St.push(Tr):Rr.set(Tr.momentOfPlay,[Tr])}else ur.set(Tr.playId,new Map([[Tr.momentOfPlay,[Tr]]]));return ur},new Map),vr=Array.from(sr.entries()).reduce((ur,[gr,Tr])=>{const Rr=[],St=[];let Yt=null;const er=Ut.get(gr);if(er){const or=v.isSynchronization?FJe:RJe,Or=v.isSynchronization?IJe:UJe;Array.from(er.keys()).sort().forEach(oa=>{(!Yt||St.length<Or)&&(oa===Tr?Yt=er.get(oa):Yt?St.length<Or&&St.push(er.get(oa)):(Rr.length===or&&Rr.shift(),Rr.push(er.get(oa))))});const Pr=new Map;Rr.forEach((oa,Ia)=>{Re(oa,Zt,Tt,Pt),Pr.set(`${Ia-Rr.length}`,oa)}),Re(Yt,Zt,Tt,Pt),Pr.set("0",Yt),St.forEach((oa,Ia)=>{Re(oa,Zt,Tt,Pt),Pr.set(`${Ia+1}`,oa)}),ur.set(gr,Pr)}return ur},new Map);$t[`${P.value?"cornersAgainstTeam":"corners"}`].forEach(ur=>{const gr=ur.related_categories.split(",").reduce((Rr,St,Yt)=>{const er=Number(St);return Yt===1&&(ur.howWasCorner=er),Rr.array.push(er),Rr.sett.add(er),Rr},{array:[],sett:new Set});for(const Rr of gr.array){const St=i.get(Rr),Yt=p.get(Rr);if(Yt&&(ur.whatHappenedName=Yt),St&&(ur.howWasCornerName=St),ur.howWasCornerName&&ur.whatHappenedName)break}ur.relatedCategoriesIds=gr.sett,ur.playConnections=Pt.get(ur.play_id),ur.fieldPositions=vr.get(ur.play_id),ur.player=Zt.get(ur.player_id)||Tt.get(ur.player_id);let Tr=ur.moment_of_play.split(".")[0];Tr.startsWith("0")&&(Tr=Tr.slice(1)),ur.formattedMomentOfPlay=Tr,ur.momentOfPlayNumber=Number(Tr.replace(":","."))}),!P.value&&!$t.isSoccerFieldDataLoaded&&($t.isSoccerFieldDataLoaded=!0),P.value&&!$t.isSoccerFieldDataRivalLoaded&&($t.isSoccerFieldDataRivalLoaded=!0)}}catch(sr){throw new Error(sr)}}function hr($t){const Rt=U.value[`${P.value?"cornersAgainstTeam":"corners"}`],sr={},Zt=Rt.reduce((Tt,Pt)=>(Pt.isVisible&&(Tt.add(Pt.play_id),Pt.isSelected&&(sr.playId=Pt.play_id)),Tt),new Set);n("open-media-player",{seasonId:a,mainSectionType:1,playListType:1,playsIds:Zt,playData:sr,categoryIds:P.value?["31_r","32_r"]:[31,32],teamId:v.teamIdForAnalysis,videosType:$t,isCarouselOnly:!0})}return($t,Rt)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.withDirectives(t.createElementVNode("div",EZe,[t.createElementVNode("div",zZe,[t.createElementVNode("div",MZe," ¿Estás seguro que deseas sincronizar el tracking del partido "+t.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`]:"")+" vs "+t.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`]:"")+" ? ",1),t.createElementVNode("div",{class:"modal-confirmation__buttons"},[t.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:ct}," No "),t.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Ye},"Sí")])])],512),[[t.vShow,L.value]]),t.withDirectives(t.createElementVNode("div",VZe,[t.createElementVNode("div",PZe,[t.createElementVNode("div",AZe," ¿Estás seguro que deseas sincronizar esta jugada en el segundo "+t.toDisplayString(T.value)+"? ",1),t.createElementVNode("div",{class:"modal-confirmation__buttons"},[t.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:lt}," No "),t.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Ot},"Sí")])])],512),[[t.vShow,S.value]]),t.createElementVNode("div",{class:t.normalizeClass(e.widthContainer<=768?"gsc-specific-plays-movil":"gsc-specific-plays")},[t.withDirectives(t.createElementVNode("div",RZe,[t.createElementVNode("div",UZe,[e.widthContainer<=768?(t.openBlock(),t.createElementBlock("span",FZe,"Elige que quieres ver:")):(t.openBlock(),t.createElementBlock("span",IZe,"Jugadas Específicas"))])],512),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:t.normalizeClass(I.value)},[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(j.value)},[e.widthContainer>768?(t.openBlock(),t.createBlock(_Be,{key:0,"is-against-mode":P.value,"games-by-team":s.value,"are-filters-open":e.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"])):(t.openBlock(),t.createBlock(mXe,{key:1,"is-against-mode":P.value,"games-by-team":s.value,"are-filters-open":e.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"]))],2),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:t.normalizeClass(F.value)},[e.isSynchronization?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:"button-tracking",onClick:dt}," Generar datos ")):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("div",qZe,[t.createElementVNode("div",jZe,[t.createVNode(t.unref(IP),{modelValue:o.value,"onUpdate:modelValue":Rt[0]||(Rt[0]=sr=>o.value=sr),label:"Mostrar conexiones",fontFamily:"Poppins-Regular",labelFontSize:e.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"]),e.widthContainer<=768&&e.isTacticVisible?(t.openBlock(),t.createBlock(t.unref(IP),{key:0,modelValue:c.value,"onUpdate:modelValue":Rt[1]||(Rt[1]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:e.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"])):t.createCommentVNode("",!0),e.widthContainer>768?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["specific-plays-radio-container",{"is-away-team":!je.value}])},[U.value&&e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",WZe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[2]||(Rt[2]=sr=>f.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-home":"outer-circle-away")},[f.value?(t.openBlock(),t.createElementBlock("svg",DZe,[...Rt[16]||(Rt[16]=[t.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:"#0d1d29"},null,-1)])])):t.createCommentVNode("",!0)],2),t.createElementVNode("span",KZe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,BZe)])]),t.createElementVNode("label",XZe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[3]||(Rt[3]=sr=>g.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[t.vModelCheckbox,g.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[g.value?(t.openBlock(),t.createElementBlock("svg",GZe,[...Rt[17]||(Rt[17]=[t.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:"#0d1d29"},null,-1)])])):t.createCommentVNode("",!0)],2),t.createElementVNode("span",ZZe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,JZe)])])],64)):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:t.normalizeClass(["specific-plays-controls22",e.widthContainer<=375?"specific-plays-controls22small":""])},[e.widthContainer>768&&e.isTacticVisible&&!e.isSynchronization?(t.openBlock(),t.createBlock(t.unref(IP),{key:0,modelValue:c.value,"onUpdate:modelValue":Rt[4]||(Rt[4]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:"13px","label-color":"#FFF"},null,8,["modelValue"])):t.createCommentVNode("",!0),e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[c.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(e.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[t.createElementVNode("div",tJe,[e.widthContainer>990||e.widthContainer<=768&&e.widthContainer>=420?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Inicio: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Inicio:")],64))]),Rt[29]||(Rt[29]=t.createElementVNode("div",{class:"icon-info"},null,-1)),t.createElementVNode("div",rJe,[t.createElementVNode("div",aJe,[Number(x.value[0])>0?(t.openBlock(),t.createElementBlock("span",nJe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(x.value[0]),1)]),Rt[25]||(Rt[25]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",iJe,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[7]||(Rt[7]=sr=>De(1,0))},[(t.openBlock(),t.createElementBlock("svg",oJe,[...Rt[23]||(Rt[23]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[8]||(Rt[8]=sr=>De(-1,0))},[...Rt[24]||(Rt[24]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])]),t.createElementVNode("div",sJe,[e.widthContainer>990||e.widthContainer<=768&&e.widthContainer>=420?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Fin: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Fin:")],64))]),Rt[30]||(Rt[30]=t.createElementVNode("div",{class:"icon-info"},null,-1)),t.createElementVNode("div",lJe,[t.createElementVNode("div",cJe,[Number(x.value[1])>0?(t.openBlock(),t.createElementBlock("span",uJe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(x.value[1]),1)]),Rt[28]||(Rt[28]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",dJe,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[9]||(Rt[9]=sr=>De(1,1))},[(t.openBlock(),t.createElementBlock("svg",pJe,[...Rt[26]||(Rt[26]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[10]||(Rt[10]=sr=>De(-1,1))},[...Rt[27]||(Rt[27]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2)):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[Rt[21]||(Rt[21]=t.createElementVNode("div",{class:"icon-info"},null,-1)),Rt[22]||(Rt[22]=t.createElementVNode("div",{class:"text-icon-info"},"Segundos antes/después del cobro:",-1)),t.createElementVNode("div",HZe,[t.createElementVNode("div",YZe,[Number(T.value)>0?(t.openBlock(),t.createElementBlock("span",QZe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(T.value),1)]),Rt[20]||(Rt[20]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",$Ze,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[5]||(Rt[5]=sr=>Qe(1))},[(t.openBlock(),t.createElementBlock("svg",eJe,[...Rt[18]||(Rt[18]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[6]||(Rt[6]=sr=>Qe(-1))},[...Rt[19]||(Rt[19]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2))],64)):t.createCommentVNode("",!0),e.isSynchronization?(t.openBlock(),t.createElementBlock("div",{key:2,role:"button",class:"button-sync",onClick:st}," Guardar sincronización ")):t.createCommentVNode("",!0)],2)],512),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:"specific-plays-field",style:t.normalizeStyle(e.widthContainer<=768?"height: auto":"")},[t.createElementVNode("div",hJe,[t.createVNode(HXe,{"width-container":e.widthContainer,"play-connections":X.value,"players-positions":be.value,"players-positions-by-range":xe.value,"team-id-for-analysis":e.teamIdForAnalysis,"selected-category":e.filters.cornertype,"are-connections-visible":o.value,"are-position-paths-visible":c.value,"visible-teams-ids":V.value,"is-against-corner":N.value,onChangelateralidad:_e},null,8,["width-container","play-connections","players-positions","players-positions-by-range","team-id-for-analysis","selected-category","are-connections-visible","are-position-paths-visible","visible-teams-ids","is-against-corner"])]),t.createElementVNode("div",fJe,[t.createElementVNode("div",mJe,[e.isTemplateMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",yJe,[t.createElementVNode("img",{src:se.value.home_team_logo,alt:""},null,8,gJe)])),Rt[31]||(Rt[31]=t.createElementVNode("div",{class:"bullet"},null,-1))]),t.createElementVNode("div",vJe,[e.isTemplateMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",bJe,[t.createElementVNode("img",{src:se.value.visiting_team_logo,alt:""},null,8,xJe)])),Rt[32]||(Rt[32]=t.createElementVNode("div",{class:"bullet"},null,-1))])]),U.value&&U.value.canPlayVideos&&!e.isFieldOnly?(t.openBlock(),t.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons",style:t.normalizeStyle(e.widthContainer<=768?"gap:5px; flex-direction: column;":"")},[Rt[36]||(Rt[36]=t.createElementVNode("div",{class:"specific-plays-field__play-buttons__text"},"Visualizar video:",-1)),t.createElementVNode("div",_Je,[U.value.video_types.includes(1)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons__button",onClick:Rt[11]||(Rt[11]=sr=>hr(1))},[...Rt[33]||(Rt[33]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Toma TV",-1)])])):t.createCommentVNode("",!0),U.value.video_types.includes(3)?(t.openBlock(),t.createElementBlock("div",{key:1,class:"specific-plays-field__play-buttons__button",onClick:Rt[12]||(Rt[12]=sr=>hr(3))},[...Rt[34]||(Rt[34]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Táctica",-1)])])):t.createCommentVNode("",!0),U.value.video_types.includes(2)?(t.openBlock(),t.createElementBlock("div",{key:2,class:"specific-plays-field__play-buttons__button",onClick:Rt[13]||(Rt[13]=sr=>hr(2))},[...Rt[35]||(Rt[35]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Panorámica",-1)])])):t.createCommentVNode("",!0)])],4)):t.createCommentVNode("",!0)],4),e.widthContainer<=768?(t.openBlock(),t.createElementBlock("div",wJe,[U.value&&e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",TJe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[14]||(Rt[14]=sr=>f.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[...Rt[37]||(Rt[37]=[t.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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:"#0d1d29"})],-1)])],2),t.createElementVNode("span",SJe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,kJe)])]),t.createElementVNode("label",LJe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[15]||(Rt[15]=sr=>g.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[t.vModelCheckbox,g.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[...Rt[38]||(Rt[38]=[t.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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:"#0d1d29"})],-1)])],2),t.createElementVNode("span",CJe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,OJe)])])],64)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],2)],2),z.value&&e.isCornerInfoVisible?(t.openBlock(),t.createElementBlock("div",NJe)):t.createCommentVNode("",!0),z.value&&e.isCornerInfoVisible?(t.openBlock(),t.createElementBlock("div",EJe,[t.createElementVNode("div",zJe,[t.createElementVNode("img",{class:"corner-info__team__logo",src:`https://golstatsimages.blob.core.windows.net/teams-80/${z.value.team_id}.png`},null,8,MJe)]),t.createElementVNode("div",VJe,[t.createElementVNode("div",PJe,[Rt[39]||(Rt[39]=t.createElementVNode("span",null," Tiro de esquina ",-1)),Rt[40]||(Rt[40]=t.createElementVNode("span",{class:"separator"}," | ",-1)),t.createElementVNode("span",null,t.toDisplayString(z.value.player.firstNameAndFirstLastName),1)]),t.createElementVNode("div",AJe,[t.createElementVNode("span",null,t.toDisplayString(z.value.howWasCornerName),1),Rt[41]||(Rt[41]=t.createElementVNode("span",{class:"separator"}," | ",-1)),t.createElementVNode("span",null,t.toDisplayString(z.value.whatHappenedName),1)])])])):t.createCommentVNode("",!0)],2)],64))}},zZ=j6(jJe,[["__scopeId","data-v-abec1cab"]]),WJe={class:"tooltip-options"},DJe={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(e,{emit:r}){const a=e,v=r,$=t.computed(()=>a.optionsType==="page");function h(){v("close-tooltip")}function u(i){v(i),h()}return(i,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"tooltip-overlay",onClick:h}),t.createElementVNode("div",WJe,[t.createElementVNode("ul",null,[$.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("li",{class:"option",onClick:p[0]||(p[0]=l=>u("change-sort"))},[...p[4]||(p[4]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),t.createTextVNode(" Cambiar orden ",-1)])]),t.createElementVNode("li",{class:"option",onClick:p[1]||(p[1]=l=>u("delete-page"))},[...p[5]||(p[5]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),t.createTextVNode(" Eliminar ",-1)])])],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("li",{class:"option",onClick:p[2]||(p[2]=l=>u("edit"))},[...p[6]||(p[6]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),t.createTextVNode(" Editar ",-1)])]),t.createElementVNode("li",{class:"option",onClick:p[3]||(p[3]=l=>u("delete"))},[...p[7]||(p[7]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),t.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},MZ=t2(DJe,[["__scopeId","data-v-998e2429"]]),KJe={class:"report-view"},BJe={class:"report-view__header"},XJe={key:0,class:"report-view__header__logo"},GJe=["src"],ZJe={class:"report-view__header__name"},JJe={class:"report-view__content"},HJe={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(e,{emit:r}){const a=e,v=t.ref(!1),$=r,h=[1,2,3,4,6,8,14,13],u=t.computed(()=>!h.includes(a.viewId)),i=t.computed(()=>{if(a.game){const o=a.isHomeTeam?a.game.homeTeam:a.game.awayTeam;if(o&&o.logo)return o.logo}return""}),p=t.computed(()=>{const o=a.view.coreView;return o?o.id===9?a.view.w<4?a.view.title.replace("Mapeo de ",""):a.view.title:o.id===6?n(a.view):o.id===13?k(a.view):a.view.title:a.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function n(o){return a.isPostMatch?o.title:`${o.title} ${l.get(o.componentProps.gameNumber)+" partido"||""}`}function k(o){try{if(!o)return"Tabla por Categoría";const c=o.dynamicFilters||[];if(!Array.isArray(c)||c.length<2)return"Tabla por Categoría";const s=c[1]||[],f=c[0]||2;if(s&&s.length>0){const g=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:f==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:f==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:f==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:f==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],S=(L,E)=>{if(L.length!==E.length)return!1;const P=[...L].sort(),V=[...E].sort();return P.every((I,j)=>I===V[j])};for(const L of g)if(S(s,L.value))return L.label}return"Tabla por Categoría"}catch(c){return console.error("Error en getTableCategoryTitle:",c),"Tabla por Categoría"}}function T(){d(),$("edit")}function x(){d(),$("delete")}function d(){v.value=!1}return(o,c)=>(t.openBlock(),t.createElementBlock("div",KJe,[t.createElementVNode("div",BJe,[v.value?(t.openBlock(),t.createBlock(MZ,{key:0,"options-type":"view",onClick:c[0]||(c[0]=t.withModifiers(s=>v.value=!1,["self"])),onMouseleave:c[1]||(c[1]=s=>v.value=!1),onCloseTooltip:d,onEdit:T,onDelete:x})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"report-view__header__team-and-name",style:t.normalizeStyle(e.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[i.value&&u.value?(t.openBlock(),t.createElementBlock("div",XJe,[t.createElementVNode("img",{src:i.value,alt:""},null,8,GJe)])):t.createCommentVNode("",!0),t.createElementVNode("div",ZJe,t.toDisplayString(p.value),1)],4),t.withDirectives(t.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:c[2]||(c[2]=s=>v.value=!0)},[...c[3]||(c[3]=[t.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])],512),[[t.vShow,e.isTemplateMode&&!e.isFilterVisible]])]),t.createElementVNode("div",JJe,[t.createElementVNode("div",{class:t.normalizeClass({"field-possession-component":e.viewId===8,"timeline-component":e.viewId===4,"field-data-by-zones-component":e.viewId===9,"center-flex-column":![8,4,9].includes(e.viewId)})},[t.renderSlot(o.$slots,"default",{},void 0,!0)],2)])]))}},YJe=t2(HJe,[["__scopeId","data-v-59165937"]]);function QJe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gN={exports:{}},VZ;function $Je(){if(VZ)return gN.exports;VZ=1;function e(){}return e.prototype={on:function(r,a,v){var $=this.e||(this.e={});return($[r]||($[r]=[])).push({fn:a,ctx:v}),this},once:function(r,a,v){var $=this;function h(){$.off(r,h),a.apply(v,arguments)}return h._=a,this.on(r,h,v)},emit:function(r){var a=[].slice.call(arguments,1),v=((this.e||(this.e={}))[r]||[]).slice(),$=0,h=v.length;for($;$<h;$++)v[$].fn.apply(v[$].ctx,a);return this},off:function(r,a){var v=this.e||(this.e={}),$=v[r],h=[];if($&&a)for(var u=0,i=$.length;u<i;u++)$[u].fn!==a&&$[u].fn._!==a&&h.push($[u]);return h.length?v[r]=h:delete v[r],this}},gN.exports=e,gN.exports.TinyEmitter=e,gN.exports}var rA,PZ;function eHe(){if(PZ)return rA;PZ=1;var e=$Je();return rA=new e,rA}var tHe=eHe();const Sd=QJe(tHe);function rHe(e,r,a,v,$){const h=(...u)=>(console.warn("gridstack.js: Function `"+a+"` is deprecated in "+$+" and has been replaced with `"+v+"`. It will be **removed** in a future release"),r.apply(e,u));return h.prototype=r.prototype,h}class ru{static getElements(r,a=document){if(typeof r=="string"){const v="getElementById"in a?a:void 0;if(v&&!isNaN(+r[0])){const h=v.getElementById(r);return h?[h]:[]}let $=a.querySelectorAll(r);return!$.length&&r[0]!=="."&&r[0]!=="#"&&($=a.querySelectorAll("."+r),$.length||($=a.querySelectorAll("#"+r))),Array.from($)}return[r]}static getElement(r,a=document){if(typeof r=="string"){const v="getElementById"in a?a:void 0;if(!r.length)return null;if(v&&r[0]==="#")return v.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return a.querySelector(r);if(v&&!isNaN(+r[0]))return v.getElementById(r);let $=a.querySelector(r);return v&&!$&&($=v.getElementById(r)),$||($=a.querySelector("."+r)),$}return r}static lazyLoad(r){var a,v;return r.lazyLoad||((v=(a=r.grid)==null?void 0:a.opts)==null?void 0:v.lazyLoad)&&r.lazyLoad!==!1}static createDiv(r,a){const v=document.createElement("div");return r.forEach($=>{$&&v.classList.add($)}),a==null||a.appendChild(v),v}static shouldSizeToContent(r,a=!1){return(r==null?void 0:r.grid)&&(a?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,a){return!(r.y>=a.y+a.h||r.y+r.h<=a.y||r.x+r.w<=a.x||r.x>=a.x+a.w)}static isTouching(r,a){return ru.isIntercepted(r,{x:a.x-.5,y:a.y-.5,w:a.w+1,h:a.h+1})}static areaIntercept(r,a){const v=r.x>a.x?r.x:a.x,$=r.x+r.w<a.x+a.w?r.x+r.w:a.x+a.w;if($<=v)return 0;const h=r.y>a.y?r.y:a.y,u=r.y+r.h<a.y+a.h?r.y+r.h:a.y+a.h;return u<=h?0:($-v)*(u-h)}static area(r){return r.w*r.h}static sort(r,a=1){return r.sort((v,$)=>{const h=a*((v.y??1e4)-($.y??1e4));return h===0?a*((v.x??1e4)-($.x??1e4)):h})}static find(r,a){return a?r.find(v=>v.id===a):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let a,v="px";if(typeof r=="string")if(r==="auto"||r==="")a=0;else{const $=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!$)throw new Error(`Invalid height val = ${r}`);v=$[2]||"px",a=parseFloat($[1])}else a=r;return{h:a,unit:v}}static defaults(r,...a){return a.forEach(v=>{for(const $ in v){if(!v.hasOwnProperty($))return;r[$]===null||r[$]===void 0?r[$]=v[$]:typeof v[$]=="object"&&typeof r[$]=="object"&&ru.defaults(r[$],v[$])}}),r}static same(r,a){if(typeof r!="object")return r==a;if(typeof r!=typeof a||Object.keys(r).length!==Object.keys(a).length)return!1;for(const v in r)if(r[v]!==a[v])return!1;return!0}static copyPos(r,a,v=!1){return a.x!==void 0&&(r.x=a.x),a.y!==void 0&&(r.y=a.y),a.w!==void 0&&(r.w=a.w),a.h!==void 0&&(r.h=a.h),v&&(a.minW&&(r.minW=a.minW),a.minH&&(r.minH=a.minH),a.maxW&&(r.maxW=a.maxW),a.maxH&&(r.maxH=a.maxH)),r}static samePos(r,a){return r&&a&&r.x===a.x&&r.y===a.y&&(r.w||1)===(a.w||1)&&(r.h||1)===(a.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,a){if(!(typeof r!="object"||typeof a!="object"))for(let v in r){const $=r[v],h=a[v];v[0]==="_"||$===h?delete r[v]:$&&typeof $=="object"&&h!==void 0&&(ru.removeInternalAndSame($,h),Object.keys($).length||delete r[v])}}static removeInternalForSave(r,a=!0){for(let v in r)(v[0]==="_"||r[v]===null||r[v]===void 0)&&delete r[v];delete r.grid,a&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,a){let v=!1;return(...$)=>{v||(v=!0,setTimeout(()=>{r(...$),v=!1},a))}}static removePositioningStyles(r){const a=r.style;a.position&&a.removeProperty("position"),a.left&&a.removeProperty("left"),a.top&&a.removeProperty("top"),a.width&&a.removeProperty("width"),a.height&&a.removeProperty("height")}static getScrollElement(r){if(!r)return document.scrollingElement||document.documentElement;const a=getComputedStyle(r);return/(auto|scroll)/.test(a.overflow+a.overflowY)?r:ru.getScrollElement(r.parentElement)}static updateScrollPosition(r,a,v){const $=ru.getScrollElement(r);if(!$)return;const h=r.getBoundingClientRect(),u=$.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight,p=h.bottom-Math.min(u.bottom,i),l=h.top-Math.max(u.top,0),n=$.scrollTop;l<0&&v<0?r.offsetHeight>u.height?$.scrollTop+=v:$.scrollTop+=Math.abs(l)>Math.abs(v)?v:l:p>0&&v>0&&(r.offsetHeight>u.height?$.scrollTop+=v:$.scrollTop+=p>v?v:p),a.top+=$.scrollTop-n}static updateScrollResize(r,a,v){const $=ru.getScrollElement(a),h=$.clientHeight,u=$===ru.getScrollElement()?0:$.getBoundingClientRect().top,i=r.clientY-u,p=i<v,l=i>h-v;p?$.scrollBy({behavior:"smooth",top:i-v}):l&&$.scrollBy({behavior:"smooth",top:v-(h-i)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:{...r}}static cloneDeep(r){const a=["parentGrid","el","grid","subGrid","engine"],v=ru.clone(r);for(const $ in v)v.hasOwnProperty($)&&typeof v[$]=="object"&&$.substring(0,2)!=="__"&&!a.find(h=>h===$)&&(v[$]=ru.cloneDeep(r[$]));return v}static cloneNode(r){const a=r.cloneNode(!0);return a.removeAttribute("id"),a}static appendTo(r,a){let v;typeof a=="string"?v=ru.getElement(a):v=a,v&&v.appendChild(r)}static addElStyles(r,a){if(a instanceof Object)for(const v in a)a.hasOwnProperty(v)&&(Array.isArray(a[v])?a[v].forEach($=>{r.style[v]=$}):r.style[v]=a[v])}static initEvent(r,a){const v={type:a.type},$={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:a.target?a.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(h=>v[h]=r[h]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(h=>v[h]=r[h]),{...v,...$}}static simulateMouseEvent(r,a,v){const $=r,h=new MouseEvent(a,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:$.ctrlKey??!1,altKey:$.altKey??!1,shiftKey:$.shiftKey??!1,metaKey:$.metaKey??!1,button:0,relatedTarget:r.target});(v||r.target).dispatchEvent(h)}static getValuesFromTransformedElement(r){const a=document.createElement("div");ru.addElStyles(a,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(a);const v=a.getBoundingClientRect();return r.removeChild(a),a.remove(),{xScale:1/v.width,yScale:1/v.height,xOffset:v.left,yOffset:v.top}}static swap(r,a,v){if(!r)return;const $=r[a];r[a]=r[v],r[v]=$}static canBeRotated(r){var a;return!(!r||r.w===r.h||r.locked||r.noResize||(a=r.grid)!=null&&a.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}}class P4{constructor(r={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=r.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=r.maxRow,this._float=r.float,this.nodes=r.nodes||[],this.onChange=r.onChange}batchUpdate(r=!0,a=!0){return!!this.batchMode===r?this:(this.batchMode=r,r?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,a&&this._packNodes(),this._notify()),this)}_useEntireRowArea(r,a){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!r._moving||r._skipDown||a.y<=r.y)}_fixCollisions(r,a=r,v,$={}){if(this.sortNodes(-1),v=v||this.collide(r,a),!v)return!1;if(r._moving&&!$.nested&&!this.float&&this.swap(r,v))return!0;let h=a;!this._loading&&this._useEntireRowArea(r,a)&&(h={x:0,w:this.column,y:a.y,h:a.h},v=this.collide(r,h,$.skip));let u=!1;const i={nested:!0,pack:!1};let p=0;for(;v=v||this.collide(r,h,$.skip);){if(p++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(v.locked||this._loading||r._moving&&!r._skipDown&&a.y>r.y&&!this.float&&(!this.collide(v,{...v,y:r.y},r)||!this.collide(v,{...v,y:a.y-v.h},r))){r._skipDown=r._skipDown||a.y>r.y;const n={...a,y:v.y+v.h,...i};l=this._loading&&ru.samePos(r,n)?!0:this.moveNode(r,n),(v.locked||this._loading)&&l?ru.copyPos(a,r):!v.locked&&l&&$.pack&&(this._packNodes(),a.y=v.y+v.h,ru.copyPos(r,a)),u=u||l}else l=this.moveNode(v,{...v,y:a.y+a.h,skip:r,...i});if(!l)return u;v=void 0}return u}collide(r,a=r,v){const $=r._id,h=v==null?void 0:v._id;return this.nodes.find(u=>u._id!==$&&u._id!==h&&ru.isIntercepted(u,a))}collideAll(r,a=r,v){const $=r._id,h=v==null?void 0:v._id;return this.nodes.filter(u=>u._id!==$&&u._id!==h&&ru.isIntercepted(u,a))}directionCollideCoverage(r,a,v){if(!a.rect||!r._rect)return;const $=r._rect,h={...a.rect};h.y>$.y?(h.h+=h.y-$.y,h.y=$.y):h.h+=$.y-h.y,h.x>$.x?(h.w+=h.x-$.x,h.x=$.x):h.w+=$.x-h.x;let u,i=.5;for(let p of v){if(p.locked||!p._rect)break;const l=p._rect;let n=Number.MAX_VALUE,k=Number.MAX_VALUE;$.y<l.y?n=(h.y+h.h-l.y)/l.h:$.y+$.h>l.y+l.h&&(n=(l.y+l.h-h.y)/l.h),$.x<l.x?k=(h.x+h.w-l.x)/l.w:$.x+$.w>l.x+l.w&&(k=(l.x+l.w-h.x)/l.w);const T=Math.min(k,n);T>i&&(i=T,u=p)}return a.collide=u,u}cacheRects(r,a,v,$,h,u){return this.nodes.forEach(i=>i._rect={y:i.y*a+v,x:i.x*r+u,w:i.w*r-u-$,h:i.h*a-v-h}),this}swap(r,a){if(!a||a.locked||!r||r.locked)return!1;function v(){const h=a.x,u=a.y;return a.x=r.x,a.y=r.y,r.h!=a.h?(r.x=h,r.y=a.y+a.h):r.w!=a.w?(r.x=a.x+a.w,r.y=u):(r.x=h,r.y=u),r._dirty=a._dirty=!0,!0}let $;if(r.w===a.w&&r.h===a.h&&(r.x===a.x||r.y===a.y)&&($=ru.isTouching(r,a)))return v();if($!==!1){if(r.w===a.w&&r.x===a.x&&($||($=ru.isTouching(r,a)))){if(a.y<r.y){const h=r;r=a,a=h}return v()}if($!==!1){if(r.h===a.h&&r.y===a.y&&($||($=ru.isTouching(r,a)))){if(a.x<r.x){const h=r;r=a,a=h}return v()}return!1}}}isAreaEmpty(r,a,v,$){const h={x:r||0,y:a||0,w:v||1,h:$||1};return!this.collide(h)}compact(r="compact",a=!0){if(this.nodes.length===0)return this;a&&this.sortNodes();const v=this.batchMode;v||this.batchUpdate();const $=this._inColumnResize;$||(this._inColumnResize=!0);const h=this.nodes;return this.nodes=[],h.forEach((u,i,p)=>{let l;u.locked||(u.autoPosition=!0,r==="list"&&i&&(l=p[i-1])),this.addNode(u,!1,l)}),$||delete this._inColumnResize,v||this.batchUpdate(!1),this}set float(r){this._float!==r&&(this._float=r||!1,r||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(r=1){return this.nodes=ru.sort(this.nodes,r),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(r=>{if(r._updating||r._orig===void 0||r.y===r._orig.y)return;let a=r.y;for(;a>r._orig.y;)--a,this.collide(r,{x:r.x,y:a,w:r.w,h:r.h})||(r._dirty=!0,r.y=a)}):this.nodes.forEach((r,a)=>{if(!r.locked)for(;r.y>0;){const v=a===0?0:r.y-1;if(!(a===0||!this.collide(r,{x:r.x,y:v,w:r.w,h:r.h})))break;r._dirty=r.y!==v,r.y=v}}),this)}prepareNode(r,a){r._id=r._id??P4._idSeq++;const v=r.id;if(v){let h=1;for(;this.nodes.find(u=>u.id===r.id&&u!==r);)r.id=v+"_"+h++}(r.x===void 0||r.y===void 0||r.x===null||r.y===null)&&(r.autoPosition=!0);const $={x:0,y:0,w:1,h:1};return ru.defaults(r,$),r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,ru.sanitizeMinMax(r),typeof r.x=="string"&&(r.x=Number(r.x)),typeof r.y=="string"&&(r.y=Number(r.y)),typeof r.w=="string"&&(r.w=Number(r.w)),typeof r.h=="string"&&(r.h=Number(r.h)),isNaN(r.x)&&(r.x=$.x,r.autoPosition=!0),isNaN(r.y)&&(r.y=$.y,r.autoPosition=!0),isNaN(r.w)&&(r.w=$.w),isNaN(r.h)&&(r.h=$.h),this.nodeBoundFix(r,a),r}nodeBoundFix(r,a){const v=r._orig||ru.copyPos({},r);if(r.maxW&&(r.w=Math.min(r.w||1,r.maxW)),r.maxH&&(r.h=Math.min(r.h||1,r.maxH)),r.minW&&(r.w=Math.max(r.w||1,r.minW)),r.minH&&(r.h=Math.max(r.h||1,r.minH)),(r.x||0)+(r.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&r._id!=null&&this.findCacheLayout(r,this.defaultColumn)===-1){const $={...r};$.autoPosition||$.x===void 0?(delete $.x,delete $.y):$.x=Math.min(this.defaultColumn-1,$.x),$.w=Math.min(this.defaultColumn,$.w||1),this.cacheOneLayout($,this.defaultColumn)}return r.w>this.column?r.w=this.column:r.w<1&&(r.w=1),this.maxRow&&r.h>this.maxRow?r.h=this.maxRow:r.h<1&&(r.h=1),r.x<0&&(r.x=0),r.y<0&&(r.y=0),r.x+r.w>this.column&&(a?r.w=this.column-r.x:r.x=this.column-r.w),this.maxRow&&r.y+r.h>this.maxRow&&(a?r.h=this.maxRow-r.y:r.y=this.maxRow-r.h),ru.samePos(r,v)||(r._dirty=!0),this}getDirtyNodes(r){return r?this.nodes.filter(a=>a._dirty&&!ru.samePos(a,a._orig)):this.nodes.filter(a=>a._dirty)}_notify(r){if(this.batchMode||!this.onChange)return this;const a=(r||[]).concat(this.getDirtyNodes());return this.onChange(a),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(r=>{delete r._dirty,delete r._lastTried}),this)}saveInitial(){return this.nodes.forEach(r=>{r._orig=ru.copyPos({},r),delete r._dirty}),this._hasLocked=this.nodes.some(r=>r.locked),this}restoreInitial(){return this.nodes.forEach(r=>{!r._orig||ru.samePos(r,r._orig)||(ru.copyPos(r,r._orig),r._dirty=!0)}),this._notify(),this}findEmptyPosition(r,a=this.nodes,v=this.column,$){const h=$?$.y*v+($.x+$.w):0;let u=!1;for(let i=h;!u;++i){const p=i%v,l=Math.floor(i/v);if(p+r.w>v)continue;const n={x:p,y:l,w:r.w,h:r.h};a.find(k=>ru.isIntercepted(n,k))||((r.x!==p||r.y!==l)&&(r._dirty=!0),r.x=p,r.y=l,delete r.autoPosition,u=!0)}return u}addNode(r,a=!1,v){const $=this.nodes.find(u=>u._id===r._id);if($)return $;this._inColumnResize?this.nodeBoundFix(r):this.prepareNode(r),delete r._temporaryRemoved,delete r._removeDOM;let h;return r.autoPosition&&this.findEmptyPosition(r,this.nodes,this.column,v)&&(delete r.autoPosition,h=!0),this.nodes.push(r),a&&this.addedNodes.push(r),h||this._fixCollisions(r),this.batchMode||this._packNodes()._notify(),r}removeNode(r,a=!0,v=!1){return this.nodes.find($=>$._id===r._id)?(v&&this.removedNodes.push(r),a&&(r._removeDOM=!0),this.nodes=this.nodes.filter($=>$._id!==r._id),r._isAboutToRemove||this._packNodes(),this._notify([r]),this):this}removeAll(r=!0,a=!0){if(delete this._layouts,!this.nodes.length)return this;r&&this.nodes.forEach($=>$._removeDOM=!0);const v=this.nodes;return this.removedNodes=a?v:[],this.nodes=[],this._notify(v)}moveNodeCheck(r,a){if(!this.changedPosConstrain(r,a))return!1;if(a.pack=!0,!this.maxRow)return this.moveNode(r,a);let v;const $=new P4({column:this.column,float:this.float,nodes:this.nodes.map(u=>u._id===r._id?(v={...u},v):{...u})});if(!v)return!1;const h=$.moveNode(v,a)&&$.getRow()<=Math.max(this.getRow(),this.maxRow);if(!h&&!a.resizing&&a.collide){const u=a.collide.el.gridstackNode;if(this.swap(r,u))return this._notify(),!0}return h?($.nodes.filter(u=>u._dirty).forEach(u=>{const i=this.nodes.find(p=>p._id===u._id);i&&(ru.copyPos(i,u),i._dirty=!0)}),this._notify(),!0):!1}willItFit(r){if(delete r._willFitPos,!this.maxRow)return!0;const a=new P4({column:this.column,float:this.float,nodes:this.nodes.map($=>({...$}))}),v={...r};return this.cleanupNode(v),delete v.el,delete v._id,delete v.content,delete v.grid,a.addNode(v),a.getRow()<=this.maxRow?(r._willFitPos=ru.copyPos({},v),!0):!1}changedPosConstrain(r,a){return a.w=a.w||r.w,a.h=a.h||r.h,r.x!==a.x||r.y!==a.y?!0:(r.maxW&&(a.w=Math.min(a.w,r.maxW)),r.maxH&&(a.h=Math.min(a.h,r.maxH)),r.minW&&(a.w=Math.max(a.w,r.minW)),r.minH&&(a.h=Math.max(a.h,r.minH)),r.w!==a.w||r.h!==a.h)}moveNode(r,a){var v,$;if(!r||!a)return!1;let h;a.pack===void 0&&!this.batchMode&&(h=a.pack=!0),typeof a.x!="number"&&(a.x=r.x),typeof a.y!="number"&&(a.y=r.y),typeof a.w!="number"&&(a.w=r.w),typeof a.h!="number"&&(a.h=r.h);const u=r.w!==a.w||r.h!==a.h,i=ru.copyPos({},r,!0);if(ru.copyPos(i,a),this.nodeBoundFix(i,u),ru.copyPos(a,i),!a.forceCollide&&ru.samePos(r,a))return!1;const p=ru.copyPos({},r),l=this.collideAll(r,i,a.skip);let n=!0;if(l.length){const k=r._moving&&!a.nested;let T=k?this.directionCollideCoverage(r,a,l):l[0];if(k&&T&&($=(v=r.grid)==null?void 0:v.opts)!=null&&$.subGridDynamic&&!r.grid._isTemp){const x=ru.areaIntercept(a.rect,T._rect),d=ru.area(a.rect),o=ru.area(T._rect);x/(d<o?d:o)>.8&&(T.grid.makeSubGrid(T.el,void 0,r),T=void 0)}T?n=!this._fixCollisions(r,i,T,a):(n=!1,h&&delete a.pack)}return n&&!ru.samePos(r,i)&&(r._dirty=!0,ru.copyPos(r,i)),a.pack&&this._packNodes()._notify(),!ru.samePos(r,p)}getRow(){return this.nodes.reduce((r,a)=>Math.max(r,a.y+a.h),0)}beginUpdate(r){return r._updating||(r._updating=!0,delete r._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const r=this.nodes.find(a=>a._updating);return r&&(delete r._updating,delete r._skipDown),this}save(r=!0,a,v){var $;const h=(($=this._layouts)==null?void 0:$.length)||0;let u;h&&(v?v!==this.column&&(u=this._layouts[v]):this.column!==h-1&&(u=this._layouts[h-1]));const i=[];return this.sortNodes(),this.nodes.forEach(p=>{const l=u==null?void 0:u.find(k=>k._id===p._id),n={...p,...l||{}};ru.removeInternalForSave(n,!r),a&&a(p,n),i.push(n)}),i}layoutsNodesChange(r){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((a,v)=>{if(!a||v===this.column)return this;if(v<this.column)this._layouts[v]=void 0;else{const $=v/this.column;r.forEach(h=>{if(!h._orig)return;const u=a.find(i=>i._id===h._id);u&&(u.y>=0&&h.y!==h._orig.y&&(u.y+=h.y-h._orig.y),h.x!==h._orig.x&&(u.x=Math.round(h.x*$)),h.w!==h._orig.w&&(u.w=Math.round(h.w*$)))})}}),this)}columnChanged(r,a,v="moveScale"){var $;if(!this.nodes.length||!a||r===a)return this;const h=v==="compact"||v==="list";h&&this.sortNodes(1),a<r&&this.cacheLayout(this.nodes,r),this.batchUpdate();let u=[],i=h?this.nodes:ru.sort(this.nodes,-1);if(a>r&&this._layouts){const p=this._layouts[a]||[],l=this._layouts.length-1;!p.length&&r!==l&&($=this._layouts[l])!=null&&$.length&&(r=l,this._layouts[l].forEach(n=>{const k=i.find(T=>T._id===n._id);k&&(!h&&!n.autoPosition&&(k.x=n.x??k.x,k.y=n.y??k.y),k.w=n.w??k.w,(n.x==null||n.y===void 0)&&(k.autoPosition=!0))})),p.forEach(n=>{const k=i.findIndex(T=>T._id===n._id);if(k!==-1){const T=i[k];if(h){T.w=n.w;return}(n.autoPosition||isNaN(n.x)||isNaN(n.y))&&this.findEmptyPosition(n,u),n.autoPosition||(T.x=n.x??T.x,T.y=n.y??T.y,T.w=n.w??T.w,u.push(T)),i.splice(k,1)}})}if(h)this.compact(v,!1);else{if(i.length)if(typeof v=="function")v(a,r,u,i);else{const p=h||v==="none"?1:a/r,l=v==="move"||v==="moveScale",n=v==="scale"||v==="moveScale";i.forEach(k=>{k.x=a===1?0:l?Math.round(k.x*p):Math.min(k.x,a-1),k.w=a===1||r===1?1:n?Math.round(k.w*p)||1:Math.min(k.w,a),u.push(k)}),i=[]}u=ru.sort(u,-1),this._inColumnResize=!0,this.nodes=[],u.forEach(p=>{this.addNode(p,!1),delete p._orig})}return this.nodes.forEach(p=>delete p._orig),this.batchUpdate(!1,!h),delete this._inColumnResize,this}cacheLayout(r,a,v=!1){const $=[];return r.forEach((h,u)=>{if(h._id===void 0){const i=h.id?this.nodes.find(p=>p.id===h.id):void 0;h._id=(i==null?void 0:i._id)??P4._idSeq++}$[u]={x:h.x,y:h.y,w:h.w,_id:h._id}}),this._layouts=v?[]:this._layouts||[],this._layouts[a]=$,this}cacheOneLayout(r,a){r._id=r._id??P4._idSeq++;const v={x:r.x,y:r.y,w:r.w,_id:r._id};(r.autoPosition||r.x===void 0)&&(delete v.x,delete v.y,r.autoPosition&&(v.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[a]=this._layouts[a]||[];const $=this.findCacheLayout(r,a);return $===-1?this._layouts[a].push(v):this._layouts[a][$]=v,this}findCacheLayout(r,a){var v,$;return(($=(v=this._layouts)==null?void 0:v[a])==null?void 0:$.findIndex(h=>h._id===r._id))??-1}removeNodeFromLayoutCache(r){if(this._layouts)for(let a=0;a<this._layouts.length;a++){const v=this.findCacheLayout(r,a);v!==-1&&this._layouts[a].splice(v,1)}}cleanupNode(r){for(const a in r)a[0]==="_"&&a!=="_id"&&delete r[a];return this}}P4._idSeq=0;const T3={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Nf{}const Xw=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class R5{}function vN(e,r){e.touches.length>1||(e.cancelable&&e.preventDefault(),ru.simulateMouseEvent(e.changedTouches[0],r))}function AZ(e,r){e.cancelable&&e.preventDefault(),ru.simulateMouseEvent(e,r)}function bN(e){R5.touchHandled||(R5.touchHandled=!0,vN(e,"mousedown"))}function xN(e){R5.touchHandled&&vN(e,"mousemove")}function _N(e){if(!R5.touchHandled)return;R5.pointerLeaveTimeout&&(window.clearTimeout(R5.pointerLeaveTimeout),delete R5.pointerLeaveTimeout);const r=!!Nf.dragElement;vN(e,"mouseup"),r||vN(e,"click"),R5.touchHandled=!1}function wN(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function RZ(e){Nf.dragElement&&e.pointerType!=="mouse"&&AZ(e,"mouseenter")}function UZ(e){Nf.dragElement&&e.pointerType!=="mouse"&&(R5.pointerLeaveTimeout=window.setTimeout(()=>{delete R5.pointerLeaveTimeout,AZ(e,"mouseleave")},10))}class TN{constructor(r,a,v){this.host=r,this.dir=a,this.option=v,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const r=this.el=document.createElement("div");return r.classList.add("ui-resizable-handle"),r.classList.add(`${TN.prefix}${this.dir}`),r.style.zIndex="100",r.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Xw&&(this.el.addEventListener("touchstart",bN),this.el.addEventListener("pointerdown",wN)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Xw&&(this.el.removeEventListener("touchstart",bN),this.el.removeEventListener("pointerdown",wN)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(r){this.mouseDownEvent=r,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Xw&&(this.el.addEventListener("touchmove",xN),this.el.addEventListener("touchend",_N)),r.stopPropagation(),r.preventDefault()}_mouseMove(r){const a=this.mouseDownEvent;this.moving?this._triggerEvent("move",r):Math.abs(r.x-a.x)+Math.abs(r.y-a.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",r),document.addEventListener("keydown",this._keyEvent)),r.stopPropagation()}_mouseUp(r){this.moving&&(this._triggerEvent("stop",r),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Xw&&(this.el.removeEventListener("touchmove",xN),this.el.removeEventListener("touchend",_N)),delete this.moving,delete this.mouseDownEvent,r.stopPropagation(),r.preventDefault()}_keyEvent(r){var a,v;r.key==="Escape"&&((v=(a=this.host.gridstackNode)==null?void 0:a.grid)==null||v.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(r,a){return this.option[r]&&this.option[r](a),this}}TN.prefix="ui-resizable-";class aA{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,a){this._eventRegister[r]=a}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,a){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](a)}}class l9 extends aA{constructor(r,a={}){super(),this.el=r,this.option=a,this.rectScale={x:1,y:1},this._ui=()=>{const v=this.el.parentElement.getBoundingClientRect(),$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},h=this.temporalRect||$;return{position:{left:(h.left-v.left)*this.rectScale.x,top:(h.top-v.top)*this.rectScale.y},size:{width:h.width*this.rectScale.x,height:h.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(r){const a=r.handles&&r.handles!==this.option.handles,v=r.autoHide&&r.autoHide!==this.option.autoHide;return Object.keys(r).forEach($=>this.option[$]=r[$]),a&&(this._removeHandlers(),this._setupHandlers()),v&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(r){return r?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Nf.overResizeElement===this&&delete Nf.overResizeElement),this}_mouseOver(r){Nf.overResizeElement||Nf.dragElement||(Nf.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(r){Nf.overResizeElement===this&&(delete Nf.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(r=>r.trim()).map(r=>new TN(this.el,r,{start:a=>{this._resizeStart(a)},stop:a=>{this._resizeStop(a)},move:a=>{this._resizing(a,r)}})),this}_resizeStart(r){this.sizeToContent=ru.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=ru.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=r,this._setupHelper(),this._applyChange();const a=ru.initEvent(r,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(a,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",a),this}_resizing(r,a){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(r,a),this._applyChange();const v=ru.initEvent(r,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(v,this._ui()),this.triggerEvent("resize",v),this}_resizeStop(r){const a=ru.initEvent(r,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(a),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",a),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=l9._originStyleProp.map(v=>this.el.style[v]),this.parentOriginStylePosition=this.el.parentElement.style.position;const r=this.el.parentElement,a=ru.getValuesFromTransformedElement(r);return this.rectScale={x:a.xScale,y:a.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return l9._originStyleProp.forEach((r,a)=>{this.el.style[r]=this.elOriginStyleVal[a]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(r,a){const v=this.startEvent,$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},h=r.clientX-v.clientX,u=this.sizeToContent?0:r.clientY-v.clientY;let i,p;a.indexOf("e")>-1?$.width+=h:a.indexOf("w")>-1&&($.width-=h,$.left+=h,i=!0),a.indexOf("s")>-1?$.height+=u:a.indexOf("n")>-1&&($.height-=u,$.top+=u,p=!0);const l=this._constrainSize($.width,$.height,i,p);return Math.round($.width)!==Math.round(l.width)&&(a.indexOf("w")>-1&&($.left+=$.width-l.width),$.width=l.width),Math.round($.height)!==Math.round(l.height)&&(a.indexOf("n")>-1&&($.top+=$.height-l.height),$.height=l.height),$}_constrainSize(r,a,v,$){const h=this.option,u=(v?h.maxWidthMoveLeft:h.maxWidth)||Number.MAX_SAFE_INTEGER,i=h.minWidth/this.rectScale.x||r,p=($?h.maxHeightMoveUp:h.maxHeight)||Number.MAX_SAFE_INTEGER,l=h.minHeight/this.rectScale.y||a,n=Math.min(u,Math.max(i,r)),k=Math.min(p,Math.max(l,a));return{width:n,height:k}}_applyChange(){let r={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const a=this.el.parentElement,{left:v,top:$}=a.getBoundingClientRect();r={left:v,top:$,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(a=>{const v=this.temporalRect[a],$=a==="width"||a==="left"?this.rectScale.x:a==="height"||a==="top"?this.rectScale.y:1;this.el.style[a]=(v-r[a])*$+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(r=>r.destroy()),delete this.handlers,this}}l9._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const aHe='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class c9 extends aA{constructor(r,a={}){var v;super(),this.el=r,this.option=a,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const $=(v=a==null?void 0:a.handle)==null?void 0:v.substring(1),h=r.gridstackNode;this.dragEls=!$||r.classList.contains($)?[r]:h!=null&&h.subGrid?[r.querySelector(a.handle)||r]:Array.from(r.querySelectorAll(a.handle)),this.dragEls.length===0&&(this.dragEls=[r]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(r=>{r.addEventListener("mousedown",this._mouseDown),Xw&&(r.addEventListener("touchstart",bN),r.addEventListener("pointerdown",wN))}),this.el.classList.remove("ui-draggable-disabled"))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(a=>{a.removeEventListener("mousedown",this._mouseDown),Xw&&(a.removeEventListener("touchstart",bN),a.removeEventListener("pointerdown",wN))}),r||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(r){return Object.keys(r).forEach(a=>this.option[a]=r[a]),this}_mouseDown(r){if(!Nf.mouseHandled)return r.button!==0||!this.dragEls.find(a=>a===r.target)&&r.target.closest(aHe)||this.option.cancel&&r.target.closest(this.option.cancel)||(this.mouseDownEvent=r,delete this.dragging,delete Nf.dragElement,delete Nf.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Xw&&(r.currentTarget.addEventListener("touchmove",xN),r.currentTarget.addEventListener("touchend",_N)),r.preventDefault(),document.activeElement&&document.activeElement.blur(),Nf.mouseHandled=!0),!0}_callDrag(r){if(!this.dragging)return;const a=ru.initEvent(r,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(a,this.ui()),this.triggerEvent("drag",a)}_mouseMove(r){var a;const v=this.mouseDownEvent;if(this.lastDrag=r,this.dragging)if(this._dragFollow(r),Nf.pauseDrag){const $=Number.isInteger(Nf.pauseDrag)?Nf.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(r),$)}else this._callDrag(r);else if(Math.abs(r.x-v.x)+Math.abs(r.y-v.y)>3){this.dragging=!0,Nf.dragElement=this;const $=(a=this.el.gridstackNode)==null?void 0:a.grid;$?Nf.dropElement=$.el.ddElement.ddDroppable:delete Nf.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=ru.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(r,this.el,this.helperContainment),this._setupHelperStyle(r);const h=ru.initEvent(r,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(h,this.ui()),this.triggerEvent("dragstart",h),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(r){var a,v;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Xw&&r.currentTarget&&(r.currentTarget.removeEventListener("touchmove",xN,!0),r.currentTarget.removeEventListener("touchend",_N,!0)),this.dragging){delete this.dragging,(a=this.el.gridstackNode)==null||delete a._origRotate,document.removeEventListener("keydown",this._keyEvent),((v=Nf.dropElement)==null?void 0:v.el)===this.el.parentElement&&delete Nf.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const $=ru.initEvent(r,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop($),this.triggerEvent("dragstop",$),Nf.dropElement&&Nf.dropElement.drop(r)}delete this.helper,delete this.mouseDownEvent,delete Nf.dragElement,delete Nf.dropElement,delete Nf.mouseHandled,r.preventDefault()}_keyEvent(r){var a,v;const $=this.el.gridstackNode,h=($==null?void 0:$.grid)||((v=(a=Nf.dropElement)==null?void 0:a.el)==null?void 0:v.gridstack);if(r.key==="Escape")$&&$._origRotate&&($._orig=$._origRotate,delete $._origRotate),h==null||h.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if($&&h&&(r.key==="r"||r.key==="R")){if(!ru.canBeRotated($))return;$._origRotate=$._origRotate||{...$._orig},delete $._moving,h.setAnimation(!1).rotate($.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),$._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,$.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",ru.swap($._orig,"w","h"),delete $._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let r=this.el;return typeof this.option.helper=="function"?r=this.option.helper(this.el):this.option.helper==="clone"&&(r=ru.cloneNode(this.el)),r.parentElement||ru.appendTo(r,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=c9.originStyleProp.map(a=>this.el.style[a]),r}_setupHelperStyle(r){var a,v;this.helper.classList.add("ui-draggable-dragging"),(v=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||v.el.classList.add("grid-stack-dragging");const $=this.helper.style;return $.pointerEvents="none",$.width=this.dragOffset.width+"px",$.height=this.dragOffset.height+"px",$.willChange="left, top",$.position="fixed",this._dragFollow(r),$.transition="none",setTimeout(()=>{this.helper&&($.transition=null)},0),this}_removeHelperStyle(){var r,a,v;this.helper.classList.remove("ui-draggable-dragging"),(a=(r=this.el.gridstackNode)==null?void 0:r.grid)==null||a.el.classList.remove("grid-stack-dragging");const $=(v=this.helper)==null?void 0:v.gridstackNode;if(!($!=null&&$._isAboutToRemove)&&this.dragElementOriginStyle){const h=this.helper,u=this.dragElementOriginStyle.transition||null;h.style.transition=this.dragElementOriginStyle.transition="none",c9.originStyleProp.forEach(i=>h.style[i]=this.dragElementOriginStyle[i]||null),setTimeout(()=>h.style.transition=u,50)}return delete this.dragElementOriginStyle,this}_dragFollow(r){const a={left:0,top:0},v=this.helper.style,$=this.dragOffset;v.left=(r.clientX+$.offsetLeft-a.left)*this.dragTransform.xScale+"px",v.top=(r.clientY+$.offsetTop-a.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(r,a,v){let $=0,h=0;v&&($=this.dragTransform.xOffset,h=this.dragTransform.yOffset);const u=a.getBoundingClientRect();return{left:u.left,top:u.top,offsetLeft:-r.clientX+u.left-$,offsetTop:-r.clientY+u.top-h,width:u.width*this.dragTransform.xScale,height:u.height*this.dragTransform.yScale}}ui(){const r=this.el.parentElement.getBoundingClientRect(),a=this.helper.getBoundingClientRect();return{position:{top:(a.top-r.top)*this.dragTransform.yScale,left:(a.left-r.left)*this.dragTransform.xScale}}}}c9.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class nHe extends aA{constructor(r,a={}){super(),this.el=r,this.option=a,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Xw&&(this.el.addEventListener("pointerenter",RZ),this.el.addEventListener("pointerleave",UZ)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Xw&&(this.el.removeEventListener("pointerenter",RZ),this.el.removeEventListener("pointerleave",UZ)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(a=>this.option[a]=r[a]),this._setupAccept(),this}_mouseEnter(r){if(!Nf.dragElement||!this._canDrop(Nf.dragElement.el))return;r.preventDefault(),r.stopPropagation(),Nf.dropElement&&Nf.dropElement!==this&&Nf.dropElement._mouseLeave(r,!0),Nf.dropElement=this;const a=ru.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(a,this._ui(Nf.dragElement)),this.triggerEvent("dropover",a),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,a=!1){var v;if(!Nf.dragElement||Nf.dropElement!==this)return;r.preventDefault(),r.stopPropagation();const $=ru.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out($,this._ui(Nf.dragElement)),this.triggerEvent("dropout",$),Nf.dropElement===this&&(delete Nf.dropElement,!a)){let h,u=this.el.parentElement;for(;!h&&u;)h=(v=u.ddElement)==null?void 0:v.ddDroppable,u=u.parentElement;h&&h._mouseEnter(r)}}drop(r){r.preventDefault();const a=ru.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(a,this._ui(Nf.dragElement)),this.triggerEvent("drop",a)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return{draggable:r.el,...r.ui()}}}class nA{static init(r){return r.ddElement||(r.ddElement=new nA(r)),r.ddElement}constructor(r){this.el=r}on(r,a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,a),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new c9(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new l9(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new nHe(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class iHe{resizable(r,a,v,$){return this._getDDElements(r,a).forEach(h=>{if(a==="disable"||a==="enable")h.ddResizable&&h.ddResizable[a]();else if(a==="destroy")h.ddResizable&&h.cleanResizable();else if(a==="option")h.setupResizable({[v]:$});else{const u=h.el.gridstackNode.grid;let i=h.el.getAttribute("gs-resize-handles")||u.opts.resizable.handles||"e,s,se";i==="all"&&(i="n,e,s,w,se,sw,ne,nw");const p=!u.opts.alwaysShowResizeHandle;h.setupResizable({...u.opts.resizable,handles:i,autoHide:p,start:a.start,stop:a.stop,resize:a.resize})}}),this}draggable(r,a,v,$){return this._getDDElements(r,a).forEach(h=>{if(a==="disable"||a==="enable")h.ddDraggable&&h.ddDraggable[a]();else if(a==="destroy")h.ddDraggable&&h.cleanDraggable();else if(a==="option")h.setupDraggable({[v]:$});else{const u=h.el.gridstackNode.grid;h.setupDraggable({...u.opts.draggable,start:a.start,stop:a.stop,drag:a.drag})}}),this}dragIn(r,a){return this._getDDElements(r).forEach(v=>v.setupDraggable(a)),this}droppable(r,a,v,$){return typeof a.accept=="function"&&!a._accept&&(a._accept=a.accept,a.accept=h=>a._accept(h)),this._getDDElements(r,a).forEach(h=>{a==="disable"||a==="enable"?h.ddDroppable&&h.ddDroppable[a]():a==="destroy"?h.ddDroppable&&h.cleanDroppable():a==="option"?h.setupDroppable({[v]:$}):h.setupDroppable(a)}),this}isDroppable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,a,v){return this._getDDElements(r).forEach($=>$.on(a,h=>{v(h,Nf.dragElement?Nf.dragElement.el:h.target,Nf.dragElement?Nf.dragElement.helper:null)})),this}off(r,a){return this._getDDElements(r).forEach(v=>v.off(a)),this}_getDDElements(r,a){const v=r.gridstack||a!=="destroy"&&a!=="disable",$=ru.getElements(r);return $.length?$.map(h=>h.ddElement||(v?nA.init(h):null)).filter(h=>h):[]}}/*!
|
|
7985
|
+
`+$):a.stack=$}catch{}}throw a}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=LS(this.defaults,r);const{transitional:a,paramsSerializer:v,headers:$}=r;a!==void 0&&fN.assertOptions(a,{silentJSONParsing:A5.transitional(A5.boolean),forcedJSONParsing:A5.transitional(A5.boolean),clarifyTimeoutError:A5.transitional(A5.boolean)},!1),v!=null&&(tu.isFunction(v)?r.paramsSerializer={serialize:v}:fN.assertOptions(v,{encode:A5.function,serialize:A5.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),fN.assertOptions(r,{baseUrl:A5.spelling("baseURL"),withXsrfToken:A5.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let h=$&&tu.merge($.common,$[r.method]);$&&tu.forEach(["delete","get","head","post","put","patch","common"],x=>{delete $[x]}),r.headers=H_.concat(h,$);const u=[];let i=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(i=i&&x.synchronous,u.unshift(x.fulfilled,x.rejected))});const p=[];this.interceptors.response.forEach(function(x){p.push(x.fulfilled,x.rejected)});let l,n=0,k;if(!i){const x=[CZ.bind(this),void 0];for(x.unshift(...u),x.push(...p),k=x.length,l=Promise.resolve(r);n<k;)l=l.then(x[n++],x[n++]);return l}k=u.length;let T=r;for(;n<k;){const x=u[n++],d=u[n++];try{T=x(T)}catch(o){d.call(this,o);break}}try{l=CZ.call(this,T)}catch(x){return Promise.reject(x)}for(n=0,k=p.length;n<k;)l=l.then(p[n++],p[n++]);return l}getUri(e){e=LS(this.defaults,e);const r=yZ(e.baseURL,e.url,e.allowAbsoluteUrls);return sZ(r,e.params,e.paramsSerializer)}};tu.forEach(["delete","get","head","options"],function(e){CS.prototype[e]=function(r,a){return this.request(LS(a||{},{method:e,url:r,data:(a||{}).data}))}}),tu.forEach(["post","put","patch"],function(e){function r(a){return function(v,$,h){return this.request(LS(h||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:v,data:$}))}}CS.prototype[e]=r(),CS.prototype[e+"Form"]=r(!0)});let TZe=class sQ{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function($){a=$});const v=this;this.promise.then($=>{if(!v._listeners)return;let h=v._listeners.length;for(;h-- >0;)v._listeners[h]($);v._listeners=null}),this.promise.then=$=>{let h;const u=new Promise(i=>{v.subscribe(i),h=i}).then($);return u.cancel=function(){v.unsubscribe(h)},u},r(function($,h,u){v.reason||(v.reason=new Yk($,h,u),a(v.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const a=this._listeners.indexOf(r);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const r=new AbortController,a=v=>{r.abort(v)};return this.subscribe(a),r.signal.unsubscribe=()=>this.unsubscribe(a),r.signal}static source(){let r;return{token:new sQ(function(a){r=a}),cancel:r}}};function SZe(e){return function(r){return e.apply(null,r)}}function kZe(e){return tu.isObject(e)&&e.isAxiosError===!0}const $P={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($P).forEach(([e,r])=>{$P[r]=e});function EZ(e){const r=new CS(e),a=XG(CS.prototype.request,r);return tu.extend(a,CS.prototype,r,{allOwnKeys:!0}),tu.extend(a,r,null,{allOwnKeys:!0}),a.create=function(v){return EZ(LS(e,v))},a}const xv=EZ(o9);xv.Axios=CS,xv.CanceledError=Yk,xv.CancelToken=TZe,xv.isCancel=pZ,xv.VERSION=OZ,xv.toFormData=cN,xv.AxiosError=Am,xv.Cancel=xv.CanceledError,xv.all=function(e){return Promise.all(e)},xv.spread=SZe,xv.isAxiosError=kZe,xv.mergeConfig=LS,xv.AxiosHeaders=H_,xv.formToJSON=e=>uZ(tu.isHTMLForm(e)?new FormData(e):e),xv.getAdapter=LZ.getAdapter,xv.HttpStatusCode=$P,xv.default=xv;const{Axios:Zwt,AxiosError:Jwt,CanceledError:Hwt,isCancel:Ywt,CancelToken:Qwt,VERSION:$wt,all:e5t,Cancel:t5t,isAxiosError:r5t,spread:a5t,toFormData:n5t,AxiosHeaders:i5t,HttpStatusCode:o5t,formToJSON:s5t,getAdapter:l5t,mergeConfig:c5t}=xv,LZe=["gameId","playerId","teamId","x","y","momentOfPlay","section","playId","timeSection"];let eA=null;function CZe(){return eA||(eA=LZe.reduce((e,r,a)=>(e[a]=r,e),{})),eA}const OZe=["playId","playerId","teamId","gameId","categoryId","relatedCategoriesIds","x1","y1","x2","y2","x3","y3","fieldSection","momentOfPlay","playingAs","matchLapse","matchResult","matchResultAtMomentOfPlay","relatedPlayId","touchOrder","timeSection"];let tA=null;function NZe(){return tA||(tA=OZe.reduce((e,r,a)=>(e[a]=r,e),{})),tA}const mN={TO_RIGHT:"toRight",TO_LEFT:"toLeft"},EZe={class:"modal-confirmation"},zZe={class:"modal-confirmation__container"},MZe={class:"modal-confirmation__title"},VZe={class:"modal-confirmation"},PZe={class:"modal-confirmation__container"},AZe={class:"modal-confirmation__title"},RZe={class:"specific-plays-titlecontainer"},UZe={class:"specific-plays-title"},FZe={key:0,class:"specific-plays-title-elegibility"},IZe={key:1},qZe={class:"specific-plays-controls"},jZe={class:"specific-plays-controls11"},WZe={class:"radio-container"},DZe={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},KZe={class:"radio-label"},BZe=["src"],XZe={class:"radio-container"},GZe={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZZe={class:"radio-label"},JZe=["src"],HZe={class:"cont-app-value-incement-second"},YZe={class:"contappvalueincementsecond-value"},QZe={key:0},$Ze={class:"contappvalueincementsecond-controls-container"},eJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},tJe={class:"text-icon-info"},rJe={class:"cont-app-value-incement-second"},aJe={class:"contappvalueincementsecond-value"},nJe={key:0},iJe={class:"contappvalueincementsecond-controls-container"},oJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},sJe={class:"text-icon-info"},lJe={class:"cont-app-value-incement-second"},cJe={class:"contappvalueincementsecond-value"},uJe={key:0},dJe={class:"contappvalueincementsecond-controls-container"},pJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},hJe={class:"specific-plays-field__soccer-field"},fJe={class:"game-teams"},mJe={class:"game-teams__team home"},yJe={key:0,class:"team-logo"},gJe=["src"],vJe={class:"game-teams__team away"},bJe={key:0,class:"team-logo"},xJe=["src"],_Je={class:"specific-plays-field__play-buttons__container"},wJe={key:1,class:"specific-plays-radio-container-movil"},TJe={class:"radio-container"},SJe={class:"radio-label"},kJe=["src"],LJe={class:"radio-container"},CJe={class:"radio-label"},OJe=["src"],NJe={key:0,class:"h-separator"},EJe={key:1,class:"corner-info"},zJe={class:"corner-info__team"},MJe=["src"],VJe={class:"corner-info__details"},PJe={class:"corner-info__details__player"},AJe={class:"corner-info__details__how-was"},yN=.6,RJe=5,UJe=10,FJe=600,IJe=600,qJe=5,jJe={__name:"GSCSpecificPlays",props:{widthContainer:{type:Number,default:1280},selectedCategoryId:{type:Number,default:31},teamIdForAnalysis:{type:Number,default:1},playIdForAnalysis:{type:Number,default:null},seasonIdForAnalysis:{type:Number,default:1325},tournamentSelected:{type:Object,default:()=>({})},advancedFilters:{type:Object,default:()=>({areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0})},filters:{type:Object,default:()=>({isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0})},isGameOnly:{type:Boolean,default:!1},game:{type:Object,default:()=>({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"})},gameIdForAnalysis:{type:Number,default:null},isAgainstMode:{type:Boolean,default:!1},areFiltersOpen:{type:Boolean,default:!1},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])},isFieldOnly:{type:Boolean,default:!0},isTemplateMode:{type:Boolean,default:!1},isCornerInfoVisible:{type:Boolean,default:!1},isNullCornerData:{type:Boolean,default:!1}},emits:["open-media-player","corners-filled","changelateralidad"],setup(e,{emit:r}){let a=0;const v=e,$=CZe(),h=NZe(),u=[{text:"Rematado fue gol",categoriesIds:[583,585,587,589]},{text:"Rematado no fue gol",categoriesIds:[584,586,588,590]},{text:"Rematado sin destino",categoriesIds:[122,128,136,142]},{text:v.tournamentSelected.is_female==1?"Ganado por portera rival":"Ganado por portero rival",categoriesIds:[123,129,137,143]},{text:v.tournamentSelected.is_female==1?"Ganado por jugadora rival":"Ganado por jugador rival",categoriesIds:[124,130,138,144]},{text:"Sin destino",categoriesIds:[125,131,139,145]}],i=new Map([[120,"Comba hacia afuera"],[134,"Comba hacia afuera"],[126,"Comba hacia adentro"],[140,"Comba hacia adentro"],[327,"Raz de área"],[146,"Raz de área"],[133,"En corto"],[147,"En corto"]]),p=u.reduce(($t,Rt)=>(Rt.categoriesIds.forEach(sr=>{$t.set(sr,Rt.text)}),$t),new Map),l={headers:{Authorization:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},n=r,k=t.ref(null),T=t.ref("0"),x=t.ref(["-1","0"]),d=t.ref(new Map),o=t.ref(!v.isTacticVisible),c=t.ref(!1),s=t.ref([]),f=t.ref(!0),g=t.ref(!0),S=t.ref(!1),L=t.ref(!1),E=t.ref(new Map),P=t.computed(()=>{if(v.gameIdForAnalysis&&v.playIdForAnalysis&&s.value){const $t=s.value.find(Rt=>Rt.game_id===v.gameIdForAnalysis);if($t){if($t.corners.find(Rt=>Rt.play_id===v.playIdForAnalysis))return!1;if($t.cornersAgainstTeam.find(Rt=>Rt.play_id===v.playIdForAnalysis))return!0}}return v.isAgainstMode}),V=t.computed(()=>{const $t=[];return U.value&&(f.value&&$t.push(v.teamIdForAnalysis),g.value&&$t.push(v.teamIdForAnalysis!==U.value.home_team?U.value.home_team:U.value.visiting_team)),$t}),I=t.computed(()=>v.widthContainer<=768?"cont-data768":"cont-data"),j=t.computed(()=>{const $t=v.widthContainer;return $t<=768?"cont-collectors768":$t<=900?"cont-collectors900":"cont-collectors"}),F=t.computed(()=>{const $t=v.widthContainer;return $t<=768?"cont-who-connected768":$t<=900?"cont-who-connected900":"cont-who-connected"}),W=t.computed(()=>s.value?s.value.findIndex($t=>$t.isSelected):null),U=t.computed(()=>s.value?s.value[W.value]:null),z=t.ref(null),X=t.computed(()=>{const $t=s.value[W.value];let Rt=!1;if($t){const sr=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(Zt=>Zt.isSelected);if(sr&&sr.playConnections){ge(sr);const Zt=sr.playConnections;let Tt=[Zt.mainPlay];return Zt.relatedPlays&&Tt.push(...Zt.relatedPlays),Tt.sort((Pt,Ut)=>Pt.touchOrder-Ut.touchOrder),Tt=Tt.filter(Pt=>{let Ut=!0;return Rt?!1:(N.value?Ut=!Pt.isTeamForAnalysis&&Pt.y1<=yN||Pt.isTeamForAnalysis&&Pt.y1>=yN:Ut=Pt.isTeamForAnalysis&&Pt.y1<=yN||!Pt.isTeamForAnalysis&&Pt.y1>=yN,Rt=!Ut,Ut)}),Tt.forEach((Pt,Ut)=>{Ut>0&&(Pt.previousPlayConnection=Tt[Ut-1]),Ut===Tt.length-1&&(Pt.isLastPlay=!0)}),Tt}}return[]}),N=t.computed(()=>{const $t=s.value[W.value];if($t){const Rt=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Rt?Rt.isAgainst:!1}return!1}),Y=t.computed(()=>{const $t=s.value[W.value];if($t){me($t);const Rt=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Rt?Rt.fieldPositions:null}return null}),se=t.ref({});function me($t){se.value=$t}function ge($t){z.value=$t}const be=t.computed(()=>Y.value?Y.value.get(T.value):[]),xe=t.computed(()=>{if(Y.value){const $t=Number(x.value[0]),Rt=Number(x.value[1]),sr=[];if(Rt!==$t)for(let Zt=$t;Zt<Rt;Zt++){const Tt=Y.value.get(Zt.toString()),Pt=Y.value.get((Zt+1).toString());Tt&&Pt&&sr.push({playersPositions:Tt,finalPlayersPositions:Pt,areFirstPositions:Zt===$t,areFinalPositions:Zt===Rt-1})}else sr.push({playersPositions:Y.value.get(x.value[0]),finalPlayersPositions:Y.value.get(x.value[0]),areFirstPositions:!0,areFinalPositions:!0});return sr}return[]}),Ae=t.computed(()=>Y.value?Array.from(Y.value.keys()):[]);t.watch(()=>v.advancedFilters,$t=>{o.value=$t.areConnectionsVisible,c.value=$t.arePathsVisible;const Rt=$t.secondsBeforeAndAfter.toString(),sr=$t.secondsBefore.toString(),Zt=$t.secondsAfter.toString();Ae.value.includes(Rt)&&(T.value=Rt),Ae.value.includes(sr)&&(x.value[0]=sr),Ae.value.includes(Zt)&&(x.value[1]=Zt)},{immediate:!0,deep:!0}),t.watch(()=>P.value,()=>{v.isNullCornerData||Et()}),t.watch(()=>v.teamIdForAnalysis,$t=>{$t&&!v.isNullCornerData&&Mt()},{immediate:!0});const je=t.computed(()=>U.value?v.teamIdForAnalysis===U.value.home_team:!0);t.watch(()=>W.value,($t,Rt)=>{if($t!==Rt&&(T.value="0",x.value=["-1","0"],U.value)){U.value.corners.forEach(Zt=>{Zt.isSelected=!1}),U.value.cornersAgainstTeam.forEach(Zt=>{Zt.isSelected=!1});const sr=(P.value?U.value.cornersAgainstTeam:U.value.corners).filter(Zt=>Zt.isVisible);sr.length>0&&(sr[0].isSelected=!0)}}),t.watch(()=>v.filters,$t=>{$t&&Ue()},{deep:!0,immediate:!0}),t.watch(()=>v.isTacticVisible,$t=>{o.value=!$t});function _e($t){n("changelateralidad",$t)}function Ue(){if(s.value)if(v.isSynchronization)s.value.forEach(($t,Rt)=>{$t.isVisible=!0,Rt===0&&($t.isSelected=!0,$t.isExpanded=!0,$t.corners.forEach(sr=>{sr.isVisible=!0}),$t.cornersAgainstTeam.forEach(sr=>{sr.isVisible=!0}))});else{let $t=!1;s.value.forEach(Rt=>{if(Rt.isSelected=!1,P.value&&Rt.isSoccerFieldDataRivalLoaded||!P.value&&Rt.isSoccerFieldDataLoaded){const sr=P.value?Rt.cornersAgainstTeam:Rt.corners;if((!v.filters.games.length||v.filters.games.includes(Rt.game_id))&&v.filters.playingAs.includes(Rt.playingAs)&&(v.filters.isMoment||v.filters.final.includes(Rt.finalResult))){let Zt=0;for(const Tt of sr){if(Tt.isSelected=!1,v.playIdForAnalysis&&Tt.play_id===v.playIdForAnalysis){Tt.isVisible=!0,Tt.isSelected=!0,Zt++;break}if(v.filters.cornertype!==Tt.init_category_id){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!v.filters.howWas.some(Pt=>Tt.relatedCategoriesIds.has(Pt))){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!P.value&&v.filters.players.length&&!v.filters.players.includes(Tt.player_id)){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(Tt.playConnections){if(!v.filters.sections.includes(Tt.playConnections.mainPlay.timeSection)){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!v.filters.moment.includes(Tt.playConnections.mainPlay.matchResultAtMomentOfPlay)){Tt.isVisible=!1,Tt.isSelected=!1;continue}const Pt=Tt.playConnections.mainPlay;if(Pt&&!v.filters.isZoneFull&&!v.filters.zona.includes(Pt.fieldSection)){Tt.isVisible=!1,Tt.isSelected=!1;continue}}if(!v.filters.isWhatHappenedFull&&Tt.relatedCategoriesIds&&!v.filters.whathappened.some(Pt=>Tt.relatedCategoriesIds.has(Pt))){Tt.isVisible=!1,Tt.isSelected=!1;continue}Tt.isVisible=!0,Zt===0&&(Tt.isSelected=!0),Zt++}Rt.isVisible=Zt>0,Rt.isVisible&&!$t?(Rt.isSelected=!0,Rt.isExpanded=!0,$t=!0):Rt.isSelected=!1}else Rt.isVisible=!1,sr.forEach(Zt=>{Zt.isVisible=!1,Zt.isSelected=!1})}})}}function qe([$t,Rt]){const sr=Math.round(Number(Rt));if(sr===60){const Zt=Number($t)+1;return`${Zt<100?Zt<10?"00":"0":""}${Zt}:00.000`}return`${$t}:${sr<10?"0":""}${sr}.000`}function Re($t,Rt,sr,Zt){$t&&$t.forEach(Tt=>{Tt.isHomeTeam=Tt.teamId===U.value.home_team,Tt.attackDirection=Zt.get(Tt.playId).mainPlay.attackDirection,Tt.player=Rt.get(Tt.playerId)||sr.get(Tt.playerId)})}function De($t,Rt){const sr=Number(x.value[Rt])+$t;if(Ae.value.includes(sr.toString())){const Zt=[...x.value];Zt[Rt]=sr.toString(),Number(Zt[1])-Number(Zt[0])>=0&&(x.value=[...Zt])}}function Qe($t){const Rt=Number(T.value)+$t;Ae.value.includes(Rt.toString())&&(T.value=Rt.toString())}function rt($t){if(!$t.teams||$t.teams.length===0)return;const Rt=$t.teams[0].team_id,sr=$t.teams[1].team_id;if(v.teamIdForAnalysis===Rt&&$t.home_atk_direction===1||v.teamIdForAnalysis===sr&&$t.visiting_atk_direction===1)for(let Zt=1;Zt<5;Zt++)d.value.set(Zt,Zt%2===0?mN.TO_LEFT:mN.TO_RIGHT);else for(let Zt=1;Zt<5;Zt++)d.value.set(Zt,Zt%2===0?mN.TO_RIGHT:mN.TO_LEFT)}function dt(){L.value=!0}function ct(){L.value=!1}async function Ye(){try{if(U.value){const $t={messages:[{queue:"gs3.tendency",message:{key:"postmatch",action:"season",data:{season_id:v.seasonIdForAnalysis,game_id:U.value.game_id}}}]};await xv.post("https://6xh1ym8shh.execute-api.us-west-2.amazonaws.com/prod/pushInternalData",$t,l)}}catch($t){throw new Error($t)}finally{ct()}}function st(){S.value=!0}function lt(){S.value=!1}async function Ot(){try{if(U.value){const $t=U.value[`${P.value?"cornersAgainstTeam":"corners"}`].find(Rt=>Rt.isSelected);if($t){const Rt={play_id:$t.play_id,game_id:U.value.game_id,season_id:v.seasonIdForAnalysis,seconds:Number(T.value),moment_of_play:$t.moment_of_play};await xv.post(" https://bqsyfm7sij.execute-api.us-east-2.amazonaws.com/prod/sync",Rt,l)}}}catch($t){throw new Error($t)}finally{lt()}}async function Mt($t){try{const Rt=E.value.get(v.teamIdForAnalysis);if(Rt){s.value=Rt,Ue();return}a=$t||v.seasonIdForAnalysis;const sr=(await xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${a}/games/teams/${v.teamIdForAnalysis}/corners`,l)).data,Zt={corners:0,cornersAgainst:0};s.value=sr.games?sr.games.reduce((Tt,Pt)=>{if(v.isGameOnly&&v.gameIdForAnalysis!==Pt.game_id)return Tt;const Ut={againstTeam:[],team:[]},vr=Pt.score[1]-Pt.score[0];Pt.dateMillis=new Date(Pt.date_time_utc),Pt.isVisible=!0,Pt.playingAs=Pt.home_team===v.teamIdForAnalysis?1:2,Pt.finalResult=vr===0?3:Pt.playingAs===1?vr>0?2:1:vr<0?2:1,Pt.corners.forEach(Tr=>{const Rr=Tr.team_id===v.teamIdForAnalysis;Tr.isAgainst=!Rr,(!v.playIdForAnalysis||v.playIdForAnalysis===Tr.play_id)&&(Rr?Ut.team.push(Tr):Ut.againstTeam.push(Tr))}),Pt.corners=Ut.team,Pt.cornersAgainstTeam=Ut.againstTeam;const ur=Pt.home_team===v.teamIdForAnalysis?1:2;Zt.corners+=Pt.corners.length,Zt.cornersAgainst+=Pt.cornersAgainstTeam.length;const gr={...Pt,isSelected:Tt.length===0,isExpanded:!1,isTeamForAnalysisHomeTeam:Pt.home_team===v.teamIdForAnalysis,canPlayVideos:v.canPlayVideos&&v.videoPrivilegesPlayingAs.has(ur)};return Tt.push(gr),Tt},[]):[],s.value=s.value.sort((Tt,Pt)=>Pt.dateMillis-Tt.dateMillis),qt(),n("corners-filled",Zt),await Et(),s.value.forEach(Tt=>{Tt.corners.concat(Tt.cornersAgainstTeam).forEach(Pt=>{if(Pt.playConnections){const[Ut,vr]=Pt.moment_of_play.split(":"),[ur,gr]=vr.split("."),Tr=Number(Ut)+45*Pt.playConnections.mainPlay.matchLapse;Pt.isSelected=!1,Pt.orderValue=+`${Tr}${ur}${gr}`}}),Tt.corners=Tt.corners.sort((Pt,Ut)=>Pt.orderValue-Ut.orderValue),Tt.cornersAgainstTeam=Tt.cornersAgainstTeam.sort((Pt,Ut)=>Pt.orderValue-Ut.orderValue)}),Ue()}catch(Rt){throw new Error(Rt)}}async function Et(){try{const $t=[];s.value.forEach(Rt=>{(P.value&&!Rt.isSoccerFieldDataRivalLoaded||!P.value&&!Rt.isSoccerFieldDataLoaded)&&$t.push(Gt(Rt))}),$t.length>0&&((await Promise.all($t)).forEach((Rt,sr)=>{lr(s.value[sr],Rt)}),Ue()),qt()}catch($t){throw new Error($t)}}function qt(){E.value.get(v.teamIdForAnalysis)||E.value.set(v.teamIdForAnalysis,s.value)}function Gt($t){return v.isSynchronization?xv.get(`https://golstats-microservices.s3.us-west-2.amazonaws.com/tendency/corners-${P.value?"received":"commited"}-${a}-${v.teamIdForAnalysis}-${$t.game_id}-large.json`):xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${a}/corners/trends/teams/${v.teamIdForAnalysis}/${$t.game_id}${P.value?"?isR=1":""}`,l)}function Jt($t){const[Rt,sr]=$t.split(", ");let Zt="";const Tt=Rt.split(" ");for(const Pt of Tt)if(Zt+=` ${Pt}`,Pt.length>3)break;return sr&&Rt?`${sr.trim().charAt(0)}.${Zt}`:""}function Qt($t){let[Rt,sr]=$t.split(", ");sr=(sr==null?void 0:sr.trim())||"";let Zt="";const Tt=Rt.split(" "),Pt=sr.includes(" ")?sr.split(" ")[0]:sr;for(const Ut of Tt)if(Zt+=` ${Ut}`,Ut.length>3)break;return Pt&&Rt?`${Pt} ${Zt}`:""}async function lr($t,Rt){try{if($t&&Rt&&(!$t.isSoccerFieldDataLoaded||!$t.isSoccerFieldDataRivalLoaded)){const sr=new Map,Zt=new Map,Tt=new Map;rt(Rt.data),Rt.data.players&&Rt.data.players.forEach(ur=>{ur.shortName=Jt(ur.name),ur.firstNameAndFirstLastName=Qt(ur.name),Zt.set(ur.player_id,ur)}),Rt.data.rival_players&&Rt.data.rival_players.forEach(ur=>{ur.shortName=Jt(ur.name),ur.firstNameAndFirstLastName=Qt(ur.name),Tt.set(ur.player_id,ur)}),k.value=Rt.data.teams.find(ur=>ur.team_id===v.teamIdForAnalysis),k.value&&(k.value.rival=Rt.data.teams.find(ur=>ur.team_id!==v.teamIdForAnalysis));const Pt=Rt.data.data.reduce((ur,gr)=>{const Tr=gr.reduce((or,Or,Pr)=>(or[h[Pr]]=Or,or.isHomeTeam=or.teamId===$t.home_team,or),{}),Rr=Tr.playId===Tr.relatedPlayId,St=ur.get(Tr.relatedPlayId),Yt=Tr.momentOfPlay.split(":"),er=qe(Yt);return Tr.player=Zt.get(Tr.playerId)||Tt.get(Tr.playerId),Tr.isTeamForAnalysis=Tr.teamId===v.teamIdForAnalysis,Rr&&(Tr.attackDirection=d.value.get(Tr.matchLapse),sr.set(Tr.playId,er)),St?Rr?St.mainPlay=Tr:St.relatedPlays.length<qJe&&(St.relatedPlays.push(Tr),St.relatedPlays.length>1&&St.relatedPlays.sort((or,Or)=>or.touchOrder-Or.touchOrder)):ur.set(Tr.playId,{mainPlay:Rr?Tr:null,relatedPlays:Rr?[]:[Tr]}),ur},new Map),Ut=Rt.data.field_positions.reduce((ur,gr)=>{const Tr=gr.reduce((St,Yt,er)=>(St[$[er]]=Yt,St),{});Tr.isTeamForAnalysis=Tr.teamId===v.teamIdForAnalysis;const Rr=ur.get(Tr.playId);if(Rr){const St=Rr.get(Tr.momentOfPlay);St?St.push(Tr):Rr.set(Tr.momentOfPlay,[Tr])}else ur.set(Tr.playId,new Map([[Tr.momentOfPlay,[Tr]]]));return ur},new Map),vr=Array.from(sr.entries()).reduce((ur,[gr,Tr])=>{const Rr=[],St=[];let Yt=null;const er=Ut.get(gr);if(er){const or=v.isSynchronization?FJe:RJe,Or=v.isSynchronization?IJe:UJe;Array.from(er.keys()).sort().forEach(oa=>{(!Yt||St.length<Or)&&(oa===Tr?Yt=er.get(oa):Yt?St.length<Or&&St.push(er.get(oa)):(Rr.length===or&&Rr.shift(),Rr.push(er.get(oa))))});const Pr=new Map;Rr.forEach((oa,Ia)=>{Re(oa,Zt,Tt,Pt),Pr.set(`${Ia-Rr.length}`,oa)}),Re(Yt,Zt,Tt,Pt),Pr.set("0",Yt),St.forEach((oa,Ia)=>{Re(oa,Zt,Tt,Pt),Pr.set(`${Ia+1}`,oa)}),ur.set(gr,Pr)}return ur},new Map);$t[`${P.value?"cornersAgainstTeam":"corners"}`].forEach(ur=>{const gr=ur.related_categories.split(",").reduce((Rr,St,Yt)=>{const er=Number(St);return Yt===1&&(ur.howWasCorner=er),Rr.array.push(er),Rr.sett.add(er),Rr},{array:[],sett:new Set});for(const Rr of gr.array){const St=i.get(Rr),Yt=p.get(Rr);if(Yt&&(ur.whatHappenedName=Yt),St&&(ur.howWasCornerName=St),ur.howWasCornerName&&ur.whatHappenedName)break}ur.relatedCategoriesIds=gr.sett,ur.playConnections=Pt.get(ur.play_id),ur.fieldPositions=vr.get(ur.play_id),ur.player=Zt.get(ur.player_id)||Tt.get(ur.player_id);let Tr=ur.moment_of_play.split(".")[0];Tr.startsWith("0")&&(Tr=Tr.slice(1)),ur.formattedMomentOfPlay=Tr,ur.momentOfPlayNumber=Number(Tr.replace(":","."))}),!P.value&&!$t.isSoccerFieldDataLoaded&&($t.isSoccerFieldDataLoaded=!0),P.value&&!$t.isSoccerFieldDataRivalLoaded&&($t.isSoccerFieldDataRivalLoaded=!0)}}catch(sr){throw new Error(sr)}}function hr($t){const Rt=U.value[`${P.value?"cornersAgainstTeam":"corners"}`],sr={},Zt=Rt.reduce((Tt,Pt)=>(Pt.isVisible&&(Tt.add(Pt.play_id),Pt.isSelected&&(sr.playId=Pt.play_id)),Tt),new Set);n("open-media-player",{seasonId:a,mainSectionType:1,playListType:1,playsIds:Zt,playData:sr,categoryIds:P.value?["31_r","32_r"]:[31,32],teamId:v.teamIdForAnalysis,videosType:$t,isCarouselOnly:!0})}return($t,Rt)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.withDirectives(t.createElementVNode("div",EZe,[t.createElementVNode("div",zZe,[t.createElementVNode("div",MZe," ¿Estás seguro que deseas sincronizar el tracking del partido "+t.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`]:"")+" vs "+t.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`]:"")+" ? ",1),t.createElementVNode("div",{class:"modal-confirmation__buttons"},[t.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:ct}," No "),t.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Ye},"Sí")])])],512),[[t.vShow,L.value]]),t.withDirectives(t.createElementVNode("div",VZe,[t.createElementVNode("div",PZe,[t.createElementVNode("div",AZe," ¿Estás seguro que deseas sincronizar esta jugada en el segundo "+t.toDisplayString(T.value)+"? ",1),t.createElementVNode("div",{class:"modal-confirmation__buttons"},[t.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:lt}," No "),t.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Ot},"Sí")])])],512),[[t.vShow,S.value]]),t.createElementVNode("div",{class:t.normalizeClass(e.widthContainer<=768?"gsc-specific-plays-movil":"gsc-specific-plays")},[t.withDirectives(t.createElementVNode("div",RZe,[t.createElementVNode("div",UZe,[e.widthContainer<=768?(t.openBlock(),t.createElementBlock("span",FZe,"Elige que quieres ver:")):(t.openBlock(),t.createElementBlock("span",IZe,"Jugadas Específicas"))])],512),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:t.normalizeClass(I.value)},[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(j.value)},[e.widthContainer>768?(t.openBlock(),t.createBlock(_Be,{key:0,"is-against-mode":P.value,"games-by-team":s.value,"are-filters-open":e.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"])):(t.openBlock(),t.createBlock(mXe,{key:1,"is-against-mode":P.value,"games-by-team":s.value,"are-filters-open":e.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"]))],2),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:t.normalizeClass(F.value)},[e.isSynchronization?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:"button-tracking",onClick:dt}," Generar datos ")):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("div",qZe,[t.createElementVNode("div",jZe,[t.createVNode(t.unref(IP),{modelValue:o.value,"onUpdate:modelValue":Rt[0]||(Rt[0]=sr=>o.value=sr),label:"Mostrar conexiones",fontFamily:"Poppins-Regular",labelFontSize:e.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"]),e.widthContainer<=768&&e.isTacticVisible?(t.openBlock(),t.createBlock(t.unref(IP),{key:0,modelValue:c.value,"onUpdate:modelValue":Rt[1]||(Rt[1]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:e.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"])):t.createCommentVNode("",!0),e.widthContainer>768?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["specific-plays-radio-container",{"is-away-team":!je.value}])},[U.value&&e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",WZe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[2]||(Rt[2]=sr=>f.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-home":"outer-circle-away")},[f.value?(t.openBlock(),t.createElementBlock("svg",DZe,[...Rt[16]||(Rt[16]=[t.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:"#0d1d29"},null,-1)])])):t.createCommentVNode("",!0)],2),t.createElementVNode("span",KZe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,BZe)])]),t.createElementVNode("label",XZe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[3]||(Rt[3]=sr=>g.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[t.vModelCheckbox,g.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[g.value?(t.openBlock(),t.createElementBlock("svg",GZe,[...Rt[17]||(Rt[17]=[t.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:"#0d1d29"},null,-1)])])):t.createCommentVNode("",!0)],2),t.createElementVNode("span",ZZe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,JZe)])])],64)):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:t.normalizeClass(["specific-plays-controls22",e.widthContainer<=375?"specific-plays-controls22small":""])},[e.widthContainer>768&&e.isTacticVisible&&!e.isSynchronization?(t.openBlock(),t.createBlock(t.unref(IP),{key:0,modelValue:c.value,"onUpdate:modelValue":Rt[4]||(Rt[4]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:"13px","label-color":"#FFF"},null,8,["modelValue"])):t.createCommentVNode("",!0),e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[c.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(e.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[t.createElementVNode("div",tJe,[e.widthContainer>990||e.widthContainer<=768&&e.widthContainer>=420?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Inicio: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Inicio:")],64))]),Rt[29]||(Rt[29]=t.createElementVNode("div",{class:"icon-info"},null,-1)),t.createElementVNode("div",rJe,[t.createElementVNode("div",aJe,[Number(x.value[0])>0?(t.openBlock(),t.createElementBlock("span",nJe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(x.value[0]),1)]),Rt[25]||(Rt[25]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",iJe,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[7]||(Rt[7]=sr=>De(1,0))},[(t.openBlock(),t.createElementBlock("svg",oJe,[...Rt[23]||(Rt[23]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[8]||(Rt[8]=sr=>De(-1,0))},[...Rt[24]||(Rt[24]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])]),t.createElementVNode("div",sJe,[e.widthContainer>990||e.widthContainer<=768&&e.widthContainer>=420?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Fin: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Fin:")],64))]),Rt[30]||(Rt[30]=t.createElementVNode("div",{class:"icon-info"},null,-1)),t.createElementVNode("div",lJe,[t.createElementVNode("div",cJe,[Number(x.value[1])>0?(t.openBlock(),t.createElementBlock("span",uJe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(x.value[1]),1)]),Rt[28]||(Rt[28]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",dJe,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[9]||(Rt[9]=sr=>De(1,1))},[(t.openBlock(),t.createElementBlock("svg",pJe,[...Rt[26]||(Rt[26]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[10]||(Rt[10]=sr=>De(-1,1))},[...Rt[27]||(Rt[27]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2)):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[Rt[21]||(Rt[21]=t.createElementVNode("div",{class:"icon-info"},null,-1)),Rt[22]||(Rt[22]=t.createElementVNode("div",{class:"text-icon-info"},"Segundos antes/después del cobro:",-1)),t.createElementVNode("div",HZe,[t.createElementVNode("div",YZe,[Number(T.value)>0?(t.openBlock(),t.createElementBlock("span",QZe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(T.value),1)]),Rt[20]||(Rt[20]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",$Ze,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[5]||(Rt[5]=sr=>Qe(1))},[(t.openBlock(),t.createElementBlock("svg",eJe,[...Rt[18]||(Rt[18]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[6]||(Rt[6]=sr=>Qe(-1))},[...Rt[19]||(Rt[19]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2))],64)):t.createCommentVNode("",!0),e.isSynchronization?(t.openBlock(),t.createElementBlock("div",{key:2,role:"button",class:"button-sync",onClick:st}," Guardar sincronización ")):t.createCommentVNode("",!0)],2)],512),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:"specific-plays-field",style:t.normalizeStyle(e.widthContainer<=768?"height: auto":"")},[t.createElementVNode("div",hJe,[t.createVNode(HXe,{"width-container":e.widthContainer,"play-connections":X.value,"players-positions":be.value,"players-positions-by-range":xe.value,"team-id-for-analysis":e.teamIdForAnalysis,"selected-category":e.filters.cornertype,"are-connections-visible":o.value,"are-position-paths-visible":c.value,"visible-teams-ids":V.value,"is-against-corner":N.value,onChangelateralidad:_e},null,8,["width-container","play-connections","players-positions","players-positions-by-range","team-id-for-analysis","selected-category","are-connections-visible","are-position-paths-visible","visible-teams-ids","is-against-corner"])]),t.createElementVNode("div",fJe,[t.createElementVNode("div",mJe,[e.isTemplateMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",yJe,[t.createElementVNode("img",{src:se.value.home_team_logo,alt:""},null,8,gJe)])),Rt[31]||(Rt[31]=t.createElementVNode("div",{class:"bullet"},null,-1))]),t.createElementVNode("div",vJe,[e.isTemplateMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",bJe,[t.createElementVNode("img",{src:se.value.visiting_team_logo,alt:""},null,8,xJe)])),Rt[32]||(Rt[32]=t.createElementVNode("div",{class:"bullet"},null,-1))])]),U.value&&U.value.canPlayVideos&&!e.isFieldOnly?(t.openBlock(),t.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons",style:t.normalizeStyle(e.widthContainer<=768?"gap:5px; flex-direction: column;":"")},[Rt[36]||(Rt[36]=t.createElementVNode("div",{class:"specific-plays-field__play-buttons__text"},"Visualizar video:",-1)),t.createElementVNode("div",_Je,[U.value.video_types.includes(1)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons__button",onClick:Rt[11]||(Rt[11]=sr=>hr(1))},[...Rt[33]||(Rt[33]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Toma TV",-1)])])):t.createCommentVNode("",!0),U.value.video_types.includes(3)?(t.openBlock(),t.createElementBlock("div",{key:1,class:"specific-plays-field__play-buttons__button",onClick:Rt[12]||(Rt[12]=sr=>hr(3))},[...Rt[34]||(Rt[34]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Táctica",-1)])])):t.createCommentVNode("",!0),U.value.video_types.includes(2)?(t.openBlock(),t.createElementBlock("div",{key:2,class:"specific-plays-field__play-buttons__button",onClick:Rt[13]||(Rt[13]=sr=>hr(2))},[...Rt[35]||(Rt[35]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Panorámica",-1)])])):t.createCommentVNode("",!0)])],4)):t.createCommentVNode("",!0)],4),e.widthContainer<=768?(t.openBlock(),t.createElementBlock("div",wJe,[U.value&&e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",TJe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[14]||(Rt[14]=sr=>f.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[...Rt[37]||(Rt[37]=[t.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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:"#0d1d29"})],-1)])],2),t.createElementVNode("span",SJe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,kJe)])]),t.createElementVNode("label",LJe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[15]||(Rt[15]=sr=>g.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[t.vModelCheckbox,g.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[...Rt[38]||(Rt[38]=[t.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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:"#0d1d29"})],-1)])],2),t.createElementVNode("span",CJe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,OJe)])])],64)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],2)],2),z.value&&e.isCornerInfoVisible?(t.openBlock(),t.createElementBlock("div",NJe)):t.createCommentVNode("",!0),z.value&&e.isCornerInfoVisible?(t.openBlock(),t.createElementBlock("div",EJe,[t.createElementVNode("div",zJe,[t.createElementVNode("img",{class:"corner-info__team__logo",src:`https://golstatsimages.blob.core.windows.net/teams-80/${z.value.team_id}.png`},null,8,MJe)]),t.createElementVNode("div",VJe,[t.createElementVNode("div",PJe,[Rt[39]||(Rt[39]=t.createElementVNode("span",null," Tiro de esquina ",-1)),Rt[40]||(Rt[40]=t.createElementVNode("span",{class:"separator"}," | ",-1)),t.createElementVNode("span",null,t.toDisplayString(z.value.player.firstNameAndFirstLastName),1)]),t.createElementVNode("div",AJe,[t.createElementVNode("span",null,t.toDisplayString(z.value.howWasCornerName),1),Rt[41]||(Rt[41]=t.createElementVNode("span",{class:"separator"}," | ",-1)),t.createElementVNode("span",null,t.toDisplayString(z.value.whatHappenedName),1)])])])):t.createCommentVNode("",!0)],2)],64))}},zZ=j6(jJe,[["__scopeId","data-v-abec1cab"]]),WJe={class:"tooltip-options"},DJe={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(e,{emit:r}){const a=e,v=r,$=t.computed(()=>a.optionsType==="page");function h(){v("close-tooltip")}function u(i){v(i),h()}return(i,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"tooltip-overlay",onClick:h}),t.createElementVNode("div",WJe,[t.createElementVNode("ul",null,[$.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("li",{class:"option",onClick:p[0]||(p[0]=l=>u("change-sort"))},[...p[4]||(p[4]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),t.createTextVNode(" Cambiar orden ",-1)])]),t.createElementVNode("li",{class:"option",onClick:p[1]||(p[1]=l=>u("delete-page"))},[...p[5]||(p[5]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),t.createTextVNode(" Eliminar ",-1)])])],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("li",{class:"option",onClick:p[2]||(p[2]=l=>u("edit"))},[...p[6]||(p[6]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),t.createTextVNode(" Editar ",-1)])]),t.createElementVNode("li",{class:"option",onClick:p[3]||(p[3]=l=>u("delete"))},[...p[7]||(p[7]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),t.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},MZ=t2(DJe,[["__scopeId","data-v-998e2429"]]),KJe={class:"report-view"},BJe={class:"report-view__header"},XJe={key:0,class:"report-view__header__logo"},GJe=["src"],ZJe={class:"report-view__header__name"},JJe={class:"report-view__content"},HJe={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(e,{emit:r}){const a=e,v=t.ref(!1),$=r,h=[1,2,3,4,6,8,14,13],u=t.computed(()=>!h.includes(a.viewId)),i=t.computed(()=>{if(a.game){const o=a.isHomeTeam?a.game.homeTeam:a.game.awayTeam;if(o&&o.logo)return o.logo}return""}),p=t.computed(()=>{const o=a.view.coreView;return o?o.id===9?a.view.w<4?a.view.title.replace("Mapeo de ",""):a.view.title:o.id===6?n(a.view):o.id===13?k(a.view):a.view.title:a.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function n(o){return a.isPostMatch?o.title:`${o.title} ${l.get(o.componentProps.gameNumber)+" partido"||""}`}function k(o){try{if(!o)return"Tabla por Categoría";const c=o.dynamicFilters||[];if(!Array.isArray(c)||c.length<2)return"Tabla por Categoría";const s=c[1]||[],f=c[0]||2;if(s&&s.length>0){const g=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:f==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:f==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:f==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:f==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],S=(L,E)=>{if(L.length!==E.length)return!1;const P=[...L].sort(),V=[...E].sort();return P.every((I,j)=>I===V[j])};for(const L of g)if(S(s,L.value))return L.label}return"Tabla por Categoría"}catch(c){return console.error("Error en getTableCategoryTitle:",c),"Tabla por Categoría"}}function T(){d(),$("edit")}function x(){d(),$("delete")}function d(){v.value=!1}return(o,c)=>(t.openBlock(),t.createElementBlock("div",KJe,[t.createElementVNode("div",BJe,[v.value?(t.openBlock(),t.createBlock(MZ,{key:0,"options-type":"view",onClick:c[0]||(c[0]=t.withModifiers(s=>v.value=!1,["self"])),onMouseleave:c[1]||(c[1]=s=>v.value=!1),onCloseTooltip:d,onEdit:T,onDelete:x})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"report-view__header__team-and-name",style:t.normalizeStyle(e.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[i.value&&u.value?(t.openBlock(),t.createElementBlock("div",XJe,[t.createElementVNode("img",{src:i.value,alt:""},null,8,GJe)])):t.createCommentVNode("",!0),t.createElementVNode("div",ZJe,t.toDisplayString(p.value),1)],4),t.withDirectives(t.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:c[2]||(c[2]=s=>v.value=!0)},[...c[3]||(c[3]=[t.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])],512),[[t.vShow,e.isTemplateMode&&!e.isFilterVisible]])]),t.createElementVNode("div",JJe,[t.createElementVNode("div",{class:t.normalizeClass({"field-possession-component":e.viewId===8,"timeline-component":e.viewId===4,"field-data-by-zones-component":e.viewId===9,"center-flex-column":![8,4,9].includes(e.viewId)})},[t.renderSlot(o.$slots,"default",{},void 0,!0)],2)])]))}},YJe=t2(HJe,[["__scopeId","data-v-103aa713"]]);function QJe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gN={exports:{}},VZ;function $Je(){if(VZ)return gN.exports;VZ=1;function e(){}return e.prototype={on:function(r,a,v){var $=this.e||(this.e={});return($[r]||($[r]=[])).push({fn:a,ctx:v}),this},once:function(r,a,v){var $=this;function h(){$.off(r,h),a.apply(v,arguments)}return h._=a,this.on(r,h,v)},emit:function(r){var a=[].slice.call(arguments,1),v=((this.e||(this.e={}))[r]||[]).slice(),$=0,h=v.length;for($;$<h;$++)v[$].fn.apply(v[$].ctx,a);return this},off:function(r,a){var v=this.e||(this.e={}),$=v[r],h=[];if($&&a)for(var u=0,i=$.length;u<i;u++)$[u].fn!==a&&$[u].fn._!==a&&h.push($[u]);return h.length?v[r]=h:delete v[r],this}},gN.exports=e,gN.exports.TinyEmitter=e,gN.exports}var rA,PZ;function eHe(){if(PZ)return rA;PZ=1;var e=$Je();return rA=new e,rA}var tHe=eHe();const Sd=QJe(tHe);function rHe(e,r,a,v,$){const h=(...u)=>(console.warn("gridstack.js: Function `"+a+"` is deprecated in "+$+" and has been replaced with `"+v+"`. It will be **removed** in a future release"),r.apply(e,u));return h.prototype=r.prototype,h}class ru{static getElements(r,a=document){if(typeof r=="string"){const v="getElementById"in a?a:void 0;if(v&&!isNaN(+r[0])){const h=v.getElementById(r);return h?[h]:[]}let $=a.querySelectorAll(r);return!$.length&&r[0]!=="."&&r[0]!=="#"&&($=a.querySelectorAll("."+r),$.length||($=a.querySelectorAll("#"+r))),Array.from($)}return[r]}static getElement(r,a=document){if(typeof r=="string"){const v="getElementById"in a?a:void 0;if(!r.length)return null;if(v&&r[0]==="#")return v.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return a.querySelector(r);if(v&&!isNaN(+r[0]))return v.getElementById(r);let $=a.querySelector(r);return v&&!$&&($=v.getElementById(r)),$||($=a.querySelector("."+r)),$}return r}static lazyLoad(r){var a,v;return r.lazyLoad||((v=(a=r.grid)==null?void 0:a.opts)==null?void 0:v.lazyLoad)&&r.lazyLoad!==!1}static createDiv(r,a){const v=document.createElement("div");return r.forEach($=>{$&&v.classList.add($)}),a==null||a.appendChild(v),v}static shouldSizeToContent(r,a=!1){return(r==null?void 0:r.grid)&&(a?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,a){return!(r.y>=a.y+a.h||r.y+r.h<=a.y||r.x+r.w<=a.x||r.x>=a.x+a.w)}static isTouching(r,a){return ru.isIntercepted(r,{x:a.x-.5,y:a.y-.5,w:a.w+1,h:a.h+1})}static areaIntercept(r,a){const v=r.x>a.x?r.x:a.x,$=r.x+r.w<a.x+a.w?r.x+r.w:a.x+a.w;if($<=v)return 0;const h=r.y>a.y?r.y:a.y,u=r.y+r.h<a.y+a.h?r.y+r.h:a.y+a.h;return u<=h?0:($-v)*(u-h)}static area(r){return r.w*r.h}static sort(r,a=1){return r.sort((v,$)=>{const h=a*((v.y??1e4)-($.y??1e4));return h===0?a*((v.x??1e4)-($.x??1e4)):h})}static find(r,a){return a?r.find(v=>v.id===a):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let a,v="px";if(typeof r=="string")if(r==="auto"||r==="")a=0;else{const $=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!$)throw new Error(`Invalid height val = ${r}`);v=$[2]||"px",a=parseFloat($[1])}else a=r;return{h:a,unit:v}}static defaults(r,...a){return a.forEach(v=>{for(const $ in v){if(!v.hasOwnProperty($))return;r[$]===null||r[$]===void 0?r[$]=v[$]:typeof v[$]=="object"&&typeof r[$]=="object"&&ru.defaults(r[$],v[$])}}),r}static same(r,a){if(typeof r!="object")return r==a;if(typeof r!=typeof a||Object.keys(r).length!==Object.keys(a).length)return!1;for(const v in r)if(r[v]!==a[v])return!1;return!0}static copyPos(r,a,v=!1){return a.x!==void 0&&(r.x=a.x),a.y!==void 0&&(r.y=a.y),a.w!==void 0&&(r.w=a.w),a.h!==void 0&&(r.h=a.h),v&&(a.minW&&(r.minW=a.minW),a.minH&&(r.minH=a.minH),a.maxW&&(r.maxW=a.maxW),a.maxH&&(r.maxH=a.maxH)),r}static samePos(r,a){return r&&a&&r.x===a.x&&r.y===a.y&&(r.w||1)===(a.w||1)&&(r.h||1)===(a.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,a){if(!(typeof r!="object"||typeof a!="object"))for(let v in r){const $=r[v],h=a[v];v[0]==="_"||$===h?delete r[v]:$&&typeof $=="object"&&h!==void 0&&(ru.removeInternalAndSame($,h),Object.keys($).length||delete r[v])}}static removeInternalForSave(r,a=!0){for(let v in r)(v[0]==="_"||r[v]===null||r[v]===void 0)&&delete r[v];delete r.grid,a&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,a){let v=!1;return(...$)=>{v||(v=!0,setTimeout(()=>{r(...$),v=!1},a))}}static removePositioningStyles(r){const a=r.style;a.position&&a.removeProperty("position"),a.left&&a.removeProperty("left"),a.top&&a.removeProperty("top"),a.width&&a.removeProperty("width"),a.height&&a.removeProperty("height")}static getScrollElement(r){if(!r)return document.scrollingElement||document.documentElement;const a=getComputedStyle(r);return/(auto|scroll)/.test(a.overflow+a.overflowY)?r:ru.getScrollElement(r.parentElement)}static updateScrollPosition(r,a,v){const $=ru.getScrollElement(r);if(!$)return;const h=r.getBoundingClientRect(),u=$.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight,p=h.bottom-Math.min(u.bottom,i),l=h.top-Math.max(u.top,0),n=$.scrollTop;l<0&&v<0?r.offsetHeight>u.height?$.scrollTop+=v:$.scrollTop+=Math.abs(l)>Math.abs(v)?v:l:p>0&&v>0&&(r.offsetHeight>u.height?$.scrollTop+=v:$.scrollTop+=p>v?v:p),a.top+=$.scrollTop-n}static updateScrollResize(r,a,v){const $=ru.getScrollElement(a),h=$.clientHeight,u=$===ru.getScrollElement()?0:$.getBoundingClientRect().top,i=r.clientY-u,p=i<v,l=i>h-v;p?$.scrollBy({behavior:"smooth",top:i-v}):l&&$.scrollBy({behavior:"smooth",top:v-(h-i)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:{...r}}static cloneDeep(r){const a=["parentGrid","el","grid","subGrid","engine"],v=ru.clone(r);for(const $ in v)v.hasOwnProperty($)&&typeof v[$]=="object"&&$.substring(0,2)!=="__"&&!a.find(h=>h===$)&&(v[$]=ru.cloneDeep(r[$]));return v}static cloneNode(r){const a=r.cloneNode(!0);return a.removeAttribute("id"),a}static appendTo(r,a){let v;typeof a=="string"?v=ru.getElement(a):v=a,v&&v.appendChild(r)}static addElStyles(r,a){if(a instanceof Object)for(const v in a)a.hasOwnProperty(v)&&(Array.isArray(a[v])?a[v].forEach($=>{r.style[v]=$}):r.style[v]=a[v])}static initEvent(r,a){const v={type:a.type},$={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:a.target?a.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(h=>v[h]=r[h]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(h=>v[h]=r[h]),{...v,...$}}static simulateMouseEvent(r,a,v){const $=r,h=new MouseEvent(a,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:$.ctrlKey??!1,altKey:$.altKey??!1,shiftKey:$.shiftKey??!1,metaKey:$.metaKey??!1,button:0,relatedTarget:r.target});(v||r.target).dispatchEvent(h)}static getValuesFromTransformedElement(r){const a=document.createElement("div");ru.addElStyles(a,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(a);const v=a.getBoundingClientRect();return r.removeChild(a),a.remove(),{xScale:1/v.width,yScale:1/v.height,xOffset:v.left,yOffset:v.top}}static swap(r,a,v){if(!r)return;const $=r[a];r[a]=r[v],r[v]=$}static canBeRotated(r){var a;return!(!r||r.w===r.h||r.locked||r.noResize||(a=r.grid)!=null&&a.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}}class P4{constructor(r={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=r.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=r.maxRow,this._float=r.float,this.nodes=r.nodes||[],this.onChange=r.onChange}batchUpdate(r=!0,a=!0){return!!this.batchMode===r?this:(this.batchMode=r,r?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,a&&this._packNodes(),this._notify()),this)}_useEntireRowArea(r,a){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!r._moving||r._skipDown||a.y<=r.y)}_fixCollisions(r,a=r,v,$={}){if(this.sortNodes(-1),v=v||this.collide(r,a),!v)return!1;if(r._moving&&!$.nested&&!this.float&&this.swap(r,v))return!0;let h=a;!this._loading&&this._useEntireRowArea(r,a)&&(h={x:0,w:this.column,y:a.y,h:a.h},v=this.collide(r,h,$.skip));let u=!1;const i={nested:!0,pack:!1};let p=0;for(;v=v||this.collide(r,h,$.skip);){if(p++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(v.locked||this._loading||r._moving&&!r._skipDown&&a.y>r.y&&!this.float&&(!this.collide(v,{...v,y:r.y},r)||!this.collide(v,{...v,y:a.y-v.h},r))){r._skipDown=r._skipDown||a.y>r.y;const n={...a,y:v.y+v.h,...i};l=this._loading&&ru.samePos(r,n)?!0:this.moveNode(r,n),(v.locked||this._loading)&&l?ru.copyPos(a,r):!v.locked&&l&&$.pack&&(this._packNodes(),a.y=v.y+v.h,ru.copyPos(r,a)),u=u||l}else l=this.moveNode(v,{...v,y:a.y+a.h,skip:r,...i});if(!l)return u;v=void 0}return u}collide(r,a=r,v){const $=r._id,h=v==null?void 0:v._id;return this.nodes.find(u=>u._id!==$&&u._id!==h&&ru.isIntercepted(u,a))}collideAll(r,a=r,v){const $=r._id,h=v==null?void 0:v._id;return this.nodes.filter(u=>u._id!==$&&u._id!==h&&ru.isIntercepted(u,a))}directionCollideCoverage(r,a,v){if(!a.rect||!r._rect)return;const $=r._rect,h={...a.rect};h.y>$.y?(h.h+=h.y-$.y,h.y=$.y):h.h+=$.y-h.y,h.x>$.x?(h.w+=h.x-$.x,h.x=$.x):h.w+=$.x-h.x;let u,i=.5;for(let p of v){if(p.locked||!p._rect)break;const l=p._rect;let n=Number.MAX_VALUE,k=Number.MAX_VALUE;$.y<l.y?n=(h.y+h.h-l.y)/l.h:$.y+$.h>l.y+l.h&&(n=(l.y+l.h-h.y)/l.h),$.x<l.x?k=(h.x+h.w-l.x)/l.w:$.x+$.w>l.x+l.w&&(k=(l.x+l.w-h.x)/l.w);const T=Math.min(k,n);T>i&&(i=T,u=p)}return a.collide=u,u}cacheRects(r,a,v,$,h,u){return this.nodes.forEach(i=>i._rect={y:i.y*a+v,x:i.x*r+u,w:i.w*r-u-$,h:i.h*a-v-h}),this}swap(r,a){if(!a||a.locked||!r||r.locked)return!1;function v(){const h=a.x,u=a.y;return a.x=r.x,a.y=r.y,r.h!=a.h?(r.x=h,r.y=a.y+a.h):r.w!=a.w?(r.x=a.x+a.w,r.y=u):(r.x=h,r.y=u),r._dirty=a._dirty=!0,!0}let $;if(r.w===a.w&&r.h===a.h&&(r.x===a.x||r.y===a.y)&&($=ru.isTouching(r,a)))return v();if($!==!1){if(r.w===a.w&&r.x===a.x&&($||($=ru.isTouching(r,a)))){if(a.y<r.y){const h=r;r=a,a=h}return v()}if($!==!1){if(r.h===a.h&&r.y===a.y&&($||($=ru.isTouching(r,a)))){if(a.x<r.x){const h=r;r=a,a=h}return v()}return!1}}}isAreaEmpty(r,a,v,$){const h={x:r||0,y:a||0,w:v||1,h:$||1};return!this.collide(h)}compact(r="compact",a=!0){if(this.nodes.length===0)return this;a&&this.sortNodes();const v=this.batchMode;v||this.batchUpdate();const $=this._inColumnResize;$||(this._inColumnResize=!0);const h=this.nodes;return this.nodes=[],h.forEach((u,i,p)=>{let l;u.locked||(u.autoPosition=!0,r==="list"&&i&&(l=p[i-1])),this.addNode(u,!1,l)}),$||delete this._inColumnResize,v||this.batchUpdate(!1),this}set float(r){this._float!==r&&(this._float=r||!1,r||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(r=1){return this.nodes=ru.sort(this.nodes,r),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(r=>{if(r._updating||r._orig===void 0||r.y===r._orig.y)return;let a=r.y;for(;a>r._orig.y;)--a,this.collide(r,{x:r.x,y:a,w:r.w,h:r.h})||(r._dirty=!0,r.y=a)}):this.nodes.forEach((r,a)=>{if(!r.locked)for(;r.y>0;){const v=a===0?0:r.y-1;if(!(a===0||!this.collide(r,{x:r.x,y:v,w:r.w,h:r.h})))break;r._dirty=r.y!==v,r.y=v}}),this)}prepareNode(r,a){r._id=r._id??P4._idSeq++;const v=r.id;if(v){let h=1;for(;this.nodes.find(u=>u.id===r.id&&u!==r);)r.id=v+"_"+h++}(r.x===void 0||r.y===void 0||r.x===null||r.y===null)&&(r.autoPosition=!0);const $={x:0,y:0,w:1,h:1};return ru.defaults(r,$),r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,ru.sanitizeMinMax(r),typeof r.x=="string"&&(r.x=Number(r.x)),typeof r.y=="string"&&(r.y=Number(r.y)),typeof r.w=="string"&&(r.w=Number(r.w)),typeof r.h=="string"&&(r.h=Number(r.h)),isNaN(r.x)&&(r.x=$.x,r.autoPosition=!0),isNaN(r.y)&&(r.y=$.y,r.autoPosition=!0),isNaN(r.w)&&(r.w=$.w),isNaN(r.h)&&(r.h=$.h),this.nodeBoundFix(r,a),r}nodeBoundFix(r,a){const v=r._orig||ru.copyPos({},r);if(r.maxW&&(r.w=Math.min(r.w||1,r.maxW)),r.maxH&&(r.h=Math.min(r.h||1,r.maxH)),r.minW&&(r.w=Math.max(r.w||1,r.minW)),r.minH&&(r.h=Math.max(r.h||1,r.minH)),(r.x||0)+(r.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&r._id!=null&&this.findCacheLayout(r,this.defaultColumn)===-1){const $={...r};$.autoPosition||$.x===void 0?(delete $.x,delete $.y):$.x=Math.min(this.defaultColumn-1,$.x),$.w=Math.min(this.defaultColumn,$.w||1),this.cacheOneLayout($,this.defaultColumn)}return r.w>this.column?r.w=this.column:r.w<1&&(r.w=1),this.maxRow&&r.h>this.maxRow?r.h=this.maxRow:r.h<1&&(r.h=1),r.x<0&&(r.x=0),r.y<0&&(r.y=0),r.x+r.w>this.column&&(a?r.w=this.column-r.x:r.x=this.column-r.w),this.maxRow&&r.y+r.h>this.maxRow&&(a?r.h=this.maxRow-r.y:r.y=this.maxRow-r.h),ru.samePos(r,v)||(r._dirty=!0),this}getDirtyNodes(r){return r?this.nodes.filter(a=>a._dirty&&!ru.samePos(a,a._orig)):this.nodes.filter(a=>a._dirty)}_notify(r){if(this.batchMode||!this.onChange)return this;const a=(r||[]).concat(this.getDirtyNodes());return this.onChange(a),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(r=>{delete r._dirty,delete r._lastTried}),this)}saveInitial(){return this.nodes.forEach(r=>{r._orig=ru.copyPos({},r),delete r._dirty}),this._hasLocked=this.nodes.some(r=>r.locked),this}restoreInitial(){return this.nodes.forEach(r=>{!r._orig||ru.samePos(r,r._orig)||(ru.copyPos(r,r._orig),r._dirty=!0)}),this._notify(),this}findEmptyPosition(r,a=this.nodes,v=this.column,$){const h=$?$.y*v+($.x+$.w):0;let u=!1;for(let i=h;!u;++i){const p=i%v,l=Math.floor(i/v);if(p+r.w>v)continue;const n={x:p,y:l,w:r.w,h:r.h};a.find(k=>ru.isIntercepted(n,k))||((r.x!==p||r.y!==l)&&(r._dirty=!0),r.x=p,r.y=l,delete r.autoPosition,u=!0)}return u}addNode(r,a=!1,v){const $=this.nodes.find(u=>u._id===r._id);if($)return $;this._inColumnResize?this.nodeBoundFix(r):this.prepareNode(r),delete r._temporaryRemoved,delete r._removeDOM;let h;return r.autoPosition&&this.findEmptyPosition(r,this.nodes,this.column,v)&&(delete r.autoPosition,h=!0),this.nodes.push(r),a&&this.addedNodes.push(r),h||this._fixCollisions(r),this.batchMode||this._packNodes()._notify(),r}removeNode(r,a=!0,v=!1){return this.nodes.find($=>$._id===r._id)?(v&&this.removedNodes.push(r),a&&(r._removeDOM=!0),this.nodes=this.nodes.filter($=>$._id!==r._id),r._isAboutToRemove||this._packNodes(),this._notify([r]),this):this}removeAll(r=!0,a=!0){if(delete this._layouts,!this.nodes.length)return this;r&&this.nodes.forEach($=>$._removeDOM=!0);const v=this.nodes;return this.removedNodes=a?v:[],this.nodes=[],this._notify(v)}moveNodeCheck(r,a){if(!this.changedPosConstrain(r,a))return!1;if(a.pack=!0,!this.maxRow)return this.moveNode(r,a);let v;const $=new P4({column:this.column,float:this.float,nodes:this.nodes.map(u=>u._id===r._id?(v={...u},v):{...u})});if(!v)return!1;const h=$.moveNode(v,a)&&$.getRow()<=Math.max(this.getRow(),this.maxRow);if(!h&&!a.resizing&&a.collide){const u=a.collide.el.gridstackNode;if(this.swap(r,u))return this._notify(),!0}return h?($.nodes.filter(u=>u._dirty).forEach(u=>{const i=this.nodes.find(p=>p._id===u._id);i&&(ru.copyPos(i,u),i._dirty=!0)}),this._notify(),!0):!1}willItFit(r){if(delete r._willFitPos,!this.maxRow)return!0;const a=new P4({column:this.column,float:this.float,nodes:this.nodes.map($=>({...$}))}),v={...r};return this.cleanupNode(v),delete v.el,delete v._id,delete v.content,delete v.grid,a.addNode(v),a.getRow()<=this.maxRow?(r._willFitPos=ru.copyPos({},v),!0):!1}changedPosConstrain(r,a){return a.w=a.w||r.w,a.h=a.h||r.h,r.x!==a.x||r.y!==a.y?!0:(r.maxW&&(a.w=Math.min(a.w,r.maxW)),r.maxH&&(a.h=Math.min(a.h,r.maxH)),r.minW&&(a.w=Math.max(a.w,r.minW)),r.minH&&(a.h=Math.max(a.h,r.minH)),r.w!==a.w||r.h!==a.h)}moveNode(r,a){var v,$;if(!r||!a)return!1;let h;a.pack===void 0&&!this.batchMode&&(h=a.pack=!0),typeof a.x!="number"&&(a.x=r.x),typeof a.y!="number"&&(a.y=r.y),typeof a.w!="number"&&(a.w=r.w),typeof a.h!="number"&&(a.h=r.h);const u=r.w!==a.w||r.h!==a.h,i=ru.copyPos({},r,!0);if(ru.copyPos(i,a),this.nodeBoundFix(i,u),ru.copyPos(a,i),!a.forceCollide&&ru.samePos(r,a))return!1;const p=ru.copyPos({},r),l=this.collideAll(r,i,a.skip);let n=!0;if(l.length){const k=r._moving&&!a.nested;let T=k?this.directionCollideCoverage(r,a,l):l[0];if(k&&T&&($=(v=r.grid)==null?void 0:v.opts)!=null&&$.subGridDynamic&&!r.grid._isTemp){const x=ru.areaIntercept(a.rect,T._rect),d=ru.area(a.rect),o=ru.area(T._rect);x/(d<o?d:o)>.8&&(T.grid.makeSubGrid(T.el,void 0,r),T=void 0)}T?n=!this._fixCollisions(r,i,T,a):(n=!1,h&&delete a.pack)}return n&&!ru.samePos(r,i)&&(r._dirty=!0,ru.copyPos(r,i)),a.pack&&this._packNodes()._notify(),!ru.samePos(r,p)}getRow(){return this.nodes.reduce((r,a)=>Math.max(r,a.y+a.h),0)}beginUpdate(r){return r._updating||(r._updating=!0,delete r._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const r=this.nodes.find(a=>a._updating);return r&&(delete r._updating,delete r._skipDown),this}save(r=!0,a,v){var $;const h=(($=this._layouts)==null?void 0:$.length)||0;let u;h&&(v?v!==this.column&&(u=this._layouts[v]):this.column!==h-1&&(u=this._layouts[h-1]));const i=[];return this.sortNodes(),this.nodes.forEach(p=>{const l=u==null?void 0:u.find(k=>k._id===p._id),n={...p,...l||{}};ru.removeInternalForSave(n,!r),a&&a(p,n),i.push(n)}),i}layoutsNodesChange(r){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((a,v)=>{if(!a||v===this.column)return this;if(v<this.column)this._layouts[v]=void 0;else{const $=v/this.column;r.forEach(h=>{if(!h._orig)return;const u=a.find(i=>i._id===h._id);u&&(u.y>=0&&h.y!==h._orig.y&&(u.y+=h.y-h._orig.y),h.x!==h._orig.x&&(u.x=Math.round(h.x*$)),h.w!==h._orig.w&&(u.w=Math.round(h.w*$)))})}}),this)}columnChanged(r,a,v="moveScale"){var $;if(!this.nodes.length||!a||r===a)return this;const h=v==="compact"||v==="list";h&&this.sortNodes(1),a<r&&this.cacheLayout(this.nodes,r),this.batchUpdate();let u=[],i=h?this.nodes:ru.sort(this.nodes,-1);if(a>r&&this._layouts){const p=this._layouts[a]||[],l=this._layouts.length-1;!p.length&&r!==l&&($=this._layouts[l])!=null&&$.length&&(r=l,this._layouts[l].forEach(n=>{const k=i.find(T=>T._id===n._id);k&&(!h&&!n.autoPosition&&(k.x=n.x??k.x,k.y=n.y??k.y),k.w=n.w??k.w,(n.x==null||n.y===void 0)&&(k.autoPosition=!0))})),p.forEach(n=>{const k=i.findIndex(T=>T._id===n._id);if(k!==-1){const T=i[k];if(h){T.w=n.w;return}(n.autoPosition||isNaN(n.x)||isNaN(n.y))&&this.findEmptyPosition(n,u),n.autoPosition||(T.x=n.x??T.x,T.y=n.y??T.y,T.w=n.w??T.w,u.push(T)),i.splice(k,1)}})}if(h)this.compact(v,!1);else{if(i.length)if(typeof v=="function")v(a,r,u,i);else{const p=h||v==="none"?1:a/r,l=v==="move"||v==="moveScale",n=v==="scale"||v==="moveScale";i.forEach(k=>{k.x=a===1?0:l?Math.round(k.x*p):Math.min(k.x,a-1),k.w=a===1||r===1?1:n?Math.round(k.w*p)||1:Math.min(k.w,a),u.push(k)}),i=[]}u=ru.sort(u,-1),this._inColumnResize=!0,this.nodes=[],u.forEach(p=>{this.addNode(p,!1),delete p._orig})}return this.nodes.forEach(p=>delete p._orig),this.batchUpdate(!1,!h),delete this._inColumnResize,this}cacheLayout(r,a,v=!1){const $=[];return r.forEach((h,u)=>{if(h._id===void 0){const i=h.id?this.nodes.find(p=>p.id===h.id):void 0;h._id=(i==null?void 0:i._id)??P4._idSeq++}$[u]={x:h.x,y:h.y,w:h.w,_id:h._id}}),this._layouts=v?[]:this._layouts||[],this._layouts[a]=$,this}cacheOneLayout(r,a){r._id=r._id??P4._idSeq++;const v={x:r.x,y:r.y,w:r.w,_id:r._id};(r.autoPosition||r.x===void 0)&&(delete v.x,delete v.y,r.autoPosition&&(v.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[a]=this._layouts[a]||[];const $=this.findCacheLayout(r,a);return $===-1?this._layouts[a].push(v):this._layouts[a][$]=v,this}findCacheLayout(r,a){var v,$;return(($=(v=this._layouts)==null?void 0:v[a])==null?void 0:$.findIndex(h=>h._id===r._id))??-1}removeNodeFromLayoutCache(r){if(this._layouts)for(let a=0;a<this._layouts.length;a++){const v=this.findCacheLayout(r,a);v!==-1&&this._layouts[a].splice(v,1)}}cleanupNode(r){for(const a in r)a[0]==="_"&&a!=="_id"&&delete r[a];return this}}P4._idSeq=0;const T3={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Nf{}const Xw=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class R5{}function vN(e,r){e.touches.length>1||(e.cancelable&&e.preventDefault(),ru.simulateMouseEvent(e.changedTouches[0],r))}function AZ(e,r){e.cancelable&&e.preventDefault(),ru.simulateMouseEvent(e,r)}function bN(e){R5.touchHandled||(R5.touchHandled=!0,vN(e,"mousedown"))}function xN(e){R5.touchHandled&&vN(e,"mousemove")}function _N(e){if(!R5.touchHandled)return;R5.pointerLeaveTimeout&&(window.clearTimeout(R5.pointerLeaveTimeout),delete R5.pointerLeaveTimeout);const r=!!Nf.dragElement;vN(e,"mouseup"),r||vN(e,"click"),R5.touchHandled=!1}function wN(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function RZ(e){Nf.dragElement&&e.pointerType!=="mouse"&&AZ(e,"mouseenter")}function UZ(e){Nf.dragElement&&e.pointerType!=="mouse"&&(R5.pointerLeaveTimeout=window.setTimeout(()=>{delete R5.pointerLeaveTimeout,AZ(e,"mouseleave")},10))}class TN{constructor(r,a,v){this.host=r,this.dir=a,this.option=v,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const r=this.el=document.createElement("div");return r.classList.add("ui-resizable-handle"),r.classList.add(`${TN.prefix}${this.dir}`),r.style.zIndex="100",r.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Xw&&(this.el.addEventListener("touchstart",bN),this.el.addEventListener("pointerdown",wN)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Xw&&(this.el.removeEventListener("touchstart",bN),this.el.removeEventListener("pointerdown",wN)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(r){this.mouseDownEvent=r,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Xw&&(this.el.addEventListener("touchmove",xN),this.el.addEventListener("touchend",_N)),r.stopPropagation(),r.preventDefault()}_mouseMove(r){const a=this.mouseDownEvent;this.moving?this._triggerEvent("move",r):Math.abs(r.x-a.x)+Math.abs(r.y-a.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",r),document.addEventListener("keydown",this._keyEvent)),r.stopPropagation()}_mouseUp(r){this.moving&&(this._triggerEvent("stop",r),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Xw&&(this.el.removeEventListener("touchmove",xN),this.el.removeEventListener("touchend",_N)),delete this.moving,delete this.mouseDownEvent,r.stopPropagation(),r.preventDefault()}_keyEvent(r){var a,v;r.key==="Escape"&&((v=(a=this.host.gridstackNode)==null?void 0:a.grid)==null||v.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(r,a){return this.option[r]&&this.option[r](a),this}}TN.prefix="ui-resizable-";class aA{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,a){this._eventRegister[r]=a}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,a){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](a)}}class l9 extends aA{constructor(r,a={}){super(),this.el=r,this.option=a,this.rectScale={x:1,y:1},this._ui=()=>{const v=this.el.parentElement.getBoundingClientRect(),$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},h=this.temporalRect||$;return{position:{left:(h.left-v.left)*this.rectScale.x,top:(h.top-v.top)*this.rectScale.y},size:{width:h.width*this.rectScale.x,height:h.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(r){const a=r.handles&&r.handles!==this.option.handles,v=r.autoHide&&r.autoHide!==this.option.autoHide;return Object.keys(r).forEach($=>this.option[$]=r[$]),a&&(this._removeHandlers(),this._setupHandlers()),v&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(r){return r?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Nf.overResizeElement===this&&delete Nf.overResizeElement),this}_mouseOver(r){Nf.overResizeElement||Nf.dragElement||(Nf.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(r){Nf.overResizeElement===this&&(delete Nf.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(r=>r.trim()).map(r=>new TN(this.el,r,{start:a=>{this._resizeStart(a)},stop:a=>{this._resizeStop(a)},move:a=>{this._resizing(a,r)}})),this}_resizeStart(r){this.sizeToContent=ru.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=ru.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=r,this._setupHelper(),this._applyChange();const a=ru.initEvent(r,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(a,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",a),this}_resizing(r,a){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(r,a),this._applyChange();const v=ru.initEvent(r,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(v,this._ui()),this.triggerEvent("resize",v),this}_resizeStop(r){const a=ru.initEvent(r,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(a),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",a),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=l9._originStyleProp.map(v=>this.el.style[v]),this.parentOriginStylePosition=this.el.parentElement.style.position;const r=this.el.parentElement,a=ru.getValuesFromTransformedElement(r);return this.rectScale={x:a.xScale,y:a.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return l9._originStyleProp.forEach((r,a)=>{this.el.style[r]=this.elOriginStyleVal[a]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(r,a){const v=this.startEvent,$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},h=r.clientX-v.clientX,u=this.sizeToContent?0:r.clientY-v.clientY;let i,p;a.indexOf("e")>-1?$.width+=h:a.indexOf("w")>-1&&($.width-=h,$.left+=h,i=!0),a.indexOf("s")>-1?$.height+=u:a.indexOf("n")>-1&&($.height-=u,$.top+=u,p=!0);const l=this._constrainSize($.width,$.height,i,p);return Math.round($.width)!==Math.round(l.width)&&(a.indexOf("w")>-1&&($.left+=$.width-l.width),$.width=l.width),Math.round($.height)!==Math.round(l.height)&&(a.indexOf("n")>-1&&($.top+=$.height-l.height),$.height=l.height),$}_constrainSize(r,a,v,$){const h=this.option,u=(v?h.maxWidthMoveLeft:h.maxWidth)||Number.MAX_SAFE_INTEGER,i=h.minWidth/this.rectScale.x||r,p=($?h.maxHeightMoveUp:h.maxHeight)||Number.MAX_SAFE_INTEGER,l=h.minHeight/this.rectScale.y||a,n=Math.min(u,Math.max(i,r)),k=Math.min(p,Math.max(l,a));return{width:n,height:k}}_applyChange(){let r={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const a=this.el.parentElement,{left:v,top:$}=a.getBoundingClientRect();r={left:v,top:$,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(a=>{const v=this.temporalRect[a],$=a==="width"||a==="left"?this.rectScale.x:a==="height"||a==="top"?this.rectScale.y:1;this.el.style[a]=(v-r[a])*$+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(r=>r.destroy()),delete this.handlers,this}}l9._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const aHe='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class c9 extends aA{constructor(r,a={}){var v;super(),this.el=r,this.option=a,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const $=(v=a==null?void 0:a.handle)==null?void 0:v.substring(1),h=r.gridstackNode;this.dragEls=!$||r.classList.contains($)?[r]:h!=null&&h.subGrid?[r.querySelector(a.handle)||r]:Array.from(r.querySelectorAll(a.handle)),this.dragEls.length===0&&(this.dragEls=[r]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(r=>{r.addEventListener("mousedown",this._mouseDown),Xw&&(r.addEventListener("touchstart",bN),r.addEventListener("pointerdown",wN))}),this.el.classList.remove("ui-draggable-disabled"))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(a=>{a.removeEventListener("mousedown",this._mouseDown),Xw&&(a.removeEventListener("touchstart",bN),a.removeEventListener("pointerdown",wN))}),r||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(r){return Object.keys(r).forEach(a=>this.option[a]=r[a]),this}_mouseDown(r){if(!Nf.mouseHandled)return r.button!==0||!this.dragEls.find(a=>a===r.target)&&r.target.closest(aHe)||this.option.cancel&&r.target.closest(this.option.cancel)||(this.mouseDownEvent=r,delete this.dragging,delete Nf.dragElement,delete Nf.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Xw&&(r.currentTarget.addEventListener("touchmove",xN),r.currentTarget.addEventListener("touchend",_N)),r.preventDefault(),document.activeElement&&document.activeElement.blur(),Nf.mouseHandled=!0),!0}_callDrag(r){if(!this.dragging)return;const a=ru.initEvent(r,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(a,this.ui()),this.triggerEvent("drag",a)}_mouseMove(r){var a;const v=this.mouseDownEvent;if(this.lastDrag=r,this.dragging)if(this._dragFollow(r),Nf.pauseDrag){const $=Number.isInteger(Nf.pauseDrag)?Nf.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(r),$)}else this._callDrag(r);else if(Math.abs(r.x-v.x)+Math.abs(r.y-v.y)>3){this.dragging=!0,Nf.dragElement=this;const $=(a=this.el.gridstackNode)==null?void 0:a.grid;$?Nf.dropElement=$.el.ddElement.ddDroppable:delete Nf.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=ru.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(r,this.el,this.helperContainment),this._setupHelperStyle(r);const h=ru.initEvent(r,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(h,this.ui()),this.triggerEvent("dragstart",h),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(r){var a,v;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Xw&&r.currentTarget&&(r.currentTarget.removeEventListener("touchmove",xN,!0),r.currentTarget.removeEventListener("touchend",_N,!0)),this.dragging){delete this.dragging,(a=this.el.gridstackNode)==null||delete a._origRotate,document.removeEventListener("keydown",this._keyEvent),((v=Nf.dropElement)==null?void 0:v.el)===this.el.parentElement&&delete Nf.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const $=ru.initEvent(r,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop($),this.triggerEvent("dragstop",$),Nf.dropElement&&Nf.dropElement.drop(r)}delete this.helper,delete this.mouseDownEvent,delete Nf.dragElement,delete Nf.dropElement,delete Nf.mouseHandled,r.preventDefault()}_keyEvent(r){var a,v;const $=this.el.gridstackNode,h=($==null?void 0:$.grid)||((v=(a=Nf.dropElement)==null?void 0:a.el)==null?void 0:v.gridstack);if(r.key==="Escape")$&&$._origRotate&&($._orig=$._origRotate,delete $._origRotate),h==null||h.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if($&&h&&(r.key==="r"||r.key==="R")){if(!ru.canBeRotated($))return;$._origRotate=$._origRotate||{...$._orig},delete $._moving,h.setAnimation(!1).rotate($.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),$._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,$.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",ru.swap($._orig,"w","h"),delete $._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let r=this.el;return typeof this.option.helper=="function"?r=this.option.helper(this.el):this.option.helper==="clone"&&(r=ru.cloneNode(this.el)),r.parentElement||ru.appendTo(r,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=c9.originStyleProp.map(a=>this.el.style[a]),r}_setupHelperStyle(r){var a,v;this.helper.classList.add("ui-draggable-dragging"),(v=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||v.el.classList.add("grid-stack-dragging");const $=this.helper.style;return $.pointerEvents="none",$.width=this.dragOffset.width+"px",$.height=this.dragOffset.height+"px",$.willChange="left, top",$.position="fixed",this._dragFollow(r),$.transition="none",setTimeout(()=>{this.helper&&($.transition=null)},0),this}_removeHelperStyle(){var r,a,v;this.helper.classList.remove("ui-draggable-dragging"),(a=(r=this.el.gridstackNode)==null?void 0:r.grid)==null||a.el.classList.remove("grid-stack-dragging");const $=(v=this.helper)==null?void 0:v.gridstackNode;if(!($!=null&&$._isAboutToRemove)&&this.dragElementOriginStyle){const h=this.helper,u=this.dragElementOriginStyle.transition||null;h.style.transition=this.dragElementOriginStyle.transition="none",c9.originStyleProp.forEach(i=>h.style[i]=this.dragElementOriginStyle[i]||null),setTimeout(()=>h.style.transition=u,50)}return delete this.dragElementOriginStyle,this}_dragFollow(r){const a={left:0,top:0},v=this.helper.style,$=this.dragOffset;v.left=(r.clientX+$.offsetLeft-a.left)*this.dragTransform.xScale+"px",v.top=(r.clientY+$.offsetTop-a.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(r,a,v){let $=0,h=0;v&&($=this.dragTransform.xOffset,h=this.dragTransform.yOffset);const u=a.getBoundingClientRect();return{left:u.left,top:u.top,offsetLeft:-r.clientX+u.left-$,offsetTop:-r.clientY+u.top-h,width:u.width*this.dragTransform.xScale,height:u.height*this.dragTransform.yScale}}ui(){const r=this.el.parentElement.getBoundingClientRect(),a=this.helper.getBoundingClientRect();return{position:{top:(a.top-r.top)*this.dragTransform.yScale,left:(a.left-r.left)*this.dragTransform.xScale}}}}c9.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class nHe extends aA{constructor(r,a={}){super(),this.el=r,this.option=a,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Xw&&(this.el.addEventListener("pointerenter",RZ),this.el.addEventListener("pointerleave",UZ)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Xw&&(this.el.removeEventListener("pointerenter",RZ),this.el.removeEventListener("pointerleave",UZ)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(a=>this.option[a]=r[a]),this._setupAccept(),this}_mouseEnter(r){if(!Nf.dragElement||!this._canDrop(Nf.dragElement.el))return;r.preventDefault(),r.stopPropagation(),Nf.dropElement&&Nf.dropElement!==this&&Nf.dropElement._mouseLeave(r,!0),Nf.dropElement=this;const a=ru.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(a,this._ui(Nf.dragElement)),this.triggerEvent("dropover",a),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,a=!1){var v;if(!Nf.dragElement||Nf.dropElement!==this)return;r.preventDefault(),r.stopPropagation();const $=ru.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out($,this._ui(Nf.dragElement)),this.triggerEvent("dropout",$),Nf.dropElement===this&&(delete Nf.dropElement,!a)){let h,u=this.el.parentElement;for(;!h&&u;)h=(v=u.ddElement)==null?void 0:v.ddDroppable,u=u.parentElement;h&&h._mouseEnter(r)}}drop(r){r.preventDefault();const a=ru.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(a,this._ui(Nf.dragElement)),this.triggerEvent("drop",a)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return{draggable:r.el,...r.ui()}}}class nA{static init(r){return r.ddElement||(r.ddElement=new nA(r)),r.ddElement}constructor(r){this.el=r}on(r,a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,a),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new c9(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new l9(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new nHe(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class iHe{resizable(r,a,v,$){return this._getDDElements(r,a).forEach(h=>{if(a==="disable"||a==="enable")h.ddResizable&&h.ddResizable[a]();else if(a==="destroy")h.ddResizable&&h.cleanResizable();else if(a==="option")h.setupResizable({[v]:$});else{const u=h.el.gridstackNode.grid;let i=h.el.getAttribute("gs-resize-handles")||u.opts.resizable.handles||"e,s,se";i==="all"&&(i="n,e,s,w,se,sw,ne,nw");const p=!u.opts.alwaysShowResizeHandle;h.setupResizable({...u.opts.resizable,handles:i,autoHide:p,start:a.start,stop:a.stop,resize:a.resize})}}),this}draggable(r,a,v,$){return this._getDDElements(r,a).forEach(h=>{if(a==="disable"||a==="enable")h.ddDraggable&&h.ddDraggable[a]();else if(a==="destroy")h.ddDraggable&&h.cleanDraggable();else if(a==="option")h.setupDraggable({[v]:$});else{const u=h.el.gridstackNode.grid;h.setupDraggable({...u.opts.draggable,start:a.start,stop:a.stop,drag:a.drag})}}),this}dragIn(r,a){return this._getDDElements(r).forEach(v=>v.setupDraggable(a)),this}droppable(r,a,v,$){return typeof a.accept=="function"&&!a._accept&&(a._accept=a.accept,a.accept=h=>a._accept(h)),this._getDDElements(r,a).forEach(h=>{a==="disable"||a==="enable"?h.ddDroppable&&h.ddDroppable[a]():a==="destroy"?h.ddDroppable&&h.cleanDroppable():a==="option"?h.setupDroppable({[v]:$}):h.setupDroppable(a)}),this}isDroppable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,a,v){return this._getDDElements(r).forEach($=>$.on(a,h=>{v(h,Nf.dragElement?Nf.dragElement.el:h.target,Nf.dragElement?Nf.dragElement.helper:null)})),this}off(r,a){return this._getDDElements(r).forEach(v=>v.off(a)),this}_getDDElements(r,a){const v=r.gridstack||a!=="destroy"&&a!=="disable",$=ru.getElements(r);return $.length?$.map(h=>h.ddElement||(v?nA.init(h):null)).filter(h=>h):[]}}/*!
|
|
7986
7986
|
* GridStack 12.3.2
|
|
7987
7987
|
* https://gridstackjs.com/
|
|
7988
7988
|
*
|