sm-click-library-ui 0.0.427 → 0.0.428

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...a){const o=new this(n);return a.forEach(r=>o.set(r)),o}static accessor(n){const o=(this[Oo]=this[Oo]={accessors:{}}).accessors,r=this.prototype;function i(s){const l=fn(s);o[l]||(rs(r,s),o[l]=!0)}return U.isArray(n)?n.forEach(i):i(n),this}};tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(tt.prototype,({value:t},n)=>{let a=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(o){this[a]=o}}}),U.freezeMethods(tt);function ya(t,n){const a=this||un,o=n||a,r=tt.from(o.headers);let i=o.data;return U.forEach(t,function(l){i=l.call(a,i,r.normalize(),n?n.status:void 0)}),r.normalize(),i}function _o(t){return!!(t&&t.__CANCEL__)}function Wt(t,n,a){Se.call(this,t??"canceled",Se.ERR_CANCELED,n,a),this.name="CanceledError"}U.inherits(Wt,Se,{__CANCEL__:!0});function Ho(t,n,a){const o=a.config.validateStatus;!a.status||!o||o(a.status)?t(a):n(new Se("Request failed with status code "+a.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function is(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function ss(t,n){t=t||10;const a=new Array(t),o=new Array(t);let r=0,i=0,s;return n=n!==void 0?n:1e3,function(d){const u=Date.now(),c=o[i];s||(s=u),a[r]=d,o[r]=u;let m=i,h=0;for(;m!==r;)h+=a[m++],m=m%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),u-s<n)return;const p=c&&u-c;return p?Math.round(h*1e3/p):void 0}}function ls(t,n){let a=0,o=1e3/n,r,i;const s=(u,c=Date.now())=>{a=c,r=null,i&&(clearTimeout(i),i=null),t(...u)};return[(...u)=>{const c=Date.now(),m=c-a;m>=o?s(u,c):(r=u,i||(i=setTimeout(()=>{i=null,s(r)},o-m)))},()=>r&&s(r)]}const Dn=(t,n,a=3)=>{let o=0;const r=ss(50,250);return ls(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,d=s-o,u=r(d),c=s<=l;o=s;const m={loaded:s,total:l,progress:l?s/l:void 0,bytes:d,rate:u||void 0,estimated:u&&l&&c?(l-s)/u:void 0,event:i,lengthComputable:l!=null,[n?"download":"upload"]:!0};t(m)},a)},Ro=(t,n)=>{const a=t!=null;return[o=>n[0]({lengthComputable:a,total:t,loaded:o}),n[1]]},zo=t=>(...n)=>U.asap(()=>t(...n)),cs=Ue.hasStandardBrowserEnv?((t,n)=>a=>(a=new URL(a,Ue.origin),t.protocol===a.protocol&&t.host===a.host&&(n||t.port===a.port)))(new URL(Ue.origin),Ue.navigator&&/(msie|trident)/i.test(Ue.navigator.userAgent)):()=>!0,ds=Ue.hasStandardBrowserEnv?{write(t,n,a,o,r,i,s){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(n)}`];U.isNumber(a)&&l.push(`expires=${new Date(a).toUTCString()}`),U.isString(o)&&l.push(`path=${o}`),U.isString(r)&&l.push(`domain=${r}`),i===!0&&l.push("secure"),U.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.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 us(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function fs(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function jo(t,n,a){let o=!us(n);return t&&(o||a==!1)?fs(t,n):n}const Go=t=>t instanceof tt?{...t}:t;function Lt(t,n){n=n||{};const a={};function o(u,c,m,h){return U.isPlainObject(u)&&U.isPlainObject(c)?U.merge.call({caseless:h},u,c):U.isPlainObject(c)?U.merge({},c):U.isArray(c)?c.slice():c}function r(u,c,m,h){if(U.isUndefined(c)){if(!U.isUndefined(u))return o(void 0,u,m,h)}else return o(u,c,m,h)}function i(u,c){if(!U.isUndefined(c))return o(void 0,c)}function s(u,c){if(U.isUndefined(c)){if(!U.isUndefined(u))return o(void 0,u)}else return o(void 0,c)}function l(u,c,m){if(m in n)return o(u,c);if(m in t)return o(void 0,u)}const d={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,c,m)=>r(Go(u),Go(c),m,!0)};return U.forEach(Object.keys({...t,...n}),function(c){const m=d[c]||r,h=m(t[c],n[c],c);U.isUndefined(h)&&m!==l||(a[c]=h)}),a}const Io=t=>{const n=Lt({},t);let{data:a,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:i,headers:s,auth:l}=n;if(n.headers=s=tt.from(s),n.url=Fo(jo(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),U.isFormData(a)){if(Ue.hasStandardBrowserEnv||Ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(U.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(Ue.hasStandardBrowserEnv&&(o&&U.isFunction(o)&&(o=o(n)),o||o!==!1&&cs(n.url))){const d=r&&i&&ds.read(i);d&&s.set(r,d)}return n},ms=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(a,o){const r=Io(t);let i=r.data;const s=tt.from(r.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:u}=r,c,m,h,p,f;function g(){p&&p(),f&&f(),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 E=tt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),M={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:E,config:t,request:y};Ho(function(_){a(_),g()},function(_){o(_),g()},M),y=null}"onloadend"in y?y.onloadend=k:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(k)},y.onabort=function(){y&&(o(new Se("Request aborted",Se.ECONNABORTED,t,y)),y=null)},y.onerror=function(B){const M=B&&B.message?B.message:"Network Error",T=new Se(M,Se.ERR_NETWORK,t,y);T.event=B||null,o(T),y=null},y.ontimeout=function(){let B=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const M=r.transitional||$o;r.timeoutErrorMessage&&(B=r.timeoutErrorMessage),o(new Se(B,M.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,t,y)),y=null},i===void 0&&s.setContentType(null),"setRequestHeader"in y&&U.forEach(s.toJSON(),function(B,M){y.setRequestHeader(M,B)}),U.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),l&&l!=="json"&&(y.responseType=r.responseType),u&&([h,f]=Dn(u,!0),y.addEventListener("progress",h)),d&&y.upload&&([m,p]=Dn(d),y.upload.addEventListener("progress",m),y.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(c=E=>{y&&(o(!E||E.type?new Wt(null,t,y):E),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));const x=is(r.url);if(x&&Ue.protocols.indexOf(x)===-1){o(new Se("Unsupported protocol "+x+":",Se.ERR_BAD_REQUEST,t));return}y.send(i||null)})},hs=(t,n)=>{const{length:a}=t=t?t.filter(Boolean):[];if(n||a){let o=new AbortController,r;const i=function(u){if(!r){r=!0,l();const c=u instanceof Error?u:this.reason;o.abort(c instanceof Se?c:new Wt(c instanceof Error?c.message:c))}};let s=n&&setTimeout(()=>{s=null,i(new Se(`timeout ${n} of ms exceeded`,Se.ETIMEDOUT))},n);const l=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:d}=o;return d.unsubscribe=()=>U.asap(l),d}},ps=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},gs=async function*(t,n){for await(const a of ys(t))yield*ps(a,n)},ys=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()}},qo=(t,n,a,o)=>{const r=gs(t,n);let i=0,s,l=d=>{s||(s=!0,o&&o(d))};return new ReadableStream({async pull(d){try{const{done:u,value:c}=await r.next();if(u){l(),d.close();return}let m=c.byteLength;if(a){let h=i+=m;a(h)}d.enqueue(new Uint8Array(c))}catch(u){throw l(u),u}},cancel(d){return l(d),r.return()}},{highWaterMark:2})},Wo=64*1024,{isFunction:Fn}=U,ks=(({Request:t,Response:n})=>({Request:t,Response:n}))(U.global),{ReadableStream:Uo,TextEncoder:Zo}=U.global,Yo=(t,...n)=>{try{return!!t(...n)}catch{return!1}},xs=t=>{t=U.merge.call({skipUndefined:!0},ks,t);const{fetch:n,Request:a,Response:o}=t,r=n?Fn(n):typeof fetch=="function",i=Fn(a),s=Fn(o);if(!r)return!1;const l=r&&Fn(Uo),d=r&&(typeof Zo=="function"?(f=>g=>f.encode(g))(new Zo):async f=>new Uint8Array(await new a(f).arrayBuffer())),u=i&&l&&Yo(()=>{let f=!1;const g=new a(Ue.origin,{body:new Uo,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!g}),c=s&&l&&Yo(()=>U.isReadableStream(new o("").body)),m={stream:c&&(f=>f.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!m[f]&&(m[f]=(g,y)=>{let k=g&&g[f];if(k)return k.call(g);throw new Se(`Response type '${f}' is not supported`,Se.ERR_NOT_SUPPORT,y)})});const h=async f=>{if(f==null)return 0;if(U.isBlob(f))return f.size;if(U.isSpecCompliantForm(f))return(await new a(Ue.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(U.isArrayBufferView(f)||U.isArrayBuffer(f))return f.byteLength;if(U.isURLSearchParams(f)&&(f=f+""),U.isString(f))return(await d(f)).byteLength},p=async(f,g)=>{const y=U.toFiniteNumber(f.getContentLength());return y??h(g)};return async f=>{let{url:g,method:y,data:k,signal:x,cancelToken:E,timeout:B,onDownloadProgress:M,onUploadProgress:T,responseType:_,headers:C,withCredentials:w="same-origin",fetchOptions:P}=Io(f),F=n||fetch;_=_?(_+"").toLowerCase():"text";let H=hs([x,E&&E.toAbortSignal()],B),V=null;const v=H&&H.unsubscribe&&(()=>{H.unsubscribe()});let $;try{if(T&&u&&y!=="get"&&y!=="head"&&($=await p(C,k))!==0){let O=new a(g,{method:"POST",body:k,duplex:"half"}),oe;if(U.isFormData(k)&&(oe=O.headers.get("content-type"))&&C.setContentType(oe),O.body){const[de,pe]=Ro($,Dn(zo(T)));k=qo(O.body,Wo,de,pe)}}U.isString(w)||(w=w?"include":"omit");const Z=i&&"credentials"in a.prototype,Q={...P,signal:H,method:y.toUpperCase(),headers:C.normalize().toJSON(),body:k,duplex:"half",credentials:Z?w:void 0};V=i&&new a(g,Q);let ee=await(i?F(V,P):F(g,Q));const L=c&&(_==="stream"||_==="response");if(c&&(M||L&&v)){const O={};["status","statusText","headers"].forEach(ye=>{O[ye]=ee[ye]});const oe=U.toFiniteNumber(ee.headers.get("content-length")),[de,pe]=M&&Ro(oe,Dn(zo(M),!0))||[];ee=new o(qo(ee.body,Wo,de,()=>{pe&&pe(),v&&v()}),O)}_=_||"text";let R=await m[U.findKey(m,_)||"text"](ee,f);return!L&&v&&v(),await new Promise((O,oe)=>{Ho(O,oe,{data:R,headers:tt.from(ee.headers),status:ee.status,statusText:ee.statusText,config:f,request:V})})}catch(Z){throw v&&v(),Z&&Z.name==="TypeError"&&/Load failed|fetch/i.test(Z.message)?Object.assign(new Se("Network Error",Se.ERR_NETWORK,f,V),{cause:Z.cause||Z}):Se.from(Z,Z&&Z.code,f,V)}}},bs=new Map,Xo=t=>{let n=t&&t.env||{};const{fetch:a,Request:o,Response:r}=n,i=[o,r,a];let s=i.length,l=s,d,u,c=bs;for(;l--;)d=i[l],u=c.get(d),u===void 0&&c.set(d,u=l?new Map:xs(n)),c=u;return u};Xo();const ka={http:j0,xhr:ms,fetch:{get:Xo}};U.forEach(ka,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const Ko=t=>`- ${t}`,ws=t=>U.isFunction(t)||t===null||t===!1;function Es(t,n){t=U.isArray(t)?t:[t];const{length:a}=t;let o,r;const i={};for(let s=0;s<a;s++){o=t[s];let l;if(r=o,!ws(o)&&(r=ka[(l=String(o)).toLowerCase()],r===void 0))throw new Se(`Unknown adapter '${l}'`);if(r&&(U.isFunction(r)||(r=r.get(n))))break;i[l||"#"+s]=r}if(!r){const s=Object.entries(i).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=a?s.length>1?`since :
4
4
  `+s.map(Ko).join(`
5
5
  `):" "+Ko(s[0]):"as no adapter specified";throw new Se("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r}const Qo={getAdapter:Es,adapters:ka};function xa(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Wt(null,t)}function Jo(t){return xa(t),t.headers=tt.from(t.headers),t.data=ya.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Qo.getAdapter(t.adapter||un.adapter,t)(t).then(function(o){return xa(t),o.data=ya.call(t,t.transformResponse,o),o.headers=tt.from(o.headers),o},function(o){return _o(o)||(xa(t),o&&o.response&&(o.response.data=ya.call(t,t.transformResponse,o.response),o.response.headers=tt.from(o.response.headers))),Promise.reject(o)})}const er="1.13.1",Ln={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{Ln[t]=function(o){return typeof o===t||"a"+(n<1?"n ":" ")+t}});const tr={};Ln.transitional=function(n,a,o){function r(i,s){return"[Axios v"+er+"] Transitional option '"+i+"'"+s+(o?". "+o:"")}return(i,s,l)=>{if(n===!1)throw new Se(r(s," has been removed"+(a?" in "+a:"")),Se.ERR_DEPRECATED);return a&&!tr[s]&&(tr[s]=!0,console.warn(r(s," has been deprecated since v"+a+" and will be removed in the near future"))),n?n(i,s,l):!0}},Ln.spelling=function(n){return(a,o)=>(console.warn(`${o} is likely a misspelling of ${n}`),!0)};function vs(t,n,a){if(typeof t!="object")throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const o=Object.keys(t);let r=o.length;for(;r-- >0;){const i=o[r],s=n[i];if(s){const l=t[i],d=l===void 0||s(l,i,t);if(d!==!0)throw new Se("option "+i+" must be "+d,Se.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new Se("Unknown option "+i,Se.ERR_BAD_OPTION)}}const $n={assertOptions:vs,validators:Ln},pt=$n.validators;let $t=class{constructor(n){this.defaults=n||{},this.interceptors={request:new Lo,response:new Lo}}async request(n,a){try{return await this._request(n,a)}catch(o){if(o instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=`
6
- `+i):o.stack=i}catch{}}throw o}}_request(n,a){typeof n=="string"?(a=a||{},a.url=n):a=n||{},a=Lt(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:i}=a;o!==void 0&&$n.assertOptions(o,{silentJSONParsing:pt.transitional(pt.boolean),forcedJSONParsing:pt.transitional(pt.boolean),clarifyTimeoutError:pt.transitional(pt.boolean)},!1),r!=null&&(U.isFunction(r)?a.paramsSerializer={serialize:r}:$n.assertOptions(r,{encode:pt.function,serialize:pt.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),$n.assertOptions(a,{baseUrl:pt.spelling("baseURL"),withXsrfToken:pt.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let s=i&&U.merge(i.common,i[a.method]);i&&U.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),a.headers=tt.concat(s,i);const l=[];let d=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(d=d&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,m=0,h;if(!d){const f=[Jo.bind(this),void 0];for(f.unshift(...l),f.push(...u),h=f.length,c=Promise.resolve(a);m<h;)c=c.then(f[m++],f[m++]);return c}h=l.length;let p=a;for(;m<h;){const f=l[m++],g=l[m++];try{p=f(p)}catch(y){g.call(this,y);break}}try{c=Jo.call(this,p)}catch(f){return Promise.reject(f)}for(m=0,h=u.length;m<h;)c=c.then(u[m++],u[m++]);return c}getUri(n){n=Lt(this.defaults,n);const a=jo(n.baseURL,n.url,n.allowAbsoluteUrls);return Fo(a,n.params,n.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(n){$t.prototype[n]=function(a,o){return this.request(Lt(o||{},{method:n,url:a,data:(o||{}).data}))}}),U.forEach(["post","put","patch"],function(n){function a(o){return function(i,s,l){return this.request(Lt(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}$t.prototype[n]=a(),$t.prototype[n+"Form"]=a(!0)});let Cs=class Fi{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const o=this;this.promise.then(r=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](r);o._listeners=null}),this.promise.then=r=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(r);return s.cancel=function(){o.unsubscribe(i)},s},n(function(i,s,l){o.reason||(o.reason=new Wt(i,s,l),a(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const a=this._listeners.indexOf(n);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const n=new AbortController,a=o=>{n.abort(o)};return this.subscribe(a),n.signal.unsubscribe=()=>this.unsubscribe(a),n.signal}static source(){let n;return{token:new Fi(function(r){n=r}),cancel:n}}};function Ss(t){return function(a){return t.apply(null,a)}}function Bs(t){return U.isObject(t)&&t.isAxiosError===!0}const ba={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(ba).forEach(([t,n])=>{ba[n]=t});function nr(t){const n=new $t(t),a=ko($t.prototype.request,n);return U.extend(a,$t.prototype,n,{allOwnKeys:!0}),U.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return nr(Lt(t,r))},a}const Ge=nr(un);Ge.Axios=$t,Ge.CanceledError=Wt,Ge.CancelToken=Cs,Ge.isCancel=_o,Ge.VERSION=er,Ge.toFormData=An,Ge.AxiosError=Se,Ge.Cancel=Ge.CanceledError,Ge.all=function(n){return Promise.all(n)},Ge.spread=Ss,Ge.isAxiosError=Bs,Ge.mergeConfig=Lt,Ge.AxiosHeaders=tt,Ge.formToJSON=t=>Po(U.isHTMLForm(t)?new FormData(t):t),Ge.getAdapter=Qo.getAdapter,Ge.HttpStatusCode=ba,Ge.default=Ge;const{Axios:Tx,AxiosError:Dx,CanceledError:Fx,isCancel:Lx,CancelToken:$x,VERSION:Px,all:Ox,Cancel:_x,isAxiosError:Hx,spread:Rx,toFormData:zx,AxiosHeaders:jx,HttpStatusCode:Gx,formToJSON:Ix,getAdapter:qx,mergeConfig:Wx}=Ge,ar=Dt.defineStore("auth",{state:()=>({jwtToken:null}),actions:{setToken(t){this.jwtToken=t},clearToken(){this.jwtToken=null}},getters:{getToken:t=>t.jwtToken}}),ot=Ge.create({baseURL:"https://back.dev-smclick.com.br/"});let wa=null;const Vs=()=>(wa||(wa=ar()),wa);ot.interceptors.request.use(t=>{try{const a=Vs().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));const Ms="v1/api/attendances/attendant/",Ns="v1/api/attendances/department/",Ea="v1/api/attendances/internal_chat/",As="v1/api/instances/instance/",Ts="v1/api/crm/event/scheduled_message/",Ds="v1/api/crm/event/calendar",Fs="v1/api/crm/products/",Ls="v1/api/contacts/tag/",va=Dt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(t=""){try{let n=`${As}`;const a=await ot.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}}}),$s={class:"w-full relative text-current"},Ps={class:"flex cursor-pointer justify-between items-center"},Os={key:0},_s={key:0},Hs={key:1,class:"flex items-center gap-2"},Rs={class:"flex gap-3 items-center flex-shrink-0"},zs={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},js={key:1,class:"relative"},Gs={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"},Is={class:"my-auto text-center mx-auto group-hover:inline-block"},qs={key:1,class:"flex justify-center"},Ws={class:"w-full"},Us={key:1,class:"flex items-center gap-2 justify-center"},Zs={class:"flex px-4 items-center gap-2"},Ys={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},Xs={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"},Ks={class:"select-none cursor-pointer w-full"},Qs=["onClick","disabled"],Js={class:"flex w-full items-center pl-2 gap-3"},el={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"},tl={key:1,class:"relative"},nl={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},al={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"},ol={class:"w-full text-center"},rl={class:"my-auto text-center mx-auto group-hover:inline-block"},il={key:1,class:"flex justify-center"},sl={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},ll={key:1,class:"p-4"},or={__name:"index",props:{modelValue:{type:Object,default:null},type:{type:String},webhooks:{type:Boolean,default:void 0}},emits:["update:modelValue","function","component-mounted"],setup(t,{emit:n}){const a=va(),o=e.ref(!1),r=e.ref(null),i=t,s=n;function l(d){r.value=d,s("function",d)}return e.watch(()=>i.modelValue,d=>{r.value=d},{immediate:!0}),e.watch(r,d=>{s("update:modelValue",d)}),e.onMounted(async()=>{if(r.value){const d=a.instances.find(u=>u.id===r.value.id);d&&(r.value.status=d.status)}s("component-mounted")}),(d,u)=>{const c=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("main",$s,[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",Ps,[e.createElementVNode("p",{onClick:u[0]||(u[0]=m=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[e.unref(a).loaded?(e.openBlock(),e.createElementBlock("div",Os,[r.value?(e.openBlock(),e.createElementBlock("span",Hs,[e.createElementVNode("header",Rs,[r.value.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",zs,[...u[3]||(u[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==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",js,[u[5]||(u[5]=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",Gs,[...u[4]||(u[4]=[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(c,{key:2,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",Is,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",qs,[...u[6]||(u[6]=[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",Ws,e.toDisplayString(r.value.name),1)])):(e.openBlock(),e.createElementBlock("span",_s,e.toDisplayString(e.unref(a).instances?e.unref(a).instances.length:"Sem")+" Instâncias disponíveis",1))])):(e.openBlock(),e.createElementBlock("div",Us,[...u[7]||(u[7]=[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",Zs,[e.createElementVNode("button",{onClick:u[1]||(u[1]=m=>(r.value=null,o.value=!1))},[...u[8]||(u[8]=[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:u[2]||(u[2]=m=>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"},[...u[9]||(u[9]=[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",Ys,[e.createElementVNode("ul",Xs,[e.unref(a).instances.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(a).instances,(m,h)=>{var p;return e.openBlock(),e.createElementBlock("li",Ks,[e.createElementVNode("button",{class:e.normalizeClass([r.value&&r.value.id===m.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:f=>(r.value=m,o.value=!1,l(m)),disabled:r.value&&r.value.id===m.id||t.type&&m.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((p=m.config)==null?void 0:p.webhooks)},[e.createElementVNode("div",Js,[m.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",el,[...u[10]||(u[10]=[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)])])):m.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",tl,[u[12]||(u[12]=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",nl,[...u[11]||(u[11]=[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(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.type&&m.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 f;return[t.type&&m.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((f=m.config)==null?void 0:f.webhooks)?(e.openBlock(),e.createElementBlock("svg",al,[...u[13]||(u[13]=[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",ol,e.toDisplayString(m.name),1),e.createVNode(c,{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":m.status===!1,"bg-green-500":m.status===!0,"bg-purple-500":m.status==="Offline"}])},[e.createElementVNode("div",rl,e.toDisplayString(m.status===!0?"Conectada":m.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[m.isLoading?(e.openBlock(),e.createElementBlock("div",il,[...u[14]||(u[14]=[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":m.status===!1,"bg-green-500":m.status===!0,"bg-purple-500":m.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",sl,[m.telephone?(e.openBlock(),e.createBlock(c,{key:0,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(m.telephone?`${m.telephone}`:""),1)]),default:e.withCtx(()=>[u[15]||(u[15]=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,Qs)])}),256)):(e.openBlock(),e.createElementBlock("div",ll," Sem instâncias disponíveis"))])])):e.createCommentVNode("",!0)])}}},cl=["aria-labelledby","aria-describedby"],dl={class:"cpk-popover__header border-base-100"},ul=["id"],fl=["disabled"],ml=["id"],hl={class:"cpk-popover__details bg-base-200 border border-base-100"},pl={class:"cpk-popover__footer"},gl=["disabled"],yl=["disabled"],kl={key:0,class:"loading-spinner"},xl=Ce({__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:B=>o("update:modelValue",B)}),i=e.ref(null),s=e.ref({left:0,top:0,p:"bottom"}),l={title:`cpk-popover-title-${Math.random().toString(36).slice(2)}`,desc:`cpk-popover-desc-${Math.random().toString(36).slice(2)}`};function d(){o("cancel",a.context),r.value=!1}function u(){a.loading||o("confirm",a.context)}let c,m,h=[];function p(){if(a.anchorRect)return a.anchorRect;const B=a.anchorEl instanceof Element?a.anchorEl:null;if(B)return B.getBoundingClientRect();const M=document.activeElement instanceof Element?document.activeElement:null;return M?M.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 f(){if(!r.value)return;const B=window.innerWidth,M=window.innerHeight,T=a.viewportPadding,_=p(),C=i.value?i.value.getBoundingClientRect():{width:320,height:200},w=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let P=w[0],F=0,H=0;const V=_.left+_.width/2-C.width/2,v=_.top+_.height/2-C.height/2,$=_.left,Z=_.left+_.width-C.width,Q=_.top,ee=_.top+_.height-C.height;for(const L of w){if(L==="bottom"&&(H=_.bottom+a.offset,F=a.align==="start"?$:a.align==="end"?Z:V,H+C.height+T<=M)){P="bottom";break}if(L==="top"&&(H=_.top-C.height-a.offset,F=a.align==="start"?$:a.align==="end"?Z:V,H>=T)){P="top";break}if(L==="right"&&(F=_.right+a.offset,H=a.align==="start"?Q:a.align==="end"?ee:v,F+C.width+T<=B)){P="right";break}if(L==="left"&&(F=_.left-C.width-a.offset,H=a.align==="start"?Q:a.align==="end"?ee:v,F>=T)){P="left";break}}F=Math.min(Math.max(T,F),B-C.width-T),H=Math.min(Math.max(T,H),M-C.height-T),s.value={left:F,top:H,p:P}}function g(){y();let M=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;M&&M!==document.body;)h.push(M),M=M.parentElement;h.push(window),h.forEach(T=>T.addEventListener("scroll",f,{passive:!0}))}function y(){h.forEach(B=>{var M;return(M=B.removeEventListener)==null?void 0:M.call(B,"scroll",f)}),h=[]}e.watch(()=>r.value,async B=>{var M;if(B){await e.nextTick(),f(),g(),c=new ResizeObserver(f),c.observe(document.body);const T=a.anchorEl instanceof Element?a.anchorEl:null;T&&((M=m==null?void 0:m.disconnect)==null||M.call(m),m=new ResizeObserver(f),m.observe(T)),window.addEventListener("resize",f),window.addEventListener("keydown",k)}else x()}),e.watch(()=>a.anchorEl,async B=>{var T;if(!r.value)return;await e.nextTick(),y(),g(),(T=m==null?void 0:m.disconnect)==null||T.call(m);const M=B instanceof Element?B:null;M&&(m=new ResizeObserver(f),m.observe(M)),f()}),e.watch(()=>a.anchorRect,()=>{r.value&&f()}),e.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&f()});function k(B){B.key==="Escape"&&d(),B.key==="Enter"&&u()}e.onMounted(()=>{window.addEventListener("mousemove",B=>{window.__lastMouseX=B.clientX,window.__lastMouseY=B.clientY},{passive:!0})}),e.onBeforeUnmount(x);function x(){y(),window.removeEventListener("resize",f),window.removeEventListener("keydown",k),c&&c.disconnect(),m&&m.disconnect()}const E=e.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(B,M)=>(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:i,class:e.normalizeClass(["cpk-popover bg-base-300",[{"is-loading":t.loading,"is-danger":t.destructive}]]),style:e.normalizeStyle(E.value),role:"dialog","aria-modal":"false","aria-labelledby":l.title,"aria-describedby":l.desc},[e.createElementVNode("div",dl,[M[0]||(M[0]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"!",-1)),e.createElementVNode("h3",{class:"cpk-popover__title",id:l.title},e.toDisplayString(t.title),9,ul),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:d,disabled:t.loading,"aria-label":"Fechar"}," × ",8,fl)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:l.desc},e.toDisplayString(t.description),9,ml)):e.createCommentVNode("",!0),e.createElementVNode("div",hl,[e.renderSlot(B.$slots,"details",{},void 0,!0)]),e.createElementVNode("div",pl,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:d,disabled:t.loading},e.toDisplayString(t.cancelLabel),9,gl),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",kl)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.loading?t.loadingLabel:t.confirmLabel),1)],10,yl)])],14,cl)]),_:3})],32)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-2f78365f"]]);function Ut(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}function gt(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,l=a!=null&&a.width?String(a.width):s;r=t.formattingValues[l]||t.formattingValues[s]}else{const s=t.defaultWidth,l=a!=null&&a.width?String(a.width):t.defaultWidth;r=t.values[l]||t.values[s]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}function yt(t){return(n,a={})=>{const o=a.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const s=i[0],l=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(l)?wl(l,m=>m.test(s)):bl(l,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 bl(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function wl(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function rr(t){return(n,a={})=>{const o=n.match(t.matchPattern);if(!o)return null;const r=o[0],i=n.match(t.parsePattern);if(!i)return null;let s=t.valueCallback?t.valueCallback(i[0]):i[0];s=a.valueCallback?a.valueCallback(s):s;const l=n.slice(r.length);return{value:s,rest:l}}}const ir=6048e5,El=864e5,sr=Symbol.for("constructDateFrom");function rt(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&sr in t?t[sr](n):t instanceof Date?new t.constructor(n):new Date(n)}function Ca(t,...n){const a=rt.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let vl={};function Pn(){return vl}function ct(t,n){return rt(n||t,t)}function Pt(t,n){var l,d,u,c;const a=Pn(),o=(n==null?void 0:n.weekStartsOn)??((d=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??a.weekStartsOn??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,r=ct(t,n==null?void 0:n.in),i=r.getDay(),s=(i<o?7:0)+i-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function Cl(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n);return+Pt(o,a)==+Pt(r,a)}const Sl={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"}},Bl=(t,n,a)=>{let o;const r=Sl[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},Vl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ml=(t,n,a,o)=>Vl[t],Nl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Al={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Tl={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"]},Dl={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"]},Fl={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"}},Ll={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"}},$l={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:gt({values:Nl,defaultWidth:"wide"}),quarter:gt({values:Al,defaultWidth:"wide",argumentCallback:t=>t-1}),month:gt({values:Tl,defaultWidth:"wide"}),day:gt({values:Dl,defaultWidth:"wide"}),dayPeriod:gt({values:Fl,defaultWidth:"wide",formattingValues:Ll,defaultFormattingWidth:"wide"})},Pl=/^(\d+)(th|st|nd|rd)?/i,Ol=/\d+/i,_l={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},Hl={any:[/^b/i,/^(a|c)/i]},Rl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zl={any:[/1/i,/2/i,/3/i,/4/i]},jl={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},Gl={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]},Il={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},ql={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]},Wl={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},Ul={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}},Zl={ordinalNumber:rr({matchPattern:Pl,parsePattern:Ol,valueCallback:t=>parseInt(t,10)}),era:yt({matchPatterns:_l,defaultMatchWidth:"wide",parsePatterns:Hl,defaultParseWidth:"any"}),quarter:yt({matchPatterns:Rl,defaultMatchWidth:"wide",parsePatterns:zl,defaultParseWidth:"any",valueCallback:t=>t+1}),month:yt({matchPatterns:jl,defaultMatchWidth:"wide",parsePatterns:Gl,defaultParseWidth:"any"}),day:yt({matchPatterns:Il,defaultMatchWidth:"wide",parsePatterns:ql,defaultParseWidth:"any"}),dayPeriod:yt({matchPatterns:Wl,defaultMatchWidth:"any",parsePatterns:Ul,defaultParseWidth:"any"})},Yl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Xl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ql={date:Ut({formats:Yl,defaultWidth:"full"}),time:Ut({formats:Xl,defaultWidth:"full"}),dateTime:Ut({formats:Kl,defaultWidth:"full"})},Jl={code:"en-US",formatDistance:Bl,formatLong:Ql,formatRelative:Ml,localize:$l,match:Zl,options:{weekStartsOn:0,firstWeekContainsDate:1}},e2={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"}},t2=(t,n,a)=>{let o;const r=e2[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},n2={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},a2={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},o2={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},r2={date:Ut({formats:n2,defaultWidth:"full"}),time:Ut({formats:a2,defaultWidth:"full"}),dateTime:Ut({formats:o2,defaultWidth:"full"})},i2={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"},s2=(t,n,a,o)=>{const r=i2[t];return typeof r=="function"?r(n):r},l2={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},c2={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},d2={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"]},u2={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"]},f2={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"}},m2={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"}},h2={ordinalNumber:(t,n)=>{const a=Number(t);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:gt({values:l2,defaultWidth:"wide"}),quarter:gt({values:c2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:gt({values:d2,defaultWidth:"wide"}),day:gt({values:u2,defaultWidth:"wide"}),dayPeriod:gt({values:f2,defaultWidth:"wide",formattingValues:m2,defaultFormattingWidth:"wide"})},p2=/^(\d+)[ºªo]?/i,g2=/\d+/i,y2={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},k2={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},x2={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},b2={any:[/1/i,/2/i,/3/i,/4/i]},w2={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},E2={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]},v2={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},C2={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]},S2={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},B2={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}},V2={ordinalNumber:rr({matchPattern:p2,parsePattern:g2,valueCallback:t=>parseInt(t,10)}),era:yt({matchPatterns:y2,defaultMatchWidth:"wide",parsePatterns:k2,defaultParseWidth:"any"}),quarter:yt({matchPatterns:x2,defaultMatchWidth:"wide",parsePatterns:b2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:yt({matchPatterns:w2,defaultMatchWidth:"wide",parsePatterns:E2,defaultParseWidth:"any"}),day:yt({matchPatterns:v2,defaultMatchWidth:"wide",parsePatterns:C2,defaultParseWidth:"any"}),dayPeriod:yt({matchPatterns:S2,defaultMatchWidth:"any",parsePatterns:B2,defaultParseWidth:"any"})},lr={code:"pt-BR",formatDistance:t2,formatLong:r2,formatRelative:s2,localize:h2,match:V2,options:{weekStartsOn:0,firstWeekContainsDate:1}},M2={scheduled_messages:"Mensagem programada"};function N2(t){return M2[t]||t||"Evento"}function Sa(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function Zt(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 mn(t){const[n,a]=String(t||"").trim().split(" ");if(!n)return null;const[o,r,i]=n.split("-").map(u=>parseInt(u,10));let s=0,l=0;if(a){const[u,c]=a.split(":");s=parseInt(u||"0",10),l=parseInt(c||"0",10)}const d=new Date(o,(r||1)-1,i||1,s,l);return isNaN(d.getTime())?null:d}function A2(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 On(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 T2(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function Ba(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)||{},i=(o==null?void 0:o.department)||{},s=(o==null?void 0:o.instance)||{};let l=null;if(a!=null&&a.time&&(l=mn(a.time)),!l&&(t!=null&&t.next_execution_at)&&(l=A2(t.next_execution_at)),!l)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=N2(c),h=(u||"").trim();return{id:(t==null?void 0:t.id)||T2(),date:l,time:On(l),type:t.function,status:t.status||null,scheduled_by:n.scheduled_by,title:m,content:h,functionName:c||null,chatId:(n==null?void 0:n.chat_id)||(o==null?void 0:o.id)||"",protocol:(o==null?void 0:o.protocol)??"",contactName:(r==null?void 0:r.name)||"Contato",contactPhoto:(r==null?void 0:r.photo)||"",departmentName:(i==null?void 0:i.name)||"",departmentId:(i==null?void 0:i.id)||null,instanceName:(s==null?void 0:s.name)||"",raw:t}}function cr(t=[]){const n=Array.isArray(t)?t:Array.isArray(t.results)?t.results:[],a=[];for(const o of n){const r=Ba(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function D2(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}/`,i=await ot.delete(r);return{ok:(i==null?void 0:i.status)>=200&&i.status<300,status:(i==null?void 0:i.status)??0}}catch(o){return console.error("Error erasing scheduled event:",o),{ok:!1,status:0}}}const dr={scheduled_messages:"#3b82f6"},ur=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function F2(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 L2(t={}){var s,l,d,u,c,m,h,p,f,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=(l=t==null?void 0:t.info)==null?void 0:l.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)||((h=(m=t==null?void 0:t.info)==null?void 0:m.instance)==null?void 0:h.name)||((f=(p=t==null?void 0:t.info)==null?void 0:p.instance)==null?void 0:f.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 i=(t==null?void 0:t.chatId)||((y=t==null?void 0:t.params)==null?void 0:y.chat_id);return i?`chat:${i}`:"misc"}function _n(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(dr,n))return dr[n];const a=L2(t),o=F2(String(a))%ur.length;return ur[o]}const Yt=Dt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),actions:{async fetchAttendants(){try{this.attendants=[];let t=`${Ms}`;const n=await ot.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)}}}),$2={class:"itemc-head"},P2={class:"minw0"},O2={class:"itemc-title"},_2={class:"itemc-sub"},H2={class:"flex items-center gap-1"},R2={class:"itemc-actions"},z2={class:"flex flex-col items-center"},j2={class:"time-badge"},G2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},I2={class:"sched-pop__card bg-base-300",role:"dialog"},q2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},W2={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"},U2=["disabled"],Z2={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Y2={key:1,class:"loading-spinner"},X2={class:"itemsb-head"},K2=["src"],Q2={key:1,class:"avatar avatar--placeholder bg-base-100"},J2={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},ec={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},tc={class:"itemsb-main"},nc={class:"itemsb-row"},ac={class:"itemsb-title truncate"},oc={class:"itemsb-time"},rc={class:"itemsb-sub"},ic={class:"items-attendant"},sc={class:"itemsb-content"},lc={key:0,class:"itemsb-actions"},cc=["disabled"],dc={key:0,class:"loading-spinner"},uc={class:"event-left"},fc={class:"event-line"},mc={class:"event-actions"},hc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},pc={class:"sched-pop__card bg-base-300",role:"dialog"},gc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},yc={class:"sched-pop__card bg-base-300",role:"dialog"},kc={class:"event-time"},xc={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},bc={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"},wc=["disabled"],Ec={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"},vc={key:1,class:"loading-spinner"},Va=Ce({__name:"EventItem",props:{ev:{type:Object,required:!0},mode:{type:String,default:"compact"},getEventColor:{type:Function,default:null},viewOnly:{type:Boolean,default:!1}},emits:["open-message","open-chat","delete-message"],setup(t,{emit:n}){const a=Yt(),o=t,r=e.computed(()=>(o.getEventColor||_n)(o.ev)),i=e.computed(()=>{var u;return((u=o.ev)==null?void 0:u.type)==="scheduled_messages"}),s=e.computed(()=>a.attendants.find(u=>u.is_me)||{}),l=u=>{const c=a.attendants.find(m=>m.id===u);return c?c.id===s.value.id?"Você":c.name||"Desconhecido":"Desconhecido"},d=e.computed(()=>{var c,m;const u=[];return(c=o.ev)!=null&&c.contactName&&u.push(o.ev.contactName),u.push(((m=o.ev)==null?void 0:m.departmentName)||"sem depto"),u.join(" • ")});return(u,c)=>{var m,h,p,f,g,y;return t.mode==="compact"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("header",$2,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"color-bar"},null,4),e.createElementVNode("div",P2,[e.createElementVNode("div",O2,e.toDisplayString(t.ev.contactName?t.ev.contactName+" • ":"")+" "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("div",_2,[e.createElementVNode("span",H2,[c[9]||(c[9]=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(l(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("footer",R2,[e.createElementVNode("div",z2,[e.createElementVNode("div",j2,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",G2,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["status-bar",(m=t.ev)!=null&&m.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",I2,[c[10]||(c[10]=e.createElementVNode("strong",null,"Status",-1)),c[11]||(c[11]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])]),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c[0]||(c[0]=k=>u.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((h=t.ev)==null?void 0:h.status)===!0?(e.openBlock(),e.createElementBlock("svg",q2,[...c[12]||(c[12]=[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",W2,[...c[13]||(c[13]=[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.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[1]||(c[1]=k=>u.$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",Z2,[...c[14]||(c[14]=[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",Y2)):e.createCommentVNode("",!0)],8,U2)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[2]||(c[2]=k=>u.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...c[15]||(c[15]=[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)])])])],64)):t.mode==="sidebar"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",X2,[e.createElementVNode("div",{class:"avatar-wrap",style:e.normalizeStyle({boxShadow:`0 0 0 1px ${r.value}`})},[t.ev.contactPhoto?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.ev.contactPhoto,alt:"",class:"avatar",loading:"lazy"},null,8,K2)):(e.openBlock(),e.createElementBlock("div",Q2,[...c[16]||(c[16]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",class:"icon-5 icon-muted"},[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"})],-1)])])),e.createElementVNode("div",J2,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-dot-avatar",(p=t.ev)!=null&&p.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",ec,[c[17]||(c[17]=e.createElementVNode("strong",null,"Status",-1)),c[18]||(c[18]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])],4),e.createElementVNode("div",tc,[e.createElementVNode("div",nc,[e.createElementVNode("span",ac,e.toDisplayString(t.ev.contactName)+" • "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("span",oc,e.toDisplayString(t.ev.time),1)]),e.createElementVNode("div",rc,[e.createElementVNode("span",ic,[c[19]||(c[19]=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(l(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("p",sc,e.toDisplayString(t.ev.content||t.ev.title),1),t.viewOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",lc,[i.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:c[3]||(c[3]=k=>u.$emit("open-message",t.ev))},e.toDisplayString(((f=t.ev)==null?void 0:f.status)===!0?"Editar":"Visualizar"),1)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[4]||(c[4]=k=>u.$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",dc)):e.createCommentVNode("",!0),c[20]||(c[20]=e.createTextVNode(" Apagar ",-1))],8,cc)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:c[5]||(c[5]=k=>u.$emit("open-chat",t.ev))}," Abrir conversa ")):e.createCommentVNode("",!0)]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",uc,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),e.createElementVNode("div",fc,e.toDisplayString(d.value),1)]),e.createElementVNode("footer",mc,[e.createElementVNode("div",hc,[c[23]||(c[23]=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",pc,[c[21]||(c[21]=e.createElementVNode("strong",null,"Agendado por",-1)),c[22]||(c[22]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])]),e.createElementVNode("div",gc,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-bar",(g=t.ev)!=null&&g.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",yc,[c[24]||(c[24]=e.createElementVNode("strong",null,"Status",-1)),c[25]||(c[25]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])]),e.createElementVNode("div",kc,e.toDisplayString(t.ev.time),1),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c[6]||(c[6]=k=>u.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((y=t.ev)==null?void 0:y.status)===!0?(e.openBlock(),e.createElementBlock("svg",xc,[...c[26]||(c[26]=[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",bc,[...c[27]||(c[27]=[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.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[7]||(c[7]=k=>u.$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",Ec,[...c[28]||(c[28]=[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",vc)):e.createCommentVNode("",!0)],8,wc)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[8]||(c[8]=k=>u.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...c[29]||(c[29]=[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)])])])],64))}}},[["__scopeId","data-v-ba8ebbe5"]]),St=new Map,Cc=Dt.defineStore("scheduled",{state:()=>({baseUrl:Ds,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=Zt(new Date)),this.loadedYM.has(t))return;const n=`${this.baseUrl}|${t}`;if(St.has(n))return St.get(n);this.loadingYM.add(t),this.errorByYM={...this.errorByYM,[t]:""};const a=(async()=>{var o,r;try{const i=`${this.baseUrl}?year_month=${encodeURIComponent(t)}&page_size=10`,s=await ot.get(i),l=Array.isArray(s==null?void 0:s.data)?s.data:((o=s==null?void 0:s.data)==null?void 0:o.results)||[],d=cr(l||[]);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 h=u;for(;h;){const p=await ot.get(h),f=Array.isArray(p==null?void 0:p.data)?p.data:((c=p==null?void 0:p.data)==null?void 0:c.results)||[],g=cr(f||[]);this._appendMonth(t,g),h=this.coerceHttps(((m=p==null?void 0:p.data)==null?void 0:m.next)||null)}}catch(h){console.warn("[scheduled] background paging error:",(h==null?void 0:h.message)||h)}})()}catch(i){const s=String((i==null?void 0:i.message)||i);throw this.errorByYM={...this.errorByYM,[t]:s},console.error("[scheduled] fetch error",t,s),this._setMonth(t,[]),this.loadedYM.delete(t),i}finally{St.delete(n),this.loadingYM.delete(t)}})();return St.set(n,a),a},async forceReload(t){t||(t=Zt(new Date));const n=`${this.baseUrl}|${t}`;St.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(i=>{var d;const s=((d=i==null?void 0:i.raw)==null?void 0:d.id)!=null?String(i.raw.id):null,l=(i==null?void 0:i.id)!=null?String(i.id):null;return s===n||l===n});if(r!==-1)return{ym:a,idx:r}}return null},applyUpdateToCache({id:t,params:n}){var h,p,f,g,y,k,x,E,B,M,T,_,C;let a=null;if((h=n==null?void 0:n.schedule)!=null&&h.time){const w=n.schedule.time,P=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(w);if(P){const[,F,H,V,v="00",$="00"]=P;a=new Date(Number(F),Number(H)-1,Number(V),Number(v),Number($),0,0)}else{const F=typeof w=="string"&&!w.includes("T")?w.replace(" ","T"):w;a=new Date(F)}}console.log(n);const o=w=>{var P,F,H,V;return a instanceof Date&&!isNaN(a)&&(w.date=a,w.time=On(a)),((F=(P=n==null?void 0:n.message)==null?void 0:P[0])==null?void 0:F.content)!=null&&(w.content=n.message[0].content),w.raw=w.raw||{id:t},w.raw.params=w.raw.params||{},n!=null&&n.schedule&&(w.raw.params.schedule={...w.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(w.raw.params.scheduled_by=n.scheduled_by),n.department&&(w.raw.params.department=n.department),n!=null&&n.message&&(w.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(w.chatId=n.chat_id??w.chatId??""),n!=null&&n.entity&&(w.raw.params.entity={...w.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(w.contactName=n.entity.name??w.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(w.contactPhoto=n.entity.photo??w.contactPhoto??null,n.entity.photo&&(w.photo=n.entity.photo))),n!=null&&n.info&&(w.raw.params.info={...w.raw.params.info||{},...n.info},(H=n.info)!=null&&H.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(w.departmentName=n.info.department.name??w.departmentName),(V=n.info)!=null&&V.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(w.instanceName=n.info.instance.name??w.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(w.instanceStatus=n.info.instance.last_instance_status??w.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?w.title=n.title??w.title??"Mensagem programada":w.title=w.title||"Mensagem programada",Object.prototype.hasOwnProperty.call(n||{},"function")?(w.function=n.function??w.function??"scheduled_messages",w.type=n.function??w.type??"scheduled_messages"):(w.function=w.function||"scheduled_messages",w.type=w.type||"scheduled_messages"),w},r=this.findEventById(t);if(!r){const w=a instanceof Date&&!isNaN(a)?a:(()=>{var $;const V=($=n==null?void 0:n.schedule)==null?void 0:$.time,v=typeof V=="string"&&!V.includes("T")?V.replace(" ","T"):V;return(mn==null?void 0:mn(v))||(v?new Date(v):new Date)})(),P=o({id:t,date:w,time:On(w),title:(n==null?void 0:n.title)||"Mensagem programada",type:(n==null?void 0:n.function)||"scheduled_messages",status:(n==null?void 0:n.status)||"true",scheduled_by:(n==null?void 0:n.scheduled_by)||null,function:(n==null?void 0:n.function)||"scheduled_messages",content:((f=(p=n==null?void 0:n.message)==null?void 0:p[0])==null?void 0:f.content)??"",raw:{id:t,params:n},contactName:((g=n==null?void 0:n.entity)==null?void 0:g.name)??"Cliente",contactPhoto:((y=n==null?void 0:n.entity)==null?void 0:y.photo)??null,departmentName:((x=(k=n==null?void 0:n.info)==null?void 0:k.department)==null?void 0:x.name)??null,departmentId:((B=(E=n==null?void 0:n.info)==null?void 0:E.department)==null?void 0:B.id)??null,instanceName:((T=(M=n==null?void 0:n.info)==null?void 0:M.instance)==null?void 0:T.name)??null,instanceStatus:((C=(_=n==null?void 0:n.info)==null?void 0:_.instance)==null?void 0:C.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),F=Zt(P.date),H=this.monthCache[F]?[...this.monthCache[F],P]:[P];H.sort((V,v)=>V.date-v.date),this._setMonth(F,H);return}const{ym:i,idx:s}=r,l=this.monthCache[i]||[],d={...l[s]},u=o({...d}),c=u.date instanceof Date?u.date:d.date,m=Zt(c);if(m===i){const w=[...l];w.splice(s,1,u),w.sort((P,F)=>P.date-F.date),this._setMonth(i,w)}else{const w=l.slice(0,s).concat(l.slice(s+1)),P=this.monthCache[m]?[...this.monthCache[m],u]:[u];P.sort((F,H)=>F.date-H.date),this.monthCache={...this.monthCache,[i]:w,[m]:P}}},removeFromCache(t){const n=this.findEventById(t);if(!n)return!1;const{ym:a,idx:o}=n,r=this.monthCache[a]||[],i=r.slice(0,o).concat(r.slice(o+1));return this._setMonth(a,i),!0},insertNormalizedEvent(t){if(!t)return;const n=String(t.id),a=t.date instanceof Date?t.date:mn(t.date)||new Date,o=Zt(a),r={...t,id:n,date:a,time:t.time??On(a)},i=this.monthCache[o]?[...this.monthCache[o]]:[],s=i.findIndex(l=>{var d;return String(((d=l==null?void 0:l.raw)==null?void 0:d.id)??(l==null?void 0:l.id))===n});s!==-1?i.splice(s,1,r):i.push(r),i.sort((l,d)=>l.date-d.date),this._setMonth(o,i)},insertFromApiItem(t){const n=Ba(t);n&&this.insertNormalizedEvent(n)},insertManyFromApi(t=[]){for(const n of t){const a=Ba(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=St.clear)==null||t.call(St)}}}),Sc={class:"cpk-header bg-base-200"},Bc={class:"left"},Vc=["title"],Mc={class:"right"},Nc=["title"],Ac={class:"toggle"},Tc=["aria-pressed","title"],Dc={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Fc={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Lc=Ce({__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",Sc,[e.createElementVNode("div",Bc,[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,Vc),e.createElementVNode("div",Mc,[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,Nc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ac,[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",Fc,[...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",Dc,[...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,Tc)])]))}},[["__scopeId","data-v-37b625a5"]]),$c=["title"],Pc={class:"week-header"},Oc=Ce({__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,$c),e.createElementVNode("div",Pc,[(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-756165d9"]]),_c=["onClick"],Hc={key:0,class:"cell-today-indicator show-lg"},Rc={class:"cell-top"},zc={class:"day-number"},jc={key:1,class:"more"},Gc={class:"bars-wrap"},Ic=4,qc=8,fr=4,mr=2,Wc=1,Uc=Ce({__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(f){const g=(f==null?void 0:f.clientWidth)||0,y=(f==null?void 0:f.clientHeight)||0;if(!g||!y)return{cols:0,rows:0,widths:[],sum:0};const k=Math.max(0,Math.floor((g+fr)/(Ic+fr))),x=Math.max(0,Math.floor((y+mr)/(qc+mr))),E=l(k,x),B=E.reduce((M,T)=>M+T,0);return{cols:k,rows:x,widths:E,sum:B}}function i(f,g){const y=r(g),k=a.value[f];(!k||k.cols!==y.cols||k.rows!==y.rows||k.sum!==y.sum)&&(a.value={...a.value,[f]:y})}function s(f,g){if(!g){const k=o.get(f);if(k&&(k.disconnect(),o.delete(f)),a.value[f]!=null){const x={...a.value};delete x[f],a.value=x}return}i(f,g);const y=new ResizeObserver(()=>i(f,g));y.observe(g),o.set(f,y)}e.onBeforeUnmount(()=>{o.forEach(f=>f.disconnect()),o.clear()});function l(f,g){if(f<=0||g<=0)return[];const y=[],k=.25;for(let x=0;x<g;x++){const E=x/Math.max(1,g-1),B=k+(1-k)*E,M=Math.max(1,Math.round(f*B));y.push(Math.min(M,f))}return y}function d(f,g){var B;const y=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,k=((B=a.value[f])==null?void 0:B.sum)??0;if(y<=k)return{bars:y,overflow:0};const x=Math.max(0,k-Wc),E=Math.max(0,y-x);return{bars:x,overflow:E}}function u(f,g){const y=a.value[f];if(!y||y.rows===0||y.cols===0)return[];const{widths:k}=y,E=d(f,g).bars,B=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,E):[])||[],M=k.map(()=>[]);let T=0;for(let _=k.length-1;_>=0&&T<B.length;_--){const C=Math.min(k[_],B.length-T);M[_]=B.slice(T,T+C),T+=C}return M}const c=e.ref(null);function m(f){return f&&f.nodeType===1&&typeof f.getBoundingClientRect=="function"}function h(f){if(!m(f))return;const g=c.value,y=g&&m(g)?g:f.offsetParent;if(!m(y))return;let k,x;try{k=f.getBoundingClientRect(),x=y.getBoundingClientRect()}catch{return}const E=y.scrollLeft||0,B=y.scrollTop||0;f.style.position="absolute",f.style.zIndex="0",f.style.top=`${k.top-x.top+B}px`,f.style.left=`${k.left-x.left+E}px`,f.style.width=`${k.width}px`,f.style.height=`${k.height}px`,f.style.pointerEvents="none"}function p(f){!f||!f.style||requestAnimationFrame(()=>{!f||!f.style||(f.style.position="",f.style.zIndex="",f.style.top="",f.style.left="",f.style.width="",f.style.height="",f.style.pointerEvents="")})}return(f,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:h,onAfterLeave:p},{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:x=>t.selectDayFn(y.date)},[t.isTodayFn(y.date)?(e.openBlock(),e.createElementBlock("div",Hc," Hoje ")):e.createCommentVNode("",!0),e.createElementVNode("div",Rc,[e.createElementVNode("span",zc,e.toDisplayString(y.date.getDate()),1)]),d(y.key,y.date).overflow>0?(e.openBlock(),e.createElementBlock("span",jc," +"+e.toDisplayString(d(y.key,y.date).overflow),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Gc,[e.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:x=>s(y.key,x)},[d(y.key,y.date).bars>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u(y.key,y.date),(x,E)=>(e.openBlock(),e.createElementBlock("div",{key:"vrow"+E,class:"vrow"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x,(B,M)=>(e.openBlock(),e.createElementBlock("span",{key:"vbar"+E+"-"+M,class:"vbar",style:e.normalizeStyle({background:e.unref(_n)(B),boxShadow:`0 0 8px ${e.unref(_n)(B)}70`})},null,4))),128))]))),128)):e.createCommentVNode("",!0)],512)])],14,_c))),128))]),_:1},512))}},[["__scopeId","data-v-26af06b5"]]),Zc={class:"agenda-section"},Yc={key:0,class:"empty-state"},Xc={key:1,class:"day-list"},Kc={class:"date-trail"},Qc={class:"weekday-short"},Jc={class:"date-pill bg-base-200 border border-base-300"},e3={class:"date-pill-month"},t3={class:"date-pill-day"},n3={class:"content-col"},a3={class:"day-header"},o3={class:"agenda-title"},r3={class:"month-header-text"},i3={class:"events-list"},s3=Ce({__name:"AgendaList",props:{days:{type:Array,default:()=>[]},weekdayLong:Function,weekdayShort:Function,monthShort:Function,monthLabelOf:Function,year:Number},emits:["open-chat","open-message","delete-message"],setup(t,{emit:n}){return(a,o)=>(e.openBlock(),e.createElementBlock("section",Zc,[t.days.length===0?(e.openBlock(),e.createElementBlock("div",Yc," Sem eventos neste mês. ")):(e.openBlock(),e.createElementBlock("ul",Xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.days,r=>{var i;return e.openBlock(),e.createElementBlock("li",{key:r.key,class:"day-item border-base-200"},[e.createElementVNode("div",Kc,[e.createElementVNode("div",Qc,e.toDisplayString(t.weekdayShort(r.date)),1),e.createElementVNode("div",Jc,[e.createElementVNode("div",e3,e.toDisplayString(t.monthShort(r.date)),1),e.createElementVNode("div",t3,e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",{style:e.normalizeStyle({background:e.unref(_n)(((i=r.events)==null?void 0:i[0])||{})}),class:"date-pill-dot"},null,4)])]),e.createElementVNode("div",n3,[e.createElementVNode("div",a3,[e.createElementVNode("h3",o3,e.toDisplayString(t.weekdayLong(r.date).toUpperCase())+" "+e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",r3,e.toDisplayString(t.monthLabelOf(r.date).toUpperCase())+" "+e.toDisplayString(t.year),1)]),e.createElementVNode("ul",i3,[(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(Va,{ev:s,mode:"agenda",onOpenMessage:o[0]||(o[0]=l=>a.$emit("open-message",l)),onOpenChat:o[1]||(o[1]=l=>a.$emit("open-chat",l)),onDeleteMessage:o[2]||(o[2]=l=>a.$emit("delete-message",l))},null,8,["ev"])]))),128))])])])}),128))]))]))}},[["__scopeId","data-v-2c977f25"]]),l3=["data-mode","data-empty"],c3=["disabled"],hr=Ce({__name:"EventsList",props:{loading:{type:Boolean,default:!1},selectedLabel:{type:String,default:""},selectedLabelLong:{type:String,default:""},events:{type:Array,default:()=>[]},mode:{type:String,default:"compact"}},emits:["reload","open-chat","open-message","delete-message"],setup(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]=i=>o.$emit("reload")),disabled:t.loading},e.toDisplayString(t.loading?"Atualizando…":"Atualizar"),9,c3)],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[4]||(r[4]=[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,(i,s)=>(e.openBlock(),e.createElementBlock("li",{key:i.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(Va,{ev:i,mode:t.mode==="compact"?"compact":"sidebar",onOpenMessage:r[1]||(r[1]=l=>o.$emit("open-message",l)),onOpenChat:r[2]||(r[2]=l=>o.$emit("open-chat",l)),onDeleteMessage:r[3]||(r[3]=l=>o.$emit("delete-message",l))},null,8,["ev","mode"])],6))),128))]),_:1},8,["class"]))],10,l3))}},[["__scopeId","data-v-4ecbf2a5"]]),d3={class:"cpk-popover__header border-base-100"},u3={class:"filter-body"},f3={class:"row"},m3=["checked"],h3={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},p3={class:"status-wrap"},g3={class:"seg"},y3=Ce({__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=Yt(),i=e.computed(()=>r.attendants.find(C=>C.is_me)||null),s=e.reactive({onlyMine:!1,status:null});e.watch(()=>a.open,async C=>{var F,H,V;if(!C)return;await e.nextTick();const w=(F=i.value)!=null&&F.id?String(i.value.id):null;s.onlyMine=!!w&&String(((H=a.filters)==null?void 0:H.scheduled_by)??"")===w;const P=(V=a.filters)==null?void 0:V.status;s.status=P===!0||P===!1?P:null,y()},{immediate:!1});function l(C,w){if(!C)return{};const{[w]:P,...F}=C;return F}function d(C){var P;s.onlyMine=!!C.target.checked;const w=(P=i.value)!=null&&P.id?String(i.value.id):null;s.onlyMine&&w?o("update:filters",{...a.filters,scheduled_by:w}):o("update:filters",l(a.filters,"scheduled_by"))}function u(C){if(s.status===C){s.status=null;const w=l(a.filters,"status");o("update:filters",w)}else s.status=C,o("update:filters",{...a.filters,status:C})}const c=e.ref(null),m=e.ref({left:0,top:0,placed:"bottom"}),h=e.computed(()=>({position:"fixed",left:`${m.value.left}px`,top:`${m.value.top}px`}));function p(){const C=a.anchorEl instanceof Element?a.anchorEl:null;if(C!=null&&C.getBoundingClientRect)return C.getBoundingClientRect();const w=window.innerWidth/2,P=window.innerHeight/3;return{left:w,right:w,top:P,bottom:P,width:0,height:0}}function f(C,w,P,F){return{left:Math.max(8,Math.min(C,window.innerWidth-P-8)),top:Math.max(8,Math.min(w,window.innerHeight-F-8))}}function g(){const C=p(),w=c.value,P=(w==null?void 0:w.offsetWidth)??300,F=(w==null?void 0:w.offsetHeight)??220;let H=C.bottom+a.offset,V;if(a.align==="center"?V=C.left+C.width/2-P/2:a.align==="end"?V=C.right-P:V=C.left,H+F>window.innerHeight-4){const $=C.top-F-a.offset;$>=4?(H=$,m.value.placed="top"):m.value.placed="bottom"}else m.value.placed="bottom";const v=f(V,H,P,F);m.value={left:v.left,top:v.top,placed:m.value.placed}}function y(){g(),requestAnimationFrame(g)}let k,x,E=[];function B(){M(),E=[window];const C=a.anchorEl instanceof Element?a.anchorEl:null;let w=C==null?void 0:C.parentElement;for(;w&&w!==document.body;){const P=getComputedStyle(w);/(auto|scroll)/.test(P.overflow+P.overflowY+P.overflowX)&&E.push(w),w=w.parentElement}E.forEach(P=>P.addEventListener("scroll",y,{passive:!0}))}function M(){E.forEach(C=>{var w;return(w=C.removeEventListener)==null?void 0:w.call(C,"scroll",y)}),E=[]}e.watch(()=>a.open,async C=>{var P,F,H,V;if(!C){M(),(P=k==null?void 0:k.disconnect)==null||P.call(k),(F=x==null?void 0:x.disconnect)==null||F.call(x);return}await e.nextTick(),y(),B(),(H=k==null?void 0:k.disconnect)==null||H.call(k),k=new ResizeObserver(y),k.observe(document.body),(V=x==null?void 0:x.disconnect)==null||V.call(x);const w=a.anchorEl instanceof Element?a.anchorEl:null;w&&(x=new ResizeObserver(y),x.observe(w)),window.addEventListener("resize",y)}),e.watch(()=>a.anchorEl,async()=>{a.open&&(await e.nextTick(),B(),y())});function T(C){C.key==="Escape"&&o("close")}function _(C){if(!a.open)return;const w=C.target,P=c.value;if(P&&P.contains(w))return;const F=a.anchorEl instanceof Element?a.anchorEl:null;F&&F.contains&&F.contains(w)||o("close")}return e.onMounted(()=>{document.addEventListener("pointerdown",_,!0),window.addEventListener("keydown",T)}),e.onBeforeUnmount(()=>{var C,w;document.removeEventListener("pointerdown",_,!0),window.removeEventListener("keydown",T),M(),(C=k==null?void 0:k.disconnect)==null||C.call(k),(w=x==null?void 0:x.disconnect)==null||w.call(x)}),(C,w)=>(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:w[4]||(w[4]=e.withModifiers(P=>C.$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(h.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[e.createElementVNode("div",d3,[w[5]||(w[5]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),w[6]||(w[6]=e.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:w[0]||(w[0]=P=>C.$emit("close")),"aria-label":"Fechar"}," × ")]),e.createElementVNode("div",u3,[e.createElementVNode("label",f3,[e.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:w[1]||(w[1]=P=>d(P)),"aria-label":"Exibir somente meus eventos"},null,40,m3),w[7]||(w[7]=e.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),e.createElementVNode("div",h3,[w[9]||(w[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",p3,[w[8]||(w[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",g3,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:w[2]||(w[2]=P=>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:w[3]||(w[3]=P=>u(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):e.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-0aad9d42"]]),k3={class:"calendar-content"},x3={class:"calendar-stage-main"},b3={key:0},pr=Ce({__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=Cc();r.setBaseUrl(o.sourceUrl);const i=new Date,s=e.ref(u(o.initialDate)),l=e.ref(new Date(i.getFullYear(),i.getMonth(),i.getDate())),d=e.ref("calendar");function u(b){if(b instanceof Date)return new Date(b.getFullYear(),b.getMonth(),1);if(typeof b=="string"){const[N,X]=b.split("-").map(ne=>parseInt(ne,10));return new Date(N||i.getFullYear(),(X||i.getMonth()+1)-1,1)}return new Date(i.getFullYear(),i.getMonth(),1)}function c(b){return new Date(b.getFullYear(),b.getMonth()+1,0).getDate()}function m(b){return new Date(b.getFullYear(),b.getMonth(),1).getDay()}function h(b,N){return b.getFullYear()===N.getFullYear()&&b.getMonth()===N.getMonth()}function p(b){return Sa(b,i)}function f(b){return Sa(b,l.value)}function g(b){l.value=new Date(b.getFullYear(),b.getMonth(),b.getDate()),h(b,s.value)||(s.value=new Date(b.getFullYear(),b.getMonth(),1))}function y(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function k(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function x(){s.value=new Date(i.getFullYear(),i.getMonth(),1),l.value=new Date(i.getFullYear(),i.getMonth(),i.getDate())}const E=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],B=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],M=e.computed(()=>v(E[s.value.getMonth()])),T=e.computed(()=>s.value.getFullYear()),_=e.computed(()=>w(l.value)),C=e.computed(()=>`${P(l.value)} ${l.value.getDate()}`);function w(b){return`${String(b.getDate()).padStart(2,"0")}/${String(b.getMonth()+1).padStart(2,"0")}/${b.getFullYear()}`}function P(b){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][b.getDay()]}function F(b){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][b.getDay()]}function H(b){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][b.getMonth()]}function V(b){return E[b.getMonth()]}function v(b){return b.charAt(0).toUpperCase()+b.slice(1)}const $=e.computed(()=>m(s.value)),Z=e.computed(()=>{const b=c(s.value);return Array.from({length:b},(N,X)=>{const ne=X+1,se=new Date(s.value.getFullYear(),s.value.getMonth(),ne);return{key:`d${ne}`,date:se}})}),Q=e.ref({open:!1,anchorEl:null});function ee(b){Q.value.open=!0,Q.value.anchorEl=(b==null?void 0:b.currentTarget)||null}const{filters:L}=Dt.storeToRefs(r),R=e.computed(()=>Zt(s.value)),O=e.computed(()=>r.eventsOf(R.value)),oe={scheduled_by:b=>{var ne,se,fe;const N=(b==null?void 0:b.scheduled_by)??((se=(ne=b==null?void 0:b.raw)==null?void 0:ne.params)==null?void 0:se.scheduled_by)??((fe=b==null?void 0:b.raw)==null?void 0:fe.scheduled_by)??(b==null?void 0:b.created_by)??(b==null?void 0:b.attendant_id),X=typeof N=="object"&&N?N.id??N.attendant_id:N;return X!=null?String(X):""}};function de(b,N){const X=(N==null?void 0:N.value)??N;return!X||typeof X!="object"?!0:Object.entries(X).every(([ne,se])=>{var ve,Fe,xe;if(se==null||se===""||Array.isArray(se)&&se.length===0)return!0;const fe=oe[ne],me=(fe==null?void 0:fe(b))??(b==null?void 0:b[ne])??((ve=b==null?void 0:b.raw)==null?void 0:ve[ne])??((xe=(Fe=b==null?void 0:b.raw)==null?void 0:Fe.params)==null?void 0:xe[ne])??null,be=typeof me=="string"?me:me??"";if(typeof se=="function")return!!se(be,b);if(Array.isArray(se))return se.map(String).includes(String(be));if(typeof se=="object"){const{in:S,notIn:z,range:j,contains:A}=se;if(S&&!S.map(String).includes(String(be))||z&&z.map(String).includes(String(be)))return!1;if(j&&typeof be=="number"){const[G,W]=j;if(G!=null&&be<G||W!=null&&be>W)return!1}if(A!=null){const G=Array.isArray(be)?be:String(be).split(",");if(!(Array.isArray(A)?A:[A]).some(J=>G.map(String).includes(String(J))))return!1}return!0}return String(be)===String(se)})}const pe=e.computed(()=>(O.value||[]).filter(N=>de(N,L)));function ye(b){return pe.value.filter(N=>Sa(N.date,b))}const Ve=e.computed(()=>ye(l.value)),Le=e.computed(()=>[...Ve.value].sort((b,N)=>b.date-N.date));function Ae(b){return ye(b).length}function qe(b){return Math.min(3,Ae(b))}function _e(b){const N=Ae(b);return N>3?N-3:0}const $e=e.computed(()=>{const b=s.value.getFullYear(),N=s.value.getMonth(),X=new Map;for(const se of pe.value){const fe=se==null?void 0:se.date;if(!(fe instanceof Date)||fe.getFullYear()!==b||fe.getMonth()!==N)continue;const me=`${b}-${N+1}-${fe.getDate()}`;X.has(me)||X.set(me,{key:`ag-${me}`,date:new Date(b,N,fe.getDate()),events:[]}),X.get(me).events.push(se)}const ne=Array.from(X.values());for(const se of ne)se.events.sort((fe,me)=>fe.date-me.date);return ne.sort((se,fe)=>se.date-fe.date),ne}),Oe=e.ref(!1),ze=e.ref(!1),q=e.computed(()=>ze.value||Oe.value),re=e.computed(()=>q?"calendar-stage--compact":"calendar-stage--single");function he(){var X;const b=window.matchMedia("(max-width: 1280px)"),N=()=>ze.value=b.matches;N(),(X=b.addEventListener)==null||X.call(b,"change",N)}const ae=e.computed(()=>r.isLoading(R.value));e.computed(()=>r.errorOf(R.value));const K=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 ce(b,N){K.value.open=!0,K.value.context={action:"delete-message",event:b},K.value.title="Confirmar exclusão",K.value.description="Tem certeza que deseja apagar este evento?",K.value.anchorEl=N&&N.currentTarget||typeof document<"u"&&document.activeElement||null,K.value.destructive=!0,K.value.confirmLabel="Apagar",K.value.loadingLabel="Apagando…"}async function D(b){if(b)try{K.value.loading=!0,b.action==="delete-message"&&await Y(b.event)}finally{K.value.loading=!1,K.value.open=!1,K.value.context=null}}function I(){K.value.open=!1,K.value.context=null}async function te(){await r.forceReload(R.value)}async function Y(b){var N;try{b.deleteLoading=!0;const X=((N=b==null?void 0:b.raw)==null?void 0:N.id)??(b==null?void 0:b.id)??b;if(X==null)throw new Error("Evento inválido para exclusão");const ne=await D2(Ts,b);return ne!=null&&ne.ok&&(r.removeFromCache(String(X))||await r.forceReload(R.value)),ne}catch(X){return console.error(X),null}finally{b.deleteLoading=!1}}return e.onMounted(async()=>{if(he(),await r.ensureMonthLoaded(R.value),!ye(l.value).length&&pe.value.length){const b=pe.value[0];l.value=new Date(b.date.getFullYear(),b.date.getMonth(),b.date.getDate())}}),e.watch(()=>o.sourceUrl,async b=>{if(r.setBaseUrl(b),r.resetAll(),await r.ensureMonthLoaded(R.value),!ye(l.value).length&&pe.value.length){const N=pe.value[0];l.value=new Date(N.date.getFullYear(),N.date.getMonth(),N.date.getDate())}}),e.watch(R,async()=>{const b=s.value.getFullYear(),N=s.value.getMonth(),X=Math.min(l.value.getDate(),c(s.value));if(l.value=new Date(b,N,X),await r.ensureMonthLoaded(R.value),!ye(l.value).length&&pe.value.length){const ne=pe.value[0];l.value=new Date(ne.date.getFullYear(),ne.date.getMonth(),ne.date.getDate())}}),n({updateEvent:r.applyUpdateToCache}),(b,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":q.value}])},[e.createElementVNode("div",k3,[N[15]||(N[15]=e.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),e.createVNode(Lc,{month:M.value,year:T.value,"is-compact":q.value,"view-mode":d.value,"filter-count":Object.keys(e.unref(L)).length,onPrev:y,onNext:k,onToday:x,onToggleCompact:N[0]||(N[0]=X=>Oe.value=!Oe.value),onSetViewMode:N[1]||(N[1]=X=>d.value=X),onClosePage:N[2]||(N[2]=X=>b.$emit("close-page")),onOpenFilter:ee},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",re.value])},[e.createElementVNode("div",x3,[e.createVNode(Oc,{"week-days":B,month:M.value,year:T.value},null,8,["month","year"]),e.createVNode(Uc,{"start-offset":$.value,"month-days":Z.value,"view-date":s.value,"is-compact":q.value,"is-same-month-fn":h,"is-selected-day-fn":f,"is-today-fn":p,"select-day-fn":g,"events-by-day-fn":ye,"day-event-count-fn":Ae,"event-bars-to-show-fn":qe,"day-event-overflow-fn":_e},null,8,["start-offset","month-days","view-date","is-compact"])]),q.value?(e.openBlock(),e.createBlock(hr,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:ae.value,"selected-label-long":C.value,events:Le.value,mode:"compact",onReload:te,onOpenChat:N[3]||(N[3]=X=>b.$emit("open-chat",X)),onOpenMessage:N[4]||(N[4]=X=>b.$emit("open-message",X)),onDeleteMessage:N[5]||(N[5]=(X,ne)=>ce(X,ne))},null,8,["loading","selected-label-long","events"])):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(s3,{key:1,days:$e.value,"weekday-long":P,"weekday-short":F,"month-short":H,"month-label-of":V,year:T.value,onOpenChat:N[6]||(N[6]=X=>b.$emit("open-chat",X)),onOpenMessage:N[7]||(N[7]=X=>b.$emit("open-message",X)),onDeleteMessage:N[8]||(N[8]=(X,ne)=>ce(X,ne))},null,8,["days","year"]))]),e.createVNode(hr,{class:"calendar-daylist calendar-daylist--desktop",loading:ae.value,"selected-label":_.value,"selected-label-long":C.value,events:Le.value,mode:q.value?"compact":"sidebar",onReload:te,onOpenChat:N[9]||(N[9]=X=>b.$emit("open-chat",X)),onOpenMessage:N[10]||(N[10]=X=>b.$emit("open-message",X)),onDeleteMessage:N[11]||(N[11]=(X,ne)=>ce(X,ne))},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),e.createVNode(xl,{modelValue:K.value.open,"onUpdate:modelValue":N[12]||(N[12]=X=>K.value.open=X),title:K.value.title,description:K.value.description,destructive:K.value.destructive,"confirm-label":K.value.confirmLabel,"cancel-label":K.value.cancelLabel,loading:K.value.loading,"loading-label":K.value.loadingLabel,context:K.value.context,"anchor-el":K.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:D,onCancel:I},{details:e.withCtx(()=>{var X;return[(X=K.value.context)!=null&&X.event?(e.openBlock(),e.createElementBlock("div",b3,[e.createVNode(Va,{"view-only":!0,mode:"sidebar",ev:K.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(y3,{open:Q.value.open,"anchor-el":Q.value.anchorEl,filters:e.unref(L),"onUpdate:filters":N[13]||(N[13]=X=>e.isRef(L)?L.value=X:null),onClose:N[14]||(N[14]=X=>Q.value.open=!1)},null,8,["open","anchor-el","filters"])],64))}},[["__scopeId","data-v-9c3b18ef"]]),w3={class:"flex flex-col text-center"},E3={class:"flex flex-col space-y-3 justify-center"},v3={class:"space-x-4 flex-col text-black justify-center"},C3=["onUpdate:modelValue","onInput","onKeydown"],gr={__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 i=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()},l=(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",w3,[e.createElementVNode("div",E3,[e.createElementVNode("div",v3,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,h)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:h,"onUpdate:modelValue":p=>o.value[h]=p,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:p=>i(h),onKeydown:e.withKeys(p=>l(h,p),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,C3)),[[e.vModelText,o.value[h]]])),128))])])]))}},S3={class:"text-center flex gap-3"},B3={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},V3={key:0,class:"items-center justify-center inline-flex"},M3=["src"],N3={__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")},i=e.computed(()=>o.base64?o.base64:l.value),s=e.computed(()=>`w-${o.dimensions[0]} h-${o.dimensions[1]}`),l=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",S3,[e.createElementVNode("section",B3,[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",V3,[...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:i.value,alt:"QRCode"},null,10,M3)])]))}};for(var We=[],Ma=0;Ma<256;++Ma)We.push((Ma+256).toString(16).slice(1));function A3(t,n=0){return(We[t[n+0]]+We[t[n+1]]+We[t[n+2]]+We[t[n+3]]+"-"+We[t[n+4]]+We[t[n+5]]+"-"+We[t[n+6]]+We[t[n+7]]+"-"+We[t[n+8]]+We[t[n+9]]+"-"+We[t[n+10]]+We[t[n+11]]+We[t[n+12]]+We[t[n+13]]+We[t[n+14]]+We[t[n+15]]).toLowerCase()}var Hn,T3=new Uint8Array(16);function D3(){if(!Hn&&(Hn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hn(T3)}var F3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const yr={randomUUID:F3};function L3(t,n,a){if(yr.randomUUID&&!t)return yr.randomUUID();t=t||{};var o=t.random||(t.rng||D3)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,A3(o)}function kr(){const t=Yt(),n=async l=>{const d=t.attendants.find(u=>u.id===l);if(d)try{const u=await ot.get(`${Ea}?attendant=${l}&page=1`);d.messages=u.data.results.reverse(),d.hasNextPage=u.data.next!==null,d.currentPage=2,d.internal_chat={channel_id:u.data.channel_id,unread:0}}catch(u){console.error("Erro ao buscar mensagens:",u)}},a=async l=>{const d=t.attendants.find(u=>u.id===l);if(!(!d||!d.hasNextPage))try{const u=await ot.get(`${Ea}?attendant=${l}&page=${d.currentPage}`);d.messages=[...u.data.results.reverse(),...d.messages],d.hasNextPage=u.data.next!==null,d.currentPage++}catch(u){console.error("Erro ao carregar mais mensagens:",u)}},o=(l,d,u)=>{const c=l==null?void 0:l.message;if(!c)return;const m=t.attendants.find(h=>{var p;return((p=h.internal_chat)==null?void 0:p.channel_id)===c.channel_id});m?(m.messages=m.messages||[],m.messages.find(p=>p.id===c.id)||(m.messages.push(c),(!d||m.id!==u)&&(m.internal_chat.unread=(m.internal_chat.unread||0)+1))):console.error("Atendente não encontrado para o canal especificado.")},r=l=>{const d=t.attendants.find(u=>u.id===l);d&&(d.internal_chat.unread=0)},i=async(l,d,u,c=!1)=>{var f;const m=t.attendants.find(g=>g.id===l);if(!m||!((f=m.internal_chat)!=null&&f.channel_id))return;let h;c?h=d:h={type:"text",content:d};const p={id:L3(),content:h,created_at:new Date().toISOString(),sender:u};m.messages.push(p);try{await ot.post(`${Ea}${m.internal_chat.channel_id}/message/`,{id:p.id,content:p.content})}catch(g){console.error("Erro ao enviar mensagem:",g)}},s=l=>{const d=t.attendants.find(u=>u.id===l);return d?d.hasNextPage:!1};return{attendants:e.computed(()=>t.attendants),count:e.computed(()=>t.count),fetchMessagesForAtendente:n,loadMessagesForAtendente:a,addMessageToAtendente:o,sendMessageToAtendente:i,hasNextPageForAtendente:s,resetUnreadMessages:r}}const $3={class:"avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500"},P3={key:0,style:{"padding-top":"0.5rem"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},O3=["src"],Na=Ce({__name:"Avatar",props:{url:{type:String}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",$3,[t.url?(e.openBlock(),e.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:t.url},null,8,O3)):(e.openBlock(),e.createElementBlock("svg",P3,[...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)])]))]))}},[["__scopeId","data-v-7d8b2820"]]),_3={class:"attendants-container"},H3={class:"atendentes-list bg-base-300"},R3={key:0,class:"empty-message bg-base-200"},z3=["onClick"],j3={class:"atendente-main"},G3={class:"atendente-name"},I3={class:"flex items-center gap-4"},q3={key:0,class:"message-indicator"},W3={key:0,class:"chat-footer bg-base-200"},xr=Ce({__name:"ChatList",props:{atendentes:{type:Array,required:!0},attendant:{required:!0},mobile:{type:Boolean,default:!1}},emits:["atendenteSelecionado"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),i=d=>{o("atendenteSelecionado",d)},s=d=>{switch(d){case"Busy":return"bg-red-500";case"Online":return"bg-green-500";case"Away":return"bg-yellow-500";case"Offline":return"bg-gray-500";default:return"bg-purple-500"}},l=e.computed(()=>r.value?a.atendentes.filter(d=>d.name.toLowerCase().includes(r.value.toLowerCase())&&d.id!==a.attendant.id):a.atendentes.filter(d=>d.id!==a.attendant.id));return(d,u)=>(e.openBlock(),e.createElementBlock("div",_3,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=c=>r.value=c),class:e.normalizeClass(t.mobile?"search-input-mobile bg-base-300 border-b border-base-200":"search-input bg-base-300 border-b border-base-200"),placeholder:"Pesquise entre os atendentes..."},null,2),[[e.vModelText,r.value]]),e.createElementVNode("ul",H3,[l.value.length===0?(e.openBlock(),e.createElementBlock("li",R3,e.toDisplayString(t.atendentes.length===0?"Não há atendentes disponíveis":"Não há atendentes com esse nome"),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,c=>(e.openBlock(),e.createElementBlock("li",{key:c.id,onClick:m=>i(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("main",j3,[e.createVNode(Na,{url:c.photo},null,8,["url"]),e.createElementVNode("span",G3,e.toDisplayString(c.name),1)]),e.createElementVNode("footer",I3,[c.internal_chat.unread>0?(e.openBlock(),e.createElementBlock("span",q3,e.toDisplayString(c.internal_chat.unread),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["status-indicator",s(c.login_status)])},null,2)]),u[1]||(u[1]=e.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,z3))),128))]),t.mobile?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",W3))]))}},[["__scopeId","data-v-dc8950e9"]]);function U3(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 Z3(t){return t?(await e.nextTick(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null):null}function Y3(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 br(t,n){if(await e.nextTick(),!t.top)return;const a=t.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const wr=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},X3={},K3=t=>(e.pushScopeId("data-v-d3e37633"),t=t(),e.popScopeId(),t),Q3={class:"container"},J3=K3(()=>e.createElementVNode("div",{class:"spinner"},null,-1)),ed=[J3];function td(t,n){return e.openBlock(),e.createElementBlock("div",Q3,ed)}const nd=wr(X3,[["render",td],["__scopeId","data-v-d3e37633"]]),ad={class:"state-error"},hn=wr(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 i=e.ref(null),s=e.ref(""),{top:l,firstload:d,distance:u}=a,{identifier:c,target:m}=e.toRefs(a),h={infiniteLoading:i,top:l,firstload:d,distance:u,parentEl:null,emit(){r=(h.parentEl||document.documentElement).scrollHeight,p.loading(),n("infinite",p)}},p={loading(){s.value="loading"},async loaded(){s.value="loaded",await br(h,r),U3(i.value,h.parentEl)&&h.emit()},async complete(){s.value="complete",await br(h,r),o==null||o.disconnect()},error(){s.value="error"}};function f(){o==null||o.disconnect(),o=Y3(h)}return e.watch(c,f),e.onMounted(async()=>{h.parentEl=await Z3(m),f()}),e.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"infiniteLoading",ref:i,class:"v3-infinite-loading"},[e.withDirectives(e.createElementVNode("div",null,[e.renderSlot(g.$slots,"spinner",{},()=>[e.createVNode(nd)],!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:h.emit},()=>{var k;return[e.createElementVNode("span",ad,[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]=(...x)=>h.emit&&h.emit(...x))},"retry")])]},!0):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]);function od(t,n,a){const o=ct(t,a==null?void 0:a.in);return isNaN(n)?rt(t,NaN):(o.setDate(o.getDate()+n),o)}function Rn(t,n){return Pt(t,{...n,weekStartsOn:1})}function Er(t,n){const a=ct(t,n==null?void 0:n.in),o=a.getFullYear(),r=rt(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const i=Rn(r),s=rt(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const l=Rn(s);return a.getTime()>=i.getTime()?o+1:a.getTime()>=l.getTime()?o:o-1}function vr(t){const n=ct(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 zn(t,n){const a=ct(t,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function rd(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n),i=zn(o),s=zn(r),l=+i-vr(i),d=+s-vr(s);return Math.round((l-d)/El)}function id(t,n){const a=Er(t,n),o=rt(t,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),Rn(o)}function Aa(t){return rt(t,Date.now())}function Cr(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n);return+zn(o)==+zn(r)}function sd(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ld(t){return!(!sd(t)&&typeof t!="number"||isNaN(+ct(t)))}function cd(t,n){const a=ct(t,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function dd(t,n){const a=ct(t,n==null?void 0:n.in);return rd(a,cd(a))+1}function ud(t,n){const a=ct(t,n==null?void 0:n.in),o=+Rn(a)-+id(a);return Math.round(o/ir)+1}function Sr(t,n){var c,m,h,p;const a=ct(t,n==null?void 0:n.in),o=a.getFullYear(),r=Pn(),i=(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??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=rt((n==null?void 0:n.in)||t,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=Pt(s,n),d=rt((n==null?void 0:n.in)||t,0);d.setFullYear(o,0,i),d.setHours(0,0,0,0);const u=Pt(d,n);return+a>=+l?o+1:+a>=+u?o:o-1}function fd(t,n){var l,d,u,c;const a=Pn(),o=(n==null?void 0:n.firstWeekContainsDate)??((d=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,r=Sr(t,n),i=rt((n==null?void 0:n.in)||t,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),Pt(i,n)}function md(t,n){const a=ct(t,n==null?void 0:n.in),o=+Pt(a,n)-+fd(a,n);return Math.round(o/ir)+1}function De(t,n){const a=t<0?"-":"",o=Math.abs(t).toString().padStart(n,"0");return a+o}const Bt={y(t,n){const a=t.getFullYear(),o=a>0?a:1-a;return De(n==="yy"?o%100:o,n.length)},M(t,n){const a=t.getMonth();return n==="M"?String(a+1):De(a+1,2)},d(t,n){return De(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 De(t.getHours()%12||12,n.length)},H(t,n){return De(t.getHours(),n.length)},m(t,n){return De(t.getMinutes(),n.length)},s(t,n){return De(t.getSeconds(),n.length)},S(t,n){const a=n.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return De(r,n.length)}},Xt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Br={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 Bt.y(t,n)},Y:function(t,n,a,o){const r=Sr(t,o),i=r>0?r:1-r;if(n==="YY"){const s=i%100;return De(s,2)}return n==="Yo"?a.ordinalNumber(i,{unit:"year"}):De(i,n.length)},R:function(t,n){const a=Er(t);return De(a,n.length)},u:function(t,n){const a=t.getFullYear();return De(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 De(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 De(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 Bt.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 De(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=md(t,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):De(r,n.length)},I:function(t,n,a){const o=ud(t);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):De(o,n.length)},d:function(t,n,a){return n==="do"?a.ordinalNumber(t.getDate(),{unit:"date"}):Bt.d(t,n)},D:function(t,n,a){const o=dd(t);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):De(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(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(i);case"ee":return De(i,2);case"eo":return a.ordinalNumber(i,{unit:"day"});case"eee":return a.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(r,{width:"short",context:"formatting"});case"eeee":default:return a.day(r,{width:"wide",context:"formatting"})}},c:function(t,n,a,o){const r=t.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(i);case"cc":return De(i,n.length);case"co":return a.ordinalNumber(i,{unit:"day"});case"ccc":return a.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(r,{width:"narrow",context:"standalone"});case"cccccc":return a.day(r,{width:"short",context:"standalone"});case"cccc":default:return a.day(r,{width:"wide",context:"standalone"})}},i:function(t,n,a){const o=t.getDay(),r=o===0?7:o;switch(n){case"i":return String(r);case"ii":return De(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=Xt.noon:o===0?r=Xt.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=Xt.evening:o>=12?r=Xt.afternoon:o>=4?r=Xt.morning:r=Xt.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 Bt.h(t,n)},H:function(t,n,a){return n==="Ho"?a.ordinalNumber(t.getHours(),{unit:"hour"}):Bt.H(t,n)},K:function(t,n,a){const o=t.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):De(o,n.length)},k:function(t,n,a){let o=t.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):De(o,n.length)},m:function(t,n,a){return n==="mo"?a.ordinalNumber(t.getMinutes(),{unit:"minute"}):Bt.m(t,n)},s:function(t,n,a){return n==="so"?a.ordinalNumber(t.getSeconds(),{unit:"second"}):Bt.s(t,n)},S:function(t,n){return Bt.S(t,n)},X:function(t,n,a){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Mr(o);case"XXXX":case"XX":return Ot(o);case"XXXXX":case"XXX":default:return Ot(o,":")}},x:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"x":return Mr(o);case"xxxx":case"xx":return Ot(o);case"xxxxx":case"xxx":default:return Ot(o,":")}},O:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Vr(o,":");case"OOOO":default:return"GMT"+Ot(o,":")}},z:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Vr(o,":");case"zzzz":default:return"GMT"+Ot(o,":")}},t:function(t,n,a){const o=Math.trunc(+t/1e3);return De(o,n.length)},T:function(t,n,a){return De(+t,n.length)}};function Vr(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),i=o%60;return i===0?a+String(r):a+String(r)+n+De(i,2)}function Mr(t,n){return t%60===0?(t>0?"-":"+")+De(Math.abs(t)/60,2):Ot(t,n)}function Ot(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=De(Math.trunc(o/60),2),i=De(o%60,2);return a+r+n+i}const Nr=(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"})}},Ar=(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"})}},hd={p:Ar,P:(t,n)=>{const a=t.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return Nr(t,n);let i;switch(o){case"P":i=n.dateTime({width:"short"});break;case"PP":i=n.dateTime({width:"medium"});break;case"PPP":i=n.dateTime({width:"long"});break;case"PPPP":default:i=n.dateTime({width:"full"});break}return i.replace("{{date}}",Nr(o,n)).replace("{{time}}",Ar(r,n))}},pd=/^D+$/,gd=/^Y+$/,yd=["D","DD","YY","YYYY"];function kd(t){return pd.test(t)}function xd(t){return gd.test(t)}function bd(t,n,a){const o=wd(t,n,a);if(console.warn(o),yd.includes(t))throw new RangeError(o)}function wd(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 Ed=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Cd=/^'([^]*?)'?$/,Sd=/''/g,Bd=/[a-zA-Z]/;function Tr(t,n,a){var c,m,h,p,f,g,y,k;const o=Pn(),r=(a==null?void 0:a.locale)??o.locale??Jl,i=(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??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(f=a==null?void 0:a.locale)==null?void 0:f.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((k=(y=o.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=ct(t,a==null?void 0:a.in);if(!ld(l))throw new RangeError("Invalid time value");let d=n.match(vd).map(x=>{const E=x[0];if(E==="p"||E==="P"){const B=hd[E];return B(x,r.formatLong)}return x}).join("").match(Ed).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const E=x[0];if(E==="'")return{isToken:!1,value:Vd(x)};if(Br[E])return{isToken:!0,value:x};if(E.match(Bd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:x}});r.localize.preprocessor&&(d=r.localize.preprocessor(l,d));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return d.map(x=>{if(!x.isToken)return x.value;const E=x.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&xd(E)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&kd(E))&&bd(E,n,String(t));const B=Br[E[0]];return B(l,E,r.localize,u)}).join("")}function Vd(t){const n=t.match(Cd);return n?n[1].replace(Sd,"'"):t}function Md(t,n){return Cl(rt(t,t),Aa(t),n)}function Nd(t,n){return Cr(rt(t,t),Aa(t))}function Ad(t,n,a){return od(t,-1,a)}function Td(t,n){return Cr(rt(t,t),Ad(Aa(t)))}/*! License details at fancyapps.com/license */const Te=t=>typeof t=="string";/*! License details at fancyapps.com/license */const Kt=t=>t&&t!==null&&t instanceof Element&&"nodeType"in t;/*! License details at fancyapps.com/license */const Dd=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},_t=function(t,n=void 0){return!t||t===document.body||n&&t===n?null:Dd(t)?t:_t(t.parentElement,n)};/*! License details at fancyapps.com/license */const wt=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 Be=function(t=0,n=0,a=0){return Math.max(Math.min(n,a),t)};/*! License details at fancyapps.com/license */const Ze=t=>typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]";/*! License details at fancyapps.com/license */function Dr(t){return Ze(t)||Array.isArray(t)}function pn(t,n){const a=Object.keys(t),o=Object.keys(n);return a.length===o.length&&a.every(r=>{const i=t[r],s=n[r];return typeof i=="function"?`${i}`==`${s}`:Dr(i)&&Dr(s)?pn(i,s):i===s})}/*! License details at fancyapps.com/license */const Fr=function(t){for(const n of jn)n.getState()===Xe.Running&&n.tick(Ta?t-Ta:0);Ta=t,Jt=window.requestAnimationFrame(Fr)};var Xe,Vt,Qt;(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"})(Xe||(Xe={})),function(t){t[t.Spring=0]="Spring",t[t.Ease=1]="Ease"}(Vt||(Vt={})),function(t){t[t.Loop=0]="Loop",t[t.Reverse=1]="Reverse"}(Qt||(Qt={}));const jn=new Set;let Jt=null,Ta=0;function Mt(){let t=Xe.Initializing,n=Vt.Ease,a=0,o=0,r=Mt.Easings.Linear,i=500,s=0,l=0,d=0,u=0,c=1/0,m=.01,h=.01,p=!1,f={},g=null,y={},k={},x={},E=0,B=0,M=Qt.Loop,T=Mt.Easings.Linear;const _=new Map;function C(V,...v){for(const $ of _.get(V)||[])$(...v)}function w(V){return o=0,V?g=setTimeout(()=>{P()},V):P(),H}function P(){t=Xe.Running,C("start",y,k)}function F(){if(t=Xe.Completed,x={},C("end",y),t===Xe.Completed)if(a<E){if(a++,M===Qt.Reverse){const V=Object.assign({},f);f=Object.assign({},k),k=V}w(B)}else a=0;return H}const H={getState:function(){return t},easing:function(V){return r=V,n=Vt.Ease,x={},H},duration:function(V){return i=V,H},spring:function(V={}){n=Vt.Spring;const v={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:$,mass:Z,tension:Q,friction:ee,restDelta:L,restSpeed:R,maxSpeed:O,clamp:oe}=Object.assign(Object.assign({},v),V);return s=$,l=Z,d=Q,u=ee,h=L,m=R,c=O,p=oe,x={},H},isRunning:function(){return t===Xe.Running},isSpring:function(){return n===Vt.Spring},from:function(V){return y=Object.assign({},V),H},to:function(V){return k=V,H},repeat:function(V,v=0,$=Qt.Loop,Z){return E=V,B=v,M=$,T=Z||r,H},on:function(V,v){var $,Z;return $=V,Z=v,_.set($,[..._.get($)||[],Z]),H},off:function(V,v){var $,Z;return $=V,Z=v,_.has($)&&_.set($,_.get($).filter(Q=>Q!==Z)),H},start:function(V){return pn(y,k)||(t=Xe.Initializing,f=Object.assign({},y),jn.add(this),Jt||(Jt=window.requestAnimationFrame(Fr)),w(V)),H},pause:function(){return g&&(clearTimeout(g),g=null),t===Xe.Running&&(t=Xe.Paused,C("pause",y)),H},end:F,tick:function(V){V>50&&(V=50),o+=V;let v=0,$=!1;if(t!==Xe.Running)return H;if(n===Vt.Ease){v=Be(0,o/i,1),$=v===1;const Q=M===Qt.Reverse?T:r;for(const ee in y)y[ee]=f[ee]+(k[ee]-f[ee])*Q(v)}if(n===Vt.Spring){const Q=.001*V;let ee=0;for(const L in y){const R=k[L];let O=y[L];if(typeof R!="number"||isNaN(R)||typeof O!="number"||isNaN(O))continue;if(Math.abs(R-O)<=h){y[L]=R,x[L]=0;continue}x[L]||(typeof s=="object"&&typeof s[L]=="number"?x[L]=s[L]:x[L]=typeof s=="number"?s:0);let oe=x[L];oe=Be(-1*Math.abs(c),oe,Math.abs(c));const de=oe*l*u;oe+=((O>R?-1:1)*(Math.abs(R-O)*d)-de)/l*Q,O+=oe*Q;const pe=y[L]>R?O<R:O>R;let ye=Math.abs(oe)<m&&Math.abs(R-O)<=h;p&&pe&&(ye=!0),ye?(O=R,oe=0):ee++,y[L]=O,x[L]=oe}$=!ee}const Z=Object.assign({},k);return C("step",y,f,k,v),$&&t===Xe.Running&&pn(k,Z)&&(t=Xe.Completed,F()),H},getStartValues:function(){return f},getCurrentValues:function(){return y},getCurrentVelocities:function(){return x},getEndValues:function(){return k},destroy:function(){t=Xe.Destroyed,g&&(clearTimeout(g),g=null),f=y=k={},jn.delete(this)}};return H}Mt.destroy=()=>{for(const t of jn)t.destroy();Jt&&(cancelAnimationFrame(Jt),Jt=null)},Mt.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 gn(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}function Da(t,n){const a=[],o=gn(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 Lr(t){return Da(t,"touches")}function $r(t){return Da(t,"targetTouches")}function Pr(t){return Da(t,"changedTouches")}function Nt(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 Gn(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 Or=t=>{t.cancelable&&t.preventDefault()},At={passive:!1},Fd={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let In=!1,yn=!0;const en=(t,n)=>{let a,o,r,i=Object.assign(Object.assign({},Fd),n),s=[],l=[],d=[],u=!1,c=!1,m=!1,h=!1,p=0,f=0,g=0,y=0,k=0,x=0,E=0,B=0,M=0,T=[],_=0,C=0;const w=new Map;function P(L){const R=Gn(l),O=Gn(d),oe=R&&O?R/O:0,de=Math.abs(E)>Math.abs(B)?E:B,pe={srcEvent:a,isPanRecognized:u,isSwipeRecognized:c,firstTouch:s,previousTouch:d,currentTouch:l,deltaX:g,deltaY:y,offsetX:k,offsetY:x,velocityX:E,velocityY:B,velocity:de,angle:M,axis:r,scale:oe,center:o};for(const ye of w.get(L)||[])ye(pe)}function F(L){const R=Date.now();if(T=T.filter(O=>!O.ts||O.ts>R-100),L&&T.push(L),E=0,B=0,T.length>3){const O=T[0],oe=T[T.length-1];if(O&&oe){const de=oe.x-O.x,pe=oe.y-O.y,ye=O.ts&&oe.ts?oe.ts-O.ts:0;ye>0&&(E=Math.abs(de)>3?de/(ye/30):0,B=Math.abs(pe)>3?pe/(ye/30):0)}}}function H(L){if(typeof MouseEvent<"u"&&L instanceof MouseEvent){if(In)return}else In=!0;const R=L.composedPath()[0],O=i.ignore.join(",");if(R.matches(O)||R.closest(O))return;if(typeof MouseEvent<"u"&&L instanceof MouseEvent){if(!L.buttons||L.button!==0)return;Or(L)}L instanceof MouseEvent&&(window.addEventListener("mousemove",V),window.addEventListener("mouseup",v)),window.addEventListener("blur",$),a=L,l=$r(L),s=[...l],d=[],f=l.length,o=Nt(l),f===1&&(u=!1,c=!1,m=!1),f&&F(Nt(l));const oe=Date.now(),de=oe-(p||oe);h=de>0&&de<=250&&f===1,p=oe,clearTimeout(_),P("start")}function V(L){var R;if(!s.length||L.defaultPrevented)return;a=L,d=[...l],l=Lr(L);const O=Nt(d),oe=Nt(Lr(L));if(F(oe),f=l.length,o=oe,d.length===l.length?(g=oe.x-O.x,y=oe.y-O.y):(g=0,y=0),s.length){const de=Nt(s);k=oe.x-de.x,x=oe.y-de.y}if(l.length>1){const de=Gn(l),pe=Gn(d);Math.abs(de-pe)>=.1&&(m=!0,P("pinch"))}u||(u=Math.abs(k)>i.panThreshold||Math.abs(x)>i.panThreshold,u&&(yn=!1,clearTimeout(C),C=0,M=Math.abs(180*Math.atan2(x,k)/Math.PI),r=M>45&&M<135?"y":"x",s=[...l],d=[...l],k=0,x=0,g=0,y=0,(R=window.getSelection())===null||R===void 0||R.removeAllRanges(),P("panstart"))),u&&(g||y)&&P("pan"),P("move")}function v(L){if(a=L,!s.length)return;const R=$r(L),O=Pr(L);if(f=R.length,o=Nt(O),O.length&&F(Nt(O)),d=[...l],l=[...R],s=[...R],f>0)P("end"),u=!1,c=!1,T=[];else{const oe=i.swipeThreshold;(Math.abs(E)>oe||Math.abs(B)>oe)&&(c=!0),u&&P("panend"),c&&P("swipe"),u||c||m||(P("tap"),h?P("doubleTap"):_=setTimeout(function(){P("singleTap")},250)),P("end"),Z()}}function $(){clearTimeout(_),Z(),u&&P("panend"),P("end")}function Z(){In=!1,u=!1,c=!1,h=!1,f=0,T=[],l=[],d=[],s=[],g=0,y=0,k=0,x=0,E=0,B=0,M=0,r=void 0,window.removeEventListener("mousemove",V),window.removeEventListener("mouseup",v),window.removeEventListener("blur",$),yn||C||(C=setTimeout(()=>{yn=!0,C=0},100))}function Q(L){const R=L.target;In=!1,R&&!L.defaultPrevented&&(yn||(Or(L),L.stopPropagation()))}const ee={init:function(){return t&&(t.addEventListener("click",Q,At),t.addEventListener("mousedown",H,At),t.addEventListener("touchstart",H,At),t.addEventListener("touchmove",V,At),t.addEventListener("touchend",v),t.addEventListener("touchcancel",v)),ee},on:function(L,R){return function(O,oe){w.set(O,[...w.get(O)||[],oe])}(L,R),ee},off:function(L,R){return w.has(L)&&w.set(L,w.get(L).filter(O=>O!==R)),ee},isPointerDown:()=>f>0,destroy:function(){clearTimeout(_),clearTimeout(C),C=0,t&&(t.removeEventListener("click",Q,At),t.removeEventListener("mousedown",H,At),t.removeEventListener("touchstart",H,At),t.removeEventListener("touchmove",V,At),t.removeEventListener("touchend",v),t.removeEventListener("touchcancel",v)),t=null,Z()}};return ee};en.isClickAllowed=()=>yn;/*! License details at fancyapps.com/license */const Fa={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 we=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.add(a)})};/*! License details at fancyapps.com/license */const Ke=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.remove(a)})};/*! License details at fancyapps.com/license */const Ye=(t,n="",a)=>{t&&t.classList&&n.split(" ").forEach(o=>{o&&t.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Ht=t=>{t.cancelable&&t.preventDefault()},Qe=(t,n=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*n)/n),kt=t=>t instanceof HTMLImageElement;var ge,_r;(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"})(ge||(ge={})),function(t){t.Cover="cover",t.Full="full",t.Max="max"}(_r||(_r={}));const ft={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},La={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:ge.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:Fa,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:ge.Zoom,width:"auto"};let qn,Hr=0,Rr=0,Wn=0;const $a=(t,n={},a={})=>{let o,r,i,s,l,d,u,c,m=0,h=Object.assign(Object.assign({},La),n),p={},f=Object.assign({},ft),g=Object.assign({},ft);const y=[];function k(D){let I=h[D];return I&&typeof I=="function"?I(ce):I}function x(){return t&&t.parentElement&&o&&m===3}const E=new Map;function B(D,...I){const te=[...E.get(D)||[]];h.on&&te.push(h.on[D]);for(const Y of te)Y&&Y instanceof Function&&Y(ce,...I);D!=="*"&&B("*",D,...I)}function M(D){if(!x())return;const I=D.target;if(_t(I))return;const te=Date.now(),Y=[-D.deltaX||0,-D.deltaY||0,-D.detail||0].reduce(function(se,fe){return Math.abs(fe)>Math.abs(se)?fe:se}),b=Be(-1,Y,1);B("wheel",D,b);const N=k("wheelAction");if(!N||D.defaultPrevented)return;const X=g.scale;let ne=X*(b>0?1.5:.5);if(N===ge.Zoom){const se=Math.abs(D.deltaY)<100&&Math.abs(D.deltaX)<100;if(te-Rr<(se?200:45))return void Ht(D);Rr=te;const fe=Q(),me=O();if(Qe(ne)<Qe(fe)&&Qe(X)<=Qe(fe)?(Wn+=Math.abs(b),ne=fe):Qe(ne)>Qe(me)&&Qe(X)>=Qe(me)?(Wn+=Math.abs(b),ne=me):(Wn=0,ne=Be(fe,ne,me)),Wn>7)return}switch(Ht(D),N){case ge.Pan:ye(N,{srcEvent:D,deltaX:2*-D.deltaX,deltaY:2*-D.deltaY});break;case ge.Zoom:ye(ge.ZoomTo,{srcEvent:D,scale:ne,center:{x:D.clientX,y:D.clientY}});break;default:ye(N,{srcEvent:D})}}function T(D){var I,te;const Y=D.composedPath()[0];if(!en.isClickAllowed()||!Kt(Y)||D.defaultPrevented||!(t!=null&&t.contains(Y))||Y.hasAttribute("disabled")||Y.hasAttribute("aria-disabled"))return;const b=Y.closest("[data-panzoom-action]"),N=(I=b==null?void 0:b.dataset)===null||I===void 0?void 0:I.panzoomAction,X=((te=b==null?void 0:b.dataset)===null||te===void 0?void 0:te.panzoomValue)||"";if(N){switch(Ht(D),N){case ge.ZoomTo:case ge.ZoomIn:case ge.ZoomOut:ye(N,{scale:parseFloat(X||"")||void 0});break;case ge.MoveLeft:case ge.MoveRight:ye(N,{deltaX:parseFloat(X||"")||void 0});break;case ge.MoveUp:case ge.MoveDown:ye(N,{deltaY:parseFloat(X||"")||void 0});break;case ge.ToggleFS:ae();break;default:ye(N)}return}if(!(o!=null&&o.contains(Y)))return;const ne={srcEvent:D};if(ye(k("clickAction"),ne),k("dblClickAction")){const se=Date.now(),fe=se-(Hr||se);Hr=se,fe>0&&fe<=250?(qn&&(clearTimeout(qn),qn=void 0),ye(k("dblClickAction"),ne)):qn=setTimeout(()=>{ye(k("singleClickAction"),ne)},250)}}function _(D){if(c=D,!x()||!v()||f.scale<=1||g.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const I=$(g.scale);if(!I)return;const{x:te,y:Y}=I;ye(ge.Pan,{deltaX:te-g.x,deltaY:Y-g.y})}function C(){var D;t&&(Ke(t,"is-loading"),(D=t.querySelector(".f-spinner"))===null||D===void 0||D.remove())}function w(){if(!t||!r)return;if(C(),kt(r)&&(!r.complete||!r.naturalWidth))return m=2,o==null||o.classList.add("has-error"),void B("error");B("loaded");const{width:D,height:I}=H();kt(r)&&(r.setAttribute("width",D+""),r.setAttribute("height",I+"")),o&&(Ke(o,"has-error"),kt(r)&&(o.setAttribute("width",D+""),o.setAttribute("height",I+""),o.style.aspectRatio=`${D/I||""}`)),d=Mt().on("start",(Y,b)=>{b.angle!==void 0&&(b.angle=90*Math.round(b.angle/90)),b.flipX!==void 0&&(b.flipX=b.flipX>0?1:-1),b.flipY!==void 0&&(b.flipY=b.flipY>0?1:-1),g=Object.assign(Object.assign({},ft),b),pe(),B("animationStart")}).on("pause",Y=>{g=Object.assign(Object.assign({},ft),Y)}).on("step",Y=>{if(!x())return void(d==null||d.end());if(f=Object.assign(Object.assign({},ft),Y),v()||!k("bounds")||q()||g.scale>f.scale||g.scale<ee())return void Ve();const b=oe(g.scale);let N=!1,X=!1,ne=!1,se=!1;f.x<b.x[0]&&(N=!0),f.x>b.x[1]&&(X=!0),f.y<b.y[0]&&(se=!0),f.y>b.y[1]&&(ne=!0);let fe=!1,me=!1,be=!1,ve=!1;g.x<b.x[0]&&(fe=!0),g.x>b.x[1]&&(me=!0),g.y<b.y[0]&&(ve=!0),g.y>b.y[1]&&(be=!0);let Fe=!1;(X&&me||N&&fe)&&(g.x=Be(b.x[0],g.x,b.x[1]),Fe=!0),(ne&&be||se&&ve)&&(g.y=Be(b.y[0],g.y,b.y[1]),Fe=!0),Fe&&d&&d.spring({tension:94,friction:17,maxSpeed:555*g.scale,restDelta:.1,restSpeed:.1,velocity:d.getCurrentVelocities()}).from(f).to(g).start(),Ve()}).on("end",()=>{l!=null&&l.isPointerDown()||de(),d!=null&&d.isRunning()||(pe(),B("animationEnd"))}),function(){const Y=k("gestures");if(!Y||!s||!r)return;let b=!1;l=en(s,Y).on("start",N=>{if(!k("gestures")||!d||!x()||v())return;const X=N.srcEvent;(f.scale>1||N.currentTouch.length>1)&&(X==null||X.stopPropagation(),d.pause(),b=!0),N.currentTouch.length===1&&B("touchStart")}).on("move",N=>{var X;b&&(g.scale!==1||N.currentTouch.length>1)&&(Ht(N.srcEvent),(X=N.srcEvent)===null||X===void 0||X.stopPropagation())}).on("pan",N=>{if(!b)return;const X=N.srcEvent;(g.scale!==1||N.currentTouch.length>1)&&(Ht(X),ye(ge.Pan,N))}).on("swipe",N=>{b&&g.scale>1&&ye(ge.Swipe,N)}).on("tap",N=>{B("click",N)}).on("singleTap",N=>{B("singleClick",N)}).on("doubleTap",N=>{B("dblClick",N)}).on("pinch",N=>{b&&(N.scale>ee()?ye(ge.ZoomIn,N):N.scale<ee()?ye(ge.ZoomOut,N):ye(ge.Pan,N))}).on("end",N=>{b&&(N.currentTouch.length?(N.srcEvent.stopPropagation(),Ht(N.srcEvent),d==null||d.end()):(b=!1,pe(),de(),B("touchEnd")))}).init()}(),s&&(s.addEventListener("wheel",M,{passive:!1}),y.push(()=>{s==null||s.removeEventListener("wheel",M,{passive:!1})})),t==null||t.addEventListener("click",T),document==null||document.addEventListener("mousemove",_),y.push(()=>{t==null||t.removeEventListener("click",T),document==null||document.removeEventListener("mousemove",_)});const te=P();f=Object.assign({},te),g=Object.assign({},te),m=3,Ve(),pe(),B("ready"),requestAnimationFrame(()=>{C(),s&&(s.style.visibility="")})}function P(){const D=Object.assign({},k("startPos")||{});let I=D.scale,te=1;te=typeof I=="string"?Z(I):typeof I=="number"?I:ee();const Y=Object.assign(Object.assign(Object.assign({},ft),D),{scale:te}),b=v()?$(te):void 0;if(b){const{x:N,y:X}=b;Y.x=N,Y.y=X}return Y}function F(){const D={top:0,left:0,width:0,height:0};if(o){const I=o.getBoundingClientRect();g.angle%180==90?(D.top=I.top+.5*I.height-.5*I.width,D.left=I.left+.5*I.width-.5*I.height,D.width=I.height,D.height=I.width):(D.top=I.top,D.left=I.left,D.width=I.width,D.height=I.height)}return D}function H(){let D=k("width"),I=k("height");if(r&&D==="auto"){const te=r.getAttribute("width");D=te?parseFloat(te+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):kt(s)?s.naturalWidth:kt(r)?r.naturalWidth:(o==null?void 0:o.getBoundingClientRect().width)||0}else D=Te(D)?parseFloat(D):D;if(r&&I==="auto"){const te=r.getAttribute("height");I=te?parseFloat(te+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):kt(s)?s.naturalHeight:kt(r)?r.naturalHeight:(o==null?void 0:o.getBoundingClientRect().height)||0}else I=Te(I)?parseFloat(I):I;return{width:D,height:I}}function V(){const D=F();return{width:D.width,height:D.height}}function v(){return k("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function $(D){const I=c||k("event"),te=o==null?void 0:o.getBoundingClientRect();if(!I||!te||D<=1)return{x:0,y:0};const Y=(I.clientX||0)-te.left,b=(I.clientY||0)-te.top,{width:N,height:X}=V(),ne=oe(D);if(D>1){const ve=k("mouseMoveFactor");ve>1&&(D*=ve)}let se=N*D,fe=X*D,me=.5*(se-N)-Y/N*100/100*(se-N),be=.5*(fe-X)-b/X*100/100*(fe-X);return me=Be(ne.x[0],me,ne.x[1]),be=Be(ne.y[0],be,ne.y[1]),{x:me,y:be}}function Z(D="base"){if(!t)return 1;const I=t.getBoundingClientRect(),te=F(),{width:Y,height:b}=H(),N=me=>{if(typeof me=="number")return me;switch(me){case"min":case"base":return 1;case"cover":return Math.max(I.height/te.height,I.width/te.width)||1;case"full":case"max":{const be=g.angle%180==90?b:Y;return be&&te.width?be/te.width:1}}},X=k("minScale"),ne=k("maxScale"),se=Math.min(N("full"),N(X)),fe=typeof ne=="number"?N("full")*ne:Math.min(N("full"),N(ne));switch(D){case"min":return se;case"base":return Be(se,1,fe);case"cover":return N("cover");case"full":return Math.min(fe,N("full"));case"max":return fe}}function Q(){return Z("min")}function ee(){return Z("base")}function L(){return Z("cover")}function R(){return Z("full")}function O(){return Z("max")}function oe(D){const I={x:[0,0],y:[0,0]},te=t==null?void 0:t.getBoundingClientRect();if(!te)return I;const Y=F(),b=te.width,N=te.height;let X=Y.width,ne=Y.height,se=D=D===void 0?g.scale:D,fe=D;if(v()&&D>1){const me=k("mouseMoveFactor");me>1&&(X*D>b+.01&&(se*=me),ne*D>N+.01&&(fe*=me))}return X*=se,ne*=fe,D>1&&(X>b&&(I.x[0]=.5*(b-X),I.x[1]=.5*(X-b)),I.x[0]-=.5*(Y.left-te.left),I.x[1]-=.5*(Y.left-te.left),I.x[0]-=.5*(Y.left+Y.width-te.right),I.x[1]-=.5*(Y.left+Y.width-te.right),ne>N&&(I.y[0]=.5*(N-ne),I.y[1]=.5*(ne-N)),I.y[0]-=.5*(Y.top-te.top),I.y[1]-=.5*(Y.top-te.top),I.y[0]-=.5*(Y.top+Y.height-te.bottom),I.y[1]-=.5*(Y.top+Y.height-te.bottom)),I}function de(){if(!x()||!k("bounds")||!d)return;const D=Q(),I=O(),te=Be(D,g.scale,I);if(g.scale<D-.01||g.scale>I+.01)return void ye(ge.ZoomTo,{scale:te});if(d.isRunning()||q())return;const Y=oe(te);g.x<Y.x[0]||g.x>Y.x[1]||g.y<Y.y[0]||g.y>Y.y[1]?(g.x=Be(Y.x[0],g.x,Y.x[1]),g.y=Be(Y.y[0],g.y,Y.y[1]),d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:d.getCurrentVelocities()}),d.from(f).to(g).start()):Ve()}function pe(D){var I;if(!x())return;const te=ze(),Y=q(),b=re(),N=he(),X=Ae(),ne=qe();Ye(o,"is-fullsize",N),Ye(o,"is-expanded",b),Ye(o,"is-dragging",Y),Ye(o,"can-drag",te),Ye(o,"will-zoom-in",X),Ye(o,"will-zoom-out",ne);const se=$e(),fe=Oe(),me=_e(),be=!x();for(const ve of((I=D||t)===null||I===void 0?void 0:I.querySelectorAll("[data-panzoom-action]"))||[]){const Fe=ve.dataset.panzoomAction;let xe=!1;if(be)xe=!0;else switch(Fe){case ge.ZoomIn:se||(xe=!0);break;case ge.ZoomOut:me||(xe=!0);break;case ge.ToggleFull:{fe||me||(xe=!0);const S=ve.querySelector("g");S&&(S.style.display=N&&!xe?"none":"");break}case ge.IterateZoom:{se||me||(xe=!0);const S=ve.querySelector("g");S&&(S.style.display=se||xe?"":"none");break}case ge.ToggleCover:case ge.ToggleMax:se||me||(xe=!0)}xe?(ve.setAttribute("aria-disabled",""),ve.setAttribute("tabindex","-1")):(ve.removeAttribute("aria-disabled"),ve.removeAttribute("tabindex"))}}function ye(D,I){var te;if(!(D&&t&&r&&d&&x())||D===ge.Swipe&&Math.abs(d.getCurrentVelocities().scale)>.01)return;const Y=Object.assign({},g);let b=Object.assign({},g),N=oe(v()?Y.scale:f.scale);const X=d.getCurrentVelocities(),ne=F(),se=(((te=(I=I||{}).currentTouch)===null||te===void 0?void 0:te.length)||0)>1,fe=I.velocityX||0,me=I.velocityY||0;let be=I.center;I.srcEvent&&(be=Nt(Pr(I.srcEvent)));let ve=I.deltaX||0,Fe=I.deltaY||0;switch(D){case ge.MoveRight:ve=I.deltaX||100;break;case ge.MoveLeft:ve=I.deltaX||-100;break;case ge.MoveUp:Fe=I.deltaY||-100;break;case ge.MoveDown:Fe=I.deltaY||100}let xe=[];switch(D){case ge.Reset:b=Object.assign({},ft),b.scale=ee();break;case ge.Pan:case ge.Move:case ge.MoveLeft:case ge.MoveRight:case ge.MoveUp:case ge.MoveDown:if(q()){let j=1,A=1;b.x<=N.x[0]&&fe<=0&&(j=Math.max(.01,1-Math.abs(1/ne.width*Math.abs(b.x-N.x[0]))),j*=.2),b.x>=N.x[1]&&fe>=0&&(j=Math.max(.01,1-Math.abs(1/ne.width*Math.abs(b.x-N.x[1]))),j*=.2),b.y<=N.y[0]&&me<=0&&(A=Math.max(.01,1-Math.abs(1/ne.height*Math.abs(b.y-N.y[0]))),A*=.2),b.y>=N.y[1]&&me>=0&&(A=Math.max(.01,1-Math.abs(1/ne.height*Math.abs(b.y-N.y[1]))),A*=.2),b.x+=ve*j,b.y+=Fe*A}else b.x=Be(N.x[0],b.x+ve,N.x[1]),b.y=Be(N.y[0],b.y+Fe,N.y[1]);break;case ge.Swipe:const S=(j=0)=>Math.sign(j)*Math.pow(Math.abs(j),1.5);b.x+=Be(-1e3,S(fe),1e3),b.y+=Be(-1e3,S(me),1e3),me&&!fe&&(b.x=Be(N.x[0],b.x,N.x[1])),!me&&fe&&(b.y=Be(N.y[0],b.y,N.y[1])),X.x=fe,X.y=me;break;case ge.ZoomTo:b.scale=I.scale||1;break;case ge.ZoomIn:b.scale=b.scale*(I.scale||2),se||(b.scale=Math.min(b.scale,O()));break;case ge.ZoomOut:b.scale=b.scale*(I.scale||.5),se||(b.scale=Math.max(b.scale,Q()));break;case ge.ToggleCover:xe=[ee(),L()];break;case ge.ToggleFull:xe=[ee(),R()];break;case ge.ToggleMax:xe=[ee(),O()];break;case ge.IterateZoom:xe=[ee(),R(),O()];break;case ge.Zoom:const z=R();b.scale>=z-.05?b.scale=ee():b.scale=Math.min(z,b.scale*(I.scale||2));break;case ge.RotateCW:b.angle+=90;break;case ge.RotateCCW:b.angle-=90;break;case ge.FlipX:b.flipX*=-1;break;case ge.FlipY:b.flipY*=-1}if(f.angle!==void 0&&Math.abs(f.angle)>=360&&(b.angle-=360*Math.floor(f.angle/360),f.angle-=360*Math.floor(f.angle/360)),xe.length){const S=xe.findIndex(z=>z>b.scale+1e-4);b.scale=xe[S]||xe[0]}if(se&&(b.scale=Be(Q()*(se?.8:1),b.scale,O()*(se?1.6:1))),v()){const S=$(b.scale);if(S){const{x:z,y:j}=S;b.x=z,b.y=j}}else if(Math.abs(b.scale-Y.scale)>1e-4){let S=0,z=0;if(be)S=be.x,z=be.y;else{const J=t.getBoundingClientRect();S=J.x+.5*J.width,z=J.y+.5*J.height}let j=S-ne.left,A=z-ne.top;j-=.5*ne.width,A-=.5*ne.height;const G=(j-Y.x)/Y.scale,W=(A-Y.y)/Y.scale;b.x=j-G*b.scale,b.y=A-W*b.scale,!se&&k("bounds")&&(N=oe(b.scale),b.x=Be(N.x[0],b.x,N.x[1]),b.y=Be(N.y[0],b.y,N.y[1]))}if(D===ge.Swipe){let S=94,z=17,j=500*b.scale,A=X;d.spring({tension:S,friction:z,maxSpeed:j,restDelta:.1,restSpeed:.1,velocity:A})}else D===ge.Pan||se?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:X});if(I.velocity===0||pn(f,b))f=Object.assign({},b),g=Object.assign({},b),d.end(),Ve(),pe();else{if(pn(g,b))return;d.from(f).to(b).start()}B("action",D)}function Ve(){if(!r||!o||!s)return;const{width:D,height:I}=H();Object.assign(o.style,{maxWidth:`min(${D}px, 100%)`,maxHeight:`min(${I}px, 100%)`});const te=function(){const{width:ve,height:Fe}=H(),{width:xe,height:S}=V();if(!t)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:xe,fitHeight:S,fullWidth:ve,fullHeight:Fe};let{x:z,y:j,scale:A,angle:G,flipX:W,flipY:J}=f,ie=1/R(),ue=ve,le=Fe,ke=f.scale*ie,Ee=g.scale*ie;const Me=Math.max(xe,S),Ne=Math.min(xe,S);ve>Fe?(ue=Me,le=Ne):(ue=Ne,le=Me),ke=ve>Fe?Me*A/ve||1:Me*A/Fe||1;let je=ue?ve*Ee:0,it=le?Fe*Ee:0,st=ue&&le?ve*ke/je:0;return z=z+.5*ue-.5*je,j=j+.5*le-.5*it,{x:z,y:j,width:je,height:it,scale:st,flipX:W,flipY:J,angle:G,fitWidth:xe,fitHeight:S,fullWidth:ve,fullHeight:Fe}}(),{x:Y,y:b,width:N,height:X,scale:ne,angle:se,flipX:fe,flipY:me}=te;let be=`translate(${Qe(Y)}px, ${Qe(b)}px)`;be+=fe!==1||me!==1?` scaleX(${Qe(ne*fe)}) scaleY(${Qe(ne*me)})`:` scale(${Qe(ne)})`,se!==0&&(be+=` rotate(${se}deg)`),s.style.width=`${Qe(N)}px`,s.style.height=`${Qe(X)}px`,s.style.transform=`${be}`,B("render")}function Le(){let D=g.scale;const I=k("clickAction");let te=ee();if(I){let Y=[];switch(I){case ge.ZoomIn:te=2*D;break;case ge.ZoomOut:te=.5*D;break;case ge.ToggleCover:Y=[ee(),L()];break;case ge.ToggleFull:Y=[ee(),R()];break;case ge.ToggleMax:Y=[ee(),O()];break;case ge.IterateZoom:Y=[ee(),R(),O()];break;case ge.Zoom:const b=R();te=D>=b-.05?ee():Math.min(b,2*D)}if(Y.length){const b=Y.findIndex(N=>N>D+1e-4);te=Y[b]||ee()}}return te=Be(Q(),te,O()),te}function Ae(){return!!(x()&&Le()>g.scale)}function qe(){return!!(x()&&Le()<g.scale)}function _e(){return!!(x()&&g.scale>Q())}function $e(){return!!(x()&&g.scale<O())}function Oe(){return!!(x()&&g.scale<R())}function ze(){return!(!(x()&&re()&&l)||v())}function q(){return!(!x()||!(l!=null&&l.isPointerDown())||v())}function re(){return!!(x()&&g.scale>ee())}function he(){return!!(x()&&g.scale>=R())}function ae(){const D="in-fullscreen",I="with-panzoom-in-fullscreen";t==null||t.classList.toggle(D);const te=t==null?void 0:t.classList.contains(D);te?(document.documentElement.classList.add(I),document.addEventListener("keydown",K,!0)):(document.documentElement.classList.remove(I),document.removeEventListener("keydown",K,!0)),Ve(),B(te?"enterFS":"exitFS")}function K(D){D.key!=="Escape"||D.defaultPrevented||ae()}const ce={canDrag:ze,canZoomIn:$e,canZoomOut:_e,canZoomToFull:Oe,destroy:function(){B("destroy");for(const D of Object.values(p))D==null||D.destroy(ce);for(const D of y)D();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,f=Object.assign({},ft),g=Object.assign({},ft),d==null||d.destroy(),d=void 0,l==null||l.destroy(),l=void 0,m=4,ce},emit:B,execute:ye,getBoundaries:oe,getContainer:function(){return t},getContent:function(){return r},getFullDim:H,getGestures:function(){return l},getMousemovePos:$,getOptions:function(){return h},getPlugins:function(){return p},getScale:Z,getStartPosition:P,getState:function(){return m},getTransform:function(D){return D===!0?g:f},getTween:function(){return d},getViewport:function(){return s},getWrapper:function(){return o},init:function(){return m=0,B("init"),function(){for(const[D,I]of Object.entries(Object.assign(Object.assign({},a),h.plugins||{})))if(D&&!p[D]&&I instanceof Function){const te=I();te.init(ce),p[D]=te}B("initPlugins")}(),function(){const D=Object.assign(Object.assign({},La.classes),k("classes"));if(t&&(we(t,D.container),r=t.querySelector("."+D.content),!!r)){if(r.setAttribute("draggable","false"),o=t.querySelector("."+D.wrapper),o||(o=document.createElement("div"),we(o,D.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),s=t.querySelector("."+D.viewport),s||(s=document.createElement("div"),we(s,D.viewport),s.insertAdjacentElement("afterbegin",r),o.insertAdjacentElement("beforeend",s)),i=r.cloneNode(!0),i.removeAttribute("id"),o.insertAdjacentElement("afterbegin",i),r instanceof HTMLPictureElement&&(r=r.querySelector("img")),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),s instanceof HTMLPictureElement&&(s=s.querySelector("img")),s&&(s.style.visibility="hidden",k("protected"))){s.addEventListener("contextmenu",te=>{Ht(te)});const I=document.createElement("div");we(I,"f-panzoom__protected"),s.appendChild(I)}B("initLayout")}}(),function(){if(t&&o&&!u){let D=null;u=new ResizeObserver(()=>{x()&&(D=D||requestAnimationFrame(()=>{x()&&(pe(),de(),B("refresh")),D=null}))}),u.observe(o),y.push(()=>{u==null||u.disconnect(),u=void 0,D&&(cancelAnimationFrame(D),D=null)})}}(),function(){if(!t||!r)return;if(!kt(r)||!kt(i))return void w();const D=()=>{r&&kt(r)&&r.decode().then(()=>{w()}).catch(()=>{w()})};if(m=1,t.classList.add("is-loading"),B("loading"),i.src&&i.complete)return void D();(function(){if(!t||t!=null&&t.querySelector(".f-spinner"))return;const I=k("spinnerTpl"),te=wt(I);te&&(te.classList.add("f-spinner"),t.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",te))})(),i.addEventListener("load",D,!1),i.addEventListener("error",D,!1),y.push(()=>{i==null||i.removeEventListener("load",D,!1),i==null||i.removeEventListener("error",D,!1)})}(),ce},isDragging:q,isExpanded:re,isFullsize:he,isMousemoveMode:v,localize:function(D,I=[]){const te=k("l10n")||{};D=String(D).replace(/\{\{(\w+)\}\}/g,(Y,b)=>te[b]||Y);for(let Y=0;Y<I.length;Y++)D=D.split(I[Y][0]).join(I[Y][1]);return D=D.replace(/\{\{(.*?)\}\}/g,(Y,b)=>b)},off:function(D,I){for(const te of D instanceof Array?D:[D])E.has(te)&&E.set(te,E.get(te).filter(Y=>Y!==I));return ce},on:function(D,I){for(const te of D instanceof Array?D:[D])E.set(te,[...E.get(te)||[],I]);return ce},toggleFS:ae,updateControls:pe,version:"6.1.3",willZoomIn:Ae,willZoomOut:qe};return ce};$a.l10n={en_EN:Fa},$a.getDefaults=()=>La;/*! License details at fancyapps.com/license */const Pa=(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 nt=(t,...n)=>{const a=n.length;for(let o=0;o<a;o++){const r=n[o]||{};Object.entries(r).forEach(([i,s])=>{const l=Array.isArray(s)?[]:{};t[i]||Object.assign(t,{[i]:l}),Ze(s)?Object.assign(t[i],nt(t[i],s)):Array.isArray(s)?Object.assign(t,{[i]:[...s]}):Object.assign(t,{[i]:s})})}return t};/*! License details at fancyapps.com/license */const Un=function(t=0,n=0,a=0,o=0,r=0,i=!1){const s=(t-n)/(a-n)*(r-o)+o;return i?o<r?Be(o,s,r):Be(r,s,o):s};/*! License details at fancyapps.com/license */const Oa=Object.assign(Object.assign({},Fa),{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 Rt=t=>{t.cancelable&&t.preventDefault()},tn={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:Oa,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 zr,jr=0;const Zn=(t,n={},a={})=>{jr++;let o,r,i,s,l,d=0,u=Object.assign({},tn),c=Object.assign({},tn),m={},h=null,p=null,f=!1,g=!1,y=!1,k=!1,x="height",E=0,B=!0,M=0,T=0,_=0,C=0,w="*",P=[],F=[];const H=new Set;let V=[],v=[],$=0,Z=0,Q=0;function ee(S,...z){let j=c[S];return j&&j instanceof Function?j(xe,...z):j}function L(S,z=[]){const j=ee("l10n")||{};S=String(S).replace(/\{\{(\w+)\}\}/g,(A,G)=>j[G]||A);for(let A=0;A<z.length;A++)S=S.split(z[A][0]).join(z[A][1]);return S=S.replace(/\{\{(.*?)\}\}/g,(A,G)=>G)}const R=new Map;function O(S,...z){const j=[...R.get(S)||[]];c.on&&j.push(c.on[S]);for(const A of j)A&&A instanceof Function&&A(xe,...z);S!=="*"&&O("*",S,...z)}function oe(){var S,z;const j=nt({},tn,u);nt(j,tn,u);let A="";const G=u.breakpoints||{};if(G)for(const[W,J]of Object.entries(G))window.matchMedia(W).matches&&(A+=W,nt(j,J));if(l===void 0||A!==l){if(l=A,d!==0){let W=(z=(S=v[M])===null||S===void 0?void 0:S.slides[0])===null||z===void 0?void 0:z.index;W===void 0&&(W=c.initialSlide),j.initialSlide=W,j.slides=[];for(const J of P)J.isVirtual&&j.slides.push(J)}be(),c=j,ee("enabled")!==!1&&(d=0,O("init"),function(){for(const[W,J]of Object.entries(Object.assign(Object.assign({},a),c.plugins||{})))if(W&&!m[W]&&J instanceof Function){const ie=J();ie.init(xe,Zn),m[W]=ie}O("initPlugins")}(),function(){if(!h)return;const W=ee("classes")||{};we(h,W.container);const J=ee("style");if(J&&Ze(J))for(const[ie,ue]of Object.entries(J))h.style.setProperty(ie,ue);p=h.querySelector(`.${W.viewport}`),p||(p=document.createElement("div"),we(p,W.viewport),p.append(...Pa(h,`.${W.slide}`)),h.insertAdjacentElement("afterbegin",p)),h.carousel=xe,O("initLayout")}(),function(){if(!p)return;const W=ee("classes")||{};P=[],[...Pa(p,`.${W.slide}`)].forEach(J=>{if(J.parentElement){const ie=re(Object.assign({el:J,isVirtual:!1},J.dataset||{}));O("createSlide",ie),P.push(ie)}}),ce();for(const J of P)O("addSlide",J);q(ee("slides"));for(const J of P){const ie=J.el;(ie==null?void 0:ie.parentElement)===p&&(we(ie,c.classes.slide),we(ie,J.class),ne(J),O("attachSlideEl",J))}O("initSlides")}(),D(),d=1,we(h,(ee("classes")||{}).isEnabled||""),me(),Le(),r=Mt().on("start",()=>{o&&o.isPointerDown()||(Ve(),me())}).on("step",W=>{const J=E;E=W.pos,E!==J&&(B=!1,me())}).on("end",W=>{o!=null&&o.isPointerDown()||(E=W.pos,r&&!g&&(E<_||E>C)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Be(_,E,C)}).start():B||(B=!0,O("settle")))}),pe(),function(){if(!h||!p)return;h.addEventListener("click",b,{passive:!1}),document.addEventListener("mousemove",de);const W=p.getBoundingClientRect();if($=W.height,Z=W.width,!i){let J=null;i=new ResizeObserver(()=>{J||(J=requestAnimationFrame(()=>{(function(){if(d!==1||!p)return;const ie=v.length,ue=p.getBoundingClientRect(),le=ue.height,ke=ue.width;ie>1&&(k&&Math.abs(le-$)<.5||!k&&Math.abs(ke-Z)<.5)||(D(),pe(),$=le,Z=ke,k&&!le||!k&&!ke||h&&p&&(ie===v.length&&(o!=null&&o.isPointerDown())||(ee("dragFree")&&(g||E>_&&E<C)?(Ve(),me()):se(M,{transition:!1}))))})(),J=null}))}),i.observe(p)}}(),O("ready"))}}function de(S){zr=S}function pe(){ee("gestures")===!1?o&&(o.destroy(),o=void 0):o||function(){const S=ee("gestures");!o&&S!==!1&&p&&(o=en(p,S).on("start",z=>{var j,A;if(!r)return;const{srcEvent:G}=z;k&&gn(G)&&!_t(G.target)&&Rt(G),r.pause(),r.getCurrentVelocities().pos=0;const W=(j=v[M])===null||j===void 0?void 0:j.slides[0];W&&H.has(W.index)&&W.el&&(E=W.offset||0,E+=(function(J){const ie=window.getComputedStyle(J),ue=new DOMMatrixReadOnly(ie.transform);return{width:ue.m41||0,height:ue.m42||0}}(W.el)[x]||0)*(y&&!k?1:-1)),te(),g||(E<_||E>C)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:((A=r.getCurrentVelocities())===null||A===void 0?void 0:A.pos)||0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Be(_,E,C)}).start()}).on("move",z=>{var j,A;const{srcEvent:G,axis:W}=z,J=G.target;if(W||(Rt(G),G.stopPropagation(),G.stopImmediatePropagation()),(W==="y"&&k||W==="x"&&!k)&&(Rt(G),G.stopPropagation()),!W)return;const{deltaX:ie,deltaY:ue}=z;if(!r||gn(G)&&((j=G.touches)===null||j===void 0?void 0:j.length)>1||W==="y"&&!k||W==="x"&&k||J&&_t(J)&&(W!=="x"||k))return;const le=y&&!k?1:-1;let ke=k?ue:ie,Ee=r!=null&&r.isRunning()?r.getEndValues().pos:E,Me=1;g||(Ee<=_&&ke*le<0?(Me=Math.max(.01,1-(Math.abs(1/$e()*Math.abs(Ee-_))||0)),Me*=.2):Ee>=C&&ke*le>0&&(Me=Math.max(.01,1-(Math.abs(1/$e()*Math.abs(Ee-C))||0)),Me*=.2)),Ee+=ke*Me*le,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:((A=r.getCurrentVelocities())===null||A===void 0?void 0:A.pos)||0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Ee}).start()}).on("panstart",z=>{(z==null?void 0:z.axis)===(k?"y":"x")&&we(p,"is-dragging")}).on("panend",()=>{Ke(p,"is-dragging")}).on("end",z=>{var j,A;const{srcEvent:G,axis:W,velocityX:J,velocityY:ie,currentTouch:ue}=z;if(ue.length>0||!r)return;const le=G.target,ke=le&&_t(le)&&!(W==="x"&&!k);k&&gn(G)&&!z.axis&&b(G);const Ee=v.length,Me=ee("dragFree");if(!Ee)return;const Ne=ee("vertical")?ie:J;let je=r!=null&&r.isRunning()?r.getEndValues().pos:E;const it=y&&!k?1:-1;if(ke||(je+=Ne*(Me?5:1)*it),!g&&(Ne*it<=0&&je<_||Ne*it>=0&&je>C)){let lt=0;return Math.abs(Ne)>0&&(lt=2*Math.abs(Ne),lt=Math.min(.3*$e(),lt)),je=Be(_+-1*lt,je,C+lt),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*Ne,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:je}).start()}if(Me||!((j=m.Autoscroll)===null||j===void 0)&&j.isEnabled())return void(Math.abs(Ne)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*Ne,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:je}).start():r.isRunning()||B||(B=!0,O("settle")));if(!Me&&!(!((A=m.Autoscroll)===null||A===void 0)&&A.isEnabled())&&(!z.offsetX&&!z.offsetY||W==="y"&&!k||W==="x"&&k))return void se(M,{transition:"tween"});let st=qe(je);Math.abs(Ne)>10&&st===M&&(st+=Ne>0?y&&!k?1:-1:y&&!k?-1:1),se(st,{transition:"tween",tween:{velocity:-1*Ne}})}).init())}(),Ye(p,"is-draggable",!!o&&v.length>0)}function ye(S="*"){var z;const j=[];for(const A of P)(S==="*"||A.class&&A.class.includes(S)||A.el&&(!((z=A.el)===null||z===void 0)&&z.classList.contains(S)))&&j.push(A);s=void 0,w=S,F=[...j]}function Ve(){if(!r)return;const S=qe(r!=null&&r.isRunning()?r.getEndValues().pos:E);S!==M&&(s=M,M=S,ne(),Le(),Ae(),O("change",M,s))}function Le(){var S,z;if(!h)return;for(const G of h.querySelectorAll("[data-carousel-index]"))G.innerHTML=M+"";for(const G of h.querySelectorAll("[data-carousel-page]"))G.innerHTML=M+1+"";for(const G of h.querySelectorAll("[data-carousel-pages]"))G.innerHTML=v.length+"";for(const G of h.querySelectorAll("[data-carousel-go-to]"))parseInt(((S=G.dataset)===null||S===void 0?void 0:S.carouselGoTo)||"-1",10)===M?G.setAttribute("aria-current","true"):G.removeAttribute("aria-current");for(const G of h.querySelectorAll("[data-carousel-go-prev]"))G.toggleAttribute("aria-disabled",!ve()),ve()?G.removeAttribute("tabindex"):G.setAttribute("tabindex","-1");for(const G of h.querySelectorAll("[data-carousel-go-next]"))G.toggleAttribute("aria-disabled",!Fe()),Fe()?G.removeAttribute("tabindex"):G.setAttribute("tabindex","-1");let j=!1;const A=(z=v[M])===null||z===void 0?void 0:z.slides[0];A&&(A.downloadSrc||A.type==="image"&&A.src)&&(j=!0);for(const G of h.querySelectorAll("[data-carousel-download]"))G.toggleAttribute("aria-disabled",!j)}function Ae(S){var z;S||(S=(z=v[M])===null||z===void 0?void 0:z.slides[0]);const j=S==null?void 0:S.el;if(j)for(const A of j.querySelectorAll("[data-slide-index]"))A.innerHTML=S.index+1+""}function qe(S){var z,j,A;if(!v.length)return 0;const G=Oe();let W=S;g?W-=Math.floor((S-((z=v[0])===null||z===void 0?void 0:z.pos))/G)*G||0:W=Be((j=v[0])===null||j===void 0?void 0:j.pos,S,(A=v[v.length-1])===null||A===void 0?void 0:A.pos);const J=new Map;let ie=0;for(const le of v){const ke=Math.abs(le.pos-W),Ee=Math.abs(le.pos-W-G),Me=Math.abs(le.pos-W+G),Ne=Math.min(ke,Ee,Me);J.set(ie,Ne),ie++}const ue=J.size>0?[...J.entries()].reduce((le,ke)=>ke[1]<le[1]?ke:le):[M,0];return parseInt(ue[0])}function _e(){return Q}function $e(){let S=0;return p&&(p.childElementCount||(p.style.display="grid"),S=p.getBoundingClientRect()[x]||0,p.style.display=""),S}function Oe(S=!0){return F.length?F.reduce((z,j)=>z+j.dim,0)+(F.length-(g&&S?0:1))*Q:0}function ze(S){const z=Oe(),j=$e();if(!z||!p||!j)return[];const A=[];S=S===void 0?E:S,g&&(S-=Math.floor(S/z)*z||0);let G=0,W=0;if(f){const ie=p.getBoundingClientRect();G=Math.abs(ie[k?"top":"left"]),W=Math.abs(window[k?"innerHeight":"innerWidth"]-ie[k?"bottom":"right"])}let J=0;for(let ie of F){const ue=(le=0)=>{A.indexOf(ie)>-1||(ie.pos=J-S+le||0,ie.offset+le>S-ie.dim-G+.51&&ie.offset+le<S+j+W-.51&&A.push(ie))};ie.offset=J,g&&(ue(z),ue(-1*z)),ue(),J+=ie.dim+Q}return A}function q(S,z){const j=[];for(const A of Array.isArray(S)?S:[S]){const G=re(Object.assign(Object.assign({},A),{isVirtual:!0}));G.el||(G.el=document.createElement("div")),O("createSlide",G),j.push(G)}P.splice(z===void 0?P.length:z,0,...j),ce();for(const A of j)O("addSlide",A),he(A);return ye(w),j}function re(S){return(Te(S)||S instanceof HTMLElement)&&(S={html:S}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},S)}function he(S){let z=S.el;if(!S||!z)return;const j=S.html?S.html instanceof HTMLElement?S.html:wt(S.html):void 0;j&&(we(j,"f-html"),S.htmlEl=j,we(z,"has-html"),z.append(j),O("contentReady",S))}function ae(S){if(!p||!S)return;let z=S.el;if(z){if(z.setAttribute("index",S.index+""),z.parentElement!==p){let j;we(z,c.classes.slide),we(z,S.class),ne(S);for(const A of P)if(A.index>S.index){j=A.el;break}p.insertBefore(z,j&&p.contains(j)?j:null),O("attachSlideEl",S)}return Ae(S),z}}function K(S){const z=S==null?void 0:S.el;z&&(z.remove(),I(z),O("detachSlideEl",S))}function ce(){for(let S=0;S<P.length;S++){const z=P[S],j=z.el;j&&(z.index!==S&&I(j),j.setAttribute("index",`${S}`)),z.index=S}}function D(){var S,z,j,A,G;if(!h||!p)return;y=ee("rtl"),k=ee("vertical"),x=k?"height":"width";const W=ee("classes");if(Ye(h,W.isLTR,!y),Ye(h,W.isRTL,y),Ye(h,W.isHorizontal,!k),Ye(h,W.isVertical,k),Ye(h,W.hasAdaptiveHeight,ee("adaptiveHeight")),!$e())return;const J=window.getComputedStyle(p);f=J.getPropertyValue("overflow-"+(k?"y":"x"))==="visible",Q=p&&parseFloat(J.getPropertyValue("--f-carousel-gap"))||0;const ie=function(){let ue=0;if(p){let le=document.createElement("div");le.style.display="block",we(le,c.classes.slide),p.appendChild(le),ue=le.getBoundingClientRect()[x],le.remove(),le=void 0}return ue}();for(const ue of F){const le=ue.el;let ke=0;if(!ue.isVirtual&&le&&Kt(le)){let Ee=!1;le.parentElement&&le.parentElement===p||(p.appendChild(le),Ee=!0),ke=le.getBoundingClientRect()[x],Ee&&((S=le.parentElement)===null||S===void 0||S.removeChild(le))}else ke=ie;ue.dim=ke}if(g=!1,ee("infinite")){g=!0;const ue=Oe();let le=$e();if(f){const ke=p.getBoundingClientRect();le+=ke.left,le+=ke.right-ke.width}for(let ke=0;ke<F.length;ke++){const Ee=((z=F[ke])===null||z===void 0?void 0:z.dim)+Q;if(ue-Ee<le&&ue-Ee-le<Ee){g=!1;break}}}(function(){var ue;if(!h)return;const le=$e(),ke=Oe(!1);let Ee=ee("slidesPerPage");Ee=Ee==="auto"?1/0:parseFloat(Ee+""),v=[];let Me=0,Ne=0;for(const He of F)(!v.length||Me+He.dim-le>.05||Ne>=Ee)&&(v.push({index:v.length,slides:[],dim:0,offset:0,pos:0}),Me=0,Ne=0),(ue=v[v.length-1])===null||ue===void 0||ue.slides.push(He),Me+=He.dim+Q,Ne++;const je=ee("center"),it=ee("fill");let st=0;for(const He of v){He.dim=(He.slides.length-1)*Q;for(const dt of He.slides)He.dim+=dt.dim;He.offset=st,He.pos=st,je!==!1&&(He.pos-=.5*(le-He.dim)),it&&!g&&ke>le&&(He.pos=Be(0,He.pos,ke-le)),st+=He.dim+Q}const lt=[];let bt;for(const He of v){const dt=Object.assign({},He);bt&&Math.abs(dt.pos-bt.pos)<.1?(bt.dim+=dt.dim,bt.slides=[...bt.slides,...dt.slides]):(bt=dt,dt.index=lt.length,lt.push(dt))}v=lt,M=Be(0,M,v.length-1)})(),_=((j=v[0])===null||j===void 0?void 0:j.pos)||0,C=((A=v[v.length-1])===null||A===void 0?void 0:A.pos)||0,d===0?function(){var ue;s=void 0,M=ee("initialPage");const le=ee("initialSlide")||void 0;le!==void 0&&(M=xe.getPageIndex(le)||0),M=Be(0,M,v.length-1),E=((ue=v[M])===null||ue===void 0?void 0:ue.pos)||0,T=E}():T=((G=v[M||0])===null||G===void 0?void 0:G.pos)||0,O("refresh"),Le()}function I(S){if(!S||!Kt(S))return;const z=parseInt(S.getAttribute("index")||"-1");let j="";for(const G of Array.from(S.classList)){const W=G.match(/^f-(\w+)(Out|In)$/);W&&W[1]&&(j=W[1]+"")}if(!S||!j)return;const A=[`f-${j}Out`,`f-${j}In`,"to-prev","to-next","from-prev","from-next"];S.removeEventListener("animationend",Y),Ke(S,A.join(" ")),H.delete(z)}function te(){if(!p)return;const S=H.size>0;for(const z of F)I(z.el);H.clear(),S&&me()}function Y(S){var z;((z=S.animationName)===null||z===void 0?void 0:z.substring(0,2))==="f-"&&(I(S.target),H.size||(Ke(h,"in-transition"),!B&&Math.abs(xe.getPosition(!0)-T)<.5&&(B=!0,O("settle"))),me())}function b(S){var z;if(S.defaultPrevented)return;const j=S.composedPath()[0];if(j.closest("[data-carousel-go-prev]"))return Rt(S),void xe.prev();if(j.closest("[data-carousel-go-next]"))return Rt(S),void xe.next();const A=j.closest("[data-carousel-go-to]");if(A)return Rt(S),void xe.goTo(parseFloat(A.dataset.carouselGoTo||"")||0);if(j.closest("[data-carousel-download]")){Rt(S);const G=(z=v[M])===null||z===void 0?void 0:z.slides[0];if(G&&(G.downloadSrc||G.type==="image"&&G.src)){const W=G.downloadFilename,J=document.createElement("a"),ie=G.downloadSrc||G.src||"";J.href=ie,J.target="_blank",J.download=W||ie,J.click()}}else O("click",S)}function N(S){var z;const j=S.el;j&&((z=j.querySelector(".f-spinner"))===null||z===void 0||z.remove())}function X(S){var z;const j=S.el;j&&((z=j.querySelector(".f-html.is-error"))===null||z===void 0||z.remove(),Ke(j,"has-error"))}function ne(S){var z;S||(S=(z=v[M])===null||z===void 0?void 0:z.slides[0]);const j=S==null?void 0:S.el;if(!j)return;let A=ee("formatCaption",S);A===void 0&&(A=S.caption),A=A||"";const G=ee("captionEl");if(G&&G instanceof HTMLElement){if(S.index!==M)return;if(Te(A)&&(G.innerHTML=L(A+"")),A instanceof HTMLElement){if(A.parentElement===G)return;G.innerHTML="",A.parentElement&&(A=A.cloneNode(!0)),G.append(A)}return}if(!A)return;let W=S.captionEl||j.querySelector(".f-caption");!W&&A instanceof HTMLElement&&A.classList.contains("f-caption")&&(W=A),W||(W=document.createElement("div"),we(W,"f-caption"),Te(A)?W.innerHTML=L(A+""):A instanceof HTMLElement&&(A.parentElement&&(A=A.cloneNode(!0)),W.append(A)));const J=`f-caption-${jr}_${S.index}`;W.setAttribute("id",J),W.dataset.selectable="true",we(j,"has-caption"),j.setAttribute("aria-labelledby",J),S.captionEl=W,j.insertAdjacentElement("beforeend",W)}function se(S,z={}){var j,A;let{transition:G,tween:W}=Object.assign({transition:c.transition,tween:c.tween},z||{});if(!h||!r)return;const J=v.length;if(!J||function(le,ke){var Ee,Me,Ne,je;if(!(h&&r&&ke&&Te(ke)&&ke!=="tween")||((Ee=v[M])===null||Ee===void 0?void 0:Ee.slides.length)>1)return!1;const it=v.length;let st=le>M?1:-1;le=g?(le%it+it)%it:Be(0,le,it-1),y&&(st*=-1);const lt=(Me=v[M])===null||Me===void 0?void 0:Me.slides[0],bt=lt==null?void 0:lt.index,He=(Ne=v[le])===null||Ne===void 0?void 0:Ne.slides[0],dt=He==null?void 0:He.index,Di=(je=v[le])===null||je===void 0?void 0:je.pos;if(dt===void 0||bt===void 0||bt===dt||E===Di||Math.abs($e()-((He==null?void 0:He.dim)||0))>1)return!1;B=!1,r.pause(),te(),we(h,"in-transition"),E=T=Di;const an=ae(lt),on=ae(He);return Ve(),an&&(H.add(bt),an.style.transform="",an.addEventListener("animationend",Y),Ke(an,c.classes.isSelected),an.inert=!1,we(an,`f-${ke}Out to-${st>0?"next":"prev"}`)),on&&(H.add(dt),on.style.transform="",on.addEventListener("animationend",Y),we(on,c.classes.isSelected),on.inert=!1,we(on,`f-${ke}In from-${st>0?"prev":"next"}`)),me(),!0}(S,G))return;S=g?(S%J+J)%J:Be(0,S,J-1),T=((j=v[S||0])===null||j===void 0?void 0:j.pos)||0;const ue=r.isRunning()?r.getEndValues().pos:E;if(Math.abs(T-ue)<1)return E=T,M!==S&&(ne(),s=M,M=S,Le(),Ae(),O("change",M,s)),me(),void(B||(B=!0,O("settle")));if(r.pause(),te(),g){const le=Oe(),ke=Math.floor((ue-((A=v[0])===null||A===void 0?void 0:A.pos))/le)||0,Ee=T+ke*le;T=[Ee+le,Ee,Ee-le].reduce(function(Me,Ne){return Math.abs(Ne-ue)<Math.abs(Me-ue)?Ne:Me})}G!==!1&&Ze(W)?r.spring(nt({},c.tween,W)).from({pos:E}).to({pos:T}).start():(E=T,Ve(),me(),B||(B=!0,O("settle")))}function fe(S){var z;let j=E;if(g&&S!==!0){const A=Oe();j-=(Math.floor((E-((z=v[0])===null||z===void 0?void 0:z.pos)||0)/A)||0)*A}return j}function me(){var S;if(!h||!p)return;V=ze();const z=new Set,j=[],A=v[M],G=c.setTransform;let W;for(const J of F){const ie=H.has(J.index),ue=V.indexOf(J)>-1,le=((S=A==null?void 0:A.slides)===null||S===void 0?void 0:S.indexOf(J))>-1;if(J.isVirtual&&!ie&&!ue)continue;let ke=ae(J);if(ke&&(j.push(J),le&&z.add(ke),ee("adaptiveHeight")&&le)){const Ee=(ke.firstElementChild||ke).getBoundingClientRect().height;W=W==null?Ee:Math.max(W,Ee)}}p&&W&&(p.style.height=`${W}px`),[...Pa(p,`.${c.classes.slide}`)].forEach(J=>{Ye(J,c.classes.isSelected,z.has(J));const ie=P[parseInt(J.getAttribute("index")||"-1")];if(!ie)return J.remove(),void I(J);const ue=H.has(ie.index),le=V.indexOf(ie)>-1;if(ie.isVirtual&&!ue&&!le)return void K(ie);if(J.inert=!le,G===!1)return;let ke=ie.pos?Math.round(1e4*ie.pos)/1e4:0,Ee=0,Me=0,Ne=0,je=0;ue||(Ee=k?0:y?-1*ke:ke,Me=k?ke:0,Ne=Un(Ee,0,ie.dim,0,100),je=Un(Me,0,ie.dim,0,100)),G instanceof Function&&!ue?G(xe,ie,{x:Ee,y:Me,xPercent:Ne,yPercent:je}):J.style.transform=Ee||Me?`translate3d(${Ne}%, ${je}%,0)`:""}),O("render",j)}function be(){h==null||h.removeEventListener("click",b),document.removeEventListener("mousemove",de),H.clear(),i==null||i.disconnect(),i=void 0;for(const S of P){let z=S.el;z&&Kt(z)&&(S.state=void 0,N(S),X(S),S.isVirtual?(K(S),S.el=void 0):(I(z),z.style.transform="",p&&!p.contains(z)&&p.appendChild(z)))}for(const S of Object.values(m))S==null||S.destroy();m={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const[S,z]of Object.entries(c.classes||{}))S!=="container"&&Ke(h,z);Ke(p,"is-draggable")}function ve(){return g||M>0}function Fe(){return g||M<v.length-1}const xe={add:function(S,z){var j;let A=E;const G=M,W=Oe(),J=r!=null&&r.isRunning()?r.getEndValues().pos:E,ie=W&&Math.floor((J-(((j=v[0])===null||j===void 0?void 0:j.pos)||0))/W)||0;return q(S,z),ye(w),D(),r&&W&&(G===M&&(A-=ie*W),A===T?E=T:r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:A}).to({pos:T}).start()),me(),xe},canGoPrev:ve,canGoNext:Fe,destroy:function(){return O("destroy"),window.removeEventListener("resize",oe),be(),R.clear(),h=null,v=[],P=[],c=Object.assign({},tn),m={},F=[],l=void 0,w="*",d=2,xe},emit:O,filter:function(S="*"){return ye(S),D(),E=Be(_,E,C),me(),O("filter",S),xe},getContainer:function(){return h},getGapDim:_e,getGestures:function(){return o},getLastMouseMove:function(){return zr},getOption:function(S){return ee(S)},getOptions:function(){return c},getPage:function(){return v[M]},getPageIndex:function(S){if(S!==void 0){for(const z of v||[])for(const j of z.slides)if(j.index===S)return z.index;return-1}return M},getPageIndexFromPosition:qe,getPageProgress:function(S,z){var j;S===void 0&&(S=M);const A=v[S];if(!A)return S>M?-1:1;const G=Oe(),W=_e();let J=A.pos,ie=fe();if(g&&z!==!0){const ue=Math.floor((ie-((j=v[0])===null||j===void 0?void 0:j.pos))/G)||0;ie-=ue*G,J=[J+G,J,J-G].reduce(function(le,ke){return Math.abs(ke-ie)<Math.abs(le-ie)?ke:le})}return(ie-J)/(A.dim+W)||0},getPageVisibility:function(S){var z;S===void 0&&(S=M);const j=v[S];if(!j)return S>M?-1:1;const A=fe(),G=$e();let W=j.pos;if(g){const J=Oe(),ie=W+(Math.floor((A-((z=v[0])===null||z===void 0?void 0:z.pos))/J)||0)*J;W=[ie+J,ie,ie-J].reduce(function(ue,le){return Math.abs(le-A)<Math.abs(ue-A)?le:ue})}return W>A&&W+j.dim<A+G?1:W<A?(W+j.dim-A)/j.dim||0:W+j.dim>A+G&&(A+G-W)/j.dim||0},getPages:function(){return v},getPlugins:function(){return m},getPosition:fe,getSlides:function(){return P},getState:function(){return d},getTotalSlideDim:Oe,getTween:function(){return r},getViewport:function(){return p},getViewportDim:$e,getVisibleSlides:function(S){return S===void 0?V:ze(S)},goTo:se,hasNavigated:function(){return s!==void 0},hideError:X,hideLoading:N,init:function(){if(!t||!Kt(t))throw new Error("No Element found");return d!==0&&(be(),d=0),h=t,u=n,window.removeEventListener("resize",oe),u.breakpoints&&window.addEventListener("resize",oe),oe(),xe},isInfinite:function(){return g},isInTransition:function(){return H.size>0},isRTL:function(){return y},isSettled:function(){return B},isVertical:function(){return k},localize:function(S,z=[]){return L(S,z)},next:function(S={}){return se(M+1,S),xe},off:function(S,z){for(const j of S instanceof Array?S:[S])R.has(j)&&R.set(j,R.get(j).filter(A=>A!==z));return xe},on:function(S,z){for(const j of S instanceof Array?S:[S])R.set(j,[...R.get(j)||[],z]);return xe},prev:function(S={}){return se(M-1,S),xe},reInit:function(S={},z={}){return be(),d=0,l=void 0,w="*",n=S,u=S,a=z,oe(),xe},remove:function(S){S===void 0&&(S=P.length-1);const z=P[S];return z&&(O("removeSlide",z),z.el&&(I(z.el),z.el.remove(),z.el=void 0),P.splice(S,1),ye(w),D(),E=Be(_,E,C),me()),xe},setPosition:function(S){E=S,Ve(),me()},showError:function(S,z){N(S),X(S);const j=S.el;if(j){const A=document.createElement("div");we(A,"f-html"),we(A,"is-error"),A.innerHTML=L(z||"<p>{{ERROR}}</p>"),S.htmlEl=A,we(j,"has-html"),we(j,"has-error"),j.insertAdjacentElement("afterbegin",A),O("contentReady",S)}return xe},showLoading:function(S){const z=S.el,j=z==null?void 0:z.querySelector(".f-spinner");if(!z||j)return xe;const A=ee("spinnerTpl"),G=wt(A);return G&&(we(G,"f-spinner"),z.insertAdjacentElement("beforeend",G)),xe},version:"6.1.3"};return xe};Zn.l10n={en_EN:Oa},Zn.getDefaults=()=>tn;/*! License details at fancyapps.com/license */const Gr=(t=!0,n="--f-scrollbar-compensate",a="--f-body-margin",o="hide-scrollbar")=>{const r=document,i=r.body,s=r.documentElement;if(t){if(i.classList.contains(o))return;let l=window.innerWidth-s.getBoundingClientRect().width;l<0&&(l=0),s.style.setProperty(n,`${l}px`);const d=parseFloat(window.getComputedStyle(i).marginRight);d&&i.style.setProperty(a,`${d}px`),i.classList.add(o)}else i.classList.remove(o),i.style.setProperty(a,""),r.documentElement.style.setProperty(n,"")};/*! License details at fancyapps.com/license */function Yn(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const zt=function(t="",n="",a=""){return t.split(n).join(a)};/*! License details at fancyapps.com/license */const Ir={tpl:t=>`<img class="f-panzoom__content"
6
+ `+i):o.stack=i}catch{}}throw o}}_request(n,a){typeof n=="string"?(a=a||{},a.url=n):a=n||{},a=Lt(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:i}=a;o!==void 0&&$n.assertOptions(o,{silentJSONParsing:pt.transitional(pt.boolean),forcedJSONParsing:pt.transitional(pt.boolean),clarifyTimeoutError:pt.transitional(pt.boolean)},!1),r!=null&&(U.isFunction(r)?a.paramsSerializer={serialize:r}:$n.assertOptions(r,{encode:pt.function,serialize:pt.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),$n.assertOptions(a,{baseUrl:pt.spelling("baseURL"),withXsrfToken:pt.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let s=i&&U.merge(i.common,i[a.method]);i&&U.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),a.headers=tt.concat(s,i);const l=[];let d=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(d=d&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,m=0,h;if(!d){const f=[Jo.bind(this),void 0];for(f.unshift(...l),f.push(...u),h=f.length,c=Promise.resolve(a);m<h;)c=c.then(f[m++],f[m++]);return c}h=l.length;let p=a;for(;m<h;){const f=l[m++],g=l[m++];try{p=f(p)}catch(y){g.call(this,y);break}}try{c=Jo.call(this,p)}catch(f){return Promise.reject(f)}for(m=0,h=u.length;m<h;)c=c.then(u[m++],u[m++]);return c}getUri(n){n=Lt(this.defaults,n);const a=jo(n.baseURL,n.url,n.allowAbsoluteUrls);return Fo(a,n.params,n.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(n){$t.prototype[n]=function(a,o){return this.request(Lt(o||{},{method:n,url:a,data:(o||{}).data}))}}),U.forEach(["post","put","patch"],function(n){function a(o){return function(i,s,l){return this.request(Lt(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}$t.prototype[n]=a(),$t.prototype[n+"Form"]=a(!0)});let Cs=class Fi{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const o=this;this.promise.then(r=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](r);o._listeners=null}),this.promise.then=r=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(r);return s.cancel=function(){o.unsubscribe(i)},s},n(function(i,s,l){o.reason||(o.reason=new Wt(i,s,l),a(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const a=this._listeners.indexOf(n);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const n=new AbortController,a=o=>{n.abort(o)};return this.subscribe(a),n.signal.unsubscribe=()=>this.unsubscribe(a),n.signal}static source(){let n;return{token:new Fi(function(r){n=r}),cancel:n}}};function Ss(t){return function(a){return t.apply(null,a)}}function Bs(t){return U.isObject(t)&&t.isAxiosError===!0}const ba={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(ba).forEach(([t,n])=>{ba[n]=t});function nr(t){const n=new $t(t),a=ko($t.prototype.request,n);return U.extend(a,$t.prototype,n,{allOwnKeys:!0}),U.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return nr(Lt(t,r))},a}const Ge=nr(un);Ge.Axios=$t,Ge.CanceledError=Wt,Ge.CancelToken=Cs,Ge.isCancel=_o,Ge.VERSION=er,Ge.toFormData=An,Ge.AxiosError=Se,Ge.Cancel=Ge.CanceledError,Ge.all=function(n){return Promise.all(n)},Ge.spread=Ss,Ge.isAxiosError=Bs,Ge.mergeConfig=Lt,Ge.AxiosHeaders=tt,Ge.formToJSON=t=>Po(U.isHTMLForm(t)?new FormData(t):t),Ge.getAdapter=Qo.getAdapter,Ge.HttpStatusCode=ba,Ge.default=Ge;const{Axios:Ax,AxiosError:Tx,CanceledError:Dx,isCancel:Fx,CancelToken:Lx,VERSION:$x,all:Px,Cancel:Ox,isAxiosError:_x,spread:Hx,toFormData:Rx,AxiosHeaders:zx,HttpStatusCode:jx,formToJSON:Gx,getAdapter:Ix,mergeConfig:qx}=Ge,ar=Dt.defineStore("auth",{state:()=>({jwtToken:null}),actions:{setToken(t){this.jwtToken=t},clearToken(){this.jwtToken=null}},getters:{getToken:t=>t.jwtToken}}),ot=Ge.create({baseURL:"https://back.dev-smclick.com.br/"});let wa=null;const Vs=()=>(wa||(wa=ar()),wa);ot.interceptors.request.use(t=>{try{const a=Vs().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));const Ms="v1/api/attendances/attendant/",Ns="v1/api/attendances/department/",Ea="v1/api/attendances/internal_chat/",As="v1/api/instances/instance/",Ts="v1/api/crm/event/scheduled_message/",Ds="v1/api/crm/event/calendar",Fs="v1/api/crm/products/",Ls="v1/api/contacts/tag/",va=Dt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(t=""){try{let n=`${As}`;const a=await ot.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}}}),$s={class:"w-full relative text-current"},Ps={class:"flex cursor-pointer justify-between items-center"},Os={key:0},_s={key:0},Hs={key:1,class:"flex items-center gap-2"},Rs={class:"flex gap-3 items-center flex-shrink-0"},zs={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},js={key:1,class:"relative"},Gs={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"},Is={class:"my-auto text-center mx-auto group-hover:inline-block"},qs={key:1,class:"flex justify-center"},Ws={class:"w-full"},Us={key:1,class:"flex items-center gap-2 justify-center"},Zs={class:"flex px-4 items-center gap-2"},Ys={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},Xs={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"},Ks={class:"select-none cursor-pointer w-full"},Qs=["onClick","disabled"],Js={class:"flex w-full items-center pl-2 gap-3"},el={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"},tl={key:1,class:"relative"},nl={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},al={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"},ol={class:"w-full text-center"},rl={class:"my-auto text-center mx-auto group-hover:inline-block"},il={key:1,class:"flex justify-center"},sl={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},ll={key:1,class:"p-4"},or={__name:"index",props:{modelValue:{type:Object,default:null},type:{type:String},webhooks:{type:Boolean,default:void 0}},emits:["update:modelValue","function","component-mounted"],setup(t,{emit:n}){const a=va(),o=e.ref(!1),r=e.ref(null),i=t,s=n;function l(d){r.value=d,s("function",d)}return e.watch(()=>i.modelValue,d=>{r.value=d},{immediate:!0}),e.watch(r,d=>{s("update:modelValue",d)}),e.onMounted(async()=>{if(r.value){const d=a.instances.find(u=>u.id===r.value.id);d&&(r.value.status=d.status)}s("component-mounted")}),(d,u)=>{const c=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("main",$s,[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",Ps,[e.createElementVNode("p",{onClick:u[0]||(u[0]=m=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[e.unref(a).loaded?(e.openBlock(),e.createElementBlock("div",Os,[r.value?(e.openBlock(),e.createElementBlock("span",Hs,[e.createElementVNode("header",Rs,[r.value.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",zs,[...u[3]||(u[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==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",js,[u[5]||(u[5]=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",Gs,[...u[4]||(u[4]=[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(c,{key:2,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",Is,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",qs,[...u[6]||(u[6]=[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",Ws,e.toDisplayString(r.value.name),1)])):(e.openBlock(),e.createElementBlock("span",_s,e.toDisplayString(e.unref(a).instances?e.unref(a).instances.length:"Sem")+" Instâncias disponíveis",1))])):(e.openBlock(),e.createElementBlock("div",Us,[...u[7]||(u[7]=[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",Zs,[e.createElementVNode("button",{onClick:u[1]||(u[1]=m=>(r.value=null,o.value=!1))},[...u[8]||(u[8]=[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:u[2]||(u[2]=m=>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"},[...u[9]||(u[9]=[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",Ys,[e.createElementVNode("ul",Xs,[e.unref(a).instances.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(a).instances,(m,h)=>{var p;return e.openBlock(),e.createElementBlock("li",Ks,[e.createElementVNode("button",{class:e.normalizeClass([r.value&&r.value.id===m.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:f=>(r.value=m,o.value=!1,l(m)),disabled:r.value&&r.value.id===m.id||t.type&&m.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((p=m.config)==null?void 0:p.webhooks)},[e.createElementVNode("div",Js,[m.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",el,[...u[10]||(u[10]=[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)])])):m.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",tl,[u[12]||(u[12]=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",nl,[...u[11]||(u[11]=[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(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.type&&m.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 f;return[t.type&&m.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((f=m.config)==null?void 0:f.webhooks)?(e.openBlock(),e.createElementBlock("svg",al,[...u[13]||(u[13]=[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",ol,e.toDisplayString(m.name),1),e.createVNode(c,{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":m.status===!1,"bg-green-500":m.status===!0,"bg-purple-500":m.status==="Offline"}])},[e.createElementVNode("div",rl,e.toDisplayString(m.status===!0?"Conectada":m.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[m.isLoading?(e.openBlock(),e.createElementBlock("div",il,[...u[14]||(u[14]=[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":m.status===!1,"bg-green-500":m.status===!0,"bg-purple-500":m.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",sl,[m.telephone?(e.openBlock(),e.createBlock(c,{key:0,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(m.telephone?`${m.telephone}`:""),1)]),default:e.withCtx(()=>[u[15]||(u[15]=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,Qs)])}),256)):(e.openBlock(),e.createElementBlock("div",ll," Sem instâncias disponíveis"))])])):e.createCommentVNode("",!0)])}}},cl=["aria-labelledby","aria-describedby"],dl={class:"cpk-popover__header border-base-100"},ul=["id"],fl=["disabled"],ml=["id"],hl={class:"cpk-popover__details bg-base-200 border border-base-100"},pl={class:"cpk-popover__footer"},gl=["disabled"],yl=["disabled"],kl={key:0,class:"loading-spinner"},xl=Ce({__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:B=>o("update:modelValue",B)}),i=e.ref(null),s=e.ref({left:0,top:0,p:"bottom"}),l={title:`cpk-popover-title-${Math.random().toString(36).slice(2)}`,desc:`cpk-popover-desc-${Math.random().toString(36).slice(2)}`};function d(){o("cancel",a.context),r.value=!1}function u(){a.loading||o("confirm",a.context)}let c,m,h=[];function p(){if(a.anchorRect)return a.anchorRect;const B=a.anchorEl instanceof Element?a.anchorEl:null;if(B)return B.getBoundingClientRect();const M=document.activeElement instanceof Element?document.activeElement:null;return M?M.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 f(){if(!r.value)return;const B=window.innerWidth,M=window.innerHeight,T=a.viewportPadding,_=p(),C=i.value?i.value.getBoundingClientRect():{width:320,height:200},w=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let P=w[0],F=0,H=0;const V=_.left+_.width/2-C.width/2,v=_.top+_.height/2-C.height/2,$=_.left,Z=_.left+_.width-C.width,Q=_.top,ee=_.top+_.height-C.height;for(const L of w){if(L==="bottom"&&(H=_.bottom+a.offset,F=a.align==="start"?$:a.align==="end"?Z:V,H+C.height+T<=M)){P="bottom";break}if(L==="top"&&(H=_.top-C.height-a.offset,F=a.align==="start"?$:a.align==="end"?Z:V,H>=T)){P="top";break}if(L==="right"&&(F=_.right+a.offset,H=a.align==="start"?Q:a.align==="end"?ee:v,F+C.width+T<=B)){P="right";break}if(L==="left"&&(F=_.left-C.width-a.offset,H=a.align==="start"?Q:a.align==="end"?ee:v,F>=T)){P="left";break}}F=Math.min(Math.max(T,F),B-C.width-T),H=Math.min(Math.max(T,H),M-C.height-T),s.value={left:F,top:H,p:P}}function g(){y();let M=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;M&&M!==document.body;)h.push(M),M=M.parentElement;h.push(window),h.forEach(T=>T.addEventListener("scroll",f,{passive:!0}))}function y(){h.forEach(B=>{var M;return(M=B.removeEventListener)==null?void 0:M.call(B,"scroll",f)}),h=[]}e.watch(()=>r.value,async B=>{var M;if(B){await e.nextTick(),f(),g(),c=new ResizeObserver(f),c.observe(document.body);const T=a.anchorEl instanceof Element?a.anchorEl:null;T&&((M=m==null?void 0:m.disconnect)==null||M.call(m),m=new ResizeObserver(f),m.observe(T)),window.addEventListener("resize",f),window.addEventListener("keydown",k)}else x()}),e.watch(()=>a.anchorEl,async B=>{var T;if(!r.value)return;await e.nextTick(),y(),g(),(T=m==null?void 0:m.disconnect)==null||T.call(m);const M=B instanceof Element?B:null;M&&(m=new ResizeObserver(f),m.observe(M)),f()}),e.watch(()=>a.anchorRect,()=>{r.value&&f()}),e.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&f()});function k(B){B.key==="Escape"&&d(),B.key==="Enter"&&u()}e.onMounted(()=>{window.addEventListener("mousemove",B=>{window.__lastMouseX=B.clientX,window.__lastMouseY=B.clientY},{passive:!0})}),e.onBeforeUnmount(x);function x(){y(),window.removeEventListener("resize",f),window.removeEventListener("keydown",k),c&&c.disconnect(),m&&m.disconnect()}const E=e.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(B,M)=>(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:i,class:e.normalizeClass(["cpk-popover bg-base-300",[{"is-loading":t.loading,"is-danger":t.destructive}]]),style:e.normalizeStyle(E.value),role:"dialog","aria-modal":"false","aria-labelledby":l.title,"aria-describedby":l.desc},[e.createElementVNode("div",dl,[M[0]||(M[0]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"!",-1)),e.createElementVNode("h3",{class:"cpk-popover__title",id:l.title},e.toDisplayString(t.title),9,ul),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:d,disabled:t.loading,"aria-label":"Fechar"}," × ",8,fl)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:l.desc},e.toDisplayString(t.description),9,ml)):e.createCommentVNode("",!0),e.createElementVNode("div",hl,[e.renderSlot(B.$slots,"details",{},void 0,!0)]),e.createElementVNode("div",pl,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:d,disabled:t.loading},e.toDisplayString(t.cancelLabel),9,gl),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",kl)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.loading?t.loadingLabel:t.confirmLabel),1)],10,yl)])],14,cl)]),_:3})],32)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-2f78365f"]]);function Ut(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}function gt(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,l=a!=null&&a.width?String(a.width):s;r=t.formattingValues[l]||t.formattingValues[s]}else{const s=t.defaultWidth,l=a!=null&&a.width?String(a.width):t.defaultWidth;r=t.values[l]||t.values[s]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}function yt(t){return(n,a={})=>{const o=a.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const s=i[0],l=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(l)?wl(l,m=>m.test(s)):bl(l,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 bl(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function wl(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function rr(t){return(n,a={})=>{const o=n.match(t.matchPattern);if(!o)return null;const r=o[0],i=n.match(t.parsePattern);if(!i)return null;let s=t.valueCallback?t.valueCallback(i[0]):i[0];s=a.valueCallback?a.valueCallback(s):s;const l=n.slice(r.length);return{value:s,rest:l}}}const ir=6048e5,El=864e5,sr=Symbol.for("constructDateFrom");function rt(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&sr in t?t[sr](n):t instanceof Date?new t.constructor(n):new Date(n)}function Ca(t,...n){const a=rt.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let vl={};function Pn(){return vl}function ct(t,n){return rt(n||t,t)}function Pt(t,n){var l,d,u,c;const a=Pn(),o=(n==null?void 0:n.weekStartsOn)??((d=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??a.weekStartsOn??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,r=ct(t,n==null?void 0:n.in),i=r.getDay(),s=(i<o?7:0)+i-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function Cl(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n);return+Pt(o,a)==+Pt(r,a)}const Sl={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"}},Bl=(t,n,a)=>{let o;const r=Sl[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},Vl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ml=(t,n,a,o)=>Vl[t],Nl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Al={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Tl={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"]},Dl={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"]},Fl={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"}},Ll={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"}},$l={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:gt({values:Nl,defaultWidth:"wide"}),quarter:gt({values:Al,defaultWidth:"wide",argumentCallback:t=>t-1}),month:gt({values:Tl,defaultWidth:"wide"}),day:gt({values:Dl,defaultWidth:"wide"}),dayPeriod:gt({values:Fl,defaultWidth:"wide",formattingValues:Ll,defaultFormattingWidth:"wide"})},Pl=/^(\d+)(th|st|nd|rd)?/i,Ol=/\d+/i,_l={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},Hl={any:[/^b/i,/^(a|c)/i]},Rl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zl={any:[/1/i,/2/i,/3/i,/4/i]},jl={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},Gl={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]},Il={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},ql={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]},Wl={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},Ul={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}},Zl={ordinalNumber:rr({matchPattern:Pl,parsePattern:Ol,valueCallback:t=>parseInt(t,10)}),era:yt({matchPatterns:_l,defaultMatchWidth:"wide",parsePatterns:Hl,defaultParseWidth:"any"}),quarter:yt({matchPatterns:Rl,defaultMatchWidth:"wide",parsePatterns:zl,defaultParseWidth:"any",valueCallback:t=>t+1}),month:yt({matchPatterns:jl,defaultMatchWidth:"wide",parsePatterns:Gl,defaultParseWidth:"any"}),day:yt({matchPatterns:Il,defaultMatchWidth:"wide",parsePatterns:ql,defaultParseWidth:"any"}),dayPeriod:yt({matchPatterns:Wl,defaultMatchWidth:"any",parsePatterns:Ul,defaultParseWidth:"any"})},Yl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Xl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ql={date:Ut({formats:Yl,defaultWidth:"full"}),time:Ut({formats:Xl,defaultWidth:"full"}),dateTime:Ut({formats:Kl,defaultWidth:"full"})},Jl={code:"en-US",formatDistance:Bl,formatLong:Ql,formatRelative:Ml,localize:$l,match:Zl,options:{weekStartsOn:0,firstWeekContainsDate:1}},e2={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"}},t2=(t,n,a)=>{let o;const r=e2[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},n2={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},a2={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},o2={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},r2={date:Ut({formats:n2,defaultWidth:"full"}),time:Ut({formats:a2,defaultWidth:"full"}),dateTime:Ut({formats:o2,defaultWidth:"full"})},i2={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"},s2=(t,n,a,o)=>{const r=i2[t];return typeof r=="function"?r(n):r},l2={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},c2={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},d2={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"]},u2={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"]},f2={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"}},m2={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"}},h2={ordinalNumber:(t,n)=>{const a=Number(t);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:gt({values:l2,defaultWidth:"wide"}),quarter:gt({values:c2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:gt({values:d2,defaultWidth:"wide"}),day:gt({values:u2,defaultWidth:"wide"}),dayPeriod:gt({values:f2,defaultWidth:"wide",formattingValues:m2,defaultFormattingWidth:"wide"})},p2=/^(\d+)[ºªo]?/i,g2=/\d+/i,y2={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},k2={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},x2={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},b2={any:[/1/i,/2/i,/3/i,/4/i]},w2={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},E2={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]},v2={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},C2={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]},S2={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},B2={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}},V2={ordinalNumber:rr({matchPattern:p2,parsePattern:g2,valueCallback:t=>parseInt(t,10)}),era:yt({matchPatterns:y2,defaultMatchWidth:"wide",parsePatterns:k2,defaultParseWidth:"any"}),quarter:yt({matchPatterns:x2,defaultMatchWidth:"wide",parsePatterns:b2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:yt({matchPatterns:w2,defaultMatchWidth:"wide",parsePatterns:E2,defaultParseWidth:"any"}),day:yt({matchPatterns:v2,defaultMatchWidth:"wide",parsePatterns:C2,defaultParseWidth:"any"}),dayPeriod:yt({matchPatterns:S2,defaultMatchWidth:"any",parsePatterns:B2,defaultParseWidth:"any"})},lr={code:"pt-BR",formatDistance:t2,formatLong:r2,formatRelative:s2,localize:h2,match:V2,options:{weekStartsOn:0,firstWeekContainsDate:1}},M2={scheduled_messages:"Mensagem programada"};function N2(t){return M2[t]||t||"Evento"}function Sa(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function Zt(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 mn(t){const[n,a]=String(t||"").trim().split(" ");if(!n)return null;const[o,r,i]=n.split("-").map(u=>parseInt(u,10));let s=0,l=0;if(a){const[u,c]=a.split(":");s=parseInt(u||"0",10),l=parseInt(c||"0",10)}const d=new Date(o,(r||1)-1,i||1,s,l);return isNaN(d.getTime())?null:d}function A2(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 On(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 T2(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function Ba(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)||{},i=(o==null?void 0:o.department)||{},s=(o==null?void 0:o.instance)||{};let l=null;if(a!=null&&a.time&&(l=mn(a.time)),!l&&(t!=null&&t.next_execution_at)&&(l=A2(t.next_execution_at)),!l)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=N2(c),h=(u||"").trim();return{id:(t==null?void 0:t.id)||T2(),date:l,time:On(l),type:t.function,status:t.status||null,scheduled_by:n.scheduled_by,title:m,content:h,functionName:c||null,chatId:(n==null?void 0:n.chat_id)||(o==null?void 0:o.id)||"",protocol:(o==null?void 0:o.protocol)??"",contactName:(r==null?void 0:r.name)||"Contato",contactPhoto:(r==null?void 0:r.photo)||"",departmentName:(i==null?void 0:i.name)||"",departmentId:(i==null?void 0:i.id)||null,instanceName:(s==null?void 0:s.name)||"",raw:t}}function cr(t=[]){const n=Array.isArray(t)?t:Array.isArray(t.results)?t.results:[],a=[];for(const o of n){const r=Ba(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function D2(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}/`,i=await ot.delete(r);return{ok:(i==null?void 0:i.status)>=200&&i.status<300,status:(i==null?void 0:i.status)??0}}catch(o){return console.error("Error erasing scheduled event:",o),{ok:!1,status:0}}}const dr={scheduled_messages:"#3b82f6"},ur=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function F2(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 L2(t={}){var s,l,d,u,c,m,h,p,f,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=(l=t==null?void 0:t.info)==null?void 0:l.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)||((h=(m=t==null?void 0:t.info)==null?void 0:m.instance)==null?void 0:h.name)||((f=(p=t==null?void 0:t.info)==null?void 0:p.instance)==null?void 0:f.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 i=(t==null?void 0:t.chatId)||((y=t==null?void 0:t.params)==null?void 0:y.chat_id);return i?`chat:${i}`:"misc"}function _n(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(dr,n))return dr[n];const a=L2(t),o=F2(String(a))%ur.length;return ur[o]}const Yt=Dt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),actions:{async fetchAttendants(){try{this.attendants=[];let t=`${Ms}`;const n=await ot.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)}}}),$2={class:"itemc-head"},P2={class:"minw0"},O2={class:"itemc-title"},_2={class:"itemc-sub"},H2={class:"flex items-center gap-1"},R2={class:"itemc-actions"},z2={class:"flex flex-col items-center"},j2={class:"time-badge"},G2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},I2={class:"sched-pop__card bg-base-300",role:"dialog"},q2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},W2={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"},U2=["disabled"],Z2={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Y2={key:1,class:"loading-spinner"},X2={class:"itemsb-head"},K2=["src"],Q2={key:1,class:"avatar avatar--placeholder bg-base-100"},J2={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},ec={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},tc={class:"itemsb-main"},nc={class:"itemsb-row"},ac={class:"itemsb-title truncate"},oc={class:"itemsb-time"},rc={class:"itemsb-sub"},ic={class:"items-attendant"},sc={class:"itemsb-content"},lc={key:0,class:"itemsb-actions"},cc=["disabled"],dc={key:0,class:"loading-spinner"},uc={class:"event-left"},fc={class:"event-line"},mc={class:"event-actions"},hc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},pc={class:"sched-pop__card bg-base-300",role:"dialog"},gc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},yc={class:"sched-pop__card bg-base-300",role:"dialog"},kc={class:"event-time"},xc={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},bc={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"},wc=["disabled"],Ec={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"},vc={key:1,class:"loading-spinner"},Va=Ce({__name:"EventItem",props:{ev:{type:Object,required:!0},mode:{type:String,default:"compact"},getEventColor:{type:Function,default:null},viewOnly:{type:Boolean,default:!1}},emits:["open-message","open-chat","delete-message"],setup(t,{emit:n}){const a=Yt(),o=t,r=e.computed(()=>(o.getEventColor||_n)(o.ev)),i=e.computed(()=>{var u;return((u=o.ev)==null?void 0:u.type)==="scheduled_messages"}),s=e.computed(()=>a.attendants.find(u=>u.is_me)||{}),l=u=>{const c=a.attendants.find(m=>m.id===u);return c?c.id===s.value.id?"Você":c.name||"Desconhecido":"Desconhecido"},d=e.computed(()=>{var c,m;const u=[];return(c=o.ev)!=null&&c.contactName&&u.push(o.ev.contactName),u.push(((m=o.ev)==null?void 0:m.departmentName)||"sem depto"),u.join(" • ")});return(u,c)=>{var m,h,p,f,g,y;return t.mode==="compact"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("header",$2,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"color-bar"},null,4),e.createElementVNode("div",P2,[e.createElementVNode("div",O2,e.toDisplayString(t.ev.contactName?t.ev.contactName+" • ":"")+" "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("div",_2,[e.createElementVNode("span",H2,[c[9]||(c[9]=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(l(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("footer",R2,[e.createElementVNode("div",z2,[e.createElementVNode("div",j2,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",G2,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["status-bar",(m=t.ev)!=null&&m.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",I2,[c[10]||(c[10]=e.createElementVNode("strong",null,"Status",-1)),c[11]||(c[11]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])]),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c[0]||(c[0]=k=>u.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((h=t.ev)==null?void 0:h.status)===!0?(e.openBlock(),e.createElementBlock("svg",q2,[...c[12]||(c[12]=[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",W2,[...c[13]||(c[13]=[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.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[1]||(c[1]=k=>u.$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",Z2,[...c[14]||(c[14]=[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",Y2)):e.createCommentVNode("",!0)],8,U2)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[2]||(c[2]=k=>u.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...c[15]||(c[15]=[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)])])])],64)):t.mode==="sidebar"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",X2,[e.createElementVNode("div",{class:"avatar-wrap",style:e.normalizeStyle({boxShadow:`0 0 0 1px ${r.value}`})},[t.ev.contactPhoto?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.ev.contactPhoto,alt:"",class:"avatar",loading:"lazy"},null,8,K2)):(e.openBlock(),e.createElementBlock("div",Q2,[...c[16]||(c[16]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",class:"icon-5 icon-muted"},[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"})],-1)])])),e.createElementVNode("div",J2,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-dot-avatar",(p=t.ev)!=null&&p.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",ec,[c[17]||(c[17]=e.createElementVNode("strong",null,"Status",-1)),c[18]||(c[18]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])],4),e.createElementVNode("div",tc,[e.createElementVNode("div",nc,[e.createElementVNode("span",ac,e.toDisplayString(t.ev.contactName)+" • "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("span",oc,e.toDisplayString(t.ev.time),1)]),e.createElementVNode("div",rc,[e.createElementVNode("span",ic,[c[19]||(c[19]=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(l(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("p",sc,e.toDisplayString(t.ev.content||t.ev.title),1),t.viewOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",lc,[i.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:c[3]||(c[3]=k=>u.$emit("open-message",t.ev))},e.toDisplayString(((f=t.ev)==null?void 0:f.status)===!0?"Editar":"Visualizar"),1)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[4]||(c[4]=k=>u.$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",dc)):e.createCommentVNode("",!0),c[20]||(c[20]=e.createTextVNode(" Apagar ",-1))],8,cc)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:c[5]||(c[5]=k=>u.$emit("open-chat",t.ev))}," Abrir conversa ")):e.createCommentVNode("",!0)]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",uc,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),e.createElementVNode("div",fc,e.toDisplayString(d.value),1)]),e.createElementVNode("footer",mc,[e.createElementVNode("div",hc,[c[23]||(c[23]=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",pc,[c[21]||(c[21]=e.createElementVNode("strong",null,"Agendado por",-1)),c[22]||(c[22]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])]),e.createElementVNode("div",gc,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-bar",(g=t.ev)!=null&&g.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",yc,[c[24]||(c[24]=e.createElementVNode("strong",null,"Status",-1)),c[25]||(c[25]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])]),e.createElementVNode("div",kc,e.toDisplayString(t.ev.time),1),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c[6]||(c[6]=k=>u.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((y=t.ev)==null?void 0:y.status)===!0?(e.openBlock(),e.createElementBlock("svg",xc,[...c[26]||(c[26]=[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",bc,[...c[27]||(c[27]=[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.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[7]||(c[7]=k=>u.$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",Ec,[...c[28]||(c[28]=[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",vc)):e.createCommentVNode("",!0)],8,wc)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[8]||(c[8]=k=>u.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...c[29]||(c[29]=[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)])])])],64))}}},[["__scopeId","data-v-ba8ebbe5"]]),St=new Map,Cc=Dt.defineStore("scheduled",{state:()=>({baseUrl:Ds,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=Zt(new Date)),this.loadedYM.has(t))return;const n=`${this.baseUrl}|${t}`;if(St.has(n))return St.get(n);this.loadingYM.add(t),this.errorByYM={...this.errorByYM,[t]:""};const a=(async()=>{var o,r;try{const i=`${this.baseUrl}?year_month=${encodeURIComponent(t)}&page_size=10`,s=await ot.get(i),l=Array.isArray(s==null?void 0:s.data)?s.data:((o=s==null?void 0:s.data)==null?void 0:o.results)||[],d=cr(l||[]);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 h=u;for(;h;){const p=await ot.get(h),f=Array.isArray(p==null?void 0:p.data)?p.data:((c=p==null?void 0:p.data)==null?void 0:c.results)||[],g=cr(f||[]);this._appendMonth(t,g),h=this.coerceHttps(((m=p==null?void 0:p.data)==null?void 0:m.next)||null)}}catch(h){console.warn("[scheduled] background paging error:",(h==null?void 0:h.message)||h)}})()}catch(i){const s=String((i==null?void 0:i.message)||i);throw this.errorByYM={...this.errorByYM,[t]:s},console.error("[scheduled] fetch error",t,s),this._setMonth(t,[]),this.loadedYM.delete(t),i}finally{St.delete(n),this.loadingYM.delete(t)}})();return St.set(n,a),a},async forceReload(t){t||(t=Zt(new Date));const n=`${this.baseUrl}|${t}`;St.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(i=>{var d;const s=((d=i==null?void 0:i.raw)==null?void 0:d.id)!=null?String(i.raw.id):null,l=(i==null?void 0:i.id)!=null?String(i.id):null;return s===n||l===n});if(r!==-1)return{ym:a,idx:r}}return null},applyUpdateToCache({id:t,params:n}){var h,p,f,g,y,k,x,E,B,M,T,_,C;let a=null;if((h=n==null?void 0:n.schedule)!=null&&h.time){const w=n.schedule.time,P=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(w);if(P){const[,F,H,V,v="00",$="00"]=P;a=new Date(Number(F),Number(H)-1,Number(V),Number(v),Number($),0,0)}else{const F=typeof w=="string"&&!w.includes("T")?w.replace(" ","T"):w;a=new Date(F)}}console.log(n);const o=w=>{var P,F,H,V;return a instanceof Date&&!isNaN(a)&&(w.date=a,w.time=On(a)),((F=(P=n==null?void 0:n.message)==null?void 0:P[0])==null?void 0:F.content)!=null&&(w.content=n.message[0].content),w.raw=w.raw||{id:t},w.raw.params=w.raw.params||{},n!=null&&n.schedule&&(w.raw.params.schedule={...w.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(w.raw.params.scheduled_by=n.scheduled_by),n.department&&(w.raw.params.department=n.department),n!=null&&n.message&&(w.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(w.chatId=n.chat_id??w.chatId??""),n!=null&&n.entity&&(w.raw.params.entity={...w.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(w.contactName=n.entity.name??w.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(w.contactPhoto=n.entity.photo??w.contactPhoto??null,n.entity.photo&&(w.photo=n.entity.photo))),n!=null&&n.info&&(w.raw.params.info={...w.raw.params.info||{},...n.info},(H=n.info)!=null&&H.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(w.departmentName=n.info.department.name??w.departmentName),(V=n.info)!=null&&V.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(w.instanceName=n.info.instance.name??w.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(w.instanceStatus=n.info.instance.last_instance_status??w.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?w.title=n.title??w.title??"Mensagem programada":w.title=w.title||"Mensagem programada",Object.prototype.hasOwnProperty.call(n||{},"function")?(w.function=n.function??w.function??"scheduled_messages",w.type=n.function??w.type??"scheduled_messages"):(w.function=w.function||"scheduled_messages",w.type=w.type||"scheduled_messages"),w},r=this.findEventById(t);if(!r){const w=a instanceof Date&&!isNaN(a)?a:(()=>{var $;const V=($=n==null?void 0:n.schedule)==null?void 0:$.time,v=typeof V=="string"&&!V.includes("T")?V.replace(" ","T"):V;return(mn==null?void 0:mn(v))||(v?new Date(v):new Date)})(),P=o({id:t,date:w,time:On(w),title:(n==null?void 0:n.title)||"Mensagem programada",type:(n==null?void 0:n.function)||"scheduled_messages",status:(n==null?void 0:n.status)||"true",scheduled_by:(n==null?void 0:n.scheduled_by)||null,function:(n==null?void 0:n.function)||"scheduled_messages",content:((f=(p=n==null?void 0:n.message)==null?void 0:p[0])==null?void 0:f.content)??"",raw:{id:t,params:n},contactName:((g=n==null?void 0:n.entity)==null?void 0:g.name)??"Cliente",contactPhoto:((y=n==null?void 0:n.entity)==null?void 0:y.photo)??null,departmentName:((x=(k=n==null?void 0:n.info)==null?void 0:k.department)==null?void 0:x.name)??null,departmentId:((B=(E=n==null?void 0:n.info)==null?void 0:E.department)==null?void 0:B.id)??null,instanceName:((T=(M=n==null?void 0:n.info)==null?void 0:M.instance)==null?void 0:T.name)??null,instanceStatus:((C=(_=n==null?void 0:n.info)==null?void 0:_.instance)==null?void 0:C.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),F=Zt(P.date),H=this.monthCache[F]?[...this.monthCache[F],P]:[P];H.sort((V,v)=>V.date-v.date),this._setMonth(F,H);return}const{ym:i,idx:s}=r,l=this.monthCache[i]||[],d={...l[s]},u=o({...d}),c=u.date instanceof Date?u.date:d.date,m=Zt(c);if(m===i){const w=[...l];w.splice(s,1,u),w.sort((P,F)=>P.date-F.date),this._setMonth(i,w)}else{const w=l.slice(0,s).concat(l.slice(s+1)),P=this.monthCache[m]?[...this.monthCache[m],u]:[u];P.sort((F,H)=>F.date-H.date),this.monthCache={...this.monthCache,[i]:w,[m]:P}}},removeFromCache(t){const n=this.findEventById(t);if(!n)return!1;const{ym:a,idx:o}=n,r=this.monthCache[a]||[],i=r.slice(0,o).concat(r.slice(o+1));return this._setMonth(a,i),!0},insertNormalizedEvent(t){if(!t)return;const n=String(t.id),a=t.date instanceof Date?t.date:mn(t.date)||new Date,o=Zt(a),r={...t,id:n,date:a,time:t.time??On(a)},i=this.monthCache[o]?[...this.monthCache[o]]:[],s=i.findIndex(l=>{var d;return String(((d=l==null?void 0:l.raw)==null?void 0:d.id)??(l==null?void 0:l.id))===n});s!==-1?i.splice(s,1,r):i.push(r),i.sort((l,d)=>l.date-d.date),this._setMonth(o,i)},insertFromApiItem(t){const n=Ba(t);n&&this.insertNormalizedEvent(n)},insertManyFromApi(t=[]){for(const n of t){const a=Ba(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=St.clear)==null||t.call(St)}}}),Sc={class:"cpk-header bg-base-200"},Bc={class:"left"},Vc=["title"],Mc={class:"right"},Nc=["title"],Ac={class:"toggle"},Tc=["aria-pressed","title"],Dc={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Fc={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Lc=Ce({__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",Sc,[e.createElementVNode("div",Bc,[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,Vc),e.createElementVNode("div",Mc,[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,Nc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ac,[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",Fc,[...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",Dc,[...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,Tc)])]))}},[["__scopeId","data-v-37b625a5"]]),$c=["title"],Pc={class:"week-header"},Oc=Ce({__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,$c),e.createElementVNode("div",Pc,[(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-756165d9"]]),_c=["onClick"],Hc={key:0,class:"cell-today-indicator show-lg"},Rc={class:"cell-top"},zc={class:"day-number"},jc={key:1,class:"more"},Gc={class:"bars-wrap"},Ic=4,qc=8,fr=4,mr=2,Wc=1,Uc=Ce({__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(f){const g=(f==null?void 0:f.clientWidth)||0,y=(f==null?void 0:f.clientHeight)||0;if(!g||!y)return{cols:0,rows:0,widths:[],sum:0};const k=Math.max(0,Math.floor((g+fr)/(Ic+fr))),x=Math.max(0,Math.floor((y+mr)/(qc+mr))),E=l(k,x),B=E.reduce((M,T)=>M+T,0);return{cols:k,rows:x,widths:E,sum:B}}function i(f,g){const y=r(g),k=a.value[f];(!k||k.cols!==y.cols||k.rows!==y.rows||k.sum!==y.sum)&&(a.value={...a.value,[f]:y})}function s(f,g){if(!g){const k=o.get(f);if(k&&(k.disconnect(),o.delete(f)),a.value[f]!=null){const x={...a.value};delete x[f],a.value=x}return}i(f,g);const y=new ResizeObserver(()=>i(f,g));y.observe(g),o.set(f,y)}e.onBeforeUnmount(()=>{o.forEach(f=>f.disconnect()),o.clear()});function l(f,g){if(f<=0||g<=0)return[];const y=[],k=.25;for(let x=0;x<g;x++){const E=x/Math.max(1,g-1),B=k+(1-k)*E,M=Math.max(1,Math.round(f*B));y.push(Math.min(M,f))}return y}function d(f,g){var B;const y=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,k=((B=a.value[f])==null?void 0:B.sum)??0;if(y<=k)return{bars:y,overflow:0};const x=Math.max(0,k-Wc),E=Math.max(0,y-x);return{bars:x,overflow:E}}function u(f,g){const y=a.value[f];if(!y||y.rows===0||y.cols===0)return[];const{widths:k}=y,E=d(f,g).bars,B=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,E):[])||[],M=k.map(()=>[]);let T=0;for(let _=k.length-1;_>=0&&T<B.length;_--){const C=Math.min(k[_],B.length-T);M[_]=B.slice(T,T+C),T+=C}return M}const c=e.ref(null);function m(f){return f&&f.nodeType===1&&typeof f.getBoundingClientRect=="function"}function h(f){if(!m(f))return;const g=c.value,y=g&&m(g)?g:f.offsetParent;if(!m(y))return;let k,x;try{k=f.getBoundingClientRect(),x=y.getBoundingClientRect()}catch{return}const E=y.scrollLeft||0,B=y.scrollTop||0;f.style.position="absolute",f.style.zIndex="0",f.style.top=`${k.top-x.top+B}px`,f.style.left=`${k.left-x.left+E}px`,f.style.width=`${k.width}px`,f.style.height=`${k.height}px`,f.style.pointerEvents="none"}function p(f){!f||!f.style||requestAnimationFrame(()=>{!f||!f.style||(f.style.position="",f.style.zIndex="",f.style.top="",f.style.left="",f.style.width="",f.style.height="",f.style.pointerEvents="")})}return(f,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:h,onAfterLeave:p},{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:x=>t.selectDayFn(y.date)},[t.isTodayFn(y.date)?(e.openBlock(),e.createElementBlock("div",Hc," Hoje ")):e.createCommentVNode("",!0),e.createElementVNode("div",Rc,[e.createElementVNode("span",zc,e.toDisplayString(y.date.getDate()),1)]),d(y.key,y.date).overflow>0?(e.openBlock(),e.createElementBlock("span",jc," +"+e.toDisplayString(d(y.key,y.date).overflow),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Gc,[e.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:x=>s(y.key,x)},[d(y.key,y.date).bars>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u(y.key,y.date),(x,E)=>(e.openBlock(),e.createElementBlock("div",{key:"vrow"+E,class:"vrow"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x,(B,M)=>(e.openBlock(),e.createElementBlock("span",{key:"vbar"+E+"-"+M,class:"vbar",style:e.normalizeStyle({background:e.unref(_n)(B),boxShadow:`0 0 8px ${e.unref(_n)(B)}70`})},null,4))),128))]))),128)):e.createCommentVNode("",!0)],512)])],14,_c))),128))]),_:1},512))}},[["__scopeId","data-v-26af06b5"]]),Zc={class:"agenda-section"},Yc={key:0,class:"empty-state"},Xc={key:1,class:"day-list"},Kc={class:"date-trail"},Qc={class:"weekday-short"},Jc={class:"date-pill bg-base-200 border border-base-300"},e3={class:"date-pill-month"},t3={class:"date-pill-day"},n3={class:"content-col"},a3={class:"day-header"},o3={class:"agenda-title"},r3={class:"month-header-text"},i3={class:"events-list"},s3=Ce({__name:"AgendaList",props:{days:{type:Array,default:()=>[]},weekdayLong:Function,weekdayShort:Function,monthShort:Function,monthLabelOf:Function,year:Number},emits:["open-chat","open-message","delete-message"],setup(t,{emit:n}){return(a,o)=>(e.openBlock(),e.createElementBlock("section",Zc,[t.days.length===0?(e.openBlock(),e.createElementBlock("div",Yc," Sem eventos neste mês. ")):(e.openBlock(),e.createElementBlock("ul",Xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.days,r=>{var i;return e.openBlock(),e.createElementBlock("li",{key:r.key,class:"day-item border-base-200"},[e.createElementVNode("div",Kc,[e.createElementVNode("div",Qc,e.toDisplayString(t.weekdayShort(r.date)),1),e.createElementVNode("div",Jc,[e.createElementVNode("div",e3,e.toDisplayString(t.monthShort(r.date)),1),e.createElementVNode("div",t3,e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",{style:e.normalizeStyle({background:e.unref(_n)(((i=r.events)==null?void 0:i[0])||{})}),class:"date-pill-dot"},null,4)])]),e.createElementVNode("div",n3,[e.createElementVNode("div",a3,[e.createElementVNode("h3",o3,e.toDisplayString(t.weekdayLong(r.date).toUpperCase())+" "+e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",r3,e.toDisplayString(t.monthLabelOf(r.date).toUpperCase())+" "+e.toDisplayString(t.year),1)]),e.createElementVNode("ul",i3,[(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(Va,{ev:s,mode:"agenda",onOpenMessage:o[0]||(o[0]=l=>a.$emit("open-message",l)),onOpenChat:o[1]||(o[1]=l=>a.$emit("open-chat",l)),onDeleteMessage:o[2]||(o[2]=l=>a.$emit("delete-message",l))},null,8,["ev"])]))),128))])])])}),128))]))]))}},[["__scopeId","data-v-2c977f25"]]),l3=["data-mode","data-empty"],c3=["disabled"],hr=Ce({__name:"EventsList",props:{loading:{type:Boolean,default:!1},selectedLabel:{type:String,default:""},selectedLabelLong:{type:String,default:""},events:{type:Array,default:()=>[]},mode:{type:String,default:"compact"}},emits:["reload","open-chat","open-message","delete-message"],setup(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]=i=>o.$emit("reload")),disabled:t.loading},e.toDisplayString(t.loading?"Atualizando…":"Atualizar"),9,c3)],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[4]||(r[4]=[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,(i,s)=>(e.openBlock(),e.createElementBlock("li",{key:i.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(Va,{ev:i,mode:t.mode==="compact"?"compact":"sidebar",onOpenMessage:r[1]||(r[1]=l=>o.$emit("open-message",l)),onOpenChat:r[2]||(r[2]=l=>o.$emit("open-chat",l)),onDeleteMessage:r[3]||(r[3]=l=>o.$emit("delete-message",l))},null,8,["ev","mode"])],6))),128))]),_:1},8,["class"]))],10,l3))}},[["__scopeId","data-v-4ecbf2a5"]]),d3={class:"cpk-popover__header border-base-100"},u3={class:"filter-body"},f3={class:"row"},m3=["checked"],h3={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},p3={class:"status-wrap"},g3={class:"seg"},y3=Ce({__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=Yt(),i=e.computed(()=>r.attendants.find(C=>C.is_me)||null),s=e.reactive({onlyMine:!1,status:null});e.watch(()=>a.open,async C=>{var F,H,V;if(!C)return;await e.nextTick();const w=(F=i.value)!=null&&F.id?String(i.value.id):null;s.onlyMine=!!w&&String(((H=a.filters)==null?void 0:H.scheduled_by)??"")===w;const P=(V=a.filters)==null?void 0:V.status;s.status=P===!0||P===!1?P:null,y()},{immediate:!1});function l(C,w){if(!C)return{};const{[w]:P,...F}=C;return F}function d(C){var P;s.onlyMine=!!C.target.checked;const w=(P=i.value)!=null&&P.id?String(i.value.id):null;s.onlyMine&&w?o("update:filters",{...a.filters,scheduled_by:w}):o("update:filters",l(a.filters,"scheduled_by"))}function u(C){if(s.status===C){s.status=null;const w=l(a.filters,"status");o("update:filters",w)}else s.status=C,o("update:filters",{...a.filters,status:C})}const c=e.ref(null),m=e.ref({left:0,top:0,placed:"bottom"}),h=e.computed(()=>({position:"fixed",left:`${m.value.left}px`,top:`${m.value.top}px`}));function p(){const C=a.anchorEl instanceof Element?a.anchorEl:null;if(C!=null&&C.getBoundingClientRect)return C.getBoundingClientRect();const w=window.innerWidth/2,P=window.innerHeight/3;return{left:w,right:w,top:P,bottom:P,width:0,height:0}}function f(C,w,P,F){return{left:Math.max(8,Math.min(C,window.innerWidth-P-8)),top:Math.max(8,Math.min(w,window.innerHeight-F-8))}}function g(){const C=p(),w=c.value,P=(w==null?void 0:w.offsetWidth)??300,F=(w==null?void 0:w.offsetHeight)??220;let H=C.bottom+a.offset,V;if(a.align==="center"?V=C.left+C.width/2-P/2:a.align==="end"?V=C.right-P:V=C.left,H+F>window.innerHeight-4){const $=C.top-F-a.offset;$>=4?(H=$,m.value.placed="top"):m.value.placed="bottom"}else m.value.placed="bottom";const v=f(V,H,P,F);m.value={left:v.left,top:v.top,placed:m.value.placed}}function y(){g(),requestAnimationFrame(g)}let k,x,E=[];function B(){M(),E=[window];const C=a.anchorEl instanceof Element?a.anchorEl:null;let w=C==null?void 0:C.parentElement;for(;w&&w!==document.body;){const P=getComputedStyle(w);/(auto|scroll)/.test(P.overflow+P.overflowY+P.overflowX)&&E.push(w),w=w.parentElement}E.forEach(P=>P.addEventListener("scroll",y,{passive:!0}))}function M(){E.forEach(C=>{var w;return(w=C.removeEventListener)==null?void 0:w.call(C,"scroll",y)}),E=[]}e.watch(()=>a.open,async C=>{var P,F,H,V;if(!C){M(),(P=k==null?void 0:k.disconnect)==null||P.call(k),(F=x==null?void 0:x.disconnect)==null||F.call(x);return}await e.nextTick(),y(),B(),(H=k==null?void 0:k.disconnect)==null||H.call(k),k=new ResizeObserver(y),k.observe(document.body),(V=x==null?void 0:x.disconnect)==null||V.call(x);const w=a.anchorEl instanceof Element?a.anchorEl:null;w&&(x=new ResizeObserver(y),x.observe(w)),window.addEventListener("resize",y)}),e.watch(()=>a.anchorEl,async()=>{a.open&&(await e.nextTick(),B(),y())});function T(C){C.key==="Escape"&&o("close")}function _(C){if(!a.open)return;const w=C.target,P=c.value;if(P&&P.contains(w))return;const F=a.anchorEl instanceof Element?a.anchorEl:null;F&&F.contains&&F.contains(w)||o("close")}return e.onMounted(()=>{document.addEventListener("pointerdown",_,!0),window.addEventListener("keydown",T)}),e.onBeforeUnmount(()=>{var C,w;document.removeEventListener("pointerdown",_,!0),window.removeEventListener("keydown",T),M(),(C=k==null?void 0:k.disconnect)==null||C.call(k),(w=x==null?void 0:x.disconnect)==null||w.call(x)}),(C,w)=>(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:w[4]||(w[4]=e.withModifiers(P=>C.$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(h.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[e.createElementVNode("div",d3,[w[5]||(w[5]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),w[6]||(w[6]=e.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:w[0]||(w[0]=P=>C.$emit("close")),"aria-label":"Fechar"}," × ")]),e.createElementVNode("div",u3,[e.createElementVNode("label",f3,[e.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:w[1]||(w[1]=P=>d(P)),"aria-label":"Exibir somente meus eventos"},null,40,m3),w[7]||(w[7]=e.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),e.createElementVNode("div",h3,[w[9]||(w[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",p3,[w[8]||(w[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",g3,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:w[2]||(w[2]=P=>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:w[3]||(w[3]=P=>u(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):e.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-0aad9d42"]]),k3={class:"calendar-content"},x3={class:"calendar-stage-main"},b3={key:0},pr=Ce({__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=Cc();r.setBaseUrl(o.sourceUrl);const i=new Date,s=e.ref(u(o.initialDate)),l=e.ref(new Date(i.getFullYear(),i.getMonth(),i.getDate())),d=e.ref("calendar");function u(b){if(b instanceof Date)return new Date(b.getFullYear(),b.getMonth(),1);if(typeof b=="string"){const[N,X]=b.split("-").map(ne=>parseInt(ne,10));return new Date(N||i.getFullYear(),(X||i.getMonth()+1)-1,1)}return new Date(i.getFullYear(),i.getMonth(),1)}function c(b){return new Date(b.getFullYear(),b.getMonth()+1,0).getDate()}function m(b){return new Date(b.getFullYear(),b.getMonth(),1).getDay()}function h(b,N){return b.getFullYear()===N.getFullYear()&&b.getMonth()===N.getMonth()}function p(b){return Sa(b,i)}function f(b){return Sa(b,l.value)}function g(b){l.value=new Date(b.getFullYear(),b.getMonth(),b.getDate()),h(b,s.value)||(s.value=new Date(b.getFullYear(),b.getMonth(),1))}function y(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function k(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function x(){s.value=new Date(i.getFullYear(),i.getMonth(),1),l.value=new Date(i.getFullYear(),i.getMonth(),i.getDate())}const E=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],B=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],M=e.computed(()=>v(E[s.value.getMonth()])),T=e.computed(()=>s.value.getFullYear()),_=e.computed(()=>w(l.value)),C=e.computed(()=>`${P(l.value)} ${l.value.getDate()}`);function w(b){return`${String(b.getDate()).padStart(2,"0")}/${String(b.getMonth()+1).padStart(2,"0")}/${b.getFullYear()}`}function P(b){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][b.getDay()]}function F(b){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][b.getDay()]}function H(b){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][b.getMonth()]}function V(b){return E[b.getMonth()]}function v(b){return b.charAt(0).toUpperCase()+b.slice(1)}const $=e.computed(()=>m(s.value)),Z=e.computed(()=>{const b=c(s.value);return Array.from({length:b},(N,X)=>{const ne=X+1,se=new Date(s.value.getFullYear(),s.value.getMonth(),ne);return{key:`d${ne}`,date:se}})}),Q=e.ref({open:!1,anchorEl:null});function ee(b){Q.value.open=!0,Q.value.anchorEl=(b==null?void 0:b.currentTarget)||null}const{filters:L}=Dt.storeToRefs(r),R=e.computed(()=>Zt(s.value)),O=e.computed(()=>r.eventsOf(R.value)),oe={scheduled_by:b=>{var ne,se,fe;const N=(b==null?void 0:b.scheduled_by)??((se=(ne=b==null?void 0:b.raw)==null?void 0:ne.params)==null?void 0:se.scheduled_by)??((fe=b==null?void 0:b.raw)==null?void 0:fe.scheduled_by)??(b==null?void 0:b.created_by)??(b==null?void 0:b.attendant_id),X=typeof N=="object"&&N?N.id??N.attendant_id:N;return X!=null?String(X):""}};function de(b,N){const X=(N==null?void 0:N.value)??N;return!X||typeof X!="object"?!0:Object.entries(X).every(([ne,se])=>{var ve,Fe,xe;if(se==null||se===""||Array.isArray(se)&&se.length===0)return!0;const fe=oe[ne],me=(fe==null?void 0:fe(b))??(b==null?void 0:b[ne])??((ve=b==null?void 0:b.raw)==null?void 0:ve[ne])??((xe=(Fe=b==null?void 0:b.raw)==null?void 0:Fe.params)==null?void 0:xe[ne])??null,be=typeof me=="string"?me:me??"";if(typeof se=="function")return!!se(be,b);if(Array.isArray(se))return se.map(String).includes(String(be));if(typeof se=="object"){const{in:S,notIn:z,range:j,contains:A}=se;if(S&&!S.map(String).includes(String(be))||z&&z.map(String).includes(String(be)))return!1;if(j&&typeof be=="number"){const[G,W]=j;if(G!=null&&be<G||W!=null&&be>W)return!1}if(A!=null){const G=Array.isArray(be)?be:String(be).split(",");if(!(Array.isArray(A)?A:[A]).some(J=>G.map(String).includes(String(J))))return!1}return!0}return String(be)===String(se)})}const pe=e.computed(()=>(O.value||[]).filter(N=>de(N,L)));function ye(b){return pe.value.filter(N=>Sa(N.date,b))}const Ve=e.computed(()=>ye(l.value)),Le=e.computed(()=>[...Ve.value].sort((b,N)=>b.date-N.date));function Ae(b){return ye(b).length}function qe(b){return Math.min(3,Ae(b))}function _e(b){const N=Ae(b);return N>3?N-3:0}const $e=e.computed(()=>{const b=s.value.getFullYear(),N=s.value.getMonth(),X=new Map;for(const se of pe.value){const fe=se==null?void 0:se.date;if(!(fe instanceof Date)||fe.getFullYear()!==b||fe.getMonth()!==N)continue;const me=`${b}-${N+1}-${fe.getDate()}`;X.has(me)||X.set(me,{key:`ag-${me}`,date:new Date(b,N,fe.getDate()),events:[]}),X.get(me).events.push(se)}const ne=Array.from(X.values());for(const se of ne)se.events.sort((fe,me)=>fe.date-me.date);return ne.sort((se,fe)=>se.date-fe.date),ne}),Oe=e.ref(!1),ze=e.ref(!1),q=e.computed(()=>ze.value||Oe.value),re=e.computed(()=>q?"calendar-stage--compact":"calendar-stage--single");function he(){var X;const b=window.matchMedia("(max-width: 1280px)"),N=()=>ze.value=b.matches;N(),(X=b.addEventListener)==null||X.call(b,"change",N)}const ae=e.computed(()=>r.isLoading(R.value));e.computed(()=>r.errorOf(R.value));const K=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 ce(b,N){K.value.open=!0,K.value.context={action:"delete-message",event:b},K.value.title="Confirmar exclusão",K.value.description="Tem certeza que deseja apagar este evento?",K.value.anchorEl=N&&N.currentTarget||typeof document<"u"&&document.activeElement||null,K.value.destructive=!0,K.value.confirmLabel="Apagar",K.value.loadingLabel="Apagando…"}async function D(b){if(b)try{K.value.loading=!0,b.action==="delete-message"&&await Y(b.event)}finally{K.value.loading=!1,K.value.open=!1,K.value.context=null}}function I(){K.value.open=!1,K.value.context=null}async function te(){await r.forceReload(R.value)}async function Y(b){var N;try{b.deleteLoading=!0;const X=((N=b==null?void 0:b.raw)==null?void 0:N.id)??(b==null?void 0:b.id)??b;if(X==null)throw new Error("Evento inválido para exclusão");const ne=await D2(Ts,b);return ne!=null&&ne.ok&&(r.removeFromCache(String(X))||await r.forceReload(R.value)),ne}catch(X){return console.error(X),null}finally{b.deleteLoading=!1}}return e.onMounted(async()=>{if(he(),await r.ensureMonthLoaded(R.value),!ye(l.value).length&&pe.value.length){const b=pe.value[0];l.value=new Date(b.date.getFullYear(),b.date.getMonth(),b.date.getDate())}}),e.watch(()=>o.sourceUrl,async b=>{if(r.setBaseUrl(b),r.resetAll(),await r.ensureMonthLoaded(R.value),!ye(l.value).length&&pe.value.length){const N=pe.value[0];l.value=new Date(N.date.getFullYear(),N.date.getMonth(),N.date.getDate())}}),e.watch(R,async()=>{const b=s.value.getFullYear(),N=s.value.getMonth(),X=Math.min(l.value.getDate(),c(s.value));if(l.value=new Date(b,N,X),await r.ensureMonthLoaded(R.value),!ye(l.value).length&&pe.value.length){const ne=pe.value[0];l.value=new Date(ne.date.getFullYear(),ne.date.getMonth(),ne.date.getDate())}}),n({updateEvent:r.applyUpdateToCache}),(b,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":q.value}])},[e.createElementVNode("div",k3,[N[15]||(N[15]=e.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),e.createVNode(Lc,{month:M.value,year:T.value,"is-compact":q.value,"view-mode":d.value,"filter-count":Object.keys(e.unref(L)).length,onPrev:y,onNext:k,onToday:x,onToggleCompact:N[0]||(N[0]=X=>Oe.value=!Oe.value),onSetViewMode:N[1]||(N[1]=X=>d.value=X),onClosePage:N[2]||(N[2]=X=>b.$emit("close-page")),onOpenFilter:ee},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",re.value])},[e.createElementVNode("div",x3,[e.createVNode(Oc,{"week-days":B,month:M.value,year:T.value},null,8,["month","year"]),e.createVNode(Uc,{"start-offset":$.value,"month-days":Z.value,"view-date":s.value,"is-compact":q.value,"is-same-month-fn":h,"is-selected-day-fn":f,"is-today-fn":p,"select-day-fn":g,"events-by-day-fn":ye,"day-event-count-fn":Ae,"event-bars-to-show-fn":qe,"day-event-overflow-fn":_e},null,8,["start-offset","month-days","view-date","is-compact"])]),q.value?(e.openBlock(),e.createBlock(hr,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:ae.value,"selected-label-long":C.value,events:Le.value,mode:"compact",onReload:te,onOpenChat:N[3]||(N[3]=X=>b.$emit("open-chat",X)),onOpenMessage:N[4]||(N[4]=X=>b.$emit("open-message",X)),onDeleteMessage:N[5]||(N[5]=(X,ne)=>ce(X,ne))},null,8,["loading","selected-label-long","events"])):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(s3,{key:1,days:$e.value,"weekday-long":P,"weekday-short":F,"month-short":H,"month-label-of":V,year:T.value,onOpenChat:N[6]||(N[6]=X=>b.$emit("open-chat",X)),onOpenMessage:N[7]||(N[7]=X=>b.$emit("open-message",X)),onDeleteMessage:N[8]||(N[8]=(X,ne)=>ce(X,ne))},null,8,["days","year"]))]),e.createVNode(hr,{class:"calendar-daylist calendar-daylist--desktop",loading:ae.value,"selected-label":_.value,"selected-label-long":C.value,events:Le.value,mode:q.value?"compact":"sidebar",onReload:te,onOpenChat:N[9]||(N[9]=X=>b.$emit("open-chat",X)),onOpenMessage:N[10]||(N[10]=X=>b.$emit("open-message",X)),onDeleteMessage:N[11]||(N[11]=(X,ne)=>ce(X,ne))},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),e.createVNode(xl,{modelValue:K.value.open,"onUpdate:modelValue":N[12]||(N[12]=X=>K.value.open=X),title:K.value.title,description:K.value.description,destructive:K.value.destructive,"confirm-label":K.value.confirmLabel,"cancel-label":K.value.cancelLabel,loading:K.value.loading,"loading-label":K.value.loadingLabel,context:K.value.context,"anchor-el":K.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:D,onCancel:I},{details:e.withCtx(()=>{var X;return[(X=K.value.context)!=null&&X.event?(e.openBlock(),e.createElementBlock("div",b3,[e.createVNode(Va,{"view-only":!0,mode:"sidebar",ev:K.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(y3,{open:Q.value.open,"anchor-el":Q.value.anchorEl,filters:e.unref(L),"onUpdate:filters":N[13]||(N[13]=X=>e.isRef(L)?L.value=X:null),onClose:N[14]||(N[14]=X=>Q.value.open=!1)},null,8,["open","anchor-el","filters"])],64))}},[["__scopeId","data-v-9c3b18ef"]]),w3={class:"flex flex-col text-center"},E3={class:"flex flex-col space-y-3 justify-center"},v3={class:"space-x-4 flex-col text-black justify-center"},C3=["onUpdate:modelValue","onInput","onKeydown"],gr={__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 i=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()},l=(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",w3,[e.createElementVNode("div",E3,[e.createElementVNode("div",v3,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,h)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:h,"onUpdate:modelValue":p=>o.value[h]=p,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:p=>i(h),onKeydown:e.withKeys(p=>l(h,p),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,C3)),[[e.vModelText,o.value[h]]])),128))])])]))}},S3={class:"text-center flex gap-3"},B3={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},V3={key:0,class:"items-center justify-center inline-flex"},M3=["src"],N3={__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")},i=e.computed(()=>o.base64?o.base64:l.value),s=e.computed(()=>`w-${o.dimensions[0]} h-${o.dimensions[1]}`),l=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",S3,[e.createElementVNode("section",B3,[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",V3,[...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:i.value,alt:"QRCode"},null,10,M3)])]))}};for(var We=[],Ma=0;Ma<256;++Ma)We.push((Ma+256).toString(16).slice(1));function A3(t,n=0){return(We[t[n+0]]+We[t[n+1]]+We[t[n+2]]+We[t[n+3]]+"-"+We[t[n+4]]+We[t[n+5]]+"-"+We[t[n+6]]+We[t[n+7]]+"-"+We[t[n+8]]+We[t[n+9]]+"-"+We[t[n+10]]+We[t[n+11]]+We[t[n+12]]+We[t[n+13]]+We[t[n+14]]+We[t[n+15]]).toLowerCase()}var Hn,T3=new Uint8Array(16);function D3(){if(!Hn&&(Hn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hn(T3)}var F3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const yr={randomUUID:F3};function L3(t,n,a){if(yr.randomUUID&&!t)return yr.randomUUID();t=t||{};var o=t.random||(t.rng||D3)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,A3(o)}function kr(){const t=Yt(),n=async l=>{const d=t.attendants.find(u=>u.id===l);if(d)try{const u=await ot.get(`${Ea}?attendant=${l}&page=1`);d.messages=u.data.results.reverse(),d.hasNextPage=u.data.next!==null,d.currentPage=2,d.internal_chat={channel_id:u.data.channel_id,unread:0}}catch(u){console.error("Erro ao buscar mensagens:",u)}},a=async l=>{const d=t.attendants.find(u=>u.id===l);if(!(!d||!d.hasNextPage))try{const u=await ot.get(`${Ea}?attendant=${l}&page=${d.currentPage}`);d.messages=[...u.data.results.reverse(),...d.messages],d.hasNextPage=u.data.next!==null,d.currentPage++}catch(u){console.error("Erro ao carregar mais mensagens:",u)}},o=(l,d,u)=>{const c=l==null?void 0:l.message;if(!c)return;const m=t.attendants.find(h=>{var p;return((p=h.internal_chat)==null?void 0:p.channel_id)===c.channel_id});m?(m.messages=m.messages||[],m.messages.find(p=>p.id===c.id)||(m.messages.push(c),(!d||m.id!==u)&&(m.internal_chat.unread=(m.internal_chat.unread||0)+1))):console.error("Atendente não encontrado para o canal especificado.")},r=l=>{const d=t.attendants.find(u=>u.id===l);d&&(d.internal_chat.unread=0)},i=async(l,d,u,c=!1)=>{var f;const m=t.attendants.find(g=>g.id===l);if(!m||!((f=m.internal_chat)!=null&&f.channel_id))return;let h;c?h=d:h={type:"text",content:d};const p={id:L3(),content:h,created_at:new Date().toISOString(),sender:u};m.messages.push(p);try{await ot.post(`${Ea}${m.internal_chat.channel_id}/message/`,{id:p.id,content:p.content})}catch(g){console.error("Erro ao enviar mensagem:",g)}},s=l=>{const d=t.attendants.find(u=>u.id===l);return d?d.hasNextPage:!1};return{attendants:e.computed(()=>t.attendants),count:e.computed(()=>t.count),fetchMessagesForAtendente:n,loadMessagesForAtendente:a,addMessageToAtendente:o,sendMessageToAtendente:i,hasNextPageForAtendente:s,resetUnreadMessages:r}}const $3={class:"avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500"},P3={key:0,style:{"padding-top":"0.5rem"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},O3=["src"],Na=Ce({__name:"Avatar",props:{url:{type:String}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",$3,[t.url?(e.openBlock(),e.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:t.url},null,8,O3)):(e.openBlock(),e.createElementBlock("svg",P3,[...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)])]))]))}},[["__scopeId","data-v-7d8b2820"]]),_3={class:"attendants-container"},H3={class:"atendentes-list bg-base-300"},R3={key:0,class:"empty-message bg-base-200"},z3=["onClick"],j3={class:"atendente-main"},G3={class:"atendente-name"},I3={class:"flex items-center gap-4"},q3={key:0,class:"message-indicator"},W3={key:0,class:"chat-footer bg-base-200"},xr=Ce({__name:"ChatList",props:{atendentes:{type:Array,required:!0},attendant:{required:!0},mobile:{type:Boolean,default:!1}},emits:["atendenteSelecionado"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),i=d=>{o("atendenteSelecionado",d)},s=d=>{switch(d){case"Busy":return"bg-red-500";case"Online":return"bg-green-500";case"Away":return"bg-yellow-500";case"Offline":return"bg-gray-500";default:return"bg-purple-500"}},l=e.computed(()=>r.value?a.atendentes.filter(d=>d.name.toLowerCase().includes(r.value.toLowerCase())&&d.id!==a.attendant.id):a.atendentes.filter(d=>d.id!==a.attendant.id));return(d,u)=>(e.openBlock(),e.createElementBlock("div",_3,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=c=>r.value=c),class:e.normalizeClass(t.mobile?"search-input-mobile bg-base-300 border-b border-base-200":"search-input bg-base-300 border-b border-base-200"),placeholder:"Pesquise entre os atendentes..."},null,2),[[e.vModelText,r.value]]),e.createElementVNode("ul",H3,[l.value.length===0?(e.openBlock(),e.createElementBlock("li",R3,e.toDisplayString(t.atendentes.length===0?"Não há atendentes disponíveis":"Não há atendentes com esse nome"),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,c=>(e.openBlock(),e.createElementBlock("li",{key:c.id,onClick:m=>i(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("main",j3,[e.createVNode(Na,{url:c.photo},null,8,["url"]),e.createElementVNode("span",G3,e.toDisplayString(c.name),1)]),e.createElementVNode("footer",I3,[c.internal_chat.unread>0?(e.openBlock(),e.createElementBlock("span",q3,e.toDisplayString(c.internal_chat.unread),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["status-indicator",s(c.login_status)])},null,2)]),u[1]||(u[1]=e.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,z3))),128))]),t.mobile?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",W3))]))}},[["__scopeId","data-v-dc8950e9"]]);function U3(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 Z3(t){return t?(await e.nextTick(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null):null}function Y3(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 br(t,n){if(await e.nextTick(),!t.top)return;const a=t.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const wr=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},X3={},K3=t=>(e.pushScopeId("data-v-d3e37633"),t=t(),e.popScopeId(),t),Q3={class:"container"},J3=K3(()=>e.createElementVNode("div",{class:"spinner"},null,-1)),ed=[J3];function td(t,n){return e.openBlock(),e.createElementBlock("div",Q3,ed)}const nd=wr(X3,[["render",td],["__scopeId","data-v-d3e37633"]]),ad={class:"state-error"},hn=wr(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 i=e.ref(null),s=e.ref(""),{top:l,firstload:d,distance:u}=a,{identifier:c,target:m}=e.toRefs(a),h={infiniteLoading:i,top:l,firstload:d,distance:u,parentEl:null,emit(){r=(h.parentEl||document.documentElement).scrollHeight,p.loading(),n("infinite",p)}},p={loading(){s.value="loading"},async loaded(){s.value="loaded",await br(h,r),U3(i.value,h.parentEl)&&h.emit()},async complete(){s.value="complete",await br(h,r),o==null||o.disconnect()},error(){s.value="error"}};function f(){o==null||o.disconnect(),o=Y3(h)}return e.watch(c,f),e.onMounted(async()=>{h.parentEl=await Z3(m),f()}),e.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"infiniteLoading",ref:i,class:"v3-infinite-loading"},[e.withDirectives(e.createElementVNode("div",null,[e.renderSlot(g.$slots,"spinner",{},()=>[e.createVNode(nd)],!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:h.emit},()=>{var k;return[e.createElementVNode("span",ad,[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]=(...x)=>h.emit&&h.emit(...x))},"retry")])]},!0):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]);function od(t,n,a){const o=ct(t,a==null?void 0:a.in);return isNaN(n)?rt(t,NaN):(o.setDate(o.getDate()+n),o)}function Rn(t,n){return Pt(t,{...n,weekStartsOn:1})}function Er(t,n){const a=ct(t,n==null?void 0:n.in),o=a.getFullYear(),r=rt(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const i=Rn(r),s=rt(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const l=Rn(s);return a.getTime()>=i.getTime()?o+1:a.getTime()>=l.getTime()?o:o-1}function vr(t){const n=ct(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 zn(t,n){const a=ct(t,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function rd(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n),i=zn(o),s=zn(r),l=+i-vr(i),d=+s-vr(s);return Math.round((l-d)/El)}function id(t,n){const a=Er(t,n),o=rt(t,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),Rn(o)}function Aa(t){return rt(t,Date.now())}function Cr(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n);return+zn(o)==+zn(r)}function sd(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ld(t){return!(!sd(t)&&typeof t!="number"||isNaN(+ct(t)))}function cd(t,n){const a=ct(t,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function dd(t,n){const a=ct(t,n==null?void 0:n.in);return rd(a,cd(a))+1}function ud(t,n){const a=ct(t,n==null?void 0:n.in),o=+Rn(a)-+id(a);return Math.round(o/ir)+1}function Sr(t,n){var c,m,h,p;const a=ct(t,n==null?void 0:n.in),o=a.getFullYear(),r=Pn(),i=(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??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=rt((n==null?void 0:n.in)||t,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=Pt(s,n),d=rt((n==null?void 0:n.in)||t,0);d.setFullYear(o,0,i),d.setHours(0,0,0,0);const u=Pt(d,n);return+a>=+l?o+1:+a>=+u?o:o-1}function fd(t,n){var l,d,u,c;const a=Pn(),o=(n==null?void 0:n.firstWeekContainsDate)??((d=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,r=Sr(t,n),i=rt((n==null?void 0:n.in)||t,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),Pt(i,n)}function md(t,n){const a=ct(t,n==null?void 0:n.in),o=+Pt(a,n)-+fd(a,n);return Math.round(o/ir)+1}function De(t,n){const a=t<0?"-":"",o=Math.abs(t).toString().padStart(n,"0");return a+o}const Bt={y(t,n){const a=t.getFullYear(),o=a>0?a:1-a;return De(n==="yy"?o%100:o,n.length)},M(t,n){const a=t.getMonth();return n==="M"?String(a+1):De(a+1,2)},d(t,n){return De(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 De(t.getHours()%12||12,n.length)},H(t,n){return De(t.getHours(),n.length)},m(t,n){return De(t.getMinutes(),n.length)},s(t,n){return De(t.getSeconds(),n.length)},S(t,n){const a=n.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return De(r,n.length)}},Xt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Br={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 Bt.y(t,n)},Y:function(t,n,a,o){const r=Sr(t,o),i=r>0?r:1-r;if(n==="YY"){const s=i%100;return De(s,2)}return n==="Yo"?a.ordinalNumber(i,{unit:"year"}):De(i,n.length)},R:function(t,n){const a=Er(t);return De(a,n.length)},u:function(t,n){const a=t.getFullYear();return De(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 De(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 De(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 Bt.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 De(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=md(t,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):De(r,n.length)},I:function(t,n,a){const o=ud(t);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):De(o,n.length)},d:function(t,n,a){return n==="do"?a.ordinalNumber(t.getDate(),{unit:"date"}):Bt.d(t,n)},D:function(t,n,a){const o=dd(t);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):De(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(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(i);case"ee":return De(i,2);case"eo":return a.ordinalNumber(i,{unit:"day"});case"eee":return a.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(r,{width:"short",context:"formatting"});case"eeee":default:return a.day(r,{width:"wide",context:"formatting"})}},c:function(t,n,a,o){const r=t.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(i);case"cc":return De(i,n.length);case"co":return a.ordinalNumber(i,{unit:"day"});case"ccc":return a.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(r,{width:"narrow",context:"standalone"});case"cccccc":return a.day(r,{width:"short",context:"standalone"});case"cccc":default:return a.day(r,{width:"wide",context:"standalone"})}},i:function(t,n,a){const o=t.getDay(),r=o===0?7:o;switch(n){case"i":return String(r);case"ii":return De(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=Xt.noon:o===0?r=Xt.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=Xt.evening:o>=12?r=Xt.afternoon:o>=4?r=Xt.morning:r=Xt.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 Bt.h(t,n)},H:function(t,n,a){return n==="Ho"?a.ordinalNumber(t.getHours(),{unit:"hour"}):Bt.H(t,n)},K:function(t,n,a){const o=t.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):De(o,n.length)},k:function(t,n,a){let o=t.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):De(o,n.length)},m:function(t,n,a){return n==="mo"?a.ordinalNumber(t.getMinutes(),{unit:"minute"}):Bt.m(t,n)},s:function(t,n,a){return n==="so"?a.ordinalNumber(t.getSeconds(),{unit:"second"}):Bt.s(t,n)},S:function(t,n){return Bt.S(t,n)},X:function(t,n,a){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Mr(o);case"XXXX":case"XX":return Ot(o);case"XXXXX":case"XXX":default:return Ot(o,":")}},x:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"x":return Mr(o);case"xxxx":case"xx":return Ot(o);case"xxxxx":case"xxx":default:return Ot(o,":")}},O:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Vr(o,":");case"OOOO":default:return"GMT"+Ot(o,":")}},z:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Vr(o,":");case"zzzz":default:return"GMT"+Ot(o,":")}},t:function(t,n,a){const o=Math.trunc(+t/1e3);return De(o,n.length)},T:function(t,n,a){return De(+t,n.length)}};function Vr(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),i=o%60;return i===0?a+String(r):a+String(r)+n+De(i,2)}function Mr(t,n){return t%60===0?(t>0?"-":"+")+De(Math.abs(t)/60,2):Ot(t,n)}function Ot(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=De(Math.trunc(o/60),2),i=De(o%60,2);return a+r+n+i}const Nr=(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"})}},Ar=(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"})}},hd={p:Ar,P:(t,n)=>{const a=t.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return Nr(t,n);let i;switch(o){case"P":i=n.dateTime({width:"short"});break;case"PP":i=n.dateTime({width:"medium"});break;case"PPP":i=n.dateTime({width:"long"});break;case"PPPP":default:i=n.dateTime({width:"full"});break}return i.replace("{{date}}",Nr(o,n)).replace("{{time}}",Ar(r,n))}},pd=/^D+$/,gd=/^Y+$/,yd=["D","DD","YY","YYYY"];function kd(t){return pd.test(t)}function xd(t){return gd.test(t)}function bd(t,n,a){const o=wd(t,n,a);if(console.warn(o),yd.includes(t))throw new RangeError(o)}function wd(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 Ed=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Cd=/^'([^]*?)'?$/,Sd=/''/g,Bd=/[a-zA-Z]/;function Tr(t,n,a){var c,m,h,p,f,g,y,k;const o=Pn(),r=(a==null?void 0:a.locale)??o.locale??Jl,i=(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??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(f=a==null?void 0:a.locale)==null?void 0:f.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((k=(y=o.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=ct(t,a==null?void 0:a.in);if(!ld(l))throw new RangeError("Invalid time value");let d=n.match(vd).map(x=>{const E=x[0];if(E==="p"||E==="P"){const B=hd[E];return B(x,r.formatLong)}return x}).join("").match(Ed).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const E=x[0];if(E==="'")return{isToken:!1,value:Vd(x)};if(Br[E])return{isToken:!0,value:x};if(E.match(Bd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:x}});r.localize.preprocessor&&(d=r.localize.preprocessor(l,d));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return d.map(x=>{if(!x.isToken)return x.value;const E=x.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&xd(E)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&kd(E))&&bd(E,n,String(t));const B=Br[E[0]];return B(l,E,r.localize,u)}).join("")}function Vd(t){const n=t.match(Cd);return n?n[1].replace(Sd,"'"):t}function Md(t,n){return Cl(rt(t,t),Aa(t),n)}function Nd(t,n){return Cr(rt(t,t),Aa(t))}function Ad(t,n,a){return od(t,-1,a)}function Td(t,n){return Cr(rt(t,t),Ad(Aa(t)))}/*! License details at fancyapps.com/license */const Te=t=>typeof t=="string";/*! License details at fancyapps.com/license */const Kt=t=>t&&t!==null&&t instanceof Element&&"nodeType"in t;/*! License details at fancyapps.com/license */const Dd=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},_t=function(t,n=void 0){return!t||t===document.body||n&&t===n?null:Dd(t)?t:_t(t.parentElement,n)};/*! License details at fancyapps.com/license */const wt=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 Be=function(t=0,n=0,a=0){return Math.max(Math.min(n,a),t)};/*! License details at fancyapps.com/license */const Ze=t=>typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]";/*! License details at fancyapps.com/license */function Dr(t){return Ze(t)||Array.isArray(t)}function pn(t,n){const a=Object.keys(t),o=Object.keys(n);return a.length===o.length&&a.every(r=>{const i=t[r],s=n[r];return typeof i=="function"?`${i}`==`${s}`:Dr(i)&&Dr(s)?pn(i,s):i===s})}/*! License details at fancyapps.com/license */const Fr=function(t){for(const n of jn)n.getState()===Xe.Running&&n.tick(Ta?t-Ta:0);Ta=t,Jt=window.requestAnimationFrame(Fr)};var Xe,Vt,Qt;(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"})(Xe||(Xe={})),function(t){t[t.Spring=0]="Spring",t[t.Ease=1]="Ease"}(Vt||(Vt={})),function(t){t[t.Loop=0]="Loop",t[t.Reverse=1]="Reverse"}(Qt||(Qt={}));const jn=new Set;let Jt=null,Ta=0;function Mt(){let t=Xe.Initializing,n=Vt.Ease,a=0,o=0,r=Mt.Easings.Linear,i=500,s=0,l=0,d=0,u=0,c=1/0,m=.01,h=.01,p=!1,f={},g=null,y={},k={},x={},E=0,B=0,M=Qt.Loop,T=Mt.Easings.Linear;const _=new Map;function C(V,...v){for(const $ of _.get(V)||[])$(...v)}function w(V){return o=0,V?g=setTimeout(()=>{P()},V):P(),H}function P(){t=Xe.Running,C("start",y,k)}function F(){if(t=Xe.Completed,x={},C("end",y),t===Xe.Completed)if(a<E){if(a++,M===Qt.Reverse){const V=Object.assign({},f);f=Object.assign({},k),k=V}w(B)}else a=0;return H}const H={getState:function(){return t},easing:function(V){return r=V,n=Vt.Ease,x={},H},duration:function(V){return i=V,H},spring:function(V={}){n=Vt.Spring;const v={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:$,mass:Z,tension:Q,friction:ee,restDelta:L,restSpeed:R,maxSpeed:O,clamp:oe}=Object.assign(Object.assign({},v),V);return s=$,l=Z,d=Q,u=ee,h=L,m=R,c=O,p=oe,x={},H},isRunning:function(){return t===Xe.Running},isSpring:function(){return n===Vt.Spring},from:function(V){return y=Object.assign({},V),H},to:function(V){return k=V,H},repeat:function(V,v=0,$=Qt.Loop,Z){return E=V,B=v,M=$,T=Z||r,H},on:function(V,v){var $,Z;return $=V,Z=v,_.set($,[..._.get($)||[],Z]),H},off:function(V,v){var $,Z;return $=V,Z=v,_.has($)&&_.set($,_.get($).filter(Q=>Q!==Z)),H},start:function(V){return pn(y,k)||(t=Xe.Initializing,f=Object.assign({},y),jn.add(this),Jt||(Jt=window.requestAnimationFrame(Fr)),w(V)),H},pause:function(){return g&&(clearTimeout(g),g=null),t===Xe.Running&&(t=Xe.Paused,C("pause",y)),H},end:F,tick:function(V){V>50&&(V=50),o+=V;let v=0,$=!1;if(t!==Xe.Running)return H;if(n===Vt.Ease){v=Be(0,o/i,1),$=v===1;const Q=M===Qt.Reverse?T:r;for(const ee in y)y[ee]=f[ee]+(k[ee]-f[ee])*Q(v)}if(n===Vt.Spring){const Q=.001*V;let ee=0;for(const L in y){const R=k[L];let O=y[L];if(typeof R!="number"||isNaN(R)||typeof O!="number"||isNaN(O))continue;if(Math.abs(R-O)<=h){y[L]=R,x[L]=0;continue}x[L]||(typeof s=="object"&&typeof s[L]=="number"?x[L]=s[L]:x[L]=typeof s=="number"?s:0);let oe=x[L];oe=Be(-1*Math.abs(c),oe,Math.abs(c));const de=oe*l*u;oe+=((O>R?-1:1)*(Math.abs(R-O)*d)-de)/l*Q,O+=oe*Q;const pe=y[L]>R?O<R:O>R;let ye=Math.abs(oe)<m&&Math.abs(R-O)<=h;p&&pe&&(ye=!0),ye?(O=R,oe=0):ee++,y[L]=O,x[L]=oe}$=!ee}const Z=Object.assign({},k);return C("step",y,f,k,v),$&&t===Xe.Running&&pn(k,Z)&&(t=Xe.Completed,F()),H},getStartValues:function(){return f},getCurrentValues:function(){return y},getCurrentVelocities:function(){return x},getEndValues:function(){return k},destroy:function(){t=Xe.Destroyed,g&&(clearTimeout(g),g=null),f=y=k={},jn.delete(this)}};return H}Mt.destroy=()=>{for(const t of jn)t.destroy();Jt&&(cancelAnimationFrame(Jt),Jt=null)},Mt.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 gn(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}function Da(t,n){const a=[],o=gn(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 Lr(t){return Da(t,"touches")}function $r(t){return Da(t,"targetTouches")}function Pr(t){return Da(t,"changedTouches")}function Nt(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 Gn(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 Or=t=>{t.cancelable&&t.preventDefault()},At={passive:!1},Fd={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let In=!1,yn=!0;const en=(t,n)=>{let a,o,r,i=Object.assign(Object.assign({},Fd),n),s=[],l=[],d=[],u=!1,c=!1,m=!1,h=!1,p=0,f=0,g=0,y=0,k=0,x=0,E=0,B=0,M=0,T=[],_=0,C=0;const w=new Map;function P(L){const R=Gn(l),O=Gn(d),oe=R&&O?R/O:0,de=Math.abs(E)>Math.abs(B)?E:B,pe={srcEvent:a,isPanRecognized:u,isSwipeRecognized:c,firstTouch:s,previousTouch:d,currentTouch:l,deltaX:g,deltaY:y,offsetX:k,offsetY:x,velocityX:E,velocityY:B,velocity:de,angle:M,axis:r,scale:oe,center:o};for(const ye of w.get(L)||[])ye(pe)}function F(L){const R=Date.now();if(T=T.filter(O=>!O.ts||O.ts>R-100),L&&T.push(L),E=0,B=0,T.length>3){const O=T[0],oe=T[T.length-1];if(O&&oe){const de=oe.x-O.x,pe=oe.y-O.y,ye=O.ts&&oe.ts?oe.ts-O.ts:0;ye>0&&(E=Math.abs(de)>3?de/(ye/30):0,B=Math.abs(pe)>3?pe/(ye/30):0)}}}function H(L){if(typeof MouseEvent<"u"&&L instanceof MouseEvent){if(In)return}else In=!0;const R=L.composedPath()[0],O=i.ignore.join(",");if(R.matches(O)||R.closest(O))return;if(typeof MouseEvent<"u"&&L instanceof MouseEvent){if(!L.buttons||L.button!==0)return;Or(L)}L instanceof MouseEvent&&(window.addEventListener("mousemove",V),window.addEventListener("mouseup",v)),window.addEventListener("blur",$),a=L,l=$r(L),s=[...l],d=[],f=l.length,o=Nt(l),f===1&&(u=!1,c=!1,m=!1),f&&F(Nt(l));const oe=Date.now(),de=oe-(p||oe);h=de>0&&de<=250&&f===1,p=oe,clearTimeout(_),P("start")}function V(L){var R;if(!s.length||L.defaultPrevented)return;a=L,d=[...l],l=Lr(L);const O=Nt(d),oe=Nt(Lr(L));if(F(oe),f=l.length,o=oe,d.length===l.length?(g=oe.x-O.x,y=oe.y-O.y):(g=0,y=0),s.length){const de=Nt(s);k=oe.x-de.x,x=oe.y-de.y}if(l.length>1){const de=Gn(l),pe=Gn(d);Math.abs(de-pe)>=.1&&(m=!0,P("pinch"))}u||(u=Math.abs(k)>i.panThreshold||Math.abs(x)>i.panThreshold,u&&(yn=!1,clearTimeout(C),C=0,M=Math.abs(180*Math.atan2(x,k)/Math.PI),r=M>45&&M<135?"y":"x",s=[...l],d=[...l],k=0,x=0,g=0,y=0,(R=window.getSelection())===null||R===void 0||R.removeAllRanges(),P("panstart"))),u&&(g||y)&&P("pan"),P("move")}function v(L){if(a=L,!s.length)return;const R=$r(L),O=Pr(L);if(f=R.length,o=Nt(O),O.length&&F(Nt(O)),d=[...l],l=[...R],s=[...R],f>0)P("end"),u=!1,c=!1,T=[];else{const oe=i.swipeThreshold;(Math.abs(E)>oe||Math.abs(B)>oe)&&(c=!0),u&&P("panend"),c&&P("swipe"),u||c||m||(P("tap"),h?P("doubleTap"):_=setTimeout(function(){P("singleTap")},250)),P("end"),Z()}}function $(){clearTimeout(_),Z(),u&&P("panend"),P("end")}function Z(){In=!1,u=!1,c=!1,h=!1,f=0,T=[],l=[],d=[],s=[],g=0,y=0,k=0,x=0,E=0,B=0,M=0,r=void 0,window.removeEventListener("mousemove",V),window.removeEventListener("mouseup",v),window.removeEventListener("blur",$),yn||C||(C=setTimeout(()=>{yn=!0,C=0},100))}function Q(L){const R=L.target;In=!1,R&&!L.defaultPrevented&&(yn||(Or(L),L.stopPropagation()))}const ee={init:function(){return t&&(t.addEventListener("click",Q,At),t.addEventListener("mousedown",H,At),t.addEventListener("touchstart",H,At),t.addEventListener("touchmove",V,At),t.addEventListener("touchend",v),t.addEventListener("touchcancel",v)),ee},on:function(L,R){return function(O,oe){w.set(O,[...w.get(O)||[],oe])}(L,R),ee},off:function(L,R){return w.has(L)&&w.set(L,w.get(L).filter(O=>O!==R)),ee},isPointerDown:()=>f>0,destroy:function(){clearTimeout(_),clearTimeout(C),C=0,t&&(t.removeEventListener("click",Q,At),t.removeEventListener("mousedown",H,At),t.removeEventListener("touchstart",H,At),t.removeEventListener("touchmove",V,At),t.removeEventListener("touchend",v),t.removeEventListener("touchcancel",v)),t=null,Z()}};return ee};en.isClickAllowed=()=>yn;/*! License details at fancyapps.com/license */const Fa={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 we=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.add(a)})};/*! License details at fancyapps.com/license */const Ke=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.remove(a)})};/*! License details at fancyapps.com/license */const Ye=(t,n="",a)=>{t&&t.classList&&n.split(" ").forEach(o=>{o&&t.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Ht=t=>{t.cancelable&&t.preventDefault()},Qe=(t,n=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*n)/n),kt=t=>t instanceof HTMLImageElement;var ge,_r;(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"})(ge||(ge={})),function(t){t.Cover="cover",t.Full="full",t.Max="max"}(_r||(_r={}));const ft={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},La={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:ge.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:Fa,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:ge.Zoom,width:"auto"};let qn,Hr=0,Rr=0,Wn=0;const $a=(t,n={},a={})=>{let o,r,i,s,l,d,u,c,m=0,h=Object.assign(Object.assign({},La),n),p={},f=Object.assign({},ft),g=Object.assign({},ft);const y=[];function k(D){let I=h[D];return I&&typeof I=="function"?I(ce):I}function x(){return t&&t.parentElement&&o&&m===3}const E=new Map;function B(D,...I){const te=[...E.get(D)||[]];h.on&&te.push(h.on[D]);for(const Y of te)Y&&Y instanceof Function&&Y(ce,...I);D!=="*"&&B("*",D,...I)}function M(D){if(!x())return;const I=D.target;if(_t(I))return;const te=Date.now(),Y=[-D.deltaX||0,-D.deltaY||0,-D.detail||0].reduce(function(se,fe){return Math.abs(fe)>Math.abs(se)?fe:se}),b=Be(-1,Y,1);B("wheel",D,b);const N=k("wheelAction");if(!N||D.defaultPrevented)return;const X=g.scale;let ne=X*(b>0?1.5:.5);if(N===ge.Zoom){const se=Math.abs(D.deltaY)<100&&Math.abs(D.deltaX)<100;if(te-Rr<(se?200:45))return void Ht(D);Rr=te;const fe=Q(),me=O();if(Qe(ne)<Qe(fe)&&Qe(X)<=Qe(fe)?(Wn+=Math.abs(b),ne=fe):Qe(ne)>Qe(me)&&Qe(X)>=Qe(me)?(Wn+=Math.abs(b),ne=me):(Wn=0,ne=Be(fe,ne,me)),Wn>7)return}switch(Ht(D),N){case ge.Pan:ye(N,{srcEvent:D,deltaX:2*-D.deltaX,deltaY:2*-D.deltaY});break;case ge.Zoom:ye(ge.ZoomTo,{srcEvent:D,scale:ne,center:{x:D.clientX,y:D.clientY}});break;default:ye(N,{srcEvent:D})}}function T(D){var I,te;const Y=D.composedPath()[0];if(!en.isClickAllowed()||!Kt(Y)||D.defaultPrevented||!(t!=null&&t.contains(Y))||Y.hasAttribute("disabled")||Y.hasAttribute("aria-disabled"))return;const b=Y.closest("[data-panzoom-action]"),N=(I=b==null?void 0:b.dataset)===null||I===void 0?void 0:I.panzoomAction,X=((te=b==null?void 0:b.dataset)===null||te===void 0?void 0:te.panzoomValue)||"";if(N){switch(Ht(D),N){case ge.ZoomTo:case ge.ZoomIn:case ge.ZoomOut:ye(N,{scale:parseFloat(X||"")||void 0});break;case ge.MoveLeft:case ge.MoveRight:ye(N,{deltaX:parseFloat(X||"")||void 0});break;case ge.MoveUp:case ge.MoveDown:ye(N,{deltaY:parseFloat(X||"")||void 0});break;case ge.ToggleFS:ae();break;default:ye(N)}return}if(!(o!=null&&o.contains(Y)))return;const ne={srcEvent:D};if(ye(k("clickAction"),ne),k("dblClickAction")){const se=Date.now(),fe=se-(Hr||se);Hr=se,fe>0&&fe<=250?(qn&&(clearTimeout(qn),qn=void 0),ye(k("dblClickAction"),ne)):qn=setTimeout(()=>{ye(k("singleClickAction"),ne)},250)}}function _(D){if(c=D,!x()||!v()||f.scale<=1||g.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const I=$(g.scale);if(!I)return;const{x:te,y:Y}=I;ye(ge.Pan,{deltaX:te-g.x,deltaY:Y-g.y})}function C(){var D;t&&(Ke(t,"is-loading"),(D=t.querySelector(".f-spinner"))===null||D===void 0||D.remove())}function w(){if(!t||!r)return;if(C(),kt(r)&&(!r.complete||!r.naturalWidth))return m=2,o==null||o.classList.add("has-error"),void B("error");B("loaded");const{width:D,height:I}=H();kt(r)&&(r.setAttribute("width",D+""),r.setAttribute("height",I+"")),o&&(Ke(o,"has-error"),kt(r)&&(o.setAttribute("width",D+""),o.setAttribute("height",I+""),o.style.aspectRatio=`${D/I||""}`)),d=Mt().on("start",(Y,b)=>{b.angle!==void 0&&(b.angle=90*Math.round(b.angle/90)),b.flipX!==void 0&&(b.flipX=b.flipX>0?1:-1),b.flipY!==void 0&&(b.flipY=b.flipY>0?1:-1),g=Object.assign(Object.assign({},ft),b),pe(),B("animationStart")}).on("pause",Y=>{g=Object.assign(Object.assign({},ft),Y)}).on("step",Y=>{if(!x())return void(d==null||d.end());if(f=Object.assign(Object.assign({},ft),Y),v()||!k("bounds")||q()||g.scale>f.scale||g.scale<ee())return void Ve();const b=oe(g.scale);let N=!1,X=!1,ne=!1,se=!1;f.x<b.x[0]&&(N=!0),f.x>b.x[1]&&(X=!0),f.y<b.y[0]&&(se=!0),f.y>b.y[1]&&(ne=!0);let fe=!1,me=!1,be=!1,ve=!1;g.x<b.x[0]&&(fe=!0),g.x>b.x[1]&&(me=!0),g.y<b.y[0]&&(ve=!0),g.y>b.y[1]&&(be=!0);let Fe=!1;(X&&me||N&&fe)&&(g.x=Be(b.x[0],g.x,b.x[1]),Fe=!0),(ne&&be||se&&ve)&&(g.y=Be(b.y[0],g.y,b.y[1]),Fe=!0),Fe&&d&&d.spring({tension:94,friction:17,maxSpeed:555*g.scale,restDelta:.1,restSpeed:.1,velocity:d.getCurrentVelocities()}).from(f).to(g).start(),Ve()}).on("end",()=>{l!=null&&l.isPointerDown()||de(),d!=null&&d.isRunning()||(pe(),B("animationEnd"))}),function(){const Y=k("gestures");if(!Y||!s||!r)return;let b=!1;l=en(s,Y).on("start",N=>{if(!k("gestures")||!d||!x()||v())return;const X=N.srcEvent;(f.scale>1||N.currentTouch.length>1)&&(X==null||X.stopPropagation(),d.pause(),b=!0),N.currentTouch.length===1&&B("touchStart")}).on("move",N=>{var X;b&&(g.scale!==1||N.currentTouch.length>1)&&(Ht(N.srcEvent),(X=N.srcEvent)===null||X===void 0||X.stopPropagation())}).on("pan",N=>{if(!b)return;const X=N.srcEvent;(g.scale!==1||N.currentTouch.length>1)&&(Ht(X),ye(ge.Pan,N))}).on("swipe",N=>{b&&g.scale>1&&ye(ge.Swipe,N)}).on("tap",N=>{B("click",N)}).on("singleTap",N=>{B("singleClick",N)}).on("doubleTap",N=>{B("dblClick",N)}).on("pinch",N=>{b&&(N.scale>ee()?ye(ge.ZoomIn,N):N.scale<ee()?ye(ge.ZoomOut,N):ye(ge.Pan,N))}).on("end",N=>{b&&(N.currentTouch.length?(N.srcEvent.stopPropagation(),Ht(N.srcEvent),d==null||d.end()):(b=!1,pe(),de(),B("touchEnd")))}).init()}(),s&&(s.addEventListener("wheel",M,{passive:!1}),y.push(()=>{s==null||s.removeEventListener("wheel",M,{passive:!1})})),t==null||t.addEventListener("click",T),document==null||document.addEventListener("mousemove",_),y.push(()=>{t==null||t.removeEventListener("click",T),document==null||document.removeEventListener("mousemove",_)});const te=P();f=Object.assign({},te),g=Object.assign({},te),m=3,Ve(),pe(),B("ready"),requestAnimationFrame(()=>{C(),s&&(s.style.visibility="")})}function P(){const D=Object.assign({},k("startPos")||{});let I=D.scale,te=1;te=typeof I=="string"?Z(I):typeof I=="number"?I:ee();const Y=Object.assign(Object.assign(Object.assign({},ft),D),{scale:te}),b=v()?$(te):void 0;if(b){const{x:N,y:X}=b;Y.x=N,Y.y=X}return Y}function F(){const D={top:0,left:0,width:0,height:0};if(o){const I=o.getBoundingClientRect();g.angle%180==90?(D.top=I.top+.5*I.height-.5*I.width,D.left=I.left+.5*I.width-.5*I.height,D.width=I.height,D.height=I.width):(D.top=I.top,D.left=I.left,D.width=I.width,D.height=I.height)}return D}function H(){let D=k("width"),I=k("height");if(r&&D==="auto"){const te=r.getAttribute("width");D=te?parseFloat(te+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):kt(s)?s.naturalWidth:kt(r)?r.naturalWidth:(o==null?void 0:o.getBoundingClientRect().width)||0}else D=Te(D)?parseFloat(D):D;if(r&&I==="auto"){const te=r.getAttribute("height");I=te?parseFloat(te+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):kt(s)?s.naturalHeight:kt(r)?r.naturalHeight:(o==null?void 0:o.getBoundingClientRect().height)||0}else I=Te(I)?parseFloat(I):I;return{width:D,height:I}}function V(){const D=F();return{width:D.width,height:D.height}}function v(){return k("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function $(D){const I=c||k("event"),te=o==null?void 0:o.getBoundingClientRect();if(!I||!te||D<=1)return{x:0,y:0};const Y=(I.clientX||0)-te.left,b=(I.clientY||0)-te.top,{width:N,height:X}=V(),ne=oe(D);if(D>1){const ve=k("mouseMoveFactor");ve>1&&(D*=ve)}let se=N*D,fe=X*D,me=.5*(se-N)-Y/N*100/100*(se-N),be=.5*(fe-X)-b/X*100/100*(fe-X);return me=Be(ne.x[0],me,ne.x[1]),be=Be(ne.y[0],be,ne.y[1]),{x:me,y:be}}function Z(D="base"){if(!t)return 1;const I=t.getBoundingClientRect(),te=F(),{width:Y,height:b}=H(),N=me=>{if(typeof me=="number")return me;switch(me){case"min":case"base":return 1;case"cover":return Math.max(I.height/te.height,I.width/te.width)||1;case"full":case"max":{const be=g.angle%180==90?b:Y;return be&&te.width?be/te.width:1}}},X=k("minScale"),ne=k("maxScale"),se=Math.min(N("full"),N(X)),fe=typeof ne=="number"?N("full")*ne:Math.min(N("full"),N(ne));switch(D){case"min":return se;case"base":return Be(se,1,fe);case"cover":return N("cover");case"full":return Math.min(fe,N("full"));case"max":return fe}}function Q(){return Z("min")}function ee(){return Z("base")}function L(){return Z("cover")}function R(){return Z("full")}function O(){return Z("max")}function oe(D){const I={x:[0,0],y:[0,0]},te=t==null?void 0:t.getBoundingClientRect();if(!te)return I;const Y=F(),b=te.width,N=te.height;let X=Y.width,ne=Y.height,se=D=D===void 0?g.scale:D,fe=D;if(v()&&D>1){const me=k("mouseMoveFactor");me>1&&(X*D>b+.01&&(se*=me),ne*D>N+.01&&(fe*=me))}return X*=se,ne*=fe,D>1&&(X>b&&(I.x[0]=.5*(b-X),I.x[1]=.5*(X-b)),I.x[0]-=.5*(Y.left-te.left),I.x[1]-=.5*(Y.left-te.left),I.x[0]-=.5*(Y.left+Y.width-te.right),I.x[1]-=.5*(Y.left+Y.width-te.right),ne>N&&(I.y[0]=.5*(N-ne),I.y[1]=.5*(ne-N)),I.y[0]-=.5*(Y.top-te.top),I.y[1]-=.5*(Y.top-te.top),I.y[0]-=.5*(Y.top+Y.height-te.bottom),I.y[1]-=.5*(Y.top+Y.height-te.bottom)),I}function de(){if(!x()||!k("bounds")||!d)return;const D=Q(),I=O(),te=Be(D,g.scale,I);if(g.scale<D-.01||g.scale>I+.01)return void ye(ge.ZoomTo,{scale:te});if(d.isRunning()||q())return;const Y=oe(te);g.x<Y.x[0]||g.x>Y.x[1]||g.y<Y.y[0]||g.y>Y.y[1]?(g.x=Be(Y.x[0],g.x,Y.x[1]),g.y=Be(Y.y[0],g.y,Y.y[1]),d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:d.getCurrentVelocities()}),d.from(f).to(g).start()):Ve()}function pe(D){var I;if(!x())return;const te=ze(),Y=q(),b=re(),N=he(),X=Ae(),ne=qe();Ye(o,"is-fullsize",N),Ye(o,"is-expanded",b),Ye(o,"is-dragging",Y),Ye(o,"can-drag",te),Ye(o,"will-zoom-in",X),Ye(o,"will-zoom-out",ne);const se=$e(),fe=Oe(),me=_e(),be=!x();for(const ve of((I=D||t)===null||I===void 0?void 0:I.querySelectorAll("[data-panzoom-action]"))||[]){const Fe=ve.dataset.panzoomAction;let xe=!1;if(be)xe=!0;else switch(Fe){case ge.ZoomIn:se||(xe=!0);break;case ge.ZoomOut:me||(xe=!0);break;case ge.ToggleFull:{fe||me||(xe=!0);const S=ve.querySelector("g");S&&(S.style.display=N&&!xe?"none":"");break}case ge.IterateZoom:{se||me||(xe=!0);const S=ve.querySelector("g");S&&(S.style.display=se||xe?"":"none");break}case ge.ToggleCover:case ge.ToggleMax:se||me||(xe=!0)}xe?(ve.setAttribute("aria-disabled",""),ve.setAttribute("tabindex","-1")):(ve.removeAttribute("aria-disabled"),ve.removeAttribute("tabindex"))}}function ye(D,I){var te;if(!(D&&t&&r&&d&&x())||D===ge.Swipe&&Math.abs(d.getCurrentVelocities().scale)>.01)return;const Y=Object.assign({},g);let b=Object.assign({},g),N=oe(v()?Y.scale:f.scale);const X=d.getCurrentVelocities(),ne=F(),se=(((te=(I=I||{}).currentTouch)===null||te===void 0?void 0:te.length)||0)>1,fe=I.velocityX||0,me=I.velocityY||0;let be=I.center;I.srcEvent&&(be=Nt(Pr(I.srcEvent)));let ve=I.deltaX||0,Fe=I.deltaY||0;switch(D){case ge.MoveRight:ve=I.deltaX||100;break;case ge.MoveLeft:ve=I.deltaX||-100;break;case ge.MoveUp:Fe=I.deltaY||-100;break;case ge.MoveDown:Fe=I.deltaY||100}let xe=[];switch(D){case ge.Reset:b=Object.assign({},ft),b.scale=ee();break;case ge.Pan:case ge.Move:case ge.MoveLeft:case ge.MoveRight:case ge.MoveUp:case ge.MoveDown:if(q()){let j=1,A=1;b.x<=N.x[0]&&fe<=0&&(j=Math.max(.01,1-Math.abs(1/ne.width*Math.abs(b.x-N.x[0]))),j*=.2),b.x>=N.x[1]&&fe>=0&&(j=Math.max(.01,1-Math.abs(1/ne.width*Math.abs(b.x-N.x[1]))),j*=.2),b.y<=N.y[0]&&me<=0&&(A=Math.max(.01,1-Math.abs(1/ne.height*Math.abs(b.y-N.y[0]))),A*=.2),b.y>=N.y[1]&&me>=0&&(A=Math.max(.01,1-Math.abs(1/ne.height*Math.abs(b.y-N.y[1]))),A*=.2),b.x+=ve*j,b.y+=Fe*A}else b.x=Be(N.x[0],b.x+ve,N.x[1]),b.y=Be(N.y[0],b.y+Fe,N.y[1]);break;case ge.Swipe:const S=(j=0)=>Math.sign(j)*Math.pow(Math.abs(j),1.5);b.x+=Be(-1e3,S(fe),1e3),b.y+=Be(-1e3,S(me),1e3),me&&!fe&&(b.x=Be(N.x[0],b.x,N.x[1])),!me&&fe&&(b.y=Be(N.y[0],b.y,N.y[1])),X.x=fe,X.y=me;break;case ge.ZoomTo:b.scale=I.scale||1;break;case ge.ZoomIn:b.scale=b.scale*(I.scale||2),se||(b.scale=Math.min(b.scale,O()));break;case ge.ZoomOut:b.scale=b.scale*(I.scale||.5),se||(b.scale=Math.max(b.scale,Q()));break;case ge.ToggleCover:xe=[ee(),L()];break;case ge.ToggleFull:xe=[ee(),R()];break;case ge.ToggleMax:xe=[ee(),O()];break;case ge.IterateZoom:xe=[ee(),R(),O()];break;case ge.Zoom:const z=R();b.scale>=z-.05?b.scale=ee():b.scale=Math.min(z,b.scale*(I.scale||2));break;case ge.RotateCW:b.angle+=90;break;case ge.RotateCCW:b.angle-=90;break;case ge.FlipX:b.flipX*=-1;break;case ge.FlipY:b.flipY*=-1}if(f.angle!==void 0&&Math.abs(f.angle)>=360&&(b.angle-=360*Math.floor(f.angle/360),f.angle-=360*Math.floor(f.angle/360)),xe.length){const S=xe.findIndex(z=>z>b.scale+1e-4);b.scale=xe[S]||xe[0]}if(se&&(b.scale=Be(Q()*(se?.8:1),b.scale,O()*(se?1.6:1))),v()){const S=$(b.scale);if(S){const{x:z,y:j}=S;b.x=z,b.y=j}}else if(Math.abs(b.scale-Y.scale)>1e-4){let S=0,z=0;if(be)S=be.x,z=be.y;else{const J=t.getBoundingClientRect();S=J.x+.5*J.width,z=J.y+.5*J.height}let j=S-ne.left,A=z-ne.top;j-=.5*ne.width,A-=.5*ne.height;const G=(j-Y.x)/Y.scale,W=(A-Y.y)/Y.scale;b.x=j-G*b.scale,b.y=A-W*b.scale,!se&&k("bounds")&&(N=oe(b.scale),b.x=Be(N.x[0],b.x,N.x[1]),b.y=Be(N.y[0],b.y,N.y[1]))}if(D===ge.Swipe){let S=94,z=17,j=500*b.scale,A=X;d.spring({tension:S,friction:z,maxSpeed:j,restDelta:.1,restSpeed:.1,velocity:A})}else D===ge.Pan||se?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:X});if(I.velocity===0||pn(f,b))f=Object.assign({},b),g=Object.assign({},b),d.end(),Ve(),pe();else{if(pn(g,b))return;d.from(f).to(b).start()}B("action",D)}function Ve(){if(!r||!o||!s)return;const{width:D,height:I}=H();Object.assign(o.style,{maxWidth:`min(${D}px, 100%)`,maxHeight:`min(${I}px, 100%)`});const te=function(){const{width:ve,height:Fe}=H(),{width:xe,height:S}=V();if(!t)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:xe,fitHeight:S,fullWidth:ve,fullHeight:Fe};let{x:z,y:j,scale:A,angle:G,flipX:W,flipY:J}=f,ie=1/R(),ue=ve,le=Fe,ke=f.scale*ie,Ee=g.scale*ie;const Me=Math.max(xe,S),Ne=Math.min(xe,S);ve>Fe?(ue=Me,le=Ne):(ue=Ne,le=Me),ke=ve>Fe?Me*A/ve||1:Me*A/Fe||1;let je=ue?ve*Ee:0,it=le?Fe*Ee:0,st=ue&&le?ve*ke/je:0;return z=z+.5*ue-.5*je,j=j+.5*le-.5*it,{x:z,y:j,width:je,height:it,scale:st,flipX:W,flipY:J,angle:G,fitWidth:xe,fitHeight:S,fullWidth:ve,fullHeight:Fe}}(),{x:Y,y:b,width:N,height:X,scale:ne,angle:se,flipX:fe,flipY:me}=te;let be=`translate(${Qe(Y)}px, ${Qe(b)}px)`;be+=fe!==1||me!==1?` scaleX(${Qe(ne*fe)}) scaleY(${Qe(ne*me)})`:` scale(${Qe(ne)})`,se!==0&&(be+=` rotate(${se}deg)`),s.style.width=`${Qe(N)}px`,s.style.height=`${Qe(X)}px`,s.style.transform=`${be}`,B("render")}function Le(){let D=g.scale;const I=k("clickAction");let te=ee();if(I){let Y=[];switch(I){case ge.ZoomIn:te=2*D;break;case ge.ZoomOut:te=.5*D;break;case ge.ToggleCover:Y=[ee(),L()];break;case ge.ToggleFull:Y=[ee(),R()];break;case ge.ToggleMax:Y=[ee(),O()];break;case ge.IterateZoom:Y=[ee(),R(),O()];break;case ge.Zoom:const b=R();te=D>=b-.05?ee():Math.min(b,2*D)}if(Y.length){const b=Y.findIndex(N=>N>D+1e-4);te=Y[b]||ee()}}return te=Be(Q(),te,O()),te}function Ae(){return!!(x()&&Le()>g.scale)}function qe(){return!!(x()&&Le()<g.scale)}function _e(){return!!(x()&&g.scale>Q())}function $e(){return!!(x()&&g.scale<O())}function Oe(){return!!(x()&&g.scale<R())}function ze(){return!(!(x()&&re()&&l)||v())}function q(){return!(!x()||!(l!=null&&l.isPointerDown())||v())}function re(){return!!(x()&&g.scale>ee())}function he(){return!!(x()&&g.scale>=R())}function ae(){const D="in-fullscreen",I="with-panzoom-in-fullscreen";t==null||t.classList.toggle(D);const te=t==null?void 0:t.classList.contains(D);te?(document.documentElement.classList.add(I),document.addEventListener("keydown",K,!0)):(document.documentElement.classList.remove(I),document.removeEventListener("keydown",K,!0)),Ve(),B(te?"enterFS":"exitFS")}function K(D){D.key!=="Escape"||D.defaultPrevented||ae()}const ce={canDrag:ze,canZoomIn:$e,canZoomOut:_e,canZoomToFull:Oe,destroy:function(){B("destroy");for(const D of Object.values(p))D==null||D.destroy(ce);for(const D of y)D();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,f=Object.assign({},ft),g=Object.assign({},ft),d==null||d.destroy(),d=void 0,l==null||l.destroy(),l=void 0,m=4,ce},emit:B,execute:ye,getBoundaries:oe,getContainer:function(){return t},getContent:function(){return r},getFullDim:H,getGestures:function(){return l},getMousemovePos:$,getOptions:function(){return h},getPlugins:function(){return p},getScale:Z,getStartPosition:P,getState:function(){return m},getTransform:function(D){return D===!0?g:f},getTween:function(){return d},getViewport:function(){return s},getWrapper:function(){return o},init:function(){return m=0,B("init"),function(){for(const[D,I]of Object.entries(Object.assign(Object.assign({},a),h.plugins||{})))if(D&&!p[D]&&I instanceof Function){const te=I();te.init(ce),p[D]=te}B("initPlugins")}(),function(){const D=Object.assign(Object.assign({},La.classes),k("classes"));if(t&&(we(t,D.container),r=t.querySelector("."+D.content),!!r)){if(r.setAttribute("draggable","false"),o=t.querySelector("."+D.wrapper),o||(o=document.createElement("div"),we(o,D.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),s=t.querySelector("."+D.viewport),s||(s=document.createElement("div"),we(s,D.viewport),s.insertAdjacentElement("afterbegin",r),o.insertAdjacentElement("beforeend",s)),i=r.cloneNode(!0),i.removeAttribute("id"),o.insertAdjacentElement("afterbegin",i),r instanceof HTMLPictureElement&&(r=r.querySelector("img")),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),s instanceof HTMLPictureElement&&(s=s.querySelector("img")),s&&(s.style.visibility="hidden",k("protected"))){s.addEventListener("contextmenu",te=>{Ht(te)});const I=document.createElement("div");we(I,"f-panzoom__protected"),s.appendChild(I)}B("initLayout")}}(),function(){if(t&&o&&!u){let D=null;u=new ResizeObserver(()=>{x()&&(D=D||requestAnimationFrame(()=>{x()&&(pe(),de(),B("refresh")),D=null}))}),u.observe(o),y.push(()=>{u==null||u.disconnect(),u=void 0,D&&(cancelAnimationFrame(D),D=null)})}}(),function(){if(!t||!r)return;if(!kt(r)||!kt(i))return void w();const D=()=>{r&&kt(r)&&r.decode().then(()=>{w()}).catch(()=>{w()})};if(m=1,t.classList.add("is-loading"),B("loading"),i.src&&i.complete)return void D();(function(){if(!t||t!=null&&t.querySelector(".f-spinner"))return;const I=k("spinnerTpl"),te=wt(I);te&&(te.classList.add("f-spinner"),t.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",te))})(),i.addEventListener("load",D,!1),i.addEventListener("error",D,!1),y.push(()=>{i==null||i.removeEventListener("load",D,!1),i==null||i.removeEventListener("error",D,!1)})}(),ce},isDragging:q,isExpanded:re,isFullsize:he,isMousemoveMode:v,localize:function(D,I=[]){const te=k("l10n")||{};D=String(D).replace(/\{\{(\w+)\}\}/g,(Y,b)=>te[b]||Y);for(let Y=0;Y<I.length;Y++)D=D.split(I[Y][0]).join(I[Y][1]);return D=D.replace(/\{\{(.*?)\}\}/g,(Y,b)=>b)},off:function(D,I){for(const te of D instanceof Array?D:[D])E.has(te)&&E.set(te,E.get(te).filter(Y=>Y!==I));return ce},on:function(D,I){for(const te of D instanceof Array?D:[D])E.set(te,[...E.get(te)||[],I]);return ce},toggleFS:ae,updateControls:pe,version:"6.1.3",willZoomIn:Ae,willZoomOut:qe};return ce};$a.l10n={en_EN:Fa},$a.getDefaults=()=>La;/*! License details at fancyapps.com/license */const Pa=(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 nt=(t,...n)=>{const a=n.length;for(let o=0;o<a;o++){const r=n[o]||{};Object.entries(r).forEach(([i,s])=>{const l=Array.isArray(s)?[]:{};t[i]||Object.assign(t,{[i]:l}),Ze(s)?Object.assign(t[i],nt(t[i],s)):Array.isArray(s)?Object.assign(t,{[i]:[...s]}):Object.assign(t,{[i]:s})})}return t};/*! License details at fancyapps.com/license */const Un=function(t=0,n=0,a=0,o=0,r=0,i=!1){const s=(t-n)/(a-n)*(r-o)+o;return i?o<r?Be(o,s,r):Be(r,s,o):s};/*! License details at fancyapps.com/license */const Oa=Object.assign(Object.assign({},Fa),{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 Rt=t=>{t.cancelable&&t.preventDefault()},tn={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:Oa,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 zr,jr=0;const Zn=(t,n={},a={})=>{jr++;let o,r,i,s,l,d=0,u=Object.assign({},tn),c=Object.assign({},tn),m={},h=null,p=null,f=!1,g=!1,y=!1,k=!1,x="height",E=0,B=!0,M=0,T=0,_=0,C=0,w="*",P=[],F=[];const H=new Set;let V=[],v=[],$=0,Z=0,Q=0;function ee(S,...z){let j=c[S];return j&&j instanceof Function?j(xe,...z):j}function L(S,z=[]){const j=ee("l10n")||{};S=String(S).replace(/\{\{(\w+)\}\}/g,(A,G)=>j[G]||A);for(let A=0;A<z.length;A++)S=S.split(z[A][0]).join(z[A][1]);return S=S.replace(/\{\{(.*?)\}\}/g,(A,G)=>G)}const R=new Map;function O(S,...z){const j=[...R.get(S)||[]];c.on&&j.push(c.on[S]);for(const A of j)A&&A instanceof Function&&A(xe,...z);S!=="*"&&O("*",S,...z)}function oe(){var S,z;const j=nt({},tn,u);nt(j,tn,u);let A="";const G=u.breakpoints||{};if(G)for(const[W,J]of Object.entries(G))window.matchMedia(W).matches&&(A+=W,nt(j,J));if(l===void 0||A!==l){if(l=A,d!==0){let W=(z=(S=v[M])===null||S===void 0?void 0:S.slides[0])===null||z===void 0?void 0:z.index;W===void 0&&(W=c.initialSlide),j.initialSlide=W,j.slides=[];for(const J of P)J.isVirtual&&j.slides.push(J)}be(),c=j,ee("enabled")!==!1&&(d=0,O("init"),function(){for(const[W,J]of Object.entries(Object.assign(Object.assign({},a),c.plugins||{})))if(W&&!m[W]&&J instanceof Function){const ie=J();ie.init(xe,Zn),m[W]=ie}O("initPlugins")}(),function(){if(!h)return;const W=ee("classes")||{};we(h,W.container);const J=ee("style");if(J&&Ze(J))for(const[ie,ue]of Object.entries(J))h.style.setProperty(ie,ue);p=h.querySelector(`.${W.viewport}`),p||(p=document.createElement("div"),we(p,W.viewport),p.append(...Pa(h,`.${W.slide}`)),h.insertAdjacentElement("afterbegin",p)),h.carousel=xe,O("initLayout")}(),function(){if(!p)return;const W=ee("classes")||{};P=[],[...Pa(p,`.${W.slide}`)].forEach(J=>{if(J.parentElement){const ie=re(Object.assign({el:J,isVirtual:!1},J.dataset||{}));O("createSlide",ie),P.push(ie)}}),ce();for(const J of P)O("addSlide",J);q(ee("slides"));for(const J of P){const ie=J.el;(ie==null?void 0:ie.parentElement)===p&&(we(ie,c.classes.slide),we(ie,J.class),ne(J),O("attachSlideEl",J))}O("initSlides")}(),D(),d=1,we(h,(ee("classes")||{}).isEnabled||""),me(),Le(),r=Mt().on("start",()=>{o&&o.isPointerDown()||(Ve(),me())}).on("step",W=>{const J=E;E=W.pos,E!==J&&(B=!1,me())}).on("end",W=>{o!=null&&o.isPointerDown()||(E=W.pos,r&&!g&&(E<_||E>C)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Be(_,E,C)}).start():B||(B=!0,O("settle")))}),pe(),function(){if(!h||!p)return;h.addEventListener("click",b,{passive:!1}),document.addEventListener("mousemove",de);const W=p.getBoundingClientRect();if($=W.height,Z=W.width,!i){let J=null;i=new ResizeObserver(()=>{J||(J=requestAnimationFrame(()=>{(function(){if(d!==1||!p)return;const ie=v.length,ue=p.getBoundingClientRect(),le=ue.height,ke=ue.width;ie>1&&(k&&Math.abs(le-$)<.5||!k&&Math.abs(ke-Z)<.5)||(D(),pe(),$=le,Z=ke,k&&!le||!k&&!ke||h&&p&&(ie===v.length&&(o!=null&&o.isPointerDown())||(ee("dragFree")&&(g||E>_&&E<C)?(Ve(),me()):se(M,{transition:!1}))))})(),J=null}))}),i.observe(p)}}(),O("ready"))}}function de(S){zr=S}function pe(){ee("gestures")===!1?o&&(o.destroy(),o=void 0):o||function(){const S=ee("gestures");!o&&S!==!1&&p&&(o=en(p,S).on("start",z=>{var j,A;if(!r)return;const{srcEvent:G}=z;k&&gn(G)&&!_t(G.target)&&Rt(G),r.pause(),r.getCurrentVelocities().pos=0;const W=(j=v[M])===null||j===void 0?void 0:j.slides[0];W&&H.has(W.index)&&W.el&&(E=W.offset||0,E+=(function(J){const ie=window.getComputedStyle(J),ue=new DOMMatrixReadOnly(ie.transform);return{width:ue.m41||0,height:ue.m42||0}}(W.el)[x]||0)*(y&&!k?1:-1)),te(),g||(E<_||E>C)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:((A=r.getCurrentVelocities())===null||A===void 0?void 0:A.pos)||0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Be(_,E,C)}).start()}).on("move",z=>{var j,A;const{srcEvent:G,axis:W}=z,J=G.target;if(W||(Rt(G),G.stopPropagation(),G.stopImmediatePropagation()),(W==="y"&&k||W==="x"&&!k)&&(Rt(G),G.stopPropagation()),!W)return;const{deltaX:ie,deltaY:ue}=z;if(!r||gn(G)&&((j=G.touches)===null||j===void 0?void 0:j.length)>1||W==="y"&&!k||W==="x"&&k||J&&_t(J)&&(W!=="x"||k))return;const le=y&&!k?1:-1;let ke=k?ue:ie,Ee=r!=null&&r.isRunning()?r.getEndValues().pos:E,Me=1;g||(Ee<=_&&ke*le<0?(Me=Math.max(.01,1-(Math.abs(1/$e()*Math.abs(Ee-_))||0)),Me*=.2):Ee>=C&&ke*le>0&&(Me=Math.max(.01,1-(Math.abs(1/$e()*Math.abs(Ee-C))||0)),Me*=.2)),Ee+=ke*Me*le,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:((A=r.getCurrentVelocities())===null||A===void 0?void 0:A.pos)||0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Ee}).start()}).on("panstart",z=>{(z==null?void 0:z.axis)===(k?"y":"x")&&we(p,"is-dragging")}).on("panend",()=>{Ke(p,"is-dragging")}).on("end",z=>{var j,A;const{srcEvent:G,axis:W,velocityX:J,velocityY:ie,currentTouch:ue}=z;if(ue.length>0||!r)return;const le=G.target,ke=le&&_t(le)&&!(W==="x"&&!k);k&&gn(G)&&!z.axis&&b(G);const Ee=v.length,Me=ee("dragFree");if(!Ee)return;const Ne=ee("vertical")?ie:J;let je=r!=null&&r.isRunning()?r.getEndValues().pos:E;const it=y&&!k?1:-1;if(ke||(je+=Ne*(Me?5:1)*it),!g&&(Ne*it<=0&&je<_||Ne*it>=0&&je>C)){let lt=0;return Math.abs(Ne)>0&&(lt=2*Math.abs(Ne),lt=Math.min(.3*$e(),lt)),je=Be(_+-1*lt,je,C+lt),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*Ne,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:je}).start()}if(Me||!((j=m.Autoscroll)===null||j===void 0)&&j.isEnabled())return void(Math.abs(Ne)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*Ne,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:je}).start():r.isRunning()||B||(B=!0,O("settle")));if(!Me&&!(!((A=m.Autoscroll)===null||A===void 0)&&A.isEnabled())&&(!z.offsetX&&!z.offsetY||W==="y"&&!k||W==="x"&&k))return void se(M,{transition:"tween"});let st=qe(je);Math.abs(Ne)>10&&st===M&&(st+=Ne>0?y&&!k?1:-1:y&&!k?-1:1),se(st,{transition:"tween",tween:{velocity:-1*Ne}})}).init())}(),Ye(p,"is-draggable",!!o&&v.length>0)}function ye(S="*"){var z;const j=[];for(const A of P)(S==="*"||A.class&&A.class.includes(S)||A.el&&(!((z=A.el)===null||z===void 0)&&z.classList.contains(S)))&&j.push(A);s=void 0,w=S,F=[...j]}function Ve(){if(!r)return;const S=qe(r!=null&&r.isRunning()?r.getEndValues().pos:E);S!==M&&(s=M,M=S,ne(),Le(),Ae(),O("change",M,s))}function Le(){var S,z;if(!h)return;for(const G of h.querySelectorAll("[data-carousel-index]"))G.innerHTML=M+"";for(const G of h.querySelectorAll("[data-carousel-page]"))G.innerHTML=M+1+"";for(const G of h.querySelectorAll("[data-carousel-pages]"))G.innerHTML=v.length+"";for(const G of h.querySelectorAll("[data-carousel-go-to]"))parseInt(((S=G.dataset)===null||S===void 0?void 0:S.carouselGoTo)||"-1",10)===M?G.setAttribute("aria-current","true"):G.removeAttribute("aria-current");for(const G of h.querySelectorAll("[data-carousel-go-prev]"))G.toggleAttribute("aria-disabled",!ve()),ve()?G.removeAttribute("tabindex"):G.setAttribute("tabindex","-1");for(const G of h.querySelectorAll("[data-carousel-go-next]"))G.toggleAttribute("aria-disabled",!Fe()),Fe()?G.removeAttribute("tabindex"):G.setAttribute("tabindex","-1");let j=!1;const A=(z=v[M])===null||z===void 0?void 0:z.slides[0];A&&(A.downloadSrc||A.type==="image"&&A.src)&&(j=!0);for(const G of h.querySelectorAll("[data-carousel-download]"))G.toggleAttribute("aria-disabled",!j)}function Ae(S){var z;S||(S=(z=v[M])===null||z===void 0?void 0:z.slides[0]);const j=S==null?void 0:S.el;if(j)for(const A of j.querySelectorAll("[data-slide-index]"))A.innerHTML=S.index+1+""}function qe(S){var z,j,A;if(!v.length)return 0;const G=Oe();let W=S;g?W-=Math.floor((S-((z=v[0])===null||z===void 0?void 0:z.pos))/G)*G||0:W=Be((j=v[0])===null||j===void 0?void 0:j.pos,S,(A=v[v.length-1])===null||A===void 0?void 0:A.pos);const J=new Map;let ie=0;for(const le of v){const ke=Math.abs(le.pos-W),Ee=Math.abs(le.pos-W-G),Me=Math.abs(le.pos-W+G),Ne=Math.min(ke,Ee,Me);J.set(ie,Ne),ie++}const ue=J.size>0?[...J.entries()].reduce((le,ke)=>ke[1]<le[1]?ke:le):[M,0];return parseInt(ue[0])}function _e(){return Q}function $e(){let S=0;return p&&(p.childElementCount||(p.style.display="grid"),S=p.getBoundingClientRect()[x]||0,p.style.display=""),S}function Oe(S=!0){return F.length?F.reduce((z,j)=>z+j.dim,0)+(F.length-(g&&S?0:1))*Q:0}function ze(S){const z=Oe(),j=$e();if(!z||!p||!j)return[];const A=[];S=S===void 0?E:S,g&&(S-=Math.floor(S/z)*z||0);let G=0,W=0;if(f){const ie=p.getBoundingClientRect();G=Math.abs(ie[k?"top":"left"]),W=Math.abs(window[k?"innerHeight":"innerWidth"]-ie[k?"bottom":"right"])}let J=0;for(let ie of F){const ue=(le=0)=>{A.indexOf(ie)>-1||(ie.pos=J-S+le||0,ie.offset+le>S-ie.dim-G+.51&&ie.offset+le<S+j+W-.51&&A.push(ie))};ie.offset=J,g&&(ue(z),ue(-1*z)),ue(),J+=ie.dim+Q}return A}function q(S,z){const j=[];for(const A of Array.isArray(S)?S:[S]){const G=re(Object.assign(Object.assign({},A),{isVirtual:!0}));G.el||(G.el=document.createElement("div")),O("createSlide",G),j.push(G)}P.splice(z===void 0?P.length:z,0,...j),ce();for(const A of j)O("addSlide",A),he(A);return ye(w),j}function re(S){return(Te(S)||S instanceof HTMLElement)&&(S={html:S}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},S)}function he(S){let z=S.el;if(!S||!z)return;const j=S.html?S.html instanceof HTMLElement?S.html:wt(S.html):void 0;j&&(we(j,"f-html"),S.htmlEl=j,we(z,"has-html"),z.append(j),O("contentReady",S))}function ae(S){if(!p||!S)return;let z=S.el;if(z){if(z.setAttribute("index",S.index+""),z.parentElement!==p){let j;we(z,c.classes.slide),we(z,S.class),ne(S);for(const A of P)if(A.index>S.index){j=A.el;break}p.insertBefore(z,j&&p.contains(j)?j:null),O("attachSlideEl",S)}return Ae(S),z}}function K(S){const z=S==null?void 0:S.el;z&&(z.remove(),I(z),O("detachSlideEl",S))}function ce(){for(let S=0;S<P.length;S++){const z=P[S],j=z.el;j&&(z.index!==S&&I(j),j.setAttribute("index",`${S}`)),z.index=S}}function D(){var S,z,j,A,G;if(!h||!p)return;y=ee("rtl"),k=ee("vertical"),x=k?"height":"width";const W=ee("classes");if(Ye(h,W.isLTR,!y),Ye(h,W.isRTL,y),Ye(h,W.isHorizontal,!k),Ye(h,W.isVertical,k),Ye(h,W.hasAdaptiveHeight,ee("adaptiveHeight")),!$e())return;const J=window.getComputedStyle(p);f=J.getPropertyValue("overflow-"+(k?"y":"x"))==="visible",Q=p&&parseFloat(J.getPropertyValue("--f-carousel-gap"))||0;const ie=function(){let ue=0;if(p){let le=document.createElement("div");le.style.display="block",we(le,c.classes.slide),p.appendChild(le),ue=le.getBoundingClientRect()[x],le.remove(),le=void 0}return ue}();for(const ue of F){const le=ue.el;let ke=0;if(!ue.isVirtual&&le&&Kt(le)){let Ee=!1;le.parentElement&&le.parentElement===p||(p.appendChild(le),Ee=!0),ke=le.getBoundingClientRect()[x],Ee&&((S=le.parentElement)===null||S===void 0||S.removeChild(le))}else ke=ie;ue.dim=ke}if(g=!1,ee("infinite")){g=!0;const ue=Oe();let le=$e();if(f){const ke=p.getBoundingClientRect();le+=ke.left,le+=ke.right-ke.width}for(let ke=0;ke<F.length;ke++){const Ee=((z=F[ke])===null||z===void 0?void 0:z.dim)+Q;if(ue-Ee<le&&ue-Ee-le<Ee){g=!1;break}}}(function(){var ue;if(!h)return;const le=$e(),ke=Oe(!1);let Ee=ee("slidesPerPage");Ee=Ee==="auto"?1/0:parseFloat(Ee+""),v=[];let Me=0,Ne=0;for(const He of F)(!v.length||Me+He.dim-le>.05||Ne>=Ee)&&(v.push({index:v.length,slides:[],dim:0,offset:0,pos:0}),Me=0,Ne=0),(ue=v[v.length-1])===null||ue===void 0||ue.slides.push(He),Me+=He.dim+Q,Ne++;const je=ee("center"),it=ee("fill");let st=0;for(const He of v){He.dim=(He.slides.length-1)*Q;for(const dt of He.slides)He.dim+=dt.dim;He.offset=st,He.pos=st,je!==!1&&(He.pos-=.5*(le-He.dim)),it&&!g&&ke>le&&(He.pos=Be(0,He.pos,ke-le)),st+=He.dim+Q}const lt=[];let bt;for(const He of v){const dt=Object.assign({},He);bt&&Math.abs(dt.pos-bt.pos)<.1?(bt.dim+=dt.dim,bt.slides=[...bt.slides,...dt.slides]):(bt=dt,dt.index=lt.length,lt.push(dt))}v=lt,M=Be(0,M,v.length-1)})(),_=((j=v[0])===null||j===void 0?void 0:j.pos)||0,C=((A=v[v.length-1])===null||A===void 0?void 0:A.pos)||0,d===0?function(){var ue;s=void 0,M=ee("initialPage");const le=ee("initialSlide")||void 0;le!==void 0&&(M=xe.getPageIndex(le)||0),M=Be(0,M,v.length-1),E=((ue=v[M])===null||ue===void 0?void 0:ue.pos)||0,T=E}():T=((G=v[M||0])===null||G===void 0?void 0:G.pos)||0,O("refresh"),Le()}function I(S){if(!S||!Kt(S))return;const z=parseInt(S.getAttribute("index")||"-1");let j="";for(const G of Array.from(S.classList)){const W=G.match(/^f-(\w+)(Out|In)$/);W&&W[1]&&(j=W[1]+"")}if(!S||!j)return;const A=[`f-${j}Out`,`f-${j}In`,"to-prev","to-next","from-prev","from-next"];S.removeEventListener("animationend",Y),Ke(S,A.join(" ")),H.delete(z)}function te(){if(!p)return;const S=H.size>0;for(const z of F)I(z.el);H.clear(),S&&me()}function Y(S){var z;((z=S.animationName)===null||z===void 0?void 0:z.substring(0,2))==="f-"&&(I(S.target),H.size||(Ke(h,"in-transition"),!B&&Math.abs(xe.getPosition(!0)-T)<.5&&(B=!0,O("settle"))),me())}function b(S){var z;if(S.defaultPrevented)return;const j=S.composedPath()[0];if(j.closest("[data-carousel-go-prev]"))return Rt(S),void xe.prev();if(j.closest("[data-carousel-go-next]"))return Rt(S),void xe.next();const A=j.closest("[data-carousel-go-to]");if(A)return Rt(S),void xe.goTo(parseFloat(A.dataset.carouselGoTo||"")||0);if(j.closest("[data-carousel-download]")){Rt(S);const G=(z=v[M])===null||z===void 0?void 0:z.slides[0];if(G&&(G.downloadSrc||G.type==="image"&&G.src)){const W=G.downloadFilename,J=document.createElement("a"),ie=G.downloadSrc||G.src||"";J.href=ie,J.target="_blank",J.download=W||ie,J.click()}}else O("click",S)}function N(S){var z;const j=S.el;j&&((z=j.querySelector(".f-spinner"))===null||z===void 0||z.remove())}function X(S){var z;const j=S.el;j&&((z=j.querySelector(".f-html.is-error"))===null||z===void 0||z.remove(),Ke(j,"has-error"))}function ne(S){var z;S||(S=(z=v[M])===null||z===void 0?void 0:z.slides[0]);const j=S==null?void 0:S.el;if(!j)return;let A=ee("formatCaption",S);A===void 0&&(A=S.caption),A=A||"";const G=ee("captionEl");if(G&&G instanceof HTMLElement){if(S.index!==M)return;if(Te(A)&&(G.innerHTML=L(A+"")),A instanceof HTMLElement){if(A.parentElement===G)return;G.innerHTML="",A.parentElement&&(A=A.cloneNode(!0)),G.append(A)}return}if(!A)return;let W=S.captionEl||j.querySelector(".f-caption");!W&&A instanceof HTMLElement&&A.classList.contains("f-caption")&&(W=A),W||(W=document.createElement("div"),we(W,"f-caption"),Te(A)?W.innerHTML=L(A+""):A instanceof HTMLElement&&(A.parentElement&&(A=A.cloneNode(!0)),W.append(A)));const J=`f-caption-${jr}_${S.index}`;W.setAttribute("id",J),W.dataset.selectable="true",we(j,"has-caption"),j.setAttribute("aria-labelledby",J),S.captionEl=W,j.insertAdjacentElement("beforeend",W)}function se(S,z={}){var j,A;let{transition:G,tween:W}=Object.assign({transition:c.transition,tween:c.tween},z||{});if(!h||!r)return;const J=v.length;if(!J||function(le,ke){var Ee,Me,Ne,je;if(!(h&&r&&ke&&Te(ke)&&ke!=="tween")||((Ee=v[M])===null||Ee===void 0?void 0:Ee.slides.length)>1)return!1;const it=v.length;let st=le>M?1:-1;le=g?(le%it+it)%it:Be(0,le,it-1),y&&(st*=-1);const lt=(Me=v[M])===null||Me===void 0?void 0:Me.slides[0],bt=lt==null?void 0:lt.index,He=(Ne=v[le])===null||Ne===void 0?void 0:Ne.slides[0],dt=He==null?void 0:He.index,Di=(je=v[le])===null||je===void 0?void 0:je.pos;if(dt===void 0||bt===void 0||bt===dt||E===Di||Math.abs($e()-((He==null?void 0:He.dim)||0))>1)return!1;B=!1,r.pause(),te(),we(h,"in-transition"),E=T=Di;const an=ae(lt),on=ae(He);return Ve(),an&&(H.add(bt),an.style.transform="",an.addEventListener("animationend",Y),Ke(an,c.classes.isSelected),an.inert=!1,we(an,`f-${ke}Out to-${st>0?"next":"prev"}`)),on&&(H.add(dt),on.style.transform="",on.addEventListener("animationend",Y),we(on,c.classes.isSelected),on.inert=!1,we(on,`f-${ke}In from-${st>0?"prev":"next"}`)),me(),!0}(S,G))return;S=g?(S%J+J)%J:Be(0,S,J-1),T=((j=v[S||0])===null||j===void 0?void 0:j.pos)||0;const ue=r.isRunning()?r.getEndValues().pos:E;if(Math.abs(T-ue)<1)return E=T,M!==S&&(ne(),s=M,M=S,Le(),Ae(),O("change",M,s)),me(),void(B||(B=!0,O("settle")));if(r.pause(),te(),g){const le=Oe(),ke=Math.floor((ue-((A=v[0])===null||A===void 0?void 0:A.pos))/le)||0,Ee=T+ke*le;T=[Ee+le,Ee,Ee-le].reduce(function(Me,Ne){return Math.abs(Ne-ue)<Math.abs(Me-ue)?Ne:Me})}G!==!1&&Ze(W)?r.spring(nt({},c.tween,W)).from({pos:E}).to({pos:T}).start():(E=T,Ve(),me(),B||(B=!0,O("settle")))}function fe(S){var z;let j=E;if(g&&S!==!0){const A=Oe();j-=(Math.floor((E-((z=v[0])===null||z===void 0?void 0:z.pos)||0)/A)||0)*A}return j}function me(){var S;if(!h||!p)return;V=ze();const z=new Set,j=[],A=v[M],G=c.setTransform;let W;for(const J of F){const ie=H.has(J.index),ue=V.indexOf(J)>-1,le=((S=A==null?void 0:A.slides)===null||S===void 0?void 0:S.indexOf(J))>-1;if(J.isVirtual&&!ie&&!ue)continue;let ke=ae(J);if(ke&&(j.push(J),le&&z.add(ke),ee("adaptiveHeight")&&le)){const Ee=(ke.firstElementChild||ke).getBoundingClientRect().height;W=W==null?Ee:Math.max(W,Ee)}}p&&W&&(p.style.height=`${W}px`),[...Pa(p,`.${c.classes.slide}`)].forEach(J=>{Ye(J,c.classes.isSelected,z.has(J));const ie=P[parseInt(J.getAttribute("index")||"-1")];if(!ie)return J.remove(),void I(J);const ue=H.has(ie.index),le=V.indexOf(ie)>-1;if(ie.isVirtual&&!ue&&!le)return void K(ie);if(J.inert=!le,G===!1)return;let ke=ie.pos?Math.round(1e4*ie.pos)/1e4:0,Ee=0,Me=0,Ne=0,je=0;ue||(Ee=k?0:y?-1*ke:ke,Me=k?ke:0,Ne=Un(Ee,0,ie.dim,0,100),je=Un(Me,0,ie.dim,0,100)),G instanceof Function&&!ue?G(xe,ie,{x:Ee,y:Me,xPercent:Ne,yPercent:je}):J.style.transform=Ee||Me?`translate3d(${Ne}%, ${je}%,0)`:""}),O("render",j)}function be(){h==null||h.removeEventListener("click",b),document.removeEventListener("mousemove",de),H.clear(),i==null||i.disconnect(),i=void 0;for(const S of P){let z=S.el;z&&Kt(z)&&(S.state=void 0,N(S),X(S),S.isVirtual?(K(S),S.el=void 0):(I(z),z.style.transform="",p&&!p.contains(z)&&p.appendChild(z)))}for(const S of Object.values(m))S==null||S.destroy();m={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const[S,z]of Object.entries(c.classes||{}))S!=="container"&&Ke(h,z);Ke(p,"is-draggable")}function ve(){return g||M>0}function Fe(){return g||M<v.length-1}const xe={add:function(S,z){var j;let A=E;const G=M,W=Oe(),J=r!=null&&r.isRunning()?r.getEndValues().pos:E,ie=W&&Math.floor((J-(((j=v[0])===null||j===void 0?void 0:j.pos)||0))/W)||0;return q(S,z),ye(w),D(),r&&W&&(G===M&&(A-=ie*W),A===T?E=T:r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:A}).to({pos:T}).start()),me(),xe},canGoPrev:ve,canGoNext:Fe,destroy:function(){return O("destroy"),window.removeEventListener("resize",oe),be(),R.clear(),h=null,v=[],P=[],c=Object.assign({},tn),m={},F=[],l=void 0,w="*",d=2,xe},emit:O,filter:function(S="*"){return ye(S),D(),E=Be(_,E,C),me(),O("filter",S),xe},getContainer:function(){return h},getGapDim:_e,getGestures:function(){return o},getLastMouseMove:function(){return zr},getOption:function(S){return ee(S)},getOptions:function(){return c},getPage:function(){return v[M]},getPageIndex:function(S){if(S!==void 0){for(const z of v||[])for(const j of z.slides)if(j.index===S)return z.index;return-1}return M},getPageIndexFromPosition:qe,getPageProgress:function(S,z){var j;S===void 0&&(S=M);const A=v[S];if(!A)return S>M?-1:1;const G=Oe(),W=_e();let J=A.pos,ie=fe();if(g&&z!==!0){const ue=Math.floor((ie-((j=v[0])===null||j===void 0?void 0:j.pos))/G)||0;ie-=ue*G,J=[J+G,J,J-G].reduce(function(le,ke){return Math.abs(ke-ie)<Math.abs(le-ie)?ke:le})}return(ie-J)/(A.dim+W)||0},getPageVisibility:function(S){var z;S===void 0&&(S=M);const j=v[S];if(!j)return S>M?-1:1;const A=fe(),G=$e();let W=j.pos;if(g){const J=Oe(),ie=W+(Math.floor((A-((z=v[0])===null||z===void 0?void 0:z.pos))/J)||0)*J;W=[ie+J,ie,ie-J].reduce(function(ue,le){return Math.abs(le-A)<Math.abs(ue-A)?le:ue})}return W>A&&W+j.dim<A+G?1:W<A?(W+j.dim-A)/j.dim||0:W+j.dim>A+G&&(A+G-W)/j.dim||0},getPages:function(){return v},getPlugins:function(){return m},getPosition:fe,getSlides:function(){return P},getState:function(){return d},getTotalSlideDim:Oe,getTween:function(){return r},getViewport:function(){return p},getViewportDim:$e,getVisibleSlides:function(S){return S===void 0?V:ze(S)},goTo:se,hasNavigated:function(){return s!==void 0},hideError:X,hideLoading:N,init:function(){if(!t||!Kt(t))throw new Error("No Element found");return d!==0&&(be(),d=0),h=t,u=n,window.removeEventListener("resize",oe),u.breakpoints&&window.addEventListener("resize",oe),oe(),xe},isInfinite:function(){return g},isInTransition:function(){return H.size>0},isRTL:function(){return y},isSettled:function(){return B},isVertical:function(){return k},localize:function(S,z=[]){return L(S,z)},next:function(S={}){return se(M+1,S),xe},off:function(S,z){for(const j of S instanceof Array?S:[S])R.has(j)&&R.set(j,R.get(j).filter(A=>A!==z));return xe},on:function(S,z){for(const j of S instanceof Array?S:[S])R.set(j,[...R.get(j)||[],z]);return xe},prev:function(S={}){return se(M-1,S),xe},reInit:function(S={},z={}){return be(),d=0,l=void 0,w="*",n=S,u=S,a=z,oe(),xe},remove:function(S){S===void 0&&(S=P.length-1);const z=P[S];return z&&(O("removeSlide",z),z.el&&(I(z.el),z.el.remove(),z.el=void 0),P.splice(S,1),ye(w),D(),E=Be(_,E,C),me()),xe},setPosition:function(S){E=S,Ve(),me()},showError:function(S,z){N(S),X(S);const j=S.el;if(j){const A=document.createElement("div");we(A,"f-html"),we(A,"is-error"),A.innerHTML=L(z||"<p>{{ERROR}}</p>"),S.htmlEl=A,we(j,"has-html"),we(j,"has-error"),j.insertAdjacentElement("afterbegin",A),O("contentReady",S)}return xe},showLoading:function(S){const z=S.el,j=z==null?void 0:z.querySelector(".f-spinner");if(!z||j)return xe;const A=ee("spinnerTpl"),G=wt(A);return G&&(we(G,"f-spinner"),z.insertAdjacentElement("beforeend",G)),xe},version:"6.1.3"};return xe};Zn.l10n={en_EN:Oa},Zn.getDefaults=()=>tn;/*! License details at fancyapps.com/license */const Gr=(t=!0,n="--f-scrollbar-compensate",a="--f-body-margin",o="hide-scrollbar")=>{const r=document,i=r.body,s=r.documentElement;if(t){if(i.classList.contains(o))return;let l=window.innerWidth-s.getBoundingClientRect().width;l<0&&(l=0),s.style.setProperty(n,`${l}px`);const d=parseFloat(window.getComputedStyle(i).marginRight);d&&i.style.setProperty(a,`${d}px`),i.classList.add(o)}else i.classList.remove(o),i.style.setProperty(a,""),r.documentElement.style.setProperty(n,"")};/*! License details at fancyapps.com/license */function Yn(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const zt=function(t="",n="",a=""){return t.split(n).join(a)};/*! License details at fancyapps.com/license */const Ir={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}}" />`},Ld=()=>{let t;function n(c,m){const h=t==null?void 0:t.getOptions().Zoomable;let p=(Ze(h)?Object.assign(Object.assign({},Ir),h):Ir)[c];return p&&typeof p=="function"&&m?p(m):p}function a(){t&&t.getOptions().Zoomable!==!1&&(t.on("addSlide",i),t.on("removeSlide",s),t.on("attachSlideEl",l),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 h=m.panzoomRef;h&&((t==null?void 0:t.getPage().slides)||[]).indexOf(m)<0&&h.execute(ge.ZoomTo,Object.assign({},h.getStartPosition()))}}function r(c,m){const h=m.target;h&&!m.defaultPrevented&&h.dataset.panzoomAction&&u(h.dataset.panzoomAction)}function i(c,m){const h=m.el;if(!t||!h||m.panzoomRef)return;const p=m.src||m.lazySrc||"",f=m.alt||m.caption||`Image #${m.index}`,g=m.srcset||m.lazySrcset||"",y=m.sizes||m.lazySizes||"";if(p&&Te(p)&&!m.html&&(!m.type||m.type==="image")){m.type="image",m.thumbSrc=m.thumbSrc||p;let M=n("tpl",m);M=zt(M,"{{src}}",p+""),M=zt(M,"{{srcset}}",g+""),M=zt(M,"{{sizes}}",y+""),h.insertAdjacentHTML("afterbegin",M)}const k=h.querySelector(".f-panzoom__content");if(!k)return;k.setAttribute("alt",f+"");const x=m.width&&m.width!=="auto"?parseFloat(m.width+""):"auto",E=m.height&&m.height!=="auto"?parseFloat(m.height+""):"auto",B=$a(h,Object.assign({width:x,height:E,classes:{container:"f-zoomable"},event:()=>t==null?void 0:t.getLastMouseMove(),spinnerTpl:()=>(t==null?void 0:t.getOption("spinnerTpl"))||""},n("Panzoom")));B.on("*",(M,T,..._)=>{t&&(T==="loading"&&(m.state=0),T==="loaded"&&(m.state=1),T==="error"&&(m.state=2,t==null||t.showError(m,"{{IMAGE_ERROR}}")),t.emit(`panzoom:${T}`,m,..._),T==="ready"&&t.emit("contentReady",m),m.index===(t==null?void 0:t.getPageIndex())&&d())}),m.panzoomRef=B}function s(c,m){m.panzoomRef&&(m.panzoomRef.destroy(),m.panzoomRef=void 0)}function l(c,m){const h=m.panzoomRef;if(h)switch(h.getState()){case 0:h.init();break;case 3:h.execute(ge.ZoomTo,Object.assign(Object.assign({},h.getStartPosition()),{velocity:0}))}}function d(){var c,m;const h=(t==null?void 0:t.getContainer())||void 0,p=(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(h)if(p)p.updateControls(h);else for(const f of h.querySelectorAll("[data-panzoom-action]")||[])f.setAttribute("aria-disabled",""),f.setAttribute("tabindex","-1")}function u(c,...m){var h;(h=t==null?void 0:t.getPage().slides[0].panzoomRef)===null||h===void 0||h.execute(c,...m)}return{init:function(c){t=c,t.on("initPlugins",a)},destroy:function(){if(t){t.off("initPlugins",a),t.off("addSlide",i),t.off("removeSlide",s),t.off("attachSlideEl",l),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 qr={syncOnChange:!1,syncOnClick:!0,syncOnHover:!1},Wr=()=>{let t,n;function a(){const p=t==null?void 0:t.getOptions().Sync;return Ze(p)?Object.assign(Object.assign({},qr),p):qr}function o(p){var f,g,y;t&&p&&(n=p,t.getOptions().classes=Object.assign(Object.assign({},t.getOptions().classes),{isSelected:""}),t.getOptions().initialSlide=((g=(f=n.getPage())===null||f===void 0?void 0:f.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",i),t.on("refresh",c),n.on("change",l),n.on("filter",m))}())}function r(){const p=a().target;t&&p&&o(p)}function i(){h()}function s(){var p;if(t&&n){const f=((p=t.getPage())===null||p===void 0?void 0:p.slides)||[],g=n.getPageIndex(f[0].index||0);g>-1&&n.goTo(g,t.hasNavigated()?void 0:{tween:!1,transition:!1}),h()}}function l(){var p;if(t&&n){const f=t.getPageIndex(((p=n.getPage())===null||p===void 0?void 0:p.slides[0].index)||0);f>-1&&t.goTo(f,n.hasNavigated()?void 0:{tween:!1,transition:!1}),h()}}function d(p,f){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?f.target.closest(`.${y}`):null;if(k){const x=parseInt(k.getAttribute("index")||"")||0,E=n.getPageIndex(x);n.goTo(E)}}function u(p){t&&d(0,p)}function c(){var p;if(t&&n){const f=t.getPageIndex(((p=n.getPage())===null||p===void 0?void 0:p.slides[0].index)||0);f>-1&&t.goTo(f,{tween:!1,transition:!1}),h()}}function m(p,f){t&&n&&(t.filter(f),l())}function h(){var p,f,g;if(!n)return;const y=((f=(p=n.getPage())===null||p===void 0?void 0:p.slides[0])===null||f===void 0?void 0:f.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(p){t=p,t.on("initSlides",r)},destroy:function(){var p;t==null||t.off("ready",i),t==null||t.off("refresh",c),t==null||t.off("change",s),t==null||t.off("click",d),(p=t==null?void 0:t.getViewport())===null||p===void 0||p.removeEventListener("mouseover",u),n==null||n.off("change",l),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 Ur={showLoading:!0,preload:1},Xn="is-lazyloading",Zr="is-lazyloaded",Yr="has-lazyerror",Xr=()=>{let t;function n(){const r=t==null?void 0:t.getOptions().Lazyload;return Ze(r)?Object.assign(Object.assign({},Ur),r):Ur}function a(r){var i;const s=r.el;if(!s)return;const l="[data-lazy-src],[data-lazy-srcset],[data-lazy-bg]",d=Array.from(s.querySelectorAll(l));s.matches(l)&&d.push(s);for(const u of d){const c=u.dataset.lazySrc,m=u.dataset.lazySrcset,h=u.dataset.lazySizes,p=u.dataset.lazyBg,f=(u instanceof HTMLImageElement||u instanceof HTMLSourceElement)&&(c||m),g=u instanceof HTMLElement&&p;if(!f&&!g)continue;const y=c||m||p;if(y){if(f&&y){const k=(i=u.parentElement)===null||i===void 0?void 0:i.classList.contains("f-panzoom__wrapper");n().showLoading&&(t==null||t.showLoading(r)),u.addEventListener("load",()=>{t==null||t.hideLoading(r),Ke(u,Yr),u instanceof HTMLImageElement?u.decode().then(()=>{Ke(u,Xn),we(u,Zr)}):(Ke(u,Xn),we(u,Zr)),k||t==null||t.emit("lazyLoad:loaded",r,u,y)}),u.addEventListener("error",()=>{t==null||t.hideLoading(r),Ke(u,Xn),we(u,Yr),k||t==null||t.emit("lazyLoad:error",r,u,y)}),u.classList.add("f-lazyload"),u.classList.add(Xn),k||t==null||t.emit("lazyLoad:load",r,u,y),c&&(u.src=c),m&&(u.srcset=m),h&&(u.sizes=h)}else g&&(document.body.contains(u)||(document.createElement("img").src=p),u.style.backgroundImage=`url('${p}')`);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()],i=n().preload;if(i>0){const s=t.getPosition(),l=t.getViewportDim();r.push(...t.getVisibleSlides(s+l*i),...t.getVisibleSlides(s-l*i))}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 Kr='<svg width="24" height="24" viewBox="0 0 24 24" tabindex="-1">',Qr="</svg>",Jr={prevTpl:Kr+'<path d="M15 3l-9 9 9 9"></path>'+Qr,nextTpl:Kr+'<path d="M9 3l9 9-9 9"></path>'+Qr},$d=()=>{let t,n,a;function o(){const l=t==null?void 0:t.getOptions().Arrows;return Ze(l)?Object.assign(Object.assign({},Jr),l):Jr}function r(l){if(!t)return;const d=`<button data-carousel-go-${l} tabindex="0" class="f-button is-arrow is-${l}" title="{{${l.toUpperCase()}}}">`+o()[`${l}Tpl`]+"</button",u=wt(t.localize(d))||void 0;return u&&we(u,o()[`${l}Class`]),u}function i(){var l;n==null||n.remove(),n=void 0,a==null||a.remove(),a=void 0,(l=t==null?void 0:t.getContainer())===null||l===void 0||l.classList.remove("has-arrows")}function s(){t&&t.getOptions().Arrows!==!1&&t.getPages().length>1?(function(){if(!t)return;const l=t.getViewport();l&&(n||(n=r("prev"),n&&l.insertAdjacentElement("beforebegin",n)),a||(a=r("next"),a&&l.insertAdjacentElement("afterend",a)),Ye(t.getContainer(),"has-arrows",!(!n&&!a)))}(),t&&(n==null||n.toggleAttribute("aria-disabled",!t.canGoPrev()),a==null||a.toggleAttribute("aria-disabled",!t.canGoNext()))):i()}return{init:function(l){t=l.on(["change","refresh"],s)},destroy:function(){i(),t==null||t.off(["change","refresh"],s),t=void 0}}};/*! License details at fancyapps.com/license */const e1='<circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/>',_a='<g><line x1="11" y1="8" x2="11" y2="14"></line></g>'+e1,Pd={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",e1],zoomIn:["zoomIn","ZOOM_IN",_a],toggleFull:["toggleFull","TOGGLE_FULL",_a],iterateZoom:["iterateZoom","ITERATE_ZOOM",_a],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>']},Ha={};for(const[t,n]of Object.entries(Pd))Ha[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 t1;(function(t){t.Left="left",t.middle="middle",t.right="right"})(t1||(t1={}));const n1=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>'}},Ha),a1={absolute:!1,display:{left:[],middle:["zoomIn","zoomOut","toggle1to1","rotateCCW","rotateCW","flipX","flipY","reset"],right:[]},enabled:"auto",items:{}},o1=()=>{let t,n;function a(r){const i=t==null?void 0:t.getOptions().Toolbar;let s=(Ze(i)?Object.assign(Object.assign({},a1),i):a1)[r];return s&&typeof s=="function"&&t?s(t):s}function o(){var r,i;if(!(t!=null&&t.getOptions().Toolbar)||!t||n)return;const s=t.getContainer();if(!s)return;let l=a("enabled");if(!l)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 h=((r=t.getPlugins().Thumbs)===null||r===void 0?void 0:r.isEnabled())||!1,p=u&&t.getPlugins().Autoplay||!1,f=t.getPlugins().Fullscreen&&(document.fullscreenEnabled||document.webkitFullscreenEnabled);if(l==="auto"&&(l=c),!l)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=nt({},n1,a("items"));for(const k of["left","middle","right"]){const x=g[k]||[],E=document.createElement("div");E.classList.add("f-carousel__toolbar__column"),E.classList.add(`is-${k}`);for(const B of x){let M;if(Te(B)){if(B==="counter"&&!u||B==="autoplay"&&!p||Ha[B]&&!c||B==="fullscreen"&&!f||B==="thumbs"&&!h||B==="download"&&!m)continue;M=y[B]}if(Ze(B)&&(M=B),M&&M.tpl){let T=t.localize(M.tpl);T=T.split("<svg>").join('<svg tabindex="-1" width="24" height="24" viewBox="0 0 24 24">');const _=wt(T);_&&(typeof M.click=="function"&&t&&_.addEventListener("click",C=>{C.preventDefault(),C.stopPropagation(),typeof M.click=="function"&&t&&M.click(t,C)}),E.append(_))}}n.append(E)}if(n.childElementCount){if(d&&n.classList.add("is-absolute"),!n.parentElement){const k=a("parentEl");k?k.insertAdjacentElement("afterbegin",n):(i=t.getViewport())===null||i===void 0||i.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,i){n1[r]=i},isEnabled:function(){return!!n}}};/*! License details at fancyapps.com/license */const r1={autoStart:!0,pauseOnHover:!0,showProgressbar:!0,timeout:2e3},Od=()=>{let t,n,a=!1,o=!1,r=!1,i=null;function s(M){const T=t==null?void 0:t.getOptions().Autoplay;let _=(Ze(T)?Object.assign(Object.assign({},r1),T):r1)[M];return _&&typeof _=="function"&&t?_(t):_}function l(){clearTimeout(n),n=void 0}function d(){if(!t||!a||r||o||n||!t.isSettled()||function(){var T;const _=((T=t==null?void 0:t.getPage())===null||T===void 0?void 0:T.slides)||[];for(const C of _)if(C.state===0)return!0;return!1}())return;(function(){var T,_,C,w;if(!t||(m(),!s("showProgressbar")))return;let P=s("progressbarParentEl");if(!P&&(!((T=t.getPlugins().Toolbar)===null||T===void 0)&&T.isEnabled())&&(P=t.getContainer()),!P&&((_=t.getPlugins().Toolbar)===null||_===void 0?void 0:_.isEnabled())!==!0){const H=((C=t.getPages()[0])===null||C===void 0?void 0:C.slides)||[],V=((w=t.getPage())===null||w===void 0?void 0:w.slides)||[];H.length===1&&V.length===1&&(P=V[0].el)}if(P||(P=t.getViewport()),!P)return;i=document.createElement("div"),we(i,"f-progressbar"),P.prepend(i);const F=s("timeout")||1e3;i.style.animationDuration=`${F}ms`})();const M=s("timeout");n=setTimeout(()=>{t&&a&&!o&&(t.isInfinite()||t.getPageIndex()!==t.getPages().length-1?t.next():t.goTo(0))},M)}function u(){var M;if(!t||t.getPages().length<2||t.getOptions().Autoplay===!1||a)return;a=!0,t.emit("autoplay:start",s("timeout")),we(t.getContainer(),"has-autoplay"),(M=t.getTween())===null||M===void 0||M.on("start",k);const T=t==null?void 0:t.getContainer();T&&s("pauseOnHover")&&matchMedia("(hover: hover)").matches&&(T.addEventListener("mouseenter",x,!1),T.addEventListener("mouseleave",E,!1)),t.on("change",g),t.on("settle",y),t.on("contentReady",p),t.on("panzoom:touchStart",c),t.on("panzoom:wheel",c),t.isSettled()&&d()}function c(){var M;if(l(),m(),t){if(a){t.emit("autoplay:end"),(M=t.getTween())===null||M===void 0||M.off("start",k);const T=t.getContainer();T&&(T.classList.remove("has-autoplay"),T.removeEventListener("mouseenter",x,!1),T.removeEventListener("mouseleave",E,!1))}t.off("change",g),t.off("settle",y),t.off("contentReady",p),t.off("panzoom:touchStart",c),t.off("panzoom:wheel",c)}a=!1,o=!1}function m(){i&&(i.remove(),i=null)}function h(){t&&t.getPages().length>1&&s("autoStart")&&u()}function p(){d()}function f(M,T){const _=T.target;_&&!T.defaultPrevented&&_.dataset.autoplayAction==="toggle"&&B.toggle()}function g(){!t||!(t!=null&&t.isInfinite())&&t.getPageIndex()===t.getPages().length-1?c():(m(),l())}function y(){d()}function k(){l(),m()}function x(){r=!0,a&&(m(),l())}function E(){r=!1,a&&!o&&(t!=null&&t.isSettled())&&d()}const B={init:function(M){t=M,t.on("ready",h),t.on("click",f)},destroy:function(){c(),t==null||t.off("ready",h),t==null||t.off("click",f),t=void 0},isEnabled:()=>a,pause:function(){o=!0,l()},resume:function(){o=!1,a&&!r&&d()},start(){u()},stop(){c()},toggle(){a?c():u()}};return B};/*! License details at fancyapps.com/license */const Ra={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 za;const _d=()=>{let t,n,a,o,r,i=0,s=0,l=!0;function d(V){const v=t==null?void 0:t.getOptions().Thumbs;let $=(Ze(v)?Object.assign(Object.assign({},Ra),v):Ra)[V];return $&&typeof $=="function"&&t?$(t):$}function u(){if(!t||(t==null?void 0:t.getOptions().Thumbs)===!1)return!1;let V=0;for(const v of t.getSlides())v.thumbSrc&&V++;return V>=d("minCount")}function c(){return d("type")==="modern"}function m(){return d("type")==="scrollable"}function h(){const V=[],v=(t==null?void 0:t.getSlides())||[];for(const $ of v)V.push({index:$.index,class:$.thumbClass,html:p($)});return V}function p(V){const v=V.thumb?V.thumb instanceof HTMLImageElement?V.thumb.src:V.thumb:V.thumbSrc||void 0,$=V.thumbAlt===void 0?`Thumbnail #${V.index}`:V.thumbAlt+"";let Z=d("thumbTpl");return Z=zt(Z,"{{alt}}",$),Z=zt(Z,"{{src}}",v+""),Z=zt(Z,"{{index}}",`${V.index}`),Z=zt(Z,"{{page}}",`${V.index||1}`),Z}function f(V){return`<div index="${V.index||0}" class="f-thumbs__slide ${V.class||""}">${V.html||""}</div>`}function g(V=!1){var v;const $=t==null?void 0:t.getContainer();if(!t||!$||a||!u())return;const Z=((v=d("Carousel"))===null||v===void 0?void 0:v.classes)||{};if(Z.container=Z.container||"f-thumbs",!a){const Q=$.nextElementSibling;Q!=null&&Q.classList.contains(Z.container)&&(a=Q)}if(!a){a=document.createElement("div");const Q=d("parentEl");Q?Q.insertAdjacentElement("beforeend",a):$.insertAdjacentElement("afterend",a)}we(a,Z.container),we(a,"f-thumbs"),we(a,`is-${d("type")}`),V&&we(a,"is-hidden")}function y(){if(!a||!m())return;o=document.createElement("div"),we(o,"f-thumbs__viewport");let V="";for(const v of h())typeof(v.html||"")=="string"&&(V+=f(v));o.innerHTML=V,a.append(o),a.addEventListener("click",v=>{v.preventDefault();const $=v.target.closest("[index]"),Z=parseInt(($==null?void 0:$.getAttribute("index"))||"-1");t&&Z>-1&&t.goTo(Z)}),r=new IntersectionObserver(v=>{v.forEach($=>{$.isIntersecting&&$.target instanceof HTMLImageElement&&($.target.src=$.target.getAttribute("data-lazy-src")+"",$.target.removeAttribute("data-lazy-src"),r==null||r.unobserve($.target))})},{root:o,rootMargin:"100px"}),a.querySelectorAll("[data-lazy-src]").forEach(v=>{r==null||r.observe(v)}),t==null||t.emit("thumbs:ready")}function k(){var V;if(!za||!t||!a||m()||n)return;const v=h();if(!v.length)return;const $=nt({},{Sync:{target:t},Lazyload:{preload:1},slides:v,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:Z=>{let Q=0;return c()&&(function(){if(!c()||!a)return;const ee=L=>a&&parseFloat(getComputedStyle(a).getPropertyValue("--f-thumb-"+L))||0;i=ee("width"),s=ee("clip-width")}(),Q=4*(i-s)),Z&&Z.getTotalSlideDim()<=Z.getViewportDim()-Q?1/0:1}},Ra.Carousel||{},d("Carousel")||{});n=za(a,$,{Sync:Wr,Lazyload:Xr}),n.on("ready",()=>{we(a,"is-syncing"),t==null||t.emit("thumbs:ready"),c()&&(t==null||t.on("render",M))}),n.on("destroy",()=>{t==null||t.emit("thumbs:destroy")}),n.init(),(V=n.getGestures())===null||V===void 0||V.on("start",()=>{l=!1}),n.on("click",(Z,Q)=>{const ee=Q.target;if(ee){const L=ee.matches("button")?ee:ee.firstElementChild;L&&L.matches("button")&&(Q.preventDefault(),L.focus({preventScroll:!0}))}}),we(t.getContainer(),"has-thumbs"),H()}function x(){u()&&d("showOnStart")&&(g(),y())}function E(){var V;u()&&(k(),t==null||t.on("addSlide",_),t==null||t.on("removeSlide",C),t==null||t.on("click",w),t==null||t.on("refresh",P),(V=t==null?void 0:t.getGestures())===null||V===void 0||V.on("start",B),F(!0))}function B(){var V,v;l=!0,!((V=document.activeElement)===null||V===void 0)&&V.closest(".f-thumbs")&&((v=document.activeElement)===null||v===void 0||v.blur())}function M(){var V,v;a==null||a.classList.toggle("is-syncing",(t==null?void 0:t.hasNavigated())===!1||((V=t==null?void 0:t.getTween())===null||V===void 0?void 0:V.isRunning())),H(),!((v=t==null?void 0:t.getGestures())===null||v===void 0)&&v.isPointerDown()&&function(){if(!c()||!t||!n||!l)return;const $=n.getTween(),Z=n.getPages(),Q=t.getPageIndex()||0,ee=t.getPageProgress()||0;if(!(t&&Z&&Z[Q]&&$))return;const L=$.isRunning()?$.getCurrentValues().pos:n.getPosition();if(L===void 0)return;let R=Z[Q].pos+ee*(i-s);R=Be(Z[0].pos,R,Z[Z.length-1].pos),$.from({pos:L}).to({pos:R}).start()}()}function T(){l=!0,F()}function _(V,v){const $={html:p(v)};if(n)n.add($,v.index);else if(o){const Z=wt(f($));if(Z){o.append(Z);const Q=Z.querySelector("img");Q&&(r==null||r.observe(Q))}}}function C(V,v){var $;n?n.remove(v.index):o&&(($=o.querySelector(`[index="${v.index}"]`))===null||$===void 0||$.remove())}function w(V,v){var $;const Z=v.target;v.defaultPrevented||(($=Z==null?void 0:Z.dataset)===null||$===void 0?void 0:$.thumbsAction)!=="toggle"||(a||(g(!0),y(),k()),a&&a.classList.toggle("is-hidden"))}function P(){F()}function F(V=!1){if(!t||!o||!m())return;const v=t.getPageIndex();o.querySelectorAll(".is-selected").forEach(Z=>{Z.classList.remove("is-selected")});const $=o.querySelector(`[index="${v}"]`);if($){$.classList.add("is-selected");const Z=o.getBoundingClientRect(),Q=$.getBoundingClientRect(),ee=$.offsetTop-o.offsetTop-.5*Z.height+.5*Q.height,L=$.scrollLeft-o.scrollLeft-.5*Z.width+.5*Q.width;o.scrollTo({top:ee,left:L,behavior:V?"instant":"smooth"})}}function H(){if(!c()||!t||!n)return;const V=(n==null?void 0:n.getSlides())||[];let v=-.5*i;for(const $ of V){const Z=$.el;if(!Z)continue;let Q=t.getPageProgress($.index)||0;Q=Math.max(-1,Math.min(1,Q)),Q>-1&&Q<1&&(v+=.5*i*(1-Math.abs(Q))),Q=Math.round(1e4*Q)/1e4,v=Math.round(1e4*v)/1e4,Z.style.setProperty("--progress",`${Math.abs(Q)}`),Z.style.setProperty("--shift",`${t!=null&&t.isRTL()?-1*v:v}px`),Q>-1&&Q<1&&(v+=.5*i*(1-Math.abs(Q)))}}return{init:function(V,v){za=v,t=V,t.on("ready",E),t.on("initSlides",x),t.on("change",T)},destroy:function(){var V,v;m()&&(t==null||t.emit("thumbs:destroy")),t==null||t.off("ready",E),t==null||t.off("initSlides",x),t==null||t.off("change",T),t==null||t.off("render",M),t==null||t.off("addSlide",_),t==null||t.off("click",w),t==null||t.off("refresh",P),(V=t==null?void 0:t.getGestures())===null||V===void 0||V.off("start",B),(v=t==null?void 0:t.getContainer())===null||v===void 0||v.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 i1={iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"}},Hd=()=>{let t;function n(r,i){let s=i.src;if(!Te(s))return;let l=i.type;if(!l){if(l||(s.charAt(0)==="#"?l="inline":s.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.((a)?png|avif|gif|jp(g|eg)|pjp(eg)?|jfif|svg|webp|bmp|ico|tif(f)?)((\?|#).*)?$)/i)?l="image":s.match(/\.(pdf)((\?|#).*)?$/i)?l="pdf":s.match(/\.(html|php)((\?|#).*)?$/i)&&(l="iframe")),!l){const 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"}`,l="gmap")}if(!l){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`,l="gmap")}i.src=s,i.type=l}}function a(r,i){i.type!=="iframe"&&i.type!=="pdf"&&i.type!=="gmap"||function(s){if(!t||!s.el||!s.src)return;const l=document.createElement("iframe");l.classList.add("f-iframe");for(const[u,c]of Object.entries(function(){const m=t==null?void 0:t.getOptions().Html;return Ze(m)?Object.assign(Object.assign({},i1),m):i1}().iframeAttr||{}))l.setAttribute(u,c);l.onerror=()=>{t&&t.getState()===1&&t.showError(s,"{{IFRAME_ERROR}}")},l.src=s.src;const d=document.createElement("div");if(d.classList.add("f-html"),d.append(l),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=l,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)}(i)}function o(r,i){var s,l;i.type!=="iframe"&&i.type!=="pdf"&&i.type!=="gmap"||(t==null||t.hideError(i),(s=i.contentEl)===null||s===void 0||s.remove(),i.contentEl=void 0,(l=i.htmlEl)===null||l===void 0||l.remove(),i.htmlEl=void 0)}return{init:function(r){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 s1=(t,n={})=>{const a=new URL(t),o=new URLSearchParams(a.search),r=new URLSearchParams;for(const[l,d]of[...o,...Object.entries(n)]){let u=d+"";if(l==="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(l,u)}let i=r+"",s=t.match(/#t=((.*)?\d+s)/);return s&&(i+=`#t=${s[1]}`),i},l1={autoplay:!1,html5videoTpl:`<video class="f-html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">
@@ -90,7 +90,7 @@
90
90
  <source src="${f}" type="${g}" />
91
91
  Seu navegador não suporta vídeo.
92
92
  </video>
93
- `,caption:y}]):Pe.show([{src:f,type:"image",caption:y}]))},c=()=>{const f=document.createElement("canvas"),g=320,y=180;f.width=g,f.height=y;const k=f.getContext("2d");return k.fillStyle="black",k.fillRect(0,0,g,y),f.toDataURL("image/png")};function m(f,g=1){return new Promise((y,k)=>{const x=document.createElement("video");x.src=f,x.crossOrigin="anonymous",x.muted=!0,x.playsInline=!0,x.preload="auto",x.addEventListener("loadeddata",()=>{x.readyState>=2&&(x.currentTime=g)}),x.addEventListener("seeked",()=>{const E=document.createElement("canvas");E.width=x.videoWidth,E.height=x.videoHeight,E.getContext("2d").drawImage(x,0,0,E.width,E.height);const M=E.toDataURL("image/png");y(M)})})}const h=f=>typeof f=="string"&&f.startsWith("data:")&&f.includes(";base64,"),p=f=>{const g=Math.floor(f/60),y=(f%60).toFixed(0),k=g.toString().padStart(2,"0"),x=y.toString().padStart(2,"0");return`${k}:${x}`};return e.onMounted(async()=>{try{const f=await m(n.base64),g=f&&f!=="data:,";a.value=g?f:c()}catch(f){console.error("Erro ao gerar thumbnail:",f),a.value=c()}}),(f,g)=>(e.openBlock(),e.createElementBlock("main",{class:e.normalizeClass({main_preview_files_container_message:t.mode==="message",main_preview_files_container_miniature:t.mode==="miniature","main_preview_files_container_preview bg-base-200":t.mode==="preview"})},[!t.isMobile&&i.value?(e.openBlock(),e.createElementBlock("section",f4,[t.mode!=="miniature"?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"iframe_preview_files",src:t.base64,frameborder:"0"},null,8,m4)):(e.openBlock(),e.createElementBlock("svg",h4,[...g[6]||(g[6]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"},null,-1)])]))])):t.isMobile&&i.value&&t.mode==="message"?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(t.mode==="message"?"flex flex-col bg-base-300 p-2 rounded-md gap-2":"")},[e.createElementVNode("span",p4,[g[7]||(g[7]=e.createElementVNode("svg",{class:"size-8 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",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("p",g4,e.toDisplayString(t.fileName),1)]),t.mode==="message"?(e.openBlock(),e.createElementBlock("div",y4,[e.createElementVNode("button",{class:"bg-base-200 p-2 text-primary w-full text-xs rounded-md hover:bg-base-100",onClick:g[0]||(g[0]=y=>f.$emit("open-mobile-pdf"))}," Abrir PDF ")])):e.createCommentVNode("",!0)],2)):s.value?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:g[1]||(g[1]=y=>u(t.base64,t.mimetype)),class:"video_message_preview_container"},[e.createElementVNode("div",k4,[e.createElementVNode("div",x4,[(e.openBlock(),e.createElementBlock("svg",b4,[...g[8]||(g[8]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",w4,[...g[9]||(g[9]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",E4,[...g[10]||(g[10]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",v4,[...g[11]||(g[11]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])]),e.createElementVNode("img",{class:e.normalizeClass(["preview_img",t.mode]),src:h(t.base64)?t.base64:t.base64.replace("+","%2B")},null,10,C4)])):d(t.mimetype)?(e.openBlock(),e.createElementBlock("section",S4,[t.mode==="preview"?(e.openBlock(),e.createElementBlock("video",{key:0,width:"300",height:"150",controls:"",src:t.base64},[e.createElementVNode("source",{src:t.base64,type:t.mimetype},null,8,V4)],8,B4)):t.mode==="miniature"?(e.openBlock(),e.createElementBlock("svg",M4,[...g[12]||(g[12]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14 7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7Zm2 9.387 4.684 1.562A1 1 0 0 0 22 17V7a1 1 0 0 0-1.316-.949L16 7.613v8.774Z","clip-rule":"evenodd"},null,-1)])])):t.mode==="message"?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:g[2]||(g[2]=y=>u(t.base64,t.mimetype)),class:"video_message_preview_container"},[a.value?(e.openBlock(),e.createElementBlock("section",N4,[e.createElementVNode("div",A4,[g[17]||(g[17]=e.createElementVNode("svg",{class:"size-12 text-white","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.6 5.2A1 1 0 0 0 7 6v12a1 1 0 0 0 1.6.8l8-6a1 1 0 0 0 0-1.6l-8-6Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",T4,[(e.openBlock(),e.createElementBlock("svg",D4,[...g[13]||(g[13]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",F4,[...g[14]||(g[14]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",L4,[...g[15]||(g[15]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",$4,[...g[16]||(g[16]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])]),e.createElementVNode("img",{class:e.normalizeClass(["preview_img",t.mode]),src:a.value},null,10,P4)])):(e.openBlock(),e.createElementBlock("span",O4,[...g[18]||(g[18]=[e.createElementVNode("span",{class:"loader-preview-lib"},null,-1)])]))])):e.createCommentVNode("",!0)])):l.value?(e.openBlock(),e.createElementBlock("section",_4,[t.mode!=="miniature"?(e.openBlock(),e.createElementBlock("section",H4,[e.createVNode(S1,{avatar:t.avatar,audio:t.base64,onDuration:g[3]||(g[3]=y=>o.value=y),onCurrentTime:g[4]||(g[4]=y=>r.value=y)},null,8,["avatar","audio"])])):(e.openBlock(),e.createElementBlock("svg",R4,[...g[19]||(g[19]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5 8a1 1 0 0 1 1 1v3a4.006 4.006 0 0 0 4 4h4a4.006 4.006 0 0 0 4-4V9a1 1 0 1 1 2 0v3.001A6.006 6.006 0 0 1 14.001 18H13v2h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2v-2H9.999A6.006 6.006 0 0 1 4 12.001V9a1 1 0 0 1 1-1Z","clip-rule":"evenodd"},null,-1),e.createElementVNode("path",{d:"M7 6a4 4 0 0 1 4-4h2a4 4 0 0 1 4 4v5a4 4 0 0 1-4 4h-2a4 4 0 0 1-4-4V6Z"},null,-1)])]))])):(e.openBlock(),e.createElementBlock("div",{key:5,class:e.normalizeClass(t.mode==="message"?"generic_files":"")},[g[20]||(g[20]=e.createElementVNode("div",null,[e.createElementVNode("svg",{class:"size-8 text-white","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:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-7Z","clip-rule":"evenodd"})])],-1)),t.mode==="message"?(e.openBlock(),e.createElementBlock("span",z4,[e.createElementVNode("p",j4,e.toDisplayString(t.fileName),1),e.createElementVNode("button",{class:"download_btn_generic_files",onClick:g[5]||(g[5]=y=>f.$emit("download"))}," Baixar arquivo ")])):e.createCommentVNode("",!0)],2)),t.mode==="message"?(e.openBlock(),e.createElementBlock("div",G4,[e.renderSlot(f.$slots,"content-message",{},void 0,!0),e.createElementVNode("div",{class:e.normalizeClass([o.value?"justify-between":" justify-end","flex w-full"])},[l.value&&o.value?(e.openBlock(),e.createElementBlock("p",I4,e.toDisplayString(p(o.value))+" - "+e.toDisplayString(r.value?p(r.value):"00:00"),1)):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"time-message",{},void 0,!0)],2)])):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-6405f10f"]]),q4={props:{audioStream:MediaStream},data(){return{audioContext:null,analyser:null}},mounted(){this.initializeAudio()},methods:{initializeAudio(){this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.analyser=this.audioContext.createAnalyser();const t=this.$refs.canvas,n=t.getContext("2d");this.audioContext.createMediaStreamSource(this.audioStream).connect(this.analyser),this.analyser.fftSize=256;const o=this.analyser.frequencyBinCount,r=new Uint8Array(o),i=()=>{this.analyser.getByteFrequencyData(r),n.clearRect(0,0,t.width,t.height);const s=t.width/o*2.5,l=t.height/2;let d=0;n.strokeStyle="green",n.lineWidth=2,n.beginPath(),n.moveTo(0,l),n.lineTo(t.width,l),n.stroke(),r.forEach(u=>{const c=u;n.fillStyle=`rgb(50, ${c+100}, 50)`,n.fillRect(d,l-c/2,s,c),d+=s+1}),this.audioStream.active&&requestAnimationFrame(i)};i()}}},W4={ref:"canvas",width:"200",height:"40",class:"mx-auto flex items-center rounded"};function U4(t,n,a,o,r,i){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("canvas",W4,null,512)])}const Z4=Ce(q4,[["render",U4],["__scopeId","data-v-49dbe3dd"]]),Y4={key:0,class:"flex w-full items-center space-x-3 text-white dark:text-black"},X4=["disabled"],K4=["disabled"],Q4={key:0,class:"size-4 hover:text-red-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 10 16"},J4={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 hover:text-emerald-500"},e5={key:5,class:"flex w-full items-center space-x-2"},t5={class:"text-xs"},n5={key:0},a5={key:1,class:"flex items-center px-2 pr-[21px]"},o5=Ce({__name:"audioRecorder",props:{canSendMessage:Boolean,sendAudioToAttendant:{type:Function,required:!0},selectedAttendant:{type:Object,required:!0},attendant:{required:!0}},emits:["audio-sent","recording","b64Audio"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(null),i=e.ref(!1),s=e.ref(!1),l=e.ref(0),d=e.ref(0),u=e.ref(null),c=e.ref(null),m=e.ref(null),h=e.ref(null),p=e.ref(0),f=e.ref(0),g=e.ref(null),y=e.ref(!1),k=e.ref(!1),x=V=>{p.value=V},E=V=>{f.value=V},B=V=>{const v=Math.floor(V/60),$=(V%60).toFixed(0),Z=v.toString().padStart(2,"0"),Q=$.toString().padStart(2,"0");return`${Z}:${Q}`},M=async()=>{try{c.value=null,h.value=await navigator.mediaDevices.getUserMedia({audio:!0}),r.value=new MediaRecorder(h.value),r.value.ondataavailable=T,r.value.start(),_(),i.value=!0,o("recording",!0)}catch(V){console.error("Erro ao iniciar a gravação:",V)}},T=V=>{V.data.size>0&&!y.value&&(u.value=new Blob([V.data]),g.value=URL.createObjectURL(u.value),P())},_=()=>{let V=Date.now();m.value=setInterval(()=>{l.value=d.value+Math.floor((Date.now()-V)/1e3)},1e3)},C=async()=>{c.value=null,r.value&&i.value&&(s.value?(r.value.resume(),_()):(r.value.pause(),clearInterval(m.value),d.value=l.value),s.value=!s.value)},w=async()=>{r.value&&i.value&&(await r.value.stop(),clearInterval(m.value),i.value=!1,s.value=!1,P()),h.value&&h.value.getTracks().forEach(V=>V.stop())},P=async()=>{if(u.value){const V=new Blob([u.value],{type:"audio/mpeg"}),v=new FileReader;v.onload=()=>{c.value=v.result},v.readAsDataURL(V)}},F=async()=>{k.value=!0,o("b64Audio",c.value);const v={type:"file",media:{name:"audio",mimetype:($=>$?$.split(";")[0].split(":")[1]:null)(c.value),data:c.value}};await a.sendAudioToAttendant(a.selectedAttendant.id,v,a.attendant,!0),o("recording",!1),k.value=!1,h.value=null,c.value=null,u.value=null,i.value=!1,s.value=!1,l.value=0},H=async()=>{y.value=!0,i.value=!1,o("recording",!1),await r.value.stop(),h.value&&(h.value.getTracks().forEach(V=>V.stop()),h.value=null),u.value=null,clearInterval(m.value),c.value=null,s.value=!1,l.value=0};return(V,v)=>{var $;return k.value?(e.openBlock(),e.createElementBlock("div",a5,[...v[9]||(v[9]=[e.createElementVNode("span",{class:"loader-audio-recorder"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",Y4,[!i.value&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["send-audio-button",{recording:i.value}]),disabled:i.value||!t.canSendMessage,onClick:v[0]||(v[0]=Z=>(M(),d.value=0,y.value=!1))},[...v[3]||(v[3]=[e.createElementVNode("svg",{class:"start-recording-icon","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 19"},[e.createElementVNode("path",{d:"M15 5a1 1 0 0 0-1 1v3a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6a1 1 0 0 0-2 0v3a6.006 6.006 0 0 0 6 6h1v2H5a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9v-2h1a6.006 6.006 0 0 0 6-6V6a1 1 0 0 0-1-1Z"}),e.createElementVNode("path",{d:"M9 0H7a3 3 0 0 0-3 3v5a3 3 0 0 0 3 3h2a3 3 0 0 0 3-3V3a3 3 0 0 0-3-3Z"})],-1)])],10,X4)):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"rounded-full bg-red-500 p-1.5 hover:bg-red-600",onClick:v[1]||(v[1]=Z=>H())},[...v[4]||(v[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})],-1)])])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:!i.value&&!s.value,onClick:C},[s.value?(e.openBlock(),e.createElementBlock("svg",J4,[...v[6]||(v[6]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 7.5V18M15 7.5V18M3 16.811V8.69c0-.864.933-1.406 1.683-.977l7.108 4.061a1.125 1.125 0 010 1.954l-7.108 4.061A1.125 1.125 0 013 16.811z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Q4,[...v[5]||(v[5]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M0 .8C0 .358.32 0 .714 0h1.429c.394 0 .714.358.714.8v14.4c0 .442-.32.8-.714.8H.714a.678.678 0 0 1-.505-.234A.851.851 0 0 1 0 15.2V.8Zm7.143 0c0-.442.32-.8.714-.8h1.429c.19 0 .37.084.505.234.134.15.209.354.209.566v14.4c0 .442-.32.8-.714.8H7.857c-.394 0-.714-.358-.714-.8V.8Z","clip-rule":"evenodd"},null,-1)])]))],8,K4)):e.createCommentVNode("",!0),(i.value||u.value)&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"rounded-full p-1.5 hover:bg-gray-100 hover:text-light",onClick:w},[...v[7]||(v[7]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})],-1)])])):e.createCommentVNode("",!0),h.value&&i.value&&!s.value?(e.openBlock(),e.createBlock(Z4,{key:4,"audio-stream":h.value},null,8,["audio-stream"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",e5,[e.createVNode(S1,{avatar:(($=t.attendant)==null?void 0:$.photo)||null,audio:c.value,onDuration:x,onCurrentTime:E},null,8,["avatar","audio"]),e.createElementVNode("main",t5,[e.createElementVNode("div",null,e.toDisplayString(B(f.value)),1),i.value||u.value?(e.openBlock(),e.createElementBlock("div",n5,e.toDisplayString(B(l.value)),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"rounded-full p-2 hover:bg-base-100",onClick:v[2]||(v[2]=Z=>F())},[...v[8]||(v[8]=[e.createElementVNode("svg",{class:"size-5 text-base-200 rotate-90","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.createCommentVNode("",!0)]))}}},[["__scopeId","data-v-fe1e6df5"]]);function r5(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 B1=r5();let V1=0;const i5=()=>{const t=V1;return V1+=1,t},M1=(t,n)=>{const a={...t,id:i5(),group:t.group||""};return B1.emit("notify",{notification:a,timeout:n}),()=>B1.emit("close",a.id)};/*! Capacitor: https://capacitorjs.com/ - MIT License */var nn;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(nn||(nn={}));class Xa extends Error{constructor(n,a,o){super(n),this.message=n,this.code=a,this.data=o}}const s5=t=>{var n,a;return t!=null&&t.androidBridge?"android":!((a=(n=t==null?void 0:t.webkit)===null||n===void 0?void 0:n.messageHandlers)===null||a===void 0)&&a.bridge?"ios":"web"},l5=t=>{const n=t.CapacitorCustomPlatform||null,a=t.Capacitor||{},o=a.Plugins=a.Plugins||{},r=()=>n!==null?n.name:s5(t),i=()=>r()!=="web",s=m=>{const h=u.get(m);return!!(h!=null&&h.platforms.has(r())||l(m))},l=m=>{var h;return(h=a.PluginHeaders)===null||h===void 0?void 0:h.find(p=>p.name===m)},d=m=>t.console.error(m),u=new Map,c=(m,h={})=>{const p=u.get(m);if(p)return console.warn(`Capacitor plugin "${m}" already registered. Cannot register plugins twice.`),p.proxy;const f=r(),g=l(m);let y;const k=async()=>(!y&&f in h?y=typeof h[f]=="function"?y=await h[f]():y=h[f]:n!==null&&!y&&"web"in h&&(y=typeof h.web=="function"?y=await h.web():y=h.web),y),x=(C,w)=>{var P,F;if(g){const H=g==null?void 0:g.methods.find(V=>w===V.name);if(H)return H.rtype==="promise"?V=>a.nativePromise(m,w.toString(),V):(V,v)=>a.nativeCallback(m,w.toString(),V,v);if(C)return(P=C[w])===null||P===void 0?void 0:P.bind(C)}else{if(C)return(F=C[w])===null||F===void 0?void 0:F.bind(C);throw new Xa(`"${m}" plugin is not implemented on ${f}`,nn.Unimplemented)}},E=C=>{let w;const P=(...F)=>{const H=k().then(V=>{const v=x(V,C);if(v){const $=v(...F);return w=$==null?void 0:$.remove,$}else throw new Xa(`"${m}.${C}()" is not implemented on ${f}`,nn.Unimplemented)});return C==="addListener"&&(H.remove=async()=>w()),H};return P.toString=()=>`${C.toString()}() { [capacitor code] }`,Object.defineProperty(P,"name",{value:C,writable:!1,configurable:!1}),P},B=E("addListener"),M=E("removeListener"),T=(C,w)=>{const P=B({eventName:C},w),F=async()=>{const V=await P;M({eventName:C,callbackId:V},w)},H=new Promise(V=>P.then(()=>V({remove:F})));return H.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await F()},H},_=new Proxy({},{get(C,w){switch(w){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return g?T:B;case"removeListener":return M;default:return E(w)}}});return o[m]=_,u.set(m,{name:m,proxy:_,platforms:new Set([...Object.keys(h),...g?[f]:[]])}),_};return a.convertFileSrc||(a.convertFileSrc=m=>m),a.getPlatform=r,a.handleError=d,a.isNativePlatform=i,a.isPluginAvailable=s,a.registerPlugin=c,a.Exception=Xa,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a},Jn=(t=>t.Capacitor=l5(t))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),En=Jn.registerPlugin;class ea{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(n,a){let o=!1;this.listeners[n]||(this.listeners[n]=[],o=!0),this.listeners[n].push(a);const i=this.windowListeners[n];i&&!i.registered&&this.addWindowListener(i),o&&this.sendRetainedArgumentsForEvent(n);const s=async()=>this.removeListener(n,a);return Promise.resolve({remove:s})}async removeAllListeners(){this.listeners={};for(const n in this.windowListeners)this.removeWindowListener(this.windowListeners[n]);this.windowListeners={}}notifyListeners(n,a,o){const r=this.listeners[n];if(!r){if(o){let i=this.retainedEventArguments[n];i||(i=[]),i.push(a),this.retainedEventArguments[n]=i}return}r.forEach(i=>i(a))}hasListeners(n){var a;return!!(!((a=this.listeners[n])===null||a===void 0)&&a.length)}registerWindowListener(n,a){this.windowListeners[a]={registered:!1,windowEventName:n,pluginEventName:a,handler:o=>{this.notifyListeners(a,o)}}}unimplemented(n="not implemented"){return new Jn.Exception(n,nn.Unimplemented)}unavailable(n="not available"){return new Jn.Exception(n,nn.Unavailable)}async removeListener(n,a){const o=this.listeners[n];if(!o)return;const r=o.indexOf(a);this.listeners[n].splice(r,1),this.listeners[n].length||this.removeWindowListener(this.windowListeners[n])}addWindowListener(n){window.addEventListener(n.windowEventName,n.handler),n.registered=!0}removeWindowListener(n){n&&(window.removeEventListener(n.windowEventName,n.handler),n.registered=!1)}sendRetainedArgumentsForEvent(n){const a=this.retainedEventArguments[n];a&&(delete this.retainedEventArguments[n],a.forEach(o=>{this.notifyListeners(n,o)}))}}const N1=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),A1=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class c5 extends ea{async getCookies(){const n=document.cookie,a={};return n.split(";").forEach(o=>{if(o.length<=0)return;let[r,i]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=A1(r).trim(),i=A1(i).trim(),a[r]=i}),a}async setCookie(n){try{const a=N1(n.key),o=N1(n.value),r=`; expires=${(n.expires||"").replace("expires=","")}`,i=(n.path||"/").replace("path=",""),s=n.url!=null&&n.url.length>0?`domain=${n.url}`:"";document.cookie=`${a}=${o||""}${r}; path=${i}; ${s};`}catch(a){return Promise.reject(a)}}async deleteCookie(n){try{document.cookie=`${n.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}}async clearCookies(){try{const n=document.cookie.split(";")||[];for(const a of n)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(n){return Promise.reject(n)}}async clearAllCookies(){try{await this.clearCookies()}catch(n){return Promise.reject(n)}}}En("CapacitorCookies",{web:()=>new c5});const d5=async t=>new Promise((n,a)=>{const o=new FileReader;o.onload=()=>{const r=o.result;n(r.indexOf(",")>=0?r.split(",")[1]:r)},o.onerror=r=>a(r),o.readAsDataURL(t)}),u5=(t={})=>{const n=Object.keys(t);return Object.keys(t).map(r=>r.toLocaleLowerCase()).reduce((r,i,s)=>(r[i]=t[n[s]],r),{})},f5=(t,n=!0)=>t?Object.entries(t).reduce((o,r)=>{const[i,s]=r;let l,d;return Array.isArray(s)?(d="",s.forEach(u=>{l=n?encodeURIComponent(u):u,d+=`${i}=${l}&`}),d.slice(0,-1)):(l=n?encodeURIComponent(s):s,d=`${i}=${l}`),`${o}&${d}`},"").substr(1):null,T1=(t,n={})=>{const a=Object.assign({method:t.method||"GET",headers:t.headers},n),r=u5(t.headers)["content-type"]||"";if(typeof t.data=="string")a.body=t.data;else if(r.includes("application/x-www-form-urlencoded")){const i=new URLSearchParams;for(const[s,l]of Object.entries(t.data||{}))i.set(s,l);a.body=i.toString()}else if(r.includes("multipart/form-data")||t.data instanceof FormData){const i=new FormData;if(t.data instanceof FormData)t.data.forEach((l,d)=>{i.append(d,l)});else for(const l of Object.keys(t.data))i.append(l,t.data[l]);a.body=i;const s=new Headers(a.headers);s.delete("content-type"),a.headers=s}else(r.includes("application/json")||typeof t.data=="object")&&(a.body=JSON.stringify(t.data));return a};class m5 extends ea{async request(n){const a=T1(n,n.webFetchExtra),o=f5(n.params,n.shouldEncodeUrlParams),r=o?`${n.url}?${o}`:n.url,i=await fetch(r,a),s=i.headers.get("content-type")||"";let{responseType:l="text"}=i.ok?n:{};s.includes("application/json")&&(l="json");let d,u;switch(l){case"arraybuffer":case"blob":u=await i.blob(),d=await d5(u);break;case"json":d=await i.json();break;case"document":case"text":default:d=await i.text()}const c={};return i.headers.forEach((m,h)=>{c[h]=m}),{data:d,headers:c,status:i.status,url:i.url}}async get(n){return this.request(Object.assign(Object.assign({},n),{method:"GET"}))}async post(n){return this.request(Object.assign(Object.assign({},n),{method:"POST"}))}async put(n){return this.request(Object.assign(Object.assign({},n),{method:"PUT"}))}async patch(n){return this.request(Object.assign(Object.assign({},n),{method:"PATCH"}))}async delete(n){return this.request(Object.assign(Object.assign({},n),{method:"DELETE"}))}}En("CapacitorHttp",{web:()=>new m5});const ta={RECORDING:"RECORDING",PAUSED:"PAUSED",NONE:"NONE"},jt=En("VoiceRecorder",{web:()=>Promise.resolve().then(()=>bx).then(t=>new t.VoiceRecorderWeb)});function D1(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{d:"M8.25 4.5a3.75 3.75 0 1 1 7.5 0v8.25a3.75 3.75 0 1 1-7.5 0V4.5Z"}),e.createElementVNode("path",{d:"M6 10.5a.75.75 0 0 1 .75.75v1.5a5.25 5.25 0 1 0 10.5 0v-1.5a.75.75 0 0 1 1.5 0v1.5a6.751 6.751 0 0 1-6 6.709v2.291h3a.75.75 0 0 1 0 1.5h-7.5a.75.75 0 0 1 0-1.5h3v-2.291a6.751 6.751 0 0 1-6-6.709v-1.5A.75.75 0 0 1 6 10.5Z"})])}function h5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"})])}function F1(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z","clip-rule":"evenodd"})])}function p5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z","clip-rule":"evenodd"})])}function g5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 0 1 3.878.512.75.75 0 1 1-.256 1.478l-.209-.035-1.005 13.07a3 3 0 0 1-2.991 2.77H8.084a3 3 0 0 1-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 0 1-.256-1.478A48.567 48.567 0 0 1 7.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 0 1 3.369 0c1.603.051 2.815 1.387 2.815 2.951Zm-6.136-1.452a51.196 51.196 0 0 1 3.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 0 0-6 0v-.113c0-.794.609-1.428 1.364-1.452Zm-.355 5.945a.75.75 0 1 0-1.5.058l.347 9a.75.75 0 1 0 1.499-.058l-.346-9Zm5.48.058a.75.75 0 1 0-1.498-.058l-.347 9a.75.75 0 0 0 1.5.058l.345-9Z","clip-rule":"evenodd"})])}const y5={key:0,class:"bg-base-300 absolute bottom-14 left-0 z-50 flex w-full items-center justify-between rounded-t-2xl p-3"},k5={class:"flex h-11 items-center"},x5={key:0},b5={key:0},w5={key:1,class:"flex w-full justify-between rounded-lg border-2 border-gray-500 p-2 px-4"},E5={key:1},v5={class:"flex w-full items-center justify-between gap-2"},C5=["disabled"],S5=["disabled"],B5={key:1,class:"loader-mobile-audio-recorder"},V5=Ce({__name:"mobileAudioRecorder",props:{disableBtn:{type:Boolean,default:!1},sendAudioToAttendant:{type:Function,required:!0},selectedAttendant:{type:Object,required:!0},attendant:{required:!0}},emits:["audio-sent","recording","paused"],setup(t,{emit:n}){const a=n,o=t,r=e.ref(null),i=e.ref(!1),s=e.ref(0),l=e.ref(null),d=e.ref([]),u=e.ref(null),c=e.ref("00:00"),m=e.ref(!1),h=e.ref(null);let p=0;e.onUnmounted(()=>{_()});const f=()=>{let v;try{if(d.value.length>0){const $=d.value.map(ee=>{const L=atob(ee),R=new Array(L.length);for(let oe=0;oe<L.length;oe++)R[oe]=L.charCodeAt(oe);const O=new Uint8Array(R);return new Blob([O],{type:u.value})}),Z=new Blob($,{type:u.value}),Q=URL.createObjectURL(Z);return v=new Audio(Q),v}}catch($){console.error("Erro ao criar o objeto Audio:",$)}},g=v=>{v==="play"?(h.value.currentTime=p,h.value.oncanplay=()=>{h.value.play().then(()=>{m.value=!0}).catch($=>{console.error("Erro ao tentar reproduzir o áudio:",$)})},h.value.onended=()=>{m.value=!1,p=0},h.value.onerror=$=>{console.error("Erro ao carregar o áudio:",$)},h.value.load()):v==="pause"&&(h.value&&!h.value.paused?(m.value=!1,h.value.pause()):console.error("Nenhum áudio está tocando no momento"))},y=v=>{const $=Math.floor(v/60),Z=(v%60).toFixed(0),Q=$.toString().padStart(2,"0"),ee=Z.toString().padStart(2,"0");return`${Q}:${ee}`},k=()=>{s.value++,c.value=y(s.value)},x=()=>{l.value&&clearInterval(l.value),l.value=setInterval(k,1e3)},E=()=>{l.value&&clearInterval(l.value)},B=async()=>{let{value:v}=await jt.hasAudioRecordingPermission();if(v)try{jt.startRecording(),a("recording",!0),r.value="started",x()}catch($){console.error($)}else M1({group:"error",title:"Erro",text:"Permissões de microfone desativadas, ajuste nas configurações do dispositivo"},4e3)},M=()=>{try{a("paused",!0),r.value="paused",_(),E()}catch(v){console.error(v)}},T=()=>{try{h.value&&(h.value.pause(),m.value=!1),a("paused",!1),r.value="started",B(),x()}catch(v){console.error(v)}},_=async()=>{(await jt.getCurrentStatus()).status!=="NONE"&&await jt.stopRecording().then($=>{u.value=$.value.mimeType,d.value.push($.value.recordDataBase64),h.value=f(),E()})},C=async()=>{const v=await jt.getCurrentStatus();v.status==="RECORDING"?(await _(),a("paused",!1),a("recording",!1),r.value=null,d.value=[],i.value=!1,s.value=0,c.value=y(0)):v.status==="NONE"&&(a("recording",!1),a("paused",!1),r.value=null,i.value=!1,d.value=[],s.value=0,c.value=y(0))},w=async()=>{await jt.getCurrentStatus(),h.value&&(h.value.pause(),m.value=!1),C()};function P(v){const $=atob(v),Z=$.length,Q=new Uint8Array(Z);for(let ee=0;ee<Z;ee++)Q[ee]=$.charCodeAt(ee);return Q}function F(v){let $=v.reduce((ee,L)=>ee+L.length,0),Z=new Uint8Array($),Q=0;return v.forEach(ee=>{Z.set(ee,Q),Q+=ee.length}),Z}function H(v){let $="",Z=v.byteLength;for(let Q=0;Q<Z;Q++)$+=String.fromCharCode(v[Q]);return btoa($)}const V=async()=>{i.value=!0,(await jt.getCurrentStatus()).status==="RECORDING"&&await _();try{const $=d.value.map(P),Z=F($),Q=H(Z),ee=`data:${u.value};base64,${Q}`,R={type:"file",media:{name:"audio",mimetype:(O=>O?O.split(";")[0].split(":")[1]:null)(ee),data:ee}};console.log("payload",JSON.stringify(R)),await o.sendAudioToAttendant(o.selectedAttendant.id,R,o.attendant,!0),C()}catch($){C(),console.error("Erro ao enviar áudio:",$),M1({group:"error",title:"Erro",text:"Erro ao enviar áudio, tente novamente."},4e3);return}};return(v,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"bounce"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",y5,[e.createElementVNode("div",k5,[r.value!="paused"?(e.openBlock(),e.createElementBlock("section",x5,"Gravando")):e.createCommentVNode("",!0)]),r.value!="paused"?(e.openBlock(),e.createElementBlock("section",b5,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),r.value==="paused"?(e.openBlock(),e.createElementBlock("section",w5,[m.value?(e.openBlock(),e.createElementBlock("button",E5,[e.createVNode(e.unref(F1),{class:"size-6 cursor-pointer",onClick:$[1]||($[1]=Z=>g("pause"))})])):(e.openBlock(),e.createElementBlock("button",{key:0,onClick:$[0]||($[0]=Z=>g("play"))},[e.createVNode(e.unref(p5),{class:"size-6 cursor-pointer"})])),$[7]||($[7]=e.createElementVNode("div",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",v5,[r.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:$[2]||($[2]=Z=>w())},[e.createVNode(e.unref(g5),{class:"ml-2 size-6 cursor-pointer text-red-500/80 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value==="paused"?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:$[3]||($[3]=Z=>T())},[e.createVNode(e.unref(D1),{class:"size-7 cursor-pointer text-green-500/90 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value==="started"?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:$[4]||($[4]=Z=>M())},[e.createVNode(e.unref(F1),{class:"size-7 cursor-pointer text-green-500 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("button",{key:4,disabled:i.value,class:"mr-2 flex items-center justify-center rounded-full bg-primary p-2 drop-shadow-md",onClick:$[6]||($[6]=Z=>V())},[i.value?(e.openBlock(),e.createElementBlock("span",B5)):(e.openBlock(),e.createBlock(e.unref(h5),{key:0,class:"size-5 cursor-pointer"}))],8,S5)):(e.openBlock(),e.createElementBlock("button",{key:3,class:"rounded-full bg-primary p-2 send-audio-button",disabled:t.disableBtn,onClick:$[5]||($[5]=Z=>B())},[e.createVNode(e.unref(D1),{class:"hover:text-white size-5"})],8,C5))])],64))}},[["__scopeId","data-v-becd1b1f"]]),M5={class:"messages-container bg-base-300"},N5={class:"header-intern bg-base-300"},A5={class:"atendente-name"},T5={key:0,class:"date-separator bg-base-100/50"},D5={class:"date-separator-text"},F5={key:0,class:"dropdown-container-internal-messages"},L5=["onClick"],$5={class:"message-time"},P5={key:1},O5={class:"message-time"},_5={class:"input-area"},L1=Ce({__name:"ChatMessages",props:{isMobile:{type:Boolean,default:!1},selectedAtendente:{type:Object,required:!0},attendant:{required:!0},loadMessagesForAtendente:{type:Function,required:!0},sendMessageToAtendente:{type:Function,required:!0},hasNextPageForAtendente:{type:Function,required:!0},downloadFilesMobile:{type:Function},openMobilePdf:{type:Function}},emits:["send-files","voltar"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),i=e.ref(null),s=e.ref(!1),l=e.ref(!1),d=e.ref(!1),u=e.computed(()=>{var C;return((C=a.selectedAtendente)==null?void 0:C.messages)||[]}),c=C=>{a.isMobile&&a.openMobilePdf(C)},m=(C,w)=>{if(C)if(a.isMobile){const F=C.mimetype.split("/")[1],H={url:C.mimetype==="image/svg+xml"?C.data.replace("+","%2B"):C.data,type:F,title:C.name};a.downloadFilesMobile(H,w)}else _(C.data,w)},h=e.computed(()=>a.hasNextPageForAtendente(a.selectedAtendente.id)),p=C=>{const w=new Date(C),P=w.getHours(),F=w.getMinutes();return`${P.toString().padStart(2,"0")}:${F.toString().padStart(2,"0")}`},f=C=>{const w=new Date(C);return Nd(w)?"Hoje":Td(w)?"Ontem":Md(w)?Tr(w,"EEEE",{locale:lr}):Tr(w,"dd 'de' MMMM 'de' yyyy",{locale:lr})},g=C=>{if(C===0)return!0;const w=new Date(u.value[C].created_at),P=new Date(u.value[C-1].created_at);return w.toDateString()!==P.toDateString()},y=C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),E())},k=()=>{i.value&&i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})},x=async C=>{try{if(!h.value){C.complete();return}const w=i.value.scrollHeight,P=i.value.scrollTop;await a.loadMessagesForAtendente(a.selectedAtendente.id),await e.nextTick(),i.value.scrollTop=i.value.scrollHeight-w+P-32,C.loaded()}catch(w){console.error(w),C.complete()}},E=async()=>{if(r.value.trim()!=="")try{const C=JSON.parse(JSON.stringify(r.value));r.value="",await a.sendMessageToAtendente(a.selectedAtendente.id,C,a.attendant),await e.nextTick(),k()}catch(C){console.error("Erro ao enviar mensagem:",C)}},B=()=>{E();const C=document.querySelector(".send-button");C.classList.add("clicked"),setTimeout(()=>{C.classList.remove("clicked")},200)},M=()=>{o("send-files");const C=document.querySelector(".send-files-button");C.classList.add("clicked"),setTimeout(()=>{C.classList.remove("clicked")},200)};e.onMounted(async()=>{await e.nextTick(()=>{k(),s.value=!0})}),e.watch(()=>{var C;return(C=u.value)==null?void 0:C.length},(C,w)=>{u.value&&T()&&setTimeout(()=>{i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})},100)});function T(){const w=i.value.scrollTop+i.value.clientHeight;return i.value.scrollHeight-w<=80}const _=async(C,w="undefined")=>{const P=C.endsWith("svg+xml");try{const F=await fetch(P?C.replace("+","%2B"):C);if(!F.ok)throw new Error("Erro ao baixar o arquivo");const H=F.headers.get("Content-Type"),V=await F.arrayBuffer(),v=H&&H!=="application/octet-stream"?H:"audio/mp3",$=new Blob([V],{type:v}),Z=window.URL.createObjectURL($),Q=document.createElement("a");Q.href=Z;const ee=H.endsWith("aac")?`${w}.mp3`:w;Q.download=ee,document.body.appendChild(Q),Q.click(),document.body.removeChild(Q),window.URL.revokeObjectURL(Z)}catch(F){console.error("Erro no download:",F)}};return(C,w)=>{const P=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("div",M5,[e.createElementVNode("div",N5,[e.createElementVNode("button",{onClick:w[0]||(w[0]=F=>o("voltar")),class:"back-button"},[...w[4]||(w[4]=[e.createElementVNode("svg",{class:"w-6 h-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)])]),e.createVNode(Na,{url:t.selectedAtendente.photo},null,8,["url"]),e.createElementVNode("h3",A5,e.toDisplayString(t.selectedAtendente.name),1)]),e.createElementVNode("div",{class:"message-area",ref_key:"chatArea",ref:i},[!d.value&&h.value&&s.value?(e.openBlock(),e.createBlock(e.unref(hn),{key:0,onInfinite:x,distance:30,top:!0,direction:"top",class:"p-3"},{complete:e.withCtx(()=>[...w[5]||(w[5]=[e.createElementVNode("span",null,null,-1)])]),spinner:e.withCtx(()=>[...w[6]||(w[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),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(F,H)=>(e.openBlock(),e.createElementBlock("div",{key:H},[g(H)?(e.openBlock(),e.createElementBlock("div",T5,[w[7]||(w[7]=e.createElementVNode("div",{class:"date-separator-line"},null,-1)),e.createElementVNode("div",D5,e.toDisplayString(f(F.created_at)),1),w[8]||(w[8]=e.createElementVNode("div",{class:"date-separator-line"},null,-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["message",{me:F.sender.id===t.attendant.id,"not-me":F.sender.id!==t.attendant.id,"new-message":H===u.value.length-1}])},[e.createElementVNode("div",{class:e.normalizeClass(["relative",F.sender.id===t.attendant.id?"text-right":"text-left"])},[F.content&&F.content.media&&F.content.media.data?(e.openBlock(),e.createElementBlock("div",F5,[e.createVNode(P,{hover:"",class:"label-popper-internal-messages",placement:"left"},{content:e.withCtx(()=>[e.createElementVNode("button",{class:"download-button-internal-messages",onClick:V=>m(F.content.media,F.content.media.name)}," Baixar ",8,L5)]),default:e.withCtx(()=>[w[9]||(w[9]=e.createElementVNode("button",{class:"dropdown-toggle-internal-messages"},[e.createElementVNode("svg",{class:"dropdown-icon-internal-messages","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:"m19 9-7 7-7-7"})])],-1))]),_:2},1024)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["shadow shadow-gray-900 dark:shadow-gray-500",["message-content",{me:F.sender.id===t.attendant.id,"not-me":F.sender.id!==t.attendant.id}]])},[F.content&&F.content.media&&F.content.media.data?(e.openBlock(),e.createBlock(Ya,{key:0,mode:"message",isMobile:t.isMobile,onDownload:V=>m(F.content.media,F.content.media.name),onOpenMobilePdf:V=>c(F.content.media.data),avatar:F.sender.id===t.attendant.id?t.attendant.photo:F.sender.photo,fileName:F.content.media.name,base64:F.content.media.data,mimetype:F.content.media.mimetype},{"content-message":e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(F.content.content),1)]),"time-message":e.withCtx(()=>[e.createElementVNode("div",$5,e.toDisplayString(p(F.created_at)),1)]),_:2},1032,["isMobile","onDownload","onOpenMobilePdf","avatar","fileName","base64","mimetype"])):(e.openBlock(),e.createElementBlock("section",P5,[e.createElementVNode("p",null,e.toDisplayString(F.content.content),1),e.createElementVNode("div",O5,e.toDisplayString(p(F.created_at)),1)]))],2)],2)],2)]))),128))])],512),e.createElementVNode("div",_5,[e.withDirectives(e.createElementVNode("textarea",{type:"text","onUpdate:modelValue":w[1]||(w[1]=F=>r.value=F),class:"message-input bg-base-300 focus:ring-0",placeholder:"Digite sua mensagem...",onKeydown:y},null,544),[[e.vModelText,r.value]]),e.createElementVNode("button",{onClick:M,class:"send-files-button"},[...w[10]||(w[10]=[e.createElementVNode("svg",{class:"size-5 text-white","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:"M7 8v8a5 5 0 1 0 10 0V6.5a3.5 3.5 0 1 0-7 0V15a2 2 0 0 0 4 0V8"})],-1)])]),r.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:B,class:"send-button"},[...w[11]||(w[11]=[e.createElementVNode("svg",{class:"size-5 text-white rotate-90","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.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["bg-base-300",["send-audio-button",{recording:l.value}]])},[t.isMobile?(e.openBlock(),e.createBlock(V5,{key:0,attendant:t.attendant,selectedAttendant:t.selectedAtendente,sendAudioToAttendant:t.sendMessageToAtendente,onRecording:w[2]||(w[2]=F=>l.value=F)},null,8,["attendant","selectedAttendant","sendAudioToAttendant"])):(e.openBlock(),e.createBlock(o5,{key:1,"can-send-message":!0,attendant:t.attendant,selectedAttendant:t.selectedAtendente,sendAudioToAttendant:t.sendMessageToAtendente,onRecording:w[3]||(w[3]=F=>l.value=F)},null,8,["attendant","selectedAttendant","sendAudioToAttendant"]))],2))])])}}},[["__scopeId","data-v-5bc3a393"]]),H5={},R5={class:"loading"};function z5(t,n){return e.openBlock(),e.createElementBlock("div",R5,[...n[0]||(n[0]=[e.createElementVNode("svg",{class:"spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-30",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)])])}const $1=Ce(H5,[["render",z5],["__scopeId","data-v-bd52ddea"]]);/**
93
+ `,caption:y}]):Pe.show([{src:f,type:"image",caption:y}]))},c=()=>{const f=document.createElement("canvas"),g=320,y=180;f.width=g,f.height=y;const k=f.getContext("2d");return k.fillStyle="black",k.fillRect(0,0,g,y),f.toDataURL("image/png")};function m(f,g=1){return new Promise((y,k)=>{const x=document.createElement("video");x.src=f,x.crossOrigin="anonymous",x.muted=!0,x.playsInline=!0,x.preload="auto",x.addEventListener("loadeddata",()=>{x.readyState>=2&&(x.currentTime=g)}),x.addEventListener("seeked",()=>{const E=document.createElement("canvas");E.width=x.videoWidth,E.height=x.videoHeight,E.getContext("2d").drawImage(x,0,0,E.width,E.height);const M=E.toDataURL("image/png");y(M)})})}const h=f=>typeof f=="string"&&f.startsWith("data:")&&f.includes(";base64,"),p=f=>{const g=Math.floor(f/60),y=(f%60).toFixed(0),k=g.toString().padStart(2,"0"),x=y.toString().padStart(2,"0");return`${k}:${x}`};return e.onMounted(async()=>{try{const f=await m(n.base64),g=f&&f!=="data:,";a.value=g?f:c()}catch(f){console.error("Erro ao gerar thumbnail:",f),a.value=c()}}),(f,g)=>(e.openBlock(),e.createElementBlock("main",{class:e.normalizeClass({main_preview_files_container_message:t.mode==="message",main_preview_files_container_miniature:t.mode==="miniature","main_preview_files_container_preview bg-base-200":t.mode==="preview"})},[!t.isMobile&&i.value?(e.openBlock(),e.createElementBlock("section",f4,[t.mode!=="miniature"?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"iframe_preview_files",src:t.base64,frameborder:"0"},null,8,m4)):(e.openBlock(),e.createElementBlock("svg",h4,[...g[6]||(g[6]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"},null,-1)])]))])):t.isMobile&&i.value&&t.mode==="message"?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(t.mode==="message"?"flex flex-col bg-base-300 p-2 rounded-md gap-2":"")},[e.createElementVNode("span",p4,[g[7]||(g[7]=e.createElementVNode("svg",{class:"size-8 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",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("p",g4,e.toDisplayString(t.fileName),1)]),t.mode==="message"?(e.openBlock(),e.createElementBlock("div",y4,[e.createElementVNode("button",{class:"bg-base-200 p-2 text-primary w-full text-xs rounded-md hover:bg-base-100",onClick:g[0]||(g[0]=y=>f.$emit("open-mobile-pdf"))}," Abrir PDF ")])):e.createCommentVNode("",!0)],2)):s.value?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:g[1]||(g[1]=y=>u(t.base64,t.mimetype)),class:"video_message_preview_container"},[e.createElementVNode("div",k4,[e.createElementVNode("div",x4,[(e.openBlock(),e.createElementBlock("svg",b4,[...g[8]||(g[8]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",w4,[...g[9]||(g[9]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",E4,[...g[10]||(g[10]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",v4,[...g[11]||(g[11]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])]),e.createElementVNode("img",{class:e.normalizeClass(["preview_img",t.mode]),src:h(t.base64)?t.base64:t.base64.replace("+","%2B")},null,10,C4)])):d(t.mimetype)?(e.openBlock(),e.createElementBlock("section",S4,[t.mode==="preview"?(e.openBlock(),e.createElementBlock("video",{key:0,width:"300",height:"150",controls:"",src:t.base64},[e.createElementVNode("source",{src:t.base64,type:t.mimetype},null,8,V4)],8,B4)):t.mode==="miniature"?(e.openBlock(),e.createElementBlock("svg",M4,[...g[12]||(g[12]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14 7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7Zm2 9.387 4.684 1.562A1 1 0 0 0 22 17V7a1 1 0 0 0-1.316-.949L16 7.613v8.774Z","clip-rule":"evenodd"},null,-1)])])):t.mode==="message"?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:g[2]||(g[2]=y=>u(t.base64,t.mimetype)),class:"video_message_preview_container"},[a.value?(e.openBlock(),e.createElementBlock("section",N4,[e.createElementVNode("div",A4,[g[17]||(g[17]=e.createElementVNode("svg",{class:"size-12 text-white","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.6 5.2A1 1 0 0 0 7 6v12a1 1 0 0 0 1.6.8l8-6a1 1 0 0 0 0-1.6l-8-6Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",T4,[(e.openBlock(),e.createElementBlock("svg",D4,[...g[13]||(g[13]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",F4,[...g[14]||(g[14]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",L4,[...g[15]||(g[15]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",$4,[...g[16]||(g[16]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])]),e.createElementVNode("img",{class:e.normalizeClass(["preview_img",t.mode]),src:a.value},null,10,P4)])):(e.openBlock(),e.createElementBlock("span",O4,[...g[18]||(g[18]=[e.createElementVNode("span",{class:"loader-preview-lib"},null,-1)])]))])):e.createCommentVNode("",!0)])):l.value?(e.openBlock(),e.createElementBlock("section",_4,[t.mode!=="miniature"?(e.openBlock(),e.createElementBlock("section",H4,[e.createVNode(S1,{avatar:t.avatar,audio:t.base64,onDuration:g[3]||(g[3]=y=>o.value=y),onCurrentTime:g[4]||(g[4]=y=>r.value=y)},null,8,["avatar","audio"])])):(e.openBlock(),e.createElementBlock("svg",R4,[...g[19]||(g[19]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5 8a1 1 0 0 1 1 1v3a4.006 4.006 0 0 0 4 4h4a4.006 4.006 0 0 0 4-4V9a1 1 0 1 1 2 0v3.001A6.006 6.006 0 0 1 14.001 18H13v2h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2v-2H9.999A6.006 6.006 0 0 1 4 12.001V9a1 1 0 0 1 1-1Z","clip-rule":"evenodd"},null,-1),e.createElementVNode("path",{d:"M7 6a4 4 0 0 1 4-4h2a4 4 0 0 1 4 4v5a4 4 0 0 1-4 4h-2a4 4 0 0 1-4-4V6Z"},null,-1)])]))])):(e.openBlock(),e.createElementBlock("div",{key:5,class:e.normalizeClass(t.mode==="message"?"generic_files":"")},[g[20]||(g[20]=e.createElementVNode("div",null,[e.createElementVNode("svg",{class:"size-8 text-white","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:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-7Z","clip-rule":"evenodd"})])],-1)),t.mode==="message"?(e.openBlock(),e.createElementBlock("span",z4,[e.createElementVNode("p",j4,e.toDisplayString(t.fileName),1),e.createElementVNode("button",{class:"download_btn_generic_files",onClick:g[5]||(g[5]=y=>f.$emit("download"))}," Baixar arquivo ")])):e.createCommentVNode("",!0)],2)),t.mode==="message"?(e.openBlock(),e.createElementBlock("div",G4,[e.renderSlot(f.$slots,"content-message",{},void 0,!0),e.createElementVNode("div",{class:e.normalizeClass([o.value?"justify-between":" justify-end","flex w-full"])},[l.value&&o.value?(e.openBlock(),e.createElementBlock("p",I4,e.toDisplayString(p(o.value))+" - "+e.toDisplayString(r.value?p(r.value):"00:00"),1)):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"time-message",{},void 0,!0)],2)])):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-6405f10f"]]),q4={props:{audioStream:MediaStream},data(){return{audioContext:null,analyser:null}},mounted(){this.initializeAudio()},methods:{initializeAudio(){this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.analyser=this.audioContext.createAnalyser();const t=this.$refs.canvas,n=t.getContext("2d");this.audioContext.createMediaStreamSource(this.audioStream).connect(this.analyser),this.analyser.fftSize=256;const o=this.analyser.frequencyBinCount,r=new Uint8Array(o),i=()=>{this.analyser.getByteFrequencyData(r),n.clearRect(0,0,t.width,t.height);const s=t.width/o*2.5,l=t.height/2;let d=0;n.strokeStyle="green",n.lineWidth=2,n.beginPath(),n.moveTo(0,l),n.lineTo(t.width,l),n.stroke(),r.forEach(u=>{const c=u;n.fillStyle=`rgb(50, ${c+100}, 50)`,n.fillRect(d,l-c/2,s,c),d+=s+1}),this.audioStream.active&&requestAnimationFrame(i)};i()}}},W4={ref:"canvas",width:"200",height:"40",class:"mx-auto flex items-center rounded"};function U4(t,n,a,o,r,i){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("canvas",W4,null,512)])}const Z4=Ce(q4,[["render",U4],["__scopeId","data-v-49dbe3dd"]]),Y4={key:0,class:"flex w-full items-center space-x-3 text-white dark:text-black"},X4=["disabled"],K4=["disabled"],Q4={key:0,class:"size-4 hover:text-red-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 10 16"},J4={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 hover:text-emerald-500"},e5={key:5,class:"flex w-full items-center space-x-2"},t5={class:"text-xs"},n5={key:0},a5={key:1,class:"flex items-center px-2 pr-[21px]"},o5=Ce({__name:"audioRecorder",props:{canSendMessage:Boolean,sendAudioToAttendant:{type:Function,required:!0},selectedAttendant:{type:Object,required:!0},attendant:{required:!0}},emits:["audio-sent","recording","b64Audio"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(null),i=e.ref(!1),s=e.ref(!1),l=e.ref(0),d=e.ref(0),u=e.ref(null),c=e.ref(null),m=e.ref(null),h=e.ref(null),p=e.ref(0),f=e.ref(0),g=e.ref(null),y=e.ref(!1),k=e.ref(!1),x=V=>{p.value=V},E=V=>{f.value=V},B=V=>{const v=Math.floor(V/60),$=(V%60).toFixed(0),Z=v.toString().padStart(2,"0"),Q=$.toString().padStart(2,"0");return`${Z}:${Q}`},M=async()=>{try{c.value=null,h.value=await navigator.mediaDevices.getUserMedia({audio:!0}),r.value=new MediaRecorder(h.value),r.value.ondataavailable=T,r.value.start(),_(),i.value=!0,o("recording",!0)}catch(V){console.error("Erro ao iniciar a gravação:",V)}},T=V=>{V.data.size>0&&!y.value&&(u.value=new Blob([V.data]),g.value=URL.createObjectURL(u.value),P())},_=()=>{let V=Date.now();m.value=setInterval(()=>{l.value=d.value+Math.floor((Date.now()-V)/1e3)},1e3)},C=async()=>{c.value=null,r.value&&i.value&&(s.value?(r.value.resume(),_()):(r.value.pause(),clearInterval(m.value),d.value=l.value),s.value=!s.value)},w=async()=>{r.value&&i.value&&(await r.value.stop(),clearInterval(m.value),i.value=!1,s.value=!1,P()),h.value&&h.value.getTracks().forEach(V=>V.stop())},P=async()=>{if(u.value){const V=new Blob([u.value],{type:"audio/mpeg"}),v=new FileReader;v.onload=()=>{c.value=v.result},v.readAsDataURL(V)}},F=async()=>{k.value=!0,o("b64Audio",c.value);const v={type:"file",media:{name:"audio",mimetype:($=>$?$.split(";")[0].split(":")[1]:null)(c.value),data:c.value}};await a.sendAudioToAttendant(a.selectedAttendant.id,v,a.attendant,!0),o("recording",!1),k.value=!1,h.value=null,c.value=null,u.value=null,i.value=!1,s.value=!1,l.value=0},H=async()=>{y.value=!0,i.value=!1,o("recording",!1),await r.value.stop(),h.value&&(h.value.getTracks().forEach(V=>V.stop()),h.value=null),u.value=null,clearInterval(m.value),c.value=null,s.value=!1,l.value=0};return(V,v)=>{var $;return k.value?(e.openBlock(),e.createElementBlock("div",a5,[...v[9]||(v[9]=[e.createElementVNode("span",{class:"loader-audio-recorder"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",Y4,[!i.value&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["send-audio-button",{recording:i.value}]),disabled:i.value||!t.canSendMessage,onClick:v[0]||(v[0]=Z=>(M(),d.value=0,y.value=!1))},[...v[3]||(v[3]=[e.createElementVNode("svg",{class:"start-recording-icon","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 19"},[e.createElementVNode("path",{d:"M15 5a1 1 0 0 0-1 1v3a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6a1 1 0 0 0-2 0v3a6.006 6.006 0 0 0 6 6h1v2H5a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9v-2h1a6.006 6.006 0 0 0 6-6V6a1 1 0 0 0-1-1Z"}),e.createElementVNode("path",{d:"M9 0H7a3 3 0 0 0-3 3v5a3 3 0 0 0 3 3h2a3 3 0 0 0 3-3V3a3 3 0 0 0-3-3Z"})],-1)])],10,X4)):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"rounded-full bg-red-500 p-1.5 hover:bg-red-600",onClick:v[1]||(v[1]=Z=>H())},[...v[4]||(v[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})],-1)])])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:!i.value&&!s.value,onClick:C},[s.value?(e.openBlock(),e.createElementBlock("svg",J4,[...v[6]||(v[6]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 7.5V18M15 7.5V18M3 16.811V8.69c0-.864.933-1.406 1.683-.977l7.108 4.061a1.125 1.125 0 010 1.954l-7.108 4.061A1.125 1.125 0 013 16.811z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Q4,[...v[5]||(v[5]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M0 .8C0 .358.32 0 .714 0h1.429c.394 0 .714.358.714.8v14.4c0 .442-.32.8-.714.8H.714a.678.678 0 0 1-.505-.234A.851.851 0 0 1 0 15.2V.8Zm7.143 0c0-.442.32-.8.714-.8h1.429c.19 0 .37.084.505.234.134.15.209.354.209.566v14.4c0 .442-.32.8-.714.8H7.857c-.394 0-.714-.358-.714-.8V.8Z","clip-rule":"evenodd"},null,-1)])]))],8,K4)):e.createCommentVNode("",!0),(i.value||u.value)&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"rounded-full p-1.5 hover:bg-gray-100 hover:text-light",onClick:w},[...v[7]||(v[7]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})],-1)])])):e.createCommentVNode("",!0),h.value&&i.value&&!s.value?(e.openBlock(),e.createBlock(Z4,{key:4,"audio-stream":h.value},null,8,["audio-stream"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",e5,[e.createVNode(S1,{avatar:(($=t.attendant)==null?void 0:$.photo)||null,audio:c.value,onDuration:x,onCurrentTime:E},null,8,["avatar","audio"]),e.createElementVNode("main",t5,[e.createElementVNode("div",null,e.toDisplayString(B(f.value)),1),i.value||u.value?(e.openBlock(),e.createElementBlock("div",n5,e.toDisplayString(B(l.value)),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"rounded-full p-2 hover:bg-base-100",onClick:v[2]||(v[2]=Z=>F())},[...v[8]||(v[8]=[e.createElementVNode("svg",{class:"size-5 text-base-200 rotate-90","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.createCommentVNode("",!0)]))}}},[["__scopeId","data-v-fe1e6df5"]]);function r5(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 B1=r5();let V1=0;const i5=()=>{const t=V1;return V1+=1,t},M1=(t,n)=>{const a={...t,id:i5(),group:t.group||""};return B1.emit("notify",{notification:a,timeout:n}),()=>B1.emit("close",a.id)};/*! Capacitor: https://capacitorjs.com/ - MIT License */var nn;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(nn||(nn={}));class Xa extends Error{constructor(n,a,o){super(n),this.message=n,this.code=a,this.data=o}}const s5=t=>{var n,a;return t!=null&&t.androidBridge?"android":!((a=(n=t==null?void 0:t.webkit)===null||n===void 0?void 0:n.messageHandlers)===null||a===void 0)&&a.bridge?"ios":"web"},l5=t=>{const n=t.CapacitorCustomPlatform||null,a=t.Capacitor||{},o=a.Plugins=a.Plugins||{},r=()=>n!==null?n.name:s5(t),i=()=>r()!=="web",s=m=>{const h=u.get(m);return!!(h!=null&&h.platforms.has(r())||l(m))},l=m=>{var h;return(h=a.PluginHeaders)===null||h===void 0?void 0:h.find(p=>p.name===m)},d=m=>t.console.error(m),u=new Map,c=(m,h={})=>{const p=u.get(m);if(p)return console.warn(`Capacitor plugin "${m}" already registered. Cannot register plugins twice.`),p.proxy;const f=r(),g=l(m);let y;const k=async()=>(!y&&f in h?y=typeof h[f]=="function"?y=await h[f]():y=h[f]:n!==null&&!y&&"web"in h&&(y=typeof h.web=="function"?y=await h.web():y=h.web),y),x=(C,w)=>{var P,F;if(g){const H=g==null?void 0:g.methods.find(V=>w===V.name);if(H)return H.rtype==="promise"?V=>a.nativePromise(m,w.toString(),V):(V,v)=>a.nativeCallback(m,w.toString(),V,v);if(C)return(P=C[w])===null||P===void 0?void 0:P.bind(C)}else{if(C)return(F=C[w])===null||F===void 0?void 0:F.bind(C);throw new Xa(`"${m}" plugin is not implemented on ${f}`,nn.Unimplemented)}},E=C=>{let w;const P=(...F)=>{const H=k().then(V=>{const v=x(V,C);if(v){const $=v(...F);return w=$==null?void 0:$.remove,$}else throw new Xa(`"${m}.${C}()" is not implemented on ${f}`,nn.Unimplemented)});return C==="addListener"&&(H.remove=async()=>w()),H};return P.toString=()=>`${C.toString()}() { [capacitor code] }`,Object.defineProperty(P,"name",{value:C,writable:!1,configurable:!1}),P},B=E("addListener"),M=E("removeListener"),T=(C,w)=>{const P=B({eventName:C},w),F=async()=>{const V=await P;M({eventName:C,callbackId:V},w)},H=new Promise(V=>P.then(()=>V({remove:F})));return H.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await F()},H},_=new Proxy({},{get(C,w){switch(w){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return g?T:B;case"removeListener":return M;default:return E(w)}}});return o[m]=_,u.set(m,{name:m,proxy:_,platforms:new Set([...Object.keys(h),...g?[f]:[]])}),_};return a.convertFileSrc||(a.convertFileSrc=m=>m),a.getPlatform=r,a.handleError=d,a.isNativePlatform=i,a.isPluginAvailable=s,a.registerPlugin=c,a.Exception=Xa,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a},Jn=(t=>t.Capacitor=l5(t))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),En=Jn.registerPlugin;class ea{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(n,a){let o=!1;this.listeners[n]||(this.listeners[n]=[],o=!0),this.listeners[n].push(a);const i=this.windowListeners[n];i&&!i.registered&&this.addWindowListener(i),o&&this.sendRetainedArgumentsForEvent(n);const s=async()=>this.removeListener(n,a);return Promise.resolve({remove:s})}async removeAllListeners(){this.listeners={};for(const n in this.windowListeners)this.removeWindowListener(this.windowListeners[n]);this.windowListeners={}}notifyListeners(n,a,o){const r=this.listeners[n];if(!r){if(o){let i=this.retainedEventArguments[n];i||(i=[]),i.push(a),this.retainedEventArguments[n]=i}return}r.forEach(i=>i(a))}hasListeners(n){var a;return!!(!((a=this.listeners[n])===null||a===void 0)&&a.length)}registerWindowListener(n,a){this.windowListeners[a]={registered:!1,windowEventName:n,pluginEventName:a,handler:o=>{this.notifyListeners(a,o)}}}unimplemented(n="not implemented"){return new Jn.Exception(n,nn.Unimplemented)}unavailable(n="not available"){return new Jn.Exception(n,nn.Unavailable)}async removeListener(n,a){const o=this.listeners[n];if(!o)return;const r=o.indexOf(a);this.listeners[n].splice(r,1),this.listeners[n].length||this.removeWindowListener(this.windowListeners[n])}addWindowListener(n){window.addEventListener(n.windowEventName,n.handler),n.registered=!0}removeWindowListener(n){n&&(window.removeEventListener(n.windowEventName,n.handler),n.registered=!1)}sendRetainedArgumentsForEvent(n){const a=this.retainedEventArguments[n];a&&(delete this.retainedEventArguments[n],a.forEach(o=>{this.notifyListeners(n,o)}))}}const N1=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),A1=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class c5 extends ea{async getCookies(){const n=document.cookie,a={};return n.split(";").forEach(o=>{if(o.length<=0)return;let[r,i]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=A1(r).trim(),i=A1(i).trim(),a[r]=i}),a}async setCookie(n){try{const a=N1(n.key),o=N1(n.value),r=`; expires=${(n.expires||"").replace("expires=","")}`,i=(n.path||"/").replace("path=",""),s=n.url!=null&&n.url.length>0?`domain=${n.url}`:"";document.cookie=`${a}=${o||""}${r}; path=${i}; ${s};`}catch(a){return Promise.reject(a)}}async deleteCookie(n){try{document.cookie=`${n.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}}async clearCookies(){try{const n=document.cookie.split(";")||[];for(const a of n)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(n){return Promise.reject(n)}}async clearAllCookies(){try{await this.clearCookies()}catch(n){return Promise.reject(n)}}}En("CapacitorCookies",{web:()=>new c5});const d5=async t=>new Promise((n,a)=>{const o=new FileReader;o.onload=()=>{const r=o.result;n(r.indexOf(",")>=0?r.split(",")[1]:r)},o.onerror=r=>a(r),o.readAsDataURL(t)}),u5=(t={})=>{const n=Object.keys(t);return Object.keys(t).map(r=>r.toLocaleLowerCase()).reduce((r,i,s)=>(r[i]=t[n[s]],r),{})},f5=(t,n=!0)=>t?Object.entries(t).reduce((o,r)=>{const[i,s]=r;let l,d;return Array.isArray(s)?(d="",s.forEach(u=>{l=n?encodeURIComponent(u):u,d+=`${i}=${l}&`}),d.slice(0,-1)):(l=n?encodeURIComponent(s):s,d=`${i}=${l}`),`${o}&${d}`},"").substr(1):null,T1=(t,n={})=>{const a=Object.assign({method:t.method||"GET",headers:t.headers},n),r=u5(t.headers)["content-type"]||"";if(typeof t.data=="string")a.body=t.data;else if(r.includes("application/x-www-form-urlencoded")){const i=new URLSearchParams;for(const[s,l]of Object.entries(t.data||{}))i.set(s,l);a.body=i.toString()}else if(r.includes("multipart/form-data")||t.data instanceof FormData){const i=new FormData;if(t.data instanceof FormData)t.data.forEach((l,d)=>{i.append(d,l)});else for(const l of Object.keys(t.data))i.append(l,t.data[l]);a.body=i;const s=new Headers(a.headers);s.delete("content-type"),a.headers=s}else(r.includes("application/json")||typeof t.data=="object")&&(a.body=JSON.stringify(t.data));return a};class m5 extends ea{async request(n){const a=T1(n,n.webFetchExtra),o=f5(n.params,n.shouldEncodeUrlParams),r=o?`${n.url}?${o}`:n.url,i=await fetch(r,a),s=i.headers.get("content-type")||"";let{responseType:l="text"}=i.ok?n:{};s.includes("application/json")&&(l="json");let d,u;switch(l){case"arraybuffer":case"blob":u=await i.blob(),d=await d5(u);break;case"json":d=await i.json();break;case"document":case"text":default:d=await i.text()}const c={};return i.headers.forEach((m,h)=>{c[h]=m}),{data:d,headers:c,status:i.status,url:i.url}}async get(n){return this.request(Object.assign(Object.assign({},n),{method:"GET"}))}async post(n){return this.request(Object.assign(Object.assign({},n),{method:"POST"}))}async put(n){return this.request(Object.assign(Object.assign({},n),{method:"PUT"}))}async patch(n){return this.request(Object.assign(Object.assign({},n),{method:"PATCH"}))}async delete(n){return this.request(Object.assign(Object.assign({},n),{method:"DELETE"}))}}En("CapacitorHttp",{web:()=>new m5});const ta={RECORDING:"RECORDING",PAUSED:"PAUSED",NONE:"NONE"},jt=En("VoiceRecorder",{web:()=>Promise.resolve().then(()=>xx).then(t=>new t.VoiceRecorderWeb)});function D1(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{d:"M8.25 4.5a3.75 3.75 0 1 1 7.5 0v8.25a3.75 3.75 0 1 1-7.5 0V4.5Z"}),e.createElementVNode("path",{d:"M6 10.5a.75.75 0 0 1 .75.75v1.5a5.25 5.25 0 1 0 10.5 0v-1.5a.75.75 0 0 1 1.5 0v1.5a6.751 6.751 0 0 1-6 6.709v2.291h3a.75.75 0 0 1 0 1.5h-7.5a.75.75 0 0 1 0-1.5h3v-2.291a6.751 6.751 0 0 1-6-6.709v-1.5A.75.75 0 0 1 6 10.5Z"})])}function h5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"})])}function F1(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z","clip-rule":"evenodd"})])}function p5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z","clip-rule":"evenodd"})])}function g5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 0 1 3.878.512.75.75 0 1 1-.256 1.478l-.209-.035-1.005 13.07a3 3 0 0 1-2.991 2.77H8.084a3 3 0 0 1-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 0 1-.256-1.478A48.567 48.567 0 0 1 7.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 0 1 3.369 0c1.603.051 2.815 1.387 2.815 2.951Zm-6.136-1.452a51.196 51.196 0 0 1 3.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 0 0-6 0v-.113c0-.794.609-1.428 1.364-1.452Zm-.355 5.945a.75.75 0 1 0-1.5.058l.347 9a.75.75 0 1 0 1.499-.058l-.346-9Zm5.48.058a.75.75 0 1 0-1.498-.058l-.347 9a.75.75 0 0 0 1.5.058l.345-9Z","clip-rule":"evenodd"})])}const y5={key:0,class:"bg-base-300 absolute bottom-14 left-0 z-50 flex w-full items-center justify-between rounded-t-2xl p-3"},k5={class:"flex h-11 items-center"},x5={key:0},b5={key:0},w5={key:1,class:"flex w-full justify-between rounded-lg border-2 border-gray-500 p-2 px-4"},E5={key:1},v5={class:"flex w-full items-center justify-between gap-2"},C5=["disabled"],S5=["disabled"],B5={key:1,class:"loader-mobile-audio-recorder"},V5=Ce({__name:"mobileAudioRecorder",props:{disableBtn:{type:Boolean,default:!1},sendAudioToAttendant:{type:Function,required:!0},selectedAttendant:{type:Object,required:!0},attendant:{required:!0}},emits:["audio-sent","recording","paused"],setup(t,{emit:n}){const a=n,o=t,r=e.ref(null),i=e.ref(!1),s=e.ref(0),l=e.ref(null),d=e.ref([]),u=e.ref(null),c=e.ref("00:00"),m=e.ref(!1),h=e.ref(null);let p=0;e.onUnmounted(()=>{_()});const f=()=>{let v;try{if(d.value.length>0){const $=d.value.map(ee=>{const L=atob(ee),R=new Array(L.length);for(let oe=0;oe<L.length;oe++)R[oe]=L.charCodeAt(oe);const O=new Uint8Array(R);return new Blob([O],{type:u.value})}),Z=new Blob($,{type:u.value}),Q=URL.createObjectURL(Z);return v=new Audio(Q),v}}catch($){console.error("Erro ao criar o objeto Audio:",$)}},g=v=>{v==="play"?(h.value.currentTime=p,h.value.oncanplay=()=>{h.value.play().then(()=>{m.value=!0}).catch($=>{console.error("Erro ao tentar reproduzir o áudio:",$)})},h.value.onended=()=>{m.value=!1,p=0},h.value.onerror=$=>{console.error("Erro ao carregar o áudio:",$)},h.value.load()):v==="pause"&&(h.value&&!h.value.paused?(m.value=!1,h.value.pause()):console.error("Nenhum áudio está tocando no momento"))},y=v=>{const $=Math.floor(v/60),Z=(v%60).toFixed(0),Q=$.toString().padStart(2,"0"),ee=Z.toString().padStart(2,"0");return`${Q}:${ee}`},k=()=>{s.value++,c.value=y(s.value)},x=()=>{l.value&&clearInterval(l.value),l.value=setInterval(k,1e3)},E=()=>{l.value&&clearInterval(l.value)},B=async()=>{let{value:v}=await jt.hasAudioRecordingPermission();if(v)try{jt.startRecording(),a("recording",!0),r.value="started",x()}catch($){console.error($)}else M1({group:"error",title:"Erro",text:"Permissões de microfone desativadas, ajuste nas configurações do dispositivo"},4e3)},M=()=>{try{a("paused",!0),r.value="paused",_(),E()}catch(v){console.error(v)}},T=()=>{try{h.value&&(h.value.pause(),m.value=!1),a("paused",!1),r.value="started",B(),x()}catch(v){console.error(v)}},_=async()=>{(await jt.getCurrentStatus()).status!=="NONE"&&await jt.stopRecording().then($=>{u.value=$.value.mimeType,d.value.push($.value.recordDataBase64),h.value=f(),E()})},C=async()=>{const v=await jt.getCurrentStatus();v.status==="RECORDING"?(await _(),a("paused",!1),a("recording",!1),r.value=null,d.value=[],i.value=!1,s.value=0,c.value=y(0)):v.status==="NONE"&&(a("recording",!1),a("paused",!1),r.value=null,i.value=!1,d.value=[],s.value=0,c.value=y(0))},w=async()=>{await jt.getCurrentStatus(),h.value&&(h.value.pause(),m.value=!1),C()};function P(v){const $=atob(v),Z=$.length,Q=new Uint8Array(Z);for(let ee=0;ee<Z;ee++)Q[ee]=$.charCodeAt(ee);return Q}function F(v){let $=v.reduce((ee,L)=>ee+L.length,0),Z=new Uint8Array($),Q=0;return v.forEach(ee=>{Z.set(ee,Q),Q+=ee.length}),Z}function H(v){let $="",Z=v.byteLength;for(let Q=0;Q<Z;Q++)$+=String.fromCharCode(v[Q]);return btoa($)}const V=async()=>{i.value=!0,(await jt.getCurrentStatus()).status==="RECORDING"&&await _();try{const $=d.value.map(P),Z=F($),Q=H(Z),ee=`data:${u.value};base64,${Q}`,R={type:"file",media:{name:"audio",mimetype:(O=>O?O.split(";")[0].split(":")[1]:null)(ee),data:ee}};console.log("payload",JSON.stringify(R)),await o.sendAudioToAttendant(o.selectedAttendant.id,R,o.attendant,!0),C()}catch($){C(),console.error("Erro ao enviar áudio:",$),M1({group:"error",title:"Erro",text:"Erro ao enviar áudio, tente novamente."},4e3);return}};return(v,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"bounce"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",y5,[e.createElementVNode("div",k5,[r.value!="paused"?(e.openBlock(),e.createElementBlock("section",x5,"Gravando")):e.createCommentVNode("",!0)]),r.value!="paused"?(e.openBlock(),e.createElementBlock("section",b5,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),r.value==="paused"?(e.openBlock(),e.createElementBlock("section",w5,[m.value?(e.openBlock(),e.createElementBlock("button",E5,[e.createVNode(e.unref(F1),{class:"size-6 cursor-pointer",onClick:$[1]||($[1]=Z=>g("pause"))})])):(e.openBlock(),e.createElementBlock("button",{key:0,onClick:$[0]||($[0]=Z=>g("play"))},[e.createVNode(e.unref(p5),{class:"size-6 cursor-pointer"})])),$[7]||($[7]=e.createElementVNode("div",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",v5,[r.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:$[2]||($[2]=Z=>w())},[e.createVNode(e.unref(g5),{class:"ml-2 size-6 cursor-pointer text-red-500/80 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value==="paused"?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:$[3]||($[3]=Z=>T())},[e.createVNode(e.unref(D1),{class:"size-7 cursor-pointer text-green-500/90 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value==="started"?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:$[4]||($[4]=Z=>M())},[e.createVNode(e.unref(F1),{class:"size-7 cursor-pointer text-green-500 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("button",{key:4,disabled:i.value,class:"mr-2 flex items-center justify-center rounded-full bg-primary p-2 drop-shadow-md",onClick:$[6]||($[6]=Z=>V())},[i.value?(e.openBlock(),e.createElementBlock("span",B5)):(e.openBlock(),e.createBlock(e.unref(h5),{key:0,class:"size-5 cursor-pointer"}))],8,S5)):(e.openBlock(),e.createElementBlock("button",{key:3,class:"rounded-full bg-primary p-2 send-audio-button",disabled:t.disableBtn,onClick:$[5]||($[5]=Z=>B())},[e.createVNode(e.unref(D1),{class:"hover:text-white size-5"})],8,C5))])],64))}},[["__scopeId","data-v-becd1b1f"]]),M5={class:"messages-container bg-base-300"},N5={class:"header-intern bg-base-300"},A5={class:"atendente-name"},T5={key:0,class:"date-separator bg-base-100/50"},D5={class:"date-separator-text"},F5={key:0,class:"dropdown-container-internal-messages"},L5=["onClick"],$5={class:"message-time"},P5={key:1},O5={class:"message-time"},_5={class:"input-area"},L1=Ce({__name:"ChatMessages",props:{isMobile:{type:Boolean,default:!1},selectedAtendente:{type:Object,required:!0},attendant:{required:!0},loadMessagesForAtendente:{type:Function,required:!0},sendMessageToAtendente:{type:Function,required:!0},hasNextPageForAtendente:{type:Function,required:!0},downloadFilesMobile:{type:Function},openMobilePdf:{type:Function}},emits:["send-files","voltar"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),i=e.ref(null),s=e.ref(!1),l=e.ref(!1),d=e.ref(!1),u=e.computed(()=>{var C;return((C=a.selectedAtendente)==null?void 0:C.messages)||[]}),c=C=>{a.isMobile&&a.openMobilePdf(C)},m=(C,w)=>{if(C)if(a.isMobile){const F=C.mimetype.split("/")[1],H={url:C.mimetype==="image/svg+xml"?C.data.replace("+","%2B"):C.data,type:F,title:C.name};a.downloadFilesMobile(H,w)}else _(C.data,w)},h=e.computed(()=>a.hasNextPageForAtendente(a.selectedAtendente.id)),p=C=>{const w=new Date(C),P=w.getHours(),F=w.getMinutes();return`${P.toString().padStart(2,"0")}:${F.toString().padStart(2,"0")}`},f=C=>{const w=new Date(C);return Nd(w)?"Hoje":Td(w)?"Ontem":Md(w)?Tr(w,"EEEE",{locale:lr}):Tr(w,"dd 'de' MMMM 'de' yyyy",{locale:lr})},g=C=>{if(C===0)return!0;const w=new Date(u.value[C].created_at),P=new Date(u.value[C-1].created_at);return w.toDateString()!==P.toDateString()},y=C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),E())},k=()=>{i.value&&i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})},x=async C=>{try{if(!h.value){C.complete();return}const w=i.value.scrollHeight,P=i.value.scrollTop;await a.loadMessagesForAtendente(a.selectedAtendente.id),await e.nextTick(),i.value.scrollTop=i.value.scrollHeight-w+P-32,C.loaded()}catch(w){console.error(w),C.complete()}},E=async()=>{if(r.value.trim()!=="")try{const C=JSON.parse(JSON.stringify(r.value));r.value="",await a.sendMessageToAtendente(a.selectedAtendente.id,C,a.attendant),await e.nextTick(),k()}catch(C){console.error("Erro ao enviar mensagem:",C)}},B=()=>{E();const C=document.querySelector(".send-button");C.classList.add("clicked"),setTimeout(()=>{C.classList.remove("clicked")},200)},M=()=>{o("send-files");const C=document.querySelector(".send-files-button");C.classList.add("clicked"),setTimeout(()=>{C.classList.remove("clicked")},200)};e.onMounted(async()=>{await e.nextTick(()=>{k(),s.value=!0})}),e.watch(()=>{var C;return(C=u.value)==null?void 0:C.length},(C,w)=>{u.value&&T()&&setTimeout(()=>{i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})},100)});function T(){const w=i.value.scrollTop+i.value.clientHeight;return i.value.scrollHeight-w<=80}const _=async(C,w="undefined")=>{const P=C.endsWith("svg+xml");try{const F=await fetch(P?C.replace("+","%2B"):C);if(!F.ok)throw new Error("Erro ao baixar o arquivo");const H=F.headers.get("Content-Type"),V=await F.arrayBuffer(),v=H&&H!=="application/octet-stream"?H:"audio/mp3",$=new Blob([V],{type:v}),Z=window.URL.createObjectURL($),Q=document.createElement("a");Q.href=Z;const ee=H.endsWith("aac")?`${w}.mp3`:w;Q.download=ee,document.body.appendChild(Q),Q.click(),document.body.removeChild(Q),window.URL.revokeObjectURL(Z)}catch(F){console.error("Erro no download:",F)}};return(C,w)=>{const P=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("div",M5,[e.createElementVNode("div",N5,[e.createElementVNode("button",{onClick:w[0]||(w[0]=F=>o("voltar")),class:"back-button"},[...w[4]||(w[4]=[e.createElementVNode("svg",{class:"w-6 h-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)])]),e.createVNode(Na,{url:t.selectedAtendente.photo},null,8,["url"]),e.createElementVNode("h3",A5,e.toDisplayString(t.selectedAtendente.name),1)]),e.createElementVNode("div",{class:"message-area",ref_key:"chatArea",ref:i},[!d.value&&h.value&&s.value?(e.openBlock(),e.createBlock(e.unref(hn),{key:0,onInfinite:x,distance:30,top:!0,direction:"top",class:"p-3"},{complete:e.withCtx(()=>[...w[5]||(w[5]=[e.createElementVNode("span",null,null,-1)])]),spinner:e.withCtx(()=>[...w[6]||(w[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),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(F,H)=>(e.openBlock(),e.createElementBlock("div",{key:H},[g(H)?(e.openBlock(),e.createElementBlock("div",T5,[w[7]||(w[7]=e.createElementVNode("div",{class:"date-separator-line"},null,-1)),e.createElementVNode("div",D5,e.toDisplayString(f(F.created_at)),1),w[8]||(w[8]=e.createElementVNode("div",{class:"date-separator-line"},null,-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["message",{me:F.sender.id===t.attendant.id,"not-me":F.sender.id!==t.attendant.id,"new-message":H===u.value.length-1}])},[e.createElementVNode("div",{class:e.normalizeClass(["relative",F.sender.id===t.attendant.id?"text-right":"text-left"])},[F.content&&F.content.media&&F.content.media.data?(e.openBlock(),e.createElementBlock("div",F5,[e.createVNode(P,{hover:"",class:"label-popper-internal-messages",placement:"left"},{content:e.withCtx(()=>[e.createElementVNode("button",{class:"download-button-internal-messages",onClick:V=>m(F.content.media,F.content.media.name)}," Baixar ",8,L5)]),default:e.withCtx(()=>[w[9]||(w[9]=e.createElementVNode("button",{class:"dropdown-toggle-internal-messages"},[e.createElementVNode("svg",{class:"dropdown-icon-internal-messages","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:"m19 9-7 7-7-7"})])],-1))]),_:2},1024)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["shadow shadow-gray-900 dark:shadow-gray-500",["message-content",{me:F.sender.id===t.attendant.id,"not-me":F.sender.id!==t.attendant.id}]])},[F.content&&F.content.media&&F.content.media.data?(e.openBlock(),e.createBlock(Ya,{key:0,mode:"message",isMobile:t.isMobile,onDownload:V=>m(F.content.media,F.content.media.name),onOpenMobilePdf:V=>c(F.content.media.data),avatar:F.sender.id===t.attendant.id?t.attendant.photo:F.sender.photo,fileName:F.content.media.name,base64:F.content.media.data,mimetype:F.content.media.mimetype},{"content-message":e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(F.content.content),1)]),"time-message":e.withCtx(()=>[e.createElementVNode("div",$5,e.toDisplayString(p(F.created_at)),1)]),_:2},1032,["isMobile","onDownload","onOpenMobilePdf","avatar","fileName","base64","mimetype"])):(e.openBlock(),e.createElementBlock("section",P5,[e.createElementVNode("p",null,e.toDisplayString(F.content.content),1),e.createElementVNode("div",O5,e.toDisplayString(p(F.created_at)),1)]))],2)],2)],2)]))),128))])],512),e.createElementVNode("div",_5,[e.withDirectives(e.createElementVNode("textarea",{type:"text","onUpdate:modelValue":w[1]||(w[1]=F=>r.value=F),class:"message-input bg-base-300 focus:ring-0",placeholder:"Digite sua mensagem...",onKeydown:y},null,544),[[e.vModelText,r.value]]),e.createElementVNode("button",{onClick:M,class:"send-files-button"},[...w[10]||(w[10]=[e.createElementVNode("svg",{class:"size-5 text-white","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:"M7 8v8a5 5 0 1 0 10 0V6.5a3.5 3.5 0 1 0-7 0V15a2 2 0 0 0 4 0V8"})],-1)])]),r.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:B,class:"send-button"},[...w[11]||(w[11]=[e.createElementVNode("svg",{class:"size-5 text-white rotate-90","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.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["bg-base-300",["send-audio-button",{recording:l.value}]])},[t.isMobile?(e.openBlock(),e.createBlock(V5,{key:0,attendant:t.attendant,selectedAttendant:t.selectedAtendente,sendAudioToAttendant:t.sendMessageToAtendente,onRecording:w[2]||(w[2]=F=>l.value=F)},null,8,["attendant","selectedAttendant","sendAudioToAttendant"])):(e.openBlock(),e.createBlock(o5,{key:1,"can-send-message":!0,attendant:t.attendant,selectedAttendant:t.selectedAtendente,sendAudioToAttendant:t.sendMessageToAtendente,onRecording:w[3]||(w[3]=F=>l.value=F)},null,8,["attendant","selectedAttendant","sendAudioToAttendant"]))],2))])])}}},[["__scopeId","data-v-5bc3a393"]]),H5={},R5={class:"loading"};function z5(t,n){return e.openBlock(),e.createElementBlock("div",R5,[...n[0]||(n[0]=[e.createElementVNode("svg",{class:"spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-30",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)])])}const $1=Ce(H5,[["render",z5],["__scopeId","data-v-bd52ddea"]]);/**
94
94
  * Vue 3 Carousel 0.16.0
95
95
  * (c) 2025
96
96
  * @license MIT
@@ -129,4 +129,4 @@ $bm_rt = loopOut('cycle', 0);`},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,
129
129
  c5.426-1.969,11.42-1.629,16.591,0.935c5.171,2.565,9.08,7.133,10.792,12.646L353.732,451.163z M296.189,175.873
130
130
  c-5.686-1.423-12.815-2.847-22.064-2.847c-47.017,0-84.035,46.27-84.035,101.11c0,27.053,12.117,44.117,35.594,44.117
131
131
  c26.346,0,54.125-33.443,60.527-74.754L296.189,175.873z"/>
132
- </svg>`,info:a.content.info??"Nome que será atribuído no Produto",type:a.content.type??"text",placeholder:a.content.placeholder??"Integração de sistemas",empty:a.content.empty??!1,data:a.content.data??""}),i=e.ref(r.data);e.watch(i,l=>{o("update:content",{...r,data:l})},{immediate:!0,deep:!0}),e.watch(()=>a.content,l=>{l.data!==i.value&&(i.value=l.data),l.empty!==r.empty&&(r.empty=l.empty)},{deep:!0});const s=e.computed(()=>r.empty&&!i.value);return(l,d)=>{const u=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("section",xy,[e.createElementVNode("header",by,[e.createElementVNode("p",wy,e.toDisplayString(r.title),1),e.createVNode(u,{hover:"",content:r.info,placement:"top",arrow:""},{default:e.withCtx(()=>[...d[2]||(d[2]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-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.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1},8,["content"])]),e.createElementVNode("div",{class:e.normalizeClass(["input__container",s.value?"input__container--error":"",r.type==="textArea"?"textArea":""])},[r.type!=="textArea"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.value?"text-red-500":"text-base-100"),innerHTML:r.svg},null,10,Ey)):e.createCommentVNode("",!0),r.type!=="textArea"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:r.type,key:r.type,placeholder:r.placeholder,"onUpdate:modelValue":d[0]||(d[0]=c=>i.value=c),class:e.normalizeClass([s.value?"empty":null,"input__field"])},null,10,vy)),[[e.vModelDynamic,i.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:2,class:e.normalizeClass([s.value?"empty":null,"input__field h-full resize-y"]),"onUpdate:modelValue":d[1]||(d[1]=c=>i.value=c),placeholder:r.placeholder},null,10,Cy)),[[e.vModelText,i.value]]),s.value?(e.openBlock(),e.createElementBlock("span",Sy," Campo obrigatório ")):e.createCommentVNode("",!0)],2)])}}},[["__scopeId","data-v-cfd206c7"]]),By=["onClick"],Vy={key:0,xmlns:"http://www.w3.org/2000/svg",class:"size-4 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},My=["onClick"],Ny={key:0,xmlns:"http://www.w3.org/2000/svg",class:"size-4 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},ui=Ce({__name:"simpleSelect",props:{modelValue:{type:[Array,String,Number,Object],default:()=>[]},options:{type:Array,required:!0,default:()=>[]},placeholder:{type:String,default:"Selecione uma opção..."},multiple:{type:Boolean,default:!1},theme:{type:String,default:"bg-base-300 border-base-300"},teleportTo:{type:String,default:null}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),i=e.ref(null),s=e.ref(null),l=e.ref({});sn(i,()=>r.value=!1);const d=()=>{if(!a.teleportTo||!s.value)return;const p=s.value.getBoundingClientRect();l.value={position:"fixed",top:`${p.bottom+6}px`,left:`${p.left}px`,width:`${p.width}px`,zIndex:9999}};e.watch(r,p=>{p&&d()});const u=[];e.onMounted(()=>{if(a.teleportTo){const p=()=>{r.value&&d()};window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),u.push(["scroll",p],["resize",p])}}),e.onUnmounted(()=>{u.forEach(([p,f])=>window.removeEventListener(p,f,p==="scroll"?!0:void 0))});const c=p=>a.multiple&&Array.isArray(a.modelValue)?a.modelValue.includes(p):a.modelValue===p,m=p=>{if(a.multiple){const f=Array.isArray(a.modelValue)?[...a.modelValue]:[],g=f.indexOf(p);g===-1?f.push(p):f.splice(g,1),o("update:modelValue",f)}else o("update:modelValue",p),r.value=!1},h=e.computed(()=>{if(a.multiple&&Array.isArray(a.modelValue))return a.modelValue.length===0?a.placeholder:a.options.filter(g=>a.modelValue.includes(g.value)).map(g=>g.name).join(", ");const p=a.options.find(f=>f.value===a.modelValue);return(p==null?void 0:p.name)||a.placeholder});return(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:"relative w-full",ref_key:"dropdownRef",ref:i},[e.createElementVNode("div",{onClick:f[0]||(f[0]=g=>r.value=!r.value),class:e.normalizeClass(["flex flex-wrap items-center justify-between p-3 gap-2 rounded-md cursor-pointer transition",t.theme]),ref_key:"triggerRef",ref:s},[e.createElementVNode("span",{class:e.normalizeClass(["text-xs truncate max-w-full",h.value===t.placeholder?"text-gray-400":"text-white"])},e.toDisplayString(h.value),3),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["size-3 text-white transition-transform duration-300",r.value?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...f[1]||(f[1]=[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),r.value&&!t.teleportTo?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute flex flex-col z-10 mt-1.5 w-full shadow-sm border rounded-md max-h-64 overflow-y-auto hide-scrollbar",t.theme])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass([c(g.value)?"bg-green-500/30 hover:bg-green-500/50":"hover:bg-base-200","flex items-center justify-between gap-2 px-3 py-2 text-left text-sm cursor-pointer transition w-full"]),onClick:y=>m(g.value)},[e.createElementVNode("span",null,e.toDisplayString(g.name),1),c(g.value)?(e.openBlock(),e.createElementBlock("svg",Vy,[...f[2]||(f[2]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):e.createCommentVNode("",!0)],10,By))),128))],2)):e.createCommentVNode("",!0),r.value&&t.teleportTo?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:t.teleportTo},[e.createElementVNode("div",{style:e.normalizeStyle(l.value),class:e.normalizeClass(["flex flex-col shadow-sm border rounded-md max-h-64 overflow-y-auto hide-scrollbar",t.theme])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass([c(g.value)?"bg-green-500/30 hover:bg-green-500/50":"hover:bg-base-200","flex items-center justify-between gap-2 px-3 py-2 text-left text-sm cursor-pointer transition w-full"]),onClick:y=>m(g.value)},[e.createElementVNode("span",null,e.toDisplayString(g.name),1),c(g.value)?(e.openBlock(),e.createElementBlock("svg",Ny,[...f[3]||(f[3]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):e.createCommentVNode("",!0)],10,My))),128))],6)],8,["to"])):e.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-3ee440f9"]]),Ay={class:"flex gap-2"},Ty=Ce({__name:"outcomeButton",props:{outcome:{type:String,default:null}},emits:["update:outcome","change"],setup(t,{emit:n}){const a=t,o=n;async function r(l){const d=a.outcome===l?null:l;o("update:outcome",d),o("change",d)}const i=e.computed(()=>a.outcome==="won"),s=e.computed(()=>a.outcome==="lost");return(l,d)=>(e.openBlock(),e.createElementBlock("div",Ay,[e.createElementVNode("button",{onClick:d[0]||(d[0]=u=>r("won")),class:e.normalizeClass(["button_outcome-base",{"button_outcome-active-won":i.value}])},[d[3]||(d[3]=e.createElementVNode("p",null,"Aceito",-1)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"svg_outcome-active-won":i.value},"text-white size-4"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none"},[...d[2]||(d[2]=[e.createElementVNode("path",{d:"M3.16666 6.37502C3.74962 6.37502 4.2222 6.85073 4.22222 7.43752V15.9375C4.22222 16.5243 3.74963 17 3.16666 17H1.05555C0.472588 17 0 16.5243 0 15.9375V7.43752C1.50967e-05 6.85073 0.472597 6.37502 1.05555 6.37502H3.16666Z",fill:"CurrentColor"},null,-1),e.createElementVNode("path",{d:"M9.48143 1.4454C9.79496 -0.637173 11.5194 0.143216 11.5194 0.143216C13.863 1.75728 13.005 4.80783 12.2832 6.13118H17.4424C19.5307 6.65187 19.0768 8.34354 18.5887 9.12465C19.5056 10.7905 18.4191 11.7716 17.7609 12.0538C18.1175 13.7717 17.0601 14.4178 16.4869 14.5264C16.8944 16.4004 15.5533 16.9564 14.8314 17H10.436C8.49997 16.9999 6.19055 16.1753 5.27777 15.7632V7.368C9.03523 5.6108 9.09933 3.98356 9.48143 1.4454Z",fill:"CurrentColor"},null,-1)])],2))],2),e.createElementVNode("button",{onClick:d[1]||(d[1]=u=>r("lost")),class:e.normalizeClass(["button_outcome-base",{"button_outcome-active-lost":s.value}])},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"svg_outcome-active-lost":s.value},"text-white size-4 mt-0.8"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 19",fill:"none"},[...d[4]||(d[4]=[e.createElementVNode("path",{d:"M15.8333 10.625C15.2504 10.625 14.7778 10.1493 14.7778 9.56249L14.7778 1.0625C14.7778 0.475698 15.2504 1.57955e-06 15.8333 1.63051e-06L17.9444 1.81507e-06C18.5274 1.86603e-06 19 0.475698 19 1.0625L19 9.56249C19 10.1493 18.5274 10.625 17.9444 10.625L15.8333 10.625Z",fill:"CurrentColor"},null,-1),e.createElementVNode("path",{d:"M9.51857 15.5546C9.20504 17.6372 7.48065 16.8568 7.48065 16.8568C5.13698 15.2427 5.99503 12.1922 6.71681 10.8688L1.55759 10.8688C-0.530671 10.3481 -0.0768444 8.65646 0.411319 7.87535C-0.50562 6.20951 0.580926 5.22844 1.23906 4.94622C0.882549 3.22832 1.93994 2.5822 2.51315 2.47363C2.10564 0.59965 3.44673 0.0436064 4.16864 6.1075e-07L8.56403 9.95007e-07C10.5 0.000138493 12.8095 0.824657 13.7222 1.23682L13.7222 9.632C9.96477 11.3892 9.90067 13.0164 9.51857 15.5546Z",fill:"CurrentColor"},null,-1)])],2)),d[5]||(d[5]=e.createElementVNode("p",null,"Perdido",-1))],2)]))}},[["__scopeId","data-v-f9b09b5e"]]),Dy={class:"flex gap-1 select-none"},Fy=["onMousemove","onClick"],ao=Ce({__name:"raitingInput",props:{modelValue:{type:Number,default:0}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(a.modelValue),i=e.ref(0);e.watch(()=>a.modelValue,c=>{r.value=c});const s=e.computed(()=>i.value||r.value);function l(c){const m=s.value-c+1;return m>=1?"100%":m>=.5?"50%":m>0?`${m*100}%`:"0%"}function d(c,m){const h=c.currentTarget.getBoundingClientRect(),p=c.offsetX<h.width/2;i.value=m-(p?.5:0)}function u(c,m){const h=c.currentTarget.getBoundingClientRect(),p=c.offsetX<h.width/2,f=m-(p?.5:0);r.value=r.value===f?0:f,o("update:modelValue",r.value)}return(c,m)=>(e.openBlock(),e.createElementBlock("main",Dy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,h=>e.createElementVNode("div",{key:h,class:"relative size-6 cursor-pointer",onMousemove:p=>d(p,h),onMouseleave:m[0]||(m[0]=p=>i.value=0),onClick:p=>u(p,h)},[m[2]||(m[2]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"absolute top-0 left-0 size-6 color-disabled"},[e.createElementVNode("path",{d:"M13.849 4.22c-.684-1.626-3.014-1.626-3.698 0L8.397 8.387l-4.552.361c-1.775.14-2.495 2.331-1.142 3.477l3.468 2.937-1.06 4.392c-.413 1.713 1.472 3.067 2.992 2.149L12 19.35l3.897 2.354c1.52.918 3.405-.436 2.992-2.15l-1.06-4.39 3.468-2.938c1.353-1.146.633-3.336-1.142-3.477l-4.552-.36-1.754-4.17Z"})],-1)),e.createElementVNode("div",{class:"absolute top-0 left-0 h-full overflow-hidden text-primary transition-all duration-150",style:e.normalizeStyle({width:l(h)})},[...m[1]||(m[1]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"size-6"},[e.createElementVNode("path",{d:"M13.849 4.22c-.684-1.626-3.014-1.626-3.698 0L8.397 8.387l-4.552.361c-1.775.14-2.495 2.331-1.142 3.477l3.468 2.937-1.06 4.392c-.413 1.713 1.472 3.067 2.992 2.149L12 19.35l3.897 2.354c1.52.918 3.405-.436 2.992-2.15l-1.06-4.39 3.468-2.938c1.353-1.146.633-3.336-1.142-3.477l-4.552-.36-1.754-4.17Z"})],-1)])],4)],40,Fy)),64))]))}},[["__scopeId","data-v-af20a8bd"]]),Ly={key:1,class:"flex flex-col w-full"},$y={key:0,class:"sticky top-0 z-10 bg-base-300 p-1 flex gap-2"},Py={class:"sticky bottom-0 bg-green-900 p-1.5 text-[10px] rounded-md border border-green-500 w-full"},Oy={class:"flex-1 overflow-y-auto flex flex-col gap-2 px-2"},_y={key:0,class:"w-full text-gray-500 list-none list-inside dark:text-gray-400 divide-y divide-base-200"},Hy={class:"flex gap-2 items-center"},Ry=["src"],zy={key:1,class:"size-8 rounded-md flex items-center justify-center border border-base-200"},jy={class:"flex flex-col items-start"},Gy={class:"text-xs font-semibold font-sans"},Iy={class:"flex gap-1"},qy={class:"flex gap-1"},Wy=["onClick"],Uy=["onClick"],Zy={key:1,class:"flex flex-col gap-1 min-h-48 flex-1 w-full justify-center items-center"},Yy=Ce({__name:"listProducts",props:{modelValue:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),i=e.ref([]),s=e.ref([...a.modelValue]),l=e.ref(1),d=e.ref(null),u=e.ref(null),c=e.computed(()=>s.value.reduce((T,_)=>{var P;const C=((P=_.product)==null?void 0:P.price)||_.price||0,w=_.quantity||0;return T+C*w},0)),m=e.computed(()=>{const T={};return s.value.forEach(_=>{T[_.product.id]=_.quantity}),T}),h=T=>m.value[T.id]||0,p=T=>{const _=s.value.find(C=>C.product.id===T.id);_?_.quantity++:s.value.push({product:{...T},quantity:1})},f=T=>{const _=s.value.find(C=>C.product.id===T.id);_&&(_.quantity>0?_.quantity--:_.quantity=0)},g=(T,_)=>{const C=new URLSearchParams,w=T;return Object.keys(_).forEach(P=>C.append(P,_[P])),`${w}?${C.toString()}`},y=async T=>{try{const{data:_}=await ot.get(g(Fs,{page:l.value,...T})),{results:C,next:w,previous:P}=_;if(d.value=w,u.value=P,l.value===1)i.value=C;else{const F=new Set(i.value.map(V=>V.id)),H=C.filter(V=>!F.has(V.id));i.value=[...i.value,...H]}d.value&&(l.value+=1)}catch(_){console.error("Erro ao buscar produtos:",_)}};e.onMounted(()=>{y()}),e.watch(s,T=>{o("update:modelValue",T)},{deep:!0});const k=e.ref(!1),x=async T=>{if(!k.value){k.value=!0;try{if(!d.value){T.complete();return}await y(),d.value?T.loaded():T.complete()}catch(_){console.error("Erro ao carregar produtos:",_),T.complete()}finally{k.value=!1}}},E=e.ref({query:"",recurrence:"",status:""}),B=e.ref(!1);let M;return e.watch(E,()=>{clearTimeout(M),M=setTimeout(async()=>{const{query:T,recurrence:_,status:C}=E.value;l.value=1,B.value=!!(T||_||C),r.value=!0,await y({query:T,recurrence:_,status:C}),r.value=!1},500)},{deep:!0}),(T,_)=>{const C=e.resolveComponent("SimpleLoader");return r.value?(e.openBlock(),e.createBlock(C,{key:0})):(e.openBlock(),e.createElementBlock("main",Ly,[i.value.length>0&&!B.value||B.value?(e.openBlock(),e.createElementBlock("header",$y,[e.withDirectives(e.createElementVNode("input",{class:"w-full text-xs bg-base-300 rounded-md p-1 outline-none border-none focus:outline-none focus:ring-0 focus:shadow-none",type:"text",placeholder:"Buscar...","onUpdate:modelValue":_[0]||(_[0]=w=>E.value.query=w)},null,512),[[e.vModelText,E.value.query]]),e.createElementVNode("section",Py," Valor total: R$"+e.toDisplayString(c.value.toFixed(2)),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Oy,[i.value.length>0&&!B.value||B.value?(e.openBlock(),e.createElementBlock("ul",_y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(w,P)=>(e.openBlock(),e.createElementBlock("li",{class:"flex w-full justify-between items-center py-2",key:w.id},[e.createElementVNode("div",Hy,[e.createElementVNode("section",null,[w.photo?(e.openBlock(),e.createElementBlock("img",{key:0,class:"size-8 rounded-md",src:w.photo,alt:""},null,8,Ry)):(e.openBlock(),e.createElementBlock("div",zy,[..._[1]||(_[1]=[e.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M4 19v2c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2H4Z"}),e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M9 3c0-.55228.44772-1 1-1h8c.5523 0 1 .44772 1 1v3c0 .55228-.4477 1-1 1h-2v1h2c.5096 0 .9376.38314.9939.88957L19.8951 17H4.10498l.90116-8.11043C5.06241 8.38314 5.49047 8 6.00002 8H12V7h-2c-.55228 0-1-.44772-1-1V3Zm1.01 8H8.00002v2.01H10.01V11Zm.99 0h2.01v2.01H11V11Zm5.01 0H14v2.01h2.01V11Zm-8.00998 3H10.01v2.01H8.00002V14ZM13.01 14H11v2.01h2.01V14Zm.99 0h2.01v2.01H14V14ZM11 4h6v1h-6V4Z","clip-rule":"evenodd"})],-1)])]))]),e.createElementVNode("section",jy,[e.createElementVNode("p",{class:e.normalizeClass(["text-xs font-semibold",h(w)>0?"text-white":""])},e.toDisplayString(w.name),3),e.createElementVNode("p",Gy," R$ "+e.toDisplayString(w.price.toFixed(2)),1)])]),e.createElementVNode("section",Iy,[e.createElementVNode("p",{class:e.normalizeClass(["text-xs font-semibold font-sans products-and-services_badge",w.recurrence])},e.toDisplayString(w.recurrence==="monthly"?"Mensal":"Único"),3),e.createElementVNode("div",qy,[e.createElementVNode("button",{class:"bg-base-200 size-6 rounded-md flex items-center justify-center",onClick:F=>f(w)}," - ",8,Wy),e.createElementVNode("p",{class:e.normalizeClass(["w-5 text-xs flex items-center justify-center font-semibold font-sans",h(w)>0?"text-white":""])},e.toDisplayString(h(w)),3),e.createElementVNode("button",{class:"bg-base-200 size-6 rounded-md flex items-center justify-center",onClick:F=>p(w)}," + ",8,Uy)])])]))),128))])):e.createCommentVNode("",!0),B.value&&i.value.length===0||i.value.length===0?(e.openBlock(),e.createElementBlock("section",Zy,[..._[2]||(_[2]=[e.createStaticVNode('<p class="text-gray-600 text-base font-sans" data-v-6d666047>Nenhum item encontrado</p><p class="text-gray-600 text-xs font-sans" data-v-6d666047> Comece criando seu primeiro na aba <strong data-v-6d666047>Produtos</strong></p><button class="bg-green-700 text-white py-1 px-2 rounded-md text-xs mt-2 hover:bg-green-600 flex gap-1 items-center justify-center" data-v-6d666047><p data-v-6d666047>Criar novo</p><svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" data-v-6d666047><path fill="currentColor" d="M4 19v2c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2H4Z" data-v-6d666047></path><path fill="currentColor" fill-rule="evenodd" d="M9 3c0-.55228.44772-1 1-1h8c.5523 0 1 .44772 1 1v3c0 .55228-.4477 1-1 1h-2v1h2c.5096 0 .9376.38314.9939.88957L19.8951 17H4.10498l.90116-8.11043C5.06241 8.38314 5.49047 8 6.00002 8H12V7h-2c-.55228 0-1-.44772-1-1V3Zm1.01 8H8.00002v2.01H10.01V11Zm.99 0h2.01v2.01H11V11Zm5.01 0H14v2.01h2.01V11Zm-8.00998 3H10.01v2.01H8.00002V14ZM13.01 14H11v2.01h2.01V14Zm.99 0h2.01v2.01H14V14ZM11 4h6v1h-6V4Z" clip-rule="evenodd" data-v-6d666047></path></svg></button>',3)])])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createBlock(e.unref(hn),{key:2,onInfinite:x,class:"p-3 bg-base-300"},{spinner:e.withCtx(()=>[..._[3]||(_[3]=[e.createElementVNode("section",{class:"w-full justify-center items-center flex"},[e.createElementVNode("div",{class:"size-4 animate-spin rounded-full border-4 border-solid border-white border-t-transparent"})],-1)])]),_:1})):e.createCommentVNode("",!0)])]))}}},[["__scopeId","data-v-6d666047"]]),Xy={class:"test-style p-2 h-full overflow-auto"},Ky={class:"flex flex-col gap-3"},Qy=["onUpdate:modelValue"],Jy={class:"text-xs"},ek=["onUpdate:modelValue"],tk=["onUpdate:modelValue"],nk=Ce({__name:"listSegmentationsFields",props:{modelValue:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref([...a.modelValue]);return e.watch(r,i=>{o("update:modelValue",i)},{deep:!0}),(i,s)=>{const l=e.resolveComponent("SimpleSelect");return e.openBlock(),e.createElementBlock("div",Xy,[s[0]||(s[0]=e.createElementVNode("header",{class:"text-start w-full items-center justify-between flex mb-2 px-1"},[e.createElementVNode("p",{class:"text-xs font-semibold"},"Campos Personalizados")],-1)),e.createElementVNode("div",Ky,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,d=>(e.openBlock(),e.createElementBlock("section",{key:d.id},[e.createElementVNode("div",{class:e.normalizeClass(["flex gap-1 rounded-md",d.type==="bool"?"flex-row items-center":"flex-col items-start"])},[d.type==="bool"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,class:"checkbox size-4 rounded-sm",type:"checkbox","onUpdate:modelValue":u=>d.content=u},null,8,Qy)),[[e.vModelCheckbox,d.content]]):e.createCommentVNode("",!0),e.createElementVNode("p",Jy,e.toDisplayString(d.name)+":",1),d.type==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,class:"input_field",type:"text","onUpdate:modelValue":u=>d.content=u},null,8,ek)),[[e.vModelText,d.content]]):e.createCommentVNode("",!0),d.type==="float"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,class:"input_field",type:"number","onUpdate:modelValue":u=>d.content=u},null,8,tk)),[[e.vModelText,d.content]]):e.createCommentVNode("",!0),d.type==="list"?(e.openBlock(),e.createBlock(l,{key:3,modelValue:d.content,"onUpdate:modelValue":u=>d.content=u,options:d.additional_info.list.options.map(u=>({value:u,name:u})),placeholder:"Selecione uma opção",theme:"bg-base-300 border-base-100","teleport-to":"body"},null,8,["modelValue","onUpdate:modelValue","options"])):e.createCommentVNode("",!0)],2)]))),128))])])}}},[["__scopeId","data-v-25c16443"]]),ak={class:"modal_head"},ok={class:"modal_responsive"},rk={class:"flex min-h-full items-center justify-center text-center"},ik={class:"z-50 w-full lg:w-1/2 shadow rounded-2xl shadow-black"},sk={class:"modal_background"},lk={class:"flex justify-between p-2.5 rounded-t-2xl bg-base-300 items-center text-current"},ck={class:"flex items-center gap-2"},dk={class:"flex flex-col items-start"},uk={class:"text-lg font-semibold"},fk={key:0,class:"text-xs text-gray-400"},mk={class:"flex gap-2 items-center"},hk={class:"grid grid-cols-2"},pk={class:"w-full flex flex-col gap-3 justify-center items-center p-2"},gk={key:0,class:"flex gap-2"},yk={class:"flex items-center justify-center"},kk=["src"],xk={key:1,class:"bg-base-300 p-2 rounded-xl size-24 flex items-center justify-center border border-base-100"},bk={class:"flex flex-col w-full gap-2"},wk={class:"flex flex-col gap-2 w-full"},Ek={class:"flex flex-col gap-2 w-full"},vk={class:"flex items-center justify-between px-1"},Ck={class:"w-full"},Sk={class:"bg-base-300 flex flex-col gap-3 justify-center"},Bk={class:"flex divide-x divide-x-white justify-between -mb-3"},Vk=["disabled"],Mk={key:0},Nk={key:1,class:"size-3.5 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Ak={key:0,class:"flex flex-col gap-2 justify-between h-full p-1.5"},Tk={class:"test-style"},Dk={class:"h-[28vh] overflow-y-auto"},Fk={class:"bg-base-300 flex flex-col overflow-auto h-[40vh] overflow-y-auto"},Lk={class:"modal_end_button"},$k=["disabled"],Pk={key:0,class:"size-4 animate-spin rounded-full border-4 border-solid text-white border-t-transparent"},Ok={key:1,class:"text-xs font-semibold"},fi=Ce({__name:"clientsForm",props:{form:{type:Object,default:()=>({tags:[],country:"BR",name:"",photo:null,raw_telephone:"",telephone:"",whatsapp_id:"",whatsapp_jid:"",whatsapp_lid:null,rating:null,outcome:null,created_at:"",updated_at:"",client:"",products:[]})},save:{type:Function,default:()=>{}},hasCrmPlus:{type:Boolean,default:!1},tagsFunctions:{type:Function,default:()=>{}}},emits:["close","save"],setup(t,{emit:n}){const a=n,o=e.ref("data"),r=t,i=e.reactive({...r.form}),s=e.ref(!1),l=e.ref({title:"Nome",info:"Nome do contato",type:"text",placeholder:"Digite o nome do contato",empty:!1,data:e.computed({get:()=>i.name,set:c=>i.name=c})}),d=e.computed(()=>r.form.mode==="edit"?`Editar ${i.name}`:"Adicionar Novo Cliente"),u=async()=>{try{s.value=!0,await r.save(i)}catch(c){console.error(c)}finally{s.value=!1}};return e.watch(()=>r.form,c=>{Object.assign(i,e.toRaw(c))},{deep:!0,immediate:!0}),(c,m)=>{const h=e.resolveComponent("Popper"),p=e.resolveComponent("vue-tel-input");return e.openBlock(),e.createElementBlock("div",ak,[m[22]||(m[22]=e.createElementVNode("div",{class:"modal-overlay absolute h-full bg-gray-600 w-full opacity-70"},null,-1)),e.createElementVNode("div",ok,[e.createElementVNode("div",rk,[e.createElementVNode("div",ik,[e.createElementVNode("div",sk,[e.createElementVNode("div",lk,[e.createElementVNode("span",ck,[m[13]||(m[13]=e.createElementVNode("svg",{class:"size-6 text-green-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:"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"})],-1)),e.createElementVNode("span",dk,[e.createElementVNode("p",uk,e.toDisplayString(d.value),1),i.id?(e.openBlock(),e.createElementBlock("p",fk," ID: "+e.toDisplayString(i.id),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("section",mk,[e.createVNode(h,{hover:"",arrow:""},{content:e.withCtx(()=>[...m[14]||(m[14]=[e.createElementVNode("div",{class:"text-[10px] bg-base-100 p-2 rounded-md w-52 text-center"}," Uma label explicativa sobre a funcionalidade do CRM+, CTA e etc. ",-1)])]),default:e.withCtx(()=>[m[15]||(m[15]=e.createElementVNode("span",{class:"bg-green-500 rounded-full flex items-center justify-center p-1.5 group"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"size-3.5 text-white",viewBox:"0 0 800 726",fill:"none"},[e.createElementVNode("path",{d:"M208 195.556H8.88906C3.98125 195.556 0 199.535 0 204.445V698.667C0 713.393 11.9391 725.334 26.6672 725.334H208C212.908 725.334 216.889 721.354 216.889 716.445V204.445C216.889 199.535 212.908 195.556 208 195.556ZM140.452 616.888H76.4516C61.725 616.888 49.7844 604.949 49.7844 590.221C49.7844 575.493 61.7234 563.554 76.4516 563.554H140.452C155.178 563.554 167.119 575.493 167.119 590.221C167.119 604.949 155.18 616.888 140.452 616.888ZM140.452 487.11H76.4516C61.725 487.11 49.7844 475.171 49.7844 460.443C49.7844 445.717 61.7234 433.776 76.4516 433.776H140.452C155.178 433.776 167.119 445.715 167.119 460.443C167.119 475.171 155.18 487.11 140.452 487.11ZM140.452 357.334H76.4516C61.725 357.334 49.7844 345.395 49.7844 330.667C49.7844 315.938 61.7234 303.999 76.4516 303.999H140.452C155.178 303.999 167.119 315.938 167.119 330.667C167.119 345.395 155.18 357.334 140.452 357.334Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M773.333 0H26.6672C11.9391 0 0 11.9406 0 26.6672V133.334C0 138.242 3.97969 142.223 8.88906 142.223H791.111C796.019 142.223 800 138.244 800 133.334V26.6672C800 11.9406 788.061 0 773.333 0ZM101.333 88.8891C91.5141 88.8891 83.5547 80.9297 83.5547 71.1109C83.5547 61.2922 91.5141 53.3328 101.333 53.3328C111.152 53.3328 119.111 61.2922 119.111 71.1109C119.111 80.9297 111.152 88.8891 101.333 88.8891ZM172.444 88.8891C162.625 88.8891 154.666 80.9297 154.666 71.1109C154.666 61.2922 162.625 53.3328 172.444 53.3328C182.262 53.3328 190.222 61.2922 190.222 71.1109C190.222 80.9297 182.262 88.8891 172.444 88.8891ZM243.556 88.8891C233.738 88.8891 225.778 80.9297 225.778 71.1109C225.778 61.2922 233.738 53.3328 243.556 53.3328C253.375 53.3328 261.334 61.2922 261.334 71.1109C261.333 80.9297 253.373 88.8891 243.556 88.8891Z",fill:"currentColor"}),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M791.111 195.556C796.021 195.556 800.001 199.535 800.001 204.444V698.667C800.001 713.395 788.06 725.334 773.334 725.334H279.111C274.202 725.334 270.223 721.352 270.223 716.444V204.444C270.223 199.535 274.204 195.556 279.111 195.556H791.111ZM558.521 358.955C550.005 339.015 520.995 339.015 512.479 358.955L490.642 410.056L433.968 414.482C411.869 416.199 402.905 443.068 419.75 457.122L462.928 493.14L449.73 546.999C444.589 568.006 468.057 584.61 486.981 573.353L535.5 544.498L584.019 573.365C602.943 584.623 626.411 568.018 621.27 546.999L608.072 493.164L651.25 457.135C668.095 443.081 659.131 416.224 637.032 414.495L580.358 410.08L558.521 358.955Z",fill:"currentColor"})])],-1))]),_:1}),e.createElementVNode("button",{class:"bg-base-200 p-1.5 rounded-md hover:bg-base-200/70 transition",onClick:m[0]||(m[0]=f=>a("close"))},[...m[16]||(m[16]=[e.createElementVNode("svg",{class:"size-4 text-white","aria-hidden":"true",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:"M6 18 17.94 6M18 18 6.06 6"})],-1)])])])]),e.createElementVNode("div",hk,[e.createElementVNode("section",pk,[t.hasCrmPlus?(e.openBlock(),e.createElementBlock("div",gk,[e.createVNode(Ty,{outcome:i.outcome,"onUpdate:outcome":m[1]||(m[1]=f=>i.outcome=f)},null,8,["outcome"])])):e.createCommentVNode("",!0),e.createElementVNode("div",yk,[i.photo?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:m[2]||(m[2]=f=>c.viewSingleImage(i.photo)),class:"cursor-pointer"},[e.createElementVNode("img",{src:i.photo,alt:"",class:"size-24 object-cover rounded-md hover:brightness-75 transition cursor-pointer"},null,8,kk)])):(e.openBlock(),e.createElementBlock("span",xk,[...m[17]||(m[17]=[e.createElementVNode("svg",{class:"size-14","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 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"})],-1)])]))]),t.hasCrmPlus?(e.openBlock(),e.createBlock(ao,{key:1,modelValue:i.rating,"onUpdate:modelValue":m[3]||(m[3]=f=>i.rating=f)},null,8,["modelValue"])):e.createCommentVNode("",!0),e.createElementVNode("div",bk,[e.createElementVNode("div",wk,[e.createElementVNode("div",Ek,[e.createElementVNode("header",vk,[m[19]||(m[19]=e.createElementVNode("p",{class:"text-xs font-medium text-left"}," Nome da etiqueta ",-1)),e.createVNode(h,{hover:"",content:"teste",placement:"top",arrow:""},{default:e.withCtx(()=>[...m[18]||(m[18]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-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.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1})]),e.createVNode(to,{modelValue:i.tags,"onUpdate:modelValue":m[4]||(m[4]=f=>i.tags=f)},null,8,["modelValue"])]),e.createElementVNode("div",Ck,[e.createVNode(no,{"onUpdate:content":m[5]||(m[5]=f=>l.value.data=f.data),content:l.value},null,8,["content"])])])])]),e.createElementVNode("section",Sk,[e.createElementVNode("div",Bk,[e.createElementVNode("button",{class:e.normalizeClass([o.value==="data"?"bg-green-900":"","bg-base-300 p-1 w-full text-xs font-sans font-medium flex items-center justify-center hover:bg-base-200/70 transition"]),onClick:m[6]||(m[6]=f=>o.value="data")}," Dados do cliente ",2),e.createElementVNode("button",{class:e.normalizeClass([o.value==="products"?"bg-green-900":"","bg-base-300 p-1 w-full text-xs font-sans font-medium flex items-center justify-center hover:bg-base-200/70 transition"]),disabled:!t.hasCrmPlus,onClick:m[7]||(m[7]=f=>o.value="products")},[t.hasCrmPlus?(e.openBlock(),e.createElementBlock("p",Mk,"Produtos")):(e.openBlock(),e.createElementBlock("svg",Nk,[...m[20]||(m[20]=[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)])]))],10,Vk)]),o.value==="data"?(e.openBlock(),e.createElementBlock("div",Ak,[e.createElementVNode("div",Tk,[m[21]||(m[21]=e.createElementVNode("h1",{class:"text-start w-full items-center justify-between flex p-2"},[e.createElementVNode("p",{class:"text-xs font-semibold"},"Contatos")],-1)),e.createVNode(p,{class:"z-50",onCountryChanged:m[8]||(m[8]=f=>i.country=f.iso2),mode:"national",validCharactersOnly:!0,defaultCountry:i.country,inputOptions:{placeholder:"Coloque seu telefone",showDialCode:!1,required:!0,searchBoxPlaceholder:"Brazil"},dropdownOptions:{showSearchBox:!0,showFlags:!0,searchBoxPlaceholder:"Brazil"},modelValue:i.telephone,"onUpdate:modelValue":m[9]||(m[9]=f=>i.telephone=f)},null,8,["defaultCountry","modelValue"])]),e.createElementVNode("div",Dk,[o.value==="data"?(e.openBlock(),e.createBlock(nk,{key:0,modelValue:i.segmentation_fields,"onUpdate:modelValue":m[10]||(m[10]=f=>i.segmentation_fields=f)},null,8,["modelValue"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",Fk,[e.createVNode(Yy,{modelValue:i.products,"onUpdate:modelValue":m[11]||(m[11]=f=>i.products=f)},null,8,["modelValue"])],512),[[e.vShow,o.value==="products"]])])]),e.createElementVNode("div",Lk,[e.createElementVNode("button",{disabled:s.value,class:"bg-green-500 py-2 px-4 rounded-lg text-sm font-medium hover:bg-green-500/80 transition-colors flex gap-2 items-center justify-center min-w-32",onClick:m[12]||(m[12]=f=>u())},[s.value?(e.openBlock(),e.createElementBlock("div",Pk)):(e.openBlock(),e.createElementBlock("p",Ok,"Salvar"))],8,$k)])])])])])])}}},[["__scopeId","data-v-82a0fc26"]]),_k={},Hk={class:"flex items-center justify-center h-full"};function Rk(t,n){return e.openBlock(),e.createElementBlock("div",Hk,[...n[0]||(n[0]=[e.createElementVNode("span",{class:"products-and-services_bar"},null,-1),e.createElementVNode("span",{class:"products-and-services_bar"},null,-1),e.createElementVNode("span",{class:"products-and-services_bar"},null,-1)])])}const mi=Ce(_k,[["render",Rk],["__scopeId","data-v-3f0502dd"]]),zk={class:"flex justify-center items-center"},jk={class:"text-[8px] font-bold"},Gk={class:"tag-view-popper-content-text"},Ik={class:"flex hover:scale-105 ease-in-out transition-all"},qk={class:"svg-list-tag","aria-hidden":"true",viewBox:"0 0 25 100",style:{color:"#d1d5db"}},Wk={style:{backgroundColor:"#d1d5db"},class:"w-full ml-[-0.5rem] rounded-r-md inline-flex items-center justify-center p-0.5 border-b-2 border-gray-900"},Uk={class:"text-[8px] text-black font-bold"},Zk={class:"max-h-64 overflow-y-auto hide-scrollbar"},Yk={class:"flex flex-col gap-2"},Xk={class:"tag-view-popper-content-text"},Kk={key:1},hi=Ce({__name:"tagView",props:{clients:{type:Object,required:!0}},setup(t){const n=t;return e.computed(()=>{var a,o;return((o=(a=n.clients)==null?void 0:a.tags)==null?void 0:o.slice(0,4))||[]}),(a,o)=>{const r=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("section",zk,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.clients.tags.slice(0,4),(i,s)=>(e.openBlock(),e.createBlock(r,{class:"tag-view-theme",arrow:"",hover:"",key:s},{content:e.withCtx(()=>[e.createElementVNode("p",Gk,e.toDisplayString(i.name),1)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex hover:scale-105 ease-in-out transition-all",e.unref(ia)(i.color)])},[(e.openBlock(),e.createElementBlock("svg",{class:"svg-list-tag","aria-hidden":"true",viewBox:"0 0 30 100",style:e.normalizeStyle({color:i.color||"#fff"})},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])],4)),e.createElementVNode("span",{style:e.normalizeStyle({backgroundColor:i.color||"#fff"}),class:"w-full ml-[-0.10rem] rounded-r-md inline-flex items-center justify-center px-1 py-0.5 border-b-2 border-gray-900"},[e.createElementVNode("p",jk,e.toDisplayString(i.name.charAt(0).toUpperCase()),1)],4)],2)]),_:2},1024))),128)),t.clients.tags.length>4?(e.openBlock(),e.createBlock(r,{key:0,arrow:"",hover:"",class:"tag-view-theme"},{content:e.withCtx(()=>[e.createElementVNode("section",Zk,[e.createElementVNode("div",Yk,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.clients.tags,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id||i.name,class:"relative inline-flex items-center rounded-md overflow-hidden"},[(e.openBlock(),e.createElementBlock("svg",{class:"size-6","aria-hidden":"true",viewBox:"0 0 65 90",style:e.normalizeStyle({color:i.color||"#fff"})},[...o[2]||(o[2]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])],4)),e.createElementVNode("span",{class:e.normalizeClass(["p-0.5 w-full text-sm font-semibold truncate text-start -ml-2",e.unref(ia)(i.color)]),style:e.normalizeStyle(["max-width: 12rem",{background:i.color||"#fff"}])},[e.createElementVNode("p",Xk,e.toDisplayString(i.name),1)],6)]))),128))])])]),default:e.withCtx(()=>[e.createElementVNode("div",Ik,[(e.openBlock(),e.createElementBlock("svg",qk,[...o[1]||(o[1]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])])),e.createElementVNode("span",Wk,[e.createElementVNode("p",Uk," +"+e.toDisplayString(t.clients.tags.length-4),1)])])]),_:1})):e.createCommentVNode("",!0),!t.clients.tags||t.clients.tags.length===0?(e.openBlock(),e.createElementBlock("span",Kk,"-")):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-54723b10"]]),pi=Ce({__name:"floating-dev",setup(t){const n=e.ref(!1),a=e.ref({x:30,y:30}),o=e.ref({x:0,y:0}),r=e.ref(!1),i=e.ref(null),s=e.ref(null),l=e.ref({vertical:"bottom",horizontal:"right"}),d=e.computed(()=>({position:"fixed",left:`${a.value.x}px`,top:`${a.value.y}px`,zIndex:1e3,cursor:r.value?"grabbing":"grab"})),u=e.computed(()=>{const g={position:"absolute",background:"#fff",borderRadius:"10px",boxShadow:"0 4px 15px rgba(0, 0, 0, 0.2)",width:"280px",maxWidth:"90vw",zIndex:1001};return l.value.vertical==="top"?g.bottom="60px":g.top="60px",l.value.horizontal==="left"?g.right="0":g.left="0",g});async function c(){if(n.value){n.value=!1;return}n.value=!0,await e.nextTick(),m()}function m(){if(!i.value||!s.value)return;const g=i.value.getBoundingClientRect(),y=s.value.offsetWidth,k=s.value.offsetHeight,x={top:g.top,bottom:window.innerHeight-(g.top+g.height),left:g.left,right:window.innerWidth-(g.left+g.width)};l.value.vertical=x.bottom<k&&x.top>k?"top":"bottom",l.value.horizontal=x.right<y&&x.left>y?"left":"right"}function h(g){r.value=!0;const y=g.type.includes("touch")?g.touches[0]:g;o.value={x:y.clientX-a.value.x,y:y.clientY-a.value.y},document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p),document.addEventListener("touchend",f)}function p(g){if(!r.value)return;const y=g.type.includes("touch")?g.touches[0]:g,k=y.clientX-o.value.x,x=y.clientY-o.value.y,E=window.innerWidth-i.value.offsetWidth,B=window.innerHeight-i.value.offsetHeight;a.value.x=Math.min(Math.max(0,k),E),a.value.y=Math.min(Math.max(0,x),B)}function f(){r.value=!1,document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",f)}return e.onBeforeUnmount(f),(g,y)=>(e.openBlock(),e.createElementBlock("div",{class:"floating-widget",style:e.normalizeStyle(d.value),ref_key:"widgetRef",ref:i,onMousedown:h,onTouchstart:h},[e.createElementVNode("button",{class:"floating-button",onClick:e.withModifiers(c,["stop"]),"aria-label":"Abrir painel flutuante"},[...y[0]||(y[0]=[e.createElementVNode("svg",{class:"floating-button-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[e.createElementVNode("path",{d:"M370 378c28.89 23.52 46 46.07 46 86M142 378c-28.89 23.52-46 46.06-46 86M384 208c28.89-23.52 32-56.07 32-96M128 206c-28.89-23.52-32-54.06-32-94M464 288.13h-80M128 288.13H48M256 192v256",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),e.createElementVNode("path",{d:"M256 448h0c-70.4 0-128-57.6-128-128v-96.07c0-65.07 57.6-96 128-96h0c70.4 0 128 25.6 128 96V320c0 70.4-57.6 128-128 128z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),e.createElementVNode("path",{d:"M179.43 143.52a49.08 49.08 0 01-3.43-15.73A80 80 0 01255.79 48h.42A80 80 0 01336 127.79a41.91 41.91 0 01-3.12 14.3",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1)])]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"floating-panel",ref_key:"panelRef",ref:s,style:e.normalizeStyle(u.value)},[e.renderSlot(g.$slots,"default",{},()=>[y[1]||(y[1]=e.createElementVNode("p",{style:{"text-align":"center","font-size":"0.9rem"}}," Adicione seu conteúdo aqui 👇 ",-1))],!0)],4)):e.createCommentVNode("",!0)]),_:3})],36))}},[["__scopeId","data-v-7767be25"]]);Dt.defineStore("debug",{state:()=>({message:"Debug store initialized"}),actions:{logMessage(){console.log(this.message)}}});function Qk(t){t.component("primarySelect",po),t.component("departSelect",K1),t.component("attendantSelect",Q1),t.component("SimpleModal",go),t.component("simpleCard",yo),t.component("instanceSelect",or),t.component("calendarEvents",pr),t.component("MFA",gr),t.component("MfaQrCode",N3),t.component("chatWindow",Y1),t.component("FilterSelectLib",J1),t.component("MobileInternalChat",X1),t.component("RandomAvatar",ai),t.component("MinModal",oi),t.component("LibPatchNotes",si),t.component("BtnNewUpdates",li),t.component("LibPhotoPicker",ci),t.component("SelectMultipleDepartments",di),t.component("PrimaryInput",no),t.component("SimpleSelect",ui),t.component("FloatingDev",pi),t.component("RaitingInput",ao),t.component("TagView",hi),t.component("ClientsForm",fi),t.component("SelectMultipleTags",to),t.component("SimpleLoader",mi)}function gi(t,n="add"){const a=eo();n==="add"?a.addDepartments(t):n==="delete"?a.removeDepartments(t):n==="update"?(a.departments=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibDeparts.`)}function yi(t,n="add"){const a=Yt();n==="add"?a.addAttendants(t):n==="delete"?a.removeAttendants(t):n==="update"?(a.attendants=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibAttendants.`)}function ki(t,n="add"){const a=va();n==="add"?a.addInstance(t):n==="delete"?a.removeInstance(t):n==="update"?(a.instances=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibInstances.`)}async function xi(t,n,a,o=[],r=[],i=[]){try{const s=await ar(t);n&&await s.setToken(n),a&&(ot.defaults.baseURL=a);const l=eo(t);r.length>0&&(l.departments=r,l.count=r.length);const d=Yt(t);o.length>0&&(d.attendants=o,d.count=o.length),await va(t).fetchInstances()}catch(s){console.error("Erro no setupLibrary:",s)}}function bi(t){return ia(t)}const Jk={install:Qk,setupLibrary:xi,attLibDeparts:gi,attLibAttendants:yi,attLibInstances:ki,primarySelect:po,simpleModal:go,simpleCard:yo,instanceSelect:or,SimpleSelect:ui,FloatingDev:pi,calendar:pr,SimpleLoader:mi,MFA:gr,chatWindow:Y1,departSelect:K1,attendantSelect:Q1,FilterSelectLib:J1,MobileInternalChat:X1,RandomAvatar:ai,MinModal:oi,libPatchNotes:si,btnNewUpdates:li,LibPhotoPicker:ci,SelectMultipleDepartments:di,SelectMultipleTags:to,PrimaryInput:no,getWithContrastColor:bi,RaitingInput:ao,TagView:hi,ClientsForm:fi};function ex(t){t.CapacitorUtils.Synapse=new Proxy({},{get(n,a){return new Proxy({},{get(o,r){return(i,s,l)=>{const d=t.Capacitor.Plugins[a];if(d===void 0){l(new Error(`Capacitor plugin ${a} not found`));return}if(typeof d[r]!="function"){l(new Error(`Method ${r} not found in Capacitor plugin ${a}`));return}(async()=>{try{const u=await d[r](i);s(u)}catch(u){l(u)}})()}}})}})}function tx(t){t.CapacitorUtils.Synapse=new Proxy({},{get(n,a){return t.cordova.plugins[a]}})}function nx(t=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!t?ex(window):window.cordova!==void 0&&tx(window))}var wi;(function(t){t.Documents="DOCUMENTS",t.Data="DATA",t.Library="LIBRARY",t.Cache="CACHE",t.External="EXTERNAL",t.ExternalStorage="EXTERNAL_STORAGE",t.ExternalCache="EXTERNAL_CACHE",t.LibraryNoCloud="LIBRARY_NO_CLOUD",t.Temporary="TEMPORARY"})(wi||(wi={}));var oo;(function(t){t.UTF8="utf8",t.ASCII="ascii",t.UTF16="utf16"})(oo||(oo={}));const sa=En("Filesystem",{web:()=>Promise.resolve().then(()=>Ex).then(t=>new t.FilesystemWeb)});nx();const ax=En("BlobWriter");function ox(t){return window.btoa(Array.from(new Uint8Array(t)).map(function(n){return String.fromCharCode(n)}).join(""))}function rx({path:t,directory:n,blob:a,recursive:o}){return sa.writeFile({directory:n,path:t,recursive:o,data:""}).then(function(){return new Promise(function(r,i){function s(d){i(d.target.error)}const l=window.indexedDB.open("Disc");l.onerror=s,l.onsuccess=function(){const u=l.result.transaction("FileStorage","readwrite");u.onerror=s;const c=u.objectStore("FileStorage"),m=`/${n}/${t.replace(/^\//,"")}`,h=c.get(m);h.onsuccess=function(){h.result.size=a.size,h.result.content=a;const p=c.put(h.result);p.onsuccess=function(){r(void 0)}}}})})}function Ei({path:t,directory:n,blob:a,recursive:o}){return sa.writeFile({directory:n,path:t,recursive:o,data:""}).then(function r(){if(a.size===0)return Promise.resolve();const i=3*128*1024,s=a.slice(0,i);return a=a.slice(i),new Response(s).arrayBuffer().then(function(d){return sa.appendFile({directory:n,path:t,data:ox(d)})}).then(r)})}function ix(t){const{path:n,directory:a,blob:o,fast_mode:r=!1,recursive:i,on_fallback:s}=t;return!o||!Number.isSafeInteger(o.size)||typeof o.type!="string"?Promise.reject(new Error("Not a Blob.")):Jn.getPlatform()==="web"?r?rx(t):Ei(t):Promise.all([ax.get_config(),sa.getUri({path:n,directory:a})]).then(function([l,d]){const u=d.uri.replace("file://","");return(window.CapacitorWebFetch||window.fetch)(l.base_url+u+(i?"?recursive=true":""),{headers:{authorization:l.auth_token},method:"put",body:o}).then(function(m){if(m.status!==204)throw new Error("Bad HTTP status: "+m.status);return d.uri})}).catch(function(d){return s!==void 0&&s(d),Ei(t)})}const sx=Object.freeze(ix);function lx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vi={};function cx(t){return t&&t.__esModule?t:{default:t}}var dx=cx,ro={exports:{}},Ci;function ux(){return Ci||(Ci=1,function(t){var n=function(a){var o=Object.prototype,r=o.hasOwnProperty,i=Object.defineProperty||function(L,R,O){L[R]=O.value},s,l=typeof Symbol=="function"?Symbol:{},d=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function m(L,R,O){return Object.defineProperty(L,R,{value:O,enumerable:!0,configurable:!0,writable:!0}),L[R]}try{m({},"")}catch{m=function(R,O,oe){return R[O]=oe}}function h(L,R,O,oe){var de=R&&R.prototype instanceof E?R:E,pe=Object.create(de.prototype),ye=new Z(oe||[]);return i(pe,"_invoke",{value:H(L,O,ye)}),pe}a.wrap=h;function p(L,R,O){try{return{type:"normal",arg:L.call(R,O)}}catch(oe){return{type:"throw",arg:oe}}}var f="suspendedStart",g="suspendedYield",y="executing",k="completed",x={};function E(){}function B(){}function M(){}var T={};m(T,d,function(){return this});var _=Object.getPrototypeOf,C=_&&_(_(Q([])));C&&C!==o&&r.call(C,d)&&(T=C);var w=M.prototype=E.prototype=Object.create(T);B.prototype=M,i(w,"constructor",{value:M,configurable:!0}),i(M,"constructor",{value:B,configurable:!0}),B.displayName=m(M,c,"GeneratorFunction");function P(L){["next","throw","return"].forEach(function(R){m(L,R,function(O){return this._invoke(R,O)})})}a.isGeneratorFunction=function(L){var R=typeof L=="function"&&L.constructor;return R?R===B||(R.displayName||R.name)==="GeneratorFunction":!1},a.mark=function(L){return Object.setPrototypeOf?Object.setPrototypeOf(L,M):(L.__proto__=M,m(L,c,"GeneratorFunction")),L.prototype=Object.create(w),L},a.awrap=function(L){return{__await:L}};function F(L,R){function O(pe,ye,Ve,Le){var Ae=p(L[pe],L,ye);if(Ae.type==="throw")Le(Ae.arg);else{var qe=Ae.arg,_e=qe.value;return _e&&typeof _e=="object"&&r.call(_e,"__await")?R.resolve(_e.__await).then(function($e){O("next",$e,Ve,Le)},function($e){O("throw",$e,Ve,Le)}):R.resolve(_e).then(function($e){qe.value=$e,Ve(qe)},function($e){return O("throw",$e,Ve,Le)})}}var oe;function de(pe,ye){function Ve(){return new R(function(Le,Ae){O(pe,ye,Le,Ae)})}return oe=oe?oe.then(Ve,Ve):Ve()}i(this,"_invoke",{value:de})}P(F.prototype),m(F.prototype,u,function(){return this}),a.AsyncIterator=F,a.async=function(L,R,O,oe,de){de===void 0&&(de=Promise);var pe=new F(h(L,R,O,oe),de);return a.isGeneratorFunction(R)?pe:pe.next().then(function(ye){return ye.done?ye.value:pe.next()})};function H(L,R,O){var oe=f;return function(pe,ye){if(oe===y)throw new Error("Generator is already running");if(oe===k){if(pe==="throw")throw ye;return ee()}for(O.method=pe,O.arg=ye;;){var Ve=O.delegate;if(Ve){var Le=V(Ve,O);if(Le){if(Le===x)continue;return Le}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(oe===f)throw oe=k,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);oe=y;var Ae=p(L,R,O);if(Ae.type==="normal"){if(oe=O.done?k:g,Ae.arg===x)continue;return{value:Ae.arg,done:O.done}}else Ae.type==="throw"&&(oe=k,O.method="throw",O.arg=Ae.arg)}}}function V(L,R){var O=R.method,oe=L.iterator[O];if(oe===s)return R.delegate=null,O==="throw"&&L.iterator.return&&(R.method="return",R.arg=s,V(L,R),R.method==="throw")||O!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+O+"' method")),x;var de=p(oe,L.iterator,R.arg);if(de.type==="throw")return R.method="throw",R.arg=de.arg,R.delegate=null,x;var pe=de.arg;if(!pe)return R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,x;if(pe.done)R[L.resultName]=pe.value,R.next=L.nextLoc,R.method!=="return"&&(R.method="next",R.arg=s);else return pe;return R.delegate=null,x}P(w),m(w,c,"Generator"),m(w,d,function(){return this}),m(w,"toString",function(){return"[object Generator]"});function v(L){var R={tryLoc:L[0]};1 in L&&(R.catchLoc=L[1]),2 in L&&(R.finallyLoc=L[2],R.afterLoc=L[3]),this.tryEntries.push(R)}function $(L){var R=L.completion||{};R.type="normal",delete R.arg,L.completion=R}function Z(L){this.tryEntries=[{tryLoc:"root"}],L.forEach(v,this),this.reset(!0)}a.keys=function(L){var R=Object(L),O=[];for(var oe in R)O.push(oe);return O.reverse(),function de(){for(;O.length;){var pe=O.pop();if(pe in R)return de.value=pe,de.done=!1,de}return de.done=!0,de}};function Q(L){if(L){var R=L[d];if(R)return R.call(L);if(typeof L.next=="function")return L;if(!isNaN(L.length)){var O=-1,oe=function de(){for(;++O<L.length;)if(r.call(L,O))return de.value=L[O],de.done=!1,de;return de.value=s,de.done=!0,de};return oe.next=oe}}return{next:ee}}a.values=Q;function ee(){return{value:s,done:!0}}return Z.prototype={constructor:Z,reset:function(L){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach($),!L)for(var R in this)R.charAt(0)==="t"&&r.call(this,R)&&!isNaN(+R.slice(1))&&(this[R]=s)},stop:function(){this.done=!0;var L=this.tryEntries[0],R=L.completion;if(R.type==="throw")throw R.arg;return this.rval},dispatchException:function(L){if(this.done)throw L;var R=this;function O(Le,Ae){return pe.type="throw",pe.arg=L,R.next=Le,Ae&&(R.method="next",R.arg=s),!!Ae}for(var oe=this.tryEntries.length-1;oe>=0;--oe){var de=this.tryEntries[oe],pe=de.completion;if(de.tryLoc==="root")return O("end");if(de.tryLoc<=this.prev){var ye=r.call(de,"catchLoc"),Ve=r.call(de,"finallyLoc");if(ye&&Ve){if(this.prev<de.catchLoc)return O(de.catchLoc,!0);if(this.prev<de.finallyLoc)return O(de.finallyLoc)}else if(ye){if(this.prev<de.catchLoc)return O(de.catchLoc,!0)}else if(Ve){if(this.prev<de.finallyLoc)return O(de.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(L,R){for(var O=this.tryEntries.length-1;O>=0;--O){var oe=this.tryEntries[O];if(oe.tryLoc<=this.prev&&r.call(oe,"finallyLoc")&&this.prev<oe.finallyLoc){var de=oe;break}}de&&(L==="break"||L==="continue")&&de.tryLoc<=R&&R<=de.finallyLoc&&(de=null);var pe=de?de.completion:{};return pe.type=L,pe.arg=R,de?(this.method="next",this.next=de.finallyLoc,x):this.complete(pe)},complete:function(L,R){if(L.type==="throw")throw L.arg;return L.type==="break"||L.type==="continue"?this.next=L.arg:L.type==="return"?(this.rval=this.arg=L.arg,this.method="return",this.next="end"):L.type==="normal"&&R&&(this.next=R),x},finish:function(L){for(var R=this.tryEntries.length-1;R>=0;--R){var O=this.tryEntries[R];if(O.finallyLoc===L)return this.complete(O.completion,O.afterLoc),$(O),x}},catch:function(L){for(var R=this.tryEntries.length-1;R>=0;--R){var O=this.tryEntries[R];if(O.tryLoc===L){var oe=O.completion;if(oe.type==="throw"){var de=oe.arg;$(O)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(L,R,O){return this.delegate={iterator:Q(L),resultName:R,nextLoc:O},this.method==="next"&&(this.arg=s),x}},a}(t.exports);try{regeneratorRuntime=n}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}(ro)),ro.exports}var io,Si;function fx(){return Si||(Si=1,io=ux()),io}var so,Bi;function mx(){if(Bi)return so;Bi=1;function t(a,o,r,i,s,l,d){try{var u=a[l](d),c=u.value}catch(m){r(m);return}u.done?o(c):Promise.resolve(c).then(i,s)}function n(a){return function(){var o=this,r=arguments;return new Promise(function(i,s){var l=a.apply(o,r);function d(c){t(l,i,s,d,u,"next",c)}function u(c){t(l,i,s,d,u,"throw",c)}d(void 0)})}}return so=n,so}(function(t){var n=dx;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var a=n(fx()),o=n(mx());function r(s){return i.apply(this,arguments)}function i(){return(i=(0,o.default)(a.default.mark(function s(l){var d,u;return a.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return d=document.createElement("video"),u=new Promise(function(m,h){d.addEventListener("loadedmetadata",function(){d.duration===1/0?(d.currentTime=Number.MAX_SAFE_INTEGER,d.ontimeupdate=function(){d.ontimeupdate=null,m(d.duration),d.currentTime=0}):m(d.duration)}),d.onerror=function(p){return h(p.target.error)}}),d.src=typeof l=="string"||l instanceof String?l:window.URL.createObjectURL(l),c.abrupt("return",u);case 4:case"end":return c.stop()}},s)}))).apply(this,arguments)}})(vi);const hx=lx(vi),Tt=()=>({value:!0}),Cn=()=>({value:!1}),px=()=>new Error("MISSING_PERMISSION"),gx=()=>new Error("ALREADY_RECORDING"),yx=()=>new Error("DEVICE_CANNOT_VOICE_RECORD"),Vi=()=>new Error("FAILED_TO_RECORD"),kx=()=>new Error("EMPTY_RECORDING"),lo=()=>new Error("RECORDING_HAS_NOT_STARTED"),Mi=()=>new Error("FAILED_TO_FETCH_RECORDING"),co=()=>new Error("COULD_NOT_QUERY_PERMISSION_STATUS"),Ni={"audio/aac":".aac","audio/mp4":".mp3","audio/webm;codecs=opus":".ogg","audio/webm":".ogg","audio/ogg;codecs=opus":".ogg"},Ai=()=>new Promise(()=>{});class ht{constructor(){this.mediaRecorder=null,this.chunks=[],this.pendingResult=Ai()}static async canDeviceVoiceRecord(){var n;return((n=navigator==null?void 0:navigator.mediaDevices)===null||n===void 0?void 0:n.getUserMedia)==null||ht.getSupportedMimeType()==null?Cn():Tt()}async startRecording(n){if(this.mediaRecorder!=null)throw gx();if(!(await ht.canDeviceVoiceRecord()).value)throw yx();if(!(await ht.hasAudioRecordingPermission().catch(()=>Tt())).value)throw px();return navigator.mediaDevices.getUserMedia({audio:!0}).then(r=>this.onSuccessfullyStartedRecording(r,n)).catch(this.onFailedToStartRecording.bind(this))}async stopRecording(){if(this.mediaRecorder==null)throw lo();try{return this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(n=>n.stop()),this.pendingResult}catch{throw Mi()}finally{this.prepareInstanceForNextOperation()}}static async hasAudioRecordingPermission(){return navigator.permissions.query==null?navigator.mediaDevices==null?Promise.reject(co()):navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>Tt()).catch(()=>{throw co()}):navigator.permissions.query({name:"microphone"}).then(n=>({value:n.state==="granted"})).catch(()=>{throw co()})}static async requestAudioRecordingPermission(){return(await ht.hasAudioRecordingPermission().catch(()=>Cn())).value?Tt():navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>Tt()).catch(()=>Cn())}pauseRecording(){if(this.mediaRecorder==null)throw lo();return this.mediaRecorder.state==="recording"?(this.mediaRecorder.pause(),Promise.resolve(Tt())):Promise.resolve(Cn())}resumeRecording(){if(this.mediaRecorder==null)throw lo();return this.mediaRecorder.state==="paused"?(this.mediaRecorder.resume(),Promise.resolve(Tt())):Promise.resolve(Cn())}getCurrentStatus(){return this.mediaRecorder==null?Promise.resolve({status:ta.NONE}):this.mediaRecorder.state==="recording"?Promise.resolve({status:ta.RECORDING}):this.mediaRecorder.state==="paused"?Promise.resolve({status:ta.PAUSED}):Promise.resolve({status:ta.NONE})}static getSupportedMimeType(){if((MediaRecorder==null?void 0:MediaRecorder.isTypeSupported)==null)return null;const n=Object.keys(Ni).find(a=>MediaRecorder.isTypeSupported(a));return n??null}onSuccessfullyStartedRecording(n,a){return this.pendingResult=new Promise((o,r)=>{this.mediaRecorder=new MediaRecorder(n),this.mediaRecorder.onerror=()=>{this.prepareInstanceForNextOperation(),r(Vi())},this.mediaRecorder.onstop=async()=>{var i,s,l;const d=ht.getSupportedMimeType();if(d==null){this.prepareInstanceForNextOperation(),r(Mi());return}const u=new Blob(this.chunks,{type:d});if(u.size<=0){this.prepareInstanceForNextOperation(),r(kx());return}let c,m;a!=null?(c=`${(l=(s=(i=a.subDirectory)===null||i===void 0?void 0:i.match(/^\/?(.+[^/])\/?$/))===null||s===void 0?void 0:s[1])!==null&&l!==void 0?l:""}/recording-${new Date().getTime()}${Ni[d]}`,await sx({blob:u,directory:a.directory,fast_mode:!0,path:c,recursive:!0})):m=await ht.blobToBase64(u);const h=await hx(u);this.prepareInstanceForNextOperation(),o({value:{recordDataBase64:m,mimeType:d,msDuration:h*1e3,path:c}})},this.mediaRecorder.ondataavailable=i=>this.chunks.push(i.data),this.mediaRecorder.start()}),Tt()}onFailedToStartRecording(){throw this.prepareInstanceForNextOperation(),Vi()}static blobToBase64(n){return new Promise(a=>{const o=new FileReader;o.onloadend=()=>{const r=String(o.result),i=r.split("base64,"),s=i.length>1?i[1]:r;a(s.trim())},o.readAsDataURL(n)})}prepareInstanceForNextOperation(){if(this.mediaRecorder!=null&&this.mediaRecorder.state==="recording")try{this.mediaRecorder.stop()}catch(n){console.warn("While trying to stop a media recorder, an error was thrown",n)}this.pendingResult=Ai(),this.mediaRecorder=null,this.chunks=[]}}class xx extends ea{constructor(){super(...arguments),this.voiceRecorderInstance=new ht}canDeviceVoiceRecord(){return ht.canDeviceVoiceRecord()}hasAudioRecordingPermission(){return ht.hasAudioRecordingPermission()}requestAudioRecordingPermission(){return ht.requestAudioRecordingPermission()}startRecording(n){return this.voiceRecorderInstance.startRecording(n)}stopRecording(){return this.voiceRecorderInstance.stopRecording()}pauseRecording(){return this.voiceRecorderInstance.pauseRecording()}resumeRecording(){return this.voiceRecorderInstance.resumeRecording()}getCurrentStatus(){return this.voiceRecorderInstance.getCurrentStatus()}}const bx=Object.freeze(Object.defineProperty({__proto__:null,VoiceRecorderWeb:xx},Symbol.toStringTag,{value:"Module"}));function Ti(t){const n=t.split("/").filter(o=>o!=="."),a=[];return n.forEach(o=>{o===".."&&a.length>0&&a[a.length-1]!==".."?a.pop():a.push(o)}),a.join("/")}function wx(t,n){t=Ti(t),n=Ti(n);const a=t.split("/"),o=n.split("/");return t!==n&&a.every((r,i)=>r===o[i])}class la extends ea{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME="Disc",this._writeCmds=["add","put","delete"],this.downloadFile=async n=>{var a,o;const r=T1(n,n.webFetchExtra),i=await fetch(n.url,r);let s;if(!n.progress)s=await i.blob();else if(!(i!=null&&i.body))s=new Blob;else{const d=i.body.getReader();let u=0;const c=[],m=i.headers.get("content-type"),h=parseInt(i.headers.get("content-length")||"0",10);for(;;){const{done:g,value:y}=await d.read();if(g)break;c.push(y),u+=(y==null?void 0:y.length)||0;const k={url:n.url,bytes:u,contentLength:h};this.notifyListeners("progress",k)}const p=new Uint8Array(u);let f=0;for(const g of c)typeof g>"u"||(p.set(g,f),f+=g.length);s=new Blob([p.buffer],{type:m||void 0})}return{path:(await this.writeFile({path:n.path,directory:(a=n.directory)!==null&&a!==void 0?a:void 0,recursive:(o=n.recursive)!==null&&o!==void 0?o:!1,data:s})).uri,blob:s}}}readFileInChunks(n,a){throw this.unavailable("Method not implemented.")}async initDb(){if(this._db!==void 0)return this._db;if(!("indexedDB"in window))throw this.unavailable("This browser doesn't support IndexedDB");return new Promise((n,a)=>{const o=indexedDB.open(this.DB_NAME,this.DB_VERSION);o.onupgradeneeded=la.doUpgrade,o.onsuccess=()=>{this._db=o.result,n(o.result)},o.onerror=()=>a(o.error),o.onblocked=()=>{console.warn("db blocked")}})}static doUpgrade(n){const o=n.target.result;switch(n.oldVersion){case 0:case 1:default:o.objectStoreNames.contains("FileStorage")&&o.deleteObjectStore("FileStorage"),o.createObjectStore("FileStorage",{keyPath:"path"}).createIndex("by_folder","folder")}}async dbRequest(n,a){const o=this._writeCmds.indexOf(n)!==-1?"readwrite":"readonly";return this.initDb().then(r=>new Promise((i,s)=>{const u=r.transaction(["FileStorage"],o).objectStore("FileStorage")[n](...a);u.onsuccess=()=>i(u.result),u.onerror=()=>s(u.error)}))}async dbIndexRequest(n,a,o){const r=this._writeCmds.indexOf(a)!==-1?"readwrite":"readonly";return this.initDb().then(i=>new Promise((s,l)=>{const m=i.transaction(["FileStorage"],r).objectStore("FileStorage").index(n)[a](...o);m.onsuccess=()=>s(m.result),m.onerror=()=>l(m.error)}))}getPath(n,a){const o=a!==void 0?a.replace(/^[/]+|[/]+$/g,""):"";let r="";return n!==void 0&&(r+="/"+n),a!==""&&(r+="/"+o),r}async clear(){(await this.initDb()).transaction(["FileStorage"],"readwrite").objectStore("FileStorage").clear()}async readFile(n){const a=this.getPath(n.directory,n.path),o=await this.dbRequest("get",[a]);if(o===void 0)throw Error("File does not exist.");return{data:o.content?o.content:""}}async writeFile(n){const a=this.getPath(n.directory,n.path);let o=n.data;const r=n.encoding,i=n.recursive,s=await this.dbRequest("get",[a]);if(s&&s.type==="directory")throw Error("The supplied path is a directory.");const l=a.substr(0,a.lastIndexOf("/"));if(await this.dbRequest("get",[l])===void 0){const m=l.indexOf("/",1);if(m!==-1){const h=l.substr(m);await this.mkdir({path:h,directory:n.directory,recursive:i})}}if(!r&&!(o instanceof Blob)&&(o=o.indexOf(",")>=0?o.split(",")[1]:o,!this.isBase64String(o)))throw Error("The supplied data is not valid base64 content.");const u=Date.now(),c={path:a,folder:l,type:"file",size:o instanceof Blob?o.size:o.length,ctime:u,mtime:u,content:o};return await this.dbRequest("put",[c]),{uri:c.path}}async appendFile(n){const a=this.getPath(n.directory,n.path);let o=n.data;const r=n.encoding,i=a.substr(0,a.lastIndexOf("/")),s=Date.now();let l=s;const d=await this.dbRequest("get",[a]);if(d&&d.type==="directory")throw Error("The supplied path is a directory.");if(await this.dbRequest("get",[i])===void 0){const m=i.indexOf("/",1);if(m!==-1){const h=i.substr(m);await this.mkdir({path:h,directory:n.directory,recursive:!0})}}if(!r&&!this.isBase64String(o))throw Error("The supplied data is not valid base64 content.");if(d!==void 0){if(d.content instanceof Blob)throw Error("The occupied entry contains a Blob object which cannot be appended to.");d.content!==void 0&&!r?o=btoa(atob(d.content)+atob(o)):o=d.content+o,l=d.ctime}const c={path:a,folder:i,type:"file",size:o.length,ctime:l,mtime:s,content:o};await this.dbRequest("put",[c])}async deleteFile(n){const a=this.getPath(n.directory,n.path);if(await this.dbRequest("get",[a])===void 0)throw Error("File does not exist.");if((await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(a)])).length!==0)throw Error("Folder is not empty.");await this.dbRequest("delete",[a])}async mkdir(n){const a=this.getPath(n.directory,n.path),o=n.recursive,r=a.substr(0,a.lastIndexOf("/")),i=(a.match(/\//g)||[]).length,s=await this.dbRequest("get",[r]),l=await this.dbRequest("get",[a]);if(i===1)throw Error("Cannot create Root directory");if(l!==void 0)throw Error("Current directory does already exist.");if(!o&&i!==2&&s===void 0)throw Error("Parent directory must exist");if(o&&i!==2&&s===void 0){const c=r.substr(r.indexOf("/",1));await this.mkdir({path:c,directory:n.directory,recursive:o})}const d=Date.now(),u={path:a,folder:r,type:"directory",size:0,ctime:d,mtime:d};await this.dbRequest("put",[u])}async rmdir(n){const{path:a,directory:o,recursive:r}=n,i=this.getPath(o,a),s=await this.dbRequest("get",[i]);if(s===void 0)throw Error("Folder does not exist.");if(s.type!=="directory")throw Error("Requested path is not a directory");const l=await this.readdir({path:a,directory:o});if(l.files.length!==0&&!r)throw Error("Folder is not empty");for(const d of l.files){const u=`${a}/${d.name}`;(await this.stat({path:u,directory:o})).type==="file"?await this.deleteFile({path:u,directory:o}):await this.rmdir({path:u,directory:o,recursive:r})}await this.dbRequest("delete",[i])}async readdir(n){const a=this.getPath(n.directory,n.path),o=await this.dbRequest("get",[a]);if(n.path!==""&&o===void 0)throw Error("Folder does not exist.");const r=await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(a)]);return{files:await Promise.all(r.map(async s=>{let l=await this.dbRequest("get",[s]);return l===void 0&&(l=await this.dbRequest("get",[s+"/"])),{name:s.substring(a.length+1),type:l.type,size:l.size,ctime:l.ctime,mtime:l.mtime,uri:l.path}}))}}async getUri(n){const a=this.getPath(n.directory,n.path);let o=await this.dbRequest("get",[a]);return o===void 0&&(o=await this.dbRequest("get",[a+"/"])),{uri:(o==null?void 0:o.path)||a}}async stat(n){const a=this.getPath(n.directory,n.path);let o=await this.dbRequest("get",[a]);if(o===void 0&&(o=await this.dbRequest("get",[a+"/"])),o===void 0)throw Error("Entry does not exist.");return{name:o.path.substring(a.length+1),type:o.type,size:o.size,ctime:o.ctime,mtime:o.mtime,uri:o.path}}async rename(n){await this._copy(n,!0)}async copy(n){return this._copy(n,!1)}async requestPermissions(){return{publicStorage:"granted"}}async checkPermissions(){return{publicStorage:"granted"}}async _copy(n,a=!1){let{toDirectory:o}=n;const{to:r,from:i,directory:s}=n;if(!r||!i)throw Error("Both to and from must be provided");o||(o=s);const l=this.getPath(s,i),d=this.getPath(o,r);if(l===d)return{uri:d};if(wx(l,d))throw Error("To path cannot contain the from path");let u;try{u=await this.stat({path:r,directory:o})}catch{const f=r.split("/");f.pop();const g=f.join("/");if(f.length>0&&(await this.stat({path:g,directory:o})).type!=="directory")throw new Error("Parent directory of the to path is a file")}if(u&&u.type==="directory")throw new Error("Cannot overwrite a directory with a file");const c=await this.stat({path:i,directory:s}),m=async(p,f,g)=>{const y=this.getPath(o,p),k=await this.dbRequest("get",[y]);k.ctime=f,k.mtime=g,await this.dbRequest("put",[k])},h=c.ctime?c.ctime:Date.now();switch(c.type){case"file":{const p=await this.readFile({path:i,directory:s});a&&await this.deleteFile({path:i,directory:s});let f;!(p.data instanceof Blob)&&!this.isBase64String(p.data)&&(f=oo.UTF8);const g=await this.writeFile({path:r,directory:o,data:p.data,encoding:f});return a&&await m(r,h,c.mtime),g}case"directory":{if(u)throw Error("Cannot move a directory over an existing object");try{await this.mkdir({path:r,directory:o,recursive:!1}),a&&await m(r,h,c.mtime)}catch{}const p=(await this.readdir({path:i,directory:s})).files;for(const f of p)await this._copy({from:`${i}/${f.name}`,to:`${r}/${f.name}`,directory:s,toDirectory:o},a);a&&await this.rmdir({path:i,directory:s})}}return{uri:d}}isBase64String(n){try{return btoa(atob(n))==n}catch{return!1}}}la._debug=!0;const Ex=Object.freeze(Object.defineProperty({__proto__:null,FilesystemWeb:la},Symbol.toStringTag,{value:"Module"}));at.attLibAttendants=yi,at.attLibDeparts=gi,at.attLibInstances=ki,at.default=Jk,at.getWithContrastColor=bi,at.setupLibrary=xi,Object.defineProperties(at,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
132
+ </svg>`,info:a.content.info??"Nome que será atribuído no Produto",type:a.content.type??"text",placeholder:a.content.placeholder??"Integração de sistemas",empty:a.content.empty??!1,data:a.content.data??""}),i=e.ref(r.data);e.watch(i,l=>{o("update:content",{...r,data:l})},{immediate:!0,deep:!0}),e.watch(()=>a.content,l=>{l.data!==i.value&&(i.value=l.data),l.empty!==r.empty&&(r.empty=l.empty)},{deep:!0});const s=e.computed(()=>r.empty&&!i.value);return(l,d)=>{const u=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("section",xy,[e.createElementVNode("header",by,[e.createElementVNode("p",wy,e.toDisplayString(r.title),1),e.createVNode(u,{hover:"",content:r.info,placement:"top",arrow:""},{default:e.withCtx(()=>[...d[2]||(d[2]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-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.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1},8,["content"])]),e.createElementVNode("div",{class:e.normalizeClass(["input__container",s.value?"input__container--error":"",r.type==="textArea"?"textArea":""])},[r.type!=="textArea"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.value?"text-red-500":"text-base-100"),innerHTML:r.svg},null,10,Ey)):e.createCommentVNode("",!0),r.type!=="textArea"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:r.type,key:r.type,placeholder:r.placeholder,"onUpdate:modelValue":d[0]||(d[0]=c=>i.value=c),class:e.normalizeClass([s.value?"empty":null,"input__field"])},null,10,vy)),[[e.vModelDynamic,i.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:2,class:e.normalizeClass([s.value?"empty":null,"input__field h-full resize-y"]),"onUpdate:modelValue":d[1]||(d[1]=c=>i.value=c),placeholder:r.placeholder},null,10,Cy)),[[e.vModelText,i.value]]),s.value?(e.openBlock(),e.createElementBlock("span",Sy," Campo obrigatório ")):e.createCommentVNode("",!0)],2)])}}},[["__scopeId","data-v-cfd206c7"]]),By=["onClick"],Vy={key:0,xmlns:"http://www.w3.org/2000/svg",class:"size-4 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},My=["onClick"],Ny={key:0,xmlns:"http://www.w3.org/2000/svg",class:"size-4 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},ui=Ce({__name:"simpleSelect",props:{modelValue:{type:[Array,String,Number,Object],default:()=>[]},options:{type:Array,required:!0,default:()=>[]},placeholder:{type:String,default:"Selecione uma opção..."},multiple:{type:Boolean,default:!1},theme:{type:String,default:"bg-base-300 border-base-300"},teleportTo:{type:String,default:null}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),i=e.ref(null),s=e.ref(null),l=e.ref({});sn(i,()=>r.value=!1);const d=()=>{if(!a.teleportTo||!s.value)return;const p=s.value.getBoundingClientRect();l.value={position:"fixed",top:`${p.bottom+6}px`,left:`${p.left}px`,width:`${p.width}px`,zIndex:9999}};e.watch(r,p=>{p&&d()});const u=[];e.onMounted(()=>{if(a.teleportTo){const p=()=>{r.value&&d()};window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),u.push(["scroll",p],["resize",p])}}),e.onUnmounted(()=>{u.forEach(([p,f])=>window.removeEventListener(p,f,p==="scroll"?!0:void 0))});const c=p=>a.multiple&&Array.isArray(a.modelValue)?a.modelValue.includes(p):a.modelValue===p,m=p=>{if(a.multiple){const f=Array.isArray(a.modelValue)?[...a.modelValue]:[],g=f.indexOf(p);g===-1?f.push(p):f.splice(g,1),o("update:modelValue",f)}else o("update:modelValue",p),r.value=!1},h=e.computed(()=>{if(a.multiple&&Array.isArray(a.modelValue))return a.modelValue.length===0?a.placeholder:a.options.filter(g=>a.modelValue.includes(g.value)).map(g=>g.name).join(", ");const p=a.options.find(f=>f.value===a.modelValue);return(p==null?void 0:p.name)||a.placeholder});return(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:"relative w-full",ref_key:"dropdownRef",ref:i},[e.createElementVNode("div",{onClick:f[0]||(f[0]=g=>r.value=!r.value),class:e.normalizeClass(["flex flex-wrap items-center justify-between p-3 gap-2 rounded-md cursor-pointer transition",t.theme]),ref_key:"triggerRef",ref:s},[e.createElementVNode("span",{class:e.normalizeClass(["text-xs truncate max-w-full",h.value===t.placeholder?"text-gray-400":"text-white"])},e.toDisplayString(h.value),3),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["size-3 text-white transition-transform duration-300",r.value?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...f[1]||(f[1]=[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),r.value&&!t.teleportTo?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute flex flex-col z-10 mt-1.5 w-full shadow-sm border rounded-md max-h-64 overflow-y-auto hide-scrollbar",t.theme])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass([c(g.value)?"bg-green-500/30 hover:bg-green-500/50":"hover:bg-base-200","flex items-center justify-between gap-2 px-3 py-2 text-left text-sm cursor-pointer transition w-full"]),onClick:y=>m(g.value)},[e.createElementVNode("span",null,e.toDisplayString(g.name),1),c(g.value)?(e.openBlock(),e.createElementBlock("svg",Vy,[...f[2]||(f[2]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):e.createCommentVNode("",!0)],10,By))),128))],2)):e.createCommentVNode("",!0),r.value&&t.teleportTo?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:t.teleportTo},[e.createElementVNode("div",{style:e.normalizeStyle(l.value),class:e.normalizeClass(["flex flex-col shadow-sm border rounded-md max-h-64 overflow-y-auto hide-scrollbar",t.theme])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass([c(g.value)?"bg-green-500/30 hover:bg-green-500/50":"hover:bg-base-200","flex items-center justify-between gap-2 px-3 py-2 text-left text-sm cursor-pointer transition w-full"]),onClick:y=>m(g.value)},[e.createElementVNode("span",null,e.toDisplayString(g.name),1),c(g.value)?(e.openBlock(),e.createElementBlock("svg",Ny,[...f[3]||(f[3]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):e.createCommentVNode("",!0)],10,My))),128))],6)],8,["to"])):e.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-3ee440f9"]]),Ay={class:"flex gap-2"},Ty=Ce({__name:"outcomeButton",props:{outcome:{type:String,default:null}},emits:["update:outcome","change"],setup(t,{emit:n}){const a=t,o=n;async function r(l){const d=a.outcome===l?null:l;o("update:outcome",d),o("change",d)}const i=e.computed(()=>a.outcome==="won"),s=e.computed(()=>a.outcome==="lost");return(l,d)=>(e.openBlock(),e.createElementBlock("div",Ay,[e.createElementVNode("button",{onClick:d[0]||(d[0]=u=>r("won")),class:e.normalizeClass(["button_outcome-base",{"button_outcome-active-won":i.value}])},[d[3]||(d[3]=e.createElementVNode("p",null,"Aceito",-1)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"svg_outcome-active-won":i.value},"text-white size-4"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none"},[...d[2]||(d[2]=[e.createElementVNode("path",{d:"M3.16666 6.37502C3.74962 6.37502 4.2222 6.85073 4.22222 7.43752V15.9375C4.22222 16.5243 3.74963 17 3.16666 17H1.05555C0.472588 17 0 16.5243 0 15.9375V7.43752C1.50967e-05 6.85073 0.472597 6.37502 1.05555 6.37502H3.16666Z",fill:"CurrentColor"},null,-1),e.createElementVNode("path",{d:"M9.48143 1.4454C9.79496 -0.637173 11.5194 0.143216 11.5194 0.143216C13.863 1.75728 13.005 4.80783 12.2832 6.13118H17.4424C19.5307 6.65187 19.0768 8.34354 18.5887 9.12465C19.5056 10.7905 18.4191 11.7716 17.7609 12.0538C18.1175 13.7717 17.0601 14.4178 16.4869 14.5264C16.8944 16.4004 15.5533 16.9564 14.8314 17H10.436C8.49997 16.9999 6.19055 16.1753 5.27777 15.7632V7.368C9.03523 5.6108 9.09933 3.98356 9.48143 1.4454Z",fill:"CurrentColor"},null,-1)])],2))],2),e.createElementVNode("button",{onClick:d[1]||(d[1]=u=>r("lost")),class:e.normalizeClass(["button_outcome-base",{"button_outcome-active-lost":s.value}])},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"svg_outcome-active-lost":s.value},"text-white size-4 mt-0.8"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 19",fill:"none"},[...d[4]||(d[4]=[e.createElementVNode("path",{d:"M15.8333 10.625C15.2504 10.625 14.7778 10.1493 14.7778 9.56249L14.7778 1.0625C14.7778 0.475698 15.2504 1.57955e-06 15.8333 1.63051e-06L17.9444 1.81507e-06C18.5274 1.86603e-06 19 0.475698 19 1.0625L19 9.56249C19 10.1493 18.5274 10.625 17.9444 10.625L15.8333 10.625Z",fill:"CurrentColor"},null,-1),e.createElementVNode("path",{d:"M9.51857 15.5546C9.20504 17.6372 7.48065 16.8568 7.48065 16.8568C5.13698 15.2427 5.99503 12.1922 6.71681 10.8688L1.55759 10.8688C-0.530671 10.3481 -0.0768444 8.65646 0.411319 7.87535C-0.50562 6.20951 0.580926 5.22844 1.23906 4.94622C0.882549 3.22832 1.93994 2.5822 2.51315 2.47363C2.10564 0.59965 3.44673 0.0436064 4.16864 6.1075e-07L8.56403 9.95007e-07C10.5 0.000138493 12.8095 0.824657 13.7222 1.23682L13.7222 9.632C9.96477 11.3892 9.90067 13.0164 9.51857 15.5546Z",fill:"CurrentColor"},null,-1)])],2)),d[5]||(d[5]=e.createElementVNode("p",null,"Perdido",-1))],2)]))}},[["__scopeId","data-v-f9b09b5e"]]),Dy={class:"flex gap-1 select-none"},Fy=["onMousemove","onClick"],ao=Ce({__name:"raitingInput",props:{modelValue:{type:Number,default:0}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(a.modelValue),i=e.ref(0);e.watch(()=>a.modelValue,c=>{r.value=c});const s=e.computed(()=>i.value||r.value);function l(c){const m=s.value-c+1;return m>=1?"100%":m>=.5?"50%":m>0?`${m*100}%`:"0%"}function d(c,m){const h=c.currentTarget.getBoundingClientRect(),p=c.offsetX<h.width/2;i.value=m-(p?.5:0)}function u(c,m){const h=c.currentTarget.getBoundingClientRect(),p=c.offsetX<h.width/2,f=m-(p?.5:0);r.value=r.value===f?0:f,o("update:modelValue",r.value)}return(c,m)=>(e.openBlock(),e.createElementBlock("main",Dy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,h=>e.createElementVNode("div",{key:h,class:"relative size-6 cursor-pointer",onMousemove:p=>d(p,h),onMouseleave:m[0]||(m[0]=p=>i.value=0),onClick:p=>u(p,h)},[m[2]||(m[2]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"absolute top-0 left-0 size-6 color-disabled"},[e.createElementVNode("path",{d:"M13.849 4.22c-.684-1.626-3.014-1.626-3.698 0L8.397 8.387l-4.552.361c-1.775.14-2.495 2.331-1.142 3.477l3.468 2.937-1.06 4.392c-.413 1.713 1.472 3.067 2.992 2.149L12 19.35l3.897 2.354c1.52.918 3.405-.436 2.992-2.15l-1.06-4.39 3.468-2.938c1.353-1.146.633-3.336-1.142-3.477l-4.552-.36-1.754-4.17Z"})],-1)),e.createElementVNode("div",{class:"absolute top-0 left-0 h-full overflow-hidden text-primary transition-all duration-150",style:e.normalizeStyle({width:l(h)})},[...m[1]||(m[1]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"size-6"},[e.createElementVNode("path",{d:"M13.849 4.22c-.684-1.626-3.014-1.626-3.698 0L8.397 8.387l-4.552.361c-1.775.14-2.495 2.331-1.142 3.477l3.468 2.937-1.06 4.392c-.413 1.713 1.472 3.067 2.992 2.149L12 19.35l3.897 2.354c1.52.918 3.405-.436 2.992-2.15l-1.06-4.39 3.468-2.938c1.353-1.146.633-3.336-1.142-3.477l-4.552-.36-1.754-4.17Z"})],-1)])],4)],40,Fy)),64))]))}},[["__scopeId","data-v-af20a8bd"]]),Ly={key:1,class:"flex flex-col w-full"},$y={key:0,class:"sticky top-0 z-10 bg-base-300 p-1 flex gap-2"},Py={class:"sticky bottom-0 bg-green-900 p-1.5 text-[10px] rounded-md border border-green-500 w-full"},Oy={class:"flex-1 overflow-y-auto flex flex-col gap-2 px-2"},_y={key:0,class:"w-full text-gray-500 list-none list-inside dark:text-gray-400 divide-y divide-base-200"},Hy={class:"flex gap-2 items-center"},Ry=["src"],zy={key:1,class:"size-8 rounded-md flex items-center justify-center border border-base-200"},jy={class:"flex flex-col items-start"},Gy={class:"text-xs font-semibold font-sans"},Iy={class:"flex gap-1"},qy={class:"flex gap-1"},Wy=["onClick"],Uy=["onClick"],Zy={key:1,class:"flex flex-col gap-1 min-h-48 flex-1 w-full justify-center items-center"},Yy=Ce({__name:"listProducts",props:{modelValue:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),i=e.ref([]),s=e.ref([...a.modelValue]),l=e.ref(1),d=e.ref(null),u=e.ref(null),c=e.computed(()=>s.value.reduce((T,_)=>{var P;const C=((P=_.product)==null?void 0:P.price)||_.price||0,w=_.quantity||0;return T+C*w},0)),m=e.computed(()=>{const T={};return s.value.forEach(_=>{T[_.product.id]=_.quantity}),T}),h=T=>m.value[T.id]||0,p=T=>{const _=s.value.find(C=>C.product.id===T.id);_?_.quantity++:s.value.push({product:{...T},quantity:1})},f=T=>{const _=s.value.find(C=>C.product.id===T.id);_&&(_.quantity>0?_.quantity--:_.quantity=0)},g=(T,_)=>{const C=new URLSearchParams,w=T;return Object.keys(_).forEach(P=>C.append(P,_[P])),`${w}?${C.toString()}`},y=async T=>{try{const{data:_}=await ot.get(g(Fs,{page:l.value,...T})),{results:C,next:w,previous:P}=_;if(d.value=w,u.value=P,l.value===1)i.value=C;else{const F=new Set(i.value.map(V=>V.id)),H=C.filter(V=>!F.has(V.id));i.value=[...i.value,...H]}d.value&&(l.value+=1)}catch(_){console.error("Erro ao buscar produtos:",_)}};e.onMounted(()=>{y()}),e.watch(s,T=>{o("update:modelValue",T)},{deep:!0});const k=e.ref(!1),x=async T=>{if(!k.value){k.value=!0;try{if(!d.value){T.complete();return}await y(),d.value?T.loaded():T.complete()}catch(_){console.error("Erro ao carregar produtos:",_),T.complete()}finally{k.value=!1}}},E=e.ref({query:"",recurrence:"",status:""}),B=e.ref(!1);let M;return e.watch(E,()=>{clearTimeout(M),M=setTimeout(async()=>{const{query:T,recurrence:_,status:C}=E.value;l.value=1,B.value=!!(T||_||C),r.value=!0,await y({query:T,recurrence:_,status:C}),r.value=!1},500)},{deep:!0}),(T,_)=>{const C=e.resolveComponent("SimpleLoader");return r.value?(e.openBlock(),e.createBlock(C,{key:0})):(e.openBlock(),e.createElementBlock("main",Ly,[i.value.length>0&&!B.value||B.value?(e.openBlock(),e.createElementBlock("header",$y,[e.withDirectives(e.createElementVNode("input",{class:"w-full text-xs bg-base-300 rounded-md p-1 outline-none border-none focus:outline-none focus:ring-0 focus:shadow-none",type:"text",placeholder:"Buscar...","onUpdate:modelValue":_[0]||(_[0]=w=>E.value.query=w)},null,512),[[e.vModelText,E.value.query]]),e.createElementVNode("section",Py," Valor total: R$"+e.toDisplayString(c.value.toFixed(2)),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Oy,[i.value.length>0&&!B.value||B.value?(e.openBlock(),e.createElementBlock("ul",_y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(w,P)=>(e.openBlock(),e.createElementBlock("li",{class:"flex w-full justify-between items-center py-2",key:w.id},[e.createElementVNode("div",Hy,[e.createElementVNode("section",null,[w.photo?(e.openBlock(),e.createElementBlock("img",{key:0,class:"size-8 rounded-md",src:w.photo,alt:""},null,8,Ry)):(e.openBlock(),e.createElementBlock("div",zy,[..._[1]||(_[1]=[e.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M4 19v2c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2H4Z"}),e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M9 3c0-.55228.44772-1 1-1h8c.5523 0 1 .44772 1 1v3c0 .55228-.4477 1-1 1h-2v1h2c.5096 0 .9376.38314.9939.88957L19.8951 17H4.10498l.90116-8.11043C5.06241 8.38314 5.49047 8 6.00002 8H12V7h-2c-.55228 0-1-.44772-1-1V3Zm1.01 8H8.00002v2.01H10.01V11Zm.99 0h2.01v2.01H11V11Zm5.01 0H14v2.01h2.01V11Zm-8.00998 3H10.01v2.01H8.00002V14ZM13.01 14H11v2.01h2.01V14Zm.99 0h2.01v2.01H14V14ZM11 4h6v1h-6V4Z","clip-rule":"evenodd"})],-1)])]))]),e.createElementVNode("section",jy,[e.createElementVNode("p",{class:e.normalizeClass(["text-xs font-semibold",h(w)>0?"text-white":""])},e.toDisplayString(w.name),3),e.createElementVNode("p",Gy," R$ "+e.toDisplayString(w.price.toFixed(2)),1)])]),e.createElementVNode("section",Iy,[e.createElementVNode("p",{class:e.normalizeClass(["text-xs font-semibold font-sans products-and-services_badge",w.recurrence])},e.toDisplayString(w.recurrence==="monthly"?"Mensal":"Único"),3),e.createElementVNode("div",qy,[e.createElementVNode("button",{class:"bg-base-200 size-6 rounded-md flex items-center justify-center",onClick:F=>f(w)}," - ",8,Wy),e.createElementVNode("p",{class:e.normalizeClass(["w-5 text-xs flex items-center justify-center font-semibold font-sans",h(w)>0?"text-white":""])},e.toDisplayString(h(w)),3),e.createElementVNode("button",{class:"bg-base-200 size-6 rounded-md flex items-center justify-center",onClick:F=>p(w)}," + ",8,Uy)])])]))),128))])):e.createCommentVNode("",!0),B.value&&i.value.length===0||i.value.length===0?(e.openBlock(),e.createElementBlock("section",Zy,[..._[2]||(_[2]=[e.createStaticVNode('<p class="text-gray-600 text-base font-sans" data-v-6d666047>Nenhum item encontrado</p><p class="text-gray-600 text-xs font-sans" data-v-6d666047> Comece criando seu primeiro na aba <strong data-v-6d666047>Produtos</strong></p><button class="bg-green-700 text-white py-1 px-2 rounded-md text-xs mt-2 hover:bg-green-600 flex gap-1 items-center justify-center" data-v-6d666047><p data-v-6d666047>Criar novo</p><svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" data-v-6d666047><path fill="currentColor" d="M4 19v2c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2H4Z" data-v-6d666047></path><path fill="currentColor" fill-rule="evenodd" d="M9 3c0-.55228.44772-1 1-1h8c.5523 0 1 .44772 1 1v3c0 .55228-.4477 1-1 1h-2v1h2c.5096 0 .9376.38314.9939.88957L19.8951 17H4.10498l.90116-8.11043C5.06241 8.38314 5.49047 8 6.00002 8H12V7h-2c-.55228 0-1-.44772-1-1V3Zm1.01 8H8.00002v2.01H10.01V11Zm.99 0h2.01v2.01H11V11Zm5.01 0H14v2.01h2.01V11Zm-8.00998 3H10.01v2.01H8.00002V14ZM13.01 14H11v2.01h2.01V14Zm.99 0h2.01v2.01H14V14ZM11 4h6v1h-6V4Z" clip-rule="evenodd" data-v-6d666047></path></svg></button>',3)])])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createBlock(e.unref(hn),{key:2,onInfinite:x,class:"p-3 bg-base-300"},{spinner:e.withCtx(()=>[..._[3]||(_[3]=[e.createElementVNode("section",{class:"w-full justify-center items-center flex"},[e.createElementVNode("div",{class:"size-4 animate-spin rounded-full border-4 border-solid border-white border-t-transparent"})],-1)])]),_:1})):e.createCommentVNode("",!0)])]))}}},[["__scopeId","data-v-6d666047"]]),Xy={class:"test-style p-2 h-full overflow-auto"},Ky={class:"flex flex-col gap-2"},Qy=["onUpdate:modelValue"],Jy={class:"text-[10px] font-sans"},ek=["onUpdate:modelValue"],tk=["onUpdate:modelValue"],nk=Ce({__name:"listSegmentationsFields",props:{modelValue:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref([...a.modelValue]);return e.watch(r,i=>{o("update:modelValue",i)},{deep:!0}),(i,s)=>{const l=e.resolveComponent("SimpleSelect");return e.openBlock(),e.createElementBlock("div",Xy,[s[0]||(s[0]=e.createElementVNode("header",{class:"text-start w-full items-center justify-between flex mb-2 px-1"},[e.createElementVNode("p",{class:"text-sm font-semibold"},"Campos Personalizados")],-1)),e.createElementVNode("div",Ky,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,d=>(e.openBlock(),e.createElementBlock("section",{key:d.id},[e.createElementVNode("div",{class:e.normalizeClass(["flex gap-1 rounded-md",d.type==="bool"?"flex-row items-center":"flex-col items-start"])},[d.type==="bool"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,class:"checkbox size-4 rounded-sm",type:"checkbox","onUpdate:modelValue":u=>d.content=u},null,8,Qy)),[[e.vModelCheckbox,d.content]]):e.createCommentVNode("",!0),e.createElementVNode("p",Jy,e.toDisplayString(d.name)+":",1),d.type==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,class:"input_field",type:"text","onUpdate:modelValue":u=>d.content=u},null,8,ek)),[[e.vModelText,d.content]]):e.createCommentVNode("",!0),d.type==="float"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,class:"input_field",type:"number","onUpdate:modelValue":u=>d.content=u},null,8,tk)),[[e.vModelText,d.content]]):e.createCommentVNode("",!0),d.type==="list"?(e.openBlock(),e.createBlock(l,{key:3,modelValue:d.content,"onUpdate:modelValue":u=>d.content=u,options:d.additional_info.list.options.map(u=>({value:u,name:u})),placeholder:"Selecione uma opção",theme:"bg-base-300 border-base-100","teleport-to":"body"},null,8,["modelValue","onUpdate:modelValue","options"])):e.createCommentVNode("",!0)],2)]))),128))])])}}},[["__scopeId","data-v-71532b46"]]),ak={class:"modal_head"},ok={class:"modal_responsive"},rk={class:"flex min-h-full items-center justify-center text-center"},ik={class:"z-50 w-full lg:w-1/2 shadow rounded-2xl shadow-black"},sk={class:"modal_background"},lk={class:"flex justify-between p-2.5 rounded-t-2xl bg-base-300 items-center text-current"},ck={class:"flex items-center gap-2"},dk={class:"flex flex-col items-start"},uk={class:"text-lg font-semibold"},fk={key:0,class:"text-xs text-gray-400"},mk={class:"flex gap-2 items-center"},hk={class:"grid grid-cols-2"},pk={class:"w-full flex flex-col gap-3 justify-center items-center p-2"},gk={key:0,class:"flex gap-2"},yk={class:"flex items-center justify-center"},kk=["src"],xk={key:1,class:"bg-base-300 p-2 rounded-xl size-24 flex items-center justify-center border border-base-100"},bk={class:"flex flex-col w-full gap-2"},wk={class:"flex flex-col gap-2 w-full"},Ek={class:"flex flex-col gap-2 w-full"},vk={class:"flex items-center justify-between px-1"},Ck={class:"w-full"},Sk={class:"bg-base-300 flex flex-col gap-3 justify-center"},Bk={class:"flex divide-x divide-x-white justify-between -mb-3"},Vk=["disabled"],Mk={key:0},Nk={key:1,class:"size-3.5 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Ak={key:0,class:"flex flex-col gap-2 justify-between h-full p-1.5"},Tk={class:"test-style"},Dk={class:"products-list-section"},Fk={class:"modal_end_button"},Lk=["disabled"],$k={key:0,class:"size-4 animate-spin rounded-full border-4 border-solid text-white border-t-transparent"},Pk={key:1,class:"text-xs font-semibold"},fi=Ce({__name:"clientsForm",props:{form:{type:Object,default:()=>({tags:[],country:"BR",name:"",photo:null,raw_telephone:"",telephone:"",whatsapp_id:"",whatsapp_jid:"",whatsapp_lid:null,rating:null,outcome:null,created_at:"",updated_at:"",client:"",products:[]})},save:{type:Function,default:()=>{}},hasCrmPlus:{type:Boolean,default:!1},tagsFunctions:{type:Function,default:()=>{}}},emits:["close","save"],setup(t,{emit:n}){const a=n,o=e.ref("data"),r=t,i=e.reactive({...r.form}),s=e.ref(!1),l=e.ref({title:"Nome",info:"Nome do contato",type:"text",placeholder:"Digite o nome do contato",empty:!1,data:e.computed({get:()=>i.name,set:c=>i.name=c})}),d=e.computed(()=>r.form.mode==="edit"?`Editar ${i.name}`:"Adicionar Novo Cliente"),u=async()=>{try{s.value=!0,await r.save(i)}catch(c){console.error(c)}finally{s.value=!1}};return e.watch(()=>r.form,c=>{Object.assign(i,e.toRaw(c))},{deep:!0,immediate:!0}),(c,m)=>{const h=e.resolveComponent("Popper"),p=e.resolveComponent("vue-tel-input");return e.openBlock(),e.createElementBlock("div",ak,[m[22]||(m[22]=e.createElementVNode("div",{class:"modal-overlay absolute h-full bg-gray-600 w-full opacity-70"},null,-1)),e.createElementVNode("div",ok,[e.createElementVNode("div",rk,[e.createElementVNode("div",ik,[e.createElementVNode("div",sk,[e.createElementVNode("div",lk,[e.createElementVNode("span",ck,[m[13]||(m[13]=e.createElementVNode("svg",{class:"size-6 text-green-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:"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"})],-1)),e.createElementVNode("span",dk,[e.createElementVNode("p",uk,e.toDisplayString(d.value),1),i.id?(e.openBlock(),e.createElementBlock("p",fk," ID: "+e.toDisplayString(i.id),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("section",mk,[e.createVNode(h,{hover:"",arrow:""},{content:e.withCtx(()=>[...m[14]||(m[14]=[e.createElementVNode("div",{class:"text-[10px] bg-base-100 p-2 rounded-md w-52 text-center"}," Uma label explicativa sobre a funcionalidade do CRM+, CTA e etc. ",-1)])]),default:e.withCtx(()=>[m[15]||(m[15]=e.createElementVNode("span",{class:"bg-green-500 rounded-full flex items-center justify-center p-1.5 group"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"size-3.5 text-white",viewBox:"0 0 800 726",fill:"none"},[e.createElementVNode("path",{d:"M208 195.556H8.88906C3.98125 195.556 0 199.535 0 204.445V698.667C0 713.393 11.9391 725.334 26.6672 725.334H208C212.908 725.334 216.889 721.354 216.889 716.445V204.445C216.889 199.535 212.908 195.556 208 195.556ZM140.452 616.888H76.4516C61.725 616.888 49.7844 604.949 49.7844 590.221C49.7844 575.493 61.7234 563.554 76.4516 563.554H140.452C155.178 563.554 167.119 575.493 167.119 590.221C167.119 604.949 155.18 616.888 140.452 616.888ZM140.452 487.11H76.4516C61.725 487.11 49.7844 475.171 49.7844 460.443C49.7844 445.717 61.7234 433.776 76.4516 433.776H140.452C155.178 433.776 167.119 445.715 167.119 460.443C167.119 475.171 155.18 487.11 140.452 487.11ZM140.452 357.334H76.4516C61.725 357.334 49.7844 345.395 49.7844 330.667C49.7844 315.938 61.7234 303.999 76.4516 303.999H140.452C155.178 303.999 167.119 315.938 167.119 330.667C167.119 345.395 155.18 357.334 140.452 357.334Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M773.333 0H26.6672C11.9391 0 0 11.9406 0 26.6672V133.334C0 138.242 3.97969 142.223 8.88906 142.223H791.111C796.019 142.223 800 138.244 800 133.334V26.6672C800 11.9406 788.061 0 773.333 0ZM101.333 88.8891C91.5141 88.8891 83.5547 80.9297 83.5547 71.1109C83.5547 61.2922 91.5141 53.3328 101.333 53.3328C111.152 53.3328 119.111 61.2922 119.111 71.1109C119.111 80.9297 111.152 88.8891 101.333 88.8891ZM172.444 88.8891C162.625 88.8891 154.666 80.9297 154.666 71.1109C154.666 61.2922 162.625 53.3328 172.444 53.3328C182.262 53.3328 190.222 61.2922 190.222 71.1109C190.222 80.9297 182.262 88.8891 172.444 88.8891ZM243.556 88.8891C233.738 88.8891 225.778 80.9297 225.778 71.1109C225.778 61.2922 233.738 53.3328 243.556 53.3328C253.375 53.3328 261.334 61.2922 261.334 71.1109C261.333 80.9297 253.373 88.8891 243.556 88.8891Z",fill:"currentColor"}),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M791.111 195.556C796.021 195.556 800.001 199.535 800.001 204.444V698.667C800.001 713.395 788.06 725.334 773.334 725.334H279.111C274.202 725.334 270.223 721.352 270.223 716.444V204.444C270.223 199.535 274.204 195.556 279.111 195.556H791.111ZM558.521 358.955C550.005 339.015 520.995 339.015 512.479 358.955L490.642 410.056L433.968 414.482C411.869 416.199 402.905 443.068 419.75 457.122L462.928 493.14L449.73 546.999C444.589 568.006 468.057 584.61 486.981 573.353L535.5 544.498L584.019 573.365C602.943 584.623 626.411 568.018 621.27 546.999L608.072 493.164L651.25 457.135C668.095 443.081 659.131 416.224 637.032 414.495L580.358 410.08L558.521 358.955Z",fill:"currentColor"})])],-1))]),_:1}),e.createElementVNode("button",{class:"bg-base-200 p-1.5 rounded-md hover:bg-base-200/70 transition",onClick:m[0]||(m[0]=f=>a("close"))},[...m[16]||(m[16]=[e.createElementVNode("svg",{class:"size-4 text-white","aria-hidden":"true",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:"M6 18 17.94 6M18 18 6.06 6"})],-1)])])])]),e.createElementVNode("div",hk,[e.createElementVNode("section",pk,[t.hasCrmPlus?(e.openBlock(),e.createElementBlock("div",gk,[e.createVNode(Ty,{outcome:i.outcome,"onUpdate:outcome":m[1]||(m[1]=f=>i.outcome=f)},null,8,["outcome"])])):e.createCommentVNode("",!0),e.createElementVNode("div",yk,[i.photo?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:m[2]||(m[2]=f=>c.viewSingleImage(i.photo)),class:"cursor-pointer"},[e.createElementVNode("img",{src:i.photo,alt:"",class:"size-24 object-cover rounded-md hover:brightness-75 transition cursor-pointer"},null,8,kk)])):(e.openBlock(),e.createElementBlock("span",xk,[...m[17]||(m[17]=[e.createElementVNode("svg",{class:"size-14","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 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"})],-1)])]))]),t.hasCrmPlus?(e.openBlock(),e.createBlock(ao,{key:1,modelValue:i.rating,"onUpdate:modelValue":m[3]||(m[3]=f=>i.rating=f)},null,8,["modelValue"])):e.createCommentVNode("",!0),e.createElementVNode("div",bk,[e.createElementVNode("div",wk,[e.createElementVNode("div",Ek,[e.createElementVNode("header",vk,[m[19]||(m[19]=e.createElementVNode("p",{class:"text-xs font-medium text-left"}," Nome da etiqueta ",-1)),e.createVNode(h,{hover:"",content:"teste",placement:"top",arrow:""},{default:e.withCtx(()=>[...m[18]||(m[18]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-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.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1})]),e.createVNode(to,{modelValue:i.tags,"onUpdate:modelValue":m[4]||(m[4]=f=>i.tags=f)},null,8,["modelValue"])]),e.createElementVNode("div",Ck,[e.createVNode(no,{"onUpdate:content":m[5]||(m[5]=f=>l.value.data=f.data),content:l.value},null,8,["content"])])])])]),e.createElementVNode("section",Sk,[e.createElementVNode("div",Bk,[e.createElementVNode("button",{class:e.normalizeClass([o.value==="data"?"bg-green-900":"","bg-base-300 p-1 w-full text-xs font-sans font-medium flex items-center justify-center hover:bg-base-200/70 transition"]),onClick:m[6]||(m[6]=f=>o.value="data")}," Dados do cliente ",2),e.createElementVNode("button",{class:e.normalizeClass([o.value==="products"?"bg-green-900":"","bg-base-300 p-1 w-full text-xs font-sans font-medium flex items-center justify-center hover:bg-base-200/70 transition"]),disabled:!t.hasCrmPlus,onClick:m[7]||(m[7]=f=>o.value="products")},[t.hasCrmPlus?(e.openBlock(),e.createElementBlock("p",Mk,"Produtos")):(e.openBlock(),e.createElementBlock("svg",Nk,[...m[20]||(m[20]=[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)])]))],10,Vk)]),o.value==="data"?(e.openBlock(),e.createElementBlock("div",Ak,[e.createElementVNode("div",Tk,[m[21]||(m[21]=e.createElementVNode("h1",{class:"text-start w-full items-center justify-between flex p-2"},[e.createElementVNode("p",{class:"text-xs font-semibold"},"Contatos")],-1)),e.createVNode(p,{class:"z-50",onCountryChanged:m[8]||(m[8]=f=>i.country=f.iso2),mode:"national",validCharactersOnly:!0,defaultCountry:i.country,inputOptions:{placeholder:"Coloque seu telefone",showDialCode:!1,required:!0,searchBoxPlaceholder:"Brazil"},dropdownOptions:{showSearchBox:!0,showFlags:!0,searchBoxPlaceholder:"Brazil"},modelValue:i.telephone,"onUpdate:modelValue":m[9]||(m[9]=f=>i.telephone=f)},null,8,["defaultCountry","modelValue"])]),e.createElementVNode("div",{class:e.normalizeClass([{noCrmPlus:!t.hasCrmPlus},"segmentation-section"])},[o.value==="data"?(e.openBlock(),e.createBlock(nk,{key:0,modelValue:i.segmentation_fields,"onUpdate:modelValue":m[10]||(m[10]=f=>i.segmentation_fields=f)},null,8,["modelValue"])):e.createCommentVNode("",!0)],2)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",Dk,[e.createVNode(Yy,{modelValue:i.products,"onUpdate:modelValue":m[11]||(m[11]=f=>i.products=f)},null,8,["modelValue"])],512),[[e.vShow,o.value==="products"]])])]),e.createElementVNode("div",Fk,[e.createElementVNode("button",{disabled:s.value,class:"bg-green-500 py-2 px-4 rounded-lg text-sm font-medium hover:bg-green-500/80 transition-colors flex gap-2 items-center justify-center min-w-32",onClick:m[12]||(m[12]=f=>u())},[s.value?(e.openBlock(),e.createElementBlock("div",$k)):(e.openBlock(),e.createElementBlock("p",Pk,"Salvar"))],8,Lk)])])])])])])}}},[["__scopeId","data-v-a0ffafd0"]]),Ok={},_k={class:"flex items-center justify-center h-full"};function Hk(t,n){return e.openBlock(),e.createElementBlock("div",_k,[...n[0]||(n[0]=[e.createElementVNode("span",{class:"products-and-services_bar"},null,-1),e.createElementVNode("span",{class:"products-and-services_bar"},null,-1),e.createElementVNode("span",{class:"products-and-services_bar"},null,-1)])])}const mi=Ce(Ok,[["render",Hk],["__scopeId","data-v-3f0502dd"]]),Rk={class:"flex justify-center items-center"},zk={class:"text-[8px] font-bold"},jk={class:"tag-view-popper-content-text"},Gk={class:"flex hover:scale-105 ease-in-out transition-all"},Ik={class:"svg-list-tag","aria-hidden":"true",viewBox:"0 0 25 100",style:{color:"#d1d5db"}},qk={style:{backgroundColor:"#d1d5db"},class:"w-full ml-[-0.5rem] rounded-r-md inline-flex items-center justify-center p-0.5 border-b-2 border-gray-900"},Wk={class:"text-[8px] text-black font-bold"},Uk={class:"max-h-64 overflow-y-auto hide-scrollbar"},Zk={class:"flex flex-col gap-2"},Yk={class:"tag-view-popper-content-text"},Xk={key:1},hi=Ce({__name:"tagView",props:{clients:{type:Object,required:!0}},setup(t){const n=t;return e.computed(()=>{var a,o;return((o=(a=n.clients)==null?void 0:a.tags)==null?void 0:o.slice(0,4))||[]}),(a,o)=>{const r=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("section",Rk,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.clients.tags.slice(0,4),(i,s)=>(e.openBlock(),e.createBlock(r,{class:"tag-view-theme",arrow:"",hover:"",key:s},{content:e.withCtx(()=>[e.createElementVNode("p",jk,e.toDisplayString(i.name),1)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex hover:scale-105 ease-in-out transition-all",e.unref(ia)(i.color)])},[(e.openBlock(),e.createElementBlock("svg",{class:"svg-list-tag","aria-hidden":"true",viewBox:"0 0 30 100",style:e.normalizeStyle({color:i.color||"#fff"})},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])],4)),e.createElementVNode("span",{style:e.normalizeStyle({backgroundColor:i.color||"#fff"}),class:"w-full ml-[-0.10rem] rounded-r-md inline-flex items-center justify-center px-1 py-0.5 border-b-2 border-gray-900"},[e.createElementVNode("p",zk,e.toDisplayString(i.name.charAt(0).toUpperCase()),1)],4)],2)]),_:2},1024))),128)),t.clients.tags.length>4?(e.openBlock(),e.createBlock(r,{key:0,arrow:"",hover:"",class:"tag-view-theme"},{content:e.withCtx(()=>[e.createElementVNode("section",Uk,[e.createElementVNode("div",Zk,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.clients.tags,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id||i.name,class:"relative inline-flex items-center rounded-md overflow-hidden"},[(e.openBlock(),e.createElementBlock("svg",{class:"size-6","aria-hidden":"true",viewBox:"0 0 65 90",style:e.normalizeStyle({color:i.color||"#fff"})},[...o[2]||(o[2]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])],4)),e.createElementVNode("span",{class:e.normalizeClass(["p-0.5 w-full text-sm font-semibold truncate text-start -ml-2",e.unref(ia)(i.color)]),style:e.normalizeStyle(["max-width: 12rem",{background:i.color||"#fff"}])},[e.createElementVNode("p",Yk,e.toDisplayString(i.name),1)],6)]))),128))])])]),default:e.withCtx(()=>[e.createElementVNode("div",Gk,[(e.openBlock(),e.createElementBlock("svg",Ik,[...o[1]||(o[1]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])])),e.createElementVNode("span",qk,[e.createElementVNode("p",Wk," +"+e.toDisplayString(t.clients.tags.length-4),1)])])]),_:1})):e.createCommentVNode("",!0),!t.clients.tags||t.clients.tags.length===0?(e.openBlock(),e.createElementBlock("span",Xk,"-")):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-54723b10"]]),pi=Ce({__name:"floating-dev",setup(t){const n=e.ref(!1),a=e.ref({x:30,y:30}),o=e.ref({x:0,y:0}),r=e.ref(!1),i=e.ref(null),s=e.ref(null),l=e.ref({vertical:"bottom",horizontal:"right"}),d=e.computed(()=>({position:"fixed",left:`${a.value.x}px`,top:`${a.value.y}px`,zIndex:1e3,cursor:r.value?"grabbing":"grab"})),u=e.computed(()=>{const g={position:"absolute",background:"#fff",borderRadius:"10px",boxShadow:"0 4px 15px rgba(0, 0, 0, 0.2)",width:"280px",maxWidth:"90vw",zIndex:1001};return l.value.vertical==="top"?g.bottom="60px":g.top="60px",l.value.horizontal==="left"?g.right="0":g.left="0",g});async function c(){if(n.value){n.value=!1;return}n.value=!0,await e.nextTick(),m()}function m(){if(!i.value||!s.value)return;const g=i.value.getBoundingClientRect(),y=s.value.offsetWidth,k=s.value.offsetHeight,x={top:g.top,bottom:window.innerHeight-(g.top+g.height),left:g.left,right:window.innerWidth-(g.left+g.width)};l.value.vertical=x.bottom<k&&x.top>k?"top":"bottom",l.value.horizontal=x.right<y&&x.left>y?"left":"right"}function h(g){r.value=!0;const y=g.type.includes("touch")?g.touches[0]:g;o.value={x:y.clientX-a.value.x,y:y.clientY-a.value.y},document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p),document.addEventListener("touchend",f)}function p(g){if(!r.value)return;const y=g.type.includes("touch")?g.touches[0]:g,k=y.clientX-o.value.x,x=y.clientY-o.value.y,E=window.innerWidth-i.value.offsetWidth,B=window.innerHeight-i.value.offsetHeight;a.value.x=Math.min(Math.max(0,k),E),a.value.y=Math.min(Math.max(0,x),B)}function f(){r.value=!1,document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",f)}return e.onBeforeUnmount(f),(g,y)=>(e.openBlock(),e.createElementBlock("div",{class:"floating-widget",style:e.normalizeStyle(d.value),ref_key:"widgetRef",ref:i,onMousedown:h,onTouchstart:h},[e.createElementVNode("button",{class:"floating-button",onClick:e.withModifiers(c,["stop"]),"aria-label":"Abrir painel flutuante"},[...y[0]||(y[0]=[e.createElementVNode("svg",{class:"floating-button-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[e.createElementVNode("path",{d:"M370 378c28.89 23.52 46 46.07 46 86M142 378c-28.89 23.52-46 46.06-46 86M384 208c28.89-23.52 32-56.07 32-96M128 206c-28.89-23.52-32-54.06-32-94M464 288.13h-80M128 288.13H48M256 192v256",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),e.createElementVNode("path",{d:"M256 448h0c-70.4 0-128-57.6-128-128v-96.07c0-65.07 57.6-96 128-96h0c70.4 0 128 25.6 128 96V320c0 70.4-57.6 128-128 128z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),e.createElementVNode("path",{d:"M179.43 143.52a49.08 49.08 0 01-3.43-15.73A80 80 0 01255.79 48h.42A80 80 0 01336 127.79a41.91 41.91 0 01-3.12 14.3",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1)])]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"floating-panel",ref_key:"panelRef",ref:s,style:e.normalizeStyle(u.value)},[e.renderSlot(g.$slots,"default",{},()=>[y[1]||(y[1]=e.createElementVNode("p",{style:{"text-align":"center","font-size":"0.9rem"}}," Adicione seu conteúdo aqui 👇 ",-1))],!0)],4)):e.createCommentVNode("",!0)]),_:3})],36))}},[["__scopeId","data-v-7767be25"]]);Dt.defineStore("debug",{state:()=>({message:"Debug store initialized"}),actions:{logMessage(){console.log(this.message)}}});function Kk(t){t.component("primarySelect",po),t.component("departSelect",K1),t.component("attendantSelect",Q1),t.component("SimpleModal",go),t.component("simpleCard",yo),t.component("instanceSelect",or),t.component("calendarEvents",pr),t.component("MFA",gr),t.component("MfaQrCode",N3),t.component("chatWindow",Y1),t.component("FilterSelectLib",J1),t.component("MobileInternalChat",X1),t.component("RandomAvatar",ai),t.component("MinModal",oi),t.component("LibPatchNotes",si),t.component("BtnNewUpdates",li),t.component("LibPhotoPicker",ci),t.component("SelectMultipleDepartments",di),t.component("PrimaryInput",no),t.component("SimpleSelect",ui),t.component("FloatingDev",pi),t.component("RaitingInput",ao),t.component("TagView",hi),t.component("ClientsForm",fi),t.component("SelectMultipleTags",to),t.component("SimpleLoader",mi)}function gi(t,n="add"){const a=eo();n==="add"?a.addDepartments(t):n==="delete"?a.removeDepartments(t):n==="update"?(a.departments=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibDeparts.`)}function yi(t,n="add"){const a=Yt();n==="add"?a.addAttendants(t):n==="delete"?a.removeAttendants(t):n==="update"?(a.attendants=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibAttendants.`)}function ki(t,n="add"){const a=va();n==="add"?a.addInstance(t):n==="delete"?a.removeInstance(t):n==="update"?(a.instances=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibInstances.`)}async function xi(t,n,a,o=[],r=[],i=[]){try{const s=await ar(t);n&&await s.setToken(n),a&&(ot.defaults.baseURL=a);const l=eo(t);r.length>0&&(l.departments=r,l.count=r.length);const d=Yt(t);o.length>0&&(d.attendants=o,d.count=o.length),await va(t).fetchInstances()}catch(s){console.error("Erro no setupLibrary:",s)}}function bi(t){return ia(t)}const Qk={install:Kk,setupLibrary:xi,attLibDeparts:gi,attLibAttendants:yi,attLibInstances:ki,primarySelect:po,simpleModal:go,simpleCard:yo,instanceSelect:or,SimpleSelect:ui,FloatingDev:pi,calendar:pr,SimpleLoader:mi,MFA:gr,chatWindow:Y1,departSelect:K1,attendantSelect:Q1,FilterSelectLib:J1,MobileInternalChat:X1,RandomAvatar:ai,MinModal:oi,libPatchNotes:si,btnNewUpdates:li,LibPhotoPicker:ci,SelectMultipleDepartments:di,SelectMultipleTags:to,PrimaryInput:no,getWithContrastColor:bi,RaitingInput:ao,TagView:hi,ClientsForm:fi};function Jk(t){t.CapacitorUtils.Synapse=new Proxy({},{get(n,a){return new Proxy({},{get(o,r){return(i,s,l)=>{const d=t.Capacitor.Plugins[a];if(d===void 0){l(new Error(`Capacitor plugin ${a} not found`));return}if(typeof d[r]!="function"){l(new Error(`Method ${r} not found in Capacitor plugin ${a}`));return}(async()=>{try{const u=await d[r](i);s(u)}catch(u){l(u)}})()}}})}})}function ex(t){t.CapacitorUtils.Synapse=new Proxy({},{get(n,a){return t.cordova.plugins[a]}})}function tx(t=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!t?Jk(window):window.cordova!==void 0&&ex(window))}var wi;(function(t){t.Documents="DOCUMENTS",t.Data="DATA",t.Library="LIBRARY",t.Cache="CACHE",t.External="EXTERNAL",t.ExternalStorage="EXTERNAL_STORAGE",t.ExternalCache="EXTERNAL_CACHE",t.LibraryNoCloud="LIBRARY_NO_CLOUD",t.Temporary="TEMPORARY"})(wi||(wi={}));var oo;(function(t){t.UTF8="utf8",t.ASCII="ascii",t.UTF16="utf16"})(oo||(oo={}));const sa=En("Filesystem",{web:()=>Promise.resolve().then(()=>wx).then(t=>new t.FilesystemWeb)});tx();const nx=En("BlobWriter");function ax(t){return window.btoa(Array.from(new Uint8Array(t)).map(function(n){return String.fromCharCode(n)}).join(""))}function ox({path:t,directory:n,blob:a,recursive:o}){return sa.writeFile({directory:n,path:t,recursive:o,data:""}).then(function(){return new Promise(function(r,i){function s(d){i(d.target.error)}const l=window.indexedDB.open("Disc");l.onerror=s,l.onsuccess=function(){const u=l.result.transaction("FileStorage","readwrite");u.onerror=s;const c=u.objectStore("FileStorage"),m=`/${n}/${t.replace(/^\//,"")}`,h=c.get(m);h.onsuccess=function(){h.result.size=a.size,h.result.content=a;const p=c.put(h.result);p.onsuccess=function(){r(void 0)}}}})})}function Ei({path:t,directory:n,blob:a,recursive:o}){return sa.writeFile({directory:n,path:t,recursive:o,data:""}).then(function r(){if(a.size===0)return Promise.resolve();const i=3*128*1024,s=a.slice(0,i);return a=a.slice(i),new Response(s).arrayBuffer().then(function(d){return sa.appendFile({directory:n,path:t,data:ax(d)})}).then(r)})}function rx(t){const{path:n,directory:a,blob:o,fast_mode:r=!1,recursive:i,on_fallback:s}=t;return!o||!Number.isSafeInteger(o.size)||typeof o.type!="string"?Promise.reject(new Error("Not a Blob.")):Jn.getPlatform()==="web"?r?ox(t):Ei(t):Promise.all([nx.get_config(),sa.getUri({path:n,directory:a})]).then(function([l,d]){const u=d.uri.replace("file://","");return(window.CapacitorWebFetch||window.fetch)(l.base_url+u+(i?"?recursive=true":""),{headers:{authorization:l.auth_token},method:"put",body:o}).then(function(m){if(m.status!==204)throw new Error("Bad HTTP status: "+m.status);return d.uri})}).catch(function(d){return s!==void 0&&s(d),Ei(t)})}const ix=Object.freeze(rx);function sx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vi={};function lx(t){return t&&t.__esModule?t:{default:t}}var cx=lx,ro={exports:{}},Ci;function dx(){return Ci||(Ci=1,function(t){var n=function(a){var o=Object.prototype,r=o.hasOwnProperty,i=Object.defineProperty||function(L,R,O){L[R]=O.value},s,l=typeof Symbol=="function"?Symbol:{},d=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function m(L,R,O){return Object.defineProperty(L,R,{value:O,enumerable:!0,configurable:!0,writable:!0}),L[R]}try{m({},"")}catch{m=function(R,O,oe){return R[O]=oe}}function h(L,R,O,oe){var de=R&&R.prototype instanceof E?R:E,pe=Object.create(de.prototype),ye=new Z(oe||[]);return i(pe,"_invoke",{value:H(L,O,ye)}),pe}a.wrap=h;function p(L,R,O){try{return{type:"normal",arg:L.call(R,O)}}catch(oe){return{type:"throw",arg:oe}}}var f="suspendedStart",g="suspendedYield",y="executing",k="completed",x={};function E(){}function B(){}function M(){}var T={};m(T,d,function(){return this});var _=Object.getPrototypeOf,C=_&&_(_(Q([])));C&&C!==o&&r.call(C,d)&&(T=C);var w=M.prototype=E.prototype=Object.create(T);B.prototype=M,i(w,"constructor",{value:M,configurable:!0}),i(M,"constructor",{value:B,configurable:!0}),B.displayName=m(M,c,"GeneratorFunction");function P(L){["next","throw","return"].forEach(function(R){m(L,R,function(O){return this._invoke(R,O)})})}a.isGeneratorFunction=function(L){var R=typeof L=="function"&&L.constructor;return R?R===B||(R.displayName||R.name)==="GeneratorFunction":!1},a.mark=function(L){return Object.setPrototypeOf?Object.setPrototypeOf(L,M):(L.__proto__=M,m(L,c,"GeneratorFunction")),L.prototype=Object.create(w),L},a.awrap=function(L){return{__await:L}};function F(L,R){function O(pe,ye,Ve,Le){var Ae=p(L[pe],L,ye);if(Ae.type==="throw")Le(Ae.arg);else{var qe=Ae.arg,_e=qe.value;return _e&&typeof _e=="object"&&r.call(_e,"__await")?R.resolve(_e.__await).then(function($e){O("next",$e,Ve,Le)},function($e){O("throw",$e,Ve,Le)}):R.resolve(_e).then(function($e){qe.value=$e,Ve(qe)},function($e){return O("throw",$e,Ve,Le)})}}var oe;function de(pe,ye){function Ve(){return new R(function(Le,Ae){O(pe,ye,Le,Ae)})}return oe=oe?oe.then(Ve,Ve):Ve()}i(this,"_invoke",{value:de})}P(F.prototype),m(F.prototype,u,function(){return this}),a.AsyncIterator=F,a.async=function(L,R,O,oe,de){de===void 0&&(de=Promise);var pe=new F(h(L,R,O,oe),de);return a.isGeneratorFunction(R)?pe:pe.next().then(function(ye){return ye.done?ye.value:pe.next()})};function H(L,R,O){var oe=f;return function(pe,ye){if(oe===y)throw new Error("Generator is already running");if(oe===k){if(pe==="throw")throw ye;return ee()}for(O.method=pe,O.arg=ye;;){var Ve=O.delegate;if(Ve){var Le=V(Ve,O);if(Le){if(Le===x)continue;return Le}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(oe===f)throw oe=k,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);oe=y;var Ae=p(L,R,O);if(Ae.type==="normal"){if(oe=O.done?k:g,Ae.arg===x)continue;return{value:Ae.arg,done:O.done}}else Ae.type==="throw"&&(oe=k,O.method="throw",O.arg=Ae.arg)}}}function V(L,R){var O=R.method,oe=L.iterator[O];if(oe===s)return R.delegate=null,O==="throw"&&L.iterator.return&&(R.method="return",R.arg=s,V(L,R),R.method==="throw")||O!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+O+"' method")),x;var de=p(oe,L.iterator,R.arg);if(de.type==="throw")return R.method="throw",R.arg=de.arg,R.delegate=null,x;var pe=de.arg;if(!pe)return R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,x;if(pe.done)R[L.resultName]=pe.value,R.next=L.nextLoc,R.method!=="return"&&(R.method="next",R.arg=s);else return pe;return R.delegate=null,x}P(w),m(w,c,"Generator"),m(w,d,function(){return this}),m(w,"toString",function(){return"[object Generator]"});function v(L){var R={tryLoc:L[0]};1 in L&&(R.catchLoc=L[1]),2 in L&&(R.finallyLoc=L[2],R.afterLoc=L[3]),this.tryEntries.push(R)}function $(L){var R=L.completion||{};R.type="normal",delete R.arg,L.completion=R}function Z(L){this.tryEntries=[{tryLoc:"root"}],L.forEach(v,this),this.reset(!0)}a.keys=function(L){var R=Object(L),O=[];for(var oe in R)O.push(oe);return O.reverse(),function de(){for(;O.length;){var pe=O.pop();if(pe in R)return de.value=pe,de.done=!1,de}return de.done=!0,de}};function Q(L){if(L){var R=L[d];if(R)return R.call(L);if(typeof L.next=="function")return L;if(!isNaN(L.length)){var O=-1,oe=function de(){for(;++O<L.length;)if(r.call(L,O))return de.value=L[O],de.done=!1,de;return de.value=s,de.done=!0,de};return oe.next=oe}}return{next:ee}}a.values=Q;function ee(){return{value:s,done:!0}}return Z.prototype={constructor:Z,reset:function(L){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach($),!L)for(var R in this)R.charAt(0)==="t"&&r.call(this,R)&&!isNaN(+R.slice(1))&&(this[R]=s)},stop:function(){this.done=!0;var L=this.tryEntries[0],R=L.completion;if(R.type==="throw")throw R.arg;return this.rval},dispatchException:function(L){if(this.done)throw L;var R=this;function O(Le,Ae){return pe.type="throw",pe.arg=L,R.next=Le,Ae&&(R.method="next",R.arg=s),!!Ae}for(var oe=this.tryEntries.length-1;oe>=0;--oe){var de=this.tryEntries[oe],pe=de.completion;if(de.tryLoc==="root")return O("end");if(de.tryLoc<=this.prev){var ye=r.call(de,"catchLoc"),Ve=r.call(de,"finallyLoc");if(ye&&Ve){if(this.prev<de.catchLoc)return O(de.catchLoc,!0);if(this.prev<de.finallyLoc)return O(de.finallyLoc)}else if(ye){if(this.prev<de.catchLoc)return O(de.catchLoc,!0)}else if(Ve){if(this.prev<de.finallyLoc)return O(de.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(L,R){for(var O=this.tryEntries.length-1;O>=0;--O){var oe=this.tryEntries[O];if(oe.tryLoc<=this.prev&&r.call(oe,"finallyLoc")&&this.prev<oe.finallyLoc){var de=oe;break}}de&&(L==="break"||L==="continue")&&de.tryLoc<=R&&R<=de.finallyLoc&&(de=null);var pe=de?de.completion:{};return pe.type=L,pe.arg=R,de?(this.method="next",this.next=de.finallyLoc,x):this.complete(pe)},complete:function(L,R){if(L.type==="throw")throw L.arg;return L.type==="break"||L.type==="continue"?this.next=L.arg:L.type==="return"?(this.rval=this.arg=L.arg,this.method="return",this.next="end"):L.type==="normal"&&R&&(this.next=R),x},finish:function(L){for(var R=this.tryEntries.length-1;R>=0;--R){var O=this.tryEntries[R];if(O.finallyLoc===L)return this.complete(O.completion,O.afterLoc),$(O),x}},catch:function(L){for(var R=this.tryEntries.length-1;R>=0;--R){var O=this.tryEntries[R];if(O.tryLoc===L){var oe=O.completion;if(oe.type==="throw"){var de=oe.arg;$(O)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(L,R,O){return this.delegate={iterator:Q(L),resultName:R,nextLoc:O},this.method==="next"&&(this.arg=s),x}},a}(t.exports);try{regeneratorRuntime=n}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}(ro)),ro.exports}var io,Si;function ux(){return Si||(Si=1,io=dx()),io}var so,Bi;function fx(){if(Bi)return so;Bi=1;function t(a,o,r,i,s,l,d){try{var u=a[l](d),c=u.value}catch(m){r(m);return}u.done?o(c):Promise.resolve(c).then(i,s)}function n(a){return function(){var o=this,r=arguments;return new Promise(function(i,s){var l=a.apply(o,r);function d(c){t(l,i,s,d,u,"next",c)}function u(c){t(l,i,s,d,u,"throw",c)}d(void 0)})}}return so=n,so}(function(t){var n=cx;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var a=n(ux()),o=n(fx());function r(s){return i.apply(this,arguments)}function i(){return(i=(0,o.default)(a.default.mark(function s(l){var d,u;return a.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return d=document.createElement("video"),u=new Promise(function(m,h){d.addEventListener("loadedmetadata",function(){d.duration===1/0?(d.currentTime=Number.MAX_SAFE_INTEGER,d.ontimeupdate=function(){d.ontimeupdate=null,m(d.duration),d.currentTime=0}):m(d.duration)}),d.onerror=function(p){return h(p.target.error)}}),d.src=typeof l=="string"||l instanceof String?l:window.URL.createObjectURL(l),c.abrupt("return",u);case 4:case"end":return c.stop()}},s)}))).apply(this,arguments)}})(vi);const mx=sx(vi),Tt=()=>({value:!0}),Cn=()=>({value:!1}),hx=()=>new Error("MISSING_PERMISSION"),px=()=>new Error("ALREADY_RECORDING"),gx=()=>new Error("DEVICE_CANNOT_VOICE_RECORD"),Vi=()=>new Error("FAILED_TO_RECORD"),yx=()=>new Error("EMPTY_RECORDING"),lo=()=>new Error("RECORDING_HAS_NOT_STARTED"),Mi=()=>new Error("FAILED_TO_FETCH_RECORDING"),co=()=>new Error("COULD_NOT_QUERY_PERMISSION_STATUS"),Ni={"audio/aac":".aac","audio/mp4":".mp3","audio/webm;codecs=opus":".ogg","audio/webm":".ogg","audio/ogg;codecs=opus":".ogg"},Ai=()=>new Promise(()=>{});class ht{constructor(){this.mediaRecorder=null,this.chunks=[],this.pendingResult=Ai()}static async canDeviceVoiceRecord(){var n;return((n=navigator==null?void 0:navigator.mediaDevices)===null||n===void 0?void 0:n.getUserMedia)==null||ht.getSupportedMimeType()==null?Cn():Tt()}async startRecording(n){if(this.mediaRecorder!=null)throw px();if(!(await ht.canDeviceVoiceRecord()).value)throw gx();if(!(await ht.hasAudioRecordingPermission().catch(()=>Tt())).value)throw hx();return navigator.mediaDevices.getUserMedia({audio:!0}).then(r=>this.onSuccessfullyStartedRecording(r,n)).catch(this.onFailedToStartRecording.bind(this))}async stopRecording(){if(this.mediaRecorder==null)throw lo();try{return this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(n=>n.stop()),this.pendingResult}catch{throw Mi()}finally{this.prepareInstanceForNextOperation()}}static async hasAudioRecordingPermission(){return navigator.permissions.query==null?navigator.mediaDevices==null?Promise.reject(co()):navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>Tt()).catch(()=>{throw co()}):navigator.permissions.query({name:"microphone"}).then(n=>({value:n.state==="granted"})).catch(()=>{throw co()})}static async requestAudioRecordingPermission(){return(await ht.hasAudioRecordingPermission().catch(()=>Cn())).value?Tt():navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>Tt()).catch(()=>Cn())}pauseRecording(){if(this.mediaRecorder==null)throw lo();return this.mediaRecorder.state==="recording"?(this.mediaRecorder.pause(),Promise.resolve(Tt())):Promise.resolve(Cn())}resumeRecording(){if(this.mediaRecorder==null)throw lo();return this.mediaRecorder.state==="paused"?(this.mediaRecorder.resume(),Promise.resolve(Tt())):Promise.resolve(Cn())}getCurrentStatus(){return this.mediaRecorder==null?Promise.resolve({status:ta.NONE}):this.mediaRecorder.state==="recording"?Promise.resolve({status:ta.RECORDING}):this.mediaRecorder.state==="paused"?Promise.resolve({status:ta.PAUSED}):Promise.resolve({status:ta.NONE})}static getSupportedMimeType(){if((MediaRecorder==null?void 0:MediaRecorder.isTypeSupported)==null)return null;const n=Object.keys(Ni).find(a=>MediaRecorder.isTypeSupported(a));return n??null}onSuccessfullyStartedRecording(n,a){return this.pendingResult=new Promise((o,r)=>{this.mediaRecorder=new MediaRecorder(n),this.mediaRecorder.onerror=()=>{this.prepareInstanceForNextOperation(),r(Vi())},this.mediaRecorder.onstop=async()=>{var i,s,l;const d=ht.getSupportedMimeType();if(d==null){this.prepareInstanceForNextOperation(),r(Mi());return}const u=new Blob(this.chunks,{type:d});if(u.size<=0){this.prepareInstanceForNextOperation(),r(yx());return}let c,m;a!=null?(c=`${(l=(s=(i=a.subDirectory)===null||i===void 0?void 0:i.match(/^\/?(.+[^/])\/?$/))===null||s===void 0?void 0:s[1])!==null&&l!==void 0?l:""}/recording-${new Date().getTime()}${Ni[d]}`,await ix({blob:u,directory:a.directory,fast_mode:!0,path:c,recursive:!0})):m=await ht.blobToBase64(u);const h=await mx(u);this.prepareInstanceForNextOperation(),o({value:{recordDataBase64:m,mimeType:d,msDuration:h*1e3,path:c}})},this.mediaRecorder.ondataavailable=i=>this.chunks.push(i.data),this.mediaRecorder.start()}),Tt()}onFailedToStartRecording(){throw this.prepareInstanceForNextOperation(),Vi()}static blobToBase64(n){return new Promise(a=>{const o=new FileReader;o.onloadend=()=>{const r=String(o.result),i=r.split("base64,"),s=i.length>1?i[1]:r;a(s.trim())},o.readAsDataURL(n)})}prepareInstanceForNextOperation(){if(this.mediaRecorder!=null&&this.mediaRecorder.state==="recording")try{this.mediaRecorder.stop()}catch(n){console.warn("While trying to stop a media recorder, an error was thrown",n)}this.pendingResult=Ai(),this.mediaRecorder=null,this.chunks=[]}}class kx extends ea{constructor(){super(...arguments),this.voiceRecorderInstance=new ht}canDeviceVoiceRecord(){return ht.canDeviceVoiceRecord()}hasAudioRecordingPermission(){return ht.hasAudioRecordingPermission()}requestAudioRecordingPermission(){return ht.requestAudioRecordingPermission()}startRecording(n){return this.voiceRecorderInstance.startRecording(n)}stopRecording(){return this.voiceRecorderInstance.stopRecording()}pauseRecording(){return this.voiceRecorderInstance.pauseRecording()}resumeRecording(){return this.voiceRecorderInstance.resumeRecording()}getCurrentStatus(){return this.voiceRecorderInstance.getCurrentStatus()}}const xx=Object.freeze(Object.defineProperty({__proto__:null,VoiceRecorderWeb:kx},Symbol.toStringTag,{value:"Module"}));function Ti(t){const n=t.split("/").filter(o=>o!=="."),a=[];return n.forEach(o=>{o===".."&&a.length>0&&a[a.length-1]!==".."?a.pop():a.push(o)}),a.join("/")}function bx(t,n){t=Ti(t),n=Ti(n);const a=t.split("/"),o=n.split("/");return t!==n&&a.every((r,i)=>r===o[i])}class la extends ea{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME="Disc",this._writeCmds=["add","put","delete"],this.downloadFile=async n=>{var a,o;const r=T1(n,n.webFetchExtra),i=await fetch(n.url,r);let s;if(!n.progress)s=await i.blob();else if(!(i!=null&&i.body))s=new Blob;else{const d=i.body.getReader();let u=0;const c=[],m=i.headers.get("content-type"),h=parseInt(i.headers.get("content-length")||"0",10);for(;;){const{done:g,value:y}=await d.read();if(g)break;c.push(y),u+=(y==null?void 0:y.length)||0;const k={url:n.url,bytes:u,contentLength:h};this.notifyListeners("progress",k)}const p=new Uint8Array(u);let f=0;for(const g of c)typeof g>"u"||(p.set(g,f),f+=g.length);s=new Blob([p.buffer],{type:m||void 0})}return{path:(await this.writeFile({path:n.path,directory:(a=n.directory)!==null&&a!==void 0?a:void 0,recursive:(o=n.recursive)!==null&&o!==void 0?o:!1,data:s})).uri,blob:s}}}readFileInChunks(n,a){throw this.unavailable("Method not implemented.")}async initDb(){if(this._db!==void 0)return this._db;if(!("indexedDB"in window))throw this.unavailable("This browser doesn't support IndexedDB");return new Promise((n,a)=>{const o=indexedDB.open(this.DB_NAME,this.DB_VERSION);o.onupgradeneeded=la.doUpgrade,o.onsuccess=()=>{this._db=o.result,n(o.result)},o.onerror=()=>a(o.error),o.onblocked=()=>{console.warn("db blocked")}})}static doUpgrade(n){const o=n.target.result;switch(n.oldVersion){case 0:case 1:default:o.objectStoreNames.contains("FileStorage")&&o.deleteObjectStore("FileStorage"),o.createObjectStore("FileStorage",{keyPath:"path"}).createIndex("by_folder","folder")}}async dbRequest(n,a){const o=this._writeCmds.indexOf(n)!==-1?"readwrite":"readonly";return this.initDb().then(r=>new Promise((i,s)=>{const u=r.transaction(["FileStorage"],o).objectStore("FileStorage")[n](...a);u.onsuccess=()=>i(u.result),u.onerror=()=>s(u.error)}))}async dbIndexRequest(n,a,o){const r=this._writeCmds.indexOf(a)!==-1?"readwrite":"readonly";return this.initDb().then(i=>new Promise((s,l)=>{const m=i.transaction(["FileStorage"],r).objectStore("FileStorage").index(n)[a](...o);m.onsuccess=()=>s(m.result),m.onerror=()=>l(m.error)}))}getPath(n,a){const o=a!==void 0?a.replace(/^[/]+|[/]+$/g,""):"";let r="";return n!==void 0&&(r+="/"+n),a!==""&&(r+="/"+o),r}async clear(){(await this.initDb()).transaction(["FileStorage"],"readwrite").objectStore("FileStorage").clear()}async readFile(n){const a=this.getPath(n.directory,n.path),o=await this.dbRequest("get",[a]);if(o===void 0)throw Error("File does not exist.");return{data:o.content?o.content:""}}async writeFile(n){const a=this.getPath(n.directory,n.path);let o=n.data;const r=n.encoding,i=n.recursive,s=await this.dbRequest("get",[a]);if(s&&s.type==="directory")throw Error("The supplied path is a directory.");const l=a.substr(0,a.lastIndexOf("/"));if(await this.dbRequest("get",[l])===void 0){const m=l.indexOf("/",1);if(m!==-1){const h=l.substr(m);await this.mkdir({path:h,directory:n.directory,recursive:i})}}if(!r&&!(o instanceof Blob)&&(o=o.indexOf(",")>=0?o.split(",")[1]:o,!this.isBase64String(o)))throw Error("The supplied data is not valid base64 content.");const u=Date.now(),c={path:a,folder:l,type:"file",size:o instanceof Blob?o.size:o.length,ctime:u,mtime:u,content:o};return await this.dbRequest("put",[c]),{uri:c.path}}async appendFile(n){const a=this.getPath(n.directory,n.path);let o=n.data;const r=n.encoding,i=a.substr(0,a.lastIndexOf("/")),s=Date.now();let l=s;const d=await this.dbRequest("get",[a]);if(d&&d.type==="directory")throw Error("The supplied path is a directory.");if(await this.dbRequest("get",[i])===void 0){const m=i.indexOf("/",1);if(m!==-1){const h=i.substr(m);await this.mkdir({path:h,directory:n.directory,recursive:!0})}}if(!r&&!this.isBase64String(o))throw Error("The supplied data is not valid base64 content.");if(d!==void 0){if(d.content instanceof Blob)throw Error("The occupied entry contains a Blob object which cannot be appended to.");d.content!==void 0&&!r?o=btoa(atob(d.content)+atob(o)):o=d.content+o,l=d.ctime}const c={path:a,folder:i,type:"file",size:o.length,ctime:l,mtime:s,content:o};await this.dbRequest("put",[c])}async deleteFile(n){const a=this.getPath(n.directory,n.path);if(await this.dbRequest("get",[a])===void 0)throw Error("File does not exist.");if((await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(a)])).length!==0)throw Error("Folder is not empty.");await this.dbRequest("delete",[a])}async mkdir(n){const a=this.getPath(n.directory,n.path),o=n.recursive,r=a.substr(0,a.lastIndexOf("/")),i=(a.match(/\//g)||[]).length,s=await this.dbRequest("get",[r]),l=await this.dbRequest("get",[a]);if(i===1)throw Error("Cannot create Root directory");if(l!==void 0)throw Error("Current directory does already exist.");if(!o&&i!==2&&s===void 0)throw Error("Parent directory must exist");if(o&&i!==2&&s===void 0){const c=r.substr(r.indexOf("/",1));await this.mkdir({path:c,directory:n.directory,recursive:o})}const d=Date.now(),u={path:a,folder:r,type:"directory",size:0,ctime:d,mtime:d};await this.dbRequest("put",[u])}async rmdir(n){const{path:a,directory:o,recursive:r}=n,i=this.getPath(o,a),s=await this.dbRequest("get",[i]);if(s===void 0)throw Error("Folder does not exist.");if(s.type!=="directory")throw Error("Requested path is not a directory");const l=await this.readdir({path:a,directory:o});if(l.files.length!==0&&!r)throw Error("Folder is not empty");for(const d of l.files){const u=`${a}/${d.name}`;(await this.stat({path:u,directory:o})).type==="file"?await this.deleteFile({path:u,directory:o}):await this.rmdir({path:u,directory:o,recursive:r})}await this.dbRequest("delete",[i])}async readdir(n){const a=this.getPath(n.directory,n.path),o=await this.dbRequest("get",[a]);if(n.path!==""&&o===void 0)throw Error("Folder does not exist.");const r=await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(a)]);return{files:await Promise.all(r.map(async s=>{let l=await this.dbRequest("get",[s]);return l===void 0&&(l=await this.dbRequest("get",[s+"/"])),{name:s.substring(a.length+1),type:l.type,size:l.size,ctime:l.ctime,mtime:l.mtime,uri:l.path}}))}}async getUri(n){const a=this.getPath(n.directory,n.path);let o=await this.dbRequest("get",[a]);return o===void 0&&(o=await this.dbRequest("get",[a+"/"])),{uri:(o==null?void 0:o.path)||a}}async stat(n){const a=this.getPath(n.directory,n.path);let o=await this.dbRequest("get",[a]);if(o===void 0&&(o=await this.dbRequest("get",[a+"/"])),o===void 0)throw Error("Entry does not exist.");return{name:o.path.substring(a.length+1),type:o.type,size:o.size,ctime:o.ctime,mtime:o.mtime,uri:o.path}}async rename(n){await this._copy(n,!0)}async copy(n){return this._copy(n,!1)}async requestPermissions(){return{publicStorage:"granted"}}async checkPermissions(){return{publicStorage:"granted"}}async _copy(n,a=!1){let{toDirectory:o}=n;const{to:r,from:i,directory:s}=n;if(!r||!i)throw Error("Both to and from must be provided");o||(o=s);const l=this.getPath(s,i),d=this.getPath(o,r);if(l===d)return{uri:d};if(bx(l,d))throw Error("To path cannot contain the from path");let u;try{u=await this.stat({path:r,directory:o})}catch{const f=r.split("/");f.pop();const g=f.join("/");if(f.length>0&&(await this.stat({path:g,directory:o})).type!=="directory")throw new Error("Parent directory of the to path is a file")}if(u&&u.type==="directory")throw new Error("Cannot overwrite a directory with a file");const c=await this.stat({path:i,directory:s}),m=async(p,f,g)=>{const y=this.getPath(o,p),k=await this.dbRequest("get",[y]);k.ctime=f,k.mtime=g,await this.dbRequest("put",[k])},h=c.ctime?c.ctime:Date.now();switch(c.type){case"file":{const p=await this.readFile({path:i,directory:s});a&&await this.deleteFile({path:i,directory:s});let f;!(p.data instanceof Blob)&&!this.isBase64String(p.data)&&(f=oo.UTF8);const g=await this.writeFile({path:r,directory:o,data:p.data,encoding:f});return a&&await m(r,h,c.mtime),g}case"directory":{if(u)throw Error("Cannot move a directory over an existing object");try{await this.mkdir({path:r,directory:o,recursive:!1}),a&&await m(r,h,c.mtime)}catch{}const p=(await this.readdir({path:i,directory:s})).files;for(const f of p)await this._copy({from:`${i}/${f.name}`,to:`${r}/${f.name}`,directory:s,toDirectory:o},a);a&&await this.rmdir({path:i,directory:s})}}return{uri:d}}isBase64String(n){try{return btoa(atob(n))==n}catch{return!1}}}la._debug=!0;const wx=Object.freeze(Object.defineProperty({__proto__:null,FilesystemWeb:la},Symbol.toStringTag,{value:"Module"}));at.attLibAttendants=yi,at.attLibDeparts=gi,at.attLibInstances=ki,at.default=Qk,at.getWithContrastColor=bi,at.setupLibrary=xi,Object.defineProperties(at,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});