sm-click-library-ui 0.0.540-dev.2 → 0.0.540-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-BMkRjy1p.js → index-DFR5wG2u.js} +24 -16
- package/dist/sm-click-library-ui.es.js +1 -1
- package/dist/sm-click-library-ui.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/tailwind.css +0 -19
- package/dist/{web-CnfL95VZ.js → web-C0b538DD.js} +2 -2
- package/dist/{web-CVTAf6EY.js → web-DSejpg_J.js} +2 -2
- package/package.json +1 -1
|
@@ -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[ir]=this[ir]={accessors:{}}).accessors,r=this.prototype;function l(s){const i=En(s);o[i]||(w0(r,s),o[i]=!0)}return ae.isArray(n)?n.forEach(l):l(n),this}};it.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ae.reduceDescriptors(it.prototype,({value:t},n)=>{let a=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(o){this[a]=o}}}),ae.freezeMethods(it);function za(t,n){const a=this||wn,o=n||a,r=it.from(o.headers);let l=o.data;return ae.forEach(t,function(i){l=i.call(a,l,r.normalize(),n?n.status:void 0)}),r.normalize(),l}function cr(t){return!!(t&&t.__CANCEL__)}function sn(t,n,a){De.call(this,t??"canceled",De.ERR_CANCELED,n,a),this.name="CanceledError"}ae.inherits(sn,De,{__CANCEL__:!0});function dr(t,n,a){const o=a.config.validateStatus;!a.status||!o||o(a.status)?t(a):n(new De("Request failed with status code "+a.status,[De.ERR_BAD_REQUEST,De.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function E0(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function C0(t,n){t=t||10;const a=new Array(t),o=new Array(t);let r=0,l=0,s;return n=n!==void 0?n:1e3,function(d){const u=Date.now(),c=o[l];s||(s=u),a[r]=d,o[r]=u;let m=l,f=0;for(;m!==r;)f+=a[m++],m=m%t;if(r=(r+1)%t,r===l&&(l=(l+1)%t),u-s<n)return;const h=c&&u-c;return h?Math.round(f*1e3/h):void 0}}function B0(t,n){let a=0,o=1e3/n,r,l;const s=(u,c=Date.now())=>{a=c,r=null,l&&(clearTimeout(l),l=null),t(...u)};return[(...u)=>{const c=Date.now(),m=c-a;m>=o?s(u,c):(r=u,l||(l=setTimeout(()=>{l=null,s(r)},o-m)))},()=>r&&s(r)]}const jn=(t,n,a=3)=>{let o=0;const r=C0(50,250);return B0(l=>{const s=l.loaded,i=l.lengthComputable?l.total:void 0,d=s-o,u=r(d),c=s<=i;o=s;const m={loaded:s,total:i,progress:i?s/i:void 0,bytes:d,rate:u||void 0,estimated:u&&i&&c?(i-s)/u:void 0,event:l,lengthComputable:i!=null,[n?"download":"upload"]:!0};t(m)},a)},ur=(t,n)=>{const a=t!=null;return[o=>n[0]({lengthComputable:a,total:t,loaded:o}),n[1]]},mr=t=>(...n)=>ae.asap(()=>t(...n)),v0=Xe.hasStandardBrowserEnv?((t,n)=>a=>(a=new URL(a,Xe.origin),t.protocol===a.protocol&&t.host===a.host&&(n||t.port===a.port)))(new URL(Xe.origin),Xe.navigator&&/(msie|trident)/i.test(Xe.navigator.userAgent)):()=>!0,V0=Xe.hasStandardBrowserEnv?{write(t,n,a,o,r,l,s){if(typeof document>"u")return;const i=[`${t}=${encodeURIComponent(n)}`];ae.isNumber(a)&&i.push(`expires=${new Date(a).toUTCString()}`),ae.isString(o)&&i.push(`path=${o}`),ae.isString(r)&&i.push(`domain=${r}`),l===!0&&i.push("secure"),ae.isString(s)&&i.push(`SameSite=${s}`),document.cookie=i.join("; ")},read(t){if(typeof document>"u")return null;const n=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function S0(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function N0(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function fr(t,n,a){let o=!S0(n);return t&&(o||a==!1)?N0(t,n):n}const pr=t=>t instanceof it?{...t}:t;function It(t,n){n=n||{};const a={};function o(u,c,m,f){return ae.isPlainObject(u)&&ae.isPlainObject(c)?ae.merge.call({caseless:f},u,c):ae.isPlainObject(c)?ae.merge({},c):ae.isArray(c)?c.slice():c}function r(u,c,m,f){if(ae.isUndefined(c)){if(!ae.isUndefined(u))return o(void 0,u,m,f)}else return o(u,c,m,f)}function l(u,c){if(!ae.isUndefined(c))return o(void 0,c)}function s(u,c){if(ae.isUndefined(c)){if(!ae.isUndefined(u))return o(void 0,u)}else return o(void 0,c)}function i(u,c,m){if(m in n)return o(u,c);if(m in t)return o(void 0,u)}const d={url:l,method:l,data:l,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:i,headers:(u,c,m)=>r(pr(u),pr(c),m,!0)};return ae.forEach(Object.keys({...t,...n}),function(c){const m=d[c]||r,f=m(t[c],n[c],c);ae.isUndefined(f)&&m!==i||(a[c]=f)}),a}const hr=t=>{const n=It({},t);let{data:a,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:l,headers:s,auth:i}=n;if(n.headers=s=it.from(s),n.url=or(fr(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),i&&s.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),ae.isFormData(a)){if(Xe.hasStandardBrowserEnv||Xe.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(ae.isFunction(a.getHeaders)){const d=a.getHeaders(),u=["content-type","content-length"];Object.entries(d).forEach(([c,m])=>{u.includes(c.toLowerCase())&&s.set(c,m)})}}if(Xe.hasStandardBrowserEnv&&(o&&ae.isFunction(o)&&(o=o(n)),o||o!==!1&&v0(n.url))){const d=r&&l&&V0.read(l);d&&s.set(r,d)}return n},M0=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(a,o){const r=hr(t);let l=r.data;const s=it.from(r.headers).normalize();let{responseType:i,onUploadProgress:d,onDownloadProgress:u}=r,c,m,f,h,p;function g(){h&&h(),p&&p(),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=it.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),v={data:!i||i==="text"||i==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:b,config:t,request:y};dr(function(R){a(R),g()},function(R){o(R),g()},v),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 De("Request aborted",De.ECONNABORTED,t,y)),y=null)},y.onerror=function(x){const v=x&&x.message?x.message:"Network Error",_=new De(v,De.ERR_NETWORK,t,y);_.event=x||null,o(_),y=null},y.ontimeout=function(){let x=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const v=r.transitional||lr;r.timeoutErrorMessage&&(x=r.timeoutErrorMessage),o(new De(x,v.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,t,y)),y=null},l===void 0&&s.setContentType(null),"setRequestHeader"in y&&ae.forEach(s.toJSON(),function(x,v){y.setRequestHeader(v,x)}),ae.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),i&&i!=="json"&&(y.responseType=r.responseType),u&&([f,p]=jn(u,!0),y.addEventListener("progress",f)),d&&y.upload&&([m,h]=jn(d),y.upload.addEventListener("progress",m),y.upload.addEventListener("loadend",h)),(r.cancelToken||r.signal)&&(c=b=>{y&&(o(!b||b.type?new sn(null,t,y):b),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));const B=E0(r.url);if(B&&Xe.protocols.indexOf(B)===-1){o(new De("Unsupported protocol "+B+":",De.ERR_BAD_REQUEST,t));return}y.send(l||null)})},A0=(t,n)=>{const{length:a}=t=t?t.filter(Boolean):[];if(n||a){let o=new AbortController,r;const l=function(u){if(!r){r=!0,i();const c=u instanceof Error?u:this.reason;o.abort(c instanceof De?c:new sn(c instanceof Error?c.message:c))}};let s=n&&setTimeout(()=>{s=null,l(new De(`timeout ${n} of ms exceeded`,De.ETIMEDOUT))},n);const i=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(l):u.removeEventListener("abort",l)}),t=null)};t.forEach(u=>u.addEventListener("abort",l));const{signal:d}=o;return d.unsubscribe=()=>ae.asap(i),d}},$0=function*(t,n){let a=t.byteLength;if(a<n){yield t;return}let o=0,r;for(;o<a;)r=o+n,yield t.slice(o,r),o=r},_0=async function*(t,n){for await(const a of D0(t))yield*$0(a,n)},D0=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const n=t.getReader();try{for(;;){const{done:a,value:o}=await n.read();if(a)break;yield o}}finally{await n.cancel()}},gr=(t,n,a,o)=>{const r=_0(t,n);let l=0,s,i=d=>{s||(s=!0,o&&o(d))};return new ReadableStream({async pull(d){try{const{done:u,value:c}=await r.next();if(u){i(),d.close();return}let m=c.byteLength;if(a){let f=l+=m;a(f)}d.enqueue(new Uint8Array(c))}catch(u){throw i(u),u}},cancel(d){return i(d),r.return()}},{highWaterMark:2})},yr=64*1024,{isFunction:Gn}=ae,T0=(({Request:t,Response:n})=>({Request:t,Response:n}))(ae.global),{ReadableStream:kr,TextEncoder:br}=ae.global,xr=(t,...n)=>{try{return!!t(...n)}catch{return!1}},L0=t=>{t=ae.merge.call({skipUndefined:!0},T0,t);const{fetch:n,Request:a,Response:o}=t,r=n?Gn(n):typeof fetch=="function",l=Gn(a),s=Gn(o);if(!r)return!1;const i=r&&Gn(kr),d=r&&(typeof br=="function"?(p=>g=>p.encode(g))(new br):async p=>new Uint8Array(await new a(p).arrayBuffer())),u=l&&i&&xr(()=>{let p=!1;const g=new a(Xe.origin,{body:new kr,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),c=s&&i&&xr(()=>ae.isReadableStream(new o("").body)),m={stream:c&&(p=>p.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!m[p]&&(m[p]=(g,y)=>{let k=g&&g[p];if(k)return k.call(g);throw new De(`Response type '${p}' is not supported`,De.ERR_NOT_SUPPORT,y)})});const f=async p=>{if(p==null)return 0;if(ae.isBlob(p))return p.size;if(ae.isSpecCompliantForm(p))return(await new a(Xe.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(ae.isArrayBufferView(p)||ae.isArrayBuffer(p))return p.byteLength;if(ae.isURLSearchParams(p)&&(p=p+""),ae.isString(p))return(await d(p)).byteLength},h=async(p,g)=>{const y=ae.toFiniteNumber(p.getContentLength());return y??f(g)};return async p=>{let{url:g,method:y,data:k,signal:B,cancelToken:b,timeout:x,onDownloadProgress:v,onUploadProgress:_,responseType:R,headers:L,withCredentials:A="same-origin",fetchOptions:M}=hr(p),S=n||fetch;R=R?(R+"").toLowerCase():"text";let N=A0([B,b&&b.toAbortSignal()],x),w=null;const C=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let O;try{if(_&&u&&y!=="get"&&y!=="head"&&(O=await h(L,k))!==0){let F=new a(g,{method:"POST",body:k,duplex:"half"}),G;if(ae.isFormData(k)&&(G=F.headers.get("content-type"))&&L.setContentType(G),F.body){const[Q,I]=ur(O,jn(mr(_)));k=gr(F.body,yr,Q,I)}}ae.isString(A)||(A=A?"include":"omit");const T=l&&"credentials"in a.prototype,V={...M,signal:N,method:y.toUpperCase(),headers:L.normalize().toJSON(),body:k,duplex:"half",credentials:T?A:void 0};w=l&&new a(g,V);let E=await(l?S(w,M):S(g,V));const $=c&&(R==="stream"||R==="response");if(c&&(v||$&&C)){const F={};["status","statusText","headers"].forEach(q=>{F[q]=E[q]});const G=ae.toFiniteNumber(E.headers.get("content-length")),[Q,I]=v&&ur(G,jn(mr(v),!0))||[];E=new o(gr(E.body,yr,Q,()=>{I&&I(),C&&C()}),F)}R=R||"text";let D=await m[ae.findKey(m,R)||"text"](E,p);return!$&&C&&C(),await new Promise((F,G)=>{dr(F,G,{data:D,headers:it.from(E.headers),status:E.status,statusText:E.statusText,config:p,request:w})})}catch(T){throw C&&C(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new De("Network Error",De.ERR_NETWORK,p,w),{cause:T.cause||T}):De.from(T,T&&T.code,p,w)}}},F0=new Map,wr=t=>{let n=t&&t.env||{};const{fetch:a,Request:o,Response:r}=n,l=[o,r,a];let s=l.length,i=s,d,u,c=F0;for(;i--;)d=l[i],u=c.get(d),u===void 0&&c.set(d,u=i?new Map:L0(n)),c=u;return u};wr();const Oa={http:o0,xhr:M0,fetch:{get:wr}};ae.forEach(Oa,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const Er=t=>`- ${t}`,P0=t=>ae.isFunction(t)||t===null||t===!1;function z0(t,n){t=ae.isArray(t)?t:[t];const{length:a}=t;let o,r;const l={};for(let s=0;s<a;s++){o=t[s];let i;if(r=o,!P0(o)&&(r=Oa[(i=String(o)).toLowerCase()],r===void 0))throw new De(`Unknown adapter '${i}'`);if(r&&(ae.isFunction(r)||(r=r.get(n))))break;l[i||"#"+s]=r}if(!r){const s=Object.entries(l).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=a?s.length>1?`since :
|
|
4
4
|
`+s.map(Er).join(`
|
|
5
5
|
`):" "+Er(s[0]):"as no adapter specified";throw new De("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r}const Cr={getAdapter:z0,adapters:Oa};function Ra(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new sn(null,t)}function Br(t){return Ra(t),t.headers=it.from(t.headers),t.data=za.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Cr.getAdapter(t.adapter||wn.adapter,t)(t).then(function(o){return Ra(t),o.data=za.call(t,t.transformResponse,o),o.headers=it.from(o.headers),o},function(o){return cr(o)||(Ra(t),o&&o.response&&(o.response.data=za.call(t,t.transformResponse,o.response),o.response.headers=it.from(o.response.headers))),Promise.reject(o)})}const vr="1.13.1",In={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{In[t]=function(o){return typeof o===t||"a"+(n<1?"n ":" ")+t}});const Vr={};In.transitional=function(n,a,o){function r(l,s){return"[Axios v"+vr+"] Transitional option '"+l+"'"+s+(o?". "+o:"")}return(l,s,i)=>{if(n===!1)throw new De(r(s," has been removed"+(a?" in "+a:"")),De.ERR_DEPRECATED);return a&&!Vr[s]&&(Vr[s]=!0,console.warn(r(s," has been deprecated since v"+a+" and will be removed in the near future"))),n?n(l,s,i):!0}},In.spelling=function(n){return(a,o)=>(console.warn(`${o} is likely a misspelling of ${n}`),!0)};function O0(t,n,a){if(typeof t!="object")throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);const o=Object.keys(t);let r=o.length;for(;r-- >0;){const l=o[r],s=n[l];if(s){const i=t[l],d=i===void 0||s(i,l,t);if(d!==!0)throw new De("option "+l+" must be "+d,De.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new De("Unknown option "+l,De.ERR_BAD_OPTION)}}const qn={assertOptions:O0,validators:In},bt=qn.validators;let qt=class{constructor(n){this.defaults=n||{},this.interceptors={request:new rr,response:new rr}}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 l=r.stack?r.stack.replace(/^.+\n/,""):"";try{o.stack?l&&!String(o.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
6
|
-
`+l):o.stack=l}catch{}}throw o}}_request(n,a){typeof n=="string"?(a=a||{},a.url=n):a=n||{},a=It(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:l}=a;o!==void 0&&qn.assertOptions(o,{silentJSONParsing:bt.transitional(bt.boolean),forcedJSONParsing:bt.transitional(bt.boolean),clarifyTimeoutError:bt.transitional(bt.boolean)},!1),r!=null&&(ae.isFunction(r)?a.paramsSerializer={serialize:r}:qn.assertOptions(r,{encode:bt.function,serialize:bt.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),qn.assertOptions(a,{baseUrl:bt.spelling("baseURL"),withXsrfToken:bt.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let s=l&&ae.merge(l.common,l[a.method]);l&&ae.forEach(["delete","get","head","post","put","patch","common"],p=>{delete l[p]}),a.headers=it.concat(s,l);const i=[];let d=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(d=d&&g.synchronous,i.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,m=0,f;if(!d){const p=[Br.bind(this),void 0];for(p.unshift(...i),p.push(...u),f=p.length,c=Promise.resolve(a);m<f;)c=c.then(p[m++],p[m++]);return c}f=i.length;let h=a;for(;m<f;){const p=i[m++],g=i[m++];try{h=p(h)}catch(y){g.call(this,y);break}}try{c=Br.call(this,h)}catch(p){return Promise.reject(p)}for(m=0,f=u.length;m<f;)c=c.then(u[m++],u[m++]);return c}getUri(n){n=It(this.defaults,n);const a=fr(n.baseURL,n.url,n.allowAbsoluteUrls);return or(a,n.params,n.paramsSerializer)}};ae.forEach(["delete","get","head","options"],function(n){qt.prototype[n]=function(a,o){return this.request(It(o||{},{method:n,url:a,data:(o||{}).data}))}}),ae.forEach(["post","put","patch"],function(n){function a(o){return function(l,s,i){return this.request(It(i||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:l,data:s}))}}qt.prototype[n]=a(),qt.prototype[n+"Form"]=a(!0)});let R0=class vi{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(l){a=l});const o=this;this.promise.then(r=>{if(!o._listeners)return;let l=o._listeners.length;for(;l-- >0;)o._listeners[l](r);o._listeners=null}),this.promise.then=r=>{let l;const s=new Promise(i=>{o.subscribe(i),l=i}).then(r);return s.cancel=function(){o.unsubscribe(l)},s},n(function(l,s,i){o.reason||(o.reason=new sn(l,s,i),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 vi(function(r){n=r}),cancel:n}}};function H0(t){return function(a){return t.apply(null,a)}}function j0(t){return ae.isObject(t)&&t.isAxiosError===!0}const Ha={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ha).forEach(([t,n])=>{Ha[n]=t});function Sr(t){const n=new qt(t),a=Go(qt.prototype.request,n);return ae.extend(a,qt.prototype,n,{allOwnKeys:!0}),ae.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return Sr(It(t,r))},a}const qe=Sr(wn);qe.Axios=qt,qe.CanceledError=sn,qe.CancelToken=R0,qe.isCancel=cr,qe.VERSION=vr,qe.toFormData=Rn,qe.AxiosError=De,qe.Cancel=qe.CanceledError,qe.all=function(n){return Promise.all(n)},qe.spread=H0,qe.isAxiosError=j0,qe.mergeConfig=It,qe.AxiosHeaders=it,qe.formToJSON=t=>sr(ae.isHTMLForm(t)?new FormData(t):t),qe.getAdapter=Cr.getAdapter,qe.HttpStatusCode=Ha,qe.default=qe;const{Axios:KA,AxiosError:JA,CanceledError:e$,isCancel:t$,CancelToken:n$,VERSION:a$,all:o$,Cancel:r$,isAxiosError:l$,spread:s$,toFormData:i$,AxiosHeaders:c$,HttpStatusCode:d$,formToJSON:u$,getAdapter:m$,mergeConfig:f$}=qe,ja=jt.defineStore("auth",{state:()=>({jwtToken:null,refreshToken:null}),actions:{setToken(t,n=null){this.jwtToken=t,n&&(this.refreshToken=n),this._syncToLocalStorage()},setRefreshToken(t){this.refreshToken=t,this._syncToLocalStorage()},clearToken(){this.jwtToken=null,this.refreshToken=null,localStorage.clear()},_syncToLocalStorage(){if(typeof window<"u"&&window.localStorage)try{if(!this.jwtToken&&!this.refreshToken)return;const t=localStorage.getItem("userData");if(t){const a=JSON.parse(t);this.jwtToken&&(a.access_token=this.jwtToken),this.refreshToken&&(a.refresh_token=this.refreshToken),localStorage.setItem("userData",JSON.stringify(a));return}localStorage.getItem("access_token")!==null&&(this.jwtToken&&localStorage.setItem("access_token",this.jwtToken),this.refreshToken&&localStorage.setItem("refresh_token",this.refreshToken))}catch(t){console.warn("Erro ao sincronizar token com localStorage:",t)}}},getters:{getToken:t=>t.jwtToken,getRefreshToken:t=>t.refreshToken}}),Pe=qe.create({baseURL:"https://back.dev-smclick.com.br/"}),Wn=qe.create();Wn.defaults.baseURL=Pe.defaults.baseURL;let Ga=null,Nr=null,Mr=null;const Ar=()=>(Ga||(Ga=ja(Mr)),Ga);function G0(t){Mr=t}function $r(t){Nr=t}Pe.interceptors.request.use(t=>{try{const a=Ar().jwtToken;a?t.headers.Authorization=`Bearer ${a}`:console.warn("JWT token não configurado em api request")}catch(n){console.warn("Erro ao acessar authStore no interceptor:",n)}return t},t=>Promise.reject(t)),Pe.interceptors.response.use(t=>t,async t=>{if(!t.response)return Promise.reject(t);const n=t.response.status;if(n.toString()[0]==="5")return console.error("Erro inesperado no servidor:",t),Promise.reject(t);if(n===401){const a=Ar(),o=a.refreshToken;if(o)try{const r=Nr||`${Wn.defaults.baseURL}v1/api/attendances/token/refresh/`,s=(await Wn.post(r,{refresh:o})).data.access;return a.setToken(s,o),t.config.headers.Authorization=`Bearer ${s}`,Pe.request(t.config)}catch(r){return console.error("Erro ao fazer refresh do token:",r),a.clearToken(),typeof window<"u"&&window.location&&setTimeout(()=>{window.location.href="/login"},500),Promise.reject(r)}else a.clearToken(),typeof window<"u"&&window.location&&setTimeout(()=>{window.location.href="/login"},500)}return Promise.reject(t)});function I0(t){t&&(Pe.defaults.baseURL=t,Wn.defaults.baseURL=t)}const q0="v1/api/attendances/attendant/",W0="v1/api/attendances/department/",Wt="v1/api/attendances/internal_chat/",U0="v1/api/instances/instance/",Z0="v1/api/crm/event/scheduled_message/",Y0="v1/api/crm/event/calendar",X0="v1/api/crm/products/",Q0="v1/api/contacts/tag/",_r="v1/api/contacts/contact/",Ia=t=>`${_r}${t}/wallets/`,K0="/v1/api/contacts/segmentation_field/",J0="v1/api/attendances/calls/",Un="v1/api/crm/event/attendant_reminder/",ec="v1/api/instances/template/",Ut=jt.defineStore("department",{state:()=>({departments:[],count:null,loaded:!1}),actions:{async fetchDepartments(t=""){try{let n=`${W0}`;const a=await Pe.get(n);this.departments=a.data,this.count=this.departments.length}catch(n){console.log("Erro ao buscar departamentos:",n)}},removeDepartments(t){this.departments=this.departments.filter(n=>n.id!==t)},addDepartments(t){const n=this.departments.findIndex(a=>a.id===t.id);n!==-1?this.departments[n]=t:this.departments.push(t)}}}),tc=["title"],nc={class:"whitespace-nowrap text-sm font-medium"},ac={class:"flex justify-center"},oc={class:"flex-shrink-0 hidden lg:block"},rc={key:0,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},lc={key:1,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},sc={class:"text-xs"},ic={class:"flex justify-center"},cc={class:"flex-shrink-0 hidden lg:block"},dc={key:0,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},uc={key:1,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},mc={key:2,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},fc={key:3,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},pc={class:"text-xs"},hc={class:"w-72 rounded-lg p-2"},gc={key:0,class:"space-y-2"},yc={class:"font-medium text-slate-100 text-sm"},kc={key:1,class:"text-xs text-slate-400 text-center py-2"},bc={class:"flex items-center gap-2 px-3 py-1.5 bg-gradient-to-r from-blue-500/10 to-blue-400/10 border border-blue-500/30 rounded-lg cursor-pointer hover:border-blue-300/50 transition-all"},xc={class:"text-sm font-semibold text-blue-500"},wc={class:"flex items-center justify-center gap-2"},Ec={class:"border border-base-200 rounded-md overflow-hidden"},Cc={class:"flex justify-between items-center p-2 sticky top-0 bg-base-200 z-10"},Bc={class:"font-semibold text-sm"},vc=["disabled","onClick"],Vc=["onClick"],Sc=["onClick"],Nc=["onClick"],Dr=ke({__name:"templateTable",props:{instanceId:{type:[String,Number],required:!0},departmentId:{type:[String,Number],default:null},extraParams:{type:Object,default:()=>({})},mode:{type:String,default:"manage",validator:t=>["manage","send"].includes(t)},showLang:{type:Boolean,default:!1},showDepartments:{type:Boolean,default:!1},itemsPerPage:{type:Number,default:15}},emits:["send","edit","delete","copy-id"],setup(t,{expose:n,emit:a}){const o=t,r=e.ref([]),l=e.ref(!1),s=e.ref(1),i=e.ref(0),d=e.ref({}),u=Ut(),c=e.computed(()=>{const y=[{key:"name",label:"Nome",width:"w-64",headerAlign:"left",filter:{type:"text",placeholder:"Buscar nome..."}}];return o.showLang&&y.push({key:"lang",label:"Idioma",width:"w-20",filter:{type:"select",key:"language",options:[{value:"pt_BR",label:"Português"},{value:"en",label:"Inglês"}]}}),y.push({key:"category",label:"Categoria",width:"w-32",filter:{type:"select",options:[{value:"MARKETING",label:"Marketing"},{value:"UTILITY",label:"Utilidade"},{value:"AUTHENTICATION",label:"Autenticação"}]}},{key:"status",label:"Status",width:"w-32",filter:{type:"select",options:[{value:"PENDING",label:"Pendente"},{value:"APPROVED",label:"Aprovado"},{value:"REJECTED",label:"Reprovado"},{value:"PENDING_DELETION",label:"Ag. deleção"}]}}),o.showDepartments&&y.push({key:"department",label:"Departamento(s)",width:"w-28",filter:{type:"multiselect",key:"departments",options:u.departments.map(k=>({value:String(k.id),label:k.name}))}}),y.push({key:"actions",label:"Ações",width:"w-44",cellClass:"whitespace-nowrap"}),y});async function m(){l.value=!0;try{const y=new URLSearchParams;y.set("page",s.value),y.set("instance",o.instanceId),o.departmentId&&y.set("department",o.departmentId);for(const[B,b]of Object.entries(d.value))Array.isArray(b)?b.length&&y.set(B,b.join(",")):b!=null&&b!==""&&y.append(B,b);if(o.extraParams)for(const[B,b]of Object.entries(o.extraParams))Array.isArray(b)?b.forEach(x=>y.append(B,x)):b!=null&&b!==""&&y.append(B,b);const{data:k}=await Pe.get(`${ec}?${y.toString()}`);r.value=k.results,i.value=k.count}catch{r.value=[],i.value=0}finally{l.value=!1}}function f(y){d.value=y,s.value=1,m()}function h(y){s.value=y,m()}e.watch(()=>[o.instanceId,o.departmentId,o.extraParams],()=>{s.value=1,m()},{deep:!0}),e.onMounted(()=>{m(),o.showDepartments&&!u.loaded&&u.fetchDepartments()});function p(y){switch(y==null?void 0:y.toLowerCase()){case"marketing":return"Marketing";case"utility":return"Utilidade";case"authentication":return"Autenticação";default:return y??""}}function g(y){switch(y==null?void 0:y.toLowerCase()){case"pending":return"Pendente";case"approved":return"Aprovado";case"rejected":return"Reprovado";case"pending_deletion":return"Aguardando deleção";default:return y??""}}return n({refresh:m}),(y,k)=>{const B=e.resolveComponent("Popper");return e.openBlock(),e.createBlock(Aa,{columns:c.value,rows:r.value,loading:l.value,"total-items":i.value,"items-per-page":t.itemsPerPage,"current-page":s.value,filters:d.value,"empty-text":"Nenhum modelo de mensagem disponível","onUpdate:currentPage":h,"onUpdate:filters":f},e.createSlots({"empty-action":e.withCtx(()=>[e.renderSlot(y.$slots,"empty-action",{},void 0,!0)]),"cell-name":e.withCtx(({row:b})=>[e.createElementVNode("span",{title:b.name,class:"block truncate text-left max-w-64 whitespace-nowrap font-medium text-sm"},e.toDisplayString(b.name),9,tc)]),"cell-category":e.withCtx(({row:b})=>{var x,v,_,R;return[e.createElementVNode("div",ac,[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 font-semibold flex justify-center items-center min-w-19 lg:min-w-32 w-0 p-1.5 rounded-lg transition-colors",{"bg-sky-500/20 border border-sky-500/50 hover:border-sky-400 text-sky-400":((x=b.category)==null?void 0:x.toLowerCase())==="marketing","bg-purple-500/20 border dark:hover-text-purple-700 border-purple-500/50 hover:border-purple-400 text-purple-400":((v=b.category)==null?void 0:v.toLowerCase())==="utility"}])},[e.createElementVNode("div",oc,[((_=b.category)==null?void 0:_.toLowerCase())==="marketing"?(e.openBlock(),e.createElementBlock("svg",rc,[...k[0]||(k[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.458 3.11A1 1 0 0 1 19 4v16a1 1 0 0 1-1.581.814L12 16.944V7.056l5.419-3.87a1 1 0 0 1 1.039-.076ZM22 12c0 1.48-.804 2.773-2 3.465v-6.93c1.196.692 2 1.984 2 3.465ZM10 8H4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6V8Zm0 9H5v3a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-3Z","clip-rule":"evenodd"},null,-1)])])):((R=b.category)==null?void 0:R.toLowerCase())==="utility"?(e.openBlock(),e.createElementBlock("svg",lc,[...k[1]||(k[1]=[e.createElementVNode("path",{d:"M11.209 3.816a1 1 0 0 0-1.966.368l.325 1.74a5.338 5.338 0 0 0-2.8 5.762l.276 1.473.055.296c.258 1.374-.228 2.262-.63 2.998-.285.52-.527.964-.437 1.449.11.586.22 1.173.75 1.074l12.7-2.377c.528-.1.418-.685.308-1.27-.103-.564-.636-1.123-1.195-1.711-.606-.636-1.243-1.306-1.404-2.051-.233-1.085-.275-1.387-.303-1.587-.009-.063-.016-.117-.028-.182a5.338 5.338 0 0 0-5.353-4.39l-.298-1.592Z"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M6.539 4.278a1 1 0 0 1 .07 1.412c-1.115 1.23-1.705 2.605-1.83 4.26a1 1 0 0 1-1.995-.15c.16-2.099.929-3.893 2.342-5.453a1 1 0 0 1 1.413-.069Z","clip-rule":"evenodd"},null,-1),e.createElementVNode("path",{d:"M8.95 19.7c.7.8 1.7 1.3 2.8 1.3 1.6 0 2.9-1.1 3.3-2.5l-6.1 1.2Z"},null,-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",sc,e.toDisplayString(p(b.category)),1)],2)])]}),"cell-status":e.withCtx(({row:b})=>{var x,v,_,R,L,A,M,S;return[e.createElementVNode("div",ic,[e.createElementVNode("div",{class:e.normalizeClass([{"bg-orange-500/20 border border-orange-500 text-orange-300 dark:text-orange-500 hover:text-orange-200 hover:border-orange-200":((x=b.status)==null?void 0:x.toLowerCase())==="pending","bg-green-600/20 border border-green-600 dark:text-green-500 text-green-300 hover:text-green-200 hover:border-green-200":((v=b.status)==null?void 0:v.toLowerCase())==="approved","bg-red-500/20 border border-red-500 text-red-300 dark:text-red-500 hover:text-red-200 hover:border-red-200":((_=b.status)==null?void 0:_.toLowerCase())==="rejected"||((R=b.status)==null?void 0:R.toLowerCase())==="pending_deletion"},"p-1.5 rounded-lg font-semibold text-xs flex items-center justify-center gap-2 min-w-19 lg:min-w-28 w-0 transition-colors"])},[e.createElementVNode("div",cc,[((L=b.status)==null?void 0:L.toLowerCase())==="pending"?(e.openBlock(),e.createElementBlock("svg",dc,[...k[2]||(k[2]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3M3.22302 14C4.13247 18.008 7.71683 21 12 21c4.9706 0 9-4.0294 9-9 0-4.97056-4.0294-9-9-9-3.72916 0-6.92858 2.26806-8.29409 5.5M7 9H3V5"},null,-1)])])):((A=b.status)==null?void 0:A.toLowerCase())==="rejected"?(e.openBlock(),e.createElementBlock("svg",uc,[...k[3]||(k[3]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"m6 6 12 12m3-6a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)])])):((M=b.status)==null?void 0:M.toLowerCase())==="approved"?(e.openBlock(),e.createElementBlock("svg",mc,[...k[4]||(k[4]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.032 12 1.984 1.984 4.96-4.96m4.55 5.272.893-.893a1.984 1.984 0 0 0 0-2.806l-.893-.893a1.984 1.984 0 0 1-.581-1.403V7.04a1.984 1.984 0 0 0-1.984-1.984h-1.262a1.983 1.983 0 0 1-1.403-.581l-.893-.893a1.984 1.984 0 0 0-2.806 0l-.893.893a1.984 1.984 0 0 1-1.403.581H7.04A1.984 1.984 0 0 0 5.055 7.04v1.262c0 .527-.209 1.031-.581 1.403l-.893.893a1.984 1.984 0 0 0 0 2.806l.893.893c.372.372.581.876.581 1.403v1.262a1.984 1.984 0 0 0 1.984 1.984h1.262c.527 0 1.031.209 1.403.581l.893.893a1.984 1.984 0 0 0 2.806 0l.893-.893a1.985 1.985 0 0 1 1.403-.581h1.262a1.984 1.984 0 0 0 1.984-1.984V15.7c0-.527.209-1.031.581-1.403Z"},null,-1)])])):((S=b.status)==null?void 0:S.toLowerCase())==="pending_deletion"?(e.openBlock(),e.createElementBlock("svg",fc,[...k[5]||(k[5]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"},null,-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",pc,e.toDisplayString(g(b.status)),1)],2)])]}),"cell-actions":e.withCtx(({row:b})=>{var x,v;return[e.createElementVNode("main",wc,[e.createVNode(B,{placement:"left",class:"preview-popper"},{content:e.withCtx(()=>[e.createElementVNode("div",Ec,[e.createElementVNode("div",Cc,[e.createElementVNode("p",Bc,e.toDisplayString(b.name),1)]),e.renderSlot(y.$slots,"preview",{template:b},()=>[k[8]||(k[8]=e.createElementVNode("span",{class:"block p-4 text-xs text-gray-400 text-center"}," Sem pré-visualização disponível ",-1))],!0)])]),default:e.withCtx(()=>[k[9]||(k[9]=e.createElementVNode("button",{class:"group action-btn action-btn-info"},[e.createElementVNode("svg",{class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{d:"M10 12a2 2 0 100-4 2 2 0 000 4z"}),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z","clip-rule":"evenodd"})]),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Pré-visualizar")],-1))]),_:2},1024),t.mode==="send"?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:((x=b.status)==null?void 0:x.toLowerCase())!=="approved",class:e.normalizeClass(["action-btn group",((v=b.status)==null?void 0:v.toLowerCase())==="approved"?"action-btn-success":"action-btn-danger"]),onClick:_=>y.$emit("send",b)},[...k[10]||(k[10]=[e.createElementVNode("svg",{class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 14 16"},[e.createElementVNode("path",{d:"M0 .984v14.032a1 1 0 0 0 1.506.845l12.006-7.016a.974.974 0 0 0 0-1.69L1.506.139A1 1 0 0 0 0 .984Z"})],-1),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Enviar modelo",-1)])],10,vc)):e.createCommentVNode("",!0),t.mode==="manage"?(e.openBlock(),e.createElementBlock("button",{key:1,class:"group action-btn action-btn-success",onClick:_=>y.$emit("edit",b)},[...k[11]||(k[11]=[e.createElementVNode("svg",{class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"})],-1),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Editar Template",-1)])],8,Vc)):e.createCommentVNode("",!0),t.mode==="manage"?(e.openBlock(),e.createElementBlock("button",{key:2,class:"group action-btn action-btn-danger",onClick:_=>y.$emit("delete",b)},[...k[12]||(k[12]=[e.createElementVNode("svg",{class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},[e.createElementVNode("path",{d:"M0 0h24v24H0V0z",fill:"none"}),e.createElementVNode("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5l-1-1h-5l-1 1H5v2h14V4z"})],-1),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Excluir",-1)])],8,Sc)):e.createCommentVNode("",!0),t.mode==="manage"?(e.openBlock(),e.createElementBlock("button",{key:3,class:"group action-btn action-btn-info",onClick:_=>y.$emit("copy-id",b)},[...k[13]||(k[13]=[e.createElementVNode("svg",{class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7 9v6a4 4 0 0 0 4 4h4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1v2Z","clip-rule":"evenodd"}),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 3.054V7H9.2a2 2 0 0 1 .281-.432l2.46-2.87A2 2 0 0 1 13 3.054ZM15 3v4a2 2 0 0 1-2 2H9v6a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-3Z","clip-rule":"evenodd"})],-1),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Copiar ID",-1)])],8,Nc)):e.createCommentVNode("",!0)]),e.renderSlot(y.$slots,"extra-actions",{template:b},void 0,!0)]}),_:2},[t.showLang?{name:"cell-lang",fn:e.withCtx(({row:b})=>[e.createElementVNode("span",nc,e.toDisplayString(b.lang),1)]),key:"0"}:void 0,t.showDepartments?{name:"cell-department",fn:e.withCtx(({row:b})=>[e.createVNode(B,{placement:"top",arrow:!1,class:"tip-popper"},{content:e.withCtx(()=>{var x;return[e.createElementVNode("section",hc,[k[6]||(k[6]=e.createElementVNode("div",{class:"text-sm font-semibold text-slate-100 pb-2"}," Departamentos ",-1)),((x=b.department)==null?void 0:x.length)>0?(e.openBlock(),e.createElementBlock("div",gc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.department,v=>(e.openBlock(),e.createElementBlock("div",{key:v.id,class:"bg-slate-800/80 rounded-lg p-2 border border-slate-700/50 hover:border-blue-500/30 transition-all"},[e.createElementVNode("span",yc,e.toDisplayString(v.name),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",kc," Sem departamentos vinculados "))])]}),default:e.withCtx(()=>{var x;return[e.createElementVNode("div",bc,[k[7]||(k[7]=e.createElementVNode("svg",{class:"size-5 text-blue-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4 4a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2v14a1 1 0 1 1 0 2H5a1 1 0 1 1 0-2V5a1 1 0 0 1-1-1Zm5 2a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H9Zm5 0a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-1Zm-5 4a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1H9Zm5 0a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1h-1Zm-3 4a2 2 0 0 0-2 2v3h2v-3h2v3h2v-3a2 2 0 0 0-2-2h-2Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("span",xc,e.toDisplayString((x=b.department)==null?void 0:x.length),1)])]}),_:2},1024)]),key:"1"}:void 0]),1032,["columns","rows","loading","total-items","items-per-page","current-page","filters"])}}},[["__scopeId","data-v-96c4b4b8"]]);function Mc(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Tr(t){return typeof t=="function"?t():e.unref(t)}const Lr=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ac=Object.prototype.toString,$c=t=>Ac.call(t)==="[object Object]",Zn=()=>{},_c=Dc();function Dc(){var t,n;return Lr&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Cn(t){var n;const a=Tr(t);return(n=a==null?void 0:a.$el)!=null?n:a}const Fr=Lr?window:void 0;function qa(...t){let n,a,o,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([a,o,r]=t,n=Fr):[n,a,o,r]=t,!n)return Zn;Array.isArray(a)||(a=[a]),Array.isArray(o)||(o=[o]);const l=[],s=()=>{l.forEach(c=>c()),l.length=0},i=(c,m,f,h)=>(c.addEventListener(m,f,h),()=>c.removeEventListener(m,f,h)),d=e.watch(()=>[Cn(n),Tr(r)],([c,m])=>{if(s(),!c)return;const f=$c(m)?{...m}:m;l.push(...a.flatMap(h=>o.map(p=>i(c,h,p,f))))},{immediate:!0,flush:"post"}),u=()=>{d(),s()};return Mc(u),u}let Pr=!1;function Yn(t,n,a={}){const{window:o=Fr,ignore:r=[],capture:l=!0,detectIframe:s=!1}=a;if(!o)return Zn;_c&&!Pr&&(Pr=!0,Array.from(o.document.body.children).forEach(f=>f.addEventListener("click",Zn)),o.document.documentElement.addEventListener("click",Zn));let i=!0;const d=f=>r.some(h=>{if(typeof h=="string")return Array.from(o.document.querySelectorAll(h)).some(p=>p===f.target||f.composedPath().includes(p));{const p=Cn(h);return p&&(f.target===p||f.composedPath().includes(p))}}),c=[qa(o,"click",f=>{const h=Cn(t);if(!(!h||h===f.target||f.composedPath().includes(h))){if(f.detail===0&&(i=!d(f)),!i){i=!0;return}n(f)}},{passive:!0,capture:l}),qa(o,"pointerdown",f=>{const h=Cn(t);i=!d(f)&&!!(h&&!f.composedPath().includes(h))},{passive:!0}),s&&qa(o,"blur",f=>{setTimeout(()=>{var h;const p=Cn(t);((h=o.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(o.document.activeElement))&&n(f)},0)})].filter(Boolean);return()=>c.forEach(f=>f())}const Tc={class:"line-clamp-2 uppercase text-xs truncate text-white"},Lc={key:0,class:"select_widget_lib"},zr=ke({__name:"primary_select",props:{config:{type:Object,default:{title:"select_primary"}}},emits:["closeSelect"],setup(t,{emit:n}){const a=t,o=e.ref(!1),r=e.ref(null);e.computed(()=>a.selectConfig.some(i=>i.freeSlot));const l=()=>{o.value=!o.value};return Yn(r,()=>{o.value&&(o.value=!1)}),(i,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"target",ref:r,class:"relative w-full"},[e.createElementVNode("button",{onClick:l,class:"bg-base-100 z-10 truncate flex items-center justify-between gap-6 p-2 rounded-md lg:mt-0 w-full shadow-md shadow-base-300"},[e.createElementVNode("div",null,[e.createElementVNode("p",Tc,e.toDisplayString(t.config.title),1)]),e.createElementVNode("div",null,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([o.value?"rotate-180 transition-transform ease-in-out":"","w-3 h-3 text-white"]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...d[0]||(d[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.4 10.3A2 2 0 0 0 17 7H7a2 2 0 0 0-1.5 3.3l4.9 5.9a2 2 0 0 0 3 0l5-6Z","clip-rule":"evenodd"},null,-1)])],2))])]),o.value?(e.openBlock(),e.createElementBlock("section",Lc,[e.createElementVNode("div",null,[e.renderSlot(i.$slots,"free-slot",{},void 0,!0)])])):e.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-265f04f1"]]),Fc={key:0,class:"modal_head"},Pc={class:"modal_responsive"},zc={class:"flex min-h-full items-center justify-center text-center sm:p-0"},Oc={class:"modal_tittle text-current bg-base-300 border-base-100"},Rc={class:"flex items-center w-full"},Hc=["innerHTML"],jc={class:"text-xl ml-1 font-semibold flex items-center gap-2"},Gc={class:"bg-base-200"},Ic={class:"text-center"},qc={class:"modal_end_button border-base-100 bg-base-300"},Or=ke({__name:"simple_modal",props:{isOpen:{type:Boolean,default:!1},header:{type:Object,default:{title:"title",svg:"<svg class='w-5 mr-2 text-teal-500 inline-block' aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'> <path d='M18 3h-5.7a2 2 0 0 0-1.4.6L3.6 11a2 2 0 0 0 0 2.8l6.6 6.6a2 2 0 0 0 2.8 0l7.4-7.5a2 2 0 0 0 .6-1.4V6a3 3 0 0 0-3-3Zm-2.4 6.4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z' /> </svg>"}},size:{type:String,default:"md:w-1/2 xl:w-1/3"}},emits:["update:isOpen","close"],setup(t,{emit:n}){e.useSlots();const a=t,o=n,r=()=>{o("update:isOpen",!a.isOpen),a.isOpen&&o("close")};return(l,s)=>(e.openBlock(),e.createBlock(e.Transition,{"leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0","enter-active-class":"transition-opacity duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100"},{default:e.withCtx(()=>{var i,d;return[t.isOpen?(e.openBlock(),e.createElementBlock("div",Fc,[s[2]||(s[2]=e.createElementVNode("div",{class:"modal-overlay absolute h-full w-full bg-gray-600 opacity-50"},null,-1)),e.createElementVNode("div",Pc,[e.createElementVNode("div",zc,[e.createElementVNode("div",{class:e.normalizeClass([t.size,"z-50 w-full shadow rounded-2xl shadow-black"])},[e.createElementVNode("div",Oc,[e.createElementVNode("section",Rc,[l.$slots.header?e.renderSlot(l.$slots,"header",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{innerHTML:(i=t.header)==null?void 0:i.svg},null,8,Hc),e.createElementVNode("h3",jc,e.toDisplayString((d=t.header)==null?void 0:d.title),1)],64))]),e.createElementVNode("button",{onClick:s[0]||(s[0]=u=>r()),class:"modal_close_button bg-base-200/40"},[...s[1]||(s[1]=[e.createElementVNode("svg",{class:"size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])])]),e.createElementVNode("div",Gc,[e.createElementVNode("div",Ic,[e.renderSlot(l.$slots,"body",{},void 0,!0)])]),e.createElementVNode("div",qc,[e.renderSlot(l.$slots,"footer",{},void 0,!0)])],2)])])])):e.createCommentVNode("",!0)]}),_:3}))}},[["__scopeId","data-v-7d2f29fd"]]),Wc={class:"simple_card_header"},Uc={key:0,class:"simple_card_icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},Zc={key:1,class:"simple_card_icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},Yc={key:2,class:"simple_card_icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},Xc={key:3,class:"simple_card_icon","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 23 23"},Qc={class:"simple_card_title"},Kc={class:"simple_card_descripiton"},Rr={__name:"simple_card",props:{content:{type:Object,default:{title:"Title",description:"Coloque aqui a descrição"}},typeCard:{type:String,default:"default"}},setup(t){const n=t,a=e.computed(()=>({simple_card_success:n.typeCard==="success",simple_card_info:n.typeCard==="info",simple_card_alert:n.typeCard==="alert",simple_card_error:n.typeCard==="error"}));return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.value,"simple_card"])},[e.createElementVNode("div",Wc,[t.typeCard==="success"?(e.openBlock(),e.createElementBlock("svg",Uc,[...r[0]||(r[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.25 10C0.25 4.61522 4.61522 0.25 10 0.25C15.3848 0.25 19.75 4.61522 19.75 10C19.75 15.3848 15.3848 19.75 10 19.75C4.61522 19.75 0.25 15.3848 0.25 10ZM13.6103 8.18593C13.8511 7.84887 13.773 7.38046 13.4359 7.1397C13.0989 6.89894 12.6305 6.97701 12.3897 7.31407L9.1543 11.8436L7.53033 10.2197C7.23744 9.92678 6.76256 9.92678 6.46967 10.2197C6.17678 10.5126 6.17678 10.9874 6.46967 11.2803L8.71967 13.5303C8.87556 13.6862 9.09215 13.7656 9.31186 13.7474C9.53157 13.7293 9.73216 13.6153 9.8603 13.4359L13.6103 8.18593Z",fill:"currentColor"},null,-1)])])):e.createCommentVNode("",!0),t.typeCard==="info"?(e.openBlock(),e.createElementBlock("svg",Zc,[...r[1]||(r[1]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.25 10C0.25 4.61522 4.61522 0.25 10 0.25C15.3848 0.25 19.75 4.61522 19.75 10C19.75 15.3848 15.3848 19.75 10 19.75C4.61522 19.75 0.25 15.3848 0.25 10ZM10 6.25C10.4142 6.25 10.75 6.58579 10.75 7V10.75C10.75 11.1642 10.4142 11.5 10 11.5C9.58579 11.5 9.25 11.1642 9.25 10.75V7C9.25 6.58579 9.58579 6.25 10 6.25ZM10 14.5C10.4142 14.5 10.75 14.1642 10.75 13.75C10.75 13.3358 10.4142 13 10 13C9.58579 13 9.25 13.3358 9.25 13.75C9.25 14.1642 9.58579 14.5 10 14.5Z",fill:"currentColor"},null,-1)])])):e.createCommentVNode("",!0),t.typeCard==="alert"?(e.openBlock(),e.createElementBlock("svg",Yc,[...r[2]||(r[2]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.40123 2.0034C9.55572 0.0022862 12.4439 0.0022856 13.5983 2.0034L20.9527 14.7509C22.1065 16.7509 20.6631 19.2501 18.3541 19.2501H3.64546C1.33649 19.2501 -0.106939 16.7509 1.04691 14.7509L8.40123 2.0034ZM11 7.25C11.4142 7.25 11.75 7.58579 11.75 8V11.75C11.75 12.1642 11.4142 12.5 11 12.5C10.5858 12.5 10.25 12.1642 10.25 11.75V8C10.25 7.58579 10.5858 7.25 11 7.25ZM11 15.5C11.4142 15.5 11.75 15.1642 11.75 14.75C11.75 14.3358 11.4142 14 11 14C10.5858 14 10.25 14.3358 10.25 14.75C10.25 15.1642 10.5858 15.5 11 15.5Z",fill:"currentColor"},null,-1)])])):e.createCommentVNode("",!0),t.typeCard==="error"?(e.openBlock(),e.createElementBlock("svg",Xc,[...r[3]||(r[3]=[e.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 12Zm7.707-3.707a1 1 0 0 0-1.414 1.414L10.586 12l-2.293 2.293a1 1 0 1 0 1.414 1.414L12 13.414l2.293 2.293a1 1 0 0 0 1.414-1.414L13.414 12l2.293-2.293a1 1 0 0 0-1.414-1.414L12 10.586 9.707 8.293Z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",Qc,e.toDisplayString(t.content.title),1)]),e.createElementVNode("section",Kc,[e.createElementVNode("p",null,e.toDisplayString(t.content.description),1)])],2))}},Xn=jt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(t=""){try{let n=`${U0}`;const a=await Pe.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(t){this.instances=this.instances.filter(n=>n.id!==t),this.count=this.instances.length},addInstance(t){const n=this.instances.findIndex(a=>a.id===t.id);n!==-1?this.instances[n]=t:this.instances.push(t),this.count=this.instances.length}}}),Jc={class:"w-full relative text-current"},e2={class:"flex cursor-pointer justify-between items-center"},t2={key:0},n2={key:0},a2={key:1,class:"flex items-center gap-2"},o2={class:"flex gap-3 items-center flex-shrink-0"},r2={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},l2={key:1,xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5",viewBox:"0 0 16 16"},s2={key:2,class:"relative"},i2={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"},c2={class:"my-auto text-center mx-auto group-hover:inline-block"},d2={key:1,class:"flex justify-center"},u2={class:"w-full"},m2={key:1,class:"flex items-center gap-2 justify-center"},f2={class:"flex px-4 items-center gap-2"},p2={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},h2={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"},g2={class:"select-none cursor-pointer w-full"},y2=["onClick","disabled"],k2={class:"flex w-full items-center pl-2 gap-3"},b2={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"},x2={key:1,xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4 flex-shrink-0",viewBox:"0 0 16 16"},w2={key:2,class:"relative"},E2={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},C2={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"},B2={class:"w-full text-center"},v2={class:"my-auto text-center mx-auto group-hover:inline-block"},V2={key:1,class:"flex justify-center"},S2={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},N2={key:1,class:"p-4"},Hr=ke({__name:"index",props:{modelValue:{type:Object,default:null},type:{type:String},webhooks:{type:Boolean,default:void 0},instance_deny_list:{type:Array,default:()=>[]}},emits:["update:modelValue","function","component-mounted"],setup(t,{emit:n}){const a=Xn(),o=e.ref(!1),r=e.ref(null),l=t,s=n;function i(u){r.value=u,s("function",u)}e.watch(()=>l.modelValue,u=>{r.value=u},{immediate:!0}),e.watch(r,u=>{s("update:modelValue",u)}),e.onMounted(async()=>{if(r.value){const u=a.instances.find(c=>c.id===r.value.id);u&&(r.value.status=u.status)}s("component-mounted")});const d=e.computed(()=>a.instances.filter(u=>!l.instance_deny_list.includes(u.id)));return(u,c)=>{const m=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("main",Jc,[e.createElementVNode("div",{class:e.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"])},[e.createElementVNode("div",e2,[e.createElementVNode("p",{onClick:c[0]||(c[0]=f=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[e.unref(a).loaded?(e.openBlock(),e.createElementBlock("div",t2,[r.value?(e.openBlock(),e.createElementBlock("span",a2,[e.createElementVNode("header",o2,[r.value.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",r2,[...c[3]||(c[3]=[e.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==="instagram"?(e.openBlock(),e.createElementBlock("svg",l2,[...c[4]||(c[4]=[e.createStaticVNode('<defs data-v-ad0e7c90><linearGradient id="instagram-gradient" x1="0%" y1="100%" x2="100%" y2="0%" data-v-ad0e7c90><stop offset="0%" style="stop-color:#FD5949;stop-opacity:1;" data-v-ad0e7c90></stop><stop offset="50%" style="stop-color:#D6249F;stop-opacity:1;" data-v-ad0e7c90></stop><stop offset="100%" style="stop-color:#285AEB;stop-opacity:1;" data-v-ad0e7c90></stop></linearGradient></defs><path fill="url(#instagram-gradient)" d="M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.917 3.917 0 0 0-1.417.923A3.927 3.927 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.916 3.916 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.926 3.926 0 0 0-.923-1.417A3.911 3.911 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0h.003zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599.28.28.453.546.598.92.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.47 2.47 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.478 2.478 0 0 1-.92-.598 2.48 2.48 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233 0-2.136.008-2.388.046-3.231.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045v.002zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92zm-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217zm0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334z" data-v-ad0e7c90></path>',2)])])):r.value.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",s2,[c[6]||(c[6]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},[e.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)),(e.openBlock(),e.createElementBlock("svg",i2,[...c[5]||(c[5]=[e.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)])]))])):e.createCommentVNode("",!0),r.value&&r.value.status!==void 0?(e.openBlock(),e.createBlock(m,{key:3,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("main",{class:e.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"}])},[e.createElementVNode("div",c2,e.toDisplayString(r.value.status===!0?"Conectada":r.value.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[r.value.isLoading?(e.openBlock(),e.createElementBlock("div",d2,[...c[7]||(c[7]=[e.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.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})):e.createCommentVNode("",!0)]),e.createElementVNode("div",u2,e.toDisplayString(r.value.name),1)])):(e.openBlock(),e.createElementBlock("span",n2,e.toDisplayString(d.value?d.value.length:"Sem")+" Instâncias disponíveis",1))])):(e.openBlock(),e.createElementBlock("div",m2,[...c[8]||(c[8]=[e.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"},[e.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"}),e.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),e.createTextVNode("Inicializando instâncias...",-1)])]))]),e.createElementVNode("footer",f2,[e.createElementVNode("button",{onClick:c[1]||(c[1]=f=>(r.value=null,o.value=!1))},[...c[9]||(c[9]=[e.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"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])]),e.createElementVNode("button",{onClick:c[2]||(c[2]=f=>o.value=!o.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.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"},[...c[10]||(c[10]=[e.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?(e.openBlock(),e.createElementBlock("nav",p2,[e.createElementVNode("ul",h2,[d.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(d.value,(f,h)=>{var p;return e.openBlock(),e.createElementBlock("li",g2,[e.createElementVNode("button",{class:e.normalizeClass([r.value&&r.value.id===f.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:g=>(r.value=f,o.value=!1,i(f)),disabled:r.value&&r.value.id===f.id||t.type&&f.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((p=f.config)==null?void 0:p.webhooks)},[e.createElementVNode("div",k2,[f.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",b2,[...c[11]||(c[11]=[e.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)])])):f.type==="instagram"?(e.openBlock(),e.createElementBlock("svg",x2,[...c[12]||(c[12]=[e.createStaticVNode('<defs data-v-ad0e7c90><linearGradient id="instagram-gradient" x1="0%" y1="100%" x2="100%" y2="0%" data-v-ad0e7c90><stop offset="0%" style="stop-color:#FD5949;stop-opacity:1;" data-v-ad0e7c90></stop><stop offset="50%" style="stop-color:#D6249F;stop-opacity:1;" data-v-ad0e7c90></stop><stop offset="100%" style="stop-color:#285AEB;stop-opacity:1;" data-v-ad0e7c90></stop></linearGradient></defs><path fill="url(#instagram-gradient)" d="M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.917 3.917 0 0 0-1.417.923A3.927 3.927 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.916 3.916 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.926 3.926 0 0 0-.923-1.417A3.911 3.911 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0h.003zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599.28.28.453.546.598.92.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.47 2.47 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.478 2.478 0 0 1-.92-.598 2.48 2.48 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233 0-2.136.008-2.388.046-3.231.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045v.002zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92zm-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217zm0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334z" data-v-ad0e7c90></path>',2)])])):f.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",w2,[c[14]||(c[14]=e.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"},[e.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)),(e.openBlock(),e.createElementBlock("svg",E2,[...c[13]||(c[13]=[e.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)])]))])):e.createCommentVNode("",!0),e.createVNode(m,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.type&&f.type!==t.type?"Não é possível utilizar esse tipo de Instância neste recurso":t.webhooks===!0?"Essa instância está com o Atendimento desabilitado":"Essa aplicação é somente para instâncias sem atendimento habilitado."),1)]),default:e.withCtx(()=>{var g;return[t.type&&f.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((g=f.config)==null?void 0:g.webhooks)?(e.openBlock(),e.createElementBlock("svg",C2,[...c[15]||(c[15]=[e.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)])])):e.createCommentVNode("",!0)]}),_:2},1024),e.createElementVNode("p",B2,e.toDisplayString(f.name),1),e.createVNode(m,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("main",{class:e.normalizeClass(["p-1 rounded px-3",{"bg-red-500":f.status===!1,"bg-green-500":f.status===!0,"bg-purple-500":f.status==="Offline"}])},[e.createElementVNode("div",v2,e.toDisplayString(f.status===!0?"Conectada":f.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[f.isLoading?(e.openBlock(),e.createElementBlock("div",V2,[...c[16]||(c[16]=[e.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{"bg-red-500":f.status===!1,"bg-green-500":f.status===!0,"bg-purple-500":f.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)]),e.createElementVNode("div",S2,[f.telephone?(e.openBlock(),e.createBlock(m,{key:0,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(f.telephone?`${f.telephone}`:""),1)]),default:e.withCtx(()=>[c[17]||(c[17]=e.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"},[e.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},1024)):e.createCommentVNode("",!0)])],10,y2)])}),256)):(e.openBlock(),e.createElementBlock("div",N2," Sem instâncias disponíveis"))])])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-ad0e7c90"]]),M2={class:"truncate text-primary"},A2={class:"flex items-center gap-2"},$2=["title"],_2=["innerHTML"],D2={key:0,class:"select-popover bg-base-300 w-full min-w-full left-0",style:{position:"absolute"}},T2={class:"select-list"},L2=["onClick"],F2={type:"button",class:"item-click"},P2={class:"item-label"},z2=["onClick","title"],O2=["innerHTML"],R2={key:0,class:"empty"},jr=ke({__name:"soundSelect",props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},labelFn:{type:Function,required:!0},previewKeyPrefix:{type:String,required:!0},tone:{type:String,default:"sky"},playingKey:{type:String,default:null}},emits:["update:modelValue","preview"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(null),s=e.computed(()=>a.modelValue?a.labelFn(a.modelValue):"Selecionar…"),i={sky:{"--tone-color":"#38bdf8","--tone-ring":"rgba(56, 189, 248, 0.35)","--tone-grad1":"rgba(56, 189, 248, 0.14)","--tone-grad2":"rgba(59, 130, 246, 0.08)"},emerald:{"--tone-color":"#34d399","--tone-ring":"rgba(52, 211, 153, 0.35)","--tone-grad1":"rgba(16, 185, 129, 0.14)","--tone-grad2":"rgba(5, 150, 105, 0.08)"},violet:{"--tone-color":"#a78bfa","--tone-ring":"rgba(167, 139, 250, 0.35)","--tone-grad1":"rgba(139, 92, 246, 0.14)","--tone-grad2":"rgba(124, 58, 237, 0.08)"},amber:{"--tone-color":"#fbbf24","--tone-ring":"rgba(251, 191, 36, 0.35)","--tone-grad1":"rgba(245, 158, 11, 0.14)","--tone-grad2":"rgba(217, 119, 6, 0.08)"},rose:{"--tone-color":"#fb7185","--tone-ring":"rgba(251, 113, 133, 0.35)","--tone-grad1":"rgba(244, 63, 94, 0.14)","--tone-grad2":"rgba(225, 29, 72, 0.08)"}},d=e.computed(()=>i[a.tone]||i.sky);function u(){r.value=!r.value}function c(y){o("update:modelValue",y),r.value=!1}function m(y){o("preview",y,`${a.previewKeyPrefix}${y}`)}const f=y=>a.playingKey===`${a.previewKeyPrefix}${y}`,h=e.computed(()=>a.modelValue?f(a.modelValue):!1);function p(y){y.stopPropagation(),a.modelValue&&m(a.modelValue)}function g(y){l.value&&!l.value.contains(y.target)&&(r.value=!1)}return e.onMounted(()=>document.addEventListener("click",g)),e.onBeforeUnmount(()=>document.removeEventListener("click",g)),(y,k)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"root",ref:l,class:"relative soundselect",style:e.normalizeStyle(d.value)},[e.createElementVNode("button",{type:"button",class:"select-head",onClick:u},[e.createElementVNode("span",M2,e.toDisplayString(s.value),1),e.createElementVNode("div",A2,[t.modelValue?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["head-playbtn text-primary",{playing:h.value}]),title:h.value?"Pausar":"Ouvir",onClick:e.withModifiers(p,["stop"])},[e.createElementVNode("span",{innerHTML:h.value?'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="currentColor"><path d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>'},null,8,_2)],10,$2)):e.createCommentVNode("",!0),k[0]||(k[0]=e.createElementVNode("span",{class:"chev"},[e.createElementVNode("svg",{class:"size-5 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 10 4 4 4-4"})])],-1))])]),e.createVNode(e.Transition,{name:"fade-scale"},{default:e.withCtx(()=>{var B;return[r.value?(e.openBlock(),e.createElementBlock("div",D2,[e.createElementVNode("div",T2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,b=>(e.openBlock(),e.createElementBlock("div",{key:b,class:e.normalizeClass(["select-item text-start cursor-pointer",{"is-selected":t.modelValue===b}]),onClick:x=>c(b)},[e.createElementVNode("button",F2,[e.createElementVNode("span",{class:e.normalizeClass(["radio-dot",t.modelValue===b?"on":""])},null,2),e.createElementVNode("span",P2,e.toDisplayString(t.labelFn(b)),1)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["playbtn",{playing:f(b)}]),onClick:e.withModifiers(x=>m(b),["stop"]),title:f(b)?"Pausar":"Ouvir"},[e.createElementVNode("span",{innerHTML:f(b)?'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="currentColor"><path d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>'},null,8,O2)],10,z2)],10,L2))),128)),(B=t.options)!=null&&B.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",R2,"Sem opções"))])])):e.createCommentVNode("",!0)]}),_:1})],4))}},[["__scopeId","data-v-2bf658f7"]]),H2=["aria-labelledby","aria-describedby"],j2={class:"cpk-popover__header border-base-100"},G2=["id"],I2=["disabled"],q2=["id"],W2={class:"cpk-popover__details bg-base-200 border border-base-100"},U2={class:"cpk-popover__footer"},Z2=["disabled"],Y2=["disabled"],X2={key:0,class:"loading-spinner"},Q2=ke({__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(t,{emit:n}){const a=t,o=n,r=e.computed({get:()=>a.modelValue,set:x=>o("update:modelValue",x)}),l=e.ref(null),s=e.ref({left:0,top:0,p:"bottom"}),i={title:`cpk-popover-title-${Math.random().toString(36).slice(2)}`,desc:`cpk-popover-desc-${Math.random().toString(36).slice(2)}`};function d(){o("cancel",a.context),r.value=!1}function u(){a.loading||o("confirm",a.context)}let c,m,f=[];function h(){if(a.anchorRect)return a.anchorRect;const x=a.anchorEl instanceof Element?a.anchorEl:null;if(x)return x.getBoundingClientRect();const v=document.activeElement instanceof Element?document.activeElement:null;return v?v.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 p(){if(!r.value)return;const x=window.innerWidth,v=window.innerHeight,_=a.viewportPadding,R=h(),L=l.value?l.value.getBoundingClientRect():{width:320,height:200},A=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let M=A[0],S=0,N=0;const w=R.left+R.width/2-L.width/2,C=R.top+R.height/2-L.height/2,O=R.left,T=R.left+R.width-L.width,V=R.top,E=R.top+R.height-L.height;for(const $ of A){if($==="bottom"&&(N=R.bottom+a.offset,S=a.align==="start"?O:a.align==="end"?T:w,N+L.height+_<=v)){M="bottom";break}if($==="top"&&(N=R.top-L.height-a.offset,S=a.align==="start"?O:a.align==="end"?T:w,N>=_)){M="top";break}if($==="right"&&(S=R.right+a.offset,N=a.align==="start"?V:a.align==="end"?E:C,S+L.width+_<=x)){M="right";break}if($==="left"&&(S=R.left-L.width-a.offset,N=a.align==="start"?V:a.align==="end"?E:C,S>=_)){M="left";break}}S=Math.min(Math.max(_,S),x-L.width-_),N=Math.min(Math.max(_,N),v-L.height-_),s.value={left:S,top:N,p:M}}function g(){y();let v=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;v&&v!==document.body;)f.push(v),v=v.parentElement;f.push(window),f.forEach(_=>_.addEventListener("scroll",p,{passive:!0}))}function y(){f.forEach(x=>{var v;return(v=x.removeEventListener)==null?void 0:v.call(x,"scroll",p)}),f=[]}e.watch(()=>r.value,async x=>{var v;if(x){await e.nextTick(),p(),g(),c=new ResizeObserver(p),c.observe(document.body);const _=a.anchorEl instanceof Element?a.anchorEl:null;_&&((v=m==null?void 0:m.disconnect)==null||v.call(m),m=new ResizeObserver(p),m.observe(_)),window.addEventListener("resize",p),window.addEventListener("keydown",k)}else B()}),e.watch(()=>a.anchorEl,async x=>{var _;if(!r.value)return;await e.nextTick(),y(),g(),(_=m==null?void 0:m.disconnect)==null||_.call(m);const v=x instanceof Element?x:null;v&&(m=new ResizeObserver(p),m.observe(v)),p()}),e.watch(()=>a.anchorRect,()=>{r.value&&p()}),e.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&p()});function k(x){x.key==="Escape"&&d(),x.key==="Enter"&&u()}e.onMounted(()=>{window.addEventListener("mousemove",x=>{window.__lastMouseX=x.clientX,window.__lastMouseY=x.clientY},{passive:!0})}),e.onBeforeUnmount(B);function B(){y(),window.removeEventListener("resize",p),window.removeEventListener("keydown",k),c&&c.disconnect(),m&&m.disconnect()}const b=e.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(x,v)=>(e.openBlock(),e.createBlock(e.Transition,{name:"cpk-layer",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:e.withModifiers(d,["self"])},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:l,class:e.normalizeClass(["cpk-popover bg-base-300",[{"is-loading":t.loading,"is-danger":t.destructive}]]),style:e.normalizeStyle(b.value),role:"dialog","aria-modal":"false","aria-labelledby":i.title,"aria-describedby":i.desc},[e.createElementVNode("div",j2,[v[0]||(v[0]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"!",-1)),e.createElementVNode("h3",{class:"cpk-popover__title",id:i.title},e.toDisplayString(t.title),9,G2),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:d,disabled:t.loading,"aria-label":"Fechar"}," × ",8,I2)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:i.desc},e.toDisplayString(t.description),9,q2)):e.createCommentVNode("",!0),e.createElementVNode("div",W2,[e.renderSlot(x.$slots,"details",{},void 0,!0)]),e.createElementVNode("div",U2,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:d,disabled:t.loading},e.toDisplayString(t.cancelLabel),9,Z2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button","cyber-button--md",t.destructive?"cyber-button--danger":"cyber-button--accent"]),onClick:u,disabled:t.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",X2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.loading?t.loadingLabel:t.confirmLabel),1)],10,Y2)])],14,H2)]),_:3})],32)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-b23001fc"]]);function K2(t){return{all:t=t||new Map,on:function(n,a){var o=t.get(n);o?o.push(a):t.set(n,[a])},off:function(n,a){var o=t.get(n);o&&(a?o.splice(o.indexOf(a)>>>0,1):t.set(n,[]))},emit:function(n,a){var o=t.get(n);o&&o.slice().map(function(r){r(a)}),(o=t.get("*"))&&o.slice().map(function(r){r(n,a)})}}}const Gr=K2();let Ir=0;const J2=()=>{const t=Ir;return Ir+=1,t},At=(t,n)=>{const a={...t,id:J2(),group:t.group||""};return Gr.emit("notify",{notification:a,timeout:n}),()=>Gr.emit("close",a.id)};function cn(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}function xt(t){return(n,a)=>{const o=a!=null&&a.context?String(a.context):"standalone";let r;if(o==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,i=a!=null&&a.width?String(a.width):s;r=t.formattingValues[i]||t.formattingValues[s]}else{const s=t.defaultWidth,i=a!=null&&a.width?String(a.width):t.defaultWidth;r=t.values[i]||t.values[s]}const l=t.argumentCallback?t.argumentCallback(n):n;return r[l]}}function wt(t){return(n,a={})=>{const o=a.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],l=n.match(r);if(!l)return null;const s=l[0],i=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(i)?td(i,m=>m.test(s)):ed(i,m=>m.test(s));let u;u=t.valueCallback?t.valueCallback(d):d,u=a.valueCallback?a.valueCallback(u):u;const c=n.slice(s.length);return{value:u,rest:c}}}function ed(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function td(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function qr(t){return(n,a={})=>{const o=n.match(t.matchPattern);if(!o)return null;const r=o[0],l=n.match(t.parsePattern);if(!l)return null;let s=t.valueCallback?t.valueCallback(l[0]):l[0];s=a.valueCallback?a.valueCallback(s):s;const i=n.slice(r.length);return{value:s,rest:i}}}const Wr=6048e5,nd=864e5,Ur=Symbol.for("constructDateFrom");function ut(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Ur in t?t[Ur](n):t instanceof Date?new t.constructor(n):new Date(n)}function Wa(t,...n){const a=ut.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let ad={};function Qn(){return ad}function ft(t,n){return ut(n||t,t)}function Zt(t,n){var i,d,u,c;const a=Qn(),o=(n==null?void 0:n.weekStartsOn)??((d=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:d.weekStartsOn)??a.weekStartsOn??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,r=ft(t,n==null?void 0:n.in),l=r.getDay(),s=(l<o?7:0)+l-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function od(t,n,a){const[o,r]=Wa(a==null?void 0:a.in,t,n);return+Zt(o,a)==+Zt(r,a)}const rd={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"}},ld=(t,n,a)=>{let o;const r=rd[t];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},sd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},id=(t,n,a,o)=>sd[t],cd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},dd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ud={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"]},md={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"]},fd={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"}},pd={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"}},hd={ordinalNumber:(t,n)=>{const a=Number(t),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:xt({values:cd,defaultWidth:"wide"}),quarter:xt({values:dd,defaultWidth:"wide",argumentCallback:t=>t-1}),month:xt({values:ud,defaultWidth:"wide"}),day:xt({values:md,defaultWidth:"wide"}),dayPeriod:xt({values:fd,defaultWidth:"wide",formattingValues:pd,defaultFormattingWidth:"wide"})},gd=/^(\d+)(th|st|nd|rd)?/i,yd=/\d+/i,kd={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},bd={any:[/^b/i,/^(a|c)/i]},xd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wd={any:[/1/i,/2/i,/3/i,/4/i]},Ed={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},Cd={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]},Bd={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},vd={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]},Vd={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},Sd={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}},Nd={ordinalNumber:qr({matchPattern:gd,parsePattern:yd,valueCallback:t=>parseInt(t,10)}),era:wt({matchPatterns:kd,defaultMatchWidth:"wide",parsePatterns:bd,defaultParseWidth:"any"}),quarter:wt({matchPatterns:xd,defaultMatchWidth:"wide",parsePatterns:wd,defaultParseWidth:"any",valueCallback:t=>t+1}),month:wt({matchPatterns:Ed,defaultMatchWidth:"wide",parsePatterns:Cd,defaultParseWidth:"any"}),day:wt({matchPatterns:Bd,defaultMatchWidth:"wide",parsePatterns:vd,defaultParseWidth:"any"}),dayPeriod:wt({matchPatterns:Vd,defaultMatchWidth:"any",parsePatterns:Sd,defaultParseWidth:"any"})},Md={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ad={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$d={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_d={date:cn({formats:Md,defaultWidth:"full"}),time:cn({formats:Ad,defaultWidth:"full"}),dateTime:cn({formats:$d,defaultWidth:"full"})},Dd={code:"en-US",formatDistance:ld,formatLong:_d,formatRelative:id,localize:hd,match:Nd,options:{weekStartsOn:0,firstWeekContainsDate:1}},Td={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"}},Ld=(t,n,a)=>{let o;const r=Td[t];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},Fd={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Pd={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},zd={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Od={date:cn({formats:Fd,defaultWidth:"full"}),time:cn({formats:Pd,defaultWidth:"full"}),dateTime:cn({formats:zd,defaultWidth:"full"})},Rd={lastWeek:t=>{const n=t.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"},Hd=(t,n,a,o)=>{const r=Rd[t];return typeof r=="function"?r(n):r},jd={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},Gd={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Id={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"]},qd={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"]},Wd={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"}},Ud={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"}},Zd={ordinalNumber:(t,n)=>{const a=Number(t);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:xt({values:jd,defaultWidth:"wide"}),quarter:xt({values:Gd,defaultWidth:"wide",argumentCallback:t=>t-1}),month:xt({values:Id,defaultWidth:"wide"}),day:xt({values:qd,defaultWidth:"wide"}),dayPeriod:xt({values:Wd,defaultWidth:"wide",formattingValues:Ud,defaultFormattingWidth:"wide"})},Yd=/^(\d+)[ºªo]?/i,Xd=/\d+/i,Qd={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},Kd={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},Jd={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},e3={any:[/1/i,/2/i,/3/i,/4/i]},t3={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},n3={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]},a3={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},o3={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]},r3={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},l3={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}},s3={ordinalNumber:qr({matchPattern:Yd,parsePattern:Xd,valueCallback:t=>parseInt(t,10)}),era:wt({matchPatterns:Qd,defaultMatchWidth:"wide",parsePatterns:Kd,defaultParseWidth:"any"}),quarter:wt({matchPatterns:Jd,defaultMatchWidth:"wide",parsePatterns:e3,defaultParseWidth:"any",valueCallback:t=>t+1}),month:wt({matchPatterns:t3,defaultMatchWidth:"wide",parsePatterns:n3,defaultParseWidth:"any"}),day:wt({matchPatterns:a3,defaultMatchWidth:"wide",parsePatterns:o3,defaultParseWidth:"any"}),dayPeriod:wt({matchPatterns:r3,defaultMatchWidth:"any",parsePatterns:l3,defaultParseWidth:"any"})},Zr={code:"pt-BR",formatDistance:Ld,formatLong:Od,formatRelative:Hd,localize:Zd,match:s3,options:{weekStartsOn:0,firstWeekContainsDate:1}},i3={scheduled_messages:"Mensagem programada",attendant_reminder:"Lembretes"};function Kn(t){return i3[t]||t||"Evento"}function Ua(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function dn(t){const n=t instanceof Date?t:new Date(t),a=n.getFullYear(),o=(n.getMonth()+1).toString().padStart(2,"0");return`${a}-${o}`}function Bn(t){const[n,a]=String(t||"").trim().split(" ");if(!n)return null;const[o,r,l]=n.split("-").map(u=>parseInt(u,10));let s=0,i=0;if(a){const[u,c]=a.split(":");s=parseInt(u||"0",10),i=parseInt(c||"0",10)}const d=new Date(o,(r||1)-1,l||1,s,i);return isNaN(d.getTime())?null:d}function c3(t){if(!t)return null;try{const n=String(t).replace(/(\.\d{3})\d+$/,"$1"),a=new Date(n);return isNaN(a.getTime())?null:a}catch{return null}}function Jn(t){if(!t)return"";const n=t instanceof Date?t:new Date(t);if(isNaN(n.getTime()))return"";const a=String(n.getHours()).padStart(2,"0"),o=String(n.getMinutes()).padStart(2,"0");return`${a}:${o}`}function d3(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function Za(t){if(!t)return null;const n=(t==null?void 0:t.params)||{},a=(n==null?void 0:n.schedule)||{},o=(t==null?void 0:t.info)||{},r=(o==null?void 0:o.entity)||{},l=(o==null?void 0:o.department)||{},s=(o==null?void 0:o.instance)||{};let i=null;if(a!=null&&a.time&&(i=Bn(a.time)),!i&&(t!=null&&t.next_execution_at)&&(i=c3(t.next_execution_at)),!i)return null;const d=Array.isArray(n==null?void 0:n.message)?n.message[0]:null,u=d&&(d.content||d.text)||"",c=(t==null?void 0:t.function)||(n==null?void 0:n.function)||"",m=Kn(c),f=(u||"").trim();return{id:(t==null?void 0:t.id)||d3(),date:i,time:Jn(i),type:t.function,status:t.status||null,scheduled_by:n.scheduled_by,title:m,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:(l==null?void 0:l.name)||"",departmentId:(l==null?void 0:l.id)||null,instanceName:(s==null?void 0:s.name)||"",raw:t}}function Yr(t=[]){const n=Array.isArray(t)?t:Array.isArray(t.results)?t.results:[],a=[];for(const o of n){const r=Za(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function u3(t="/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(t).replace(/\/$/,"")}/${o}/`,l=await Pe.delete(r);return{ok:(l==null?void 0:l.status)>=200&&l.status<300,status:(l==null?void 0:l.status)??0}}catch(o){return console.error("Error erasing scheduled event:",o),{ok:!1,status:0}}}const $t=new Map,Ya=jt.defineStore("scheduled",{state:()=>({baseUrl:Y0,monthCache:{},loadingYM:new Set,errorByYM:{},loadedYM:new Set,filters:{}}),getters:{eventsOf:t=>n=>t.monthCache[n]||[],isLoading:t=>n=>t.loadingYM.has(n),errorOf:t=>n=>t.errorByYM[n]||""},actions:{setBaseUrl(t){this.baseUrl=t||"/crm_scheduled"},_setMonth(t,n){this.monthCache={...this.monthCache,[t]:n||[]}},_deleteMonth(t){const{[t]:n,...a}=this.monthCache;this.monthCache=a,this.loadingYM.delete(t);const{[t]:o,...r}=this.errorByYM;this.errorByYM=r,this.loadedYM.delete(t)},coerceHttps(t){return t&&t.startsWith("http://")?t.replace(/^http:\/\//i,"https://"):t},_appendMonth(t,n){if(!n||n.length===0)return;this.monthCache[t]||(this.monthCache[t]=[]);const a=new Set(this.monthCache[t].map(o=>o==null?void 0:o.id));for(const o of n)o&&(o.id&&a.has(o.id)||this.monthCache[t].push(o))},async ensureMonthLoaded(t){if(t||(t=dn(new Date)),this.loadedYM.has(t))return;const n=`${this.baseUrl}|${t}`;if($t.has(n))return $t.get(n);this.loadingYM.add(t),this.errorByYM={...this.errorByYM,[t]:""};const a=(async()=>{var o,r;try{const l=`${this.baseUrl}?year_month=${encodeURIComponent(t)}&page_size=10`,s=await Pe.get(l),i=Array.isArray(s==null?void 0:s.data)?s.data:((o=s==null?void 0:s.data)==null?void 0:o.results)||[],d=Yr(i||[]);this._setMonth(t,d),this.loadedYM.add(t);let u=this.coerceHttps(((r=s==null?void 0:s.data)==null?void 0:r.next)||null);u&&(async()=>{var c,m;try{let f=u;for(;f;){const h=await Pe.get(f),p=Array.isArray(h==null?void 0:h.data)?h.data:((c=h==null?void 0:h.data)==null?void 0:c.results)||[],g=Yr(p||[]);this._appendMonth(t,g),f=this.coerceHttps(((m=h==null?void 0:h.data)==null?void 0:m.next)||null)}}catch(f){console.warn("[scheduled] background paging error:",(f==null?void 0:f.message)||f)}})()}catch(l){const s=String((l==null?void 0:l.message)||l);throw this.errorByYM={...this.errorByYM,[t]:s},console.error("[scheduled] fetch error",t,s),this._setMonth(t,[]),this.loadedYM.delete(t),l}finally{$t.delete(n),this.loadingYM.delete(t)}})();return $t.set(n,a),a},async forceReload(t){t||(t=dn(new Date));const n=`${this.baseUrl}|${t}`;$t.delete(n),this._deleteMonth(t),this.loadedYM.delete(t),await this.ensureMonthLoaded(t)},findEventById(t){const n=String(t);for(const[a,o]of Object.entries(this.monthCache)){const r=(o||[]).findIndex(l=>{var d;const s=((d=l==null?void 0:l.raw)==null?void 0:d.id)!=null?String(l.raw.id):null,i=(l==null?void 0:l.id)!=null?String(l.id):null;return s===n||i===n});if(r!==-1)return{ym:a,idx:r}}return null},applyUpdateToCache({id:t,params:n}){var f,h,p,g,y,k,B,b,x,v,_,R,L;let a=null;if((f=n==null?void 0:n.schedule)!=null&&f.time){const A=n.schedule.time,M=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(A);if(M){const[,S,N,w,C="00",O="00"]=M;a=new Date(Number(S),Number(N)-1,Number(w),Number(C),Number(O),0,0)}else{const S=typeof A=="string"&&!A.includes("T")?A.replace(" ","T"):A;a=new Date(S)}}const o=A=>{var M,S,N,w;return a instanceof Date&&!isNaN(a)&&(A.date=a,A.time=Jn(a)),((S=(M=n==null?void 0:n.message)==null?void 0:M[0])==null?void 0:S.content)!=null&&(A.content=n.message[0].content),A.raw=A.raw||{id:t},A.raw.params=A.raw.params||{},n!=null&&n.schedule&&(A.raw.params.schedule={...A.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(A.raw.params.scheduled_by=n.scheduled_by),n.department&&(A.raw.params.department=n.department),n!=null&&n.message&&(A.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(A.chatId=n.chat_id??A.chatId??""),n!=null&&n.entity&&(A.raw.params.entity={...A.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(A.contactName=n.entity.name??A.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(A.contactPhoto=n.entity.photo??A.contactPhoto??null,n.entity.photo&&(A.photo=n.entity.photo))),n!=null&&n.info&&(A.raw.params.info={...A.raw.params.info||{},...n.info},(N=n.info)!=null&&N.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(A.departmentName=n.info.department.name??A.departmentName),(w=n.info)!=null&&w.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(A.instanceName=n.info.instance.name??A.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(A.instanceStatus=n.info.instance.last_instance_status??A.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?A.title=n.title??A.title??Kn(A.function):A.title=A.title||Kn(A.function),Object.prototype.hasOwnProperty.call(n||{},"function")?(A.function=n.function??A.function??"scheduled_messages",A.type=n.function??A.type??"scheduled_messages"):(A.function=A.function||"scheduled_messages",A.type=A.type||"scheduled_messages"),A},r=this.findEventById(t);if(!r){const A=a instanceof Date&&!isNaN(a)?a:(()=>{var T;const C=(T=n==null?void 0:n.schedule)==null?void 0:T.time,O=typeof C=="string"&&!C.includes("T")?C.replace(" ","T"):C;return(Bn==null?void 0:Bn(O))||(O?new Date(O):new Date)})(),M=((n==null?void 0:n.function)||"scheduled_messages")==="attendant_reminder",S=o({id:t,date:A,time:Jn(A),title:(n==null?void 0:n.title)||Kn((n==null?void 0:n.function)||"scheduled_messages"),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:((p=(h=n==null?void 0:n.message)==null?void 0:h[0])==null?void 0:p.content)??"",raw:{id:t,params:n},contactName:M?"":((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:M?"":((B=(k=n==null?void 0:n.info)==null?void 0:k.department)==null?void 0:B.name)??null,departmentId:((x=(b=n==null?void 0:n.info)==null?void 0:b.department)==null?void 0:x.id)??null,instanceName:((_=(v=n==null?void 0:n.info)==null?void 0:v.instance)==null?void 0:_.name)??null,instanceStatus:((L=(R=n==null?void 0:n.info)==null?void 0:R.instance)==null?void 0:L.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),N=dn(S.date),w=this.monthCache[N]?[...this.monthCache[N],S]:[S];w.sort((C,O)=>C.date-O.date),this._setMonth(N,w);return}const{ym:l,idx:s}=r,i=this.monthCache[l]||[],d={...i[s]},u=o({...d}),c=u.date instanceof Date?u.date:d.date,m=dn(c);if(m===l){const A=[...i];A.splice(s,1,u),A.sort((M,S)=>M.date-S.date),this._setMonth(l,A)}else{const A=i.slice(0,s).concat(i.slice(s+1)),M=this.monthCache[m]?[...this.monthCache[m],u]:[u];M.sort((S,N)=>S.date-N.date),this.monthCache={...this.monthCache,[l]:A,[m]:M}}},removeFromCache(t){const n=this.findEventById(t);if(!n)return!1;const{ym:a,idx:o}=n,r=this.monthCache[a]||[],l=r.slice(0,o).concat(r.slice(o+1));return this._setMonth(a,l),!0},insertNormalizedEvent(t){if(!t)return;const n=String(t.id),a=t.date instanceof Date?t.date:Bn(t.date)||new Date,o=dn(a),r={...t,id:n,date:a,time:t.time??Jn(a)},l=this.monthCache[o]?[...this.monthCache[o]]:[],s=l.findIndex(i=>{var d;return String(((d=i==null?void 0:i.raw)==null?void 0:d.id)??(i==null?void 0:i.id))===n});s!==-1?l.splice(s,1,r):l.push(r),l.sort((i,d)=>i.date-d.date),this._setMonth(o,l)},insertFromApiItem(t){const n=Za(t);n&&this.insertNormalizedEvent(n)},insertManyFromApi(t=[]){for(const n of t){const a=Za(n);a&&this.insertNormalizedEvent(a)}},insertFromApiPage(t){const n=Array.isArray(t)?t:(t==null?void 0:t.results)||[];this.insertManyFromApi(n)},insertFromParams(t){return this.applyUpdateToCache(t)},hasEvent(t){return!!this.findEventById(t)},resetAll(){var t;this.monthCache={},this.loadingYM=new Set,this.errorByYM={},this.loadedYM=new Set,(t=$t.clear)==null||t.call($t)}}}),Xr=()=>Ya(),Ze=e.reactive({active:{reminders:[],pagination:{count:0,next:null,previous:null,currentPage:1,pageSize:10},loaded:!1,loading:!1},completed:{reminders:[],pagination:{count:0,next:null,previous:null,currentPage:1,pageSize:10},loaded:!1,loading:!1}}),Qr=(t,n,a)=>{if(n){const o=Ze[a].reminders.findIndex(r=>r.id===t.id);o!==-1&&(Ze[a].reminders[o]={...t})}else Ze[a].reminders.unshift({...t,id:t.id}),Ze[a].reminders.length>Ze[a].pagination.pageSize&&Ze[a].reminders.pop(),Ze[a].pagination.count+=1},m3=(t,n,a)=>{const o=new URLSearchParams,r=t;return o.set("page",n||1),o.set("status",a),`${r}?${o.toString()}`},f3=async(t=2,n)=>{try{const{data:a}=await Pe.get(m3(Un,t,n));return a}catch(a){return console.error("Error fetching reminders:",a),{results:[],count:0}}},Xa=async(t,n)=>{const a=t==="next",o=a?Ze.active:Ze.completed;o.loading=!0;try{const r=await f3(n,a);o.reminders=r.results||[],o.pagination.count=r.count||0,o.pagination.next=r.next||null,o.pagination.previous=r.previous||null,o.pagination.currentPage=n,o.loaded=!0}catch(r){console.error("Error fetching reminders:",r)}finally{o.loading=!1}},p3=async t=>{var i,d,u,c,m;const n=!!(t!=null&&t.id),a=(t==null?void 0:t.params)||{},o=a!=null&&a.schedule?{...a.schedule}:null,r=a!=null&&a.message?{...a.message}:null;if(!((i=r[0])!=null&&i.title))throw new Error("O campo título é obrigatório.");const l=n?{method:"patch",url:`${Un}${t.id}/`,success:"Produto editado com sucesso!"}:{method:"post",url:Un,success:"Produto criado com sucesso!"},s={schedule:o,message:r};try{const{data:f}=await Pe[l.method](l.url,s),h=(f==null?void 0:f.message)||l.success||"Lembrete salvo com sucesso.";At({group:"success",title:"Sucesso",text:h},4e3),Qr(f.data,n,"active");const p={id:f.data.id,params:{...s,title:((u=(d=s.message)==null?void 0:d[0])==null?void 0:u.title)||"Lembrete",function:f.data.function||"attendant_reminder",type:"attendant_reminder",scheduled_by:(m=(c=f.data)==null?void 0:c.params)==null?void 0:m.scheduled_by,status:!0}};return Xr().insertFromParams(p),f}catch(f){throw f}},h3=async t=>{try{const n=await Pe.delete(`${Un}${t}/`),a=Ze.active.reminders.findIndex(o=>o.id===t);return a!==-1&&Ze.active.reminders.splice(a,1),At({group:"success",title:"Sucesso",text:n.data.message||"Lembrete deletado com sucesso."},4e3),n.data}catch(n){console.error("Error deleting reminder:",n)}finally{Xr().removeFromCache(String(t))}},ea=t=>{if(!(t instanceof Date))return null;const n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),l=String(t.getMinutes()).padStart(2,"0");return`${n}-${a}-${o} ${r}:${l}`},ta=(t,n)=>{if(t==="time")return new Date(n).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"});if(t==="data")return new Date(n).toLocaleDateString("pt-BR")},g3=t=>{if(!t||!t.id)return;const n=Ze.active.reminders,a=n.findIndex(o=>o.id===t.id);a!==-1&&(n.splice(a,1),Ze.active.pagination.count=Math.max(0,Ze.active.pagination.count-1)),Qr(t,!1,"completed")},y3={class:"w-full h-full max-w-full flex flex-col"},k3={class:"flex-1 min-h-0"},b3={key:0,class:"w-full h-full flex items-center justify-center text-center p-6"},x3={class:"flex flex-col items-center gap-2 text-base-content/70"},w3={class:"text-sm"},E3={class:"text-xs"},C3={key:1,class:"overflow-auto h-full bg-base-300"},B3={class:"w-full table-fixed"},v3={class:"sticky top-0 bg-base-200 z-10 text-xs font-medium"},V3={key:0,class:"px-2"},S3=["title"],N3={class:"truncate text-center"},M3=["title"],A3={class:"truncate text-center"},$3={class:"w-16 px-6"},_3={class:"flex gap-1 items-center justify-center"},D3={key:0,class:"px-6 py-2"},T3={class:"flex gap-1 items-center justify-center"},L3={class:"bg-base-200 hover:bg-base-100 hover:scale-105 transition-all duration-200 p-1 rounded-lg"},F3=["onClick"],P3={class:"text-center text-base"},z3={class:"line-clamp-2 font-sans"},O3={class:"center mt-2 text-sm"},R3=["disabled","onClick"],H3={key:0,class:"size-4 animate-spin rounded-full border-4 border-solid text-white border-t-transparent"},j3={key:1,class:"relative uppercase font-medium text-xs"},G3={class:"p-1 flex-none"},I3=["title","disabled"],q3=ke({__name:"reminderList",props:{listState:{type:String,default:"Próximos"},listStateModifiers:{}},emits:e.mergeModels(["openForm"],["update:listState"]),setup(t,{emit:n}){const a=n,o=e.useModel(t,"listState"),r=e.computed(()=>o.value==="Próximos"),l=e.ref(!1),s=async c=>{l.value||(l.value=!0,await h3(c),l.value=!1)},i=e.computed(()=>Ze),d=e.computed({get(){var c,m,f,h;return i.value?o.value==="Próximos"?((m=(c=i.value.active)==null?void 0:c.pagination)==null?void 0:m.currentPage)??1:((h=(f=i.value.completed)==null?void 0:f.pagination)==null?void 0:h.currentPage)??1:1},set(c){o.value==="Próximos"?i.value.active.pagination.currentPage=c:i.value.completed.pagination.currentPage=c}}),u=()=>{r.value&&a("openForm",{type:"create"})};return e.onMounted(async()=>{await Promise.all([Xa("next",1),Xa("completed",1)])}),(c,m)=>{const f=e.resolveComponent("Popper"),h=e.resolveComponent("VueAwesomePaginate");return e.openBlock(),e.createElementBlock("section",y3,[e.createElementVNode("div",k3,[(o.value==="Próximos"?i.value.active.reminders.length:i.value.completed.reminders.length)===0?(e.openBlock(),e.createElementBlock("div",b3,[e.createElementVNode("div",x3,[m[3]||(m[3]=e.createElementVNode("svg",{class:"w-14 text-gray-600","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M17.133 12.632v-1.8a5.407 5.407 0 0 0-4.154-5.262.955.955 0 0 0 .021-.106V3.1a1 1 0 0 0-2 0v2.364a.933.933 0 0 0 .021.106 5.406 5.406 0 0 0-4.154 5.262v1.8C6.867 15.018 5 15.614 5 16.807 5 17.4 5 18 5.538 18h12.924C19 18 19 17.4 19 16.807c0-1.193-1.867-1.789-1.867-4.175Zm-13.267-.8a1 1 0 0 1-1-1 9.424 9.424 0 0 1 2.517-6.391A1.001 1.001 0 1 1 6.854 5.8a7.43 7.43 0 0 0-1.988 5.037 1 1 0 0 1-1 .995Zm16.268 0a1 1 0 0 1-1-1A7.431 7.431 0 0 0 17.146 5.8a1 1 0 0 1 1.471-1.354 9.424 9.424 0 0 1 2.517 6.391 1 1 0 0 1-1 .995ZM8.823 19a3.453 3.453 0 0 0 6.354 0H8.823Z"})],-1)),e.createElementVNode("p",w3,e.toDisplayString(o.value==="Próximos"?"Nenhum lembrete futuro encontrado.":"Nenhum lembrete concluído."),1),e.createElementVNode("p",E3,e.toDisplayString(o.value==="Próximos"?"Clique em “Criar novo lembrete +” para adicionar.":"Conclua um lembrete para vê-lo aqui."),1)])])):(e.openBlock(),e.createElementBlock("div",C3,[e.createElementVNode("table",B3,[e.createElementVNode("thead",v3,[e.createElementVNode("tr",null,[m[4]||(m[4]=e.createElementVNode("th",{class:"px-6"},"Nome",-1)),m[5]||(m[5]=e.createElementVNode("th",{class:"px-6"},"Descrição",-1)),m[6]||(m[6]=e.createElementVNode("th",{class:"px-6"},"Data",-1)),r.value?(e.openBlock(),e.createElementBlock("th",V3,"Ação")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value==="Próximos"?i.value.active.reminders:i.value.completed.reminders,p=>{var g,y,k,B,b,x,v,_;return e.openBlock(),e.createElementBlock("tr",{key:p.id,class:"bg-base-300 hover:bg-base-200 transition-colors duration-150 cursor-default text-xs h-8"},[e.createElementVNode("td",{class:"whitespace-normal break-words p-1 px-6",title:((g=p==null?void 0:p.params)==null?void 0:g.message[0].title)||null},[e.createElementVNode("p",N3,e.toDisplayString(((y=p==null?void 0:p.params)==null?void 0:y.message[0].title)||"-"),1)],8,S3),e.createElementVNode("td",{class:"whitespace-normal break-words p-1 px-6 max-w-32",title:((k=p==null?void 0:p.params)==null?void 0:k.message[0].content)||null},[e.createElementVNode("p",A3,e.toDisplayString(((B=p==null?void 0:p.params)==null?void 0:B.message[0].content)||"-"),1)],8,M3),e.createElementVNode("td",$3,[e.createElementVNode("section",_3,[e.createElementVNode("p",null,e.toDisplayString(e.unref(ta)("data",(x=(b=p==null?void 0:p.params)==null?void 0:b.schedule)==null?void 0:x.time)),1),m[7]||(m[7]=e.createTextVNode(" - ",-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(ta)("time",(_=(v=p==null?void 0:p.params)==null?void 0:v.schedule)==null?void 0:_.time)),1)])]),r.value?(e.openBlock(),e.createElementBlock("td",D3,[e.createElementVNode("section",T3,[e.createElementVNode("button",L3,[(e.openBlock(),e.createElementBlock("svg",{onClick:R=>a("openForm",{type:"edit",...p}),class:"size-4 text-yellow-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[...m[8]||(m[8]=[e.createElementVNode("path",{"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)])],8,F3))]),e.createVNode(f,{class:"reminder-del-popper"},{content:e.withCtx(({close:R})=>{var L;return[e.createElementVNode("section",P3,[e.createElementVNode("div",z3,[m[9]||(m[9]=e.createTextVNode(" Tem certeza que deseja ",-1)),m[10]||(m[10]=e.createElementVNode("span",{class:"font-bold text-red-500"},"apagar",-1)),e.createTextVNode(" o "+e.toDisplayString((L=p==null?void 0:p.params)==null?void 0:L.message[0].title)+"? ",1)]),m[12]||(m[12]=e.createElementVNode("div",{class:"text-sm"},"Essa ação é irreversível.",-1)),e.createElementVNode("div",O3,[e.createElementVNode("button",{disabled:l.value,class:"group relative inline-flex items-center justify-center w-full overflow-hidden rounded bg-red-500 px-5 py-1 text-xs text-white transition-all duration-300 ease-out hover:bg-gradient-to-r hover:from-red-500 hover:to-red-400 hover:ring-2 hover:ring-red-400 hover:ring-offset-2",onClick:[R,A=>s(p.id)]},[m[11]||(m[11]=e.createElementVNode("span",{class:"ease absolute right-0 -mt-12 h-32 w-8 translate-x-12 rotate-12 bg-white opacity-10 transition-all duration-1000 group-hover:-translate-x-40"},null,-1)),l.value?(e.openBlock(),e.createElementBlock("div",H3)):(e.openBlock(),e.createElementBlock("span",j3,"Apagar lembrete"))],8,R3)])])]}),default:e.withCtx(()=>[m[13]||(m[13]=e.createElementVNode("button",{class:"bg-base-200 hover:bg-base-100 hover:scale-105 transition-all duration-200 p-1 rounded-lg"},[e.createElementVNode("svg",{class:"size-4 text-red-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.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"})])],-1))]),_:2},1024)])])):e.createCommentVNode("",!0)])}),128))])])]))]),e.createElementVNode("div",G3,[e.createElementVNode("button",{title:r.value?"Criar novo lembrete":"Volte para aba de próximos para criar lembretes",disabled:!r.value,onClick:m[0]||(m[0]=p=>u()),class:"bg-base-100 w-full border border-base-100 p-2 rounded-md uppercase text-[11px] hover:bg-base-100/80 flex justify-center items-center gap-2"}," Criar novo lembrete + ",8,I3)]),i.value&&(o.value==="Próximos"?i.value.active.pagination.count:i.value.completed.pagination.count)>10?(e.openBlock(),e.createBlock(h,{key:0,class:"justify-center mx-auto bg-base-300 w-full py-2 flex-none",modelValue:d.value,"onUpdate:modelValue":m[1]||(m[1]=p=>d.value=p),"total-items":o.value==="Próximos"?i.value.active.pagination.count:i.value.completed.pagination.count,"items-per-page":o.value==="Próximos"?i.value.active.pagination.pageSize:i.value.completed.pagination.pageSize,"max-pages-shown":3,onClick:m[2]||(m[2]=p=>e.unref(Xa)(o.value==="Próximos"?"next":"completed",d.value))},{"prev-button":e.withCtx(()=>[...m[14]||(m[14]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"mx-auto w-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15m0 0l6.75 6.75M4.5 12l6.75-6.75"})],-1)])]),"next-button":e.withCtx(()=>[...m[15]||(m[15]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"mx-auto w-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75"})],-1)])]),_:1},8,["modelValue","total-items","items-per-page"])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-d33b5518"]]),W3={class:"table-body-container"},U3={class:"reminder-form-label-name"},Z3={class:"flex items-center gap-1"},Y3={key:0,class:"text-red-500 text-[10px] mt-0.3"},X3=["disabled"],Q3={class:"reminder-form-label-description"},K3={class:"reminder-form-label-description-container bg-base-300"},J3=["disabled"],e4={class:"reminder-form-label-date"},t4={class:"flex items-center gap-1"},n4={key:0,class:"text-red-500 text-[10px] mt-0.3"},a4={class:"reminder-data-picker-container"},o4=["disabled"],r4={class:"flex gap-1.5 text-xs group-hover:scale-105 group-hover:text-primary_alt transition-all duration-200"},l4=ke({__name:"reminderForm",props:{modelValue:{type:Object,default:()=>({})},viewOnly:{type:Boolean,default:!1}},setup(t,{expose:n}){const a=t,o=e.ref(new Date(Date.now()+6e4)),r=e.ref(Date.now()),l=e.computed(()=>new Date(r.value+6e4)),s=e.ref({params:{message:[{title:"",type:"text",content:""}],schedule:{type:"unique",time:ea(o.value),timezone:"America/Sao_Paulo"}}}),i=e.ref([]),d=async()=>{const c=l.value.getTime();if(o.value.getTime()<c&&(o.value=new Date(c),s.value.params.schedule.time=ea(o.value)),s.value.params.message[0].title.trim()==="")return i.value.push("title"),new Promise.reject("Título é obrigatório");try{await p3(s.value)}catch(f){return i.value.push("date"),Promise.reject(f)}};e.watch(o,c=>{if(!(c instanceof Date)||a.viewOnly)return;const m=l.value;c.getTime()<m.getTime()&&(o.value=new Date(m.getTime()))});let u;return e.onMounted(()=>{var c,m;if(u=setInterval(()=>{r.value=Date.now();const f=l.value;!a.viewOnly&&o.value.getTime()<f.getTime()&&(o.value=new Date(f.getTime()))},15e3),a.modelValue&&Object.keys(a.modelValue).length>0){s.value=JSON.parse(JSON.stringify(a.modelValue));const f=new Date(((m=(c=s.value.params)==null?void 0:c.schedule)==null?void 0:m.time)||o.value);a.viewOnly?o.value=f:isNaN(f.getTime())||f.getTime()<l.value.getTime()?(s.value.params.schedule.time=ea(l.value),o.value=new Date(l.value.getTime())):o.value=f}}),e.onBeforeUnmount(()=>{u&&clearInterval(u)}),n({save:d}),(c,m)=>{const f=e.resolveComponent("VueDatePicker");return e.openBlock(),e.createElementBlock("div",W3,[e.createElementVNode("span",U3,[e.createElementVNode("section",Z3,[m[5]||(m[5]=e.createElementVNode("p",{class:"reminder-form-label-text"},"Nome",-1)),i.value.includes("title")&&s.value.params.message[0].title.trim()===""?(e.openBlock(),e.createElementBlock("a",Y3," Campo obrigatório")):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=h=>s.value.params.message[0].title=h),onInput:m[1]||(m[1]=h=>i.value=i.value.filter(p=>p!=="title")),placeholder:"Ligar para o cliente às 14h",type:"text",disabled:a.viewOnly,class:e.normalizeClass(["reminder-form-input-name bg-base-300",i.value.includes("title")&&s.value.params.message[0].title.trim()===""?"border-red-500 border-2":"border-transparent border-none",a.viewOnly?"opacity-60 cursor-not-allowed":""])},null,42,X3),[[e.vModelText,s.value.params.message[0].title]])]),e.createElementVNode("span",Q3,[m[6]||(m[6]=e.createElementVNode("p",{class:"reminder-form-label-text"},"Descrição",-1)),e.createElementVNode("div",K3,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[2]||(m[2]=h=>s.value.params.message[0].content=h),placeholder:"Ligar para o cliente para confirmar o agendamento da reunião.",disabled:a.viewOnly,class:e.normalizeClass(["reminder-form-input-description bg-base-300",a.viewOnly?"opacity-60 cursor-not-allowed":""]),maxlength:"1000","aria-label":"Anotações do cliente"},null,10,J3),[[e.vModelText,s.value.params.message[0].content]]),e.createElementVNode("div",{class:e.normalizeClass(["description-character-count bg-base-300",s.value.params.message[0].content.length>900?"text-red-500":s.value.params.message[0].content.length>700?"text-yellow-500":"text-gray-400"])},e.toDisplayString(s.value.params.message[0].content.length||0)+"/1000 ",3)])]),e.createElementVNode("span",e4,[e.createElementVNode("section",t4,[m[7]||(m[7]=e.createElementVNode("p",{class:"reminder-form-label-text"},"Data do lembrete",-1)),i.value.includes("date")&&new Date(s.value.params.schedule.time).getTime()<l.value.getTime()?(e.openBlock(),e.createElementBlock("a",n4," Não é possível criar um agendamento com data e hora anterior que o atual")):e.createCommentVNode("",!0)]),e.createElementVNode("div",a4,[e.createVNode(f,{modelValue:o.value,"onUpdate:modelValue":[m[3]||(m[3]=h=>o.value=h),m[4]||(m[4]=h=>s.value.params.schedule.time=e.unref(ea)(o.value))],"text-input":"",locale:"pt-BR","cancel-text":"Cancelar","select-text":"Confirmar","enable-time-picker":!0,format:"dd/MM/yyyy HH:mm",teleport:!0,"min-date":l.value,disabled:a.viewOnly},{"clear-icon":e.withCtx(()=>[...m[8]||(m[8]=[])]),"dp-input":e.withCtx(()=>[e.createElementVNode("button",{class:e.normalizeClass(["reminder-btn-data-picker bg-base-300",a.viewOnly?"opacity-60 cursor-not-allowed":"group"]),disabled:a.viewOnly},[m[10]||(m[10]=e.createElementVNode("svg",{class:"size-4.5 group-hover:scale-105 group-hover:text-primary_alt transition-all duration-200","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"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-2Zm6.01-6a1 1 0 1 0-2 0 1 1 0 0 0 2 0Zm2 0a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm6 0a1 1 0 1 0-2 0 1 1 0 0 0 2 0Zm-10 4a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm6 0a1 1 0 1 0-2 0 1 1 0 0 0 2 0Zm2 0a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",r4,[e.createElementVNode("p",null,e.toDisplayString(e.unref(ta)("data",o.value)),1),m[9]||(m[9]=e.createTextVNode(" - ",-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(ta)("time",o.value)),1)])],10,o4)]),_:1},8,["modelValue","min-date","disabled"])])])])}}},[["__scopeId","data-v-0fb1ce3a"]]),s4={class:"reminder-modal-header"},i4={class:"modal_responsive"},c4={class:"flex min-h-full items-center justify-center text-center sm:p-0"},d4={class:"reminder-modal-container"},u4={class:"reminder-modal-title bg-base-300 border-base-100"},m4={class:"flex flex-col gap-1 w-full"},f4={class:"flex items-center gap-1"},p4={class:"text-md"},h4={key:0,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},g4={key:1,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},y4={key:0,class:"flex flex-col lg:flex-row w-full gap-1.5"},k4=["onClick"],b4={key:0,class:"size-3.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},x4={key:1,class:"size-3.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},w4={class:"flex-1 min-h-0 flex flex-col bg-base-200 overflow-hidden"},E4={class:"reminder-modal-end-button border-base-100 bg-base-300"},C4=["disabled"],B4={key:0,class:"size-3 animate-spin rounded-full border-2 border-solid text-primary border-t-transparent"},v4={key:1},V4={key:2},Qa=ke({__name:"reminderModal",props:{initialData:{type:Object,default:null},viewOnly:{type:Boolean,default:!1}},emits:["close"],setup(t,{expose:n,emit:a}){const o=t,r=e.ref(null),l=e.ref({}),s=e.ref(!1),i=e.computed(()=>f.value==="list"?"Lembretes":f.value==="create"?"Criar Lembrete":f.value==="edit"?o.viewOnly?"Visualizar Lembrete":"Editar Lembrete":"Lembretes"),d=async()=>{var y;if(!s.value){s.value=!0;try{await((y=r.value)==null?void 0:y.save()),f.value="list"}catch{}finally{s.value=!1}}},u=a,c=e.ref("Próximos"),m=e.ref(["Próximos","Executados"]),f=e.ref("list"),h=()=>{if(o.viewOnly){u("close");return}f.value==="list"?u("close"):f.value="list"},p=y=>{(y==null?void 0:y.type)==="create"?(f.value="create",l.value={}):(y==null?void 0:y.type)==="edit"&&(f.value="edit",l.value=y)},g=y=>{f.value="edit",l.value=y};return n({openForEdit:g}),e.onMounted(()=>{o.initialData&&g(o.initialData)}),(y,k)=>(e.openBlock(),e.createElementBlock("div",s4,[k[9]||(k[9]=e.createElementVNode("div",{class:"reminder-modal-overlay"},null,-1)),e.createElementVNode("div",i4,[e.createElementVNode("div",c4,[e.createElementVNode("div",d4,[e.createElementVNode("div",u4,[e.createElementVNode("section",m4,[e.createElementVNode("div",f4,[k[6]||(k[6]=e.createElementVNode("svg",{class:"size-5 text-primary","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M17.133 12.632v-1.8a5.406 5.406 0 0 0-4.154-5.262.955.955 0 0 0 .021-.106V3.1a1 1 0 0 0-2 0v2.364a.955.955 0 0 0 .021.106 5.406 5.406 0 0 0-4.154 5.262v1.8C6.867 15.018 5 15.614 5 16.807 5 17.4 5 18 5.538 18h12.924C19 18 19 17.4 19 16.807c0-1.193-1.867-1.789-1.867-4.175ZM8.823 19a3.453 3.453 0 0 0 6.354 0H8.823Z"})],-1)),e.createElementVNode("h3",p4,e.toDisplayString(i.value),1),e.createElementVNode("button",{onClick:k[0]||(k[0]=B=>h()),class:"reminder-modal-close-button bg-base-200/40"},[f.value==="list"?(e.openBlock(),e.createElementBlock("svg",h4,[...k[4]||(k[4]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",g4,[...k[5]||(k[5]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 19-7-7 7-7"},null,-1)])]))])]),f.value==="list"?(e.openBlock(),e.createElementBlock("div",y4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,B=>(e.openBlock(),e.createElementBlock("button",{onClick:b=>c.value=B,class:e.normalizeClass([" w-full rounded-md px-2 flex items-center lg:justify-center justify-between gap-1.5 py-1 text-sm font-medium transition-all duration-200",c.value===B?"bg-primary_alt":"bg-base-100 text-gray-400 hover:bg-primary_alt hover:text-white"])},[e.createElementVNode("p",null,e.toDisplayString(B),1),B==="Próximos"?(e.openBlock(),e.createElementBlock("svg",b4,[...k[7]||(k[7]=[e.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 12Zm11-4a1 1 0 1 0-2 0v4a1 1 0 0 0 .293.707l3 3a1 1 0 0 0 1.414-1.414L13 11.586V8Z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",x4,[...k[8]||(k[8]=[e.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 12Zm13.707-1.293a1 1 0 0 0-1.414-1.414L11 12.586l-1.793-1.793a1 1 0 0 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l4-4Z","clip-rule":"evenodd"},null,-1)])]))],10,k4))),256))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",w4,[e.withDirectives(e.createVNode(q3,{listState:c.value,"onUpdate:listState":k[1]||(k[1]=B=>c.value=B),onOpenForm:k[2]||(k[2]=B=>p(B))},null,8,["listState"]),[[e.vShow,f.value==="list"]]),f.value==="create"||f.value==="edit"?(e.openBlock(),e.createBlock(l4,{key:0,modelValue:l.value,"onUpdate:modelValue":k[3]||(k[3]=B=>l.value=B),ref_key:"formRef",ref:r,"view-only":o.viewOnly},null,8,["modelValue","view-only"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",E4,[f.value!=="list"&&!o.viewOnly?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:s.value,class:"btn-save-reminder bg-primary hover:bg-primary_alt disabled:opacity-50 disabled:cursor-not-allowed",onClick:d},[s.value?(e.openBlock(),e.createElementBlock("div",B4)):!s.value&&f.value==="edit"?(e.openBlock(),e.createElementBlock("p",v4,"Salvar")):(e.openBlock(),e.createElementBlock("p",V4,"Criar"))],8,C4)):e.createCommentVNode("",!0)])])])])]))}},[["__scopeId","data-v-7a21f1ac"]]),Kr={scheduled_messages:"#3b82f6",attendant_reminder:"#f59e0b"},Jr=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function S4(t=""){let n=2166136261;for(let a=0;a<t.length;a++)n^=t.charCodeAt(a),n=Math.imul(n,16777619);return n>>>0}function N4(t={}){var s,i,d,u,c,m,f,h,p,g,y;const n=t.functionName||t.function||((s=t==null?void 0:t.params)==null?void 0:s.function);if(n)return`fn:${n}`;const a=(t==null?void 0:t.departmentName)||((d=(i=t==null?void 0:t.info)==null?void 0:i.department)==null?void 0:d.name)||((c=(u=t==null?void 0:t.info)==null?void 0:u.department)==null?void 0:c.id);if(a)return`dept:${a}`;const o=(t==null?void 0:t.instanceName)||((f=(m=t==null?void 0:t.info)==null?void 0:m.instance)==null?void 0:f.name)||((p=(h=t==null?void 0:t.info)==null?void 0:h.instance)==null?void 0:p.id);if(o)return`inst:${o}`;const r=(t==null?void 0:t.protocol)??((g=t==null?void 0:t.info)==null?void 0:g.protocol);if(r!=null)return`proto:${r}`;const l=(t==null?void 0:t.chatId)||((y=t==null?void 0:t.params)==null?void 0:y.chat_id);return l?`chat:${l}`:"misc"}function na(t={}){var r;const n=t.functionName||t.function||((r=t==null?void 0:t.params)==null?void 0:r.function);if(n&&Object.prototype.hasOwnProperty.call(Kr,n))return Kr[n];const a=N4(t),o=S4(String(a))%Jr.length;return Jr[o]}const _t=jt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),getters:{logged_attendant:t=>()=>t.attendants.find(n=>n.is_me)},actions:{async fetchAttendants(){try{this.attendants=[];let t=`${q0}`;const n=await Pe.get(t);this.attendants=n.data,this.count=this.attendants.length}catch(t){console.log("Erro ao buscar atendentes:",t)}},removeAttendants(t){this.attendants=this.attendants.filter(n=>n.id!==t)},addAttendants(t){const n=this.attendants.findIndex(a=>a.id===t.id);n!==-1?this.attendants[n]=t:this.attendants.push(t)}}}),M4={class:"itemc-head"},A4={class:"sched-pop sched-pop--right",tabindex:"0","aria-haspopup":"true"},$4={class:"sched-pop__card bg-base-300",role:"dialog"},_4={class:"minw0"},D4={class:"itemc-title"},T4={class:"itemc-sub"},L4={class:"flex items-center gap-1"},F4={class:"itemc-actions"},P4={class:"flex flex-col items-center"},z4={class:"time-badge"},O4={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},R4={class:"sched-pop__card bg-base-300",role:"dialog"},H4={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},j4={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"},G4=["disabled"],I4={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"},q4={key:1,class:"loading-spinner"},W4=["disabled"],U4={class:"itemsb-head"},Z4={class:"avatar-wrap"},Y4=["src"],X4={key:1,class:"avatar avatar--placeholder bg-base-100"},Q4={key:0,viewBox:"0 0 24 24",class:"icon-5 icon-muted"},K4={key:1,title:"Lembrete"},J4={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},e5={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},t5={class:"itemsb-main"},n5={class:"itemsb-row"},a5={class:"itemsb-title truncate"},o5={class:"flex flex-col items-center"},r5={class:"itemsb-time"},l5={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},s5={class:"sched-pop__card bg-base-300",role:"dialog"},i5={class:"itemsb-sub"},c5={class:"items-attendant"},d5={key:0,class:"itemsb-content"},u5={key:1,class:"itemsb-content"},m5={key:2,class:"itemsb-actions"},f5=["disabled"],p5={key:0,class:"loading-spinner"},h5=["disabled"],g5={class:"event-left"},y5={class:"sched-pop sched-pop--right",tabindex:"0","aria-haspopup":"true"},k5={class:"sched-pop__card bg-base-300",role:"dialog"},b5={class:"event-line"},x5={class:"event-actions"},w5={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},E5={class:"sched-pop__card bg-base-300",role:"dialog"},C5={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},B5={class:"sched-pop__card bg-base-300",role:"dialog"},v5={class:"event-time"},V5={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},S5={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"},N5=["disabled"],M5={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"},A5={key:1,class:"loading-spinner"},$5=["disabled"],Ka=ke({__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","edit-reminder"],setup(t,{emit:n}){const a=_t(),o=t,r=e.computed(()=>(o.getEventColor||na)(o.ev)),l=e.computed(()=>{var c;return((c=o.ev)==null?void 0:c.type)==="scheduled_messages"}),s=e.computed(()=>{var c;return((c=o.ev)==null?void 0:c.type)==="attendant_reminder"}),i=e.computed(()=>a.attendants.find(c=>c.is_me)||{}),d=c=>{const m=a.attendants.find(f=>f.id===c);return m?m.id===i.value.id?"Você":m.name||"Desconhecido":"Desconhecido"},u=e.computed(()=>{var m,f;const c=[];return(m=o.ev)!=null&&m.contactName&&c.push(o.ev.contactName),c.push(((f=o.ev)==null?void 0:f.departmentName)||"sem depto"),c.join(" • ")});return(c,m)=>{var f,h,p,g,y,k,B,b;return t.mode==="compact"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("header",M4,[e.createElementVNode("div",A4,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"color-bar"},null,4),e.createElementVNode("div",$4,[m[9]||(m[9]=e.createElementVNode("strong",null,"Tipo",-1)),m[10]||(m[10]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.type==="attendant_reminder"?"Lembrete":"Mensagem programada"),1)])]),e.createElementVNode("div",_4,[e.createElementVNode("div",D4,[l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.ev.contactName?t.ev.contactName+" • ":"")+" "+e.toDisplayString(t.ev.departmentName||"sem depto"),1)],64)):s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.ev.raw.params.message[0].title),1)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",T4,[e.createElementVNode("span",L4,[m[11]||(m[11]=e.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"},[e.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)),e.createTextVNode(" "+e.toDisplayString(d(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("footer",F4,[e.createElementVNode("div",P4,[e.createElementVNode("div",z4,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",O4,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["status-bar",(f=t.ev)!=null&&f.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",R4,[m[12]||(m[12]=e.createElementVNode("strong",null,"Status",-1)),m[13]||(m[13]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])]),e.createElementVNode("button",{onClick:m[0]||(m[0]=x=>s.value?c.$emit("edit-reminder",t.ev):c.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary"},[((h=t.ev)==null?void 0:h.status)===!0?(e.openBlock(),e.createElementBlock("svg",H4,[...m[14]||(m[14]=[e.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)])])):(e.openBlock(),e.createElementBlock("svg",j4,[...m[15]||(m[15]=[e.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)])]))]),e.createElementVNode("button",{onClick:m[1]||(m[1]=x=>c.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--danger",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",I4,[...m[16]||(m[16]=[e.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)])])),t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",q4)):e.createCommentVNode("",!0)],8,G4),e.createElementVNode("button",{disabled:!l.value,class:"disabled:opacity-90 cyber-button cyber-button--xs cyber-button--accent",onClick:m[2]||(m[2]=x=>c.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...m[17]||(m[17]=[e.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.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)])],8,W4)])],64)):t.mode==="sidebar"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",U4,[e.createElementVNode("div",Z4,[t.ev.contactPhoto?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.ev.contactPhoto,alt:"",class:"avatar",loading:"lazy"},null,8,Y4)):(e.openBlock(),e.createElementBlock("div",X4,[l.value?(e.openBlock(),e.createElementBlock("svg",Q4,[...m[18]||(m[18]=[e.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"},null,-1)])])):(e.openBlock(),e.createElementBlock("span",K4,[...m[19]||(m[19]=[e.createElementVNode("svg",{class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M17.133 12.632v-1.8a5.406 5.406 0 0 0-4.154-5.262.955.955 0 0 0 .021-.106V3.1a1 1 0 0 0-2 0v2.364a.955.955 0 0 0 .021.106 5.406 5.406 0 0 0-4.154 5.262v1.8C6.867 15.018 5 15.614 5 16.807 5 17.4 5 18 5.538 18h12.924C19 18 19 17.4 19 16.807c0-1.193-1.867-1.789-1.867-4.175ZM8.823 19a3.453 3.453 0 0 0 6.354 0H8.823Z"})],-1)])]))])),e.createElementVNode("div",J4,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-dot-avatar",((p=t.ev)==null?void 0:p.type)==="attendant_reminder"?"status--reminder":"status--scheduled"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",e5,[m[20]||(m[20]=e.createElementVNode("strong",null,"Status",-1)),m[21]||(m[21]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(((g=t.ev)==null?void 0:g.type)==="attendant_reminder"?"Lembrete":"Mensagem programada"),1)])])]),e.createElementVNode("div",t5,[e.createElementVNode("div",n5,[e.createElementVNode("span",a5,[l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.ev.contactName)+" • "+e.toDisplayString(t.ev.departmentName||"sem depto"),1)],64)):s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.ev.raw.params.message[0].title),1)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("section",o5,[e.createElementVNode("span",r5,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",l5,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-bar",(y=t.ev)!=null&&y.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",s5,[m[22]||(m[22]=e.createElementVNode("strong",null,"Status",-1)),m[23]||(m[23]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])])]),e.createElementVNode("div",i5,[e.createElementVNode("span",c5,[m[24]||(m[24]=e.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"},[e.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)),e.createTextVNode(" "+e.toDisplayString(d(t.ev.scheduled_by)),1)])])])]),s.value?(e.openBlock(),e.createElementBlock("p",d5,e.toDisplayString(t.ev.raw.params.message[0].content),1)):(e.openBlock(),e.createElementBlock("p",u5,e.toDisplayString(t.ev.content),1)),t.viewOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",m5,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:m[3]||(m[3]=x=>s.value?c.$emit("edit-reminder",t.ev):c.$emit("open-message",t.ev))},e.toDisplayString(((k=t.ev)==null?void 0:k.status)===!0?"Editar":"Visualizar"),1),e.createElementVNode("button",{onClick:m[4]||(m[4]=x=>c.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--sm cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",p5)):e.createCommentVNode("",!0),m[25]||(m[25]=e.createTextVNode(" Apagar ",-1))],8,f5),e.createElementVNode("button",{disabled:!l.value,type:"button",class:"disabled:opacity-90 cyber-button cyber-button--sm cyber-button--accent",onClick:m[5]||(m[5]=x=>c.$emit("open-chat",t.ev))}," Abrir conversa ",8,h5)]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",g5,[e.createElementVNode("div",y5,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),e.createElementVNode("div",k5,[m[26]||(m[26]=e.createElementVNode("strong",null,"Tipo",-1)),m[27]||(m[27]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.type==="attendant_reminder"?"Lembrete":"Mensagem programada"),1)])]),e.createElementVNode("div",b5,[l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(u.value),1)],64)):s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.ev.raw.params.message[0].title),1)],64)):e.createCommentVNode("",!0)])]),e.createElementVNode("footer",x5,[e.createElementVNode("div",w5,[m[30]||(m[30]=e.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"},[e.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)),e.createElementVNode("div",E5,[m[28]||(m[28]=e.createElementVNode("strong",null,"Agendado por",-1)),m[29]||(m[29]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(d(t.ev.scheduled_by)),1)])]),e.createElementVNode("div",C5,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-bar",(B=t.ev)!=null&&B.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",B5,[m[31]||(m[31]=e.createElementVNode("strong",null,"Status",-1)),m[32]||(m[32]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])]),e.createElementVNode("div",v5,e.toDisplayString(t.ev.time),1),e.createElementVNode("button",{onClick:m[6]||(m[6]=x=>s.value?c.$emit("edit-reminder",t.ev):c.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((b=t.ev)==null?void 0:b.status)===!0?(e.openBlock(),e.createElementBlock("svg",V5,[...m[33]||(m[33]=[e.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)])])):(e.openBlock(),e.createElementBlock("svg",S5,[...m[34]||(m[34]=[e.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)])]))]),e.createElementVNode("button",{onClick:m[7]||(m[7]=x=>c.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",M5,[...m[35]||(m[35]=[e.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)])])),t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",A5)):e.createCommentVNode("",!0)],8,N5),e.createElementVNode("button",{disabled:!l.value,class:"cyber-button cyber-button--xs cyber-button--accent",onClick:m[8]||(m[8]=x=>c.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...m[36]||(m[36]=[e.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.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)])],8,$5)])],64))}}},[["__scopeId","data-v-811ab961"]]),_5={class:"cpk-header bg-base-200"},D5={class:"left"},T5=["title"],L5={class:"right"},F5=["title"],P5={class:"toggle"},z5=["aria-pressed","title"],O5={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},R5={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},H5=ke({__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(t){return(n,a)=>(e.openBlock(),e.createElementBlock("header",_5,[e.createElementVNode("div",D5,[e.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]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])]),e.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]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M15.5 19 9 12l6.5-7 1.5 1.3L12.3 12l4.7 5.7z"})],-1),e.createElementVNode("span",{class:"label-md"},"Anterior",-1)])]),e.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]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24","aria-hidden":"true"},[e.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),e.createElementVNode("span",{class:"label-md"},"Hoje",-1)])]),e.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]=[e.createElementVNode("span",{class:"label-md"},"Próximo",-1),e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M8 19l6.5-7L8 5l-1.5 1.3L11.7 12 6.5 17.7z"})],-1)])])]),e.createElementVNode("h2",{class:"month-title",title:`${t.month} ${t.year}`},e.toDisplayString(t.month)+" "+e.toDisplayString(t.year),9,T5),e.createElementVNode("div",L5,[e.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]=e.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"},[e.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)),t.filterCount>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:"filter-badge",title:`${t.filterCount} filtro${t.filterCount>1?"s":""} ativo${t.filterCount>1?"s":""}`},e.toDisplayString(t.filterCount),9,F5)):e.createCommentVNode("",!0)]),e.createElementVNode("div",P5,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--sm btn-ghost",t.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]=[e.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[e.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),e.createElementVNode("span",{class:"label-lg"},"Calendário",-1)])],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--sm btn-ghost",t.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]=[e.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[e.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),e.createElementVNode("span",{class:"label-lg"},"Agenda",-1)])],2)]),e.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":t.isCompact,title:t.isCompact?"Sair do modo compacto":"Ativar modo compacto"},[t.isCompact?(e.openBlock(),e.createElementBlock("svg",R5,[...a[16]||(a[16]=[e.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)])])):(e.openBlock(),e.createElementBlock("svg",O5,[...a[15]||(a[15]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8h4V4m12 4h-4V4M4 16h4v4m12-4h-4v4"},null,-1)])]))],8,z5)])]))}},[["__scopeId","data-v-e367c35d"]]),j5=["title"],G5={class:"week-header"},I5=ke({__name:"WeekDays",props:{weekDays:{type:Array,default:()=>[]},month:String,year:[String,Number]},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h2",{class:"month-title",title:`${t.month} ${t.year}`},e.toDisplayString(t.month)+" "+e.toDisplayString(t.year),9,j5),e.createElementVNode("div",G5,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.weekDays,o=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"week-cell"},e.toDisplayString(o),1))),128))])],64))}},[["__scopeId","data-v-a59e7945"]]),q5=["onClick"],W5={key:0,class:"cell-today-indicator show-lg"},U5={class:"cell-top"},Z5={class:"day-number"},Y5={key:1,class:"more"},X5={class:"bars-wrap"},Q5=4,K5=8,el=4,tl=2,J5=1,e6=ke({__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(t){const n=t,a=e.ref({}),o=new Map;function r(p){const g=(p==null?void 0:p.clientWidth)||0,y=(p==null?void 0:p.clientHeight)||0;if(!g||!y)return{cols:0,rows:0,widths:[],sum:0};const k=Math.max(0,Math.floor((g+el)/(Q5+el))),B=Math.max(0,Math.floor((y+tl)/(K5+tl))),b=i(k,B),x=b.reduce((v,_)=>v+_,0);return{cols:k,rows:B,widths:b,sum:x}}function l(p,g){const y=r(g),k=a.value[p];(!k||k.cols!==y.cols||k.rows!==y.rows||k.sum!==y.sum)&&(a.value={...a.value,[p]:y})}function s(p,g){if(!g){const k=o.get(p);if(k&&(k.disconnect(),o.delete(p)),a.value[p]!=null){const B={...a.value};delete B[p],a.value=B}return}l(p,g);const y=new ResizeObserver(()=>l(p,g));y.observe(g),o.set(p,y)}e.onBeforeUnmount(()=>{o.forEach(p=>p.disconnect()),o.clear()});function i(p,g){if(p<=0||g<=0)return[];const y=[],k=.25;for(let B=0;B<g;B++){const b=B/Math.max(1,g-1),x=k+(1-k)*b,v=Math.max(1,Math.round(p*x));y.push(Math.min(v,p))}return y}function d(p,g){var x;const y=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,k=((x=a.value[p])==null?void 0:x.sum)??0;if(y<=k)return{bars:y,overflow:0};const B=Math.max(0,k-J5),b=Math.max(0,y-B);return{bars:B,overflow:b}}function u(p,g){const y=a.value[p];if(!y||y.rows===0||y.cols===0)return[];const{widths:k}=y,b=d(p,g).bars,x=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,b):[])||[],v=k.map(()=>[]);let _=0;for(let R=k.length-1;R>=0&&_<x.length;R--){const L=Math.min(k[R],x.length-_);v[R]=x.slice(_,_+L),_+=L}return v}const c=e.ref(null);function m(p){return p&&p.nodeType===1&&typeof p.getBoundingClientRect=="function"}function f(p){if(!m(p))return;const g=c.value,y=g&&m(g)?g:p.offsetParent;if(!m(y))return;let k,B;try{k=p.getBoundingClientRect(),B=y.getBoundingClientRect()}catch{return}const b=y.scrollLeft||0,x=y.scrollTop||0;p.style.position="absolute",p.style.zIndex="0",p.style.top=`${k.top-B.top+x}px`,p.style.left=`${k.left-B.left+b}px`,p.style.width=`${k.width}px`,p.style.height=`${k.height}px`,p.style.pointerEvents="none"}function h(p){!p||!p.style||requestAnimationFrame(()=>{!p||!p.style||(p.style.position="",p.style.zIndex="",p.style.top="",p.style.left="",p.style.width="",p.style.height="",p.style.pointerEvents="")})}return(p,g)=>(e.openBlock(),e.createBlock(e.TransitionGroup,{name:"cal-fade","move-class":"cal-move",tag:"div",class:"cal-grid calendar-grid",appear:"",ref_key:"gridRef",ref:c,onBeforeLeave:f,onAfterLeave:h},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.startOffset,y=>(e.openBlock(),e.createElementBlock("div",{key:"x"+y,class:"cal-cell day-empty bg-base-300 border border-base-100"}))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.monthDays,(y,k)=>(e.openBlock(),e.createElementBlock("div",{key:y.key,style:e.normalizeStyle({"--i":k}),class:e.normalizeClass(["cal-cell day-cell border border-base-100 bg-base-200 hover:bg-base-100",[t.isSameMonthFn(y.date,t.viewDate)?"":"opacity-60",t.isSelectedDayFn(y.date)?"neon-selected":"",t.isTodayFn(y.date)?"is-today":"",t.dayEventCountFn(y.date)>0?"has-events":""]]),onClick:B=>t.selectDayFn(y.date)},[t.isTodayFn(y.date)?(e.openBlock(),e.createElementBlock("div",W5," Hoje ")):e.createCommentVNode("",!0),e.createElementVNode("div",U5,[e.createElementVNode("span",Z5,e.toDisplayString(y.date.getDate()),1)]),d(y.key,y.date).overflow>0?(e.openBlock(),e.createElementBlock("span",Y5," +"+e.toDisplayString(d(y.key,y.date).overflow),1)):e.createCommentVNode("",!0),e.createElementVNode("div",X5,[e.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:B=>s(y.key,B)},[d(y.key,y.date).bars>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u(y.key,y.date),(B,b)=>(e.openBlock(),e.createElementBlock("div",{key:"vrow"+b,class:"vrow"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B,(x,v)=>(e.openBlock(),e.createElementBlock("span",{key:"vbar"+b+"-"+v,class:"vbar",style:e.normalizeStyle({background:e.unref(na)(x),boxShadow:`0 0 8px ${e.unref(na)(x)}70`})},null,4))),128))]))),128)):e.createCommentVNode("",!0)],512)])],14,q5))),128))]),_:1},512))}},[["__scopeId","data-v-82c146bb"]]),t6={class:"agenda-section"},n6={key:0,class:"empty-state"},a6={key:1,class:"day-list"},o6={class:"date-trail"},r6={class:"weekday-short"},l6={class:"date-pill bg-base-200 border border-base-300"},s6={class:"date-pill-month"},i6={class:"date-pill-day"},c6={class:"content-col"},d6={class:"day-header"},u6={class:"agenda-title"},m6={class:"month-header-text"},f6={class:"events-list"},p6=ke({__name:"AgendaList",props:{days:{type:Array,default:()=>[]},weekdayLong:Function,weekdayShort:Function,monthShort:Function,monthLabelOf:Function,year:Number},emits:["open-chat","open-message","delete-message","edit-reminder"],setup(t,{emit:n}){return(a,o)=>(e.openBlock(),e.createElementBlock("section",t6,[t.days.length===0?(e.openBlock(),e.createElementBlock("div",n6," Sem eventos neste mês. ")):(e.openBlock(),e.createElementBlock("ul",a6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.days,r=>{var l;return e.openBlock(),e.createElementBlock("li",{key:r.key,class:"day-item border-base-200"},[e.createElementVNode("div",o6,[e.createElementVNode("div",r6,e.toDisplayString(t.weekdayShort(r.date)),1),e.createElementVNode("div",l6,[e.createElementVNode("div",s6,e.toDisplayString(t.monthShort(r.date)),1),e.createElementVNode("div",i6,e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",{style:e.normalizeStyle({background:e.unref(na)(((l=r.events)==null?void 0:l[0])||{})}),class:"date-pill-dot"},null,4)])]),e.createElementVNode("div",c6,[e.createElementVNode("div",d6,[e.createElementVNode("h3",u6,e.toDisplayString(t.weekdayLong(r.date).toUpperCase())+" "+e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",m6,e.toDisplayString(t.monthLabelOf(r.date).toUpperCase())+" "+e.toDisplayString(t.year),1)]),e.createElementVNode("ul",f6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.events,s=>(e.openBlock(),e.createElementBlock("li",{key:s.id,class:"event-item border border-base-100 bg-base-200 hover:bg-base-100"},[e.createVNode(Ka,{ev:s,mode:"agenda",onOpenMessage:o[0]||(o[0]=i=>a.$emit("open-message",i)),onOpenChat:o[1]||(o[1]=i=>a.$emit("open-chat",i)),onDeleteMessage:o[2]||(o[2]=i=>a.$emit("delete-message",i)),onEditReminder:o[3]||(o[3]=i=>a.$emit("edit-reminder",i))},null,8,["ev"])]))),128))])])])}),128))]))]))}},[["__scopeId","data-v-022bc946"]]),h6=["data-mode","data-empty"],g6=["disabled"],nl=ke({__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","edit-reminder"],setup(t){const n=t,a=e.computed(()=>n.mode==="compact"?n.selectedLabelLong||"Hoje":`Eventos em ${n.selectedLabel||"—"}`);return(o,r)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["bg-base-300 daylist",[t.mode==="compact"?"daylist--compact has-border border-base-200":"daylist--sidebar has-border border-base-200 supports-blur",{"daylist--tight":t.mode==="compact"&&!t.loading&&t.events.length===0}]]),"data-mode":t.mode,"data-empty":!t.loading&&t.events.length===0?"1":"0"},[e.createElementVNode("div",{class:e.normalizeClass(["daylist-header",t.mode==="compact"?"daylist-header--compact bg-base-300":"daylist-header--sidebar bg-base-300"])},[e.createElementVNode("h3",{class:e.normalizeClass(t.mode==="compact"?"daylist-title--compact":"daylist-title--sidebar")},e.toDisplayString(a.value),3),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:r[0]||(r[0]=l=>o.$emit("reload")),disabled:t.loading},e.toDisplayString(t.loading?"Atualizando…":"Atualizar"),9,g6)],2),t.loading?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:"fade"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["loading-text",t.mode==="compact"?"is-compact":"is-sidebar"])}," Carregando… ",2)]),_:1})):t.events.length===0?(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"fade"},{default:e.withCtx(()=>[...r[5]||(r[5]=[e.createElementVNode("div",{class:"empty-text"},"Sem eventos.",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.TransitionGroup,{key:2,name:"list","move-class":"list-move",tag:"ul",appear:"",class:e.normalizeClass([t.mode==="compact"?"list-compact has-border border-base-300 bg-base-200 supports-blur":"list-sidebar"])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.events,(l,s)=>(e.openBlock(),e.createElementBlock("li",{key:l.id,style:e.normalizeStyle({"--i":s}),class:e.normalizeClass(t.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 ")},[e.createVNode(Ka,{ev:l,mode:t.mode==="compact"?"compact":"sidebar",onOpenMessage:r[1]||(r[1]=i=>o.$emit("open-message",i)),onOpenChat:r[2]||(r[2]=i=>o.$emit("open-chat",i)),onDeleteMessage:r[3]||(r[3]=i=>o.$emit("delete-message",i)),onEditReminder:r[4]||(r[4]=i=>o.$emit("edit-reminder",i))},null,8,["ev","mode"])],6))),128))]),_:1},8,["class"]))],10,h6))}},[["__scopeId","data-v-d4438400"]]),y6={class:"cpk-popover__header border-base-100"},k6={class:"filter-body"},b6={class:"row"},x6=["checked"],w6={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},E6={class:"status-wrap"},C6={class:"seg"},B6=ke({__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(t,{emit:n}){const a=t,o=n,r=_t(),l=e.computed(()=>r.attendants.find(L=>L.is_me)||null),s=e.reactive({onlyMine:!1,status:null});e.watch(()=>a.open,async L=>{var S,N,w;if(!L)return;await e.nextTick();const A=(S=l.value)!=null&&S.id?String(l.value.id):null;s.onlyMine=!!A&&String(((N=a.filters)==null?void 0:N.scheduled_by)??"")===A;const M=(w=a.filters)==null?void 0:w.status;s.status=M===!0||M===!1?M:null,y()},{immediate:!1});function i(L,A){if(!L)return{};const{[A]:M,...S}=L;return S}function d(L){var M;s.onlyMine=!!L.target.checked;const A=(M=l.value)!=null&&M.id?String(l.value.id):null;s.onlyMine&&A?o("update:filters",{...a.filters,scheduled_by:A}):o("update:filters",i(a.filters,"scheduled_by"))}function u(L){if(s.status===L){s.status=null;const A=i(a.filters,"status");o("update:filters",A)}else s.status=L,o("update:filters",{...a.filters,status:L})}const c=e.ref(null),m=e.ref({left:0,top:0,placed:"bottom"}),f=e.computed(()=>({position:"fixed",left:`${m.value.left}px`,top:`${m.value.top}px`}));function h(){const L=a.anchorEl instanceof Element?a.anchorEl:null;if(L!=null&&L.getBoundingClientRect)return L.getBoundingClientRect();const A=window.innerWidth/2,M=window.innerHeight/3;return{left:A,right:A,top:M,bottom:M,width:0,height:0}}function p(L,A,M,S){return{left:Math.max(8,Math.min(L,window.innerWidth-M-8)),top:Math.max(8,Math.min(A,window.innerHeight-S-8))}}function g(){const L=h(),A=c.value,M=(A==null?void 0:A.offsetWidth)??300,S=(A==null?void 0:A.offsetHeight)??220;let N=L.bottom+a.offset,w;if(a.align==="center"?w=L.left+L.width/2-M/2:a.align==="end"?w=L.right-M:w=L.left,N+S>window.innerHeight-4){const O=L.top-S-a.offset;O>=4?(N=O,m.value.placed="top"):m.value.placed="bottom"}else m.value.placed="bottom";const C=p(w,N,M,S);m.value={left:C.left,top:C.top,placed:m.value.placed}}function y(){g(),requestAnimationFrame(g)}let k,B,b=[];function x(){v(),b=[window];const L=a.anchorEl instanceof Element?a.anchorEl:null;let A=L==null?void 0:L.parentElement;for(;A&&A!==document.body;){const M=getComputedStyle(A);/(auto|scroll)/.test(M.overflow+M.overflowY+M.overflowX)&&b.push(A),A=A.parentElement}b.forEach(M=>M.addEventListener("scroll",y,{passive:!0}))}function v(){b.forEach(L=>{var A;return(A=L.removeEventListener)==null?void 0:A.call(L,"scroll",y)}),b=[]}e.watch(()=>a.open,async L=>{var M,S,N,w;if(!L){v(),(M=k==null?void 0:k.disconnect)==null||M.call(k),(S=B==null?void 0:B.disconnect)==null||S.call(B);return}await e.nextTick(),y(),x(),(N=k==null?void 0:k.disconnect)==null||N.call(k),k=new ResizeObserver(y),k.observe(document.body),(w=B==null?void 0:B.disconnect)==null||w.call(B);const A=a.anchorEl instanceof Element?a.anchorEl:null;A&&(B=new ResizeObserver(y),B.observe(A)),window.addEventListener("resize",y)}),e.watch(()=>a.anchorEl,async()=>{a.open&&(await e.nextTick(),x(),y())});function _(L){L.key==="Escape"&&o("close")}function R(L){if(!a.open)return;const A=L.target,M=c.value;if(M&&M.contains(A))return;const S=a.anchorEl instanceof Element?a.anchorEl:null;S&&S.contains&&S.contains(A)||o("close")}return e.onMounted(()=>{document.addEventListener("pointerdown",R,!0),window.addEventListener("keydown",_)}),e.onBeforeUnmount(()=>{var L,A;document.removeEventListener("pointerdown",R,!0),window.removeEventListener("keydown",_),v(),(L=k==null?void 0:k.disconnect)==null||L.call(k),(A=B==null?void 0:B.disconnect)==null||A.call(B)}),(L,A)=>(e.openBlock(),e.createBlock(e.Transition,{name:"cpk-layer",appear:""},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:A[4]||(A[4]=e.withModifiers(M=>L.$emit("close"),["self"]))},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:c,class:"cpk-popover bg-base-300",style:e.normalizeStyle(f.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[e.createElementVNode("div",y6,[A[5]||(A[5]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),A[6]||(A[6]=e.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:A[0]||(A[0]=M=>L.$emit("close")),"aria-label":"Fechar"}," × ")]),e.createElementVNode("div",k6,[e.createElementVNode("label",b6,[e.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:A[1]||(A[1]=M=>d(M)),"aria-label":"Exibir somente meus eventos"},null,40,x6),A[7]||(A[7]=e.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),e.createElementVNode("div",w6,[A[9]||(A[9]=e.createElementVNode("span",{class:"status-icon","aria-hidden":"true"},[e.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"},[e.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)),e.createElementVNode("div",E6,[A[8]||(A[8]=e.createElementVNode("div",{class:"label-cpk"},[e.createTextVNode(" Status "),e.createElementVNode("span",{class:"sched-pop",tabindex:"0","aria-label":"Ajuda sobre status"},[e.createElementVNode("span",{class:"sched-pop__mark"},[e.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"},[e.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"})])]),e.createElementVNode("div",{class:"sched-pop__card bg-base-300",style:{"--popover-brd":"var(--cyber-border)",transform:"translate(-5%, -50%) scale(0.98)"}},[e.createElementVNode("div",null,[e.createElementVNode("span",{style:{"font-weight":"600"}},"Ativos:"),e.createTextVNode(" Eventos que estão programados para ocorrer ")]),e.createElementVNode("div",null,[e.createElementVNode("span",{style:{"font-weight":"600"}},"Executados:"),e.createTextVNode(" Eventos que já ocorreram ")])])])],-1)),e.createElementVNode("div",C6,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:A[2]||(A[2]=M=>u(!0)),"aria-pressed":"state.status === true"}," Ativos ",2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!1?"is-active":""]),onClick:A[3]||(A[3]=M=>u(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):e.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-cc8bb01a"]]),v6={class:"calendar-content"},V6={key:0},aa=80,al=ke({__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(t,{expose:n,emit:a}){const o=t,r=Ya();r.setBaseUrl(o.sourceUrl);const l=new Date,s=e.ref(_(o.initialDate)),i=e.ref(new Date(l.getFullYear(),l.getMonth(),l.getDate())),d=e.ref("calendar"),u=e.ref(!1),c=e.ref(0),m=e.ref(0),f=e.computed(()=>u.value?{transform:`translateX(${m.value}px)`}:{});function h(){u.value=!1,c.value=0,m.value=0}function p(P){var Z,X;if(!(P.pointerType==="mouse"&&P.button!==0)){u.value=!0,c.value=P.clientX;try{(X=(Z=P.target).setPointerCapture)==null||X.call(Z,P.pointerId)}catch{}}}function g(P){u.value&&(m.value=P.clientX-c.value)}function y(P){var X,me;if(!u.value)return;const Z=m.value;try{(me=(X=P.target).releasePointerCapture)==null||me.call(X,P.pointerId)}catch{}h(),Z<-aa?C():Z>aa&&w()}function k(P){var Z,X;try{(X=(Z=P.target).releasePointerCapture)==null||X.call(Z,P.pointerId)}catch{}h()}function B(P){const Z=P.touches&&P.touches[0];Z&&(u.value=!0,c.value=Z.clientX,m.value=0)}function b(P){if(!u.value)return;const Z=P.touches&&P.touches[0];Z&&(m.value=Z.clientX-c.value)}function x(P){if(!u.value)return;const Z=m.value;h(),Z<-aa?C():Z>aa&&w()}function v(P){h()}function _(P){if(P instanceof Date)return new Date(P.getFullYear(),P.getMonth(),1);if(typeof P=="string"){const[Z,X]=P.split("-").map(me=>parseInt(me,10));return new Date(Z||l.getFullYear(),(X||l.getMonth()+1)-1,1)}return new Date(l.getFullYear(),l.getMonth(),1)}function R(P){return new Date(P.getFullYear(),P.getMonth()+1,0).getDate()}function L(P){return new Date(P.getFullYear(),P.getMonth(),1).getDay()}function A(P,Z){return P.getFullYear()===Z.getFullYear()&&P.getMonth()===Z.getMonth()}function M(P){return Ua(P,l)}function S(P){return Ua(P,i.value)}function N(P){i.value=new Date(P.getFullYear(),P.getMonth(),P.getDate()),A(P,s.value)||(s.value=new Date(P.getFullYear(),P.getMonth(),1))}function w(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function C(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function O(){s.value=new Date(l.getFullYear(),l.getMonth(),1),i.value=new Date(l.getFullYear(),l.getMonth(),l.getDate())}const T=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],V=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],E=e.computed(()=>ye(T[s.value.getMonth()])),$=e.computed(()=>s.value.getFullYear()),D=e.computed(()=>G(i.value)),F=e.computed(()=>`${Q(i.value)} ${i.value.getDate()}`);function G(P){return`${String(P.getDate()).padStart(2,"0")}/${String(P.getMonth()+1).padStart(2,"0")}/${P.getFullYear()}`}function Q(P){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][P.getDay()]}function I(P){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][P.getDay()]}function q(P){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][P.getMonth()]}function re(P){return T[P.getMonth()]}function ye(P){return P.charAt(0).toUpperCase()+P.slice(1)}const de=e.computed(()=>L(s.value)),Ne=e.computed(()=>{const P=R(s.value);return Array.from({length:P},(Z,X)=>{const me=X+1,be=new Date(s.value.getFullYear(),s.value.getMonth(),me);return{key:`d${me}`,date:be}})}),ve=e.ref({open:!1,anchorEl:null});function we(P){ve.value.open=!0,ve.value.anchorEl=(P==null?void 0:P.currentTarget)||null}const{filters:Be}=jt.storeToRefs(r),Te=e.ref(!1),J=e.ref(null),ue=e.ref(!1);function ge(P){J.value=P.raw,ue.value=P.status!==!0,Te.value=!0}function ce(){Te.value=!1,J.value=null,ue.value=!1}const ie=e.computed(()=>dn(s.value)),fe=e.computed(()=>r.eventsOf(ie.value)),j={scheduled_by:P=>{var me,be,Me;const Z=(P==null?void 0:P.scheduled_by)??((be=(me=P==null?void 0:P.raw)==null?void 0:me.params)==null?void 0:be.scheduled_by)??((Me=P==null?void 0:P.raw)==null?void 0:Me.scheduled_by)??(P==null?void 0:P.created_by)??(P==null?void 0:P.attendant_id),X=typeof Z=="object"&&Z?Z.id??Z.attendant_id:Z;return X!=null?String(X):""}};function ee(P,Z){const X=(Z==null?void 0:Z.value)??Z;return!X||typeof X!="object"?!0:Object.entries(X).every(([me,be])=>{var Je,et,tt;if(be==null||be===""||Array.isArray(be)&&be.length===0)return!0;const Me=j[me],_e=(Me==null?void 0:Me(P))??(P==null?void 0:P[me])??((Je=P==null?void 0:P.raw)==null?void 0:Je[me])??((tt=(et=P==null?void 0:P.raw)==null?void 0:et.params)==null?void 0:tt[me])??null,ze=typeof _e=="string"?_e:_e??"";if(typeof be=="function")return!!be(ze,P);if(Array.isArray(be))return be.map(String).includes(String(ze));if(typeof be=="object"){const{in:mt,notIn:Ie,range:lt,contains:on}=be;if(mt&&!mt.map(String).includes(String(ze))||Ie&&Ie.map(String).includes(String(ze)))return!1;if(lt&&typeof ze=="number"){const[kt,vt]=lt;if(kt!=null&&ze<kt||vt!=null&&ze>vt)return!1}if(on!=null){const kt=Array.isArray(ze)?ze:String(ze).split(",");if(!(Array.isArray(on)?on:[on]).some(GA=>kt.map(String).includes(String(GA))))return!1}return!0}return String(ze)===String(be)})}const se=e.computed(()=>(fe.value||[]).filter(Z=>ee(Z,Be)));function oe(P){return se.value.filter(Z=>Ua(Z.date,P))}const U=e.computed(()=>oe(i.value)),ne=e.computed(()=>[...U.value].sort((P,Z)=>P.date-Z.date));function he(P){return oe(P).length}function pe(P){return Math.min(3,he(P))}function xe(P){const Z=he(P);return Z>3?Z-3:0}const Ve=e.computed(()=>{const P=s.value.getFullYear(),Z=s.value.getMonth(),X=new Map;for(const be of se.value){const Me=be==null?void 0:be.date;if(!(Me instanceof Date)||Me.getFullYear()!==P||Me.getMonth()!==Z)continue;const _e=`${P}-${Z+1}-${Me.getDate()}`;X.has(_e)||X.set(_e,{key:`ag-${_e}`,date:new Date(P,Z,Me.getDate()),events:[]}),X.get(_e).events.push(be)}const me=Array.from(X.values());for(const be of me)be.events.sort((Me,_e)=>Me.date-_e.date);return me.sort((be,Me)=>be.date-Me.date),me}),Ce=e.ref(!1),Le=e.ref(!1),Ae=e.computed(()=>Le.value||Ce.value),He=e.computed(()=>Ae?"calendar-stage--compact":"calendar-stage--single");function Se(){var X;const P=window.matchMedia("(max-width: 1280px)"),Z=()=>Le.value=P.matches;Z(),(X=P.addEventListener)==null||X.call(P,"change",Z)}const z=e.computed(()=>r.isLoading(ie.value));e.computed(()=>r.errorOf(ie.value));const W=e.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 Y(P,Z){W.value.open=!0,W.value.context={action:"delete-message",event:P},W.value.title="Confirmar exclusão",W.value.description="Tem certeza que deseja apagar este evento?",W.value.anchorEl=Z&&Z.currentTarget||typeof document<"u"&&document.activeElement||null,W.value.destructive=!0,W.value.confirmLabel="Apagar",W.value.loadingLabel="Apagando…"}async function H(P){if(P)try{if(W.value.loading=!0,P.action==="delete-message"&&await le(P.event),P.event.type==="attendant_reminder"){const Z=Ze.active.reminders.findIndex(X=>X.id===P.event.id);Z!==-1&&Ze.active.reminders.splice(Z,1)}}finally{W.value.loading=!1,W.value.open=!1,W.value.context=null}}function K(){W.value.open=!1,W.value.context=null}async function te(){await r.forceReload(ie.value)}async function le(P){var Z;try{P.deleteLoading=!0;const X=((Z=P==null?void 0:P.raw)==null?void 0:Z.id)??(P==null?void 0:P.id)??P;if(X==null)throw new Error("Evento inválido para exclusão");const me=await u3(Z0,P);return me!=null&&me.ok&&(r.removeFromCache(String(X))||await r.forceReload(ie.value)),me}catch(X){return console.error(X),null}finally{P.deleteLoading=!1}}return e.onMounted(async()=>{Se(),await r.ensureMonthLoaded(ie.value)}),e.watch(()=>o.sourceUrl,async P=>{r.setBaseUrl(P),r.resetAll(),await r.ensureMonthLoaded(ie.value)}),e.watch(ie,async()=>{const P=s.value.getFullYear(),Z=s.value.getMonth(),X=Math.min(i.value.getDate(),R(s.value));i.value=new Date(P,Z,X),await r.ensureMonthLoaded(ie.value)}),n({updateEvent:r.applyUpdateToCache}),(P,Z)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":Ae.value}])},[e.createElementVNode("div",v6,[Z[15]||(Z[15]=e.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),e.createVNode(H5,{month:E.value,year:$.value,"is-compact":Ae.value,"view-mode":d.value,"filter-count":Object.keys(e.unref(Be)).length,onPrev:w,onNext:C,onToday:O,onToggleCompact:Z[0]||(Z[0]=X=>Ce.value=!Ce.value),onSetViewMode:Z[1]||(Z[1]=X=>d.value=X),onClosePage:Z[2]||(Z[2]=X=>P.$emit("close-page")),onOpenFilter:we},null,8,["month","year","is-compact","view-mode","filter-count"]),d.value==="calendar"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["calendar-stage",He.value])},[e.createElementVNode("div",{class:"calendar-stage-main",onPointerdown:p,onPointermove:g,onPointerup:y,onPointercancel:k,onTouchstart:B,onTouchmove:b,onTouchend:x,onTouchcancel:v,style:e.normalizeStyle(f.value)},[e.createVNode(I5,{"week-days":V,month:E.value,year:$.value},null,8,["month","year"]),e.createVNode(e6,{"start-offset":de.value,"month-days":Ne.value,"view-date":s.value,"is-compact":Ae.value,"is-same-month-fn":A,"is-selected-day-fn":S,"is-today-fn":M,"select-day-fn":N,"events-by-day-fn":oe,"day-event-count-fn":he,"event-bars-to-show-fn":pe,"day-event-overflow-fn":xe},null,8,["start-offset","month-days","view-date","is-compact"])],36),Ae.value?(e.openBlock(),e.createBlock(nl,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:z.value,"selected-label-long":F.value,events:ne.value,mode:"compact",onReload:te,onOpenChat:Z[3]||(Z[3]=X=>P.$emit("open-chat",X)),onOpenMessage:Z[4]||(Z[4]=X=>P.$emit("open-message",X)),onDeleteMessage:Z[5]||(Z[5]=(X,me)=>Y(X,me)),onEditReminder:ge},null,8,["loading","selected-label-long","events"])):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(p6,{key:1,days:Ve.value,"weekday-long":Q,"weekday-short":I,"month-short":q,"month-label-of":re,year:$.value,onOpenChat:Z[6]||(Z[6]=X=>P.$emit("open-chat",X)),onOpenMessage:Z[7]||(Z[7]=X=>P.$emit("open-message",X)),onDeleteMessage:Z[8]||(Z[8]=(X,me)=>Y(X,me)),onEditReminder:ge},null,8,["days","year"]))]),e.createVNode(nl,{class:"calendar-daylist calendar-daylist--desktop",loading:z.value,"selected-label":D.value,"selected-label-long":F.value,events:ne.value,mode:Ae.value?"compact":"sidebar",onReload:te,onOpenChat:Z[9]||(Z[9]=X=>P.$emit("open-chat",X)),onOpenMessage:Z[10]||(Z[10]=X=>P.$emit("open-message",X)),onDeleteMessage:Z[11]||(Z[11]=(X,me)=>Y(X,me)),onEditReminder:ge},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),e.createVNode(Q2,{modelValue:W.value.open,"onUpdate:modelValue":Z[12]||(Z[12]=X=>W.value.open=X),title:W.value.title,description:W.value.description,destructive:W.value.destructive,"confirm-label":W.value.confirmLabel,"cancel-label":W.value.cancelLabel,loading:W.value.loading,"loading-label":W.value.loadingLabel,context:W.value.context,"anchor-el":W.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:H,onCancel:K},{details:e.withCtx(()=>{var X;return[(X=W.value.context)!=null&&X.event?(e.openBlock(),e.createElementBlock("div",V6,[e.createVNode(Ka,{"view-only":!0,mode:"sidebar",ev:W.value.context.event},null,8,["ev"])])):e.createCommentVNode("",!0)]}),_:1},8,["modelValue","title","description","destructive","confirm-label","cancel-label","loading","loading-label","context","anchor-el"]),e.createVNode(B6,{open:ve.value.open,"anchor-el":ve.value.anchorEl,filters:e.unref(Be),"onUpdate:filters":Z[13]||(Z[13]=X=>e.isRef(Be)?Be.value=X:null),onClose:Z[14]||(Z[14]=X=>ve.value.open=!1)},null,8,["open","anchor-el","filters"]),Te.value?(e.openBlock(),e.createBlock(Qa,{key:0,"initial-data":J.value,"view-only":ue.value,onClose:ce},null,8,["initial-data","view-only"])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-1072822c"]]),S6={class:"flex flex-col text-center"},N6={class:"flex flex-col space-y-3 justify-center"},M6={class:"space-x-4 flex-col text-black justify-center"},A6=["onUpdate:modelValue","onInput","onKeydown"],ol={__name:"mfa",props:{eventHandling:{type:String,default:null}},emits:["filled","reset"],setup(t,{emit:n}){e.onMounted(()=>{r.value[0].focus()});const a=n,o=e.ref(Array(6).fill("")),r=e.ref([]);e.ref(!1);const l=u=>{const c=o.value[u];o.value[0]<1&&a("reset"),/^\d$/.test(c)?s(u):o.value[u]="",u===o.value.length-1&&o.value.every(m=>m!=="")&&d()},s=u=>{u<o.value.length-1&&o.value[u]&&r.value[u+1].focus()},i=(u,c)=>{c.key==="Backspace"&&!o.value[u]&&u>0&&r.value[u-1].focus()},d=()=>{const u=o.value.join("");a("filled",u)};return(u,c)=>(e.openBlock(),e.createElementBlock("section",S6,[e.createElementVNode("div",N6,[e.createElementVNode("div",M6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,f)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:f,"onUpdate:modelValue":h=>o.value[f]=h,class:e.normalizeClass([t.eventHandling==="check"?"checked_mfa":t.eventHandling==="err"?"err_mfa":"reset_input","inline-block w-10 h-10 rounded-md text-center"]),type:"text",maxlength:"1",onInput:h=>l(f),onKeydown:e.withKeys(h=>i(f,h),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,A6)),[[e.vModelText,o.value[f]]])),128))])])]))}},$6={class:"text-center flex gap-3"},_6={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},D6={key:0,class:"items-center justify-center inline-flex"},T6=["src"],L6={__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(t,{emit:n}){const a=n;e.ref(!1);const o=t,r=()=>{a("generateQR")},l=e.computed(()=>o.base64?o.base64:i.value),s=e.computed(()=>`w-${o.dimensions[0]} h-${o.dimensions[1]}`),i=e.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(d,u)=>(e.openBlock(),e.createElementBlock("div",$6,[e.createElementVNode("section",_6,[t.generated?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.value,"btnQrCode"])},[t.loading?(e.openBlock(),e.createElementBlock("div",D6,[...u[0]||(u[0]=[e.createElementVNode("div",{class:"loaderMFA"},null,-1)])])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"uppercase bg-base-300 p-2 z-40",onClick:r}," Gerar QR "))],2)),e.createElementVNode("img",{class:e.normalizeClass([[s.value,t.generated?"rounded-md":"rounded-none"],""]),src:l.value,alt:"QRCode"},null,10,T6)])]))}},F6={class:"header-buttons-container"},P6=["onClick"],z6={class:"selector-label"},O6=["innerHTML"],R6={class:"selector-text"},H6={key:0,class:"unread-dot","aria-label":"Há mensagens não lidas"},j6={class:"p-2 flex items-center gap-2 relative"},G6={style:{left:"1rem"},class:"text-white size-4 absolute left-4 top-1/2 -translate-y-1/2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},I6=["value","placeholder"],q6=ke({__name:"sectionsHeader",props:{hasUnread:{type:Object,default:()=>({attendants:!1,groups:!1})},currentState:{type:String,default:""},searchQuery:{type:String,default:""}},emits:["update:currentState","update:searchQuery"],setup(t,{emit:n}){const a=t,o=n,r=e.computed(()=>a.currentState==="grupos"),l=e.computed(()=>a.currentState==="atendentes"),s=e.computed(()=>r.value?"Pesquise entre os grupos...":l.value?"Pesquise entre os atendentes...":"Pesquise..."),i=[{label:"Atendentes",value:"atendentes",svg:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-2 9a4 4 0 0 0-4 4v1a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-1a4 4 0 0 0-4-4h-4Z" clip-rule="evenodd"/> </svg>'},{label:"Grupos",value:"grupos",svg:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="M12 6a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm-1.5 8a4 4 0 0 0-4 4 2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-3Zm6.82-3.096a5.51 5.51 0 0 0-2.797-6.293 3.5 3.5 0 1 1 2.796 6.292ZM19.5 18h.5a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-1.1a5.503 5.503 0 0 1-.471.762A5.998 5.998 0 0 1 19.5 18ZM4 7.5a3.5 3.5 0 0 1 5.477-2.889 5.5 5.5 0 0 0-2.796 6.293A3.501 3.501 0 0 1 4 7.5ZM7.1 12H6a4 4 0 0 0-4 4 2 2 0 0 0 2 2h.5a5.998 5.998 0 0 1 3.071-5.238A5.505 5.505 0 0 1 7.1 12Z" clip-rule="evenodd"/> </svg>'}];return(d,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",F6,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,c=>e.createElementVNode("button",{key:c.value,class:e.normalizeClass(["selector-button",{active:a.currentState===c.value}]),onClick:m=>d.$emit("update:currentState",c.value)},[e.createElementVNode("span",z6,[e.createElementVNode("div",{innerHTML:c.svg},null,8,O6),e.createElementVNode("span",R6,e.toDisplayString(c.label),1),a.hasUnread[c.value]?(e.openBlock(),e.createElementBlock("span",H6)):e.createCommentVNode("",!0)])],10,P6)),64))]),e.createElementVNode("div",j6,[(e.openBlock(),e.createElementBlock("svg",G6,[...u[1]||(u[1]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"m21 21-3.5-3.5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"},null,-1)])])),e.createElementVNode("input",{style:{"padding-left":"2rem"},value:t.searchQuery,onInput:u[0]||(u[0]=c=>o("update:searchQuery",c.target.value)),class:"bg-base-300 w-full p-1 border-none focus:border-primary rounded-full text-white placeholder:text-white text-sm",placeholder:s.value},null,40,I6)])],64))}},[["__scopeId","data-v-693c0401"]]),W6=["src"],U6={key:2,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"},Dt=ke({__name:"Avatar",props:{url:{type:String},style:{type:String,default:"size-10"}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500",t.style])},[n.$slots.default?e.renderSlot(n.$slots,"default",{key:0},void 0,!0):t.url?(e.openBlock(),e.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:t.url},null,8,W6)):(e.openBlock(),e.createElementBlock("svg",U6,[...a[0]||(a[0]=[e.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)])]))],2))}},[["__scopeId","data-v-dea35c44"]]);function Z6(t,n=null){if(!t)return!1;const a=t.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 Y6(t){return t?(await e.nextTick(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null):null}function X6(t){let n=`0px 0px ${t.distance}px 0px`;t.top&&(n=`${t.distance}px 0px 0px 0px`);const a=new IntersectionObserver(o=>{o[0].isIntersecting&&(t.firstload&&t.emit(),t.firstload=!0)},{root:t.parentEl,rootMargin:n});return t.infiniteLoading.value&&a.observe(t.infiniteLoading.value),a}async function rl(t,n){if(await e.nextTick(),!t.top)return;const a=t.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const ll=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},Q6={},K6=t=>(e.pushScopeId("data-v-d3e37633"),t=t(),e.popScopeId(),t),J6={class:"container"},e7=K6(()=>e.createElementVNode("div",{class:"spinner"},null,-1)),t7=[e7];function n7(t,n){return e.openBlock(),e.createElementBlock("div",J6,t7)}const a7=ll(Q6,[["render",n7],["__scopeId","data-v-d3e37633"]]),o7={class:"state-error"},Yt=ll(e.defineComponent({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(t,{emit:n}){const a=t;let o=null,r=0;const l=e.ref(null),s=e.ref(""),{top:i,firstload:d,distance:u}=a,{identifier:c,target:m}=e.toRefs(a),f={infiniteLoading:l,top:i,firstload:d,distance:u,parentEl:null,emit(){r=(f.parentEl||document.documentElement).scrollHeight,h.loading(),n("infinite",h)}},h={loading(){s.value="loading"},async loaded(){s.value="loaded",await rl(f,r),Z6(l.value,f.parentEl)&&f.emit()},async complete(){s.value="complete",await rl(f,r),o==null||o.disconnect()},error(){s.value="error"}};function p(){o==null||o.disconnect(),o=X6(f)}return e.watch(c,p),e.onMounted(async()=>{f.parentEl=await Y6(m),p()}),e.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"infiniteLoading",ref:l,class:"v3-infinite-loading"},[e.withDirectives(e.createElementVNode("div",null,[e.renderSlot(g.$slots,"spinner",{},()=>[e.createVNode(a7)],!0)],512),[[e.vShow,s.value=="loading"]]),s.value=="complete"?e.renderSlot(g.$slots,"complete",{key:0},()=>{var k;return[e.createElementVNode("span",null,e.toDisplayString(((k=g.slots)==null?void 0:k.complete)||"No more results!"),1)]},!0):e.createCommentVNode("",!0),s.value=="error"?e.renderSlot(g.$slots,"error",{key:1,retry:f.emit},()=>{var k;return[e.createElementVNode("span",o7,[e.createElementVNode("span",null,e.toDisplayString(((k=g.slots)==null?void 0:k.error)||"Oops something went wrong!"),1),e.createElementVNode("button",{class:"retry",onClick:y[0]||(y[0]=(...B)=>f.emit&&f.emit(...B))},"retry")])]},!0):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]),r7={class:"atendentes-list hide-scrollbar bg-base-300"},l7={key:0,class:"empty-message bg-base-200"},s7=["onClick"],i7={class:"atendente-main"},c7={style:{"background-color":"rgba(2, 169, 219, 0.3)"},class:"relative rounded-full"},d7={class:"flex items-center justify-center mt-0.5 mr-0.8"},u7={key:0,class:"size-8 mt-0.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},m7={key:1,class:"size-8","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},f7={class:""},p7={class:"opacity-50"},h7={class:"flex items-center gap-4"},g7={key:0,class:"message-indicator"},y7=ke({__name:"mountListForType",props:{content:{type:Object,default:()=>({})},mode:{type:String,default:!1},loader:{type:Boolean,default:!1}},setup(t){const n=t,a=e.computed(()=>n.mode==="grupos"),o=e.inject("useChat"),r=()=>{typeof o.openCreateOrEdit=="function"&&o.openCreateOrEdit("create")},l=d=>{typeof o.selectChatToOpen=="function"&&o.selectChatToOpen(d)},s=(d,u)=>({Busy:{indicatorStyle:{backgroundColor:"rgb(239 68 68)"},textStyle:{color:"rgb(252 165 165)"},label:"Ocupado"},Online:{indicatorStyle:{backgroundColor:"rgb(34 197 94)"},textStyle:{color:"rgb(134 239 172)"},label:"Online"},Away:{indicatorStyle:{backgroundColor:"rgb(234 179 8)"},textStyle:{color:"rgb(250 204 21)"},label:"Ausente"},Offline:{indicatorStyle:{backgroundColor:"rgb(107 114 128)"},textStyle:{color:"rgb(209 213 219)"},label:"Offline"},null:{indicatorStyle:{backgroundColor:"rgb(107 114 128)"},textStyle:{color:"rgb(209 213 219)"},label:"Offline"}})[d]||{indicatorStyle:{backgroundColor:"rgb(107 114 128)"},textStyle:{color:"rgb(209 213 219)"},label:u?`Grupo • ${u} membros`:"Grupo"},i=async d=>{if(!a.value||typeof o.loadMoreChannels!="function"){d.complete();return}try{if(await o.loadMoreChannels()){d.loaded();return}d.complete()}catch{d.error()}};return(d,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("ul",r7,[t.content.length===0?(e.openBlock(),e.createElementBlock("li",l7,[...u[1]||(u[1]=[e.createElementVNode("p",null,"não há atendentes disponíveis",-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.content,c=>{var m,f,h;return e.openBlock(),e.createElementBlock("li",{key:c.id,onClick:p=>l(c),class:e.normalizeClass([["atendente-item",c.isMoved?"moved":""],"border-b even:bg-base-300 bg-blue-400/10 border-base-200 hover:bg-base-200 relative"])},[e.createElementVNode("section",i7,[e.createElementVNode("div",c7,[c.photo?(e.openBlock(),e.createBlock(Dt,{key:0,url:c.photo},null,8,["url"])):(e.openBlock(),e.createBlock(Dt,{key:1,url:c.photo},{default:e.withCtx(()=>[e.createElementVNode("div",d7,[a.value?(e.openBlock(),e.createElementBlock("svg",u7,[...u[2]||(u[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 6a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm-1.5 8a4 4 0 0 0-4 4 2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-3Zm6.82-3.096a5.51 5.51 0 0 0-2.797-6.293 3.5 3.5 0 1 1 2.796 6.292ZM19.5 18h.5a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-1.1a5.503 5.503 0 0 1-.471.762A5.998 5.998 0 0 1 19.5 18ZM4 7.5a3.5 3.5 0 0 1 5.477-2.889 5.5 5.5 0 0 0-2.796 6.293A3.501 3.501 0 0 1 4 7.5ZM7.1 12H6a4 4 0 0 0-4 4 2 2 0 0 0 2 2h.5a5.998 5.998 0 0 1 3.071-5.238A5.505 5.505 0 0 1 7.1 12Z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",m7,[...u[3]||(u[3]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-2 9a4 4 0 0 0-4 4v1a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-1a4 4 0 0 0-4-4h-4Z","clip-rule":"evenodd"},null,-1)])]))])]),_:1},8,["url"])),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle([{right:"0px",bottom:"0px"},s(c.login_status,(m=c==null?void 0:c.participants)==null?void 0:m.length).indicatorStyle]),class:e.normalizeClass(["status-indicator absolute"])},null,4))]),e.createElementVNode("span",null,[e.createElementVNode("h1",f7,e.toDisplayString(c.name),1),e.createElementVNode("p",{style:e.normalizeStyle(s(c.login_status,(f=c==null?void 0:c.participants)==null?void 0:f.length).textStyle),class:"atendente-name"},[e.createElementVNode("a",p7,e.toDisplayString(s(c.login_status,(h=c==null?void 0:c.participants)==null?void 0:h.length).label),1)],4)])]),e.createElementVNode("footer",h7,[c.internal_chat.unread>0?(e.openBlock(),e.createElementBlock("span",g7,e.toDisplayString(c.internal_chat.unread),1)):e.createCommentVNode("",!0)]),u[4]||(u[4]=e.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,s7)}),128)),a.value&&t.content.length>0?(e.openBlock(),e.createBlock(e.unref(Yt),{key:1,onInfinite:i,distance:30,class:"p-3"},{complete:e.withCtx(()=>[...u[5]||(u[5]=[e.createElementVNode("span",null,null,-1)])]),spinner:e.withCtx(()=>[...u[6]||(u[6]=[e.createElementVNode("div",{class:"loading"},[e.createElementVNode("svg",{class:"spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})])],-1)])]),_:1})):e.createCommentVNode("",!0)]),!t.loader&&a.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"create-group-button bg-base-300 hover:bg-primary border-primary text-primary",onClick:u[0]||(u[0]=c=>r())},[...u[7]||(u[7]=[e.createElementVNode("span",{class:"create-group-tooltip bg-primary"},"Criar grupo",-1),e.createElementVNode("svg",{class:"size-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15 14",fill:"currentColor"},[e.createElementVNode("path",{d:"M11 7.99951C12.6568 7.99951 13.9998 9.3428 14 10.9995C14 12.6564 12.6569 13.9995 11 13.9995C9.3431 13.9995 8 12.6564 8 10.9995C8.00022 9.3428 9.34323 7.99951 11 7.99951ZM11 9.42725C10.9204 9.42725 10.8443 9.45888 10.7881 9.51514C10.7318 9.5714 10.7002 9.64749 10.7002 9.72705V10.6997H9.72754C9.64797 10.6997 9.57091 10.7313 9.51465 10.7876C9.45852 10.8438 9.42686 10.9201 9.42676 10.9995C9.42676 11.0791 9.45839 11.1561 9.51465 11.2124C9.57091 11.2687 9.64798 11.3003 9.72754 11.3003H10.7002V12.2729C10.7002 12.3525 10.7319 12.4286 10.7881 12.4849C10.8443 12.5411 10.9205 12.5728 11 12.5728C11.0795 12.5728 11.1557 12.5411 11.2119 12.4849C11.2681 12.4286 11.2998 12.3525 11.2998 12.2729V11.3003H12.2725C12.352 11.3003 12.4291 11.2687 12.4854 11.2124C12.5416 11.1561 12.5732 11.0791 12.5732 10.9995C12.5731 10.9201 12.5415 10.8438 12.4854 10.7876C12.4291 10.7313 12.352 10.6997 12.2725 10.6997H11.2998V9.72705C11.2998 9.64749 11.2682 9.5714 11.2119 9.51514C11.1557 9.45888 11.0796 9.42725 11 9.42725ZM8.625 7.50049C8.75546 7.50049 8.88472 7.51114 9.0127 7.52783C7.81025 8.21758 7.00015 9.51391 7 10.9995C7.00001 11.3446 7.04378 11.68 7.12598 11.9995H4.875C4.47733 11.9995 4.09573 11.8421 3.81445 11.561C3.53317 11.2798 3.37502 10.8973 3.375 10.4995C3.37513 9.7041 3.69144 8.94088 4.25391 8.37842C4.81649 7.81602 5.57949 7.50049 6.375 7.50049H8.625ZM3.8252 6.00049C3.92718 6.20013 4.04571 6.39131 4.17871 6.57178C3.47999 6.96241 2.89804 7.53261 2.49316 8.22314C2.0884 8.91353 1.87473 9.69923 1.875 10.4995H1.5C1.10231 10.4995 0.720731 10.3422 0.439453 10.061C0.158267 9.77986 0.000133157 9.39811 0 9.00049C0 8.2049 0.316324 7.44099 0.878906 6.87842C1.44148 6.31605 2.20451 6.00049 3 6.00049H3.8252ZM12 6.00049C12.7955 6.00049 13.5585 6.31605 14.1211 6.87842C14.6837 7.44099 15 8.2049 15 9.00049C14.9999 9.26491 14.9283 9.52124 14.7988 9.74658C14.3222 8.30098 13.0442 7.22072 11.4902 7.03076C11.2822 6.85894 11.0587 6.7045 10.8213 6.57178C10.9543 6.39131 11.0728 6.20013 11.1748 6.00049H12ZM7.5 1.50049C8.19619 1.50049 8.86416 1.77679 9.35645 2.26904C9.84868 2.76129 10.125 3.42937 10.125 4.12549C10.1249 4.82139 9.84845 5.48879 9.35645 5.98096C8.86417 6.47319 8.19617 6.75049 7.5 6.75049C7.15529 6.75049 6.81359 6.6822 6.49512 6.55029C6.17678 6.41839 5.88722 6.2246 5.64355 5.98096C5.39999 5.73731 5.20705 5.44767 5.0752 5.12939C4.94337 4.81107 4.87503 4.47002 4.875 4.12549C4.875 3.78081 4.9433 3.43905 5.0752 3.12061C5.2071 2.80231 5.39992 2.51268 5.64355 2.26904C5.88719 2.02542 6.17682 1.83259 6.49512 1.70068C6.8136 1.56877 7.15528 1.50049 7.5 1.50049ZM4.27539 0.00439453C4.75237 0.0318198 5.21314 0.188708 5.60742 0.458496C4.77299 0.888977 4.11076 1.5917 3.72949 2.44971C3.34824 3.3078 3.27087 4.2704 3.51074 5.17822C2.93768 5.04016 2.42723 4.71353 2.0625 4.25049C1.69784 3.78747 1.49997 3.21485 1.5 2.62549C1.49989 2.14763 1.63021 1.67828 1.87695 1.26904C2.12371 0.859923 2.47779 0.526133 2.90039 0.303223C3.32301 0.0803171 3.79837 -0.0229799 4.27539 0.00439453ZM10.4512 0.0356445C10.8309 -0.0261991 11.2197 -0.00395918 11.5898 0.101074C11.96 0.206149 12.3031 0.39091 12.5938 0.643066C12.8844 0.895214 13.1162 1.20846 13.2725 1.56006C13.4287 1.91163 13.5057 2.29359 13.498 2.67822C13.4904 3.06286 13.3976 3.44154 13.2275 3.78662C13.0575 4.1315 12.8139 4.43501 12.5137 4.67529C12.2136 4.91544 11.8638 5.0859 11.4902 5.17627C11.728 4.26901 11.6504 3.3078 11.2695 2.45068C10.8883 1.59293 10.2262 0.889932 9.39258 0.458496C9.71014 0.241574 10.0716 0.0974964 10.4512 0.0356445Z",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-59b8286b"]]),k7={class:"attendants-container"},b7={key:0,class:"chat-footer bg-base-200 flex justify-end"},x7=ke({__name:"ChatList",props:{listAttendants:{type:Array,default:()=>[],required:!0},listGroups:{type:Array,default:()=>[],required:!0},currentAttendant:{type:Object,required:!0},mobile:{type:Boolean,default:!1},currentList:{type:String,default:void 0},searchQuery:{type:String,default:void 0}},emits:["update:currentList","update:searchQuery"],setup(t,{emit:n}){const a=t,o=e.inject("useChat"),r=n,l=e.ref(a.currentList??"atendentes"),s=e.computed({get(){return a.currentList??l.value},set(B){if(a.currentList===void 0){l.value=B;return}r("update:currentList",B)}}),i=e.ref(a.searchQuery??""),d=e.computed({get(){return a.searchQuery??i.value},set(B){if(a.searchQuery===void 0){i.value=B;return}r("update:searchQuery",B)}}),u=e.computed(()=>d.value?a.listAttendants.filter(B=>B.name.toLowerCase().includes(d.value.toLowerCase())&&B.id!==a.currentAttendant.id):a.listAttendants.filter(B=>B.id!==a.currentAttendant.id)),c=e.computed(()=>(a.listGroups||[]).filter(B=>B==null?void 0:B.is_group));e.watch(()=>s.value,async B=>{d.value="";const b=B==="grupos",x=!a.mobile;b&&await f()});const m=e.ref(!1),f=async(B="")=>{typeof o.fetchGroupChannels=="function"&&(m.value=!0,await o.fetchGroupChannels(1,B),m.value=!1)};let h=null;e.watch(()=>d.value,B=>{s.value==="grupos"&&(h&&clearTimeout(h),h=setTimeout(()=>{f(B.trim())},400))}),e.onBeforeUnmount(()=>{h&&clearTimeout(h)});const p=e.computed(()=>(a.listAttendants||[]).filter(B=>{var b;return B.id!==((b=a.currentAttendant)==null?void 0:b.id)}).reduce((B,b)=>{var x;return B+(Number((x=b==null?void 0:b.internal_chat)==null?void 0:x.unread)||0)},0)),g=e.computed(()=>(a.listGroups||[]).filter(B=>B.is_group).reduce((B,b)=>{var x;return B+(Number((x=b==null?void 0:b.internal_chat)==null?void 0:x.unread)||0)},0)),y=e.computed(()=>p.value>0),k=e.computed(()=>g.value>0);return(B,b)=>(e.openBlock(),e.createElementBlock("div",k7,[e.createVNode(q6,{hasUnread:{atendentes:y.value,grupos:k.value},currentState:s.value,"onUpdate:currentState":b[0]||(b[0]=x=>s.value=x),searchQuery:d.value,"onUpdate:searchQuery":b[1]||(b[1]=x=>d.value=x)},null,8,["hasUnread","currentState","searchQuery"]),e.createVNode(y7,{content:s.value==="atendentes"?u.value:c.value,mode:s.value,loader:m.value},null,8,["content","mode","loader"]),t.mobile?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",b7))]))}},[["__scopeId","data-v-69e392ac"]]);function w7(t,n,a){const o=ft(t,a==null?void 0:a.in);return isNaN(n)?ut(t,NaN):(o.setDate(o.getDate()+n),o)}function oa(t,n){return Zt(t,{...n,weekStartsOn:1})}function sl(t,n){const a=ft(t,n==null?void 0:n.in),o=a.getFullYear(),r=ut(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const l=oa(r),s=ut(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const i=oa(s);return a.getTime()>=l.getTime()?o+1:a.getTime()>=i.getTime()?o:o-1}function il(t){const n=ft(t),a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),+t-+a}function ra(t,n){const a=ft(t,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function E7(t,n,a){const[o,r]=Wa(a==null?void 0:a.in,t,n),l=ra(o),s=ra(r),i=+l-il(l),d=+s-il(s);return Math.round((i-d)/nd)}function C7(t,n){const a=sl(t,n),o=ut(t,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),oa(o)}function Ja(t){return ut(t,Date.now())}function cl(t,n,a){const[o,r]=Wa(a==null?void 0:a.in,t,n);return+ra(o)==+ra(r)}function B7(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function v7(t){return!(!B7(t)&&typeof t!="number"||isNaN(+ft(t)))}function V7(t,n){const a=ft(t,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function S7(t,n){const a=ft(t,n==null?void 0:n.in);return E7(a,V7(a))+1}function N7(t,n){const a=ft(t,n==null?void 0:n.in),o=+oa(a)-+C7(a);return Math.round(o/Wr)+1}function dl(t,n){var c,m,f,h;const a=ft(t,n==null?void 0:n.in),o=a.getFullYear(),r=Qn(),l=(n==null?void 0:n.firstWeekContainsDate)??((m=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=ut((n==null?void 0:n.in)||t,0);s.setFullYear(o+1,0,l),s.setHours(0,0,0,0);const i=Zt(s,n),d=ut((n==null?void 0:n.in)||t,0);d.setFullYear(o,0,l),d.setHours(0,0,0,0);const u=Zt(d,n);return+a>=+i?o+1:+a>=+u?o:o-1}function M7(t,n){var i,d,u,c;const a=Qn(),o=(n==null?void 0:n.firstWeekContainsDate)??((d=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,r=dl(t,n),l=ut((n==null?void 0:n.in)||t,0);return l.setFullYear(r,0,o),l.setHours(0,0,0,0),Zt(l,n)}function A7(t,n){const a=ft(t,n==null?void 0:n.in),o=+Zt(a,n)-+M7(a,n);return Math.round(o/Wr)+1}function Re(t,n){const a=t<0?"-":"",o=Math.abs(t).toString().padStart(n,"0");return a+o}const Tt={y(t,n){const a=t.getFullYear(),o=a>0?a:1-a;return Re(n==="yy"?o%100:o,n.length)},M(t,n){const a=t.getMonth();return n==="M"?String(a+1):Re(a+1,2)},d(t,n){return Re(t.getDate(),n.length)},a(t,n){const a=t.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(t,n){return Re(t.getHours()%12||12,n.length)},H(t,n){return Re(t.getHours(),n.length)},m(t,n){return Re(t.getMinutes(),n.length)},s(t,n){return Re(t.getSeconds(),n.length)},S(t,n){const a=n.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return Re(r,n.length)}},un={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ul={G:function(t,n,a){const o=t.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(t,n,a){if(n==="yo"){const o=t.getFullYear(),r=o>0?o:1-o;return a.ordinalNumber(r,{unit:"year"})}return Tt.y(t,n)},Y:function(t,n,a,o){const r=dl(t,o),l=r>0?r:1-r;if(n==="YY"){const s=l%100;return Re(s,2)}return n==="Yo"?a.ordinalNumber(l,{unit:"year"}):Re(l,n.length)},R:function(t,n){const a=sl(t);return Re(a,n.length)},u:function(t,n){const a=t.getFullYear();return Re(a,n.length)},Q:function(t,n,a){const o=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return Re(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(t,n,a){const o=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return Re(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(t,n,a){const o=t.getMonth();switch(n){case"M":case"MM":return Tt.M(t,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(t,n,a){const o=t.getMonth();switch(n){case"L":return String(o+1);case"LL":return Re(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(t,n,a,o){const r=A7(t,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):Re(r,n.length)},I:function(t,n,a){const o=N7(t);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):Re(o,n.length)},d:function(t,n,a){return n==="do"?a.ordinalNumber(t.getDate(),{unit:"date"}):Tt.d(t,n)},D:function(t,n,a){const o=S7(t);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):Re(o,n.length)},E:function(t,n,a){const o=t.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(t,n,a,o){const r=t.getDay(),l=(r-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(l);case"ee":return Re(l,2);case"eo":return a.ordinalNumber(l,{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(t,n,a,o){const r=t.getDay(),l=(r-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(l);case"cc":return Re(l,n.length);case"co":return a.ordinalNumber(l,{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(t,n,a){const o=t.getDay(),r=o===0?7:o;switch(n){case"i":return String(r);case"ii":return Re(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(t,n,a){const r=t.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(t,n,a){const o=t.getHours();let r;switch(o===12?r=un.noon:o===0?r=un.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(t,n,a){const o=t.getHours();let r;switch(o>=17?r=un.evening:o>=12?r=un.afternoon:o>=4?r=un.morning:r=un.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(t,n,a){if(n==="ho"){let o=t.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return Tt.h(t,n)},H:function(t,n,a){return n==="Ho"?a.ordinalNumber(t.getHours(),{unit:"hour"}):Tt.H(t,n)},K:function(t,n,a){const o=t.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):Re(o,n.length)},k:function(t,n,a){let o=t.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):Re(o,n.length)},m:function(t,n,a){return n==="mo"?a.ordinalNumber(t.getMinutes(),{unit:"minute"}):Tt.m(t,n)},s:function(t,n,a){return n==="so"?a.ordinalNumber(t.getSeconds(),{unit:"second"}):Tt.s(t,n)},S:function(t,n){return Tt.S(t,n)},X:function(t,n,a){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return fl(o);case"XXXX":case"XX":return Xt(o);case"XXXXX":case"XXX":default:return Xt(o,":")}},x:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"x":return fl(o);case"xxxx":case"xx":return Xt(o);case"xxxxx":case"xxx":default:return Xt(o,":")}},O:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+ml(o,":");case"OOOO":default:return"GMT"+Xt(o,":")}},z:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+ml(o,":");case"zzzz":default:return"GMT"+Xt(o,":")}},t:function(t,n,a){const o=Math.trunc(+t/1e3);return Re(o,n.length)},T:function(t,n,a){return Re(+t,n.length)}};function ml(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),l=o%60;return l===0?a+String(r):a+String(r)+n+Re(l,2)}function fl(t,n){return t%60===0?(t>0?"-":"+")+Re(Math.abs(t)/60,2):Xt(t,n)}function Xt(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Re(Math.trunc(o/60),2),l=Re(o%60,2);return a+r+n+l}const pl=(t,n)=>{switch(t){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"})}},hl=(t,n)=>{switch(t){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"})}},$7={p:hl,P:(t,n)=>{const a=t.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return pl(t,n);let l;switch(o){case"P":l=n.dateTime({width:"short"});break;case"PP":l=n.dateTime({width:"medium"});break;case"PPP":l=n.dateTime({width:"long"});break;case"PPPP":default:l=n.dateTime({width:"full"});break}return l.replace("{{date}}",pl(o,n)).replace("{{time}}",hl(r,n))}},_7=/^D+$/,D7=/^Y+$/,T7=["D","DD","YY","YYYY"];function L7(t){return _7.test(t)}function F7(t){return D7.test(t)}function P7(t,n,a){const o=z7(t,n,a);if(console.warn(o),T7.includes(t))throw new RangeError(o)}function z7(t,n,a){const o=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const O7=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,R7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,H7=/^'([^]*?)'?$/,j7=/''/g,G7=/[a-zA-Z]/;function gl(t,n,a){var c,m,f,h,p,g,y,k;const o=Qn(),r=(a==null?void 0:a.locale)??o.locale??Dd,l=(a==null?void 0:a.firstWeekContainsDate)??((m=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:m.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(p=a==null?void 0:a.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((k=(y=o.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,i=ft(t,a==null?void 0:a.in);if(!v7(i))throw new RangeError("Invalid time value");let d=n.match(R7).map(B=>{const b=B[0];if(b==="p"||b==="P"){const x=$7[b];return x(B,r.formatLong)}return B}).join("").match(O7).map(B=>{if(B==="''")return{isToken:!1,value:"'"};const b=B[0];if(b==="'")return{isToken:!1,value:I7(B)};if(ul[b])return{isToken:!0,value:B};if(b.match(G7))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:B}});r.localize.preprocessor&&(d=r.localize.preprocessor(i,d));const u={firstWeekContainsDate:l,weekStartsOn:s,locale:r};return d.map(B=>{if(!B.isToken)return B.value;const b=B.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&F7(b)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&L7(b))&&P7(b,n,String(t));const x=ul[b[0]];return x(i,b,r.localize,u)}).join("")}function I7(t){const n=t.match(H7);return n?n[1].replace(j7,"'"):t}function q7(t,n){return od(ut(t,t),Ja(t),n)}function W7(t,n){return cl(ut(t,t),Ja(t))}function U7(t,n,a){return w7(t,-1,a)}function Z7(t,n){return cl(ut(t,t),U7(Ja(t)))}const Y7={class:"absolute right-0 top-0 z-20 flex size-full flex-col gap-2 overflow-hidden rounded-md bg-base-200"},X7={class:"flex items-center"},Q7={class:"flex w-full shrink-0 flex-col items-center gap-1.5"},K7={class:"text-lg font-normal"},J7={class:"text-sm font-sans text-gray-500"},eu={class:"text-primary"},tu={class:"text-sm font-sans text-gray-500"},nu={class:"flex min-h-0 flex-1 flex-col"},au={class:"min-h-0 flex-1 overflow-y-auto"},ou={class:"relative"},ru=["aria-disabled"],lu={class:"flex w-full items-center justify-between"},su={class:"flex items-center gap-2"},iu=["disabled","onClick","onMouseenter","onFocus"],cu={key:0,class:"flex gap-1 m-1"},du=["disabled"],uu=["disabled"],mu={key:0,class:"loader-sm"},fu={key:1},pu=ke({__name:"groupChatInfo",props:{selectedAttendant:{type:Object,required:!0},attendant:{type:Object,required:!0},participantsGroup:{type:Array,default:()=>[]},participantCount:{type:Number,default:0}},emits:["close"],setup(t,{emit:n}){const a=t,o=n,r=e.inject("useChat"),l=()=>{x.value&&typeof r.openCreateOrEdit=="function"&&r.openCreateOrEdit("edit",a.selectedAttendant)},s=async L=>{var A,M,S;L&&L.id!==((A=a.attendant)==null?void 0:A.id)&&typeof r.removeGroupParticipant=="function"&&await r.removeGroupParticipant((S=(M=a.selectedAttendant)==null?void 0:M.internal_chat)==null?void 0:S.channel_id,L.id)},i=e.ref(!1),d=e.ref(!1),u=e.ref(null),c=e.ref(!1),m=e.ref({}),f=e.ref(""),h=()=>{if(!u.value)return;const L=u.value.getBoundingClientRect(),A=240,M=8,S=Math.max(M,window.innerWidth-A-M),N=Math.min(Math.max(M,L.right+M),S),w=L.top+L.height/2;m.value={left:`${N}px`,top:`${w}px`}},p=async(L,A)=>{A&&(u.value=L.currentTarget,f.value=A,c.value=!0,await e.nextTick(),h())},g=()=>{c.value=!1,u.value=null,f.value=""},y=()=>{c.value&&h()},k=()=>{d.value=!0},B=()=>{d.value=!1},b=async()=>{var M,S;i.value=!0;const L=(S=(M=a.selectedAttendant)==null?void 0:M.internal_chat)==null?void 0:S.channel_id;if(!L||typeof r.leaveGroup!="function")return;if(!await r.leaveGroup(L)){i.value=!1,B();return}o("close"),typeof r.closeSelectedChat=="function"&&r.closeSelectedChat(),i.value=!1,B()},x=e.computed(()=>a.selectedAttendant.group_created_by===a.attendant.id),v=e.computed(()=>{const L=a.participantsGroup.find(A=>a.selectedAttendant.group_created_by===A.id);return L?L.name:"Desconhecido"}),_=e.computed(()=>x.value?"":`Você não é o administrador do grupo. Somente ${v.value} pode ajustar os membros.`),R=L=>{var A;return(L==null?void 0:L.id)===((A=a.attendant)==null?void 0:A.id)?"Você não pode remover a si mesmo do grupo.":x.value?"":`Você não é o administrador do grupo. Somente ${v.value} pode remover membros.`};return e.onMounted(()=>{window.addEventListener("resize",y),window.addEventListener("scroll",y,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",y),window.removeEventListener("scroll",y,!0)}),(L,A)=>(e.openBlock(),e.createElementBlock("span",Y7,[e.createElementVNode("span",X7,[e.createElementVNode("button",{class:"p-2",onClick:A[0]||(A[0]=M=>o("close"))},[...A[3]||(A[3]=[e.createElementVNode("svg",{class:"size-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M14.502 7.046h-2.5v-.928a2.122 2.122 0 0 0-1.199-1.954 1.827 1.827 0 0 0-1.984.311L3.71 8.965a2.2 2.2 0 0 0 0 3.24L8.82 16.7a1.829 1.829 0 0 0 1.985.31 2.121 2.121 0 0 0 1.199-1.959v-.928h1a2.025 2.025 0 0 1 1.999 2.047V19a1 1 0 0 0 1.275.961 6.59 6.59 0 0 0 4.662-7.22 6.593 6.593 0 0 0-6.437-5.695Z"})],-1)])]),A[4]||(A[4]=e.createElementVNode("p",{class:"text-sm font-medium"},"Informações do grupo",-1))]),e.createElementVNode("div",Q7,[e.createVNode(Dt,{style:"size-24",url:t.selectedAttendant.photo},{default:e.withCtx(()=>[...A[5]||(A[5]=[e.createElementVNode("svg",{class:"size-24","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 6a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm-1.5 8a4 4 0 0 0-4 4 2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-3Zm6.82-3.096a5.51 5.51 0 0 0-2.797-6.293 3.5 3.5 0 1 1 2.796 6.292ZM19.5 18h.5a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-1.1a5.503 5.503 0 0 1-.471.762A5.998 5.998 0 0 1 19.5 18ZM4 7.5a3.5 3.5 0 0 1 5.477-2.889 5.5 5.5 0 0 0-2.796 6.293A3.501 3.501 0 0 1 4 7.5ZM7.1 12H6a4 4 0 0 0-4 4 2 2 0 0 0 2 2h.5a5.998 5.998 0 0 1 3.071-5.238A5.505 5.505 0 0 1 7.1 12Z","clip-rule":"evenodd"})],-1)])]),_:1},8,["url"]),e.createElementVNode("h1",K7,e.toDisplayString(t.selectedAttendant.name),1),e.createElementVNode("h2",J7,[A[6]||(A[6]=e.createTextVNode(" Grupo • ",-1)),e.createElementVNode("a",eu,e.toDisplayString(t.participantCount)+" membros",1)]),e.createElementVNode("h3",tu," Criado por "+e.toDisplayString(v.value)+", 10/09/1998 ",1)]),e.createElementVNode("div",nu,[e.createElementVNode("div",au,[e.createElementVNode("li",ou,[e.createElementVNode("button",{"aria-disabled":!x.value,class:e.normalizeClass(["bg-base-100 flex w-full items-center gap-2 p-2 text-left hover:bg-gray-800 hover:text-primary",!x.value&&"cursor-not-allowed opacity-70"]),onClick:l,onMouseenter:A[1]||(A[1]=M=>p(M,_.value)),onMouseleave:g,onFocus:A[2]||(A[2]=M=>p(M,_.value)),onBlur:g},[...A[7]||(A[7]=[e.createElementVNode("span",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"bg-base-300 size-10 rounded-full flex items-center justify-center"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15 14",fill:"currentColor",class:"size-5"},[e.createElementVNode("path",{d:"M11 7.99951C12.6568 7.99951 13.9998 9.3428 14 10.9995C14 12.6564 12.6569 13.9995 11 13.9995C9.3431 13.9995 8 12.6564 8 10.9995C8.00022 9.3428 9.34323 7.99951 11 7.99951ZM11 9.42725C10.9204 9.42725 10.8443 9.45888 10.7881 9.51514C10.7318 9.5714 10.7002 9.64749 10.7002 9.72705V10.6997H9.72754C9.64797 10.6997 9.57091 10.7313 9.51465 10.7876C9.45852 10.8438 9.42686 10.9201 9.42676 10.9995C9.42676 11.0791 9.45839 11.1561 9.51465 11.2124C9.57091 11.2687 9.64798 11.3003 9.72754 11.3003H10.7002V12.2729C10.7002 12.3525 10.7319 12.4286 10.7881 12.4849C10.8443 12.5411 10.9205 12.5728 11 12.5728C11.0795 12.5728 11.1557 12.5411 11.2119 12.4849C11.2681 12.4286 11.2998 12.3525 11.2998 12.2729V11.3003H12.2725C12.352 11.3003 12.4291 11.2687 12.4854 11.2124C12.5416 11.1561 12.5732 11.0791 12.5732 10.9995C12.5731 10.9201 12.5415 10.8438 12.4854 10.7876C12.4291 10.7313 12.352 10.6997 12.2725 10.6997H11.2998V9.72705C11.2998 9.64749 11.2682 9.5714 11.2119 9.51514C11.1557 9.45888 11.0796 9.42725 11 9.42725ZM8.625 7.50049C8.75546 7.50049 8.88472 7.51114 9.0127 7.52783C7.81025 8.21758 7.00015 9.51391 7 10.9995C7.00001 11.3446 7.04378 11.68 7.12598 11.9995H4.875C4.47733 11.9995 4.09573 11.8421 3.81445 11.561C3.53317 11.2798 3.37502 10.8973 3.375 10.4995C3.37513 9.7041 3.69144 8.94088 4.25391 8.37842C4.81649 7.81602 5.57949 7.50049 6.375 7.50049H8.625ZM3.8252 6.00049C3.92718 6.20013 4.04571 6.39131 4.17871 6.57178C3.47999 6.96241 2.89804 7.53261 2.49316 8.22314C2.0884 8.91353 1.87473 9.69923 1.875 10.4995H1.5C1.10231 10.4995 0.720731 10.3422 0.439453 10.061C0.158267 9.77986 0.000133157 9.39811 0 9.00049C0 8.2049 0.316324 7.44099 0.878906 6.87842C1.44148 6.31605 2.20451 6.00049 3 6.00049H3.8252ZM12 6.00049C12.7955 6.00049 13.5585 6.31605 14.1211 6.87842C14.6837 7.44099 15 8.2049 15 9.00049C14.9999 9.26491 14.9283 9.52124 14.7988 9.74658C14.3222 8.30098 13.0442 7.22072 11.4902 7.03076C11.2822 6.85894 11.0587 6.7045 10.8213 6.57178C10.9543 6.39131 11.0728 6.20013 11.1748 6.00049H12ZM7.5 1.50049C8.19619 1.50049 8.86416 1.77679 9.35645 2.26904C9.84868 2.76129 10.125 3.42937 10.125 4.12549C10.1249 4.82139 9.84845 5.48879 9.35645 5.98096C8.86417 6.47319 8.19617 6.75049 7.5 6.75049C7.15529 6.75049 6.81359 6.6822 6.49512 6.55029C6.17678 6.41839 5.88722 6.2246 5.64355 5.98096C5.39999 5.73731 5.20705 5.44767 5.0752 5.12939C4.94337 4.81107 4.87503 4.47002 4.875 4.12549C4.875 3.78081 4.9433 3.43905 5.0752 3.12061C5.2071 2.80231 5.39992 2.51268 5.64355 2.26904C5.88719 2.02542 6.17682 1.83259 6.49512 1.70068C6.8136 1.56877 7.15528 1.50049 7.5 1.50049ZM4.27539 0.00439453C4.75237 0.0318198 5.21314 0.188708 5.60742 0.458496C4.77299 0.888977 4.11076 1.5917 3.72949 2.44971C3.34824 3.3078 3.27087 4.2704 3.51074 5.17822C2.93768 5.04016 2.42723 4.71353 2.0625 4.25049C1.69784 3.78747 1.49997 3.21485 1.5 2.62549C1.49989 2.14763 1.63021 1.67828 1.87695 1.26904C2.12371 0.859923 2.47779 0.526133 2.90039 0.303223C3.32301 0.0803171 3.79837 -0.0229799 4.27539 0.00439453ZM10.4512 0.0356445C10.8309 -0.0261991 11.2197 -0.00395918 11.5898 0.101074C11.96 0.206149 12.3031 0.39091 12.5938 0.643066C12.8844 0.895214 13.1162 1.20846 13.2725 1.56006C13.4287 1.91163 13.5057 2.29359 13.498 2.67822C13.4904 3.06286 13.3976 3.44154 13.2275 3.78662C13.0575 4.1315 12.8139 4.43501 12.5137 4.67529C12.2136 4.91544 11.8638 5.0859 11.4902 5.17627C11.728 4.26901 11.6504 3.3078 11.2695 2.45068C10.8883 1.59293 10.2262 0.889932 9.39258 0.458496C9.71014 0.241574 10.0716 0.0974964 10.4512 0.0356445Z",fill:"currentColor"})])]),e.createElementVNode("p",null,"Ajustar membros do grupo")],-1)])],42,ru)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.participantsGroup,M=>(e.openBlock(),e.createElementBlock("li",{key:M.id,class:"bg-base-100 flex items-center gap-2 p-2 even:bg-base-300"},[e.createElementVNode("div",lu,[e.createElementVNode("span",su,[e.createVNode(Dt,{url:M.photo},null,8,["url"]),e.createElementVNode("p",null,e.toDisplayString(M.name),1)]),e.createElementVNode("button",{class:e.normalizeClass(["rounded-md p-0.5 text-sm w-20",M.id===t.attendant.id?"bg-primary hover:bg-primary":"bg-red-500 hover:bg-red-800"]),disabled:!x.value,onClick:S=>s(M),onMouseenter:S=>p(S,R(M)),onMouseleave:g,onFocus:S=>p(S,R(M)),onBlur:g},e.toDisplayString(M.id===t.attendant.id?"Eu":"Remover"),43,iu)])]))),128))])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[c.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"pointer-events-none fixed z-[9999] w-60 -translate-y-1/2 rounded-md bg-base-300 p-2 text-center text-sm text-gray-500 shadow-lg",style:e.normalizeStyle(m.value)},[e.createElementVNode("p",null,e.toDisplayString(f.value),1)],4)):e.createCommentVNode("",!0)])),d.value?(e.openBlock(),e.createElementBlock("div",cu,[e.createElementVNode("button",{class:"flex-1 rounded-lg bg-base-300 hover:bg-base-100 p-1 h-10 flex items-center justify-center text-sm font-medium",onClick:B,disabled:i.value}," Cancelar ",8,du),e.createElementVNode("button",{class:"flex-1 rounded-lg bg-red-600 hover:bg-red-700 p-1 h-10 flex items-center justify-center text-sm font-semibold",onClick:b,disabled:i.value},[i.value?(e.openBlock(),e.createElementBlock("div",mu)):(e.openBlock(),e.createElementBlock("span",fu,"Confirmar saída"))],8,uu)])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"rounded-lg bg-base-100 p-1 h-10 flex items-center justify-center m-1 hover:bg-red-700",onClick:k},[...A[8]||(A[8]=[e.createElementVNode("p",{class:"text-sm font-semibold"},"Sair do grupo",-1)])]))]))}},[["__scopeId","data-v-09a2608b"]]);/*! License details at fancyapps.com/license */const Oe=t=>typeof t=="string";/*! License details at fancyapps.com/license */const mn=t=>t&&t!==null&&t instanceof Element&&"nodeType"in t;/*! License details at fancyapps.com/license */const hu=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const n=t.scrollHeight>t.clientHeight,a=window.getComputedStyle(t).overflowY,o=a.indexOf("hidden")!==-1,r=a.indexOf("visible")!==-1;return n&&!o&&!r},Qt=function(t,n=void 0){return!t||t===document.body||n&&t===n?null:hu(t)?t:Qt(t.parentElement,n)};/*! License details at fancyapps.com/license */const Vt=function(t){var n=new DOMParser().parseFromString(t,"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 Fe=function(t=0,n=0,a=0){return Math.max(Math.min(n,a),t)};/*! License details at fancyapps.com/license */const Qe=t=>typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]";/*! License details at fancyapps.com/license */function yl(t){return Qe(t)||Array.isArray(t)}function vn(t,n){const a=Object.keys(t),o=Object.keys(n);return a.length===o.length&&a.every(r=>{const l=t[r],s=n[r];return typeof l=="function"?`${l}`==`${s}`:yl(l)&&yl(s)?vn(l,s):l===s})}/*! License details at fancyapps.com/license */const kl=function(t){for(const n of la)n.getState()===nt.Running&&n.tick(eo?t-eo:0);eo=t,pn=window.requestAnimationFrame(kl)};var nt,Lt,fn;(function(t){t[t.Initializing=0]="Initializing",t[t.Running=1]="Running",t[t.Paused=2]="Paused",t[t.Completed=3]="Completed",t[t.Destroyed=4]="Destroyed"})(nt||(nt={})),function(t){t[t.Spring=0]="Spring",t[t.Ease=1]="Ease"}(Lt||(Lt={})),function(t){t[t.Loop=0]="Loop",t[t.Reverse=1]="Reverse"}(fn||(fn={}));const la=new Set;let pn=null,eo=0;function Ft(){let t=nt.Initializing,n=Lt.Ease,a=0,o=0,r=Ft.Easings.Linear,l=500,s=0,i=0,d=0,u=0,c=1/0,m=.01,f=.01,h=!1,p={},g=null,y={},k={},B={},b=0,x=0,v=fn.Loop,_=Ft.Easings.Linear;const R=new Map;function L(w,...C){for(const O of R.get(w)||[])O(...C)}function A(w){return o=0,w?g=setTimeout(()=>{M()},w):M(),N}function M(){t=nt.Running,L("start",y,k)}function S(){if(t=nt.Completed,B={},L("end",y),t===nt.Completed)if(a<b){if(a++,v===fn.Reverse){const w=Object.assign({},p);p=Object.assign({},k),k=w}A(x)}else a=0;return N}const N={getState:function(){return t},easing:function(w){return r=w,n=Lt.Ease,B={},N},duration:function(w){return l=w,N},spring:function(w={}){n=Lt.Spring;const C={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:O,mass:T,tension:V,friction:E,restDelta:$,restSpeed:D,maxSpeed:F,clamp:G}=Object.assign(Object.assign({},C),w);return s=O,i=T,d=V,u=E,f=$,m=D,c=F,h=G,B={},N},isRunning:function(){return t===nt.Running},isSpring:function(){return n===Lt.Spring},from:function(w){return y=Object.assign({},w),N},to:function(w){return k=w,N},repeat:function(w,C=0,O=fn.Loop,T){return b=w,x=C,v=O,_=T||r,N},on:function(w,C){var O,T;return O=w,T=C,R.set(O,[...R.get(O)||[],T]),N},off:function(w,C){var O,T;return O=w,T=C,R.has(O)&&R.set(O,R.get(O).filter(V=>V!==T)),N},start:function(w){return vn(y,k)||(t=nt.Initializing,p=Object.assign({},y),la.add(this),pn||(pn=window.requestAnimationFrame(kl)),A(w)),N},pause:function(){return g&&(clearTimeout(g),g=null),t===nt.Running&&(t=nt.Paused,L("pause",y)),N},end:S,tick:function(w){w>50&&(w=50),o+=w;let C=0,O=!1;if(t!==nt.Running)return N;if(n===Lt.Ease){C=Fe(0,o/l,1),O=C===1;const V=v===fn.Reverse?_:r;for(const E in y)y[E]=p[E]+(k[E]-p[E])*V(C)}if(n===Lt.Spring){const V=.001*w;let E=0;for(const $ in y){const D=k[$];let F=y[$];if(typeof D!="number"||isNaN(D)||typeof F!="number"||isNaN(F))continue;if(Math.abs(D-F)<=f){y[$]=D,B[$]=0;continue}B[$]||(typeof s=="object"&&typeof s[$]=="number"?B[$]=s[$]:B[$]=typeof s=="number"?s:0);let G=B[$];G=Fe(-1*Math.abs(c),G,Math.abs(c));const Q=G*i*u;G+=((F>D?-1:1)*(Math.abs(D-F)*d)-Q)/i*V,F+=G*V;const I=y[$]>D?F<D:F>D;let q=Math.abs(G)<m&&Math.abs(D-F)<=f;h&&I&&(q=!0),q?(F=D,G=0):E++,y[$]=F,B[$]=G}O=!E}const T=Object.assign({},k);return L("step",y,p,k,C),O&&t===nt.Running&&vn(k,T)&&(t=nt.Completed,S()),N},getStartValues:function(){return p},getCurrentValues:function(){return y},getCurrentVelocities:function(){return B},getEndValues:function(){return k},destroy:function(){t=nt.Destroyed,g&&(clearTimeout(g),g=null),p=y=k={},la.delete(this)}};return N}Ft.destroy=()=>{for(const t of la)t.destroy();pn&&(cancelAnimationFrame(pn),pn=null)},Ft.Easings={Linear:function(t){return t},EaseIn:function(t){return t===0?0:Math.pow(2,10*t-10)},EaseOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},EaseInOut:function(t){return t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}};/*! License details at fancyapps.com/license */function Vn(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}function to(t,n){const a=[],o=Vn(t)?t[n]:t instanceof MouseEvent&&(n==="changedTouches"||t.type!=="mouseup")?[t]:[];for(const r of o)a.push({x:r.clientX,y:r.clientY,ts:Date.now()});return a}function bl(t){return to(t,"touches")}function xl(t){return to(t,"targetTouches")}function wl(t){return to(t,"changedTouches")}function Pt(t){const n=t[0],a=t[1]||n;return{x:(n.x+a.x)/2,y:(n.y+a.y)/2,ts:a.ts}}function sa(t){const n=t[0],a=t[1]||t[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 El=t=>{t.cancelable&&t.preventDefault()},zt={passive:!1},gu={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let ia=!1,Sn=!0;const hn=(t,n)=>{let a,o,r,l=Object.assign(Object.assign({},gu),n),s=[],i=[],d=[],u=!1,c=!1,m=!1,f=!1,h=0,p=0,g=0,y=0,k=0,B=0,b=0,x=0,v=0,_=[],R=0,L=0;const A=new Map;function M($){const D=sa(i),F=sa(d),G=D&&F?D/F:0,Q=Math.abs(b)>Math.abs(x)?b:x,I={srcEvent:a,isPanRecognized:u,isSwipeRecognized:c,firstTouch:s,previousTouch:d,currentTouch:i,deltaX:g,deltaY:y,offsetX:k,offsetY:B,velocityX:b,velocityY:x,velocity:Q,angle:v,axis:r,scale:G,center:o};for(const q of A.get($)||[])q(I)}function S($){const D=Date.now();if(_=_.filter(F=>!F.ts||F.ts>D-100),$&&_.push($),b=0,x=0,_.length>3){const F=_[0],G=_[_.length-1];if(F&&G){const Q=G.x-F.x,I=G.y-F.y,q=F.ts&&G.ts?G.ts-F.ts:0;q>0&&(b=Math.abs(Q)>3?Q/(q/30):0,x=Math.abs(I)>3?I/(q/30):0)}}}function N($){if(typeof MouseEvent<"u"&&$ instanceof MouseEvent){if(ia)return}else ia=!0;const D=$.composedPath()[0],F=l.ignore.join(",");if(D.matches(F)||D.closest(F))return;if(typeof MouseEvent<"u"&&$ instanceof MouseEvent){if(!$.buttons||$.button!==0)return;El($)}$ instanceof MouseEvent&&(window.addEventListener("mousemove",w),window.addEventListener("mouseup",C)),window.addEventListener("blur",O),a=$,i=xl($),s=[...i],d=[],p=i.length,o=Pt(i),p===1&&(u=!1,c=!1,m=!1),p&&S(Pt(i));const G=Date.now(),Q=G-(h||G);f=Q>0&&Q<=250&&p===1,h=G,clearTimeout(R),M("start")}function w($){var D;if(!s.length||$.defaultPrevented)return;a=$,d=[...i],i=bl($);const F=Pt(d),G=Pt(bl($));if(S(G),p=i.length,o=G,d.length===i.length?(g=G.x-F.x,y=G.y-F.y):(g=0,y=0),s.length){const Q=Pt(s);k=G.x-Q.x,B=G.y-Q.y}if(i.length>1){const Q=sa(i),I=sa(d);Math.abs(Q-I)>=.1&&(m=!0,M("pinch"))}u||(u=Math.abs(k)>l.panThreshold||Math.abs(B)>l.panThreshold,u&&(Sn=!1,clearTimeout(L),L=0,v=Math.abs(180*Math.atan2(B,k)/Math.PI),r=v>45&&v<135?"y":"x",s=[...i],d=[...i],k=0,B=0,g=0,y=0,(D=window.getSelection())===null||D===void 0||D.removeAllRanges(),M("panstart"))),u&&(g||y)&&M("pan"),M("move")}function C($){if(a=$,!s.length)return;const D=xl($),F=wl($);if(p=D.length,o=Pt(F),F.length&&S(Pt(F)),d=[...i],i=[...D],s=[...D],p>0)M("end"),u=!1,c=!1,_=[];else{const G=l.swipeThreshold;(Math.abs(b)>G||Math.abs(x)>G)&&(c=!0),u&&M("panend"),c&&M("swipe"),u||c||m||(M("tap"),f?M("doubleTap"):R=setTimeout(function(){M("singleTap")},250)),M("end"),T()}}function O(){clearTimeout(R),T(),u&&M("panend"),M("end")}function T(){ia=!1,u=!1,c=!1,f=!1,p=0,_=[],i=[],d=[],s=[],g=0,y=0,k=0,B=0,b=0,x=0,v=0,r=void 0,window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",C),window.removeEventListener("blur",O),Sn||L||(L=setTimeout(()=>{Sn=!0,L=0},100))}function V($){const D=$.target;ia=!1,D&&!$.defaultPrevented&&(Sn||(El($),$.stopPropagation()))}const E={init:function(){return t&&(t.addEventListener("click",V,zt),t.addEventListener("mousedown",N,zt),t.addEventListener("touchstart",N,zt),t.addEventListener("touchmove",w,zt),t.addEventListener("touchend",C),t.addEventListener("touchcancel",C)),E},on:function($,D){return function(F,G){A.set(F,[...A.get(F)||[],G])}($,D),E},off:function($,D){return A.has($)&&A.set($,A.get($).filter(F=>F!==D)),E},isPointerDown:()=>p>0,destroy:function(){clearTimeout(R),clearTimeout(L),L=0,t&&(t.removeEventListener("click",V,zt),t.removeEventListener("mousedown",N,zt),t.removeEventListener("touchstart",N,zt),t.removeEventListener("touchmove",w,zt),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",C)),t=null,T()}};return E};hn.isClickAllowed=()=>Sn;/*! License details at fancyapps.com/license */const no={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",TOGGLE_FS:"Toggle fullscreen"};/*! License details at fancyapps.com/license */const $e=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.add(a)})};/*! License details at fancyapps.com/license */const at=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.remove(a)})};/*! License details at fancyapps.com/license */const Ke=(t,n="",a)=>{t&&t.classList&&n.split(" ").forEach(o=>{o&&t.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Kt=t=>{t.cancelable&&t.preventDefault()},ot=(t,n=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*n)/n),Et=t=>t instanceof HTMLImageElement;var Ee,Cl;(function(t){t.Reset="reset",t.Zoom="zoom",t.ZoomIn="zoomIn",t.ZoomOut="zoomOut",t.ZoomTo="zoomTo",t.ToggleCover="toggleCover",t.ToggleFull="toggleFull",t.ToggleMax="toggleMax",t.IterateZoom="iterateZoom",t.Pan="pan",t.Swipe="swipe",t.Move="move",t.MoveLeft="moveLeft",t.MoveRight="moveRight",t.MoveUp="moveUp",t.MoveDown="moveDown",t.RotateCCW="rotateCCW",t.RotateCW="rotateCW",t.FlipX="flipX",t.FlipY="flipY",t.ToggleFS="toggleFS"})(Ee||(Ee={})),function(t){t.Cover="cover",t.Full="full",t.Max="max"}(Cl||(Cl={}));const ht={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},ao={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:Ee.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:no,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:Ee.Zoom,width:"auto"};let ca,Bl=0,vl=0,da=0;const oo=(t,n={},a={})=>{let o,r,l,s,i,d,u,c,m=0,f=Object.assign(Object.assign({},ao),n),h={},p=Object.assign({},ht),g=Object.assign({},ht);const y=[];function k(j){let ee=f[j];return ee&&typeof ee=="function"?ee(fe):ee}function B(){return t&&t.parentElement&&o&&m===3}const b=new Map;function x(j,...ee){const se=[...b.get(j)||[]];f.on&&se.push(f.on[j]);for(const oe of se)oe&&oe instanceof Function&&oe(fe,...ee);j!=="*"&&x("*",j,...ee)}function v(j){if(!B())return;const ee=j.target;if(Qt(ee))return;const se=Date.now(),oe=[-j.deltaX||0,-j.deltaY||0,-j.detail||0].reduce(function(xe,Ve){return Math.abs(Ve)>Math.abs(xe)?Ve:xe}),U=Fe(-1,oe,1);x("wheel",j,U);const ne=k("wheelAction");if(!ne||j.defaultPrevented)return;const he=g.scale;let pe=he*(U>0?1.5:.5);if(ne===Ee.Zoom){const xe=Math.abs(j.deltaY)<100&&Math.abs(j.deltaX)<100;if(se-vl<(xe?200:45))return void Kt(j);vl=se;const Ve=V(),Ce=F();if(ot(pe)<ot(Ve)&&ot(he)<=ot(Ve)?(da+=Math.abs(U),pe=Ve):ot(pe)>ot(Ce)&&ot(he)>=ot(Ce)?(da+=Math.abs(U),pe=Ce):(da=0,pe=Fe(Ve,pe,Ce)),da>7)return}switch(Kt(j),ne){case Ee.Pan:q(ne,{srcEvent:j,deltaX:2*-j.deltaX,deltaY:2*-j.deltaY});break;case Ee.Zoom:q(Ee.ZoomTo,{srcEvent:j,scale:pe,center:{x:j.clientX,y:j.clientY}});break;default:q(ne,{srcEvent:j})}}function _(j){var ee,se;const oe=j.composedPath()[0];if(!hn.isClickAllowed()||!mn(oe)||j.defaultPrevented||!(t!=null&&t.contains(oe))||oe.hasAttribute("disabled")||oe.hasAttribute("aria-disabled"))return;const U=oe.closest("[data-panzoom-action]"),ne=(ee=U==null?void 0:U.dataset)===null||ee===void 0?void 0:ee.panzoomAction,he=((se=U==null?void 0:U.dataset)===null||se===void 0?void 0:se.panzoomValue)||"";if(ne){switch(Kt(j),ne){case Ee.ZoomTo:case Ee.ZoomIn:case Ee.ZoomOut:q(ne,{scale:parseFloat(he||"")||void 0});break;case Ee.MoveLeft:case Ee.MoveRight:q(ne,{deltaX:parseFloat(he||"")||void 0});break;case Ee.MoveUp:case Ee.MoveDown:q(ne,{deltaY:parseFloat(he||"")||void 0});break;case Ee.ToggleFS:ce();break;default:q(ne)}return}if(!(o!=null&&o.contains(oe)))return;const pe={srcEvent:j};if(q(k("clickAction"),pe),k("dblClickAction")){const xe=Date.now(),Ve=xe-(Bl||xe);Bl=xe,Ve>0&&Ve<=250?(ca&&(clearTimeout(ca),ca=void 0),q(k("dblClickAction"),pe)):ca=setTimeout(()=>{q(k("singleClickAction"),pe)},250)}}function R(j){if(c=j,!B()||!C()||p.scale<=1||g.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const ee=O(g.scale);if(!ee)return;const{x:se,y:oe}=ee;q(Ee.Pan,{deltaX:se-g.x,deltaY:oe-g.y})}function L(){var j;t&&(at(t,"is-loading"),(j=t.querySelector(".f-spinner"))===null||j===void 0||j.remove())}function A(){if(!t||!r)return;if(L(),Et(r)&&(!r.complete||!r.naturalWidth))return m=2,o==null||o.classList.add("has-error"),void x("error");x("loaded");const{width:j,height:ee}=N();Et(r)&&(r.setAttribute("width",j+""),r.setAttribute("height",ee+"")),o&&(at(o,"has-error"),Et(r)&&(o.setAttribute("width",j+""),o.setAttribute("height",ee+""),o.style.aspectRatio=`${j/ee||""}`)),d=Ft().on("start",(oe,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),g=Object.assign(Object.assign({},ht),U),I(),x("animationStart")}).on("pause",oe=>{g=Object.assign(Object.assign({},ht),oe)}).on("step",oe=>{if(!B())return void(d==null||d.end());if(p=Object.assign(Object.assign({},ht),oe),C()||!k("bounds")||J()||g.scale>p.scale||g.scale<E())return void re();const U=G(g.scale);let ne=!1,he=!1,pe=!1,xe=!1;p.x<U.x[0]&&(ne=!0),p.x>U.x[1]&&(he=!0),p.y<U.y[0]&&(xe=!0),p.y>U.y[1]&&(pe=!0);let Ve=!1,Ce=!1,Le=!1,Ae=!1;g.x<U.x[0]&&(Ve=!0),g.x>U.x[1]&&(Ce=!0),g.y<U.y[0]&&(Ae=!0),g.y>U.y[1]&&(Le=!0);let He=!1;(he&&Ce||ne&&Ve)&&(g.x=Fe(U.x[0],g.x,U.x[1]),He=!0),(pe&&Le||xe&&Ae)&&(g.y=Fe(U.y[0],g.y,U.y[1]),He=!0),He&&d&&d.spring({tension:94,friction:17,maxSpeed:555*g.scale,restDelta:.1,restSpeed:.1,velocity:d.getCurrentVelocities()}).from(p).to(g).start(),re()}).on("end",()=>{i!=null&&i.isPointerDown()||Q(),d!=null&&d.isRunning()||(I(),x("animationEnd"))}),function(){const oe=k("gestures");if(!oe||!s||!r)return;let U=!1;i=hn(s,oe).on("start",ne=>{if(!k("gestures")||!d||!B()||C())return;const he=ne.srcEvent;(p.scale>1||ne.currentTouch.length>1)&&(he==null||he.stopPropagation(),d.pause(),U=!0),ne.currentTouch.length===1&&x("touchStart")}).on("move",ne=>{var he;U&&(g.scale!==1||ne.currentTouch.length>1)&&(Kt(ne.srcEvent),(he=ne.srcEvent)===null||he===void 0||he.stopPropagation())}).on("pan",ne=>{if(!U)return;const he=ne.srcEvent;(g.scale!==1||ne.currentTouch.length>1)&&(Kt(he),q(Ee.Pan,ne))}).on("swipe",ne=>{U&&g.scale>1&&q(Ee.Swipe,ne)}).on("tap",ne=>{x("click",ne)}).on("singleTap",ne=>{x("singleClick",ne)}).on("doubleTap",ne=>{x("dblClick",ne)}).on("pinch",ne=>{U&&(ne.scale>E()?q(Ee.ZoomIn,ne):ne.scale<E()?q(Ee.ZoomOut,ne):q(Ee.Pan,ne))}).on("end",ne=>{U&&(ne.currentTouch.length?(ne.srcEvent.stopPropagation(),Kt(ne.srcEvent),d==null||d.end()):(U=!1,I(),Q(),x("touchEnd")))}).init()}(),s&&(s.addEventListener("wheel",v,{passive:!1}),y.push(()=>{s==null||s.removeEventListener("wheel",v,{passive:!1})})),t==null||t.addEventListener("click",_),document==null||document.addEventListener("mousemove",R),y.push(()=>{t==null||t.removeEventListener("click",_),document==null||document.removeEventListener("mousemove",R)});const se=M();p=Object.assign({},se),g=Object.assign({},se),m=3,re(),I(),x("ready"),requestAnimationFrame(()=>{L(),s&&(s.style.visibility="")})}function M(){const j=Object.assign({},k("startPos")||{});let ee=j.scale,se=1;se=typeof ee=="string"?T(ee):typeof ee=="number"?ee:E();const oe=Object.assign(Object.assign(Object.assign({},ht),j),{scale:se}),U=C()?O(se):void 0;if(U){const{x:ne,y:he}=U;oe.x=ne,oe.y=he}return oe}function S(){const j={top:0,left:0,width:0,height:0};if(o){const ee=o.getBoundingClientRect();g.angle%180==90?(j.top=ee.top+.5*ee.height-.5*ee.width,j.left=ee.left+.5*ee.width-.5*ee.height,j.width=ee.height,j.height=ee.width):(j.top=ee.top,j.left=ee.left,j.width=ee.width,j.height=ee.height)}return j}function N(){let j=k("width"),ee=k("height");if(r&&j==="auto"){const se=r.getAttribute("width");j=se?parseFloat(se+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):Et(s)?s.naturalWidth:Et(r)?r.naturalWidth:(o==null?void 0:o.getBoundingClientRect().width)||0}else j=Oe(j)?parseFloat(j):j;if(r&&ee==="auto"){const se=r.getAttribute("height");ee=se?parseFloat(se+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):Et(s)?s.naturalHeight:Et(r)?r.naturalHeight:(o==null?void 0:o.getBoundingClientRect().height)||0}else ee=Oe(ee)?parseFloat(ee):ee;return{width:j,height:ee}}function w(){const j=S();return{width:j.width,height:j.height}}function C(){return k("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function O(j){const ee=c||k("event"),se=o==null?void 0:o.getBoundingClientRect();if(!ee||!se||j<=1)return{x:0,y:0};const oe=(ee.clientX||0)-se.left,U=(ee.clientY||0)-se.top,{width:ne,height:he}=w(),pe=G(j);if(j>1){const Ae=k("mouseMoveFactor");Ae>1&&(j*=Ae)}let xe=ne*j,Ve=he*j,Ce=.5*(xe-ne)-oe/ne*100/100*(xe-ne),Le=.5*(Ve-he)-U/he*100/100*(Ve-he);return Ce=Fe(pe.x[0],Ce,pe.x[1]),Le=Fe(pe.y[0],Le,pe.y[1]),{x:Ce,y:Le}}function T(j="base"){if(!t)return 1;const ee=t.getBoundingClientRect(),se=S(),{width:oe,height:U}=N(),ne=Ce=>{if(typeof Ce=="number")return Ce;switch(Ce){case"min":case"base":return 1;case"cover":return Math.max(ee.height/se.height,ee.width/se.width)||1;case"full":case"max":{const Le=g.angle%180==90?U:oe;return Le&&se.width?Le/se.width:1}}},he=k("minScale"),pe=k("maxScale"),xe=Math.min(ne("full"),ne(he)),Ve=typeof pe=="number"?ne("full")*pe:Math.min(ne("full"),ne(pe));switch(j){case"min":return xe;case"base":return Fe(xe,1,Ve);case"cover":return ne("cover");case"full":return Math.min(Ve,ne("full"));case"max":return Ve}}function V(){return T("min")}function E(){return T("base")}function $(){return T("cover")}function D(){return T("full")}function F(){return T("max")}function G(j){const ee={x:[0,0],y:[0,0]},se=t==null?void 0:t.getBoundingClientRect();if(!se)return ee;const oe=S(),U=se.width,ne=se.height;let he=oe.width,pe=oe.height,xe=j=j===void 0?g.scale:j,Ve=j;if(C()&&j>1){const Ce=k("mouseMoveFactor");Ce>1&&(he*j>U+.01&&(xe*=Ce),pe*j>ne+.01&&(Ve*=Ce))}return he*=xe,pe*=Ve,j>1&&(he>U&&(ee.x[0]=.5*(U-he),ee.x[1]=.5*(he-U)),ee.x[0]-=.5*(oe.left-se.left),ee.x[1]-=.5*(oe.left-se.left),ee.x[0]-=.5*(oe.left+oe.width-se.right),ee.x[1]-=.5*(oe.left+oe.width-se.right),pe>ne&&(ee.y[0]=.5*(ne-pe),ee.y[1]=.5*(pe-ne)),ee.y[0]-=.5*(oe.top-se.top),ee.y[1]-=.5*(oe.top-se.top),ee.y[0]-=.5*(oe.top+oe.height-se.bottom),ee.y[1]-=.5*(oe.top+oe.height-se.bottom)),ee}function Q(){if(!B()||!k("bounds")||!d)return;const j=V(),ee=F(),se=Fe(j,g.scale,ee);if(g.scale<j-.01||g.scale>ee+.01)return void q(Ee.ZoomTo,{scale:se});if(d.isRunning()||J())return;const oe=G(se);g.x<oe.x[0]||g.x>oe.x[1]||g.y<oe.y[0]||g.y>oe.y[1]?(g.x=Fe(oe.x[0],g.x,oe.x[1]),g.y=Fe(oe.y[0],g.y,oe.y[1]),d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:d.getCurrentVelocities()}),d.from(p).to(g).start()):re()}function I(j){var ee;if(!B())return;const se=Te(),oe=J(),U=ue(),ne=ge(),he=de(),pe=Ne();Ke(o,"is-fullsize",ne),Ke(o,"is-expanded",U),Ke(o,"is-dragging",oe),Ke(o,"can-drag",se),Ke(o,"will-zoom-in",he),Ke(o,"will-zoom-out",pe);const xe=we(),Ve=Be(),Ce=ve(),Le=!B();for(const Ae of((ee=j||t)===null||ee===void 0?void 0:ee.querySelectorAll("[data-panzoom-action]"))||[]){const He=Ae.dataset.panzoomAction;let Se=!1;if(Le)Se=!0;else switch(He){case Ee.ZoomIn:xe||(Se=!0);break;case Ee.ZoomOut:Ce||(Se=!0);break;case Ee.ToggleFull:{Ve||Ce||(Se=!0);const z=Ae.querySelector("g");z&&(z.style.display=ne&&!Se?"none":"");break}case Ee.IterateZoom:{xe||Ce||(Se=!0);const z=Ae.querySelector("g");z&&(z.style.display=xe||Se?"":"none");break}case Ee.ToggleCover:case Ee.ToggleMax:xe||Ce||(Se=!0)}Se?(Ae.setAttribute("aria-disabled",""),Ae.setAttribute("tabindex","-1")):(Ae.removeAttribute("aria-disabled"),Ae.removeAttribute("tabindex"))}}function q(j,ee){var se;if(!(j&&t&&r&&d&&B())||j===Ee.Swipe&&Math.abs(d.getCurrentVelocities().scale)>.01)return;const oe=Object.assign({},g);let U=Object.assign({},g),ne=G(C()?oe.scale:p.scale);const he=d.getCurrentVelocities(),pe=S(),xe=(((se=(ee=ee||{}).currentTouch)===null||se===void 0?void 0:se.length)||0)>1,Ve=ee.velocityX||0,Ce=ee.velocityY||0;let Le=ee.center;ee.srcEvent&&(Le=Pt(wl(ee.srcEvent)));let Ae=ee.deltaX||0,He=ee.deltaY||0;switch(j){case Ee.MoveRight:Ae=ee.deltaX||100;break;case Ee.MoveLeft:Ae=ee.deltaX||-100;break;case Ee.MoveUp:He=ee.deltaY||-100;break;case Ee.MoveDown:He=ee.deltaY||100}let Se=[];switch(j){case Ee.Reset:U=Object.assign({},ht),U.scale=E();break;case Ee.Pan:case Ee.Move:case Ee.MoveLeft:case Ee.MoveRight:case Ee.MoveUp:case Ee.MoveDown:if(J()){let Y=1,H=1;U.x<=ne.x[0]&&Ve<=0&&(Y=Math.max(.01,1-Math.abs(1/pe.width*Math.abs(U.x-ne.x[0]))),Y*=.2),U.x>=ne.x[1]&&Ve>=0&&(Y=Math.max(.01,1-Math.abs(1/pe.width*Math.abs(U.x-ne.x[1]))),Y*=.2),U.y<=ne.y[0]&&Ce<=0&&(H=Math.max(.01,1-Math.abs(1/pe.height*Math.abs(U.y-ne.y[0]))),H*=.2),U.y>=ne.y[1]&&Ce>=0&&(H=Math.max(.01,1-Math.abs(1/pe.height*Math.abs(U.y-ne.y[1]))),H*=.2),U.x+=Ae*Y,U.y+=He*H}else U.x=Fe(ne.x[0],U.x+Ae,ne.x[1]),U.y=Fe(ne.y[0],U.y+He,ne.y[1]);break;case Ee.Swipe:const z=(Y=0)=>Math.sign(Y)*Math.pow(Math.abs(Y),1.5);U.x+=Fe(-1e3,z(Ve),1e3),U.y+=Fe(-1e3,z(Ce),1e3),Ce&&!Ve&&(U.x=Fe(ne.x[0],U.x,ne.x[1])),!Ce&&Ve&&(U.y=Fe(ne.y[0],U.y,ne.y[1])),he.x=Ve,he.y=Ce;break;case Ee.ZoomTo:U.scale=ee.scale||1;break;case Ee.ZoomIn:U.scale=U.scale*(ee.scale||2),xe||(U.scale=Math.min(U.scale,F()));break;case Ee.ZoomOut:U.scale=U.scale*(ee.scale||.5),xe||(U.scale=Math.max(U.scale,V()));break;case Ee.ToggleCover:Se=[E(),$()];break;case Ee.ToggleFull:Se=[E(),D()];break;case Ee.ToggleMax:Se=[E(),F()];break;case Ee.IterateZoom:Se=[E(),D(),F()];break;case Ee.Zoom:const W=D();U.scale>=W-.05?U.scale=E():U.scale=Math.min(W,U.scale*(ee.scale||2));break;case Ee.RotateCW:U.angle+=90;break;case Ee.RotateCCW:U.angle-=90;break;case Ee.FlipX:U.flipX*=-1;break;case Ee.FlipY:U.flipY*=-1}if(p.angle!==void 0&&Math.abs(p.angle)>=360&&(U.angle-=360*Math.floor(p.angle/360),p.angle-=360*Math.floor(p.angle/360)),Se.length){const z=Se.findIndex(W=>W>U.scale+1e-4);U.scale=Se[z]||Se[0]}if(xe&&(U.scale=Fe(V()*(xe?.8:1),U.scale,F()*(xe?1.6:1))),C()){const z=O(U.scale);if(z){const{x:W,y:Y}=z;U.x=W,U.y=Y}}else if(Math.abs(U.scale-oe.scale)>1e-4){let z=0,W=0;if(Le)z=Le.x,W=Le.y;else{const le=t.getBoundingClientRect();z=le.x+.5*le.width,W=le.y+.5*le.height}let Y=z-pe.left,H=W-pe.top;Y-=.5*pe.width,H-=.5*pe.height;const K=(Y-oe.x)/oe.scale,te=(H-oe.y)/oe.scale;U.x=Y-K*U.scale,U.y=H-te*U.scale,!xe&&k("bounds")&&(ne=G(U.scale),U.x=Fe(ne.x[0],U.x,ne.x[1]),U.y=Fe(ne.y[0],U.y,ne.y[1]))}if(j===Ee.Swipe){let z=94,W=17,Y=500*U.scale,H=he;d.spring({tension:z,friction:W,maxSpeed:Y,restDelta:.1,restSpeed:.1,velocity:H})}else j===Ee.Pan||xe?d.spring({tension:900,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:he});if(ee.velocity===0||vn(p,U))p=Object.assign({},U),g=Object.assign({},U),d.end(),re(),I();else{if(vn(g,U))return;d.from(p).to(U).start()}x("action",j)}function re(){if(!r||!o||!s)return;const{width:j,height:ee}=N();Object.assign(o.style,{maxWidth:`min(${j}px, 100%)`,maxHeight:`min(${ee}px, 100%)`});const se=function(){const{width:Ae,height:He}=N(),{width:Se,height:z}=w();if(!t)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:Se,fitHeight:z,fullWidth:Ae,fullHeight:He};let{x:W,y:Y,scale:H,angle:K,flipX:te,flipY:le}=p,P=1/D(),Z=Ae,X=He,me=p.scale*P,be=g.scale*P;const Me=Math.max(Se,z),_e=Math.min(Se,z);Ae>He?(Z=Me,X=_e):(Z=_e,X=Me),me=Ae>He?Me*H/Ae||1:Me*H/He||1;let ze=Z?Ae*be:0,Je=X?He*be:0,et=Z&&X?Ae*me/ze:0;return W=W+.5*Z-.5*ze,Y=Y+.5*X-.5*Je,{x:W,y:Y,width:ze,height:Je,scale:et,flipX:te,flipY:le,angle:K,fitWidth:Se,fitHeight:z,fullWidth:Ae,fullHeight:He}}(),{x:oe,y:U,width:ne,height:he,scale:pe,angle:xe,flipX:Ve,flipY:Ce}=se;let Le=`translate(${ot(oe)}px, ${ot(U)}px)`;Le+=Ve!==1||Ce!==1?` scaleX(${ot(pe*Ve)}) scaleY(${ot(pe*Ce)})`:` scale(${ot(pe)})`,xe!==0&&(Le+=` rotate(${xe}deg)`),s.style.width=`${ot(ne)}px`,s.style.height=`${ot(he)}px`,s.style.transform=`${Le}`,x("render")}function ye(){let j=g.scale;const ee=k("clickAction");let se=E();if(ee){let oe=[];switch(ee){case Ee.ZoomIn:se=2*j;break;case Ee.ZoomOut:se=.5*j;break;case Ee.ToggleCover:oe=[E(),$()];break;case Ee.ToggleFull:oe=[E(),D()];break;case Ee.ToggleMax:oe=[E(),F()];break;case Ee.IterateZoom:oe=[E(),D(),F()];break;case Ee.Zoom:const U=D();se=j>=U-.05?E():Math.min(U,2*j)}if(oe.length){const U=oe.findIndex(ne=>ne>j+1e-4);se=oe[U]||E()}}return se=Fe(V(),se,F()),se}function de(){return!!(B()&&ye()>g.scale)}function Ne(){return!!(B()&&ye()<g.scale)}function ve(){return!!(B()&&g.scale>V())}function we(){return!!(B()&&g.scale<F())}function Be(){return!!(B()&&g.scale<D())}function Te(){return!(!(B()&&ue()&&i)||C())}function J(){return!(!B()||!(i!=null&&i.isPointerDown())||C())}function ue(){return!!(B()&&g.scale>E())}function ge(){return!!(B()&&g.scale>=D())}function ce(){const j="in-fullscreen",ee="with-panzoom-in-fullscreen";t==null||t.classList.toggle(j);const se=t==null?void 0:t.classList.contains(j);se?(document.documentElement.classList.add(ee),document.addEventListener("keydown",ie,!0)):(document.documentElement.classList.remove(ee),document.removeEventListener("keydown",ie,!0)),re(),x(se?"enterFS":"exitFS")}function ie(j){j.key!=="Escape"||j.defaultPrevented||ce()}const fe={canDrag:Te,canZoomIn:we,canZoomOut:ve,canZoomToFull:Be,destroy:function(){x("destroy");for(const j of Object.values(h))j==null||j.destroy(fe);for(const j of y)j();return o&&(o.style.aspectRatio="",o.style.maxWidth="",o.style.maxHeight=""),s&&(s.style.width="",s.style.height="",s.style.transform=""),o=void 0,r=void 0,s=void 0,p=Object.assign({},ht),g=Object.assign({},ht),d==null||d.destroy(),d=void 0,i==null||i.destroy(),i=void 0,m=4,fe},emit:x,execute:q,getBoundaries:G,getContainer:function(){return t},getContent:function(){return r},getFullDim:N,getGestures:function(){return i},getMousemovePos:O,getOptions:function(){return f},getPlugins:function(){return h},getScale:T,getStartPosition:M,getState:function(){return m},getTransform:function(j){return j===!0?g:p},getTween:function(){return d},getViewport:function(){return s},getWrapper:function(){return o},init:function(){return m=0,x("init"),function(){for(const[j,ee]of Object.entries(Object.assign(Object.assign({},a),f.plugins||{})))if(j&&!h[j]&&ee instanceof Function){const se=ee();se.init(fe),h[j]=se}x("initPlugins")}(),function(){const j=Object.assign(Object.assign({},ao.classes),k("classes"));if(t&&($e(t,j.container),r=t.querySelector("."+j.content),!!r)){if(r.setAttribute("draggable","false"),o=t.querySelector("."+j.wrapper),o||(o=document.createElement("div"),$e(o,j.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),s=t.querySelector("."+j.viewport),s||(s=document.createElement("div"),$e(s,j.viewport),s.insertAdjacentElement("afterbegin",r),o.insertAdjacentElement("beforeend",s)),l=r.cloneNode(!0),l.removeAttribute("id"),o.insertAdjacentElement("afterbegin",l),r instanceof HTMLPictureElement&&(r=r.querySelector("img")),l instanceof HTMLPictureElement&&(l=l.querySelector("img")),s instanceof HTMLPictureElement&&(s=s.querySelector("img")),s&&(s.style.visibility="hidden",k("protected"))){s.addEventListener("contextmenu",se=>{Kt(se)});const ee=document.createElement("div");$e(ee,"f-panzoom__protected"),s.appendChild(ee)}x("initLayout")}}(),function(){if(t&&o&&!u){let j=null;u=new ResizeObserver(()=>{B()&&(j=j||requestAnimationFrame(()=>{B()&&(I(),Q(),x("refresh")),j=null}))}),u.observe(o),y.push(()=>{u==null||u.disconnect(),u=void 0,j&&(cancelAnimationFrame(j),j=null)})}}(),function(){if(!t||!r)return;if(!Et(r)||!Et(l))return void A();const j=()=>{r&&Et(r)&&r.decode().then(()=>{A()}).catch(()=>{A()})};if(m=1,t.classList.add("is-loading"),x("loading"),l.src&&l.complete)return void j();(function(){if(!t||t!=null&&t.querySelector(".f-spinner"))return;const ee=k("spinnerTpl"),se=Vt(ee);se&&(se.classList.add("f-spinner"),t.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",se))})(),l.addEventListener("load",j,!1),l.addEventListener("error",j,!1),y.push(()=>{l==null||l.removeEventListener("load",j,!1),l==null||l.removeEventListener("error",j,!1)})}(),fe},isDragging:J,isExpanded:ue,isFullsize:ge,isMousemoveMode:C,localize:function(j,ee=[]){const se=k("l10n")||{};j=String(j).replace(/\{\{(\w+)\}\}/g,(oe,U)=>se[U]||oe);for(let oe=0;oe<ee.length;oe++)j=j.split(ee[oe][0]).join(ee[oe][1]);return j=j.replace(/\{\{(.*?)\}\}/g,(oe,U)=>U)},off:function(j,ee){for(const se of j instanceof Array?j:[j])b.has(se)&&b.set(se,b.get(se).filter(oe=>oe!==ee));return fe},on:function(j,ee){for(const se of j instanceof Array?j:[j])b.set(se,[...b.get(se)||[],ee]);return fe},toggleFS:ce,updateControls:I,version:"6.1.3",willZoomIn:de,willZoomOut:Ne};return fe};oo.l10n={en_EN:no},oo.getDefaults=()=>ao;/*! License details at fancyapps.com/license */const ro=(t,n)=>{let a=[];return t.childNodes.forEach(o=>{o.nodeType!==Node.ELEMENT_NODE||n&&!o.matches(n)||a.push(o)}),a};/*! License details at fancyapps.com/license */const ct=(t,...n)=>{const a=n.length;for(let o=0;o<a;o++){const r=n[o]||{};Object.entries(r).forEach(([l,s])=>{const i=Array.isArray(s)?[]:{};t[l]||Object.assign(t,{[l]:i}),Qe(s)?Object.assign(t[l],ct(t[l],s)):Array.isArray(s)?Object.assign(t,{[l]:[...s]}):Object.assign(t,{[l]:s})})}return t};/*! License details at fancyapps.com/license */const ua=function(t=0,n=0,a=0,o=0,r=0,l=!1){const s=(t-n)/(a-n)*(r-o)+o;return l?o<r?Fe(o,s,r):Fe(r,s,o):s};/*! License details at fancyapps.com/license */const lo=Object.assign(Object.assign({},no),{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 Jt=t=>{t.cancelable&&t.preventDefault()},gn={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:lo,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:160,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1};let Vl,Sl=0;const ma=(t,n={},a={})=>{Sl++;let o,r,l,s,i,d=0,u=Object.assign({},gn),c=Object.assign({},gn),m={},f=null,h=null,p=!1,g=!1,y=!1,k=!1,B="height",b=0,x=!0,v=0,_=0,R=0,L=0,A="*",M=[],S=[];const N=new Set;let w=[],C=[],O=0,T=0,V=0;function E(z,...W){let Y=c[z];return Y&&Y instanceof Function?Y(Se,...W):Y}function $(z,W=[]){const Y=E("l10n")||{};z=String(z).replace(/\{\{(\w+)\}\}/g,(H,K)=>Y[K]||H);for(let H=0;H<W.length;H++)z=z.split(W[H][0]).join(W[H][1]);return z=z.replace(/\{\{(.*?)\}\}/g,(H,K)=>K)}const D=new Map;function F(z,...W){const Y=[...D.get(z)||[]];c.on&&Y.push(c.on[z]);for(const H of Y)H&&H instanceof Function&&H(Se,...W);z!=="*"&&F("*",z,...W)}function G(){var z,W;const Y=ct({},gn,u);ct(Y,gn,u);let H="";const K=u.breakpoints||{};if(K)for(const[te,le]of Object.entries(K))window.matchMedia(te).matches&&(H+=te,ct(Y,le));if(i===void 0||H!==i){if(i=H,d!==0){let te=(W=(z=C[v])===null||z===void 0?void 0:z.slides[0])===null||W===void 0?void 0:W.index;te===void 0&&(te=c.initialSlide),Y.initialSlide=te,Y.slides=[];for(const le of M)le.isVirtual&&Y.slides.push(le)}Le(),c=Y,E("enabled")!==!1&&(d=0,F("init"),function(){for(const[te,le]of Object.entries(Object.assign(Object.assign({},a),c.plugins||{})))if(te&&!m[te]&&le instanceof Function){const P=le();P.init(Se,ma),m[te]=P}F("initPlugins")}(),function(){if(!f)return;const te=E("classes")||{};$e(f,te.container);const le=E("style");if(le&&Qe(le))for(const[P,Z]of Object.entries(le))f.style.setProperty(P,Z);h=f.querySelector(`.${te.viewport}`),h||(h=document.createElement("div"),$e(h,te.viewport),h.append(...ro(f,`.${te.slide}`)),f.insertAdjacentElement("afterbegin",h)),f.carousel=Se,F("initLayout")}(),function(){if(!h)return;const te=E("classes")||{};M=[],[...ro(h,`.${te.slide}`)].forEach(le=>{if(le.parentElement){const P=ue(Object.assign({el:le,isVirtual:!1},le.dataset||{}));F("createSlide",P),M.push(P)}}),fe();for(const le of M)F("addSlide",le);J(E("slides"));for(const le of M){const P=le.el;(P==null?void 0:P.parentElement)===h&&($e(P,c.classes.slide),$e(P,le.class),pe(le),F("attachSlideEl",le))}F("initSlides")}(),j(),d=1,$e(f,(E("classes")||{}).isEnabled||""),Ce(),ye(),r=Ft().on("start",()=>{o&&o.isPointerDown()||(re(),Ce())}).on("step",te=>{const le=b;b=te.pos,b!==le&&(x=!1,Ce())}).on("end",te=>{o!=null&&o.isPointerDown()||(b=te.pos,r&&!g&&(b<R||b>L)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Fe(R,b,L)}).start():x||(x=!0,F("settle")))}),I(),function(){if(!f||!h)return;f.addEventListener("click",U,{passive:!1}),document.addEventListener("mousemove",Q);const te=h.getBoundingClientRect();if(O=te.height,T=te.width,!l){let le=null;l=new ResizeObserver(()=>{le||(le=requestAnimationFrame(()=>{(function(){if(d!==1||!h)return;const P=C.length,Z=h.getBoundingClientRect(),X=Z.height,me=Z.width;P>1&&(k&&Math.abs(X-O)<.5||!k&&Math.abs(me-T)<.5)||(j(),I(),O=X,T=me,k&&!X||!k&&!me||f&&h&&(P===C.length&&(o!=null&&o.isPointerDown())||(E("dragFree")&&(g||b>R&&b<L)?(re(),Ce()):xe(v,{transition:!1}))))})(),le=null}))}),l.observe(h)}}(),F("ready"))}}function Q(z){Vl=z}function I(){E("gestures")===!1?o&&(o.destroy(),o=void 0):o||function(){const z=E("gestures");!o&&z!==!1&&h&&(o=hn(h,z).on("start",W=>{var Y,H;if(!r)return;const{srcEvent:K}=W;k&&Vn(K)&&!Qt(K.target)&&Jt(K),r.pause(),r.getCurrentVelocities().pos=0;const te=(Y=C[v])===null||Y===void 0?void 0:Y.slides[0];te&&N.has(te.index)&&te.el&&(b=te.offset||0,b+=(function(le){const P=window.getComputedStyle(le),Z=new DOMMatrixReadOnly(P.transform);return{width:Z.m41||0,height:Z.m42||0}}(te.el)[B]||0)*(y&&!k?1:-1)),se(),g||(b<R||b>L)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:((H=r.getCurrentVelocities())===null||H===void 0?void 0:H.pos)||0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Fe(R,b,L)}).start()}).on("move",W=>{var Y,H;const{srcEvent:K,axis:te}=W,le=K.target;if(te||(Jt(K),K.stopPropagation(),K.stopImmediatePropagation()),(te==="y"&&k||te==="x"&&!k)&&(Jt(K),K.stopPropagation()),!te)return;const{deltaX:P,deltaY:Z}=W;if(!r||Vn(K)&&((Y=K.touches)===null||Y===void 0?void 0:Y.length)>1||te==="y"&&!k||te==="x"&&k||le&&Qt(le)&&(te!=="x"||k))return;const X=y&&!k?1:-1;let me=k?Z:P,be=r!=null&&r.isRunning()?r.getEndValues().pos:b,Me=1;g||(be<=R&&me*X<0?(Me=Math.max(.01,1-(Math.abs(1/we()*Math.abs(be-R))||0)),Me*=.2):be>=L&&me*X>0&&(Me=Math.max(.01,1-(Math.abs(1/we()*Math.abs(be-L))||0)),Me*=.2)),be+=me*Me*X,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:((H=r.getCurrentVelocities())===null||H===void 0?void 0:H.pos)||0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:be}).start()}).on("panstart",W=>{(W==null?void 0:W.axis)===(k?"y":"x")&&$e(h,"is-dragging")}).on("panend",()=>{at(h,"is-dragging")}).on("end",W=>{var Y,H;const{srcEvent:K,axis:te,velocityX:le,velocityY:P,currentTouch:Z}=W;if(Z.length>0||!r)return;const X=K.target,me=X&&Qt(X)&&!(te==="x"&&!k);k&&Vn(K)&&!W.axis&&U(K);const be=C.length,Me=E("dragFree");if(!be)return;const _e=E("vertical")?P:le;let ze=r!=null&&r.isRunning()?r.getEndValues().pos:b;const Je=y&&!k?1:-1;if(me||(ze+=_e*(Me?5:1)*Je),!g&&(_e*Je<=0&&ze<R||_e*Je>=0&&ze>L)){let tt=0;return Math.abs(_e)>0&&(tt=2*Math.abs(_e),tt=Math.min(.3*we(),tt)),ze=Fe(R+-1*tt,ze,L+tt),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*_e,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:ze}).start()}if(Me||!((Y=m.Autoscroll)===null||Y===void 0)&&Y.isEnabled())return void(Math.abs(_e)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*_e,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:ze}).start():r.isRunning()||x||(x=!0,F("settle")));if(!Me&&!(!((H=m.Autoscroll)===null||H===void 0)&&H.isEnabled())&&(!W.offsetX&&!W.offsetY||te==="y"&&!k||te==="x"&&k))return void xe(v,{transition:"tween"});let et=Ne(ze);Math.abs(_e)>10&&et===v&&(et+=_e>0?y&&!k?1:-1:y&&!k?-1:1),xe(et,{transition:"tween",tween:{velocity:-1*_e}})}).init())}(),Ke(h,"is-draggable",!!o&&C.length>0)}function q(z="*"){var W;const Y=[];for(const H of M)(z==="*"||H.class&&H.class.includes(z)||H.el&&(!((W=H.el)===null||W===void 0)&&W.classList.contains(z)))&&Y.push(H);s=void 0,A=z,S=[...Y]}function re(){if(!r)return;const z=Ne(r!=null&&r.isRunning()?r.getEndValues().pos:b);z!==v&&(s=v,v=z,pe(),ye(),de(),F("change",v,s))}function ye(){var z,W;if(!f)return;for(const K of f.querySelectorAll("[data-carousel-index]"))K.innerHTML=v+"";for(const K of f.querySelectorAll("[data-carousel-page]"))K.innerHTML=v+1+"";for(const K of f.querySelectorAll("[data-carousel-pages]"))K.innerHTML=C.length+"";for(const K of f.querySelectorAll("[data-carousel-go-to]"))parseInt(((z=K.dataset)===null||z===void 0?void 0:z.carouselGoTo)||"-1",10)===v?K.setAttribute("aria-current","true"):K.removeAttribute("aria-current");for(const K of f.querySelectorAll("[data-carousel-go-prev]"))K.toggleAttribute("aria-disabled",!Ae()),Ae()?K.removeAttribute("tabindex"):K.setAttribute("tabindex","-1");for(const K of f.querySelectorAll("[data-carousel-go-next]"))K.toggleAttribute("aria-disabled",!He()),He()?K.removeAttribute("tabindex"):K.setAttribute("tabindex","-1");let Y=!1;const H=(W=C[v])===null||W===void 0?void 0:W.slides[0];H&&(H.downloadSrc||H.type==="image"&&H.src)&&(Y=!0);for(const K of f.querySelectorAll("[data-carousel-download]"))K.toggleAttribute("aria-disabled",!Y)}function de(z){var W;z||(z=(W=C[v])===null||W===void 0?void 0:W.slides[0]);const Y=z==null?void 0:z.el;if(Y)for(const H of Y.querySelectorAll("[data-slide-index]"))H.innerHTML=z.index+1+""}function Ne(z){var W,Y,H;if(!C.length)return 0;const K=Be();let te=z;g?te-=Math.floor((z-((W=C[0])===null||W===void 0?void 0:W.pos))/K)*K||0:te=Fe((Y=C[0])===null||Y===void 0?void 0:Y.pos,z,(H=C[C.length-1])===null||H===void 0?void 0:H.pos);const le=new Map;let P=0;for(const X of C){const me=Math.abs(X.pos-te),be=Math.abs(X.pos-te-K),Me=Math.abs(X.pos-te+K),_e=Math.min(me,be,Me);le.set(P,_e),P++}const Z=le.size>0?[...le.entries()].reduce((X,me)=>me[1]<X[1]?me:X):[v,0];return parseInt(Z[0])}function ve(){return V}function we(){let z=0;return h&&(h.childElementCount||(h.style.display="grid"),z=h.getBoundingClientRect()[B]||0,h.style.display=""),z}function Be(z=!0){return S.length?S.reduce((W,Y)=>W+Y.dim,0)+(S.length-(g&&z?0:1))*V:0}function Te(z){const W=Be(),Y=we();if(!W||!h||!Y)return[];const H=[];z=z===void 0?b:z,g&&(z-=Math.floor(z/W)*W||0);let K=0,te=0;if(p){const P=h.getBoundingClientRect();K=Math.abs(P[k?"top":"left"]),te=Math.abs(window[k?"innerHeight":"innerWidth"]-P[k?"bottom":"right"])}let le=0;for(let P of S){const Z=(X=0)=>{H.indexOf(P)>-1||(P.pos=le-z+X||0,P.offset+X>z-P.dim-K+.51&&P.offset+X<z+Y+te-.51&&H.push(P))};P.offset=le,g&&(Z(W),Z(-1*W)),Z(),le+=P.dim+V}return H}function J(z,W){const Y=[];for(const H of Array.isArray(z)?z:[z]){const K=ue(Object.assign(Object.assign({},H),{isVirtual:!0}));K.el||(K.el=document.createElement("div")),F("createSlide",K),Y.push(K)}M.splice(W===void 0?M.length:W,0,...Y),fe();for(const H of Y)F("addSlide",H),ge(H);return q(A),Y}function ue(z){return(Oe(z)||z instanceof HTMLElement)&&(z={html:z}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},z)}function ge(z){let W=z.el;if(!z||!W)return;const Y=z.html?z.html instanceof HTMLElement?z.html:Vt(z.html):void 0;Y&&($e(Y,"f-html"),z.htmlEl=Y,$e(W,"has-html"),W.append(Y),F("contentReady",z))}function ce(z){if(!h||!z)return;let W=z.el;if(W){if(W.setAttribute("index",z.index+""),W.parentElement!==h){let Y;$e(W,c.classes.slide),$e(W,z.class),pe(z);for(const H of M)if(H.index>z.index){Y=H.el;break}h.insertBefore(W,Y&&h.contains(Y)?Y:null),F("attachSlideEl",z)}return de(z),W}}function ie(z){const W=z==null?void 0:z.el;W&&(W.remove(),ee(W),F("detachSlideEl",z))}function fe(){for(let z=0;z<M.length;z++){const W=M[z],Y=W.el;Y&&(W.index!==z&&ee(Y),Y.setAttribute("index",`${z}`)),W.index=z}}function j(){var z,W,Y,H,K;if(!f||!h)return;y=E("rtl"),k=E("vertical"),B=k?"height":"width";const te=E("classes");if(Ke(f,te.isLTR,!y),Ke(f,te.isRTL,y),Ke(f,te.isHorizontal,!k),Ke(f,te.isVertical,k),Ke(f,te.hasAdaptiveHeight,E("adaptiveHeight")),!we())return;const le=window.getComputedStyle(h);p=le.getPropertyValue("overflow-"+(k?"y":"x"))==="visible",V=h&&parseFloat(le.getPropertyValue("--f-carousel-gap"))||0;const P=function(){let Z=0;if(h){let X=document.createElement("div");X.style.display="block",$e(X,c.classes.slide),h.appendChild(X),Z=X.getBoundingClientRect()[B],X.remove(),X=void 0}return Z}();for(const Z of S){const X=Z.el;let me=0;if(!Z.isVirtual&&X&&mn(X)){let be=!1;X.parentElement&&X.parentElement===h||(h.appendChild(X),be=!0),me=X.getBoundingClientRect()[B],be&&((z=X.parentElement)===null||z===void 0||z.removeChild(X))}else me=P;Z.dim=me}if(g=!1,E("infinite")){g=!0;const Z=Be();let X=we();if(p){const me=h.getBoundingClientRect();X+=me.left,X+=me.right-me.width}for(let me=0;me<S.length;me++){const be=((W=S[me])===null||W===void 0?void 0:W.dim)+V;if(Z-be<X&&Z-be-X<be){g=!1;break}}}(function(){var Z;if(!f)return;const X=we(),me=Be(!1);let be=E("slidesPerPage");be=be==="auto"?1/0:parseFloat(be+""),C=[];let Me=0,_e=0;for(const Ie of S)(!C.length||Me+Ie.dim-X>.05||_e>=be)&&(C.push({index:C.length,slides:[],dim:0,offset:0,pos:0}),Me=0,_e=0),(Z=C[C.length-1])===null||Z===void 0||Z.slides.push(Ie),Me+=Ie.dim+V,_e++;const ze=E("center"),Je=E("fill");let et=0;for(const Ie of C){Ie.dim=(Ie.slides.length-1)*V;for(const lt of Ie.slides)Ie.dim+=lt.dim;Ie.offset=et,Ie.pos=et,ze!==!1&&(Ie.pos-=.5*(X-Ie.dim)),Je&&!g&&me>X&&(Ie.pos=Fe(0,Ie.pos,me-X)),et+=Ie.dim+V}const tt=[];let mt;for(const Ie of C){const lt=Object.assign({},Ie);mt&&Math.abs(lt.pos-mt.pos)<.1?(mt.dim+=lt.dim,mt.slides=[...mt.slides,...lt.slides]):(mt=lt,lt.index=tt.length,tt.push(lt))}C=tt,v=Fe(0,v,C.length-1)})(),R=((Y=C[0])===null||Y===void 0?void 0:Y.pos)||0,L=((H=C[C.length-1])===null||H===void 0?void 0:H.pos)||0,d===0?function(){var Z;s=void 0,v=E("initialPage");const X=E("initialSlide")||void 0;X!==void 0&&(v=Se.getPageIndex(X)||0),v=Fe(0,v,C.length-1),b=((Z=C[v])===null||Z===void 0?void 0:Z.pos)||0,_=b}():_=((K=C[v||0])===null||K===void 0?void 0:K.pos)||0,F("refresh"),ye()}function ee(z){if(!z||!mn(z))return;const W=parseInt(z.getAttribute("index")||"-1");let Y="";for(const K of Array.from(z.classList)){const te=K.match(/^f-(\w+)(Out|In)$/);te&&te[1]&&(Y=te[1]+"")}if(!z||!Y)return;const H=[`f-${Y}Out`,`f-${Y}In`,"to-prev","to-next","from-prev","from-next"];z.removeEventListener("animationend",oe),at(z,H.join(" ")),N.delete(W)}function se(){if(!h)return;const z=N.size>0;for(const W of S)ee(W.el);N.clear(),z&&Ce()}function oe(z){var W;((W=z.animationName)===null||W===void 0?void 0:W.substring(0,2))==="f-"&&(ee(z.target),N.size||(at(f,"in-transition"),!x&&Math.abs(Se.getPosition(!0)-_)<.5&&(x=!0,F("settle"))),Ce())}function U(z){var W;if(z.defaultPrevented)return;const Y=z.composedPath()[0];if(Y.closest("[data-carousel-go-prev]"))return Jt(z),void Se.prev();if(Y.closest("[data-carousel-go-next]"))return Jt(z),void Se.next();const H=Y.closest("[data-carousel-go-to]");if(H)return Jt(z),void Se.goTo(parseFloat(H.dataset.carouselGoTo||"")||0);if(Y.closest("[data-carousel-download]")){Jt(z);const K=(W=C[v])===null||W===void 0?void 0:W.slides[0];if(K&&(K.downloadSrc||K.type==="image"&&K.src)){const te=K.downloadFilename,le=document.createElement("a"),P=K.downloadSrc||K.src||"";le.href=P,le.target="_blank",le.download=te||P,le.click()}}else F("click",z)}function ne(z){var W;const Y=z.el;Y&&((W=Y.querySelector(".f-spinner"))===null||W===void 0||W.remove())}function he(z){var W;const Y=z.el;Y&&((W=Y.querySelector(".f-html.is-error"))===null||W===void 0||W.remove(),at(Y,"has-error"))}function pe(z){var W;z||(z=(W=C[v])===null||W===void 0?void 0:W.slides[0]);const Y=z==null?void 0:z.el;if(!Y)return;let H=E("formatCaption",z);H===void 0&&(H=z.caption),H=H||"";const K=E("captionEl");if(K&&K instanceof HTMLElement){if(z.index!==v)return;if(Oe(H)&&(K.innerHTML=$(H+"")),H instanceof HTMLElement){if(H.parentElement===K)return;K.innerHTML="",H.parentElement&&(H=H.cloneNode(!0)),K.append(H)}return}if(!H)return;let te=z.captionEl||Y.querySelector(".f-caption");!te&&H instanceof HTMLElement&&H.classList.contains("f-caption")&&(te=H),te||(te=document.createElement("div"),$e(te,"f-caption"),Oe(H)?te.innerHTML=$(H+""):H instanceof HTMLElement&&(H.parentElement&&(H=H.cloneNode(!0)),te.append(H)));const le=`f-caption-${Sl}_${z.index}`;te.setAttribute("id",le),te.dataset.selectable="true",$e(Y,"has-caption"),Y.setAttribute("aria-labelledby",le),z.captionEl=te,Y.insertAdjacentElement("beforeend",te)}function xe(z,W={}){var Y,H;let{transition:K,tween:te}=Object.assign({transition:c.transition,tween:c.tween},W||{});if(!f||!r)return;const le=C.length;if(!le||function(X,me){var be,Me,_e,ze;if(!(f&&r&&me&&Oe(me)&&me!=="tween")||((be=C[v])===null||be===void 0?void 0:be.slides.length)>1)return!1;const Je=C.length;let et=X>v?1:-1;X=g?(X%Je+Je)%Je:Fe(0,X,Je-1),y&&(et*=-1);const tt=(Me=C[v])===null||Me===void 0?void 0:Me.slides[0],mt=tt==null?void 0:tt.index,Ie=(_e=C[X])===null||_e===void 0?void 0:_e.slides[0],lt=Ie==null?void 0:Ie.index,on=(ze=C[X])===null||ze===void 0?void 0:ze.pos;if(lt===void 0||mt===void 0||mt===lt||b===on||Math.abs(we()-((Ie==null?void 0:Ie.dim)||0))>1)return!1;x=!1,r.pause(),se(),$e(f,"in-transition"),b=_=on;const kt=ce(tt),vt=ce(Ie);return re(),kt&&(N.add(mt),kt.style.transform="",kt.addEventListener("animationend",oe),at(kt,c.classes.isSelected),kt.inert=!1,$e(kt,`f-${me}Out to-${et>0?"next":"prev"}`)),vt&&(N.add(lt),vt.style.transform="",vt.addEventListener("animationend",oe),$e(vt,c.classes.isSelected),vt.inert=!1,$e(vt,`f-${me}In from-${et>0?"prev":"next"}`)),Ce(),!0}(z,K))return;z=g?(z%le+le)%le:Fe(0,z,le-1),_=((Y=C[z||0])===null||Y===void 0?void 0:Y.pos)||0;const Z=r.isRunning()?r.getEndValues().pos:b;if(Math.abs(_-Z)<1)return b=_,v!==z&&(pe(),s=v,v=z,ye(),de(),F("change",v,s)),Ce(),void(x||(x=!0,F("settle")));if(r.pause(),se(),g){const X=Be(),me=Math.floor((Z-((H=C[0])===null||H===void 0?void 0:H.pos))/X)||0,be=_+me*X;_=[be+X,be,be-X].reduce(function(Me,_e){return Math.abs(_e-Z)<Math.abs(Me-Z)?_e:Me})}K!==!1&&Qe(te)?r.spring(ct({},c.tween,te)).from({pos:b}).to({pos:_}).start():(b=_,re(),Ce(),x||(x=!0,F("settle")))}function Ve(z){var W;let Y=b;if(g&&z!==!0){const H=Be();Y-=(Math.floor((b-((W=C[0])===null||W===void 0?void 0:W.pos)||0)/H)||0)*H}return Y}function Ce(){var z;if(!f||!h)return;w=Te();const W=new Set,Y=[],H=C[v],K=c.setTransform;let te;for(const le of S){const P=N.has(le.index),Z=w.indexOf(le)>-1,X=((z=H==null?void 0:H.slides)===null||z===void 0?void 0:z.indexOf(le))>-1;if(le.isVirtual&&!P&&!Z)continue;let me=ce(le);if(me&&(Y.push(le),X&&W.add(me),E("adaptiveHeight")&&X)){const be=(me.firstElementChild||me).getBoundingClientRect().height;te=te==null?be:Math.max(te,be)}}h&&te&&(h.style.height=`${te}px`),[...ro(h,`.${c.classes.slide}`)].forEach(le=>{Ke(le,c.classes.isSelected,W.has(le));const P=M[parseInt(le.getAttribute("index")||"-1")];if(!P)return le.remove(),void ee(le);const Z=N.has(P.index),X=w.indexOf(P)>-1;if(P.isVirtual&&!Z&&!X)return void ie(P);if(le.inert=!X,K===!1)return;let me=P.pos?Math.round(1e4*P.pos)/1e4:0,be=0,Me=0,_e=0,ze=0;Z||(be=k?0:y?-1*me:me,Me=k?me:0,_e=ua(be,0,P.dim,0,100),ze=ua(Me,0,P.dim,0,100)),K instanceof Function&&!Z?K(Se,P,{x:be,y:Me,xPercent:_e,yPercent:ze}):le.style.transform=be||Me?`translate3d(${_e}%, ${ze}%,0)`:""}),F("render",Y)}function Le(){f==null||f.removeEventListener("click",U),document.removeEventListener("mousemove",Q),N.clear(),l==null||l.disconnect(),l=void 0;for(const z of M){let W=z.el;W&&mn(W)&&(z.state=void 0,ne(z),he(z),z.isVirtual?(ie(z),z.el=void 0):(ee(W),W.style.transform="",h&&!h.contains(W)&&h.appendChild(W)))}for(const z of Object.values(m))z==null||z.destroy();m={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const[z,W]of Object.entries(c.classes||{}))z!=="container"&&at(f,W);at(h,"is-draggable")}function Ae(){return g||v>0}function He(){return g||v<C.length-1}const Se={add:function(z,W){var Y;let H=b;const K=v,te=Be(),le=r!=null&&r.isRunning()?r.getEndValues().pos:b,P=te&&Math.floor((le-(((Y=C[0])===null||Y===void 0?void 0:Y.pos)||0))/te)||0;return J(z,W),q(A),j(),r&&te&&(K===v&&(H-=P*te),H===_?b=_:r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:H}).to({pos:_}).start()),Ce(),Se},canGoPrev:Ae,canGoNext:He,destroy:function(){return F("destroy"),window.removeEventListener("resize",G),Le(),D.clear(),f=null,C=[],M=[],c=Object.assign({},gn),m={},S=[],i=void 0,A="*",d=2,Se},emit:F,filter:function(z="*"){return q(z),j(),b=Fe(R,b,L),Ce(),F("filter",z),Se},getContainer:function(){return f},getGapDim:ve,getGestures:function(){return o},getLastMouseMove:function(){return Vl},getOption:function(z){return E(z)},getOptions:function(){return c},getPage:function(){return C[v]},getPageIndex:function(z){if(z!==void 0){for(const W of C||[])for(const Y of W.slides)if(Y.index===z)return W.index;return-1}return v},getPageIndexFromPosition:Ne,getPageProgress:function(z,W){var Y;z===void 0&&(z=v);const H=C[z];if(!H)return z>v?-1:1;const K=Be(),te=ve();let le=H.pos,P=Ve();if(g&&W!==!0){const Z=Math.floor((P-((Y=C[0])===null||Y===void 0?void 0:Y.pos))/K)||0;P-=Z*K,le=[le+K,le,le-K].reduce(function(X,me){return Math.abs(me-P)<Math.abs(X-P)?me:X})}return(P-le)/(H.dim+te)||0},getPageVisibility:function(z){var W;z===void 0&&(z=v);const Y=C[z];if(!Y)return z>v?-1:1;const H=Ve(),K=we();let te=Y.pos;if(g){const le=Be(),P=te+(Math.floor((H-((W=C[0])===null||W===void 0?void 0:W.pos))/le)||0)*le;te=[P+le,P,P-le].reduce(function(Z,X){return Math.abs(X-H)<Math.abs(Z-H)?X:Z})}return te>H&&te+Y.dim<H+K?1:te<H?(te+Y.dim-H)/Y.dim||0:te+Y.dim>H+K&&(H+K-te)/Y.dim||0},getPages:function(){return C},getPlugins:function(){return m},getPosition:Ve,getSlides:function(){return M},getState:function(){return d},getTotalSlideDim:Be,getTween:function(){return r},getViewport:function(){return h},getViewportDim:we,getVisibleSlides:function(z){return z===void 0?w:Te(z)},goTo:xe,hasNavigated:function(){return s!==void 0},hideError:he,hideLoading:ne,init:function(){if(!t||!mn(t))throw new Error("No Element found");return d!==0&&(Le(),d=0),f=t,u=n,window.removeEventListener("resize",G),u.breakpoints&&window.addEventListener("resize",G),G(),Se},isInfinite:function(){return g},isInTransition:function(){return N.size>0},isRTL:function(){return y},isSettled:function(){return x},isVertical:function(){return k},localize:function(z,W=[]){return $(z,W)},next:function(z={}){return xe(v+1,z),Se},off:function(z,W){for(const Y of z instanceof Array?z:[z])D.has(Y)&&D.set(Y,D.get(Y).filter(H=>H!==W));return Se},on:function(z,W){for(const Y of z instanceof Array?z:[z])D.set(Y,[...D.get(Y)||[],W]);return Se},prev:function(z={}){return xe(v-1,z),Se},reInit:function(z={},W={}){return Le(),d=0,i=void 0,A="*",n=z,u=z,a=W,G(),Se},remove:function(z){z===void 0&&(z=M.length-1);const W=M[z];return W&&(F("removeSlide",W),W.el&&(ee(W.el),W.el.remove(),W.el=void 0),M.splice(z,1),q(A),j(),b=Fe(R,b,L),Ce()),Se},setPosition:function(z){b=z,re(),Ce()},showError:function(z,W){ne(z),he(z);const Y=z.el;if(Y){const H=document.createElement("div");$e(H,"f-html"),$e(H,"is-error"),H.innerHTML=$(W||"<p>{{ERROR}}</p>"),z.htmlEl=H,$e(Y,"has-html"),$e(Y,"has-error"),Y.insertAdjacentElement("afterbegin",H),F("contentReady",z)}return Se},showLoading:function(z){const W=z.el,Y=W==null?void 0:W.querySelector(".f-spinner");if(!W||Y)return Se;const H=E("spinnerTpl"),K=Vt(H);return K&&($e(K,"f-spinner"),W.insertAdjacentElement("beforeend",K)),Se},version:"6.1.3"};return Se};ma.l10n={en_EN:lo},ma.getDefaults=()=>gn;/*! License details at fancyapps.com/license */const Nl=(t=!0,n="--f-scrollbar-compensate",a="--f-body-margin",o="hide-scrollbar")=>{const r=document,l=r.body,s=r.documentElement;if(t){if(l.classList.contains(o))return;let i=window.innerWidth-s.getBoundingClientRect().width;i<0&&(i=0),s.style.setProperty(n,`${i}px`);const d=parseFloat(window.getComputedStyle(l).marginRight);d&&l.style.setProperty(a,`${d}px`),l.classList.add(o)}else l.classList.remove(o),l.style.setProperty(a,""),r.documentElement.style.setProperty(n,"")};/*! License details at fancyapps.com/license */function fa(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const en=function(t="",n="",a=""){return t.split(n).join(a)};/*! License details at fancyapps.com/license */const Ml={tpl:t=>`<img class="f-panzoom__content"
|
|
6
|
+
`+l):o.stack=l}catch{}}throw o}}_request(n,a){typeof n=="string"?(a=a||{},a.url=n):a=n||{},a=It(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:l}=a;o!==void 0&&qn.assertOptions(o,{silentJSONParsing:bt.transitional(bt.boolean),forcedJSONParsing:bt.transitional(bt.boolean),clarifyTimeoutError:bt.transitional(bt.boolean)},!1),r!=null&&(ae.isFunction(r)?a.paramsSerializer={serialize:r}:qn.assertOptions(r,{encode:bt.function,serialize:bt.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),qn.assertOptions(a,{baseUrl:bt.spelling("baseURL"),withXsrfToken:bt.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let s=l&&ae.merge(l.common,l[a.method]);l&&ae.forEach(["delete","get","head","post","put","patch","common"],p=>{delete l[p]}),a.headers=it.concat(s,l);const i=[];let d=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(d=d&&g.synchronous,i.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,m=0,f;if(!d){const p=[Br.bind(this),void 0];for(p.unshift(...i),p.push(...u),f=p.length,c=Promise.resolve(a);m<f;)c=c.then(p[m++],p[m++]);return c}f=i.length;let h=a;for(;m<f;){const p=i[m++],g=i[m++];try{h=p(h)}catch(y){g.call(this,y);break}}try{c=Br.call(this,h)}catch(p){return Promise.reject(p)}for(m=0,f=u.length;m<f;)c=c.then(u[m++],u[m++]);return c}getUri(n){n=It(this.defaults,n);const a=fr(n.baseURL,n.url,n.allowAbsoluteUrls);return or(a,n.params,n.paramsSerializer)}};ae.forEach(["delete","get","head","options"],function(n){qt.prototype[n]=function(a,o){return this.request(It(o||{},{method:n,url:a,data:(o||{}).data}))}}),ae.forEach(["post","put","patch"],function(n){function a(o){return function(l,s,i){return this.request(It(i||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:l,data:s}))}}qt.prototype[n]=a(),qt.prototype[n+"Form"]=a(!0)});let R0=class vi{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(l){a=l});const o=this;this.promise.then(r=>{if(!o._listeners)return;let l=o._listeners.length;for(;l-- >0;)o._listeners[l](r);o._listeners=null}),this.promise.then=r=>{let l;const s=new Promise(i=>{o.subscribe(i),l=i}).then(r);return s.cancel=function(){o.unsubscribe(l)},s},n(function(l,s,i){o.reason||(o.reason=new sn(l,s,i),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 vi(function(r){n=r}),cancel:n}}};function H0(t){return function(a){return t.apply(null,a)}}function j0(t){return ae.isObject(t)&&t.isAxiosError===!0}const Ha={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ha).forEach(([t,n])=>{Ha[n]=t});function Sr(t){const n=new qt(t),a=Go(qt.prototype.request,n);return ae.extend(a,qt.prototype,n,{allOwnKeys:!0}),ae.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return Sr(It(t,r))},a}const qe=Sr(wn);qe.Axios=qt,qe.CanceledError=sn,qe.CancelToken=R0,qe.isCancel=cr,qe.VERSION=vr,qe.toFormData=Rn,qe.AxiosError=De,qe.Cancel=qe.CanceledError,qe.all=function(n){return Promise.all(n)},qe.spread=H0,qe.isAxiosError=j0,qe.mergeConfig=It,qe.AxiosHeaders=it,qe.formToJSON=t=>sr(ae.isHTMLForm(t)?new FormData(t):t),qe.getAdapter=Cr.getAdapter,qe.HttpStatusCode=Ha,qe.default=qe;const{Axios:KA,AxiosError:JA,CanceledError:e$,isCancel:t$,CancelToken:n$,VERSION:a$,all:o$,Cancel:r$,isAxiosError:l$,spread:s$,toFormData:i$,AxiosHeaders:c$,HttpStatusCode:d$,formToJSON:u$,getAdapter:m$,mergeConfig:f$}=qe,ja=jt.defineStore("auth",{state:()=>({jwtToken:null,refreshToken:null}),actions:{setToken(t,n=null){this.jwtToken=t,n&&(this.refreshToken=n),this._syncToLocalStorage()},setRefreshToken(t){this.refreshToken=t,this._syncToLocalStorage()},clearToken(){this.jwtToken=null,this.refreshToken=null,localStorage.clear()},_syncToLocalStorage(){if(typeof window<"u"&&window.localStorage)try{if(!this.jwtToken&&!this.refreshToken)return;const t=localStorage.getItem("userData");if(t){const a=JSON.parse(t);this.jwtToken&&(a.access_token=this.jwtToken),this.refreshToken&&(a.refresh_token=this.refreshToken),localStorage.setItem("userData",JSON.stringify(a));return}localStorage.getItem("access_token")!==null&&(this.jwtToken&&localStorage.setItem("access_token",this.jwtToken),this.refreshToken&&localStorage.setItem("refresh_token",this.refreshToken))}catch(t){console.warn("Erro ao sincronizar token com localStorage:",t)}}},getters:{getToken:t=>t.jwtToken,getRefreshToken:t=>t.refreshToken}}),Pe=qe.create({baseURL:"https://back.dev-smclick.com.br/"}),Wn=qe.create();Wn.defaults.baseURL=Pe.defaults.baseURL;let Ga=null,Nr=null,Mr=null;const Ar=()=>(Ga||(Ga=ja(Mr)),Ga);function G0(t){Mr=t}function $r(t){Nr=t}Pe.interceptors.request.use(t=>{try{const a=Ar().jwtToken;a?t.headers.Authorization=`Bearer ${a}`:console.warn("JWT token não configurado em api request")}catch(n){console.warn("Erro ao acessar authStore no interceptor:",n)}return t},t=>Promise.reject(t)),Pe.interceptors.response.use(t=>t,async t=>{if(!t.response)return Promise.reject(t);const n=t.response.status;if(n.toString()[0]==="5")return console.error("Erro inesperado no servidor:",t),Promise.reject(t);if(n===401){const a=Ar(),o=a.refreshToken;if(o)try{const r=Nr||`${Wn.defaults.baseURL}v1/api/attendances/token/refresh/`,s=(await Wn.post(r,{refresh:o})).data.access;return a.setToken(s,o),t.config.headers.Authorization=`Bearer ${s}`,Pe.request(t.config)}catch(r){return console.error("Erro ao fazer refresh do token:",r),a.clearToken(),typeof window<"u"&&window.location&&setTimeout(()=>{window.location.href="/login"},500),Promise.reject(r)}else a.clearToken(),typeof window<"u"&&window.location&&setTimeout(()=>{window.location.href="/login"},500)}return Promise.reject(t)});function I0(t){t&&(Pe.defaults.baseURL=t,Wn.defaults.baseURL=t)}const q0="v1/api/attendances/attendant/",W0="v1/api/attendances/department/",Wt="v1/api/attendances/internal_chat/",U0="v1/api/instances/instance/",Z0="v1/api/crm/event/scheduled_message/",Y0="v1/api/crm/event/calendar",X0="v1/api/crm/products/",Q0="v1/api/contacts/tag/",_r="v1/api/contacts/contact/",Ia=t=>`${_r}${t}/wallets/`,K0="/v1/api/contacts/segmentation_field/",J0="v1/api/attendances/calls/",Un="v1/api/crm/event/attendant_reminder/",ec="v1/api/instances/template/",Ut=jt.defineStore("department",{state:()=>({departments:[],count:null,loaded:!1}),actions:{async fetchDepartments(t=""){try{let n=`${W0}`;const a=await Pe.get(n);this.departments=a.data,this.count=this.departments.length}catch(n){console.log("Erro ao buscar departamentos:",n)}},removeDepartments(t){this.departments=this.departments.filter(n=>n.id!==t)},addDepartments(t){const n=this.departments.findIndex(a=>a.id===t.id);n!==-1?this.departments[n]=t:this.departments.push(t)}}}),tc=["title"],nc={class:"whitespace-nowrap text-sm font-medium"},ac={class:"flex justify-center"},oc={class:"flex-shrink-0 hidden lg:block"},rc={key:0,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},lc={key:1,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},sc={class:"text-xs"},ic={class:"flex justify-center"},cc={class:"flex-shrink-0 hidden lg:block"},dc={key:0,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},uc={key:1,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},mc={key:2,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},fc={key:3,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},pc={class:"text-xs"},hc={class:"w-72 rounded-lg p-2"},gc={key:0,class:"space-y-2"},yc={class:"font-medium text-slate-100 text-sm"},kc={key:1,class:"text-xs text-slate-400 text-center py-2"},bc={class:"flex items-center gap-2 px-3 py-1.5 bg-gradient-to-r from-blue-500/10 to-blue-400/10 border border-blue-500/30 rounded-lg cursor-pointer hover:border-blue-300/50 transition-all"},xc={class:"text-sm font-semibold text-blue-500"},wc={class:"flex items-center justify-center gap-2"},Ec={class:"border border-base-200 rounded-md overflow-hidden"},Cc={class:"flex justify-between items-center p-2 sticky top-0 bg-base-200 z-10"},Bc={class:"font-semibold text-sm"},vc=["disabled","onClick"],Vc=["onClick"],Sc=["onClick"],Nc=["onClick"],Dr=ke({__name:"templateTable",props:{instanceId:{type:[String,Number],required:!0},departmentId:{type:[String,Number],default:null},extraParams:{type:Object,default:()=>({})},mode:{type:String,default:"manage",validator:t=>["manage","send"].includes(t)},showLang:{type:Boolean,default:!1},showDepartments:{type:Boolean,default:!1},itemsPerPage:{type:Number,default:15}},emits:["send","edit","delete","copy-id"],setup(t,{expose:n,emit:a}){const o=t,r=e.ref([]),l=e.ref(!1),s=e.ref(1),i=e.ref(0),d=e.ref({}),u=Ut(),c=e.computed(()=>{const y=[{key:"name",label:"Nome",width:"w-64",headerAlign:"left",filter:{type:"text",placeholder:"Buscar nome..."}}];return o.showLang&&y.push({key:"lang",label:"Idioma",width:"w-20",filter:{type:"select",key:"language",options:[{value:"pt_BR",label:"Português"},{value:"en",label:"Inglês"}]}}),y.push({key:"category",label:"Categoria",width:"w-32",filter:{type:"select",options:[{value:"MARKETING",label:"Marketing"},{value:"UTILITY",label:"Utilidade"},{value:"AUTHENTICATION",label:"Autenticação"}]}},{key:"status",label:"Status",width:"w-32",filter:{type:"select",options:[{value:"PENDING",label:"Pendente"},{value:"APPROVED",label:"Aprovado"},{value:"REJECTED",label:"Reprovado"},{value:"PENDING_DELETION",label:"Ag. deleção"}]}}),o.showDepartments&&y.push({key:"department",label:"Departamento(s)",width:"w-28",filter:{type:"multiselect",key:"departments",options:u.departments.map(k=>({value:String(k.id),label:k.name}))}}),y.push({key:"actions",label:"Ações",width:"w-44",cellClass:"whitespace-nowrap"}),y});async function m(){l.value=!0;try{const y=new URLSearchParams;y.set("page",s.value),y.set("instance",o.instanceId),o.departmentId&&y.set("department",o.departmentId);for(const[B,b]of Object.entries(d.value))Array.isArray(b)?b.length&&y.set(B,b.join(",")):b!=null&&b!==""&&y.append(B,b);if(o.extraParams)for(const[B,b]of Object.entries(o.extraParams))Array.isArray(b)?b.forEach(x=>y.append(B,x)):b!=null&&b!==""&&y.append(B,b);const{data:k}=await Pe.get(`${ec}?${y.toString()}`);r.value=k.results,i.value=k.count}catch{r.value=[],i.value=0}finally{l.value=!1}}function f(y){d.value=y,s.value=1,m()}function h(y){s.value=y,m()}e.watch(()=>[o.instanceId,o.departmentId,o.extraParams],()=>{s.value=1,m()},{deep:!0}),e.onMounted(()=>{m(),o.showDepartments&&!u.loaded&&u.fetchDepartments()});function p(y){switch(y==null?void 0:y.toLowerCase()){case"marketing":return"Marketing";case"utility":return"Utilidade";case"authentication":return"Autenticação";default:return y??""}}function g(y){switch(y==null?void 0:y.toLowerCase()){case"pending":return"Pendente";case"approved":return"Aprovado";case"rejected":return"Reprovado";case"pending_deletion":return"Aguardando deleção";default:return y??""}}return n({refresh:m}),(y,k)=>{const B=e.resolveComponent("Popper");return e.openBlock(),e.createBlock(Aa,{columns:c.value,rows:r.value,loading:l.value,"total-items":i.value,"items-per-page":t.itemsPerPage,"current-page":s.value,filters:d.value,"empty-text":"Nenhum modelo de mensagem disponível","onUpdate:currentPage":h,"onUpdate:filters":f},e.createSlots({"empty-action":e.withCtx(()=>[e.renderSlot(y.$slots,"empty-action",{},void 0,!0)]),"cell-name":e.withCtx(({row:b})=>[e.createElementVNode("span",{title:b.name,class:"block truncate text-left max-w-64 whitespace-nowrap font-medium text-sm"},e.toDisplayString(b.name),9,tc)]),"cell-category":e.withCtx(({row:b})=>{var x,v,_,R;return[e.createElementVNode("div",ac,[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 font-semibold flex justify-center items-center min-w-19 lg:min-w-32 w-0 p-1.5 rounded-lg transition-colors",{"bg-sky-500/20 border border-sky-500/50 hover:border-sky-400 text-sky-400":((x=b.category)==null?void 0:x.toLowerCase())==="marketing","bg-purple-500/20 border dark:hover-text-purple-700 border-purple-500/50 hover:border-purple-400 text-purple-400":((v=b.category)==null?void 0:v.toLowerCase())==="utility"}])},[e.createElementVNode("div",oc,[((_=b.category)==null?void 0:_.toLowerCase())==="marketing"?(e.openBlock(),e.createElementBlock("svg",rc,[...k[0]||(k[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.458 3.11A1 1 0 0 1 19 4v16a1 1 0 0 1-1.581.814L12 16.944V7.056l5.419-3.87a1 1 0 0 1 1.039-.076ZM22 12c0 1.48-.804 2.773-2 3.465v-6.93c1.196.692 2 1.984 2 3.465ZM10 8H4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6V8Zm0 9H5v3a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-3Z","clip-rule":"evenodd"},null,-1)])])):((R=b.category)==null?void 0:R.toLowerCase())==="utility"?(e.openBlock(),e.createElementBlock("svg",lc,[...k[1]||(k[1]=[e.createElementVNode("path",{d:"M11.209 3.816a1 1 0 0 0-1.966.368l.325 1.74a5.338 5.338 0 0 0-2.8 5.762l.276 1.473.055.296c.258 1.374-.228 2.262-.63 2.998-.285.52-.527.964-.437 1.449.11.586.22 1.173.75 1.074l12.7-2.377c.528-.1.418-.685.308-1.27-.103-.564-.636-1.123-1.195-1.711-.606-.636-1.243-1.306-1.404-2.051-.233-1.085-.275-1.387-.303-1.587-.009-.063-.016-.117-.028-.182a5.338 5.338 0 0 0-5.353-4.39l-.298-1.592Z"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M6.539 4.278a1 1 0 0 1 .07 1.412c-1.115 1.23-1.705 2.605-1.83 4.26a1 1 0 0 1-1.995-.15c.16-2.099.929-3.893 2.342-5.453a1 1 0 0 1 1.413-.069Z","clip-rule":"evenodd"},null,-1),e.createElementVNode("path",{d:"M8.95 19.7c.7.8 1.7 1.3 2.8 1.3 1.6 0 2.9-1.1 3.3-2.5l-6.1 1.2Z"},null,-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",sc,e.toDisplayString(p(b.category)),1)],2)])]}),"cell-status":e.withCtx(({row:b})=>{var x,v,_,R,L,A,M,S;return[e.createElementVNode("div",ic,[e.createElementVNode("div",{class:e.normalizeClass([{"bg-orange-500/20 border border-orange-500 text-orange-300 dark:text-orange-500 hover:text-orange-200 hover:border-orange-200":((x=b.status)==null?void 0:x.toLowerCase())==="pending","bg-green-600/20 border border-green-600 dark:text-green-500 text-green-300 hover:text-green-200 hover:border-green-200":((v=b.status)==null?void 0:v.toLowerCase())==="approved","bg-red-500/20 border border-red-500 text-red-300 dark:text-red-500 hover:text-red-200 hover:border-red-200":((_=b.status)==null?void 0:_.toLowerCase())==="rejected"||((R=b.status)==null?void 0:R.toLowerCase())==="pending_deletion"},"p-1.5 rounded-lg font-semibold text-xs flex items-center justify-center gap-2 min-w-19 lg:min-w-28 w-0 transition-colors"])},[e.createElementVNode("div",cc,[((L=b.status)==null?void 0:L.toLowerCase())==="pending"?(e.openBlock(),e.createElementBlock("svg",dc,[...k[2]||(k[2]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3M3.22302 14C4.13247 18.008 7.71683 21 12 21c4.9706 0 9-4.0294 9-9 0-4.97056-4.0294-9-9-9-3.72916 0-6.92858 2.26806-8.29409 5.5M7 9H3V5"},null,-1)])])):((A=b.status)==null?void 0:A.toLowerCase())==="rejected"?(e.openBlock(),e.createElementBlock("svg",uc,[...k[3]||(k[3]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"m6 6 12 12m3-6a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)])])):((M=b.status)==null?void 0:M.toLowerCase())==="approved"?(e.openBlock(),e.createElementBlock("svg",mc,[...k[4]||(k[4]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.032 12 1.984 1.984 4.96-4.96m4.55 5.272.893-.893a1.984 1.984 0 0 0 0-2.806l-.893-.893a1.984 1.984 0 0 1-.581-1.403V7.04a1.984 1.984 0 0 0-1.984-1.984h-1.262a1.983 1.983 0 0 1-1.403-.581l-.893-.893a1.984 1.984 0 0 0-2.806 0l-.893.893a1.984 1.984 0 0 1-1.403.581H7.04A1.984 1.984 0 0 0 5.055 7.04v1.262c0 .527-.209 1.031-.581 1.403l-.893.893a1.984 1.984 0 0 0 0 2.806l.893.893c.372.372.581.876.581 1.403v1.262a1.984 1.984 0 0 0 1.984 1.984h1.262c.527 0 1.031.209 1.403.581l.893.893a1.984 1.984 0 0 0 2.806 0l.893-.893a1.985 1.985 0 0 1 1.403-.581h1.262a1.984 1.984 0 0 0 1.984-1.984V15.7c0-.527.209-1.031.581-1.403Z"},null,-1)])])):((S=b.status)==null?void 0:S.toLowerCase())==="pending_deletion"?(e.openBlock(),e.createElementBlock("svg",fc,[...k[5]||(k[5]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"},null,-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",pc,e.toDisplayString(g(b.status)),1)],2)])]}),"cell-actions":e.withCtx(({row:b})=>{var x,v;return[e.createElementVNode("main",wc,[e.createVNode(B,{placement:"left",class:"preview-popper"},{content:e.withCtx(()=>[e.createElementVNode("div",Ec,[e.createElementVNode("div",Cc,[e.createElementVNode("p",Bc,e.toDisplayString(b.name),1)]),e.renderSlot(y.$slots,"preview",{template:b},()=>[k[8]||(k[8]=e.createElementVNode("span",{class:"block p-4 text-xs text-gray-400 text-center"}," Sem pré-visualização disponível ",-1))],!0)])]),default:e.withCtx(()=>[k[9]||(k[9]=e.createElementVNode("button",{class:"group action-btn action-btn-info"},[e.createElementVNode("svg",{class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{d:"M10 12a2 2 0 100-4 2 2 0 000 4z"}),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z","clip-rule":"evenodd"})]),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Pré-visualizar")],-1))]),_:2},1024),t.mode==="send"?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:((x=b.status)==null?void 0:x.toLowerCase())!=="approved",class:e.normalizeClass(["action-btn group",((v=b.status)==null?void 0:v.toLowerCase())==="approved"?"action-btn-success":"action-btn-danger"]),onClick:_=>y.$emit("send",b)},[...k[10]||(k[10]=[e.createElementVNode("svg",{class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 14 16"},[e.createElementVNode("path",{d:"M0 .984v14.032a1 1 0 0 0 1.506.845l12.006-7.016a.974.974 0 0 0 0-1.69L1.506.139A1 1 0 0 0 0 .984Z"})],-1),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Enviar modelo",-1)])],10,vc)):e.createCommentVNode("",!0),t.mode==="manage"?(e.openBlock(),e.createElementBlock("button",{key:1,class:"group action-btn action-btn-success",onClick:_=>y.$emit("edit",b)},[...k[11]||(k[11]=[e.createElementVNode("svg",{class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"})],-1),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Editar Template",-1)])],8,Vc)):e.createCommentVNode("",!0),t.mode==="manage"?(e.openBlock(),e.createElementBlock("button",{key:2,class:"group action-btn action-btn-danger",onClick:_=>y.$emit("delete",b)},[...k[12]||(k[12]=[e.createElementVNode("svg",{class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},[e.createElementVNode("path",{d:"M0 0h24v24H0V0z",fill:"none"}),e.createElementVNode("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5l-1-1h-5l-1 1H5v2h14V4z"})],-1),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Excluir",-1)])],8,Sc)):e.createCommentVNode("",!0),t.mode==="manage"?(e.openBlock(),e.createElementBlock("button",{key:3,class:"group action-btn action-btn-info",onClick:_=>y.$emit("copy-id",b)},[...k[13]||(k[13]=[e.createElementVNode("svg",{class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7 9v6a4 4 0 0 0 4 4h4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1v2Z","clip-rule":"evenodd"}),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 3.054V7H9.2a2 2 0 0 1 .281-.432l2.46-2.87A2 2 0 0 1 13 3.054ZM15 3v4a2 2 0 0 1-2 2H9v6a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-3Z","clip-rule":"evenodd"})],-1),e.createElementVNode("span",{class:"pointer-events-none absolute -left-0 top-[-60px] z-30 m-2 mx-auto -translate-x-1/3 rounded-md bg-slate-700 p-2 text-sm text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100"},"Copiar ID",-1)])],8,Nc)):e.createCommentVNode("",!0)]),e.renderSlot(y.$slots,"extra-actions",{template:b},void 0,!0)]}),_:2},[t.showLang?{name:"cell-lang",fn:e.withCtx(({row:b})=>[e.createElementVNode("span",nc,e.toDisplayString(b.lang),1)]),key:"0"}:void 0,t.showDepartments?{name:"cell-department",fn:e.withCtx(({row:b})=>[e.createVNode(B,{placement:"top",arrow:!1,class:"tip-popper"},{content:e.withCtx(()=>{var x;return[e.createElementVNode("section",hc,[k[6]||(k[6]=e.createElementVNode("div",{class:"text-sm font-semibold text-slate-100 pb-2"}," Departamentos ",-1)),((x=b.department)==null?void 0:x.length)>0?(e.openBlock(),e.createElementBlock("div",gc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.department,v=>(e.openBlock(),e.createElementBlock("div",{key:v.id,class:"bg-slate-800/80 rounded-lg p-2 border border-slate-700/50 hover:border-blue-500/30 transition-all"},[e.createElementVNode("span",yc,e.toDisplayString(v.name),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",kc," Sem departamentos vinculados "))])]}),default:e.withCtx(()=>{var x;return[e.createElementVNode("div",bc,[k[7]||(k[7]=e.createElementVNode("svg",{class:"size-5 text-blue-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4 4a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2v14a1 1 0 1 1 0 2H5a1 1 0 1 1 0-2V5a1 1 0 0 1-1-1Zm5 2a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H9Zm5 0a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-1Zm-5 4a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1H9Zm5 0a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1h-1Zm-3 4a2 2 0 0 0-2 2v3h2v-3h2v3h2v-3a2 2 0 0 0-2-2h-2Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("span",xc,e.toDisplayString((x=b.department)==null?void 0:x.length),1)])]}),_:2},1024)]),key:"1"}:void 0]),1032,["columns","rows","loading","total-items","items-per-page","current-page","filters"])}}},[["__scopeId","data-v-96c4b4b8"]]);function Mc(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Tr(t){return typeof t=="function"?t():e.unref(t)}const Lr=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ac=Object.prototype.toString,$c=t=>Ac.call(t)==="[object Object]",Zn=()=>{},_c=Dc();function Dc(){var t,n;return Lr&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Cn(t){var n;const a=Tr(t);return(n=a==null?void 0:a.$el)!=null?n:a}const Fr=Lr?window:void 0;function qa(...t){let n,a,o,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([a,o,r]=t,n=Fr):[n,a,o,r]=t,!n)return Zn;Array.isArray(a)||(a=[a]),Array.isArray(o)||(o=[o]);const l=[],s=()=>{l.forEach(c=>c()),l.length=0},i=(c,m,f,h)=>(c.addEventListener(m,f,h),()=>c.removeEventListener(m,f,h)),d=e.watch(()=>[Cn(n),Tr(r)],([c,m])=>{if(s(),!c)return;const f=$c(m)?{...m}:m;l.push(...a.flatMap(h=>o.map(p=>i(c,h,p,f))))},{immediate:!0,flush:"post"}),u=()=>{d(),s()};return Mc(u),u}let Pr=!1;function Yn(t,n,a={}){const{window:o=Fr,ignore:r=[],capture:l=!0,detectIframe:s=!1}=a;if(!o)return Zn;_c&&!Pr&&(Pr=!0,Array.from(o.document.body.children).forEach(f=>f.addEventListener("click",Zn)),o.document.documentElement.addEventListener("click",Zn));let i=!0;const d=f=>r.some(h=>{if(typeof h=="string")return Array.from(o.document.querySelectorAll(h)).some(p=>p===f.target||f.composedPath().includes(p));{const p=Cn(h);return p&&(f.target===p||f.composedPath().includes(p))}}),c=[qa(o,"click",f=>{const h=Cn(t);if(!(!h||h===f.target||f.composedPath().includes(h))){if(f.detail===0&&(i=!d(f)),!i){i=!0;return}n(f)}},{passive:!0,capture:l}),qa(o,"pointerdown",f=>{const h=Cn(t);i=!d(f)&&!!(h&&!f.composedPath().includes(h))},{passive:!0}),s&&qa(o,"blur",f=>{setTimeout(()=>{var h;const p=Cn(t);((h=o.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(o.document.activeElement))&&n(f)},0)})].filter(Boolean);return()=>c.forEach(f=>f())}const Tc={class:"line-clamp-2 uppercase text-xs truncate text-white"},Lc={key:0,class:"select_widget_lib"},zr=ke({__name:"primary_select",props:{config:{type:Object,default:{title:"select_primary"}}},emits:["closeSelect"],setup(t,{emit:n}){const a=t,o=e.ref(!1),r=e.ref(null);e.computed(()=>a.selectConfig.some(i=>i.freeSlot));const l=()=>{o.value=!o.value};return Yn(r,()=>{o.value&&(o.value=!1)}),(i,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"target",ref:r,class:"relative w-full"},[e.createElementVNode("button",{onClick:l,class:"bg-base-100 z-10 truncate flex items-center justify-between gap-6 p-2 rounded-md lg:mt-0 w-full shadow-md shadow-base-300"},[e.createElementVNode("div",null,[e.createElementVNode("p",Tc,e.toDisplayString(t.config.title),1)]),e.createElementVNode("div",null,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([o.value?"rotate-180 transition-transform ease-in-out":"","w-3 h-3 text-white"]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...d[0]||(d[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.4 10.3A2 2 0 0 0 17 7H7a2 2 0 0 0-1.5 3.3l4.9 5.9a2 2 0 0 0 3 0l5-6Z","clip-rule":"evenodd"},null,-1)])],2))])]),o.value?(e.openBlock(),e.createElementBlock("section",Lc,[e.createElementVNode("div",null,[e.renderSlot(i.$slots,"free-slot",{},void 0,!0)])])):e.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-265f04f1"]]),Fc={key:0,class:"modal_head"},Pc={class:"modal_responsive"},zc={class:"flex min-h-full items-center justify-center text-center sm:p-0"},Oc={class:"modal_tittle text-current bg-base-300 border-base-100"},Rc={class:"flex items-center w-full"},Hc=["innerHTML"],jc={class:"text-xl ml-1 font-semibold flex items-center gap-2"},Gc={class:"bg-base-200"},Ic={class:"text-center"},qc={class:"modal_end_button border-base-100 bg-base-300"},Or=ke({__name:"simple_modal",props:{isOpen:{type:Boolean,default:!1},header:{type:Object,default:{title:"title",svg:"<svg class='w-5 mr-2 text-teal-500 inline-block' aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'> <path d='M18 3h-5.7a2 2 0 0 0-1.4.6L3.6 11a2 2 0 0 0 0 2.8l6.6 6.6a2 2 0 0 0 2.8 0l7.4-7.5a2 2 0 0 0 .6-1.4V6a3 3 0 0 0-3-3Zm-2.4 6.4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z' /> </svg>"}},size:{type:String,default:"md:w-1/2 xl:w-1/3"}},emits:["update:isOpen","close"],setup(t,{emit:n}){e.useSlots();const a=t,o=n,r=()=>{o("update:isOpen",!a.isOpen),a.isOpen&&o("close")};return(l,s)=>(e.openBlock(),e.createBlock(e.Transition,{"leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0","enter-active-class":"transition-opacity duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100"},{default:e.withCtx(()=>{var i,d;return[t.isOpen?(e.openBlock(),e.createElementBlock("div",Fc,[s[2]||(s[2]=e.createElementVNode("div",{class:"modal-overlay absolute h-full w-full bg-gray-600 opacity-50"},null,-1)),e.createElementVNode("div",Pc,[e.createElementVNode("div",zc,[e.createElementVNode("div",{class:e.normalizeClass([t.size,"z-50 w-full shadow rounded-2xl shadow-black"])},[e.createElementVNode("div",Oc,[e.createElementVNode("section",Rc,[l.$slots.header?e.renderSlot(l.$slots,"header",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{innerHTML:(i=t.header)==null?void 0:i.svg},null,8,Hc),e.createElementVNode("h3",jc,e.toDisplayString((d=t.header)==null?void 0:d.title),1)],64))]),e.createElementVNode("button",{onClick:s[0]||(s[0]=u=>r()),class:"modal_close_button bg-base-200/40"},[...s[1]||(s[1]=[e.createElementVNode("svg",{class:"size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])])]),e.createElementVNode("div",Gc,[e.createElementVNode("div",Ic,[e.renderSlot(l.$slots,"body",{},void 0,!0)])]),e.createElementVNode("div",qc,[e.renderSlot(l.$slots,"footer",{},void 0,!0)])],2)])])])):e.createCommentVNode("",!0)]}),_:3}))}},[["__scopeId","data-v-7d2f29fd"]]),Wc={class:"simple_card_header"},Uc={key:0,class:"simple_card_icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},Zc={key:1,class:"simple_card_icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},Yc={key:2,class:"simple_card_icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},Xc={key:3,class:"simple_card_icon","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 23 23"},Qc={class:"simple_card_title"},Kc={class:"simple_card_descripiton"},Rr={__name:"simple_card",props:{content:{type:Object,default:{title:"Title",description:"Coloque aqui a descrição"}},typeCard:{type:String,default:"default"}},setup(t){const n=t,a=e.computed(()=>({simple_card_success:n.typeCard==="success",simple_card_info:n.typeCard==="info",simple_card_alert:n.typeCard==="alert",simple_card_error:n.typeCard==="error"}));return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.value,"simple_card"])},[e.createElementVNode("div",Wc,[t.typeCard==="success"?(e.openBlock(),e.createElementBlock("svg",Uc,[...r[0]||(r[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.25 10C0.25 4.61522 4.61522 0.25 10 0.25C15.3848 0.25 19.75 4.61522 19.75 10C19.75 15.3848 15.3848 19.75 10 19.75C4.61522 19.75 0.25 15.3848 0.25 10ZM13.6103 8.18593C13.8511 7.84887 13.773 7.38046 13.4359 7.1397C13.0989 6.89894 12.6305 6.97701 12.3897 7.31407L9.1543 11.8436L7.53033 10.2197C7.23744 9.92678 6.76256 9.92678 6.46967 10.2197C6.17678 10.5126 6.17678 10.9874 6.46967 11.2803L8.71967 13.5303C8.87556 13.6862 9.09215 13.7656 9.31186 13.7474C9.53157 13.7293 9.73216 13.6153 9.8603 13.4359L13.6103 8.18593Z",fill:"currentColor"},null,-1)])])):e.createCommentVNode("",!0),t.typeCard==="info"?(e.openBlock(),e.createElementBlock("svg",Zc,[...r[1]||(r[1]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.25 10C0.25 4.61522 4.61522 0.25 10 0.25C15.3848 0.25 19.75 4.61522 19.75 10C19.75 15.3848 15.3848 19.75 10 19.75C4.61522 19.75 0.25 15.3848 0.25 10ZM10 6.25C10.4142 6.25 10.75 6.58579 10.75 7V10.75C10.75 11.1642 10.4142 11.5 10 11.5C9.58579 11.5 9.25 11.1642 9.25 10.75V7C9.25 6.58579 9.58579 6.25 10 6.25ZM10 14.5C10.4142 14.5 10.75 14.1642 10.75 13.75C10.75 13.3358 10.4142 13 10 13C9.58579 13 9.25 13.3358 9.25 13.75C9.25 14.1642 9.58579 14.5 10 14.5Z",fill:"currentColor"},null,-1)])])):e.createCommentVNode("",!0),t.typeCard==="alert"?(e.openBlock(),e.createElementBlock("svg",Yc,[...r[2]||(r[2]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.40123 2.0034C9.55572 0.0022862 12.4439 0.0022856 13.5983 2.0034L20.9527 14.7509C22.1065 16.7509 20.6631 19.2501 18.3541 19.2501H3.64546C1.33649 19.2501 -0.106939 16.7509 1.04691 14.7509L8.40123 2.0034ZM11 7.25C11.4142 7.25 11.75 7.58579 11.75 8V11.75C11.75 12.1642 11.4142 12.5 11 12.5C10.5858 12.5 10.25 12.1642 10.25 11.75V8C10.25 7.58579 10.5858 7.25 11 7.25ZM11 15.5C11.4142 15.5 11.75 15.1642 11.75 14.75C11.75 14.3358 11.4142 14 11 14C10.5858 14 10.25 14.3358 10.25 14.75C10.25 15.1642 10.5858 15.5 11 15.5Z",fill:"currentColor"},null,-1)])])):e.createCommentVNode("",!0),t.typeCard==="error"?(e.openBlock(),e.createElementBlock("svg",Xc,[...r[3]||(r[3]=[e.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 12Zm7.707-3.707a1 1 0 0 0-1.414 1.414L10.586 12l-2.293 2.293a1 1 0 1 0 1.414 1.414L12 13.414l2.293 2.293a1 1 0 0 0 1.414-1.414L13.414 12l2.293-2.293a1 1 0 0 0-1.414-1.414L12 10.586 9.707 8.293Z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",Qc,e.toDisplayString(t.content.title),1)]),e.createElementVNode("section",Kc,[e.createElementVNode("p",null,e.toDisplayString(t.content.description),1)])],2))}},Xn=jt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(t=""){try{let n=`${U0}`;const a=await Pe.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(t){this.instances=this.instances.filter(n=>n.id!==t),this.count=this.instances.length},addInstance(t){const n=this.instances.findIndex(a=>a.id===t.id);n!==-1?this.instances[n]=t:this.instances.push(t),this.count=this.instances.length}}}),Jc={class:"w-full relative text-current"},e2={class:"flex cursor-pointer justify-between items-center"},t2={key:0},n2={key:0},a2={key:1,class:"flex items-center gap-2"},o2={class:"flex gap-3 items-center flex-shrink-0"},r2={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},l2={key:1,xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5",viewBox:"0 0 16 16"},s2={key:2,class:"relative"},i2={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"},c2={class:"my-auto text-center mx-auto group-hover:inline-block"},d2={key:1,class:"flex justify-center"},u2={class:"w-full"},m2={key:1,class:"flex items-center gap-2 justify-center"},f2={class:"flex px-4 items-center gap-2"},p2={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},h2={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"},g2={class:"select-none cursor-pointer w-full"},y2=["onClick","disabled"],k2={class:"flex w-full items-center pl-2 gap-3"},b2={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"},x2={key:1,xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4 flex-shrink-0",viewBox:"0 0 16 16"},w2={key:2,class:"relative"},E2={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},C2={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"},B2={class:"w-full text-center"},v2={class:"my-auto text-center mx-auto group-hover:inline-block"},V2={key:1,class:"flex justify-center"},S2={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},N2={key:1,class:"p-4"},Hr=ke({__name:"index",props:{modelValue:{type:Object,default:null},type:{type:String},webhooks:{type:Boolean,default:void 0},instance_deny_list:{type:Array,default:()=>[]}},emits:["update:modelValue","function","component-mounted"],setup(t,{emit:n}){const a=Xn(),o=e.ref(!1),r=e.ref(null),l=t,s=n;function i(u){r.value=u,s("function",u)}e.watch(()=>l.modelValue,u=>{r.value=u},{immediate:!0}),e.watch(r,u=>{s("update:modelValue",u)}),e.onMounted(async()=>{if(r.value){const u=a.instances.find(c=>c.id===r.value.id);u&&(r.value.status=u.status)}s("component-mounted")});const d=e.computed(()=>a.instances.filter(u=>!l.instance_deny_list.includes(u.id)));return(u,c)=>{const m=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("main",Jc,[e.createElementVNode("div",{class:e.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"])},[e.createElementVNode("div",e2,[e.createElementVNode("p",{onClick:c[0]||(c[0]=f=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[e.unref(a).loaded?(e.openBlock(),e.createElementBlock("div",t2,[r.value?(e.openBlock(),e.createElementBlock("span",a2,[e.createElementVNode("header",o2,[r.value.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",r2,[...c[3]||(c[3]=[e.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==="instagram"?(e.openBlock(),e.createElementBlock("svg",l2,[...c[4]||(c[4]=[e.createStaticVNode('<defs data-v-ad0e7c90><linearGradient id="instagram-gradient" x1="0%" y1="100%" x2="100%" y2="0%" data-v-ad0e7c90><stop offset="0%" style="stop-color:#FD5949;stop-opacity:1;" data-v-ad0e7c90></stop><stop offset="50%" style="stop-color:#D6249F;stop-opacity:1;" data-v-ad0e7c90></stop><stop offset="100%" style="stop-color:#285AEB;stop-opacity:1;" data-v-ad0e7c90></stop></linearGradient></defs><path fill="url(#instagram-gradient)" d="M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.917 3.917 0 0 0-1.417.923A3.927 3.927 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.916 3.916 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.926 3.926 0 0 0-.923-1.417A3.911 3.911 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0h.003zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599.28.28.453.546.598.92.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.47 2.47 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.478 2.478 0 0 1-.92-.598 2.48 2.48 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233 0-2.136.008-2.388.046-3.231.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045v.002zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92zm-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217zm0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334z" data-v-ad0e7c90></path>',2)])])):r.value.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",s2,[c[6]||(c[6]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},[e.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)),(e.openBlock(),e.createElementBlock("svg",i2,[...c[5]||(c[5]=[e.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)])]))])):e.createCommentVNode("",!0),r.value&&r.value.status!==void 0?(e.openBlock(),e.createBlock(m,{key:3,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("main",{class:e.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"}])},[e.createElementVNode("div",c2,e.toDisplayString(r.value.status===!0?"Conectada":r.value.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[r.value.isLoading?(e.openBlock(),e.createElementBlock("div",d2,[...c[7]||(c[7]=[e.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.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})):e.createCommentVNode("",!0)]),e.createElementVNode("div",u2,e.toDisplayString(r.value.name),1)])):(e.openBlock(),e.createElementBlock("span",n2,e.toDisplayString(d.value?d.value.length:"Sem")+" Instâncias disponíveis",1))])):(e.openBlock(),e.createElementBlock("div",m2,[...c[8]||(c[8]=[e.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"},[e.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"}),e.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),e.createTextVNode("Inicializando instâncias...",-1)])]))]),e.createElementVNode("footer",f2,[e.createElementVNode("button",{onClick:c[1]||(c[1]=f=>(r.value=null,o.value=!1))},[...c[9]||(c[9]=[e.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"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])]),e.createElementVNode("button",{onClick:c[2]||(c[2]=f=>o.value=!o.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.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"},[...c[10]||(c[10]=[e.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?(e.openBlock(),e.createElementBlock("nav",p2,[e.createElementVNode("ul",h2,[d.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(d.value,(f,h)=>{var p;return e.openBlock(),e.createElementBlock("li",g2,[e.createElementVNode("button",{class:e.normalizeClass([r.value&&r.value.id===f.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:g=>(r.value=f,o.value=!1,i(f)),disabled:r.value&&r.value.id===f.id||t.type&&f.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((p=f.config)==null?void 0:p.webhooks)},[e.createElementVNode("div",k2,[f.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",b2,[...c[11]||(c[11]=[e.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)])])):f.type==="instagram"?(e.openBlock(),e.createElementBlock("svg",x2,[...c[12]||(c[12]=[e.createStaticVNode('<defs data-v-ad0e7c90><linearGradient id="instagram-gradient" x1="0%" y1="100%" x2="100%" y2="0%" data-v-ad0e7c90><stop offset="0%" style="stop-color:#FD5949;stop-opacity:1;" data-v-ad0e7c90></stop><stop offset="50%" style="stop-color:#D6249F;stop-opacity:1;" data-v-ad0e7c90></stop><stop offset="100%" style="stop-color:#285AEB;stop-opacity:1;" data-v-ad0e7c90></stop></linearGradient></defs><path fill="url(#instagram-gradient)" d="M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.917 3.917 0 0 0-1.417.923A3.927 3.927 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.916 3.916 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.926 3.926 0 0 0-.923-1.417A3.911 3.911 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0h.003zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599.28.28.453.546.598.92.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.47 2.47 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.478 2.478 0 0 1-.92-.598 2.48 2.48 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233 0-2.136.008-2.388.046-3.231.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045v.002zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92zm-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217zm0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334z" data-v-ad0e7c90></path>',2)])])):f.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",w2,[c[14]||(c[14]=e.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"},[e.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)),(e.openBlock(),e.createElementBlock("svg",E2,[...c[13]||(c[13]=[e.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)])]))])):e.createCommentVNode("",!0),e.createVNode(m,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.type&&f.type!==t.type?"Não é possível utilizar esse tipo de Instância neste recurso":t.webhooks===!0?"Essa instância está com o Atendimento desabilitado":"Essa aplicação é somente para instâncias sem atendimento habilitado."),1)]),default:e.withCtx(()=>{var g;return[t.type&&f.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((g=f.config)==null?void 0:g.webhooks)?(e.openBlock(),e.createElementBlock("svg",C2,[...c[15]||(c[15]=[e.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)])])):e.createCommentVNode("",!0)]}),_:2},1024),e.createElementVNode("p",B2,e.toDisplayString(f.name),1),e.createVNode(m,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("main",{class:e.normalizeClass(["p-1 rounded px-3",{"bg-red-500":f.status===!1,"bg-green-500":f.status===!0,"bg-purple-500":f.status==="Offline"}])},[e.createElementVNode("div",v2,e.toDisplayString(f.status===!0?"Conectada":f.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[f.isLoading?(e.openBlock(),e.createElementBlock("div",V2,[...c[16]||(c[16]=[e.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{"bg-red-500":f.status===!1,"bg-green-500":f.status===!0,"bg-purple-500":f.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)]),e.createElementVNode("div",S2,[f.telephone?(e.openBlock(),e.createBlock(m,{key:0,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(f.telephone?`${f.telephone}`:""),1)]),default:e.withCtx(()=>[c[17]||(c[17]=e.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"},[e.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},1024)):e.createCommentVNode("",!0)])],10,y2)])}),256)):(e.openBlock(),e.createElementBlock("div",N2," Sem instâncias disponíveis"))])])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-ad0e7c90"]]),M2={class:"truncate text-primary"},A2={class:"flex items-center gap-2"},$2=["title"],_2=["innerHTML"],D2={key:0,class:"select-popover bg-base-300 w-full min-w-full left-0",style:{position:"absolute"}},T2={class:"select-list"},L2=["onClick"],F2={type:"button",class:"item-click"},P2={class:"item-label"},z2=["onClick","title"],O2=["innerHTML"],R2={key:0,class:"empty"},jr=ke({__name:"soundSelect",props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},labelFn:{type:Function,required:!0},previewKeyPrefix:{type:String,required:!0},tone:{type:String,default:"sky"},playingKey:{type:String,default:null}},emits:["update:modelValue","preview"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(null),s=e.computed(()=>a.modelValue?a.labelFn(a.modelValue):"Selecionar…"),i={sky:{"--tone-color":"#38bdf8","--tone-ring":"rgba(56, 189, 248, 0.35)","--tone-grad1":"rgba(56, 189, 248, 0.14)","--tone-grad2":"rgba(59, 130, 246, 0.08)"},emerald:{"--tone-color":"#34d399","--tone-ring":"rgba(52, 211, 153, 0.35)","--tone-grad1":"rgba(16, 185, 129, 0.14)","--tone-grad2":"rgba(5, 150, 105, 0.08)"},violet:{"--tone-color":"#a78bfa","--tone-ring":"rgba(167, 139, 250, 0.35)","--tone-grad1":"rgba(139, 92, 246, 0.14)","--tone-grad2":"rgba(124, 58, 237, 0.08)"},amber:{"--tone-color":"#fbbf24","--tone-ring":"rgba(251, 191, 36, 0.35)","--tone-grad1":"rgba(245, 158, 11, 0.14)","--tone-grad2":"rgba(217, 119, 6, 0.08)"},rose:{"--tone-color":"#fb7185","--tone-ring":"rgba(251, 113, 133, 0.35)","--tone-grad1":"rgba(244, 63, 94, 0.14)","--tone-grad2":"rgba(225, 29, 72, 0.08)"}},d=e.computed(()=>i[a.tone]||i.sky);function u(){r.value=!r.value}function c(y){o("update:modelValue",y),r.value=!1}function m(y){o("preview",y,`${a.previewKeyPrefix}${y}`)}const f=y=>a.playingKey===`${a.previewKeyPrefix}${y}`,h=e.computed(()=>a.modelValue?f(a.modelValue):!1);function p(y){y.stopPropagation(),a.modelValue&&m(a.modelValue)}function g(y){l.value&&!l.value.contains(y.target)&&(r.value=!1)}return e.onMounted(()=>document.addEventListener("click",g)),e.onBeforeUnmount(()=>document.removeEventListener("click",g)),(y,k)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"root",ref:l,class:"relative soundselect",style:e.normalizeStyle(d.value)},[e.createElementVNode("button",{type:"button",class:"select-head",onClick:u},[e.createElementVNode("span",M2,e.toDisplayString(s.value),1),e.createElementVNode("div",A2,[t.modelValue?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["head-playbtn text-primary",{playing:h.value}]),title:h.value?"Pausar":"Ouvir",onClick:e.withModifiers(p,["stop"])},[e.createElementVNode("span",{innerHTML:h.value?'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="currentColor"><path d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>'},null,8,_2)],10,$2)):e.createCommentVNode("",!0),k[0]||(k[0]=e.createElementVNode("span",{class:"chev"},[e.createElementVNode("svg",{class:"size-5 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 10 4 4 4-4"})])],-1))])]),e.createVNode(e.Transition,{name:"fade-scale"},{default:e.withCtx(()=>{var B;return[r.value?(e.openBlock(),e.createElementBlock("div",D2,[e.createElementVNode("div",T2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,b=>(e.openBlock(),e.createElementBlock("div",{key:b,class:e.normalizeClass(["select-item text-start cursor-pointer",{"is-selected":t.modelValue===b}]),onClick:x=>c(b)},[e.createElementVNode("button",F2,[e.createElementVNode("span",{class:e.normalizeClass(["radio-dot",t.modelValue===b?"on":""])},null,2),e.createElementVNode("span",P2,e.toDisplayString(t.labelFn(b)),1)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["playbtn",{playing:f(b)}]),onClick:e.withModifiers(x=>m(b),["stop"]),title:f(b)?"Pausar":"Ouvir"},[e.createElementVNode("span",{innerHTML:f(b)?'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="currentColor"><path d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>'},null,8,O2)],10,z2)],10,L2))),128)),(B=t.options)!=null&&B.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",R2,"Sem opções"))])])):e.createCommentVNode("",!0)]}),_:1})],4))}},[["__scopeId","data-v-2bf658f7"]]),H2=["aria-labelledby","aria-describedby"],j2={class:"cpk-popover__header border-base-100"},G2=["id"],I2=["disabled"],q2=["id"],W2={class:"cpk-popover__details bg-base-200 border border-base-100"},U2={class:"cpk-popover__footer"},Z2=["disabled"],Y2=["disabled"],X2={key:0,class:"loading-spinner"},Q2=ke({__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(t,{emit:n}){const a=t,o=n,r=e.computed({get:()=>a.modelValue,set:x=>o("update:modelValue",x)}),l=e.ref(null),s=e.ref({left:0,top:0,p:"bottom"}),i={title:`cpk-popover-title-${Math.random().toString(36).slice(2)}`,desc:`cpk-popover-desc-${Math.random().toString(36).slice(2)}`};function d(){o("cancel",a.context),r.value=!1}function u(){a.loading||o("confirm",a.context)}let c,m,f=[];function h(){if(a.anchorRect)return a.anchorRect;const x=a.anchorEl instanceof Element?a.anchorEl:null;if(x)return x.getBoundingClientRect();const v=document.activeElement instanceof Element?document.activeElement:null;return v?v.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 p(){if(!r.value)return;const x=window.innerWidth,v=window.innerHeight,_=a.viewportPadding,R=h(),L=l.value?l.value.getBoundingClientRect():{width:320,height:200},A=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let M=A[0],S=0,N=0;const w=R.left+R.width/2-L.width/2,C=R.top+R.height/2-L.height/2,O=R.left,T=R.left+R.width-L.width,V=R.top,E=R.top+R.height-L.height;for(const $ of A){if($==="bottom"&&(N=R.bottom+a.offset,S=a.align==="start"?O:a.align==="end"?T:w,N+L.height+_<=v)){M="bottom";break}if($==="top"&&(N=R.top-L.height-a.offset,S=a.align==="start"?O:a.align==="end"?T:w,N>=_)){M="top";break}if($==="right"&&(S=R.right+a.offset,N=a.align==="start"?V:a.align==="end"?E:C,S+L.width+_<=x)){M="right";break}if($==="left"&&(S=R.left-L.width-a.offset,N=a.align==="start"?V:a.align==="end"?E:C,S>=_)){M="left";break}}S=Math.min(Math.max(_,S),x-L.width-_),N=Math.min(Math.max(_,N),v-L.height-_),s.value={left:S,top:N,p:M}}function g(){y();let v=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;v&&v!==document.body;)f.push(v),v=v.parentElement;f.push(window),f.forEach(_=>_.addEventListener("scroll",p,{passive:!0}))}function y(){f.forEach(x=>{var v;return(v=x.removeEventListener)==null?void 0:v.call(x,"scroll",p)}),f=[]}e.watch(()=>r.value,async x=>{var v;if(x){await e.nextTick(),p(),g(),c=new ResizeObserver(p),c.observe(document.body);const _=a.anchorEl instanceof Element?a.anchorEl:null;_&&((v=m==null?void 0:m.disconnect)==null||v.call(m),m=new ResizeObserver(p),m.observe(_)),window.addEventListener("resize",p),window.addEventListener("keydown",k)}else B()}),e.watch(()=>a.anchorEl,async x=>{var _;if(!r.value)return;await e.nextTick(),y(),g(),(_=m==null?void 0:m.disconnect)==null||_.call(m);const v=x instanceof Element?x:null;v&&(m=new ResizeObserver(p),m.observe(v)),p()}),e.watch(()=>a.anchorRect,()=>{r.value&&p()}),e.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&p()});function k(x){x.key==="Escape"&&d(),x.key==="Enter"&&u()}e.onMounted(()=>{window.addEventListener("mousemove",x=>{window.__lastMouseX=x.clientX,window.__lastMouseY=x.clientY},{passive:!0})}),e.onBeforeUnmount(B);function B(){y(),window.removeEventListener("resize",p),window.removeEventListener("keydown",k),c&&c.disconnect(),m&&m.disconnect()}const b=e.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(x,v)=>(e.openBlock(),e.createBlock(e.Transition,{name:"cpk-layer",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:e.withModifiers(d,["self"])},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:l,class:e.normalizeClass(["cpk-popover bg-base-300",[{"is-loading":t.loading,"is-danger":t.destructive}]]),style:e.normalizeStyle(b.value),role:"dialog","aria-modal":"false","aria-labelledby":i.title,"aria-describedby":i.desc},[e.createElementVNode("div",j2,[v[0]||(v[0]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"!",-1)),e.createElementVNode("h3",{class:"cpk-popover__title",id:i.title},e.toDisplayString(t.title),9,G2),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:d,disabled:t.loading,"aria-label":"Fechar"}," × ",8,I2)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:i.desc},e.toDisplayString(t.description),9,q2)):e.createCommentVNode("",!0),e.createElementVNode("div",W2,[e.renderSlot(x.$slots,"details",{},void 0,!0)]),e.createElementVNode("div",U2,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:d,disabled:t.loading},e.toDisplayString(t.cancelLabel),9,Z2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button","cyber-button--md",t.destructive?"cyber-button--danger":"cyber-button--accent"]),onClick:u,disabled:t.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",X2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.loading?t.loadingLabel:t.confirmLabel),1)],10,Y2)])],14,H2)]),_:3})],32)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-b23001fc"]]);function K2(t){return{all:t=t||new Map,on:function(n,a){var o=t.get(n);o?o.push(a):t.set(n,[a])},off:function(n,a){var o=t.get(n);o&&(a?o.splice(o.indexOf(a)>>>0,1):t.set(n,[]))},emit:function(n,a){var o=t.get(n);o&&o.slice().map(function(r){r(a)}),(o=t.get("*"))&&o.slice().map(function(r){r(n,a)})}}}const Gr=K2();let Ir=0;const J2=()=>{const t=Ir;return Ir+=1,t},At=(t,n)=>{const a={...t,id:J2(),group:t.group||""};return Gr.emit("notify",{notification:a,timeout:n}),()=>Gr.emit("close",a.id)};function cn(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}function xt(t){return(n,a)=>{const o=a!=null&&a.context?String(a.context):"standalone";let r;if(o==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,i=a!=null&&a.width?String(a.width):s;r=t.formattingValues[i]||t.formattingValues[s]}else{const s=t.defaultWidth,i=a!=null&&a.width?String(a.width):t.defaultWidth;r=t.values[i]||t.values[s]}const l=t.argumentCallback?t.argumentCallback(n):n;return r[l]}}function wt(t){return(n,a={})=>{const o=a.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],l=n.match(r);if(!l)return null;const s=l[0],i=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(i)?td(i,m=>m.test(s)):ed(i,m=>m.test(s));let u;u=t.valueCallback?t.valueCallback(d):d,u=a.valueCallback?a.valueCallback(u):u;const c=n.slice(s.length);return{value:u,rest:c}}}function ed(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function td(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function qr(t){return(n,a={})=>{const o=n.match(t.matchPattern);if(!o)return null;const r=o[0],l=n.match(t.parsePattern);if(!l)return null;let s=t.valueCallback?t.valueCallback(l[0]):l[0];s=a.valueCallback?a.valueCallback(s):s;const i=n.slice(r.length);return{value:s,rest:i}}}const Wr=6048e5,nd=864e5,Ur=Symbol.for("constructDateFrom");function ut(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Ur in t?t[Ur](n):t instanceof Date?new t.constructor(n):new Date(n)}function Wa(t,...n){const a=ut.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let ad={};function Qn(){return ad}function ft(t,n){return ut(n||t,t)}function Zt(t,n){var i,d,u,c;const a=Qn(),o=(n==null?void 0:n.weekStartsOn)??((d=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:d.weekStartsOn)??a.weekStartsOn??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,r=ft(t,n==null?void 0:n.in),l=r.getDay(),s=(l<o?7:0)+l-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function od(t,n,a){const[o,r]=Wa(a==null?void 0:a.in,t,n);return+Zt(o,a)==+Zt(r,a)}const rd={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"}},ld=(t,n,a)=>{let o;const r=rd[t];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},sd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},id=(t,n,a,o)=>sd[t],cd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},dd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ud={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"]},md={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"]},fd={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"}},pd={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"}},hd={ordinalNumber:(t,n)=>{const a=Number(t),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:xt({values:cd,defaultWidth:"wide"}),quarter:xt({values:dd,defaultWidth:"wide",argumentCallback:t=>t-1}),month:xt({values:ud,defaultWidth:"wide"}),day:xt({values:md,defaultWidth:"wide"}),dayPeriod:xt({values:fd,defaultWidth:"wide",formattingValues:pd,defaultFormattingWidth:"wide"})},gd=/^(\d+)(th|st|nd|rd)?/i,yd=/\d+/i,kd={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},bd={any:[/^b/i,/^(a|c)/i]},xd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wd={any:[/1/i,/2/i,/3/i,/4/i]},Ed={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},Cd={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]},Bd={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},vd={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]},Vd={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},Sd={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}},Nd={ordinalNumber:qr({matchPattern:gd,parsePattern:yd,valueCallback:t=>parseInt(t,10)}),era:wt({matchPatterns:kd,defaultMatchWidth:"wide",parsePatterns:bd,defaultParseWidth:"any"}),quarter:wt({matchPatterns:xd,defaultMatchWidth:"wide",parsePatterns:wd,defaultParseWidth:"any",valueCallback:t=>t+1}),month:wt({matchPatterns:Ed,defaultMatchWidth:"wide",parsePatterns:Cd,defaultParseWidth:"any"}),day:wt({matchPatterns:Bd,defaultMatchWidth:"wide",parsePatterns:vd,defaultParseWidth:"any"}),dayPeriod:wt({matchPatterns:Vd,defaultMatchWidth:"any",parsePatterns:Sd,defaultParseWidth:"any"})},Md={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ad={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$d={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_d={date:cn({formats:Md,defaultWidth:"full"}),time:cn({formats:Ad,defaultWidth:"full"}),dateTime:cn({formats:$d,defaultWidth:"full"})},Dd={code:"en-US",formatDistance:ld,formatLong:_d,formatRelative:id,localize:hd,match:Nd,options:{weekStartsOn:0,firstWeekContainsDate:1}},Td={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"}},Ld=(t,n,a)=>{let o;const r=Td[t];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},Fd={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Pd={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},zd={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Od={date:cn({formats:Fd,defaultWidth:"full"}),time:cn({formats:Pd,defaultWidth:"full"}),dateTime:cn({formats:zd,defaultWidth:"full"})},Rd={lastWeek:t=>{const n=t.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"},Hd=(t,n,a,o)=>{const r=Rd[t];return typeof r=="function"?r(n):r},jd={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},Gd={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Id={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"]},qd={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"]},Wd={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"}},Ud={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"}},Zd={ordinalNumber:(t,n)=>{const a=Number(t);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:xt({values:jd,defaultWidth:"wide"}),quarter:xt({values:Gd,defaultWidth:"wide",argumentCallback:t=>t-1}),month:xt({values:Id,defaultWidth:"wide"}),day:xt({values:qd,defaultWidth:"wide"}),dayPeriod:xt({values:Wd,defaultWidth:"wide",formattingValues:Ud,defaultFormattingWidth:"wide"})},Yd=/^(\d+)[ºªo]?/i,Xd=/\d+/i,Qd={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},Kd={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},Jd={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},e3={any:[/1/i,/2/i,/3/i,/4/i]},t3={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},n3={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]},a3={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},o3={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]},r3={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},l3={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}},s3={ordinalNumber:qr({matchPattern:Yd,parsePattern:Xd,valueCallback:t=>parseInt(t,10)}),era:wt({matchPatterns:Qd,defaultMatchWidth:"wide",parsePatterns:Kd,defaultParseWidth:"any"}),quarter:wt({matchPatterns:Jd,defaultMatchWidth:"wide",parsePatterns:e3,defaultParseWidth:"any",valueCallback:t=>t+1}),month:wt({matchPatterns:t3,defaultMatchWidth:"wide",parsePatterns:n3,defaultParseWidth:"any"}),day:wt({matchPatterns:a3,defaultMatchWidth:"wide",parsePatterns:o3,defaultParseWidth:"any"}),dayPeriod:wt({matchPatterns:r3,defaultMatchWidth:"any",parsePatterns:l3,defaultParseWidth:"any"})},Zr={code:"pt-BR",formatDistance:Ld,formatLong:Od,formatRelative:Hd,localize:Zd,match:s3,options:{weekStartsOn:0,firstWeekContainsDate:1}},i3={scheduled_messages:"Mensagem programada",attendant_reminder:"Lembretes"};function Kn(t){return i3[t]||t||"Evento"}function Ua(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function dn(t){const n=t instanceof Date?t:new Date(t),a=n.getFullYear(),o=(n.getMonth()+1).toString().padStart(2,"0");return`${a}-${o}`}function Bn(t){const[n,a]=String(t||"").trim().split(" ");if(!n)return null;const[o,r,l]=n.split("-").map(u=>parseInt(u,10));let s=0,i=0;if(a){const[u,c]=a.split(":");s=parseInt(u||"0",10),i=parseInt(c||"0",10)}const d=new Date(o,(r||1)-1,l||1,s,i);return isNaN(d.getTime())?null:d}function c3(t){if(!t)return null;try{const n=String(t).replace(/(\.\d{3})\d+$/,"$1"),a=new Date(n);return isNaN(a.getTime())?null:a}catch{return null}}function Jn(t){if(!t)return"";const n=t instanceof Date?t:new Date(t);if(isNaN(n.getTime()))return"";const a=String(n.getHours()).padStart(2,"0"),o=String(n.getMinutes()).padStart(2,"0");return`${a}:${o}`}function d3(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function Za(t){if(!t)return null;const n=(t==null?void 0:t.params)||{},a=(n==null?void 0:n.schedule)||{},o=(t==null?void 0:t.info)||{},r=(o==null?void 0:o.entity)||{},l=(o==null?void 0:o.department)||{},s=(o==null?void 0:o.instance)||{};let i=null;if(a!=null&&a.time&&(i=Bn(a.time)),!i&&(t!=null&&t.next_execution_at)&&(i=c3(t.next_execution_at)),!i)return null;const d=Array.isArray(n==null?void 0:n.message)?n.message[0]:null,u=d&&(d.content||d.text)||"",c=(t==null?void 0:t.function)||(n==null?void 0:n.function)||"",m=Kn(c),f=(u||"").trim();return{id:(t==null?void 0:t.id)||d3(),date:i,time:Jn(i),type:t.function,status:t.status||null,scheduled_by:n.scheduled_by,title:m,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:(l==null?void 0:l.name)||"",departmentId:(l==null?void 0:l.id)||null,instanceName:(s==null?void 0:s.name)||"",raw:t}}function Yr(t=[]){const n=Array.isArray(t)?t:Array.isArray(t.results)?t.results:[],a=[];for(const o of n){const r=Za(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function u3(t="/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(t).replace(/\/$/,"")}/${o}/`,l=await Pe.delete(r);return{ok:(l==null?void 0:l.status)>=200&&l.status<300,status:(l==null?void 0:l.status)??0}}catch(o){return console.error("Error erasing scheduled event:",o),{ok:!1,status:0}}}const $t=new Map,Ya=jt.defineStore("scheduled",{state:()=>({baseUrl:Y0,monthCache:{},loadingYM:new Set,errorByYM:{},loadedYM:new Set,filters:{}}),getters:{eventsOf:t=>n=>t.monthCache[n]||[],isLoading:t=>n=>t.loadingYM.has(n),errorOf:t=>n=>t.errorByYM[n]||""},actions:{setBaseUrl(t){this.baseUrl=t||"/crm_scheduled"},_setMonth(t,n){this.monthCache={...this.monthCache,[t]:n||[]}},_deleteMonth(t){const{[t]:n,...a}=this.monthCache;this.monthCache=a,this.loadingYM.delete(t);const{[t]:o,...r}=this.errorByYM;this.errorByYM=r,this.loadedYM.delete(t)},coerceHttps(t){return t&&t.startsWith("http://")?t.replace(/^http:\/\//i,"https://"):t},_appendMonth(t,n){if(!n||n.length===0)return;this.monthCache[t]||(this.monthCache[t]=[]);const a=new Set(this.monthCache[t].map(o=>o==null?void 0:o.id));for(const o of n)o&&(o.id&&a.has(o.id)||this.monthCache[t].push(o))},async ensureMonthLoaded(t){if(t||(t=dn(new Date)),this.loadedYM.has(t))return;const n=`${this.baseUrl}|${t}`;if($t.has(n))return $t.get(n);this.loadingYM.add(t),this.errorByYM={...this.errorByYM,[t]:""};const a=(async()=>{var o,r;try{const l=`${this.baseUrl}?year_month=${encodeURIComponent(t)}&page_size=10`,s=await Pe.get(l),i=Array.isArray(s==null?void 0:s.data)?s.data:((o=s==null?void 0:s.data)==null?void 0:o.results)||[],d=Yr(i||[]);this._setMonth(t,d),this.loadedYM.add(t);let u=this.coerceHttps(((r=s==null?void 0:s.data)==null?void 0:r.next)||null);u&&(async()=>{var c,m;try{let f=u;for(;f;){const h=await Pe.get(f),p=Array.isArray(h==null?void 0:h.data)?h.data:((c=h==null?void 0:h.data)==null?void 0:c.results)||[],g=Yr(p||[]);this._appendMonth(t,g),f=this.coerceHttps(((m=h==null?void 0:h.data)==null?void 0:m.next)||null)}}catch(f){console.warn("[scheduled] background paging error:",(f==null?void 0:f.message)||f)}})()}catch(l){const s=String((l==null?void 0:l.message)||l);throw this.errorByYM={...this.errorByYM,[t]:s},console.error("[scheduled] fetch error",t,s),this._setMonth(t,[]),this.loadedYM.delete(t),l}finally{$t.delete(n),this.loadingYM.delete(t)}})();return $t.set(n,a),a},async forceReload(t){t||(t=dn(new Date));const n=`${this.baseUrl}|${t}`;$t.delete(n),this._deleteMonth(t),this.loadedYM.delete(t),await this.ensureMonthLoaded(t)},findEventById(t){const n=String(t);for(const[a,o]of Object.entries(this.monthCache)){const r=(o||[]).findIndex(l=>{var d;const s=((d=l==null?void 0:l.raw)==null?void 0:d.id)!=null?String(l.raw.id):null,i=(l==null?void 0:l.id)!=null?String(l.id):null;return s===n||i===n});if(r!==-1)return{ym:a,idx:r}}return null},applyUpdateToCache({id:t,params:n}){var f,h,p,g,y,k,B,b,x,v,_,R,L;let a=null;if((f=n==null?void 0:n.schedule)!=null&&f.time){const A=n.schedule.time,M=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(A);if(M){const[,S,N,w,C="00",O="00"]=M;a=new Date(Number(S),Number(N)-1,Number(w),Number(C),Number(O),0,0)}else{const S=typeof A=="string"&&!A.includes("T")?A.replace(" ","T"):A;a=new Date(S)}}const o=A=>{var M,S,N,w;return a instanceof Date&&!isNaN(a)&&(A.date=a,A.time=Jn(a)),((S=(M=n==null?void 0:n.message)==null?void 0:M[0])==null?void 0:S.content)!=null&&(A.content=n.message[0].content),A.raw=A.raw||{id:t},A.raw.params=A.raw.params||{},n!=null&&n.schedule&&(A.raw.params.schedule={...A.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(A.raw.params.scheduled_by=n.scheduled_by),n.department&&(A.raw.params.department=n.department),n!=null&&n.message&&(A.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(A.chatId=n.chat_id??A.chatId??""),n!=null&&n.entity&&(A.raw.params.entity={...A.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(A.contactName=n.entity.name??A.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(A.contactPhoto=n.entity.photo??A.contactPhoto??null,n.entity.photo&&(A.photo=n.entity.photo))),n!=null&&n.info&&(A.raw.params.info={...A.raw.params.info||{},...n.info},(N=n.info)!=null&&N.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(A.departmentName=n.info.department.name??A.departmentName),(w=n.info)!=null&&w.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(A.instanceName=n.info.instance.name??A.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(A.instanceStatus=n.info.instance.last_instance_status??A.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?A.title=n.title??A.title??Kn(A.function):A.title=A.title||Kn(A.function),Object.prototype.hasOwnProperty.call(n||{},"function")?(A.function=n.function??A.function??"scheduled_messages",A.type=n.function??A.type??"scheduled_messages"):(A.function=A.function||"scheduled_messages",A.type=A.type||"scheduled_messages"),A},r=this.findEventById(t);if(!r){const A=a instanceof Date&&!isNaN(a)?a:(()=>{var T;const C=(T=n==null?void 0:n.schedule)==null?void 0:T.time,O=typeof C=="string"&&!C.includes("T")?C.replace(" ","T"):C;return(Bn==null?void 0:Bn(O))||(O?new Date(O):new Date)})(),M=((n==null?void 0:n.function)||"scheduled_messages")==="attendant_reminder",S=o({id:t,date:A,time:Jn(A),title:(n==null?void 0:n.title)||Kn((n==null?void 0:n.function)||"scheduled_messages"),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:((p=(h=n==null?void 0:n.message)==null?void 0:h[0])==null?void 0:p.content)??"",raw:{id:t,params:n},contactName:M?"":((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:M?"":((B=(k=n==null?void 0:n.info)==null?void 0:k.department)==null?void 0:B.name)??null,departmentId:((x=(b=n==null?void 0:n.info)==null?void 0:b.department)==null?void 0:x.id)??null,instanceName:((_=(v=n==null?void 0:n.info)==null?void 0:v.instance)==null?void 0:_.name)??null,instanceStatus:((L=(R=n==null?void 0:n.info)==null?void 0:R.instance)==null?void 0:L.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),N=dn(S.date),w=this.monthCache[N]?[...this.monthCache[N],S]:[S];w.sort((C,O)=>C.date-O.date),this._setMonth(N,w);return}const{ym:l,idx:s}=r,i=this.monthCache[l]||[],d={...i[s]},u=o({...d}),c=u.date instanceof Date?u.date:d.date,m=dn(c);if(m===l){const A=[...i];A.splice(s,1,u),A.sort((M,S)=>M.date-S.date),this._setMonth(l,A)}else{const A=i.slice(0,s).concat(i.slice(s+1)),M=this.monthCache[m]?[...this.monthCache[m],u]:[u];M.sort((S,N)=>S.date-N.date),this.monthCache={...this.monthCache,[l]:A,[m]:M}}},removeFromCache(t){const n=this.findEventById(t);if(!n)return!1;const{ym:a,idx:o}=n,r=this.monthCache[a]||[],l=r.slice(0,o).concat(r.slice(o+1));return this._setMonth(a,l),!0},insertNormalizedEvent(t){if(!t)return;const n=String(t.id),a=t.date instanceof Date?t.date:Bn(t.date)||new Date,o=dn(a),r={...t,id:n,date:a,time:t.time??Jn(a)},l=this.monthCache[o]?[...this.monthCache[o]]:[],s=l.findIndex(i=>{var d;return String(((d=i==null?void 0:i.raw)==null?void 0:d.id)??(i==null?void 0:i.id))===n});s!==-1?l.splice(s,1,r):l.push(r),l.sort((i,d)=>i.date-d.date),this._setMonth(o,l)},insertFromApiItem(t){const n=Za(t);n&&this.insertNormalizedEvent(n)},insertManyFromApi(t=[]){for(const n of t){const a=Za(n);a&&this.insertNormalizedEvent(a)}},insertFromApiPage(t){const n=Array.isArray(t)?t:(t==null?void 0:t.results)||[];this.insertManyFromApi(n)},insertFromParams(t){return this.applyUpdateToCache(t)},hasEvent(t){return!!this.findEventById(t)},resetAll(){var t;this.monthCache={},this.loadingYM=new Set,this.errorByYM={},this.loadedYM=new Set,(t=$t.clear)==null||t.call($t)}}}),Xr=()=>Ya(),Ze=e.reactive({active:{reminders:[],pagination:{count:0,next:null,previous:null,currentPage:1,pageSize:10},loaded:!1,loading:!1},completed:{reminders:[],pagination:{count:0,next:null,previous:null,currentPage:1,pageSize:10},loaded:!1,loading:!1}}),Qr=(t,n,a)=>{if(n){const o=Ze[a].reminders.findIndex(r=>r.id===t.id);o!==-1&&(Ze[a].reminders[o]={...t})}else Ze[a].reminders.unshift({...t,id:t.id}),Ze[a].reminders.length>Ze[a].pagination.pageSize&&Ze[a].reminders.pop(),Ze[a].pagination.count+=1},m3=(t,n,a)=>{const o=new URLSearchParams,r=t;return o.set("page",n||1),o.set("status",a),`${r}?${o.toString()}`},f3=async(t=2,n)=>{try{const{data:a}=await Pe.get(m3(Un,t,n));return a}catch(a){return console.error("Error fetching reminders:",a),{results:[],count:0}}},Xa=async(t,n)=>{const a=t==="next",o=a?Ze.active:Ze.completed;o.loading=!0;try{const r=await f3(n,a);o.reminders=r.results||[],o.pagination.count=r.count||0,o.pagination.next=r.next||null,o.pagination.previous=r.previous||null,o.pagination.currentPage=n,o.loaded=!0}catch(r){console.error("Error fetching reminders:",r)}finally{o.loading=!1}},p3=async t=>{var i,d,u,c,m;const n=!!(t!=null&&t.id),a=(t==null?void 0:t.params)||{},o=a!=null&&a.schedule?{...a.schedule}:null,r=a!=null&&a.message?{...a.message}:null;if(!((i=r[0])!=null&&i.title))throw new Error("O campo título é obrigatório.");const l=n?{method:"patch",url:`${Un}${t.id}/`,success:"Produto editado com sucesso!"}:{method:"post",url:Un,success:"Produto criado com sucesso!"},s={schedule:o,message:r};try{const{data:f}=await Pe[l.method](l.url,s),h=(f==null?void 0:f.message)||l.success||"Lembrete salvo com sucesso.";At({group:"success",title:"Sucesso",text:h},4e3),Qr(f.data,n,"active");const p={id:f.data.id,params:{...s,title:((u=(d=s.message)==null?void 0:d[0])==null?void 0:u.title)||"Lembrete",function:f.data.function||"attendant_reminder",type:"attendant_reminder",scheduled_by:(m=(c=f.data)==null?void 0:c.params)==null?void 0:m.scheduled_by,status:!0}};return Xr().insertFromParams(p),f}catch(f){throw f}},h3=async t=>{try{const n=await Pe.delete(`${Un}${t}/`),a=Ze.active.reminders.findIndex(o=>o.id===t);return a!==-1&&Ze.active.reminders.splice(a,1),At({group:"success",title:"Sucesso",text:n.data.message||"Lembrete deletado com sucesso."},4e3),n.data}catch(n){console.error("Error deleting reminder:",n)}finally{Xr().removeFromCache(String(t))}},ea=t=>{if(!(t instanceof Date))return null;const n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),l=String(t.getMinutes()).padStart(2,"0");return`${n}-${a}-${o} ${r}:${l}`},ta=(t,n)=>{if(t==="time")return new Date(n).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"});if(t==="data")return new Date(n).toLocaleDateString("pt-BR")},g3=t=>{if(!t||!t.id)return;const n=Ze.active.reminders,a=n.findIndex(o=>o.id===t.id);a!==-1&&(n.splice(a,1),Ze.active.pagination.count=Math.max(0,Ze.active.pagination.count-1)),Qr(t,!1,"completed")},y3={class:"w-full h-full max-w-full flex flex-col"},k3={class:"flex-1 min-h-0"},b3={key:0,class:"w-full h-full flex items-center justify-center text-center p-6"},x3={class:"flex flex-col items-center gap-2 text-base-content/70"},w3={class:"text-sm"},E3={class:"text-xs"},C3={key:1,class:"overflow-auto h-full bg-base-300"},B3={class:"w-full table-fixed"},v3={class:"sticky top-0 bg-base-200 z-10 text-xs font-medium"},V3={key:0,class:"px-2"},S3=["title"],N3={class:"truncate text-center"},M3=["title"],A3={class:"truncate text-center"},$3={class:"w-16 px-6"},_3={class:"flex gap-1 items-center justify-center"},D3={key:0,class:"px-6 py-2"},T3={class:"flex gap-1 items-center justify-center"},L3={class:"bg-base-200 hover:bg-base-100 hover:scale-105 transition-all duration-200 p-1 rounded-lg"},F3=["onClick"],P3={class:"text-center text-base"},z3={class:"line-clamp-2 font-sans"},O3={class:"center mt-2 text-sm"},R3=["disabled","onClick"],H3={key:0,class:"size-4 animate-spin rounded-full border-4 border-solid text-white border-t-transparent"},j3={key:1,class:"relative uppercase font-medium text-xs"},G3={class:"p-1 flex-none"},I3=["title","disabled"],q3=ke({__name:"reminderList",props:{listState:{type:String,default:"Próximos"},listStateModifiers:{}},emits:e.mergeModels(["openForm"],["update:listState"]),setup(t,{emit:n}){const a=n,o=e.useModel(t,"listState"),r=e.computed(()=>o.value==="Próximos"),l=e.ref(!1),s=async c=>{l.value||(l.value=!0,await h3(c),l.value=!1)},i=e.computed(()=>Ze),d=e.computed({get(){var c,m,f,h;return i.value?o.value==="Próximos"?((m=(c=i.value.active)==null?void 0:c.pagination)==null?void 0:m.currentPage)??1:((h=(f=i.value.completed)==null?void 0:f.pagination)==null?void 0:h.currentPage)??1:1},set(c){o.value==="Próximos"?i.value.active.pagination.currentPage=c:i.value.completed.pagination.currentPage=c}}),u=()=>{r.value&&a("openForm",{type:"create"})};return e.onMounted(async()=>{await Promise.all([Xa("next",1),Xa("completed",1)])}),(c,m)=>{const f=e.resolveComponent("Popper"),h=e.resolveComponent("VueAwesomePaginate");return e.openBlock(),e.createElementBlock("section",y3,[e.createElementVNode("div",k3,[(o.value==="Próximos"?i.value.active.reminders.length:i.value.completed.reminders.length)===0?(e.openBlock(),e.createElementBlock("div",b3,[e.createElementVNode("div",x3,[m[3]||(m[3]=e.createElementVNode("svg",{class:"w-14 text-gray-600","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M17.133 12.632v-1.8a5.407 5.407 0 0 0-4.154-5.262.955.955 0 0 0 .021-.106V3.1a1 1 0 0 0-2 0v2.364a.933.933 0 0 0 .021.106 5.406 5.406 0 0 0-4.154 5.262v1.8C6.867 15.018 5 15.614 5 16.807 5 17.4 5 18 5.538 18h12.924C19 18 19 17.4 19 16.807c0-1.193-1.867-1.789-1.867-4.175Zm-13.267-.8a1 1 0 0 1-1-1 9.424 9.424 0 0 1 2.517-6.391A1.001 1.001 0 1 1 6.854 5.8a7.43 7.43 0 0 0-1.988 5.037 1 1 0 0 1-1 .995Zm16.268 0a1 1 0 0 1-1-1A7.431 7.431 0 0 0 17.146 5.8a1 1 0 0 1 1.471-1.354 9.424 9.424 0 0 1 2.517 6.391 1 1 0 0 1-1 .995ZM8.823 19a3.453 3.453 0 0 0 6.354 0H8.823Z"})],-1)),e.createElementVNode("p",w3,e.toDisplayString(o.value==="Próximos"?"Nenhum lembrete futuro encontrado.":"Nenhum lembrete concluído."),1),e.createElementVNode("p",E3,e.toDisplayString(o.value==="Próximos"?"Clique em “Criar novo lembrete +” para adicionar.":"Conclua um lembrete para vê-lo aqui."),1)])])):(e.openBlock(),e.createElementBlock("div",C3,[e.createElementVNode("table",B3,[e.createElementVNode("thead",v3,[e.createElementVNode("tr",null,[m[4]||(m[4]=e.createElementVNode("th",{class:"px-6"},"Nome",-1)),m[5]||(m[5]=e.createElementVNode("th",{class:"px-6"},"Descrição",-1)),m[6]||(m[6]=e.createElementVNode("th",{class:"px-6"},"Data",-1)),r.value?(e.openBlock(),e.createElementBlock("th",V3,"Ação")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value==="Próximos"?i.value.active.reminders:i.value.completed.reminders,p=>{var g,y,k,B,b,x,v,_;return e.openBlock(),e.createElementBlock("tr",{key:p.id,class:"bg-base-300 hover:bg-base-200 transition-colors duration-150 cursor-default text-xs h-8"},[e.createElementVNode("td",{class:"whitespace-normal break-words p-1 px-6",title:((g=p==null?void 0:p.params)==null?void 0:g.message[0].title)||null},[e.createElementVNode("p",N3,e.toDisplayString(((y=p==null?void 0:p.params)==null?void 0:y.message[0].title)||"-"),1)],8,S3),e.createElementVNode("td",{class:"whitespace-normal break-words p-1 px-6 max-w-32",title:((k=p==null?void 0:p.params)==null?void 0:k.message[0].content)||null},[e.createElementVNode("p",A3,e.toDisplayString(((B=p==null?void 0:p.params)==null?void 0:B.message[0].content)||"-"),1)],8,M3),e.createElementVNode("td",$3,[e.createElementVNode("section",_3,[e.createElementVNode("p",null,e.toDisplayString(e.unref(ta)("data",(x=(b=p==null?void 0:p.params)==null?void 0:b.schedule)==null?void 0:x.time)),1),m[7]||(m[7]=e.createTextVNode(" - ",-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(ta)("time",(_=(v=p==null?void 0:p.params)==null?void 0:v.schedule)==null?void 0:_.time)),1)])]),r.value?(e.openBlock(),e.createElementBlock("td",D3,[e.createElementVNode("section",T3,[e.createElementVNode("button",L3,[(e.openBlock(),e.createElementBlock("svg",{onClick:R=>a("openForm",{type:"edit",...p}),class:"size-4 text-yellow-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[...m[8]||(m[8]=[e.createElementVNode("path",{"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)])],8,F3))]),e.createVNode(f,{class:"reminder-del-popper"},{content:e.withCtx(({close:R})=>{var L;return[e.createElementVNode("section",P3,[e.createElementVNode("div",z3,[m[9]||(m[9]=e.createTextVNode(" Tem certeza que deseja ",-1)),m[10]||(m[10]=e.createElementVNode("span",{class:"font-bold text-red-500"},"apagar",-1)),e.createTextVNode(" o "+e.toDisplayString((L=p==null?void 0:p.params)==null?void 0:L.message[0].title)+"? ",1)]),m[12]||(m[12]=e.createElementVNode("div",{class:"text-sm"},"Essa ação é irreversível.",-1)),e.createElementVNode("div",O3,[e.createElementVNode("button",{disabled:l.value,class:"group relative inline-flex items-center justify-center w-full overflow-hidden rounded bg-red-500 px-5 py-1 text-xs text-white transition-all duration-300 ease-out hover:bg-gradient-to-r hover:from-red-500 hover:to-red-400 hover:ring-2 hover:ring-red-400 hover:ring-offset-2",onClick:[R,A=>s(p.id)]},[m[11]||(m[11]=e.createElementVNode("span",{class:"ease absolute right-0 -mt-12 h-32 w-8 translate-x-12 rotate-12 bg-white opacity-10 transition-all duration-1000 group-hover:-translate-x-40"},null,-1)),l.value?(e.openBlock(),e.createElementBlock("div",H3)):(e.openBlock(),e.createElementBlock("span",j3,"Apagar lembrete"))],8,R3)])])]}),default:e.withCtx(()=>[m[13]||(m[13]=e.createElementVNode("button",{class:"bg-base-200 hover:bg-base-100 hover:scale-105 transition-all duration-200 p-1 rounded-lg"},[e.createElementVNode("svg",{class:"size-4 text-red-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.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"})])],-1))]),_:2},1024)])])):e.createCommentVNode("",!0)])}),128))])])]))]),e.createElementVNode("div",G3,[e.createElementVNode("button",{title:r.value?"Criar novo lembrete":"Volte para aba de próximos para criar lembretes",disabled:!r.value,onClick:m[0]||(m[0]=p=>u()),class:"bg-base-100 w-full border border-base-100 p-2 rounded-md uppercase text-[11px] hover:bg-base-100/80 flex justify-center items-center gap-2"}," Criar novo lembrete + ",8,I3)]),i.value&&(o.value==="Próximos"?i.value.active.pagination.count:i.value.completed.pagination.count)>10?(e.openBlock(),e.createBlock(h,{key:0,class:"justify-center mx-auto bg-base-300 w-full py-2 flex-none",modelValue:d.value,"onUpdate:modelValue":m[1]||(m[1]=p=>d.value=p),"total-items":o.value==="Próximos"?i.value.active.pagination.count:i.value.completed.pagination.count,"items-per-page":o.value==="Próximos"?i.value.active.pagination.pageSize:i.value.completed.pagination.pageSize,"max-pages-shown":3,onClick:m[2]||(m[2]=p=>e.unref(Xa)(o.value==="Próximos"?"next":"completed",d.value))},{"prev-button":e.withCtx(()=>[...m[14]||(m[14]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"mx-auto w-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15m0 0l6.75 6.75M4.5 12l6.75-6.75"})],-1)])]),"next-button":e.withCtx(()=>[...m[15]||(m[15]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"mx-auto w-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75"})],-1)])]),_:1},8,["modelValue","total-items","items-per-page"])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-d33b5518"]]),W3={class:"table-body-container"},U3={class:"reminder-form-label-name"},Z3={class:"flex items-center gap-1"},Y3={key:0,class:"text-red-500 text-[10px] mt-0.3"},X3=["disabled"],Q3={class:"reminder-form-label-description"},K3={class:"reminder-form-label-description-container bg-base-300"},J3=["disabled"],e4={class:"reminder-form-label-date"},t4={class:"flex items-center gap-1"},n4={key:0,class:"text-red-500 text-[10px] mt-0.3"},a4={class:"reminder-data-picker-container"},o4=["disabled"],r4={class:"flex gap-1.5 text-xs group-hover:scale-105 group-hover:text-primary_alt transition-all duration-200"},l4=ke({__name:"reminderForm",props:{modelValue:{type:Object,default:()=>({})},viewOnly:{type:Boolean,default:!1}},setup(t,{expose:n}){const a=t,o=e.ref(new Date(Date.now()+6e4)),r=e.ref(Date.now()),l=e.computed(()=>new Date(r.value+6e4)),s=e.ref({params:{message:[{title:"",type:"text",content:""}],schedule:{type:"unique",time:ea(o.value),timezone:"America/Sao_Paulo"}}}),i=e.ref([]),d=async()=>{const c=l.value.getTime();if(o.value.getTime()<c&&(o.value=new Date(c),s.value.params.schedule.time=ea(o.value)),s.value.params.message[0].title.trim()==="")return i.value.push("title"),new Promise.reject("Título é obrigatório");try{await p3(s.value)}catch(f){return i.value.push("date"),Promise.reject(f)}};e.watch(o,c=>{if(!(c instanceof Date)||a.viewOnly)return;const m=l.value;c.getTime()<m.getTime()&&(o.value=new Date(m.getTime()))});let u;return e.onMounted(()=>{var c,m;if(u=setInterval(()=>{r.value=Date.now();const f=l.value;!a.viewOnly&&o.value.getTime()<f.getTime()&&(o.value=new Date(f.getTime()))},15e3),a.modelValue&&Object.keys(a.modelValue).length>0){s.value=JSON.parse(JSON.stringify(a.modelValue));const f=new Date(((m=(c=s.value.params)==null?void 0:c.schedule)==null?void 0:m.time)||o.value);a.viewOnly?o.value=f:isNaN(f.getTime())||f.getTime()<l.value.getTime()?(s.value.params.schedule.time=ea(l.value),o.value=new Date(l.value.getTime())):o.value=f}}),e.onBeforeUnmount(()=>{u&&clearInterval(u)}),n({save:d}),(c,m)=>{const f=e.resolveComponent("VueDatePicker");return e.openBlock(),e.createElementBlock("div",W3,[e.createElementVNode("span",U3,[e.createElementVNode("section",Z3,[m[5]||(m[5]=e.createElementVNode("p",{class:"reminder-form-label-text"},"Nome",-1)),i.value.includes("title")&&s.value.params.message[0].title.trim()===""?(e.openBlock(),e.createElementBlock("a",Y3," Campo obrigatório")):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=h=>s.value.params.message[0].title=h),onInput:m[1]||(m[1]=h=>i.value=i.value.filter(p=>p!=="title")),placeholder:"Ligar para o cliente às 14h",type:"text",disabled:a.viewOnly,class:e.normalizeClass(["reminder-form-input-name bg-base-300",i.value.includes("title")&&s.value.params.message[0].title.trim()===""?"border-red-500 border-2":"border-transparent border-none",a.viewOnly?"opacity-60 cursor-not-allowed":""])},null,42,X3),[[e.vModelText,s.value.params.message[0].title]])]),e.createElementVNode("span",Q3,[m[6]||(m[6]=e.createElementVNode("p",{class:"reminder-form-label-text"},"Descrição",-1)),e.createElementVNode("div",K3,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[2]||(m[2]=h=>s.value.params.message[0].content=h),placeholder:"Ligar para o cliente para confirmar o agendamento da reunião.",disabled:a.viewOnly,class:e.normalizeClass(["reminder-form-input-description bg-base-300",a.viewOnly?"opacity-60 cursor-not-allowed":""]),maxlength:"1000","aria-label":"Anotações do cliente"},null,10,J3),[[e.vModelText,s.value.params.message[0].content]]),e.createElementVNode("div",{class:e.normalizeClass(["description-character-count bg-base-300",s.value.params.message[0].content.length>900?"text-red-500":s.value.params.message[0].content.length>700?"text-yellow-500":"text-gray-400"])},e.toDisplayString(s.value.params.message[0].content.length||0)+"/1000 ",3)])]),e.createElementVNode("span",e4,[e.createElementVNode("section",t4,[m[7]||(m[7]=e.createElementVNode("p",{class:"reminder-form-label-text"},"Data do lembrete",-1)),i.value.includes("date")&&new Date(s.value.params.schedule.time).getTime()<l.value.getTime()?(e.openBlock(),e.createElementBlock("a",n4," Não é possível criar um agendamento com data e hora anterior que o atual")):e.createCommentVNode("",!0)]),e.createElementVNode("div",a4,[e.createVNode(f,{modelValue:o.value,"onUpdate:modelValue":[m[3]||(m[3]=h=>o.value=h),m[4]||(m[4]=h=>s.value.params.schedule.time=e.unref(ea)(o.value))],"text-input":"",locale:"pt-BR","cancel-text":"Cancelar","select-text":"Confirmar","enable-time-picker":!0,format:"dd/MM/yyyy HH:mm",teleport:!0,"min-date":l.value,disabled:a.viewOnly},{"clear-icon":e.withCtx(()=>[...m[8]||(m[8]=[])]),"dp-input":e.withCtx(()=>[e.createElementVNode("button",{class:e.normalizeClass(["reminder-btn-data-picker bg-base-300",a.viewOnly?"opacity-60 cursor-not-allowed":"group"]),disabled:a.viewOnly},[m[10]||(m[10]=e.createElementVNode("svg",{class:"size-4.5 group-hover:scale-105 group-hover:text-primary_alt transition-all duration-200","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"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-2Zm6.01-6a1 1 0 1 0-2 0 1 1 0 0 0 2 0Zm2 0a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm6 0a1 1 0 1 0-2 0 1 1 0 0 0 2 0Zm-10 4a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm6 0a1 1 0 1 0-2 0 1 1 0 0 0 2 0Zm2 0a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",r4,[e.createElementVNode("p",null,e.toDisplayString(e.unref(ta)("data",o.value)),1),m[9]||(m[9]=e.createTextVNode(" - ",-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(ta)("time",o.value)),1)])],10,o4)]),_:1},8,["modelValue","min-date","disabled"])])])])}}},[["__scopeId","data-v-0fb1ce3a"]]),s4={class:"reminder-modal-header"},i4={class:"modal_responsive"},c4={class:"flex min-h-full items-center justify-center text-center sm:p-0"},d4={class:"reminder-modal-container"},u4={class:"reminder-modal-title bg-base-300 border-base-100"},m4={class:"flex flex-col gap-1 w-full"},f4={class:"flex items-center gap-1"},p4={class:"text-md"},h4={key:0,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},g4={key:1,class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},y4={key:0,class:"flex flex-col lg:flex-row w-full gap-1.5"},k4=["onClick"],b4={key:0,class:"size-3.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},x4={key:1,class:"size-3.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},w4={class:"flex-1 min-h-0 flex flex-col bg-base-200 overflow-hidden"},E4={class:"reminder-modal-end-button border-base-100 bg-base-300"},C4=["disabled"],B4={key:0,class:"size-3 animate-spin rounded-full border-2 border-solid text-primary border-t-transparent"},v4={key:1},V4={key:2},Qa=ke({__name:"reminderModal",props:{initialData:{type:Object,default:null},viewOnly:{type:Boolean,default:!1}},emits:["close"],setup(t,{expose:n,emit:a}){const o=t,r=e.ref(null),l=e.ref({}),s=e.ref(!1),i=e.computed(()=>f.value==="list"?"Lembretes":f.value==="create"?"Criar Lembrete":f.value==="edit"?o.viewOnly?"Visualizar Lembrete":"Editar Lembrete":"Lembretes"),d=async()=>{var y;if(!s.value){s.value=!0;try{await((y=r.value)==null?void 0:y.save()),f.value="list"}catch{}finally{s.value=!1}}},u=a,c=e.ref("Próximos"),m=e.ref(["Próximos","Executados"]),f=e.ref("list"),h=()=>{if(o.viewOnly){u("close");return}f.value==="list"?u("close"):f.value="list"},p=y=>{(y==null?void 0:y.type)==="create"?(f.value="create",l.value={}):(y==null?void 0:y.type)==="edit"&&(f.value="edit",l.value=y)},g=y=>{f.value="edit",l.value=y};return n({openForEdit:g}),e.onMounted(()=>{o.initialData&&g(o.initialData)}),(y,k)=>(e.openBlock(),e.createElementBlock("div",s4,[k[9]||(k[9]=e.createElementVNode("div",{class:"reminder-modal-overlay"},null,-1)),e.createElementVNode("div",i4,[e.createElementVNode("div",c4,[e.createElementVNode("div",d4,[e.createElementVNode("div",u4,[e.createElementVNode("section",m4,[e.createElementVNode("div",f4,[k[6]||(k[6]=e.createElementVNode("svg",{class:"size-5 text-primary","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M17.133 12.632v-1.8a5.406 5.406 0 0 0-4.154-5.262.955.955 0 0 0 .021-.106V3.1a1 1 0 0 0-2 0v2.364a.955.955 0 0 0 .021.106 5.406 5.406 0 0 0-4.154 5.262v1.8C6.867 15.018 5 15.614 5 16.807 5 17.4 5 18 5.538 18h12.924C19 18 19 17.4 19 16.807c0-1.193-1.867-1.789-1.867-4.175ZM8.823 19a3.453 3.453 0 0 0 6.354 0H8.823Z"})],-1)),e.createElementVNode("h3",p4,e.toDisplayString(i.value),1),e.createElementVNode("button",{onClick:k[0]||(k[0]=B=>h()),class:"reminder-modal-close-button bg-base-200/40"},[f.value==="list"?(e.openBlock(),e.createElementBlock("svg",h4,[...k[4]||(k[4]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",g4,[...k[5]||(k[5]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 19-7-7 7-7"},null,-1)])]))])]),f.value==="list"?(e.openBlock(),e.createElementBlock("div",y4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,B=>(e.openBlock(),e.createElementBlock("button",{onClick:b=>c.value=B,class:e.normalizeClass([" w-full rounded-md px-2 flex items-center lg:justify-center justify-between gap-1.5 py-1 text-sm font-medium transition-all duration-200",c.value===B?"bg-primary_alt":"bg-base-100 text-gray-400 hover:bg-primary_alt hover:text-white"])},[e.createElementVNode("p",null,e.toDisplayString(B),1),B==="Próximos"?(e.openBlock(),e.createElementBlock("svg",b4,[...k[7]||(k[7]=[e.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 12Zm11-4a1 1 0 1 0-2 0v4a1 1 0 0 0 .293.707l3 3a1 1 0 0 0 1.414-1.414L13 11.586V8Z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",x4,[...k[8]||(k[8]=[e.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 12Zm13.707-1.293a1 1 0 0 0-1.414-1.414L11 12.586l-1.793-1.793a1 1 0 0 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l4-4Z","clip-rule":"evenodd"},null,-1)])]))],10,k4))),256))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",w4,[e.withDirectives(e.createVNode(q3,{listState:c.value,"onUpdate:listState":k[1]||(k[1]=B=>c.value=B),onOpenForm:k[2]||(k[2]=B=>p(B))},null,8,["listState"]),[[e.vShow,f.value==="list"]]),f.value==="create"||f.value==="edit"?(e.openBlock(),e.createBlock(l4,{key:0,modelValue:l.value,"onUpdate:modelValue":k[3]||(k[3]=B=>l.value=B),ref_key:"formRef",ref:r,"view-only":o.viewOnly},null,8,["modelValue","view-only"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",E4,[f.value!=="list"&&!o.viewOnly?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:s.value,class:"btn-save-reminder bg-primary hover:bg-primary_alt disabled:opacity-50 disabled:cursor-not-allowed",onClick:d},[s.value?(e.openBlock(),e.createElementBlock("div",B4)):!s.value&&f.value==="edit"?(e.openBlock(),e.createElementBlock("p",v4,"Salvar")):(e.openBlock(),e.createElementBlock("p",V4,"Criar"))],8,C4)):e.createCommentVNode("",!0)])])])])]))}},[["__scopeId","data-v-7a21f1ac"]]),Kr={scheduled_messages:"#3b82f6",attendant_reminder:"#f59e0b"},Jr=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function S4(t=""){let n=2166136261;for(let a=0;a<t.length;a++)n^=t.charCodeAt(a),n=Math.imul(n,16777619);return n>>>0}function N4(t={}){var s,i,d,u,c,m,f,h,p,g,y;const n=t.functionName||t.function||((s=t==null?void 0:t.params)==null?void 0:s.function);if(n)return`fn:${n}`;const a=(t==null?void 0:t.departmentName)||((d=(i=t==null?void 0:t.info)==null?void 0:i.department)==null?void 0:d.name)||((c=(u=t==null?void 0:t.info)==null?void 0:u.department)==null?void 0:c.id);if(a)return`dept:${a}`;const o=(t==null?void 0:t.instanceName)||((f=(m=t==null?void 0:t.info)==null?void 0:m.instance)==null?void 0:f.name)||((p=(h=t==null?void 0:t.info)==null?void 0:h.instance)==null?void 0:p.id);if(o)return`inst:${o}`;const r=(t==null?void 0:t.protocol)??((g=t==null?void 0:t.info)==null?void 0:g.protocol);if(r!=null)return`proto:${r}`;const l=(t==null?void 0:t.chatId)||((y=t==null?void 0:t.params)==null?void 0:y.chat_id);return l?`chat:${l}`:"misc"}function na(t={}){var r;const n=t.functionName||t.function||((r=t==null?void 0:t.params)==null?void 0:r.function);if(n&&Object.prototype.hasOwnProperty.call(Kr,n))return Kr[n];const a=N4(t),o=S4(String(a))%Jr.length;return Jr[o]}const _t=jt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),getters:{logged_attendant:t=>()=>t.attendants.find(n=>n.is_me)},actions:{async fetchAttendants(){try{this.attendants=[];let t=`${q0}`;const n=await Pe.get(t);this.attendants=n.data,this.count=this.attendants.length}catch(t){console.log("Erro ao buscar atendentes:",t)}},removeAttendants(t){this.attendants=this.attendants.filter(n=>n.id!==t)},addAttendants(t){const n=this.attendants.findIndex(a=>a.id===t.id);n!==-1?this.attendants[n]=t:this.attendants.push(t)}}}),M4={class:"itemc-head"},A4={class:"sched-pop sched-pop--right",tabindex:"0","aria-haspopup":"true"},$4={class:"sched-pop__card bg-base-300",role:"dialog"},_4={class:"minw0"},D4={class:"itemc-title"},T4={class:"itemc-sub"},L4={class:"flex items-center gap-1"},F4={class:"itemc-actions"},P4={class:"flex flex-col items-center"},z4={class:"time-badge"},O4={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},R4={class:"sched-pop__card bg-base-300",role:"dialog"},H4={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},j4={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"},G4=["disabled"],I4={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"},q4={key:1,class:"loading-spinner"},W4=["disabled"],U4={class:"itemsb-head"},Z4={class:"avatar-wrap"},Y4=["src"],X4={key:1,class:"avatar avatar--placeholder bg-base-100"},Q4={key:0,viewBox:"0 0 24 24",class:"icon-5 icon-muted"},K4={key:1,title:"Lembrete"},J4={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},e5={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},t5={class:"itemsb-main"},n5={class:"itemsb-row"},a5={class:"itemsb-title truncate"},o5={class:"flex flex-col items-center"},r5={class:"itemsb-time"},l5={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},s5={class:"sched-pop__card bg-base-300",role:"dialog"},i5={class:"itemsb-sub"},c5={class:"items-attendant"},d5={key:0,class:"itemsb-content"},u5={key:1,class:"itemsb-content"},m5={key:2,class:"itemsb-actions"},f5=["disabled"],p5={key:0,class:"loading-spinner"},h5=["disabled"],g5={class:"event-left"},y5={class:"sched-pop sched-pop--right",tabindex:"0","aria-haspopup":"true"},k5={class:"sched-pop__card bg-base-300",role:"dialog"},b5={class:"event-line"},x5={class:"event-actions"},w5={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},E5={class:"sched-pop__card bg-base-300",role:"dialog"},C5={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},B5={class:"sched-pop__card bg-base-300",role:"dialog"},v5={class:"event-time"},V5={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},S5={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"},N5=["disabled"],M5={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"},A5={key:1,class:"loading-spinner"},$5=["disabled"],Ka=ke({__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","edit-reminder"],setup(t,{emit:n}){const a=_t(),o=t,r=e.computed(()=>(o.getEventColor||na)(o.ev)),l=e.computed(()=>{var c;return((c=o.ev)==null?void 0:c.type)==="scheduled_messages"}),s=e.computed(()=>{var c;return((c=o.ev)==null?void 0:c.type)==="attendant_reminder"}),i=e.computed(()=>a.attendants.find(c=>c.is_me)||{}),d=c=>{const m=a.attendants.find(f=>f.id===c);return m?m.id===i.value.id?"Você":m.name||"Desconhecido":"Desconhecido"},u=e.computed(()=>{var m,f;const c=[];return(m=o.ev)!=null&&m.contactName&&c.push(o.ev.contactName),c.push(((f=o.ev)==null?void 0:f.departmentName)||"sem depto"),c.join(" • ")});return(c,m)=>{var f,h,p,g,y,k,B,b;return t.mode==="compact"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("header",M4,[e.createElementVNode("div",A4,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"color-bar"},null,4),e.createElementVNode("div",$4,[m[9]||(m[9]=e.createElementVNode("strong",null,"Tipo",-1)),m[10]||(m[10]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.type==="attendant_reminder"?"Lembrete":"Mensagem programada"),1)])]),e.createElementVNode("div",_4,[e.createElementVNode("div",D4,[l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.ev.contactName?t.ev.contactName+" • ":"")+" "+e.toDisplayString(t.ev.departmentName||"sem depto"),1)],64)):s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.ev.raw.params.message[0].title),1)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",T4,[e.createElementVNode("span",L4,[m[11]||(m[11]=e.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"},[e.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)),e.createTextVNode(" "+e.toDisplayString(d(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("footer",F4,[e.createElementVNode("div",P4,[e.createElementVNode("div",z4,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",O4,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["status-bar",(f=t.ev)!=null&&f.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",R4,[m[12]||(m[12]=e.createElementVNode("strong",null,"Status",-1)),m[13]||(m[13]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])]),e.createElementVNode("button",{onClick:m[0]||(m[0]=x=>s.value?c.$emit("edit-reminder",t.ev):c.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary"},[((h=t.ev)==null?void 0:h.status)===!0?(e.openBlock(),e.createElementBlock("svg",H4,[...m[14]||(m[14]=[e.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)])])):(e.openBlock(),e.createElementBlock("svg",j4,[...m[15]||(m[15]=[e.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)])]))]),e.createElementVNode("button",{onClick:m[1]||(m[1]=x=>c.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--danger",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",I4,[...m[16]||(m[16]=[e.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)])])),t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",q4)):e.createCommentVNode("",!0)],8,G4),e.createElementVNode("button",{disabled:!l.value,class:"disabled:opacity-90 cyber-button cyber-button--xs cyber-button--accent",onClick:m[2]||(m[2]=x=>c.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...m[17]||(m[17]=[e.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.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)])],8,W4)])],64)):t.mode==="sidebar"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",U4,[e.createElementVNode("div",Z4,[t.ev.contactPhoto?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.ev.contactPhoto,alt:"",class:"avatar",loading:"lazy"},null,8,Y4)):(e.openBlock(),e.createElementBlock("div",X4,[l.value?(e.openBlock(),e.createElementBlock("svg",Q4,[...m[18]||(m[18]=[e.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"},null,-1)])])):(e.openBlock(),e.createElementBlock("span",K4,[...m[19]||(m[19]=[e.createElementVNode("svg",{class:"size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M17.133 12.632v-1.8a5.406 5.406 0 0 0-4.154-5.262.955.955 0 0 0 .021-.106V3.1a1 1 0 0 0-2 0v2.364a.955.955 0 0 0 .021.106 5.406 5.406 0 0 0-4.154 5.262v1.8C6.867 15.018 5 15.614 5 16.807 5 17.4 5 18 5.538 18h12.924C19 18 19 17.4 19 16.807c0-1.193-1.867-1.789-1.867-4.175ZM8.823 19a3.453 3.453 0 0 0 6.354 0H8.823Z"})],-1)])]))])),e.createElementVNode("div",J4,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-dot-avatar",((p=t.ev)==null?void 0:p.type)==="attendant_reminder"?"status--reminder":"status--scheduled"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",e5,[m[20]||(m[20]=e.createElementVNode("strong",null,"Status",-1)),m[21]||(m[21]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(((g=t.ev)==null?void 0:g.type)==="attendant_reminder"?"Lembrete":"Mensagem programada"),1)])])]),e.createElementVNode("div",t5,[e.createElementVNode("div",n5,[e.createElementVNode("span",a5,[l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.ev.contactName)+" • "+e.toDisplayString(t.ev.departmentName||"sem depto"),1)],64)):s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.ev.raw.params.message[0].title),1)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("section",o5,[e.createElementVNode("span",r5,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",l5,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-bar",(y=t.ev)!=null&&y.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",s5,[m[22]||(m[22]=e.createElementVNode("strong",null,"Status",-1)),m[23]||(m[23]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])])]),e.createElementVNode("div",i5,[e.createElementVNode("span",c5,[m[24]||(m[24]=e.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"},[e.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)),e.createTextVNode(" "+e.toDisplayString(d(t.ev.scheduled_by)),1)])])])]),s.value?(e.openBlock(),e.createElementBlock("p",d5,e.toDisplayString(t.ev.raw.params.message[0].content),1)):(e.openBlock(),e.createElementBlock("p",u5,e.toDisplayString(t.ev.content),1)),t.viewOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",m5,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:m[3]||(m[3]=x=>s.value?c.$emit("edit-reminder",t.ev):c.$emit("open-message",t.ev))},e.toDisplayString(((k=t.ev)==null?void 0:k.status)===!0?"Editar":"Visualizar"),1),e.createElementVNode("button",{onClick:m[4]||(m[4]=x=>c.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--sm cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",p5)):e.createCommentVNode("",!0),m[25]||(m[25]=e.createTextVNode(" Apagar ",-1))],8,f5),e.createElementVNode("button",{disabled:!l.value,type:"button",class:"disabled:opacity-90 cyber-button cyber-button--sm cyber-button--accent",onClick:m[5]||(m[5]=x=>c.$emit("open-chat",t.ev))}," Abrir conversa ",8,h5)]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",g5,[e.createElementVNode("div",y5,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),e.createElementVNode("div",k5,[m[26]||(m[26]=e.createElementVNode("strong",null,"Tipo",-1)),m[27]||(m[27]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.type==="attendant_reminder"?"Lembrete":"Mensagem programada"),1)])]),e.createElementVNode("div",b5,[l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(u.value),1)],64)):s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.ev.raw.params.message[0].title),1)],64)):e.createCommentVNode("",!0)])]),e.createElementVNode("footer",x5,[e.createElementVNode("div",w5,[m[30]||(m[30]=e.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"},[e.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)),e.createElementVNode("div",E5,[m[28]||(m[28]=e.createElementVNode("strong",null,"Agendado por",-1)),m[29]||(m[29]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(d(t.ev.scheduled_by)),1)])]),e.createElementVNode("div",C5,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-bar",(B=t.ev)!=null&&B.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",B5,[m[31]||(m[31]=e.createElementVNode("strong",null,"Status",-1)),m[32]||(m[32]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])]),e.createElementVNode("div",v5,e.toDisplayString(t.ev.time),1),e.createElementVNode("button",{onClick:m[6]||(m[6]=x=>s.value?c.$emit("edit-reminder",t.ev):c.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((b=t.ev)==null?void 0:b.status)===!0?(e.openBlock(),e.createElementBlock("svg",V5,[...m[33]||(m[33]=[e.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)])])):(e.openBlock(),e.createElementBlock("svg",S5,[...m[34]||(m[34]=[e.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)])]))]),e.createElementVNode("button",{onClick:m[7]||(m[7]=x=>c.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",M5,[...m[35]||(m[35]=[e.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)])])),t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",A5)):e.createCommentVNode("",!0)],8,N5),e.createElementVNode("button",{disabled:!l.value,class:"cyber-button cyber-button--xs cyber-button--accent",onClick:m[8]||(m[8]=x=>c.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...m[36]||(m[36]=[e.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.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)])],8,$5)])],64))}}},[["__scopeId","data-v-811ab961"]]),_5={class:"cpk-header bg-base-200"},D5={class:"left"},T5=["title"],L5={class:"right"},F5=["title"],P5={class:"toggle"},z5=["aria-pressed","title"],O5={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},R5={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},H5=ke({__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(t){return(n,a)=>(e.openBlock(),e.createElementBlock("header",_5,[e.createElementVNode("div",D5,[e.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]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])]),e.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]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M15.5 19 9 12l6.5-7 1.5 1.3L12.3 12l4.7 5.7z"})],-1),e.createElementVNode("span",{class:"label-md"},"Anterior",-1)])]),e.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]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24","aria-hidden":"true"},[e.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),e.createElementVNode("span",{class:"label-md"},"Hoje",-1)])]),e.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]=[e.createElementVNode("span",{class:"label-md"},"Próximo",-1),e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M8 19l6.5-7L8 5l-1.5 1.3L11.7 12 6.5 17.7z"})],-1)])])]),e.createElementVNode("h2",{class:"month-title",title:`${t.month} ${t.year}`},e.toDisplayString(t.month)+" "+e.toDisplayString(t.year),9,T5),e.createElementVNode("div",L5,[e.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]=e.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"},[e.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)),t.filterCount>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:"filter-badge",title:`${t.filterCount} filtro${t.filterCount>1?"s":""} ativo${t.filterCount>1?"s":""}`},e.toDisplayString(t.filterCount),9,F5)):e.createCommentVNode("",!0)]),e.createElementVNode("div",P5,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--sm btn-ghost",t.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]=[e.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[e.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),e.createElementVNode("span",{class:"label-lg"},"Calendário",-1)])],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--sm btn-ghost",t.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]=[e.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[e.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),e.createElementVNode("span",{class:"label-lg"},"Agenda",-1)])],2)]),e.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":t.isCompact,title:t.isCompact?"Sair do modo compacto":"Ativar modo compacto"},[t.isCompact?(e.openBlock(),e.createElementBlock("svg",R5,[...a[16]||(a[16]=[e.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)])])):(e.openBlock(),e.createElementBlock("svg",O5,[...a[15]||(a[15]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8h4V4m12 4h-4V4M4 16h4v4m12-4h-4v4"},null,-1)])]))],8,z5)])]))}},[["__scopeId","data-v-e367c35d"]]),j5=["title"],G5={class:"week-header"},I5=ke({__name:"WeekDays",props:{weekDays:{type:Array,default:()=>[]},month:String,year:[String,Number]},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h2",{class:"month-title",title:`${t.month} ${t.year}`},e.toDisplayString(t.month)+" "+e.toDisplayString(t.year),9,j5),e.createElementVNode("div",G5,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.weekDays,o=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"week-cell"},e.toDisplayString(o),1))),128))])],64))}},[["__scopeId","data-v-a59e7945"]]),q5=["onClick"],W5={key:0,class:"cell-today-indicator show-lg"},U5={class:"cell-top"},Z5={class:"day-number"},Y5={key:1,class:"more"},X5={class:"bars-wrap"},Q5=4,K5=8,el=4,tl=2,J5=1,e6=ke({__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(t){const n=t,a=e.ref({}),o=new Map;function r(p){const g=(p==null?void 0:p.clientWidth)||0,y=(p==null?void 0:p.clientHeight)||0;if(!g||!y)return{cols:0,rows:0,widths:[],sum:0};const k=Math.max(0,Math.floor((g+el)/(Q5+el))),B=Math.max(0,Math.floor((y+tl)/(K5+tl))),b=i(k,B),x=b.reduce((v,_)=>v+_,0);return{cols:k,rows:B,widths:b,sum:x}}function l(p,g){const y=r(g),k=a.value[p];(!k||k.cols!==y.cols||k.rows!==y.rows||k.sum!==y.sum)&&(a.value={...a.value,[p]:y})}function s(p,g){if(!g){const k=o.get(p);if(k&&(k.disconnect(),o.delete(p)),a.value[p]!=null){const B={...a.value};delete B[p],a.value=B}return}l(p,g);const y=new ResizeObserver(()=>l(p,g));y.observe(g),o.set(p,y)}e.onBeforeUnmount(()=>{o.forEach(p=>p.disconnect()),o.clear()});function i(p,g){if(p<=0||g<=0)return[];const y=[],k=.25;for(let B=0;B<g;B++){const b=B/Math.max(1,g-1),x=k+(1-k)*b,v=Math.max(1,Math.round(p*x));y.push(Math.min(v,p))}return y}function d(p,g){var x;const y=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,k=((x=a.value[p])==null?void 0:x.sum)??0;if(y<=k)return{bars:y,overflow:0};const B=Math.max(0,k-J5),b=Math.max(0,y-B);return{bars:B,overflow:b}}function u(p,g){const y=a.value[p];if(!y||y.rows===0||y.cols===0)return[];const{widths:k}=y,b=d(p,g).bars,x=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,b):[])||[],v=k.map(()=>[]);let _=0;for(let R=k.length-1;R>=0&&_<x.length;R--){const L=Math.min(k[R],x.length-_);v[R]=x.slice(_,_+L),_+=L}return v}const c=e.ref(null);function m(p){return p&&p.nodeType===1&&typeof p.getBoundingClientRect=="function"}function f(p){if(!m(p))return;const g=c.value,y=g&&m(g)?g:p.offsetParent;if(!m(y))return;let k,B;try{k=p.getBoundingClientRect(),B=y.getBoundingClientRect()}catch{return}const b=y.scrollLeft||0,x=y.scrollTop||0;p.style.position="absolute",p.style.zIndex="0",p.style.top=`${k.top-B.top+x}px`,p.style.left=`${k.left-B.left+b}px`,p.style.width=`${k.width}px`,p.style.height=`${k.height}px`,p.style.pointerEvents="none"}function h(p){!p||!p.style||requestAnimationFrame(()=>{!p||!p.style||(p.style.position="",p.style.zIndex="",p.style.top="",p.style.left="",p.style.width="",p.style.height="",p.style.pointerEvents="")})}return(p,g)=>(e.openBlock(),e.createBlock(e.TransitionGroup,{name:"cal-fade","move-class":"cal-move",tag:"div",class:"cal-grid calendar-grid",appear:"",ref_key:"gridRef",ref:c,onBeforeLeave:f,onAfterLeave:h},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.startOffset,y=>(e.openBlock(),e.createElementBlock("div",{key:"x"+y,class:"cal-cell day-empty bg-base-300 border border-base-100"}))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.monthDays,(y,k)=>(e.openBlock(),e.createElementBlock("div",{key:y.key,style:e.normalizeStyle({"--i":k}),class:e.normalizeClass(["cal-cell day-cell border border-base-100 bg-base-200 hover:bg-base-100",[t.isSameMonthFn(y.date,t.viewDate)?"":"opacity-60",t.isSelectedDayFn(y.date)?"neon-selected":"",t.isTodayFn(y.date)?"is-today":"",t.dayEventCountFn(y.date)>0?"has-events":""]]),onClick:B=>t.selectDayFn(y.date)},[t.isTodayFn(y.date)?(e.openBlock(),e.createElementBlock("div",W5," Hoje ")):e.createCommentVNode("",!0),e.createElementVNode("div",U5,[e.createElementVNode("span",Z5,e.toDisplayString(y.date.getDate()),1)]),d(y.key,y.date).overflow>0?(e.openBlock(),e.createElementBlock("span",Y5," +"+e.toDisplayString(d(y.key,y.date).overflow),1)):e.createCommentVNode("",!0),e.createElementVNode("div",X5,[e.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:B=>s(y.key,B)},[d(y.key,y.date).bars>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u(y.key,y.date),(B,b)=>(e.openBlock(),e.createElementBlock("div",{key:"vrow"+b,class:"vrow"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B,(x,v)=>(e.openBlock(),e.createElementBlock("span",{key:"vbar"+b+"-"+v,class:"vbar",style:e.normalizeStyle({background:e.unref(na)(x),boxShadow:`0 0 8px ${e.unref(na)(x)}70`})},null,4))),128))]))),128)):e.createCommentVNode("",!0)],512)])],14,q5))),128))]),_:1},512))}},[["__scopeId","data-v-82c146bb"]]),t6={class:"agenda-section"},n6={key:0,class:"empty-state"},a6={key:1,class:"day-list"},o6={class:"date-trail"},r6={class:"weekday-short"},l6={class:"date-pill bg-base-200 border border-base-300"},s6={class:"date-pill-month"},i6={class:"date-pill-day"},c6={class:"content-col"},d6={class:"day-header"},u6={class:"agenda-title"},m6={class:"month-header-text"},f6={class:"events-list"},p6=ke({__name:"AgendaList",props:{days:{type:Array,default:()=>[]},weekdayLong:Function,weekdayShort:Function,monthShort:Function,monthLabelOf:Function,year:Number},emits:["open-chat","open-message","delete-message","edit-reminder"],setup(t,{emit:n}){return(a,o)=>(e.openBlock(),e.createElementBlock("section",t6,[t.days.length===0?(e.openBlock(),e.createElementBlock("div",n6," Sem eventos neste mês. ")):(e.openBlock(),e.createElementBlock("ul",a6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.days,r=>{var l;return e.openBlock(),e.createElementBlock("li",{key:r.key,class:"day-item border-base-200"},[e.createElementVNode("div",o6,[e.createElementVNode("div",r6,e.toDisplayString(t.weekdayShort(r.date)),1),e.createElementVNode("div",l6,[e.createElementVNode("div",s6,e.toDisplayString(t.monthShort(r.date)),1),e.createElementVNode("div",i6,e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",{style:e.normalizeStyle({background:e.unref(na)(((l=r.events)==null?void 0:l[0])||{})}),class:"date-pill-dot"},null,4)])]),e.createElementVNode("div",c6,[e.createElementVNode("div",d6,[e.createElementVNode("h3",u6,e.toDisplayString(t.weekdayLong(r.date).toUpperCase())+" "+e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",m6,e.toDisplayString(t.monthLabelOf(r.date).toUpperCase())+" "+e.toDisplayString(t.year),1)]),e.createElementVNode("ul",f6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.events,s=>(e.openBlock(),e.createElementBlock("li",{key:s.id,class:"event-item border border-base-100 bg-base-200 hover:bg-base-100"},[e.createVNode(Ka,{ev:s,mode:"agenda",onOpenMessage:o[0]||(o[0]=i=>a.$emit("open-message",i)),onOpenChat:o[1]||(o[1]=i=>a.$emit("open-chat",i)),onDeleteMessage:o[2]||(o[2]=i=>a.$emit("delete-message",i)),onEditReminder:o[3]||(o[3]=i=>a.$emit("edit-reminder",i))},null,8,["ev"])]))),128))])])])}),128))]))]))}},[["__scopeId","data-v-022bc946"]]),h6=["data-mode","data-empty"],g6=["disabled"],nl=ke({__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","edit-reminder"],setup(t){const n=t,a=e.computed(()=>n.mode==="compact"?n.selectedLabelLong||"Hoje":`Eventos em ${n.selectedLabel||"—"}`);return(o,r)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["bg-base-300 daylist",[t.mode==="compact"?"daylist--compact has-border border-base-200":"daylist--sidebar has-border border-base-200 supports-blur",{"daylist--tight":t.mode==="compact"&&!t.loading&&t.events.length===0}]]),"data-mode":t.mode,"data-empty":!t.loading&&t.events.length===0?"1":"0"},[e.createElementVNode("div",{class:e.normalizeClass(["daylist-header",t.mode==="compact"?"daylist-header--compact bg-base-300":"daylist-header--sidebar bg-base-300"])},[e.createElementVNode("h3",{class:e.normalizeClass(t.mode==="compact"?"daylist-title--compact":"daylist-title--sidebar")},e.toDisplayString(a.value),3),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:r[0]||(r[0]=l=>o.$emit("reload")),disabled:t.loading},e.toDisplayString(t.loading?"Atualizando…":"Atualizar"),9,g6)],2),t.loading?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:"fade"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["loading-text",t.mode==="compact"?"is-compact":"is-sidebar"])}," Carregando… ",2)]),_:1})):t.events.length===0?(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"fade"},{default:e.withCtx(()=>[...r[5]||(r[5]=[e.createElementVNode("div",{class:"empty-text"},"Sem eventos.",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.TransitionGroup,{key:2,name:"list","move-class":"list-move",tag:"ul",appear:"",class:e.normalizeClass([t.mode==="compact"?"list-compact has-border border-base-300 bg-base-200 supports-blur":"list-sidebar"])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.events,(l,s)=>(e.openBlock(),e.createElementBlock("li",{key:l.id,style:e.normalizeStyle({"--i":s}),class:e.normalizeClass(t.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 ")},[e.createVNode(Ka,{ev:l,mode:t.mode==="compact"?"compact":"sidebar",onOpenMessage:r[1]||(r[1]=i=>o.$emit("open-message",i)),onOpenChat:r[2]||(r[2]=i=>o.$emit("open-chat",i)),onDeleteMessage:r[3]||(r[3]=i=>o.$emit("delete-message",i)),onEditReminder:r[4]||(r[4]=i=>o.$emit("edit-reminder",i))},null,8,["ev","mode"])],6))),128))]),_:1},8,["class"]))],10,h6))}},[["__scopeId","data-v-d4438400"]]),y6={class:"cpk-popover__header border-base-100"},k6={class:"filter-body"},b6={class:"row"},x6=["checked"],w6={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},E6={class:"status-wrap"},C6={class:"seg"},B6=ke({__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(t,{emit:n}){const a=t,o=n,r=_t(),l=e.computed(()=>r.attendants.find(L=>L.is_me)||null),s=e.reactive({onlyMine:!1,status:null});e.watch(()=>a.open,async L=>{var S,N,w;if(!L)return;await e.nextTick();const A=(S=l.value)!=null&&S.id?String(l.value.id):null;s.onlyMine=!!A&&String(((N=a.filters)==null?void 0:N.scheduled_by)??"")===A;const M=(w=a.filters)==null?void 0:w.status;s.status=M===!0||M===!1?M:null,y()},{immediate:!1});function i(L,A){if(!L)return{};const{[A]:M,...S}=L;return S}function d(L){var M;s.onlyMine=!!L.target.checked;const A=(M=l.value)!=null&&M.id?String(l.value.id):null;s.onlyMine&&A?o("update:filters",{...a.filters,scheduled_by:A}):o("update:filters",i(a.filters,"scheduled_by"))}function u(L){if(s.status===L){s.status=null;const A=i(a.filters,"status");o("update:filters",A)}else s.status=L,o("update:filters",{...a.filters,status:L})}const c=e.ref(null),m=e.ref({left:0,top:0,placed:"bottom"}),f=e.computed(()=>({position:"fixed",left:`${m.value.left}px`,top:`${m.value.top}px`}));function h(){const L=a.anchorEl instanceof Element?a.anchorEl:null;if(L!=null&&L.getBoundingClientRect)return L.getBoundingClientRect();const A=window.innerWidth/2,M=window.innerHeight/3;return{left:A,right:A,top:M,bottom:M,width:0,height:0}}function p(L,A,M,S){return{left:Math.max(8,Math.min(L,window.innerWidth-M-8)),top:Math.max(8,Math.min(A,window.innerHeight-S-8))}}function g(){const L=h(),A=c.value,M=(A==null?void 0:A.offsetWidth)??300,S=(A==null?void 0:A.offsetHeight)??220;let N=L.bottom+a.offset,w;if(a.align==="center"?w=L.left+L.width/2-M/2:a.align==="end"?w=L.right-M:w=L.left,N+S>window.innerHeight-4){const O=L.top-S-a.offset;O>=4?(N=O,m.value.placed="top"):m.value.placed="bottom"}else m.value.placed="bottom";const C=p(w,N,M,S);m.value={left:C.left,top:C.top,placed:m.value.placed}}function y(){g(),requestAnimationFrame(g)}let k,B,b=[];function x(){v(),b=[window];const L=a.anchorEl instanceof Element?a.anchorEl:null;let A=L==null?void 0:L.parentElement;for(;A&&A!==document.body;){const M=getComputedStyle(A);/(auto|scroll)/.test(M.overflow+M.overflowY+M.overflowX)&&b.push(A),A=A.parentElement}b.forEach(M=>M.addEventListener("scroll",y,{passive:!0}))}function v(){b.forEach(L=>{var A;return(A=L.removeEventListener)==null?void 0:A.call(L,"scroll",y)}),b=[]}e.watch(()=>a.open,async L=>{var M,S,N,w;if(!L){v(),(M=k==null?void 0:k.disconnect)==null||M.call(k),(S=B==null?void 0:B.disconnect)==null||S.call(B);return}await e.nextTick(),y(),x(),(N=k==null?void 0:k.disconnect)==null||N.call(k),k=new ResizeObserver(y),k.observe(document.body),(w=B==null?void 0:B.disconnect)==null||w.call(B);const A=a.anchorEl instanceof Element?a.anchorEl:null;A&&(B=new ResizeObserver(y),B.observe(A)),window.addEventListener("resize",y)}),e.watch(()=>a.anchorEl,async()=>{a.open&&(await e.nextTick(),x(),y())});function _(L){L.key==="Escape"&&o("close")}function R(L){if(!a.open)return;const A=L.target,M=c.value;if(M&&M.contains(A))return;const S=a.anchorEl instanceof Element?a.anchorEl:null;S&&S.contains&&S.contains(A)||o("close")}return e.onMounted(()=>{document.addEventListener("pointerdown",R,!0),window.addEventListener("keydown",_)}),e.onBeforeUnmount(()=>{var L,A;document.removeEventListener("pointerdown",R,!0),window.removeEventListener("keydown",_),v(),(L=k==null?void 0:k.disconnect)==null||L.call(k),(A=B==null?void 0:B.disconnect)==null||A.call(B)}),(L,A)=>(e.openBlock(),e.createBlock(e.Transition,{name:"cpk-layer",appear:""},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:A[4]||(A[4]=e.withModifiers(M=>L.$emit("close"),["self"]))},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:c,class:"cpk-popover bg-base-300",style:e.normalizeStyle(f.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[e.createElementVNode("div",y6,[A[5]||(A[5]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),A[6]||(A[6]=e.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:A[0]||(A[0]=M=>L.$emit("close")),"aria-label":"Fechar"}," × ")]),e.createElementVNode("div",k6,[e.createElementVNode("label",b6,[e.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:A[1]||(A[1]=M=>d(M)),"aria-label":"Exibir somente meus eventos"},null,40,x6),A[7]||(A[7]=e.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),e.createElementVNode("div",w6,[A[9]||(A[9]=e.createElementVNode("span",{class:"status-icon","aria-hidden":"true"},[e.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"},[e.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)),e.createElementVNode("div",E6,[A[8]||(A[8]=e.createElementVNode("div",{class:"label-cpk"},[e.createTextVNode(" Status "),e.createElementVNode("span",{class:"sched-pop",tabindex:"0","aria-label":"Ajuda sobre status"},[e.createElementVNode("span",{class:"sched-pop__mark"},[e.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"},[e.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"})])]),e.createElementVNode("div",{class:"sched-pop__card bg-base-300",style:{"--popover-brd":"var(--cyber-border)",transform:"translate(-5%, -50%) scale(0.98)"}},[e.createElementVNode("div",null,[e.createElementVNode("span",{style:{"font-weight":"600"}},"Ativos:"),e.createTextVNode(" Eventos que estão programados para ocorrer ")]),e.createElementVNode("div",null,[e.createElementVNode("span",{style:{"font-weight":"600"}},"Executados:"),e.createTextVNode(" Eventos que já ocorreram ")])])])],-1)),e.createElementVNode("div",C6,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:A[2]||(A[2]=M=>u(!0)),"aria-pressed":"state.status === true"}," Ativos ",2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!1?"is-active":""]),onClick:A[3]||(A[3]=M=>u(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):e.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-cc8bb01a"]]),v6={class:"calendar-content"},V6={key:0},aa=80,al=ke({__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(t,{expose:n,emit:a}){const o=t,r=Ya();r.setBaseUrl(o.sourceUrl);const l=new Date,s=e.ref(_(o.initialDate)),i=e.ref(new Date(l.getFullYear(),l.getMonth(),l.getDate())),d=e.ref("calendar"),u=e.ref(!1),c=e.ref(0),m=e.ref(0),f=e.computed(()=>u.value?{transform:`translateX(${m.value}px)`}:{});function h(){u.value=!1,c.value=0,m.value=0}function p(P){var Z,X;if(!(P.pointerType==="mouse"&&P.button!==0)){u.value=!0,c.value=P.clientX;try{(X=(Z=P.target).setPointerCapture)==null||X.call(Z,P.pointerId)}catch{}}}function g(P){u.value&&(m.value=P.clientX-c.value)}function y(P){var X,me;if(!u.value)return;const Z=m.value;try{(me=(X=P.target).releasePointerCapture)==null||me.call(X,P.pointerId)}catch{}h(),Z<-aa?C():Z>aa&&w()}function k(P){var Z,X;try{(X=(Z=P.target).releasePointerCapture)==null||X.call(Z,P.pointerId)}catch{}h()}function B(P){const Z=P.touches&&P.touches[0];Z&&(u.value=!0,c.value=Z.clientX,m.value=0)}function b(P){if(!u.value)return;const Z=P.touches&&P.touches[0];Z&&(m.value=Z.clientX-c.value)}function x(P){if(!u.value)return;const Z=m.value;h(),Z<-aa?C():Z>aa&&w()}function v(P){h()}function _(P){if(P instanceof Date)return new Date(P.getFullYear(),P.getMonth(),1);if(typeof P=="string"){const[Z,X]=P.split("-").map(me=>parseInt(me,10));return new Date(Z||l.getFullYear(),(X||l.getMonth()+1)-1,1)}return new Date(l.getFullYear(),l.getMonth(),1)}function R(P){return new Date(P.getFullYear(),P.getMonth()+1,0).getDate()}function L(P){return new Date(P.getFullYear(),P.getMonth(),1).getDay()}function A(P,Z){return P.getFullYear()===Z.getFullYear()&&P.getMonth()===Z.getMonth()}function M(P){return Ua(P,l)}function S(P){return Ua(P,i.value)}function N(P){i.value=new Date(P.getFullYear(),P.getMonth(),P.getDate()),A(P,s.value)||(s.value=new Date(P.getFullYear(),P.getMonth(),1))}function w(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function C(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function O(){s.value=new Date(l.getFullYear(),l.getMonth(),1),i.value=new Date(l.getFullYear(),l.getMonth(),l.getDate())}const T=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],V=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],E=e.computed(()=>ye(T[s.value.getMonth()])),$=e.computed(()=>s.value.getFullYear()),D=e.computed(()=>G(i.value)),F=e.computed(()=>`${Q(i.value)} ${i.value.getDate()}`);function G(P){return`${String(P.getDate()).padStart(2,"0")}/${String(P.getMonth()+1).padStart(2,"0")}/${P.getFullYear()}`}function Q(P){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][P.getDay()]}function I(P){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][P.getDay()]}function q(P){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][P.getMonth()]}function re(P){return T[P.getMonth()]}function ye(P){return P.charAt(0).toUpperCase()+P.slice(1)}const de=e.computed(()=>L(s.value)),Ne=e.computed(()=>{const P=R(s.value);return Array.from({length:P},(Z,X)=>{const me=X+1,be=new Date(s.value.getFullYear(),s.value.getMonth(),me);return{key:`d${me}`,date:be}})}),ve=e.ref({open:!1,anchorEl:null});function we(P){ve.value.open=!0,ve.value.anchorEl=(P==null?void 0:P.currentTarget)||null}const{filters:Be}=jt.storeToRefs(r),Te=e.ref(!1),J=e.ref(null),ue=e.ref(!1);function ge(P){J.value=P.raw,ue.value=P.status!==!0,Te.value=!0}function ce(){Te.value=!1,J.value=null,ue.value=!1}const ie=e.computed(()=>dn(s.value)),fe=e.computed(()=>r.eventsOf(ie.value)),j={scheduled_by:P=>{var me,be,Me;const Z=(P==null?void 0:P.scheduled_by)??((be=(me=P==null?void 0:P.raw)==null?void 0:me.params)==null?void 0:be.scheduled_by)??((Me=P==null?void 0:P.raw)==null?void 0:Me.scheduled_by)??(P==null?void 0:P.created_by)??(P==null?void 0:P.attendant_id),X=typeof Z=="object"&&Z?Z.id??Z.attendant_id:Z;return X!=null?String(X):""}};function ee(P,Z){const X=(Z==null?void 0:Z.value)??Z;return!X||typeof X!="object"?!0:Object.entries(X).every(([me,be])=>{var Je,et,tt;if(be==null||be===""||Array.isArray(be)&&be.length===0)return!0;const Me=j[me],_e=(Me==null?void 0:Me(P))??(P==null?void 0:P[me])??((Je=P==null?void 0:P.raw)==null?void 0:Je[me])??((tt=(et=P==null?void 0:P.raw)==null?void 0:et.params)==null?void 0:tt[me])??null,ze=typeof _e=="string"?_e:_e??"";if(typeof be=="function")return!!be(ze,P);if(Array.isArray(be))return be.map(String).includes(String(ze));if(typeof be=="object"){const{in:mt,notIn:Ie,range:lt,contains:on}=be;if(mt&&!mt.map(String).includes(String(ze))||Ie&&Ie.map(String).includes(String(ze)))return!1;if(lt&&typeof ze=="number"){const[kt,vt]=lt;if(kt!=null&&ze<kt||vt!=null&&ze>vt)return!1}if(on!=null){const kt=Array.isArray(ze)?ze:String(ze).split(",");if(!(Array.isArray(on)?on:[on]).some(GA=>kt.map(String).includes(String(GA))))return!1}return!0}return String(ze)===String(be)})}const se=e.computed(()=>(fe.value||[]).filter(Z=>ee(Z,Be)));function oe(P){return se.value.filter(Z=>Ua(Z.date,P))}const U=e.computed(()=>oe(i.value)),ne=e.computed(()=>[...U.value].sort((P,Z)=>P.date-Z.date));function he(P){return oe(P).length}function pe(P){return Math.min(3,he(P))}function xe(P){const Z=he(P);return Z>3?Z-3:0}const Ve=e.computed(()=>{const P=s.value.getFullYear(),Z=s.value.getMonth(),X=new Map;for(const be of se.value){const Me=be==null?void 0:be.date;if(!(Me instanceof Date)||Me.getFullYear()!==P||Me.getMonth()!==Z)continue;const _e=`${P}-${Z+1}-${Me.getDate()}`;X.has(_e)||X.set(_e,{key:`ag-${_e}`,date:new Date(P,Z,Me.getDate()),events:[]}),X.get(_e).events.push(be)}const me=Array.from(X.values());for(const be of me)be.events.sort((Me,_e)=>Me.date-_e.date);return me.sort((be,Me)=>be.date-Me.date),me}),Ce=e.ref(!1),Le=e.ref(!1),Ae=e.computed(()=>Le.value||Ce.value),He=e.computed(()=>Ae?"calendar-stage--compact":"calendar-stage--single");function Se(){var X;const P=window.matchMedia("(max-width: 1280px)"),Z=()=>Le.value=P.matches;Z(),(X=P.addEventListener)==null||X.call(P,"change",Z)}const z=e.computed(()=>r.isLoading(ie.value));e.computed(()=>r.errorOf(ie.value));const W=e.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 Y(P,Z){W.value.open=!0,W.value.context={action:"delete-message",event:P},W.value.title="Confirmar exclusão",W.value.description="Tem certeza que deseja apagar este evento?",W.value.anchorEl=Z&&Z.currentTarget||typeof document<"u"&&document.activeElement||null,W.value.destructive=!0,W.value.confirmLabel="Apagar",W.value.loadingLabel="Apagando…"}async function H(P){if(P)try{if(W.value.loading=!0,P.action==="delete-message"&&await le(P.event),P.event.type==="attendant_reminder"){const Z=Ze.active.reminders.findIndex(X=>X.id===P.event.id);Z!==-1&&Ze.active.reminders.splice(Z,1)}}finally{W.value.loading=!1,W.value.open=!1,W.value.context=null}}function K(){W.value.open=!1,W.value.context=null}async function te(){await r.forceReload(ie.value)}async function le(P){var Z;try{P.deleteLoading=!0;const X=((Z=P==null?void 0:P.raw)==null?void 0:Z.id)??(P==null?void 0:P.id)??P;if(X==null)throw new Error("Evento inválido para exclusão");const me=await u3(Z0,P);return me!=null&&me.ok&&(r.removeFromCache(String(X))||await r.forceReload(ie.value)),me}catch(X){return console.error(X),null}finally{P.deleteLoading=!1}}return e.onMounted(async()=>{Se(),await r.ensureMonthLoaded(ie.value)}),e.watch(()=>o.sourceUrl,async P=>{r.setBaseUrl(P),r.resetAll(),await r.ensureMonthLoaded(ie.value)}),e.watch(ie,async()=>{const P=s.value.getFullYear(),Z=s.value.getMonth(),X=Math.min(i.value.getDate(),R(s.value));i.value=new Date(P,Z,X),await r.ensureMonthLoaded(ie.value)}),n({updateEvent:r.applyUpdateToCache}),(P,Z)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":Ae.value}])},[e.createElementVNode("div",v6,[Z[15]||(Z[15]=e.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),e.createVNode(H5,{month:E.value,year:$.value,"is-compact":Ae.value,"view-mode":d.value,"filter-count":Object.keys(e.unref(Be)).length,onPrev:w,onNext:C,onToday:O,onToggleCompact:Z[0]||(Z[0]=X=>Ce.value=!Ce.value),onSetViewMode:Z[1]||(Z[1]=X=>d.value=X),onClosePage:Z[2]||(Z[2]=X=>P.$emit("close-page")),onOpenFilter:we},null,8,["month","year","is-compact","view-mode","filter-count"]),d.value==="calendar"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["calendar-stage",He.value])},[e.createElementVNode("div",{class:"calendar-stage-main",onPointerdown:p,onPointermove:g,onPointerup:y,onPointercancel:k,onTouchstart:B,onTouchmove:b,onTouchend:x,onTouchcancel:v,style:e.normalizeStyle(f.value)},[e.createVNode(I5,{"week-days":V,month:E.value,year:$.value},null,8,["month","year"]),e.createVNode(e6,{"start-offset":de.value,"month-days":Ne.value,"view-date":s.value,"is-compact":Ae.value,"is-same-month-fn":A,"is-selected-day-fn":S,"is-today-fn":M,"select-day-fn":N,"events-by-day-fn":oe,"day-event-count-fn":he,"event-bars-to-show-fn":pe,"day-event-overflow-fn":xe},null,8,["start-offset","month-days","view-date","is-compact"])],36),Ae.value?(e.openBlock(),e.createBlock(nl,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:z.value,"selected-label-long":F.value,events:ne.value,mode:"compact",onReload:te,onOpenChat:Z[3]||(Z[3]=X=>P.$emit("open-chat",X)),onOpenMessage:Z[4]||(Z[4]=X=>P.$emit("open-message",X)),onDeleteMessage:Z[5]||(Z[5]=(X,me)=>Y(X,me)),onEditReminder:ge},null,8,["loading","selected-label-long","events"])):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(p6,{key:1,days:Ve.value,"weekday-long":Q,"weekday-short":I,"month-short":q,"month-label-of":re,year:$.value,onOpenChat:Z[6]||(Z[6]=X=>P.$emit("open-chat",X)),onOpenMessage:Z[7]||(Z[7]=X=>P.$emit("open-message",X)),onDeleteMessage:Z[8]||(Z[8]=(X,me)=>Y(X,me)),onEditReminder:ge},null,8,["days","year"]))]),e.createVNode(nl,{class:"calendar-daylist calendar-daylist--desktop",loading:z.value,"selected-label":D.value,"selected-label-long":F.value,events:ne.value,mode:Ae.value?"compact":"sidebar",onReload:te,onOpenChat:Z[9]||(Z[9]=X=>P.$emit("open-chat",X)),onOpenMessage:Z[10]||(Z[10]=X=>P.$emit("open-message",X)),onDeleteMessage:Z[11]||(Z[11]=(X,me)=>Y(X,me)),onEditReminder:ge},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),e.createVNode(Q2,{modelValue:W.value.open,"onUpdate:modelValue":Z[12]||(Z[12]=X=>W.value.open=X),title:W.value.title,description:W.value.description,destructive:W.value.destructive,"confirm-label":W.value.confirmLabel,"cancel-label":W.value.cancelLabel,loading:W.value.loading,"loading-label":W.value.loadingLabel,context:W.value.context,"anchor-el":W.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:H,onCancel:K},{details:e.withCtx(()=>{var X;return[(X=W.value.context)!=null&&X.event?(e.openBlock(),e.createElementBlock("div",V6,[e.createVNode(Ka,{"view-only":!0,mode:"sidebar",ev:W.value.context.event},null,8,["ev"])])):e.createCommentVNode("",!0)]}),_:1},8,["modelValue","title","description","destructive","confirm-label","cancel-label","loading","loading-label","context","anchor-el"]),e.createVNode(B6,{open:ve.value.open,"anchor-el":ve.value.anchorEl,filters:e.unref(Be),"onUpdate:filters":Z[13]||(Z[13]=X=>e.isRef(Be)?Be.value=X:null),onClose:Z[14]||(Z[14]=X=>ve.value.open=!1)},null,8,["open","anchor-el","filters"]),Te.value?(e.openBlock(),e.createBlock(Qa,{key:0,"initial-data":J.value,"view-only":ue.value,onClose:ce},null,8,["initial-data","view-only"])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-1072822c"]]),S6={class:"flex flex-col text-center"},N6={class:"flex flex-col space-y-3 justify-center"},M6={class:"space-x-4 flex-col text-black justify-center"},A6=["onUpdate:modelValue","onInput","onKeydown"],ol={__name:"mfa",props:{eventHandling:{type:String,default:null}},emits:["filled","reset"],setup(t,{emit:n}){e.onMounted(()=>{r.value[0].focus()});const a=n,o=e.ref(Array(6).fill("")),r=e.ref([]);e.ref(!1);const l=u=>{const c=o.value[u];o.value[0]<1&&a("reset"),/^\d$/.test(c)?s(u):o.value[u]="",u===o.value.length-1&&o.value.every(m=>m!=="")&&d()},s=u=>{u<o.value.length-1&&o.value[u]&&r.value[u+1].focus()},i=(u,c)=>{c.key==="Backspace"&&!o.value[u]&&u>0&&r.value[u-1].focus()},d=()=>{const u=o.value.join("");a("filled",u)};return(u,c)=>(e.openBlock(),e.createElementBlock("section",S6,[e.createElementVNode("div",N6,[e.createElementVNode("div",M6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,f)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:f,"onUpdate:modelValue":h=>o.value[f]=h,class:e.normalizeClass([t.eventHandling==="check"?"checked_mfa":t.eventHandling==="err"?"err_mfa":"reset_input","inline-block w-10 h-10 rounded-md text-center"]),type:"text",maxlength:"1",onInput:h=>l(f),onKeydown:e.withKeys(h=>i(f,h),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,A6)),[[e.vModelText,o.value[f]]])),128))])])]))}},$6={class:"text-center flex gap-3"},_6={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},D6={key:0,class:"items-center justify-center inline-flex"},T6=["src"],L6={__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(t,{emit:n}){const a=n;e.ref(!1);const o=t,r=()=>{a("generateQR")},l=e.computed(()=>o.base64?o.base64:i.value),s=e.computed(()=>`w-${o.dimensions[0]} h-${o.dimensions[1]}`),i=e.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(d,u)=>(e.openBlock(),e.createElementBlock("div",$6,[e.createElementVNode("section",_6,[t.generated?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.value,"btnQrCode"])},[t.loading?(e.openBlock(),e.createElementBlock("div",D6,[...u[0]||(u[0]=[e.createElementVNode("div",{class:"loaderMFA"},null,-1)])])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"uppercase bg-base-300 p-2 z-40",onClick:r}," Gerar QR "))],2)),e.createElementVNode("img",{class:e.normalizeClass([[s.value,t.generated?"rounded-md":"rounded-none"],""]),src:l.value,alt:"QRCode"},null,10,T6)])]))}},F6={class:"header-buttons-container"},P6=["onClick"],z6={class:"selector-label"},O6=["innerHTML"],R6={class:"selector-text"},H6={key:0,class:"unread-dot","aria-label":"Há mensagens não lidas"},j6={class:"p-2 flex items-center gap-2 relative"},G6={style:{left:"1rem"},class:"text-gray-500 size-4 absolute left-4 top-1/2 -translate-y-1/2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},I6=["value","placeholder"],q6=ke({__name:"sectionsHeader",props:{hasUnread:{type:Object,default:()=>({attendants:!1,groups:!1})},currentState:{type:String,default:""},searchQuery:{type:String,default:""}},emits:["update:currentState","update:searchQuery"],setup(t,{emit:n}){const a=t,o=n,r=e.computed(()=>a.currentState==="grupos"),l=e.computed(()=>a.currentState==="atendentes"),s=e.computed(()=>r.value?"Pesquise entre os grupos...":l.value?"Pesquise entre os atendentes...":"Pesquise..."),i=[{label:"Atendentes",value:"atendentes",svg:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-2 9a4 4 0 0 0-4 4v1a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-1a4 4 0 0 0-4-4h-4Z" clip-rule="evenodd"/> </svg>'},{label:"Grupos",value:"grupos",svg:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="M12 6a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm-1.5 8a4 4 0 0 0-4 4 2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-3Zm6.82-3.096a5.51 5.51 0 0 0-2.797-6.293 3.5 3.5 0 1 1 2.796 6.292ZM19.5 18h.5a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-1.1a5.503 5.503 0 0 1-.471.762A5.998 5.998 0 0 1 19.5 18ZM4 7.5a3.5 3.5 0 0 1 5.477-2.889 5.5 5.5 0 0 0-2.796 6.293A3.501 3.501 0 0 1 4 7.5ZM7.1 12H6a4 4 0 0 0-4 4 2 2 0 0 0 2 2h.5a5.998 5.998 0 0 1 3.071-5.238A5.505 5.505 0 0 1 7.1 12Z" clip-rule="evenodd"/> </svg>'}];return(d,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",F6,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,c=>e.createElementVNode("button",{key:c.value,class:e.normalizeClass(["selector-button",{active:a.currentState===c.value}]),onClick:m=>d.$emit("update:currentState",c.value)},[e.createElementVNode("span",z6,[e.createElementVNode("div",{innerHTML:c.svg},null,8,O6),e.createElementVNode("span",R6,e.toDisplayString(c.label),1),a.hasUnread[c.value]?(e.openBlock(),e.createElementBlock("span",H6)):e.createCommentVNode("",!0)])],10,P6)),64))]),e.createElementVNode("div",j6,[(e.openBlock(),e.createElementBlock("svg",G6,[...u[1]||(u[1]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"m21 21-3.5-3.5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"},null,-1)])])),e.createElementVNode("input",{style:{"padding-left":"2rem"},value:t.searchQuery,onInput:u[0]||(u[0]=c=>o("update:searchQuery",c.target.value)),class:"bg-base-300 w-full p-1 border-none focus:border-primary rounded-full text-white placeholder:text-gray-500 text-sm",placeholder:s.value},null,40,I6)])],64))}},[["__scopeId","data-v-d941e53a"]]),W6=["src"],U6={key:2,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"},Dt=ke({__name:"Avatar",props:{url:{type:String},style:{type:String,default:"size-10"}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500",t.style])},[n.$slots.default?e.renderSlot(n.$slots,"default",{key:0},void 0,!0):t.url?(e.openBlock(),e.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:t.url},null,8,W6)):(e.openBlock(),e.createElementBlock("svg",U6,[...a[0]||(a[0]=[e.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)])]))],2))}},[["__scopeId","data-v-dea35c44"]]);function Z6(t,n=null){if(!t)return!1;const a=t.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 Y6(t){return t?(await e.nextTick(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null):null}function X6(t){let n=`0px 0px ${t.distance}px 0px`;t.top&&(n=`${t.distance}px 0px 0px 0px`);const a=new IntersectionObserver(o=>{o[0].isIntersecting&&(t.firstload&&t.emit(),t.firstload=!0)},{root:t.parentEl,rootMargin:n});return t.infiniteLoading.value&&a.observe(t.infiniteLoading.value),a}async function rl(t,n){if(await e.nextTick(),!t.top)return;const a=t.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const ll=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},Q6={},K6=t=>(e.pushScopeId("data-v-d3e37633"),t=t(),e.popScopeId(),t),J6={class:"container"},e7=K6(()=>e.createElementVNode("div",{class:"spinner"},null,-1)),t7=[e7];function n7(t,n){return e.openBlock(),e.createElementBlock("div",J6,t7)}const a7=ll(Q6,[["render",n7],["__scopeId","data-v-d3e37633"]]),o7={class:"state-error"},Yt=ll(e.defineComponent({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(t,{emit:n}){const a=t;let o=null,r=0;const l=e.ref(null),s=e.ref(""),{top:i,firstload:d,distance:u}=a,{identifier:c,target:m}=e.toRefs(a),f={infiniteLoading:l,top:i,firstload:d,distance:u,parentEl:null,emit(){r=(f.parentEl||document.documentElement).scrollHeight,h.loading(),n("infinite",h)}},h={loading(){s.value="loading"},async loaded(){s.value="loaded",await rl(f,r),Z6(l.value,f.parentEl)&&f.emit()},async complete(){s.value="complete",await rl(f,r),o==null||o.disconnect()},error(){s.value="error"}};function p(){o==null||o.disconnect(),o=X6(f)}return e.watch(c,p),e.onMounted(async()=>{f.parentEl=await Y6(m),p()}),e.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"infiniteLoading",ref:l,class:"v3-infinite-loading"},[e.withDirectives(e.createElementVNode("div",null,[e.renderSlot(g.$slots,"spinner",{},()=>[e.createVNode(a7)],!0)],512),[[e.vShow,s.value=="loading"]]),s.value=="complete"?e.renderSlot(g.$slots,"complete",{key:0},()=>{var k;return[e.createElementVNode("span",null,e.toDisplayString(((k=g.slots)==null?void 0:k.complete)||"No more results!"),1)]},!0):e.createCommentVNode("",!0),s.value=="error"?e.renderSlot(g.$slots,"error",{key:1,retry:f.emit},()=>{var k;return[e.createElementVNode("span",o7,[e.createElementVNode("span",null,e.toDisplayString(((k=g.slots)==null?void 0:k.error)||"Oops something went wrong!"),1),e.createElementVNode("button",{class:"retry",onClick:y[0]||(y[0]=(...B)=>f.emit&&f.emit(...B))},"retry")])]},!0):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]),r7={class:"atendentes-list hide-scrollbar bg-base-300"},l7={key:0,class:"empty-message bg-base-200"},s7=["onClick"],i7={class:"atendente-main"},c7={style:{"background-color":"rgba(2, 169, 219, 0.3)"},class:"relative rounded-full"},d7={class:"flex items-center justify-center mt-0.5 mr-0.8"},u7={key:0,style:{"margin-left":"0.15rem"},class:"size-8 mt-0.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},m7={key:1,style:{"margin-left":"0.15rem"},class:"size-8 mt-0.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},f7={class:""},p7={class:"opacity-50"},h7={class:"flex items-center gap-4"},g7={key:0,class:"message-indicator"},y7=ke({__name:"mountListForType",props:{content:{type:Object,default:()=>({})},mode:{type:String,default:!1},loader:{type:Boolean,default:!1}},setup(t){const n=t,a=e.computed(()=>n.mode==="grupos"),o=e.inject("useChat"),r=()=>{typeof o.openCreateOrEdit=="function"&&o.openCreateOrEdit("create")},l=d=>{typeof o.selectChatToOpen=="function"&&o.selectChatToOpen(d)},s=(d,u)=>({Busy:{indicatorStyle:{backgroundColor:"rgb(239 68 68)"},textStyle:{color:"rgb(252 165 165)"},label:"Ocupado"},Online:{indicatorStyle:{backgroundColor:"rgb(34 197 94)"},textStyle:{color:"rgb(134 239 172)"},label:"Online"},Away:{indicatorStyle:{backgroundColor:"rgb(234 179 8)"},textStyle:{color:"rgb(250 204 21)"},label:"Ausente"},Offline:{indicatorStyle:{backgroundColor:"rgb(107 114 128)"},textStyle:{color:"rgb(209 213 219)"},label:"Offline"},null:{indicatorStyle:{backgroundColor:"rgb(107 114 128)"},textStyle:{color:"rgb(209 213 219)"},label:"Offline"}})[d]||{indicatorStyle:{backgroundColor:"rgb(107 114 128)"},textStyle:{color:"rgb(209 213 219)"},label:u?`Grupo • ${u} membros`:"Grupo"},i=async d=>{if(!a.value||typeof o.loadMoreChannels!="function"){d.complete();return}try{if(await o.loadMoreChannels()){d.loaded();return}d.complete()}catch{d.error()}};return(d,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("ul",r7,[t.content.length===0?(e.openBlock(),e.createElementBlock("li",l7,[...u[1]||(u[1]=[e.createElementVNode("p",null,"não há atendentes disponíveis",-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.content,c=>{var m,f,h;return e.openBlock(),e.createElementBlock("li",{key:c.id,onClick:p=>l(c),class:e.normalizeClass([["atendente-item",c.isMoved?"moved":""],"border-b even:bg-base-300 bg-blue-400/10 border-base-200 hover:bg-base-200 relative"])},[e.createElementVNode("section",i7,[e.createElementVNode("div",c7,[c.photo?(e.openBlock(),e.createBlock(Dt,{key:0,url:c.photo},null,8,["url"])):(e.openBlock(),e.createBlock(Dt,{key:1,url:c.photo},{default:e.withCtx(()=>[e.createElementVNode("div",d7,[a.value?(e.openBlock(),e.createElementBlock("svg",u7,[...u[2]||(u[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 6a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm-1.5 8a4 4 0 0 0-4 4 2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-3Zm6.82-3.096a5.51 5.51 0 0 0-2.797-6.293 3.5 3.5 0 1 1 2.796 6.292ZM19.5 18h.5a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-1.1a5.503 5.503 0 0 1-.471.762A5.998 5.998 0 0 1 19.5 18ZM4 7.5a3.5 3.5 0 0 1 5.477-2.889 5.5 5.5 0 0 0-2.796 6.293A3.501 3.501 0 0 1 4 7.5ZM7.1 12H6a4 4 0 0 0-4 4 2 2 0 0 0 2 2h.5a5.998 5.998 0 0 1 3.071-5.238A5.505 5.505 0 0 1 7.1 12Z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",m7,[...u[3]||(u[3]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-2 9a4 4 0 0 0-4 4v1a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-1a4 4 0 0 0-4-4h-4Z","clip-rule":"evenodd"},null,-1)])]))])]),_:1},8,["url"])),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle([{right:"0px",bottom:"0px"},s(c.login_status,(m=c==null?void 0:c.participants)==null?void 0:m.length).indicatorStyle]),class:e.normalizeClass(["status-indicator absolute"])},null,4))]),e.createElementVNode("span",null,[e.createElementVNode("h1",f7,e.toDisplayString(c.name),1),e.createElementVNode("p",{style:e.normalizeStyle(s(c.login_status,(f=c==null?void 0:c.participants)==null?void 0:f.length).textStyle),class:"atendente-name"},[e.createElementVNode("a",p7,e.toDisplayString(s(c.login_status,(h=c==null?void 0:c.participants)==null?void 0:h.length).label),1)],4)])]),e.createElementVNode("footer",h7,[c.internal_chat.unread>0?(e.openBlock(),e.createElementBlock("span",g7,e.toDisplayString(c.internal_chat.unread),1)):e.createCommentVNode("",!0)]),u[4]||(u[4]=e.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,s7)}),128)),a.value&&t.content.length>0?(e.openBlock(),e.createBlock(e.unref(Yt),{key:1,onInfinite:i,distance:30,class:"p-3"},{complete:e.withCtx(()=>[...u[5]||(u[5]=[e.createElementVNode("span",null,null,-1)])]),spinner:e.withCtx(()=>[...u[6]||(u[6]=[e.createElementVNode("div",{class:"loading"},[e.createElementVNode("svg",{class:"spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})])],-1)])]),_:1})):e.createCommentVNode("",!0)]),!t.loader&&a.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"create-group-button bg-base-300 hover:bg-primary border-primary text-primary",onClick:u[0]||(u[0]=c=>r()),"aria-label":"Criar grupo"},[...u[7]||(u[7]=[e.createElementVNode("span",{class:"create-group-label"},"Criar grupo",-1),e.createElementVNode("span",{class:"create-group-icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"size-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15 14",fill:"currentColor"},[e.createElementVNode("path",{d:"M11 7.99951C12.6568 7.99951 13.9998 9.3428 14 10.9995C14 12.6564 12.6569 13.9995 11 13.9995C9.3431 13.9995 8 12.6564 8 10.9995C8.00022 9.3428 9.34323 7.99951 11 7.99951ZM11 9.42725C10.9204 9.42725 10.8443 9.45888 10.7881 9.51514C10.7318 9.5714 10.7002 9.64749 10.7002 9.72705V10.6997H9.72754C9.64797 10.6997 9.57091 10.7313 9.51465 10.7876C9.45852 10.8438 9.42686 10.9201 9.42676 10.9995C9.42676 11.0791 9.45839 11.1561 9.51465 11.2124C9.57091 11.2687 9.64798 11.3003 9.72754 11.3003H10.7002V12.2729C10.7002 12.3525 10.7319 12.4286 10.7881 12.4849C10.8443 12.5411 10.9205 12.5728 11 12.5728C11.0795 12.5728 11.1557 12.5411 11.2119 12.4849C11.2681 12.4286 11.2998 12.3525 11.2998 12.2729V11.3003H12.2725C12.352 11.3003 12.4291 11.2687 12.4854 11.2124C12.5416 11.1561 12.5732 11.0791 12.5732 10.9995C12.5731 10.9201 12.5415 10.8438 12.4854 10.7876C12.4291 10.7313 12.352 10.6997 12.2725 10.6997H11.2998V9.72705C11.2998 9.64749 11.2682 9.5714 11.2119 9.51514C11.1557 9.45888 11.0796 9.42725 11 9.42725ZM8.625 7.50049C8.75546 7.50049 8.88472 7.51114 9.0127 7.52783C7.81025 8.21758 7.00015 9.51391 7 10.9995C7.00001 11.3446 7.04378 11.68 7.12598 11.9995H4.875C4.47733 11.9995 4.09573 11.8421 3.81445 11.561C3.53317 11.2798 3.37502 10.8973 3.375 10.4995C3.37513 9.7041 3.69144 8.94088 4.25391 8.37842C4.81649 7.81602 5.57949 7.50049 6.375 7.50049H8.625ZM3.8252 6.00049C3.92718 6.20013 4.04571 6.39131 4.17871 6.57178C3.47999 6.96241 2.89804 7.53261 2.49316 8.22314C2.0884 8.91353 1.87473 9.69923 1.875 10.4995H1.5C1.10231 10.4995 0.720731 10.3422 0.439453 10.061C0.158267 9.77986 0.000133157 9.39811 0 9.00049C0 8.2049 0.316324 7.44099 0.878906 6.87842C1.44148 6.31605 2.20451 6.00049 3 6.00049H3.8252ZM12 6.00049C12.7955 6.00049 13.5585 6.31605 14.1211 6.87842C14.6837 7.44099 15 8.2049 15 9.00049C14.9999 9.26491 14.9283 9.52124 14.7988 9.74658C14.3222 8.30098 13.0442 7.22072 11.4902 7.03076C11.2822 6.85894 11.0587 6.7045 10.8213 6.57178C10.9543 6.39131 11.0728 6.20013 11.1748 6.00049H12ZM7.5 1.50049C8.19619 1.50049 8.86416 1.77679 9.35645 2.26904C9.84868 2.76129 10.125 3.42937 10.125 4.12549C10.1249 4.82139 9.84845 5.48879 9.35645 5.98096C8.86417 6.47319 8.19617 6.75049 7.5 6.75049C7.15529 6.75049 6.81359 6.6822 6.49512 6.55029C6.17678 6.41839 5.88722 6.2246 5.64355 5.98096C5.39999 5.73731 5.20705 5.44767 5.0752 5.12939C4.94337 4.81107 4.87503 4.47002 4.875 4.12549C4.875 3.78081 4.9433 3.43905 5.0752 3.12061C5.2071 2.80231 5.39992 2.51268 5.64355 2.26904C5.88719 2.02542 6.17682 1.83259 6.49512 1.70068C6.8136 1.56877 7.15528 1.50049 7.5 1.50049ZM4.27539 0.00439453C4.75237 0.0318198 5.21314 0.188708 5.60742 0.458496C4.77299 0.888977 4.11076 1.5917 3.72949 2.44971C3.34824 3.3078 3.27087 4.2704 3.51074 5.17822C2.93768 5.04016 2.42723 4.71353 2.0625 4.25049C1.69784 3.78747 1.49997 3.21485 1.5 2.62549C1.49989 2.14763 1.63021 1.67828 1.87695 1.26904C2.12371 0.859923 2.47779 0.526133 2.90039 0.303223C3.32301 0.0803171 3.79837 -0.0229799 4.27539 0.00439453ZM10.4512 0.0356445C10.8309 -0.0261991 11.2197 -0.00395918 11.5898 0.101074C11.96 0.206149 12.3031 0.39091 12.5938 0.643066C12.8844 0.895214 13.1162 1.20846 13.2725 1.56006C13.4287 1.91163 13.5057 2.29359 13.498 2.67822C13.4904 3.06286 13.3976 3.44154 13.2275 3.78662C13.0575 4.1315 12.8139 4.43501 12.5137 4.67529C12.2136 4.91544 11.8638 5.0859 11.4902 5.17627C11.728 4.26901 11.6504 3.3078 11.2695 2.45068C10.8883 1.59293 10.2262 0.889932 9.39258 0.458496C9.71014 0.241574 10.0716 0.0974964 10.4512 0.0356445Z",fill:"currentColor"})])],-1)])])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-733aecb4"]]),k7={class:"attendants-container"},b7={key:0,class:"chat-footer bg-base-200 flex justify-end"},x7=ke({__name:"ChatList",props:{listAttendants:{type:Array,default:()=>[],required:!0},listGroups:{type:Array,default:()=>[],required:!0},currentAttendant:{type:Object,required:!0},mobile:{type:Boolean,default:!1},currentList:{type:String,default:void 0},searchQuery:{type:String,default:void 0}},emits:["update:currentList","update:searchQuery"],setup(t,{emit:n}){const a=t,o=e.inject("useChat"),r=n,l=e.ref(a.currentList??"atendentes"),s=e.computed({get(){return a.currentList??l.value},set(B){if(a.currentList===void 0){l.value=B;return}r("update:currentList",B)}}),i=e.ref(a.searchQuery??""),d=e.computed({get(){return a.searchQuery??i.value},set(B){if(a.searchQuery===void 0){i.value=B;return}r("update:searchQuery",B)}}),u=e.computed(()=>d.value?a.listAttendants.filter(B=>B.name.toLowerCase().includes(d.value.toLowerCase())&&B.id!==a.currentAttendant.id):a.listAttendants.filter(B=>B.id!==a.currentAttendant.id)),c=e.computed(()=>(a.listGroups||[]).filter(B=>B==null?void 0:B.is_group));e.watch(()=>s.value,async B=>{d.value="";const b=B==="grupos",x=!a.mobile;b&&await f()});const m=e.ref(!1),f=async(B="")=>{typeof o.fetchGroupChannels=="function"&&(m.value=!0,await o.fetchGroupChannels(1,B),m.value=!1)};let h=null;e.watch(()=>d.value,B=>{s.value==="grupos"&&(h&&clearTimeout(h),h=setTimeout(()=>{f(B.trim())},400))}),e.onBeforeUnmount(()=>{h&&clearTimeout(h)});const p=e.computed(()=>(a.listAttendants||[]).filter(B=>{var b;return B.id!==((b=a.currentAttendant)==null?void 0:b.id)}).reduce((B,b)=>{var x;return B+(Number((x=b==null?void 0:b.internal_chat)==null?void 0:x.unread)||0)},0)),g=e.computed(()=>(a.listGroups||[]).filter(B=>B.is_group).reduce((B,b)=>{var x;return B+(Number((x=b==null?void 0:b.internal_chat)==null?void 0:x.unread)||0)},0)),y=e.computed(()=>p.value>0),k=e.computed(()=>g.value>0);return(B,b)=>(e.openBlock(),e.createElementBlock("div",k7,[e.createVNode(q6,{hasUnread:{atendentes:y.value,grupos:k.value},currentState:s.value,"onUpdate:currentState":b[0]||(b[0]=x=>s.value=x),searchQuery:d.value,"onUpdate:searchQuery":b[1]||(b[1]=x=>d.value=x)},null,8,["hasUnread","currentState","searchQuery"]),e.createVNode(y7,{content:s.value==="atendentes"?u.value:c.value,mode:s.value,loader:m.value},null,8,["content","mode","loader"]),t.mobile?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",b7))]))}},[["__scopeId","data-v-69e392ac"]]);function w7(t,n,a){const o=ft(t,a==null?void 0:a.in);return isNaN(n)?ut(t,NaN):(o.setDate(o.getDate()+n),o)}function oa(t,n){return Zt(t,{...n,weekStartsOn:1})}function sl(t,n){const a=ft(t,n==null?void 0:n.in),o=a.getFullYear(),r=ut(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const l=oa(r),s=ut(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const i=oa(s);return a.getTime()>=l.getTime()?o+1:a.getTime()>=i.getTime()?o:o-1}function il(t){const n=ft(t),a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),+t-+a}function ra(t,n){const a=ft(t,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function E7(t,n,a){const[o,r]=Wa(a==null?void 0:a.in,t,n),l=ra(o),s=ra(r),i=+l-il(l),d=+s-il(s);return Math.round((i-d)/nd)}function C7(t,n){const a=sl(t,n),o=ut(t,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),oa(o)}function Ja(t){return ut(t,Date.now())}function cl(t,n,a){const[o,r]=Wa(a==null?void 0:a.in,t,n);return+ra(o)==+ra(r)}function B7(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function v7(t){return!(!B7(t)&&typeof t!="number"||isNaN(+ft(t)))}function V7(t,n){const a=ft(t,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function S7(t,n){const a=ft(t,n==null?void 0:n.in);return E7(a,V7(a))+1}function N7(t,n){const a=ft(t,n==null?void 0:n.in),o=+oa(a)-+C7(a);return Math.round(o/Wr)+1}function dl(t,n){var c,m,f,h;const a=ft(t,n==null?void 0:n.in),o=a.getFullYear(),r=Qn(),l=(n==null?void 0:n.firstWeekContainsDate)??((m=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=ut((n==null?void 0:n.in)||t,0);s.setFullYear(o+1,0,l),s.setHours(0,0,0,0);const i=Zt(s,n),d=ut((n==null?void 0:n.in)||t,0);d.setFullYear(o,0,l),d.setHours(0,0,0,0);const u=Zt(d,n);return+a>=+i?o+1:+a>=+u?o:o-1}function M7(t,n){var i,d,u,c;const a=Qn(),o=(n==null?void 0:n.firstWeekContainsDate)??((d=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,r=dl(t,n),l=ut((n==null?void 0:n.in)||t,0);return l.setFullYear(r,0,o),l.setHours(0,0,0,0),Zt(l,n)}function A7(t,n){const a=ft(t,n==null?void 0:n.in),o=+Zt(a,n)-+M7(a,n);return Math.round(o/Wr)+1}function Re(t,n){const a=t<0?"-":"",o=Math.abs(t).toString().padStart(n,"0");return a+o}const Tt={y(t,n){const a=t.getFullYear(),o=a>0?a:1-a;return Re(n==="yy"?o%100:o,n.length)},M(t,n){const a=t.getMonth();return n==="M"?String(a+1):Re(a+1,2)},d(t,n){return Re(t.getDate(),n.length)},a(t,n){const a=t.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(t,n){return Re(t.getHours()%12||12,n.length)},H(t,n){return Re(t.getHours(),n.length)},m(t,n){return Re(t.getMinutes(),n.length)},s(t,n){return Re(t.getSeconds(),n.length)},S(t,n){const a=n.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return Re(r,n.length)}},un={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ul={G:function(t,n,a){const o=t.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(t,n,a){if(n==="yo"){const o=t.getFullYear(),r=o>0?o:1-o;return a.ordinalNumber(r,{unit:"year"})}return Tt.y(t,n)},Y:function(t,n,a,o){const r=dl(t,o),l=r>0?r:1-r;if(n==="YY"){const s=l%100;return Re(s,2)}return n==="Yo"?a.ordinalNumber(l,{unit:"year"}):Re(l,n.length)},R:function(t,n){const a=sl(t);return Re(a,n.length)},u:function(t,n){const a=t.getFullYear();return Re(a,n.length)},Q:function(t,n,a){const o=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return Re(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(t,n,a){const o=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return Re(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(t,n,a){const o=t.getMonth();switch(n){case"M":case"MM":return Tt.M(t,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(t,n,a){const o=t.getMonth();switch(n){case"L":return String(o+1);case"LL":return Re(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(t,n,a,o){const r=A7(t,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):Re(r,n.length)},I:function(t,n,a){const o=N7(t);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):Re(o,n.length)},d:function(t,n,a){return n==="do"?a.ordinalNumber(t.getDate(),{unit:"date"}):Tt.d(t,n)},D:function(t,n,a){const o=S7(t);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):Re(o,n.length)},E:function(t,n,a){const o=t.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(t,n,a,o){const r=t.getDay(),l=(r-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(l);case"ee":return Re(l,2);case"eo":return a.ordinalNumber(l,{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(t,n,a,o){const r=t.getDay(),l=(r-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(l);case"cc":return Re(l,n.length);case"co":return a.ordinalNumber(l,{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(t,n,a){const o=t.getDay(),r=o===0?7:o;switch(n){case"i":return String(r);case"ii":return Re(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(t,n,a){const r=t.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(t,n,a){const o=t.getHours();let r;switch(o===12?r=un.noon:o===0?r=un.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(t,n,a){const o=t.getHours();let r;switch(o>=17?r=un.evening:o>=12?r=un.afternoon:o>=4?r=un.morning:r=un.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(t,n,a){if(n==="ho"){let o=t.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return Tt.h(t,n)},H:function(t,n,a){return n==="Ho"?a.ordinalNumber(t.getHours(),{unit:"hour"}):Tt.H(t,n)},K:function(t,n,a){const o=t.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):Re(o,n.length)},k:function(t,n,a){let o=t.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):Re(o,n.length)},m:function(t,n,a){return n==="mo"?a.ordinalNumber(t.getMinutes(),{unit:"minute"}):Tt.m(t,n)},s:function(t,n,a){return n==="so"?a.ordinalNumber(t.getSeconds(),{unit:"second"}):Tt.s(t,n)},S:function(t,n){return Tt.S(t,n)},X:function(t,n,a){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return fl(o);case"XXXX":case"XX":return Xt(o);case"XXXXX":case"XXX":default:return Xt(o,":")}},x:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"x":return fl(o);case"xxxx":case"xx":return Xt(o);case"xxxxx":case"xxx":default:return Xt(o,":")}},O:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+ml(o,":");case"OOOO":default:return"GMT"+Xt(o,":")}},z:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+ml(o,":");case"zzzz":default:return"GMT"+Xt(o,":")}},t:function(t,n,a){const o=Math.trunc(+t/1e3);return Re(o,n.length)},T:function(t,n,a){return Re(+t,n.length)}};function ml(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),l=o%60;return l===0?a+String(r):a+String(r)+n+Re(l,2)}function fl(t,n){return t%60===0?(t>0?"-":"+")+Re(Math.abs(t)/60,2):Xt(t,n)}function Xt(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Re(Math.trunc(o/60),2),l=Re(o%60,2);return a+r+n+l}const pl=(t,n)=>{switch(t){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"})}},hl=(t,n)=>{switch(t){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"})}},$7={p:hl,P:(t,n)=>{const a=t.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return pl(t,n);let l;switch(o){case"P":l=n.dateTime({width:"short"});break;case"PP":l=n.dateTime({width:"medium"});break;case"PPP":l=n.dateTime({width:"long"});break;case"PPPP":default:l=n.dateTime({width:"full"});break}return l.replace("{{date}}",pl(o,n)).replace("{{time}}",hl(r,n))}},_7=/^D+$/,D7=/^Y+$/,T7=["D","DD","YY","YYYY"];function L7(t){return _7.test(t)}function F7(t){return D7.test(t)}function P7(t,n,a){const o=z7(t,n,a);if(console.warn(o),T7.includes(t))throw new RangeError(o)}function z7(t,n,a){const o=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const O7=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,R7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,H7=/^'([^]*?)'?$/,j7=/''/g,G7=/[a-zA-Z]/;function gl(t,n,a){var c,m,f,h,p,g,y,k;const o=Qn(),r=(a==null?void 0:a.locale)??o.locale??Dd,l=(a==null?void 0:a.firstWeekContainsDate)??((m=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:m.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(p=a==null?void 0:a.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((k=(y=o.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,i=ft(t,a==null?void 0:a.in);if(!v7(i))throw new RangeError("Invalid time value");let d=n.match(R7).map(B=>{const b=B[0];if(b==="p"||b==="P"){const x=$7[b];return x(B,r.formatLong)}return B}).join("").match(O7).map(B=>{if(B==="''")return{isToken:!1,value:"'"};const b=B[0];if(b==="'")return{isToken:!1,value:I7(B)};if(ul[b])return{isToken:!0,value:B};if(b.match(G7))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:B}});r.localize.preprocessor&&(d=r.localize.preprocessor(i,d));const u={firstWeekContainsDate:l,weekStartsOn:s,locale:r};return d.map(B=>{if(!B.isToken)return B.value;const b=B.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&F7(b)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&L7(b))&&P7(b,n,String(t));const x=ul[b[0]];return x(i,b,r.localize,u)}).join("")}function I7(t){const n=t.match(H7);return n?n[1].replace(j7,"'"):t}function q7(t,n){return od(ut(t,t),Ja(t),n)}function W7(t,n){return cl(ut(t,t),Ja(t))}function U7(t,n,a){return w7(t,-1,a)}function Z7(t,n){return cl(ut(t,t),U7(Ja(t)))}const Y7={class:"absolute right-0 top-0 z-20 flex size-full flex-col gap-2 overflow-hidden rounded-md bg-base-200"},X7={class:"flex items-center"},Q7={class:"flex w-full shrink-0 flex-col items-center gap-1.5"},K7={class:"text-lg font-normal"},J7={class:"text-sm font-sans text-gray-500"},eu={class:"text-primary"},tu={class:"text-sm font-sans text-gray-500"},nu={class:"flex min-h-0 flex-1 flex-col"},au={class:"min-h-0 flex-1 overflow-y-auto"},ou={class:"relative"},ru=["aria-disabled"],lu={class:"flex w-full items-center justify-between"},su={class:"flex items-center gap-2"},iu=["disabled","onClick","onMouseenter","onFocus"],cu={key:0,class:"flex gap-1 m-1"},du=["disabled"],uu=["disabled"],mu={key:0,class:"loader-sm"},fu={key:1},pu=ke({__name:"groupChatInfo",props:{selectedAttendant:{type:Object,required:!0},attendant:{type:Object,required:!0},participantsGroup:{type:Array,default:()=>[]},participantCount:{type:Number,default:0}},emits:["close"],setup(t,{emit:n}){const a=t,o=n,r=e.inject("useChat"),l=()=>{x.value&&typeof r.openCreateOrEdit=="function"&&r.openCreateOrEdit("edit",a.selectedAttendant)},s=async L=>{var A,M,S;L&&L.id!==((A=a.attendant)==null?void 0:A.id)&&typeof r.removeGroupParticipant=="function"&&await r.removeGroupParticipant((S=(M=a.selectedAttendant)==null?void 0:M.internal_chat)==null?void 0:S.channel_id,L.id)},i=e.ref(!1),d=e.ref(!1),u=e.ref(null),c=e.ref(!1),m=e.ref({}),f=e.ref(""),h=()=>{if(!u.value)return;const L=u.value.getBoundingClientRect(),A=240,M=8,S=Math.max(M,window.innerWidth-A-M),N=Math.min(Math.max(M,L.right+M),S),w=L.top+L.height/2;m.value={left:`${N}px`,top:`${w}px`}},p=async(L,A)=>{A&&(u.value=L.currentTarget,f.value=A,c.value=!0,await e.nextTick(),h())},g=()=>{c.value=!1,u.value=null,f.value=""},y=()=>{c.value&&h()},k=()=>{d.value=!0},B=()=>{d.value=!1},b=async()=>{var M,S;i.value=!0;const L=(S=(M=a.selectedAttendant)==null?void 0:M.internal_chat)==null?void 0:S.channel_id;if(!L||typeof r.leaveGroup!="function")return;if(!await r.leaveGroup(L)){i.value=!1,B();return}o("close"),typeof r.closeSelectedChat=="function"&&r.closeSelectedChat(),i.value=!1,B()},x=e.computed(()=>a.selectedAttendant.group_created_by===a.attendant.id),v=e.computed(()=>{const L=a.participantsGroup.find(A=>a.selectedAttendant.group_created_by===A.id);return L?L.name:"Desconhecido"}),_=e.computed(()=>x.value?"":`Você não é o administrador do grupo. Somente ${v.value} pode ajustar os membros.`),R=L=>{var A;return(L==null?void 0:L.id)===((A=a.attendant)==null?void 0:A.id)?"Você não pode remover a si mesmo do grupo.":x.value?"":`Você não é o administrador do grupo. Somente ${v.value} pode remover membros.`};return e.onMounted(()=>{window.addEventListener("resize",y),window.addEventListener("scroll",y,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",y),window.removeEventListener("scroll",y,!0)}),(L,A)=>(e.openBlock(),e.createElementBlock("span",Y7,[e.createElementVNode("span",X7,[e.createElementVNode("button",{class:"p-2",onClick:A[0]||(A[0]=M=>o("close"))},[...A[3]||(A[3]=[e.createElementVNode("svg",{class:"size-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M14.502 7.046h-2.5v-.928a2.122 2.122 0 0 0-1.199-1.954 1.827 1.827 0 0 0-1.984.311L3.71 8.965a2.2 2.2 0 0 0 0 3.24L8.82 16.7a1.829 1.829 0 0 0 1.985.31 2.121 2.121 0 0 0 1.199-1.959v-.928h1a2.025 2.025 0 0 1 1.999 2.047V19a1 1 0 0 0 1.275.961 6.59 6.59 0 0 0 4.662-7.22 6.593 6.593 0 0 0-6.437-5.695Z"})],-1)])]),A[4]||(A[4]=e.createElementVNode("p",{class:"text-sm font-medium"},"Informações do grupo",-1))]),e.createElementVNode("div",Q7,[e.createVNode(Dt,{style:"size-24",url:t.selectedAttendant.photo},{default:e.withCtx(()=>[...A[5]||(A[5]=[e.createElementVNode("svg",{class:"size-24","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 6a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm-1.5 8a4 4 0 0 0-4 4 2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-3Zm6.82-3.096a5.51 5.51 0 0 0-2.797-6.293 3.5 3.5 0 1 1 2.796 6.292ZM19.5 18h.5a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-1.1a5.503 5.503 0 0 1-.471.762A5.998 5.998 0 0 1 19.5 18ZM4 7.5a3.5 3.5 0 0 1 5.477-2.889 5.5 5.5 0 0 0-2.796 6.293A3.501 3.501 0 0 1 4 7.5ZM7.1 12H6a4 4 0 0 0-4 4 2 2 0 0 0 2 2h.5a5.998 5.998 0 0 1 3.071-5.238A5.505 5.505 0 0 1 7.1 12Z","clip-rule":"evenodd"})],-1)])]),_:1},8,["url"]),e.createElementVNode("h1",K7,e.toDisplayString(t.selectedAttendant.name),1),e.createElementVNode("h2",J7,[A[6]||(A[6]=e.createTextVNode(" Grupo • ",-1)),e.createElementVNode("a",eu,e.toDisplayString(t.participantCount)+" membros",1)]),e.createElementVNode("h3",tu," Criado por "+e.toDisplayString(v.value)+", 10/09/1998 ",1)]),e.createElementVNode("div",nu,[e.createElementVNode("div",au,[e.createElementVNode("li",ou,[e.createElementVNode("button",{"aria-disabled":!x.value,class:e.normalizeClass(["bg-base-100 flex w-full items-center gap-2 p-2 text-left hover:bg-gray-800 hover:text-primary",!x.value&&"cursor-not-allowed opacity-70"]),onClick:l,onMouseenter:A[1]||(A[1]=M=>p(M,_.value)),onMouseleave:g,onFocus:A[2]||(A[2]=M=>p(M,_.value)),onBlur:g},[...A[7]||(A[7]=[e.createElementVNode("span",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"bg-base-300 size-10 rounded-full flex items-center justify-center"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15 14",fill:"currentColor",class:"size-5"},[e.createElementVNode("path",{d:"M11 7.99951C12.6568 7.99951 13.9998 9.3428 14 10.9995C14 12.6564 12.6569 13.9995 11 13.9995C9.3431 13.9995 8 12.6564 8 10.9995C8.00022 9.3428 9.34323 7.99951 11 7.99951ZM11 9.42725C10.9204 9.42725 10.8443 9.45888 10.7881 9.51514C10.7318 9.5714 10.7002 9.64749 10.7002 9.72705V10.6997H9.72754C9.64797 10.6997 9.57091 10.7313 9.51465 10.7876C9.45852 10.8438 9.42686 10.9201 9.42676 10.9995C9.42676 11.0791 9.45839 11.1561 9.51465 11.2124C9.57091 11.2687 9.64798 11.3003 9.72754 11.3003H10.7002V12.2729C10.7002 12.3525 10.7319 12.4286 10.7881 12.4849C10.8443 12.5411 10.9205 12.5728 11 12.5728C11.0795 12.5728 11.1557 12.5411 11.2119 12.4849C11.2681 12.4286 11.2998 12.3525 11.2998 12.2729V11.3003H12.2725C12.352 11.3003 12.4291 11.2687 12.4854 11.2124C12.5416 11.1561 12.5732 11.0791 12.5732 10.9995C12.5731 10.9201 12.5415 10.8438 12.4854 10.7876C12.4291 10.7313 12.352 10.6997 12.2725 10.6997H11.2998V9.72705C11.2998 9.64749 11.2682 9.5714 11.2119 9.51514C11.1557 9.45888 11.0796 9.42725 11 9.42725ZM8.625 7.50049C8.75546 7.50049 8.88472 7.51114 9.0127 7.52783C7.81025 8.21758 7.00015 9.51391 7 10.9995C7.00001 11.3446 7.04378 11.68 7.12598 11.9995H4.875C4.47733 11.9995 4.09573 11.8421 3.81445 11.561C3.53317 11.2798 3.37502 10.8973 3.375 10.4995C3.37513 9.7041 3.69144 8.94088 4.25391 8.37842C4.81649 7.81602 5.57949 7.50049 6.375 7.50049H8.625ZM3.8252 6.00049C3.92718 6.20013 4.04571 6.39131 4.17871 6.57178C3.47999 6.96241 2.89804 7.53261 2.49316 8.22314C2.0884 8.91353 1.87473 9.69923 1.875 10.4995H1.5C1.10231 10.4995 0.720731 10.3422 0.439453 10.061C0.158267 9.77986 0.000133157 9.39811 0 9.00049C0 8.2049 0.316324 7.44099 0.878906 6.87842C1.44148 6.31605 2.20451 6.00049 3 6.00049H3.8252ZM12 6.00049C12.7955 6.00049 13.5585 6.31605 14.1211 6.87842C14.6837 7.44099 15 8.2049 15 9.00049C14.9999 9.26491 14.9283 9.52124 14.7988 9.74658C14.3222 8.30098 13.0442 7.22072 11.4902 7.03076C11.2822 6.85894 11.0587 6.7045 10.8213 6.57178C10.9543 6.39131 11.0728 6.20013 11.1748 6.00049H12ZM7.5 1.50049C8.19619 1.50049 8.86416 1.77679 9.35645 2.26904C9.84868 2.76129 10.125 3.42937 10.125 4.12549C10.1249 4.82139 9.84845 5.48879 9.35645 5.98096C8.86417 6.47319 8.19617 6.75049 7.5 6.75049C7.15529 6.75049 6.81359 6.6822 6.49512 6.55029C6.17678 6.41839 5.88722 6.2246 5.64355 5.98096C5.39999 5.73731 5.20705 5.44767 5.0752 5.12939C4.94337 4.81107 4.87503 4.47002 4.875 4.12549C4.875 3.78081 4.9433 3.43905 5.0752 3.12061C5.2071 2.80231 5.39992 2.51268 5.64355 2.26904C5.88719 2.02542 6.17682 1.83259 6.49512 1.70068C6.8136 1.56877 7.15528 1.50049 7.5 1.50049ZM4.27539 0.00439453C4.75237 0.0318198 5.21314 0.188708 5.60742 0.458496C4.77299 0.888977 4.11076 1.5917 3.72949 2.44971C3.34824 3.3078 3.27087 4.2704 3.51074 5.17822C2.93768 5.04016 2.42723 4.71353 2.0625 4.25049C1.69784 3.78747 1.49997 3.21485 1.5 2.62549C1.49989 2.14763 1.63021 1.67828 1.87695 1.26904C2.12371 0.859923 2.47779 0.526133 2.90039 0.303223C3.32301 0.0803171 3.79837 -0.0229799 4.27539 0.00439453ZM10.4512 0.0356445C10.8309 -0.0261991 11.2197 -0.00395918 11.5898 0.101074C11.96 0.206149 12.3031 0.39091 12.5938 0.643066C12.8844 0.895214 13.1162 1.20846 13.2725 1.56006C13.4287 1.91163 13.5057 2.29359 13.498 2.67822C13.4904 3.06286 13.3976 3.44154 13.2275 3.78662C13.0575 4.1315 12.8139 4.43501 12.5137 4.67529C12.2136 4.91544 11.8638 5.0859 11.4902 5.17627C11.728 4.26901 11.6504 3.3078 11.2695 2.45068C10.8883 1.59293 10.2262 0.889932 9.39258 0.458496C9.71014 0.241574 10.0716 0.0974964 10.4512 0.0356445Z",fill:"currentColor"})])]),e.createElementVNode("p",null,"Ajustar membros do grupo")],-1)])],42,ru)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.participantsGroup,M=>(e.openBlock(),e.createElementBlock("li",{key:M.id,class:"bg-base-100 flex items-center gap-2 p-2 even:bg-base-300"},[e.createElementVNode("div",lu,[e.createElementVNode("span",su,[e.createVNode(Dt,{url:M.photo},null,8,["url"]),e.createElementVNode("p",null,e.toDisplayString(M.name),1)]),e.createElementVNode("button",{class:e.normalizeClass(["rounded-md p-0.5 text-sm w-20",M.id===t.attendant.id?"bg-primary hover:bg-primary":"bg-red-500 hover:bg-red-800"]),disabled:!x.value,onClick:S=>s(M),onMouseenter:S=>p(S,R(M)),onMouseleave:g,onFocus:S=>p(S,R(M)),onBlur:g},e.toDisplayString(M.id===t.attendant.id?"Eu":"Remover"),43,iu)])]))),128))])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[c.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"pointer-events-none fixed z-[9999] w-60 -translate-y-1/2 rounded-md bg-base-300 p-2 text-center text-sm text-gray-500 shadow-lg",style:e.normalizeStyle(m.value)},[e.createElementVNode("p",null,e.toDisplayString(f.value),1)],4)):e.createCommentVNode("",!0)])),d.value?(e.openBlock(),e.createElementBlock("div",cu,[e.createElementVNode("button",{class:"flex-1 rounded-lg bg-base-300 hover:bg-base-100 p-1 h-10 flex items-center justify-center text-sm font-medium",onClick:B,disabled:i.value}," Cancelar ",8,du),e.createElementVNode("button",{class:"flex-1 rounded-lg bg-red-600 hover:bg-red-700 p-1 h-10 flex items-center justify-center text-sm font-semibold",onClick:b,disabled:i.value},[i.value?(e.openBlock(),e.createElementBlock("div",mu)):(e.openBlock(),e.createElementBlock("span",fu,"Confirmar saída"))],8,uu)])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"rounded-lg bg-base-100 p-1 h-10 flex items-center justify-center m-1 hover:bg-red-700",onClick:k},[...A[8]||(A[8]=[e.createElementVNode("p",{class:"text-sm font-semibold"},"Sair do grupo",-1)])]))]))}},[["__scopeId","data-v-09a2608b"]]);/*! License details at fancyapps.com/license */const Oe=t=>typeof t=="string";/*! License details at fancyapps.com/license */const mn=t=>t&&t!==null&&t instanceof Element&&"nodeType"in t;/*! License details at fancyapps.com/license */const hu=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const n=t.scrollHeight>t.clientHeight,a=window.getComputedStyle(t).overflowY,o=a.indexOf("hidden")!==-1,r=a.indexOf("visible")!==-1;return n&&!o&&!r},Qt=function(t,n=void 0){return!t||t===document.body||n&&t===n?null:hu(t)?t:Qt(t.parentElement,n)};/*! License details at fancyapps.com/license */const Vt=function(t){var n=new DOMParser().parseFromString(t,"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 Fe=function(t=0,n=0,a=0){return Math.max(Math.min(n,a),t)};/*! License details at fancyapps.com/license */const Qe=t=>typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]";/*! License details at fancyapps.com/license */function yl(t){return Qe(t)||Array.isArray(t)}function vn(t,n){const a=Object.keys(t),o=Object.keys(n);return a.length===o.length&&a.every(r=>{const l=t[r],s=n[r];return typeof l=="function"?`${l}`==`${s}`:yl(l)&&yl(s)?vn(l,s):l===s})}/*! License details at fancyapps.com/license */const kl=function(t){for(const n of la)n.getState()===nt.Running&&n.tick(eo?t-eo:0);eo=t,pn=window.requestAnimationFrame(kl)};var nt,Lt,fn;(function(t){t[t.Initializing=0]="Initializing",t[t.Running=1]="Running",t[t.Paused=2]="Paused",t[t.Completed=3]="Completed",t[t.Destroyed=4]="Destroyed"})(nt||(nt={})),function(t){t[t.Spring=0]="Spring",t[t.Ease=1]="Ease"}(Lt||(Lt={})),function(t){t[t.Loop=0]="Loop",t[t.Reverse=1]="Reverse"}(fn||(fn={}));const la=new Set;let pn=null,eo=0;function Ft(){let t=nt.Initializing,n=Lt.Ease,a=0,o=0,r=Ft.Easings.Linear,l=500,s=0,i=0,d=0,u=0,c=1/0,m=.01,f=.01,h=!1,p={},g=null,y={},k={},B={},b=0,x=0,v=fn.Loop,_=Ft.Easings.Linear;const R=new Map;function L(w,...C){for(const O of R.get(w)||[])O(...C)}function A(w){return o=0,w?g=setTimeout(()=>{M()},w):M(),N}function M(){t=nt.Running,L("start",y,k)}function S(){if(t=nt.Completed,B={},L("end",y),t===nt.Completed)if(a<b){if(a++,v===fn.Reverse){const w=Object.assign({},p);p=Object.assign({},k),k=w}A(x)}else a=0;return N}const N={getState:function(){return t},easing:function(w){return r=w,n=Lt.Ease,B={},N},duration:function(w){return l=w,N},spring:function(w={}){n=Lt.Spring;const C={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:O,mass:T,tension:V,friction:E,restDelta:$,restSpeed:D,maxSpeed:F,clamp:G}=Object.assign(Object.assign({},C),w);return s=O,i=T,d=V,u=E,f=$,m=D,c=F,h=G,B={},N},isRunning:function(){return t===nt.Running},isSpring:function(){return n===Lt.Spring},from:function(w){return y=Object.assign({},w),N},to:function(w){return k=w,N},repeat:function(w,C=0,O=fn.Loop,T){return b=w,x=C,v=O,_=T||r,N},on:function(w,C){var O,T;return O=w,T=C,R.set(O,[...R.get(O)||[],T]),N},off:function(w,C){var O,T;return O=w,T=C,R.has(O)&&R.set(O,R.get(O).filter(V=>V!==T)),N},start:function(w){return vn(y,k)||(t=nt.Initializing,p=Object.assign({},y),la.add(this),pn||(pn=window.requestAnimationFrame(kl)),A(w)),N},pause:function(){return g&&(clearTimeout(g),g=null),t===nt.Running&&(t=nt.Paused,L("pause",y)),N},end:S,tick:function(w){w>50&&(w=50),o+=w;let C=0,O=!1;if(t!==nt.Running)return N;if(n===Lt.Ease){C=Fe(0,o/l,1),O=C===1;const V=v===fn.Reverse?_:r;for(const E in y)y[E]=p[E]+(k[E]-p[E])*V(C)}if(n===Lt.Spring){const V=.001*w;let E=0;for(const $ in y){const D=k[$];let F=y[$];if(typeof D!="number"||isNaN(D)||typeof F!="number"||isNaN(F))continue;if(Math.abs(D-F)<=f){y[$]=D,B[$]=0;continue}B[$]||(typeof s=="object"&&typeof s[$]=="number"?B[$]=s[$]:B[$]=typeof s=="number"?s:0);let G=B[$];G=Fe(-1*Math.abs(c),G,Math.abs(c));const Q=G*i*u;G+=((F>D?-1:1)*(Math.abs(D-F)*d)-Q)/i*V,F+=G*V;const I=y[$]>D?F<D:F>D;let q=Math.abs(G)<m&&Math.abs(D-F)<=f;h&&I&&(q=!0),q?(F=D,G=0):E++,y[$]=F,B[$]=G}O=!E}const T=Object.assign({},k);return L("step",y,p,k,C),O&&t===nt.Running&&vn(k,T)&&(t=nt.Completed,S()),N},getStartValues:function(){return p},getCurrentValues:function(){return y},getCurrentVelocities:function(){return B},getEndValues:function(){return k},destroy:function(){t=nt.Destroyed,g&&(clearTimeout(g),g=null),p=y=k={},la.delete(this)}};return N}Ft.destroy=()=>{for(const t of la)t.destroy();pn&&(cancelAnimationFrame(pn),pn=null)},Ft.Easings={Linear:function(t){return t},EaseIn:function(t){return t===0?0:Math.pow(2,10*t-10)},EaseOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},EaseInOut:function(t){return t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}};/*! License details at fancyapps.com/license */function Vn(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}function to(t,n){const a=[],o=Vn(t)?t[n]:t instanceof MouseEvent&&(n==="changedTouches"||t.type!=="mouseup")?[t]:[];for(const r of o)a.push({x:r.clientX,y:r.clientY,ts:Date.now()});return a}function bl(t){return to(t,"touches")}function xl(t){return to(t,"targetTouches")}function wl(t){return to(t,"changedTouches")}function Pt(t){const n=t[0],a=t[1]||n;return{x:(n.x+a.x)/2,y:(n.y+a.y)/2,ts:a.ts}}function sa(t){const n=t[0],a=t[1]||t[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 El=t=>{t.cancelable&&t.preventDefault()},zt={passive:!1},gu={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let ia=!1,Sn=!0;const hn=(t,n)=>{let a,o,r,l=Object.assign(Object.assign({},gu),n),s=[],i=[],d=[],u=!1,c=!1,m=!1,f=!1,h=0,p=0,g=0,y=0,k=0,B=0,b=0,x=0,v=0,_=[],R=0,L=0;const A=new Map;function M($){const D=sa(i),F=sa(d),G=D&&F?D/F:0,Q=Math.abs(b)>Math.abs(x)?b:x,I={srcEvent:a,isPanRecognized:u,isSwipeRecognized:c,firstTouch:s,previousTouch:d,currentTouch:i,deltaX:g,deltaY:y,offsetX:k,offsetY:B,velocityX:b,velocityY:x,velocity:Q,angle:v,axis:r,scale:G,center:o};for(const q of A.get($)||[])q(I)}function S($){const D=Date.now();if(_=_.filter(F=>!F.ts||F.ts>D-100),$&&_.push($),b=0,x=0,_.length>3){const F=_[0],G=_[_.length-1];if(F&&G){const Q=G.x-F.x,I=G.y-F.y,q=F.ts&&G.ts?G.ts-F.ts:0;q>0&&(b=Math.abs(Q)>3?Q/(q/30):0,x=Math.abs(I)>3?I/(q/30):0)}}}function N($){if(typeof MouseEvent<"u"&&$ instanceof MouseEvent){if(ia)return}else ia=!0;const D=$.composedPath()[0],F=l.ignore.join(",");if(D.matches(F)||D.closest(F))return;if(typeof MouseEvent<"u"&&$ instanceof MouseEvent){if(!$.buttons||$.button!==0)return;El($)}$ instanceof MouseEvent&&(window.addEventListener("mousemove",w),window.addEventListener("mouseup",C)),window.addEventListener("blur",O),a=$,i=xl($),s=[...i],d=[],p=i.length,o=Pt(i),p===1&&(u=!1,c=!1,m=!1),p&&S(Pt(i));const G=Date.now(),Q=G-(h||G);f=Q>0&&Q<=250&&p===1,h=G,clearTimeout(R),M("start")}function w($){var D;if(!s.length||$.defaultPrevented)return;a=$,d=[...i],i=bl($);const F=Pt(d),G=Pt(bl($));if(S(G),p=i.length,o=G,d.length===i.length?(g=G.x-F.x,y=G.y-F.y):(g=0,y=0),s.length){const Q=Pt(s);k=G.x-Q.x,B=G.y-Q.y}if(i.length>1){const Q=sa(i),I=sa(d);Math.abs(Q-I)>=.1&&(m=!0,M("pinch"))}u||(u=Math.abs(k)>l.panThreshold||Math.abs(B)>l.panThreshold,u&&(Sn=!1,clearTimeout(L),L=0,v=Math.abs(180*Math.atan2(B,k)/Math.PI),r=v>45&&v<135?"y":"x",s=[...i],d=[...i],k=0,B=0,g=0,y=0,(D=window.getSelection())===null||D===void 0||D.removeAllRanges(),M("panstart"))),u&&(g||y)&&M("pan"),M("move")}function C($){if(a=$,!s.length)return;const D=xl($),F=wl($);if(p=D.length,o=Pt(F),F.length&&S(Pt(F)),d=[...i],i=[...D],s=[...D],p>0)M("end"),u=!1,c=!1,_=[];else{const G=l.swipeThreshold;(Math.abs(b)>G||Math.abs(x)>G)&&(c=!0),u&&M("panend"),c&&M("swipe"),u||c||m||(M("tap"),f?M("doubleTap"):R=setTimeout(function(){M("singleTap")},250)),M("end"),T()}}function O(){clearTimeout(R),T(),u&&M("panend"),M("end")}function T(){ia=!1,u=!1,c=!1,f=!1,p=0,_=[],i=[],d=[],s=[],g=0,y=0,k=0,B=0,b=0,x=0,v=0,r=void 0,window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",C),window.removeEventListener("blur",O),Sn||L||(L=setTimeout(()=>{Sn=!0,L=0},100))}function V($){const D=$.target;ia=!1,D&&!$.defaultPrevented&&(Sn||(El($),$.stopPropagation()))}const E={init:function(){return t&&(t.addEventListener("click",V,zt),t.addEventListener("mousedown",N,zt),t.addEventListener("touchstart",N,zt),t.addEventListener("touchmove",w,zt),t.addEventListener("touchend",C),t.addEventListener("touchcancel",C)),E},on:function($,D){return function(F,G){A.set(F,[...A.get(F)||[],G])}($,D),E},off:function($,D){return A.has($)&&A.set($,A.get($).filter(F=>F!==D)),E},isPointerDown:()=>p>0,destroy:function(){clearTimeout(R),clearTimeout(L),L=0,t&&(t.removeEventListener("click",V,zt),t.removeEventListener("mousedown",N,zt),t.removeEventListener("touchstart",N,zt),t.removeEventListener("touchmove",w,zt),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",C)),t=null,T()}};return E};hn.isClickAllowed=()=>Sn;/*! License details at fancyapps.com/license */const no={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",TOGGLE_FS:"Toggle fullscreen"};/*! License details at fancyapps.com/license */const $e=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.add(a)})};/*! License details at fancyapps.com/license */const at=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.remove(a)})};/*! License details at fancyapps.com/license */const Ke=(t,n="",a)=>{t&&t.classList&&n.split(" ").forEach(o=>{o&&t.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Kt=t=>{t.cancelable&&t.preventDefault()},ot=(t,n=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*n)/n),Et=t=>t instanceof HTMLImageElement;var Ee,Cl;(function(t){t.Reset="reset",t.Zoom="zoom",t.ZoomIn="zoomIn",t.ZoomOut="zoomOut",t.ZoomTo="zoomTo",t.ToggleCover="toggleCover",t.ToggleFull="toggleFull",t.ToggleMax="toggleMax",t.IterateZoom="iterateZoom",t.Pan="pan",t.Swipe="swipe",t.Move="move",t.MoveLeft="moveLeft",t.MoveRight="moveRight",t.MoveUp="moveUp",t.MoveDown="moveDown",t.RotateCCW="rotateCCW",t.RotateCW="rotateCW",t.FlipX="flipX",t.FlipY="flipY",t.ToggleFS="toggleFS"})(Ee||(Ee={})),function(t){t.Cover="cover",t.Full="full",t.Max="max"}(Cl||(Cl={}));const ht={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},ao={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:Ee.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:no,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:Ee.Zoom,width:"auto"};let ca,Bl=0,vl=0,da=0;const oo=(t,n={},a={})=>{let o,r,l,s,i,d,u,c,m=0,f=Object.assign(Object.assign({},ao),n),h={},p=Object.assign({},ht),g=Object.assign({},ht);const y=[];function k(j){let ee=f[j];return ee&&typeof ee=="function"?ee(fe):ee}function B(){return t&&t.parentElement&&o&&m===3}const b=new Map;function x(j,...ee){const se=[...b.get(j)||[]];f.on&&se.push(f.on[j]);for(const oe of se)oe&&oe instanceof Function&&oe(fe,...ee);j!=="*"&&x("*",j,...ee)}function v(j){if(!B())return;const ee=j.target;if(Qt(ee))return;const se=Date.now(),oe=[-j.deltaX||0,-j.deltaY||0,-j.detail||0].reduce(function(xe,Ve){return Math.abs(Ve)>Math.abs(xe)?Ve:xe}),U=Fe(-1,oe,1);x("wheel",j,U);const ne=k("wheelAction");if(!ne||j.defaultPrevented)return;const he=g.scale;let pe=he*(U>0?1.5:.5);if(ne===Ee.Zoom){const xe=Math.abs(j.deltaY)<100&&Math.abs(j.deltaX)<100;if(se-vl<(xe?200:45))return void Kt(j);vl=se;const Ve=V(),Ce=F();if(ot(pe)<ot(Ve)&&ot(he)<=ot(Ve)?(da+=Math.abs(U),pe=Ve):ot(pe)>ot(Ce)&&ot(he)>=ot(Ce)?(da+=Math.abs(U),pe=Ce):(da=0,pe=Fe(Ve,pe,Ce)),da>7)return}switch(Kt(j),ne){case Ee.Pan:q(ne,{srcEvent:j,deltaX:2*-j.deltaX,deltaY:2*-j.deltaY});break;case Ee.Zoom:q(Ee.ZoomTo,{srcEvent:j,scale:pe,center:{x:j.clientX,y:j.clientY}});break;default:q(ne,{srcEvent:j})}}function _(j){var ee,se;const oe=j.composedPath()[0];if(!hn.isClickAllowed()||!mn(oe)||j.defaultPrevented||!(t!=null&&t.contains(oe))||oe.hasAttribute("disabled")||oe.hasAttribute("aria-disabled"))return;const U=oe.closest("[data-panzoom-action]"),ne=(ee=U==null?void 0:U.dataset)===null||ee===void 0?void 0:ee.panzoomAction,he=((se=U==null?void 0:U.dataset)===null||se===void 0?void 0:se.panzoomValue)||"";if(ne){switch(Kt(j),ne){case Ee.ZoomTo:case Ee.ZoomIn:case Ee.ZoomOut:q(ne,{scale:parseFloat(he||"")||void 0});break;case Ee.MoveLeft:case Ee.MoveRight:q(ne,{deltaX:parseFloat(he||"")||void 0});break;case Ee.MoveUp:case Ee.MoveDown:q(ne,{deltaY:parseFloat(he||"")||void 0});break;case Ee.ToggleFS:ce();break;default:q(ne)}return}if(!(o!=null&&o.contains(oe)))return;const pe={srcEvent:j};if(q(k("clickAction"),pe),k("dblClickAction")){const xe=Date.now(),Ve=xe-(Bl||xe);Bl=xe,Ve>0&&Ve<=250?(ca&&(clearTimeout(ca),ca=void 0),q(k("dblClickAction"),pe)):ca=setTimeout(()=>{q(k("singleClickAction"),pe)},250)}}function R(j){if(c=j,!B()||!C()||p.scale<=1||g.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const ee=O(g.scale);if(!ee)return;const{x:se,y:oe}=ee;q(Ee.Pan,{deltaX:se-g.x,deltaY:oe-g.y})}function L(){var j;t&&(at(t,"is-loading"),(j=t.querySelector(".f-spinner"))===null||j===void 0||j.remove())}function A(){if(!t||!r)return;if(L(),Et(r)&&(!r.complete||!r.naturalWidth))return m=2,o==null||o.classList.add("has-error"),void x("error");x("loaded");const{width:j,height:ee}=N();Et(r)&&(r.setAttribute("width",j+""),r.setAttribute("height",ee+"")),o&&(at(o,"has-error"),Et(r)&&(o.setAttribute("width",j+""),o.setAttribute("height",ee+""),o.style.aspectRatio=`${j/ee||""}`)),d=Ft().on("start",(oe,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),g=Object.assign(Object.assign({},ht),U),I(),x("animationStart")}).on("pause",oe=>{g=Object.assign(Object.assign({},ht),oe)}).on("step",oe=>{if(!B())return void(d==null||d.end());if(p=Object.assign(Object.assign({},ht),oe),C()||!k("bounds")||J()||g.scale>p.scale||g.scale<E())return void re();const U=G(g.scale);let ne=!1,he=!1,pe=!1,xe=!1;p.x<U.x[0]&&(ne=!0),p.x>U.x[1]&&(he=!0),p.y<U.y[0]&&(xe=!0),p.y>U.y[1]&&(pe=!0);let Ve=!1,Ce=!1,Le=!1,Ae=!1;g.x<U.x[0]&&(Ve=!0),g.x>U.x[1]&&(Ce=!0),g.y<U.y[0]&&(Ae=!0),g.y>U.y[1]&&(Le=!0);let He=!1;(he&&Ce||ne&&Ve)&&(g.x=Fe(U.x[0],g.x,U.x[1]),He=!0),(pe&&Le||xe&&Ae)&&(g.y=Fe(U.y[0],g.y,U.y[1]),He=!0),He&&d&&d.spring({tension:94,friction:17,maxSpeed:555*g.scale,restDelta:.1,restSpeed:.1,velocity:d.getCurrentVelocities()}).from(p).to(g).start(),re()}).on("end",()=>{i!=null&&i.isPointerDown()||Q(),d!=null&&d.isRunning()||(I(),x("animationEnd"))}),function(){const oe=k("gestures");if(!oe||!s||!r)return;let U=!1;i=hn(s,oe).on("start",ne=>{if(!k("gestures")||!d||!B()||C())return;const he=ne.srcEvent;(p.scale>1||ne.currentTouch.length>1)&&(he==null||he.stopPropagation(),d.pause(),U=!0),ne.currentTouch.length===1&&x("touchStart")}).on("move",ne=>{var he;U&&(g.scale!==1||ne.currentTouch.length>1)&&(Kt(ne.srcEvent),(he=ne.srcEvent)===null||he===void 0||he.stopPropagation())}).on("pan",ne=>{if(!U)return;const he=ne.srcEvent;(g.scale!==1||ne.currentTouch.length>1)&&(Kt(he),q(Ee.Pan,ne))}).on("swipe",ne=>{U&&g.scale>1&&q(Ee.Swipe,ne)}).on("tap",ne=>{x("click",ne)}).on("singleTap",ne=>{x("singleClick",ne)}).on("doubleTap",ne=>{x("dblClick",ne)}).on("pinch",ne=>{U&&(ne.scale>E()?q(Ee.ZoomIn,ne):ne.scale<E()?q(Ee.ZoomOut,ne):q(Ee.Pan,ne))}).on("end",ne=>{U&&(ne.currentTouch.length?(ne.srcEvent.stopPropagation(),Kt(ne.srcEvent),d==null||d.end()):(U=!1,I(),Q(),x("touchEnd")))}).init()}(),s&&(s.addEventListener("wheel",v,{passive:!1}),y.push(()=>{s==null||s.removeEventListener("wheel",v,{passive:!1})})),t==null||t.addEventListener("click",_),document==null||document.addEventListener("mousemove",R),y.push(()=>{t==null||t.removeEventListener("click",_),document==null||document.removeEventListener("mousemove",R)});const se=M();p=Object.assign({},se),g=Object.assign({},se),m=3,re(),I(),x("ready"),requestAnimationFrame(()=>{L(),s&&(s.style.visibility="")})}function M(){const j=Object.assign({},k("startPos")||{});let ee=j.scale,se=1;se=typeof ee=="string"?T(ee):typeof ee=="number"?ee:E();const oe=Object.assign(Object.assign(Object.assign({},ht),j),{scale:se}),U=C()?O(se):void 0;if(U){const{x:ne,y:he}=U;oe.x=ne,oe.y=he}return oe}function S(){const j={top:0,left:0,width:0,height:0};if(o){const ee=o.getBoundingClientRect();g.angle%180==90?(j.top=ee.top+.5*ee.height-.5*ee.width,j.left=ee.left+.5*ee.width-.5*ee.height,j.width=ee.height,j.height=ee.width):(j.top=ee.top,j.left=ee.left,j.width=ee.width,j.height=ee.height)}return j}function N(){let j=k("width"),ee=k("height");if(r&&j==="auto"){const se=r.getAttribute("width");j=se?parseFloat(se+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):Et(s)?s.naturalWidth:Et(r)?r.naturalWidth:(o==null?void 0:o.getBoundingClientRect().width)||0}else j=Oe(j)?parseFloat(j):j;if(r&&ee==="auto"){const se=r.getAttribute("height");ee=se?parseFloat(se+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):Et(s)?s.naturalHeight:Et(r)?r.naturalHeight:(o==null?void 0:o.getBoundingClientRect().height)||0}else ee=Oe(ee)?parseFloat(ee):ee;return{width:j,height:ee}}function w(){const j=S();return{width:j.width,height:j.height}}function C(){return k("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function O(j){const ee=c||k("event"),se=o==null?void 0:o.getBoundingClientRect();if(!ee||!se||j<=1)return{x:0,y:0};const oe=(ee.clientX||0)-se.left,U=(ee.clientY||0)-se.top,{width:ne,height:he}=w(),pe=G(j);if(j>1){const Ae=k("mouseMoveFactor");Ae>1&&(j*=Ae)}let xe=ne*j,Ve=he*j,Ce=.5*(xe-ne)-oe/ne*100/100*(xe-ne),Le=.5*(Ve-he)-U/he*100/100*(Ve-he);return Ce=Fe(pe.x[0],Ce,pe.x[1]),Le=Fe(pe.y[0],Le,pe.y[1]),{x:Ce,y:Le}}function T(j="base"){if(!t)return 1;const ee=t.getBoundingClientRect(),se=S(),{width:oe,height:U}=N(),ne=Ce=>{if(typeof Ce=="number")return Ce;switch(Ce){case"min":case"base":return 1;case"cover":return Math.max(ee.height/se.height,ee.width/se.width)||1;case"full":case"max":{const Le=g.angle%180==90?U:oe;return Le&&se.width?Le/se.width:1}}},he=k("minScale"),pe=k("maxScale"),xe=Math.min(ne("full"),ne(he)),Ve=typeof pe=="number"?ne("full")*pe:Math.min(ne("full"),ne(pe));switch(j){case"min":return xe;case"base":return Fe(xe,1,Ve);case"cover":return ne("cover");case"full":return Math.min(Ve,ne("full"));case"max":return Ve}}function V(){return T("min")}function E(){return T("base")}function $(){return T("cover")}function D(){return T("full")}function F(){return T("max")}function G(j){const ee={x:[0,0],y:[0,0]},se=t==null?void 0:t.getBoundingClientRect();if(!se)return ee;const oe=S(),U=se.width,ne=se.height;let he=oe.width,pe=oe.height,xe=j=j===void 0?g.scale:j,Ve=j;if(C()&&j>1){const Ce=k("mouseMoveFactor");Ce>1&&(he*j>U+.01&&(xe*=Ce),pe*j>ne+.01&&(Ve*=Ce))}return he*=xe,pe*=Ve,j>1&&(he>U&&(ee.x[0]=.5*(U-he),ee.x[1]=.5*(he-U)),ee.x[0]-=.5*(oe.left-se.left),ee.x[1]-=.5*(oe.left-se.left),ee.x[0]-=.5*(oe.left+oe.width-se.right),ee.x[1]-=.5*(oe.left+oe.width-se.right),pe>ne&&(ee.y[0]=.5*(ne-pe),ee.y[1]=.5*(pe-ne)),ee.y[0]-=.5*(oe.top-se.top),ee.y[1]-=.5*(oe.top-se.top),ee.y[0]-=.5*(oe.top+oe.height-se.bottom),ee.y[1]-=.5*(oe.top+oe.height-se.bottom)),ee}function Q(){if(!B()||!k("bounds")||!d)return;const j=V(),ee=F(),se=Fe(j,g.scale,ee);if(g.scale<j-.01||g.scale>ee+.01)return void q(Ee.ZoomTo,{scale:se});if(d.isRunning()||J())return;const oe=G(se);g.x<oe.x[0]||g.x>oe.x[1]||g.y<oe.y[0]||g.y>oe.y[1]?(g.x=Fe(oe.x[0],g.x,oe.x[1]),g.y=Fe(oe.y[0],g.y,oe.y[1]),d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:d.getCurrentVelocities()}),d.from(p).to(g).start()):re()}function I(j){var ee;if(!B())return;const se=Te(),oe=J(),U=ue(),ne=ge(),he=de(),pe=Ne();Ke(o,"is-fullsize",ne),Ke(o,"is-expanded",U),Ke(o,"is-dragging",oe),Ke(o,"can-drag",se),Ke(o,"will-zoom-in",he),Ke(o,"will-zoom-out",pe);const xe=we(),Ve=Be(),Ce=ve(),Le=!B();for(const Ae of((ee=j||t)===null||ee===void 0?void 0:ee.querySelectorAll("[data-panzoom-action]"))||[]){const He=Ae.dataset.panzoomAction;let Se=!1;if(Le)Se=!0;else switch(He){case Ee.ZoomIn:xe||(Se=!0);break;case Ee.ZoomOut:Ce||(Se=!0);break;case Ee.ToggleFull:{Ve||Ce||(Se=!0);const z=Ae.querySelector("g");z&&(z.style.display=ne&&!Se?"none":"");break}case Ee.IterateZoom:{xe||Ce||(Se=!0);const z=Ae.querySelector("g");z&&(z.style.display=xe||Se?"":"none");break}case Ee.ToggleCover:case Ee.ToggleMax:xe||Ce||(Se=!0)}Se?(Ae.setAttribute("aria-disabled",""),Ae.setAttribute("tabindex","-1")):(Ae.removeAttribute("aria-disabled"),Ae.removeAttribute("tabindex"))}}function q(j,ee){var se;if(!(j&&t&&r&&d&&B())||j===Ee.Swipe&&Math.abs(d.getCurrentVelocities().scale)>.01)return;const oe=Object.assign({},g);let U=Object.assign({},g),ne=G(C()?oe.scale:p.scale);const he=d.getCurrentVelocities(),pe=S(),xe=(((se=(ee=ee||{}).currentTouch)===null||se===void 0?void 0:se.length)||0)>1,Ve=ee.velocityX||0,Ce=ee.velocityY||0;let Le=ee.center;ee.srcEvent&&(Le=Pt(wl(ee.srcEvent)));let Ae=ee.deltaX||0,He=ee.deltaY||0;switch(j){case Ee.MoveRight:Ae=ee.deltaX||100;break;case Ee.MoveLeft:Ae=ee.deltaX||-100;break;case Ee.MoveUp:He=ee.deltaY||-100;break;case Ee.MoveDown:He=ee.deltaY||100}let Se=[];switch(j){case Ee.Reset:U=Object.assign({},ht),U.scale=E();break;case Ee.Pan:case Ee.Move:case Ee.MoveLeft:case Ee.MoveRight:case Ee.MoveUp:case Ee.MoveDown:if(J()){let Y=1,H=1;U.x<=ne.x[0]&&Ve<=0&&(Y=Math.max(.01,1-Math.abs(1/pe.width*Math.abs(U.x-ne.x[0]))),Y*=.2),U.x>=ne.x[1]&&Ve>=0&&(Y=Math.max(.01,1-Math.abs(1/pe.width*Math.abs(U.x-ne.x[1]))),Y*=.2),U.y<=ne.y[0]&&Ce<=0&&(H=Math.max(.01,1-Math.abs(1/pe.height*Math.abs(U.y-ne.y[0]))),H*=.2),U.y>=ne.y[1]&&Ce>=0&&(H=Math.max(.01,1-Math.abs(1/pe.height*Math.abs(U.y-ne.y[1]))),H*=.2),U.x+=Ae*Y,U.y+=He*H}else U.x=Fe(ne.x[0],U.x+Ae,ne.x[1]),U.y=Fe(ne.y[0],U.y+He,ne.y[1]);break;case Ee.Swipe:const z=(Y=0)=>Math.sign(Y)*Math.pow(Math.abs(Y),1.5);U.x+=Fe(-1e3,z(Ve),1e3),U.y+=Fe(-1e3,z(Ce),1e3),Ce&&!Ve&&(U.x=Fe(ne.x[0],U.x,ne.x[1])),!Ce&&Ve&&(U.y=Fe(ne.y[0],U.y,ne.y[1])),he.x=Ve,he.y=Ce;break;case Ee.ZoomTo:U.scale=ee.scale||1;break;case Ee.ZoomIn:U.scale=U.scale*(ee.scale||2),xe||(U.scale=Math.min(U.scale,F()));break;case Ee.ZoomOut:U.scale=U.scale*(ee.scale||.5),xe||(U.scale=Math.max(U.scale,V()));break;case Ee.ToggleCover:Se=[E(),$()];break;case Ee.ToggleFull:Se=[E(),D()];break;case Ee.ToggleMax:Se=[E(),F()];break;case Ee.IterateZoom:Se=[E(),D(),F()];break;case Ee.Zoom:const W=D();U.scale>=W-.05?U.scale=E():U.scale=Math.min(W,U.scale*(ee.scale||2));break;case Ee.RotateCW:U.angle+=90;break;case Ee.RotateCCW:U.angle-=90;break;case Ee.FlipX:U.flipX*=-1;break;case Ee.FlipY:U.flipY*=-1}if(p.angle!==void 0&&Math.abs(p.angle)>=360&&(U.angle-=360*Math.floor(p.angle/360),p.angle-=360*Math.floor(p.angle/360)),Se.length){const z=Se.findIndex(W=>W>U.scale+1e-4);U.scale=Se[z]||Se[0]}if(xe&&(U.scale=Fe(V()*(xe?.8:1),U.scale,F()*(xe?1.6:1))),C()){const z=O(U.scale);if(z){const{x:W,y:Y}=z;U.x=W,U.y=Y}}else if(Math.abs(U.scale-oe.scale)>1e-4){let z=0,W=0;if(Le)z=Le.x,W=Le.y;else{const le=t.getBoundingClientRect();z=le.x+.5*le.width,W=le.y+.5*le.height}let Y=z-pe.left,H=W-pe.top;Y-=.5*pe.width,H-=.5*pe.height;const K=(Y-oe.x)/oe.scale,te=(H-oe.y)/oe.scale;U.x=Y-K*U.scale,U.y=H-te*U.scale,!xe&&k("bounds")&&(ne=G(U.scale),U.x=Fe(ne.x[0],U.x,ne.x[1]),U.y=Fe(ne.y[0],U.y,ne.y[1]))}if(j===Ee.Swipe){let z=94,W=17,Y=500*U.scale,H=he;d.spring({tension:z,friction:W,maxSpeed:Y,restDelta:.1,restSpeed:.1,velocity:H})}else j===Ee.Pan||xe?d.spring({tension:900,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:he});if(ee.velocity===0||vn(p,U))p=Object.assign({},U),g=Object.assign({},U),d.end(),re(),I();else{if(vn(g,U))return;d.from(p).to(U).start()}x("action",j)}function re(){if(!r||!o||!s)return;const{width:j,height:ee}=N();Object.assign(o.style,{maxWidth:`min(${j}px, 100%)`,maxHeight:`min(${ee}px, 100%)`});const se=function(){const{width:Ae,height:He}=N(),{width:Se,height:z}=w();if(!t)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:Se,fitHeight:z,fullWidth:Ae,fullHeight:He};let{x:W,y:Y,scale:H,angle:K,flipX:te,flipY:le}=p,P=1/D(),Z=Ae,X=He,me=p.scale*P,be=g.scale*P;const Me=Math.max(Se,z),_e=Math.min(Se,z);Ae>He?(Z=Me,X=_e):(Z=_e,X=Me),me=Ae>He?Me*H/Ae||1:Me*H/He||1;let ze=Z?Ae*be:0,Je=X?He*be:0,et=Z&&X?Ae*me/ze:0;return W=W+.5*Z-.5*ze,Y=Y+.5*X-.5*Je,{x:W,y:Y,width:ze,height:Je,scale:et,flipX:te,flipY:le,angle:K,fitWidth:Se,fitHeight:z,fullWidth:Ae,fullHeight:He}}(),{x:oe,y:U,width:ne,height:he,scale:pe,angle:xe,flipX:Ve,flipY:Ce}=se;let Le=`translate(${ot(oe)}px, ${ot(U)}px)`;Le+=Ve!==1||Ce!==1?` scaleX(${ot(pe*Ve)}) scaleY(${ot(pe*Ce)})`:` scale(${ot(pe)})`,xe!==0&&(Le+=` rotate(${xe}deg)`),s.style.width=`${ot(ne)}px`,s.style.height=`${ot(he)}px`,s.style.transform=`${Le}`,x("render")}function ye(){let j=g.scale;const ee=k("clickAction");let se=E();if(ee){let oe=[];switch(ee){case Ee.ZoomIn:se=2*j;break;case Ee.ZoomOut:se=.5*j;break;case Ee.ToggleCover:oe=[E(),$()];break;case Ee.ToggleFull:oe=[E(),D()];break;case Ee.ToggleMax:oe=[E(),F()];break;case Ee.IterateZoom:oe=[E(),D(),F()];break;case Ee.Zoom:const U=D();se=j>=U-.05?E():Math.min(U,2*j)}if(oe.length){const U=oe.findIndex(ne=>ne>j+1e-4);se=oe[U]||E()}}return se=Fe(V(),se,F()),se}function de(){return!!(B()&&ye()>g.scale)}function Ne(){return!!(B()&&ye()<g.scale)}function ve(){return!!(B()&&g.scale>V())}function we(){return!!(B()&&g.scale<F())}function Be(){return!!(B()&&g.scale<D())}function Te(){return!(!(B()&&ue()&&i)||C())}function J(){return!(!B()||!(i!=null&&i.isPointerDown())||C())}function ue(){return!!(B()&&g.scale>E())}function ge(){return!!(B()&&g.scale>=D())}function ce(){const j="in-fullscreen",ee="with-panzoom-in-fullscreen";t==null||t.classList.toggle(j);const se=t==null?void 0:t.classList.contains(j);se?(document.documentElement.classList.add(ee),document.addEventListener("keydown",ie,!0)):(document.documentElement.classList.remove(ee),document.removeEventListener("keydown",ie,!0)),re(),x(se?"enterFS":"exitFS")}function ie(j){j.key!=="Escape"||j.defaultPrevented||ce()}const fe={canDrag:Te,canZoomIn:we,canZoomOut:ve,canZoomToFull:Be,destroy:function(){x("destroy");for(const j of Object.values(h))j==null||j.destroy(fe);for(const j of y)j();return o&&(o.style.aspectRatio="",o.style.maxWidth="",o.style.maxHeight=""),s&&(s.style.width="",s.style.height="",s.style.transform=""),o=void 0,r=void 0,s=void 0,p=Object.assign({},ht),g=Object.assign({},ht),d==null||d.destroy(),d=void 0,i==null||i.destroy(),i=void 0,m=4,fe},emit:x,execute:q,getBoundaries:G,getContainer:function(){return t},getContent:function(){return r},getFullDim:N,getGestures:function(){return i},getMousemovePos:O,getOptions:function(){return f},getPlugins:function(){return h},getScale:T,getStartPosition:M,getState:function(){return m},getTransform:function(j){return j===!0?g:p},getTween:function(){return d},getViewport:function(){return s},getWrapper:function(){return o},init:function(){return m=0,x("init"),function(){for(const[j,ee]of Object.entries(Object.assign(Object.assign({},a),f.plugins||{})))if(j&&!h[j]&&ee instanceof Function){const se=ee();se.init(fe),h[j]=se}x("initPlugins")}(),function(){const j=Object.assign(Object.assign({},ao.classes),k("classes"));if(t&&($e(t,j.container),r=t.querySelector("."+j.content),!!r)){if(r.setAttribute("draggable","false"),o=t.querySelector("."+j.wrapper),o||(o=document.createElement("div"),$e(o,j.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),s=t.querySelector("."+j.viewport),s||(s=document.createElement("div"),$e(s,j.viewport),s.insertAdjacentElement("afterbegin",r),o.insertAdjacentElement("beforeend",s)),l=r.cloneNode(!0),l.removeAttribute("id"),o.insertAdjacentElement("afterbegin",l),r instanceof HTMLPictureElement&&(r=r.querySelector("img")),l instanceof HTMLPictureElement&&(l=l.querySelector("img")),s instanceof HTMLPictureElement&&(s=s.querySelector("img")),s&&(s.style.visibility="hidden",k("protected"))){s.addEventListener("contextmenu",se=>{Kt(se)});const ee=document.createElement("div");$e(ee,"f-panzoom__protected"),s.appendChild(ee)}x("initLayout")}}(),function(){if(t&&o&&!u){let j=null;u=new ResizeObserver(()=>{B()&&(j=j||requestAnimationFrame(()=>{B()&&(I(),Q(),x("refresh")),j=null}))}),u.observe(o),y.push(()=>{u==null||u.disconnect(),u=void 0,j&&(cancelAnimationFrame(j),j=null)})}}(),function(){if(!t||!r)return;if(!Et(r)||!Et(l))return void A();const j=()=>{r&&Et(r)&&r.decode().then(()=>{A()}).catch(()=>{A()})};if(m=1,t.classList.add("is-loading"),x("loading"),l.src&&l.complete)return void j();(function(){if(!t||t!=null&&t.querySelector(".f-spinner"))return;const ee=k("spinnerTpl"),se=Vt(ee);se&&(se.classList.add("f-spinner"),t.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",se))})(),l.addEventListener("load",j,!1),l.addEventListener("error",j,!1),y.push(()=>{l==null||l.removeEventListener("load",j,!1),l==null||l.removeEventListener("error",j,!1)})}(),fe},isDragging:J,isExpanded:ue,isFullsize:ge,isMousemoveMode:C,localize:function(j,ee=[]){const se=k("l10n")||{};j=String(j).replace(/\{\{(\w+)\}\}/g,(oe,U)=>se[U]||oe);for(let oe=0;oe<ee.length;oe++)j=j.split(ee[oe][0]).join(ee[oe][1]);return j=j.replace(/\{\{(.*?)\}\}/g,(oe,U)=>U)},off:function(j,ee){for(const se of j instanceof Array?j:[j])b.has(se)&&b.set(se,b.get(se).filter(oe=>oe!==ee));return fe},on:function(j,ee){for(const se of j instanceof Array?j:[j])b.set(se,[...b.get(se)||[],ee]);return fe},toggleFS:ce,updateControls:I,version:"6.1.3",willZoomIn:de,willZoomOut:Ne};return fe};oo.l10n={en_EN:no},oo.getDefaults=()=>ao;/*! License details at fancyapps.com/license */const ro=(t,n)=>{let a=[];return t.childNodes.forEach(o=>{o.nodeType!==Node.ELEMENT_NODE||n&&!o.matches(n)||a.push(o)}),a};/*! License details at fancyapps.com/license */const ct=(t,...n)=>{const a=n.length;for(let o=0;o<a;o++){const r=n[o]||{};Object.entries(r).forEach(([l,s])=>{const i=Array.isArray(s)?[]:{};t[l]||Object.assign(t,{[l]:i}),Qe(s)?Object.assign(t[l],ct(t[l],s)):Array.isArray(s)?Object.assign(t,{[l]:[...s]}):Object.assign(t,{[l]:s})})}return t};/*! License details at fancyapps.com/license */const ua=function(t=0,n=0,a=0,o=0,r=0,l=!1){const s=(t-n)/(a-n)*(r-o)+o;return l?o<r?Fe(o,s,r):Fe(r,s,o):s};/*! License details at fancyapps.com/license */const lo=Object.assign(Object.assign({},no),{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 Jt=t=>{t.cancelable&&t.preventDefault()},gn={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:lo,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:160,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1};let Vl,Sl=0;const ma=(t,n={},a={})=>{Sl++;let o,r,l,s,i,d=0,u=Object.assign({},gn),c=Object.assign({},gn),m={},f=null,h=null,p=!1,g=!1,y=!1,k=!1,B="height",b=0,x=!0,v=0,_=0,R=0,L=0,A="*",M=[],S=[];const N=new Set;let w=[],C=[],O=0,T=0,V=0;function E(z,...W){let Y=c[z];return Y&&Y instanceof Function?Y(Se,...W):Y}function $(z,W=[]){const Y=E("l10n")||{};z=String(z).replace(/\{\{(\w+)\}\}/g,(H,K)=>Y[K]||H);for(let H=0;H<W.length;H++)z=z.split(W[H][0]).join(W[H][1]);return z=z.replace(/\{\{(.*?)\}\}/g,(H,K)=>K)}const D=new Map;function F(z,...W){const Y=[...D.get(z)||[]];c.on&&Y.push(c.on[z]);for(const H of Y)H&&H instanceof Function&&H(Se,...W);z!=="*"&&F("*",z,...W)}function G(){var z,W;const Y=ct({},gn,u);ct(Y,gn,u);let H="";const K=u.breakpoints||{};if(K)for(const[te,le]of Object.entries(K))window.matchMedia(te).matches&&(H+=te,ct(Y,le));if(i===void 0||H!==i){if(i=H,d!==0){let te=(W=(z=C[v])===null||z===void 0?void 0:z.slides[0])===null||W===void 0?void 0:W.index;te===void 0&&(te=c.initialSlide),Y.initialSlide=te,Y.slides=[];for(const le of M)le.isVirtual&&Y.slides.push(le)}Le(),c=Y,E("enabled")!==!1&&(d=0,F("init"),function(){for(const[te,le]of Object.entries(Object.assign(Object.assign({},a),c.plugins||{})))if(te&&!m[te]&&le instanceof Function){const P=le();P.init(Se,ma),m[te]=P}F("initPlugins")}(),function(){if(!f)return;const te=E("classes")||{};$e(f,te.container);const le=E("style");if(le&&Qe(le))for(const[P,Z]of Object.entries(le))f.style.setProperty(P,Z);h=f.querySelector(`.${te.viewport}`),h||(h=document.createElement("div"),$e(h,te.viewport),h.append(...ro(f,`.${te.slide}`)),f.insertAdjacentElement("afterbegin",h)),f.carousel=Se,F("initLayout")}(),function(){if(!h)return;const te=E("classes")||{};M=[],[...ro(h,`.${te.slide}`)].forEach(le=>{if(le.parentElement){const P=ue(Object.assign({el:le,isVirtual:!1},le.dataset||{}));F("createSlide",P),M.push(P)}}),fe();for(const le of M)F("addSlide",le);J(E("slides"));for(const le of M){const P=le.el;(P==null?void 0:P.parentElement)===h&&($e(P,c.classes.slide),$e(P,le.class),pe(le),F("attachSlideEl",le))}F("initSlides")}(),j(),d=1,$e(f,(E("classes")||{}).isEnabled||""),Ce(),ye(),r=Ft().on("start",()=>{o&&o.isPointerDown()||(re(),Ce())}).on("step",te=>{const le=b;b=te.pos,b!==le&&(x=!1,Ce())}).on("end",te=>{o!=null&&o.isPointerDown()||(b=te.pos,r&&!g&&(b<R||b>L)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Fe(R,b,L)}).start():x||(x=!0,F("settle")))}),I(),function(){if(!f||!h)return;f.addEventListener("click",U,{passive:!1}),document.addEventListener("mousemove",Q);const te=h.getBoundingClientRect();if(O=te.height,T=te.width,!l){let le=null;l=new ResizeObserver(()=>{le||(le=requestAnimationFrame(()=>{(function(){if(d!==1||!h)return;const P=C.length,Z=h.getBoundingClientRect(),X=Z.height,me=Z.width;P>1&&(k&&Math.abs(X-O)<.5||!k&&Math.abs(me-T)<.5)||(j(),I(),O=X,T=me,k&&!X||!k&&!me||f&&h&&(P===C.length&&(o!=null&&o.isPointerDown())||(E("dragFree")&&(g||b>R&&b<L)?(re(),Ce()):xe(v,{transition:!1}))))})(),le=null}))}),l.observe(h)}}(),F("ready"))}}function Q(z){Vl=z}function I(){E("gestures")===!1?o&&(o.destroy(),o=void 0):o||function(){const z=E("gestures");!o&&z!==!1&&h&&(o=hn(h,z).on("start",W=>{var Y,H;if(!r)return;const{srcEvent:K}=W;k&&Vn(K)&&!Qt(K.target)&&Jt(K),r.pause(),r.getCurrentVelocities().pos=0;const te=(Y=C[v])===null||Y===void 0?void 0:Y.slides[0];te&&N.has(te.index)&&te.el&&(b=te.offset||0,b+=(function(le){const P=window.getComputedStyle(le),Z=new DOMMatrixReadOnly(P.transform);return{width:Z.m41||0,height:Z.m42||0}}(te.el)[B]||0)*(y&&!k?1:-1)),se(),g||(b<R||b>L)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:((H=r.getCurrentVelocities())===null||H===void 0?void 0:H.pos)||0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:Fe(R,b,L)}).start()}).on("move",W=>{var Y,H;const{srcEvent:K,axis:te}=W,le=K.target;if(te||(Jt(K),K.stopPropagation(),K.stopImmediatePropagation()),(te==="y"&&k||te==="x"&&!k)&&(Jt(K),K.stopPropagation()),!te)return;const{deltaX:P,deltaY:Z}=W;if(!r||Vn(K)&&((Y=K.touches)===null||Y===void 0?void 0:Y.length)>1||te==="y"&&!k||te==="x"&&k||le&&Qt(le)&&(te!=="x"||k))return;const X=y&&!k?1:-1;let me=k?Z:P,be=r!=null&&r.isRunning()?r.getEndValues().pos:b,Me=1;g||(be<=R&&me*X<0?(Me=Math.max(.01,1-(Math.abs(1/we()*Math.abs(be-R))||0)),Me*=.2):be>=L&&me*X>0&&(Me=Math.max(.01,1-(Math.abs(1/we()*Math.abs(be-L))||0)),Me*=.2)),be+=me*Me*X,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:((H=r.getCurrentVelocities())===null||H===void 0?void 0:H.pos)||0,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:be}).start()}).on("panstart",W=>{(W==null?void 0:W.axis)===(k?"y":"x")&&$e(h,"is-dragging")}).on("panend",()=>{at(h,"is-dragging")}).on("end",W=>{var Y,H;const{srcEvent:K,axis:te,velocityX:le,velocityY:P,currentTouch:Z}=W;if(Z.length>0||!r)return;const X=K.target,me=X&&Qt(X)&&!(te==="x"&&!k);k&&Vn(K)&&!W.axis&&U(K);const be=C.length,Me=E("dragFree");if(!be)return;const _e=E("vertical")?P:le;let ze=r!=null&&r.isRunning()?r.getEndValues().pos:b;const Je=y&&!k?1:-1;if(me||(ze+=_e*(Me?5:1)*Je),!g&&(_e*Je<=0&&ze<R||_e*Je>=0&&ze>L)){let tt=0;return Math.abs(_e)>0&&(tt=2*Math.abs(_e),tt=Math.min(.3*we(),tt)),ze=Fe(R+-1*tt,ze,L+tt),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*_e,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:ze}).start()}if(Me||!((Y=m.Autoscroll)===null||Y===void 0)&&Y.isEnabled())return void(Math.abs(_e)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*_e,restDelta:1,restSpeed:1}).from({pos:b}).to({pos:ze}).start():r.isRunning()||x||(x=!0,F("settle")));if(!Me&&!(!((H=m.Autoscroll)===null||H===void 0)&&H.isEnabled())&&(!W.offsetX&&!W.offsetY||te==="y"&&!k||te==="x"&&k))return void xe(v,{transition:"tween"});let et=Ne(ze);Math.abs(_e)>10&&et===v&&(et+=_e>0?y&&!k?1:-1:y&&!k?-1:1),xe(et,{transition:"tween",tween:{velocity:-1*_e}})}).init())}(),Ke(h,"is-draggable",!!o&&C.length>0)}function q(z="*"){var W;const Y=[];for(const H of M)(z==="*"||H.class&&H.class.includes(z)||H.el&&(!((W=H.el)===null||W===void 0)&&W.classList.contains(z)))&&Y.push(H);s=void 0,A=z,S=[...Y]}function re(){if(!r)return;const z=Ne(r!=null&&r.isRunning()?r.getEndValues().pos:b);z!==v&&(s=v,v=z,pe(),ye(),de(),F("change",v,s))}function ye(){var z,W;if(!f)return;for(const K of f.querySelectorAll("[data-carousel-index]"))K.innerHTML=v+"";for(const K of f.querySelectorAll("[data-carousel-page]"))K.innerHTML=v+1+"";for(const K of f.querySelectorAll("[data-carousel-pages]"))K.innerHTML=C.length+"";for(const K of f.querySelectorAll("[data-carousel-go-to]"))parseInt(((z=K.dataset)===null||z===void 0?void 0:z.carouselGoTo)||"-1",10)===v?K.setAttribute("aria-current","true"):K.removeAttribute("aria-current");for(const K of f.querySelectorAll("[data-carousel-go-prev]"))K.toggleAttribute("aria-disabled",!Ae()),Ae()?K.removeAttribute("tabindex"):K.setAttribute("tabindex","-1");for(const K of f.querySelectorAll("[data-carousel-go-next]"))K.toggleAttribute("aria-disabled",!He()),He()?K.removeAttribute("tabindex"):K.setAttribute("tabindex","-1");let Y=!1;const H=(W=C[v])===null||W===void 0?void 0:W.slides[0];H&&(H.downloadSrc||H.type==="image"&&H.src)&&(Y=!0);for(const K of f.querySelectorAll("[data-carousel-download]"))K.toggleAttribute("aria-disabled",!Y)}function de(z){var W;z||(z=(W=C[v])===null||W===void 0?void 0:W.slides[0]);const Y=z==null?void 0:z.el;if(Y)for(const H of Y.querySelectorAll("[data-slide-index]"))H.innerHTML=z.index+1+""}function Ne(z){var W,Y,H;if(!C.length)return 0;const K=Be();let te=z;g?te-=Math.floor((z-((W=C[0])===null||W===void 0?void 0:W.pos))/K)*K||0:te=Fe((Y=C[0])===null||Y===void 0?void 0:Y.pos,z,(H=C[C.length-1])===null||H===void 0?void 0:H.pos);const le=new Map;let P=0;for(const X of C){const me=Math.abs(X.pos-te),be=Math.abs(X.pos-te-K),Me=Math.abs(X.pos-te+K),_e=Math.min(me,be,Me);le.set(P,_e),P++}const Z=le.size>0?[...le.entries()].reduce((X,me)=>me[1]<X[1]?me:X):[v,0];return parseInt(Z[0])}function ve(){return V}function we(){let z=0;return h&&(h.childElementCount||(h.style.display="grid"),z=h.getBoundingClientRect()[B]||0,h.style.display=""),z}function Be(z=!0){return S.length?S.reduce((W,Y)=>W+Y.dim,0)+(S.length-(g&&z?0:1))*V:0}function Te(z){const W=Be(),Y=we();if(!W||!h||!Y)return[];const H=[];z=z===void 0?b:z,g&&(z-=Math.floor(z/W)*W||0);let K=0,te=0;if(p){const P=h.getBoundingClientRect();K=Math.abs(P[k?"top":"left"]),te=Math.abs(window[k?"innerHeight":"innerWidth"]-P[k?"bottom":"right"])}let le=0;for(let P of S){const Z=(X=0)=>{H.indexOf(P)>-1||(P.pos=le-z+X||0,P.offset+X>z-P.dim-K+.51&&P.offset+X<z+Y+te-.51&&H.push(P))};P.offset=le,g&&(Z(W),Z(-1*W)),Z(),le+=P.dim+V}return H}function J(z,W){const Y=[];for(const H of Array.isArray(z)?z:[z]){const K=ue(Object.assign(Object.assign({},H),{isVirtual:!0}));K.el||(K.el=document.createElement("div")),F("createSlide",K),Y.push(K)}M.splice(W===void 0?M.length:W,0,...Y),fe();for(const H of Y)F("addSlide",H),ge(H);return q(A),Y}function ue(z){return(Oe(z)||z instanceof HTMLElement)&&(z={html:z}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},z)}function ge(z){let W=z.el;if(!z||!W)return;const Y=z.html?z.html instanceof HTMLElement?z.html:Vt(z.html):void 0;Y&&($e(Y,"f-html"),z.htmlEl=Y,$e(W,"has-html"),W.append(Y),F("contentReady",z))}function ce(z){if(!h||!z)return;let W=z.el;if(W){if(W.setAttribute("index",z.index+""),W.parentElement!==h){let Y;$e(W,c.classes.slide),$e(W,z.class),pe(z);for(const H of M)if(H.index>z.index){Y=H.el;break}h.insertBefore(W,Y&&h.contains(Y)?Y:null),F("attachSlideEl",z)}return de(z),W}}function ie(z){const W=z==null?void 0:z.el;W&&(W.remove(),ee(W),F("detachSlideEl",z))}function fe(){for(let z=0;z<M.length;z++){const W=M[z],Y=W.el;Y&&(W.index!==z&&ee(Y),Y.setAttribute("index",`${z}`)),W.index=z}}function j(){var z,W,Y,H,K;if(!f||!h)return;y=E("rtl"),k=E("vertical"),B=k?"height":"width";const te=E("classes");if(Ke(f,te.isLTR,!y),Ke(f,te.isRTL,y),Ke(f,te.isHorizontal,!k),Ke(f,te.isVertical,k),Ke(f,te.hasAdaptiveHeight,E("adaptiveHeight")),!we())return;const le=window.getComputedStyle(h);p=le.getPropertyValue("overflow-"+(k?"y":"x"))==="visible",V=h&&parseFloat(le.getPropertyValue("--f-carousel-gap"))||0;const P=function(){let Z=0;if(h){let X=document.createElement("div");X.style.display="block",$e(X,c.classes.slide),h.appendChild(X),Z=X.getBoundingClientRect()[B],X.remove(),X=void 0}return Z}();for(const Z of S){const X=Z.el;let me=0;if(!Z.isVirtual&&X&&mn(X)){let be=!1;X.parentElement&&X.parentElement===h||(h.appendChild(X),be=!0),me=X.getBoundingClientRect()[B],be&&((z=X.parentElement)===null||z===void 0||z.removeChild(X))}else me=P;Z.dim=me}if(g=!1,E("infinite")){g=!0;const Z=Be();let X=we();if(p){const me=h.getBoundingClientRect();X+=me.left,X+=me.right-me.width}for(let me=0;me<S.length;me++){const be=((W=S[me])===null||W===void 0?void 0:W.dim)+V;if(Z-be<X&&Z-be-X<be){g=!1;break}}}(function(){var Z;if(!f)return;const X=we(),me=Be(!1);let be=E("slidesPerPage");be=be==="auto"?1/0:parseFloat(be+""),C=[];let Me=0,_e=0;for(const Ie of S)(!C.length||Me+Ie.dim-X>.05||_e>=be)&&(C.push({index:C.length,slides:[],dim:0,offset:0,pos:0}),Me=0,_e=0),(Z=C[C.length-1])===null||Z===void 0||Z.slides.push(Ie),Me+=Ie.dim+V,_e++;const ze=E("center"),Je=E("fill");let et=0;for(const Ie of C){Ie.dim=(Ie.slides.length-1)*V;for(const lt of Ie.slides)Ie.dim+=lt.dim;Ie.offset=et,Ie.pos=et,ze!==!1&&(Ie.pos-=.5*(X-Ie.dim)),Je&&!g&&me>X&&(Ie.pos=Fe(0,Ie.pos,me-X)),et+=Ie.dim+V}const tt=[];let mt;for(const Ie of C){const lt=Object.assign({},Ie);mt&&Math.abs(lt.pos-mt.pos)<.1?(mt.dim+=lt.dim,mt.slides=[...mt.slides,...lt.slides]):(mt=lt,lt.index=tt.length,tt.push(lt))}C=tt,v=Fe(0,v,C.length-1)})(),R=((Y=C[0])===null||Y===void 0?void 0:Y.pos)||0,L=((H=C[C.length-1])===null||H===void 0?void 0:H.pos)||0,d===0?function(){var Z;s=void 0,v=E("initialPage");const X=E("initialSlide")||void 0;X!==void 0&&(v=Se.getPageIndex(X)||0),v=Fe(0,v,C.length-1),b=((Z=C[v])===null||Z===void 0?void 0:Z.pos)||0,_=b}():_=((K=C[v||0])===null||K===void 0?void 0:K.pos)||0,F("refresh"),ye()}function ee(z){if(!z||!mn(z))return;const W=parseInt(z.getAttribute("index")||"-1");let Y="";for(const K of Array.from(z.classList)){const te=K.match(/^f-(\w+)(Out|In)$/);te&&te[1]&&(Y=te[1]+"")}if(!z||!Y)return;const H=[`f-${Y}Out`,`f-${Y}In`,"to-prev","to-next","from-prev","from-next"];z.removeEventListener("animationend",oe),at(z,H.join(" ")),N.delete(W)}function se(){if(!h)return;const z=N.size>0;for(const W of S)ee(W.el);N.clear(),z&&Ce()}function oe(z){var W;((W=z.animationName)===null||W===void 0?void 0:W.substring(0,2))==="f-"&&(ee(z.target),N.size||(at(f,"in-transition"),!x&&Math.abs(Se.getPosition(!0)-_)<.5&&(x=!0,F("settle"))),Ce())}function U(z){var W;if(z.defaultPrevented)return;const Y=z.composedPath()[0];if(Y.closest("[data-carousel-go-prev]"))return Jt(z),void Se.prev();if(Y.closest("[data-carousel-go-next]"))return Jt(z),void Se.next();const H=Y.closest("[data-carousel-go-to]");if(H)return Jt(z),void Se.goTo(parseFloat(H.dataset.carouselGoTo||"")||0);if(Y.closest("[data-carousel-download]")){Jt(z);const K=(W=C[v])===null||W===void 0?void 0:W.slides[0];if(K&&(K.downloadSrc||K.type==="image"&&K.src)){const te=K.downloadFilename,le=document.createElement("a"),P=K.downloadSrc||K.src||"";le.href=P,le.target="_blank",le.download=te||P,le.click()}}else F("click",z)}function ne(z){var W;const Y=z.el;Y&&((W=Y.querySelector(".f-spinner"))===null||W===void 0||W.remove())}function he(z){var W;const Y=z.el;Y&&((W=Y.querySelector(".f-html.is-error"))===null||W===void 0||W.remove(),at(Y,"has-error"))}function pe(z){var W;z||(z=(W=C[v])===null||W===void 0?void 0:W.slides[0]);const Y=z==null?void 0:z.el;if(!Y)return;let H=E("formatCaption",z);H===void 0&&(H=z.caption),H=H||"";const K=E("captionEl");if(K&&K instanceof HTMLElement){if(z.index!==v)return;if(Oe(H)&&(K.innerHTML=$(H+"")),H instanceof HTMLElement){if(H.parentElement===K)return;K.innerHTML="",H.parentElement&&(H=H.cloneNode(!0)),K.append(H)}return}if(!H)return;let te=z.captionEl||Y.querySelector(".f-caption");!te&&H instanceof HTMLElement&&H.classList.contains("f-caption")&&(te=H),te||(te=document.createElement("div"),$e(te,"f-caption"),Oe(H)?te.innerHTML=$(H+""):H instanceof HTMLElement&&(H.parentElement&&(H=H.cloneNode(!0)),te.append(H)));const le=`f-caption-${Sl}_${z.index}`;te.setAttribute("id",le),te.dataset.selectable="true",$e(Y,"has-caption"),Y.setAttribute("aria-labelledby",le),z.captionEl=te,Y.insertAdjacentElement("beforeend",te)}function xe(z,W={}){var Y,H;let{transition:K,tween:te}=Object.assign({transition:c.transition,tween:c.tween},W||{});if(!f||!r)return;const le=C.length;if(!le||function(X,me){var be,Me,_e,ze;if(!(f&&r&&me&&Oe(me)&&me!=="tween")||((be=C[v])===null||be===void 0?void 0:be.slides.length)>1)return!1;const Je=C.length;let et=X>v?1:-1;X=g?(X%Je+Je)%Je:Fe(0,X,Je-1),y&&(et*=-1);const tt=(Me=C[v])===null||Me===void 0?void 0:Me.slides[0],mt=tt==null?void 0:tt.index,Ie=(_e=C[X])===null||_e===void 0?void 0:_e.slides[0],lt=Ie==null?void 0:Ie.index,on=(ze=C[X])===null||ze===void 0?void 0:ze.pos;if(lt===void 0||mt===void 0||mt===lt||b===on||Math.abs(we()-((Ie==null?void 0:Ie.dim)||0))>1)return!1;x=!1,r.pause(),se(),$e(f,"in-transition"),b=_=on;const kt=ce(tt),vt=ce(Ie);return re(),kt&&(N.add(mt),kt.style.transform="",kt.addEventListener("animationend",oe),at(kt,c.classes.isSelected),kt.inert=!1,$e(kt,`f-${me}Out to-${et>0?"next":"prev"}`)),vt&&(N.add(lt),vt.style.transform="",vt.addEventListener("animationend",oe),$e(vt,c.classes.isSelected),vt.inert=!1,$e(vt,`f-${me}In from-${et>0?"prev":"next"}`)),Ce(),!0}(z,K))return;z=g?(z%le+le)%le:Fe(0,z,le-1),_=((Y=C[z||0])===null||Y===void 0?void 0:Y.pos)||0;const Z=r.isRunning()?r.getEndValues().pos:b;if(Math.abs(_-Z)<1)return b=_,v!==z&&(pe(),s=v,v=z,ye(),de(),F("change",v,s)),Ce(),void(x||(x=!0,F("settle")));if(r.pause(),se(),g){const X=Be(),me=Math.floor((Z-((H=C[0])===null||H===void 0?void 0:H.pos))/X)||0,be=_+me*X;_=[be+X,be,be-X].reduce(function(Me,_e){return Math.abs(_e-Z)<Math.abs(Me-Z)?_e:Me})}K!==!1&&Qe(te)?r.spring(ct({},c.tween,te)).from({pos:b}).to({pos:_}).start():(b=_,re(),Ce(),x||(x=!0,F("settle")))}function Ve(z){var W;let Y=b;if(g&&z!==!0){const H=Be();Y-=(Math.floor((b-((W=C[0])===null||W===void 0?void 0:W.pos)||0)/H)||0)*H}return Y}function Ce(){var z;if(!f||!h)return;w=Te();const W=new Set,Y=[],H=C[v],K=c.setTransform;let te;for(const le of S){const P=N.has(le.index),Z=w.indexOf(le)>-1,X=((z=H==null?void 0:H.slides)===null||z===void 0?void 0:z.indexOf(le))>-1;if(le.isVirtual&&!P&&!Z)continue;let me=ce(le);if(me&&(Y.push(le),X&&W.add(me),E("adaptiveHeight")&&X)){const be=(me.firstElementChild||me).getBoundingClientRect().height;te=te==null?be:Math.max(te,be)}}h&&te&&(h.style.height=`${te}px`),[...ro(h,`.${c.classes.slide}`)].forEach(le=>{Ke(le,c.classes.isSelected,W.has(le));const P=M[parseInt(le.getAttribute("index")||"-1")];if(!P)return le.remove(),void ee(le);const Z=N.has(P.index),X=w.indexOf(P)>-1;if(P.isVirtual&&!Z&&!X)return void ie(P);if(le.inert=!X,K===!1)return;let me=P.pos?Math.round(1e4*P.pos)/1e4:0,be=0,Me=0,_e=0,ze=0;Z||(be=k?0:y?-1*me:me,Me=k?me:0,_e=ua(be,0,P.dim,0,100),ze=ua(Me,0,P.dim,0,100)),K instanceof Function&&!Z?K(Se,P,{x:be,y:Me,xPercent:_e,yPercent:ze}):le.style.transform=be||Me?`translate3d(${_e}%, ${ze}%,0)`:""}),F("render",Y)}function Le(){f==null||f.removeEventListener("click",U),document.removeEventListener("mousemove",Q),N.clear(),l==null||l.disconnect(),l=void 0;for(const z of M){let W=z.el;W&&mn(W)&&(z.state=void 0,ne(z),he(z),z.isVirtual?(ie(z),z.el=void 0):(ee(W),W.style.transform="",h&&!h.contains(W)&&h.appendChild(W)))}for(const z of Object.values(m))z==null||z.destroy();m={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const[z,W]of Object.entries(c.classes||{}))z!=="container"&&at(f,W);at(h,"is-draggable")}function Ae(){return g||v>0}function He(){return g||v<C.length-1}const Se={add:function(z,W){var Y;let H=b;const K=v,te=Be(),le=r!=null&&r.isRunning()?r.getEndValues().pos:b,P=te&&Math.floor((le-(((Y=C[0])===null||Y===void 0?void 0:Y.pos)||0))/te)||0;return J(z,W),q(A),j(),r&&te&&(K===v&&(H-=P*te),H===_?b=_:r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:H}).to({pos:_}).start()),Ce(),Se},canGoPrev:Ae,canGoNext:He,destroy:function(){return F("destroy"),window.removeEventListener("resize",G),Le(),D.clear(),f=null,C=[],M=[],c=Object.assign({},gn),m={},S=[],i=void 0,A="*",d=2,Se},emit:F,filter:function(z="*"){return q(z),j(),b=Fe(R,b,L),Ce(),F("filter",z),Se},getContainer:function(){return f},getGapDim:ve,getGestures:function(){return o},getLastMouseMove:function(){return Vl},getOption:function(z){return E(z)},getOptions:function(){return c},getPage:function(){return C[v]},getPageIndex:function(z){if(z!==void 0){for(const W of C||[])for(const Y of W.slides)if(Y.index===z)return W.index;return-1}return v},getPageIndexFromPosition:Ne,getPageProgress:function(z,W){var Y;z===void 0&&(z=v);const H=C[z];if(!H)return z>v?-1:1;const K=Be(),te=ve();let le=H.pos,P=Ve();if(g&&W!==!0){const Z=Math.floor((P-((Y=C[0])===null||Y===void 0?void 0:Y.pos))/K)||0;P-=Z*K,le=[le+K,le,le-K].reduce(function(X,me){return Math.abs(me-P)<Math.abs(X-P)?me:X})}return(P-le)/(H.dim+te)||0},getPageVisibility:function(z){var W;z===void 0&&(z=v);const Y=C[z];if(!Y)return z>v?-1:1;const H=Ve(),K=we();let te=Y.pos;if(g){const le=Be(),P=te+(Math.floor((H-((W=C[0])===null||W===void 0?void 0:W.pos))/le)||0)*le;te=[P+le,P,P-le].reduce(function(Z,X){return Math.abs(X-H)<Math.abs(Z-H)?X:Z})}return te>H&&te+Y.dim<H+K?1:te<H?(te+Y.dim-H)/Y.dim||0:te+Y.dim>H+K&&(H+K-te)/Y.dim||0},getPages:function(){return C},getPlugins:function(){return m},getPosition:Ve,getSlides:function(){return M},getState:function(){return d},getTotalSlideDim:Be,getTween:function(){return r},getViewport:function(){return h},getViewportDim:we,getVisibleSlides:function(z){return z===void 0?w:Te(z)},goTo:xe,hasNavigated:function(){return s!==void 0},hideError:he,hideLoading:ne,init:function(){if(!t||!mn(t))throw new Error("No Element found");return d!==0&&(Le(),d=0),f=t,u=n,window.removeEventListener("resize",G),u.breakpoints&&window.addEventListener("resize",G),G(),Se},isInfinite:function(){return g},isInTransition:function(){return N.size>0},isRTL:function(){return y},isSettled:function(){return x},isVertical:function(){return k},localize:function(z,W=[]){return $(z,W)},next:function(z={}){return xe(v+1,z),Se},off:function(z,W){for(const Y of z instanceof Array?z:[z])D.has(Y)&&D.set(Y,D.get(Y).filter(H=>H!==W));return Se},on:function(z,W){for(const Y of z instanceof Array?z:[z])D.set(Y,[...D.get(Y)||[],W]);return Se},prev:function(z={}){return xe(v-1,z),Se},reInit:function(z={},W={}){return Le(),d=0,i=void 0,A="*",n=z,u=z,a=W,G(),Se},remove:function(z){z===void 0&&(z=M.length-1);const W=M[z];return W&&(F("removeSlide",W),W.el&&(ee(W.el),W.el.remove(),W.el=void 0),M.splice(z,1),q(A),j(),b=Fe(R,b,L),Ce()),Se},setPosition:function(z){b=z,re(),Ce()},showError:function(z,W){ne(z),he(z);const Y=z.el;if(Y){const H=document.createElement("div");$e(H,"f-html"),$e(H,"is-error"),H.innerHTML=$(W||"<p>{{ERROR}}</p>"),z.htmlEl=H,$e(Y,"has-html"),$e(Y,"has-error"),Y.insertAdjacentElement("afterbegin",H),F("contentReady",z)}return Se},showLoading:function(z){const W=z.el,Y=W==null?void 0:W.querySelector(".f-spinner");if(!W||Y)return Se;const H=E("spinnerTpl"),K=Vt(H);return K&&($e(K,"f-spinner"),W.insertAdjacentElement("beforeend",K)),Se},version:"6.1.3"};return Se};ma.l10n={en_EN:lo},ma.getDefaults=()=>gn;/*! License details at fancyapps.com/license */const Nl=(t=!0,n="--f-scrollbar-compensate",a="--f-body-margin",o="hide-scrollbar")=>{const r=document,l=r.body,s=r.documentElement;if(t){if(l.classList.contains(o))return;let i=window.innerWidth-s.getBoundingClientRect().width;i<0&&(i=0),s.style.setProperty(n,`${i}px`);const d=parseFloat(window.getComputedStyle(l).marginRight);d&&l.style.setProperty(a,`${d}px`),l.classList.add(o)}else l.classList.remove(o),l.style.setProperty(a,""),r.documentElement.style.setProperty(n,"")};/*! License details at fancyapps.com/license */function fa(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const en=function(t="",n="",a=""){return t.split(n).join(a)};/*! License details at fancyapps.com/license */const Ml={tpl:t=>`<img class="f-panzoom__content"
|
|
7
7
|
${t.srcset?'data-lazy-srcset="{{srcset}}"':""}
|
|
8
8
|
${t.sizes?'data-lazy-sizes="{{sizes}}"':""}
|
|
9
9
|
data-lazy-src="{{src}}" alt="{{alt}}" />`},yu=()=>{let t;function n(c,m){const f=t==null?void 0:t.getOptions().Zoomable;let h=(Qe(f)?Object.assign(Object.assign({},Ml),f):Ml)[c];return h&&typeof h=="function"&&m?h(m):h}function a(){t&&t.getOptions().Zoomable!==!1&&(t.on("addSlide",l),t.on("removeSlide",s),t.on("attachSlideEl",i),t.on("click",r),t.on("change",o),t.on("ready",o))}function o(){d();const c=(t==null?void 0:t.getVisibleSlides())||[];if(c.length>1||(t==null?void 0:t.getOption("transition"))==="slide")for(const m of c){const f=m.panzoomRef;f&&((t==null?void 0:t.getPage().slides)||[]).indexOf(m)<0&&f.execute(Ee.ZoomTo,Object.assign({},f.getStartPosition()))}}function r(c,m){const f=m.target;f&&!m.defaultPrevented&&f.dataset.panzoomAction&&u(f.dataset.panzoomAction)}function l(c,m){const f=m.el;if(!t||!f||m.panzoomRef)return;const h=m.src||m.lazySrc||"",p=m.alt||m.caption||`Image #${m.index}`,g=m.srcset||m.lazySrcset||"",y=m.sizes||m.lazySizes||"";if(h&&Oe(h)&&!m.html&&(!m.type||m.type==="image")){m.type="image",m.thumbSrc=m.thumbSrc||h;let v=n("tpl",m);v=en(v,"{{src}}",h+""),v=en(v,"{{srcset}}",g+""),v=en(v,"{{sizes}}",y+""),f.insertAdjacentHTML("afterbegin",v)}const k=f.querySelector(".f-panzoom__content");if(!k)return;k.setAttribute("alt",p+"");const B=m.width&&m.width!=="auto"?parseFloat(m.width+""):"auto",b=m.height&&m.height!=="auto"?parseFloat(m.height+""):"auto",x=oo(f,Object.assign({width:B,height:b,classes:{container:"f-zoomable"},event:()=>t==null?void 0:t.getLastMouseMove(),spinnerTpl:()=>(t==null?void 0:t.getOption("spinnerTpl"))||""},n("Panzoom")));x.on("*",(v,_,...R)=>{t&&(_==="loading"&&(m.state=0),_==="loaded"&&(m.state=1),_==="error"&&(m.state=2,t==null||t.showError(m,"{{IMAGE_ERROR}}")),t.emit(`panzoom:${_}`,m,...R),_==="ready"&&t.emit("contentReady",m),m.index===(t==null?void 0:t.getPageIndex())&&d())}),m.panzoomRef=x}function s(c,m){m.panzoomRef&&(m.panzoomRef.destroy(),m.panzoomRef=void 0)}function i(c,m){const f=m.panzoomRef;if(f)switch(f.getState()){case 0:f.init();break;case 3:f.execute(Ee.ZoomTo,Object.assign(Object.assign({},f.getStartPosition()),{velocity:0}))}}function d(){var c,m;const f=(t==null?void 0:t.getContainer())||void 0,h=(m=(c=t==null?void 0:t.getPage())===null||c===void 0?void 0:c.slides[0])===null||m===void 0?void 0:m.panzoomRef;if(f)if(h)h.updateControls(f);else for(const p of f.querySelectorAll("[data-panzoom-action]")||[])p.setAttribute("aria-disabled",""),p.setAttribute("tabindex","-1")}function u(c,...m){var f;(f=t==null?void 0:t.getPage().slides[0].panzoomRef)===null||f===void 0||f.execute(c,...m)}return{init:function(c){t=c,t.on("initPlugins",a)},destroy:function(){if(t){t.off("initPlugins",a),t.off("addSlide",l),t.off("removeSlide",s),t.off("attachSlideEl",i),t.off("click",r),t.off("change",o),t.off("ready",o);for(const c of t.getSlides())s(0,c)}t=void 0},execute:u}};/*! License details at fancyapps.com/license */const Al={syncOnChange:!1,syncOnClick:!0,syncOnHover:!1},$l=()=>{let t,n;function a(){const h=t==null?void 0:t.getOptions().Sync;return Qe(h)?Object.assign(Object.assign({},Al),h):Al}function o(h){var p,g,y;t&&h&&(n=h,t.getOptions().classes=Object.assign(Object.assign({},t.getOptions().classes),{isSelected:""}),t.getOptions().initialSlide=((g=(p=n.getPage())===null||p===void 0?void 0:p.slides[0])===null||g===void 0?void 0:g.index)||0,a().syncOnChange&&t.on("change",s),a().syncOnClick&&t.on("click",d),a().syncOnHover&&((y=t.getViewport())===null||y===void 0||y.addEventListener("mouseover",u)),function(){!t||!n||(t.on("ready",l),t.on("refresh",c),n.on("change",i),n.on("filter",m))}())}function r(){const h=a().target;t&&h&&o(h)}function l(){f()}function s(){var h;if(t&&n){const p=((h=t.getPage())===null||h===void 0?void 0:h.slides)||[],g=n.getPageIndex(p[0].index||0);g>-1&&n.goTo(g,t.hasNavigated()?void 0:{tween:!1,transition:!1}),f()}}function i(){var h;if(t&&n){const p=t.getPageIndex(((h=n.getPage())===null||h===void 0?void 0:h.slides[0].index)||0);p>-1&&t.goTo(p,n.hasNavigated()?void 0:{tween:!1,transition:!1}),f()}}function d(h,p){var g;if(!t||!n||!((g=t.getTween())===null||g===void 0)&&g.isRunning())return;const y=t==null?void 0:t.getOptions().classes.slide;if(!y)return;const k=y?p.target.closest(`.${y}`):null;if(k){const B=parseInt(k.getAttribute("index")||"")||0,b=n.getPageIndex(B);n.goTo(b)}}function u(h){t&&d(0,h)}function c(){var h;if(t&&n){const p=t.getPageIndex(((h=n.getPage())===null||h===void 0?void 0:h.slides[0].index)||0);p>-1&&t.goTo(p,{tween:!1,transition:!1}),f()}}function m(h,p){t&&n&&(t.filter(p),i())}function f(){var h,p,g;if(!n)return;const y=((p=(h=n.getPage())===null||h===void 0?void 0:h.slides[0])===null||p===void 0?void 0:p.index)||0;for(const k of(t==null?void 0:t.getSlides())||[])(g=k.el)===null||g===void 0||g.classList.toggle("is-selected",k.index===y)}return{init:function(h){t=h,t.on("initSlides",r)},destroy:function(){var h;t==null||t.off("ready",l),t==null||t.off("refresh",c),t==null||t.off("change",s),t==null||t.off("click",d),(h=t==null?void 0:t.getViewport())===null||h===void 0||h.removeEventListener("mouseover",u),n==null||n.off("change",i),n==null||n.off("filter",m),n=void 0,t==null||t.off("initSlides",r),t=void 0},getTarget:function(){return n}}};/*! License details at fancyapps.com/license */const _l={showLoading:!0,preload:1},pa="is-lazyloading",Dl="is-lazyloaded",Tl="has-lazyerror",Ll=()=>{let t;function n(){const r=t==null?void 0:t.getOptions().Lazyload;return Qe(r)?Object.assign(Object.assign({},_l),r):_l}function a(r){var l;const s=r.el;if(!s)return;const i="[data-lazy-src],[data-lazy-srcset],[data-lazy-bg]",d=Array.from(s.querySelectorAll(i));s.matches(i)&&d.push(s);for(const u of d){const c=u.dataset.lazySrc,m=u.dataset.lazySrcset,f=u.dataset.lazySizes,h=u.dataset.lazyBg,p=(u instanceof HTMLImageElement||u instanceof HTMLSourceElement)&&(c||m),g=u instanceof HTMLElement&&h;if(!p&&!g)continue;const y=c||m||h;if(y){if(p&&y){const k=(l=u.parentElement)===null||l===void 0?void 0:l.classList.contains("f-panzoom__wrapper");n().showLoading&&(t==null||t.showLoading(r)),u.addEventListener("load",()=>{t==null||t.hideLoading(r),at(u,Tl),u instanceof HTMLImageElement?u.decode().then(()=>{at(u,pa),$e(u,Dl)}):(at(u,pa),$e(u,Dl)),k||t==null||t.emit("lazyLoad:loaded",r,u,y)}),u.addEventListener("error",()=>{t==null||t.hideLoading(r),at(u,pa),$e(u,Tl),k||t==null||t.emit("lazyLoad:error",r,u,y)}),u.classList.add("f-lazyload"),u.classList.add(pa),k||t==null||t.emit("lazyLoad:load",r,u,y),c&&(u.src=c),m&&(u.srcset=m),f&&(u.sizes=f)}else g&&(document.body.contains(u)||(document.createElement("img").src=h),u.style.backgroundImage=`url('${h}')`);delete u.dataset.lazySrc,delete u.dataset.lazySrcset,delete u.dataset.lazySizes,delete u.dataset.lazyBg}}}function o(){if(!t)return;const r=[...t.getVisibleSlides()],l=n().preload;if(l>0){const s=t.getPosition(),i=t.getViewportDim();r.push(...t.getVisibleSlides(s+i*l),...t.getVisibleSlides(s-i*l))}for(const s of r)a(s)}return{init:function(r){t=r,t.on("render",o)},destroy:function(){t==null||t.off("render",o),t=void 0}}};/*! License details at fancyapps.com/license */const Fl='<svg width="24" height="24" viewBox="0 0 24 24" tabindex="-1">',Pl="</svg>",zl={prevTpl:Fl+'<path d="M15 3l-9 9 9 9"></path>'+Pl,nextTpl:Fl+'<path d="M9 3l9 9-9 9"></path>'+Pl},ku=()=>{let t,n,a;function o(){const i=t==null?void 0:t.getOptions().Arrows;return Qe(i)?Object.assign(Object.assign({},zl),i):zl}function r(i){if(!t)return;const d=`<button data-carousel-go-${i} tabindex="0" class="f-button is-arrow is-${i}" title="{{${i.toUpperCase()}}}">`+o()[`${i}Tpl`]+"</button",u=Vt(t.localize(d))||void 0;return u&&$e(u,o()[`${i}Class`]),u}function l(){var i;n==null||n.remove(),n=void 0,a==null||a.remove(),a=void 0,(i=t==null?void 0:t.getContainer())===null||i===void 0||i.classList.remove("has-arrows")}function s(){t&&t.getOptions().Arrows!==!1&&t.getPages().length>1?(function(){if(!t)return;const i=t.getViewport();i&&(n||(n=r("prev"),n&&i.insertAdjacentElement("beforebegin",n)),a||(a=r("next"),a&&i.insertAdjacentElement("afterend",a)),Ke(t.getContainer(),"has-arrows",!(!n&&!a)))}(),t&&(n==null||n.toggleAttribute("aria-disabled",!t.canGoPrev()),a==null||a.toggleAttribute("aria-disabled",!t.canGoNext()))):l()}return{init:function(i){t=i.on(["change","refresh"],s)},destroy:function(){l(),t==null||t.off(["change","refresh"],s),t=void 0}}};/*! License details at fancyapps.com/license */const Ol='<circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/>',so='<g><line x1="11" y1="8" x2="11" y2="14"></line></g>'+Ol,bu={moveLeft:["moveLeft","MOVE_LEFT",'<path d="M5 12h14M5 12l6 6M5 12l6-6"/>'],moveRight:["moveRight","MOVE_RIGHT",'<path d="M5 12h14M13 18l6-6M13 6l6 6"/>'],moveUp:["moveUp","MOVE_UP",'<path d="M12 5v14M18 11l-6-6M6 11l6-6"/>'],moveDown:["moveDown","MOVE_DOWN",'<path d="M12 5v14M18 13l-6 6M6 13l6 6"/>'],zoomOut:["zoomOut","ZOOM_OUT",Ol],zoomIn:["zoomIn","ZOOM_IN",so],toggleFull:["toggleFull","TOGGLE_FULL",so],iterateZoom:["iterateZoom","ITERATE_ZOOM",so],toggle1to1:["toggleFull","TOGGLE_FULL",'<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"/>'],rotateCCW:["rotateCCW","ROTATE_CCW",'<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"/>'],rotateCW:["rotateCW","ROTATE_CW",'<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"/>'],flipX:["flipX","FLIP_X",'<path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/>'],flipY:["flipY","FLIP_Y",'<path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/>'],reset:["reset","RESET",'<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"/>'],toggleFS:["toggleFS","TOGGLE_FS",'<g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g>']},io={};for(const[t,n]of Object.entries(bu))io[t]={tpl:`<button data-panzoom-action="${n[0]}" class="f-button" title="{{${n[1]}}}"><svg>${n[2]}</svg></button>`};/*! License details at fancyapps.com/license */var Rl;(function(t){t.Left="left",t.middle="middle",t.right="right"})(Rl||(Rl={}));const Hl=Object.assign({counter:{tpl:'<div class="f-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>'}},io),jl={absolute:!1,display:{left:[],middle:["zoomIn","zoomOut","toggle1to1","rotateCCW","rotateCW","flipX","flipY","reset"],right:[]},enabled:"auto",items:{}},Gl=()=>{let t,n;function a(r){const l=t==null?void 0:t.getOptions().Toolbar;let s=(Qe(l)?Object.assign(Object.assign({},jl),l):jl)[r];return s&&typeof s=="function"&&t?s(t):s}function o(){var r,l;if(!(t!=null&&t.getOptions().Toolbar)||!t||n)return;const s=t.getContainer();if(!s)return;let i=a("enabled");if(!i)return;const d=a("absolute"),u=t.getSlides().length>1;let c=!1,m=!1;for(const k of t.getSlides())k.panzoomRef&&(c=!0),(k.downloadSrc||k.type==="image"&&k.src)&&(m=!0);const f=((r=t.getPlugins().Thumbs)===null||r===void 0?void 0:r.isEnabled())||!1,h=u&&t.getPlugins().Autoplay||!1,p=t.getPlugins().Fullscreen&&(document.fullscreenEnabled||document.webkitFullscreenEnabled);if(i==="auto"&&(i=c),!i)return;n=s.querySelector(".f-carousel__toolbar")||void 0,n||(n=document.createElement("div"),n.classList.add("f-carousel__toolbar"));const g=a("display"),y=ct({},Hl,a("items"));for(const k of["left","middle","right"]){const B=g[k]||[],b=document.createElement("div");b.classList.add("f-carousel__toolbar__column"),b.classList.add(`is-${k}`);for(const x of B){let v;if(Oe(x)){if(x==="counter"&&!u||x==="autoplay"&&!h||io[x]&&!c||x==="fullscreen"&&!p||x==="thumbs"&&!f||x==="download"&&!m)continue;v=y[x]}if(Qe(x)&&(v=x),v&&v.tpl){let _=t.localize(v.tpl);_=_.split("<svg>").join('<svg tabindex="-1" width="24" height="24" viewBox="0 0 24 24">');const R=Vt(_);R&&(typeof v.click=="function"&&t&&R.addEventListener("click",L=>{L.preventDefault(),L.stopPropagation(),typeof v.click=="function"&&t&&v.click(t,L)}),b.append(R))}}n.append(b)}if(n.childElementCount){if(d&&n.classList.add("is-absolute"),!n.parentElement){const k=a("parentEl");k?k.insertAdjacentElement("afterbegin",n):(l=t.getViewport())===null||l===void 0||l.insertAdjacentElement("beforebegin",n)}s.contains(n)&&s.classList.add("has-toolbar")}}return{init:function(r){t=r,t==null||t.on("initSlides",o)},destroy:function(){var r;t==null||t.off("initSlides",o),(r=t==null?void 0:t.getContainer())===null||r===void 0||r.classList.remove("has-toolbar"),n==null||n.remove(),n=void 0},add:function(r,l){Hl[r]=l},isEnabled:function(){return!!n}}};/*! License details at fancyapps.com/license */const Il={autoStart:!0,pauseOnHover:!0,showProgressbar:!0,timeout:2e3},xu=()=>{let t,n,a=!1,o=!1,r=!1,l=null;function s(v){const _=t==null?void 0:t.getOptions().Autoplay;let R=(Qe(_)?Object.assign(Object.assign({},Il),_):Il)[v];return R&&typeof R=="function"&&t?R(t):R}function i(){clearTimeout(n),n=void 0}function d(){if(!t||!a||r||o||n||!t.isSettled()||function(){var _;const R=((_=t==null?void 0:t.getPage())===null||_===void 0?void 0:_.slides)||[];for(const L of R)if(L.state===0)return!0;return!1}())return;(function(){var _,R,L,A;if(!t||(m(),!s("showProgressbar")))return;let M=s("progressbarParentEl");if(!M&&(!((_=t.getPlugins().Toolbar)===null||_===void 0)&&_.isEnabled())&&(M=t.getContainer()),!M&&((R=t.getPlugins().Toolbar)===null||R===void 0?void 0:R.isEnabled())!==!0){const N=((L=t.getPages()[0])===null||L===void 0?void 0:L.slides)||[],w=((A=t.getPage())===null||A===void 0?void 0:A.slides)||[];N.length===1&&w.length===1&&(M=w[0].el)}if(M||(M=t.getViewport()),!M)return;l=document.createElement("div"),$e(l,"f-progressbar"),M.prepend(l);const S=s("timeout")||1e3;l.style.animationDuration=`${S}ms`})();const v=s("timeout");n=setTimeout(()=>{t&&a&&!o&&(t.isInfinite()||t.getPageIndex()!==t.getPages().length-1?t.next():t.goTo(0))},v)}function u(){var v;if(!t||t.getPages().length<2||t.getOptions().Autoplay===!1||a)return;a=!0,t.emit("autoplay:start",s("timeout")),$e(t.getContainer(),"has-autoplay"),(v=t.getTween())===null||v===void 0||v.on("start",k);const _=t==null?void 0:t.getContainer();_&&s("pauseOnHover")&&matchMedia("(hover: hover)").matches&&(_.addEventListener("mouseenter",B,!1),_.addEventListener("mouseleave",b,!1)),t.on("change",g),t.on("settle",y),t.on("contentReady",h),t.on("panzoom:touchStart",c),t.on("panzoom:wheel",c),t.isSettled()&&d()}function c(){var v;if(i(),m(),t){if(a){t.emit("autoplay:end"),(v=t.getTween())===null||v===void 0||v.off("start",k);const _=t.getContainer();_&&(_.classList.remove("has-autoplay"),_.removeEventListener("mouseenter",B,!1),_.removeEventListener("mouseleave",b,!1))}t.off("change",g),t.off("settle",y),t.off("contentReady",h),t.off("panzoom:touchStart",c),t.off("panzoom:wheel",c)}a=!1,o=!1}function m(){l&&(l.remove(),l=null)}function f(){t&&t.getPages().length>1&&s("autoStart")&&u()}function h(){d()}function p(v,_){const R=_.target;R&&!_.defaultPrevented&&R.dataset.autoplayAction==="toggle"&&x.toggle()}function g(){!t||!(t!=null&&t.isInfinite())&&t.getPageIndex()===t.getPages().length-1?c():(m(),i())}function y(){d()}function k(){i(),m()}function B(){r=!0,a&&(m(),i())}function b(){r=!1,a&&!o&&(t!=null&&t.isSettled())&&d()}const x={init:function(v){t=v,t.on("ready",f),t.on("click",p)},destroy:function(){c(),t==null||t.off("ready",f),t==null||t.off("click",p),t=void 0},isEnabled:()=>a,pause:function(){o=!0,i()},resume:function(){o=!1,a&&!r&&d()},start(){u()},stop(){c()},toggle(){a?c():u()}};return x};/*! License details at fancyapps.com/license */const co={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 uo;const wu=()=>{let t,n,a,o,r,l=0,s=0,i=!0;function d(w){const C=t==null?void 0:t.getOptions().Thumbs;let O=(Qe(C)?Object.assign(Object.assign({},co),C):co)[w];return O&&typeof O=="function"&&t?O(t):O}function u(){if(!t||(t==null?void 0:t.getOptions().Thumbs)===!1)return!1;let w=0;for(const C of t.getSlides())C.thumbSrc&&w++;return w>=d("minCount")}function c(){return d("type")==="modern"}function m(){return d("type")==="scrollable"}function f(){const w=[],C=(t==null?void 0:t.getSlides())||[];for(const O of C)w.push({index:O.index,class:O.thumbClass,html:h(O)});return w}function h(w){const C=w.thumb?w.thumb instanceof HTMLImageElement?w.thumb.src:w.thumb:w.thumbSrc||void 0,O=w.thumbAlt===void 0?`Thumbnail #${w.index}`:w.thumbAlt+"";let T=d("thumbTpl");return T=en(T,"{{alt}}",O),T=en(T,"{{src}}",C+""),T=en(T,"{{index}}",`${w.index}`),T=en(T,"{{page}}",`${w.index||1}`),T}function p(w){return`<div index="${w.index||0}" class="f-thumbs__slide ${w.class||""}">${w.html||""}</div>`}function g(w=!1){var C;const O=t==null?void 0:t.getContainer();if(!t||!O||a||!u())return;const T=((C=d("Carousel"))===null||C===void 0?void 0:C.classes)||{};if(T.container=T.container||"f-thumbs",!a){const V=O.nextElementSibling;V!=null&&V.classList.contains(T.container)&&(a=V)}if(!a){a=document.createElement("div");const V=d("parentEl");V?V.insertAdjacentElement("beforeend",a):O.insertAdjacentElement("afterend",a)}$e(a,T.container),$e(a,"f-thumbs"),$e(a,`is-${d("type")}`),w&&$e(a,"is-hidden")}function y(){if(!a||!m())return;o=document.createElement("div"),$e(o,"f-thumbs__viewport");let w="";for(const C of f())typeof(C.html||"")=="string"&&(w+=p(C));o.innerHTML=w,a.append(o),a.addEventListener("click",C=>{C.preventDefault();const O=C.target.closest("[index]"),T=parseInt((O==null?void 0:O.getAttribute("index"))||"-1");t&&T>-1&&t.goTo(T)}),r=new IntersectionObserver(C=>{C.forEach(O=>{O.isIntersecting&&O.target instanceof HTMLImageElement&&(O.target.src=O.target.getAttribute("data-lazy-src")+"",O.target.removeAttribute("data-lazy-src"),r==null||r.unobserve(O.target))})},{root:o,rootMargin:"100px"}),a.querySelectorAll("[data-lazy-src]").forEach(C=>{r==null||r.observe(C)}),t==null||t.emit("thumbs:ready")}function k(){var w;if(!uo||!t||!a||m()||n)return;const C=f();if(!C.length)return;const O=ct({},{Sync:{target:t},Lazyload:{preload:1},slides:C,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",slide:"f-thumbs__slide"},center:!0,fill:!c(),infinite:!1,dragFree:!0,rtl:t.getOptions().rtl||!1,slidesPerPage:T=>{let V=0;return c()&&(function(){if(!c()||!a)return;const E=$=>a&&parseFloat(getComputedStyle(a).getPropertyValue("--f-thumb-"+$))||0;l=E("width"),s=E("clip-width")}(),V=4*(l-s)),T&&T.getTotalSlideDim()<=T.getViewportDim()-V?1/0:1}},co.Carousel||{},d("Carousel")||{});n=uo(a,O,{Sync:$l,Lazyload:Ll}),n.on("ready",()=>{$e(a,"is-syncing"),t==null||t.emit("thumbs:ready"),c()&&(t==null||t.on("render",v))}),n.on("destroy",()=>{t==null||t.emit("thumbs:destroy")}),n.init(),(w=n.getGestures())===null||w===void 0||w.on("start",()=>{i=!1}),n.on("click",(T,V)=>{const E=V.target;if(E){const $=E.matches("button")?E:E.firstElementChild;$&&$.matches("button")&&(V.preventDefault(),$.focus({preventScroll:!0}))}}),$e(t.getContainer(),"has-thumbs"),N()}function B(){u()&&d("showOnStart")&&(g(),y())}function b(){var w;u()&&(k(),t==null||t.on("addSlide",R),t==null||t.on("removeSlide",L),t==null||t.on("click",A),t==null||t.on("refresh",M),(w=t==null?void 0:t.getGestures())===null||w===void 0||w.on("start",x),S(!0))}function x(){var w,C;i=!0,!((w=document.activeElement)===null||w===void 0)&&w.closest(".f-thumbs")&&((C=document.activeElement)===null||C===void 0||C.blur())}function v(){var w,C;a==null||a.classList.toggle("is-syncing",(t==null?void 0:t.hasNavigated())===!1||((w=t==null?void 0:t.getTween())===null||w===void 0?void 0:w.isRunning())),N(),!((C=t==null?void 0:t.getGestures())===null||C===void 0)&&C.isPointerDown()&&function(){if(!c()||!t||!n||!i)return;const O=n.getTween(),T=n.getPages(),V=t.getPageIndex()||0,E=t.getPageProgress()||0;if(!(t&&T&&T[V]&&O))return;const $=O.isRunning()?O.getCurrentValues().pos:n.getPosition();if($===void 0)return;let D=T[V].pos+E*(l-s);D=Fe(T[0].pos,D,T[T.length-1].pos),O.from({pos:$}).to({pos:D}).start()}()}function _(){i=!0,S()}function R(w,C){const O={html:h(C)};if(n)n.add(O,C.index);else if(o){const T=Vt(p(O));if(T){o.append(T);const V=T.querySelector("img");V&&(r==null||r.observe(V))}}}function L(w,C){var O;n?n.remove(C.index):o&&((O=o.querySelector(`[index="${C.index}"]`))===null||O===void 0||O.remove())}function A(w,C){var O;const T=C.target;C.defaultPrevented||((O=T==null?void 0:T.dataset)===null||O===void 0?void 0:O.thumbsAction)!=="toggle"||(a||(g(!0),y(),k()),a&&a.classList.toggle("is-hidden"))}function M(){S()}function S(w=!1){if(!t||!o||!m())return;const C=t.getPageIndex();o.querySelectorAll(".is-selected").forEach(T=>{T.classList.remove("is-selected")});const O=o.querySelector(`[index="${C}"]`);if(O){O.classList.add("is-selected");const T=o.getBoundingClientRect(),V=O.getBoundingClientRect(),E=O.offsetTop-o.offsetTop-.5*T.height+.5*V.height,$=O.scrollLeft-o.scrollLeft-.5*T.width+.5*V.width;o.scrollTo({top:E,left:$,behavior:w?"instant":"smooth"})}}function N(){if(!c()||!t||!n)return;const w=(n==null?void 0:n.getSlides())||[];let C=-.5*l;for(const O of w){const T=O.el;if(!T)continue;let V=t.getPageProgress(O.index)||0;V=Math.max(-1,Math.min(1,V)),V>-1&&V<1&&(C+=.5*l*(1-Math.abs(V))),V=Math.round(1e4*V)/1e4,C=Math.round(1e4*C)/1e4,T.style.setProperty("--progress",`${Math.abs(V)}`),T.style.setProperty("--shift",`${t!=null&&t.isRTL()?-1*C:C}px`),V>-1&&V<1&&(C+=.5*l*(1-Math.abs(V)))}}return{init:function(w,C){uo=C,t=w,t.on("ready",b),t.on("initSlides",B),t.on("change",_)},destroy:function(){var w,C;m()&&(t==null||t.emit("thumbs:destroy")),t==null||t.off("ready",b),t==null||t.off("initSlides",B),t==null||t.off("change",_),t==null||t.off("render",v),t==null||t.off("addSlide",R),t==null||t.off("click",A),t==null||t.off("refresh",M),(w=t==null?void 0:t.getGestures())===null||w===void 0||w.off("start",x),(C=t==null?void 0:t.getContainer())===null||C===void 0||C.classList.remove("has-thumbs"),t=void 0,n==null||n.destroy(),n=void 0,a==null||a.remove(),a=void 0},getCarousel:function(){return n},getContainer:function(){return a},getType:function(){return d("type")},isEnabled:u}};/*! License details at fancyapps.com/license */const ql={iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"}},Eu=()=>{let t;function n(r,l){let s=l.src;if(!Oe(s))return;let i=l.type;if(!i){if(i||(s.charAt(0)==="#"?i="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)?i="image":s.match(/\.(pdf)((\?|#).*)?$/i)?i="pdf":s.match(/\.(html|php)((\?|#).*)?$/i)&&(i="iframe")),!i){const d=s.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i);d&&(s=`https://maps.google.${d[1]}/?ll=${(d[2]?d[2]+"&z="+Math.floor(parseFloat(d[3]))+(d[4]?d[4].replace(/^\//,"&"):""):d[4]+"").replace(/\?/,"&")}&output=${d[4]&&d[4].indexOf("layer=c")>0?"svembed":"embed"}`,i="gmap")}if(!i){const d=s.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i);d&&(s=`https://maps.google.${d[1]}/maps?q=${d[2].replace("query=","q=").replace("api=1","")}&output=embed`,i="gmap")}l.src=s,l.type=i}}function a(r,l){l.type!=="iframe"&&l.type!=="pdf"&&l.type!=="gmap"||function(s){if(!t||!s.el||!s.src)return;const i=document.createElement("iframe");i.classList.add("f-iframe");for(const[u,c]of Object.entries(function(){const m=t==null?void 0:t.getOptions().Html;return Qe(m)?Object.assign(Object.assign({},ql),m):ql}().iframeAttr||{}))i.setAttribute(u,c);i.onerror=()=>{t&&t.getState()===1&&t.showError(s,"{{IFRAME_ERROR}}")},i.src=s.src;const d=document.createElement("div");if(d.classList.add("f-html"),d.append(i),s.width){let u=`${s.width}`;u.match(/^\d+$/)&&(u+="px"),d.style.maxWidth=`${u}`}if(s.height){let u=`${s.height}`;u.match(/^\d+$/)&&(u+="px"),d.style.maxHeight=`${u}`}if(s.aspectRatio){const u=s.el.getBoundingClientRect();d.style.aspectRatio=`${s.aspectRatio}`,d.style[u.width>u.height?"width":"height"]="auto",d.style[u.width>u.height?"maxWidth":"maxHeight"]="none"}s.contentEl=i,s.htmlEl=d,s.el.classList.add("has-html"),s.el.classList.add("has-iframe"),s.el.classList.add(`has-${s.type}`),s.el.prepend(d),t.emit("contentReady",s)}(l)}function o(r,l){var s,i;l.type!=="iframe"&&l.type!=="pdf"&&l.type!=="gmap"||(t==null||t.hideError(l),(s=l.contentEl)===null||s===void 0||s.remove(),l.contentEl=void 0,(i=l.htmlEl)===null||i===void 0||i.remove(),l.htmlEl=void 0)}return{init:function(r){t=r,t.on("addSlide",n),t.on("attachSlideEl",a),t.on("detachSlideEl",o)},destroy:function(){t==null||t.off("addSlide",n),t==null||t.off("attachSlideEl",a),t==null||t.off("detachSlideEl",o),t=void 0}}};/*! License details at fancyapps.com/license */const Wl=(t,n={})=>{const a=new URL(t),o=new URLSearchParams(a.search),r=new URLSearchParams;for(const[i,d]of[...o,...Object.entries(n)]){let u=d+"";if(i==="t"){let c=u.match(/((\d*)m)?(\d*)s?/);c&&r.set("start",60*parseInt(c[2]||"0")+parseInt(c[3]||"0")+"")}else r.set(i,u)}let l=r+"",s=t.match(/#t=((.*)?\d+s)/);return s&&(l+=`#t=${s[1]}`),l},Ul={autoplay:!1,html5videoTpl:`<video class="f-html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">
|