sm-click-library-ui 0.0.422 → 0.0.424
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...a){const o=new this(n);return a.forEach(r=>o.set(r)),o}static accessor(n){const o=(this[wo]=this[wo]={accessors:{}}).accessors,r=this.prototype;function i(s){const l=Kt(s);o[l]||(Ni(r,s),o[l]=!0)}return W.isArray(n)?n.forEach(i):i(n),this}};Qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),W.reduceDescriptors(Qe.prototype,({value:e},n)=>{let a=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(o){this[a]=o}}}),W.freezeMethods(Qe);function na(e,n){const a=this||Xt,o=n||a,r=Qe.from(o.headers);let i=o.data;return W.forEach(e,function(l){i=l.call(a,i,r.normalize(),n?n.status:void 0)}),r.normalize(),i}function Eo(e){return!!(e&&e.__CANCEL__)}function Pt(e,n,a){Se.call(this,e??"canceled",Se.ERR_CANCELED,n,a),this.name="CanceledError"}W.inherits(Pt,Se,{__CANCEL__:!0});function vo(e,n,a){const o=a.config.validateStatus;!a.status||!o||o(a.status)?e(a):n(new Se("Request failed with status code "+a.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function Di(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}function Ti(e,n){e=e||10;const a=new Array(e),o=new Array(e);let r=0,i=0,s;return n=n!==void 0?n:1e3,function(u){const m=Date.now(),c=o[i];s||(s=m),a[r]=u,o[r]=m;let h=i,f=0;for(;h!==r;)f+=a[h++],h=h%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),m-s<n)return;const p=c&&m-c;return p?Math.round(f*1e3/p):void 0}}function Fi(e,n){let a=0,o=1e3/n,r,i;const s=(m,c=Date.now())=>{a=c,r=null,i&&(clearTimeout(i),i=null),e.apply(null,m)};return[(...m)=>{const c=Date.now(),h=c-a;h>=o?s(m,c):(r=m,i||(i=setTimeout(()=>{i=null,s(r)},o-h)))},()=>r&&s(r)]}const kn=(e,n,a=3)=>{let o=0;const r=Ti(50,250);return Fi(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,u=s-o,m=r(u),c=s<=l;o=s;const h={loaded:s,total:l,progress:l?s/l:void 0,bytes:u,rate:m||void 0,estimated:m&&l&&c?(l-s)/m:void 0,event:i,lengthComputable:l!=null,[n?"download":"upload"]:!0};e(h)},a)},Co=(e,n)=>{const a=e!=null;return[o=>n[0]({lengthComputable:a,total:e,loaded:o}),n[1]]},So=e=>(...n)=>W.asap(()=>e(...n)),Li=We.hasStandardBrowserEnv?((e,n)=>a=>(a=new URL(a,We.origin),e.protocol===a.protocol&&e.host===a.host&&(n||e.port===a.port)))(new URL(We.origin),We.navigator&&/(msie|trident)/i.test(We.navigator.userAgent)):()=>!0,Oi=We.hasStandardBrowserEnv?{write(e,n,a,o,r,i){const s=[e+"="+encodeURIComponent(n)];W.isNumber(a)&&s.push("expires="+new Date(a).toGMTString()),W.isString(o)&&s.push("path="+o),W.isString(r)&&s.push("domain="+r),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Pi(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function $i(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}function Bo(e,n,a){let o=!Pi(n);return e&&(o||a==!1)?$i(e,n):n}const Mo=e=>e instanceof Qe?{...e}:e;function At(e,n){n=n||{};const a={};function o(m,c,h,f){return W.isPlainObject(m)&&W.isPlainObject(c)?W.merge.call({caseless:f},m,c):W.isPlainObject(c)?W.merge({},c):W.isArray(c)?c.slice():c}function r(m,c,h,f){if(W.isUndefined(c)){if(!W.isUndefined(m))return o(void 0,m,h,f)}else return o(m,c,h,f)}function i(m,c){if(!W.isUndefined(c))return o(void 0,c)}function s(m,c){if(W.isUndefined(c)){if(!W.isUndefined(m))return o(void 0,m)}else return o(void 0,c)}function l(m,c,h){if(h in n)return o(m,c);if(h in e)return o(void 0,m)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(m,c,h)=>r(Mo(m),Mo(c),h,!0)};return W.forEach(Object.keys(Object.assign({},e,n)),function(c){const h=u[c]||r,f=h(e[c],n[c],c);W.isUndefined(f)&&h!==l||(a[c]=f)}),a}const Vo=e=>{const n=At({},e);let{data:a,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:i,headers:s,auth:l}=n;n.headers=s=Qe.from(s),n.url=yo(Bo(n.baseURL,n.url,n.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(W.isFormData(a)){if(We.hasStandardBrowserEnv||We.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((u=s.getContentType())!==!1){const[m,...c]=u?u.split(";").map(h=>h.trim()).filter(Boolean):[];s.setContentType([m||"multipart/form-data",...c].join("; "))}}if(We.hasStandardBrowserEnv&&(o&&W.isFunction(o)&&(o=o(n)),o||o!==!1&&Li(n.url))){const m=r&&i&&Oi.read(i);m&&s.set(r,m)}return n},_i=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(a,o){const r=Vo(e);let i=r.data;const s=Qe.from(r.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:m}=r,c,h,f,p,d;function g(){p&&p(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function k(){if(!y)return;const b=Qe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:b,config:e,request:y};vo(function(_){a(_),g()},function(_){o(_),g()},C),y=null}"onloadend"in y?y.onloadend=k:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(k)},y.onabort=function(){y&&(o(new Se("Request aborted",Se.ECONNABORTED,e,y)),y=null)},y.onerror=function(){o(new Se("Network Error",Se.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let v=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const C=r.transitional||xo;r.timeoutErrorMessage&&(v=r.timeoutErrorMessage),o(new Se(v,C.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,e,y)),y=null},i===void 0&&s.setContentType(null),"setRequestHeader"in y&&W.forEach(s.toJSON(),function(v,C){y.setRequestHeader(C,v)}),W.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),l&&l!=="json"&&(y.responseType=r.responseType),m&&([f,d]=kn(m,!0),y.addEventListener("progress",f)),u&&y.upload&&([h,p]=kn(u),y.upload.addEventListener("progress",h),y.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(c=b=>{y&&(o(!b||b.type?new Pt(null,e,y):b),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));const x=Di(r.url);if(x&&We.protocols.indexOf(x)===-1){o(new Se("Unsupported protocol "+x+":",Se.ERR_BAD_REQUEST,e));return}y.send(i||null)})},Ri=(e,n)=>{const{length:a}=e=e?e.filter(Boolean):[];if(n||a){let o=new AbortController,r;const i=function(m){if(!r){r=!0,l();const c=m instanceof Error?m:this.reason;o.abort(c instanceof Se?c:new Pt(c instanceof Error?c.message:c))}};let s=n&&setTimeout(()=>{s=null,i(new Se(`timeout ${n} of ms exceeded`,Se.ETIMEDOUT))},n);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(i):m.removeEventListener("abort",i)}),e=null)};e.forEach(m=>m.addEventListener("abort",i));const{signal:u}=o;return u.unsubscribe=()=>W.asap(l),u}},Hi=function*(e,n){let a=e.byteLength;if(a<n){yield e;return}let o=0,r;for(;o<a;)r=o+n,yield e.slice(o,r),o=r},zi=async function*(e,n){for await(const a of ji(e))yield*Hi(a,n)},ji=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const n=e.getReader();try{for(;;){const{done:a,value:o}=await n.read();if(a)break;yield o}}finally{await n.cancel()}},Ao=(e,n,a,o)=>{const r=zi(e,n);let i=0,s,l=u=>{s||(s=!0,o&&o(u))};return new ReadableStream({async pull(u){try{const{done:m,value:c}=await r.next();if(m){l(),u.close();return}let h=c.byteLength;if(a){let f=i+=h;a(f)}u.enqueue(new Uint8Array(c))}catch(m){throw l(m),m}},cancel(u){return l(u),r.return()}},{highWaterMark:2})},xn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",No=xn&&typeof ReadableStream=="function",Gi=xn&&(typeof TextEncoder=="function"?(e=>n=>e.encode(n))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Do=(e,...n)=>{try{return!!e(...n)}catch{return!1}},Ii=No&&Do(()=>{let e=!1;const n=new Request(We.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!n}),To=64*1024,aa=No&&Do(()=>W.isReadableStream(new Response("").body)),bn={stream:aa&&(e=>e.body)};xn&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(n=>{!bn[n]&&(bn[n]=W.isFunction(e[n])?a=>a[n]():(a,o)=>{throw new Se(`Response type '${n}' is not supported`,Se.ERR_NOT_SUPPORT,o)})})})(new Response);const qi=async e=>{if(e==null)return 0;if(W.isBlob(e))return e.size;if(W.isSpecCompliantForm(e))return(await new Request(We.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(W.isArrayBufferView(e)||W.isArrayBuffer(e))return e.byteLength;if(W.isURLSearchParams(e)&&(e=e+""),W.isString(e))return(await Gi(e)).byteLength},Wi=async(e,n)=>{const a=W.toFiniteNumber(e.getContentLength());return a??qi(n)},oa={http:mi,xhr:_i,fetch:xn&&(async e=>{let{url:n,method:a,data:o,signal:r,cancelToken:i,timeout:s,onDownloadProgress:l,onUploadProgress:u,responseType:m,headers:c,withCredentials:h="same-origin",fetchOptions:f}=Vo(e);m=m?(m+"").toLowerCase():"text";let p=Ri([r,i&&i.toAbortSignal()],s),d;const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Ii&&a!=="get"&&a!=="head"&&(y=await Wi(c,o))!==0){let C=new Request(n,{method:"POST",body:o,duplex:"half"}),O;if(W.isFormData(o)&&(O=C.headers.get("content-type"))&&c.setContentType(O),C.body){const[_,E]=Co(y,kn(So(u)));o=Ao(C.body,To,_,E)}}W.isString(h)||(h=h?"include":"omit");const k="credentials"in Request.prototype;d=new Request(n,{...f,signal:p,method:a.toUpperCase(),headers:c.normalize().toJSON(),body:o,duplex:"half",credentials:k?h:void 0});let x=await fetch(d,f);const b=aa&&(m==="stream"||m==="response");if(aa&&(l||b&&g)){const C={};["status","statusText","headers"].forEach(w=>{C[w]=x[w]});const O=W.toFiniteNumber(x.headers.get("content-length")),[_,E]=l&&Co(O,kn(So(l),!0))||[];x=new Response(Ao(x.body,To,_,()=>{E&&E(),g&&g()}),C)}m=m||"text";let v=await bn[W.findKey(bn,m)||"text"](x,e);return!b&&g&&g(),await new Promise((C,O)=>{vo(C,O,{data:v,headers:Qe.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:d})})}catch(k){throw g&&g(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new Se("Network Error",Se.ERR_NETWORK,e,d),{cause:k.cause||k}):Se.from(k,k&&k.code,e,d)}})};W.forEach(oa,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch{}Object.defineProperty(e,"adapterName",{value:n})}});const Fo=e=>`- ${e}`,Ui=e=>W.isFunction(e)||e===null||e===!1,Lo={getAdapter:e=>{e=W.isArray(e)?e:[e];const{length:n}=e;let a,o;const r={};for(let i=0;i<n;i++){a=e[i];let s;if(o=a,!Ui(a)&&(o=oa[(s=String(a)).toLowerCase()],o===void 0))throw new Se(`Unknown adapter '${s}'`);if(o)break;r[s||"#"+i]=o}if(!o){const i=Object.entries(r).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=n?i.length>1?`since :
|
|
4
4
|
`+i.map(Fo).join(`
|
|
5
5
|
`):" "+Fo(i[0]):"as no adapter specified";throw new Se("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o},adapters:oa};function ra(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pt(null,e)}function Oo(e){return ra(e),e.headers=Qe.from(e.headers),e.data=na.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Lo.getAdapter(e.adapter||Xt.adapter)(e).then(function(o){return ra(e),o.data=na.call(e,e.transformResponse,o),o.headers=Qe.from(o.headers),o},function(o){return Eo(o)||(ra(e),o&&o.response&&(o.response.data=na.call(e,e.transformResponse,o.response),o.response.headers=Qe.from(o.response.headers))),Promise.reject(o)})}const Po="1.10.0",wn={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{wn[e]=function(o){return typeof o===e||"a"+(n<1?"n ":" ")+e}});const $o={};wn.transitional=function(n,a,o){function r(i,s){return"[Axios v"+Po+"] Transitional option '"+i+"'"+s+(o?". "+o:"")}return(i,s,l)=>{if(n===!1)throw new Se(r(s," has been removed"+(a?" in "+a:"")),Se.ERR_DEPRECATED);return a&&!$o[s]&&($o[s]=!0,console.warn(r(s," has been deprecated since v"+a+" and will be removed in the near future"))),n?n(i,s,l):!0}},wn.spelling=function(n){return(a,o)=>(console.warn(`${o} is likely a misspelling of ${n}`),!0)};function Yi(e,n,a){if(typeof e!="object")throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const i=o[r],s=n[i];if(s){const l=e[i],u=l===void 0||s(l,i,e);if(u!==!0)throw new Se("option "+i+" must be "+u,Se.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new Se("Unknown option "+i,Se.ERR_BAD_OPTION)}}const En={assertOptions:Yi,validators:wn},lt=En.validators;let Nt=class{constructor(n){this.defaults=n||{},this.interceptors={request:new ko,response:new ko}}async request(n,a){try{return await this._request(n,a)}catch(o){if(o instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
6
|
-
`+i):o.stack=i}catch{}}throw o}}_request(n,a){typeof n=="string"?(a=a||{},a.url=n):a=n||{},a=At(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:i}=a;o!==void 0&&En.assertOptions(o,{silentJSONParsing:lt.transitional(lt.boolean),forcedJSONParsing:lt.transitional(lt.boolean),clarifyTimeoutError:lt.transitional(lt.boolean)},!1),r!=null&&(W.isFunction(r)?a.paramsSerializer={serialize:r}:En.assertOptions(r,{encode:lt.function,serialize:lt.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),En.assertOptions(a,{baseUrl:lt.spelling("baseURL"),withXsrfToken:lt.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let s=i&&W.merge(i.common,i[a.method]);i&&W.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),a.headers=Qe.concat(s,i);const l=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(u=u&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const m=[];this.interceptors.response.forEach(function(g){m.push(g.fulfilled,g.rejected)});let c,h=0,f;if(!u){const d=[Oo.bind(this),void 0];for(d.unshift.apply(d,l),d.push.apply(d,m),f=d.length,c=Promise.resolve(a);h<f;)c=c.then(d[h++],d[h++]);return c}f=l.length;let p=a;for(h=0;h<f;){const d=l[h++],g=l[h++];try{p=d(p)}catch(y){g.call(this,y);break}}try{c=Oo.call(this,p)}catch(d){return Promise.reject(d)}for(h=0,f=m.length;h<f;)c=c.then(m[h++],m[h++]);return c}getUri(n){n=At(this.defaults,n);const a=Bo(n.baseURL,n.url,n.allowAbsoluteUrls);return yo(a,n.params,n.paramsSerializer)}};W.forEach(["delete","get","head","options"],function(n){Nt.prototype[n]=function(a,o){return this.request(At(o||{},{method:n,url:a,data:(o||{}).data}))}}),W.forEach(["post","put","patch"],function(n){function a(o){return function(i,s,l){return this.request(At(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Nt.prototype[n]=a(),Nt.prototype[n+"Form"]=a(!0)});let Zi=class a0{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const o=this;this.promise.then(r=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](r);o._listeners=null}),this.promise.then=r=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(r);return s.cancel=function(){o.unsubscribe(i)},s},n(function(i,s,l){o.reason||(o.reason=new Pt(i,s,l),a(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const a=this._listeners.indexOf(n);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const n=new AbortController,a=o=>{n.abort(o)};return this.subscribe(a),n.signal.unsubscribe=()=>this.unsubscribe(a),n.signal}static source(){let n;return{token:new a0(function(r){n=r}),cancel:n}}};function Xi(e){return function(a){return e.apply(null,a)}}function Ki(e){return W.isObject(e)&&e.isAxiosError===!0}const ia={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};Object.entries(ia).forEach(([e,n])=>{ia[n]=e});function _o(e){const n=new Nt(e),a=to(Nt.prototype.request,n);return W.extend(a,Nt.prototype,n,{allOwnKeys:!0}),W.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return _o(At(e,r))},a}const He=_o(Xt);He.Axios=Nt,He.CanceledError=Pt,He.CancelToken=Zi,He.isCancel=Eo,He.VERSION=Po,He.toFormData=gn,He.AxiosError=Se,He.Cancel=He.CanceledError,He.all=function(n){return Promise.all(n)},He.spread=Xi,He.isAxiosError=Ki,He.mergeConfig=At,He.AxiosHeaders=Qe,He.formToJSON=e=>bo(W.isHTMLForm(e)?new FormData(e):e),He.getAdapter=Lo.getAdapter,He.HttpStatusCode=ia,He.default=He;const{Axios:yy,AxiosError:ky,CanceledError:xy,isCancel:by,CancelToken:wy,VERSION:Ey,all:vy,Cancel:Cy,isAxiosError:Sy,spread:By,toFormData:My,AxiosHeaders:Vy,HttpStatusCode:Ay,formToJSON:Ny,getAdapter:Dy,mergeConfig:Ty}=He,Ro=Mt.defineStore("auth",{state:()=>({jwtToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzQwMDY5MzIyLCJpYXQiOjE3Mzk5ODI5MjIsImp0aSI6IjcyZjcxYjgzY2I5YTQ1MWFhMmYyODQ0OTlmZGFkZWIxIiwidXNlcl9pZCI6ImU4YTAwNWZhLTk0YjUtNDRiOC05ZDkwLWZjNzJmYzI0NjRhOSJ9.IOzqjqDpRRfqsvqhzEsGDLhQOKWapjzFycNG3Qv8k0U"}),actions:{setToken(e){this.jwtToken=e},clearToken(){this.jwtToken=null}},getters:{getToken:e=>e.jwtToken}}),it=He.create({baseURL:"https://back.dev-smclick.com.br/"});it.interceptors.request.use(e=>{const a=Ro().getToken;return a&&(e.headers.Authorization=`Bearer ${a}`),e},e=>Promise.reject(e));const Qi="v1/api/attendances/attendant/",Ji="v1/api/attendances/department/",sa="v1/api/attendances/internal_chat/",es="v1/api/instances/instance/",ts="v1/api/crm/event/scheduled_message/",ns="v1/api/crm/event/calendar",la=Mt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(e=""){try{let n=`${es}`;const a=await it.get(n);this.instances=a.data,await Promise.all(this.instances.map(async o=>{o.isLoading=!0;try{const r=o.last_instance_status;r==="DISCONNECTED"||r==="UNDEFINED"?o.status=!1:o.status=!0}catch(r){console.log(r),o.status="Offline"}o.isLoading=!1})),this.count=this.instances.length,this.loaded=!0}catch(n){console.log("Erro ao buscar instâncias:",n),this.loaded=!0}},removeInstance(e){this.instances=this.instances.filter(n=>n.id!==e),this.count=this.instances.length},addInstance(e){const n=this.instances.findIndex(a=>a.id===e.id);n!==-1?this.instances[n]=e:this.instances.push(e),this.count=this.instances.length}}}),as={class:"w-full relative text-current"},os={class:"flex cursor-pointer justify-between items-center"},rs={key:0},is={key:0},ss={key:1,class:"flex items-center gap-2"},ls={class:"flex gap-3 items-center flex-shrink-0"},cs={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},ds={key:1,class:"relative"},us={style:{color:"#0081FB",width:"20px",height:"20px"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},fs={class:"my-auto text-center mx-auto group-hover:inline-block"},ms={key:1,class:"flex justify-center"},hs={class:"w-full"},ps={key:1,class:"flex items-center gap-2 justify-center"},gs={class:"flex px-4 items-center gap-2"},ys={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},ks={class:"gap-2 rounded-b-lg flex overflow-y-auto p-2 shadow shadow-black dark:shadow-gray-400 bg-base-300 max-h-[200px] flex-col"},xs={class:"select-none cursor-pointer w-full"},bs=["onClick","disabled"],ws={class:"flex w-full items-center pl-2 gap-3"},Es={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4 flex-shrink-0 text-green-400",viewBox:"0 0 16 16"},vs={key:1,class:"relative"},Cs={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},Ss={key:0,class:"w-6 h-6 flex-shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Bs={class:"w-full text-center"},Ms={class:"my-auto text-center mx-auto group-hover:inline-block"},Vs={key:1,class:"flex justify-center"},As={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},Ns={key:1,class:"p-4"},Ho={__name:"index",props:{modelValue:{type:Object,default:null},type:{type:String},webhooks:{type:Boolean,default:void 0}},emits:["update:modelValue","function","component-mounted"],setup(e,{emit:n}){const a=la(),o=t.ref(!1),r=t.ref(null),i=e,s=n;function l(u){r.value=u,s("function",u)}return t.watch(()=>i.modelValue,u=>{r.value=u},{immediate:!0}),t.watch(r,u=>{s("update:modelValue",u)}),t.onMounted(async()=>{if(r.value){const u=a.instances.find(m=>m.id===r.value.id);u&&(r.value.status=u.status)}s("component-mounted")}),(u,m)=>{const c=t.resolveComponent("Popper");return t.openBlock(),t.createElementBlock("main",as,[t.createElementVNode("div",{class:t.normalizeClass([{"rounded-b-none":o.value},"rounded-lg shadow dark:shadow-gray-400 shadow-gray-900 dark:bg-base-100 bg-base-100 text-center"])},[t.createElementVNode("div",os,[t.createElementVNode("p",{onClick:m[0]||(m[0]=h=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[t.unref(a).loaded?(t.openBlock(),t.createElementBlock("div",rs,[r.value?(t.openBlock(),t.createElementBlock("span",ss,[t.createElementVNode("header",ls,[r.value.type==="whatsapp-qrcode"?(t.openBlock(),t.createElementBlock("svg",cs,m[3]||(m[3]=[t.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"},null,-1)]))):r.value.type==="whatsapp-api-official"?(t.openBlock(),t.createElementBlock("div",ds,[m[5]||(m[5]=t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},[t.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})],-1)),(t.openBlock(),t.createElementBlock("svg",us,m[4]||(m[4]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"},null,-1)])))])):t.createCommentVNode("",!0),r.value&&r.value.status!==void 0?(t.openBlock(),t.createBlock(c,{key:2,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:t.withCtx(()=>[t.createElementVNode("main",{class:t.normalizeClass(["p-1 rounded text-sm px-3",{"bg-red-500":r.value.status===!1,"bg-green-500":r.value.status===!0,"bg-purple-500":r.value.status==="Offline"}])},[t.createElementVNode("div",fs,t.toDisplayString(r.value.status===!0?"Conectada":r.value.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:t.withCtx(()=>[r.value.isLoading?(t.openBlock(),t.createElementBlock("div",ms,m[6]||(m[6]=[t.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)]))):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{"bg-red-500":r.value.status===!1,"bg-green-500":r.value.status===!0,"bg-purple-500":r.value.status==="Offline"},"text-xs w-5 h-5 py-1 shadow flex justify-start shadow-gray-900 dark:shadow-gray-400 rounded-full cursor-pointer transition-all duration-200 ease-in-out"])},null,2))]),_:1})):t.createCommentVNode("",!0)]),t.createElementVNode("div",hs,t.toDisplayString(r.value.name),1)])):(t.openBlock(),t.createElementBlock("span",is,t.toDisplayString(t.unref(a).instances?t.unref(a).instances.length:"Sem")+" Instâncias disponíveis",1))])):(t.openBlock(),t.createElementBlock("div",ps,m[7]||(m[7]=[t.createElementVNode("svg",{"aria-hidden":"true",class:"inline w-5 h-5 text-blue-300 animate-spin fill-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),t.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),t.createTextVNode("Inicializando instâncias...")])))]),t.createElementVNode("footer",gs,[t.createElementVNode("button",{onClick:m[1]||(m[1]=h=>(r.value=null,o.value=!1))},m[8]||(m[8]=[t.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])),t.createElementVNode("button",{onClick:m[2]||(m[2]=h=>o.value=!o.value)},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass([{"rotate-180":o.value},"w-4 h-4 ease-out transition"]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},m[9]||(m[9]=[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"},null,-1)]),2))])])])],2),o.value?(t.openBlock(),t.createElementBlock("nav",ys,[t.createElementVNode("ul",ks,[t.unref(a).instances.length>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(a).instances,(h,f)=>(t.openBlock(),t.createElementBlock("li",xs,[t.createElementVNode("button",{class:t.normalizeClass([r.value&&r.value.id===h.id?"bg-base-100":"bg-base-200 hover:bg-base-100","flex rounded-md justify-between items-center p-2 px-1 w-full"]),onClick:p=>(r.value=h,o.value=!1,l(h)),disabled:r.value&&r.value.id===h.id||e.type&&h.type!==e.type||e.webhooks!==void 0&&e.webhooks!==h.webhooks},[t.createElementVNode("div",ws,[h.type==="whatsapp-qrcode"?(t.openBlock(),t.createElementBlock("svg",Es,m[10]||(m[10]=[t.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"},null,-1)]))):h.type==="whatsapp-api-official"?(t.openBlock(),t.createElementBlock("div",vs,[m[12]||(m[12]=t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4 flex-shrink-0 text-green-400",viewBox:"0 0 16 16"},[t.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})],-1)),(t.openBlock(),t.createElementBlock("svg",Cs,m[11]||(m[11]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"},null,-1)])))])):t.createCommentVNode("",!0),t.createVNode(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:t.withCtx(()=>[t.createElementVNode("span",null,t.toDisplayString(e.type&&h.type!==e.type?"Não é possível utilizar esse tipo de Instância neste recurso":e.webhooks===!0?"Essa instância está com o Atendimento desabilitado":"Essa aplicação é somente para instâncias sem atendimento habilitado."),1)]),default:t.withCtx(()=>[e.type&&h.type!==e.type||e.webhooks!==void 0&&e.webhooks!==h.webhooks?(t.openBlock(),t.createElementBlock("svg",Ss,m[13]||(m[13]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 10V7a4 4 0 1 1 8 0v3h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h1Zm2-3a2 2 0 1 1 4 0v3h-4V7Zm2 6a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1Z","clip-rule":"evenodd"},null,-1)]))):t.createCommentVNode("",!0)]),_:2},1024),t.createElementVNode("p",Bs,t.toDisplayString(h.name),1),t.createVNode(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:t.withCtx(()=>[t.createElementVNode("main",{class:t.normalizeClass(["p-1 rounded px-3",{"bg-red-500":h.status===!1,"bg-green-500":h.status===!0,"bg-purple-500":h.status==="Offline"}])},[t.createElementVNode("div",Ms,t.toDisplayString(h.status===!0?"Conectada":h.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:t.withCtx(()=>[h.isLoading?(t.openBlock(),t.createElementBlock("div",Vs,m[14]||(m[14]=[t.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)]))):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{"bg-red-500":h.status===!1,"bg-green-500":h.status===!0,"bg-purple-500":h.status==="Offline"},"text-xs w-5 h-5 py-1 shadow flex justify-start shadow-gray-900 dark:shadow-gray-400 rounded-full cursor-pointer transition-all duration-200 ease-in-out"])},null,2))]),_:2},1024)]),t.createElementVNode("div",As,[h.telephone?(t.openBlock(),t.createBlock(c,{key:0,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(h.telephone?`${h.telephone}`:""),1)]),default:t.withCtx(()=>[m[15]||(m[15]=t.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{d:"M7.978 4a2.553 2.553 0 0 0-1.926.877C4.233 6.7 3.699 8.751 4.153 10.814c.44 1.995 1.778 3.893 3.456 5.572 1.68 1.679 3.577 3.018 5.57 3.459 2.062.456 4.115-.073 5.94-1.885a2.556 2.556 0 0 0 .001-3.861l-1.21-1.21a2.689 2.689 0 0 0-3.802 0l-.617.618a.806.806 0 0 1-1.14 0l-1.854-1.855a.807.807 0 0 1 0-1.14l.618-.62a2.692 2.692 0 0 0 0-3.803l-1.21-1.211A2.555 2.555 0 0 0 7.978 4Z"})],-1))]),_:2,__:[15]},1024)):t.createCommentVNode("",!0)])],10,bs)]))),256)):(t.openBlock(),t.createElementBlock("div",Ns," Sem instâncias disponíveis"))])])):t.createCommentVNode("",!0)])}}},Ds=["aria-labelledby","aria-describedby"],Ts={class:"cpk-popover__header border-base-100"},Fs=["id"],Ls=["disabled"],Os=["id"],Ps={class:"cpk-popover__details bg-base-200 border border-base-100"},$s={class:"cpk-popover__footer"},_s=["disabled"],Rs=["disabled"],Hs={key:0,class:"loading-spinner"},zs=Ae({__name:"confirmModal",props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:"Confirmar ação"},description:{type:String,default:""},confirmLabel:{type:String,default:"Confirmar"},cancelLabel:{type:String,default:"Cancelar"},loadingLabel:{type:String,default:"Processando…"},loading:{type:Boolean,default:!1},destructive:{type:Boolean,default:!1},context:{type:Object,default:()=>({})},anchorEl:{type:[HTMLElement,Object],default:null},anchorRect:{type:Object,default:null},placement:{type:String,default:"auto"},align:{type:String,default:"center"},offset:{type:Number,default:10},viewportPadding:{type:Number,default:8}},emits:["update:modelValue","confirm","cancel"],setup(e,{emit:n}){const a=e,o=n,r=t.computed({get:()=>a.modelValue,set:v=>o("update:modelValue",v)}),i=t.ref(null),s=t.ref({left:0,top:0,p:"bottom"}),l={title:`cpk-popover-title-${Math.random().toString(36).slice(2)}`,desc:`cpk-popover-desc-${Math.random().toString(36).slice(2)}`};function u(){o("cancel",a.context),r.value=!1}function m(){a.loading||o("confirm",a.context)}let c,h,f=[];function p(){if(a.anchorRect)return a.anchorRect;const v=a.anchorEl instanceof Element?a.anchorEl:null;if(v)return v.getBoundingClientRect();const C=document.activeElement instanceof Element?document.activeElement:null;return C?C.getBoundingClientRect():{left:window.__lastMouseX??window.innerWidth/2,top:window.__lastMouseY??window.innerHeight/2,width:1,height:1,right:(window.__lastMouseX??0)+1,bottom:(window.__lastMouseY??0)+1}}function d(){if(!r.value)return;const v=window.innerWidth,C=window.innerHeight,O=a.viewportPadding,_=p(),E=i.value?i.value.getBoundingClientRect():{width:320,height:200},w=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let R=w[0],D=0,P=0;const T=_.left+_.width/2-E.width/2,A=_.top+_.height/2-E.height/2,z=_.left,ie=_.left+_.width-E.width,ee=_.top,pe=_.top+_.height-E.height;for(const V of w){if(V==="bottom"&&(P=_.bottom+a.offset,D=a.align==="start"?z:a.align==="end"?ie:T,P+E.height+O<=C)){R="bottom";break}if(V==="top"&&(P=_.top-E.height-a.offset,D=a.align==="start"?z:a.align==="end"?ie:T,P>=O)){R="top";break}if(V==="right"&&(D=_.right+a.offset,P=a.align==="start"?ee:a.align==="end"?pe:A,D+E.width+O<=v)){R="right";break}if(V==="left"&&(D=_.left-E.width-a.offset,P=a.align==="start"?ee:a.align==="end"?pe:A,D>=O)){R="left";break}}D=Math.min(Math.max(O,D),v-E.width-O),P=Math.min(Math.max(O,P),C-E.height-O),s.value={left:D,top:P,p:R}}function g(){y();let C=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;C&&C!==document.body;)f.push(C),C=C.parentElement;f.push(window),f.forEach(O=>O.addEventListener("scroll",d,{passive:!0}))}function y(){f.forEach(v=>{var C;return(C=v.removeEventListener)==null?void 0:C.call(v,"scroll",d)}),f=[]}t.watch(()=>r.value,async v=>{var C;if(v){await t.nextTick(),d(),g(),c=new ResizeObserver(d),c.observe(document.body);const O=a.anchorEl instanceof Element?a.anchorEl:null;O&&((C=h==null?void 0:h.disconnect)==null||C.call(h),h=new ResizeObserver(d),h.observe(O)),window.addEventListener("resize",d),window.addEventListener("keydown",k)}else x()}),t.watch(()=>a.anchorEl,async v=>{var O;if(!r.value)return;await t.nextTick(),y(),g(),(O=h==null?void 0:h.disconnect)==null||O.call(h);const C=v instanceof Element?v:null;C&&(h=new ResizeObserver(d),h.observe(C)),d()}),t.watch(()=>a.anchorRect,()=>{r.value&&d()}),t.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&d()});function k(v){v.key==="Escape"&&u(),v.key==="Enter"&&m()}t.onMounted(()=>{window.addEventListener("mousemove",v=>{window.__lastMouseX=v.clientX,window.__lastMouseY=v.clientY},{passive:!0})}),t.onBeforeUnmount(x);function x(){y(),window.removeEventListener("resize",d),window.removeEventListener("keydown",k),c&&c.disconnect(),h&&h.disconnect()}const b=t.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(v,C)=>(t.openBlock(),t.createBlock(t.Transition,{name:"cpk-layer",appear:""},{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:t.withModifiers(u,["self"])},[t.createVNode(t.Transition,{name:"cpk-card",appear:""},{default:t.withCtx(()=>[t.createElementVNode("div",{ref_key:"card",ref:i,class:t.normalizeClass(["cpk-popover bg-base-300",[{"is-loading":e.loading,"is-danger":e.destructive}]]),style:t.normalizeStyle(b.value),role:"dialog","aria-modal":"false","aria-labelledby":l.title,"aria-describedby":l.desc},[t.createElementVNode("div",Ts,[C[0]||(C[0]=t.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"!",-1)),t.createElementVNode("h3",{class:"cpk-popover__title",id:l.title},t.toDisplayString(e.title),9,Fs),t.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:u,disabled:e.loading,"aria-label":"Fechar"}," × ",8,Ls)]),e.description?(t.openBlock(),t.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:l.desc},t.toDisplayString(e.description),9,Os)):t.createCommentVNode("",!0),t.createElementVNode("div",Ps,[t.renderSlot(v.$slots,"details",{},void 0,!0)]),t.createElementVNode("div",$s,[t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:u,disabled:e.loading},t.toDisplayString(e.cancelLabel),9,_s),t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button","cyber-button--md",e.destructive?"cyber-button--danger":"cyber-button--accent"]),onClick:m,disabled:e.loading},[e.loading?(t.openBlock(),t.createElementBlock("span",Hs)):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(e.loading?e.loadingLabel:e.confirmLabel),1)],10,Rs)])],14,Ds)]),_:3})],32)):t.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-2f78365f"]]);function $t(e){return(n={})=>{const a=n.width?String(n.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}function ct(e){return(n,a)=>{const o=a!=null&&a.context?String(a.context):"standalone";let r;if(o==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,l=a!=null&&a.width?String(a.width):s;r=e.formattingValues[l]||e.formattingValues[s]}else{const s=e.defaultWidth,l=a!=null&&a.width?String(a.width):e.defaultWidth;r=e.values[l]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(n):n;return r[i]}}function dt(e){return(n,a={})=>{const o=a.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=n.match(r);if(!i)return null;const s=i[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?Gs(l,h=>h.test(s)):js(l,h=>h.test(s));let m;m=e.valueCallback?e.valueCallback(u):u,m=a.valueCallback?a.valueCallback(m):m;const c=n.slice(s.length);return{value:m,rest:c}}}function js(e,n){for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&n(e[a]))return a}function Gs(e,n){for(let a=0;a<e.length;a++)if(n(e[a]))return a}function zo(e){return(n,a={})=>{const o=n.match(e.matchPattern);if(!o)return null;const r=o[0],i=n.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=a.valueCallback?a.valueCallback(s):s;const l=n.slice(r.length);return{value:s,rest:l}}}const jo=6048e5,Is=864e5,Go=Symbol.for("constructDateFrom");function Je(e,n){return typeof e=="function"?e(n):e&&typeof e=="object"&&Go in e?e[Go](n):e instanceof Date?new e.constructor(n):new Date(n)}function ca(e,...n){const a=Je.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let qs={};function vn(){return qs}function tt(e,n){return Je(n||e,e)}function Dt(e,n){var l,u,m,c;const a=vn(),o=(n==null?void 0:n.weekStartsOn)??((u=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??a.weekStartsOn??((c=(m=a.locale)==null?void 0:m.options)==null?void 0:c.weekStartsOn)??0,r=tt(e,n==null?void 0:n.in),i=r.getDay(),s=(i<o?7:0)+i-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function Ws(e,n,a){const[o,r]=ca(a==null?void 0:a.in,e,n);return+Dt(o,a)==+Dt(r,a)}const Us={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ys=(e,n,a)=>{let o;const r=Us[e];return typeof r=="string"?o=r:n===1?o=r.one:o=r.other.replace("{{count}}",n.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o},Zs={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Xs=(e,n,a,o)=>Zs[e],Ks={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Qs={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Js={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},el={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},tl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},al={ordinalNumber:(e,n)=>{const a=Number(e),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},era:ct({values:Ks,defaultWidth:"wide"}),quarter:ct({values:Qs,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ct({values:Js,defaultWidth:"wide"}),day:ct({values:el,defaultWidth:"wide"}),dayPeriod:ct({values:tl,defaultWidth:"wide",formattingValues:nl,defaultFormattingWidth:"wide"})},ol=/^(\d+)(th|st|nd|rd)?/i,rl=/\d+/i,il={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},sl={any:[/^b/i,/^(a|c)/i]},ll={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cl={any:[/1/i,/2/i,/3/i,/4/i]},dl={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ul={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},fl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ml={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},pl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gl={ordinalNumber:zo({matchPattern:ol,parsePattern:rl,valueCallback:e=>parseInt(e,10)}),era:dt({matchPatterns:il,defaultMatchWidth:"wide",parsePatterns:sl,defaultParseWidth:"any"}),quarter:dt({matchPatterns:ll,defaultMatchWidth:"wide",parsePatterns:cl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dt({matchPatterns:dl,defaultMatchWidth:"wide",parsePatterns:ul,defaultParseWidth:"any"}),day:dt({matchPatterns:fl,defaultMatchWidth:"wide",parsePatterns:ml,defaultParseWidth:"any"}),dayPeriod:dt({matchPatterns:hl,defaultMatchWidth:"any",parsePatterns:pl,defaultParseWidth:"any"})},yl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},bl={date:$t({formats:yl,defaultWidth:"full"}),time:$t({formats:kl,defaultWidth:"full"}),dateTime:$t({formats:xl,defaultWidth:"full"})},wl={code:"en-US",formatDistance:Ys,formatLong:bl,formatRelative:Xs,localize:al,match:gl,options:{weekStartsOn:0,firstWeekContainsDate:1}},El={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},vl=(e,n,a)=>{let o;const r=El[e];return typeof r=="string"?o=r:n===1?o=r.one:o=r.other.replace("{{count}}",String(n)),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"em "+o:"há "+o:o},Cl={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Sl={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Bl={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ml={date:$t({formats:Cl,defaultWidth:"full"}),time:$t({formats:Sl,defaultWidth:"full"}),dateTime:$t({formats:Bl,defaultWidth:"full"})},Vl={lastWeek:e=>{const n=e.getDay();return"'"+(n===0||n===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},Al=(e,n,a,o)=>{const r=Vl[e];return typeof r=="function"?r(n):r},Nl={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},Dl={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Tl={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},Fl={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},Ll={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},Ol={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},Pl={ordinalNumber:(e,n)=>{const a=Number(e);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:ct({values:Nl,defaultWidth:"wide"}),quarter:ct({values:Dl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ct({values:Tl,defaultWidth:"wide"}),day:ct({values:Fl,defaultWidth:"wide"}),dayPeriod:ct({values:Ll,defaultWidth:"wide",formattingValues:Ol,defaultFormattingWidth:"wide"})},$l=/^(\d+)[ºªo]?/i,_l=/\d+/i,Rl={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},Hl={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},zl={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},jl={any:[/1/i,/2/i,/3/i,/4/i]},Gl={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Il={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},ql={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},Wl={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},Ul={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Yl={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},Zl={ordinalNumber:zo({matchPattern:$l,parsePattern:_l,valueCallback:e=>parseInt(e,10)}),era:dt({matchPatterns:Rl,defaultMatchWidth:"wide",parsePatterns:Hl,defaultParseWidth:"any"}),quarter:dt({matchPatterns:zl,defaultMatchWidth:"wide",parsePatterns:jl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dt({matchPatterns:Gl,defaultMatchWidth:"wide",parsePatterns:Il,defaultParseWidth:"any"}),day:dt({matchPatterns:ql,defaultMatchWidth:"wide",parsePatterns:Wl,defaultParseWidth:"any"}),dayPeriod:dt({matchPatterns:Ul,defaultMatchWidth:"any",parsePatterns:Yl,defaultParseWidth:"any"})},Io={code:"pt-BR",formatDistance:vl,formatLong:Ml,formatRelative:Al,localize:Pl,match:Zl,options:{weekStartsOn:0,firstWeekContainsDate:1}},Xl={scheduled_messages:"Mensagem programada"};function Kl(e){return Xl[e]||e||"Evento"}function da(e,n){return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()}function _t(e){const n=e instanceof Date?e:new Date(e),a=n.getFullYear(),o=(n.getMonth()+1).toString().padStart(2,"0");return`${a}-${o}`}function Qt(e){const[n,a]=String(e||"").trim().split(" ");if(!n)return null;const[o,r,i]=n.split("-").map(m=>parseInt(m,10));let s=0,l=0;if(a){const[m,c]=a.split(":");s=parseInt(m||"0",10),l=parseInt(c||"0",10)}const u=new Date(o,(r||1)-1,i||1,s,l);return isNaN(u.getTime())?null:u}function Ql(e){if(!e)return null;try{const n=String(e).replace(/(\.\d{3})\d+$/,"$1"),a=new Date(n);return isNaN(a.getTime())?null:a}catch{return null}}function Cn(e){if(!e)return"";const n=e instanceof Date?e:new Date(e);if(isNaN(n.getTime()))return"";const a=String(n.getHours()).padStart(2,"0"),o=String(n.getMinutes()).padStart(2,"0");return`${a}:${o}`}function Jl(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function ua(e){if(!e)return null;const n=(e==null?void 0:e.params)||{},a=(n==null?void 0:n.schedule)||{},o=(e==null?void 0:e.info)||{},r=(o==null?void 0:o.entity)||{},i=(o==null?void 0:o.department)||{},s=(o==null?void 0:o.instance)||{};let l=null;if(a!=null&&a.time&&(l=Qt(a.time)),!l&&(e!=null&&e.next_execution_at)&&(l=Ql(e.next_execution_at)),!l)return null;const u=Array.isArray(n==null?void 0:n.message)?n.message[0]:null,m=u&&(u.content||u.text)||"",c=(e==null?void 0:e.function)||(n==null?void 0:n.function)||"",h=Kl(c),f=(m||"").trim();return{id:(e==null?void 0:e.id)||Jl(),date:l,time:Cn(l),type:e.function,status:e.status||null,scheduled_by:n.scheduled_by,title:h,content:f,functionName:c||null,chatId:(n==null?void 0:n.chat_id)||(o==null?void 0:o.id)||"",protocol:(o==null?void 0:o.protocol)??"",contactName:(r==null?void 0:r.name)||"Contato",contactPhoto:(r==null?void 0:r.photo)||"",departmentName:(i==null?void 0:i.name)||"",departmentId:(i==null?void 0:i.id)||null,instanceName:(s==null?void 0:s.name)||"",raw:e}}function qo(e=[]){const n=Array.isArray(e)?e:Array.isArray(e.results)?e.results:[],a=[];for(const o of n){const r=ua(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function e2(e="/crm_scheduled",n){var a;try{const o=((a=n==null?void 0:n.raw)==null?void 0:a.id)??(n==null?void 0:n.id)??n;if(o==null)throw new Error("ID inválido");const r=`${String(e).replace(/\/$/,"")}/${o}/`,i=await it.delete(r);return{ok:(i==null?void 0:i.status)>=200&&i.status<300,status:(i==null?void 0:i.status)??0}}catch(o){return console.error("Error erasing scheduled event:",o),{ok:!1,status:0}}}const Wo={scheduled_messages:"#3b82f6"},Uo=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function t2(e=""){let n=2166136261;for(let a=0;a<e.length;a++)n^=e.charCodeAt(a),n=Math.imul(n,16777619);return n>>>0}function n2(e={}){var s,l,u,m,c,h,f,p,d,g,y;const n=e.functionName||e.function||((s=e==null?void 0:e.params)==null?void 0:s.function);if(n)return`fn:${n}`;const a=(e==null?void 0:e.departmentName)||((u=(l=e==null?void 0:e.info)==null?void 0:l.department)==null?void 0:u.name)||((c=(m=e==null?void 0:e.info)==null?void 0:m.department)==null?void 0:c.id);if(a)return`dept:${a}`;const o=(e==null?void 0:e.instanceName)||((f=(h=e==null?void 0:e.info)==null?void 0:h.instance)==null?void 0:f.name)||((d=(p=e==null?void 0:e.info)==null?void 0:p.instance)==null?void 0:d.id);if(o)return`inst:${o}`;const r=(e==null?void 0:e.protocol)??((g=e==null?void 0:e.info)==null?void 0:g.protocol);if(r!=null)return`proto:${r}`;const i=(e==null?void 0:e.chatId)||((y=e==null?void 0:e.params)==null?void 0:y.chat_id);return i?`chat:${i}`:"misc"}function Sn(e={}){var r;const n=e.functionName||e.function||((r=e==null?void 0:e.params)==null?void 0:r.function);if(n&&Object.prototype.hasOwnProperty.call(Wo,n))return Wo[n];const a=n2(e),o=t2(String(a))%Uo.length;return Uo[o]}const Rt=Mt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),actions:{async fetchAttendants(){try{this.attendants=[];let e=`${Qi}`;const n=await it.get(e);this.attendants=n.data,this.count=this.attendants.length}catch(e){console.log("Erro ao buscar atendentes:",e)}},removeAttendants(e){this.attendants=this.attendants.filter(n=>n.id!==e)},addAttendants(e){const n=this.attendants.findIndex(a=>a.id===e.id);n!==-1?this.attendants[n]=e:this.attendants.push(e)}}}),a2={class:"itemc-head"},o2={class:"minw0"},r2={class:"itemc-title"},i2={class:"itemc-sub"},s2={class:"flex items-center gap-1"},l2={class:"itemc-actions"},c2={class:"flex flex-col items-center"},d2={class:"time-badge"},u2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},f2={class:"sched-pop__card bg-base-300",role:"dialog"},m2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},h2={key:1,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},p2=["disabled"],g2={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},y2={key:1,class:"loading-spinner"},k2={class:"itemsb-head"},x2=["src"],b2={key:1,class:"avatar avatar--placeholder bg-base-100"},w2={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},E2={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},v2={class:"itemsb-main"},C2={class:"itemsb-row"},S2={class:"itemsb-title truncate"},B2={class:"itemsb-time"},M2={class:"itemsb-sub"},V2={class:"items-attendant"},A2={class:"itemsb-content"},N2={key:0,class:"itemsb-actions"},D2=["disabled"],T2={key:0,class:"loading-spinner"},F2={class:"event-left"},L2={class:"event-line"},O2={class:"event-actions"},P2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},$2={class:"sched-pop__card bg-base-300",role:"dialog"},_2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},R2={class:"sched-pop__card bg-base-300",role:"dialog"},H2={class:"event-time"},z2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},j2={key:1,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},G2=["disabled"],I2={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},q2={key:1,class:"loading-spinner"},fa=Ae({__name:"EventItem",props:{ev:{type:Object,required:!0},mode:{type:String,default:"compact"},getEventColor:{type:Function,default:null},viewOnly:{type:Boolean,default:!1}},emits:["open-message","open-chat","delete-message"],setup(e,{emit:n}){const a=Rt(),o=e,r=t.computed(()=>(o.getEventColor||Sn)(o.ev)),i=t.computed(()=>{var m;return((m=o.ev)==null?void 0:m.type)==="scheduled_messages"}),s=t.computed(()=>a.attendants.find(m=>m.is_me)||{}),l=m=>{const c=a.attendants.find(h=>h.id===m);return c?c.id===s.value.id?"Você":c.name||"Desconhecido":"Desconhecido"},u=t.computed(()=>{var c,h;const m=[];return(c=o.ev)!=null&&c.contactName&&m.push(o.ev.contactName),m.push(((h=o.ev)==null?void 0:h.departmentName)||"sem depto"),m.join(" • ")});return(m,c)=>{var h,f,p,d,g,y;return e.mode==="compact"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("header",a2,[t.createElementVNode("span",{style:t.normalizeStyle({background:r.value}),class:"color-bar"},null,4),t.createElementVNode("div",o2,[t.createElementVNode("div",r2,t.toDisplayString(e.ev.contactName?e.ev.contactName+" • ":"")+" "+t.toDisplayString(e.ev.departmentName||"sem depto"),1),t.createElementVNode("div",i2,[t.createElementVNode("span",s2,[c[9]||(c[9]=t.createElementVNode("svg",{class:"icon-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z","clip-rule":"evenodd"})],-1)),t.createTextVNode(" "+t.toDisplayString(l(e.ev.scheduled_by)),1)])])])]),t.createElementVNode("footer",l2,[t.createElementVNode("div",c2,[t.createElementVNode("div",d2,t.toDisplayString(e.ev.time),1),t.createElementVNode("div",u2,[e.ev.status!==void 0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["status-bar",(h=e.ev)!=null&&h.status?"status--up":"status--down"])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",f2,[c[10]||(c[10]=t.createElementVNode("strong",null,"Status",-1)),c[11]||(c[11]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" "+t.toDisplayString(e.ev.status===!0?"Ativo":"Executado"),1)])])]),i.value?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:c[0]||(c[0]=k=>m.$emit("open-message",e.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((f=e.ev)==null?void 0:f.status)===!0?(t.openBlock(),t.createElementBlock("svg",m2,c[12]||(c[12]=[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z","clip-rule":"evenodd"},null,-1)]))):(t.openBlock(),t.createElementBlock("svg",h2,c[13]||(c[13]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.998 7.78C6.729 6.345 9.198 5 12 5c2.802 0 5.27 1.345 7.002 2.78a12.713 12.713 0 0 1 2.096 2.183c.253 .344 .465 .682 .618 .997 .14 .286 .284 .658 .284 1.04s-.145 .754 -.284 1.04a6.6 6.6 0 0 1-.618 .997 12.712 12.712 0 0 1-2.096 2.183C17.271 17.655 14.802 19 12 19c-2.802 0-5.27-1.345-7.002-2.78a12.712 12.712 0 0 1-2.096-2.183 6.6 6.6 0 0 1-.618-.997C2.144 12.754 2 12.382 2 12s.145-.754 .284-1.04c.153-.315 .365-.653 .618-.997A12.714 12.714 0 0 1 4.998 7.78ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","clip-rule":"evenodd"},null,-1)])))])):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:c[1]||(c[1]=k=>m.$emit("delete-message",e.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:e.ev.deleteLoading||!e.ev.status},[e.ev.deleteLoading?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",g2,c[14]||(c[14]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z","clip-rule":"evenodd"},null,-1)]))),e.ev.deleteLoading?(t.openBlock(),t.createElementBlock("div",y2)):t.createCommentVNode("",!0)],8,p2)):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[2]||(c[2]=k=>m.$emit("open-chat",e.ev)),"aria-label":"Abrir conversa"},c[15]||(c[15]=[t.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.559 4.544c.355-.35.834-.544 1.33-.544H19.11c.496 0 .975.194 1.33.544.356.35.559.829.559 1.331v9.25c0 .502-.203.981-.559 1.331-.355.35-.834.544-1.33.544H15.5l-2.7 3.6a1 1 0 0 1-1.6 0L8.5 17H4.889c-.496 0-.975-.194-1.33-.544A1.868 1.868 0 0 1 3 15.125v-9.25c0-.502.203-.981.559-1.331ZM7.556 7.5a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Zm0 3.5a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2H7.556Z","clip-rule":"evenodd"})],-1)]))])],64)):e.mode==="sidebar"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",k2,[t.createElementVNode("div",{class:"avatar-wrap",style:t.normalizeStyle({boxShadow:`0 0 0 1px ${r.value}`})},[e.ev.contactPhoto?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.ev.contactPhoto,alt:"",class:"avatar",loading:"lazy"},null,8,x2)):(t.openBlock(),t.createElementBlock("div",b2,c[16]||(c[16]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",class:"icon-5 icon-muted"},[t.createElementVNode("path",{fill:"currentColor",d:"M12 12a5 5 0 1 0-5-5a5 5 0 0 0 5 5m0 2c-4 0-8 2-8 4v2h16v-2c0-2-4-4-8-4Z"})],-1)]))),t.createElementVNode("div",w2,[e.ev.status!==void 0?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["status-dot-avatar",(p=e.ev)!=null&&p.status?"status--up":"status--down"])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",E2,[c[17]||(c[17]=t.createElementVNode("strong",null,"Status",-1)),c[18]||(c[18]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" "+t.toDisplayString(e.ev.status===!0?"Ativo":"Executado"),1)])])],4),t.createElementVNode("div",v2,[t.createElementVNode("div",C2,[t.createElementVNode("span",S2,t.toDisplayString(e.ev.contactName)+" • "+t.toDisplayString(e.ev.departmentName||"sem depto"),1),t.createElementVNode("span",B2,t.toDisplayString(e.ev.time),1)]),t.createElementVNode("div",M2,[t.createElementVNode("span",V2,[c[19]||(c[19]=t.createElementVNode("svg",{class:"icon-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z"})],-1)),t.createTextVNode(" "+t.toDisplayString(l(e.ev.scheduled_by)),1)])])])]),t.createElementVNode("p",A2,t.toDisplayString(e.ev.content||e.ev.title),1),e.viewOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",N2,[i.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:c[3]||(c[3]=k=>m.$emit("open-message",e.ev))},t.toDisplayString(((d=e.ev)==null?void 0:d.status)===!0?"Editar":"Visualizar"),1)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:c[4]||(c[4]=k=>m.$emit("delete-message",e.ev)),class:"cyber-button cyber-button--sm cyber-button--danger","aria-label":"Apagar evento",disabled:e.ev.deleteLoading||!e.ev.status},[e.ev.deleteLoading?(t.openBlock(),t.createElementBlock("div",T2)):t.createCommentVNode("",!0),c[20]||(c[20]=t.createTextVNode(" Apagar "))],8,D2)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:c[5]||(c[5]=k=>m.$emit("open-chat",e.ev))}," Abrir conversa ")):t.createCommentVNode("",!0)]))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",F2,[t.createElementVNode("span",{style:t.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),t.createElementVNode("div",L2,t.toDisplayString(u.value),1)]),t.createElementVNode("footer",O2,[t.createElementVNode("div",P2,[c[23]||(c[23]=t.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z","clip-rule":"evenodd"})],-1)),t.createElementVNode("div",$2,[c[21]||(c[21]=t.createElementVNode("strong",null,"Agendado por",-1)),c[22]||(c[22]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" "+t.toDisplayString(l(e.ev.scheduled_by)),1)])]),t.createElementVNode("div",_2,[e.ev.status!==void 0?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["status-bar",(g=e.ev)!=null&&g.status?"status--up":"status--down"])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",R2,[c[24]||(c[24]=t.createElementVNode("strong",null,"Status",-1)),c[25]||(c[25]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" "+t.toDisplayString(e.ev.status===!0?"Ativo":"Executado"),1)])]),t.createElementVNode("div",H2,t.toDisplayString(e.ev.time),1),i.value?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:c[6]||(c[6]=k=>m.$emit("open-message",e.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((y=e.ev)==null?void 0:y.status)===!0?(t.openBlock(),t.createElementBlock("svg",z2,c[26]||(c[26]=[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z","clip-rule":"evenodd"},null,-1)]))):(t.openBlock(),t.createElementBlock("svg",j2,c[27]||(c[27]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.998 7.78C6.729 6.345 9.198 5 12 5c2.802 0 5.27 1.345 7.002 2.78a12.713 12.713 0 0 1 2.096 2.183c.253 .344 .465 .682 .618 .997 .14 .286 .284 .658 .284 1.04s-.145 .754 -.284 1.04a6.6 6.6 0 0 1-.618 .997 12.712 12.712 0 0 1-2.096 2.183C17.271 17.655 14.802 19 12 19c-2.802 0-5.27-1.345-7.002-2.78a12.712 12.712 0 0 1-2.096-2.183 6.6 6.6 0 0 1-.618-.997C2.144 12.754 2 12.382 2 12s.145-.754 .284-1.04c.153-.315 .365-.653 .618-.997A12.714 12.714 0 0 1 4.998 7.78ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","clip-rule":"evenodd"},null,-1)])))])):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:c[7]||(c[7]=k=>m.$emit("delete-message",e.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:e.ev.deleteLoading||!e.ev.status},[e.ev.deleteLoading?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",I2,c[28]||(c[28]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z","clip-rule":"evenodd"},null,-1)]))),e.ev.deleteLoading?(t.openBlock(),t.createElementBlock("div",q2)):t.createCommentVNode("",!0)],8,G2)):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[8]||(c[8]=k=>m.$emit("open-chat",e.ev)),"aria-label":"Abrir conversa"},c[29]||(c[29]=[t.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.559 4.544c.355-.35.834-.544 1.33-.544H19.11c.496 0 .975.194 1.33.544.356.35.559.829.559 1.331v9.25c0 .502-.203.981-.559 1.331-.355.35-.834.544-1.33.544H15.5l-2.7 3.6a1 1 0 0 1-1.6 0L8.5 17H4.889c-.496 0-.975-.194-1.33-.544A1.868 1.868 0 0 1 3 15.125v-9.25c0-.502.203-.981.559-1.331ZM7.556 7.5a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Zm0 3.5a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2H7.556Z","clip-rule":"evenodd"})],-1)]))])],64))}}},[["__scopeId","data-v-ba8ebbe5"]]),gt=new Map,Yo=Mt.defineStore("scheduled",{state:()=>({baseUrl:ns,monthCache:{},loadingYM:new Set,errorByYM:{},loadedYM:new Set,filters:{}}),getters:{eventsOf:e=>n=>e.monthCache[n]||[],isLoading:e=>n=>e.loadingYM.has(n),errorOf:e=>n=>e.errorByYM[n]||""},actions:{setBaseUrl(e){this.baseUrl=e||"/crm_scheduled"},_setMonth(e,n){this.monthCache={...this.monthCache,[e]:n||[]}},_deleteMonth(e){const{[e]:n,...a}=this.monthCache;this.monthCache=a,this.loadingYM.delete(e);const{[e]:o,...r}=this.errorByYM;this.errorByYM=r,this.loadedYM.delete(e)},coerceHttps(e){return e&&e.startsWith("http://")?e.replace(/^http:\/\//i,"https://"):e},_appendMonth(e,n){if(!n||n.length===0)return;this.monthCache[e]||(this.monthCache[e]=[]);const a=new Set(this.monthCache[e].map(o=>o==null?void 0:o.id));for(const o of n)o&&(o.id&&a.has(o.id)||this.monthCache[e].push(o))},async ensureMonthLoaded(e){if(e||(e=_t(new Date)),this.loadedYM.has(e))return;const n=`${this.baseUrl}|${e}`;if(gt.has(n))return gt.get(n);this.loadingYM.add(e),this.errorByYM={...this.errorByYM,[e]:""};const a=(async()=>{var o,r;try{const i=`${this.baseUrl}?year_month=${encodeURIComponent(e)}&page_size=10`,s=await it.get(i),l=Array.isArray(s==null?void 0:s.data)?s.data:((o=s==null?void 0:s.data)==null?void 0:o.results)||[],u=qo(l||[]);this._setMonth(e,u),this.loadedYM.add(e);let m=this.coerceHttps(((r=s==null?void 0:s.data)==null?void 0:r.next)||null);m&&(async()=>{var c,h;try{let f=m;for(;f;){const p=await it.get(f),d=Array.isArray(p==null?void 0:p.data)?p.data:((c=p==null?void 0:p.data)==null?void 0:c.results)||[],g=qo(d||[]);this._appendMonth(e,g),f=this.coerceHttps(((h=p==null?void 0:p.data)==null?void 0:h.next)||null)}}catch(f){console.warn("[scheduled] background paging error:",(f==null?void 0:f.message)||f)}})()}catch(i){const s=String((i==null?void 0:i.message)||i);throw this.errorByYM={...this.errorByYM,[e]:s},console.error("[scheduled] fetch error",e,s),this._setMonth(e,[]),this.loadedYM.delete(e),i}finally{gt.delete(n),this.loadingYM.delete(e)}})();return gt.set(n,a),a},async forceReload(e){e||(e=_t(new Date));const n=`${this.baseUrl}|${e}`;gt.delete(n),this._deleteMonth(e),this.loadedYM.delete(e),await this.ensureMonthLoaded(e)},findEventById(e){const n=String(e);for(const[a,o]of Object.entries(this.monthCache)){const r=(o||[]).findIndex(i=>{var u;const s=((u=i==null?void 0:i.raw)==null?void 0:u.id)!=null?String(i.raw.id):null,l=(i==null?void 0:i.id)!=null?String(i.id):null;return s===n||l===n});if(r!==-1)return{ym:a,idx:r}}return null},applyUpdateToCache({id:e,params:n}){var f,p,d,g,y,k,x,b,v,C,O,_,E;let a=null;if((f=n==null?void 0:n.schedule)!=null&&f.time){const w=n.schedule.time,R=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(w);if(R){const[,D,P,T,A="00",z="00"]=R;a=new Date(Number(D),Number(P)-1,Number(T),Number(A),Number(z),0,0)}else{const D=typeof w=="string"&&!w.includes("T")?w.replace(" ","T"):w;a=new Date(D)}}console.log(n);const o=w=>{var R,D,P,T;return a instanceof Date&&!isNaN(a)&&(w.date=a,w.time=Cn(a)),((D=(R=n==null?void 0:n.message)==null?void 0:R[0])==null?void 0:D.content)!=null&&(w.content=n.message[0].content),w.raw=w.raw||{id:e},w.raw.params=w.raw.params||{},n!=null&&n.schedule&&(w.raw.params.schedule={...w.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(w.raw.params.scheduled_by=n.scheduled_by),n.department&&(w.raw.params.department=n.department),n!=null&&n.message&&(w.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(w.chatId=n.chat_id??w.chatId??""),n!=null&&n.entity&&(w.raw.params.entity={...w.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(w.contactName=n.entity.name??w.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(w.contactPhoto=n.entity.photo??w.contactPhoto??null,n.entity.photo&&(w.photo=n.entity.photo))),n!=null&&n.info&&(w.raw.params.info={...w.raw.params.info||{},...n.info},(P=n.info)!=null&&P.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(w.departmentName=n.info.department.name??w.departmentName),(T=n.info)!=null&&T.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(w.instanceName=n.info.instance.name??w.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(w.instanceStatus=n.info.instance.last_instance_status??w.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?w.title=n.title??w.title??"Mensagem programada":w.title=w.title||"Mensagem programada",Object.prototype.hasOwnProperty.call(n||{},"function")?(w.function=n.function??w.function??"scheduled_messages",w.type=n.function??w.type??"scheduled_messages"):(w.function=w.function||"scheduled_messages",w.type=w.type||"scheduled_messages"),w},r=this.findEventById(e);if(!r){const w=a instanceof Date&&!isNaN(a)?a:(()=>{var z;const T=(z=n==null?void 0:n.schedule)==null?void 0:z.time,A=typeof T=="string"&&!T.includes("T")?T.replace(" ","T"):T;return(Qt==null?void 0:Qt(A))||(A?new Date(A):new Date)})(),R=o({id:e,date:w,time:Cn(w),title:(n==null?void 0:n.title)||"Mensagem programada",type:(n==null?void 0:n.function)||"scheduled_messages",status:(n==null?void 0:n.status)||"true",scheduled_by:(n==null?void 0:n.scheduled_by)||null,function:(n==null?void 0:n.function)||"scheduled_messages",content:((d=(p=n==null?void 0:n.message)==null?void 0:p[0])==null?void 0:d.content)??"",raw:{id:e,params:n},contactName:((g=n==null?void 0:n.entity)==null?void 0:g.name)??"Cliente",contactPhoto:((y=n==null?void 0:n.entity)==null?void 0:y.photo)??null,departmentName:((x=(k=n==null?void 0:n.info)==null?void 0:k.department)==null?void 0:x.name)??null,departmentId:((v=(b=n==null?void 0:n.info)==null?void 0:b.department)==null?void 0:v.id)??null,instanceName:((O=(C=n==null?void 0:n.info)==null?void 0:C.instance)==null?void 0:O.name)??null,instanceStatus:((E=(_=n==null?void 0:n.info)==null?void 0:_.instance)==null?void 0:E.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),D=_t(R.date),P=this.monthCache[D]?[...this.monthCache[D],R]:[R];P.sort((T,A)=>T.date-A.date),this._setMonth(D,P);return}const{ym:i,idx:s}=r,l=this.monthCache[i]||[],u={...l[s]},m=o({...u}),c=m.date instanceof Date?m.date:u.date,h=_t(c);if(h===i){const w=[...l];w.splice(s,1,m),w.sort((R,D)=>R.date-D.date),this._setMonth(i,w)}else{const w=l.slice(0,s).concat(l.slice(s+1)),R=this.monthCache[h]?[...this.monthCache[h],m]:[m];R.sort((D,P)=>D.date-P.date),this.monthCache={...this.monthCache,[i]:w,[h]:R}}},removeFromCache(e){const n=this.findEventById(e);if(!n)return!1;const{ym:a,idx:o}=n,r=this.monthCache[a]||[],i=r.slice(0,o).concat(r.slice(o+1));return this._setMonth(a,i),!0},insertNormalizedEvent(e){if(!e)return;const n=String(e.id),a=e.date instanceof Date?e.date:Qt(e.date)||new Date,o=_t(a),r={...e,id:n,date:a,time:e.time??Cn(a)},i=this.monthCache[o]?[...this.monthCache[o]]:[],s=i.findIndex(l=>{var u;return String(((u=l==null?void 0:l.raw)==null?void 0:u.id)??(l==null?void 0:l.id))===n});s!==-1?i.splice(s,1,r):i.push(r),i.sort((l,u)=>l.date-u.date),this._setMonth(o,i)},insertFromApiItem(e){const n=ua(e);n&&this.insertNormalizedEvent(n)},insertManyFromApi(e=[]){for(const n of e){const a=ua(n);a&&this.insertNormalizedEvent(a)}},insertFromApiPage(e){const n=Array.isArray(e)?e:(e==null?void 0:e.results)||[];this.insertManyFromApi(n)},insertFromParams(e){return this.applyUpdateToCache(e)},hasEvent(e){return!!this.findEventById(e)},resetAll(){var e;this.monthCache={},this.loadingYM=new Set,this.errorByYM={},this.loadedYM=new Set,(e=gt.clear)==null||e.call(gt)}}}),W2={class:"cpk-header bg-base-200"},U2={class:"left"},Y2=["title"],Z2={class:"right"},X2=["title"],K2={class:"toggle"},Q2=["aria-pressed","title"],J2={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},ec={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},tc=Ae({__name:"CalHeader",props:{month:String,year:[String,Number],isCompact:Boolean,viewMode:{type:String,default:"calendar"},filterCount:{type:Number,default:0}},emits:["prev","next","today","toggle-compact","set-view-mode","close-page","open-filter"],setup(e){return(n,a)=>(t.openBlock(),t.createElementBlock("header",W2,[t.createElementVNode("div",U2,[t.createElementVNode("button",{onClick:a[0]||(a[0]=o=>n.$emit("close-page")),class:"cyber-button cyber-button--sm btn-ghost nav hide-md-up","aria-label":"Fechar"},a[8]||(a[8]=[t.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost nav",onClick:a[1]||(a[1]=o=>n.$emit("prev")),"aria-label":"Mês anterior"},a[9]||(a[9]=[t.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[t.createElementVNode("path",{fill:"currentColor",d:"M15.5 19 9 12l6.5-7 1.5 1.3L12.3 12l4.7 5.7z"})],-1),t.createElementVNode("span",{class:"label-md"},"Anterior",-1)])),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent today",onClick:a[2]||(a[2]=o=>n.$emit("today")),"aria-label":"Hoje"},a[10]||(a[10]=[t.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24","aria-hidden":"true"},[t.createElementVNode("path",{fill:"currentColor",d:"M11.6643 2.05648c.0197-.00699.1589-.05645.3357-.05645.1768 0 .316.04946.3357.05645l.0019.00067c.0461.01577.0846.03229.1092.04332.0514.02304.1015.04898.1449.07268.0896.04898.1957.11302.3102.18855.2291.15109.521.36725.8121.63689C14.247 3.49218 15 4.37 15 5.50003c0 1.12688-.7447 2.00396-1.2779 2.49995-.2531.23541-.5075.43043-.7221.57742V10h5c.5523 0 1 .4477 1 1v3h-4c-.0568 0-.1125.0048-.1667.0139-.0542-.0091-.1099-.0139-.1667-.0139H5v-3c0-.5523.44772-1 1-1h5V8.57622c-.2139-.14666-.4676-.34115-.7202-.57589C9.74664 7.50489 9 6.62764 9 5.50003c0-1.13003.753-2.00785 1.286-2.50144.2911-.26964.583-.4858.8121-.63689.1145-.07553.2206-.13957.3102-.18855.0434-.0237.0935-.04964.1449-.07268.0246-.01103.0631-.02755.1092-.04332l.0019-.00067ZM4 17.8377V21c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2.8243c-.0609.0534-.1248.1054-.1917.1556-.56.42-1.274.6687-2.1416.6687-.8677 0-1.5817-.2487-2.1417-.6687-.281-.2108-.5081-.4531-.6917-.7045-.1835.2514-.4106.4937-.6917.7045-.5599.42-1.2739.6687-2.1416.6687-.8677 0-1.5817-.2487-2.14169-.6687-.20142-.1511-.37514-.3184-.52499-.4936-.14984.1752-.32356.3425-.52499.4936-.55999.42-1.27398.6687-2.14166.6687s-1.58168-.2487-2.14167-.6687c-.20143-.1511-.37515-.3184-.525-.4936ZM5.2078 16c.0124.0314.0255.0628.03934.0939.11841.2664.27553.4856.47786.6374.19001.1425.47602.2687.94167.2687s.75165-.1262.94166-.2687c.20234-.1518.35945-.371.47786-.6374.01384-.0311.02694-.0625.03934-.0939H5.2078Zm5.3727.0939c-.0139-.0311-.027-.0625-.0394-.0939h2.9177c-.0124.0314-.0255.0628-.0393.0939-.1184.2664-.2755.4856-.4779.6374-.19.1425-.476.2687-.9416.2687-.4657 0-.7517-.1262-.9417-.2687-.2023-.1518-.3594-.371-.4778-.6374Zm5.6666 0c-.0138-.0311-.0269-.0625-.0393-.0939h2.9177c-.0124.0314-.0255.0628-.0393.0939-.1184.2664-.2755.4856-.4779.6374-.19.1425-.476.2687-.9416.2687-.4657 0-.7517-.1262-.9417-.2687-.2023-.1518-.3594-.371-.4779-.6374Z"})],-1),t.createElementVNode("span",{class:"label-md"},"Hoje",-1)])),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost nav",onClick:a[3]||(a[3]=o=>n.$emit("next")),"aria-label":"Próximo mês"},a[11]||(a[11]=[t.createElementVNode("span",{class:"label-md"},"Próximo",-1),t.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[t.createElementVNode("path",{fill:"currentColor",d:"M8 19l6.5-7L8 5l-1.5 1.3L11.7 12 6.5 17.7z"})],-1)]))]),t.createElementVNode("h2",{class:"month-title",title:`${e.month} ${e.year}`},t.toDisplayString(e.month)+" "+t.toDisplayString(e.year),9,Y2),t.createElementVNode("div",Z2,[t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost filter-btn",title:"Filtro de eventos",onClick:a[4]||(a[4]=o=>n.$emit("open-filter",o))},[a[12]||(a[12]=t.createElementVNode("svg",{class:"icon-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{d:"M5.05 3C3.291 3 2.352 5.024 3.51 6.317l5.422 6.059v4.874c0 .472.227.917.613 1.2l3.069 2.25c1.01.742 2.454.036 2.454-1.2v-7.124l5.422-6.059C21.647 5.024 20.708 3 18.95 3H5.05Z"})],-1)),e.filterCount>0?(t.openBlock(),t.createElementBlock("span",{key:0,class:"filter-badge",title:`${e.filterCount} filtro${e.filterCount>1?"s":""} ativo${e.filterCount>1?"s":""}`},t.toDisplayString(e.filterCount),9,X2)):t.createCommentVNode("",!0)]),t.createElementVNode("div",K2,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button cyber-button--sm btn-ghost",e.viewMode==="calendar"?"is-active":""]),onClick:a[5]||(a[5]=o=>n.$emit("set-view-mode","calendar")),"aria-label":"Visão Calendário"},a[13]||(a[13]=[t.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M5 5a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1h1a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1h1a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1 2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a2 2 0 0 1 2-2ZM3 19v-7a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z","clip-rule":"evenodd"})],-1),t.createElementVNode("span",{class:"label-lg"},"Calendário",-1)]),2),t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button cyber-button--sm btn-ghost",e.viewMode==="agenda"?"is-active":""]),onClick:a[6]||(a[6]=o=>n.$emit("set-view-mode","agenda")),"aria-label":"Visão Agenda"},a[14]||(a[14]=[t.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M11 4.717c-2.286-.58-4.16-.756-7.045-.71A1.99 1.99 0 0 0 2 6v11c0 1.133.934 2.022 2.044 2.007 2.759-.38 4.5-.182 6.956.449V4.717Zm2 15.081c2.456-.631 4.198-.829 6.956-.791A2.013 2.013 0 0 0 22 16.999V6a1.99 1.99 0 0 0-1.955-1.993c-2.885-.046-4.76.13-7.045.71v15.081Z","clip-rule":"evenodd"})],-1),t.createElementVNode("span",{class:"label-lg"},"Agenda",-1)]),2)]),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm show-lg btn-ghost",onClick:a[7]||(a[7]=o=>n.$emit("toggle-compact")),"aria-pressed":e.isCompact,title:e.isCompact?"Sair do modo compacto":"Ativar modo compacto"},[e.isCompact?(t.openBlock(),t.createElementBlock("svg",ec,a[16]||(a[16]=[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 4H4m0 0v4m0-4 5 5m7-5h4m0 0v4m0-4-5 5M8 20H4m0 0v-4m0 4 5-5m7 5h4m0 0v-4m0 4-5-5"},null,-1)]))):(t.openBlock(),t.createElementBlock("svg",J2,a[15]||(a[15]=[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8h4V4m12 4h-4V4M4 16h4v4m12-4h-4v4"},null,-1)])))],8,Q2)])]))}},[["__scopeId","data-v-37b625a5"]]),nc=["title"],ac={class:"week-header"},oc=Ae({__name:"WeekDays",props:{weekDays:{type:Array,default:()=>[]},month:String,year:[String,Number]},setup(e){return(n,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("h2",{class:"month-title",title:`${e.month} ${e.year}`},t.toDisplayString(e.month)+" "+t.toDisplayString(e.year),9,nc),t.createElementVNode("div",ac,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.weekDays,o=>(t.openBlock(),t.createElementBlock("div",{key:o,class:"week-cell"},t.toDisplayString(o),1))),128))])],64))}},[["__scopeId","data-v-756165d9"]]),rc=["onClick"],ic={key:0,class:"cell-today-indicator show-lg"},sc={class:"cell-top"},lc={class:"day-number"},cc={key:1,class:"more"},dc={class:"bars-wrap"},uc=4,fc=8,Zo=4,Xo=2,mc=1,hc=Ae({__name:"CalendarGrid",props:{startOffset:Number,monthDays:Array,viewDate:Date,isCompact:Boolean,isSameMonthFn:Function,isSelectedDayFn:Function,isTodayFn:Function,selectDayFn:Function,eventsByDayFn:Function,dayEventCountFn:Function,eventBarsToShowFn:Function,dayEventOverflowFn:Function},setup(e){const n=e,a=t.ref({}),o=new Map;function r(d){const g=(d==null?void 0:d.clientWidth)||0,y=(d==null?void 0:d.clientHeight)||0;if(!g||!y)return{cols:0,rows:0,widths:[],sum:0};const k=Math.max(0,Math.floor((g+Zo)/(uc+Zo))),x=Math.max(0,Math.floor((y+Xo)/(fc+Xo))),b=l(k,x),v=b.reduce((C,O)=>C+O,0);return{cols:k,rows:x,widths:b,sum:v}}function i(d,g){const y=r(g),k=a.value[d];(!k||k.cols!==y.cols||k.rows!==y.rows||k.sum!==y.sum)&&(a.value={...a.value,[d]:y})}function s(d,g){if(!g){const k=o.get(d);if(k&&(k.disconnect(),o.delete(d)),a.value[d]!=null){const x={...a.value};delete x[d],a.value=x}return}i(d,g);const y=new ResizeObserver(()=>i(d,g));y.observe(g),o.set(d,y)}t.onBeforeUnmount(()=>{o.forEach(d=>d.disconnect()),o.clear()});function l(d,g){if(d<=0||g<=0)return[];const y=[],k=.25;for(let x=0;x<g;x++){const b=x/Math.max(1,g-1),v=k+(1-k)*b,C=Math.max(1,Math.round(d*v));y.push(Math.min(C,d))}return y}function u(d,g){var v;const y=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,k=((v=a.value[d])==null?void 0:v.sum)??0;if(y<=k)return{bars:y,overflow:0};const x=Math.max(0,k-mc),b=Math.max(0,y-x);return{bars:x,overflow:b}}function m(d,g){const y=a.value[d];if(!y||y.rows===0||y.cols===0)return[];const{widths:k}=y,b=u(d,g).bars,v=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,b):[])||[],C=k.map(()=>[]);let O=0;for(let _=k.length-1;_>=0&&O<v.length;_--){const E=Math.min(k[_],v.length-O);C[_]=v.slice(O,O+E),O+=E}return C}const c=t.ref(null);function h(d){return d&&d.nodeType===1&&typeof d.getBoundingClientRect=="function"}function f(d){if(!h(d))return;const g=c.value,y=g&&h(g)?g:d.offsetParent;if(!h(y))return;let k,x;try{k=d.getBoundingClientRect(),x=y.getBoundingClientRect()}catch{return}const b=y.scrollLeft||0,v=y.scrollTop||0;d.style.position="absolute",d.style.zIndex="0",d.style.top=`${k.top-x.top+v}px`,d.style.left=`${k.left-x.left+b}px`,d.style.width=`${k.width}px`,d.style.height=`${k.height}px`,d.style.pointerEvents="none"}function p(d){!d||!d.style||requestAnimationFrame(()=>{!d||!d.style||(d.style.position="",d.style.zIndex="",d.style.top="",d.style.left="",d.style.width="",d.style.height="",d.style.pointerEvents="")})}return(d,g)=>(t.openBlock(),t.createBlock(t.TransitionGroup,{name:"cal-fade","move-class":"cal-move",tag:"div",class:"cal-grid calendar-grid",appear:"",ref_key:"gridRef",ref:c,onBeforeLeave:f,onAfterLeave:p},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.startOffset,y=>(t.openBlock(),t.createElementBlock("div",{key:"x"+y,class:"cal-cell day-empty bg-base-300 border border-base-100"}))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.monthDays,(y,k)=>(t.openBlock(),t.createElementBlock("div",{key:y.key,style:t.normalizeStyle({"--i":k}),class:t.normalizeClass(["cal-cell day-cell border border-base-100 bg-base-200 hover:bg-base-100",[e.isSameMonthFn(y.date,e.viewDate)?"":"opacity-60",e.isSelectedDayFn(y.date)?"neon-selected":"",e.isTodayFn(y.date)?"is-today":"",e.dayEventCountFn(y.date)>0?"has-events":""]]),onClick:x=>e.selectDayFn(y.date)},[e.isTodayFn(y.date)?(t.openBlock(),t.createElementBlock("div",ic," Hoje ")):t.createCommentVNode("",!0),t.createElementVNode("div",sc,[t.createElementVNode("span",lc,t.toDisplayString(y.date.getDate()),1)]),u(y.key,y.date).overflow>0?(t.openBlock(),t.createElementBlock("span",cc," +"+t.toDisplayString(u(y.key,y.date).overflow),1)):t.createCommentVNode("",!0),t.createElementVNode("div",dc,[t.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:x=>s(y.key,x)},[u(y.key,y.date).bars>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(m(y.key,y.date),(x,b)=>(t.openBlock(),t.createElementBlock("div",{key:"vrow"+b,class:"vrow"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(x,(v,C)=>(t.openBlock(),t.createElementBlock("span",{key:"vbar"+b+"-"+C,class:"vbar",style:t.normalizeStyle({background:t.unref(Sn)(v),boxShadow:`0 0 8px ${t.unref(Sn)(v)}70`})},null,4))),128))]))),128)):t.createCommentVNode("",!0)],512)])],14,rc))),128))]),_:1},512))}},[["__scopeId","data-v-26af06b5"]]),pc={class:"agenda-section"},gc={key:0,class:"empty-state"},yc={key:1,class:"day-list"},kc={class:"date-trail"},xc={class:"weekday-short"},bc={class:"date-pill bg-base-200 border border-base-300"},wc={class:"date-pill-month"},Ec={class:"date-pill-day"},vc={class:"content-col"},Cc={class:"day-header"},Sc={class:"agenda-title"},Bc={class:"month-header-text"},Mc={class:"events-list"},Vc=Ae({__name:"AgendaList",props:{days:{type:Array,default:()=>[]},weekdayLong:Function,weekdayShort:Function,monthShort:Function,monthLabelOf:Function,year:Number},emits:["open-chat","open-message","delete-message"],setup(e,{emit:n}){return(a,o)=>(t.openBlock(),t.createElementBlock("section",pc,[e.days.length===0?(t.openBlock(),t.createElementBlock("div",gc," Sem eventos neste mês. ")):(t.openBlock(),t.createElementBlock("ul",yc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.days,r=>{var i;return t.openBlock(),t.createElementBlock("li",{key:r.key,class:"day-item border-base-200"},[t.createElementVNode("div",kc,[t.createElementVNode("div",xc,t.toDisplayString(e.weekdayShort(r.date)),1),t.createElementVNode("div",bc,[t.createElementVNode("div",wc,t.toDisplayString(e.monthShort(r.date)),1),t.createElementVNode("div",Ec,t.toDisplayString(r.date.getDate()),1),t.createElementVNode("div",{style:t.normalizeStyle({background:t.unref(Sn)(((i=r.events)==null?void 0:i[0])||{})}),class:"date-pill-dot"},null,4)])]),t.createElementVNode("div",vc,[t.createElementVNode("div",Cc,[t.createElementVNode("h3",Sc,t.toDisplayString(e.weekdayLong(r.date).toUpperCase())+" "+t.toDisplayString(r.date.getDate()),1),t.createElementVNode("div",Bc,t.toDisplayString(e.monthLabelOf(r.date).toUpperCase())+" "+t.toDisplayString(e.year),1)]),t.createElementVNode("ul",Mc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.events,s=>(t.openBlock(),t.createElementBlock("li",{key:s.id,class:"event-item border border-base-100 bg-base-200 hover:bg-base-100"},[t.createVNode(fa,{ev:s,mode:"agenda",onOpenMessage:o[0]||(o[0]=l=>a.$emit("open-message",l)),onOpenChat:o[1]||(o[1]=l=>a.$emit("open-chat",l)),onDeleteMessage:o[2]||(o[2]=l=>a.$emit("delete-message",l))},null,8,["ev"])]))),128))])])])}),128))]))]))}},[["__scopeId","data-v-2c977f25"]]),Ac=["data-mode","data-empty"],Nc=["disabled"],Ko=Ae({__name:"EventsList",props:{loading:{type:Boolean,default:!1},selectedLabel:{type:String,default:""},selectedLabelLong:{type:String,default:""},events:{type:Array,default:()=>[]},mode:{type:String,default:"compact"}},emits:["reload","open-chat","open-message","delete-message"],setup(e){const n=e,a=t.computed(()=>n.mode==="compact"?n.selectedLabelLong||"Hoje":`Eventos em ${n.selectedLabel||"—"}`);return(o,r)=>(t.openBlock(),t.createElementBlock("section",{class:t.normalizeClass(["bg-base-300 daylist",[e.mode==="compact"?"daylist--compact has-border border-base-200":"daylist--sidebar has-border border-base-200 supports-blur",{"daylist--tight":e.mode==="compact"&&!e.loading&&e.events.length===0}]]),"data-mode":e.mode,"data-empty":!e.loading&&e.events.length===0?"1":"0"},[t.createElementVNode("div",{class:t.normalizeClass(["daylist-header",e.mode==="compact"?"daylist-header--compact bg-base-300":"daylist-header--sidebar bg-base-300"])},[t.createElementVNode("h3",{class:t.normalizeClass(e.mode==="compact"?"daylist-title--compact":"daylist-title--sidebar")},t.toDisplayString(a.value),3),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:r[0]||(r[0]=i=>o.$emit("reload")),disabled:e.loading},t.toDisplayString(e.loading?"Atualizando…":"Atualizar"),9,Nc)],2),e.loading?(t.openBlock(),t.createBlock(t.Transition,{key:0,name:"fade"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["loading-text",e.mode==="compact"?"is-compact":"is-sidebar"])}," Carregando… ",2)]),_:1})):e.events.length===0?(t.openBlock(),t.createBlock(t.Transition,{key:1,name:"fade"},{default:t.withCtx(()=>r[4]||(r[4]=[t.createElementVNode("div",{class:"empty-text"},"Sem eventos.",-1)])),_:1,__:[4]})):(t.openBlock(),t.createBlock(t.TransitionGroup,{key:2,name:"list","move-class":"list-move",tag:"ul",appear:"",class:t.normalizeClass([e.mode==="compact"?"list-compact has-border border-base-300 bg-base-200 supports-blur":"list-sidebar"])},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.events,(i,s)=>(t.openBlock(),t.createElementBlock("li",{key:i.id,style:t.normalizeStyle({"--i":s}),class:t.normalizeClass(e.mode==="compact"?"item-compact hover:bg-base-100":"item-sidebar hover:z-10 has-border hover:bg-base-100 border-base-100 bg-base-200 ")},[t.createVNode(fa,{ev:i,mode:e.mode==="compact"?"compact":"sidebar",onOpenMessage:r[1]||(r[1]=l=>o.$emit("open-message",l)),onOpenChat:r[2]||(r[2]=l=>o.$emit("open-chat",l)),onDeleteMessage:r[3]||(r[3]=l=>o.$emit("delete-message",l))},null,8,["ev","mode"])],6))),128))]),_:1},8,["class"]))],10,Ac))}},[["__scopeId","data-v-4ecbf2a5"]]),Dc={class:"cpk-popover__header border-base-100"},Tc={class:"filter-body"},Fc={class:"row"},Lc=["checked"],Oc={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},Pc={class:"status-wrap"},$c={class:"seg"},_c=Ae({__name:"CalFilter",props:{open:{type:Boolean,default:!1},anchorEl:{type:[HTMLElement,Object],default:null},offset:{type:Number,default:8},align:{type:String,default:"center"},filters:{type:Object,default:()=>({})}},emits:["close","update:filters"],setup(e,{emit:n}){const a=e,o=n,r=Rt(),i=t.computed(()=>r.attendants.find(E=>E.is_me)||null),s=t.reactive({onlyMine:!1,status:null});t.watch(()=>a.open,async E=>{var D,P,T;if(!E)return;await t.nextTick();const w=(D=i.value)!=null&&D.id?String(i.value.id):null;s.onlyMine=!!w&&String(((P=a.filters)==null?void 0:P.scheduled_by)??"")===w;const R=(T=a.filters)==null?void 0:T.status;s.status=R===!0||R===!1?R:null,y()},{immediate:!1});function l(E,w){if(!E)return{};const{[w]:R,...D}=E;return D}function u(E){var R;s.onlyMine=!!E.target.checked;const w=(R=i.value)!=null&&R.id?String(i.value.id):null;s.onlyMine&&w?o("update:filters",{...a.filters,scheduled_by:w}):o("update:filters",l(a.filters,"scheduled_by"))}function m(E){if(s.status===E){s.status=null;const w=l(a.filters,"status");o("update:filters",w)}else s.status=E,o("update:filters",{...a.filters,status:E})}const c=t.ref(null),h=t.ref({left:0,top:0,placed:"bottom"}),f=t.computed(()=>({position:"fixed",left:`${h.value.left}px`,top:`${h.value.top}px`}));function p(){const E=a.anchorEl instanceof Element?a.anchorEl:null;if(E!=null&&E.getBoundingClientRect)return E.getBoundingClientRect();const w=window.innerWidth/2,R=window.innerHeight/3;return{left:w,right:w,top:R,bottom:R,width:0,height:0}}function d(E,w,R,D){return{left:Math.max(8,Math.min(E,window.innerWidth-R-8)),top:Math.max(8,Math.min(w,window.innerHeight-D-8))}}function g(){const E=p(),w=c.value,R=(w==null?void 0:w.offsetWidth)??300,D=(w==null?void 0:w.offsetHeight)??220;let P=E.bottom+a.offset,T;if(a.align==="center"?T=E.left+E.width/2-R/2:a.align==="end"?T=E.right-R:T=E.left,P+D>window.innerHeight-4){const z=E.top-D-a.offset;z>=4?(P=z,h.value.placed="top"):h.value.placed="bottom"}else h.value.placed="bottom";const A=d(T,P,R,D);h.value={left:A.left,top:A.top,placed:h.value.placed}}function y(){g(),requestAnimationFrame(g)}let k,x,b=[];function v(){C(),b=[window];const E=a.anchorEl instanceof Element?a.anchorEl:null;let w=E==null?void 0:E.parentElement;for(;w&&w!==document.body;){const R=getComputedStyle(w);/(auto|scroll)/.test(R.overflow+R.overflowY+R.overflowX)&&b.push(w),w=w.parentElement}b.forEach(R=>R.addEventListener("scroll",y,{passive:!0}))}function C(){b.forEach(E=>{var w;return(w=E.removeEventListener)==null?void 0:w.call(E,"scroll",y)}),b=[]}t.watch(()=>a.open,async E=>{var R,D,P,T;if(!E){C(),(R=k==null?void 0:k.disconnect)==null||R.call(k),(D=x==null?void 0:x.disconnect)==null||D.call(x);return}await t.nextTick(),y(),v(),(P=k==null?void 0:k.disconnect)==null||P.call(k),k=new ResizeObserver(y),k.observe(document.body),(T=x==null?void 0:x.disconnect)==null||T.call(x);const w=a.anchorEl instanceof Element?a.anchorEl:null;w&&(x=new ResizeObserver(y),x.observe(w)),window.addEventListener("resize",y)}),t.watch(()=>a.anchorEl,async()=>{a.open&&(await t.nextTick(),v(),y())});function O(E){E.key==="Escape"&&o("close")}function _(E){if(!a.open)return;const w=E.target,R=c.value;if(R&&R.contains(w))return;const D=a.anchorEl instanceof Element?a.anchorEl:null;D&&D.contains&&D.contains(w)||o("close")}return t.onMounted(()=>{document.addEventListener("pointerdown",_,!0),window.addEventListener("keydown",O)}),t.onBeforeUnmount(()=>{var E,w;document.removeEventListener("pointerdown",_,!0),window.removeEventListener("keydown",O),C(),(E=k==null?void 0:k.disconnect)==null||E.call(k),(w=x==null?void 0:x.disconnect)==null||w.call(x)}),(E,w)=>(t.openBlock(),t.createBlock(t.Transition,{name:"cpk-layer",appear:""},{default:t.withCtx(()=>[e.open?(t.openBlock(),t.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:w[4]||(w[4]=t.withModifiers(R=>E.$emit("close"),["self"]))},[t.createVNode(t.Transition,{name:"cpk-card",appear:""},{default:t.withCtx(()=>[t.createElementVNode("div",{ref_key:"card",ref:c,class:"cpk-popover bg-base-300",style:t.normalizeStyle(f.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[t.createElementVNode("div",Dc,[w[5]||(w[5]=t.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),w[6]||(w[6]=t.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),t.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:w[0]||(w[0]=R=>E.$emit("close")),"aria-label":"Fechar"}," × ")]),t.createElementVNode("div",Tc,[t.createElementVNode("label",Fc,[t.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:w[1]||(w[1]=R=>u(R)),"aria-label":"Exibir somente meus eventos"},null,40,Lc),w[7]||(w[7]=t.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),t.createElementVNode("div",Oc,[w[9]||(w[9]=t.createElementVNode("span",{class:"status-icon","aria-hidden":"true"},[t.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a1 1 0 0 1 .932.638l7 18a1 1 0 0 1-1.326 1.281L13 19.517V13a1 1 0 1 0-2 0v6.517l-5.606 2.402a1 1 0 0 1-1.326-1.281l7-18A1 1 0 0 1 12 2Z","clip-rule":"evenodd"})])],-1)),t.createElementVNode("div",Pc,[w[8]||(w[8]=t.createElementVNode("div",{class:"label-cpk"},[t.createTextVNode(" Status "),t.createElementVNode("span",{class:"sched-pop",tabindex:"0","aria-label":"Ajuda sobre status"},[t.createElementVNode("span",{class:"sched-pop__mark"},[t.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.008-3.018a1.502 1.502 0 0 1 2.522 1.159v.024a1.44 1.44 0 0 1-1.493 1.418 1 1 0 0 0-1.037.999V14a1 1 0 1 0 2 0v-.539a3.44 3.44 0 0 0 2.529-3.256 3.502 3.502 0 0 0-7-.255 1 1 0 0 0 2 .076c.014-.398.187-.774.48-1.044Zm.982 7.026a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2h-.01Z","clip-rule":"evenodd"})])]),t.createElementVNode("div",{class:"sched-pop__card bg-base-300",style:{"--popover-brd":"var(--cyber-border)",transform:"translate(-5%, -50%) scale(0.98)"}},[t.createElementVNode("div",null,[t.createElementVNode("span",{style:{"font-weight":"600"}},"Ativos:"),t.createTextVNode(" Eventos que estão programados para ocorrer ")]),t.createElementVNode("div",null,[t.createElementVNode("span",{style:{"font-weight":"600"}},"Executados:"),t.createTextVNode(" Eventos que já ocorreram ")])])])],-1)),t.createElementVNode("div",$c,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:w[2]||(w[2]=R=>m(!0)),"aria-pressed":"state.status === true"}," Ativos ",2),t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!1?"is-active":""]),onClick:w[3]||(w[3]=R=>m(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):t.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-0aad9d42"]]),Rc={class:"calendar-content"},Hc={class:"calendar-stage-main"},zc={key:0},Qo=Ae({__name:"scheduledCalendar",props:{sourceUrl:{type:String,default:"/crm_scheduled"},initialDate:{type:[String,Date],default:()=>new Date}},emits:["open-chat","loaded","open-message","close-page"],setup(e,{expose:n,emit:a}){const o=e,r=Yo();r.setBaseUrl(o.sourceUrl);const i=new Date,s=t.ref(m(o.initialDate)),l=t.ref(new Date(i.getFullYear(),i.getMonth(),i.getDate())),u=t.ref("calendar");function m(L){if(L instanceof Date)return new Date(L.getFullYear(),L.getMonth(),1);if(typeof L=="string"){const[K,ae]=L.split("-").map(ce=>parseInt(ce,10));return new Date(K||i.getFullYear(),(ae||i.getMonth()+1)-1,1)}return new Date(i.getFullYear(),i.getMonth(),1)}function c(L){return new Date(L.getFullYear(),L.getMonth()+1,0).getDate()}function h(L){return new Date(L.getFullYear(),L.getMonth(),1).getDay()}function f(L,K){return L.getFullYear()===K.getFullYear()&&L.getMonth()===K.getMonth()}function p(L){return da(L,i)}function d(L){return da(L,l.value)}function g(L){l.value=new Date(L.getFullYear(),L.getMonth(),L.getDate()),f(L,s.value)||(s.value=new Date(L.getFullYear(),L.getMonth(),1))}function y(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function k(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function x(){s.value=new Date(i.getFullYear(),i.getMonth(),1),l.value=new Date(i.getFullYear(),i.getMonth(),i.getDate())}const b=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],v=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],C=t.computed(()=>A(b[s.value.getMonth()])),O=t.computed(()=>s.value.getFullYear()),_=t.computed(()=>w(l.value)),E=t.computed(()=>`${R(l.value)} ${l.value.getDate()}`);function w(L){return`${String(L.getDate()).padStart(2,"0")}/${String(L.getMonth()+1).padStart(2,"0")}/${L.getFullYear()}`}function R(L){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][L.getDay()]}function D(L){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][L.getDay()]}function P(L){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][L.getMonth()]}function T(L){return b[L.getMonth()]}function A(L){return L.charAt(0).toUpperCase()+L.slice(1)}const z=t.computed(()=>h(s.value)),ie=t.computed(()=>{const L=c(s.value);return Array.from({length:L},(K,ae)=>{const ce=ae+1,Ee=new Date(s.value.getFullYear(),s.value.getMonth(),ce);return{key:`d${ce}`,date:Ee}})}),ee=t.ref({open:!1,anchorEl:null});function pe(L){ee.value.open=!0,ee.value.anchorEl=(L==null?void 0:L.currentTarget)||null}const{filters:V}=Mt.storeToRefs(r),M=t.computed(()=>_t(s.value)),j=t.computed(()=>r.eventsOf(M.value)),re={scheduled_by:L=>{var ce,Ee,ye;const K=(L==null?void 0:L.scheduled_by)??((Ee=(ce=L==null?void 0:L.raw)==null?void 0:ce.params)==null?void 0:Ee.scheduled_by)??((ye=L==null?void 0:L.raw)==null?void 0:ye.scheduled_by)??(L==null?void 0:L.created_by)??(L==null?void 0:L.attendant_id),ae=typeof K=="object"&&K?K.id??K.attendant_id:K;return ae!=null?String(ae):""}};function se(L,K){const ae=(K==null?void 0:K.value)??K;return!ae||typeof ae!="object"?!0:Object.entries(ae).every(([ce,Ee])=>{var q,Y,me;if(Ee==null||Ee===""||Array.isArray(Ee)&&Ee.length===0)return!0;const ye=re[ce],B=(ye==null?void 0:ye(L))??(L==null?void 0:L[ce])??((q=L==null?void 0:L.raw)==null?void 0:q[ce])??((me=(Y=L==null?void 0:L.raw)==null?void 0:Y.params)==null?void 0:me[ce])??null,F=typeof B=="string"?B:B??"";if(typeof Ee=="function")return!!Ee(F,L);if(Array.isArray(Ee))return Ee.map(String).includes(String(F));if(typeof Ee=="object"){const{in:te,notIn:oe,range:ue,contains:$}=Ee;if(te&&!te.map(String).includes(String(F))||oe&&oe.map(String).includes(String(F)))return!1;if(ue&&typeof F=="number"){const[Z,le]=ue;if(Z!=null&&F<Z||le!=null&&F>le)return!1}if($!=null){const Z=Array.isArray(F)?F:String(F).split(",");if(!(Array.isArray($)?$:[$]).some(xe=>Z.map(String).includes(String(xe))))return!1}return!0}return String(F)===String(Ee)})}const be=t.computed(()=>(j.value||[]).filter(K=>se(K,V)));function Ce(L){return be.value.filter(K=>da(K.date,L))}const Le=t.computed(()=>Ce(l.value)),Oe=t.computed(()=>[...Le.value].sort((L,K)=>L.date-K.date));function Be(L){return Ce(L).length}function G(L){return Math.min(3,Be(L))}function ne(L){const K=Be(L);return K>3?K-3:0}const Q=t.computed(()=>{const L=s.value.getFullYear(),K=s.value.getMonth(),ae=new Map;for(const Ee of be.value){const ye=Ee==null?void 0:Ee.date;if(!(ye instanceof Date)||ye.getFullYear()!==L||ye.getMonth()!==K)continue;const B=`${L}-${K+1}-${ye.getDate()}`;ae.has(B)||ae.set(B,{key:`ag-${B}`,date:new Date(L,K,ye.getDate()),events:[]}),ae.get(B).events.push(Ee)}const ce=Array.from(ae.values());for(const Ee of ce)Ee.events.sort((ye,B)=>ye.date-B.date);return ce.sort((Ee,ye)=>Ee.date-ye.date),ce}),S=t.ref(!1),N=t.ref(!1),I=t.computed(()=>N.value||S.value),H=t.computed(()=>I?"calendar-stage--compact":"calendar-stage--single");function X(){var ae;const L=window.matchMedia("(max-width: 1280px)"),K=()=>N.value=L.matches;K(),(ae=L.addEventListener)==null||ae.call(L,"change",K)}const U=t.computed(()=>r.isLoading(M.value));t.computed(()=>r.errorOf(M.value));const J=t.ref({open:!1,loading:!1,context:null,title:"Confirmar exclusão",description:"Tem certeza que deseja apagar este item?",destructive:!0,anchorEl:null,confirmLabel:"Apagar",cancelLabel:"Cancelar",loadingLabel:"Apagando…"});function de(L,K){J.value.open=!0,J.value.context={action:"delete-message",event:L},J.value.title="Confirmar exclusão",J.value.description="Tem certeza que deseja apagar este evento?",J.value.anchorEl=K&&K.currentTarget||typeof document<"u"&&document.activeElement||null,J.value.destructive=!0,J.value.confirmLabel="Apagar",J.value.loadingLabel="Apagando…"}async function we(L){if(L)try{J.value.loading=!0,L.action==="delete-message"&&await ge(L.event)}finally{J.value.loading=!1,J.value.open=!1,J.value.context=null}}function ke(){J.value.open=!1,J.value.context=null}async function he(){await r.forceReload(M.value)}async function ge(L){var K;try{L.deleteLoading=!0;const ae=((K=L==null?void 0:L.raw)==null?void 0:K.id)??(L==null?void 0:L.id)??L;if(ae==null)throw new Error("Evento inválido para exclusão");const ce=await e2(ts,L);return ce!=null&&ce.ok&&(r.removeFromCache(String(ae))||await r.forceReload(M.value)),ce}catch(ae){return console.error(ae),null}finally{L.deleteLoading=!1}}return t.onMounted(async()=>{if(X(),await r.ensureMonthLoaded(M.value),!Ce(l.value).length&&be.value.length){const L=be.value[0];l.value=new Date(L.date.getFullYear(),L.date.getMonth(),L.date.getDate())}}),t.watch(()=>o.sourceUrl,async L=>{if(r.setBaseUrl(L),r.resetAll(),await r.ensureMonthLoaded(M.value),!Ce(l.value).length&&be.value.length){const K=be.value[0];l.value=new Date(K.date.getFullYear(),K.date.getMonth(),K.date.getDate())}}),t.watch(M,async()=>{const L=s.value.getFullYear(),K=s.value.getMonth(),ae=Math.min(l.value.getDate(),c(s.value));if(l.value=new Date(L,K,ae),await r.ensureMonthLoaded(M.value),!Ce(l.value).length&&be.value.length){const ce=be.value[0];l.value=new Date(ce.date.getFullYear(),ce.date.getMonth(),ce.date.getDate())}}),n({updateEvent:r.applyUpdateToCache}),(L,K)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:t.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":I.value}])},[t.createElementVNode("div",Rc,[K[15]||(K[15]=t.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),t.createVNode(tc,{month:C.value,year:O.value,"is-compact":I.value,"view-mode":u.value,"filter-count":Object.keys(t.unref(V)).length,onPrev:y,onNext:k,onToday:x,onToggleCompact:K[0]||(K[0]=ae=>S.value=!S.value),onSetViewMode:K[1]||(K[1]=ae=>u.value=ae),onClosePage:K[2]||(K[2]=ae=>L.$emit("close-page")),onOpenFilter:pe},null,8,["month","year","is-compact","view-mode","filter-count"]),u.value==="calendar"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["calendar-stage",H.value])},[t.createElementVNode("div",Hc,[t.createVNode(oc,{"week-days":v,month:C.value,year:O.value},null,8,["month","year"]),t.createVNode(hc,{"start-offset":z.value,"month-days":ie.value,"view-date":s.value,"is-compact":I.value,"is-same-month-fn":f,"is-selected-day-fn":d,"is-today-fn":p,"select-day-fn":g,"events-by-day-fn":Ce,"day-event-count-fn":Be,"event-bars-to-show-fn":G,"day-event-overflow-fn":ne},null,8,["start-offset","month-days","view-date","is-compact"])]),I.value?(t.openBlock(),t.createBlock(Ko,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:U.value,"selected-label-long":E.value,events:Oe.value,mode:"compact",onReload:he,onOpenChat:K[3]||(K[3]=ae=>L.$emit("open-chat",ae)),onOpenMessage:K[4]||(K[4]=ae=>L.$emit("open-message",ae)),onDeleteMessage:K[5]||(K[5]=(ae,ce)=>de(ae,ce))},null,8,["loading","selected-label-long","events"])):t.createCommentVNode("",!0)],2)):(t.openBlock(),t.createBlock(Vc,{key:1,days:Q.value,"weekday-long":R,"weekday-short":D,"month-short":P,"month-label-of":T,year:O.value,onOpenChat:K[6]||(K[6]=ae=>L.$emit("open-chat",ae)),onOpenMessage:K[7]||(K[7]=ae=>L.$emit("open-message",ae)),onDeleteMessage:K[8]||(K[8]=(ae,ce)=>de(ae,ce))},null,8,["days","year"]))]),t.createVNode(Ko,{class:"calendar-daylist calendar-daylist--desktop",loading:U.value,"selected-label":_.value,"selected-label-long":E.value,events:Oe.value,mode:I.value?"compact":"sidebar",onReload:he,onOpenChat:K[9]||(K[9]=ae=>L.$emit("open-chat",ae)),onOpenMessage:K[10]||(K[10]=ae=>L.$emit("open-message",ae)),onDeleteMessage:K[11]||(K[11]=(ae,ce)=>de(ae,ce))},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),t.createVNode(zs,{modelValue:J.value.open,"onUpdate:modelValue":K[12]||(K[12]=ae=>J.value.open=ae),title:J.value.title,description:J.value.description,destructive:J.value.destructive,"confirm-label":J.value.confirmLabel,"cancel-label":J.value.cancelLabel,loading:J.value.loading,"loading-label":J.value.loadingLabel,context:J.value.context,"anchor-el":J.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:we,onCancel:ke},{details:t.withCtx(()=>{var ae;return[(ae=J.value.context)!=null&&ae.event?(t.openBlock(),t.createElementBlock("div",zc,[t.createVNode(fa,{"view-only":!0,mode:"sidebar",ev:J.value.context.event},null,8,["ev"])])):t.createCommentVNode("",!0)]}),_:1},8,["modelValue","title","description","destructive","confirm-label","cancel-label","loading","loading-label","context","anchor-el"]),t.createVNode(_c,{open:ee.value.open,"anchor-el":ee.value.anchorEl,filters:t.unref(V),"onUpdate:filters":K[13]||(K[13]=ae=>t.isRef(V)?V.value=ae:null),onClose:K[14]||(K[14]=ae=>ee.value.open=!1)},null,8,["open","anchor-el","filters"])],64))}},[["__scopeId","data-v-9c3b18ef"]]),jc={class:"flex flex-col text-center"},Gc={class:"flex flex-col space-y-3 justify-center"},Ic={class:"space-x-4 flex-col text-black justify-center"},qc=["onUpdate:modelValue","onInput","onKeydown"],Jo={__name:"mfa",props:{eventHandling:{type:String,default:null}},emits:["filled","reset"],setup(e,{emit:n}){t.onMounted(()=>{r.value[0].focus()});const a=n,o=t.ref(Array(6).fill("")),r=t.ref([]);t.ref(!1);const i=m=>{const c=o.value[m];o.value[0]<1&&a("reset"),/^\d$/.test(c)?s(m):o.value[m]="",m===o.value.length-1&&o.value.every(h=>h!=="")&&u()},s=m=>{m<o.value.length-1&&o.value[m]&&r.value[m+1].focus()},l=(m,c)=>{c.key==="Backspace"&&!o.value[m]&&m>0&&r.value[m-1].focus()},u=()=>{const m=o.value.join("");a("filled",m)};return(m,c)=>(t.openBlock(),t.createElementBlock("section",jc,[t.createElementVNode("div",Gc,[t.createElementVNode("div",Ic,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,(h,f)=>t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:f,"onUpdate:modelValue":p=>o.value[f]=p,class:t.normalizeClass([e.eventHandling==="check"?"checked_mfa":e.eventHandling==="err"?"err_mfa":"reset_input","inline-block w-10 h-10 rounded-md text-center"]),type:"text",maxlength:"1",onInput:p=>i(f),onKeydown:t.withKeys(p=>l(f,p),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,qc)),[[t.vModelText,o.value[f]]])),128))])])]))}},Wc={class:"text-center flex gap-3"},Uc={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},Yc={key:0,class:"items-center justify-center inline-flex"},Zc=["src"],Xc={__name:"mfaQrCode",props:{base64:{type:String,default:""},dimensions:{type:Array,default:null},loading:{type:Boolean,default:!1},generated:{type:Boolean,default:!1}},emits:["generateQR"],setup(e,{emit:n}){const a=n;t.ref(!1);const o=e,r=()=>{a("generateQR")},i=t.computed(()=>o.base64?o.base64:l.value),s=t.computed(()=>`w-${o.dimensions[0]} h-${o.dimensions[1]}`),l=t.ref("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAARGUlEQVR42u3dsZLbxhKFYejGpAOp9Jb7ACo9gMqx9JYbKOA6pwNfuly2yJ5lz5nuA/xfFSILwGAwanuxxz0frtfrdQMAA/+rHgAAjKJgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2GhTsD59+rR9+PBht0fkx48f2/l8/s955/N5+/HjR/XruTu+6Bgdv/r51dc/+vpd5cP1er1WD2Lb/nrhP3/+rB6GTDTN5/N5++OPP375z06n0/b29lY6/kfji4yMX/386usfff2uQsFaJJrm6N9i1a8p+2/Z6udXX//o63eVNj8SAkCEggXABgULgA0KFkIzPvhH1zidTk/9s07PCD0KFh56e3vbvnz5kr7O169fHxaFb9++/bIwnU6n7ffff5c/ZzQ+NHFt4uPHj9dt2+4er6+v1UNMjT/y6NwZr+n79+/X0+kU3mf1cTqdrt+/f396/KPnq8d39PW7ik2s4fX1dfv8+XP1MJ8efzTN6l+7Z3JUaityWplYxsj1j75+V+FHwoPoWqxGx/boz6ifrfPcHQ0FC4ANChYAGxQsADYoWCayv3JfkWVSjq06p4UeKFgmsjmhezmnaqM5q+qcFpqozlXcZHMsmyAjtL0jh6LOYd07RnNC91wul+vLy0t4n5eXl+vlcpl+/irV73/v63eV3eSw1E3GomlS57AeyfZzent723777beHf+ZyuWzn81ly/grq9jhHX7+r8CPhDmRzQiOF5NGfyZ4PjKJgAbBBwQJgg4IFwAYFayeqW6N0z0l1GAPyKFg7Ud3PqXtOqmsODe9Unau4OXqORTXuWf2i1FT9uqLnH82RZd//3tfvKuSwBkXTVJnDiszoF6VeJsp+XdHzj+TIsu9/7+t3FX4kPACHfk7KMUbXJiPmg4IFwAYFC4ANChYAGxSsJo7+K/fq5++eI8NfKFhNHD0nVP383XNk+L/qXMUNOZZfG80JZcefPb/KrBxVFut3Df4Lq7nz+bx9+/atehhtMT/HQsEyQE7oMebnOChYAGxQsADYoGABsEHBMrCibYx7Dsl9/BhDwWru7e1t+/Lli/w+7jkk9/FjUHWu4iabY6mWzbGo+kGN3r+7e/OT3Zdx1vWPvn5X2U0/rGrZfkLKflAj9+/u0fxk92Wccf2jr99V+JGwCYeeVZUezc+MuVNfH3NQsADYoGABsEHBAmCDggUL5KywbRQsmCBnhW3b+gQsohyI+xGJzn95ebleLpf/nDerH1Q2h+R+fnb+jr5+V7HJYbmLpjnal+5yudxtozJjX71sDsn9/Oy+jEdfv6tQsBbJFizO733+0dfvKnzDAmCDggXABgULgA0KVhPqnFH00Tl7/8z5M/p9VY4f61CwmlDnjL5+/fqwMGTv/+z5s/p9VY0fi1XnKjDH9mS+pjonNXpkqftpYY02sQbkRL+Wf6Q6JzUiu0zV/bSwBgVrJzIFa9vqc07Z8UWy40cPfMMCYIOCBcAGBQuADQoWynNSanxQ3w8K1sFV56TUVu3riEWqcxU3z+Z01PvSZY9VOZ9oHPf6ac16/mep+3mpxz+qOsfWff2OahNryOR01PvSZa3I+WT6ac14/swyUvfzUo9/RHWOLaNTTq1Nweqe08lST/PRc1LV4+/+fFlNygTfsAD4oGABsEHBAmBjFwUr++ty9QfFFb/OV/aDGpGdw+rxqzk/X6e5tS9Y2X5F6pzOqn5Kqn5Qo6J+W93Hr+b6fO36gVXnKm624hxR9ojGF+nar2k0J3XvcBl/xP39ZNdnFzaxBnWOKCsaX6Rzv6aRnNQjDuOP/hq4v5/s+uzCpmBFw3TPqXTv19Q955Qdf3Z9uT+fC/tvWACOg4IFwAYFC4ANCtYk1TkktcwYqsffYd/D7s/ngoI1SXUOSe3ZHFD1+Lvse9j9+WxU5yputmROJjq/66Huh1SdE1o1/up+WNU5wOzzdc2Z/RuxhgbU/ZCqc0Irxl/dD6s6B5h9vs45s3+iYDWhfr7q11y9b2L2+urnU8vOX/X6ueEbFgAbFCwANihYAGy0KVjO/YK66zA36hxX535e1bLz1+nZ2hQs135B3VXnhG7UOa6u/byqZeevy/r5W3WuYtSzOZFsP6fR416/oVn9mJ69v3p+Z53f9f1X55CO1u8q0ibWEMnkRLL9nEY86jc0ox9Ttl9YRLlvnnrfSPX7r84hHanfVcSmYHXPaWXvrz4/cvTxRar/mrjkpNTafMMCgAgFC4ANChYAGxYFq8v/eHnPipyLOieTuf6K91M5vo5xhdnP6KJ9were72dVzkWdk3n2+qveT9X42uWQ7sjmyGxU5ypu1P2Mnr3uNphz2WuOadX7UT3fXt5vdv3eO6pzZu/VJtag7meU/bV2Zl9E9xxTdP4I9TLLjq/7+1XGcqpzZu/RpmC590six/SYepnt/f1W5wi7aP8NCwBuKFgAbFCwANhoU7Dc+yWpc1LV+x5235ewcv2seL/KOXTImd20KVju/ZLUOanqfQ+770tYtX5WvV9Vvy2XnNnfqnMVs7j3S3r2/rPG1z0H5k71/o7WL6tNrCHLvV9Sdc6mew7MXeb9zli/e+mXtZuCVZ1zyU5jdc6mew7MXfecmIs237AAIELBAmCDggXAxmEKVvTRMqN6T7zs+Ebunxnj3j+oj1CuEfX76+QwBetezqW6X5K6n9SsflHP5sC69zNbRZUDVL+/dqpzFbNsohzTNphjyfZjyt4/oh5f9sh69vmqc2ar9s1UP/8qh4k1ZGX6Ja24f0Q9vqzsMsw8X3XObMW+mernX4WCNSiapur7R9Tjc38+9f2r14/6+Vc5zDcsAP4oWABsULAA2NhNwaruF9S5p1D3D6odcmzO/caOZDcFq7pfkOr+Wd1zUF1ybK79xg6nOldxo+qX1L1f0Oj4np2/0ePe83eZv6ocmVtO6d9mra8u2sQalP2SuvcLGhlf9JqU+/J1mL/KHJlTTulXZqyvLtoUrKP3Y6rO8WSvr54/cko51e9vlt18wwKwfxQsADYoWABstClY6n3f1NfPmPFBV7kvX/UH5+r7V6+PrOr5m6lNwVLv+6a+/rNm5YhU+/JV57iq71+9PrKq52+66lzFqOp+R6rxjR7dx199/+zxbL8zdT+tVYeLNrGGSHW/I+X4RqhfU3b82fFV9+vK9DtT99NawaQM9MlhhQMt7nekHp/7+LPj656zqs4JVj9/F22+YQFAhIIFwAYFC4ANi4LVod9RpLofV/U9qvd2VN9bmePbU05KrX3B6tLvKFLdj6t6/Kp+UmrZflVd+nkdRnWu4qY6h3Lv6NKPqyqHlt03z6WfVPecVbZfWXS4aBNrqM6hPNKhH1dlDi27b55DP6nuOatsv7JIkzIQalOwqnMokew0de93lR2/+v5q3XNW3dfHKu2/YQHADQULgA0KFgAbbQpW955D2Y/W2T9TPT/KflsdVPZjG/FofTjkFGdpU7C678v2bM5oNGcTXb96flT9trqo6sc26t76cMkpTlOdq8jK5pxm5VhUR5QD2su+c9kclDpHpbq/+/pbrU2sISObc5qRY1GKckB72Hcum4NS56iU43dffyvtomBtW33OSS07/u6vWf3+1M9/9PW3SptvWAAQoWABsEHBAmBjNwUrm6PpHKk4AuX7q+4n5r7+Oo1tNwUrm6Opzjkdner9VfcTc19/7XJ01bmKVdQ5mep+Rdnz3XNQz44ve3R5vntm9WPrYjexhog6J1Pdryj7a3X3HFRE2W+tw/M9MqMfWxeHKVjVOZ/qfkjdz1dz3zdS/fzdx3+zm29YAPaPggXABgULgI3DFCx1TkfZrygan7rf1oz77133OajOqc1ymIKlzumo+hVF41P325p1/73r3k+qOqc2TXWu4qZq371R7x3Xew/VvoSz5i97/+r3r35/qqN7zmu1NrGGyn33Rqh/La7clzCSzVmNiJaZ+v13b9+Sfb6jaFOwuu+rVp3jcb+/+/WrNflrWu4w37AA+KNgAbBBwQJgo03B6r7vnfIe1f2S1PdXv58j5MT28AwztClY3fe9U/Urqu6XpL6/+v0cJSfWPee1THWuAn+p7idVff8tyCNV5dRG7/8s9b6Ee8txtYk1HF11P6nq+0exg8qc2sj9M9T7Eu4px0XBaqK6X5H7/atzaurn7z7+Vdp8wwKACAULgA0KFgAbFKwmKvsVzeinpb4/sG0UrDaq+hXN6qelvj+wbVufHNbHjx/Lew8pjyzVvoEuR6T6/tn34z7+VdrEGj59+rT9/Pmzehgy2WlW7hvoIJq/6lhA9v24j38VCtYi2WnunlNSq36+7P33Pv5V+IYFwAYFC4ANChYAGxQsA10+eFap7heWHWP12LZNuy/lShSs5o6eU6ruFzaq+75/qn0pl6vOVdxEOazX19fqIabGH1Hv+xedf6/f02i/JlW/qKxZ/abU1O/n3tEtZxWxiTW8vr5unz9/rh7m0+OPplm971+m39RIvyZlv6isGf2m1H9N1O/nkU45qwg/EjZRHeqMmuNlzq/WeWwzniH7fNVr7z0oWABsULAA2KBgAbBBwdqBbE7pCPv6ZSMP1f3AMjmqSKecVYSCZS6bUzrKvn7ZnFZ1P7Bnc1SRdjmrSHWu4iabw9qSOZvoyI4/Et1fnXNS58BU98/miNT7AqqPWTkq+mG9UzaHVd2eI5vDyu7Ll6XOgSnvn80RqfcFVJuRo3Lph8WPhCbUWaLqLE7m/tmxu+e0Zry7R9eoXhv/RMECYIOCBcAGBQuADQpWE9X9iDrnlNRjn3WNStn5r15/oyhYTVT3I+qaU4rMmp/qflpZ2fmvXn/DqnMVN0fPYUWqcjKr+i1F18nm0J6dv2w/sFXnq99PF+SwBkXTlM1hRSpzMiv6LalzaJn5y/YDW3F+RqecVYSCNai6YFXvG5ed32h86udT7xtYfX5WkzIQ4hsWABsULAA2KFgAbFCwMETdb0mdA8pev/P5M7h8dKdgYYi635I6B5S9ftfzZ6nK0b1bda7ihhzWY9nxVVPnyKr7OWXvr86JPXt0y2kRaxgUTdPeYw1Z6hxZdT+n7P3VObGMTjktfiTEEup+S9X9nLL3z5y/915p/0TBAmCDggXABgULgA0KloEuHzwzuues1KKP5urzMzrM3w0Fq7m97wvYJWeldi/nlN2XUL0+uszf36pzFTfZHFa1bA6r676A6hzRqvGpr//se1t1qPe1XGU3Oaxq2RxW530B1TmiFeNTX1+dA8xS72u5Cj8SNlGddanMEa0YX/X1q+2hWG0bBQuAEQoWABsULAA2KFg7UJ1jUueAOly/MgeV1SlHlUXBMledY1LngLpcvyoHldUuR5VVnau4iXJM7kckOj/K0Tyb48rmrGY9f/frZw/VvoWjqvuFzWKTw3IXTXN2X75Mjiubs5rx/N2vn6Xct3BEdb+wWShYi2QLVvZ89fj2fv0s9fuPuDeAvOEbFgAbFCwANihYAGxQsJqo3LeO62vtYV/GLihYTVTtW8f1tfayL2MXbX5LCAAR/gsLgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgI0/AXRl5K/bYs25AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTAyLTExVDIwOjQzOjIzKzAwOjAwj4NP3QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0wMi0xMVQyMDo0MzoyMyswMDowMP7e92EAAAAASUVORK5CYII=");return(u,m)=>(t.openBlock(),t.createElementBlock("div",Wc,[t.createElementVNode("section",Uc,[e.generated?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([s.value,"btnQrCode"])},[e.loading?(t.openBlock(),t.createElementBlock("div",Yc,m[0]||(m[0]=[t.createElementVNode("div",{class:"loaderMFA"},null,-1)]))):(t.openBlock(),t.createElementBlock("button",{key:1,class:"uppercase bg-base-300 p-2 z-40",onClick:r}," Gerar QR "))],2)),t.createElementVNode("img",{class:t.normalizeClass([[s.value,e.generated?"rounded-md":"rounded-none"],""]),src:i.value,alt:"QRCode"},null,10,Zc)])]))}};for(var Ie=[],ma=0;ma<256;++ma)Ie.push((ma+256).toString(16).slice(1));function Kc(e,n=0){return(Ie[e[n+0]]+Ie[e[n+1]]+Ie[e[n+2]]+Ie[e[n+3]]+"-"+Ie[e[n+4]]+Ie[e[n+5]]+"-"+Ie[e[n+6]]+Ie[e[n+7]]+"-"+Ie[e[n+8]]+Ie[e[n+9]]+"-"+Ie[e[n+10]]+Ie[e[n+11]]+Ie[e[n+12]]+Ie[e[n+13]]+Ie[e[n+14]]+Ie[e[n+15]]).toLowerCase()}var Bn,Qc=new Uint8Array(16);function Jc(){if(!Bn&&(Bn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bn(Qc)}var e3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const e1={randomUUID:e3};function t3(e,n,a){if(e1.randomUUID&&!e)return e1.randomUUID();e=e||{};var o=e.random||(e.rng||Jc)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Kc(o)}function t1(){const e=Rt(),n=async l=>{const u=e.attendants.find(m=>m.id===l);if(u)try{const m=await it.get(`${sa}?attendant=${l}&page=1`);u.messages=m.data.results.reverse(),u.hasNextPage=m.data.next!==null,u.currentPage=2,u.internal_chat={channel_id:m.data.channel_id,unread:0}}catch(m){console.error("Erro ao buscar mensagens:",m)}},a=async l=>{const u=e.attendants.find(m=>m.id===l);if(!(!u||!u.hasNextPage))try{const m=await it.get(`${sa}?attendant=${l}&page=${u.currentPage}`);u.messages=[...m.data.results.reverse(),...u.messages],u.hasNextPage=m.data.next!==null,u.currentPage++}catch(m){console.error("Erro ao carregar mais mensagens:",m)}},o=(l,u,m)=>{const c=l==null?void 0:l.message;if(!c)return;const h=e.attendants.find(f=>{var p;return((p=f.internal_chat)==null?void 0:p.channel_id)===c.channel_id});h?(h.messages=h.messages||[],h.messages.find(p=>p.id===c.id)||(h.messages.push(c),(!u||h.id!==m)&&(h.internal_chat.unread=(h.internal_chat.unread||0)+1))):console.error("Atendente não encontrado para o canal especificado.")},r=l=>{const u=e.attendants.find(m=>m.id===l);u&&(u.internal_chat.unread=0)},i=async(l,u,m,c=!1)=>{var d;const h=e.attendants.find(g=>g.id===l);if(!h||!((d=h.internal_chat)!=null&&d.channel_id))return;let f;c?f=u:f={type:"text",content:u};const p={id:t3(),content:f,created_at:new Date().toISOString(),sender:m};h.messages.push(p);try{await it.post(`${sa}${h.internal_chat.channel_id}/message/`,{id:p.id,content:p.content})}catch(g){console.error("Erro ao enviar mensagem:",g)}},s=l=>{const u=e.attendants.find(m=>m.id===l);return u?u.hasNextPage:!1};return{attendants:t.computed(()=>e.attendants),count:t.computed(()=>e.count),fetchMessagesForAtendente:n,loadMessagesForAtendente:a,addMessageToAtendente:o,sendMessageToAtendente:i,hasNextPageForAtendente:s,resetUnreadMessages:r}}const n3={class:"avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500"},a3={key:0,style:{"padding-top":"0.5rem"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o3=["src"],ha=Ae({__name:"Avatar",props:{url:{type:String}},setup(e){return(n,a)=>(t.openBlock(),t.createElementBlock("div",n3,[e.url?(t.openBlock(),t.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:e.url},null,8,o3)):(t.openBlock(),t.createElementBlock("svg",a3,a[0]||(a[0]=[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"},null,-1)])))]))}},[["__scopeId","data-v-7d8b2820"]]),r3={class:"attendants-container"},i3={class:"atendentes-list bg-base-300"},s3={key:0,class:"empty-message bg-base-200"},l3=["onClick"],c3={class:"atendente-main"},d3={class:"atendente-name"},u3={class:"flex items-center gap-4"},f3={key:0,class:"message-indicator"},m3={key:0,class:"chat-footer bg-base-200"},n1=Ae({__name:"ChatList",props:{atendentes:{type:Array,required:!0},attendant:{required:!0},mobile:{type:Boolean,default:!1}},emits:["atendenteSelecionado"],setup(e,{emit:n}){const a=e,o=n,r=t.ref(""),i=u=>{o("atendenteSelecionado",u)},s=u=>{switch(u){case"Busy":return"bg-red-500";case"Online":return"bg-green-500";case"Away":return"bg-yellow-500";case"Offline":return"bg-gray-500";default:return"bg-purple-500"}},l=t.computed(()=>r.value?a.atendentes.filter(u=>u.name.toLowerCase().includes(r.value.toLowerCase())&&u.id!==a.attendant.id):a.atendentes.filter(u=>u.id!==a.attendant.id));return(u,m)=>(t.openBlock(),t.createElementBlock("div",r3,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=c=>r.value=c),class:t.normalizeClass(e.mobile?"search-input-mobile bg-base-300 border-b border-base-200":"search-input bg-base-300 border-b border-base-200"),placeholder:"Pesquise entre os atendentes..."},null,2),[[t.vModelText,r.value]]),t.createElementVNode("ul",i3,[l.value.length===0?(t.openBlock(),t.createElementBlock("li",s3,t.toDisplayString(e.atendentes.length===0?"Não há atendentes disponíveis":"Não há atendentes com esse nome"),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,c=>(t.openBlock(),t.createElementBlock("li",{key:c.id,onClick:h=>i(c),class:t.normalizeClass([["atendente-item",c.isMoved?"moved":""],"border-b even:bg-base-300 bg-blue-400/10 border-base-200 hover:bg-base-200 relative"])},[t.createElementVNode("main",c3,[t.createVNode(ha,{url:c.photo},null,8,["url"]),t.createElementVNode("span",d3,t.toDisplayString(c.name),1)]),t.createElementVNode("footer",u3,[c.internal_chat.unread>0?(t.openBlock(),t.createElementBlock("span",f3,t.toDisplayString(c.internal_chat.unread),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["status-indicator",s(c.login_status)])},null,2)]),m[1]||(m[1]=t.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,l3))),128))]),e.mobile?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("footer",m3))]))}},[["__scopeId","data-v-dc8950e9"]]);function h3(e,n=null){if(!e)return!1;const a=e.getBoundingClientRect(),o=n?n.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};return a.bottom>=o.top&&a.top<=o.bottom&&a.right>=o.left&&a.left<=o.right}async function p3(e){return e?(await t.nextTick(),e.value instanceof HTMLElement?e.value:e.value?document.querySelector(e.value):null):null}function g3(e){let n=`0px 0px ${e.distance}px 0px`;e.top&&(n=`${e.distance}px 0px 0px 0px`);const a=new IntersectionObserver(o=>{o[0].isIntersecting&&(e.firstload&&e.emit(),e.firstload=!0)},{root:e.parentEl,rootMargin:n});return e.infiniteLoading.value&&a.observe(e.infiniteLoading.value),a}async function a1(e,n){if(await t.nextTick(),!e.top)return;const a=e.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const o1=(e,n)=>{const a=e.__vccOpts||e;for(const[o,r]of n)a[o]=r;return a},y3={},k3=e=>(t.pushScopeId("data-v-d3e37633"),e=e(),t.popScopeId(),e),x3={class:"container"},b3=k3(()=>t.createElementVNode("div",{class:"spinner"},null,-1)),w3=[b3];function E3(e,n){return t.openBlock(),t.createElementBlock("div",x3,w3)}const v3=o1(y3,[["render",E3],["__scopeId","data-v-d3e37633"]]),C3={class:"state-error"},pa=o1(t.defineComponent({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(e,{emit:n}){const a=e;let o=null,r=0;const i=t.ref(null),s=t.ref(""),{top:l,firstload:u,distance:m}=a,{identifier:c,target:h}=t.toRefs(a),f={infiniteLoading:i,top:l,firstload:u,distance:m,parentEl:null,emit(){r=(f.parentEl||document.documentElement).scrollHeight,p.loading(),n("infinite",p)}},p={loading(){s.value="loading"},async loaded(){s.value="loaded",await a1(f,r),h3(i.value,f.parentEl)&&f.emit()},async complete(){s.value="complete",await a1(f,r),o==null||o.disconnect()},error(){s.value="error"}};function d(){o==null||o.disconnect(),o=g3(f)}return t.watch(c,d),t.onMounted(async()=>{f.parentEl=await p3(h),d()}),t.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,y)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"infiniteLoading",ref:i,class:"v3-infinite-loading"},[t.withDirectives(t.createElementVNode("div",null,[t.renderSlot(g.$slots,"spinner",{},()=>[t.createVNode(v3)],!0)],512),[[t.vShow,s.value=="loading"]]),s.value=="complete"?t.renderSlot(g.$slots,"complete",{key:0},()=>{var k;return[t.createElementVNode("span",null,t.toDisplayString(((k=g.slots)==null?void 0:k.complete)||"No more results!"),1)]},!0):t.createCommentVNode("",!0),s.value=="error"?t.renderSlot(g.$slots,"error",{key:1,retry:f.emit},()=>{var k;return[t.createElementVNode("span",C3,[t.createElementVNode("span",null,t.toDisplayString(((k=g.slots)==null?void 0:k.error)||"Oops something went wrong!"),1),t.createElementVNode("button",{class:"retry",onClick:y[0]||(y[0]=(...x)=>f.emit&&f.emit(...x))},"retry")])]},!0):t.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]);function S3(e,n,a){const o=tt(e,a==null?void 0:a.in);return isNaN(n)?Je(e,NaN):(o.setDate(o.getDate()+n),o)}function Mn(e,n){return Dt(e,{...n,weekStartsOn:1})}function r1(e,n){const a=tt(e,n==null?void 0:n.in),o=a.getFullYear(),r=Je(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const i=Mn(r),s=Je(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const l=Mn(s);return a.getTime()>=i.getTime()?o+1:a.getTime()>=l.getTime()?o:o-1}function i1(e){const n=tt(e),a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),+e-+a}function Vn(e,n){const a=tt(e,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function B3(e,n,a){const[o,r]=ca(a==null?void 0:a.in,e,n),i=Vn(o),s=Vn(r),l=+i-i1(i),u=+s-i1(s);return Math.round((l-u)/Is)}function M3(e,n){const a=r1(e,n),o=Je(e,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),Mn(o)}function ga(e){return Je(e,Date.now())}function s1(e,n,a){const[o,r]=ca(a==null?void 0:a.in,e,n);return+Vn(o)==+Vn(r)}function V3(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function A3(e){return!(!V3(e)&&typeof e!="number"||isNaN(+tt(e)))}function N3(e,n){const a=tt(e,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function D3(e,n){const a=tt(e,n==null?void 0:n.in);return B3(a,N3(a))+1}function T3(e,n){const a=tt(e,n==null?void 0:n.in),o=+Mn(a)-+M3(a);return Math.round(o/jo)+1}function l1(e,n){var c,h,f,p;const a=tt(e,n==null?void 0:n.in),o=a.getFullYear(),r=vn(),i=(n==null?void 0:n.firstWeekContainsDate)??((h=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=Je((n==null?void 0:n.in)||e,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=Dt(s,n),u=Je((n==null?void 0:n.in)||e,0);u.setFullYear(o,0,i),u.setHours(0,0,0,0);const m=Dt(u,n);return+a>=+l?o+1:+a>=+m?o:o-1}function F3(e,n){var l,u,m,c;const a=vn(),o=(n==null?void 0:n.firstWeekContainsDate)??((u=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??a.firstWeekContainsDate??((c=(m=a.locale)==null?void 0:m.options)==null?void 0:c.firstWeekContainsDate)??1,r=l1(e,n),i=Je((n==null?void 0:n.in)||e,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),Dt(i,n)}function L3(e,n){const a=tt(e,n==null?void 0:n.in),o=+Dt(a,n)-+F3(a,n);return Math.round(o/jo)+1}function Fe(e,n){const a=e<0?"-":"",o=Math.abs(e).toString().padStart(n,"0");return a+o}const yt={y(e,n){const a=e.getFullYear(),o=a>0?a:1-a;return Fe(n==="yy"?o%100:o,n.length)},M(e,n){const a=e.getMonth();return n==="M"?String(a+1):Fe(a+1,2)},d(e,n){return Fe(e.getDate(),n.length)},a(e,n){const a=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h(e,n){return Fe(e.getHours()%12||12,n.length)},H(e,n){return Fe(e.getHours(),n.length)},m(e,n){return Fe(e.getMinutes(),n.length)},s(e,n){return Fe(e.getSeconds(),n.length)},S(e,n){const a=n.length,o=e.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return Fe(r,n.length)}},Ht={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},c1={G:function(e,n,a){const o=e.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})}},y:function(e,n,a){if(n==="yo"){const o=e.getFullYear(),r=o>0?o:1-o;return a.ordinalNumber(r,{unit:"year"})}return yt.y(e,n)},Y:function(e,n,a,o){const r=l1(e,o),i=r>0?r:1-r;if(n==="YY"){const s=i%100;return Fe(s,2)}return n==="Yo"?a.ordinalNumber(i,{unit:"year"}):Fe(i,n.length)},R:function(e,n){const a=r1(e);return Fe(a,n.length)},u:function(e,n){const a=e.getFullYear();return Fe(a,n.length)},Q:function(e,n,a){const o=Math.ceil((e.getMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return Fe(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,n,a){const o=Math.ceil((e.getMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return Fe(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,n,a){const o=e.getMonth();switch(n){case"M":case"MM":return yt.M(e,n);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})}},L:function(e,n,a){const o=e.getMonth();switch(n){case"L":return String(o+1);case"LL":return Fe(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})}},w:function(e,n,a,o){const r=L3(e,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):Fe(r,n.length)},I:function(e,n,a){const o=T3(e);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):Fe(o,n.length)},d:function(e,n,a){return n==="do"?a.ordinalNumber(e.getDate(),{unit:"date"}):yt.d(e,n)},D:function(e,n,a){const o=D3(e);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):Fe(o,n.length)},E:function(e,n,a){const o=e.getDay();switch(n){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})}},e:function(e,n,a,o){const r=e.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(i);case"ee":return Fe(i,2);case"eo":return a.ordinalNumber(i,{unit:"day"});case"eee":return a.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(r,{width:"short",context:"formatting"});case"eeee":default:return a.day(r,{width:"wide",context:"formatting"})}},c:function(e,n,a,o){const r=e.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(i);case"cc":return Fe(i,n.length);case"co":return a.ordinalNumber(i,{unit:"day"});case"ccc":return a.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(r,{width:"narrow",context:"standalone"});case"cccccc":return a.day(r,{width:"short",context:"standalone"});case"cccc":default:return a.day(r,{width:"wide",context:"standalone"})}},i:function(e,n,a){const o=e.getDay(),r=o===0?7:o;switch(n){case"i":return String(r);case"ii":return Fe(r,n.length);case"io":return a.ordinalNumber(r,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});case"iiii":default:return a.day(o,{width:"wide",context:"formatting"})}},a:function(e,n,a){const r=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,n,a){const o=e.getHours();let r;switch(o===12?r=Ht.noon:o===0?r=Ht.midnight:r=o/12>=1?"pm":"am",n){case"b":case"bb":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,n,a){const o=e.getHours();let r;switch(o>=17?r=Ht.evening:o>=12?r=Ht.afternoon:o>=4?r=Ht.morning:r=Ht.night,n){case"B":case"BB":case"BBB":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,n,a){if(n==="ho"){let o=e.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return yt.h(e,n)},H:function(e,n,a){return n==="Ho"?a.ordinalNumber(e.getHours(),{unit:"hour"}):yt.H(e,n)},K:function(e,n,a){const o=e.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):Fe(o,n.length)},k:function(e,n,a){let o=e.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):Fe(o,n.length)},m:function(e,n,a){return n==="mo"?a.ordinalNumber(e.getMinutes(),{unit:"minute"}):yt.m(e,n)},s:function(e,n,a){return n==="so"?a.ordinalNumber(e.getSeconds(),{unit:"second"}):yt.s(e,n)},S:function(e,n){return yt.S(e,n)},X:function(e,n,a){const o=e.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return u1(o);case"XXXX":case"XX":return Tt(o);case"XXXXX":case"XXX":default:return Tt(o,":")}},x:function(e,n,a){const o=e.getTimezoneOffset();switch(n){case"x":return u1(o);case"xxxx":case"xx":return Tt(o);case"xxxxx":case"xxx":default:return Tt(o,":")}},O:function(e,n,a){const o=e.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+d1(o,":");case"OOOO":default:return"GMT"+Tt(o,":")}},z:function(e,n,a){const o=e.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+d1(o,":");case"zzzz":default:return"GMT"+Tt(o,":")}},t:function(e,n,a){const o=Math.trunc(+e/1e3);return Fe(o,n.length)},T:function(e,n,a){return Fe(+e,n.length)}};function d1(e,n=""){const a=e>0?"-":"+",o=Math.abs(e),r=Math.trunc(o/60),i=o%60;return i===0?a+String(r):a+String(r)+n+Fe(i,2)}function u1(e,n){return e%60===0?(e>0?"-":"+")+Fe(Math.abs(e)/60,2):Tt(e,n)}function Tt(e,n=""){const a=e>0?"-":"+",o=Math.abs(e),r=Fe(Math.trunc(o/60),2),i=Fe(o%60,2);return a+r+n+i}const f1=(e,n)=>{switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},m1=(e,n)=>{switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},O3={p:m1,P:(e,n)=>{const a=e.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return f1(e,n);let i;switch(o){case"P":i=n.dateTime({width:"short"});break;case"PP":i=n.dateTime({width:"medium"});break;case"PPP":i=n.dateTime({width:"long"});break;case"PPPP":default:i=n.dateTime({width:"full"});break}return i.replace("{{date}}",f1(o,n)).replace("{{time}}",m1(r,n))}},P3=/^D+$/,$3=/^Y+$/,_3=["D","DD","YY","YYYY"];function R3(e){return P3.test(e)}function H3(e){return $3.test(e)}function z3(e,n,a){const o=j3(e,n,a);if(console.warn(o),_3.includes(e))throw new RangeError(o)}function j3(e,n,a){const o=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${n}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const G3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,I3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,q3=/^'([^]*?)'?$/,W3=/''/g,U3=/[a-zA-Z]/;function h1(e,n,a){var c,h,f,p,d,g,y,k;const o=vn(),r=(a==null?void 0:a.locale)??o.locale??wl,i=(a==null?void 0:a.firstWeekContainsDate)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(f=o.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(d=a==null?void 0:a.locale)==null?void 0:d.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((k=(y=o.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=tt(e,a==null?void 0:a.in);if(!A3(l))throw new RangeError("Invalid time value");let u=n.match(I3).map(x=>{const b=x[0];if(b==="p"||b==="P"){const v=O3[b];return v(x,r.formatLong)}return x}).join("").match(G3).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const b=x[0];if(b==="'")return{isToken:!1,value:Y3(x)};if(c1[b])return{isToken:!0,value:x};if(b.match(U3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:x}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const m={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return u.map(x=>{if(!x.isToken)return x.value;const b=x.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&H3(b)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&R3(b))&&z3(b,n,String(e));const v=c1[b[0]];return v(l,b,r.localize,m)}).join("")}function Y3(e){const n=e.match(q3);return n?n[1].replace(W3,"'"):e}function Z3(e,n){return Ws(Je(e,e),ga(e),n)}function X3(e,n){return s1(Je(e,e),ga(e))}function K3(e,n,a){return S3(e,-1,a)}function Q3(e,n){return s1(Je(e,e),K3(ga(e)))}/*! License details at fancyapps.com/license */const je=e=>typeof e=="string";/*! License details at fancyapps.com/license */const zt=e=>e&&e!==null&&e instanceof Element&&"nodeType"in e;/*! License details at fancyapps.com/license */const J3=function(e){if(!(e&&e instanceof Element&&e.offsetParent))return!1;const n=e.scrollHeight>e.clientHeight,a=window.getComputedStyle(e).overflowY,o=a.indexOf("hidden")!==-1,r=a.indexOf("visible")!==-1;return n&&!o&&!r},Jt=function(e,n=void 0){return!e||e===document.body||n&&e===n?null:J3(e)?e:Jt(e.parentElement,n)};/*! License details at fancyapps.com/license */const kt=function(e){var n=new DOMParser().parseFromString(e,"text/html").body;if(n.childElementCount>1){for(var a=document.createElement("div");n.firstChild;)a.appendChild(n.firstChild);return a}let o=n.firstChild;return!o||o instanceof HTMLElement?o:((a=document.createElement("div")).appendChild(o),a)};/*! License details at fancyapps.com/license */const De=function(e=0,n=0,a=0){return Math.max(Math.min(n,a),e)};/*! License details at fancyapps.com/license */const Ue=e=>typeof e=="object"&&e!==null&&e.constructor===Object&&Object.prototype.toString.call(e)==="[object Object]";/*! License details at fancyapps.com/license */function p1(e){return Ue(e)||Array.isArray(e)}function ya(e,n){const a=Object.keys(e),o=Object.keys(n);return a.length===o.length&&a.every(r=>{const i=e[r],s=n[r];return typeof i=="function"?`${i}`==`${s}`:p1(i)&&p1(s)?ya(i,s):i===s})}/*! License details at fancyapps.com/license */const g1=function(e){for(const n of An)n.getState()===Ye.Running&&n.tick(ka?e-ka:0);ka=e,Gt=window.requestAnimationFrame(g1)};var Ye,xt,jt;(function(e){e[e.Initializing=0]="Initializing",e[e.Running=1]="Running",e[e.Paused=2]="Paused",e[e.Completed=3]="Completed",e[e.Destroyed=4]="Destroyed"})(Ye||(Ye={})),function(e){e[e.Spring=0]="Spring",e[e.Ease=1]="Ease"}(xt||(xt={})),function(e){e[e.Loop=0]="Loop",e[e.Reverse=1]="Reverse"}(jt||(jt={}));const An=new Set;let Gt=null,ka=0;function bt(){let e=Ye.Initializing,n=xt.Ease,a=0,o=0,r=bt.Easings.Linear,i=500,s=0,l=0,u=0,m=0,c=1/0,h=.01,f=.01,p=!1,d={},g=null,y={},k={},x={},b=0,v=0,C=jt.Loop,O=bt.Easings.Linear;const _=new Map;function E(T,...A){for(const z of _.get(T)||[])z(...A)}function w(T){return o=0,T?g=setTimeout(()=>{R()},T):R(),P}function R(){e=Ye.Running,E("start",y,k)}function D(){if(e=Ye.Completed,x={},E("end",y),e===Ye.Completed)if(a<b){if(a++,C===jt.Reverse){const T=Object.assign({},d);d=Object.assign({},k),k=T}w(v)}else a=0;return P}const P={getState:function(){return e},easing:function(T){return r=T,n=xt.Ease,x={},P},duration:function(T){return i=T,P},spring:function(T={}){n=xt.Spring;const A={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:z,mass:ie,tension:ee,friction:pe,restDelta:V,restSpeed:M,maxSpeed:j,clamp:re}=Object.assign(Object.assign({},A),T);return s=z,l=ie,u=ee,m=pe,f=V,h=M,c=j,p=re,x={},P},isRunning:function(){return e===Ye.Running},isSpring:function(){return n===xt.Spring},from:function(T){return y=Object.assign({},T),P},to:function(T){return k=T,P},repeat:function(T,A=0,z=jt.Loop,ie){return b=T,v=A,C=z,O=ie||r,P},on:function(T,A){var z,ie;return z=T,ie=A,_.set(z,[..._.get(z)||[],ie]),P},off:function(T,A){var z,ie;return z=T,ie=A,_.has(z)&&_.set(z,_.get(z).filter(ee=>ee!==ie)),P},start:function(T){return e=Ye.Initializing,d=Object.assign({},y),ya(d,k)||(An.add(this),Gt||(Gt=window.requestAnimationFrame(g1)),w(T)),P},pause:function(){return g&&(clearTimeout(g),g=null),e===Ye.Running&&(e=Ye.Paused,E("pause",y)),P},end:D,tick:function(T){T>50&&(T=50),o+=T;let A=0,z=!1;if(e!==Ye.Running)return P;if(n===xt.Ease){A=De(0,o/i,1),z=A===1;const ee=C===jt.Reverse?O:r;for(const pe in y)y[pe]=d[pe]+(k[pe]-d[pe])*ee(A)}if(n===xt.Spring){const ee=.001*T;let pe=0;for(const V in y){const M=k[V];let j=y[V];if(typeof M!="number"||isNaN(M)||typeof j!="number"||isNaN(j))continue;if(Math.abs(M-j)<=f){y[V]=M,x[V]=0;continue}x[V]||(typeof s=="object"&&typeof s[V]=="number"?x[V]=s[V]:x[V]=typeof s=="number"?s:0);let re=x[V];re=De(-1*Math.abs(c),re,Math.abs(c));const se=re*l*m;re+=((j>M?-1:1)*(Math.abs(M-j)*u)-se)/l*ee,j+=re*ee;const be=y[V]>M?j<M:j>M;let Ce=Math.abs(re)<h&&Math.abs(M-j)<=f;p&&be&&(Ce=!0),Ce?(j=M,re=0):pe++,y[V]=j,x[V]=re}z=!pe}const ie=Object.assign({},k);return E("step",y,d,k,A),z&&e===Ye.Running&&ya(k,ie)&&(e=Ye.Completed,D()),P},getStartValues:function(){return d},getCurrentValues:function(){return y},getCurrentVelocities:function(){return x},getEndValues:function(){return k},destroy:function(){e=Ye.Destroyed,g&&(clearTimeout(g),g=null),d=y=k={},An.delete(this)}};return P}bt.destroy=()=>{for(const e of An)e.destroy();Gt&&(cancelAnimationFrame(Gt),Gt=null)},bt.Easings={Linear:function(e){return e},EaseIn:function(e){return e===0?0:Math.pow(2,10*e-10)},EaseOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},EaseInOut:function(e){return e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2}};/*! License details at fancyapps.com/license */function xa(e){const n=[],a=typeof TouchEvent<"u"&&e instanceof TouchEvent?e.touches:e instanceof MouseEvent&&e.type!=="mouseup"?[e]:[];for(const o of a)n.push({x:o.clientX,y:o.clientY,ts:Date.now()});return n}function y1(e){const n=[],a=typeof TouchEvent<"u"&&e instanceof TouchEvent?e.changedTouches:e instanceof MouseEvent?[e]:[];for(const o of a)n.push({x:o.clientX,y:o.clientY,ts:Date.now()});return n}function wt(e){const n=e[0],a=e[1]||n;return{x:(n.x+a.x)/2,y:(n.y+a.y)/2,ts:a.ts}}function Nn(e){const n=e[0],a=e[1]||e[0];return n&&a?-1*Math.sqrt((a.x-n.x)*(a.x-n.x)+(a.y-n.y)*(a.y-n.y)):0}const k1=e=>{e.cancelable&&e.preventDefault()},Et={passive:!1},ed={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let ba=!1,en=!0;const tn=(e,n)=>{let a,o,r,i=Object.assign(Object.assign({},ed),n),s=[],l=[],u=[],m=!1,c=!1,h=!1,f=0,p=0,d=0,g=0,y=0,k=0,x=0,b=0,v=0,C=[],O=0,_=0;const E=new Map;function w(V){const M=Nn(l),j=Nn(u),re=M&&j?M/j:0,se=Math.abs(x)>Math.abs(b)?x:b,be={srcEvent:a,isPanRecognized:m,isSwipeRecognized:c,firstTouch:s,previousTouch:u,currentTouch:l,deltaX:d,deltaY:g,offsetX:y,offsetY:k,velocityX:x,velocityY:b,velocity:se,angle:v,axis:r,scale:re,center:o};for(const Ce of E.get(V)||[])Ce(be)}function R(V){const M=Date.now();C=C.filter(j=>!j.ts||j.ts>M-100),V&&C.push(V)}function D(){if(x=0,b=0,C.length>3){const V=C[0],M=C[C.length-1];if(V&&M){const j=M.x-V.x,re=M.y-V.y,se=V.ts&&M.ts?M.ts-V.ts:0;se>0&&(x=Math.abs(j)>3?j/(se/30):0,b=Math.abs(re)>3?re/(se/30):0)}}}function P(V){if(V instanceof MouseEvent){if(ba)return}else ba=!0;const M=V.composedPath()[0],j=i.ignore.join(",");if(M.matches(j)||M.closest(j)||typeof MouseEvent<"u"&&V instanceof MouseEvent&&(!V.buttons||V.button!==0))return;V instanceof MouseEvent&&k1(V);const re=Date.now(),se=re-(f||re);h=se>0&&se<=250,f=re,clearTimeout(O),a=V,V instanceof MouseEvent&&(window.addEventListener("mousemove",T),window.addEventListener("mouseup",A)),window.addEventListener("blur",z),l=xa(V),s=[...l],u=[],p=l.length,o=wt(l),p===1&&(m=!1,c=!1),p&&R(wt(l)),w("start")}function T(V){var M;if(!s.length||V.defaultPrevented)return;a=V,u=[...l],l=xa(V),p=l.length,o=wt(l);const j=o,re=wt(u);if(d=j.x-re.x,g=j.y-re.y,R(j),D(),w("move"),l.length>1){const se=Nn(l),be=Nn(u);Math.abs(se-be)>=.1&&w("pinch")}if(!m&&s.length){const se=wt(s);y=j.x-se.x,k=j.y-se.y,m=Math.abs(y)>i.panThreshold||Math.abs(k)>i.panThreshold,m&&(en=!1,clearTimeout(_),_=0,v=Math.abs(180*Math.atan2(k,y)/Math.PI),r=v>45&&v<135?"y":"x",s=[...l],u=[...l],(M=window.getSelection())===null||M===void 0||M.removeAllRanges(),w("panstart"))}m&&(d||g)&&w("pan")}function A(V){if(a=V,!s.length)return;const M=xa(V),j=y1(V);if(p=M.length,o=wt(j),j.length&&R(wt(j)),D(),u=[...l],l=[...M],s=[...M],M.length>0)w("end"),m=!1,c=!1,C=[];else{const re=i.swipeThreshold;(Math.abs(x)>re||Math.abs(b)>re)&&(c=!0),m&&w("panend"),c&&w("swipe"),m||c||(w("tap"),h?w("doubleTap"):O=setTimeout(function(){w("singleTap")},250)),w("end"),ie()}}function z(){clearTimeout(O),ie(),m&&w("panend"),w("end")}function ie(){m=!1,c=!1,h=!1,p=0,C=[],l=[],u=[],s=[],d=0,g=0,y=0,k=0,x=0,b=0,v=0,r=void 0,window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",A),window.removeEventListener("blur",z),en||_||(_=setTimeout(()=>{en=!0,_=0},100))}function ee(V){const M=V.target;ba=!1,M&&!V.defaultPrevented&&(en||(k1(V),V.stopPropagation()))}const pe={init:function(){if(e)return e.addEventListener("click",ee,Et),e.addEventListener("mousedown",P,Et),e.addEventListener("touchstart",P,Et),e.addEventListener("touchmove",T,Et),e.addEventListener("touchend",A),e.addEventListener("touchcancel",A),pe},on:function(V,M){return function(j,re){E.set(j,[...E.get(j)||[],re])}(V,M),pe},off:function(V,M){return E.has(V)&&E.set(V,E.get(V).filter(j=>j!==M)),pe},isPointerDown:()=>p>0,destroy:function(){clearTimeout(O),clearTimeout(_),_=0,e&&(e.removeEventListener("click",ee,Et),e.removeEventListener("mousedown",P,Et),e.removeEventListener("touchstart",P,Et),e.removeEventListener("touchmove",T,Et),e.removeEventListener("touchend",A),e.removeEventListener("touchcancel",A)),e=null,ie()}};return pe};tn.isClickAllowed=()=>en;/*! License details at fancyapps.com/license */const wa={IMAGE_ERROR:"This image couldn't be loaded. <br /> Please try again later.",MOVE_UP:"Move up",MOVE_DOWN:"Move down",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",TOGGLE_FULL:"Toggle zoom level",TOGGLE_1TO1:"Toggle zoom level",ITERATE_ZOOM:"Toggle zoom level",ROTATE_CCW:"Rotate counterclockwise",ROTATE_CW:"Rotate clockwise",FLIP_X:"Flip horizontally",FLIP_Y:"Flip vertically",RESET:"Reset"};/*! License details at fancyapps.com/license */const Te=(e,n="")=>{e&&e.classList&&n.split(" ").forEach(a=>{a&&e.classList.add(a)})};/*! License details at fancyapps.com/license */const Dn=e=>{e.cancelable&&e.preventDefault()},Ze=(e,n=1e4)=>(e=parseFloat(e+"")||0,Math.round((e+Number.EPSILON)*n)/n);var fe,x1;(function(e){e.Reset="reset",e.Zoom="zoom",e.ZoomIn="zoomIn",e.ZoomOut="zoomOut",e.ZoomTo="zoomTo",e.ToggleCover="toggleCover",e.ToggleFull="toggleFull",e.ToggleMax="toggleMax",e.IterateZoom="iterateZoom",e.Pan="pan",e.Swipe="swipe",e.Move="move",e.MoveLeft="moveLeft",e.MoveRight="moveRight",e.MoveUp="moveUp",e.MoveDown="moveDown",e.RotateCCW="rotateCCW",e.RotateCW="rotateCW",e.FlipX="flipX",e.FlipY="flipY"})(fe||(fe={})),function(e){e.Cover="cover",e.Full="full",e.Max="max"}(x1||(x1={}));const nt={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},Ea={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:fe.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:wa,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:fe.Zoom,width:"auto"};let Tn,b1=0,w1=0,Fn=0;const va=(e,n={},a={})=>{let o,r,i,s,l,u,m,c=0,h=Object.assign(Object.assign({},Ea),n),f={},p=Object.assign({},nt),d=Object.assign({},nt);const g=[];function y(S){let N=h[S];return N&&typeof N=="function"?N(Q):N}const k=new Map;function x(S,...N){const I=k.get(S)||[];h.on&&I.push(h.on[S]);for(const H of I)H&&H instanceof Function&&H(Q,...N);S!=="*"&&x("*",S,...N)}function b(S){if(c!==3)return;const N=S.target;if(Jt(N))return;const I=Date.now(),H=[-S.deltaX||0,-S.deltaY||0,-S.detail||0].reduce(function(we,ke){return Math.abs(ke)>Math.abs(we)?ke:we}),X=De(-1,H,1);x("wheel",S,X);const U=y("wheelAction");if(!U||S.defaultPrevented)return;const J=d.scale;let de=J*(X>0?1.5:.5);if(U===fe.Zoom){const we=Math.abs(S.deltaY)<100&&Math.abs(S.deltaX)<100;if(I-w1<(we?200:45))return void Dn(S);w1=I;const ke=P(),he=ie();if(Ze(de)<Ze(ke)&&Ze(J)<=Ze(ke)?(Fn+=Math.abs(X),de=ke):Ze(de)>Ze(he)&&Ze(J)>=Ze(he)?(Fn+=Math.abs(X),de=he):(Fn=0,de=De(ke,de,he)),Fn>7)return}switch(Dn(S),U){case fe.Pan:M(U,{srcEvent:S,deltaX:2*-S.deltaX,deltaY:2*-S.deltaY});break;case fe.Zoom:M(fe.ZoomTo,{srcEvent:S,scale:de,center:{x:S.clientX,y:S.clientY}});break;default:M(U,{srcEvent:S})}}function v(S){var N,I;const H=S.composedPath()[0];if(!tn.isClickAllowed()||!zt(H)||S.defaultPrevented||!(e!=null&&e.contains(H))||H.hasAttribute("disabled")||H.hasAttribute("aria-disabled"))return;const X=H.closest("[data-panzoom-action]"),U=(N=X==null?void 0:X.dataset)===null||N===void 0?void 0:N.panzoomAction,J=((I=X==null?void 0:X.dataset)===null||I===void 0?void 0:I.panzoomValue)||"";if(U){switch(U){case fe.ZoomTo:case fe.ZoomIn:case fe.ZoomOut:M(U,{scale:parseFloat(J||"")||void 0});break;case fe.MoveLeft:case fe.MoveRight:M(U,{deltaX:parseFloat(J||"")||void 0});break;case fe.MoveUp:case fe.MoveDown:M(U,{deltaY:parseFloat(J||"")||void 0});break;default:M(U)}return}if(!(o!=null&&o.contains(H)))return;const de={srcEvent:S};if(M(y("clickAction"),de),y("dblClickAction")){const we=Date.now(),ke=we-(b1||we);b1=we,ke>0&&ke<=250?(Tn&&(clearTimeout(Tn),Tn=void 0),M(y("dblClickAction"),de)):Tn=setTimeout(()=>{M(y("singleClickAction"),de)},250)}}function C(S){if(m=S,!w()||c!==3||p.scale<=1||d.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const N=R(d.scale);if(!N)return;const{x:I,y:H}=N;M(fe.Pan,{deltaX:I-d.x,deltaY:H-d.y})}function O(){var S;if(e&&((S=e.querySelector(".f-spinner"))===null||S===void 0||S.remove(),e.classList.remove("is-loading")),!e||!o)return;if(r instanceof HTMLImageElement&&(!r.complete||!r.naturalWidth))return c=2,o==null||o.classList.add("has-error"),void x("error");x("loaded");const{width:N,height:I}=E();r&&(r.setAttribute("width",N+""),r.setAttribute("height",I+"")),o&&(o.classList.remove("has-error"),o.setAttribute("width",N+""),o.setAttribute("height",I+""),o.style.aspectRatio=`${N/I||""}`),l=bt().on("start",(X,U)=>{d=Object.assign(Object.assign({},nt),U),U.angle!==void 0&&(U.angle=90*Math.round(U.angle/90)),U.flipX!==void 0&&(U.flipX=U.flipX>0?1:-1),U.flipY!==void 0&&(U.flipY=U.flipY>0?1:-1),V(),x("animationStart")}).on("pause",X=>{d=Object.assign(Object.assign({},nt),X)}).on("step",X=>{if(c!==3||!l)return;if(!e||!e.parentElement)return void l.end();if(p=Object.assign(Object.assign({},nt),X),w()||!y("bounds")||(s==null?void 0:s.isPointerDown())||d.scale>p.scale||d.scale<T())return void j();const U=ee(d.scale);let J=!1,de=!1,we=!1,ke=!1;p.x<U.x[0]&&(J=!0),p.x>U.x[1]&&(de=!0),p.y<U.y[0]&&(ke=!0),p.y>U.y[1]&&(we=!0);let he=!1,ge=!1,L=!1,K=!1;d.x<U.x[0]&&(he=!0),d.x>U.x[1]&&(ge=!0),d.y<U.y[0]&&(K=!0),d.y>U.y[1]&&(L=!0);let ae=!1;(de&&ge||J&&he)&&(d.x=De(U.x[0],d.x,U.x[1]),ae=!0),(we&&L||ke&&K)&&(d.y=De(U.y[0],d.y,U.y[1]),ae=!0),ae&&l.spring({tension:94,friction:17,maxSpeed:555*d.scale,restDelta:.1,restSpeed:.1,velocity:l.getCurrentVelocities()}).from(p).to(d).start(),j()}).on("end",()=>{pe(),l!=null&&l.isRunning()||(V(),x("animationEnd"))}),function(){const X=y("gestures");X&&i&&r&&(s=tn(i,X).on("start",U=>{if(!l)return;const J=U.srcEvent;w()||((p.scale>1||U.currentTouch.length>1)&&(J==null||J.stopPropagation(),l.pause()),U.currentTouch.length===1&&x("touchStart"))}).on("move",U=>{w()||(d.scale!==1||U.currentTouch.length>1)&&(U.srcEvent.preventDefault(),U.srcEvent.stopPropagation())}).on("pan",U=>{if(w())return;const J=U.srcEvent;(d.scale!==1||U.currentTouch.length>1)&&(Dn(J),M(fe.Pan,U))}).on("swipe",U=>{w()||d.scale>1&&M(fe.Swipe,U)}).on("tap",U=>{x("click",U)}).on("singleTap",U=>{x("singleClick",U)}).on("doubleTap",U=>{x("dblClick",U)}).on("pinch",U=>{w()||(U.scale>T()?M(fe.ZoomIn,U):U.scale<T()?M(fe.ZoomOut,U):M(fe.Pan,U))}).on("end",U=>{w()||(U.currentTouch.length?(U.srcEvent.stopPropagation(),Dn(U.srcEvent),l==null||l.end()):(V(),pe(),x("touchEnd")))}).init())}(),i&&(i.addEventListener("wheel",b,{passive:!1}),g.push(()=>{i==null||i.removeEventListener("wheel",b,{passive:!1})})),e==null||e.addEventListener("click",v),document==null||document.addEventListener("mousemove",C),g.push(()=>{e==null||e.removeEventListener("click",v),document==null||document.removeEventListener("mousemove",C)});const H=Object.assign(Object.assign({},y("startPos")||{}),{scale:T()});if(p=Object.assign(Object.assign({},nt),H),d=Object.assign(Object.assign({},nt),H),w()){const X=R(d.scale);if(X){const{x:U,y:J}=X;p.x=U,p.y=J,d.x=U,d.y=J}}c=3,j(),V(),x("ready"),requestAnimationFrame(()=>{i&&(i.style.visibility="")})}function _(){const S={top:0,left:0,width:0,height:0};if(o){const N=o.getBoundingClientRect();d.angle%180==90?(S.top=N.top+.5*N.height-.5*N.width,S.left=N.left+.5*N.width-.5*N.height,S.width=N.height,S.height=N.width):(S.top=N.top,S.left=N.left,S.width=N.width,S.height=N.height)}return S}function E(){let S=y("width"),N=y("height");if(r&&S==="auto"){const I=r.getAttribute("width");S=I?parseFloat(I+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):i instanceof HTMLImageElement?i.naturalWidth:r instanceof HTMLImageElement?r.naturalWidth:r.getBoundingClientRect().width}else S=je(S)?parseFloat(S):S;if(r&&N==="auto"){const I=r.getAttribute("height");N=I?parseFloat(I+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):i instanceof HTMLImageElement?i.naturalHeight:r instanceof HTMLImageElement?r.naturalHeight:r.getBoundingClientRect().height}else N=je(N)?parseFloat(N):N;return{width:S,height:N}}function w(){return y("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function R(S){const N=m||y("event"),I=o==null?void 0:o.getBoundingClientRect();if(!N||!I||S<=1)return{x:0,y:0};const H=(N.clientX||0)-I.left,X=(N.clientY||0)-I.top,U=I.width,J=I.height,de=ee(S);if(S>1){const L=y("mouseMoveFactor");L>1&&(S*=L)}let we=U*S,ke=J*S,he=.5*(we-U)-H/U*100/100*(we-U),ge=.5*(ke-J)-X/J*100/100*(ke-J);return he=De(de.x[0],he,de.x[1]),ge=De(de.y[0],ge,de.y[1]),{x:he,y:ge}}function D(S="base"){if(!e)return 1;const N=e.getBoundingClientRect(),I=_(),{width:H,height:X}=E(),U=he=>{if(typeof he=="number")return he;switch(he){case"min":case"base":return 1;case"cover":return Math.max(N.height/I.height,N.width/I.width)||1;case"full":case"max":{const ge=d.angle%180==90?X:H;return ge&&I.width?ge/I.width:1}}},J=y("minScale"),de=y("maxScale"),we=Math.min(U("full"),U(J)),ke=typeof de=="number"?U("full")*de:Math.min(U("full"),U(de));switch(S){case"min":return we;case"base":return De(we,1,ke);case"cover":return U("cover");case"full":return Math.min(ke,U("full"));case"max":return ke}}function P(){return D("min")}function T(){return D("base")}function A(){return D("cover")}function z(){return D("full")}function ie(){return D("max")}function ee(S){const N={x:[0,0],y:[0,0]},I=e==null?void 0:e.getBoundingClientRect();if(!I)return N;const H=_(),X=I.width,U=I.height;let J=H.width,de=H.height,we=S=S===void 0?d.scale:S,ke=S;if(w()&&S>1){const he=y("mouseMoveFactor");he>1&&(J*S>X+.01&&(we*=he),de*S>U+.01&&(ke*=he))}return J*=we,de*=ke,S>1&&(J>X&&(N.x[0]=.5*(X-J),N.x[1]=.5*(J-X)),N.x[0]-=.5*(H.left-I.left),N.x[1]-=.5*(H.left-I.left),N.x[0]-=.5*(H.left+H.width-I.right),N.x[1]-=.5*(H.left+H.width-I.right),de>U&&(N.y[0]=.5*(U-de),N.y[1]=.5*(de-U)),N.y[0]-=.5*(H.top-I.top),N.y[1]-=.5*(H.top-I.top),N.y[0]-=.5*(H.top+H.height-I.bottom),N.y[1]-=.5*(H.top+H.height-I.bottom)),N}function pe(){if(!y("bounds")||c!==3||!(e!=null&&e.parentElement)||!l)return;const S=P(),N=ie(),I=De(S,d.scale,N);if(d.scale<S-.01||d.scale>N+.01)return void M(fe.ZoomTo,{scale:I});if(l.isRunning()||s!=null&&s.isPointerDown())return;const H=ee(I);d.x<H.x[0]||d.x>H.x[1]||d.y<H.y[0]||d.y>H.y[1]?(d.x=De(H.x[0],d.x,H.x[1]),d.y=De(H.y[0],d.y,H.y[1]),l.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:l.getCurrentVelocities()}),l.from(p).to(d).start()):j()}function V(){if(!e||!e.parentElement||!o)return;const S=Oe(),N=Be(),I=G(),H=ne(),X=se(),U=be();o.classList.toggle("is-fullsize",H),o.classList.toggle("is-expanded",I),o.classList.toggle("is-dragging",N),o.classList.toggle("can-drag",S),o.classList.toggle("will-zoom-in",X),o.classList.toggle("will-zoom-out",U);const J=Ce(),de=Le(),we=c!==3;for(const ke of(e==null?void 0:e.querySelectorAll("[data-panzoom-action]"))||[]){const he=ke.dataset.panzoomAction;let ge=!1;if(we)ge=!0;else switch(he){case fe.ZoomIn:J||(ge=!0);break;case fe.ZoomOut:de||(ge=!0);break;case fe.ToggleFull:J||de||(ge=!0);const L=ke.querySelector("g");L&&(L.style.display=H?"none":"");break;case fe.ToggleCover:case fe.ToggleMax:J||de||(ge=!0)}ge?(ke.setAttribute("aria-disabled",""),ke.setAttribute("tabindex","-1")):(ke.removeAttribute("aria-disabled"),ke.removeAttribute("tabindex"))}}function M(S,N){var I;if(!e||!r||!l||S===fe.Swipe&&Math.abs(l.getCurrentVelocities().scale)>.01)return;let H=Object.assign({},d),X=ee(w()?d.scale:p.scale);const U=l.getCurrentVelocities(),J=_(),de=(((I=(N=N||{}).currentTouch)===null||I===void 0?void 0:I.length)||0)>1,we=N.velocityX||0,ke=N.velocityY||0;let he=N.center;!he&&N.srcEvent&&(he=wt(y1(N.srcEvent)));let ge=N.deltaX||0,L=N.deltaY||0;switch(S){case fe.MoveRight:ge=N.deltaX||100;break;case fe.MoveLeft:ge=N.deltaX||-100;break;case fe.MoveUp:L=N.deltaY||-100;break;case fe.MoveDown:L=N.deltaY||100}let K=[];switch(S){case fe.Reset:d=Object.assign({},nt),d.scale=T();break;case fe.Pan:case fe.Move:case fe.MoveLeft:case fe.MoveRight:case fe.MoveUp:case fe.MoveDown:if(s!=null&&s.isPointerDown()){let Ee=1,ye=1;d.x<=X.x[0]&&we<=0&&(Ee=Math.max(.01,1-Math.abs(1/J.width*Math.abs(d.x-X.x[0]))),Ee*=.2),d.x>=X.x[1]&&we>=0&&(Ee=Math.max(.01,1-Math.abs(1/J.width*Math.abs(d.x-X.x[1]))),Ee*=.2),d.y<=X.y[0]&&ke<=0&&(ye=Math.max(.01,1-Math.abs(1/J.height*Math.abs(d.y-X.y[0]))),ye*=.2),d.y>=X.y[1]&&ke>=0&&(ye=Math.max(.01,1-Math.abs(1/J.height*Math.abs(d.y-X.y[1]))),ye*=.2),d.x+=ge*Ee,d.y+=L*ye}else d.x=De(X.x[0],d.x+ge,X.x[1]),d.y=De(X.y[0],d.y+L,X.y[1]);break;case fe.Swipe:const ae=(Ee=0)=>Math.sign(Ee)*Math.pow(Math.abs(Ee),1.5);d.x+=De(-1e3,ae(we),1e3),d.y+=De(-1e3,ae(ke),1e3),ke&&!we&&(d.x=De(X.x[0],d.x,X.x[1])),!ke&&we&&(d.y=De(X.y[0],d.y,X.y[1])),U.x=we,U.y=ke;break;case fe.ZoomTo:d.scale=N.scale||1;break;case fe.ZoomIn:d.scale=d.scale*(N.scale||2),de||(d.scale=Math.min(d.scale,ie()));break;case fe.ZoomOut:d.scale=d.scale*(N.scale||.5),de||(d.scale=Math.max(d.scale,P()));break;case fe.ToggleCover:K=[T(),A()];break;case fe.ToggleFull:K=[T(),z()];break;case fe.ToggleMax:K=[T(),ie()];break;case fe.IterateZoom:K=[T(),z(),ie()];break;case fe.Zoom:const ce=z();d.scale>=ce-.05?d.scale=T():d.scale=Math.min(ce,d.scale*(N.scale||2));break;case fe.RotateCW:d.angle+=90;break;case fe.RotateCCW:d.angle-=90;break;case fe.FlipX:d.flipX*=-1;break;case fe.FlipY:d.flipY*=-1}if(p.angle!==void 0&&Math.abs(p.angle)>=360&&(d.angle-=360*Math.floor(p.angle/360),p.angle-=360*Math.floor(p.angle/360)),K.length){const ae=K.findIndex(ce=>ce>d.scale+1e-4);d.scale=K[ae]||K[0]}if(de&&(d.scale=De(P()*(de?.8:1),d.scale,ie()*(de?1.6:1))),w()){const ae=R(d.scale);if(ae){const{x:ce,y:Ee}=ae;d.x=ce,d.y=Ee}}else if(d.scale!==H.scale){let ae=0,ce=0;if(he)ae=he.x,ce=he.y;else{const q=e.getBoundingClientRect();ae=q.x+.5*q.width,ce=q.y+.5*q.height}let Ee=ae-J.left,ye=ce-J.top;Ee-=.5*J.width,ye-=.5*J.height;const B=(Ee-H.x)/H.scale,F=(ye-H.y)/H.scale;d.x=Ee-B*d.scale,d.y=ye-F*d.scale,!de&&y("bounds")&&(X=ee(d.scale),d.x=De(X.x[0],d.x,X.x[1]),d.y=De(X.y[0],d.y,X.y[1]))}if(S===fe.Swipe){let ae=94,ce=17,Ee=500*d.scale,ye=U;l.spring({tension:ae,friction:ce,maxSpeed:Ee,restDelta:.1,restSpeed:.1,velocity:ye})}else S===fe.Pan||de?l.spring({tension:750,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):l.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:U});S===fe.Reset&&N.velocity===0?p=Object.assign({},d):l.from(p).to(d).start(),x("action",S)}function j(){if(!o||!r)return;if(r instanceof HTMLImageElement){const{width:de,height:we}=E();o.style.maxWidth=`min(${de}px, 100%)`,o.style.maxHeight=`min(${we}px, 100%)`}let{x:S,y:N,scale:I,angle:H,flipX:X,flipY:U}=p;const J=function(){const de=_(),we=de.width,ke=de.height,{width:he,height:ge}=E();if(!e)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:we,fitHeight:ke,fullWidth:he,fullHeight:ge};let{x:L,y:K,scale:ae,angle:ce,flipX:Ee,flipY:ye}=p,B=1/z(),F=he,q=ge,Y=p.scale*B,me=d.scale*B;const te=Math.max(we,ke),oe=Math.min(we,ke);he>ge?(F=te,q=oe):(F=oe,q=te),Y=he>ge?te*ae/he||1:te*ae/ge||1;let ue=F?he*me:0,$=q?ge*me:0;return L=L+.5*F-.5*ue,K=K+.5*q-.5*$,{x:L,y:K,width:ue,height:$,scale:F&&q?he*Y/ue:0,flipX:Ee,flipY:ye,angle:ce,fitWidth:we,fitHeight:ke,fullWidth:he,fullHeight:ge}}();if(o&&J){const{x:de,y:we,width:ke,height:he,scale:ge,flipX:L,flipY:K}=J;let ae=`translate(${Ze(de)}px, ${Ze(we)}px)`;ae+=L!==1||K!==1?` scaleX(${Ze(ge*L)}) scaleY(${Ze(ge*K)})`:` scale(${Ze(ge)})`,H!==0&&(ae+=` rotate(${H}deg)`),i&&(i.style.width=`${Ze(ke)}px`,i.style.height=`${Ze(he)}px`,i.style.transform=`${ae}`)}x("render")}function re(){let S=d.scale;const N=y("clickAction");let I=T();if(N){let H=[];switch(N){case fe.ZoomIn:I=2*S;break;case fe.ZoomOut:I=.5*S;break;case fe.ToggleCover:H=[T(),A()];break;case fe.ToggleFull:H=[T(),z()];break;case fe.ToggleMax:H=[T(),ie()];break;case fe.IterateZoom:H=[T(),z(),ie()];break;case fe.Zoom:const X=z();I=S>=X-.05?T():Math.min(X,2*S)}if(H.length){const X=H.findIndex(U=>U>S+1e-4);I=H[X]||T()}}return I=De(P(),I,ie()),I}function se(){return c===3&&re()>d.scale}function be(){return c===3&&re()<d.scale}function Ce(){return c===3&&d.scale<ie()}function Le(){return c===3&&d.scale>P()}function Oe(){return c===3&&G()&&!!s&&!w()}function Be(){return c===3&&(s==null?void 0:s.isPointerDown())&&!w()}function G(){return c===3&&d.scale>T()}function ne(){return c===3&&d.scale>=z()}const Q={canDrag:Oe,canZoomIn:Ce,canZoomOut:Le,destroy:function(){x("destroy");for(const S of Object.values(f))S==null||S.destroy(Q);for(const S of g)S();return o&&(o.style.aspectRatio="",o.style.maxWidth="",o.style.maxHeight=""),i&&(i.style.width="",i.style.height="",i.style.transform=""),o=void 0,r=void 0,i=void 0,p=Object.assign({},nt),d=Object.assign({},nt),l==null||l.destroy(),l=void 0,s==null||s.destroy(),s=void 0,c=4,Q},emit:x,execute:M,getBoundaries:ee,getContainer:function(){return e},getFullDim:E,getGestures:function(){return s},getMousemovePos:R,getOptions:function(){return h},getScale:D,getState:function(){return c},getTransform:function(S){return S===!0?d:p},getTween:function(){return l},getViewport:function(){return i},getWrapper:function(){return o},init:function(){return c=0,x("init"),function(){for(const[S,N]of Object.entries(Object.assign(Object.assign({},a),h.plugins||{})))if(S&&!f[S]&&N instanceof Function){const I=N();I.init(Q),f[S]=I}x("initPlugins")}(),function(){if(!e)return;const S=Object.assign(Object.assign({},Ea.classes),y("classes"));if(Te(e,S.container),r=e.querySelector("."+S.content),!!r&&(r.setAttribute("draggable","false"),o=e.querySelector("."+S.wrapper),o||(o=document.createElement("div"),Te(o,S.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),r instanceof HTMLImageElement||r instanceof HTMLPictureElement)){if(i=e.querySelector("."+S.viewport),!i){i=document.createElement("div"),Te(i,S.viewport);const N=r.cloneNode(!0);N.classList.remove("is-lazyloading"),N.classList.remove("is-lazyloaded"),i.insertAdjacentElement("afterbegin",N),o.insertAdjacentElement("beforeend",i)}if(r instanceof HTMLPictureElement&&(r=r.querySelector("img")),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),i.style.visibility="hidden",y("protected")){i.addEventListener("contextmenu",I=>{I.preventDefault()});const N=document.createElement("div");Te(N,"f-panzoom__protected"),i.appendChild(N)}x("initLayout")}}(),function(){if(!(r&&r instanceof HTMLImageElement))return;c=1,x("loading");const S=()=>{r&&r instanceof HTMLImageElement&&r.decode().then(()=>{requestAnimationFrame(()=>{O()})}).catch(()=>{O()})};if(r.src&&r.complete)return void S();(function(){const N=e==null?void 0:e.querySelector(".f-spinner");if(!e||N)return;const I=y("spinnerTpl"),H=kt(I);H&&(H.classList.add("f-spinner"),e.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",H))})(),r.addEventListener("load",S,!1),r.addEventListener("error",S,!1),g.push(()=>{r==null||r.removeEventListener("load",S,!1),r==null||r.removeEventListener("error",S,!1)})}(),function(){if(e&&o&&!u){let S=null;u=new ResizeObserver(()=>{S||(S=requestAnimationFrame(()=>{e&&e.parentElement&&c===3&&(V(),pe(),x("refresh")),S=null}))}),u.observe(o),g.push(()=>{u==null||u.disconnect(),u=void 0,S&&(cancelAnimationFrame(S),S=null)})}}(),Q},isDragging:Be,isExpanded:G,isFullsize:ne,localize:function(S,N=[]){const I=y("l10n")||{};S=String(S).replace(/\{\{(\w+)\}\}/g,(H,X)=>I[X]||H);for(let H=0;H<N.length;H++)S=S.split(N[H][0]).join(N[H][1]);return S=S.replace(/\{\{(.*?)\}\}/g,(H,X)=>X)},off:function(S,N){for(const I of S instanceof Array?S:[S])k.has(I)&&k.set(I,k.get(I).filter(H=>H!==N));return Q},on:function(S,N){for(const I of S instanceof Array?S:[S])k.set(I,[...k.get(I)||[],N]);return Q},version:"6.0.16",willZoomIn:se,willZoomOut:be};return Q};va.l10n={en_EN:wa},va.getDefaults=()=>Ea;/*! License details at fancyapps.com/license */const Ca=(e,n)=>{let a=[];return e.childNodes.forEach(o=>{o.nodeType!==Node.ELEMENT_NODE||n&&!o.matches(n)||a.push(o)}),a};/*! License details at fancyapps.com/license */const at=(e,...n)=>{const a=n.length;for(let o=0;o<a;o++){const r=n[o]||{};Object.entries(r).forEach(([i,s])=>{const l=Array.isArray(s)?[]:{};e[i]||Object.assign(e,{[i]:l}),Ue(s)?Object.assign(e[i],at(l,s)):Array.isArray(s)?Object.assign(e,{[i]:[...s]}):Object.assign(e,{[i]:s})})}return e};/*! License details at fancyapps.com/license */const Sa=function(e=0,n=0,a=0,o=0,r=0,i=!1){const s=(e-n)/(a-n)*(r-o)+o;return i?o<r?De(o,s,r):De(r,s,o):s};/*! License details at fancyapps.com/license */const ft=(e,n="")=>{e&&e.classList&&n.split(" ").forEach(a=>{a&&e.classList.remove(a)})};/*! License details at fancyapps.com/license */const vt=(e,n="",a)=>{e&&e.classList&&n.split(" ").forEach(o=>{o&&e.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Ba=Object.assign(Object.assign({},wa),{ERROR:"Something went wrong. <br /> Please try again later.",NEXT:"Next page",PREV:"Previous page",GOTO:"Go to page #%d",DOWNLOAD:"Download",TOGGLE_FULLSCREEN:"Toggle full-screen mode",TOGGLE_EXPAND:"Toggle full-size mode",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_AUTOPLAY:"Toggle slideshow"});/*! License details at fancyapps.com/license */const It=e=>{e.cancelable&&e.preventDefault()},qt={adaptiveHeight:!1,center:!0,classes:{container:"f-carousel",isEnabled:"is-enabled",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",hasAdaptiveHeight:"has-adaptive-height",viewport:"f-carousel__viewport",slide:"f-carousel__slide",isSelected:"is-selected"},dragFree:!1,enabled:!0,errorTpl:'<div class="f-html">{{ERROR}}</div>',fill:!1,infinite:!0,initialPage:0,l10n:Ba,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:200,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1};let E1,v1=0;const Ln=(e,n={},a={})=>{v1++;let o,r,i,s,l,u=0,m=Object.assign({},qt),c=Object.assign({},qt),h={},f=null,p=null,d=!1,g=!1,y=!1,k=!1,x="height",b=0,v=!0,C=0,O=0,_=0,E=0,w="*",R=[],D=[];const P=new Set;let T=[],A=[],z=0,ie=0;function ee(B,...F){let q=c[B];return q&&q instanceof Function?q(ye,...F):q}function pe(B,F=[]){const q=ee("l10n")||{};B=String(B).replace(/\{\{(\w+)\}\}/g,(Y,me)=>q[me]||Y);for(let Y=0;Y<F.length;Y++)B=B.split(F[Y][0]).join(F[Y][1]);return B=B.replace(/\{\{(.*?)\}\}/g,(Y,me)=>me)}const V=new Map;function M(B,...F){const q=V.get(B)||[];c.on&&q.push(c.on[B]);for(const Y of q)Y&&Y instanceof Function&&Y(ye,...F);B!=="*"&&M("*",B,...F)}function j(){var B,F;const q=at({},qt,m);at(q,qt,m);let Y="";const me=m.breakpoints||{};if(me)for(const[te,oe]of Object.entries(me))window.matchMedia(te).matches&&(Y+=te,at(q,oe));if(l===void 0||Y!==l){if(l=Y,u!==0){let te=(F=(B=A[C])===null||B===void 0?void 0:B.slides[0])===null||F===void 0?void 0:F.index;te===void 0&&(te=c.initialSlide),q.initialSlide=te,q.slides=[];for(const oe of R)oe.isVirtual&&q.slides.push(oe)}Ee(),c=q,c.enabled!==!1&&(u=0,M("init"),function(){for(const[te,oe]of Object.entries(Object.assign(Object.assign({},a),c.plugins||{})))if(te&&!h[te]&&oe instanceof Function){const ue=oe();ue.init(ye,Ln),h[te]=ue}M("initPlugins")}(),function(){if(!f)return;const te=ee("classes")||{};Te(f,te.container),Te(f,te.isEnabled);const oe=ee("style");if(oe&&Ue(oe))for(const[ue,$]of Object.entries(oe))f.style.setProperty(ue,$);p=f.querySelector(`.${te.viewport}`),p||(p=document.createElement("div"),Te(p,te.viewport),p.append(...Ca(f,`.${te.slide}`)),f.insertAdjacentElement("afterbegin",p)),d=window.getComputedStyle(p).getPropertyValue("overflow")==="visible",f.carousel=ye,M("initLayout")}(),function(){if(!p)return;const te=ee("classes")||{};R=[],[...Ca(p,`.${te.slide}`)].forEach(oe=>{oe.parentElement&&(R.push(N(Object.assign({el:oe,isVirtual:!1},oe.dataset||{}))),oe.parentElement.removeChild(oe))}),S(ee("slides"));for(const oe of R)M("addSlide",oe);M("initSlides")}(),r=bt().on("start",()=>{v=!1,o&&o.isPointerDown()||(be(),ce())}).on("step",te=>{b=te.pos,ce()}).on("end",te=>{o!=null&&o.isPointerDown()||(b=te.pos,r&&!g&&(b<_||b>E)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:De(_,b,E)}).start():v||(v=!0,M("settle")))}),function(){const te=ee("gestures");p&&te!==!1&&(o=tn(p,te).on("start",oe=>{var ue,$;if(!r)return;const{srcEvent:Z}=oe;function le(ve){const Me=window.getComputedStyle(ve),Ne=new DOMMatrixReadOnly(Me.transform);return{width:Ne.m41||0,height:Ne.m42||0}}k&&It(Z),r.pause(),r.getCurrentVelocities().pos=0;const xe=(ue=A[C])===null||ue===void 0?void 0:ue.slides[0];xe&&P.has(xe.index)&&xe.el&&(b=xe.offset||0,b+=(le(xe.el)[x]||0)*(y&&!k?1:-1)),we(),g||(b<_||b>E)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:(($=r.getCurrentVelocities())===null||$===void 0?void 0:$.pos)||0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:De(_,b,E)}).start()}).on("move",oe=>{const{srcEvent:ue,axis:$}=oe,Z=oe.srcEvent.target;Z&&Jt(Z)||($||(ue.stopPropagation(),ue.stopImmediatePropagation()),($==="y"&&k||$==="x"&&!k)&&(It(ue),ue.stopPropagation()))}).on("panstart",oe=>{(oe==null?void 0:oe.axis)===(k?"y":"x")&&Te(p,"is-dragging")}).on("panend",()=>{ft(p,"is-dragging")}).on("pan",oe=>{var ue;const{deltaX:$,deltaY:Z,currentTouch:le,axis:xe}=oe;if(!r||le.length>1||xe==="y"&&!k||xe==="x"&&k)return;const ve=y&&!k?1:-1;let Me=k?Z:$,Ne=r!=null&&r.isRunning()?r.getEndValues().pos:b,Ve=1;g||(Ne<=_&&Me*ve<0?(Ve=Math.max(.01,1-Math.abs(1/G()*Math.abs(Ne-_))),Ve*=.2):Ne>=E&&Me*ve>0&&(Ve=Math.max(.01,1-Math.abs(1/G()*Math.abs(Ne-E))),Ve*=.2)),Ne+=Me*Ve*ve,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:((ue=r.getCurrentVelocities())===null||ue===void 0?void 0:ue.pos)||0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Ne}).start()}).on("end",oe=>{var ue,$;const{axis:Z,velocityX:le,velocityY:xe,currentTouch:ve}=oe,Me=A.length,Ne=ee("dragFree");if(ve.length>0||!r||!Me)return;const Ve=ee("vertical")?xe:le;let Re=r!=null&&r.isRunning()?r.getEndValues().pos:b;const et=y&&!k?1:-1;if(Re+=Ve*(Ne?5:1)*et,!g&&(Ve*et<=0&&Re<_||Ve*et>=0&&Re>E)){let Ge=0;return Math.abs(Ve)>0&&(Ge=2*Math.abs(Ve),Ge=Math.min(.3*G(),Ge)),Re=De(_+-1*Ge,Re,E+Ge),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*Ve,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Re}).start()}if(Ne||!((ue=h.Autoscroll)===null||ue===void 0)&&ue.isEnabled())return void(Math.abs(Ve)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*Ve,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Re}).start():r.isRunning()||v||(v=!0,M("settle")));if(!Ne&&!(!(($=h.Autoscroll)===null||$===void 0)&&$.isEnabled())&&(!oe.offsetX&&!oe.offsetY||Z==="y"&&!k||Z==="x"&&k))return void ae(C,{transition:"tween"});let ot=Oe(Re);Math.abs(Ve)>10&&ot===C&&(ot+=Ve>0?y&&!k?1:-1:y&&!k?-1:1),ae(ot,{transition:"tween",tween:{tension:160,friction:25,velocity:-1*Ve}})}).init())}(),J(),function(){if(f&&(f.addEventListener("click",he,{passive:!1}),document.addEventListener("mousemove",re),!i)){let te=null;i=new ResizeObserver(oe=>{te||(te=requestAnimationFrame(()=>{(function(ue){if(!f)return;let $=ue[0].contentBoxSize[0].blockSize,Z=ue[0].contentBoxSize[0].inlineSize;if(u===0)return z=$,ie=Z,u=1,ce(),Ce(),void M("ready");if(u!==1)return;const le=A.length;J();const xe=f.getBoundingClientRect();$=xe.height,Z=xe.width,le>1&&(k&&Math.abs($-z)<.5||!k&&Math.abs(Z-ie)<.5)||(z=$,ie=Z,k&&!$||!k&&!Z||f&&p&&(le===A.length&&(o!=null&&o.isPointerDown())||(ee("dragFree")&&(g||b>_&&b<E)?(be(),ce()):ae(C,{transition:!1}))))})(oe),te=null}))}),i.observe(f)}}())}}function re(B){E1=B}function se(B="*"){var F;const q=[];for(const Y of R)(B==="*"||Y.class&&Y.class.includes(B)||Y.el&&(!((F=Y.el)===null||F===void 0)&&F.classList.contains(B)))&&q.push(Y);s=void 0,w=B,D=[...q]}function be(){if(!r)return;const B=Oe(r!=null&&r.isRunning()?r.getEndValues().pos:b);B!==C&&(s=C,C=B,K(),Ce(),Le(),M("change",C,s))}function Ce(){var B;if(!f)return;vt(p,"is-draggable",!!o&&A.length>0);for(const Y of f.querySelectorAll("[data-carousel-index]"))Y.innerHTML=C+"";for(const Y of f.querySelectorAll("[data-carousel-page]"))Y.innerHTML=C+1+"";for(const Y of f.querySelectorAll("[data-carousel-pages]"))Y.innerHTML=A.length+"";let F=!1;const q=(B=A[C])===null||B===void 0?void 0:B.slides[0];q&&(q.downloadSrc||q.type==="image"&&q.src)&&(F=!0);for(const Y of f.querySelectorAll("[data-carousel-download]"))Y.toggleAttribute("aria-disabled",!F)}function Le(B){var F;if(!f)return;B||(B=(F=A[C])===null||F===void 0?void 0:F.slides[0]);const q=B.el;if(q)for(const Y of q.querySelectorAll("[data-slide-index]"))Y.innerHTML=B.index+1+""}function Oe(B){if(!A.length||!r)return 0;const F=ne();let q=B;g?q-=Math.floor((B-A[0].pos)/F)*F:q=De(A[0].pos,B,A[A.length-1].pos);const Y=new Map;let me=0;for(const oe of A){const ue=Math.abs(oe.pos-q),$=Math.abs(oe.pos-q-F),Z=Math.abs(oe.pos-q+F),le=Math.min(ue,$,Z);Y.set(me,le),me++}const te=Y.size>0?[...Y.entries()].reduce((oe,ue)=>ue[1]<oe[1]?ue:oe):[C,0];return parseInt(te[0])}function Be(){return p&&parseFloat(getComputedStyle(p).getPropertyValue("--f-carousel-gap"))||0}function G(){return p&&p.getBoundingClientRect()[x]||0}function ne(B=!0){const F=Be();return D.reduce((q,Y)=>q+Y.dim,0)+(D.length-(g&&B?0:1))*F}function Q(B){const F=Be(),q=ne();let Y=G();if(!p)return[];const me=[];if(!q||!Y)return[];B=B===void 0?b:B,g&&(B-=Math.floor(B/q)*q);let te=0,oe=0;if(d){const $=p.getBoundingClientRect();te=$.left,oe=$.right-$.width}let ue=0;for(let $ of D){const Z=(le=0)=>{me.indexOf($)>-1||($.pos=ue-B+le||0,$.offset+le>B-$.dim-te+.51&&$.offset+le<B+Y+oe-.51&&me.push($))};if($.offset=ue,g)for(let le=-1;le<=1;le++)Z(q*le);else Z();ue+=$.dim+F}return me}function S(B,F){const q=[];for(const Y of Array.isArray(B)?B:[B]){const me=N(Object.assign(Object.assign({},Y),{isVirtual:!0}));q.push(me)}R.splice(F===void 0?R.length:F,0,...q),U();for(const Y of q)I(Y);return se(w),q}function N(B){return(je(B)||B instanceof HTMLElement)&&(B={html:B}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},B)}function I(B){if(!B)return;let F=B.el;F||(F=document.createElement("div"),B.el=F);const q=B.html?B.html instanceof HTMLElement?B.html:kt(B.html):void 0;q&&(Te(q,"f-html"),B.htmlEl=q,Te(F,"has-html"),F.append(q),M("contentReady",B))}function H(B){if(!p||!B)return;let F=B.el;if(F){if(F.setAttribute("index",B.index+""),F.parentElement!==p){let q;Te(F,c.classes.slide),Te(F,B.class),K(B);for(const Y of R)if(Y.index>B.index){q=Y.el;break}p.insertBefore(F,q&&p.contains(q)?q:null),M("attachSlideEl",B)}return F}}function X(B){const F=B==null?void 0:B.el;F&&(F.remove(),de(F),M("detachSlideEl",B))}function U(){for(let B=0;B<R.length;B++){const F=R[B],q=F.el;q&&(F.index!==B&&de(q),q.setAttribute("index",`${B}`)),F.index=B}}function J(){var B,F,q,Y;if(!f||!p)return;y=ee("rtl"),k=ee("vertical"),x=k?"height":"width";const me=ee("classes");vt(f,me.isLTR,!y),vt(f,me.isRTL,y),vt(f,me.isHorizontal,!k),vt(f,me.isVertical,k),vt(f,me.hasAdaptiveHeight,ee("adaptiveHeight"));const te=p.getBoundingClientRect();if(!te.width&&!te.height)return;const oe=function(){let $=0;if(p){let Z=document.createElement("div");Te(Z,c.classes.slide),p.appendChild(Z),$=Z.getBoundingClientRect()[x],Z.remove(),Z=void 0}return $}();for(const $ of D){const Z=$.el;let le=0;if(!$.isVirtual&&Z&&zt(Z)){let xe=!1;Z.parentElement&&Z.parentElement===p||(p.appendChild(Z),xe=!0),le=Z.getBoundingClientRect()[x],xe&&((B=Z.parentElement)===null||B===void 0||B.removeChild(Z))}else le=oe;$.dim=le}(function(){if(!f)return;U();const $=G(),Z=Be(),le=ne(!1);let xe=ee("slidesPerPage");xe=xe==="auto"?1/0:parseFloat(xe+""),A=[];let ve=0,Me=0;for(const $e of D)(!A.length||ve+$e.dim-$>.05||Me>=xe)&&(A.push({index:A.length,slides:[],dim:0,offset:0,pos:0}),ve=0,Me=0),A[A.length-1].slides.push($e),ve+=$e.dim+Z,Me++;const Ne=ee("center"),Ve=ee("fill"),Re=ee("infinite");let et=0;for(const $e of A){$e.dim=($e.slides.length-1)*Z;for(const Bt of $e.slides)$e.dim+=Bt.dim;$e.offset=et,$e.pos=et,Ne!==!1&&($e.pos-=.5*($-$e.dim)),Ve&&!Re&&le>$&&($e.pos=De(0,$e.pos,le-$)),et+=$e.dim+Z}const ot=[];let Ge;for(const $e of A){const Bt=Object.assign({},$e);Ge&&Bt.pos===Ge.pos?(Ge.dim+=Bt.dim,Ge.slides=[...Ge.slides,...Bt.slides]):(Ge=Bt,Bt.index=ot.length,ot.push(Bt))}A=ot,Ce()})();let ue=G();if(d){const $=p.getBoundingClientRect();ue+=$.left,ue+=$.right-$.width}if(g=ee("infinite")&&A.length>1&&ne()-(ue+(((F=D[0])===null||F===void 0?void 0:F.dim)||0))>-.5,_=((q=A[0])===null||q===void 0?void 0:q.pos)||0,E=((Y=A[A.length-1])===null||Y===void 0?void 0:Y.pos)||0,u===0)(function(){var $;s=void 0,C=ee("initialPage");const Z=ee("initialSlide")||void 0;Z!==void 0&&(C=ye.getPageIndex(Z)||0),C=De(0,C,A.length-1),b=(($=A[C])===null||$===void 0?void 0:$.pos)||0,O=b})();else{const $=r!=null&&r.isRunning()?r.getEndValues().pos:b;($<_||$>E)&&(C=De(0,C,A.length-1),O=A[C||0].pos||0)}M("refresh")}function de(B){if(!B||!zt(B))return;const F=parseInt(B.getAttribute("index")||"-1");let q="";for(const me of Array.from(B.classList)){const te=me.match(/^f-(\w+)(Out|In)$/);te&&te[1]&&(q=te[1]+"")}if(!B||!q)return;const Y=[`f-${q}Out`,`f-${q}In`,"to-prev","to-next","from-prev","from-next"];B.removeEventListener("animationend",ke),ft(B,Y.join(" ")),P.delete(F)}function we(){if(!p)return;const B=P.size;for(const F of D)de(F.el);P.clear(),B&&ce()}function ke(B){B.animationName.substring(0,2)==="f-"&&(de(B.target),P.size||(ft(f,"in-transition"),!v&&Math.abs(ye.getPosition(!0)-O)<.5&&(v=!0,M("settle"))),ce())}function he(B){if(B.defaultPrevented)return;const F=B.composedPath()[0];if(F.closest("[data-carousel-go-prev]"))return It(B),void ye.prev();if(F.closest("[data-carousel-go-next]"))return It(B),void ye.next();const q=F.closest("[data-carousel-go-to]");if(q)return It(B),void ye.goTo(parseFloat(q.dataset.carouselGoTo||"")||0);if(F.closest("[data-carousel-download]")){It(B);const Y=A[C].slides[0];if(Y.downloadSrc||Y.type==="image"&&Y.src){const me=Y.downloadFilename,te=document.createElement("a"),oe=Y.downloadSrc||Y.src||"";te.href=oe,te.target="_blank",te.download=me||oe,te.click()}}else M("click",B)}function ge(B){var F;const q=B.el;q&&((F=q.querySelector(".f-spinner"))===null||F===void 0||F.remove(),ft(q,"is-loading"))}function L(B){var F;const q=B.el;q&&((F=q.querySelector(".f-html.is-error"))===null||F===void 0||F.remove(),ft(q,"has-error"))}function K(B){var F;B||(B=(F=A[C])===null||F===void 0?void 0:F.slides[0]);const q=B==null?void 0:B.el;if(!q)return;let Y=ee("formatCaption",B);Y===void 0&&(Y=B.caption),Y=Y||"";const me=ee("captionEl");if(me&&me instanceof HTMLElement){if(B.index!==C)return;if(je(Y)&&(me.innerHTML=pe(Y+"")),Y instanceof HTMLElement){if(Y.parentElement===me)return;me.innerHTML="",Y.parentElement&&(Y=Y.cloneNode(!0)),me.append(Y)}return}if(!Y)return;let te=B.captionEl||q.querySelector(".f-caption");!te&&Y instanceof HTMLElement&&Y.classList.contains("f-caption")&&(te=Y),te||(te=document.createElement("div"),Te(te,"f-caption"),je(Y)?te.innerHTML=pe(Y+""):Y instanceof HTMLElement&&(Y.parentElement&&(Y=Y.cloneNode(!0)),te.append(Y)));const oe=`f-caption-${v1}_${B.index}`;te.setAttribute("id",oe),te.dataset.selectable="true",Te(q,"has-caption"),q.setAttribute("aria-labelledby",oe),B.captionEl=te,q.insertAdjacentElement("beforeend",te)}function ae(B,F){let{transition:q,tween:Y}=Object.assign({transition:c.transition,tween:c.tween},F||{});if(!f||!r)return;const me=A.length;if(!me||function(oe,ue){var $,Z,le,xe;if(!(f&&r&&ue&&je(ue)&&ue!=="tween")||(($=A[C])===null||$===void 0?void 0:$.slides.length)>1)return!1;const ve=A.length;let Me=oe>C?1:-1;oe=g?(oe%ve+ve)%ve:De(0,oe,ve-1),y&&(Me*=-1);const Ne=(Z=A[C])===null||Z===void 0?void 0:Z.slides[0],Ve=Ne==null?void 0:Ne.index,Re=(le=A[oe])===null||le===void 0?void 0:le.slides[0],et=Re==null?void 0:Re.index,ot=(xe=A[oe])===null||xe===void 0?void 0:xe.pos;if(et===void 0||Ve===void 0||Ve===et||b===ot||Math.abs(G()-((Re==null?void 0:Re.dim)||0))>1)return!1;v=!1,r.pause(),we(),Te(f,"in-transition"),b=O=ot;const Ge=H(Ne),$e=H(Re);return be(),Ge&&(P.add(Ve),Ge.style.transform="",Ge.addEventListener("animationend",ke),ft(Ge,c.classes.isSelected),Te(Ge,`f-${ue}Out to-${Me>0?"next":"prev"}`)),$e&&(P.add(et),$e.style.transform="",$e.addEventListener("animationend",ke),Te($e,c.classes.isSelected),Te($e,`f-${ue}In from-${Me>0?"prev":"next"}`)),ce(),!0}(B,q))return;B=g?(B%me+me)%me:De(0,B,me-1),O=A[B||0].pos||0;const te=r.isRunning()?r.getEndValues().pos:b;if(Math.abs(O-te)<1)return b=O,C!==B&&(K(),Ce(),Le(),s=C,C=B,M("change",C,s)),ce(),void(v||(v=!0,M("settle")));if(r.pause(),we(),g){const oe=ne(),ue=Math.floor((te-A[0].pos)/oe),$=O+ue*oe;O=[$+oe,$,$-oe].reduce(function(Z,le){return Math.abs(le-te)<Math.abs(Z-te)?le:Z})}q!==!1&&Ue(Y)?r.spring(Y).from({pos:b}).to({pos:O}).start():(b=O,be(),ce(),v||(v=!0,M("settle")))}function ce(){var B;if(!f||!p)return;const F=A[C];T=Q();const q=new Set;let Y;const me=[];for(const te of D){if(te.isVirtual&&!P.has(te.index)&&T.indexOf(te)<0)continue;let oe=H(te);if(!oe)continue;me.push(te);const ue=((B=F==null?void 0:F.slides)===null||B===void 0?void 0:B.indexOf(te))>-1;if(ue&&q.add(oe),!P.has(te.index)){const $=te.pos?Math.round(1e4*te.pos)/1e4:0,Z=k?0:y?-1*$:$,le=k?$:0,xe=Sa(Z,0,te.dim,0,100),ve=Sa(le,0,te.dim,0,100),Me=c.setTransform||void 0;Me instanceof Function?Me(ye,te,{x:Z,y:le,xPercent:xe,yPercent:ve}):oe.style.transform=Z||le?`translate3d(${xe}%, ${ve}%,0)`:""}if(ee("adaptiveHeight")&&ue){const $=(oe.firstElementChild||oe).getBoundingClientRect().height;Y=Y==null?$:Math.max(Y,$)}}[...Ca(p,`.${c.classes.slide}`)].forEach(te=>{const oe=parseInt(te.getAttribute("index")||"-1"),ue=R[oe];ue||te.remove(),vt(te,c.classes.isSelected,q.has(te)),ue.isVirtual&&!P.has(ue.index)&&T.indexOf(ue)<0&&X(ue)}),p&&Y&&(p.style.height=`${Y}px`),M("render",me)}function Ee(){var B;f==null||f.removeEventListener("click",he),we(),document.removeEventListener("mousemove",re),i==null||i.disconnect(),i=void 0;for(const F of R)F.el&&zt(F.el)&&(F.state=void 0,ge(F),L(F),X(F),F.isVirtual?((B=F.el)===null||B===void 0||B.remove(),F.el=void 0):(F.el.style.transform="",p==null||p.appendChild(F.el)));for(const F of Object.values(h))F==null||F.destroy();h={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const F of Object.values(c.classes||{}))ft(f,F);ft(p,"is-draggable")}const ye={add:function(B,F){const q=b,Y=O,me=S(B,F);for(const te of me)M("addSlide",te);return se(w),J(),r&&Y!==O&&r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:q}).to({pos:O}).start(),ce(),ye},canGoPrev:function(){return g||C>0},canGoNext:function(){return g||C<A.length-1},destroy:function(){return M("destroy"),window.removeEventListener("resize",j),Ee(),V.clear(),f=null,A=[],R=[],c=Object.assign({},qt),h={},D=[],l="",w="*",u=2,ye},emit:M,filter:function(B="*"){return se(B),J(),ce(),M("filter",B),ye},getContainer:function(){return f},getGapDim:Be,getGestures:function(){return o},getLastMouseMove:function(){return E1},getOptions:function(){return c},getPage:function(){return A[C]},getPageIndex:function(B){if(B!==void 0){for(const F of A||[])for(const q of F.slides)if(q.index===B)return F.index;return-1}return C},getPageProgress:function(B,F){B===void 0&&(B=C);const q=A[B];if(!q)return B>C?-1:1;const Y=ne(),me=Be();let te=q.pos,oe=ye.getPosition();if(g&&F!==!0){const ue=Math.floor((oe-A[0].pos)/Y);oe-=ue*Y,te=[te+Y,te,te-Y].reduce(function($,Z){return Math.abs(Z-oe)<Math.abs($-oe)?Z:$})}return(oe-te)/(q.dim+me)},getPageVisibility:function(B){B===void 0&&(B=C);const F=A[B];if(!F)return B>C?-1:1;const q=ye.getPosition(),Y=G();let me=F.pos;if(g){const te=ye.getPosition(),oe=ne(),ue=me+Math.floor((te-A[0].pos)/oe)*oe;me=[ue+oe,ue,ue-oe].reduce(function($,Z){return Math.abs(Z-te)<Math.abs($-te)?Z:$})}return me>q&&me+F.dim<q+Y?1:me<q?(me+F.dim-q)/F.dim:me+F.dim>q+Y?(q+Y-me)/F.dim:0},getPages:function(){return A},getPlugins:function(){return h},getPosition:function(B){var F;let q=b;if(g&&B!==!0){const Y=ne();q-=Math.floor((b-((F=A[0])===null||F===void 0?void 0:F.pos)||0)/Y)*Y}return q},getSlides:function(){return R},getState:function(){return u},getTotalSlideDim:ne,getTween:function(){return r},getViewport:function(){return p},getViewportDim:G,getVisibleSlides:function(B){return B===void 0?T:Q(B)},goTo:ae,hasNavigated:function(){return s!==void 0},hideError:L,hideLoading:ge,init:function(){if(!e||!zt(e))throw new Error("No Element found");return u!==0&&(Ee(),u=0),f=e,m=n,window.removeEventListener("resize",j),m.breakpoints&&window.addEventListener("resize",j),j(),ye},isInfinite:function(){return g},isInTransition:function(){return P.size>0},isRTL:function(){return y},isSettled:function(){return v},localize:function(B,F=[]){return pe(B,F)},next:function(B={}){return ae(C+1,B),ye},off:function(B,F){for(const q of B instanceof Array?B:[B])V.has(q)&&V.set(q,V.get(q).filter(Y=>Y!==F));return ye},on:function(B,F){for(const q of B instanceof Array?B:[B])V.set(q,[...V.get(q)||[],F]);return ye},prev:function(B={}){return ae(C-1,B),ye},remove:function(B){B===void 0&&(B=R.length-1);const F=R[B];return F&&(M("removeSlide",F),F.el&&(de(F.el),F.el.remove(),F.el=void 0),R.splice(B,1),se(w),J(),ce()),ye},setPosition:function(B){b=B,be(),ce()},showError:function(B,F){ge(B),L(B);const q=B.el;if(q){const Y=document.createElement("div");Te(Y,"f-html"),Te(Y,"is-error"),Y.innerHTML=pe(F||"<p>{{ERROR}}</p>"),B.htmlEl=Y,Te(q,"has-html"),Te(q,"has-error"),q.insertAdjacentElement("afterbegin",Y),M("contentReady",B)}return ye},showLoading:function(B){const F=B.el,q=F==null?void 0:F.querySelector(".f-spinner");if(!F||q)return ye;const Y=ee("spinnerTpl"),me=kt(Y);return me&&(Te(me,"f-spinner"),Te(F,"is-loading"),F.insertAdjacentElement("beforeend",me)),ye},version:"6.0.16"};return ye};Ln.l10n={en_EN:Ba},Ln.getDefaults=()=>qt;/*! License details at fancyapps.com/license */const C1=(e=!0,n="--f-scrollbar-compensate",a="--f-body-margin",o="hide-scrollbar")=>{const r=document,i=r.body,s=r.documentElement;if(e){if(i.classList.contains(o))return;let l=window.innerWidth-s.getBoundingClientRect().width;l<0&&(l=0),s.style.setProperty(n,`${l}px`);const u=parseFloat(window.getComputedStyle(i).marginRight);u&&i.style.setProperty(a,`${u}px`),i.classList.add(o)}else i.classList.remove(o),i.style.setProperty(a,""),r.documentElement.style.setProperty(n,"")};/*! License details at fancyapps.com/license */function S1(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const Ct=function(e="",n="",a=""){return e.split(n).join(a)};/*! License details at fancyapps.com/license */const B1={tpl:e=>`<img class="f-panzoom__content"
|
|
6
|
+
`+i):o.stack=i}catch{}}throw o}}_request(n,a){typeof n=="string"?(a=a||{},a.url=n):a=n||{},a=At(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:i}=a;o!==void 0&&En.assertOptions(o,{silentJSONParsing:lt.transitional(lt.boolean),forcedJSONParsing:lt.transitional(lt.boolean),clarifyTimeoutError:lt.transitional(lt.boolean)},!1),r!=null&&(W.isFunction(r)?a.paramsSerializer={serialize:r}:En.assertOptions(r,{encode:lt.function,serialize:lt.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),En.assertOptions(a,{baseUrl:lt.spelling("baseURL"),withXsrfToken:lt.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let s=i&&W.merge(i.common,i[a.method]);i&&W.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),a.headers=Qe.concat(s,i);const l=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(u=u&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const m=[];this.interceptors.response.forEach(function(g){m.push(g.fulfilled,g.rejected)});let c,h=0,f;if(!u){const d=[Oo.bind(this),void 0];for(d.unshift.apply(d,l),d.push.apply(d,m),f=d.length,c=Promise.resolve(a);h<f;)c=c.then(d[h++],d[h++]);return c}f=l.length;let p=a;for(h=0;h<f;){const d=l[h++],g=l[h++];try{p=d(p)}catch(y){g.call(this,y);break}}try{c=Oo.call(this,p)}catch(d){return Promise.reject(d)}for(h=0,f=m.length;h<f;)c=c.then(m[h++],m[h++]);return c}getUri(n){n=At(this.defaults,n);const a=Bo(n.baseURL,n.url,n.allowAbsoluteUrls);return yo(a,n.params,n.paramsSerializer)}};W.forEach(["delete","get","head","options"],function(n){Nt.prototype[n]=function(a,o){return this.request(At(o||{},{method:n,url:a,data:(o||{}).data}))}}),W.forEach(["post","put","patch"],function(n){function a(o){return function(i,s,l){return this.request(At(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Nt.prototype[n]=a(),Nt.prototype[n+"Form"]=a(!0)});let Zi=class a0{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const o=this;this.promise.then(r=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](r);o._listeners=null}),this.promise.then=r=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(r);return s.cancel=function(){o.unsubscribe(i)},s},n(function(i,s,l){o.reason||(o.reason=new Pt(i,s,l),a(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const a=this._listeners.indexOf(n);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const n=new AbortController,a=o=>{n.abort(o)};return this.subscribe(a),n.signal.unsubscribe=()=>this.unsubscribe(a),n.signal}static source(){let n;return{token:new a0(function(r){n=r}),cancel:n}}};function Xi(e){return function(a){return e.apply(null,a)}}function Ki(e){return W.isObject(e)&&e.isAxiosError===!0}const ia={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};Object.entries(ia).forEach(([e,n])=>{ia[n]=e});function _o(e){const n=new Nt(e),a=to(Nt.prototype.request,n);return W.extend(a,Nt.prototype,n,{allOwnKeys:!0}),W.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return _o(At(e,r))},a}const He=_o(Xt);He.Axios=Nt,He.CanceledError=Pt,He.CancelToken=Zi,He.isCancel=Eo,He.VERSION=Po,He.toFormData=gn,He.AxiosError=Se,He.Cancel=He.CanceledError,He.all=function(n){return Promise.all(n)},He.spread=Xi,He.isAxiosError=Ki,He.mergeConfig=At,He.AxiosHeaders=Qe,He.formToJSON=e=>bo(W.isHTMLForm(e)?new FormData(e):e),He.getAdapter=Lo.getAdapter,He.HttpStatusCode=ia,He.default=He;const{Axios:yy,AxiosError:ky,CanceledError:xy,isCancel:by,CancelToken:wy,VERSION:Ey,all:vy,Cancel:Cy,isAxiosError:Sy,spread:By,toFormData:My,AxiosHeaders:Vy,HttpStatusCode:Ay,formToJSON:Ny,getAdapter:Dy,mergeConfig:Ty}=He,Ro=Mt.defineStore("auth",{state:()=>({jwtToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzQwMDY5MzIyLCJpYXQiOjE3Mzk5ODI5MjIsImp0aSI6IjcyZjcxYjgzY2I5YTQ1MWFhMmYyODQ0OTlmZGFkZWIxIiwidXNlcl9pZCI6ImU4YTAwNWZhLTk0YjUtNDRiOC05ZDkwLWZjNzJmYzI0NjRhOSJ9.IOzqjqDpRRfqsvqhzEsGDLhQOKWapjzFycNG3Qv8k0U"}),actions:{setToken(e){this.jwtToken=e},clearToken(){this.jwtToken=null}},getters:{getToken:e=>e.jwtToken}}),it=He.create({baseURL:"https://back.dev-smclick.com.br/"});it.interceptors.request.use(e=>{const a=Ro().getToken;return a&&(e.headers.Authorization=`Bearer ${a}`),e},e=>Promise.reject(e));const Qi="v1/api/attendances/attendant/",Ji="v1/api/attendances/department/",sa="v1/api/attendances/internal_chat/",es="v1/api/instances/instance/",ts="v1/api/crm/event/scheduled_message/",ns="v1/api/crm/event/calendar",la=Mt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(e=""){try{let n=`${es}`;const a=await it.get(n);this.instances=a.data,await Promise.all(this.instances.map(async o=>{o.isLoading=!0;try{const r=o.last_instance_status;r==="DISCONNECTED"||r==="UNDEFINED"?o.status=!1:o.status=!0}catch(r){console.log(r),o.status="Offline"}o.isLoading=!1})),this.count=this.instances.length,this.loaded=!0}catch(n){console.log("Erro ao buscar instâncias:",n),this.loaded=!0}},removeInstance(e){this.instances=this.instances.filter(n=>n.id!==e),this.count=this.instances.length},addInstance(e){const n=this.instances.findIndex(a=>a.id===e.id);n!==-1?this.instances[n]=e:this.instances.push(e),this.count=this.instances.length}}}),as={class:"w-full relative text-current"},os={class:"flex cursor-pointer justify-between items-center"},rs={key:0},is={key:0},ss={key:1,class:"flex items-center gap-2"},ls={class:"flex gap-3 items-center flex-shrink-0"},cs={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},ds={key:1,class:"relative"},us={style:{color:"#0081FB",width:"20px",height:"20px"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},fs={class:"my-auto text-center mx-auto group-hover:inline-block"},ms={key:1,class:"flex justify-center"},hs={class:"w-full"},ps={key:1,class:"flex items-center gap-2 justify-center"},gs={class:"flex px-4 items-center gap-2"},ys={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},ks={class:"gap-2 rounded-b-lg flex overflow-y-auto p-2 shadow shadow-black dark:shadow-gray-400 bg-base-300 max-h-[200px] flex-col"},xs={class:"select-none cursor-pointer w-full"},bs=["onClick","disabled"],ws={class:"flex w-full items-center pl-2 gap-3"},Es={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4 flex-shrink-0 text-green-400",viewBox:"0 0 16 16"},vs={key:1,class:"relative"},Cs={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},Ss={key:0,class:"w-6 h-6 flex-shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Bs={class:"w-full text-center"},Ms={class:"my-auto text-center mx-auto group-hover:inline-block"},Vs={key:1,class:"flex justify-center"},As={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},Ns={key:1,class:"p-4"},Ho={__name:"index",props:{modelValue:{type:Object,default:null},type:{type:String},webhooks:{type:Boolean,default:void 0}},emits:["update:modelValue","function","component-mounted"],setup(e,{emit:n}){const a=la(),o=t.ref(!1),r=t.ref(null),i=e,s=n;function l(u){r.value=u,s("function",u)}return t.watch(()=>i.modelValue,u=>{r.value=u},{immediate:!0}),t.watch(r,u=>{s("update:modelValue",u)}),t.onMounted(async()=>{if(r.value){const u=a.instances.find(m=>m.id===r.value.id);u&&(r.value.status=u.status)}s("component-mounted")}),(u,m)=>{const c=t.resolveComponent("Popper");return t.openBlock(),t.createElementBlock("main",as,[t.createElementVNode("div",{class:t.normalizeClass([{"rounded-b-none":o.value},"rounded-lg shadow dark:shadow-gray-400 shadow-gray-900 dark:bg-base-100 bg-base-100 text-center"])},[t.createElementVNode("div",os,[t.createElementVNode("p",{onClick:m[0]||(m[0]=h=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[t.unref(a).loaded?(t.openBlock(),t.createElementBlock("div",rs,[r.value?(t.openBlock(),t.createElementBlock("span",ss,[t.createElementVNode("header",ls,[r.value.type==="whatsapp-qrcode"?(t.openBlock(),t.createElementBlock("svg",cs,m[3]||(m[3]=[t.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"},null,-1)]))):r.value.type==="whatsapp-api-official"?(t.openBlock(),t.createElementBlock("div",ds,[m[5]||(m[5]=t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},[t.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})],-1)),(t.openBlock(),t.createElementBlock("svg",us,m[4]||(m[4]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"},null,-1)])))])):t.createCommentVNode("",!0),r.value&&r.value.status!==void 0?(t.openBlock(),t.createBlock(c,{key:2,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:t.withCtx(()=>[t.createElementVNode("main",{class:t.normalizeClass(["p-1 rounded text-sm px-3",{"bg-red-500":r.value.status===!1,"bg-green-500":r.value.status===!0,"bg-purple-500":r.value.status==="Offline"}])},[t.createElementVNode("div",fs,t.toDisplayString(r.value.status===!0?"Conectada":r.value.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:t.withCtx(()=>[r.value.isLoading?(t.openBlock(),t.createElementBlock("div",ms,m[6]||(m[6]=[t.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)]))):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{"bg-red-500":r.value.status===!1,"bg-green-500":r.value.status===!0,"bg-purple-500":r.value.status==="Offline"},"text-xs w-5 h-5 py-1 shadow flex justify-start shadow-gray-900 dark:shadow-gray-400 rounded-full cursor-pointer transition-all duration-200 ease-in-out"])},null,2))]),_:1})):t.createCommentVNode("",!0)]),t.createElementVNode("div",hs,t.toDisplayString(r.value.name),1)])):(t.openBlock(),t.createElementBlock("span",is,t.toDisplayString(t.unref(a).instances?t.unref(a).instances.length:"Sem")+" Instâncias disponíveis",1))])):(t.openBlock(),t.createElementBlock("div",ps,m[7]||(m[7]=[t.createElementVNode("svg",{"aria-hidden":"true",class:"inline w-5 h-5 text-blue-300 animate-spin fill-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),t.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),t.createTextVNode("Inicializando instâncias...")])))]),t.createElementVNode("footer",gs,[t.createElementVNode("button",{onClick:m[1]||(m[1]=h=>(r.value=null,o.value=!1))},m[8]||(m[8]=[t.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])),t.createElementVNode("button",{onClick:m[2]||(m[2]=h=>o.value=!o.value)},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass([{"rotate-180":o.value},"w-4 h-4 ease-out transition"]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},m[9]||(m[9]=[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"},null,-1)]),2))])])])],2),o.value?(t.openBlock(),t.createElementBlock("nav",ys,[t.createElementVNode("ul",ks,[t.unref(a).instances.length>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(a).instances,(h,f)=>{var p;return t.openBlock(),t.createElementBlock("li",xs,[t.createElementVNode("button",{class:t.normalizeClass([r.value&&r.value.id===h.id?"bg-base-100":"bg-base-200 hover:bg-base-100","flex rounded-md justify-between items-center p-2 px-1 w-full"]),onClick:d=>(r.value=h,o.value=!1,l(h)),disabled:r.value&&r.value.id===h.id||e.type&&h.type!==e.type||e.webhooks!==void 0&&e.webhooks!==((p=h.config)==null?void 0:p.webhooks)},[t.createElementVNode("div",ws,[h.type==="whatsapp-qrcode"?(t.openBlock(),t.createElementBlock("svg",Es,m[10]||(m[10]=[t.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"},null,-1)]))):h.type==="whatsapp-api-official"?(t.openBlock(),t.createElementBlock("div",vs,[m[12]||(m[12]=t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4 flex-shrink-0 text-green-400",viewBox:"0 0 16 16"},[t.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})],-1)),(t.openBlock(),t.createElementBlock("svg",Cs,m[11]||(m[11]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"},null,-1)])))])):t.createCommentVNode("",!0),t.createVNode(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:t.withCtx(()=>[t.createElementVNode("span",null,t.toDisplayString(e.type&&h.type!==e.type?"Não é possível utilizar esse tipo de Instância neste recurso":e.webhooks===!0?"Essa instância está com o Atendimento desabilitado":"Essa aplicação é somente para instâncias sem atendimento habilitado."),1)]),default:t.withCtx(()=>{var d;return[e.type&&h.type!==e.type||e.webhooks!==void 0&&e.webhooks!==((d=h.config)==null?void 0:d.webhooks)?(t.openBlock(),t.createElementBlock("svg",Ss,m[13]||(m[13]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 10V7a4 4 0 1 1 8 0v3h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h1Zm2-3a2 2 0 1 1 4 0v3h-4V7Zm2 6a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1Z","clip-rule":"evenodd"},null,-1)]))):t.createCommentVNode("",!0)]}),_:2},1024),t.createElementVNode("p",Bs,t.toDisplayString(h.name),1),t.createVNode(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:t.withCtx(()=>[t.createElementVNode("main",{class:t.normalizeClass(["p-1 rounded px-3",{"bg-red-500":h.status===!1,"bg-green-500":h.status===!0,"bg-purple-500":h.status==="Offline"}])},[t.createElementVNode("div",Ms,t.toDisplayString(h.status===!0?"Conectada":h.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:t.withCtx(()=>[h.isLoading?(t.openBlock(),t.createElementBlock("div",Vs,m[14]||(m[14]=[t.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)]))):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{"bg-red-500":h.status===!1,"bg-green-500":h.status===!0,"bg-purple-500":h.status==="Offline"},"text-xs w-5 h-5 py-1 shadow flex justify-start shadow-gray-900 dark:shadow-gray-400 rounded-full cursor-pointer transition-all duration-200 ease-in-out"])},null,2))]),_:2},1024)]),t.createElementVNode("div",As,[h.telephone?(t.openBlock(),t.createBlock(c,{key:0,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(h.telephone?`${h.telephone}`:""),1)]),default:t.withCtx(()=>[m[15]||(m[15]=t.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{d:"M7.978 4a2.553 2.553 0 0 0-1.926.877C4.233 6.7 3.699 8.751 4.153 10.814c.44 1.995 1.778 3.893 3.456 5.572 1.68 1.679 3.577 3.018 5.57 3.459 2.062.456 4.115-.073 5.94-1.885a2.556 2.556 0 0 0 .001-3.861l-1.21-1.21a2.689 2.689 0 0 0-3.802 0l-.617.618a.806.806 0 0 1-1.14 0l-1.854-1.855a.807.807 0 0 1 0-1.14l.618-.62a2.692 2.692 0 0 0 0-3.803l-1.21-1.211A2.555 2.555 0 0 0 7.978 4Z"})],-1))]),_:2,__:[15]},1024)):t.createCommentVNode("",!0)])],10,bs)])}),256)):(t.openBlock(),t.createElementBlock("div",Ns," Sem instâncias disponíveis"))])])):t.createCommentVNode("",!0)])}}},Ds=["aria-labelledby","aria-describedby"],Ts={class:"cpk-popover__header border-base-100"},Fs=["id"],Ls=["disabled"],Os=["id"],Ps={class:"cpk-popover__details bg-base-200 border border-base-100"},$s={class:"cpk-popover__footer"},_s=["disabled"],Rs=["disabled"],Hs={key:0,class:"loading-spinner"},zs=Ae({__name:"confirmModal",props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:"Confirmar ação"},description:{type:String,default:""},confirmLabel:{type:String,default:"Confirmar"},cancelLabel:{type:String,default:"Cancelar"},loadingLabel:{type:String,default:"Processando…"},loading:{type:Boolean,default:!1},destructive:{type:Boolean,default:!1},context:{type:Object,default:()=>({})},anchorEl:{type:[HTMLElement,Object],default:null},anchorRect:{type:Object,default:null},placement:{type:String,default:"auto"},align:{type:String,default:"center"},offset:{type:Number,default:10},viewportPadding:{type:Number,default:8}},emits:["update:modelValue","confirm","cancel"],setup(e,{emit:n}){const a=e,o=n,r=t.computed({get:()=>a.modelValue,set:v=>o("update:modelValue",v)}),i=t.ref(null),s=t.ref({left:0,top:0,p:"bottom"}),l={title:`cpk-popover-title-${Math.random().toString(36).slice(2)}`,desc:`cpk-popover-desc-${Math.random().toString(36).slice(2)}`};function u(){o("cancel",a.context),r.value=!1}function m(){a.loading||o("confirm",a.context)}let c,h,f=[];function p(){if(a.anchorRect)return a.anchorRect;const v=a.anchorEl instanceof Element?a.anchorEl:null;if(v)return v.getBoundingClientRect();const C=document.activeElement instanceof Element?document.activeElement:null;return C?C.getBoundingClientRect():{left:window.__lastMouseX??window.innerWidth/2,top:window.__lastMouseY??window.innerHeight/2,width:1,height:1,right:(window.__lastMouseX??0)+1,bottom:(window.__lastMouseY??0)+1}}function d(){if(!r.value)return;const v=window.innerWidth,C=window.innerHeight,O=a.viewportPadding,_=p(),E=i.value?i.value.getBoundingClientRect():{width:320,height:200},w=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let R=w[0],D=0,P=0;const T=_.left+_.width/2-E.width/2,A=_.top+_.height/2-E.height/2,z=_.left,ie=_.left+_.width-E.width,ee=_.top,pe=_.top+_.height-E.height;for(const V of w){if(V==="bottom"&&(P=_.bottom+a.offset,D=a.align==="start"?z:a.align==="end"?ie:T,P+E.height+O<=C)){R="bottom";break}if(V==="top"&&(P=_.top-E.height-a.offset,D=a.align==="start"?z:a.align==="end"?ie:T,P>=O)){R="top";break}if(V==="right"&&(D=_.right+a.offset,P=a.align==="start"?ee:a.align==="end"?pe:A,D+E.width+O<=v)){R="right";break}if(V==="left"&&(D=_.left-E.width-a.offset,P=a.align==="start"?ee:a.align==="end"?pe:A,D>=O)){R="left";break}}D=Math.min(Math.max(O,D),v-E.width-O),P=Math.min(Math.max(O,P),C-E.height-O),s.value={left:D,top:P,p:R}}function g(){y();let C=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;C&&C!==document.body;)f.push(C),C=C.parentElement;f.push(window),f.forEach(O=>O.addEventListener("scroll",d,{passive:!0}))}function y(){f.forEach(v=>{var C;return(C=v.removeEventListener)==null?void 0:C.call(v,"scroll",d)}),f=[]}t.watch(()=>r.value,async v=>{var C;if(v){await t.nextTick(),d(),g(),c=new ResizeObserver(d),c.observe(document.body);const O=a.anchorEl instanceof Element?a.anchorEl:null;O&&((C=h==null?void 0:h.disconnect)==null||C.call(h),h=new ResizeObserver(d),h.observe(O)),window.addEventListener("resize",d),window.addEventListener("keydown",k)}else x()}),t.watch(()=>a.anchorEl,async v=>{var O;if(!r.value)return;await t.nextTick(),y(),g(),(O=h==null?void 0:h.disconnect)==null||O.call(h);const C=v instanceof Element?v:null;C&&(h=new ResizeObserver(d),h.observe(C)),d()}),t.watch(()=>a.anchorRect,()=>{r.value&&d()}),t.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&d()});function k(v){v.key==="Escape"&&u(),v.key==="Enter"&&m()}t.onMounted(()=>{window.addEventListener("mousemove",v=>{window.__lastMouseX=v.clientX,window.__lastMouseY=v.clientY},{passive:!0})}),t.onBeforeUnmount(x);function x(){y(),window.removeEventListener("resize",d),window.removeEventListener("keydown",k),c&&c.disconnect(),h&&h.disconnect()}const b=t.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(v,C)=>(t.openBlock(),t.createBlock(t.Transition,{name:"cpk-layer",appear:""},{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:t.withModifiers(u,["self"])},[t.createVNode(t.Transition,{name:"cpk-card",appear:""},{default:t.withCtx(()=>[t.createElementVNode("div",{ref_key:"card",ref:i,class:t.normalizeClass(["cpk-popover bg-base-300",[{"is-loading":e.loading,"is-danger":e.destructive}]]),style:t.normalizeStyle(b.value),role:"dialog","aria-modal":"false","aria-labelledby":l.title,"aria-describedby":l.desc},[t.createElementVNode("div",Ts,[C[0]||(C[0]=t.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"!",-1)),t.createElementVNode("h3",{class:"cpk-popover__title",id:l.title},t.toDisplayString(e.title),9,Fs),t.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:u,disabled:e.loading,"aria-label":"Fechar"}," × ",8,Ls)]),e.description?(t.openBlock(),t.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:l.desc},t.toDisplayString(e.description),9,Os)):t.createCommentVNode("",!0),t.createElementVNode("div",Ps,[t.renderSlot(v.$slots,"details",{},void 0,!0)]),t.createElementVNode("div",$s,[t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:u,disabled:e.loading},t.toDisplayString(e.cancelLabel),9,_s),t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button","cyber-button--md",e.destructive?"cyber-button--danger":"cyber-button--accent"]),onClick:m,disabled:e.loading},[e.loading?(t.openBlock(),t.createElementBlock("span",Hs)):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(e.loading?e.loadingLabel:e.confirmLabel),1)],10,Rs)])],14,Ds)]),_:3})],32)):t.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-2f78365f"]]);function $t(e){return(n={})=>{const a=n.width?String(n.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}function ct(e){return(n,a)=>{const o=a!=null&&a.context?String(a.context):"standalone";let r;if(o==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,l=a!=null&&a.width?String(a.width):s;r=e.formattingValues[l]||e.formattingValues[s]}else{const s=e.defaultWidth,l=a!=null&&a.width?String(a.width):e.defaultWidth;r=e.values[l]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(n):n;return r[i]}}function dt(e){return(n,a={})=>{const o=a.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=n.match(r);if(!i)return null;const s=i[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?Gs(l,h=>h.test(s)):js(l,h=>h.test(s));let m;m=e.valueCallback?e.valueCallback(u):u,m=a.valueCallback?a.valueCallback(m):m;const c=n.slice(s.length);return{value:m,rest:c}}}function js(e,n){for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&n(e[a]))return a}function Gs(e,n){for(let a=0;a<e.length;a++)if(n(e[a]))return a}function zo(e){return(n,a={})=>{const o=n.match(e.matchPattern);if(!o)return null;const r=o[0],i=n.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=a.valueCallback?a.valueCallback(s):s;const l=n.slice(r.length);return{value:s,rest:l}}}const jo=6048e5,Is=864e5,Go=Symbol.for("constructDateFrom");function Je(e,n){return typeof e=="function"?e(n):e&&typeof e=="object"&&Go in e?e[Go](n):e instanceof Date?new e.constructor(n):new Date(n)}function ca(e,...n){const a=Je.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let qs={};function vn(){return qs}function tt(e,n){return Je(n||e,e)}function Dt(e,n){var l,u,m,c;const a=vn(),o=(n==null?void 0:n.weekStartsOn)??((u=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??a.weekStartsOn??((c=(m=a.locale)==null?void 0:m.options)==null?void 0:c.weekStartsOn)??0,r=tt(e,n==null?void 0:n.in),i=r.getDay(),s=(i<o?7:0)+i-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function Ws(e,n,a){const[o,r]=ca(a==null?void 0:a.in,e,n);return+Dt(o,a)==+Dt(r,a)}const Us={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ys=(e,n,a)=>{let o;const r=Us[e];return typeof r=="string"?o=r:n===1?o=r.one:o=r.other.replace("{{count}}",n.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o},Zs={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Xs=(e,n,a,o)=>Zs[e],Ks={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Qs={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Js={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},el={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},tl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},al={ordinalNumber:(e,n)=>{const a=Number(e),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},era:ct({values:Ks,defaultWidth:"wide"}),quarter:ct({values:Qs,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ct({values:Js,defaultWidth:"wide"}),day:ct({values:el,defaultWidth:"wide"}),dayPeriod:ct({values:tl,defaultWidth:"wide",formattingValues:nl,defaultFormattingWidth:"wide"})},ol=/^(\d+)(th|st|nd|rd)?/i,rl=/\d+/i,il={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},sl={any:[/^b/i,/^(a|c)/i]},ll={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cl={any:[/1/i,/2/i,/3/i,/4/i]},dl={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ul={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},fl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ml={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},pl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gl={ordinalNumber:zo({matchPattern:ol,parsePattern:rl,valueCallback:e=>parseInt(e,10)}),era:dt({matchPatterns:il,defaultMatchWidth:"wide",parsePatterns:sl,defaultParseWidth:"any"}),quarter:dt({matchPatterns:ll,defaultMatchWidth:"wide",parsePatterns:cl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dt({matchPatterns:dl,defaultMatchWidth:"wide",parsePatterns:ul,defaultParseWidth:"any"}),day:dt({matchPatterns:fl,defaultMatchWidth:"wide",parsePatterns:ml,defaultParseWidth:"any"}),dayPeriod:dt({matchPatterns:hl,defaultMatchWidth:"any",parsePatterns:pl,defaultParseWidth:"any"})},yl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},bl={date:$t({formats:yl,defaultWidth:"full"}),time:$t({formats:kl,defaultWidth:"full"}),dateTime:$t({formats:xl,defaultWidth:"full"})},wl={code:"en-US",formatDistance:Ys,formatLong:bl,formatRelative:Xs,localize:al,match:gl,options:{weekStartsOn:0,firstWeekContainsDate:1}},El={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},vl=(e,n,a)=>{let o;const r=El[e];return typeof r=="string"?o=r:n===1?o=r.one:o=r.other.replace("{{count}}",String(n)),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"em "+o:"há "+o:o},Cl={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Sl={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Bl={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ml={date:$t({formats:Cl,defaultWidth:"full"}),time:$t({formats:Sl,defaultWidth:"full"}),dateTime:$t({formats:Bl,defaultWidth:"full"})},Vl={lastWeek:e=>{const n=e.getDay();return"'"+(n===0||n===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},Al=(e,n,a,o)=>{const r=Vl[e];return typeof r=="function"?r(n):r},Nl={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},Dl={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Tl={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},Fl={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},Ll={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},Ol={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},Pl={ordinalNumber:(e,n)=>{const a=Number(e);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:ct({values:Nl,defaultWidth:"wide"}),quarter:ct({values:Dl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ct({values:Tl,defaultWidth:"wide"}),day:ct({values:Fl,defaultWidth:"wide"}),dayPeriod:ct({values:Ll,defaultWidth:"wide",formattingValues:Ol,defaultFormattingWidth:"wide"})},$l=/^(\d+)[ºªo]?/i,_l=/\d+/i,Rl={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},Hl={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},zl={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},jl={any:[/1/i,/2/i,/3/i,/4/i]},Gl={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Il={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},ql={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},Wl={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},Ul={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Yl={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},Zl={ordinalNumber:zo({matchPattern:$l,parsePattern:_l,valueCallback:e=>parseInt(e,10)}),era:dt({matchPatterns:Rl,defaultMatchWidth:"wide",parsePatterns:Hl,defaultParseWidth:"any"}),quarter:dt({matchPatterns:zl,defaultMatchWidth:"wide",parsePatterns:jl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dt({matchPatterns:Gl,defaultMatchWidth:"wide",parsePatterns:Il,defaultParseWidth:"any"}),day:dt({matchPatterns:ql,defaultMatchWidth:"wide",parsePatterns:Wl,defaultParseWidth:"any"}),dayPeriod:dt({matchPatterns:Ul,defaultMatchWidth:"any",parsePatterns:Yl,defaultParseWidth:"any"})},Io={code:"pt-BR",formatDistance:vl,formatLong:Ml,formatRelative:Al,localize:Pl,match:Zl,options:{weekStartsOn:0,firstWeekContainsDate:1}},Xl={scheduled_messages:"Mensagem programada"};function Kl(e){return Xl[e]||e||"Evento"}function da(e,n){return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()}function _t(e){const n=e instanceof Date?e:new Date(e),a=n.getFullYear(),o=(n.getMonth()+1).toString().padStart(2,"0");return`${a}-${o}`}function Qt(e){const[n,a]=String(e||"").trim().split(" ");if(!n)return null;const[o,r,i]=n.split("-").map(m=>parseInt(m,10));let s=0,l=0;if(a){const[m,c]=a.split(":");s=parseInt(m||"0",10),l=parseInt(c||"0",10)}const u=new Date(o,(r||1)-1,i||1,s,l);return isNaN(u.getTime())?null:u}function Ql(e){if(!e)return null;try{const n=String(e).replace(/(\.\d{3})\d+$/,"$1"),a=new Date(n);return isNaN(a.getTime())?null:a}catch{return null}}function Cn(e){if(!e)return"";const n=e instanceof Date?e:new Date(e);if(isNaN(n.getTime()))return"";const a=String(n.getHours()).padStart(2,"0"),o=String(n.getMinutes()).padStart(2,"0");return`${a}:${o}`}function Jl(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function ua(e){if(!e)return null;const n=(e==null?void 0:e.params)||{},a=(n==null?void 0:n.schedule)||{},o=(e==null?void 0:e.info)||{},r=(o==null?void 0:o.entity)||{},i=(o==null?void 0:o.department)||{},s=(o==null?void 0:o.instance)||{};let l=null;if(a!=null&&a.time&&(l=Qt(a.time)),!l&&(e!=null&&e.next_execution_at)&&(l=Ql(e.next_execution_at)),!l)return null;const u=Array.isArray(n==null?void 0:n.message)?n.message[0]:null,m=u&&(u.content||u.text)||"",c=(e==null?void 0:e.function)||(n==null?void 0:n.function)||"",h=Kl(c),f=(m||"").trim();return{id:(e==null?void 0:e.id)||Jl(),date:l,time:Cn(l),type:e.function,status:e.status||null,scheduled_by:n.scheduled_by,title:h,content:f,functionName:c||null,chatId:(n==null?void 0:n.chat_id)||(o==null?void 0:o.id)||"",protocol:(o==null?void 0:o.protocol)??"",contactName:(r==null?void 0:r.name)||"Contato",contactPhoto:(r==null?void 0:r.photo)||"",departmentName:(i==null?void 0:i.name)||"",departmentId:(i==null?void 0:i.id)||null,instanceName:(s==null?void 0:s.name)||"",raw:e}}function qo(e=[]){const n=Array.isArray(e)?e:Array.isArray(e.results)?e.results:[],a=[];for(const o of n){const r=ua(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function e2(e="/crm_scheduled",n){var a;try{const o=((a=n==null?void 0:n.raw)==null?void 0:a.id)??(n==null?void 0:n.id)??n;if(o==null)throw new Error("ID inválido");const r=`${String(e).replace(/\/$/,"")}/${o}/`,i=await it.delete(r);return{ok:(i==null?void 0:i.status)>=200&&i.status<300,status:(i==null?void 0:i.status)??0}}catch(o){return console.error("Error erasing scheduled event:",o),{ok:!1,status:0}}}const Wo={scheduled_messages:"#3b82f6"},Uo=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function t2(e=""){let n=2166136261;for(let a=0;a<e.length;a++)n^=e.charCodeAt(a),n=Math.imul(n,16777619);return n>>>0}function n2(e={}){var s,l,u,m,c,h,f,p,d,g,y;const n=e.functionName||e.function||((s=e==null?void 0:e.params)==null?void 0:s.function);if(n)return`fn:${n}`;const a=(e==null?void 0:e.departmentName)||((u=(l=e==null?void 0:e.info)==null?void 0:l.department)==null?void 0:u.name)||((c=(m=e==null?void 0:e.info)==null?void 0:m.department)==null?void 0:c.id);if(a)return`dept:${a}`;const o=(e==null?void 0:e.instanceName)||((f=(h=e==null?void 0:e.info)==null?void 0:h.instance)==null?void 0:f.name)||((d=(p=e==null?void 0:e.info)==null?void 0:p.instance)==null?void 0:d.id);if(o)return`inst:${o}`;const r=(e==null?void 0:e.protocol)??((g=e==null?void 0:e.info)==null?void 0:g.protocol);if(r!=null)return`proto:${r}`;const i=(e==null?void 0:e.chatId)||((y=e==null?void 0:e.params)==null?void 0:y.chat_id);return i?`chat:${i}`:"misc"}function Sn(e={}){var r;const n=e.functionName||e.function||((r=e==null?void 0:e.params)==null?void 0:r.function);if(n&&Object.prototype.hasOwnProperty.call(Wo,n))return Wo[n];const a=n2(e),o=t2(String(a))%Uo.length;return Uo[o]}const Rt=Mt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),actions:{async fetchAttendants(){try{this.attendants=[];let e=`${Qi}`;const n=await it.get(e);this.attendants=n.data,this.count=this.attendants.length}catch(e){console.log("Erro ao buscar atendentes:",e)}},removeAttendants(e){this.attendants=this.attendants.filter(n=>n.id!==e)},addAttendants(e){const n=this.attendants.findIndex(a=>a.id===e.id);n!==-1?this.attendants[n]=e:this.attendants.push(e)}}}),a2={class:"itemc-head"},o2={class:"minw0"},r2={class:"itemc-title"},i2={class:"itemc-sub"},s2={class:"flex items-center gap-1"},l2={class:"itemc-actions"},c2={class:"flex flex-col items-center"},d2={class:"time-badge"},u2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},f2={class:"sched-pop__card bg-base-300",role:"dialog"},m2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},h2={key:1,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},p2=["disabled"],g2={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},y2={key:1,class:"loading-spinner"},k2={class:"itemsb-head"},x2=["src"],b2={key:1,class:"avatar avatar--placeholder bg-base-100"},w2={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},E2={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},v2={class:"itemsb-main"},C2={class:"itemsb-row"},S2={class:"itemsb-title truncate"},B2={class:"itemsb-time"},M2={class:"itemsb-sub"},V2={class:"items-attendant"},A2={class:"itemsb-content"},N2={key:0,class:"itemsb-actions"},D2=["disabled"],T2={key:0,class:"loading-spinner"},F2={class:"event-left"},L2={class:"event-line"},O2={class:"event-actions"},P2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},$2={class:"sched-pop__card bg-base-300",role:"dialog"},_2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},R2={class:"sched-pop__card bg-base-300",role:"dialog"},H2={class:"event-time"},z2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},j2={key:1,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},G2=["disabled"],I2={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},q2={key:1,class:"loading-spinner"},fa=Ae({__name:"EventItem",props:{ev:{type:Object,required:!0},mode:{type:String,default:"compact"},getEventColor:{type:Function,default:null},viewOnly:{type:Boolean,default:!1}},emits:["open-message","open-chat","delete-message"],setup(e,{emit:n}){const a=Rt(),o=e,r=t.computed(()=>(o.getEventColor||Sn)(o.ev)),i=t.computed(()=>{var m;return((m=o.ev)==null?void 0:m.type)==="scheduled_messages"}),s=t.computed(()=>a.attendants.find(m=>m.is_me)||{}),l=m=>{const c=a.attendants.find(h=>h.id===m);return c?c.id===s.value.id?"Você":c.name||"Desconhecido":"Desconhecido"},u=t.computed(()=>{var c,h;const m=[];return(c=o.ev)!=null&&c.contactName&&m.push(o.ev.contactName),m.push(((h=o.ev)==null?void 0:h.departmentName)||"sem depto"),m.join(" • ")});return(m,c)=>{var h,f,p,d,g,y;return e.mode==="compact"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("header",a2,[t.createElementVNode("span",{style:t.normalizeStyle({background:r.value}),class:"color-bar"},null,4),t.createElementVNode("div",o2,[t.createElementVNode("div",r2,t.toDisplayString(e.ev.contactName?e.ev.contactName+" • ":"")+" "+t.toDisplayString(e.ev.departmentName||"sem depto"),1),t.createElementVNode("div",i2,[t.createElementVNode("span",s2,[c[9]||(c[9]=t.createElementVNode("svg",{class:"icon-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z","clip-rule":"evenodd"})],-1)),t.createTextVNode(" "+t.toDisplayString(l(e.ev.scheduled_by)),1)])])])]),t.createElementVNode("footer",l2,[t.createElementVNode("div",c2,[t.createElementVNode("div",d2,t.toDisplayString(e.ev.time),1),t.createElementVNode("div",u2,[e.ev.status!==void 0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["status-bar",(h=e.ev)!=null&&h.status?"status--up":"status--down"])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",f2,[c[10]||(c[10]=t.createElementVNode("strong",null,"Status",-1)),c[11]||(c[11]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" "+t.toDisplayString(e.ev.status===!0?"Ativo":"Executado"),1)])])]),i.value?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:c[0]||(c[0]=k=>m.$emit("open-message",e.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((f=e.ev)==null?void 0:f.status)===!0?(t.openBlock(),t.createElementBlock("svg",m2,c[12]||(c[12]=[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z","clip-rule":"evenodd"},null,-1)]))):(t.openBlock(),t.createElementBlock("svg",h2,c[13]||(c[13]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.998 7.78C6.729 6.345 9.198 5 12 5c2.802 0 5.27 1.345 7.002 2.78a12.713 12.713 0 0 1 2.096 2.183c.253 .344 .465 .682 .618 .997 .14 .286 .284 .658 .284 1.04s-.145 .754 -.284 1.04a6.6 6.6 0 0 1-.618 .997 12.712 12.712 0 0 1-2.096 2.183C17.271 17.655 14.802 19 12 19c-2.802 0-5.27-1.345-7.002-2.78a12.712 12.712 0 0 1-2.096-2.183 6.6 6.6 0 0 1-.618-.997C2.144 12.754 2 12.382 2 12s.145-.754 .284-1.04c.153-.315 .365-.653 .618-.997A12.714 12.714 0 0 1 4.998 7.78ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","clip-rule":"evenodd"},null,-1)])))])):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:c[1]||(c[1]=k=>m.$emit("delete-message",e.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:e.ev.deleteLoading||!e.ev.status},[e.ev.deleteLoading?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",g2,c[14]||(c[14]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z","clip-rule":"evenodd"},null,-1)]))),e.ev.deleteLoading?(t.openBlock(),t.createElementBlock("div",y2)):t.createCommentVNode("",!0)],8,p2)):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[2]||(c[2]=k=>m.$emit("open-chat",e.ev)),"aria-label":"Abrir conversa"},c[15]||(c[15]=[t.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.559 4.544c.355-.35.834-.544 1.33-.544H19.11c.496 0 .975.194 1.33.544.356.35.559.829.559 1.331v9.25c0 .502-.203.981-.559 1.331-.355.35-.834.544-1.33.544H15.5l-2.7 3.6a1 1 0 0 1-1.6 0L8.5 17H4.889c-.496 0-.975-.194-1.33-.544A1.868 1.868 0 0 1 3 15.125v-9.25c0-.502.203-.981.559-1.331ZM7.556 7.5a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Zm0 3.5a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2H7.556Z","clip-rule":"evenodd"})],-1)]))])],64)):e.mode==="sidebar"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",k2,[t.createElementVNode("div",{class:"avatar-wrap",style:t.normalizeStyle({boxShadow:`0 0 0 1px ${r.value}`})},[e.ev.contactPhoto?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.ev.contactPhoto,alt:"",class:"avatar",loading:"lazy"},null,8,x2)):(t.openBlock(),t.createElementBlock("div",b2,c[16]||(c[16]=[t.createElementVNode("svg",{viewBox:"0 0 24 24",class:"icon-5 icon-muted"},[t.createElementVNode("path",{fill:"currentColor",d:"M12 12a5 5 0 1 0-5-5a5 5 0 0 0 5 5m0 2c-4 0-8 2-8 4v2h16v-2c0-2-4-4-8-4Z"})],-1)]))),t.createElementVNode("div",w2,[e.ev.status!==void 0?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["status-dot-avatar",(p=e.ev)!=null&&p.status?"status--up":"status--down"])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",E2,[c[17]||(c[17]=t.createElementVNode("strong",null,"Status",-1)),c[18]||(c[18]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" "+t.toDisplayString(e.ev.status===!0?"Ativo":"Executado"),1)])])],4),t.createElementVNode("div",v2,[t.createElementVNode("div",C2,[t.createElementVNode("span",S2,t.toDisplayString(e.ev.contactName)+" • "+t.toDisplayString(e.ev.departmentName||"sem depto"),1),t.createElementVNode("span",B2,t.toDisplayString(e.ev.time),1)]),t.createElementVNode("div",M2,[t.createElementVNode("span",V2,[c[19]||(c[19]=t.createElementVNode("svg",{class:"icon-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z"})],-1)),t.createTextVNode(" "+t.toDisplayString(l(e.ev.scheduled_by)),1)])])])]),t.createElementVNode("p",A2,t.toDisplayString(e.ev.content||e.ev.title),1),e.viewOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",N2,[i.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:c[3]||(c[3]=k=>m.$emit("open-message",e.ev))},t.toDisplayString(((d=e.ev)==null?void 0:d.status)===!0?"Editar":"Visualizar"),1)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:c[4]||(c[4]=k=>m.$emit("delete-message",e.ev)),class:"cyber-button cyber-button--sm cyber-button--danger","aria-label":"Apagar evento",disabled:e.ev.deleteLoading||!e.ev.status},[e.ev.deleteLoading?(t.openBlock(),t.createElementBlock("div",T2)):t.createCommentVNode("",!0),c[20]||(c[20]=t.createTextVNode(" Apagar "))],8,D2)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:c[5]||(c[5]=k=>m.$emit("open-chat",e.ev))}," Abrir conversa ")):t.createCommentVNode("",!0)]))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",F2,[t.createElementVNode("span",{style:t.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),t.createElementVNode("div",L2,t.toDisplayString(u.value),1)]),t.createElementVNode("footer",O2,[t.createElementVNode("div",P2,[c[23]||(c[23]=t.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z","clip-rule":"evenodd"})],-1)),t.createElementVNode("div",$2,[c[21]||(c[21]=t.createElementVNode("strong",null,"Agendado por",-1)),c[22]||(c[22]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" "+t.toDisplayString(l(e.ev.scheduled_by)),1)])]),t.createElementVNode("div",_2,[e.ev.status!==void 0?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["status-bar",(g=e.ev)!=null&&g.status?"status--up":"status--down"])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",R2,[c[24]||(c[24]=t.createElementVNode("strong",null,"Status",-1)),c[25]||(c[25]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" "+t.toDisplayString(e.ev.status===!0?"Ativo":"Executado"),1)])]),t.createElementVNode("div",H2,t.toDisplayString(e.ev.time),1),i.value?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:c[6]||(c[6]=k=>m.$emit("open-message",e.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((y=e.ev)==null?void 0:y.status)===!0?(t.openBlock(),t.createElementBlock("svg",z2,c[26]||(c[26]=[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z","clip-rule":"evenodd"},null,-1)]))):(t.openBlock(),t.createElementBlock("svg",j2,c[27]||(c[27]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.998 7.78C6.729 6.345 9.198 5 12 5c2.802 0 5.27 1.345 7.002 2.78a12.713 12.713 0 0 1 2.096 2.183c.253 .344 .465 .682 .618 .997 .14 .286 .284 .658 .284 1.04s-.145 .754 -.284 1.04a6.6 6.6 0 0 1-.618 .997 12.712 12.712 0 0 1-2.096 2.183C17.271 17.655 14.802 19 12 19c-2.802 0-5.27-1.345-7.002-2.78a12.712 12.712 0 0 1-2.096-2.183 6.6 6.6 0 0 1-.618-.997C2.144 12.754 2 12.382 2 12s.145-.754 .284-1.04c.153-.315 .365-.653 .618-.997A12.714 12.714 0 0 1 4.998 7.78ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","clip-rule":"evenodd"},null,-1)])))])):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:c[7]||(c[7]=k=>m.$emit("delete-message",e.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:e.ev.deleteLoading||!e.ev.status},[e.ev.deleteLoading?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",I2,c[28]||(c[28]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z","clip-rule":"evenodd"},null,-1)]))),e.ev.deleteLoading?(t.openBlock(),t.createElementBlock("div",q2)):t.createCommentVNode("",!0)],8,G2)):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[8]||(c[8]=k=>m.$emit("open-chat",e.ev)),"aria-label":"Abrir conversa"},c[29]||(c[29]=[t.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.559 4.544c.355-.35.834-.544 1.33-.544H19.11c.496 0 .975.194 1.33.544.356.35.559.829.559 1.331v9.25c0 .502-.203.981-.559 1.331-.355.35-.834.544-1.33.544H15.5l-2.7 3.6a1 1 0 0 1-1.6 0L8.5 17H4.889c-.496 0-.975-.194-1.33-.544A1.868 1.868 0 0 1 3 15.125v-9.25c0-.502.203-.981.559-1.331ZM7.556 7.5a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Zm0 3.5a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2H7.556Z","clip-rule":"evenodd"})],-1)]))])],64))}}},[["__scopeId","data-v-ba8ebbe5"]]),gt=new Map,Yo=Mt.defineStore("scheduled",{state:()=>({baseUrl:ns,monthCache:{},loadingYM:new Set,errorByYM:{},loadedYM:new Set,filters:{}}),getters:{eventsOf:e=>n=>e.monthCache[n]||[],isLoading:e=>n=>e.loadingYM.has(n),errorOf:e=>n=>e.errorByYM[n]||""},actions:{setBaseUrl(e){this.baseUrl=e||"/crm_scheduled"},_setMonth(e,n){this.monthCache={...this.monthCache,[e]:n||[]}},_deleteMonth(e){const{[e]:n,...a}=this.monthCache;this.monthCache=a,this.loadingYM.delete(e);const{[e]:o,...r}=this.errorByYM;this.errorByYM=r,this.loadedYM.delete(e)},coerceHttps(e){return e&&e.startsWith("http://")?e.replace(/^http:\/\//i,"https://"):e},_appendMonth(e,n){if(!n||n.length===0)return;this.monthCache[e]||(this.monthCache[e]=[]);const a=new Set(this.monthCache[e].map(o=>o==null?void 0:o.id));for(const o of n)o&&(o.id&&a.has(o.id)||this.monthCache[e].push(o))},async ensureMonthLoaded(e){if(e||(e=_t(new Date)),this.loadedYM.has(e))return;const n=`${this.baseUrl}|${e}`;if(gt.has(n))return gt.get(n);this.loadingYM.add(e),this.errorByYM={...this.errorByYM,[e]:""};const a=(async()=>{var o,r;try{const i=`${this.baseUrl}?year_month=${encodeURIComponent(e)}&page_size=10`,s=await it.get(i),l=Array.isArray(s==null?void 0:s.data)?s.data:((o=s==null?void 0:s.data)==null?void 0:o.results)||[],u=qo(l||[]);this._setMonth(e,u),this.loadedYM.add(e);let m=this.coerceHttps(((r=s==null?void 0:s.data)==null?void 0:r.next)||null);m&&(async()=>{var c,h;try{let f=m;for(;f;){const p=await it.get(f),d=Array.isArray(p==null?void 0:p.data)?p.data:((c=p==null?void 0:p.data)==null?void 0:c.results)||[],g=qo(d||[]);this._appendMonth(e,g),f=this.coerceHttps(((h=p==null?void 0:p.data)==null?void 0:h.next)||null)}}catch(f){console.warn("[scheduled] background paging error:",(f==null?void 0:f.message)||f)}})()}catch(i){const s=String((i==null?void 0:i.message)||i);throw this.errorByYM={...this.errorByYM,[e]:s},console.error("[scheduled] fetch error",e,s),this._setMonth(e,[]),this.loadedYM.delete(e),i}finally{gt.delete(n),this.loadingYM.delete(e)}})();return gt.set(n,a),a},async forceReload(e){e||(e=_t(new Date));const n=`${this.baseUrl}|${e}`;gt.delete(n),this._deleteMonth(e),this.loadedYM.delete(e),await this.ensureMonthLoaded(e)},findEventById(e){const n=String(e);for(const[a,o]of Object.entries(this.monthCache)){const r=(o||[]).findIndex(i=>{var u;const s=((u=i==null?void 0:i.raw)==null?void 0:u.id)!=null?String(i.raw.id):null,l=(i==null?void 0:i.id)!=null?String(i.id):null;return s===n||l===n});if(r!==-1)return{ym:a,idx:r}}return null},applyUpdateToCache({id:e,params:n}){var f,p,d,g,y,k,x,b,v,C,O,_,E;let a=null;if((f=n==null?void 0:n.schedule)!=null&&f.time){const w=n.schedule.time,R=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(w);if(R){const[,D,P,T,A="00",z="00"]=R;a=new Date(Number(D),Number(P)-1,Number(T),Number(A),Number(z),0,0)}else{const D=typeof w=="string"&&!w.includes("T")?w.replace(" ","T"):w;a=new Date(D)}}console.log(n);const o=w=>{var R,D,P,T;return a instanceof Date&&!isNaN(a)&&(w.date=a,w.time=Cn(a)),((D=(R=n==null?void 0:n.message)==null?void 0:R[0])==null?void 0:D.content)!=null&&(w.content=n.message[0].content),w.raw=w.raw||{id:e},w.raw.params=w.raw.params||{},n!=null&&n.schedule&&(w.raw.params.schedule={...w.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(w.raw.params.scheduled_by=n.scheduled_by),n.department&&(w.raw.params.department=n.department),n!=null&&n.message&&(w.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(w.chatId=n.chat_id??w.chatId??""),n!=null&&n.entity&&(w.raw.params.entity={...w.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(w.contactName=n.entity.name??w.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(w.contactPhoto=n.entity.photo??w.contactPhoto??null,n.entity.photo&&(w.photo=n.entity.photo))),n!=null&&n.info&&(w.raw.params.info={...w.raw.params.info||{},...n.info},(P=n.info)!=null&&P.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(w.departmentName=n.info.department.name??w.departmentName),(T=n.info)!=null&&T.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(w.instanceName=n.info.instance.name??w.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(w.instanceStatus=n.info.instance.last_instance_status??w.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?w.title=n.title??w.title??"Mensagem programada":w.title=w.title||"Mensagem programada",Object.prototype.hasOwnProperty.call(n||{},"function")?(w.function=n.function??w.function??"scheduled_messages",w.type=n.function??w.type??"scheduled_messages"):(w.function=w.function||"scheduled_messages",w.type=w.type||"scheduled_messages"),w},r=this.findEventById(e);if(!r){const w=a instanceof Date&&!isNaN(a)?a:(()=>{var z;const T=(z=n==null?void 0:n.schedule)==null?void 0:z.time,A=typeof T=="string"&&!T.includes("T")?T.replace(" ","T"):T;return(Qt==null?void 0:Qt(A))||(A?new Date(A):new Date)})(),R=o({id:e,date:w,time:Cn(w),title:(n==null?void 0:n.title)||"Mensagem programada",type:(n==null?void 0:n.function)||"scheduled_messages",status:(n==null?void 0:n.status)||"true",scheduled_by:(n==null?void 0:n.scheduled_by)||null,function:(n==null?void 0:n.function)||"scheduled_messages",content:((d=(p=n==null?void 0:n.message)==null?void 0:p[0])==null?void 0:d.content)??"",raw:{id:e,params:n},contactName:((g=n==null?void 0:n.entity)==null?void 0:g.name)??"Cliente",contactPhoto:((y=n==null?void 0:n.entity)==null?void 0:y.photo)??null,departmentName:((x=(k=n==null?void 0:n.info)==null?void 0:k.department)==null?void 0:x.name)??null,departmentId:((v=(b=n==null?void 0:n.info)==null?void 0:b.department)==null?void 0:v.id)??null,instanceName:((O=(C=n==null?void 0:n.info)==null?void 0:C.instance)==null?void 0:O.name)??null,instanceStatus:((E=(_=n==null?void 0:n.info)==null?void 0:_.instance)==null?void 0:E.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),D=_t(R.date),P=this.monthCache[D]?[...this.monthCache[D],R]:[R];P.sort((T,A)=>T.date-A.date),this._setMonth(D,P);return}const{ym:i,idx:s}=r,l=this.monthCache[i]||[],u={...l[s]},m=o({...u}),c=m.date instanceof Date?m.date:u.date,h=_t(c);if(h===i){const w=[...l];w.splice(s,1,m),w.sort((R,D)=>R.date-D.date),this._setMonth(i,w)}else{const w=l.slice(0,s).concat(l.slice(s+1)),R=this.monthCache[h]?[...this.monthCache[h],m]:[m];R.sort((D,P)=>D.date-P.date),this.monthCache={...this.monthCache,[i]:w,[h]:R}}},removeFromCache(e){const n=this.findEventById(e);if(!n)return!1;const{ym:a,idx:o}=n,r=this.monthCache[a]||[],i=r.slice(0,o).concat(r.slice(o+1));return this._setMonth(a,i),!0},insertNormalizedEvent(e){if(!e)return;const n=String(e.id),a=e.date instanceof Date?e.date:Qt(e.date)||new Date,o=_t(a),r={...e,id:n,date:a,time:e.time??Cn(a)},i=this.monthCache[o]?[...this.monthCache[o]]:[],s=i.findIndex(l=>{var u;return String(((u=l==null?void 0:l.raw)==null?void 0:u.id)??(l==null?void 0:l.id))===n});s!==-1?i.splice(s,1,r):i.push(r),i.sort((l,u)=>l.date-u.date),this._setMonth(o,i)},insertFromApiItem(e){const n=ua(e);n&&this.insertNormalizedEvent(n)},insertManyFromApi(e=[]){for(const n of e){const a=ua(n);a&&this.insertNormalizedEvent(a)}},insertFromApiPage(e){const n=Array.isArray(e)?e:(e==null?void 0:e.results)||[];this.insertManyFromApi(n)},insertFromParams(e){return this.applyUpdateToCache(e)},hasEvent(e){return!!this.findEventById(e)},resetAll(){var e;this.monthCache={},this.loadingYM=new Set,this.errorByYM={},this.loadedYM=new Set,(e=gt.clear)==null||e.call(gt)}}}),W2={class:"cpk-header bg-base-200"},U2={class:"left"},Y2=["title"],Z2={class:"right"},X2=["title"],K2={class:"toggle"},Q2=["aria-pressed","title"],J2={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},ec={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},tc=Ae({__name:"CalHeader",props:{month:String,year:[String,Number],isCompact:Boolean,viewMode:{type:String,default:"calendar"},filterCount:{type:Number,default:0}},emits:["prev","next","today","toggle-compact","set-view-mode","close-page","open-filter"],setup(e){return(n,a)=>(t.openBlock(),t.createElementBlock("header",W2,[t.createElementVNode("div",U2,[t.createElementVNode("button",{onClick:a[0]||(a[0]=o=>n.$emit("close-page")),class:"cyber-button cyber-button--sm btn-ghost nav hide-md-up","aria-label":"Fechar"},a[8]||(a[8]=[t.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost nav",onClick:a[1]||(a[1]=o=>n.$emit("prev")),"aria-label":"Mês anterior"},a[9]||(a[9]=[t.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[t.createElementVNode("path",{fill:"currentColor",d:"M15.5 19 9 12l6.5-7 1.5 1.3L12.3 12l4.7 5.7z"})],-1),t.createElementVNode("span",{class:"label-md"},"Anterior",-1)])),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent today",onClick:a[2]||(a[2]=o=>n.$emit("today")),"aria-label":"Hoje"},a[10]||(a[10]=[t.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24","aria-hidden":"true"},[t.createElementVNode("path",{fill:"currentColor",d:"M11.6643 2.05648c.0197-.00699.1589-.05645.3357-.05645.1768 0 .316.04946.3357.05645l.0019.00067c.0461.01577.0846.03229.1092.04332.0514.02304.1015.04898.1449.07268.0896.04898.1957.11302.3102.18855.2291.15109.521.36725.8121.63689C14.247 3.49218 15 4.37 15 5.50003c0 1.12688-.7447 2.00396-1.2779 2.49995-.2531.23541-.5075.43043-.7221.57742V10h5c.5523 0 1 .4477 1 1v3h-4c-.0568 0-.1125.0048-.1667.0139-.0542-.0091-.1099-.0139-.1667-.0139H5v-3c0-.5523.44772-1 1-1h5V8.57622c-.2139-.14666-.4676-.34115-.7202-.57589C9.74664 7.50489 9 6.62764 9 5.50003c0-1.13003.753-2.00785 1.286-2.50144.2911-.26964.583-.4858.8121-.63689.1145-.07553.2206-.13957.3102-.18855.0434-.0237.0935-.04964.1449-.07268.0246-.01103.0631-.02755.1092-.04332l.0019-.00067ZM4 17.8377V21c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2.8243c-.0609.0534-.1248.1054-.1917.1556-.56.42-1.274.6687-2.1416.6687-.8677 0-1.5817-.2487-2.1417-.6687-.281-.2108-.5081-.4531-.6917-.7045-.1835.2514-.4106.4937-.6917.7045-.5599.42-1.2739.6687-2.1416.6687-.8677 0-1.5817-.2487-2.14169-.6687-.20142-.1511-.37514-.3184-.52499-.4936-.14984.1752-.32356.3425-.52499.4936-.55999.42-1.27398.6687-2.14166.6687s-1.58168-.2487-2.14167-.6687c-.20143-.1511-.37515-.3184-.525-.4936ZM5.2078 16c.0124.0314.0255.0628.03934.0939.11841.2664.27553.4856.47786.6374.19001.1425.47602.2687.94167.2687s.75165-.1262.94166-.2687c.20234-.1518.35945-.371.47786-.6374.01384-.0311.02694-.0625.03934-.0939H5.2078Zm5.3727.0939c-.0139-.0311-.027-.0625-.0394-.0939h2.9177c-.0124.0314-.0255.0628-.0393.0939-.1184.2664-.2755.4856-.4779.6374-.19.1425-.476.2687-.9416.2687-.4657 0-.7517-.1262-.9417-.2687-.2023-.1518-.3594-.371-.4778-.6374Zm5.6666 0c-.0138-.0311-.0269-.0625-.0393-.0939h2.9177c-.0124.0314-.0255.0628-.0393.0939-.1184.2664-.2755.4856-.4779.6374-.19.1425-.476.2687-.9416.2687-.4657 0-.7517-.1262-.9417-.2687-.2023-.1518-.3594-.371-.4779-.6374Z"})],-1),t.createElementVNode("span",{class:"label-md"},"Hoje",-1)])),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost nav",onClick:a[3]||(a[3]=o=>n.$emit("next")),"aria-label":"Próximo mês"},a[11]||(a[11]=[t.createElementVNode("span",{class:"label-md"},"Próximo",-1),t.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[t.createElementVNode("path",{fill:"currentColor",d:"M8 19l6.5-7L8 5l-1.5 1.3L11.7 12 6.5 17.7z"})],-1)]))]),t.createElementVNode("h2",{class:"month-title",title:`${e.month} ${e.year}`},t.toDisplayString(e.month)+" "+t.toDisplayString(e.year),9,Y2),t.createElementVNode("div",Z2,[t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost filter-btn",title:"Filtro de eventos",onClick:a[4]||(a[4]=o=>n.$emit("open-filter",o))},[a[12]||(a[12]=t.createElementVNode("svg",{class:"icon-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{d:"M5.05 3C3.291 3 2.352 5.024 3.51 6.317l5.422 6.059v4.874c0 .472.227.917.613 1.2l3.069 2.25c1.01.742 2.454.036 2.454-1.2v-7.124l5.422-6.059C21.647 5.024 20.708 3 18.95 3H5.05Z"})],-1)),e.filterCount>0?(t.openBlock(),t.createElementBlock("span",{key:0,class:"filter-badge",title:`${e.filterCount} filtro${e.filterCount>1?"s":""} ativo${e.filterCount>1?"s":""}`},t.toDisplayString(e.filterCount),9,X2)):t.createCommentVNode("",!0)]),t.createElementVNode("div",K2,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button cyber-button--sm btn-ghost",e.viewMode==="calendar"?"is-active":""]),onClick:a[5]||(a[5]=o=>n.$emit("set-view-mode","calendar")),"aria-label":"Visão Calendário"},a[13]||(a[13]=[t.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M5 5a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1h1a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1h1a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1 2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a2 2 0 0 1 2-2ZM3 19v-7a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z","clip-rule":"evenodd"})],-1),t.createElementVNode("span",{class:"label-lg"},"Calendário",-1)]),2),t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button cyber-button--sm btn-ghost",e.viewMode==="agenda"?"is-active":""]),onClick:a[6]||(a[6]=o=>n.$emit("set-view-mode","agenda")),"aria-label":"Visão Agenda"},a[14]||(a[14]=[t.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[t.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M11 4.717c-2.286-.58-4.16-.756-7.045-.71A1.99 1.99 0 0 0 2 6v11c0 1.133.934 2.022 2.044 2.007 2.759-.38 4.5-.182 6.956.449V4.717Zm2 15.081c2.456-.631 4.198-.829 6.956-.791A2.013 2.013 0 0 0 22 16.999V6a1.99 1.99 0 0 0-1.955-1.993c-2.885-.046-4.76.13-7.045.71v15.081Z","clip-rule":"evenodd"})],-1),t.createElementVNode("span",{class:"label-lg"},"Agenda",-1)]),2)]),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm show-lg btn-ghost",onClick:a[7]||(a[7]=o=>n.$emit("toggle-compact")),"aria-pressed":e.isCompact,title:e.isCompact?"Sair do modo compacto":"Ativar modo compacto"},[e.isCompact?(t.openBlock(),t.createElementBlock("svg",ec,a[16]||(a[16]=[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 4H4m0 0v4m0-4 5 5m7-5h4m0 0v4m0-4-5 5M8 20H4m0 0v-4m0 4 5-5m7 5h4m0 0v-4m0 4-5-5"},null,-1)]))):(t.openBlock(),t.createElementBlock("svg",J2,a[15]||(a[15]=[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8h4V4m12 4h-4V4M4 16h4v4m12-4h-4v4"},null,-1)])))],8,Q2)])]))}},[["__scopeId","data-v-37b625a5"]]),nc=["title"],ac={class:"week-header"},oc=Ae({__name:"WeekDays",props:{weekDays:{type:Array,default:()=>[]},month:String,year:[String,Number]},setup(e){return(n,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("h2",{class:"month-title",title:`${e.month} ${e.year}`},t.toDisplayString(e.month)+" "+t.toDisplayString(e.year),9,nc),t.createElementVNode("div",ac,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.weekDays,o=>(t.openBlock(),t.createElementBlock("div",{key:o,class:"week-cell"},t.toDisplayString(o),1))),128))])],64))}},[["__scopeId","data-v-756165d9"]]),rc=["onClick"],ic={key:0,class:"cell-today-indicator show-lg"},sc={class:"cell-top"},lc={class:"day-number"},cc={key:1,class:"more"},dc={class:"bars-wrap"},uc=4,fc=8,Zo=4,Xo=2,mc=1,hc=Ae({__name:"CalendarGrid",props:{startOffset:Number,monthDays:Array,viewDate:Date,isCompact:Boolean,isSameMonthFn:Function,isSelectedDayFn:Function,isTodayFn:Function,selectDayFn:Function,eventsByDayFn:Function,dayEventCountFn:Function,eventBarsToShowFn:Function,dayEventOverflowFn:Function},setup(e){const n=e,a=t.ref({}),o=new Map;function r(d){const g=(d==null?void 0:d.clientWidth)||0,y=(d==null?void 0:d.clientHeight)||0;if(!g||!y)return{cols:0,rows:0,widths:[],sum:0};const k=Math.max(0,Math.floor((g+Zo)/(uc+Zo))),x=Math.max(0,Math.floor((y+Xo)/(fc+Xo))),b=l(k,x),v=b.reduce((C,O)=>C+O,0);return{cols:k,rows:x,widths:b,sum:v}}function i(d,g){const y=r(g),k=a.value[d];(!k||k.cols!==y.cols||k.rows!==y.rows||k.sum!==y.sum)&&(a.value={...a.value,[d]:y})}function s(d,g){if(!g){const k=o.get(d);if(k&&(k.disconnect(),o.delete(d)),a.value[d]!=null){const x={...a.value};delete x[d],a.value=x}return}i(d,g);const y=new ResizeObserver(()=>i(d,g));y.observe(g),o.set(d,y)}t.onBeforeUnmount(()=>{o.forEach(d=>d.disconnect()),o.clear()});function l(d,g){if(d<=0||g<=0)return[];const y=[],k=.25;for(let x=0;x<g;x++){const b=x/Math.max(1,g-1),v=k+(1-k)*b,C=Math.max(1,Math.round(d*v));y.push(Math.min(C,d))}return y}function u(d,g){var v;const y=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,k=((v=a.value[d])==null?void 0:v.sum)??0;if(y<=k)return{bars:y,overflow:0};const x=Math.max(0,k-mc),b=Math.max(0,y-x);return{bars:x,overflow:b}}function m(d,g){const y=a.value[d];if(!y||y.rows===0||y.cols===0)return[];const{widths:k}=y,b=u(d,g).bars,v=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,b):[])||[],C=k.map(()=>[]);let O=0;for(let _=k.length-1;_>=0&&O<v.length;_--){const E=Math.min(k[_],v.length-O);C[_]=v.slice(O,O+E),O+=E}return C}const c=t.ref(null);function h(d){return d&&d.nodeType===1&&typeof d.getBoundingClientRect=="function"}function f(d){if(!h(d))return;const g=c.value,y=g&&h(g)?g:d.offsetParent;if(!h(y))return;let k,x;try{k=d.getBoundingClientRect(),x=y.getBoundingClientRect()}catch{return}const b=y.scrollLeft||0,v=y.scrollTop||0;d.style.position="absolute",d.style.zIndex="0",d.style.top=`${k.top-x.top+v}px`,d.style.left=`${k.left-x.left+b}px`,d.style.width=`${k.width}px`,d.style.height=`${k.height}px`,d.style.pointerEvents="none"}function p(d){!d||!d.style||requestAnimationFrame(()=>{!d||!d.style||(d.style.position="",d.style.zIndex="",d.style.top="",d.style.left="",d.style.width="",d.style.height="",d.style.pointerEvents="")})}return(d,g)=>(t.openBlock(),t.createBlock(t.TransitionGroup,{name:"cal-fade","move-class":"cal-move",tag:"div",class:"cal-grid calendar-grid",appear:"",ref_key:"gridRef",ref:c,onBeforeLeave:f,onAfterLeave:p},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.startOffset,y=>(t.openBlock(),t.createElementBlock("div",{key:"x"+y,class:"cal-cell day-empty bg-base-300 border border-base-100"}))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.monthDays,(y,k)=>(t.openBlock(),t.createElementBlock("div",{key:y.key,style:t.normalizeStyle({"--i":k}),class:t.normalizeClass(["cal-cell day-cell border border-base-100 bg-base-200 hover:bg-base-100",[e.isSameMonthFn(y.date,e.viewDate)?"":"opacity-60",e.isSelectedDayFn(y.date)?"neon-selected":"",e.isTodayFn(y.date)?"is-today":"",e.dayEventCountFn(y.date)>0?"has-events":""]]),onClick:x=>e.selectDayFn(y.date)},[e.isTodayFn(y.date)?(t.openBlock(),t.createElementBlock("div",ic," Hoje ")):t.createCommentVNode("",!0),t.createElementVNode("div",sc,[t.createElementVNode("span",lc,t.toDisplayString(y.date.getDate()),1)]),u(y.key,y.date).overflow>0?(t.openBlock(),t.createElementBlock("span",cc," +"+t.toDisplayString(u(y.key,y.date).overflow),1)):t.createCommentVNode("",!0),t.createElementVNode("div",dc,[t.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:x=>s(y.key,x)},[u(y.key,y.date).bars>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(m(y.key,y.date),(x,b)=>(t.openBlock(),t.createElementBlock("div",{key:"vrow"+b,class:"vrow"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(x,(v,C)=>(t.openBlock(),t.createElementBlock("span",{key:"vbar"+b+"-"+C,class:"vbar",style:t.normalizeStyle({background:t.unref(Sn)(v),boxShadow:`0 0 8px ${t.unref(Sn)(v)}70`})},null,4))),128))]))),128)):t.createCommentVNode("",!0)],512)])],14,rc))),128))]),_:1},512))}},[["__scopeId","data-v-26af06b5"]]),pc={class:"agenda-section"},gc={key:0,class:"empty-state"},yc={key:1,class:"day-list"},kc={class:"date-trail"},xc={class:"weekday-short"},bc={class:"date-pill bg-base-200 border border-base-300"},wc={class:"date-pill-month"},Ec={class:"date-pill-day"},vc={class:"content-col"},Cc={class:"day-header"},Sc={class:"agenda-title"},Bc={class:"month-header-text"},Mc={class:"events-list"},Vc=Ae({__name:"AgendaList",props:{days:{type:Array,default:()=>[]},weekdayLong:Function,weekdayShort:Function,monthShort:Function,monthLabelOf:Function,year:Number},emits:["open-chat","open-message","delete-message"],setup(e,{emit:n}){return(a,o)=>(t.openBlock(),t.createElementBlock("section",pc,[e.days.length===0?(t.openBlock(),t.createElementBlock("div",gc," Sem eventos neste mês. ")):(t.openBlock(),t.createElementBlock("ul",yc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.days,r=>{var i;return t.openBlock(),t.createElementBlock("li",{key:r.key,class:"day-item border-base-200"},[t.createElementVNode("div",kc,[t.createElementVNode("div",xc,t.toDisplayString(e.weekdayShort(r.date)),1),t.createElementVNode("div",bc,[t.createElementVNode("div",wc,t.toDisplayString(e.monthShort(r.date)),1),t.createElementVNode("div",Ec,t.toDisplayString(r.date.getDate()),1),t.createElementVNode("div",{style:t.normalizeStyle({background:t.unref(Sn)(((i=r.events)==null?void 0:i[0])||{})}),class:"date-pill-dot"},null,4)])]),t.createElementVNode("div",vc,[t.createElementVNode("div",Cc,[t.createElementVNode("h3",Sc,t.toDisplayString(e.weekdayLong(r.date).toUpperCase())+" "+t.toDisplayString(r.date.getDate()),1),t.createElementVNode("div",Bc,t.toDisplayString(e.monthLabelOf(r.date).toUpperCase())+" "+t.toDisplayString(e.year),1)]),t.createElementVNode("ul",Mc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.events,s=>(t.openBlock(),t.createElementBlock("li",{key:s.id,class:"event-item border border-base-100 bg-base-200 hover:bg-base-100"},[t.createVNode(fa,{ev:s,mode:"agenda",onOpenMessage:o[0]||(o[0]=l=>a.$emit("open-message",l)),onOpenChat:o[1]||(o[1]=l=>a.$emit("open-chat",l)),onDeleteMessage:o[2]||(o[2]=l=>a.$emit("delete-message",l))},null,8,["ev"])]))),128))])])])}),128))]))]))}},[["__scopeId","data-v-2c977f25"]]),Ac=["data-mode","data-empty"],Nc=["disabled"],Ko=Ae({__name:"EventsList",props:{loading:{type:Boolean,default:!1},selectedLabel:{type:String,default:""},selectedLabelLong:{type:String,default:""},events:{type:Array,default:()=>[]},mode:{type:String,default:"compact"}},emits:["reload","open-chat","open-message","delete-message"],setup(e){const n=e,a=t.computed(()=>n.mode==="compact"?n.selectedLabelLong||"Hoje":`Eventos em ${n.selectedLabel||"—"}`);return(o,r)=>(t.openBlock(),t.createElementBlock("section",{class:t.normalizeClass(["bg-base-300 daylist",[e.mode==="compact"?"daylist--compact has-border border-base-200":"daylist--sidebar has-border border-base-200 supports-blur",{"daylist--tight":e.mode==="compact"&&!e.loading&&e.events.length===0}]]),"data-mode":e.mode,"data-empty":!e.loading&&e.events.length===0?"1":"0"},[t.createElementVNode("div",{class:t.normalizeClass(["daylist-header",e.mode==="compact"?"daylist-header--compact bg-base-300":"daylist-header--sidebar bg-base-300"])},[t.createElementVNode("h3",{class:t.normalizeClass(e.mode==="compact"?"daylist-title--compact":"daylist-title--sidebar")},t.toDisplayString(a.value),3),t.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:r[0]||(r[0]=i=>o.$emit("reload")),disabled:e.loading},t.toDisplayString(e.loading?"Atualizando…":"Atualizar"),9,Nc)],2),e.loading?(t.openBlock(),t.createBlock(t.Transition,{key:0,name:"fade"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["loading-text",e.mode==="compact"?"is-compact":"is-sidebar"])}," Carregando… ",2)]),_:1})):e.events.length===0?(t.openBlock(),t.createBlock(t.Transition,{key:1,name:"fade"},{default:t.withCtx(()=>r[4]||(r[4]=[t.createElementVNode("div",{class:"empty-text"},"Sem eventos.",-1)])),_:1,__:[4]})):(t.openBlock(),t.createBlock(t.TransitionGroup,{key:2,name:"list","move-class":"list-move",tag:"ul",appear:"",class:t.normalizeClass([e.mode==="compact"?"list-compact has-border border-base-300 bg-base-200 supports-blur":"list-sidebar"])},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.events,(i,s)=>(t.openBlock(),t.createElementBlock("li",{key:i.id,style:t.normalizeStyle({"--i":s}),class:t.normalizeClass(e.mode==="compact"?"item-compact hover:bg-base-100":"item-sidebar hover:z-10 has-border hover:bg-base-100 border-base-100 bg-base-200 ")},[t.createVNode(fa,{ev:i,mode:e.mode==="compact"?"compact":"sidebar",onOpenMessage:r[1]||(r[1]=l=>o.$emit("open-message",l)),onOpenChat:r[2]||(r[2]=l=>o.$emit("open-chat",l)),onDeleteMessage:r[3]||(r[3]=l=>o.$emit("delete-message",l))},null,8,["ev","mode"])],6))),128))]),_:1},8,["class"]))],10,Ac))}},[["__scopeId","data-v-4ecbf2a5"]]),Dc={class:"cpk-popover__header border-base-100"},Tc={class:"filter-body"},Fc={class:"row"},Lc=["checked"],Oc={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},Pc={class:"status-wrap"},$c={class:"seg"},_c=Ae({__name:"CalFilter",props:{open:{type:Boolean,default:!1},anchorEl:{type:[HTMLElement,Object],default:null},offset:{type:Number,default:8},align:{type:String,default:"center"},filters:{type:Object,default:()=>({})}},emits:["close","update:filters"],setup(e,{emit:n}){const a=e,o=n,r=Rt(),i=t.computed(()=>r.attendants.find(E=>E.is_me)||null),s=t.reactive({onlyMine:!1,status:null});t.watch(()=>a.open,async E=>{var D,P,T;if(!E)return;await t.nextTick();const w=(D=i.value)!=null&&D.id?String(i.value.id):null;s.onlyMine=!!w&&String(((P=a.filters)==null?void 0:P.scheduled_by)??"")===w;const R=(T=a.filters)==null?void 0:T.status;s.status=R===!0||R===!1?R:null,y()},{immediate:!1});function l(E,w){if(!E)return{};const{[w]:R,...D}=E;return D}function u(E){var R;s.onlyMine=!!E.target.checked;const w=(R=i.value)!=null&&R.id?String(i.value.id):null;s.onlyMine&&w?o("update:filters",{...a.filters,scheduled_by:w}):o("update:filters",l(a.filters,"scheduled_by"))}function m(E){if(s.status===E){s.status=null;const w=l(a.filters,"status");o("update:filters",w)}else s.status=E,o("update:filters",{...a.filters,status:E})}const c=t.ref(null),h=t.ref({left:0,top:0,placed:"bottom"}),f=t.computed(()=>({position:"fixed",left:`${h.value.left}px`,top:`${h.value.top}px`}));function p(){const E=a.anchorEl instanceof Element?a.anchorEl:null;if(E!=null&&E.getBoundingClientRect)return E.getBoundingClientRect();const w=window.innerWidth/2,R=window.innerHeight/3;return{left:w,right:w,top:R,bottom:R,width:0,height:0}}function d(E,w,R,D){return{left:Math.max(8,Math.min(E,window.innerWidth-R-8)),top:Math.max(8,Math.min(w,window.innerHeight-D-8))}}function g(){const E=p(),w=c.value,R=(w==null?void 0:w.offsetWidth)??300,D=(w==null?void 0:w.offsetHeight)??220;let P=E.bottom+a.offset,T;if(a.align==="center"?T=E.left+E.width/2-R/2:a.align==="end"?T=E.right-R:T=E.left,P+D>window.innerHeight-4){const z=E.top-D-a.offset;z>=4?(P=z,h.value.placed="top"):h.value.placed="bottom"}else h.value.placed="bottom";const A=d(T,P,R,D);h.value={left:A.left,top:A.top,placed:h.value.placed}}function y(){g(),requestAnimationFrame(g)}let k,x,b=[];function v(){C(),b=[window];const E=a.anchorEl instanceof Element?a.anchorEl:null;let w=E==null?void 0:E.parentElement;for(;w&&w!==document.body;){const R=getComputedStyle(w);/(auto|scroll)/.test(R.overflow+R.overflowY+R.overflowX)&&b.push(w),w=w.parentElement}b.forEach(R=>R.addEventListener("scroll",y,{passive:!0}))}function C(){b.forEach(E=>{var w;return(w=E.removeEventListener)==null?void 0:w.call(E,"scroll",y)}),b=[]}t.watch(()=>a.open,async E=>{var R,D,P,T;if(!E){C(),(R=k==null?void 0:k.disconnect)==null||R.call(k),(D=x==null?void 0:x.disconnect)==null||D.call(x);return}await t.nextTick(),y(),v(),(P=k==null?void 0:k.disconnect)==null||P.call(k),k=new ResizeObserver(y),k.observe(document.body),(T=x==null?void 0:x.disconnect)==null||T.call(x);const w=a.anchorEl instanceof Element?a.anchorEl:null;w&&(x=new ResizeObserver(y),x.observe(w)),window.addEventListener("resize",y)}),t.watch(()=>a.anchorEl,async()=>{a.open&&(await t.nextTick(),v(),y())});function O(E){E.key==="Escape"&&o("close")}function _(E){if(!a.open)return;const w=E.target,R=c.value;if(R&&R.contains(w))return;const D=a.anchorEl instanceof Element?a.anchorEl:null;D&&D.contains&&D.contains(w)||o("close")}return t.onMounted(()=>{document.addEventListener("pointerdown",_,!0),window.addEventListener("keydown",O)}),t.onBeforeUnmount(()=>{var E,w;document.removeEventListener("pointerdown",_,!0),window.removeEventListener("keydown",O),C(),(E=k==null?void 0:k.disconnect)==null||E.call(k),(w=x==null?void 0:x.disconnect)==null||w.call(x)}),(E,w)=>(t.openBlock(),t.createBlock(t.Transition,{name:"cpk-layer",appear:""},{default:t.withCtx(()=>[e.open?(t.openBlock(),t.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:w[4]||(w[4]=t.withModifiers(R=>E.$emit("close"),["self"]))},[t.createVNode(t.Transition,{name:"cpk-card",appear:""},{default:t.withCtx(()=>[t.createElementVNode("div",{ref_key:"card",ref:c,class:"cpk-popover bg-base-300",style:t.normalizeStyle(f.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[t.createElementVNode("div",Dc,[w[5]||(w[5]=t.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),w[6]||(w[6]=t.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),t.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:w[0]||(w[0]=R=>E.$emit("close")),"aria-label":"Fechar"}," × ")]),t.createElementVNode("div",Tc,[t.createElementVNode("label",Fc,[t.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:w[1]||(w[1]=R=>u(R)),"aria-label":"Exibir somente meus eventos"},null,40,Lc),w[7]||(w[7]=t.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),t.createElementVNode("div",Oc,[w[9]||(w[9]=t.createElementVNode("span",{class:"status-icon","aria-hidden":"true"},[t.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a1 1 0 0 1 .932.638l7 18a1 1 0 0 1-1.326 1.281L13 19.517V13a1 1 0 1 0-2 0v6.517l-5.606 2.402a1 1 0 0 1-1.326-1.281l7-18A1 1 0 0 1 12 2Z","clip-rule":"evenodd"})])],-1)),t.createElementVNode("div",Pc,[w[8]||(w[8]=t.createElementVNode("div",{class:"label-cpk"},[t.createTextVNode(" Status "),t.createElementVNode("span",{class:"sched-pop",tabindex:"0","aria-label":"Ajuda sobre status"},[t.createElementVNode("span",{class:"sched-pop__mark"},[t.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.008-3.018a1.502 1.502 0 0 1 2.522 1.159v.024a1.44 1.44 0 0 1-1.493 1.418 1 1 0 0 0-1.037.999V14a1 1 0 1 0 2 0v-.539a3.44 3.44 0 0 0 2.529-3.256 3.502 3.502 0 0 0-7-.255 1 1 0 0 0 2 .076c.014-.398.187-.774.48-1.044Zm.982 7.026a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2h-.01Z","clip-rule":"evenodd"})])]),t.createElementVNode("div",{class:"sched-pop__card bg-base-300",style:{"--popover-brd":"var(--cyber-border)",transform:"translate(-5%, -50%) scale(0.98)"}},[t.createElementVNode("div",null,[t.createElementVNode("span",{style:{"font-weight":"600"}},"Ativos:"),t.createTextVNode(" Eventos que estão programados para ocorrer ")]),t.createElementVNode("div",null,[t.createElementVNode("span",{style:{"font-weight":"600"}},"Executados:"),t.createTextVNode(" Eventos que já ocorreram ")])])])],-1)),t.createElementVNode("div",$c,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:w[2]||(w[2]=R=>m(!0)),"aria-pressed":"state.status === true"}," Ativos ",2),t.createElementVNode("button",{type:"button",class:t.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!1?"is-active":""]),onClick:w[3]||(w[3]=R=>m(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):t.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-0aad9d42"]]),Rc={class:"calendar-content"},Hc={class:"calendar-stage-main"},zc={key:0},Qo=Ae({__name:"scheduledCalendar",props:{sourceUrl:{type:String,default:"/crm_scheduled"},initialDate:{type:[String,Date],default:()=>new Date}},emits:["open-chat","loaded","open-message","close-page"],setup(e,{expose:n,emit:a}){const o=e,r=Yo();r.setBaseUrl(o.sourceUrl);const i=new Date,s=t.ref(m(o.initialDate)),l=t.ref(new Date(i.getFullYear(),i.getMonth(),i.getDate())),u=t.ref("calendar");function m(L){if(L instanceof Date)return new Date(L.getFullYear(),L.getMonth(),1);if(typeof L=="string"){const[K,ae]=L.split("-").map(ce=>parseInt(ce,10));return new Date(K||i.getFullYear(),(ae||i.getMonth()+1)-1,1)}return new Date(i.getFullYear(),i.getMonth(),1)}function c(L){return new Date(L.getFullYear(),L.getMonth()+1,0).getDate()}function h(L){return new Date(L.getFullYear(),L.getMonth(),1).getDay()}function f(L,K){return L.getFullYear()===K.getFullYear()&&L.getMonth()===K.getMonth()}function p(L){return da(L,i)}function d(L){return da(L,l.value)}function g(L){l.value=new Date(L.getFullYear(),L.getMonth(),L.getDate()),f(L,s.value)||(s.value=new Date(L.getFullYear(),L.getMonth(),1))}function y(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function k(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function x(){s.value=new Date(i.getFullYear(),i.getMonth(),1),l.value=new Date(i.getFullYear(),i.getMonth(),i.getDate())}const b=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],v=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],C=t.computed(()=>A(b[s.value.getMonth()])),O=t.computed(()=>s.value.getFullYear()),_=t.computed(()=>w(l.value)),E=t.computed(()=>`${R(l.value)} ${l.value.getDate()}`);function w(L){return`${String(L.getDate()).padStart(2,"0")}/${String(L.getMonth()+1).padStart(2,"0")}/${L.getFullYear()}`}function R(L){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][L.getDay()]}function D(L){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][L.getDay()]}function P(L){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][L.getMonth()]}function T(L){return b[L.getMonth()]}function A(L){return L.charAt(0).toUpperCase()+L.slice(1)}const z=t.computed(()=>h(s.value)),ie=t.computed(()=>{const L=c(s.value);return Array.from({length:L},(K,ae)=>{const ce=ae+1,Ee=new Date(s.value.getFullYear(),s.value.getMonth(),ce);return{key:`d${ce}`,date:Ee}})}),ee=t.ref({open:!1,anchorEl:null});function pe(L){ee.value.open=!0,ee.value.anchorEl=(L==null?void 0:L.currentTarget)||null}const{filters:V}=Mt.storeToRefs(r),M=t.computed(()=>_t(s.value)),j=t.computed(()=>r.eventsOf(M.value)),re={scheduled_by:L=>{var ce,Ee,ye;const K=(L==null?void 0:L.scheduled_by)??((Ee=(ce=L==null?void 0:L.raw)==null?void 0:ce.params)==null?void 0:Ee.scheduled_by)??((ye=L==null?void 0:L.raw)==null?void 0:ye.scheduled_by)??(L==null?void 0:L.created_by)??(L==null?void 0:L.attendant_id),ae=typeof K=="object"&&K?K.id??K.attendant_id:K;return ae!=null?String(ae):""}};function se(L,K){const ae=(K==null?void 0:K.value)??K;return!ae||typeof ae!="object"?!0:Object.entries(ae).every(([ce,Ee])=>{var q,Y,me;if(Ee==null||Ee===""||Array.isArray(Ee)&&Ee.length===0)return!0;const ye=re[ce],B=(ye==null?void 0:ye(L))??(L==null?void 0:L[ce])??((q=L==null?void 0:L.raw)==null?void 0:q[ce])??((me=(Y=L==null?void 0:L.raw)==null?void 0:Y.params)==null?void 0:me[ce])??null,F=typeof B=="string"?B:B??"";if(typeof Ee=="function")return!!Ee(F,L);if(Array.isArray(Ee))return Ee.map(String).includes(String(F));if(typeof Ee=="object"){const{in:te,notIn:oe,range:ue,contains:$}=Ee;if(te&&!te.map(String).includes(String(F))||oe&&oe.map(String).includes(String(F)))return!1;if(ue&&typeof F=="number"){const[Z,le]=ue;if(Z!=null&&F<Z||le!=null&&F>le)return!1}if($!=null){const Z=Array.isArray(F)?F:String(F).split(",");if(!(Array.isArray($)?$:[$]).some(xe=>Z.map(String).includes(String(xe))))return!1}return!0}return String(F)===String(Ee)})}const be=t.computed(()=>(j.value||[]).filter(K=>se(K,V)));function Ce(L){return be.value.filter(K=>da(K.date,L))}const Le=t.computed(()=>Ce(l.value)),Oe=t.computed(()=>[...Le.value].sort((L,K)=>L.date-K.date));function Be(L){return Ce(L).length}function G(L){return Math.min(3,Be(L))}function ne(L){const K=Be(L);return K>3?K-3:0}const Q=t.computed(()=>{const L=s.value.getFullYear(),K=s.value.getMonth(),ae=new Map;for(const Ee of be.value){const ye=Ee==null?void 0:Ee.date;if(!(ye instanceof Date)||ye.getFullYear()!==L||ye.getMonth()!==K)continue;const B=`${L}-${K+1}-${ye.getDate()}`;ae.has(B)||ae.set(B,{key:`ag-${B}`,date:new Date(L,K,ye.getDate()),events:[]}),ae.get(B).events.push(Ee)}const ce=Array.from(ae.values());for(const Ee of ce)Ee.events.sort((ye,B)=>ye.date-B.date);return ce.sort((Ee,ye)=>Ee.date-ye.date),ce}),S=t.ref(!1),N=t.ref(!1),I=t.computed(()=>N.value||S.value),H=t.computed(()=>I?"calendar-stage--compact":"calendar-stage--single");function X(){var ae;const L=window.matchMedia("(max-width: 1280px)"),K=()=>N.value=L.matches;K(),(ae=L.addEventListener)==null||ae.call(L,"change",K)}const U=t.computed(()=>r.isLoading(M.value));t.computed(()=>r.errorOf(M.value));const J=t.ref({open:!1,loading:!1,context:null,title:"Confirmar exclusão",description:"Tem certeza que deseja apagar este item?",destructive:!0,anchorEl:null,confirmLabel:"Apagar",cancelLabel:"Cancelar",loadingLabel:"Apagando…"});function de(L,K){J.value.open=!0,J.value.context={action:"delete-message",event:L},J.value.title="Confirmar exclusão",J.value.description="Tem certeza que deseja apagar este evento?",J.value.anchorEl=K&&K.currentTarget||typeof document<"u"&&document.activeElement||null,J.value.destructive=!0,J.value.confirmLabel="Apagar",J.value.loadingLabel="Apagando…"}async function we(L){if(L)try{J.value.loading=!0,L.action==="delete-message"&&await ge(L.event)}finally{J.value.loading=!1,J.value.open=!1,J.value.context=null}}function ke(){J.value.open=!1,J.value.context=null}async function he(){await r.forceReload(M.value)}async function ge(L){var K;try{L.deleteLoading=!0;const ae=((K=L==null?void 0:L.raw)==null?void 0:K.id)??(L==null?void 0:L.id)??L;if(ae==null)throw new Error("Evento inválido para exclusão");const ce=await e2(ts,L);return ce!=null&&ce.ok&&(r.removeFromCache(String(ae))||await r.forceReload(M.value)),ce}catch(ae){return console.error(ae),null}finally{L.deleteLoading=!1}}return t.onMounted(async()=>{if(X(),await r.ensureMonthLoaded(M.value),!Ce(l.value).length&&be.value.length){const L=be.value[0];l.value=new Date(L.date.getFullYear(),L.date.getMonth(),L.date.getDate())}}),t.watch(()=>o.sourceUrl,async L=>{if(r.setBaseUrl(L),r.resetAll(),await r.ensureMonthLoaded(M.value),!Ce(l.value).length&&be.value.length){const K=be.value[0];l.value=new Date(K.date.getFullYear(),K.date.getMonth(),K.date.getDate())}}),t.watch(M,async()=>{const L=s.value.getFullYear(),K=s.value.getMonth(),ae=Math.min(l.value.getDate(),c(s.value));if(l.value=new Date(L,K,ae),await r.ensureMonthLoaded(M.value),!Ce(l.value).length&&be.value.length){const ce=be.value[0];l.value=new Date(ce.date.getFullYear(),ce.date.getMonth(),ce.date.getDate())}}),n({updateEvent:r.applyUpdateToCache}),(L,K)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:t.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":I.value}])},[t.createElementVNode("div",Rc,[K[15]||(K[15]=t.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),t.createVNode(tc,{month:C.value,year:O.value,"is-compact":I.value,"view-mode":u.value,"filter-count":Object.keys(t.unref(V)).length,onPrev:y,onNext:k,onToday:x,onToggleCompact:K[0]||(K[0]=ae=>S.value=!S.value),onSetViewMode:K[1]||(K[1]=ae=>u.value=ae),onClosePage:K[2]||(K[2]=ae=>L.$emit("close-page")),onOpenFilter:pe},null,8,["month","year","is-compact","view-mode","filter-count"]),u.value==="calendar"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["calendar-stage",H.value])},[t.createElementVNode("div",Hc,[t.createVNode(oc,{"week-days":v,month:C.value,year:O.value},null,8,["month","year"]),t.createVNode(hc,{"start-offset":z.value,"month-days":ie.value,"view-date":s.value,"is-compact":I.value,"is-same-month-fn":f,"is-selected-day-fn":d,"is-today-fn":p,"select-day-fn":g,"events-by-day-fn":Ce,"day-event-count-fn":Be,"event-bars-to-show-fn":G,"day-event-overflow-fn":ne},null,8,["start-offset","month-days","view-date","is-compact"])]),I.value?(t.openBlock(),t.createBlock(Ko,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:U.value,"selected-label-long":E.value,events:Oe.value,mode:"compact",onReload:he,onOpenChat:K[3]||(K[3]=ae=>L.$emit("open-chat",ae)),onOpenMessage:K[4]||(K[4]=ae=>L.$emit("open-message",ae)),onDeleteMessage:K[5]||(K[5]=(ae,ce)=>de(ae,ce))},null,8,["loading","selected-label-long","events"])):t.createCommentVNode("",!0)],2)):(t.openBlock(),t.createBlock(Vc,{key:1,days:Q.value,"weekday-long":R,"weekday-short":D,"month-short":P,"month-label-of":T,year:O.value,onOpenChat:K[6]||(K[6]=ae=>L.$emit("open-chat",ae)),onOpenMessage:K[7]||(K[7]=ae=>L.$emit("open-message",ae)),onDeleteMessage:K[8]||(K[8]=(ae,ce)=>de(ae,ce))},null,8,["days","year"]))]),t.createVNode(Ko,{class:"calendar-daylist calendar-daylist--desktop",loading:U.value,"selected-label":_.value,"selected-label-long":E.value,events:Oe.value,mode:I.value?"compact":"sidebar",onReload:he,onOpenChat:K[9]||(K[9]=ae=>L.$emit("open-chat",ae)),onOpenMessage:K[10]||(K[10]=ae=>L.$emit("open-message",ae)),onDeleteMessage:K[11]||(K[11]=(ae,ce)=>de(ae,ce))},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),t.createVNode(zs,{modelValue:J.value.open,"onUpdate:modelValue":K[12]||(K[12]=ae=>J.value.open=ae),title:J.value.title,description:J.value.description,destructive:J.value.destructive,"confirm-label":J.value.confirmLabel,"cancel-label":J.value.cancelLabel,loading:J.value.loading,"loading-label":J.value.loadingLabel,context:J.value.context,"anchor-el":J.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:we,onCancel:ke},{details:t.withCtx(()=>{var ae;return[(ae=J.value.context)!=null&&ae.event?(t.openBlock(),t.createElementBlock("div",zc,[t.createVNode(fa,{"view-only":!0,mode:"sidebar",ev:J.value.context.event},null,8,["ev"])])):t.createCommentVNode("",!0)]}),_:1},8,["modelValue","title","description","destructive","confirm-label","cancel-label","loading","loading-label","context","anchor-el"]),t.createVNode(_c,{open:ee.value.open,"anchor-el":ee.value.anchorEl,filters:t.unref(V),"onUpdate:filters":K[13]||(K[13]=ae=>t.isRef(V)?V.value=ae:null),onClose:K[14]||(K[14]=ae=>ee.value.open=!1)},null,8,["open","anchor-el","filters"])],64))}},[["__scopeId","data-v-9c3b18ef"]]),jc={class:"flex flex-col text-center"},Gc={class:"flex flex-col space-y-3 justify-center"},Ic={class:"space-x-4 flex-col text-black justify-center"},qc=["onUpdate:modelValue","onInput","onKeydown"],Jo={__name:"mfa",props:{eventHandling:{type:String,default:null}},emits:["filled","reset"],setup(e,{emit:n}){t.onMounted(()=>{r.value[0].focus()});const a=n,o=t.ref(Array(6).fill("")),r=t.ref([]);t.ref(!1);const i=m=>{const c=o.value[m];o.value[0]<1&&a("reset"),/^\d$/.test(c)?s(m):o.value[m]="",m===o.value.length-1&&o.value.every(h=>h!=="")&&u()},s=m=>{m<o.value.length-1&&o.value[m]&&r.value[m+1].focus()},l=(m,c)=>{c.key==="Backspace"&&!o.value[m]&&m>0&&r.value[m-1].focus()},u=()=>{const m=o.value.join("");a("filled",m)};return(m,c)=>(t.openBlock(),t.createElementBlock("section",jc,[t.createElementVNode("div",Gc,[t.createElementVNode("div",Ic,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,(h,f)=>t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:f,"onUpdate:modelValue":p=>o.value[f]=p,class:t.normalizeClass([e.eventHandling==="check"?"checked_mfa":e.eventHandling==="err"?"err_mfa":"reset_input","inline-block w-10 h-10 rounded-md text-center"]),type:"text",maxlength:"1",onInput:p=>i(f),onKeydown:t.withKeys(p=>l(f,p),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,qc)),[[t.vModelText,o.value[f]]])),128))])])]))}},Wc={class:"text-center flex gap-3"},Uc={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},Yc={key:0,class:"items-center justify-center inline-flex"},Zc=["src"],Xc={__name:"mfaQrCode",props:{base64:{type:String,default:""},dimensions:{type:Array,default:null},loading:{type:Boolean,default:!1},generated:{type:Boolean,default:!1}},emits:["generateQR"],setup(e,{emit:n}){const a=n;t.ref(!1);const o=e,r=()=>{a("generateQR")},i=t.computed(()=>o.base64?o.base64:l.value),s=t.computed(()=>`w-${o.dimensions[0]} h-${o.dimensions[1]}`),l=t.ref("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAARGUlEQVR42u3dsZLbxhKFYejGpAOp9Jb7ACo9gMqx9JYbKOA6pwNfuly2yJ5lz5nuA/xfFSILwGAwanuxxz0frtfrdQMAA/+rHgAAjKJgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2GhTsD59+rR9+PBht0fkx48f2/l8/s955/N5+/HjR/XruTu+6Bgdv/r51dc/+vpd5cP1er1WD2Lb/nrhP3/+rB6GTDTN5/N5++OPP375z06n0/b29lY6/kfji4yMX/386usfff2uQsFaJJrm6N9i1a8p+2/Z6udXX//o63eVNj8SAkCEggXABgULgA0KFkIzPvhH1zidTk/9s07PCD0KFh56e3vbvnz5kr7O169fHxaFb9++/bIwnU6n7ffff5c/ZzQ+NHFt4uPHj9dt2+4er6+v1UNMjT/y6NwZr+n79+/X0+kU3mf1cTqdrt+/f396/KPnq8d39PW7ik2s4fX1dfv8+XP1MJ8efzTN6l+7Z3JUaityWplYxsj1j75+V+FHwoPoWqxGx/boz6ifrfPcHQ0FC4ANChYAGxQsADYoWCayv3JfkWVSjq06p4UeKFgmsjmhezmnaqM5q+qcFpqozlXcZHMsmyAjtL0jh6LOYd07RnNC91wul+vLy0t4n5eXl+vlcpl+/irV73/v63eV3eSw1E3GomlS57AeyfZzent723777beHf+ZyuWzn81ly/grq9jhHX7+r8CPhDmRzQiOF5NGfyZ4PjKJgAbBBwQJgg4IFwAYFayeqW6N0z0l1GAPyKFg7Ud3PqXtOqmsODe9Unau4OXqORTXuWf2i1FT9uqLnH82RZd//3tfvKuSwBkXTVJnDiszoF6VeJsp+XdHzj+TIsu9/7+t3FX4kPACHfk7KMUbXJiPmg4IFwAYFC4ANChYAGxSsJo7+K/fq5++eI8NfKFhNHD0nVP383XNk+L/qXMUNOZZfG80JZcefPb/KrBxVFut3Df4Lq7nz+bx9+/atehhtMT/HQsEyQE7oMebnOChYAGxQsADYoGABsEHBMrCibYx7Dsl9/BhDwWru7e1t+/Lli/w+7jkk9/FjUHWu4iabY6mWzbGo+kGN3r+7e/OT3Zdx1vWPvn5X2U0/rGrZfkLKflAj9+/u0fxk92Wccf2jr99V+JGwCYeeVZUezc+MuVNfH3NQsADYoGABsEHBAmCDggUL5KywbRQsmCBnhW3b+gQsohyI+xGJzn95ebleLpf/nDerH1Q2h+R+fnb+jr5+V7HJYbmLpjnal+5yudxtozJjX71sDsn9/Oy+jEdfv6tQsBbJFizO733+0dfvKnzDAmCDggXABgULgA0KVhPqnFH00Tl7/8z5M/p9VY4f61CwmlDnjL5+/fqwMGTv/+z5s/p9VY0fi1XnKjDH9mS+pjonNXpkqftpYY02sQbkRL+Wf6Q6JzUiu0zV/bSwBgVrJzIFa9vqc07Z8UWy40cPfMMCYIOCBcAGBQuADQoWynNSanxQ3w8K1sFV56TUVu3riEWqcxU3z+Z01PvSZY9VOZ9oHPf6ac16/mep+3mpxz+qOsfWff2OahNryOR01PvSZa3I+WT6ac14/swyUvfzUo9/RHWOLaNTTq1Nweqe08lST/PRc1LV4+/+fFlNygTfsAD4oGABsEHBAmBjFwUr++ty9QfFFb/OV/aDGpGdw+rxqzk/X6e5tS9Y2X5F6pzOqn5Kqn5Qo6J+W93Hr+b6fO36gVXnKm624hxR9ojGF+nar2k0J3XvcBl/xP39ZNdnFzaxBnWOKCsaX6Rzv6aRnNQjDuOP/hq4v5/s+uzCpmBFw3TPqXTv19Q955Qdf3Z9uT+fC/tvWACOg4IFwAYFC4ANCtYk1TkktcwYqsffYd/D7s/ngoI1SXUOSe3ZHFD1+Lvse9j9+WxU5yputmROJjq/66Huh1SdE1o1/up+WNU5wOzzdc2Z/RuxhgbU/ZCqc0Irxl/dD6s6B5h9vs45s3+iYDWhfr7q11y9b2L2+urnU8vOX/X6ueEbFgAbFCwANihYAGy0KVjO/YK66zA36hxX535e1bLz1+nZ2hQs135B3VXnhG7UOa6u/byqZeevy/r5W3WuYtSzOZFsP6fR416/oVn9mJ69v3p+Z53f9f1X55CO1u8q0ibWEMnkRLL9nEY86jc0ox9Ttl9YRLlvnnrfSPX7r84hHanfVcSmYHXPaWXvrz4/cvTxRar/mrjkpNTafMMCgAgFC4ANChYAGxYFq8v/eHnPipyLOieTuf6K91M5vo5xhdnP6KJ9were72dVzkWdk3n2+qveT9X42uWQ7sjmyGxU5ypu1P2Mnr3uNphz2WuOadX7UT3fXt5vdv3eO6pzZu/VJtag7meU/bV2Zl9E9xxTdP4I9TLLjq/7+1XGcqpzZu/RpmC590six/SYepnt/f1W5wi7aP8NCwBuKFgAbFCwANhoU7Dc+yWpc1LV+x5235ewcv2seL/KOXTImd20KVju/ZLUOanqfQ+770tYtX5WvV9Vvy2XnNnfqnMVs7j3S3r2/rPG1z0H5k71/o7WL6tNrCHLvV9Sdc6mew7MXeb9zli/e+mXtZuCVZ1zyU5jdc6mew7MXfecmIs237AAIELBAmCDggXAxmEKVvTRMqN6T7zs+Ebunxnj3j+oj1CuEfX76+QwBetezqW6X5K6n9SsflHP5sC69zNbRZUDVL+/dqpzFbNsohzTNphjyfZjyt4/oh5f9sh69vmqc2ar9s1UP/8qh4k1ZGX6Ja24f0Q9vqzsMsw8X3XObMW+mernX4WCNSiapur7R9Tjc38+9f2r14/6+Vc5zDcsAP4oWABsULAA2NhNwaruF9S5p1D3D6odcmzO/caOZDcFq7pfkOr+Wd1zUF1ybK79xg6nOldxo+qX1L1f0Oj4np2/0ePe83eZv6ocmVtO6d9mra8u2sQalP2SuvcLGhlf9JqU+/J1mL/KHJlTTulXZqyvLtoUrKP3Y6rO8WSvr54/cko51e9vlt18wwKwfxQsADYoWABstClY6n3f1NfPmPFBV7kvX/UH5+r7V6+PrOr5m6lNwVLv+6a+/rNm5YhU+/JV57iq71+9PrKq52+66lzFqOp+R6rxjR7dx199/+zxbL8zdT+tVYeLNrGGSHW/I+X4RqhfU3b82fFV9+vK9DtT99NawaQM9MlhhQMt7nekHp/7+LPj656zqs4JVj9/F22+YQFAhIIFwAYFC4ANi4LVod9RpLofV/U9qvd2VN9bmePbU05KrX3B6tLvKFLdj6t6/Kp+UmrZflVd+nkdRnWu4qY6h3Lv6NKPqyqHlt03z6WfVPecVbZfWXS4aBNrqM6hPNKhH1dlDi27b55DP6nuOatsv7JIkzIQalOwqnMokew0de93lR2/+v5q3XNW3dfHKu2/YQHADQULgA0KFgAbbQpW955D2Y/W2T9TPT/KflsdVPZjG/FofTjkFGdpU7C678v2bM5oNGcTXb96flT9trqo6sc26t76cMkpTlOdq8jK5pxm5VhUR5QD2su+c9kclDpHpbq/+/pbrU2sISObc5qRY1GKckB72Hcum4NS56iU43dffyvtomBtW33OSS07/u6vWf3+1M9/9PW3SptvWAAQoWABsEHBAmBjNwUrm6PpHKk4AuX7q+4n5r7+Oo1tNwUrm6Opzjkdner9VfcTc19/7XJ01bmKVdQ5mep+Rdnz3XNQz44ve3R5vntm9WPrYjexhog6J1Pdryj7a3X3HFRE2W+tw/M9MqMfWxeHKVjVOZ/qfkjdz1dz3zdS/fzdx3+zm29YAPaPggXABgULgI3DFCx1TkfZrygan7rf1oz77133OajOqc1ymIKlzumo+hVF41P325p1/73r3k+qOqc2TXWu4qZq371R7x3Xew/VvoSz5i97/+r3r35/qqN7zmu1NrGGyn33Rqh/La7clzCSzVmNiJaZ+v13b9+Sfb6jaFOwuu+rVp3jcb+/+/WrNflrWu4w37AA+KNgAbBBwQJgo03B6r7vnfIe1f2S1PdXv58j5MT28AwztClY3fe9U/Urqu6XpL6/+v0cJSfWPee1THWuAn+p7idVff8tyCNV5dRG7/8s9b6Ee8txtYk1HF11P6nq+0exg8qc2sj9M9T7Eu4px0XBaqK6X5H7/atzaurn7z7+Vdp8wwKACAULgA0KFgAbFKwmKvsVzeinpb4/sG0UrDaq+hXN6qelvj+wbVufHNbHjx/Lew8pjyzVvoEuR6T6/tn34z7+VdrEGj59+rT9/Pmzehgy2WlW7hvoIJq/6lhA9v24j38VCtYi2WnunlNSq36+7P33Pv5V+IYFwAYFC4ANChYAGxQsA10+eFap7heWHWP12LZNuy/lShSs5o6eU6ruFzaq+75/qn0pl6vOVdxEOazX19fqIabGH1Hv+xedf6/f02i/JlW/qKxZ/abU1O/n3tEtZxWxiTW8vr5unz9/rh7m0+OPplm971+m39RIvyZlv6isGf2m1H9N1O/nkU45qwg/EjZRHeqMmuNlzq/WeWwzniH7fNVr7z0oWABsULAA2KBgAbBBwdqBbE7pCPv6ZSMP1f3AMjmqSKecVYSCZS6bUzrKvn7ZnFZ1P7Bnc1SRdjmrSHWu4iabw9qSOZvoyI4/Et1fnXNS58BU98/miNT7AqqPWTkq+mG9UzaHVd2eI5vDyu7Ll6XOgSnvn80RqfcFVJuRo3Lph8WPhCbUWaLqLE7m/tmxu+e0Zry7R9eoXhv/RMECYIOCBcAGBQuADQpWE9X9iDrnlNRjn3WNStn5r15/oyhYTVT3I+qaU4rMmp/qflpZ2fmvXn/DqnMVN0fPYUWqcjKr+i1F18nm0J6dv2w/sFXnq99PF+SwBkXTlM1hRSpzMiv6LalzaJn5y/YDW3F+RqecVYSCNai6YFXvG5ed32h86udT7xtYfX5WkzIQ4hsWABsULAA2KFgAbFCwMETdb0mdA8pev/P5M7h8dKdgYYi635I6B5S9ftfzZ6nK0b1bda7ihhzWY9nxVVPnyKr7OWXvr86JPXt0y2kRaxgUTdPeYw1Z6hxZdT+n7P3VObGMTjktfiTEEup+S9X9nLL3z5y/915p/0TBAmCDggXABgULgA0KloEuHzwzuues1KKP5urzMzrM3w0Fq7m97wvYJWeldi/nlN2XUL0+uszf36pzFTfZHFa1bA6r676A6hzRqvGpr//se1t1qPe1XGU3Oaxq2RxW530B1TmiFeNTX1+dA8xS72u5Cj8SNlGddanMEa0YX/X1q+2hWG0bBQuAEQoWABsULAA2KFg7UJ1jUueAOly/MgeV1SlHlUXBMledY1LngLpcvyoHldUuR5VVnau4iXJM7kckOj/K0Tyb48rmrGY9f/frZw/VvoWjqvuFzWKTw3IXTXN2X75Mjiubs5rx/N2vn6Xct3BEdb+wWShYi2QLVvZ89fj2fv0s9fuPuDeAvOEbFgAbFCwANihYAGxQsJqo3LeO62vtYV/GLihYTVTtW8f1tfayL2MXbX5LCAAR/gsLgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgI0/AXRl5K/bYs25AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTAyLTExVDIwOjQzOjIzKzAwOjAwj4NP3QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0wMi0xMVQyMDo0MzoyMyswMDowMP7e92EAAAAASUVORK5CYII=");return(u,m)=>(t.openBlock(),t.createElementBlock("div",Wc,[t.createElementVNode("section",Uc,[e.generated?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([s.value,"btnQrCode"])},[e.loading?(t.openBlock(),t.createElementBlock("div",Yc,m[0]||(m[0]=[t.createElementVNode("div",{class:"loaderMFA"},null,-1)]))):(t.openBlock(),t.createElementBlock("button",{key:1,class:"uppercase bg-base-300 p-2 z-40",onClick:r}," Gerar QR "))],2)),t.createElementVNode("img",{class:t.normalizeClass([[s.value,e.generated?"rounded-md":"rounded-none"],""]),src:i.value,alt:"QRCode"},null,10,Zc)])]))}};for(var Ie=[],ma=0;ma<256;++ma)Ie.push((ma+256).toString(16).slice(1));function Kc(e,n=0){return(Ie[e[n+0]]+Ie[e[n+1]]+Ie[e[n+2]]+Ie[e[n+3]]+"-"+Ie[e[n+4]]+Ie[e[n+5]]+"-"+Ie[e[n+6]]+Ie[e[n+7]]+"-"+Ie[e[n+8]]+Ie[e[n+9]]+"-"+Ie[e[n+10]]+Ie[e[n+11]]+Ie[e[n+12]]+Ie[e[n+13]]+Ie[e[n+14]]+Ie[e[n+15]]).toLowerCase()}var Bn,Qc=new Uint8Array(16);function Jc(){if(!Bn&&(Bn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bn(Qc)}var e3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const e1={randomUUID:e3};function t3(e,n,a){if(e1.randomUUID&&!e)return e1.randomUUID();e=e||{};var o=e.random||(e.rng||Jc)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Kc(o)}function t1(){const e=Rt(),n=async l=>{const u=e.attendants.find(m=>m.id===l);if(u)try{const m=await it.get(`${sa}?attendant=${l}&page=1`);u.messages=m.data.results.reverse(),u.hasNextPage=m.data.next!==null,u.currentPage=2,u.internal_chat={channel_id:m.data.channel_id,unread:0}}catch(m){console.error("Erro ao buscar mensagens:",m)}},a=async l=>{const u=e.attendants.find(m=>m.id===l);if(!(!u||!u.hasNextPage))try{const m=await it.get(`${sa}?attendant=${l}&page=${u.currentPage}`);u.messages=[...m.data.results.reverse(),...u.messages],u.hasNextPage=m.data.next!==null,u.currentPage++}catch(m){console.error("Erro ao carregar mais mensagens:",m)}},o=(l,u,m)=>{const c=l==null?void 0:l.message;if(!c)return;const h=e.attendants.find(f=>{var p;return((p=f.internal_chat)==null?void 0:p.channel_id)===c.channel_id});h?(h.messages=h.messages||[],h.messages.find(p=>p.id===c.id)||(h.messages.push(c),(!u||h.id!==m)&&(h.internal_chat.unread=(h.internal_chat.unread||0)+1))):console.error("Atendente não encontrado para o canal especificado.")},r=l=>{const u=e.attendants.find(m=>m.id===l);u&&(u.internal_chat.unread=0)},i=async(l,u,m,c=!1)=>{var d;const h=e.attendants.find(g=>g.id===l);if(!h||!((d=h.internal_chat)!=null&&d.channel_id))return;let f;c?f=u:f={type:"text",content:u};const p={id:t3(),content:f,created_at:new Date().toISOString(),sender:m};h.messages.push(p);try{await it.post(`${sa}${h.internal_chat.channel_id}/message/`,{id:p.id,content:p.content})}catch(g){console.error("Erro ao enviar mensagem:",g)}},s=l=>{const u=e.attendants.find(m=>m.id===l);return u?u.hasNextPage:!1};return{attendants:t.computed(()=>e.attendants),count:t.computed(()=>e.count),fetchMessagesForAtendente:n,loadMessagesForAtendente:a,addMessageToAtendente:o,sendMessageToAtendente:i,hasNextPageForAtendente:s,resetUnreadMessages:r}}const n3={class:"avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500"},a3={key:0,style:{"padding-top":"0.5rem"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o3=["src"],ha=Ae({__name:"Avatar",props:{url:{type:String}},setup(e){return(n,a)=>(t.openBlock(),t.createElementBlock("div",n3,[e.url?(t.openBlock(),t.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:e.url},null,8,o3)):(t.openBlock(),t.createElementBlock("svg",a3,a[0]||(a[0]=[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"},null,-1)])))]))}},[["__scopeId","data-v-7d8b2820"]]),r3={class:"attendants-container"},i3={class:"atendentes-list bg-base-300"},s3={key:0,class:"empty-message bg-base-200"},l3=["onClick"],c3={class:"atendente-main"},d3={class:"atendente-name"},u3={class:"flex items-center gap-4"},f3={key:0,class:"message-indicator"},m3={key:0,class:"chat-footer bg-base-200"},n1=Ae({__name:"ChatList",props:{atendentes:{type:Array,required:!0},attendant:{required:!0},mobile:{type:Boolean,default:!1}},emits:["atendenteSelecionado"],setup(e,{emit:n}){const a=e,o=n,r=t.ref(""),i=u=>{o("atendenteSelecionado",u)},s=u=>{switch(u){case"Busy":return"bg-red-500";case"Online":return"bg-green-500";case"Away":return"bg-yellow-500";case"Offline":return"bg-gray-500";default:return"bg-purple-500"}},l=t.computed(()=>r.value?a.atendentes.filter(u=>u.name.toLowerCase().includes(r.value.toLowerCase())&&u.id!==a.attendant.id):a.atendentes.filter(u=>u.id!==a.attendant.id));return(u,m)=>(t.openBlock(),t.createElementBlock("div",r3,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=c=>r.value=c),class:t.normalizeClass(e.mobile?"search-input-mobile bg-base-300 border-b border-base-200":"search-input bg-base-300 border-b border-base-200"),placeholder:"Pesquise entre os atendentes..."},null,2),[[t.vModelText,r.value]]),t.createElementVNode("ul",i3,[l.value.length===0?(t.openBlock(),t.createElementBlock("li",s3,t.toDisplayString(e.atendentes.length===0?"Não há atendentes disponíveis":"Não há atendentes com esse nome"),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,c=>(t.openBlock(),t.createElementBlock("li",{key:c.id,onClick:h=>i(c),class:t.normalizeClass([["atendente-item",c.isMoved?"moved":""],"border-b even:bg-base-300 bg-blue-400/10 border-base-200 hover:bg-base-200 relative"])},[t.createElementVNode("main",c3,[t.createVNode(ha,{url:c.photo},null,8,["url"]),t.createElementVNode("span",d3,t.toDisplayString(c.name),1)]),t.createElementVNode("footer",u3,[c.internal_chat.unread>0?(t.openBlock(),t.createElementBlock("span",f3,t.toDisplayString(c.internal_chat.unread),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["status-indicator",s(c.login_status)])},null,2)]),m[1]||(m[1]=t.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,l3))),128))]),e.mobile?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("footer",m3))]))}},[["__scopeId","data-v-dc8950e9"]]);function h3(e,n=null){if(!e)return!1;const a=e.getBoundingClientRect(),o=n?n.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};return a.bottom>=o.top&&a.top<=o.bottom&&a.right>=o.left&&a.left<=o.right}async function p3(e){return e?(await t.nextTick(),e.value instanceof HTMLElement?e.value:e.value?document.querySelector(e.value):null):null}function g3(e){let n=`0px 0px ${e.distance}px 0px`;e.top&&(n=`${e.distance}px 0px 0px 0px`);const a=new IntersectionObserver(o=>{o[0].isIntersecting&&(e.firstload&&e.emit(),e.firstload=!0)},{root:e.parentEl,rootMargin:n});return e.infiniteLoading.value&&a.observe(e.infiniteLoading.value),a}async function a1(e,n){if(await t.nextTick(),!e.top)return;const a=e.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const o1=(e,n)=>{const a=e.__vccOpts||e;for(const[o,r]of n)a[o]=r;return a},y3={},k3=e=>(t.pushScopeId("data-v-d3e37633"),e=e(),t.popScopeId(),e),x3={class:"container"},b3=k3(()=>t.createElementVNode("div",{class:"spinner"},null,-1)),w3=[b3];function E3(e,n){return t.openBlock(),t.createElementBlock("div",x3,w3)}const v3=o1(y3,[["render",E3],["__scopeId","data-v-d3e37633"]]),C3={class:"state-error"},pa=o1(t.defineComponent({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(e,{emit:n}){const a=e;let o=null,r=0;const i=t.ref(null),s=t.ref(""),{top:l,firstload:u,distance:m}=a,{identifier:c,target:h}=t.toRefs(a),f={infiniteLoading:i,top:l,firstload:u,distance:m,parentEl:null,emit(){r=(f.parentEl||document.documentElement).scrollHeight,p.loading(),n("infinite",p)}},p={loading(){s.value="loading"},async loaded(){s.value="loaded",await a1(f,r),h3(i.value,f.parentEl)&&f.emit()},async complete(){s.value="complete",await a1(f,r),o==null||o.disconnect()},error(){s.value="error"}};function d(){o==null||o.disconnect(),o=g3(f)}return t.watch(c,d),t.onMounted(async()=>{f.parentEl=await p3(h),d()}),t.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,y)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"infiniteLoading",ref:i,class:"v3-infinite-loading"},[t.withDirectives(t.createElementVNode("div",null,[t.renderSlot(g.$slots,"spinner",{},()=>[t.createVNode(v3)],!0)],512),[[t.vShow,s.value=="loading"]]),s.value=="complete"?t.renderSlot(g.$slots,"complete",{key:0},()=>{var k;return[t.createElementVNode("span",null,t.toDisplayString(((k=g.slots)==null?void 0:k.complete)||"No more results!"),1)]},!0):t.createCommentVNode("",!0),s.value=="error"?t.renderSlot(g.$slots,"error",{key:1,retry:f.emit},()=>{var k;return[t.createElementVNode("span",C3,[t.createElementVNode("span",null,t.toDisplayString(((k=g.slots)==null?void 0:k.error)||"Oops something went wrong!"),1),t.createElementVNode("button",{class:"retry",onClick:y[0]||(y[0]=(...x)=>f.emit&&f.emit(...x))},"retry")])]},!0):t.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]);function S3(e,n,a){const o=tt(e,a==null?void 0:a.in);return isNaN(n)?Je(e,NaN):(o.setDate(o.getDate()+n),o)}function Mn(e,n){return Dt(e,{...n,weekStartsOn:1})}function r1(e,n){const a=tt(e,n==null?void 0:n.in),o=a.getFullYear(),r=Je(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const i=Mn(r),s=Je(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const l=Mn(s);return a.getTime()>=i.getTime()?o+1:a.getTime()>=l.getTime()?o:o-1}function i1(e){const n=tt(e),a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),+e-+a}function Vn(e,n){const a=tt(e,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function B3(e,n,a){const[o,r]=ca(a==null?void 0:a.in,e,n),i=Vn(o),s=Vn(r),l=+i-i1(i),u=+s-i1(s);return Math.round((l-u)/Is)}function M3(e,n){const a=r1(e,n),o=Je(e,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),Mn(o)}function ga(e){return Je(e,Date.now())}function s1(e,n,a){const[o,r]=ca(a==null?void 0:a.in,e,n);return+Vn(o)==+Vn(r)}function V3(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function A3(e){return!(!V3(e)&&typeof e!="number"||isNaN(+tt(e)))}function N3(e,n){const a=tt(e,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function D3(e,n){const a=tt(e,n==null?void 0:n.in);return B3(a,N3(a))+1}function T3(e,n){const a=tt(e,n==null?void 0:n.in),o=+Mn(a)-+M3(a);return Math.round(o/jo)+1}function l1(e,n){var c,h,f,p;const a=tt(e,n==null?void 0:n.in),o=a.getFullYear(),r=vn(),i=(n==null?void 0:n.firstWeekContainsDate)??((h=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=Je((n==null?void 0:n.in)||e,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=Dt(s,n),u=Je((n==null?void 0:n.in)||e,0);u.setFullYear(o,0,i),u.setHours(0,0,0,0);const m=Dt(u,n);return+a>=+l?o+1:+a>=+m?o:o-1}function F3(e,n){var l,u,m,c;const a=vn(),o=(n==null?void 0:n.firstWeekContainsDate)??((u=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??a.firstWeekContainsDate??((c=(m=a.locale)==null?void 0:m.options)==null?void 0:c.firstWeekContainsDate)??1,r=l1(e,n),i=Je((n==null?void 0:n.in)||e,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),Dt(i,n)}function L3(e,n){const a=tt(e,n==null?void 0:n.in),o=+Dt(a,n)-+F3(a,n);return Math.round(o/jo)+1}function Fe(e,n){const a=e<0?"-":"",o=Math.abs(e).toString().padStart(n,"0");return a+o}const yt={y(e,n){const a=e.getFullYear(),o=a>0?a:1-a;return Fe(n==="yy"?o%100:o,n.length)},M(e,n){const a=e.getMonth();return n==="M"?String(a+1):Fe(a+1,2)},d(e,n){return Fe(e.getDate(),n.length)},a(e,n){const a=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h(e,n){return Fe(e.getHours()%12||12,n.length)},H(e,n){return Fe(e.getHours(),n.length)},m(e,n){return Fe(e.getMinutes(),n.length)},s(e,n){return Fe(e.getSeconds(),n.length)},S(e,n){const a=n.length,o=e.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return Fe(r,n.length)}},Ht={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},c1={G:function(e,n,a){const o=e.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})}},y:function(e,n,a){if(n==="yo"){const o=e.getFullYear(),r=o>0?o:1-o;return a.ordinalNumber(r,{unit:"year"})}return yt.y(e,n)},Y:function(e,n,a,o){const r=l1(e,o),i=r>0?r:1-r;if(n==="YY"){const s=i%100;return Fe(s,2)}return n==="Yo"?a.ordinalNumber(i,{unit:"year"}):Fe(i,n.length)},R:function(e,n){const a=r1(e);return Fe(a,n.length)},u:function(e,n){const a=e.getFullYear();return Fe(a,n.length)},Q:function(e,n,a){const o=Math.ceil((e.getMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return Fe(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,n,a){const o=Math.ceil((e.getMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return Fe(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,n,a){const o=e.getMonth();switch(n){case"M":case"MM":return yt.M(e,n);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})}},L:function(e,n,a){const o=e.getMonth();switch(n){case"L":return String(o+1);case"LL":return Fe(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})}},w:function(e,n,a,o){const r=L3(e,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):Fe(r,n.length)},I:function(e,n,a){const o=T3(e);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):Fe(o,n.length)},d:function(e,n,a){return n==="do"?a.ordinalNumber(e.getDate(),{unit:"date"}):yt.d(e,n)},D:function(e,n,a){const o=D3(e);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):Fe(o,n.length)},E:function(e,n,a){const o=e.getDay();switch(n){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})}},e:function(e,n,a,o){const r=e.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(i);case"ee":return Fe(i,2);case"eo":return a.ordinalNumber(i,{unit:"day"});case"eee":return a.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(r,{width:"short",context:"formatting"});case"eeee":default:return a.day(r,{width:"wide",context:"formatting"})}},c:function(e,n,a,o){const r=e.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(i);case"cc":return Fe(i,n.length);case"co":return a.ordinalNumber(i,{unit:"day"});case"ccc":return a.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(r,{width:"narrow",context:"standalone"});case"cccccc":return a.day(r,{width:"short",context:"standalone"});case"cccc":default:return a.day(r,{width:"wide",context:"standalone"})}},i:function(e,n,a){const o=e.getDay(),r=o===0?7:o;switch(n){case"i":return String(r);case"ii":return Fe(r,n.length);case"io":return a.ordinalNumber(r,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});case"iiii":default:return a.day(o,{width:"wide",context:"formatting"})}},a:function(e,n,a){const r=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,n,a){const o=e.getHours();let r;switch(o===12?r=Ht.noon:o===0?r=Ht.midnight:r=o/12>=1?"pm":"am",n){case"b":case"bb":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,n,a){const o=e.getHours();let r;switch(o>=17?r=Ht.evening:o>=12?r=Ht.afternoon:o>=4?r=Ht.morning:r=Ht.night,n){case"B":case"BB":case"BBB":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,n,a){if(n==="ho"){let o=e.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return yt.h(e,n)},H:function(e,n,a){return n==="Ho"?a.ordinalNumber(e.getHours(),{unit:"hour"}):yt.H(e,n)},K:function(e,n,a){const o=e.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):Fe(o,n.length)},k:function(e,n,a){let o=e.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):Fe(o,n.length)},m:function(e,n,a){return n==="mo"?a.ordinalNumber(e.getMinutes(),{unit:"minute"}):yt.m(e,n)},s:function(e,n,a){return n==="so"?a.ordinalNumber(e.getSeconds(),{unit:"second"}):yt.s(e,n)},S:function(e,n){return yt.S(e,n)},X:function(e,n,a){const o=e.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return u1(o);case"XXXX":case"XX":return Tt(o);case"XXXXX":case"XXX":default:return Tt(o,":")}},x:function(e,n,a){const o=e.getTimezoneOffset();switch(n){case"x":return u1(o);case"xxxx":case"xx":return Tt(o);case"xxxxx":case"xxx":default:return Tt(o,":")}},O:function(e,n,a){const o=e.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+d1(o,":");case"OOOO":default:return"GMT"+Tt(o,":")}},z:function(e,n,a){const o=e.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+d1(o,":");case"zzzz":default:return"GMT"+Tt(o,":")}},t:function(e,n,a){const o=Math.trunc(+e/1e3);return Fe(o,n.length)},T:function(e,n,a){return Fe(+e,n.length)}};function d1(e,n=""){const a=e>0?"-":"+",o=Math.abs(e),r=Math.trunc(o/60),i=o%60;return i===0?a+String(r):a+String(r)+n+Fe(i,2)}function u1(e,n){return e%60===0?(e>0?"-":"+")+Fe(Math.abs(e)/60,2):Tt(e,n)}function Tt(e,n=""){const a=e>0?"-":"+",o=Math.abs(e),r=Fe(Math.trunc(o/60),2),i=Fe(o%60,2);return a+r+n+i}const f1=(e,n)=>{switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},m1=(e,n)=>{switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},O3={p:m1,P:(e,n)=>{const a=e.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return f1(e,n);let i;switch(o){case"P":i=n.dateTime({width:"short"});break;case"PP":i=n.dateTime({width:"medium"});break;case"PPP":i=n.dateTime({width:"long"});break;case"PPPP":default:i=n.dateTime({width:"full"});break}return i.replace("{{date}}",f1(o,n)).replace("{{time}}",m1(r,n))}},P3=/^D+$/,$3=/^Y+$/,_3=["D","DD","YY","YYYY"];function R3(e){return P3.test(e)}function H3(e){return $3.test(e)}function z3(e,n,a){const o=j3(e,n,a);if(console.warn(o),_3.includes(e))throw new RangeError(o)}function j3(e,n,a){const o=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${n}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const G3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,I3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,q3=/^'([^]*?)'?$/,W3=/''/g,U3=/[a-zA-Z]/;function h1(e,n,a){var c,h,f,p,d,g,y,k;const o=vn(),r=(a==null?void 0:a.locale)??o.locale??wl,i=(a==null?void 0:a.firstWeekContainsDate)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(f=o.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(d=a==null?void 0:a.locale)==null?void 0:d.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((k=(y=o.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=tt(e,a==null?void 0:a.in);if(!A3(l))throw new RangeError("Invalid time value");let u=n.match(I3).map(x=>{const b=x[0];if(b==="p"||b==="P"){const v=O3[b];return v(x,r.formatLong)}return x}).join("").match(G3).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const b=x[0];if(b==="'")return{isToken:!1,value:Y3(x)};if(c1[b])return{isToken:!0,value:x};if(b.match(U3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:x}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const m={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return u.map(x=>{if(!x.isToken)return x.value;const b=x.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&H3(b)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&R3(b))&&z3(b,n,String(e));const v=c1[b[0]];return v(l,b,r.localize,m)}).join("")}function Y3(e){const n=e.match(q3);return n?n[1].replace(W3,"'"):e}function Z3(e,n){return Ws(Je(e,e),ga(e),n)}function X3(e,n){return s1(Je(e,e),ga(e))}function K3(e,n,a){return S3(e,-1,a)}function Q3(e,n){return s1(Je(e,e),K3(ga(e)))}/*! License details at fancyapps.com/license */const je=e=>typeof e=="string";/*! License details at fancyapps.com/license */const zt=e=>e&&e!==null&&e instanceof Element&&"nodeType"in e;/*! License details at fancyapps.com/license */const J3=function(e){if(!(e&&e instanceof Element&&e.offsetParent))return!1;const n=e.scrollHeight>e.clientHeight,a=window.getComputedStyle(e).overflowY,o=a.indexOf("hidden")!==-1,r=a.indexOf("visible")!==-1;return n&&!o&&!r},Jt=function(e,n=void 0){return!e||e===document.body||n&&e===n?null:J3(e)?e:Jt(e.parentElement,n)};/*! License details at fancyapps.com/license */const kt=function(e){var n=new DOMParser().parseFromString(e,"text/html").body;if(n.childElementCount>1){for(var a=document.createElement("div");n.firstChild;)a.appendChild(n.firstChild);return a}let o=n.firstChild;return!o||o instanceof HTMLElement?o:((a=document.createElement("div")).appendChild(o),a)};/*! License details at fancyapps.com/license */const De=function(e=0,n=0,a=0){return Math.max(Math.min(n,a),e)};/*! License details at fancyapps.com/license */const Ue=e=>typeof e=="object"&&e!==null&&e.constructor===Object&&Object.prototype.toString.call(e)==="[object Object]";/*! License details at fancyapps.com/license */function p1(e){return Ue(e)||Array.isArray(e)}function ya(e,n){const a=Object.keys(e),o=Object.keys(n);return a.length===o.length&&a.every(r=>{const i=e[r],s=n[r];return typeof i=="function"?`${i}`==`${s}`:p1(i)&&p1(s)?ya(i,s):i===s})}/*! License details at fancyapps.com/license */const g1=function(e){for(const n of An)n.getState()===Ye.Running&&n.tick(ka?e-ka:0);ka=e,Gt=window.requestAnimationFrame(g1)};var Ye,xt,jt;(function(e){e[e.Initializing=0]="Initializing",e[e.Running=1]="Running",e[e.Paused=2]="Paused",e[e.Completed=3]="Completed",e[e.Destroyed=4]="Destroyed"})(Ye||(Ye={})),function(e){e[e.Spring=0]="Spring",e[e.Ease=1]="Ease"}(xt||(xt={})),function(e){e[e.Loop=0]="Loop",e[e.Reverse=1]="Reverse"}(jt||(jt={}));const An=new Set;let Gt=null,ka=0;function bt(){let e=Ye.Initializing,n=xt.Ease,a=0,o=0,r=bt.Easings.Linear,i=500,s=0,l=0,u=0,m=0,c=1/0,h=.01,f=.01,p=!1,d={},g=null,y={},k={},x={},b=0,v=0,C=jt.Loop,O=bt.Easings.Linear;const _=new Map;function E(T,...A){for(const z of _.get(T)||[])z(...A)}function w(T){return o=0,T?g=setTimeout(()=>{R()},T):R(),P}function R(){e=Ye.Running,E("start",y,k)}function D(){if(e=Ye.Completed,x={},E("end",y),e===Ye.Completed)if(a<b){if(a++,C===jt.Reverse){const T=Object.assign({},d);d=Object.assign({},k),k=T}w(v)}else a=0;return P}const P={getState:function(){return e},easing:function(T){return r=T,n=xt.Ease,x={},P},duration:function(T){return i=T,P},spring:function(T={}){n=xt.Spring;const A={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:z,mass:ie,tension:ee,friction:pe,restDelta:V,restSpeed:M,maxSpeed:j,clamp:re}=Object.assign(Object.assign({},A),T);return s=z,l=ie,u=ee,m=pe,f=V,h=M,c=j,p=re,x={},P},isRunning:function(){return e===Ye.Running},isSpring:function(){return n===xt.Spring},from:function(T){return y=Object.assign({},T),P},to:function(T){return k=T,P},repeat:function(T,A=0,z=jt.Loop,ie){return b=T,v=A,C=z,O=ie||r,P},on:function(T,A){var z,ie;return z=T,ie=A,_.set(z,[..._.get(z)||[],ie]),P},off:function(T,A){var z,ie;return z=T,ie=A,_.has(z)&&_.set(z,_.get(z).filter(ee=>ee!==ie)),P},start:function(T){return e=Ye.Initializing,d=Object.assign({},y),ya(d,k)||(An.add(this),Gt||(Gt=window.requestAnimationFrame(g1)),w(T)),P},pause:function(){return g&&(clearTimeout(g),g=null),e===Ye.Running&&(e=Ye.Paused,E("pause",y)),P},end:D,tick:function(T){T>50&&(T=50),o+=T;let A=0,z=!1;if(e!==Ye.Running)return P;if(n===xt.Ease){A=De(0,o/i,1),z=A===1;const ee=C===jt.Reverse?O:r;for(const pe in y)y[pe]=d[pe]+(k[pe]-d[pe])*ee(A)}if(n===xt.Spring){const ee=.001*T;let pe=0;for(const V in y){const M=k[V];let j=y[V];if(typeof M!="number"||isNaN(M)||typeof j!="number"||isNaN(j))continue;if(Math.abs(M-j)<=f){y[V]=M,x[V]=0;continue}x[V]||(typeof s=="object"&&typeof s[V]=="number"?x[V]=s[V]:x[V]=typeof s=="number"?s:0);let re=x[V];re=De(-1*Math.abs(c),re,Math.abs(c));const se=re*l*m;re+=((j>M?-1:1)*(Math.abs(M-j)*u)-se)/l*ee,j+=re*ee;const be=y[V]>M?j<M:j>M;let Ce=Math.abs(re)<h&&Math.abs(M-j)<=f;p&&be&&(Ce=!0),Ce?(j=M,re=0):pe++,y[V]=j,x[V]=re}z=!pe}const ie=Object.assign({},k);return E("step",y,d,k,A),z&&e===Ye.Running&&ya(k,ie)&&(e=Ye.Completed,D()),P},getStartValues:function(){return d},getCurrentValues:function(){return y},getCurrentVelocities:function(){return x},getEndValues:function(){return k},destroy:function(){e=Ye.Destroyed,g&&(clearTimeout(g),g=null),d=y=k={},An.delete(this)}};return P}bt.destroy=()=>{for(const e of An)e.destroy();Gt&&(cancelAnimationFrame(Gt),Gt=null)},bt.Easings={Linear:function(e){return e},EaseIn:function(e){return e===0?0:Math.pow(2,10*e-10)},EaseOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},EaseInOut:function(e){return e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2}};/*! License details at fancyapps.com/license */function xa(e){const n=[],a=typeof TouchEvent<"u"&&e instanceof TouchEvent?e.touches:e instanceof MouseEvent&&e.type!=="mouseup"?[e]:[];for(const o of a)n.push({x:o.clientX,y:o.clientY,ts:Date.now()});return n}function y1(e){const n=[],a=typeof TouchEvent<"u"&&e instanceof TouchEvent?e.changedTouches:e instanceof MouseEvent?[e]:[];for(const o of a)n.push({x:o.clientX,y:o.clientY,ts:Date.now()});return n}function wt(e){const n=e[0],a=e[1]||n;return{x:(n.x+a.x)/2,y:(n.y+a.y)/2,ts:a.ts}}function Nn(e){const n=e[0],a=e[1]||e[0];return n&&a?-1*Math.sqrt((a.x-n.x)*(a.x-n.x)+(a.y-n.y)*(a.y-n.y)):0}const k1=e=>{e.cancelable&&e.preventDefault()},Et={passive:!1},ed={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let ba=!1,en=!0;const tn=(e,n)=>{let a,o,r,i=Object.assign(Object.assign({},ed),n),s=[],l=[],u=[],m=!1,c=!1,h=!1,f=0,p=0,d=0,g=0,y=0,k=0,x=0,b=0,v=0,C=[],O=0,_=0;const E=new Map;function w(V){const M=Nn(l),j=Nn(u),re=M&&j?M/j:0,se=Math.abs(x)>Math.abs(b)?x:b,be={srcEvent:a,isPanRecognized:m,isSwipeRecognized:c,firstTouch:s,previousTouch:u,currentTouch:l,deltaX:d,deltaY:g,offsetX:y,offsetY:k,velocityX:x,velocityY:b,velocity:se,angle:v,axis:r,scale:re,center:o};for(const Ce of E.get(V)||[])Ce(be)}function R(V){const M=Date.now();C=C.filter(j=>!j.ts||j.ts>M-100),V&&C.push(V)}function D(){if(x=0,b=0,C.length>3){const V=C[0],M=C[C.length-1];if(V&&M){const j=M.x-V.x,re=M.y-V.y,se=V.ts&&M.ts?M.ts-V.ts:0;se>0&&(x=Math.abs(j)>3?j/(se/30):0,b=Math.abs(re)>3?re/(se/30):0)}}}function P(V){if(V instanceof MouseEvent){if(ba)return}else ba=!0;const M=V.composedPath()[0],j=i.ignore.join(",");if(M.matches(j)||M.closest(j)||typeof MouseEvent<"u"&&V instanceof MouseEvent&&(!V.buttons||V.button!==0))return;V instanceof MouseEvent&&k1(V);const re=Date.now(),se=re-(f||re);h=se>0&&se<=250,f=re,clearTimeout(O),a=V,V instanceof MouseEvent&&(window.addEventListener("mousemove",T),window.addEventListener("mouseup",A)),window.addEventListener("blur",z),l=xa(V),s=[...l],u=[],p=l.length,o=wt(l),p===1&&(m=!1,c=!1),p&&R(wt(l)),w("start")}function T(V){var M;if(!s.length||V.defaultPrevented)return;a=V,u=[...l],l=xa(V),p=l.length,o=wt(l);const j=o,re=wt(u);if(d=j.x-re.x,g=j.y-re.y,R(j),D(),w("move"),l.length>1){const se=Nn(l),be=Nn(u);Math.abs(se-be)>=.1&&w("pinch")}if(!m&&s.length){const se=wt(s);y=j.x-se.x,k=j.y-se.y,m=Math.abs(y)>i.panThreshold||Math.abs(k)>i.panThreshold,m&&(en=!1,clearTimeout(_),_=0,v=Math.abs(180*Math.atan2(k,y)/Math.PI),r=v>45&&v<135?"y":"x",s=[...l],u=[...l],(M=window.getSelection())===null||M===void 0||M.removeAllRanges(),w("panstart"))}m&&(d||g)&&w("pan")}function A(V){if(a=V,!s.length)return;const M=xa(V),j=y1(V);if(p=M.length,o=wt(j),j.length&&R(wt(j)),D(),u=[...l],l=[...M],s=[...M],M.length>0)w("end"),m=!1,c=!1,C=[];else{const re=i.swipeThreshold;(Math.abs(x)>re||Math.abs(b)>re)&&(c=!0),m&&w("panend"),c&&w("swipe"),m||c||(w("tap"),h?w("doubleTap"):O=setTimeout(function(){w("singleTap")},250)),w("end"),ie()}}function z(){clearTimeout(O),ie(),m&&w("panend"),w("end")}function ie(){m=!1,c=!1,h=!1,p=0,C=[],l=[],u=[],s=[],d=0,g=0,y=0,k=0,x=0,b=0,v=0,r=void 0,window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",A),window.removeEventListener("blur",z),en||_||(_=setTimeout(()=>{en=!0,_=0},100))}function ee(V){const M=V.target;ba=!1,M&&!V.defaultPrevented&&(en||(k1(V),V.stopPropagation()))}const pe={init:function(){if(e)return e.addEventListener("click",ee,Et),e.addEventListener("mousedown",P,Et),e.addEventListener("touchstart",P,Et),e.addEventListener("touchmove",T,Et),e.addEventListener("touchend",A),e.addEventListener("touchcancel",A),pe},on:function(V,M){return function(j,re){E.set(j,[...E.get(j)||[],re])}(V,M),pe},off:function(V,M){return E.has(V)&&E.set(V,E.get(V).filter(j=>j!==M)),pe},isPointerDown:()=>p>0,destroy:function(){clearTimeout(O),clearTimeout(_),_=0,e&&(e.removeEventListener("click",ee,Et),e.removeEventListener("mousedown",P,Et),e.removeEventListener("touchstart",P,Et),e.removeEventListener("touchmove",T,Et),e.removeEventListener("touchend",A),e.removeEventListener("touchcancel",A)),e=null,ie()}};return pe};tn.isClickAllowed=()=>en;/*! License details at fancyapps.com/license */const wa={IMAGE_ERROR:"This image couldn't be loaded. <br /> Please try again later.",MOVE_UP:"Move up",MOVE_DOWN:"Move down",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",TOGGLE_FULL:"Toggle zoom level",TOGGLE_1TO1:"Toggle zoom level",ITERATE_ZOOM:"Toggle zoom level",ROTATE_CCW:"Rotate counterclockwise",ROTATE_CW:"Rotate clockwise",FLIP_X:"Flip horizontally",FLIP_Y:"Flip vertically",RESET:"Reset"};/*! License details at fancyapps.com/license */const Te=(e,n="")=>{e&&e.classList&&n.split(" ").forEach(a=>{a&&e.classList.add(a)})};/*! License details at fancyapps.com/license */const Dn=e=>{e.cancelable&&e.preventDefault()},Ze=(e,n=1e4)=>(e=parseFloat(e+"")||0,Math.round((e+Number.EPSILON)*n)/n);var fe,x1;(function(e){e.Reset="reset",e.Zoom="zoom",e.ZoomIn="zoomIn",e.ZoomOut="zoomOut",e.ZoomTo="zoomTo",e.ToggleCover="toggleCover",e.ToggleFull="toggleFull",e.ToggleMax="toggleMax",e.IterateZoom="iterateZoom",e.Pan="pan",e.Swipe="swipe",e.Move="move",e.MoveLeft="moveLeft",e.MoveRight="moveRight",e.MoveUp="moveUp",e.MoveDown="moveDown",e.RotateCCW="rotateCCW",e.RotateCW="rotateCW",e.FlipX="flipX",e.FlipY="flipY"})(fe||(fe={})),function(e){e.Cover="cover",e.Full="full",e.Max="max"}(x1||(x1={}));const nt={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},Ea={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:fe.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:wa,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:fe.Zoom,width:"auto"};let Tn,b1=0,w1=0,Fn=0;const va=(e,n={},a={})=>{let o,r,i,s,l,u,m,c=0,h=Object.assign(Object.assign({},Ea),n),f={},p=Object.assign({},nt),d=Object.assign({},nt);const g=[];function y(S){let N=h[S];return N&&typeof N=="function"?N(Q):N}const k=new Map;function x(S,...N){const I=k.get(S)||[];h.on&&I.push(h.on[S]);for(const H of I)H&&H instanceof Function&&H(Q,...N);S!=="*"&&x("*",S,...N)}function b(S){if(c!==3)return;const N=S.target;if(Jt(N))return;const I=Date.now(),H=[-S.deltaX||0,-S.deltaY||0,-S.detail||0].reduce(function(we,ke){return Math.abs(ke)>Math.abs(we)?ke:we}),X=De(-1,H,1);x("wheel",S,X);const U=y("wheelAction");if(!U||S.defaultPrevented)return;const J=d.scale;let de=J*(X>0?1.5:.5);if(U===fe.Zoom){const we=Math.abs(S.deltaY)<100&&Math.abs(S.deltaX)<100;if(I-w1<(we?200:45))return void Dn(S);w1=I;const ke=P(),he=ie();if(Ze(de)<Ze(ke)&&Ze(J)<=Ze(ke)?(Fn+=Math.abs(X),de=ke):Ze(de)>Ze(he)&&Ze(J)>=Ze(he)?(Fn+=Math.abs(X),de=he):(Fn=0,de=De(ke,de,he)),Fn>7)return}switch(Dn(S),U){case fe.Pan:M(U,{srcEvent:S,deltaX:2*-S.deltaX,deltaY:2*-S.deltaY});break;case fe.Zoom:M(fe.ZoomTo,{srcEvent:S,scale:de,center:{x:S.clientX,y:S.clientY}});break;default:M(U,{srcEvent:S})}}function v(S){var N,I;const H=S.composedPath()[0];if(!tn.isClickAllowed()||!zt(H)||S.defaultPrevented||!(e!=null&&e.contains(H))||H.hasAttribute("disabled")||H.hasAttribute("aria-disabled"))return;const X=H.closest("[data-panzoom-action]"),U=(N=X==null?void 0:X.dataset)===null||N===void 0?void 0:N.panzoomAction,J=((I=X==null?void 0:X.dataset)===null||I===void 0?void 0:I.panzoomValue)||"";if(U){switch(U){case fe.ZoomTo:case fe.ZoomIn:case fe.ZoomOut:M(U,{scale:parseFloat(J||"")||void 0});break;case fe.MoveLeft:case fe.MoveRight:M(U,{deltaX:parseFloat(J||"")||void 0});break;case fe.MoveUp:case fe.MoveDown:M(U,{deltaY:parseFloat(J||"")||void 0});break;default:M(U)}return}if(!(o!=null&&o.contains(H)))return;const de={srcEvent:S};if(M(y("clickAction"),de),y("dblClickAction")){const we=Date.now(),ke=we-(b1||we);b1=we,ke>0&&ke<=250?(Tn&&(clearTimeout(Tn),Tn=void 0),M(y("dblClickAction"),de)):Tn=setTimeout(()=>{M(y("singleClickAction"),de)},250)}}function C(S){if(m=S,!w()||c!==3||p.scale<=1||d.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const N=R(d.scale);if(!N)return;const{x:I,y:H}=N;M(fe.Pan,{deltaX:I-d.x,deltaY:H-d.y})}function O(){var S;if(e&&((S=e.querySelector(".f-spinner"))===null||S===void 0||S.remove(),e.classList.remove("is-loading")),!e||!o)return;if(r instanceof HTMLImageElement&&(!r.complete||!r.naturalWidth))return c=2,o==null||o.classList.add("has-error"),void x("error");x("loaded");const{width:N,height:I}=E();r&&(r.setAttribute("width",N+""),r.setAttribute("height",I+"")),o&&(o.classList.remove("has-error"),o.setAttribute("width",N+""),o.setAttribute("height",I+""),o.style.aspectRatio=`${N/I||""}`),l=bt().on("start",(X,U)=>{d=Object.assign(Object.assign({},nt),U),U.angle!==void 0&&(U.angle=90*Math.round(U.angle/90)),U.flipX!==void 0&&(U.flipX=U.flipX>0?1:-1),U.flipY!==void 0&&(U.flipY=U.flipY>0?1:-1),V(),x("animationStart")}).on("pause",X=>{d=Object.assign(Object.assign({},nt),X)}).on("step",X=>{if(c!==3||!l)return;if(!e||!e.parentElement)return void l.end();if(p=Object.assign(Object.assign({},nt),X),w()||!y("bounds")||(s==null?void 0:s.isPointerDown())||d.scale>p.scale||d.scale<T())return void j();const U=ee(d.scale);let J=!1,de=!1,we=!1,ke=!1;p.x<U.x[0]&&(J=!0),p.x>U.x[1]&&(de=!0),p.y<U.y[0]&&(ke=!0),p.y>U.y[1]&&(we=!0);let he=!1,ge=!1,L=!1,K=!1;d.x<U.x[0]&&(he=!0),d.x>U.x[1]&&(ge=!0),d.y<U.y[0]&&(K=!0),d.y>U.y[1]&&(L=!0);let ae=!1;(de&&ge||J&&he)&&(d.x=De(U.x[0],d.x,U.x[1]),ae=!0),(we&&L||ke&&K)&&(d.y=De(U.y[0],d.y,U.y[1]),ae=!0),ae&&l.spring({tension:94,friction:17,maxSpeed:555*d.scale,restDelta:.1,restSpeed:.1,velocity:l.getCurrentVelocities()}).from(p).to(d).start(),j()}).on("end",()=>{pe(),l!=null&&l.isRunning()||(V(),x("animationEnd"))}),function(){const X=y("gestures");X&&i&&r&&(s=tn(i,X).on("start",U=>{if(!l)return;const J=U.srcEvent;w()||((p.scale>1||U.currentTouch.length>1)&&(J==null||J.stopPropagation(),l.pause()),U.currentTouch.length===1&&x("touchStart"))}).on("move",U=>{w()||(d.scale!==1||U.currentTouch.length>1)&&(U.srcEvent.preventDefault(),U.srcEvent.stopPropagation())}).on("pan",U=>{if(w())return;const J=U.srcEvent;(d.scale!==1||U.currentTouch.length>1)&&(Dn(J),M(fe.Pan,U))}).on("swipe",U=>{w()||d.scale>1&&M(fe.Swipe,U)}).on("tap",U=>{x("click",U)}).on("singleTap",U=>{x("singleClick",U)}).on("doubleTap",U=>{x("dblClick",U)}).on("pinch",U=>{w()||(U.scale>T()?M(fe.ZoomIn,U):U.scale<T()?M(fe.ZoomOut,U):M(fe.Pan,U))}).on("end",U=>{w()||(U.currentTouch.length?(U.srcEvent.stopPropagation(),Dn(U.srcEvent),l==null||l.end()):(V(),pe(),x("touchEnd")))}).init())}(),i&&(i.addEventListener("wheel",b,{passive:!1}),g.push(()=>{i==null||i.removeEventListener("wheel",b,{passive:!1})})),e==null||e.addEventListener("click",v),document==null||document.addEventListener("mousemove",C),g.push(()=>{e==null||e.removeEventListener("click",v),document==null||document.removeEventListener("mousemove",C)});const H=Object.assign(Object.assign({},y("startPos")||{}),{scale:T()});if(p=Object.assign(Object.assign({},nt),H),d=Object.assign(Object.assign({},nt),H),w()){const X=R(d.scale);if(X){const{x:U,y:J}=X;p.x=U,p.y=J,d.x=U,d.y=J}}c=3,j(),V(),x("ready"),requestAnimationFrame(()=>{i&&(i.style.visibility="")})}function _(){const S={top:0,left:0,width:0,height:0};if(o){const N=o.getBoundingClientRect();d.angle%180==90?(S.top=N.top+.5*N.height-.5*N.width,S.left=N.left+.5*N.width-.5*N.height,S.width=N.height,S.height=N.width):(S.top=N.top,S.left=N.left,S.width=N.width,S.height=N.height)}return S}function E(){let S=y("width"),N=y("height");if(r&&S==="auto"){const I=r.getAttribute("width");S=I?parseFloat(I+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):i instanceof HTMLImageElement?i.naturalWidth:r instanceof HTMLImageElement?r.naturalWidth:r.getBoundingClientRect().width}else S=je(S)?parseFloat(S):S;if(r&&N==="auto"){const I=r.getAttribute("height");N=I?parseFloat(I+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):i instanceof HTMLImageElement?i.naturalHeight:r instanceof HTMLImageElement?r.naturalHeight:r.getBoundingClientRect().height}else N=je(N)?parseFloat(N):N;return{width:S,height:N}}function w(){return y("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function R(S){const N=m||y("event"),I=o==null?void 0:o.getBoundingClientRect();if(!N||!I||S<=1)return{x:0,y:0};const H=(N.clientX||0)-I.left,X=(N.clientY||0)-I.top,U=I.width,J=I.height,de=ee(S);if(S>1){const L=y("mouseMoveFactor");L>1&&(S*=L)}let we=U*S,ke=J*S,he=.5*(we-U)-H/U*100/100*(we-U),ge=.5*(ke-J)-X/J*100/100*(ke-J);return he=De(de.x[0],he,de.x[1]),ge=De(de.y[0],ge,de.y[1]),{x:he,y:ge}}function D(S="base"){if(!e)return 1;const N=e.getBoundingClientRect(),I=_(),{width:H,height:X}=E(),U=he=>{if(typeof he=="number")return he;switch(he){case"min":case"base":return 1;case"cover":return Math.max(N.height/I.height,N.width/I.width)||1;case"full":case"max":{const ge=d.angle%180==90?X:H;return ge&&I.width?ge/I.width:1}}},J=y("minScale"),de=y("maxScale"),we=Math.min(U("full"),U(J)),ke=typeof de=="number"?U("full")*de:Math.min(U("full"),U(de));switch(S){case"min":return we;case"base":return De(we,1,ke);case"cover":return U("cover");case"full":return Math.min(ke,U("full"));case"max":return ke}}function P(){return D("min")}function T(){return D("base")}function A(){return D("cover")}function z(){return D("full")}function ie(){return D("max")}function ee(S){const N={x:[0,0],y:[0,0]},I=e==null?void 0:e.getBoundingClientRect();if(!I)return N;const H=_(),X=I.width,U=I.height;let J=H.width,de=H.height,we=S=S===void 0?d.scale:S,ke=S;if(w()&&S>1){const he=y("mouseMoveFactor");he>1&&(J*S>X+.01&&(we*=he),de*S>U+.01&&(ke*=he))}return J*=we,de*=ke,S>1&&(J>X&&(N.x[0]=.5*(X-J),N.x[1]=.5*(J-X)),N.x[0]-=.5*(H.left-I.left),N.x[1]-=.5*(H.left-I.left),N.x[0]-=.5*(H.left+H.width-I.right),N.x[1]-=.5*(H.left+H.width-I.right),de>U&&(N.y[0]=.5*(U-de),N.y[1]=.5*(de-U)),N.y[0]-=.5*(H.top-I.top),N.y[1]-=.5*(H.top-I.top),N.y[0]-=.5*(H.top+H.height-I.bottom),N.y[1]-=.5*(H.top+H.height-I.bottom)),N}function pe(){if(!y("bounds")||c!==3||!(e!=null&&e.parentElement)||!l)return;const S=P(),N=ie(),I=De(S,d.scale,N);if(d.scale<S-.01||d.scale>N+.01)return void M(fe.ZoomTo,{scale:I});if(l.isRunning()||s!=null&&s.isPointerDown())return;const H=ee(I);d.x<H.x[0]||d.x>H.x[1]||d.y<H.y[0]||d.y>H.y[1]?(d.x=De(H.x[0],d.x,H.x[1]),d.y=De(H.y[0],d.y,H.y[1]),l.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:l.getCurrentVelocities()}),l.from(p).to(d).start()):j()}function V(){if(!e||!e.parentElement||!o)return;const S=Oe(),N=Be(),I=G(),H=ne(),X=se(),U=be();o.classList.toggle("is-fullsize",H),o.classList.toggle("is-expanded",I),o.classList.toggle("is-dragging",N),o.classList.toggle("can-drag",S),o.classList.toggle("will-zoom-in",X),o.classList.toggle("will-zoom-out",U);const J=Ce(),de=Le(),we=c!==3;for(const ke of(e==null?void 0:e.querySelectorAll("[data-panzoom-action]"))||[]){const he=ke.dataset.panzoomAction;let ge=!1;if(we)ge=!0;else switch(he){case fe.ZoomIn:J||(ge=!0);break;case fe.ZoomOut:de||(ge=!0);break;case fe.ToggleFull:J||de||(ge=!0);const L=ke.querySelector("g");L&&(L.style.display=H?"none":"");break;case fe.ToggleCover:case fe.ToggleMax:J||de||(ge=!0)}ge?(ke.setAttribute("aria-disabled",""),ke.setAttribute("tabindex","-1")):(ke.removeAttribute("aria-disabled"),ke.removeAttribute("tabindex"))}}function M(S,N){var I;if(!e||!r||!l||S===fe.Swipe&&Math.abs(l.getCurrentVelocities().scale)>.01)return;let H=Object.assign({},d),X=ee(w()?d.scale:p.scale);const U=l.getCurrentVelocities(),J=_(),de=(((I=(N=N||{}).currentTouch)===null||I===void 0?void 0:I.length)||0)>1,we=N.velocityX||0,ke=N.velocityY||0;let he=N.center;!he&&N.srcEvent&&(he=wt(y1(N.srcEvent)));let ge=N.deltaX||0,L=N.deltaY||0;switch(S){case fe.MoveRight:ge=N.deltaX||100;break;case fe.MoveLeft:ge=N.deltaX||-100;break;case fe.MoveUp:L=N.deltaY||-100;break;case fe.MoveDown:L=N.deltaY||100}let K=[];switch(S){case fe.Reset:d=Object.assign({},nt),d.scale=T();break;case fe.Pan:case fe.Move:case fe.MoveLeft:case fe.MoveRight:case fe.MoveUp:case fe.MoveDown:if(s!=null&&s.isPointerDown()){let Ee=1,ye=1;d.x<=X.x[0]&&we<=0&&(Ee=Math.max(.01,1-Math.abs(1/J.width*Math.abs(d.x-X.x[0]))),Ee*=.2),d.x>=X.x[1]&&we>=0&&(Ee=Math.max(.01,1-Math.abs(1/J.width*Math.abs(d.x-X.x[1]))),Ee*=.2),d.y<=X.y[0]&&ke<=0&&(ye=Math.max(.01,1-Math.abs(1/J.height*Math.abs(d.y-X.y[0]))),ye*=.2),d.y>=X.y[1]&&ke>=0&&(ye=Math.max(.01,1-Math.abs(1/J.height*Math.abs(d.y-X.y[1]))),ye*=.2),d.x+=ge*Ee,d.y+=L*ye}else d.x=De(X.x[0],d.x+ge,X.x[1]),d.y=De(X.y[0],d.y+L,X.y[1]);break;case fe.Swipe:const ae=(Ee=0)=>Math.sign(Ee)*Math.pow(Math.abs(Ee),1.5);d.x+=De(-1e3,ae(we),1e3),d.y+=De(-1e3,ae(ke),1e3),ke&&!we&&(d.x=De(X.x[0],d.x,X.x[1])),!ke&&we&&(d.y=De(X.y[0],d.y,X.y[1])),U.x=we,U.y=ke;break;case fe.ZoomTo:d.scale=N.scale||1;break;case fe.ZoomIn:d.scale=d.scale*(N.scale||2),de||(d.scale=Math.min(d.scale,ie()));break;case fe.ZoomOut:d.scale=d.scale*(N.scale||.5),de||(d.scale=Math.max(d.scale,P()));break;case fe.ToggleCover:K=[T(),A()];break;case fe.ToggleFull:K=[T(),z()];break;case fe.ToggleMax:K=[T(),ie()];break;case fe.IterateZoom:K=[T(),z(),ie()];break;case fe.Zoom:const ce=z();d.scale>=ce-.05?d.scale=T():d.scale=Math.min(ce,d.scale*(N.scale||2));break;case fe.RotateCW:d.angle+=90;break;case fe.RotateCCW:d.angle-=90;break;case fe.FlipX:d.flipX*=-1;break;case fe.FlipY:d.flipY*=-1}if(p.angle!==void 0&&Math.abs(p.angle)>=360&&(d.angle-=360*Math.floor(p.angle/360),p.angle-=360*Math.floor(p.angle/360)),K.length){const ae=K.findIndex(ce=>ce>d.scale+1e-4);d.scale=K[ae]||K[0]}if(de&&(d.scale=De(P()*(de?.8:1),d.scale,ie()*(de?1.6:1))),w()){const ae=R(d.scale);if(ae){const{x:ce,y:Ee}=ae;d.x=ce,d.y=Ee}}else if(d.scale!==H.scale){let ae=0,ce=0;if(he)ae=he.x,ce=he.y;else{const q=e.getBoundingClientRect();ae=q.x+.5*q.width,ce=q.y+.5*q.height}let Ee=ae-J.left,ye=ce-J.top;Ee-=.5*J.width,ye-=.5*J.height;const B=(Ee-H.x)/H.scale,F=(ye-H.y)/H.scale;d.x=Ee-B*d.scale,d.y=ye-F*d.scale,!de&&y("bounds")&&(X=ee(d.scale),d.x=De(X.x[0],d.x,X.x[1]),d.y=De(X.y[0],d.y,X.y[1]))}if(S===fe.Swipe){let ae=94,ce=17,Ee=500*d.scale,ye=U;l.spring({tension:ae,friction:ce,maxSpeed:Ee,restDelta:.1,restSpeed:.1,velocity:ye})}else S===fe.Pan||de?l.spring({tension:750,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):l.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:U});S===fe.Reset&&N.velocity===0?p=Object.assign({},d):l.from(p).to(d).start(),x("action",S)}function j(){if(!o||!r)return;if(r instanceof HTMLImageElement){const{width:de,height:we}=E();o.style.maxWidth=`min(${de}px, 100%)`,o.style.maxHeight=`min(${we}px, 100%)`}let{x:S,y:N,scale:I,angle:H,flipX:X,flipY:U}=p;const J=function(){const de=_(),we=de.width,ke=de.height,{width:he,height:ge}=E();if(!e)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:we,fitHeight:ke,fullWidth:he,fullHeight:ge};let{x:L,y:K,scale:ae,angle:ce,flipX:Ee,flipY:ye}=p,B=1/z(),F=he,q=ge,Y=p.scale*B,me=d.scale*B;const te=Math.max(we,ke),oe=Math.min(we,ke);he>ge?(F=te,q=oe):(F=oe,q=te),Y=he>ge?te*ae/he||1:te*ae/ge||1;let ue=F?he*me:0,$=q?ge*me:0;return L=L+.5*F-.5*ue,K=K+.5*q-.5*$,{x:L,y:K,width:ue,height:$,scale:F&&q?he*Y/ue:0,flipX:Ee,flipY:ye,angle:ce,fitWidth:we,fitHeight:ke,fullWidth:he,fullHeight:ge}}();if(o&&J){const{x:de,y:we,width:ke,height:he,scale:ge,flipX:L,flipY:K}=J;let ae=`translate(${Ze(de)}px, ${Ze(we)}px)`;ae+=L!==1||K!==1?` scaleX(${Ze(ge*L)}) scaleY(${Ze(ge*K)})`:` scale(${Ze(ge)})`,H!==0&&(ae+=` rotate(${H}deg)`),i&&(i.style.width=`${Ze(ke)}px`,i.style.height=`${Ze(he)}px`,i.style.transform=`${ae}`)}x("render")}function re(){let S=d.scale;const N=y("clickAction");let I=T();if(N){let H=[];switch(N){case fe.ZoomIn:I=2*S;break;case fe.ZoomOut:I=.5*S;break;case fe.ToggleCover:H=[T(),A()];break;case fe.ToggleFull:H=[T(),z()];break;case fe.ToggleMax:H=[T(),ie()];break;case fe.IterateZoom:H=[T(),z(),ie()];break;case fe.Zoom:const X=z();I=S>=X-.05?T():Math.min(X,2*S)}if(H.length){const X=H.findIndex(U=>U>S+1e-4);I=H[X]||T()}}return I=De(P(),I,ie()),I}function se(){return c===3&&re()>d.scale}function be(){return c===3&&re()<d.scale}function Ce(){return c===3&&d.scale<ie()}function Le(){return c===3&&d.scale>P()}function Oe(){return c===3&&G()&&!!s&&!w()}function Be(){return c===3&&(s==null?void 0:s.isPointerDown())&&!w()}function G(){return c===3&&d.scale>T()}function ne(){return c===3&&d.scale>=z()}const Q={canDrag:Oe,canZoomIn:Ce,canZoomOut:Le,destroy:function(){x("destroy");for(const S of Object.values(f))S==null||S.destroy(Q);for(const S of g)S();return o&&(o.style.aspectRatio="",o.style.maxWidth="",o.style.maxHeight=""),i&&(i.style.width="",i.style.height="",i.style.transform=""),o=void 0,r=void 0,i=void 0,p=Object.assign({},nt),d=Object.assign({},nt),l==null||l.destroy(),l=void 0,s==null||s.destroy(),s=void 0,c=4,Q},emit:x,execute:M,getBoundaries:ee,getContainer:function(){return e},getFullDim:E,getGestures:function(){return s},getMousemovePos:R,getOptions:function(){return h},getScale:D,getState:function(){return c},getTransform:function(S){return S===!0?d:p},getTween:function(){return l},getViewport:function(){return i},getWrapper:function(){return o},init:function(){return c=0,x("init"),function(){for(const[S,N]of Object.entries(Object.assign(Object.assign({},a),h.plugins||{})))if(S&&!f[S]&&N instanceof Function){const I=N();I.init(Q),f[S]=I}x("initPlugins")}(),function(){if(!e)return;const S=Object.assign(Object.assign({},Ea.classes),y("classes"));if(Te(e,S.container),r=e.querySelector("."+S.content),!!r&&(r.setAttribute("draggable","false"),o=e.querySelector("."+S.wrapper),o||(o=document.createElement("div"),Te(o,S.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),r instanceof HTMLImageElement||r instanceof HTMLPictureElement)){if(i=e.querySelector("."+S.viewport),!i){i=document.createElement("div"),Te(i,S.viewport);const N=r.cloneNode(!0);N.classList.remove("is-lazyloading"),N.classList.remove("is-lazyloaded"),i.insertAdjacentElement("afterbegin",N),o.insertAdjacentElement("beforeend",i)}if(r instanceof HTMLPictureElement&&(r=r.querySelector("img")),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),i.style.visibility="hidden",y("protected")){i.addEventListener("contextmenu",I=>{I.preventDefault()});const N=document.createElement("div");Te(N,"f-panzoom__protected"),i.appendChild(N)}x("initLayout")}}(),function(){if(!(r&&r instanceof HTMLImageElement))return;c=1,x("loading");const S=()=>{r&&r instanceof HTMLImageElement&&r.decode().then(()=>{requestAnimationFrame(()=>{O()})}).catch(()=>{O()})};if(r.src&&r.complete)return void S();(function(){const N=e==null?void 0:e.querySelector(".f-spinner");if(!e||N)return;const I=y("spinnerTpl"),H=kt(I);H&&(H.classList.add("f-spinner"),e.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",H))})(),r.addEventListener("load",S,!1),r.addEventListener("error",S,!1),g.push(()=>{r==null||r.removeEventListener("load",S,!1),r==null||r.removeEventListener("error",S,!1)})}(),function(){if(e&&o&&!u){let S=null;u=new ResizeObserver(()=>{S||(S=requestAnimationFrame(()=>{e&&e.parentElement&&c===3&&(V(),pe(),x("refresh")),S=null}))}),u.observe(o),g.push(()=>{u==null||u.disconnect(),u=void 0,S&&(cancelAnimationFrame(S),S=null)})}}(),Q},isDragging:Be,isExpanded:G,isFullsize:ne,localize:function(S,N=[]){const I=y("l10n")||{};S=String(S).replace(/\{\{(\w+)\}\}/g,(H,X)=>I[X]||H);for(let H=0;H<N.length;H++)S=S.split(N[H][0]).join(N[H][1]);return S=S.replace(/\{\{(.*?)\}\}/g,(H,X)=>X)},off:function(S,N){for(const I of S instanceof Array?S:[S])k.has(I)&&k.set(I,k.get(I).filter(H=>H!==N));return Q},on:function(S,N){for(const I of S instanceof Array?S:[S])k.set(I,[...k.get(I)||[],N]);return Q},version:"6.0.16",willZoomIn:se,willZoomOut:be};return Q};va.l10n={en_EN:wa},va.getDefaults=()=>Ea;/*! License details at fancyapps.com/license */const Ca=(e,n)=>{let a=[];return e.childNodes.forEach(o=>{o.nodeType!==Node.ELEMENT_NODE||n&&!o.matches(n)||a.push(o)}),a};/*! License details at fancyapps.com/license */const at=(e,...n)=>{const a=n.length;for(let o=0;o<a;o++){const r=n[o]||{};Object.entries(r).forEach(([i,s])=>{const l=Array.isArray(s)?[]:{};e[i]||Object.assign(e,{[i]:l}),Ue(s)?Object.assign(e[i],at(l,s)):Array.isArray(s)?Object.assign(e,{[i]:[...s]}):Object.assign(e,{[i]:s})})}return e};/*! License details at fancyapps.com/license */const Sa=function(e=0,n=0,a=0,o=0,r=0,i=!1){const s=(e-n)/(a-n)*(r-o)+o;return i?o<r?De(o,s,r):De(r,s,o):s};/*! License details at fancyapps.com/license */const ft=(e,n="")=>{e&&e.classList&&n.split(" ").forEach(a=>{a&&e.classList.remove(a)})};/*! License details at fancyapps.com/license */const vt=(e,n="",a)=>{e&&e.classList&&n.split(" ").forEach(o=>{o&&e.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Ba=Object.assign(Object.assign({},wa),{ERROR:"Something went wrong. <br /> Please try again later.",NEXT:"Next page",PREV:"Previous page",GOTO:"Go to page #%d",DOWNLOAD:"Download",TOGGLE_FULLSCREEN:"Toggle full-screen mode",TOGGLE_EXPAND:"Toggle full-size mode",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_AUTOPLAY:"Toggle slideshow"});/*! License details at fancyapps.com/license */const It=e=>{e.cancelable&&e.preventDefault()},qt={adaptiveHeight:!1,center:!0,classes:{container:"f-carousel",isEnabled:"is-enabled",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",hasAdaptiveHeight:"has-adaptive-height",viewport:"f-carousel__viewport",slide:"f-carousel__slide",isSelected:"is-selected"},dragFree:!1,enabled:!0,errorTpl:'<div class="f-html">{{ERROR}}</div>',fill:!1,infinite:!0,initialPage:0,l10n:Ba,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:200,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1};let E1,v1=0;const Ln=(e,n={},a={})=>{v1++;let o,r,i,s,l,u=0,m=Object.assign({},qt),c=Object.assign({},qt),h={},f=null,p=null,d=!1,g=!1,y=!1,k=!1,x="height",b=0,v=!0,C=0,O=0,_=0,E=0,w="*",R=[],D=[];const P=new Set;let T=[],A=[],z=0,ie=0;function ee(B,...F){let q=c[B];return q&&q instanceof Function?q(ye,...F):q}function pe(B,F=[]){const q=ee("l10n")||{};B=String(B).replace(/\{\{(\w+)\}\}/g,(Y,me)=>q[me]||Y);for(let Y=0;Y<F.length;Y++)B=B.split(F[Y][0]).join(F[Y][1]);return B=B.replace(/\{\{(.*?)\}\}/g,(Y,me)=>me)}const V=new Map;function M(B,...F){const q=V.get(B)||[];c.on&&q.push(c.on[B]);for(const Y of q)Y&&Y instanceof Function&&Y(ye,...F);B!=="*"&&M("*",B,...F)}function j(){var B,F;const q=at({},qt,m);at(q,qt,m);let Y="";const me=m.breakpoints||{};if(me)for(const[te,oe]of Object.entries(me))window.matchMedia(te).matches&&(Y+=te,at(q,oe));if(l===void 0||Y!==l){if(l=Y,u!==0){let te=(F=(B=A[C])===null||B===void 0?void 0:B.slides[0])===null||F===void 0?void 0:F.index;te===void 0&&(te=c.initialSlide),q.initialSlide=te,q.slides=[];for(const oe of R)oe.isVirtual&&q.slides.push(oe)}Ee(),c=q,c.enabled!==!1&&(u=0,M("init"),function(){for(const[te,oe]of Object.entries(Object.assign(Object.assign({},a),c.plugins||{})))if(te&&!h[te]&&oe instanceof Function){const ue=oe();ue.init(ye,Ln),h[te]=ue}M("initPlugins")}(),function(){if(!f)return;const te=ee("classes")||{};Te(f,te.container),Te(f,te.isEnabled);const oe=ee("style");if(oe&&Ue(oe))for(const[ue,$]of Object.entries(oe))f.style.setProperty(ue,$);p=f.querySelector(`.${te.viewport}`),p||(p=document.createElement("div"),Te(p,te.viewport),p.append(...Ca(f,`.${te.slide}`)),f.insertAdjacentElement("afterbegin",p)),d=window.getComputedStyle(p).getPropertyValue("overflow")==="visible",f.carousel=ye,M("initLayout")}(),function(){if(!p)return;const te=ee("classes")||{};R=[],[...Ca(p,`.${te.slide}`)].forEach(oe=>{oe.parentElement&&(R.push(N(Object.assign({el:oe,isVirtual:!1},oe.dataset||{}))),oe.parentElement.removeChild(oe))}),S(ee("slides"));for(const oe of R)M("addSlide",oe);M("initSlides")}(),r=bt().on("start",()=>{v=!1,o&&o.isPointerDown()||(be(),ce())}).on("step",te=>{b=te.pos,ce()}).on("end",te=>{o!=null&&o.isPointerDown()||(b=te.pos,r&&!g&&(b<_||b>E)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:De(_,b,E)}).start():v||(v=!0,M("settle")))}),function(){const te=ee("gestures");p&&te!==!1&&(o=tn(p,te).on("start",oe=>{var ue,$;if(!r)return;const{srcEvent:Z}=oe;function le(ve){const Me=window.getComputedStyle(ve),Ne=new DOMMatrixReadOnly(Me.transform);return{width:Ne.m41||0,height:Ne.m42||0}}k&&It(Z),r.pause(),r.getCurrentVelocities().pos=0;const xe=(ue=A[C])===null||ue===void 0?void 0:ue.slides[0];xe&&P.has(xe.index)&&xe.el&&(b=xe.offset||0,b+=(le(xe.el)[x]||0)*(y&&!k?1:-1)),we(),g||(b<_||b>E)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:(($=r.getCurrentVelocities())===null||$===void 0?void 0:$.pos)||0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:De(_,b,E)}).start()}).on("move",oe=>{const{srcEvent:ue,axis:$}=oe,Z=oe.srcEvent.target;Z&&Jt(Z)||($||(ue.stopPropagation(),ue.stopImmediatePropagation()),($==="y"&&k||$==="x"&&!k)&&(It(ue),ue.stopPropagation()))}).on("panstart",oe=>{(oe==null?void 0:oe.axis)===(k?"y":"x")&&Te(p,"is-dragging")}).on("panend",()=>{ft(p,"is-dragging")}).on("pan",oe=>{var ue;const{deltaX:$,deltaY:Z,currentTouch:le,axis:xe}=oe;if(!r||le.length>1||xe==="y"&&!k||xe==="x"&&k)return;const ve=y&&!k?1:-1;let Me=k?Z:$,Ne=r!=null&&r.isRunning()?r.getEndValues().pos:b,Ve=1;g||(Ne<=_&&Me*ve<0?(Ve=Math.max(.01,1-Math.abs(1/G()*Math.abs(Ne-_))),Ve*=.2):Ne>=E&&Me*ve>0&&(Ve=Math.max(.01,1-Math.abs(1/G()*Math.abs(Ne-E))),Ve*=.2)),Ne+=Me*Ve*ve,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:((ue=r.getCurrentVelocities())===null||ue===void 0?void 0:ue.pos)||0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Ne}).start()}).on("end",oe=>{var ue,$;const{axis:Z,velocityX:le,velocityY:xe,currentTouch:ve}=oe,Me=A.length,Ne=ee("dragFree");if(ve.length>0||!r||!Me)return;const Ve=ee("vertical")?xe:le;let Re=r!=null&&r.isRunning()?r.getEndValues().pos:b;const et=y&&!k?1:-1;if(Re+=Ve*(Ne?5:1)*et,!g&&(Ve*et<=0&&Re<_||Ve*et>=0&&Re>E)){let Ge=0;return Math.abs(Ve)>0&&(Ge=2*Math.abs(Ve),Ge=Math.min(.3*G(),Ge)),Re=De(_+-1*Ge,Re,E+Ge),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*Ve,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Re}).start()}if(Ne||!((ue=h.Autoscroll)===null||ue===void 0)&&ue.isEnabled())return void(Math.abs(Ve)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*Ve,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Re}).start():r.isRunning()||v||(v=!0,M("settle")));if(!Ne&&!(!(($=h.Autoscroll)===null||$===void 0)&&$.isEnabled())&&(!oe.offsetX&&!oe.offsetY||Z==="y"&&!k||Z==="x"&&k))return void ae(C,{transition:"tween"});let ot=Oe(Re);Math.abs(Ve)>10&&ot===C&&(ot+=Ve>0?y&&!k?1:-1:y&&!k?-1:1),ae(ot,{transition:"tween",tween:{tension:160,friction:25,velocity:-1*Ve}})}).init())}(),J(),function(){if(f&&(f.addEventListener("click",he,{passive:!1}),document.addEventListener("mousemove",re),!i)){let te=null;i=new ResizeObserver(oe=>{te||(te=requestAnimationFrame(()=>{(function(ue){if(!f)return;let $=ue[0].contentBoxSize[0].blockSize,Z=ue[0].contentBoxSize[0].inlineSize;if(u===0)return z=$,ie=Z,u=1,ce(),Ce(),void M("ready");if(u!==1)return;const le=A.length;J();const xe=f.getBoundingClientRect();$=xe.height,Z=xe.width,le>1&&(k&&Math.abs($-z)<.5||!k&&Math.abs(Z-ie)<.5)||(z=$,ie=Z,k&&!$||!k&&!Z||f&&p&&(le===A.length&&(o!=null&&o.isPointerDown())||(ee("dragFree")&&(g||b>_&&b<E)?(be(),ce()):ae(C,{transition:!1}))))})(oe),te=null}))}),i.observe(f)}}())}}function re(B){E1=B}function se(B="*"){var F;const q=[];for(const Y of R)(B==="*"||Y.class&&Y.class.includes(B)||Y.el&&(!((F=Y.el)===null||F===void 0)&&F.classList.contains(B)))&&q.push(Y);s=void 0,w=B,D=[...q]}function be(){if(!r)return;const B=Oe(r!=null&&r.isRunning()?r.getEndValues().pos:b);B!==C&&(s=C,C=B,K(),Ce(),Le(),M("change",C,s))}function Ce(){var B;if(!f)return;vt(p,"is-draggable",!!o&&A.length>0);for(const Y of f.querySelectorAll("[data-carousel-index]"))Y.innerHTML=C+"";for(const Y of f.querySelectorAll("[data-carousel-page]"))Y.innerHTML=C+1+"";for(const Y of f.querySelectorAll("[data-carousel-pages]"))Y.innerHTML=A.length+"";let F=!1;const q=(B=A[C])===null||B===void 0?void 0:B.slides[0];q&&(q.downloadSrc||q.type==="image"&&q.src)&&(F=!0);for(const Y of f.querySelectorAll("[data-carousel-download]"))Y.toggleAttribute("aria-disabled",!F)}function Le(B){var F;if(!f)return;B||(B=(F=A[C])===null||F===void 0?void 0:F.slides[0]);const q=B.el;if(q)for(const Y of q.querySelectorAll("[data-slide-index]"))Y.innerHTML=B.index+1+""}function Oe(B){if(!A.length||!r)return 0;const F=ne();let q=B;g?q-=Math.floor((B-A[0].pos)/F)*F:q=De(A[0].pos,B,A[A.length-1].pos);const Y=new Map;let me=0;for(const oe of A){const ue=Math.abs(oe.pos-q),$=Math.abs(oe.pos-q-F),Z=Math.abs(oe.pos-q+F),le=Math.min(ue,$,Z);Y.set(me,le),me++}const te=Y.size>0?[...Y.entries()].reduce((oe,ue)=>ue[1]<oe[1]?ue:oe):[C,0];return parseInt(te[0])}function Be(){return p&&parseFloat(getComputedStyle(p).getPropertyValue("--f-carousel-gap"))||0}function G(){return p&&p.getBoundingClientRect()[x]||0}function ne(B=!0){const F=Be();return D.reduce((q,Y)=>q+Y.dim,0)+(D.length-(g&&B?0:1))*F}function Q(B){const F=Be(),q=ne();let Y=G();if(!p)return[];const me=[];if(!q||!Y)return[];B=B===void 0?b:B,g&&(B-=Math.floor(B/q)*q);let te=0,oe=0;if(d){const $=p.getBoundingClientRect();te=$.left,oe=$.right-$.width}let ue=0;for(let $ of D){const Z=(le=0)=>{me.indexOf($)>-1||($.pos=ue-B+le||0,$.offset+le>B-$.dim-te+.51&&$.offset+le<B+Y+oe-.51&&me.push($))};if($.offset=ue,g)for(let le=-1;le<=1;le++)Z(q*le);else Z();ue+=$.dim+F}return me}function S(B,F){const q=[];for(const Y of Array.isArray(B)?B:[B]){const me=N(Object.assign(Object.assign({},Y),{isVirtual:!0}));q.push(me)}R.splice(F===void 0?R.length:F,0,...q),U();for(const Y of q)I(Y);return se(w),q}function N(B){return(je(B)||B instanceof HTMLElement)&&(B={html:B}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},B)}function I(B){if(!B)return;let F=B.el;F||(F=document.createElement("div"),B.el=F);const q=B.html?B.html instanceof HTMLElement?B.html:kt(B.html):void 0;q&&(Te(q,"f-html"),B.htmlEl=q,Te(F,"has-html"),F.append(q),M("contentReady",B))}function H(B){if(!p||!B)return;let F=B.el;if(F){if(F.setAttribute("index",B.index+""),F.parentElement!==p){let q;Te(F,c.classes.slide),Te(F,B.class),K(B);for(const Y of R)if(Y.index>B.index){q=Y.el;break}p.insertBefore(F,q&&p.contains(q)?q:null),M("attachSlideEl",B)}return F}}function X(B){const F=B==null?void 0:B.el;F&&(F.remove(),de(F),M("detachSlideEl",B))}function U(){for(let B=0;B<R.length;B++){const F=R[B],q=F.el;q&&(F.index!==B&&de(q),q.setAttribute("index",`${B}`)),F.index=B}}function J(){var B,F,q,Y;if(!f||!p)return;y=ee("rtl"),k=ee("vertical"),x=k?"height":"width";const me=ee("classes");vt(f,me.isLTR,!y),vt(f,me.isRTL,y),vt(f,me.isHorizontal,!k),vt(f,me.isVertical,k),vt(f,me.hasAdaptiveHeight,ee("adaptiveHeight"));const te=p.getBoundingClientRect();if(!te.width&&!te.height)return;const oe=function(){let $=0;if(p){let Z=document.createElement("div");Te(Z,c.classes.slide),p.appendChild(Z),$=Z.getBoundingClientRect()[x],Z.remove(),Z=void 0}return $}();for(const $ of D){const Z=$.el;let le=0;if(!$.isVirtual&&Z&&zt(Z)){let xe=!1;Z.parentElement&&Z.parentElement===p||(p.appendChild(Z),xe=!0),le=Z.getBoundingClientRect()[x],xe&&((B=Z.parentElement)===null||B===void 0||B.removeChild(Z))}else le=oe;$.dim=le}(function(){if(!f)return;U();const $=G(),Z=Be(),le=ne(!1);let xe=ee("slidesPerPage");xe=xe==="auto"?1/0:parseFloat(xe+""),A=[];let ve=0,Me=0;for(const $e of D)(!A.length||ve+$e.dim-$>.05||Me>=xe)&&(A.push({index:A.length,slides:[],dim:0,offset:0,pos:0}),ve=0,Me=0),A[A.length-1].slides.push($e),ve+=$e.dim+Z,Me++;const Ne=ee("center"),Ve=ee("fill"),Re=ee("infinite");let et=0;for(const $e of A){$e.dim=($e.slides.length-1)*Z;for(const Bt of $e.slides)$e.dim+=Bt.dim;$e.offset=et,$e.pos=et,Ne!==!1&&($e.pos-=.5*($-$e.dim)),Ve&&!Re&&le>$&&($e.pos=De(0,$e.pos,le-$)),et+=$e.dim+Z}const ot=[];let Ge;for(const $e of A){const Bt=Object.assign({},$e);Ge&&Bt.pos===Ge.pos?(Ge.dim+=Bt.dim,Ge.slides=[...Ge.slides,...Bt.slides]):(Ge=Bt,Bt.index=ot.length,ot.push(Bt))}A=ot,Ce()})();let ue=G();if(d){const $=p.getBoundingClientRect();ue+=$.left,ue+=$.right-$.width}if(g=ee("infinite")&&A.length>1&&ne()-(ue+(((F=D[0])===null||F===void 0?void 0:F.dim)||0))>-.5,_=((q=A[0])===null||q===void 0?void 0:q.pos)||0,E=((Y=A[A.length-1])===null||Y===void 0?void 0:Y.pos)||0,u===0)(function(){var $;s=void 0,C=ee("initialPage");const Z=ee("initialSlide")||void 0;Z!==void 0&&(C=ye.getPageIndex(Z)||0),C=De(0,C,A.length-1),b=(($=A[C])===null||$===void 0?void 0:$.pos)||0,O=b})();else{const $=r!=null&&r.isRunning()?r.getEndValues().pos:b;($<_||$>E)&&(C=De(0,C,A.length-1),O=A[C||0].pos||0)}M("refresh")}function de(B){if(!B||!zt(B))return;const F=parseInt(B.getAttribute("index")||"-1");let q="";for(const me of Array.from(B.classList)){const te=me.match(/^f-(\w+)(Out|In)$/);te&&te[1]&&(q=te[1]+"")}if(!B||!q)return;const Y=[`f-${q}Out`,`f-${q}In`,"to-prev","to-next","from-prev","from-next"];B.removeEventListener("animationend",ke),ft(B,Y.join(" ")),P.delete(F)}function we(){if(!p)return;const B=P.size;for(const F of D)de(F.el);P.clear(),B&&ce()}function ke(B){B.animationName.substring(0,2)==="f-"&&(de(B.target),P.size||(ft(f,"in-transition"),!v&&Math.abs(ye.getPosition(!0)-O)<.5&&(v=!0,M("settle"))),ce())}function he(B){if(B.defaultPrevented)return;const F=B.composedPath()[0];if(F.closest("[data-carousel-go-prev]"))return It(B),void ye.prev();if(F.closest("[data-carousel-go-next]"))return It(B),void ye.next();const q=F.closest("[data-carousel-go-to]");if(q)return It(B),void ye.goTo(parseFloat(q.dataset.carouselGoTo||"")||0);if(F.closest("[data-carousel-download]")){It(B);const Y=A[C].slides[0];if(Y.downloadSrc||Y.type==="image"&&Y.src){const me=Y.downloadFilename,te=document.createElement("a"),oe=Y.downloadSrc||Y.src||"";te.href=oe,te.target="_blank",te.download=me||oe,te.click()}}else M("click",B)}function ge(B){var F;const q=B.el;q&&((F=q.querySelector(".f-spinner"))===null||F===void 0||F.remove(),ft(q,"is-loading"))}function L(B){var F;const q=B.el;q&&((F=q.querySelector(".f-html.is-error"))===null||F===void 0||F.remove(),ft(q,"has-error"))}function K(B){var F;B||(B=(F=A[C])===null||F===void 0?void 0:F.slides[0]);const q=B==null?void 0:B.el;if(!q)return;let Y=ee("formatCaption",B);Y===void 0&&(Y=B.caption),Y=Y||"";const me=ee("captionEl");if(me&&me instanceof HTMLElement){if(B.index!==C)return;if(je(Y)&&(me.innerHTML=pe(Y+"")),Y instanceof HTMLElement){if(Y.parentElement===me)return;me.innerHTML="",Y.parentElement&&(Y=Y.cloneNode(!0)),me.append(Y)}return}if(!Y)return;let te=B.captionEl||q.querySelector(".f-caption");!te&&Y instanceof HTMLElement&&Y.classList.contains("f-caption")&&(te=Y),te||(te=document.createElement("div"),Te(te,"f-caption"),je(Y)?te.innerHTML=pe(Y+""):Y instanceof HTMLElement&&(Y.parentElement&&(Y=Y.cloneNode(!0)),te.append(Y)));const oe=`f-caption-${v1}_${B.index}`;te.setAttribute("id",oe),te.dataset.selectable="true",Te(q,"has-caption"),q.setAttribute("aria-labelledby",oe),B.captionEl=te,q.insertAdjacentElement("beforeend",te)}function ae(B,F){let{transition:q,tween:Y}=Object.assign({transition:c.transition,tween:c.tween},F||{});if(!f||!r)return;const me=A.length;if(!me||function(oe,ue){var $,Z,le,xe;if(!(f&&r&&ue&&je(ue)&&ue!=="tween")||(($=A[C])===null||$===void 0?void 0:$.slides.length)>1)return!1;const ve=A.length;let Me=oe>C?1:-1;oe=g?(oe%ve+ve)%ve:De(0,oe,ve-1),y&&(Me*=-1);const Ne=(Z=A[C])===null||Z===void 0?void 0:Z.slides[0],Ve=Ne==null?void 0:Ne.index,Re=(le=A[oe])===null||le===void 0?void 0:le.slides[0],et=Re==null?void 0:Re.index,ot=(xe=A[oe])===null||xe===void 0?void 0:xe.pos;if(et===void 0||Ve===void 0||Ve===et||b===ot||Math.abs(G()-((Re==null?void 0:Re.dim)||0))>1)return!1;v=!1,r.pause(),we(),Te(f,"in-transition"),b=O=ot;const Ge=H(Ne),$e=H(Re);return be(),Ge&&(P.add(Ve),Ge.style.transform="",Ge.addEventListener("animationend",ke),ft(Ge,c.classes.isSelected),Te(Ge,`f-${ue}Out to-${Me>0?"next":"prev"}`)),$e&&(P.add(et),$e.style.transform="",$e.addEventListener("animationend",ke),Te($e,c.classes.isSelected),Te($e,`f-${ue}In from-${Me>0?"prev":"next"}`)),ce(),!0}(B,q))return;B=g?(B%me+me)%me:De(0,B,me-1),O=A[B||0].pos||0;const te=r.isRunning()?r.getEndValues().pos:b;if(Math.abs(O-te)<1)return b=O,C!==B&&(K(),Ce(),Le(),s=C,C=B,M("change",C,s)),ce(),void(v||(v=!0,M("settle")));if(r.pause(),we(),g){const oe=ne(),ue=Math.floor((te-A[0].pos)/oe),$=O+ue*oe;O=[$+oe,$,$-oe].reduce(function(Z,le){return Math.abs(le-te)<Math.abs(Z-te)?le:Z})}q!==!1&&Ue(Y)?r.spring(Y).from({pos:b}).to({pos:O}).start():(b=O,be(),ce(),v||(v=!0,M("settle")))}function ce(){var B;if(!f||!p)return;const F=A[C];T=Q();const q=new Set;let Y;const me=[];for(const te of D){if(te.isVirtual&&!P.has(te.index)&&T.indexOf(te)<0)continue;let oe=H(te);if(!oe)continue;me.push(te);const ue=((B=F==null?void 0:F.slides)===null||B===void 0?void 0:B.indexOf(te))>-1;if(ue&&q.add(oe),!P.has(te.index)){const $=te.pos?Math.round(1e4*te.pos)/1e4:0,Z=k?0:y?-1*$:$,le=k?$:0,xe=Sa(Z,0,te.dim,0,100),ve=Sa(le,0,te.dim,0,100),Me=c.setTransform||void 0;Me instanceof Function?Me(ye,te,{x:Z,y:le,xPercent:xe,yPercent:ve}):oe.style.transform=Z||le?`translate3d(${xe}%, ${ve}%,0)`:""}if(ee("adaptiveHeight")&&ue){const $=(oe.firstElementChild||oe).getBoundingClientRect().height;Y=Y==null?$:Math.max(Y,$)}}[...Ca(p,`.${c.classes.slide}`)].forEach(te=>{const oe=parseInt(te.getAttribute("index")||"-1"),ue=R[oe];ue||te.remove(),vt(te,c.classes.isSelected,q.has(te)),ue.isVirtual&&!P.has(ue.index)&&T.indexOf(ue)<0&&X(ue)}),p&&Y&&(p.style.height=`${Y}px`),M("render",me)}function Ee(){var B;f==null||f.removeEventListener("click",he),we(),document.removeEventListener("mousemove",re),i==null||i.disconnect(),i=void 0;for(const F of R)F.el&&zt(F.el)&&(F.state=void 0,ge(F),L(F),X(F),F.isVirtual?((B=F.el)===null||B===void 0||B.remove(),F.el=void 0):(F.el.style.transform="",p==null||p.appendChild(F.el)));for(const F of Object.values(h))F==null||F.destroy();h={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const F of Object.values(c.classes||{}))ft(f,F);ft(p,"is-draggable")}const ye={add:function(B,F){const q=b,Y=O,me=S(B,F);for(const te of me)M("addSlide",te);return se(w),J(),r&&Y!==O&&r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:q}).to({pos:O}).start(),ce(),ye},canGoPrev:function(){return g||C>0},canGoNext:function(){return g||C<A.length-1},destroy:function(){return M("destroy"),window.removeEventListener("resize",j),Ee(),V.clear(),f=null,A=[],R=[],c=Object.assign({},qt),h={},D=[],l="",w="*",u=2,ye},emit:M,filter:function(B="*"){return se(B),J(),ce(),M("filter",B),ye},getContainer:function(){return f},getGapDim:Be,getGestures:function(){return o},getLastMouseMove:function(){return E1},getOptions:function(){return c},getPage:function(){return A[C]},getPageIndex:function(B){if(B!==void 0){for(const F of A||[])for(const q of F.slides)if(q.index===B)return F.index;return-1}return C},getPageProgress:function(B,F){B===void 0&&(B=C);const q=A[B];if(!q)return B>C?-1:1;const Y=ne(),me=Be();let te=q.pos,oe=ye.getPosition();if(g&&F!==!0){const ue=Math.floor((oe-A[0].pos)/Y);oe-=ue*Y,te=[te+Y,te,te-Y].reduce(function($,Z){return Math.abs(Z-oe)<Math.abs($-oe)?Z:$})}return(oe-te)/(q.dim+me)},getPageVisibility:function(B){B===void 0&&(B=C);const F=A[B];if(!F)return B>C?-1:1;const q=ye.getPosition(),Y=G();let me=F.pos;if(g){const te=ye.getPosition(),oe=ne(),ue=me+Math.floor((te-A[0].pos)/oe)*oe;me=[ue+oe,ue,ue-oe].reduce(function($,Z){return Math.abs(Z-te)<Math.abs($-te)?Z:$})}return me>q&&me+F.dim<q+Y?1:me<q?(me+F.dim-q)/F.dim:me+F.dim>q+Y?(q+Y-me)/F.dim:0},getPages:function(){return A},getPlugins:function(){return h},getPosition:function(B){var F;let q=b;if(g&&B!==!0){const Y=ne();q-=Math.floor((b-((F=A[0])===null||F===void 0?void 0:F.pos)||0)/Y)*Y}return q},getSlides:function(){return R},getState:function(){return u},getTotalSlideDim:ne,getTween:function(){return r},getViewport:function(){return p},getViewportDim:G,getVisibleSlides:function(B){return B===void 0?T:Q(B)},goTo:ae,hasNavigated:function(){return s!==void 0},hideError:L,hideLoading:ge,init:function(){if(!e||!zt(e))throw new Error("No Element found");return u!==0&&(Ee(),u=0),f=e,m=n,window.removeEventListener("resize",j),m.breakpoints&&window.addEventListener("resize",j),j(),ye},isInfinite:function(){return g},isInTransition:function(){return P.size>0},isRTL:function(){return y},isSettled:function(){return v},localize:function(B,F=[]){return pe(B,F)},next:function(B={}){return ae(C+1,B),ye},off:function(B,F){for(const q of B instanceof Array?B:[B])V.has(q)&&V.set(q,V.get(q).filter(Y=>Y!==F));return ye},on:function(B,F){for(const q of B instanceof Array?B:[B])V.set(q,[...V.get(q)||[],F]);return ye},prev:function(B={}){return ae(C-1,B),ye},remove:function(B){B===void 0&&(B=R.length-1);const F=R[B];return F&&(M("removeSlide",F),F.el&&(de(F.el),F.el.remove(),F.el=void 0),R.splice(B,1),se(w),J(),ce()),ye},setPosition:function(B){b=B,be(),ce()},showError:function(B,F){ge(B),L(B);const q=B.el;if(q){const Y=document.createElement("div");Te(Y,"f-html"),Te(Y,"is-error"),Y.innerHTML=pe(F||"<p>{{ERROR}}</p>"),B.htmlEl=Y,Te(q,"has-html"),Te(q,"has-error"),q.insertAdjacentElement("afterbegin",Y),M("contentReady",B)}return ye},showLoading:function(B){const F=B.el,q=F==null?void 0:F.querySelector(".f-spinner");if(!F||q)return ye;const Y=ee("spinnerTpl"),me=kt(Y);return me&&(Te(me,"f-spinner"),Te(F,"is-loading"),F.insertAdjacentElement("beforeend",me)),ye},version:"6.0.16"};return ye};Ln.l10n={en_EN:Ba},Ln.getDefaults=()=>qt;/*! License details at fancyapps.com/license */const C1=(e=!0,n="--f-scrollbar-compensate",a="--f-body-margin",o="hide-scrollbar")=>{const r=document,i=r.body,s=r.documentElement;if(e){if(i.classList.contains(o))return;let l=window.innerWidth-s.getBoundingClientRect().width;l<0&&(l=0),s.style.setProperty(n,`${l}px`);const u=parseFloat(window.getComputedStyle(i).marginRight);u&&i.style.setProperty(a,`${u}px`),i.classList.add(o)}else i.classList.remove(o),i.style.setProperty(a,""),r.documentElement.style.setProperty(n,"")};/*! License details at fancyapps.com/license */function S1(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const Ct=function(e="",n="",a=""){return e.split(n).join(a)};/*! License details at fancyapps.com/license */const B1={tpl:e=>`<img class="f-panzoom__content"
|
|
7
7
|
${e.srcset?'data-lazy-srcset="{{srcset}}"':""}
|
|
8
8
|
${e.sizes?'data-lazy-sizes="{{sizes}}"':""}
|
|
9
9
|
data-lazy-src="{{src}}" alt="{{alt}}" />`},td=()=>{let e;function n(c,h){const f=e==null?void 0:e.getOptions().Zoomable;let p=(Ue(f)?Object.assign(Object.assign({},B1),f):B1)[c];return p&&typeof p=="function"&&h?p(h):p}function a(){e&&(e.on("addSlide",i),e.on("removeSlide",s),e.on("attachSlideEl",l),e.on("click",r),e.on("change",o))}function o(){u()}function r(c,h){const f=h.target;f&&!h.defaultPrevented&&f.dataset.panzoomAction&&m(f.dataset.panzoomAction)}function i(c,h){if(!e)return;const f=h.el;if(!f)return;const p=h.src||h.lazySrc||"",d=h.alt||h.caption||`Image #${h.index}`,g=h.srcset||h.lazySrcset||"",y=h.sizes||h.lazySizes||"";if(p&&je(p)&&!h.html&&(!h.type||h.type==="image")){h.type="image";let v=n("tpl",h);v=Ct(v,"{{src}}",p+""),v=Ct(v,"{{alt}}",d+""),v=Ct(v,"{{srcset}}",g+""),v=Ct(v,"{{sizes}}",y+""),f.insertAdjacentHTML("afterbegin",v)}if(!f.querySelector(".f-panzoom__content"))return;const k=h.width&&h.width!=="auto"?parseFloat(h.width+""):"auto",x=h.height&&h.height!=="auto"?parseFloat(h.height+""):"auto",b=va(f,Object.assign({width:k,height:x,event:()=>e==null?void 0:e.getLastMouseMove(),classes:{container:"f-zoomable"}},n("Panzoom")));b.on("*",(v,C,...O)=>{e&&(C==="loading"&&(h.state=0),C==="loaded"&&(h.state=1),C==="error"&&(h.state=2,e==null||e.showError(h,"{{IMAGE_ERROR}}")),e.emit(`panzoom:${C}`,h,...O),C==="ready"&&e.emit("contentReady",h),h.index===e.getPageIndex()&&u())}),h.panzoomRef=b}function s(c,h){h.panzoomRef&&(h.panzoomRef.destroy(),h.panzoomRef=void 0)}function l(c,h){const f=h.panzoomRef;if(f)switch(f.getState()){case 0:f.init();break;case 3:f.execute(fe.Reset,{velocity:0})}}function u(){var c;const h=e==null?void 0:e.getContainer();if(!h)return;const f=(c=e==null?void 0:e.getPage())===null||c===void 0?void 0:c.slides[0].panzoomRef,p=(f==null?void 0:f.canZoomIn())||!1,d=(f==null?void 0:f.canZoomOut())||!1,g=(f==null?void 0:f.isFullsize())||!1,y=!f||(f==null?void 0:f.getState())!==3;for(const k of(h==null?void 0:h.querySelectorAll("[data-panzoom-action]"))||[]){const x=k.dataset.panzoomAction;let b=!1;if(y)b=!0;else switch(x){case fe.ZoomIn:p||(b=!0);break;case fe.ZoomOut:d||(b=!0);break;case fe.ToggleFull:p||d||(b=!0);const v=k.querySelector("g");v&&(v.style.display=g?"none":"");break;case fe.ToggleCover:case fe.ToggleMax:p||d||(b=!0)}b?(k.setAttribute("aria-disabled",""),k.setAttribute("tabindex","-1")):(k.removeAttribute("aria-disabled"),k.removeAttribute("tabindex"))}}function m(c,...h){var f;(f=e==null?void 0:e.getPage().slides[0].panzoomRef)===null||f===void 0||f.execute(c,...h)}return{init:function(c){e=c,e.getOptions().Zoomable!==!1&&e.on("initPlugins",a)},destroy:function(){if(e){e.off("addSlide",i),e.off("removeSlide",s),e.off("attachSlideEl",l),e.off("change",o);for(const c of e.getSlides())s(0,c)}e=void 0},execute:m}};/*! License details at fancyapps.com/license */const M1={syncOnChange:!1,syncOnClick:!0,syncOnHover:!1},V1=()=>{let e,n;function a(){const p=e==null?void 0:e.getOptions().Sync;return Ue(p)?Object.assign(Object.assign({},M1),p):M1}function o(p){var d,g,y;e&&p&&(n=p,e.getOptions().classes=Object.assign(Object.assign({},e.getOptions().classes),{isSelected:""}),e.getOptions().initialSlide=((g=(d=n.getPage())===null||d===void 0?void 0:d.slides[0])===null||g===void 0?void 0:g.index)||0,a().syncOnChange&&e.on("change",s),a().syncOnClick&&e.on("click",u),a().syncOnHover&&((y=e.getViewport())===null||y===void 0||y.addEventListener("mouseover",m)),function(){!e||!n||(e.on("ready",i),e.on("refresh",c),n.on("change",l),n.on("filter",h))}())}function r(){const p=a().target;e&&p&&o(p)}function i(){f()}function s(){var p;if(e&&n){const d=((p=e.getPage())===null||p===void 0?void 0:p.slides)||[],g=n.getPageIndex(d[0].index||0);g>-1&&n.goTo(g,e.hasNavigated()?void 0:{tween:!1,transition:!1}),f()}}function l(){var p;if(e&&n){const d=e.getPageIndex(((p=n.getPage())===null||p===void 0?void 0:p.slides[0].index)||0);d>-1&&e.goTo(d,n.hasNavigated()?void 0:{tween:!1,transition:!1}),f()}}function u(p,d){var g;if(!e||!n||!((g=e.getTween())===null||g===void 0)&&g.isRunning())return;const y=e==null?void 0:e.getOptions().classes.slide;if(!y)return;const k=y?d.target.closest(`.${y}`):null;if(k){const x=parseInt(k.getAttribute("index")||"")||0,b=n.getPageIndex(x);n.goTo(b)}}function m(p){e&&u(0,p)}function c(){var p;if(e&&n){const d=e.getPageIndex(((p=n.getPage())===null||p===void 0?void 0:p.slides[0].index)||0);d>-1&&e.goTo(d,{tween:!1,transition:!1}),f()}}function h(p,d){e&&n&&(e.filter(d),l())}function f(){var p,d,g;if(!n)return;const y=((d=(p=n.getPage())===null||p===void 0?void 0:p.slides[0])===null||d===void 0?void 0:d.index)||0;for(const k of(e==null?void 0:e.getSlides())||[])(g=k.el)===null||g===void 0||g.classList.toggle("is-selected",k.index===y)}return{init:function(p){e=p,e.on("initSlides",r)},destroy:function(){var p;e==null||e.off("ready",i),e==null||e.off("refresh",c),e==null||e.off("change",s),e==null||e.off("click",u),(p=e==null?void 0:e.getViewport())===null||p===void 0||p.removeEventListener("mouseover",m),n==null||n.off("change",l),n==null||n.off("filter",h),n=void 0,e==null||e.off("initSlides",r),e=void 0},getTarget:function(){return n}}};/*! License details at fancyapps.com/license */const A1={showLoading:!0,preload:1},On="is-lazyloading",N1="is-lazyloaded",D1=()=>{let e;function n(){const r=e==null?void 0:e.getOptions().Lazyload;return Ue(r)?Object.assign(Object.assign({},A1),r):A1}function a(r){const i=r.el;if(!i)return;const s="[data-lazy-src],[data-lazy-srcset],[data-lazy-bg]",l=Array.from(i.querySelectorAll(s));i.matches(s)&&l.push(i);for(const u of l){const m=u.dataset.lazySrc,c=u.dataset.lazySrcset,h=u.dataset.lazySizes,f=u.dataset.lazyBg,p=(u instanceof HTMLImageElement||u instanceof HTMLSourceElement)&&(m||c),d=u instanceof HTMLElement&&f;if(!p&&!d)continue;const g=m||c||f;g&&(p&&g?(n().showLoading&&(e==null||e.showLoading(r)),u.addEventListener("load",()=>{e==null||e.hideLoading(r),u instanceof HTMLImageElement?u.decode().then(()=>{u.classList.remove(On),u.classList.add(N1)}):(u.classList.remove(On),u.classList.add(N1)),e==null||e.emit("lazyLoad:loaded",r,u,g)}),u.addEventListener("error",()=>{e==null||e.hideLoading(r),u.classList.remove(On),u.classList.add("has-lazyerror"),e==null||e.emit("lazyLoad:error",r,u,g)}),u.classList.add("f-lazyload"),u.classList.add(On),e==null||e.emit("lazyLoad:load",r,u,g),m&&(u.src=m),c&&(u.srcset=c),h&&(u.sizes=h)):d&&(document.body.contains(u)||(document.createElement("img").src=f),u.style.backgroundImage=`url('${f}')`),delete u.dataset.lazySrc,delete u.dataset.lazySrcset,delete u.dataset.lazySizes)}}function o(){if(!e)return;const r=n().preload,i=[...e.getVisibleSlides()],s=e.getPosition(),l=e.getViewportDim();i.push(...e.getVisibleSlides(s+l*r),...e.getVisibleSlides(s-l*r));for(const u of i||[])a(u)}return{init:function(r){e=r,e.on("render",o)},destroy:function(){e==null||e.off("render",o),e=void 0}}};/*! License details at fancyapps.com/license */const T1={prevTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"></path></svg>',nextTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"></path></svg>'},nd=()=>{let e,n,a;function o(s){if(!e)return;const l=`<button data-carousel-go-${s} tabindex="0" class="f-button is-arrow is-${s}" title="{{${s.toUpperCase()}}}">`+function(){const u=e==null?void 0:e.getOptions().Arrows;return Ue(u)?Object.assign(Object.assign({},T1),u):T1}()[`${s}Tpl`]+"</button";return kt(e.localize(l))||void 0}function r(){var s;n==null||n.remove(),n=void 0,a==null||a.remove(),a=void 0,(s=e==null?void 0:e.getContainer())===null||s===void 0||s.classList.remove("has-arrows")}function i(){e&&e.getOptions().Arrows!==!1&&e.getPages().length>1?(function(){if(!e)return;const s=e.getViewport();s&&(n||(n=o("prev"),n&&s.insertAdjacentElement("beforebegin",n)),a||(a=o("next"),a&&s.insertAdjacentElement("afterend",a)),vt(e.getContainer(),"has-arrows",!(!n&&!a)))}(),e&&(n==null||n.toggleAttribute("aria-disabled",!e.canGoPrev()),a==null||a.toggleAttribute("aria-disabled",!e.canGoNext()))):r()}return{init:function(s){e=s.on(["change","refresh"],i)},destroy:function(){r(),e==null||e.off(["change","refresh"],i),e=void 0}}};/*! License details at fancyapps.com/license */const F1={moveLeft:{tpl:'<button data-panzoom-action="moveLeft" class="f-button" title="{{MOVE_LEFT}}"><svg><path d="M5 12h14M5 12l6 6M5 12l6-6"/></svg></button>'},moveRight:{tpl:'<button data-panzoom-action="moveRight" class="f-button" title="{{MOVE_RIGHT}}"><svg><path d="M5 12h14M13 18l6-6M13 6l6 6"/></svg></button>'},moveUp:{tpl:'<button data-panzoom-action="moveUp" class="f-button" title="{{MOVE_UP}}"><svg><path d="M12 5v14M18 11l-6-6M6 11l6-6"/></svg></button>'},moveDown:{tpl:'<button data-panzoom-action="moveDown" class="f-button" title="{{MOVE_DOWN}}"><svg><path d="M12 5v14M18 13l-6 6M6 13l6 6"/></svg></button>'},zoomIn:{tpl:'<button data-panzoom-action="zoomIn" class="f-button" title="{{ZOOM_IN}}"><svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M11 8v6M8 11h6"/></svg></button>'},zoomOut:{tpl:'<button data-panzoom-action="zoomOut" class="f-button" title="{{ZOOM_OUT}}"><svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg></button>'},toggle1to1:{tpl:'<button data-panzoom-action="toggleFull" class="f-button" title="{{TOGGLE_FULL}}"><svg><path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/></svg></button>'},toggleFull:{tpl:'<button data-panzoom-action="toggleFull" class="f-button" title="{{TOGGLE_FULL}}"><svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg></button>'},rotateCCW:{tpl:'<button data-panzoom-action="rotateCCW" class="f-button" title="{{ROTATE_CCW}}"><svg><path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/></svg></button>'},rotateCW:{tpl:'<button data-panzoom-action="rotateCW" class="f-button" title="{{ROTATE_CW}}"><svg><path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/></svg></button>'},flipX:{tpl:'<button data-panzoom-action="flipX" class="f-button" title="{{FLIP_X}}"><svg><path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/></svg></button>'},flipY:{tpl:'<button data-panzoom-action="flipY" class="f-button" title="{{FLIP_Y}}"><svg><path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/></svg></button>'},reset:{tpl:'<button data-panzoom-action="reset" class="f-button" title="{{RESET}}"><svg><path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg></button>'}};/*! License details at fancyapps.com/license */var L1;(function(e){e.Left="left",e.middle="middle",e.right="right"})(L1||(L1={}));const O1=Object.assign({counter:{tpl:'<div class="f-carousel__counter"><span data-carousel-page></span>/<span data-carousel-pages></span></div>'},download:{tpl:'<button data-carousel-download class="f-button" title="{{DOWNLOAD}}"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></button>'},autoplay:{tpl:'<button data-autoplay-action="toggle" class="f-button" title="{{TOGGLE_AUTOPLAY}}"><svg><g><path d="M5 3.5 19 12 5 20.5Z"/></g><g><path d="M8 4v15M17 4v15"/></g></svg></button>'},thumbs:{tpl:'<button data-thumbs-action="toggle" class="f-button" title="{{TOGGLE_THUMBS}}"><svg><rect width="18" height="14" x="3" y="3" rx="2"/><path d="M4 21h1M9 21h1M14 21h1M19 21h1"/></svg></button>'}},F1),P1={absolute:!1,display:{left:[],middle:["zoomIn","zoomOut","toggle1to1","rotateCCW","rotateCW","flipX","flipY","reset"],right:[]},enabled:"auto",items:{}},$1=()=>{let e,n;function a(){const r=e==null?void 0:e.getOptions().Toolbar;return Ue(r)?Object.assign(Object.assign({},P1),r):P1}function o(){var r,i,s;if(!(e!=null&&e.getOptions().Toolbar)||!e||n)return;let l=a().enabled;if(!l)return;let u=a().absolute;const m=e.getSlides().length>1;let c=!1,h=!1;for(const k of e.getSlides())k.panzoomRef&&(c=!0),(k.downloadSrc||k.type==="image"&&k.src)&&(h=!0);let f=((r=e.getPlugins().Thumbs)===null||r===void 0?void 0:r.isEnabled())||!1,p=m&&e.getPlugins().Autoplay||!1,d=e.getPlugins().Fullscreen&&(document.fullscreenEnabled||document.webkitFullscreenEnabled);if(l==="auto"&&(l=c),!l)return;n=document.createElement("div"),n.classList.add("f-carousel__toolbar");const g=a().display,y=at({},O1,a().items);for(const k of["left","middle","right"]){const x=g[k]||[],b=document.createElement("div");b.classList.add("f-carousel__toolbar__column"),b.classList.add(`is-${k}`);for(const v of x){let C;if(je(v)){if(v==="counter"&&!m||v==="autoplay"&&!p||F1[v]&&!c||v==="fullscreen"&&!d||v==="thumbs"&&!f||v==="download"&&!h)continue;C=y[v]}if(typeof v=="object"&&(C=v),C&&C.tpl){let O=e.localize(C.tpl);O=O.split("<svg>").join('<svg tabindex="-1" width="24" height="24" viewBox="0 0 24 24">');const _=kt(O);_&&(typeof C.click=="function"&&e&&_.addEventListener("click",E=>{E.preventDefault(),E.stopPropagation(),typeof C.click=="function"&&e&&C.click(e,E)}),b.append(_))}}n.append(b)}n.childElementCount&&(u===!0&&n.classList.add("is-absolute"),(i=e.getContainer())===null||i===void 0||i.classList.add("has-toolbar"),(s=e.getViewport())===null||s===void 0||s.insertAdjacentElement("beforebegin",n))}return{init:function(r){e=r,e.on("initSlides",o)},destroy:function(){var r;e==null||e.off("initSlides",o),(r=e==null?void 0:e.getContainer())===null||r===void 0||r.classList.remove("has-toolbar"),n==null||n.remove(),n=void 0},add:function(r,i){O1[r]=i},isEnabled:function(){return!!n}}};/*! License details at fancyapps.com/license */const _1={autoStart:!0,pauseOnHover:!0,showProgressbar:!0,timeout:2e3},ad=()=>{let e,n,a=!1,o=!1,r=!1,i=null;function s(O){const _=e==null?void 0:e.getOptions().Autoplay;let E=(Ue(_)?Object.assign(Object.assign({},_1),_):_1)[O];return E&&typeof E=="function"&&e?E(e):E}function l(){var O;const _=((O=e==null?void 0:e.getPage())===null||O===void 0?void 0:O.slides)||[];for(const E of _)if(E.state===0)return!0;return!1}function u(){clearTimeout(n),n=void 0}function m(){if(n||r||l()||!(e!=null&&e.isSettled()))return;(function(){var _,E,w,R;if(!e||(f(),!s("showProgressbar")))return;let D=s("progressbarParentEl");if(!D&&(!((_=e.getPlugins().Toolbar)===null||_===void 0)&&_.isEnabled())&&(D=e.getContainer()),!D&&((E=e.getPlugins().Toolbar)===null||E===void 0?void 0:E.isEnabled())!==!0){const T=((w=e.getPages()[0])===null||w===void 0?void 0:w.slides)||[],A=((R=e.getPage())===null||R===void 0?void 0:R.slides)||[];T.length===1&&A.length===1&&(D=A[0].el)}if(D||(D=e.getViewport()),!D)return;i=document.createElement("div"),i.classList.add("f-progressbar"),D.prepend(i);const P=s("timeout")||1e3;i.style.animationDuration=`${P}ms`})();const O=s("timeout");n=setTimeout(()=>{e&&a&&!o&&(e.isInfinite()||e.getPageIndex()!==e.getPages().length-1?e.next():e.goTo(0))},O)}function c(){var O,_;if(!e||e.getPages().length<2||e.getOptions().Autoplay===!1||a)return;a=!0,e.emit("autoplay:start",s("timeout")),(O=e.getContainer())===null||O===void 0||O.classList.add("has-autoplay"),(_=e.getTween())===null||_===void 0||_.on("start",x);const E=e==null?void 0:e.getContainer();E&&s("pauseOnHover")&&matchMedia("(hover: hover)").matches&&(E.addEventListener("mouseenter",b,!1),E.addEventListener("mouseleave",v,!1)),e.on("change",y),e.on("settle",k),e.on("contentReady",d),e.on("panzoom:animationStart",h),e.isSettled()&&m()}function h(){var O,_;if(u(),f(),a&&e){e.emit("autoplay:end"),(O=e.getContainer())===null||O===void 0||O.classList.remove("has-autoplay"),(_=e.getTween())===null||_===void 0||_.off("start",x);const E=e==null?void 0:e.getContainer();E&&(E.removeEventListener("mouseenter",b,!1),E.removeEventListener("mouseleave",v,!1))}e&&(e.off("change",y),e.off("settle",k),e.off("contentReady",d),e.off("panzoom:animationStart",h)),a=!1,o=!1}function f(){i&&(i.remove(),i=null)}function p(){e&&e.getPages().length>1&&s("autoStart")&&c()}function d(O){e&&e.getPageIndex(O.index)===e.getPageIndex()&&(!a||r||l()||m())}function g(O,_){const E=_.target;E&&!_.defaultPrevented&&E.dataset.autoplayAction==="toggle"&&C.toggle()}function y(){!e||!(e!=null&&e.isInfinite())&&e.getPageIndex()===e.getPages().length-1?h():(f(),u())}function k(){!a||r||o||m()}function x(){u(),f()}function b(){r=!0,a&&(f(),u())}function v(){r=!1,a&&!o&&(e!=null&&e.isSettled())&&m()}const C={init:function(O){e=O,e.on("ready",p),e.on("click",g)},destroy:function(){h(),e==null||e.off("ready",p),e==null||e.off("click",g),e=void 0},isEnabled:()=>a,pause:function(){o=!0,u()},resume:function(){o=!1,a&&!r&&m()},start(){c()},stop(){h()},toggle(){a?h():c()}};return C};/*! License details at fancyapps.com/license */const Ma={Carousel:{Lazyload:{showLoading:!1}},minCount:2,showOnStart:!0,thumbTpl:'<button aria-label="Slide to #{{page}}"><img draggable="false" alt="{{alt}}" data-lazy-src="{{src}}" /></button>',type:"modern"};let Va;const od=()=>{let e,n,a,o=0,r=0,i=!0;function s(b){const v=e==null?void 0:e.getOptions().Thumbs;let C=(Ue(v)?Object.assign(Object.assign({},Ma),v):Ma)[b];return C&&typeof C=="function"?C():C}function l(){if(!e||(e==null?void 0:e.getOptions().Thumbs)===!1)return!1;let b=0;for(const v of e.getSlides())v.thumbSrc&&b++;return b>=s("minCount")}function u(){return s("type")==="modern"}function m(b=!1){const v=e==null?void 0:e.getContainer();if(e&&v&&!a&&l()){if(!a){const C=v.nextElementSibling;C!=null&&C.classList.contains("f-thumbs")&&(a=C)}if(!a){a=document.createElement("div"),a.classList.add("f-thumbs");const C=s("parentEl");C?C.insertAdjacentElement("beforeend",a):v.insertAdjacentElement("afterend",a)}a.classList.add(`is-${s("type")}`),a.classList.add("is-syncing"),b&&(a.style.maxHeight="0px")}}function c(b){let v=b.thumb?b.thumb instanceof HTMLImageElement?b.thumb.src:b.thumb:b.thumbSrc||void 0,C=s("thumbTpl");return C=Ct(C,"{{alt}}",`Thumbnail #${b.index}`),C=Ct(C,"{{src}}",v+""),C=Ct(C,"{{index}}",`${b.index}`),C=Ct(C,"{{page}}",`${b.index||1}`),{html:C,class:b.thumbClass}}function h(){var b,v;if(!Va||!e||!a||n)return;const C=[];for(const O of e.getSlides())C.push(c(O));C.length&&(n=Va(a,at({},{Sync:{target:e},Lazyload:{preload:1},slides:C,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",slide:"f-thumbs__slide"},initialSlide:e.getOptions().initialPage,center:!0,fill:!u(),infinite:!1,dragFree:!0,rtl:e.getOptions().rtl||!1,slidesPerPage:O=>{let _=0;return u()&&(function(){if(!u()||!a)return;const E=w=>a&&parseFloat(getComputedStyle(a).getPropertyValue("--f-thumb-"+w))||0;o=E("width"),r=E("clip-width")}(),_=4*(o-r)),O&&O.getTotalSlideDim()<=O.getViewportDim()-_?1/0:1}},Ma.Carousel||{},s("Carousel")||{}),{Sync:V1,Lazyload:D1}).init(),(b=n.getGestures())===null||b===void 0||b.on("start",()=>{i=!1}),n.on("click",(O,_)=>{const E=_.target;if(E){const w=E.matches("button")?E:E.firstElementChild;w&&w.matches("button")&&w.focus({})}}),(v=e.getContainer())===null||v===void 0||v.classList.add("has-thumbs"),x())}function f(){var b;l()&&(s("showOnStart")&&(m(),h()),(b=e==null?void 0:e.getGestures())===null||b===void 0||b.on("start",p),e==null||e.on("addSlide",y),e==null||e.on("click",k))}function p(){var b,v;i=!0,!((b=document.activeElement)===null||b===void 0)&&b.closest(".f-thumbs")&&((v=document.activeElement)===null||v===void 0||v.blur())}function d(){var b,v;a==null||a.classList.toggle("is-syncing",(e==null?void 0:e.hasNavigated())===!1||((b=e==null?void 0:e.getTween())===null||b===void 0?void 0:b.isRunning())),x(),!((v=e==null?void 0:e.getGestures())===null||v===void 0)&&v.isPointerDown()&&function(){if(!u()||!e||!n||!i)return;const C=n.getTween(),O=n.getPages(),_=e.getPageIndex()||0,E=e.getPageProgress()||0;if(!(e&&O&&O[_]&&C))return;const w=C.isRunning()?C.getCurrentValues().pos:n.getPosition();if(w===void 0)return;let R=O[_].pos+E*(o-r);R=De(O[0].pos,R,O[O.length-1].pos),C.from({pos:w}).to({pos:R}).start()}()}function g(){i=!0}function y(b,v){n==null||n.add(c(v),v.index)}function k(b,v){const C=v.target;C&&!v.defaultPrevented&&C.dataset.thumbsAction==="toggle"&&function(){if(a||(m(!0),h()),!a)return;const O=a.style.maxHeight;a.style.maxHeight=O?"":"0px"}()}function x(){if(!u()||!e||!n)return;const b=(n==null?void 0:n.getSlides())||[];let v=-.5*o;for(const C of b){const O=C.el;if(!O)continue;let _=e.getPageProgress(C.index)||0;_=Math.max(-1,Math.min(1,_)),_>-1&&_<1&&(v+=.5*o*(1-Math.abs(_))),_=Math.round(1e4*_)/1e4,v=Math.round(1e4*v)/1e4,O.style.setProperty("--progress",`${Math.abs(_)}`),O.style.setProperty("--shift",`${e!=null&&e.isRTL()?-1*v:v}px`),_>-1&&_<1&&(v+=.5*o*(1-Math.abs(_)))}}return{init:function(b,v){Va=v,e=b,e.on("ready",f),e.on("render",d),e.on("change",g)},destroy:function(){var b,v;e==null||e.off("ready",f),e==null||e.off("render",d),e==null||e.off("change",g),e==null||e.off("addSlide",y),e==null||e.off("click",k),(b=e==null?void 0:e.getGestures())===null||b===void 0||b.off("start",p),(v=e==null?void 0:e.getContainer())===null||v===void 0||v.classList.remove("has-thumbs"),e=void 0,n==null||n.destroy(),n=void 0,a==null||a.remove(),a=void 0},getContainer:function(){return a},isEnabled:function(){return l()}}};/*! License details at fancyapps.com/license */const R1={iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"}},rd=()=>{let e;function n(r,i){let s=i.src;if(!je(s))return;let l=i.type;if(!l){if(l||(s.charAt(0)==="#"?l="inline":s.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.((a)?png|avif|gif|jp(g|eg)|pjp(eg)?|jfif|svg|webp|bmp|ico|tif(f)?)((\?|#).*)?$)/i)?l="image":s.match(/\.(pdf)((\?|#).*)?$/i)?l="pdf":s.match(/\.(html|php)((\?|#).*)?$/i)&&(l="iframe")),!l){const u=s.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i);u&&(s=`https://maps.google.${u[1]}/?ll=${(u[2]?u[2]+"&z="+Math.floor(parseFloat(u[3]))+(u[4]?u[4].replace(/^\//,"&"):""):u[4]+"").replace(/\?/,"&")}&output=${u[4]&&u[4].indexOf("layer=c")>0?"svembed":"embed"}`,l="gmap")}if(!l){const u=s.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i);u&&(s=`https://maps.google.${u[1]}/maps?q=${u[2].replace("query=","q=").replace("api=1","")}&output=embed`,l="gmap")}i.src=s,i.type=l}}function a(r,i){i.type!=="iframe"&&i.type!=="pdf"&&i.type!=="gmap"||function(s){if(!e||!s.el||!s.src)return;const l=document.createElement("iframe");l.classList.add("f-iframe");for(const[m,c]of Object.entries(function(){const h=e==null?void 0:e.getOptions().Html;return Ue(h)?Object.assign(Object.assign({},R1),h):R1}().iframeAttr||{}))l.setAttribute(m,c);l.onerror=()=>{e&&e.getState()===1&&e.showError(s,"{{IFRAME_ERROR}}")},l.src=s.src;const u=document.createElement("div");if(u.classList.add("f-html"),u.append(l),s.width){let m=`${s.width}`;m.match(/^\d+$/)&&(m+="px"),u.style.maxWidth=`${m}`}if(s.height){let m=`${s.height}`;m.match(/^\d+$/)&&(m+="px"),u.style.maxHeight=`${m}`}if(s.aspectRatio){const m=s.el.getBoundingClientRect();u.style.aspectRatio=`${s.aspectRatio}`,u.style[m.width>m.height?"width":"height"]="auto",u.style[m.width>m.height?"maxWidth":"maxHeight"]="none"}s.contentEl=l,s.htmlEl=u,s.el.classList.add("has-html"),s.el.classList.add("has-iframe"),s.el.classList.add(`has-${s.type}`),s.el.prepend(u),e.emit("contentReady",s)}(i)}function o(r,i){var s,l;i.type!=="iframe"&&i.type!=="pdf"&&i.type!=="gmap"||(e==null||e.hideError(i),(s=i.contentEl)===null||s===void 0||s.remove(),i.contentEl=void 0,(l=i.htmlEl)===null||l===void 0||l.remove(),i.htmlEl=void 0)}return{init:function(r){e=r,e.on("addSlide",n),e.on("attachSlideEl",a),e.on("detachSlideEl",o)},destroy:function(){e==null||e.off("addSlide",n),e==null||e.off("attachSlideEl",a),e==null||e.off("detachSlideEl",o),e=void 0}}};/*! License details at fancyapps.com/license */const H1=(e,n={})=>{const a=new URL(e),o=new URLSearchParams(a.search),r=new URLSearchParams;for(const[l,u]of[...o,...Object.entries(n)]){let m=u+"";if(l==="t"){let c=m.match(/((\d*)m)?(\d*)s?/);c&&r.set("start",60*parseInt(c[2]||"0")+parseInt(c[3]||"0")+"")}else r.set(l,m)}let i=r+"",s=e.match(/#t=((.*)?\d+s)/);return s&&(i+=`#t=${s[1]}`),i},z1={autoplay:!1,html5videoTpl:`<video class="f-html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">
|