sm-click-library-ui 0.0.606-dev.27 → 0.0.606-dev.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-Dsu2GaaY.js → index-D9aCT9N7.js} +204 -203
- package/dist/sm-click-library-ui.es.js +1 -1
- package/dist/sm-click-library-ui.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/{vue3-lottie.es--tlZSlIa.js → vue3-lottie.es-CKffBRu0.js} +1 -1
- package/dist/{web-ZLwUCnTP.js → web-DnVaPz5o.js} +2 -2
- package/dist/{web-CRrpHp80.js → web-Dwvhi5WS.js} +2 -2
- package/package.json +1 -1
|
@@ -275,12 +275,12 @@ if (n > 0 && t < 1) {
|
|
|
275
275
|
`,review_and_pay:`
|
|
276
276
|
<svg class="size-5 text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
|
277
277
|
<path fill-rule="evenodd" d="M4 4a1 1 0 0 1 1-1h1.5a1 1 0 0 1 .979.796L7.939 6H19a1 1 0 0 1 .979 1.204l-1.25 6a1 1 0 0 1-.979.796H9.605l.208 1H17a3 3 0 1 1-2.83 2h-2.34a3 3 0 1 1-4.009-1.76L5.686 5H5a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>
|
|
278
|
-
</svg>`};function ve(Se){return typeof Se!="string"?!1:/^https:\/\/[^\s/$.?#].[^\s]*$/i.test(Se.trim())}function me(){var Te,ze;const Se=(Te=ne.content)==null?void 0:Te.headers;if(!Se)return{kind:null,value:""};const Le=String((Se==null?void 0:Se.type)||"").toLowerCase(),Ve=(Se==null?void 0:Se.content)??(Se==null?void 0:Se.media)??"";if(["text","image","video","document"].includes(Le))return{kind:Le,value:Ve};if(typeof Ve=="string"&&ve(Ve))try{const Re=(ze=new URL(Ve).pathname.split(".").pop())==null?void 0:ze.toLowerCase();if(["jpeg","jpg","png","gif","webp"].includes(Re))return{kind:"image",value:Ve};if(["mp4","mov","webm"].includes(Re))return{kind:"video",value:Ve};if(Re==="pdf")return{kind:"document",value:Ve}}catch{}return{kind:"text",value:Ve}}const{kind:ge,value:fe}=me();function pe(){ae("action",{type:re,...ne.content})}return(Se,Le)=>{var Ve,Te;return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$L,[(Ve=ee.content)!=null&&Ve.headers?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$G,[["image","video","document"].includes(e$b.unref(ge))&&ve(e$b.unref(fe))?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_3$C,[e$b.unref(ge)==="image"?(e$b.openBlock(),e$b.createElementBlock("img",{key:0,src:e$b.unref(fe),class:"max-h-96 max-w-full rounded object-contain",alt:"header image"},null,8,_hoisted_4$A)):e$b.unref(ge)==="video"?(e$b.openBlock(),e$b.createElementBlock("video",{key:1,src:e$b.unref(fe),controls:"",class:"max-h-96 max-w-full rounded object-contain"},null,8,_hoisted_5$x)):e$b.unref(ge)==="document"?(e$b.openBlock(),e$b.createElementBlock("embed",{key:2,src:e$b.unref(fe),type:"application/pdf",class:"w-full h-96 rounded"},null,8,_hoisted_6$t)):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),(Te=ee.content.headers)!=null&&Te.text?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$r,[e$b.createVNode(MessageMarkdown,{content:ee.content.headers.text||ee.content.headers.text},null,8,["content"])])):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),ce.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$l,[e$b.createElementVNode("p",_hoisted_9$i,[e$b.createVNode(MessageMarkdown,{content:e$b.unref(ie)},null,8,["content"])])])),ce.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10$g,[e$b.createElementVNode("p",_hoisted_11$f,[e$b.createVNode(MessageMarkdown,{content:ee.content.footer},null,8,["content"])])])),ce.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_12$d,[Le[4]||(Le[4]=e$b.createElementVNode("div",{class:"px-3 pt-2 pb-1 flex items-center gap-2"},[e$b.createElementVNode("svg",{class:"size-3.5 shrink-0 text-base-content/40",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1H2V7ZM2 10h20v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7Zm3 3a1 1 0 0 0 0 2h3a1 1 0 0 0 0-2H5Z"})]),e$b.createElementVNode("p",{class:"text-[11px] font-medium text-base-content/50 uppercase tracking-wide leading-none"}," Solicitação de pagamento ")],-1)),e$b.createElementVNode("div",_hoisted_13$a,[ce.value.description?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_14$9,[Le[0]||(Le[0]=e$b.createElementVNode("svg",{class:"size-3.5 mt-0.5 shrink-0 text-base-content/40",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M5 4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4Zm5 4a1 1 0 0 0 0 2h4a1 1 0 0 0 0-2h-4Zm0 3a1 1 0 0 0 0 2h4a1 1 0 0 0 0-2h-4Zm0 3a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2h-2Z","clip-rule":"evenodd"})],-1)),e$b.createElementVNode("span",_hoisted_15$8,e$b.toDisplayString(ce.value.description),1)])):e$b.createCommentVNode("",!0),ce.value.reference_id?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$7,[Le[1]||(Le[1]=e$b.createElementVNode("span",{class:"text-[10px] uppercase tracking-wider font-semibold text-base-content/40"},"Ref.",-1)),e$b.createElementVNode("span",_hoisted_17$3,e$b.toDisplayString(ce.value.reference_id),1)])):e$b.createCommentVNode("",!0),Le[3]||(Le[3]=e$b.createElementVNode("div",{class:"border-t border-dashed border-base-content/10"},null,-1)),e$b.createElementVNode("div",_hoisted_18$3,[Le[2]||(Le[2]=e$b.createElementVNode("span",{class:"text-[12px] font-medium text-base-content/60 uppercase tracking-wide"},"Total a pagar",-1)),e$b.createElementVNode("span",_hoisted_19$3,e$b.toDisplayString(de(ce.value.total_amount,ce.value.currency)),1)])])])):e$b.createCommentVNode("",!0),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(le.value,(ze,Re)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ze.id||ze.type||ze.text,class:"-mx-2"},[ze.type!=="review_and_pay"?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,class:e$b.normalizeClass(["group flex border-b border-base-100 w-full items-center justify-center gap-1 bg-base-200 px-3 py-2 text-primary hover:bg-base-100 transition",Re===le.value.length-1?"rounded-b-md":""]),onClick:pe},[e$b.createElementVNode("span",{innerHTML:ue[ze.type]||ue.voice_call,class:"inline-flex"},null,8,_hoisted_20$3),e$b.createElementVNode("span",_hoisted_21$3,e$b.toDisplayString((ze==null?void 0:ze.text)||oe[ze==null?void 0:ze.type]||"sem texto"),1)],2)):e$b.createCommentVNode("",!0)]))),128))])}}},_sfc_main$P={},_hoisted_1$K={class:"media-hover-frame"};function _sfc_render$2(ee,te){return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$K,[...te[0]||(te[0]=[e$b.createStaticVNode('<svg class="media-corner media-corner-tl" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg><svg class="media-corner media-corner-tr" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg><svg class="media-corner media-corner-bl" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg><svg class="media-corner media-corner-br" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg>',4)])])}const MediaHoverFrame=_export_sfc$1(_sfc_main$P,[["render",_sfc_render$2],["__scopeId","data-v-8194d834"]]),_sfc_main$O={props:{content:{type:String,required:!0},isCircle:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},computed:{containerClass(){return this.isCircle?"h-[150px] min-w-[150px]":this.compact?"mx-auto aspect-video h-auto w-[300px] max-w-full":"h-[200px] w-full min-w-[200px]"},loadingClass(){return this.isCircle?"size-full rounded-full":"size-full rounded-xl"},videoClass(){return this.isCircle?"size-full rounded-full object-cover":"size-full rounded-xl object-scale-down"}},data(){return{isLoading:!0,shouldLoad:!1}},mounted(){this.observer=new IntersectionObserver(this.onIntersection,{root:null,rootMargin:"0px",threshold:.5}),this.observer.observe(this.$refs.videoContainer)},beforeUnmount(){var ee;(ee=this.observer)==null||ee.disconnect()},methods:{onIntersection(ee){ee.forEach(te=>{te.isIntersecting&&te.intersectionRatio>=.5&&(this.shouldLoad=!0,this.isLoading=!1,this.observer.unobserve(this.$refs.videoContainer))})}}},_hoisted_1$J=["src","type"];function _sfc_render$1(ee,te,ne,ae,re,oe){return e$b.openBlock(),e$b.createElementBlock("div",{ref:"videoContainer",class:e$b.normalizeClass(["video-container group relative shrink cursor-pointer",oe.containerClass])},[te[2]||(te[2]=e$b.createElementVNode("svg",{class:"absolute inset-0 z-50 m-auto size-[30%] text-gray-100 hover:opacity-70","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.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)),re.isLoading?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["flex justify-center bg-base-300 p-3",oe.loadingClass])},[...te[0]||(te[0]=[e$b.createElementVNode("div",{class:"loader m-auto size-12 rounded-full border-4 border-teal-600"},null,-1)])],2)):re.shouldLoad?(e$b.openBlock(),e$b.createElementBlock("video",{key:ne.content,ref:"videoRef",class:e$b.normalizeClass(["bg-base-300",oe.videoClass])},[e$b.createElementVNode("source",{src:ne.content,type:ne.content.type},null,8,_hoisted_1$J),te[1]||(te[1]=e$b.createTextVNode(" Seu navegador não suporta esse vídeo. ",-1))],2)):e$b.createCommentVNode("",!0)],2)}const VideoLazy=_export_sfc$1(_sfc_main$O,[["render",_sfc_render$1]]),_hoisted_1$I=["src"],_hoisted_2$F=["aria-label"],_hoisted_3$B={key:0,class:"ptv-icon",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},_hoisted_4$z=["viewBox"],_hoisted_5$w=["cx","cy","r"],_hoisted_6$s=["cx","cy","r","stroke-dashoffset"],_hoisted_7$q=["cx","cy","r","stroke-width","aria-valuemax","aria-valuenow"],_hoisted_8$k=["cx","cy"],_hoisted_9$h={class:"ptv-time"},RING_WIDTH=4,HOVER_GROWTH=10,PLAYING_GROWTH=44,_sfc_main$N={__name:"MessagePtv",props:{src:{type:String,required:!0},duration:{type:[Number,String],default:0},baseSize:{type:Number,default:200}},setup(ee){const te=ee,ne=e$b.ref(null),ae=e$b.ref(null),re=e$b.ref(!1),oe=e$b.ref(!1),ie=e$b.ref(!1),le=e$b.ref(0),ce=e$b.ref(Number(te.duration)||0),de=e$b.computed(()=>re.value||ie.value?te.baseSize+PLAYING_GROWTH:oe.value?te.baseSize+HOVER_GROWTH:te.baseSize),ue=e$b.computed(()=>de.value/2),ve=e$b.computed(()=>ue.value-RING_WIDTH/2),me=e$b.computed(()=>`${te.src}#t=0.001`),ge=e$b.computed(()=>ce.value?Math.min(le.value/ce.value,1):0),fe=e$b.computed(()=>re.value||ie.value||oe.value),pe=e$b.computed(()=>{const Be=ge.value*2*Math.PI;return{x:ue.value+ve.value*Math.cos(Be),y:ue.value+ve.value*Math.sin(Be)}}),_e=e$b.computed(()=>{const Be=re.value||ie.value?Math.max(ce.value-le.value,0):ce.value;return`${Math.floor(Be/60)}:${String(Math.floor(Be%60)).padStart(2,"0")}`});let be;function ke(){const Be=ae.value;Be&&(le.value=Be.currentTime,be=requestAnimationFrame(ke))}function $e(){re.value=!0,cancelAnimationFrame(be),be=requestAnimationFrame(ke)}function ye(){re.value=!1,cancelAnimationFrame(be)}function Ee(){ye(),Ve(0)}function Se(){var De;const Be=(De=ae.value)==null?void 0:De.duration;Number.isFinite(Be)&&Be>0&&(ce.value=Be)}function Le(){const Be=ae.value;Be&&(Be.paused?Be.play().catch(()=>ye()):Be.pause())}function Ve(Be){const De=ae.value;if(!De)return;const Ne=Math.min(Math.max(Be,0),ce.value||0);De.currentTime=Ne,le.value=Ne}function Te(Be){var Me;const De=(Me=ne.value)==null?void 0:Me.getBoundingClientRect();if(!De)return 0;const Ne=Math.atan2(Be.clientX-(De.left+De.width/2),De.top+De.height/2-Be.clientY);return(Ne<0?Ne+2*Math.PI:Ne)/(2*Math.PI)}function ze(Be){Ve(Te(Be)*ce.value)}function Re(){ie.value=!1,window.removeEventListener("pointermove",ze),window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re)}function Oe(Be){Be.stopPropagation(),Be.preventDefault(),ce.value&&(ie.value=!0,ze(Be),window.addEventListener("pointermove",ze),window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re))}function Pe(Be){const De={ArrowRight:1,ArrowUp:1,ArrowLeft:-1,ArrowDown:-1}[Be.key]??0;De&&(Be.preventDefault(),Ve(le.value+De))}return e$b.onBeforeUnmount(()=>{cancelAnimationFrame(be),Re()}),(Be,De)=>(e$b.openBlock(),e$b.createElementBlock("div",{ref_key:"rootEl",ref:ne,class:e$b.normalizeClass(["ptv",{"is-playing":re.value,"is-scrubbing":ie.value}]),style:e$b.normalizeStyle({width:`${de.value}px`,height:`${de.value}px`}),onPointerenter:De[0]||(De[0]=Ne=>oe.value=!0),onPointerleave:De[1]||(De[1]=Ne=>oe.value=!1)},[e$b.createElementVNode("video",{ref_key:"videoRef",ref:ae,class:"ptv-video",src:me.value,playsinline:"",preload:"metadata",onLoadedmetadata:Se,onPlay:$e,onPause:ye,onEnded:Ee},null,40,_hoisted_1$I),e$b.createElementVNode("button",{type:"button",class:"ptv-toggle","aria-label":re.value?"Pausar vídeo":"Tocar vídeo",onClick:e$b.withModifiers(Le,["stop"])},[re.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$B,[...De[2]||(De[2]=[e$b.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"},null,-1)])]))],8,_hoisted_2$F),(e$b.openBlock(),e$b.createElementBlock("svg",{class:"ptv-ring",viewBox:`0 0 ${de.value} ${de.value}`},[e$b.createElementVNode("circle",{class:"ptv-ring-track",cx:ue.value,cy:ue.value,r:ve.value,"stroke-width":RING_WIDTH},null,8,_hoisted_5$w),e$b.createElementVNode("circle",{class:"ptv-ring-progress",cx:ue.value,cy:ue.value,r:ve.value,"stroke-width":RING_WIDTH,pathLength:"1","stroke-dasharray":"1","stroke-dashoffset":1-ge.value},null,8,_hoisted_6$s),e$b.createElementVNode("circle",{class:"ptv-scrub",cx:ue.value,cy:ue.value,r:ve.value,"stroke-width":RING_WIDTH*4,role:"slider",tabindex:"0","aria-label":"Posição do vídeo","aria-valuemin":"0","aria-valuemax":Math.round(ce.value),"aria-valuenow":Math.round(le.value),onPointerdown:Oe,onKeydown:Pe},null,40,_hoisted_7$q),fe.value?(e$b.openBlock(),e$b.createElementBlock("circle",{key:0,class:"ptv-knob",cx:pe.value.x,cy:pe.value.y,r:RING_WIDTH},null,8,_hoisted_8$k)):e$b.createCommentVNode("",!0)],8,_hoisted_4$z)),e$b.createElementVNode("span",_hoisted_9$h,e$b.toDisplayString(_e.value),1)],38))}},MessagePtv=_export_sfc$1(_sfc_main$N,[["__scopeId","data-v-4481c02f"]]),_hoisted_1$H={class:"sidebar rounded shadow transition duration-150 ease-in-out"},_hoisted_2$E={class:"flex items-center gap-4 p-1"},_hoisted_3$A=["href","download","title"],_hoisted_4$y={class:"pr-3 max-w-28 md:max-w-32"},_hoisted_5$v={class:"line-clamp-2 truncate"},_hoisted_6$r=["href","download","title"],_hoisted_7$p={key:0,class:"mt-2"},_sfc_main$M={__name:"MessageFileCard",props:{file:{type:Object,default:()=>({})}},emits:["download"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.computed(()=>{var oe,ie,le,ce;return((oe=ne.file)==null?void 0:oe.title)||((ie=ne.file)==null?void 0:ie.name)||((le=ne.file)==null?void 0:le.filename)||((ce=ne.file)==null?void 0:ce.original_name)||"arquivo"});return(oe,ie)=>(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.createElementVNode("div",_hoisted_1$H,[e$b.createElementVNode("div",_hoisted_2$E,[e$b.createElementVNode("a",{href:ee.file.url,download:re.value,title:re.value,onClick:ie[0]||(ie[0]=e$b.withModifiers(le=>ae("download",ee.file,re.value),["prevent"]))},[...ie[2]||(ie[2]=[e$b.createElementVNode("svg",{class:"size-14 rounded p-1 text-primary header","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.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-7Zm3 2h2.01v2.01h-2V8h2v2.01h-2V12h2v2.01h-2V16h2v2.01h-2v2H12V18h2v-1.99h-2V14h2v-1.99h-2V10h2V8.01h-2V6h2V4Z","clip-rule":"evenodd"})],-1)])],8,_hoisted_3$A),e$b.createElementVNode("main",_hoisted_4$y,[e$b.createElementVNode("p",_hoisted_5$v,e$b.toDisplayString(re.value),1),e$b.createElementVNode("a",{target:"_blank",class:"cursor-pointer text-primary hover:underline",href:ee.file.url,download:re.value,title:re.value,onClick:ie[1]||(ie[1]=e$b.withModifiers(le=>ae("download",ee.file,re.value),["prevent"]))}," Baixar arquivo ",8,_hoisted_6$r)])])]),ee.file.caption?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$p,[e$b.createVNode(MessageMarkdown,{content:ee.file.caption},null,8,["content"])])):e$b.createCommentVNode("",!0)],64))}},_hoisted_1$G={key:1,class:"flex items-center justify-center text-xs opacity-60"},_hoisted_2$D={key:2,class:"loader-dots relative my-2 block h-5 w-14"},_sfc_main$L={__name:"MessageTgSticker",props:{content:{type:Object,default:()=>({})},variant:{type:String,default:"chat"}},setup(ee){const te=e$b.defineAsyncComponent(async()=>(await Promise.resolve().then(()=>vue3Lottie_es)).Vue3Lottie),ne=ee,ae=e$b.ref(null),re=e$b.ref(!1),oe=e$b.computed(()=>ne.variant==="thumbnail"?96:ne.variant==="composer"?180:220),ie=e$b.computed(()=>ne.variant==="chat"?"flex items-center justify-center p-1":"flex size-full items-center justify-center");return e$b.watch(()=>{var le;return(le=ne.content)==null?void 0:le.url},async le=>{if(ae.value=null,re.value=!1,!!le)try{const[{ungzip:ce},de]=await Promise.all([Promise.resolve().then(()=>pako),fetch(le)]),ue=ce(new Uint8Array(await de.arrayBuffer()));ae.value=JSON.parse(new TextDecoder("utf-8").decode(ue))}catch{re.value=!0}},{immediate:!0}),(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(ie.value)},[ae.value?(e$b.openBlock(),e$b.createBlock(e$b.unref(te),{key:0,speed:1,"animation-data":ae.value,height:oe.value,width:oe.value,loop:"",autoplay:""},null,8,["animation-data","height","width"])):re.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$G," Figurinha indisponível ")):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$D,[...ce[0]||(ce[0]=[e$b.createElementVNode("div",{class:"loader-dot"},null,-1),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.2s]"},null,-1),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.4s]"},null,-1)])]))],2))}},MessageTgSticker=_export_sfc$1(_sfc_main$L,[["__scopeId","data-v-b1c4fd4b"]]),GIF_TYPES$1=new Set(["gif","image/gif"]),STICKER_TYPES=new Set(["image/webp","webp"]),TG_STICKER_TYPES=new Set(["application/x-tgsticker","x-tgsticker"]),HEIF_TYPES=new Set(["heif","heic","image/heif","image/heic"]),AUDIO_TYPES=new Set(["audio","audio/mpeg","audio/ogg","audio/wav","audio/mp3","mpeg","mp3","ogg","wav","aac"]),VIDEO_TYPES=new Set(["video","video/mp4","mp4"]),IMAGE_TYPES=new Set(["image","image/jpeg","jpeg","image/png","png","jpg"]),MIME_BY_EXTENSION={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",heif:"image/heif",heic:"image/heic",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",mov:"video/quicktime",m4v:"video/x-m4v",avi:"video/x-msvideo",mkv:"video/x-matroska",mp3:"audio/mpeg",wav:"audio/wav",m4a:"audio/mp4",aac:"audio/aac",pdf:"application/pdf"};function normalizeMediaValue(ee){return typeof ee=="string"?ee.trim().toLowerCase():""}function inferMimeTypeFromName(ee,te=""){const ne=normalizeMediaValue(ee).split(".").pop()||"";return MIME_BY_EXTENSION[ne]||te}function resolveFileMimeType(ee="",te="",ne=""){return normalizeMediaValue(typeof te=="string"?te:te==null?void 0:te.type)||inferMimeTypeFromName(ee,ne)}function mediaItemName(ee){var te,ne,ae,re;return normalizeMediaValue(((te=ee==null?void 0:ee.content)==null?void 0:te.title)||((ne=ee==null?void 0:ee.content)==null?void 0:ne.name)||((ae=ee==null?void 0:ee.content)==null?void 0:ae.filename)||((re=ee==null?void 0:ee.content)==null?void 0:re.original_name)||(ee==null?void 0:ee.title)||(ee==null?void 0:ee.name)||(ee==null?void 0:ee.fileName)||(ee==null?void 0:ee.filename)||(ee==null?void 0:ee.original_name)||"")}function resolveMediaType(ee){var ne,ae;const te=normalizeMediaValue(((ne=ee==null?void 0:ee.content)==null?void 0:ne.type)||(ee==null?void 0:ee.type)||((ae=ee==null?void 0:ee.mimeType)==null?void 0:ae.type)||(ee==null?void 0:ee.mimeType)||"");return te||inferMimeTypeFromName(mediaItemName(ee))}function isHeif(ee){const te=resolveMediaType(ee);return HEIF_TYPES.has(te)||/\.(heif|heic)$/i.test(mediaItemName(ee))}function shouldRenderHeifAsVideo(ee,te="web"){return isHeif(ee)&&normalizeMediaValue(te)!=="ios"}function isSticker(ee){return STICKER_TYPES.has(resolveMediaType(ee))}function isTgSticker(ee){return TG_STICKER_TYPES.has(resolveMediaType(ee))||/\.tgs(ticker)?$/i.test(mediaItemName(ee))}function isVideo(ee){const te=resolveMediaType(ee);return VIDEO_TYPES.has(te)||/^video\//i.test(te)}function isPtv(ee){var te;return isVideo(ee)&&!!(((te=ee==null?void 0:ee.content)==null?void 0:te.isptv)??(ee==null?void 0:ee.isptv))}function isGif(ee){var ne;const te=resolveMediaType(ee);return isVideo(ee)&&((ne=ee==null?void 0:ee.content)==null?void 0:ne.is_gif)||GIF_TYPES$1.has(te)}function isImage(ee){const te=resolveMediaType(ee);return!te||isSticker(ee)||isGif(ee)?!1:isHeif(ee)||IMAGE_TYPES.has(te)||te.startsWith("image/")}function isAudio(ee){const te=resolveMediaType(ee);return AUDIO_TYPES.has(te)||/^audio\//i.test(te)}const GIF_TYPES=["gif","image/gif"];function getMimeType(ee){var te;return normalizeMediaValue(typeof(ee==null?void 0:ee.type)=="string"?ee.type:(te=ee==null?void 0:ee.content)==null?void 0:te.type)}function isGifLike(ee){return GIF_TYPES.includes(getMimeType(ee))}function useVideoPreview(ee,te="web"){return isHeif(ee)?shouldRenderHeifAsVideo(ee,te):isGifLike(ee)}function useImagePreview(ee,te="web"){return isHeif(ee)?!shouldRenderHeifAsVideo(ee,te):!isGifLike(ee)}function previewMediaSrc(ee,te="web"){var ne,ae,re,oe;return useVideoPreview(ee,te)?(ee==null?void 0:ee.blobUrl)||((ne=ee==null?void 0:ee.content)==null?void 0:ne.data64)||(ee==null?void 0:ee.data64)||((ae=ee==null?void 0:ee.content)==null?void 0:ae.url)||(ee==null?void 0:ee.url):((re=ee==null?void 0:ee.content)==null?void 0:re.data64)||(ee==null?void 0:ee.data64)||((oe=ee==null?void 0:ee.content)==null?void 0:oe.url)||(ee==null?void 0:ee.url)}const _hoisted_1$F={key:0},_hoisted_2$C=["alt"],_hoisted_3$z=["src","alt"],_hoisted_4$x=["src"],_hoisted_5$u=["src"],_hoisted_6$q=["src"],_hoisted_7$o=["aria-label"],_hoisted_8$j=["src"],_hoisted_9$g=["aria-label"],_hoisted_10$f=["src"],_hoisted_11$e={class:"pdf-mobile-header"},_hoisted_12$c={class:"min-w-0"},_hoisted_13$9={class:"truncate text-sm font-medium"},_hoisted_14$8={key:1,class:"renderer-loading"},CHAT_IMAGE_MAX_HEIGHT=300,_sfc_main$K={__name:"MessageFileRenderer",props:{message:{type:Object,required:!0},variant:{type:String,default:"chat"},showCaption:{type:Boolean,default:!0},interactive:{type:Boolean,default:!0}},emits:["expand","open-native-pdf","download","error"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useMessageUiStore(),oe=e$b.computed(()=>re.deviceType),ie=e$b.computed(()=>{var _t;return((_t=ne.message)==null?void 0:_t.content)||{}}),le=e$b.computed(()=>{var _t;return String(((_t=ie.value)==null?void 0:_t.type)||"").toLowerCase()}),ce=e$b.computed(()=>previewMediaSrc(ie.value,oe.value)),de=e$b.computed(()=>oe.value!=="ios"&&!isImageSourcePreloaded(ce.value)),ue=e$b.computed(()=>{var _t,Ze;return((_t=ie.value)==null?void 0:_t.data64)||((Ze=ie.value)==null?void 0:Ze.url)||""}),ve=e$b.computed(()=>{var _t,Ze;return((_t=ie.value)==null?void 0:_t.text)||((Ze=ie.value)==null?void 0:Ze.caption)||""}),me=e$b.computed(()=>{var _t,Ze,at,dt;return((_t=ie.value)==null?void 0:_t.title)||((Ze=ie.value)==null?void 0:Ze.name)||((at=ie.value)==null?void 0:at.filename)||((dt=ie.value)==null?void 0:dt.original_name)||"arquivo"}),ge=e$b.computed(()=>Object.keys(ie.value||{}).length>0),fe=e$b.computed(()=>re.isWebDevice),pe=e$b.computed(()=>ne.variant==="composer"),_e=e$b.computed(()=>ne.variant==="thumbnail"),be=e$b.computed(()=>ne.interactive&&!_e.value),ke=e$b.computed(()=>isHeif(ie.value)&&useVideoPreview(ie.value,oe.value)),$e=e$b.computed(()=>be.value&&!isSticker(ne.message)&&!ke.value),ye=e$b.computed(()=>["application/pdf","pdf"].includes(le.value)),Ee=e$b.computed(()=>["gif","image/gif"].includes(le.value)),Se=e$b.computed(()=>{if(ye.value)return"pdf";if(isAudio(ne.message))return"audio";if(isTgSticker(ne.message))return"sticker";if(isSticker(ne.message))return"image";if(isImage(ne.message))return useVideoPreview(ie.value,oe.value)?"video":"image";if(isPtv(ne.message)&&ne.variant==="chat")return"ptv";if(isVideo(ne.message))return"video";if(isGif(ne.message)){if(Ee.value||useImagePreview(ie.value,oe.value))return"image";if(useVideoPreview(ie.value,oe.value))return"video"}return"file"}),Le=e$b.computed(()=>ne.showCaption&&!!ve.value&&!pe.value&&!_e.value),Ve=e$b.computed(()=>Se.value==="video"?"Abrir vídeo":"Ampliar"),Te=e$b.computed(()=>`${Ve.value}: ${me.value}`),ze=e$b.computed(()=>_e.value?"renderer renderer-thumbnail":pe.value?"renderer renderer-composer":"renderer renderer-chat"),Re=e$b.computed(()=>_e.value?"media-surface media-surface-thumbnail":pe.value?"media-surface media-surface-composer":"media-surface media-surface-chat"),Oe=e$b.computed(()=>_e.value?"icon-surface icon-surface-thumbnail":"icon-surface"),Pe=e$b.computed(()=>isSticker(ne.message)&&!_e.value?"media-image-sticker":_e.value?"media-image media-image-thumbnail":pe.value?"media-image media-image-composer":"media-image media-image-chat"),Be=e$b.computed(()=>_e.value?"media-video-heif-thumbnail":pe.value?"media-video-heif-composer":"media-video-heif-chat"),De=e$b.computed(()=>$e.value&&ne.variant==="chat"&&(Se.value==="image"||Se.value==="video")),Ne=e$b.computed(()=>Se.value==="video"?"renderer-caption pt-2":"renderer-caption"),Me=e$b.computed(()=>pe.value?"pdf-shell pdf-shell-composer":"pdf-shell"),we=e$b.computed(()=>pe.value?"file-shell file-shell-composer":"file-shell"),Ce={w:260,h:195},Fe=e$b.ref(null),Ie=e$b.ref(isImageSourcePreloaded(ce.value));e$b.watch(ce,_t=>{Fe.value=null,Ie.value=isImageSourcePreloaded(_t)});const Ue=e$b.computed(()=>ne.variant==="chat"&&Se.value==="image"&&!isSticker(ne.message)),qe=e$b.computed(()=>Fe.value||mediaSizeFromContent(ie.value,ce.value)),je=e$b.computed(()=>{if(!Ue.value)return null;const _t=qe.value||Ce,Ze=Math.min(_t.h,CHAT_IMAGE_MAX_HEIGHT);return{width:`${Math.round(Ze*_t.w/_t.h)}px`,maxWidth:"100%",aspectRatio:`${_t.w} / ${_t.h}`}}),We=e$b.computed(()=>Ue.value?"media-image-reserved":""),Ge=e$b.computed(()=>Ie.value?"media-image-revealed":"media-image-revealing"),Ke=e$b.computed(()=>Ue.value&&!Ie.value);function et(_t){const Ze=_t.target,{naturalWidth:at,naturalHeight:dt}=Ze;!at||!dt||sameMediaSource(Ze.currentSrc||Ze.src,ce.value)&&(Fe.value={w:at,h:dt},rememberMediaSize(ce.value,at,dt))}function yt(){Ie.value=!0}async function Et(_t){et(_t);const Ze=_t.target,at=Ze.currentSrc||Ze.src;if(!(de.value&&!sameMediaSource(at,ce.value))){if(typeof Ze.decode=="function"){try{await Ze.decode()}catch{}if(!sameMediaSource(Ze.currentSrc||Ze.src,at))return}yt()}}function At(_t){$e.value&&ae("expand",ne.message,_t)}function Pt(_t){const Ze=(_t==null?void 0:_t.data64)||(_t==null?void 0:_t.url);if(!Ze||String(Ze).startsWith("undefined")){ae("error","PDF inválido.");return}if(!fe.value){ae("open-native-pdf",Ze);return}N$3.show([{src:Ze,type:"iframe",caption:_t.caption||_t.title||"Documento PDF"}],{Carousel:{Toolbar:{display:{left:["counter"],middle:[],right:["toggleFull","close"]}}},Html:{videoTpl:'<iframe src="{{src}}" width="90%" height="85vh" style="border-radius: 12px; border: none;"></iframe>'},dragToClose:!1})}return(_t,Ze)=>{var dt,ct,ht,tt;const at=e$b.resolveDirective("lazy");return ge.value?(e$b.openBlock(),e$b.createElementBlock("section",{key:0,class:e$b.normalizeClass(ze.value)},[(dt=ie.value)!=null&&dt.story_reply?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$F,[...Ze[5]||(Ze[5]=[e$b.createElementVNode("p",{class:"italic opacity-70"},"Resposta de stories",-1)])])):e$b.createCommentVNode("",!0),Se.value==="image"?(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent($e.value?"button":"div"),{key:1,type:$e.value?"button":void 0,class:e$b.normalizeClass([Re.value,$e.value?"group":"",Ke.value?"media-surface-pending":""]),style:e$b.normalizeStyle(je.value),"aria-label":$e.value?Te.value:void 0,onClick:Ze[0]||(Ze[0]=Ye=>$e.value&&At(!1))},{default:e$b.withCtx(()=>[de.value?e$b.withDirectives((e$b.openBlock(),e$b.createElementBlock("img",{key:0,alt:me.value,class:e$b.normalizeClass([Pe.value,We.value,Ge.value]),decoding:"async",onLoad:Et,onError:yt},null,42,_hoisted_2$C)),[[at,ce.value]]):(e$b.openBlock(),e$b.createElementBlock("img",{key:1,src:ce.value,alt:me.value,class:e$b.normalizeClass([Pe.value,We.value,Ge.value]),decoding:"async",onLoad:Et,onError:yt},null,42,_hoisted_3$z)),De.value?(e$b.openBlock(),e$b.createBlock(MediaHoverFrame,{key:2})):e$b.createCommentVNode("",!0)]),_:1},8,["type","class","style","aria-label"])):Se.value==="ptv"?(e$b.openBlock(),e$b.createBlock(MessagePtv,{key:2,src:ce.value,duration:(ct=ie.value)==null?void 0:ct.duration},null,8,["src","duration"])):Se.value==="video"?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:3},[ke.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(Re.value)},[e$b.createElementVNode("video",{class:e$b.normalizeClass(["media-video media-video-heif",Be.value]),src:ce.value,autoplay:"",muted:"",loop:"",playsinline:""},null,10,_hoisted_4$x)],2)):_e.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(Re.value)},[e$b.createElementVNode("video",{class:e$b.normalizeClass(["media-video media-video-thumbnail",{"media-video-ptv":(ht=ie.value)==null?void 0:ht.isptv}]),src:ce.value,autoplay:"",muted:"",loop:"",playsinline:""},null,10,_hoisted_5$u)],2)):pe.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:2,class:e$b.normalizeClass(Re.value)},[e$b.createElementVNode("video",{class:"media-video",src:ce.value,controls:"",autoplay:"",muted:"",loop:"",playsinline:""},null,8,_hoisted_6$q)],2)):$e.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:3,type:"button",class:"video-trigger group","aria-label":Te.value,onClick:Ze[1]||(Ze[1]=Ye=>At(!0))},[e$b.createVNode(VideoLazy,{content:ce.value,"is-circle":(tt=ie.value)==null?void 0:tt.isptv,compact:ee.variant==="chat"},null,8,["content","is-circle","compact"]),De.value?(e$b.openBlock(),e$b.createBlock(MediaHoverFrame,{key:0})):e$b.createCommentVNode("",!0)],8,_hoisted_7$o)):(e$b.openBlock(),e$b.createElementBlock("div",{key:4,class:e$b.normalizeClass(Re.value)},[e$b.createElementVNode("video",{class:"media-video media-video-thumbnail",src:ce.value,autoplay:"",muted:"",loop:"",playsinline:""},null,8,_hoisted_8$j)],2))],64)):Se.value==="pdf"?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:4},[_e.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(Oe.value)},[...Ze[6]||(Ze[6]=[e$b.createElementVNode("svg",{class:"size-14 text-red-500",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.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)])],2)):fe.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(Me.value)},[e$b.createElementVNode("button",{type:"button",class:e$b.normalizeClass(Re.value),"aria-label":`Abrir PDF ${me.value}`,onClick:Ze[2]||(Ze[2]=Ye=>Pt(ie.value))},[ue.value&&!ue.value.startsWith("undefined")?(e$b.openBlock(),e$b.createElementBlock("iframe",{key:0,src:`${ue.value}#toolbar=0&navpanes=0`,class:"pdf-frame",loading:"lazy"},null,8,_hoisted_10$f)):e$b.createCommentVNode("",!0),Ze[7]||(Ze[7]=e$b.createElementVNode("div",{class:"absolute inset-0 flex items-end justify-start bg-gradient-to-t from-black/50 to-transparent p-2 transition-opacity"},[e$b.createElementVNode("span",{class:"flex items-center gap-1.5 rounded-md bg-gray-500/80 border border-gray-600 backdrop-blur-sm px-2.5 py-1 text-xs font-medium text-white shadow"},[e$b.createElementVNode("svg",{class:"size-3.5 shrink-0",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.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"})]),e$b.createTextVNode(" Abrir PDF ")])],-1))],10,_hoisted_9$g)],2)):(e$b.openBlock(),e$b.createElementBlock("button",{key:2,type:"button",class:"pdf-mobile-card",onClick:Ze[3]||(Ze[3]=Ye=>ae("open-native-pdf",ue.value))},[e$b.createElementVNode("div",_hoisted_11$e,[Ze[9]||(Ze[9]=e$b.createElementVNode("svg",{class:"size-5 shrink-0",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.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$b.createElementVNode("div",_hoisted_12$c,[e$b.createElementVNode("p",_hoisted_13$9,e$b.toDisplayString(me.value),1),Ze[8]||(Ze[8]=e$b.createElementVNode("p",{class:"text-xs opacity-75"},"Toque para abrir o documento",-1))])])]))],64)):Se.value==="sticker"?(e$b.openBlock(),e$b.createElementBlock("div",{key:5,class:e$b.normalizeClass(Oe.value)},[e$b.createVNode(MessageTgSticker,{content:ie.value,variant:ee.variant},null,8,["content","variant"])],2)):Se.value==="audio"?(e$b.openBlock(),e$b.createElementBlock("div",{key:6,class:e$b.normalizeClass(Oe.value)},[...Ze[10]||(Ze[10]=[e$b.createElementVNode("svg",{class:"size-14 text-primary",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 7V2.221a2 2 0 0 0-.5.365L4.586 6.5a2 2 0 0 0-.365.5H9Zm2 0V2h7a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9h5a2 2 0 0 0 2-2Zm2.318.052h-.002A1 1 0 0 0 12 8v5.293A4.033 4.033 0 0 0 10.5 13C8.787 13 7 14.146 7 16s1.787 3 3.5 3 3.5-1.146 3.5-3c0-.107-.006-.211-.017-.313A1.04 1.04 0 0 0 14 15.5V9.766c.538.493 1 1.204 1 2.234a1 1 0 1 0 2 0c0-1.881-.956-3.14-1.86-3.893a6.4 6.4 0 0 0-1.636-.985 4.009 4.009 0 0 0-.165-.063l-.014-.005-.005-.001-.002-.001ZM9 16c0-.356.452-1 1.5-1s1.5.644 1.5 1-.452 1-1.5 1S9 16.356 9 16Z","clip-rule":"evenodd"})],-1)])],2)):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:7},[_e.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(Oe.value)},[...Ze[11]||(Ze[11]=[e$b.createElementVNode("svg",{class:"size-14 text-primary",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.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)])],2)):(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(we.value)},[e$b.createVNode(_sfc_main$M,{file:ie.value,onDownload:Ze[4]||(Ze[4]=(Ye,Je)=>ae("download",Ye,Je))},null,8,["file"])],2))],64)),Le.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:8,class:e$b.normalizeClass(Ne.value)},[e$b.createVNode(MessageMarkdown,{content:ve.value},null,8,["content"])],2)):e$b.createCommentVNode("",!0)],2)):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_14$8,[...Ze[12]||(Ze[12]=[e$b.createElementVNode("div",{class:"loader-dots relative my-2 block h-5 w-20"},[e$b.createElementVNode("div",{class:"loader-dot"}),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.2s]"}),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.4s]"})],-1)])]))}}},MessageFileRenderer=_export_sfc$1(_sfc_main$K,[["__scopeId","data-v-bd8e7bea"]]),_hoisted_1$E={class:"sm-quote-content"},_hoisted_2$B={key:1,class:"sm-quote-description"},_hoisted_3$y={key:0,class:"sm-quote-author message-self-name"},_hoisted_4$w={key:2,class:"sm-quote-line"},_hoisted_5$t={class:"sm-quote-icon","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_6$p=["d"],_hoisted_7$n={key:3,class:"sm-quote-line sm-quote-line--kind"},_hoisted_8$i=["fill","stroke","stroke-width"],_hoisted_9$f=["d"],_hoisted_10$e={key:2},_hoisted_11$d={key:4,class:"sm-quote-template"},_hoisted_12$b={key:0,class:"font-semibold"},_hoisted_13$8=["src"],_hoisted_14$7={key:2,class:"opacity-70"},_hoisted_15$7={key:5,class:"mt-3 flex justify-between px-3"},_hoisted_16$6={key:0,class:"sm-quote-media"},_sfc_main$J={__name:"MessageQuote",props:{message:{type:Object,required:!0},isMessage:{type:Boolean,default:!1},messageId:{type:String,required:!1,default:null},attendant:{type:[Object,null],required:!1,default:null},chatId:{type:String,required:!1,default:null}},emits:["go"],setup(ee,{emit:te}){const ne=te,ae=ee,re=/^https:\/\/[^\s/$.?#].[^\s]*$/i,oe={audio:{label:"",icon:null},image:{label:"Foto",icon:"image"},sticker:{label:"Figurinha",icon:"sticker"},video:{label:"Vídeo",icon:"video"},gif:{label:"GIF",icon:"video"},pdf:{label:"PDF",icon:"pdf"},file:{label:"Arquivo",icon:"file"}},ie=["M5 8c.6 0 1 .4 1 1v3a4 4 0 0 0 4 4h4a4 4 0 0 0 4-4V9a1 1 0 1 1 2 0v3a6 6 0 0 1-6 6h-1v2h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2v-2h-1a6 6 0 0 1-6-6V9c0-.6.4-1 1-1Z","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"],le={image:"M7.5 4.6A2 2 0 0 1 8.9 4h6.2c.5 0 1 .2 1.4.6L17.9 6H19a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8c0-1.1.9-2 2-2h1l1.5-1.4ZM10 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm2-4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z",sticker:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25z",video:"M19 3a2 2 0 0 1 2 2v2h-2V5.4L17.4 7h-2.8l2-2h-2.2l-2 2H9.6l2-2H9.4l-2 2H3V5c0-1.1.9-2 2-2h14ZM3 9v10c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V9H3Zm2-2.4L6.6 5H5v1.6ZM9.6 11a1 1 0 0 1 1 .1l4 3a1 1 0 0 1 0 1.6l-4 3A1 1 0 0 1 9 18v-6c0-.4.2-.7.6-.9Z",pdf:"M9 2.2V7H4.2l.4-.5 3.9-4 .5-.3Zm2-.2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7c0 1.1.9 2 2 2 0 1.1.9 2 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 1v5c0 .6.4 1 1 1h1.4a2.6 2.6 0 0 0 2.6-2.6v-1.8a2.6 2.6 0 0 0-2.6-2.6H11Zm1 5v-3h.4a.6.6 0 0 1 .6.6v1.8a.6.6 0 0 1-.6.6H12Zm5-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",file:"M9 2.2V7H4.2l.4-.5 3.9-4 .5-.3Zm2-.2v5a2 2 0 0 1-2 2H4v11c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-7Z"},ce=useMessageUiStore(),de=e$b.computed(()=>ce.deviceType),ue=e$b.computed(()=>{var Ve;return((Ve=ce.loggedAttendant)==null?void 0:Ve.name)??""}),ve=e$b.computed(()=>{var Ve;return((Ve=ae.message)==null?void 0:Ve.type)??""}),me=e$b.computed(()=>ve.value==="pdf"),ge=e$b.computed(()=>ve.value==="voice_call"),fe=e$b.computed(()=>{const Ve=ae.message;return isAudio(Ve)?"audio":isImage(Ve)?"image":isSticker(Ve)||isTgSticker(Ve)?"sticker":isVideo(Ve)?"video":isGif(Ve)?"gif":me.value?"pdf":"file"}),pe=e$b.computed(()=>fe.value==="audio"?null:le[oe[fe.value].icon]),_e=e$b.computed(()=>oe[fe.value].label),be=e$b.computed(()=>!!ve.value&&!ge.value),ke=e$b.computed(()=>["image","sticker","video","gif","pdf"].includes(fe.value)&&!!ve.value),$e=e$b.computed(()=>{var Ve;return{type:((Ve=ae.message)==null?void 0:Ve.type)||"document",content:ae.message||{}}}),ye=e$b.computed(()=>{var Re,Oe,Pe,Be,De;const Ve=ae.message||{},Te=ae.isMessage?((Re=ae.attendant)==null?void 0:Re.name)||((Oe=Ve==null?void 0:Ve.sender)==null?void 0:Oe.name):((Pe=Ve==null?void 0:Ve.sent_by)==null?void 0:Pe.name)||((Be=Ve==null?void 0:Ve.sender)==null?void 0:Be.name);return Te?(ae.isMessage||!!((De=Ve==null?void 0:Ve.sent_by)!=null&&De.name))&&Te===ue.value?"Você":Te:""}),Ee=e$b.computed(()=>{var Re;const Ve=Number((Re=ae.message)==null?void 0:Re.duration);if(!Number.isFinite(Ve)||Ve<0)return"00:00";const Te=Math.floor(Ve/60),ze=Math.floor(Ve%60);return`${String(Te).padStart(2,"0")}:${String(ze).padStart(2,"0")}`});function Se(Ve){return typeof Ve!="string"?!1:re.test(Ve.trim())}function Le(){ae.isMessage&&ne("go",ae.messageId,ae.chatId)}return(Ve,Te)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["sm-quote",[ee.isMessage?"sm-quote--reply":"sm-quote--composer header",!ee.isMessage&&de.value!=="web"?"mb-2 rounded-xl":"",!ee.isMessage&&de.value==="web"?"rounded-t-xl":""]])},[(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.isMessage?"button":"div"),{type:ee.isMessage?"button":void 0,class:"sm-quote-card",onClick:Le},{default:e$b.withCtx(()=>[e$b.createElementVNode("div",_hoisted_1$E,[ye.value?(e$b.openBlock(),e$b.createElementBlock("p",{key:0,class:"sm-quote-author message-sender-name",style:e$b.normalizeStyle(e$b.unref(senderColorStyle)(ye.value))},e$b.toDisplayString(ye.value),5)):e$b.createCommentVNode("",!0),ee.message.description?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$B,[ee.isMessage?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$y,"Você")):e$b.createCommentVNode("",!0),e$b.createVNode(MessageMarkdown,{content:ee.message.description},null,8,["content"])])):e$b.createCommentVNode("",!0),fe.value==="audio"?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_4$w,[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_5$t,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie,ze=>e$b.createElementVNode("path",{key:ze,d:ze},null,8,_hoisted_6$p)),64))])),e$b.createTextVNode(" "+e$b.toDisplayString(Ee.value),1)])):e$b.createCommentVNode("",!0),be.value?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$n,[pe.value?(e$b.openBlock(),e$b.createElementBlock("svg",{key:0,class:"sm-quote-icon","aria-hidden":"true",viewBox:"0 0 24 24",fill:fe.value==="sticker"?"none":"currentColor",stroke:fe.value==="sticker"?"currentColor":void 0,"stroke-width":fe.value==="sticker"?1.5:void 0,"stroke-linecap":"round","stroke-linejoin":"round"},[e$b.createElementVNode("path",{d:pe.value,"fill-rule":"evenodd","clip-rule":"evenodd"},null,8,_hoisted_9$f)],8,_hoisted_8$i)):e$b.createCommentVNode("",!0),ee.message.text?(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.text},null,8,["content"])):_e.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_10$e,e$b.toDisplayString(_e.value),1)):e$b.createCommentVNode("",!0)])):ee.message.template?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_11$d,[ee.message.template.header?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_12$b,[Se(ee.message.template.header)?(e$b.openBlock(),e$b.createElementBlock("img",{key:0,src:ee.message.template.header,class:"max-w-full h-auto rounded"},null,8,_hoisted_13$8)):(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.template.header},null,8,["content"]))])):e$b.createCommentVNode("",!0),ee.message.template.body?(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.template.body},null,8,["content"])):e$b.createCommentVNode("",!0),ee.message.template.footer?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_14$7,[e$b.createVNode(MessageMarkdown,{content:ee.message.template.footer},null,8,["content"])])):e$b.createCommentVNode("",!0)])):ge.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_15$7,[e$b.createVNode(_sfc_main$Q,{content:ee.message},null,8,["content"])])):(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:6,content:ee.message.text},null,8,["content"]))]),ke.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$6,[e$b.createVNode(MessageFileRenderer,{message:$e.value,variant:"thumbnail",interactive:!1,"show-caption":!1},null,8,["message"])])):e$b.createCommentVNode("",!0)]),_:1},8,["type"])),ee.isMessage?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("button",{key:0,class:"sm-quote-close",title:"Fechar",type:"button",onClick:Te[0]||(Te[0]=ze=>e$b.unref(ce).clearQuote())},[...Te[1]||(Te[1]=[e$b.createElementVNode("svg",{class:"size-5","aria-hidden":"true",viewBox:"0 0 24 24",fill:"none"},[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 18 6m0 12L6 6"})],-1)])]))],2))}},MessageQuote=_export_sfc$1(_sfc_main$J,[["__scopeId","data-v-5435c680"]]);function viewSingleImage(ee,te=""){ee&&N$3.show([{src:ee,type:"image",caption:te}])}const _hoisted_1$D={class:"mx-auto"},_hoisted_2$A={key:0,class:"mb-1 flex items-center opacity-95"},_hoisted_3$x={class:"mb-2 overflow-hidden max-h-[400px] rounded-md bg-base-300 dark:shadow-gray-500 relative"},_hoisted_4$v=["href"],_hoisted_5$s={key:0,class:"text-start"},_hoisted_6$o={key:1,class:"text-white font-normal hover:font-medium transition-all ease-in-out select-none"},_hoisted_7$m=["src"],_sfc_main$I={__name:"MessageAd",props:{message:{type:Object,required:!0},from_me:{type:Boolean,required:!0}},setup(ee){function te(ne){try{return ne.split("/")[2]}catch{return ne}}return(ne,ae)=>{var re,oe,ie,le,ce;return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$D,[(re=ee.message.ad_info)!=null&&re.sourceUrl?(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_2$A,[...ae[1]||(ae[1]=[e$b.createElementVNode("svg",{class:"mr-2 size-5 rotate-90","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.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$b.createElementVNode("p",{class:"italic"},"Enviada via anúncio",-1)])])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_3$x,[(oe=ee.message.ad_info)!=null&&oe.sourceUrl?(e$b.openBlock(),e$b.createElementBlock("a",{key:0,target:"_blank",rel:"noopener noreferrer",href:ee.message.ad_info.sourceUrl,class:e$b.normalizeClass([ee.from_me?"header":"bg-gray-900/80 dark:bg-primary/10","flex flex-col p-4 px-2 absolute bottom-0 w-full"])},[(ie=ee.message.ad_info)!=null&&ie.title?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_5$s,e$b.toDisplayString(ee.message.ad_info.title),1)):e$b.createCommentVNode("",!0),(le=ee.message.ad_info)!=null&&le.sourceUrl?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_6$o,e$b.toDisplayString(te(ee.message.ad_info.sourceUrl)),1)):e$b.createCommentVNode("",!0)],10,_hoisted_4$v)):e$b.createCommentVNode("",!0),(ce=ee.message.ad_info)!=null&&ce.thumbnailUrl?(e$b.openBlock(),e$b.createElementBlock("img",{key:1,class:"mx-auto cursor-pointer object-scale-down",src:ee.message.ad_info.thumbnailUrl,onClick:ae[0]||(ae[0]=de=>e$b.unref(viewSingleImage)(ee.message.ad_info.thumbnailUrl))},null,8,_hoisted_7$m)):e$b.createCommentVNode("",!0)]),e$b.createVNode(MessageMarkdown,{content:ee.message.text},null,8,["content"])])}}},_hoisted_1$C={class:"mx-auto mb-2"},_hoisted_2$z=["href"],_hoisted_3$w={class:"group relative overflow-hidden rounded-lg"},_hoisted_4$u=["src"],_hoisted_5$r={class:"italic text-white text-sm block"},_hoisted_6$n={class:"w-full mt-2 whitespace-pre-wrap break-words"},_sfc_main$H={__name:"MessageComment",props:{message:{type:Object,required:!0},from_me:{type:Boolean,required:!0}},setup(ee){const te=e$b.ref(!1),ne=()=>{te.value=!te.value};return(ae,re)=>{var oe,ie,le,ce,de;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.createElementVNode("div",_hoisted_1$C,[e$b.createElementVNode("a",{href:(oe=ee.message.post_info)==null?void 0:oe.permalink,target:"_blank",rel:"noopener noreferrer",class:"italic"}," Comentário de postagem ",8,_hoisted_2$z)]),e$b.createElementVNode("div",null,[e$b.createElementVNode("div",_hoisted_3$w,[e$b.createElementVNode("img",{class:"mx-auto cursor-pointer object-scale-down max-h-[600px] max-w-full",src:(ie=ee.message.post_info)==null?void 0:ie.thumbnail_url,onClick:re[0]||(re[0]=ue=>{var ve;return e$b.unref(viewSingleImage)((ve=ee.message.post_info)==null?void 0:ve.thumbnail_url)})},null,8,_hoisted_4$u),(le=ee.message.post_info)!=null&&le.caption?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:"absolute bottom-0 left-0 right-0 bg-black/60 p-2 cursor-pointer transition-all",onClick:e$b.withModifiers(ne,["stop"])},[e$b.createElementVNode("span",_hoisted_5$r,e$b.toDisplayString(te.value||ee.message.post_info.caption.length<=80?ee.message.post_info.caption:ee.message.post_info.caption.slice(0,80)+"..."),1)])):e$b.createCommentVNode("",!0),((de=(ce=ee.message.post_info)==null?void 0:ce.caption)==null?void 0:de.length)>80?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:"absolute bottom-1 right-1 flex items-center justify-center text-white bg-black/60 rounded-full w-6 h-6 cursor-pointer shadow-md hover:shadow-lg hover:bg-black border border-white/40 transition-all duration-200 z-10",onClick:e$b.withModifiers(ne,["stop"])},[(e$b.openBlock(),e$b.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2.5",stroke:"currentColor",class:e$b.normalizeClass(["size-4 transition-transform duration-300 drop-shadow-sm",te.value?"rotate-180":""])},[...re[1]||(re[1]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"},null,-1)])],2))])):e$b.createCommentVNode("",!0)]),e$b.createElementVNode("div",_hoisted_6$n,e$b.toDisplayString(ee.message.text),1)])],64)}}};let element=null,detach=null,peaks=null,peaksDuration=0;function forgetPeaks(){peaks=null,peaksDuration=0}function hardStop(ee){if(ee)try{ee.pause();const te=ee.currentSrc||ee.src||"";ee.removeAttribute("src"),ee.load(),te.startsWith("blob:")&&URL.revokeObjectURL(te)}catch{}}const useAudioPlaybackStore=pinia.defineStore("smClickAudioPlayback",{state:()=>({trackId:null,meta:null,isPlaying:!1,currentTime:0,duration:0,rate:1,mountedIds:[]}),getters:{hasTrack:ee=>!!ee.trackId,isFloating:ee=>!!ee.trackId&&!ee.mountedIds.includes(ee.trackId),progress:ee=>ee.duration>0?ee.currentTime/ee.duration:0},actions:{isActive(ee){return!!ee&&this.trackId===ee},activeElement(){return element},activeSrc(){return(element==null?void 0:element.currentSrc)||(element==null?void 0:element.src)||""},setPeaks(ee,te,ne){!this.isActive(ee)||!te||(peaks=te,peaksDuration=ne||this.duration||0)},activePeaks(){return!peaks||!peaksDuration?null:{peaks,duration:peaksDuration}},acquire(ee){return ee&&!this.mountedIds.includes(ee)&&this.mountedIds.push(ee),ee&&this.trackId===ee&&element?element:new Audio},claim(ee,te,ne=null){!ee||!te||(element&&element!==te&&(this.unbind(),this.mountedIds.includes(this.trackId)?element.pause():hardStop(element)),element=te,forgetPeaks(),this.trackId=ee,this.meta=ne||null,this.duration=Number.isFinite(te.duration)?te.duration:0,this.currentTime=te.currentTime||0,this.rate=te.playbackRate||1,this.bind(te))},setMeta(ee,te){this.isActive(ee)&&(this.meta=te||null)},release(ee,te){if(this.mountedIds=this.mountedIds.filter(ne=>ne!==ee),te&&te!==element){hardStop(te);return}element&&(element.paused||element.ended)&&this.clear()},bind(ee){this.unbind();const te=()=>{this.currentTime=ee.currentTime||0},ne=()=>{this.duration=Number.isFinite(ee.duration)?ee.duration:0},ae=()=>{this.isPlaying=!0},re=()=>{this.isPlaying=!1},oe=()=>{this.isPlaying=!1,this.currentTime=0,this.mountedIds.includes(this.trackId)||this.clear()},ie=()=>{this.rate=ee.playbackRate||1};ee.addEventListener("timeupdate",te),ee.addEventListener("loadedmetadata",ne),ee.addEventListener("durationchange",ne),ee.addEventListener("play",ae),ee.addEventListener("pause",re),ee.addEventListener("ended",oe),ee.addEventListener("ratechange",ie),detach=()=>{ee.removeEventListener("timeupdate",te),ee.removeEventListener("loadedmetadata",ne),ee.removeEventListener("durationchange",ne),ee.removeEventListener("play",ae),ee.removeEventListener("pause",re),ee.removeEventListener("ended",oe),ee.removeEventListener("ratechange",ie)},this.isPlaying=!ee.paused&&!ee.ended},unbind(){detach&&detach(),detach=null},toggle(){element&&(element.paused||element.ended?element.play().catch(()=>{}):element.pause())},play(){var ee;(ee=element==null?void 0:element.play)==null||ee.call(element).catch(()=>{})},pause(){var ee;(ee=element==null?void 0:element.pause)==null||ee.call(element)},seek(ee){if(!element)return;const te=Number.isFinite(element.duration)?element.duration:0;element.currentTime=Math.max(0,Math.min(ee,te||ee)),this.currentTime=element.currentTime},setRate(ee){element&&(element.playbackRate=ee,this.rate=ee)},clear(){this.unbind(),hardStop(element),element=null,forgetPeaks(),this.trackId=null,this.meta=null,this.isPlaying=!1,this.currentTime=0,this.duration=0,this.rate=1}}});function detachSharedMedia(ee,te,ne){var ae,re;if(!(!ee||!te||ee.media!==te)&&ne.activeElement()===te){try{(ae=ee.unAll)==null||ae.call(ee)}catch{}try{(re=ee.subscriptions)==null||re.forEach(oe=>oe==null?void 0:oe())}catch{}try{ee.media=new Audio}catch{}}}function attachSharedMedia(ee,te,{rate:ne=1}={}){var ae,re,oe,ie,le;if(!ee||!te)return null;try{ee.media=te,(ae=ee.initPlayerEvents)==null||ae.call(ee),(re=ee.setPlaybackRate)==null||re.call(ee,ne),te.paused||(ie=(oe=ee.timer)==null?void 0:oe.start)==null||ie.call(oe)}catch(ce){return console.error("Falha ao religar áudio em reprodução:",ce),null}return{duration:((le=ee.getDuration)==null?void 0:le.call(ee))||0,currentTime:te.currentTime||0,isPlaying:!te.paused&&!te.ended}}function resolveColor(ee,te){if(!ee||!te||!ee.includes("color-mix("))return ee;const ne=document.createElement("span");ne.style.cssText="position:absolute;inline-size:0;block-size:0;visibility:hidden",ne.style.color=ee,te.appendChild(ne);const ae=getComputedStyle(ne).color;return ne.remove(),ae||ee}function readWaveColors(ee){const te={wave:"rgba(148, 163, 184, 0.5)",progress:"#0ea5e9",cursor:"#ffffff"};if(!ee)return te;const ne=getComputedStyle(ee),ae=(re,oe)=>resolveColor(ne.getPropertyValue(re).trim(),ee)||oe;return{wave:ae("--audio-wave",te.wave),progress:ae("--audio-progress",te.progress),cursor:ae("--audio-cursor",te.cursor)}}const _hoisted_1$B=["aria-pressed","aria-label","onKeydown"],_hoisted_2$y={key:1,class:"size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},_hoisted_3$v={class:"relative flex h-10 min-w-0 flex-1 items-center"},_hoisted_4$t=["aria-label"],BAR_WIDTH=3,BAR_GAP=3,_sfc_main$G={__name:"MessageAudio",props:{audio:{type:String,required:!0},isOwner:{type:Boolean,default:!1},trackId:{type:[String,Number],default:null},trackMeta:{type:Object,default:null},height:{type:Number,default:40},barWidth:{type:Number,default:3},barRadius:{type:Number,default:3},barHeight:{type:Number,default:.85},barGap:{type:Number,default:2},fullWidth:{type:Boolean,default:!1},minWidth:{type:String,default:"200px"},prefWidth:{type:String,default:"37vw"},maxWidth:{type:String,default:"300px"},onlyOneAtATime:{type:Boolean,default:!0}},emits:["duration","currentTime"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.computed(()=>ne.fullWidth?{inlineSize:"100%",minInlineSize:"0"}:{inlineSize:`clamp(${ne.minWidth}, ${ne.prefWidth}, ${ne.maxWidth})`,minInlineSize:"0"}),oe=e$b.ref(null),ie=e$b.ref(null);let le=null,ce=null,de=null;const ue=useAudioPlaybackStore(),ve=e$b.computed(()=>ne.trackId!=null&&ne.trackId!==""),me=e$b.ref(!1),ge=e$b.ref(!0),fe=e$b.ref(0),pe=e$b.ref(0),_e=e$b.ref(1),be=/^data:(audio\/[^,;]+(?:;[^,;=]+=[^,;]+)*);base64,/,ke=je=>typeof je=="string"&&be.test(je),$e=je=>typeof je=="string"&&je.length>=16&&/^[A-Za-z0-9+/=\s]+$/.test(je)&&je.length%4===0;function ye(je,We="audio/mp3"){var yt;const Ge=(yt=je.match(be))==null?void 0:yt[1],Ke=je.includes(",")?je.slice(je.indexOf(",")+1):je,et=Uint8Array.from(atob(Ke),Et=>Et.charCodeAt(0));return new Blob([et],{type:Ge||We})}function Ee(){var je,We;detachSharedMedia(le,ce,ue);try{(je=le==null?void 0:le.unAll)==null||je.call(le)}catch{}try{(We=le==null?void 0:le.destroy)==null||We.call(le)}catch{}le=null}async function Se(){if(!ie.value)return;Ee();const je=ve.value&&ue.isActive(ne.trackId)&&!!ue.activeElement();ve.value?ce=ue.acquire(ne.trackId):ce||(ce=new Audio);const We=readWaveColors(oe.value);le=w$5.create({container:ie.value,media:je?new Audio:ce,waveColor:We.wave,progressColor:We.progress,cursorColor:We.cursor,cursorWidth:12,height:ne.height,barWidth:ne.barWidth,barRadius:ne.barRadius,barHeight:ne.barHeight,barGap:ne.barGap,hideScrollbar:!0}),le.on("ready",()=>{fe.value=le.getDuration(),ae("duration",fe.value),ge.value=!1,le.setPlaybackRate(_e.value),Ve()}),le.on("error",Ge=>{ge.value=!1,console.error("Falha ao carregar áudio:",Ge)}),le.on("play",()=>{if(me.value=!0,ne.onlyOneAtATime&&!ve.value){const Ge=window.__activeWSInstance;if(Ge&&Ge!==le)try{Ge.pause()}catch{}window.__activeWSInstance=le}}),le.on("pause",()=>{me.value=!1,window.__activeWSInstance===le&&(window.__activeWSInstance=null)}),le.on("finish",()=>{me.value=!1,window.__activeWSInstance===le&&(window.__activeWSInstance=null)}),le.on("audioprocess",()=>{pe.value=le.getCurrentTime(),ae("currentTime",pe.value)}),le.on("seek",()=>{pe.value=le.getCurrentTime(),ae("currentTime",pe.value)}),ie.value.addEventListener("pointerdown",De),je&&(_e.value=ue.rate||1),await Te(ne.audio),je&&Le()}function Le(){const je=attachSharedMedia(le,ce,{rate:_e.value});je&&(fe.value=je.duration||ue.duration,pe.value=je.currentTime,me.value=je.isPlaying)}function Ve(){if(!(!ve.value||!ue.isActive(ne.trackId)))try{ue.setPeaks(ne.trackId,le.exportPeaks(),le.getDuration())}catch{}}async function Te(je){if(le){ge.value=!0;try{ke(je)||$e(je)?await le.loadBlob(ye(je)):await le.load(je)}catch{try{await le.load(je)}catch(We){console.error("Falha ao carregar áudio:",We),ge.value=!1}}}}function ze(){le&&(ve.value&&!ue.isActive(ne.trackId)&&(ue.claim(ne.trackId,ce,ne.trackMeta),ue.setRate(_e.value),Ve()),le.playPause())}function Re(){var je;_e.value=_e.value>=2?1:+(_e.value+.5).toFixed(1),(je=le==null?void 0:le.setPlaybackRate)==null||je.call(le,_e.value),ve.value&&ue.isActive(ne.trackId)&&ue.setRate(_e.value)}let Oe=!1;function Pe(je){var et,yt;const We=(yt=(et=ie.value)==null?void 0:et.getBoundingClientRect)==null?void 0:yt.call(et);if(!We)return null;const Ke=(("touches"in je?je.touches[0].clientX:je.clientX)-We.left)/We.width;return Math.max(0,Math.min(1,Ke))}function Be(je){var Ge;const We=Pe(je);We!=null&&((Ge=le==null?void 0:le.seekTo)==null||Ge.call(le,We))}function De(je){Oe=!0,Be(je),window.addEventListener("pointermove",Ne,{passive:!0}),window.addEventListener("pointerup",Me,{passive:!0})}function Ne(je){Oe&&Be(je)}function Me(){Oe=!1,window.removeEventListener("pointermove",Ne),window.removeEventListener("pointerup",Me)}let we=null;function Ce(){var We;if(!le||!oe.value)return;const je=readWaveColors(oe.value);(We=le.setOptions)==null||We.call(le,{waveColor:je.wave,progressColor:je.progress,cursorColor:je.cursor})}const Fe=e$b.ref(null),Ie=e$b.ref(20);let Ue=null;const qe=je=>({animationDelay:`-${(1.2-je%8*.1).toFixed(2)}s`});return e$b.onMounted(async()=>{await e$b.nextTick(),await Se();const je=()=>{if(!Fe.value)return;const Ge=Fe.value.clientWidth;Ie.value=Math.floor(Ge/(BAR_WIDTH+BAR_GAP))};e$b.watch(ge,Ge=>{Ge?e$b.nextTick(()=>{Fe.value&&!Ue&&(je(),Ue=new ResizeObserver(je),Ue.observe(Fe.value))}):Ue&&(Ue.disconnect(),Ue=null)},{immediate:!0});const We=async()=>{var Ke,et;if(!le)return;const Ge=((Ke=le.getCurrentTime)==null?void 0:Ke.call(le))??0;await Se();try{(et=le.seekTo)==null||et.call(le,Ge/(fe.value||1))}catch{}};window.addEventListener("resize",We),de=We,we=new MutationObserver(Ce),we.observe(document.documentElement,{attributeFilter:["class","style"]})}),e$b.onBeforeUnmount(()=>{var je;Ue&&Ue.disconnect(),we&&we.disconnect();try{window.removeEventListener("resize",de)}catch{}try{(je=ie.value)==null||je.removeEventListener("pointerdown",De)}catch{}if(Ee(),ve.value)ue.release(ne.trackId,ce);else if(ce)try{ce.pause(),ce.removeAttribute("src"),ce.load()}catch{}ce=null}),e$b.watch(()=>ne.audio,je=>{je&&Te(je)}),e$b.watch(_e,je=>{var We;return(We=le==null?void 0:le.setPlaybackRate)==null?void 0:We.call(le,je)}),e$b.watch(()=>ve.value?ue.isPlaying:null,je=>{je===null||!ue.isActive(ne.trackId)||(me.value=je)}),e$b.watch(()=>ne.trackMeta,je=>{ve.value&&ue.setMeta(ne.trackId,je)}),(je,We)=>(e$b.openBlock(),e$b.createElementBlock("div",{ref_key:"rootEl",ref:oe,class:e$b.normalizeClass(["audio-row flex min-w-0 max-w-full select-none items-center gap-2.5",ee.isOwner?"ms-auto":"me-auto"]),style:e$b.normalizeStyle(re.value)},[e$b.createElementVNode("button",{type:"button",class:"audio-play grid size-10 shrink-0 place-items-center rounded-full transition focus:outline-none focus-visible:ring-2 focus-visible:ring-current","aria-pressed":me.value?"true":"false","aria-label":me.value?"Pausar":"Tocar",onClick:ze,onKeydown:e$b.withKeys(e$b.withModifiers(ze,["prevent"]),["space"])},[me.value?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$y,[...We[1]||(We[1]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H8Zm7 0a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-1Z","clip-rule":"evenodd"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",{key:0,class:e$b.normalizeClass(["size-5 translate-x-px",{"animate-pulse":ge.value}]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...We[0]||(We[0]=[e$b.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"},null,-1)])],2))],40,_hoisted_1$B),e$b.createElementVNode("div",_hoisted_3$v,[ge.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"loaderContainerEl",ref:Fe,class:"loading-equalizer"},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(Ie.value,Ge=>(e$b.openBlock(),e$b.createElementBlock("span",{key:Ge,style:e$b.normalizeStyle(qe(Ge))},null,4))),128))],512)):e$b.createCommentVNode("",!0),e$b.withDirectives(e$b.createElementVNode("div",{ref_key:"waveEl",ref:ie,class:"ws-surface block size-full min-w-0 cursor-pointer"},null,512),[[e$b.vShow,!ge.value]])]),e$b.withDirectives(e$b.createElementVNode("button",{type:"button",class:"audio-rate shrink-0 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-5 transition","aria-label":`Velocidade ${_e.value.toFixed(1)}x. Clique para mudar`,onClick:Re},e$b.toDisplayString(_e.value.toFixed(1))+"x ",9,_hoisted_4$t),[[e$b.vShow,me.value]])],6))}},MessageAudio=_export_sfc$1(_sfc_main$G,[["__scopeId","data-v-7694c78f"]]),_hoisted_1$A={class:"relative"},_hoisted_2$x={key:0,class:"relative"},_hoisted_3$u={key:1,class:"relative h-[200px] w-full lg:w-[300px] rounded-lg bg-base-200 border border-base-300 overflow-hidden"},MAX_FILE_SIZE=7*1024*1024,_sfc_main$F={__name:"MessageFileLoading",props:{message:{type:Object,required:!0}},setup(ee){const te=ee,ne=e$b.computed(()=>{var oe;const ae=(oe=te.message)==null?void 0:oe.content;return ae!=null&&ae.data64?Math.ceil(ae.data64.length/1.33)<=MAX_FILE_SIZE:!1});return(ae,re)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$A,[ne.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$x,[e$b.createVNode(MessageFileRenderer,{message:ee.message},null,8,["message"]),re[0]||(re[0]=e$b.createStaticVNode('<div class="pointer-events-none absolute inset-0 flex flex-col items-center justify-center rounded-md bg-black/30"><div class="loader-dots relative mx-auto block h-5 w-20"><div class="absolute left-0 top-0 mt-1 size-3 animate-loader rounded-full bg-white"></div><div class="absolute left-0 top-0 mt-1 size-3 animate-loader rounded-full bg-white [animation-delay:.2s]"></div><div class="absolute left-0 top-0 mt-1 size-3 animate-loader rounded-full bg-white [animation-delay:.4s]"></div></div><p class="mt-2 text-sm font-medium text-white">Enviando...</p></div>',1))])):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_3$u,[...re[1]||(re[1]=[e$b.createStaticVNode('<div class="absolute inset-0 opacity-30 dark:opacity-20"><div class="absolute top-0 left-0 w-32 h-32 bg-primary rounded-full blur-3xl animate-pulse"></div><div class="absolute bottom-0 right-0 w-40 h-40 bg-primary rounded-full blur-3xl animate-pulse [animation-delay:.5s]"></div></div><div class="relative h-full flex flex-col items-center justify-center gap-4 p-6"><div class="rounded-full bg-base-100 p-4 ring-2 ring-primary backdrop-blur-sm"><svg class="size-10 text-primary animate-bounce" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16.88 9.1A4 4 0 0 1 16 17H5a5 5 0 0 1-1-9.9V7a3 3 0 0 1 4.52-2.59A4.98 4.98 0 0 1 17 8c0 .38-.04.74-.12 1.1zM11 11h3l-4-4-4 4h3v3h2v-3z"></path></svg></div><div class="flex flex-col items-center gap-3"><p class="text-sm font-semibold">Enviando arquivo</p><div class="flex items-center gap-1.5"><div class="size-2 rounded-full bg-primary animate-bounce"></div><div class="size-2 rounded-full bg-primary animate-bounce [animation-delay:.1s]"></div><div class="size-2 rounded-full bg-primary animate-bounce [animation-delay:.2s]"></div></div></div></div>',2)])]))]))}},_hoisted_1$z=["data-group-items"],_hoisted_2$w={class:"flex size-5 cursor-pointer items-center justify-center rounded border-2 transition-colors border-gray-400 dark:bg-gray-500/60 dark:border-gray-600 hover:border-primary"},_hoisted_3$t={key:0,class:"size-3.5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_hoisted_4$s=["id","onClick"],_hoisted_5$q=["onClick"],_hoisted_6$m={key:0,class:"size-3.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_hoisted_7$l={key:1,class:"absolute inset-0 flex items-center justify-center bg-black/60 text-xl font-semibold text-white"},_hoisted_8$h={class:"pointer-events-none absolute inset-0 bg-black/30 opacity-0 transition-opacity group-hover:opacity-100"},_hoisted_9$e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute left-2 top-2 size-6",style:{transform:"rotate(135deg)"}},_hoisted_10$d={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute right-2 top-2 size-6",style:{transform:"rotate(-135deg)"}},_hoisted_11$c={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute bottom-2 left-2 size-6",style:{transform:"rotate(45deg)"}},_hoisted_12$a={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute bottom-2 right-2 size-6",style:{transform:"rotate(-45deg)"}},_hoisted_13$7={key:0,class:"pt-1"},_sfc_main$E={__name:"MessageGroupMedia",props:{message:{type:Object,required:!0}},emits:["expand"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useMessageUiStore(),oe=e$b.computed(()=>{var ge;return(((ge=ne.message)==null?void 0:ge.items)||[]).slice(0,4)}),ie=e$b.computed(()=>{var ge,fe;return Math.max((((fe=(ge=ne.message)==null?void 0:ge.items)==null?void 0:fe.length)||0)-4,0)}),le=e$b.computed(()=>{var ge;return(((ge=ne.message)==null?void 0:ge.items)||[]).map(fe=>fe==null?void 0:fe.id).filter(fe=>fe!=null&&fe!=="")}),ce=e$b.computed(()=>le.value.join(" ")),de=e$b.ref(null);function ue(ge){var _e,be;const fe=String(((_e=ge==null?void 0:ge.detail)==null?void 0:_e.itemId)??"");if(!fe)return;const pe=(((be=ne.message)==null?void 0:be.items)||[]).findIndex(ke=>String(ke==null?void 0:ke.id)===fe);pe>=0&&ae("expand",pe)}e$b.onMounted(()=>{var ge;return(ge=de.value)==null?void 0:ge.addEventListener("open-package-item",ue)}),e$b.onBeforeUnmount(()=>{var ge;return(ge=de.value)==null?void 0:ge.removeEventListener("open-package-item",ue)});function ve(ge){return ge?re.isMessageSelected(ge):!1}function me(ge){var fe;return{id:ge==null?void 0:ge.id,type:(ge==null?void 0:ge.type)||((fe=ge==null?void 0:ge.content)==null?void 0:fe.type)||"image",content:{...ge==null?void 0:ge.content}}}return(ge,fe)=>{var pe,_e;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.createElementVNode("div",{ref_key:"rootEl",ref:de,class:"relative grid grid-cols-2 gap-[2px] text-white","data-group-items":ce.value},[e$b.unref(re).forwardMode.active?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:"absolute left-1 top-1 z-10",onClick:fe[0]||(fe[0]=e$b.withModifiers(be=>e$b.unref(re).togglePackageSelection(le.value),["stop"]))},[e$b.createElementVNode("div",_hoisted_2$w,[(ee.message.items||[]).some(be=>ve(be.id))?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$t,[...fe[1]||(fe[1]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):e$b.createCommentVNode("",!0)])])):e$b.createCommentVNode("",!0),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(oe.value,(be,ke)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:be.id||ke,id:String(be.id||ke),class:"group relative aspect-square max-h-[250px] w-full cursor-pointer overflow-hidden rounded-lg",onClick:$e=>ae("expand",ke)},[e$b.createVNode(MessageFileRenderer,{message:me(be),variant:"thumbnail","show-caption":!1,interactive:!1},null,8,["message"]),e$b.unref(re).forwardMode.active?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,"aria-label":"Selecionar mídia",class:e$b.normalizeClass(["absolute left-1 top-1 z-10 flex size-5 cursor-pointer items-center justify-center rounded border-2 bg-black/40 transition-colors",ve(be.id)?"border-primary":"border-gray-400 hover:border-primary"]),onClick:e$b.withModifiers($e=>e$b.unref(re).toggleMessageSelection(be.id),["stop"])},[ve(be.id)?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_6$m,[...fe[2]||(fe[2]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):e$b.createCommentVNode("",!0)],10,_hoisted_5$q)):e$b.createCommentVNode("",!0),ke===3&&ie.value>0?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$l," +"+e$b.toDisplayString(ie.value),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_8$h,[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_9$e,[...fe[3]||(fe[3]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_10$d,[...fe[4]||(fe[4]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_11$c,[...fe[5]||(fe[5]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_12$a,[...fe[6]||(fe[6]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])],8,_hoisted_4$s))),128))],8,_hoisted_1$z),(pe=ee.message.content)!=null&&pe.caption?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_13$7,[e$b.createVNode(MessageMarkdown,{content:(_e=ee.message.content)==null?void 0:_e.caption},null,8,["content"])])):e$b.createCommentVNode("",!0)],64)}}};var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(ee){return ee&&ee.__esModule&&Object.prototype.hasOwnProperty.call(ee,"default")?ee.default:ee}var leafletSrc={exports:{}};/* @preserve
|
|
278
|
+
</svg>`};function ve(Se){return typeof Se!="string"?!1:/^https:\/\/[^\s/$.?#].[^\s]*$/i.test(Se.trim())}function me(){var Te,ze;const Se=(Te=ne.content)==null?void 0:Te.headers;if(!Se)return{kind:null,value:""};const Le=String((Se==null?void 0:Se.type)||"").toLowerCase(),Ve=(Se==null?void 0:Se.content)??(Se==null?void 0:Se.media)??"";if(["text","image","video","document"].includes(Le))return{kind:Le,value:Ve};if(typeof Ve=="string"&&ve(Ve))try{const Re=(ze=new URL(Ve).pathname.split(".").pop())==null?void 0:ze.toLowerCase();if(["jpeg","jpg","png","gif","webp"].includes(Re))return{kind:"image",value:Ve};if(["mp4","mov","webm"].includes(Re))return{kind:"video",value:Ve};if(Re==="pdf")return{kind:"document",value:Ve}}catch{}return{kind:"text",value:Ve}}const{kind:ge,value:fe}=me();function pe(){ae("action",{type:re,...ne.content})}return(Se,Le)=>{var Ve,Te;return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$L,[(Ve=ee.content)!=null&&Ve.headers?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$G,[["image","video","document"].includes(e$b.unref(ge))&&ve(e$b.unref(fe))?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_3$C,[e$b.unref(ge)==="image"?(e$b.openBlock(),e$b.createElementBlock("img",{key:0,src:e$b.unref(fe),class:"max-h-96 max-w-full rounded object-contain",alt:"header image"},null,8,_hoisted_4$A)):e$b.unref(ge)==="video"?(e$b.openBlock(),e$b.createElementBlock("video",{key:1,src:e$b.unref(fe),controls:"",class:"max-h-96 max-w-full rounded object-contain"},null,8,_hoisted_5$x)):e$b.unref(ge)==="document"?(e$b.openBlock(),e$b.createElementBlock("embed",{key:2,src:e$b.unref(fe),type:"application/pdf",class:"w-full h-96 rounded"},null,8,_hoisted_6$t)):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),(Te=ee.content.headers)!=null&&Te.text?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$r,[e$b.createVNode(MessageMarkdown,{content:ee.content.headers.text||ee.content.headers.text},null,8,["content"])])):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),ce.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$l,[e$b.createElementVNode("p",_hoisted_9$i,[e$b.createVNode(MessageMarkdown,{content:e$b.unref(ie)},null,8,["content"])])])),ce.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10$g,[e$b.createElementVNode("p",_hoisted_11$f,[e$b.createVNode(MessageMarkdown,{content:ee.content.footer},null,8,["content"])])])),ce.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_12$d,[Le[4]||(Le[4]=e$b.createElementVNode("div",{class:"px-3 pt-2 pb-1 flex items-center gap-2"},[e$b.createElementVNode("svg",{class:"size-3.5 shrink-0 text-base-content/40",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1H2V7ZM2 10h20v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7Zm3 3a1 1 0 0 0 0 2h3a1 1 0 0 0 0-2H5Z"})]),e$b.createElementVNode("p",{class:"text-[11px] font-medium text-base-content/50 uppercase tracking-wide leading-none"}," Solicitação de pagamento ")],-1)),e$b.createElementVNode("div",_hoisted_13$a,[ce.value.description?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_14$9,[Le[0]||(Le[0]=e$b.createElementVNode("svg",{class:"size-3.5 mt-0.5 shrink-0 text-base-content/40",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M5 4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4Zm5 4a1 1 0 0 0 0 2h4a1 1 0 0 0 0-2h-4Zm0 3a1 1 0 0 0 0 2h4a1 1 0 0 0 0-2h-4Zm0 3a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2h-2Z","clip-rule":"evenodd"})],-1)),e$b.createElementVNode("span",_hoisted_15$8,e$b.toDisplayString(ce.value.description),1)])):e$b.createCommentVNode("",!0),ce.value.reference_id?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$7,[Le[1]||(Le[1]=e$b.createElementVNode("span",{class:"text-[10px] uppercase tracking-wider font-semibold text-base-content/40"},"Ref.",-1)),e$b.createElementVNode("span",_hoisted_17$3,e$b.toDisplayString(ce.value.reference_id),1)])):e$b.createCommentVNode("",!0),Le[3]||(Le[3]=e$b.createElementVNode("div",{class:"border-t border-dashed border-base-content/10"},null,-1)),e$b.createElementVNode("div",_hoisted_18$3,[Le[2]||(Le[2]=e$b.createElementVNode("span",{class:"text-[12px] font-medium text-base-content/60 uppercase tracking-wide"},"Total a pagar",-1)),e$b.createElementVNode("span",_hoisted_19$3,e$b.toDisplayString(de(ce.value.total_amount,ce.value.currency)),1)])])])):e$b.createCommentVNode("",!0),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(le.value,(ze,Re)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ze.id||ze.type||ze.text,class:"-mx-2"},[ze.type!=="review_and_pay"?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,class:e$b.normalizeClass(["group flex border-b border-base-100 w-full items-center justify-center gap-1 bg-base-200 px-3 py-2 text-primary hover:bg-base-100 transition",Re===le.value.length-1?"rounded-b-md":""]),onClick:pe},[e$b.createElementVNode("span",{innerHTML:ue[ze.type]||ue.voice_call,class:"inline-flex"},null,8,_hoisted_20$3),e$b.createElementVNode("span",_hoisted_21$3,e$b.toDisplayString((ze==null?void 0:ze.text)||oe[ze==null?void 0:ze.type]||"sem texto"),1)],2)):e$b.createCommentVNode("",!0)]))),128))])}}},_sfc_main$P={},_hoisted_1$K={class:"media-hover-frame"};function _sfc_render$2(ee,te){return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$K,[...te[0]||(te[0]=[e$b.createStaticVNode('<svg class="media-corner media-corner-tl" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg><svg class="media-corner media-corner-tr" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg><svg class="media-corner media-corner-bl" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg><svg class="media-corner media-corner-br" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg>',4)])])}const MediaHoverFrame=_export_sfc$1(_sfc_main$P,[["render",_sfc_render$2],["__scopeId","data-v-8194d834"]]),_sfc_main$O={props:{content:{type:String,required:!0},isCircle:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},computed:{containerClass(){return this.isCircle?"h-[150px] min-w-[150px]":this.compact?"mx-auto aspect-video h-auto w-[300px] max-w-full":"h-[200px] w-full min-w-[200px]"},loadingClass(){return this.isCircle?"size-full rounded-full":"size-full rounded-xl"},videoClass(){return this.isCircle?"size-full rounded-full object-cover":"size-full rounded-xl object-scale-down"}},data(){return{isLoading:!0,shouldLoad:!1}},mounted(){this.observer=new IntersectionObserver(this.onIntersection,{root:null,rootMargin:"0px",threshold:.5}),this.observer.observe(this.$refs.videoContainer)},beforeUnmount(){var ee;(ee=this.observer)==null||ee.disconnect()},methods:{onIntersection(ee){ee.forEach(te=>{te.isIntersecting&&te.intersectionRatio>=.5&&(this.shouldLoad=!0,this.isLoading=!1,this.observer.unobserve(this.$refs.videoContainer))})}}},_hoisted_1$J=["src","type"];function _sfc_render$1(ee,te,ne,ae,re,oe){return e$b.openBlock(),e$b.createElementBlock("div",{ref:"videoContainer",class:e$b.normalizeClass(["video-container group relative shrink cursor-pointer",oe.containerClass])},[te[2]||(te[2]=e$b.createElementVNode("svg",{class:"absolute inset-0 z-50 m-auto size-[30%] text-gray-100 hover:opacity-70","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.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)),re.isLoading?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["flex justify-center bg-base-300 p-3",oe.loadingClass])},[...te[0]||(te[0]=[e$b.createElementVNode("div",{class:"loader m-auto size-12 rounded-full border-4 border-teal-600"},null,-1)])],2)):re.shouldLoad?(e$b.openBlock(),e$b.createElementBlock("video",{key:ne.content,ref:"videoRef",class:e$b.normalizeClass(["bg-base-300",oe.videoClass])},[e$b.createElementVNode("source",{src:ne.content,type:ne.content.type},null,8,_hoisted_1$J),te[1]||(te[1]=e$b.createTextVNode(" Seu navegador não suporta esse vídeo. ",-1))],2)):e$b.createCommentVNode("",!0)],2)}const VideoLazy=_export_sfc$1(_sfc_main$O,[["render",_sfc_render$1]]),_hoisted_1$I=["src"],_hoisted_2$F=["aria-label"],_hoisted_3$B={key:0,class:"ptv-icon",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},_hoisted_4$z=["viewBox"],_hoisted_5$w=["cx","cy","r"],_hoisted_6$s=["cx","cy","r","stroke-dashoffset"],_hoisted_7$q=["cx","cy","r","stroke-width","aria-valuemax","aria-valuenow"],_hoisted_8$k=["cx","cy"],_hoisted_9$h={class:"ptv-time"},RING_WIDTH=4,HOVER_GROWTH=10,PLAYING_GROWTH=44,_sfc_main$N={__name:"MessagePtv",props:{src:{type:String,required:!0},duration:{type:[Number,String],default:0},baseSize:{type:Number,default:200}},setup(ee){const te=ee,ne=e$b.ref(null),ae=e$b.ref(null),re=e$b.ref(!1),oe=e$b.ref(!1),ie=e$b.ref(!1),le=e$b.ref(0),ce=e$b.ref(Number(te.duration)||0),de=e$b.computed(()=>re.value||ie.value?te.baseSize+PLAYING_GROWTH:oe.value?te.baseSize+HOVER_GROWTH:te.baseSize),ue=e$b.computed(()=>de.value/2),ve=e$b.computed(()=>ue.value-RING_WIDTH/2),me=e$b.computed(()=>`${te.src}#t=0.001`),ge=e$b.computed(()=>ce.value?Math.min(le.value/ce.value,1):0),fe=e$b.computed(()=>re.value||ie.value||oe.value),pe=e$b.computed(()=>{const Be=ge.value*2*Math.PI;return{x:ue.value+ve.value*Math.cos(Be),y:ue.value+ve.value*Math.sin(Be)}}),_e=e$b.computed(()=>{const Be=re.value||ie.value?Math.max(ce.value-le.value,0):ce.value;return`${Math.floor(Be/60)}:${String(Math.floor(Be%60)).padStart(2,"0")}`});let be;function ke(){const Be=ae.value;Be&&(le.value=Be.currentTime,be=requestAnimationFrame(ke))}function $e(){re.value=!0,cancelAnimationFrame(be),be=requestAnimationFrame(ke)}function ye(){re.value=!1,cancelAnimationFrame(be)}function Ee(){ye(),Ve(0)}function Se(){var De;const Be=(De=ae.value)==null?void 0:De.duration;Number.isFinite(Be)&&Be>0&&(ce.value=Be)}function Le(){const Be=ae.value;Be&&(Be.paused?Be.play().catch(()=>ye()):Be.pause())}function Ve(Be){const De=ae.value;if(!De)return;const Ne=Math.min(Math.max(Be,0),ce.value||0);De.currentTime=Ne,le.value=Ne}function Te(Be){var Me;const De=(Me=ne.value)==null?void 0:Me.getBoundingClientRect();if(!De)return 0;const Ne=Math.atan2(Be.clientX-(De.left+De.width/2),De.top+De.height/2-Be.clientY);return(Ne<0?Ne+2*Math.PI:Ne)/(2*Math.PI)}function ze(Be){Ve(Te(Be)*ce.value)}function Re(){ie.value=!1,window.removeEventListener("pointermove",ze),window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re)}function Oe(Be){Be.stopPropagation(),Be.preventDefault(),ce.value&&(ie.value=!0,ze(Be),window.addEventListener("pointermove",ze),window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re))}function Pe(Be){const De={ArrowRight:1,ArrowUp:1,ArrowLeft:-1,ArrowDown:-1}[Be.key]??0;De&&(Be.preventDefault(),Ve(le.value+De))}return e$b.onBeforeUnmount(()=>{cancelAnimationFrame(be),Re()}),(Be,De)=>(e$b.openBlock(),e$b.createElementBlock("div",{ref_key:"rootEl",ref:ne,class:e$b.normalizeClass(["ptv",{"is-playing":re.value,"is-scrubbing":ie.value}]),style:e$b.normalizeStyle({width:`${de.value}px`,height:`${de.value}px`}),onPointerenter:De[0]||(De[0]=Ne=>oe.value=!0),onPointerleave:De[1]||(De[1]=Ne=>oe.value=!1)},[e$b.createElementVNode("video",{ref_key:"videoRef",ref:ae,class:"ptv-video",src:me.value,playsinline:"",preload:"metadata",onLoadedmetadata:Se,onPlay:$e,onPause:ye,onEnded:Ee},null,40,_hoisted_1$I),e$b.createElementVNode("button",{type:"button",class:"ptv-toggle","aria-label":re.value?"Pausar vídeo":"Tocar vídeo",onClick:e$b.withModifiers(Le,["stop"])},[re.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$B,[...De[2]||(De[2]=[e$b.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"},null,-1)])]))],8,_hoisted_2$F),(e$b.openBlock(),e$b.createElementBlock("svg",{class:"ptv-ring",viewBox:`0 0 ${de.value} ${de.value}`},[e$b.createElementVNode("circle",{class:"ptv-ring-track",cx:ue.value,cy:ue.value,r:ve.value,"stroke-width":RING_WIDTH},null,8,_hoisted_5$w),e$b.createElementVNode("circle",{class:"ptv-ring-progress",cx:ue.value,cy:ue.value,r:ve.value,"stroke-width":RING_WIDTH,pathLength:"1","stroke-dasharray":"1","stroke-dashoffset":1-ge.value},null,8,_hoisted_6$s),e$b.createElementVNode("circle",{class:"ptv-scrub",cx:ue.value,cy:ue.value,r:ve.value,"stroke-width":RING_WIDTH*4,role:"slider",tabindex:"0","aria-label":"Posição do vídeo","aria-valuemin":"0","aria-valuemax":Math.round(ce.value),"aria-valuenow":Math.round(le.value),onPointerdown:Oe,onKeydown:Pe},null,40,_hoisted_7$q),fe.value?(e$b.openBlock(),e$b.createElementBlock("circle",{key:0,class:"ptv-knob",cx:pe.value.x,cy:pe.value.y,r:RING_WIDTH},null,8,_hoisted_8$k)):e$b.createCommentVNode("",!0)],8,_hoisted_4$z)),e$b.createElementVNode("span",_hoisted_9$h,e$b.toDisplayString(_e.value),1)],38))}},MessagePtv=_export_sfc$1(_sfc_main$N,[["__scopeId","data-v-4481c02f"]]),_hoisted_1$H={class:"sidebar rounded shadow transition duration-150 ease-in-out"},_hoisted_2$E={class:"flex items-center gap-4 p-1"},_hoisted_3$A=["href","download","title"],_hoisted_4$y={class:"pr-3 max-w-28 md:max-w-32"},_hoisted_5$v={class:"line-clamp-2 truncate"},_hoisted_6$r=["href","download","title"],_hoisted_7$p={key:0,class:"mt-2"},_sfc_main$M={__name:"MessageFileCard",props:{file:{type:Object,default:()=>({})}},emits:["download"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.computed(()=>{var oe,ie,le,ce;return((oe=ne.file)==null?void 0:oe.title)||((ie=ne.file)==null?void 0:ie.name)||((le=ne.file)==null?void 0:le.filename)||((ce=ne.file)==null?void 0:ce.original_name)||"arquivo"});return(oe,ie)=>(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.createElementVNode("div",_hoisted_1$H,[e$b.createElementVNode("div",_hoisted_2$E,[e$b.createElementVNode("a",{href:ee.file.url,download:re.value,title:re.value,onClick:ie[0]||(ie[0]=e$b.withModifiers(le=>ae("download",ee.file,re.value),["prevent"]))},[...ie[2]||(ie[2]=[e$b.createElementVNode("svg",{class:"size-14 rounded p-1 text-primary header","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.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-7Zm3 2h2.01v2.01h-2V8h2v2.01h-2V12h2v2.01h-2V16h2v2.01h-2v2H12V18h2v-1.99h-2V14h2v-1.99h-2V10h2V8.01h-2V6h2V4Z","clip-rule":"evenodd"})],-1)])],8,_hoisted_3$A),e$b.createElementVNode("main",_hoisted_4$y,[e$b.createElementVNode("p",_hoisted_5$v,e$b.toDisplayString(re.value),1),e$b.createElementVNode("a",{target:"_blank",class:"cursor-pointer text-primary hover:underline",href:ee.file.url,download:re.value,title:re.value,onClick:ie[1]||(ie[1]=e$b.withModifiers(le=>ae("download",ee.file,re.value),["prevent"]))}," Baixar arquivo ",8,_hoisted_6$r)])])]),ee.file.caption?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$p,[e$b.createVNode(MessageMarkdown,{content:ee.file.caption},null,8,["content"])])):e$b.createCommentVNode("",!0)],64))}},_hoisted_1$G={key:1,class:"flex items-center justify-center text-xs opacity-60"},_hoisted_2$D={key:2,class:"loader-dots relative my-2 block h-5 w-14"},_sfc_main$L={__name:"MessageTgSticker",props:{content:{type:Object,default:()=>({})},variant:{type:String,default:"chat"}},setup(ee){const te=e$b.defineAsyncComponent(async()=>(await Promise.resolve().then(()=>vue3Lottie_es)).Vue3Lottie),ne=ee,ae=e$b.ref(null),re=e$b.ref(!1),oe=e$b.computed(()=>ne.variant==="thumbnail"?96:ne.variant==="composer"?180:220),ie=e$b.computed(()=>ne.variant==="chat"?"flex items-center justify-center p-1":"flex size-full items-center justify-center");return e$b.watch(()=>{var le;return(le=ne.content)==null?void 0:le.url},async le=>{if(ae.value=null,re.value=!1,!!le)try{const[{ungzip:ce},de]=await Promise.all([Promise.resolve().then(()=>pako),fetch(le)]),ue=ce(new Uint8Array(await de.arrayBuffer()));ae.value=JSON.parse(new TextDecoder("utf-8").decode(ue))}catch{re.value=!0}},{immediate:!0}),(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(ie.value)},[ae.value?(e$b.openBlock(),e$b.createBlock(e$b.unref(te),{key:0,speed:1,"animation-data":ae.value,height:oe.value,width:oe.value,loop:"",autoplay:""},null,8,["animation-data","height","width"])):re.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$G," Figurinha indisponível ")):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$D,[...ce[0]||(ce[0]=[e$b.createElementVNode("div",{class:"loader-dot"},null,-1),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.2s]"},null,-1),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.4s]"},null,-1)])]))],2))}},MessageTgSticker=_export_sfc$1(_sfc_main$L,[["__scopeId","data-v-b1c4fd4b"]]),GIF_TYPES$1=new Set(["gif","image/gif"]),STICKER_TYPES=new Set(["image/webp","webp"]),TG_STICKER_TYPES=new Set(["application/x-tgsticker","x-tgsticker"]),HEIF_TYPES=new Set(["heif","heic","image/heif","image/heic"]),AUDIO_TYPES=new Set(["audio","audio/mpeg","audio/ogg","audio/wav","audio/mp3","mpeg","mp3","ogg","wav","aac","webm"]),VIDEO_TYPES=new Set(["video","video/mp4","mp4"]),IMAGE_TYPES=new Set(["image","image/jpeg","jpeg","image/png","png","jpg"]),MIME_BY_EXTENSION={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",heif:"image/heif",heic:"image/heic",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",mov:"video/quicktime",m4v:"video/x-m4v",avi:"video/x-msvideo",mkv:"video/x-matroska",mp3:"audio/mpeg",wav:"audio/wav",m4a:"audio/mp4",aac:"audio/aac",pdf:"application/pdf"};function normalizeMediaValue(ee){return typeof ee=="string"?ee.trim().toLowerCase():""}function inferMimeTypeFromName(ee,te=""){const ne=normalizeMediaValue(ee).split(".").pop()||"";return MIME_BY_EXTENSION[ne]||te}function resolveFileMimeType(ee="",te="",ne=""){return normalizeMediaValue(typeof te=="string"?te:te==null?void 0:te.type)||inferMimeTypeFromName(ee,ne)}function mediaItemName(ee){var te,ne,ae,re;return normalizeMediaValue(((te=ee==null?void 0:ee.content)==null?void 0:te.title)||((ne=ee==null?void 0:ee.content)==null?void 0:ne.name)||((ae=ee==null?void 0:ee.content)==null?void 0:ae.filename)||((re=ee==null?void 0:ee.content)==null?void 0:re.original_name)||(ee==null?void 0:ee.title)||(ee==null?void 0:ee.name)||(ee==null?void 0:ee.fileName)||(ee==null?void 0:ee.filename)||(ee==null?void 0:ee.original_name)||"")}function resolveMediaType(ee){var ne,ae;const te=normalizeMediaValue(((ne=ee==null?void 0:ee.content)==null?void 0:ne.type)||(ee==null?void 0:ee.type)||((ae=ee==null?void 0:ee.mimeType)==null?void 0:ae.type)||(ee==null?void 0:ee.mimeType)||"");return te||inferMimeTypeFromName(mediaItemName(ee))}function isHeif(ee){const te=resolveMediaType(ee);return HEIF_TYPES.has(te)||/\.(heif|heic)$/i.test(mediaItemName(ee))}function shouldRenderHeifAsVideo(ee,te="web"){return isHeif(ee)&&normalizeMediaValue(te)!=="ios"}function isSticker(ee){return STICKER_TYPES.has(resolveMediaType(ee))}function isTgSticker(ee){return TG_STICKER_TYPES.has(resolveMediaType(ee))||/\.tgs(ticker)?$/i.test(mediaItemName(ee))}function isVideo(ee){const te=resolveMediaType(ee);return VIDEO_TYPES.has(te)||/^video\//i.test(te)}function isPtv(ee){var te;return isVideo(ee)&&!!(((te=ee==null?void 0:ee.content)==null?void 0:te.isptv)??(ee==null?void 0:ee.isptv))}function isGif(ee){var ne;const te=resolveMediaType(ee);return isVideo(ee)&&((ne=ee==null?void 0:ee.content)==null?void 0:ne.is_gif)||GIF_TYPES$1.has(te)}function isImage(ee){const te=resolveMediaType(ee);return!te||isSticker(ee)||isGif(ee)?!1:isHeif(ee)||IMAGE_TYPES.has(te)||te.startsWith("image/")}function isAudio(ee){const te=resolveMediaType(ee);return AUDIO_TYPES.has(te)||/^audio\//i.test(te)}const GIF_TYPES=["gif","image/gif"];function getMimeType(ee){var te;return normalizeMediaValue(typeof(ee==null?void 0:ee.type)=="string"?ee.type:(te=ee==null?void 0:ee.content)==null?void 0:te.type)}function isGifLike(ee){return GIF_TYPES.includes(getMimeType(ee))}function useVideoPreview(ee,te="web"){return isHeif(ee)?shouldRenderHeifAsVideo(ee,te):isGifLike(ee)}function useImagePreview(ee,te="web"){return isHeif(ee)?!shouldRenderHeifAsVideo(ee,te):!isGifLike(ee)}function previewMediaSrc(ee,te="web"){var ne,ae,re,oe;return useVideoPreview(ee,te)?(ee==null?void 0:ee.blobUrl)||((ne=ee==null?void 0:ee.content)==null?void 0:ne.data64)||(ee==null?void 0:ee.data64)||((ae=ee==null?void 0:ee.content)==null?void 0:ae.url)||(ee==null?void 0:ee.url):((re=ee==null?void 0:ee.content)==null?void 0:re.data64)||(ee==null?void 0:ee.data64)||((oe=ee==null?void 0:ee.content)==null?void 0:oe.url)||(ee==null?void 0:ee.url)}const _hoisted_1$F={key:0},_hoisted_2$C=["alt"],_hoisted_3$z=["src","alt"],_hoisted_4$x=["src"],_hoisted_5$u=["src"],_hoisted_6$q=["src"],_hoisted_7$o=["aria-label"],_hoisted_8$j=["src"],_hoisted_9$g=["aria-label"],_hoisted_10$f=["src"],_hoisted_11$e={class:"pdf-mobile-header"},_hoisted_12$c={class:"min-w-0"},_hoisted_13$9={class:"truncate text-sm font-medium"},_hoisted_14$8={key:1,class:"renderer-loading"},CHAT_IMAGE_MAX_HEIGHT=300,_sfc_main$K={__name:"MessageFileRenderer",props:{message:{type:Object,required:!0},variant:{type:String,default:"chat"},showCaption:{type:Boolean,default:!0},interactive:{type:Boolean,default:!0}},emits:["expand","open-native-pdf","download","error"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useMessageUiStore(),oe=e$b.computed(()=>re.deviceType),ie=e$b.computed(()=>{var _t;return((_t=ne.message)==null?void 0:_t.content)||{}}),le=e$b.computed(()=>{var _t;return String(((_t=ie.value)==null?void 0:_t.type)||"").toLowerCase()}),ce=e$b.computed(()=>previewMediaSrc(ie.value,oe.value)),de=e$b.computed(()=>oe.value!=="ios"&&!isImageSourcePreloaded(ce.value)),ue=e$b.computed(()=>{var _t,Ze;return((_t=ie.value)==null?void 0:_t.data64)||((Ze=ie.value)==null?void 0:Ze.url)||""}),ve=e$b.computed(()=>{var _t,Ze;return((_t=ie.value)==null?void 0:_t.text)||((Ze=ie.value)==null?void 0:Ze.caption)||""}),me=e$b.computed(()=>{var _t,Ze,at,dt;return((_t=ie.value)==null?void 0:_t.title)||((Ze=ie.value)==null?void 0:Ze.name)||((at=ie.value)==null?void 0:at.filename)||((dt=ie.value)==null?void 0:dt.original_name)||"arquivo"}),ge=e$b.computed(()=>Object.keys(ie.value||{}).length>0),fe=e$b.computed(()=>re.isWebDevice),pe=e$b.computed(()=>ne.variant==="composer"),_e=e$b.computed(()=>ne.variant==="thumbnail"),be=e$b.computed(()=>ne.interactive&&!_e.value),ke=e$b.computed(()=>isHeif(ie.value)&&useVideoPreview(ie.value,oe.value)),$e=e$b.computed(()=>be.value&&!isSticker(ne.message)&&!ke.value),ye=e$b.computed(()=>["application/pdf","pdf"].includes(le.value)),Ee=e$b.computed(()=>["gif","image/gif"].includes(le.value)),Se=e$b.computed(()=>{if(ye.value)return"pdf";if(isAudio(ne.message))return"audio";if(isTgSticker(ne.message))return"sticker";if(isSticker(ne.message))return"image";if(isImage(ne.message))return useVideoPreview(ie.value,oe.value)?"video":"image";if(isPtv(ne.message)&&ne.variant==="chat")return"ptv";if(isVideo(ne.message))return"video";if(isGif(ne.message)){if(Ee.value||useImagePreview(ie.value,oe.value))return"image";if(useVideoPreview(ie.value,oe.value))return"video"}return"file"}),Le=e$b.computed(()=>ne.showCaption&&!!ve.value&&!pe.value&&!_e.value),Ve=e$b.computed(()=>Se.value==="video"?"Abrir vídeo":"Ampliar"),Te=e$b.computed(()=>`${Ve.value}: ${me.value}`),ze=e$b.computed(()=>_e.value?"renderer renderer-thumbnail":pe.value?"renderer renderer-composer":"renderer renderer-chat"),Re=e$b.computed(()=>_e.value?"media-surface media-surface-thumbnail":pe.value?"media-surface media-surface-composer":"media-surface media-surface-chat"),Oe=e$b.computed(()=>_e.value?"icon-surface icon-surface-thumbnail":"icon-surface"),Pe=e$b.computed(()=>isSticker(ne.message)&&!_e.value?"media-image-sticker":_e.value?"media-image media-image-thumbnail":pe.value?"media-image media-image-composer":"media-image media-image-chat"),Be=e$b.computed(()=>_e.value?"media-video-heif-thumbnail":pe.value?"media-video-heif-composer":"media-video-heif-chat"),De=e$b.computed(()=>$e.value&&ne.variant==="chat"&&(Se.value==="image"||Se.value==="video")),Ne=e$b.computed(()=>Se.value==="video"?"renderer-caption pt-2":"renderer-caption"),Me=e$b.computed(()=>pe.value?"pdf-shell pdf-shell-composer":"pdf-shell"),we=e$b.computed(()=>pe.value?"file-shell file-shell-composer":"file-shell"),Ce={w:260,h:195},Fe=e$b.ref(null),Ie=e$b.ref(isImageSourcePreloaded(ce.value));e$b.watch(ce,_t=>{Fe.value=null,Ie.value=isImageSourcePreloaded(_t)});const Ue=e$b.computed(()=>ne.variant==="chat"&&Se.value==="image"&&!isSticker(ne.message)),qe=e$b.computed(()=>Fe.value||mediaSizeFromContent(ie.value,ce.value)),je=e$b.computed(()=>{if(!Ue.value)return null;const _t=qe.value||Ce,Ze=Math.min(_t.h,CHAT_IMAGE_MAX_HEIGHT);return{width:`${Math.round(Ze*_t.w/_t.h)}px`,maxWidth:"100%",aspectRatio:`${_t.w} / ${_t.h}`}}),We=e$b.computed(()=>Ue.value?"media-image-reserved":""),Ge=e$b.computed(()=>Ie.value?"media-image-revealed":"media-image-revealing"),Ke=e$b.computed(()=>Ue.value&&!Ie.value);function et(_t){const Ze=_t.target,{naturalWidth:at,naturalHeight:dt}=Ze;!at||!dt||sameMediaSource(Ze.currentSrc||Ze.src,ce.value)&&(Fe.value={w:at,h:dt},rememberMediaSize(ce.value,at,dt))}function yt(){Ie.value=!0}async function Et(_t){et(_t);const Ze=_t.target,at=Ze.currentSrc||Ze.src;if(!(de.value&&!sameMediaSource(at,ce.value))){if(typeof Ze.decode=="function"){try{await Ze.decode()}catch{}if(!sameMediaSource(Ze.currentSrc||Ze.src,at))return}yt()}}function At(_t){$e.value&&ae("expand",ne.message,_t)}function Pt(_t){const Ze=(_t==null?void 0:_t.data64)||(_t==null?void 0:_t.url);if(!Ze||String(Ze).startsWith("undefined")){ae("error","PDF inválido.");return}if(!fe.value){ae("open-native-pdf",Ze);return}N$3.show([{src:Ze,type:"iframe",caption:_t.caption||_t.title||"Documento PDF"}],{Carousel:{Toolbar:{display:{left:["counter"],middle:[],right:["toggleFull","close"]}}},Html:{videoTpl:'<iframe src="{{src}}" width="90%" height="85vh" style="border-radius: 12px; border: none;"></iframe>'},dragToClose:!1})}return(_t,Ze)=>{var dt,ct,ht,tt;const at=e$b.resolveDirective("lazy");return ge.value?(e$b.openBlock(),e$b.createElementBlock("section",{key:0,class:e$b.normalizeClass(ze.value)},[(dt=ie.value)!=null&&dt.story_reply?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$F,[...Ze[5]||(Ze[5]=[e$b.createElementVNode("p",{class:"italic opacity-70"},"Resposta de stories",-1)])])):e$b.createCommentVNode("",!0),Se.value==="image"?(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent($e.value?"button":"div"),{key:1,type:$e.value?"button":void 0,class:e$b.normalizeClass([Re.value,$e.value?"group":"",Ke.value?"media-surface-pending":""]),style:e$b.normalizeStyle(je.value),"aria-label":$e.value?Te.value:void 0,onClick:Ze[0]||(Ze[0]=Ye=>$e.value&&At(!1))},{default:e$b.withCtx(()=>[de.value?e$b.withDirectives((e$b.openBlock(),e$b.createElementBlock("img",{key:0,alt:me.value,class:e$b.normalizeClass([Pe.value,We.value,Ge.value]),decoding:"async",onLoad:Et,onError:yt},null,42,_hoisted_2$C)),[[at,ce.value]]):(e$b.openBlock(),e$b.createElementBlock("img",{key:1,src:ce.value,alt:me.value,class:e$b.normalizeClass([Pe.value,We.value,Ge.value]),decoding:"async",onLoad:Et,onError:yt},null,42,_hoisted_3$z)),De.value?(e$b.openBlock(),e$b.createBlock(MediaHoverFrame,{key:2})):e$b.createCommentVNode("",!0)]),_:1},8,["type","class","style","aria-label"])):Se.value==="ptv"?(e$b.openBlock(),e$b.createBlock(MessagePtv,{key:2,src:ce.value,duration:(ct=ie.value)==null?void 0:ct.duration},null,8,["src","duration"])):Se.value==="video"?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:3},[ke.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(Re.value)},[e$b.createElementVNode("video",{class:e$b.normalizeClass(["media-video media-video-heif",Be.value]),src:ce.value,autoplay:"",muted:"",loop:"",playsinline:""},null,10,_hoisted_4$x)],2)):_e.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(Re.value)},[e$b.createElementVNode("video",{class:e$b.normalizeClass(["media-video media-video-thumbnail",{"media-video-ptv":(ht=ie.value)==null?void 0:ht.isptv}]),src:ce.value,autoplay:"",muted:"",loop:"",playsinline:""},null,10,_hoisted_5$u)],2)):pe.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:2,class:e$b.normalizeClass(Re.value)},[e$b.createElementVNode("video",{class:"media-video",src:ce.value,controls:"",autoplay:"",muted:"",loop:"",playsinline:""},null,8,_hoisted_6$q)],2)):$e.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:3,type:"button",class:"video-trigger group","aria-label":Te.value,onClick:Ze[1]||(Ze[1]=Ye=>At(!0))},[e$b.createVNode(VideoLazy,{content:ce.value,"is-circle":(tt=ie.value)==null?void 0:tt.isptv,compact:ee.variant==="chat"},null,8,["content","is-circle","compact"]),De.value?(e$b.openBlock(),e$b.createBlock(MediaHoverFrame,{key:0})):e$b.createCommentVNode("",!0)],8,_hoisted_7$o)):(e$b.openBlock(),e$b.createElementBlock("div",{key:4,class:e$b.normalizeClass(Re.value)},[e$b.createElementVNode("video",{class:"media-video media-video-thumbnail",src:ce.value,autoplay:"",muted:"",loop:"",playsinline:""},null,8,_hoisted_8$j)],2))],64)):Se.value==="pdf"?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:4},[_e.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(Oe.value)},[...Ze[6]||(Ze[6]=[e$b.createElementVNode("svg",{class:"size-14 text-red-500",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.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)])],2)):fe.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(Me.value)},[e$b.createElementVNode("button",{type:"button",class:e$b.normalizeClass(Re.value),"aria-label":`Abrir PDF ${me.value}`,onClick:Ze[2]||(Ze[2]=Ye=>Pt(ie.value))},[ue.value&&!ue.value.startsWith("undefined")?(e$b.openBlock(),e$b.createElementBlock("iframe",{key:0,src:`${ue.value}#toolbar=0&navpanes=0`,class:"pdf-frame",loading:"lazy"},null,8,_hoisted_10$f)):e$b.createCommentVNode("",!0),Ze[7]||(Ze[7]=e$b.createElementVNode("div",{class:"absolute inset-0 flex items-end justify-start bg-gradient-to-t from-black/50 to-transparent p-2 transition-opacity"},[e$b.createElementVNode("span",{class:"flex items-center gap-1.5 rounded-md bg-gray-500/80 border border-gray-600 backdrop-blur-sm px-2.5 py-1 text-xs font-medium text-white shadow"},[e$b.createElementVNode("svg",{class:"size-3.5 shrink-0",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.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"})]),e$b.createTextVNode(" Abrir PDF ")])],-1))],10,_hoisted_9$g)],2)):(e$b.openBlock(),e$b.createElementBlock("button",{key:2,type:"button",class:"pdf-mobile-card",onClick:Ze[3]||(Ze[3]=Ye=>ae("open-native-pdf",ue.value))},[e$b.createElementVNode("div",_hoisted_11$e,[Ze[9]||(Ze[9]=e$b.createElementVNode("svg",{class:"size-5 shrink-0",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.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$b.createElementVNode("div",_hoisted_12$c,[e$b.createElementVNode("p",_hoisted_13$9,e$b.toDisplayString(me.value),1),Ze[8]||(Ze[8]=e$b.createElementVNode("p",{class:"text-xs opacity-75"},"Toque para abrir o documento",-1))])])]))],64)):Se.value==="sticker"?(e$b.openBlock(),e$b.createElementBlock("div",{key:5,class:e$b.normalizeClass(Oe.value)},[e$b.createVNode(MessageTgSticker,{content:ie.value,variant:ee.variant},null,8,["content","variant"])],2)):Se.value==="audio"?(e$b.openBlock(),e$b.createElementBlock("div",{key:6,class:e$b.normalizeClass(Oe.value)},[...Ze[10]||(Ze[10]=[e$b.createElementVNode("svg",{class:"size-14 text-primary",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 7V2.221a2 2 0 0 0-.5.365L4.586 6.5a2 2 0 0 0-.365.5H9Zm2 0V2h7a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9h5a2 2 0 0 0 2-2Zm2.318.052h-.002A1 1 0 0 0 12 8v5.293A4.033 4.033 0 0 0 10.5 13C8.787 13 7 14.146 7 16s1.787 3 3.5 3 3.5-1.146 3.5-3c0-.107-.006-.211-.017-.313A1.04 1.04 0 0 0 14 15.5V9.766c.538.493 1 1.204 1 2.234a1 1 0 1 0 2 0c0-1.881-.956-3.14-1.86-3.893a6.4 6.4 0 0 0-1.636-.985 4.009 4.009 0 0 0-.165-.063l-.014-.005-.005-.001-.002-.001ZM9 16c0-.356.452-1 1.5-1s1.5.644 1.5 1-.452 1-1.5 1S9 16.356 9 16Z","clip-rule":"evenodd"})],-1)])],2)):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:7},[_e.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(Oe.value)},[...Ze[11]||(Ze[11]=[e$b.createElementVNode("svg",{class:"size-14 text-primary",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.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)])],2)):(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(we.value)},[e$b.createVNode(_sfc_main$M,{file:ie.value,onDownload:Ze[4]||(Ze[4]=(Ye,Je)=>ae("download",Ye,Je))},null,8,["file"])],2))],64)),Le.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:8,class:e$b.normalizeClass(Ne.value)},[e$b.createVNode(MessageMarkdown,{content:ve.value},null,8,["content"])],2)):e$b.createCommentVNode("",!0)],2)):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_14$8,[...Ze[12]||(Ze[12]=[e$b.createElementVNode("div",{class:"loader-dots relative my-2 block h-5 w-20"},[e$b.createElementVNode("div",{class:"loader-dot"}),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.2s]"}),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.4s]"})],-1)])]))}}},MessageFileRenderer=_export_sfc$1(_sfc_main$K,[["__scopeId","data-v-bd8e7bea"]]),_hoisted_1$E={class:"sm-quote-content"},_hoisted_2$B={key:1,class:"sm-quote-description"},_hoisted_3$y={key:0,class:"sm-quote-author message-self-name"},_hoisted_4$w={key:2,class:"sm-quote-line"},_hoisted_5$t={class:"sm-quote-icon","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_6$p=["d"],_hoisted_7$n={key:3,class:"sm-quote-line sm-quote-line--kind"},_hoisted_8$i=["fill","stroke","stroke-width"],_hoisted_9$f=["d"],_hoisted_10$e={key:2},_hoisted_11$d={key:4,class:"sm-quote-template"},_hoisted_12$b={key:0,class:"font-semibold"},_hoisted_13$8=["src"],_hoisted_14$7={key:2,class:"opacity-70"},_hoisted_15$7={key:5,class:"mt-3 flex justify-between px-3"},_hoisted_16$6={key:0,class:"sm-quote-media"},_sfc_main$J={__name:"MessageQuote",props:{message:{type:Object,required:!0},isMessage:{type:Boolean,default:!1},messageId:{type:String,required:!1,default:null},attendant:{type:[Object,null],required:!1,default:null},chatId:{type:String,required:!1,default:null}},emits:["go"],setup(ee,{emit:te}){const ne=te,ae=ee,re=/^https:\/\/[^\s/$.?#].[^\s]*$/i,oe={audio:{label:"",icon:null},image:{label:"Foto",icon:"image"},sticker:{label:"Figurinha",icon:"sticker"},video:{label:"Vídeo",icon:"video"},gif:{label:"GIF",icon:"video"},pdf:{label:"PDF",icon:"pdf"},file:{label:"Arquivo",icon:"file"}},ie=["M5 8c.6 0 1 .4 1 1v3a4 4 0 0 0 4 4h4a4 4 0 0 0 4-4V9a1 1 0 1 1 2 0v3a6 6 0 0 1-6 6h-1v2h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2v-2h-1a6 6 0 0 1-6-6V9c0-.6.4-1 1-1Z","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"],le={image:"M7.5 4.6A2 2 0 0 1 8.9 4h6.2c.5 0 1 .2 1.4.6L17.9 6H19a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8c0-1.1.9-2 2-2h1l1.5-1.4ZM10 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm2-4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z",sticker:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25z",video:"M19 3a2 2 0 0 1 2 2v2h-2V5.4L17.4 7h-2.8l2-2h-2.2l-2 2H9.6l2-2H9.4l-2 2H3V5c0-1.1.9-2 2-2h14ZM3 9v10c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V9H3Zm2-2.4L6.6 5H5v1.6ZM9.6 11a1 1 0 0 1 1 .1l4 3a1 1 0 0 1 0 1.6l-4 3A1 1 0 0 1 9 18v-6c0-.4.2-.7.6-.9Z",pdf:"M9 2.2V7H4.2l.4-.5 3.9-4 .5-.3Zm2-.2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7c0 1.1.9 2 2 2 0 1.1.9 2 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 1v5c0 .6.4 1 1 1h1.4a2.6 2.6 0 0 0 2.6-2.6v-1.8a2.6 2.6 0 0 0-2.6-2.6H11Zm1 5v-3h.4a.6.6 0 0 1 .6.6v1.8a.6.6 0 0 1-.6.6H12Zm5-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",file:"M9 2.2V7H4.2l.4-.5 3.9-4 .5-.3Zm2-.2v5a2 2 0 0 1-2 2H4v11c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-7Z"},ce=useMessageUiStore(),de=e$b.computed(()=>ce.deviceType),ue=e$b.computed(()=>{var Ve;return((Ve=ce.loggedAttendant)==null?void 0:Ve.name)??""}),ve=e$b.computed(()=>{var Ve;return((Ve=ae.message)==null?void 0:Ve.type)??""}),me=e$b.computed(()=>ve.value==="pdf"),ge=e$b.computed(()=>ve.value==="voice_call"),fe=e$b.computed(()=>{const Ve=ae.message;return isAudio(Ve)?"audio":isImage(Ve)?"image":isSticker(Ve)||isTgSticker(Ve)?"sticker":isVideo(Ve)?"video":isGif(Ve)?"gif":me.value?"pdf":"file"}),pe=e$b.computed(()=>fe.value==="audio"?null:le[oe[fe.value].icon]),_e=e$b.computed(()=>oe[fe.value].label),be=e$b.computed(()=>!!ve.value&&!ge.value),ke=e$b.computed(()=>["image","sticker","video","gif","pdf"].includes(fe.value)&&!!ve.value),$e=e$b.computed(()=>{var Ve;return{type:((Ve=ae.message)==null?void 0:Ve.type)||"document",content:ae.message||{}}}),ye=e$b.computed(()=>{var Re,Oe,Pe,Be,De;const Ve=ae.message||{},Te=ae.isMessage?((Re=ae.attendant)==null?void 0:Re.name)||((Oe=Ve==null?void 0:Ve.sender)==null?void 0:Oe.name):((Pe=Ve==null?void 0:Ve.sent_by)==null?void 0:Pe.name)||((Be=Ve==null?void 0:Ve.sender)==null?void 0:Be.name);return Te?(ae.isMessage||!!((De=Ve==null?void 0:Ve.sent_by)!=null&&De.name))&&Te===ue.value?"Você":Te:""}),Ee=e$b.computed(()=>{var Re;const Ve=Number((Re=ae.message)==null?void 0:Re.duration);if(!Number.isFinite(Ve)||Ve<0)return"00:00";const Te=Math.floor(Ve/60),ze=Math.floor(Ve%60);return`${String(Te).padStart(2,"0")}:${String(ze).padStart(2,"0")}`});function Se(Ve){return typeof Ve!="string"?!1:re.test(Ve.trim())}function Le(){ae.isMessage&&ne("go",ae.messageId,ae.chatId)}return(Ve,Te)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["sm-quote",[ee.isMessage?"sm-quote--reply":"sm-quote--composer header",!ee.isMessage&&de.value!=="web"?"mb-2 rounded-xl":"",!ee.isMessage&&de.value==="web"?"rounded-t-xl":""]])},[(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.isMessage?"button":"div"),{type:ee.isMessage?"button":void 0,class:"sm-quote-card",onClick:Le},{default:e$b.withCtx(()=>[e$b.createElementVNode("div",_hoisted_1$E,[ye.value?(e$b.openBlock(),e$b.createElementBlock("p",{key:0,class:"sm-quote-author message-sender-name",style:e$b.normalizeStyle(e$b.unref(senderColorStyle)(ye.value))},e$b.toDisplayString(ye.value),5)):e$b.createCommentVNode("",!0),ee.message.description?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$B,[ee.isMessage?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$y,"Você")):e$b.createCommentVNode("",!0),e$b.createVNode(MessageMarkdown,{content:ee.message.description},null,8,["content"])])):e$b.createCommentVNode("",!0),fe.value==="audio"?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_4$w,[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_5$t,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie,ze=>e$b.createElementVNode("path",{key:ze,d:ze},null,8,_hoisted_6$p)),64))])),e$b.createTextVNode(" "+e$b.toDisplayString(Ee.value),1)])):e$b.createCommentVNode("",!0),be.value?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$n,[pe.value?(e$b.openBlock(),e$b.createElementBlock("svg",{key:0,class:"sm-quote-icon","aria-hidden":"true",viewBox:"0 0 24 24",fill:fe.value==="sticker"?"none":"currentColor",stroke:fe.value==="sticker"?"currentColor":void 0,"stroke-width":fe.value==="sticker"?1.5:void 0,"stroke-linecap":"round","stroke-linejoin":"round"},[e$b.createElementVNode("path",{d:pe.value,"fill-rule":"evenodd","clip-rule":"evenodd"},null,8,_hoisted_9$f)],8,_hoisted_8$i)):e$b.createCommentVNode("",!0),ee.message.text?(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.text},null,8,["content"])):_e.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_10$e,e$b.toDisplayString(_e.value),1)):e$b.createCommentVNode("",!0)])):ee.message.template?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_11$d,[ee.message.template.header?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_12$b,[Se(ee.message.template.header)?(e$b.openBlock(),e$b.createElementBlock("img",{key:0,src:ee.message.template.header,class:"max-w-full h-auto rounded"},null,8,_hoisted_13$8)):(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.template.header},null,8,["content"]))])):e$b.createCommentVNode("",!0),ee.message.template.body?(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.template.body},null,8,["content"])):e$b.createCommentVNode("",!0),ee.message.template.footer?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_14$7,[e$b.createVNode(MessageMarkdown,{content:ee.message.template.footer},null,8,["content"])])):e$b.createCommentVNode("",!0)])):ge.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_15$7,[e$b.createVNode(_sfc_main$Q,{content:ee.message},null,8,["content"])])):(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:6,content:ee.message.text},null,8,["content"]))]),ke.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$6,[e$b.createVNode(MessageFileRenderer,{message:$e.value,variant:"thumbnail",interactive:!1,"show-caption":!1},null,8,["message"])])):e$b.createCommentVNode("",!0)]),_:1},8,["type"])),ee.isMessage?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("button",{key:0,class:"sm-quote-close",title:"Fechar",type:"button",onClick:Te[0]||(Te[0]=ze=>e$b.unref(ce).clearQuote())},[...Te[1]||(Te[1]=[e$b.createElementVNode("svg",{class:"size-5","aria-hidden":"true",viewBox:"0 0 24 24",fill:"none"},[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 18 6m0 12L6 6"})],-1)])]))],2))}},MessageQuote=_export_sfc$1(_sfc_main$J,[["__scopeId","data-v-5435c680"]]);function viewSingleImage(ee,te=""){ee&&N$3.show([{src:ee,type:"image",caption:te}])}const _hoisted_1$D={class:"mx-auto"},_hoisted_2$A={key:0,class:"mb-1 flex items-center opacity-95"},_hoisted_3$x={class:"mb-2 overflow-hidden max-h-[400px] rounded-md bg-base-300 dark:shadow-gray-500 relative"},_hoisted_4$v=["href"],_hoisted_5$s={key:0,class:"text-start"},_hoisted_6$o={key:1,class:"text-white font-normal hover:font-medium transition-all ease-in-out select-none"},_hoisted_7$m=["src"],_sfc_main$I={__name:"MessageAd",props:{message:{type:Object,required:!0},from_me:{type:Boolean,required:!0}},setup(ee){function te(ne){try{return ne.split("/")[2]}catch{return ne}}return(ne,ae)=>{var re,oe,ie,le,ce;return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$D,[(re=ee.message.ad_info)!=null&&re.sourceUrl?(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_2$A,[...ae[1]||(ae[1]=[e$b.createElementVNode("svg",{class:"mr-2 size-5 rotate-90","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.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$b.createElementVNode("p",{class:"italic"},"Enviada via anúncio",-1)])])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_3$x,[(oe=ee.message.ad_info)!=null&&oe.sourceUrl?(e$b.openBlock(),e$b.createElementBlock("a",{key:0,target:"_blank",rel:"noopener noreferrer",href:ee.message.ad_info.sourceUrl,class:e$b.normalizeClass([ee.from_me?"header":"bg-gray-900/80 dark:bg-primary/10","flex flex-col p-4 px-2 absolute bottom-0 w-full"])},[(ie=ee.message.ad_info)!=null&&ie.title?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_5$s,e$b.toDisplayString(ee.message.ad_info.title),1)):e$b.createCommentVNode("",!0),(le=ee.message.ad_info)!=null&&le.sourceUrl?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_6$o,e$b.toDisplayString(te(ee.message.ad_info.sourceUrl)),1)):e$b.createCommentVNode("",!0)],10,_hoisted_4$v)):e$b.createCommentVNode("",!0),(ce=ee.message.ad_info)!=null&&ce.thumbnailUrl?(e$b.openBlock(),e$b.createElementBlock("img",{key:1,class:"mx-auto cursor-pointer object-scale-down",src:ee.message.ad_info.thumbnailUrl,onClick:ae[0]||(ae[0]=de=>e$b.unref(viewSingleImage)(ee.message.ad_info.thumbnailUrl))},null,8,_hoisted_7$m)):e$b.createCommentVNode("",!0)]),e$b.createVNode(MessageMarkdown,{content:ee.message.text},null,8,["content"])])}}},_hoisted_1$C={class:"mx-auto mb-2"},_hoisted_2$z=["href"],_hoisted_3$w={class:"group relative overflow-hidden rounded-lg"},_hoisted_4$u=["src"],_hoisted_5$r={class:"italic text-white text-sm block"},_hoisted_6$n={class:"w-full mt-2 whitespace-pre-wrap break-words"},_sfc_main$H={__name:"MessageComment",props:{message:{type:Object,required:!0},from_me:{type:Boolean,required:!0}},setup(ee){const te=e$b.ref(!1),ne=()=>{te.value=!te.value};return(ae,re)=>{var oe,ie,le,ce,de;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.createElementVNode("div",_hoisted_1$C,[e$b.createElementVNode("a",{href:(oe=ee.message.post_info)==null?void 0:oe.permalink,target:"_blank",rel:"noopener noreferrer",class:"italic"}," Comentário de postagem ",8,_hoisted_2$z)]),e$b.createElementVNode("div",null,[e$b.createElementVNode("div",_hoisted_3$w,[e$b.createElementVNode("img",{class:"mx-auto cursor-pointer object-scale-down max-h-[600px] max-w-full",src:(ie=ee.message.post_info)==null?void 0:ie.thumbnail_url,onClick:re[0]||(re[0]=ue=>{var ve;return e$b.unref(viewSingleImage)((ve=ee.message.post_info)==null?void 0:ve.thumbnail_url)})},null,8,_hoisted_4$u),(le=ee.message.post_info)!=null&&le.caption?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:"absolute bottom-0 left-0 right-0 bg-black/60 p-2 cursor-pointer transition-all",onClick:e$b.withModifiers(ne,["stop"])},[e$b.createElementVNode("span",_hoisted_5$r,e$b.toDisplayString(te.value||ee.message.post_info.caption.length<=80?ee.message.post_info.caption:ee.message.post_info.caption.slice(0,80)+"..."),1)])):e$b.createCommentVNode("",!0),((de=(ce=ee.message.post_info)==null?void 0:ce.caption)==null?void 0:de.length)>80?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:"absolute bottom-1 right-1 flex items-center justify-center text-white bg-black/60 rounded-full w-6 h-6 cursor-pointer shadow-md hover:shadow-lg hover:bg-black border border-white/40 transition-all duration-200 z-10",onClick:e$b.withModifiers(ne,["stop"])},[(e$b.openBlock(),e$b.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2.5",stroke:"currentColor",class:e$b.normalizeClass(["size-4 transition-transform duration-300 drop-shadow-sm",te.value?"rotate-180":""])},[...re[1]||(re[1]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"},null,-1)])],2))])):e$b.createCommentVNode("",!0)]),e$b.createElementVNode("div",_hoisted_6$n,e$b.toDisplayString(ee.message.text),1)])],64)}}};let element=null,detach=null,peaks=null,peaksDuration=0;function forgetPeaks(){peaks=null,peaksDuration=0}function hardStop(ee){if(ee)try{ee.pause();const te=ee.currentSrc||ee.src||"";ee.removeAttribute("src"),ee.load(),te.startsWith("blob:")&&URL.revokeObjectURL(te)}catch{}}const useAudioPlaybackStore=pinia.defineStore("smClickAudioPlayback",{state:()=>({trackId:null,meta:null,isPlaying:!1,currentTime:0,duration:0,rate:1,mountedIds:[]}),getters:{hasTrack:ee=>!!ee.trackId,isFloating:ee=>!!ee.trackId&&!ee.mountedIds.includes(ee.trackId),progress:ee=>ee.duration>0?ee.currentTime/ee.duration:0},actions:{isActive(ee){return!!ee&&this.trackId===ee},activeElement(){return element},activeSrc(){return(element==null?void 0:element.currentSrc)||(element==null?void 0:element.src)||""},setPeaks(ee,te,ne){!this.isActive(ee)||!te||(peaks=te,peaksDuration=ne||this.duration||0)},activePeaks(){return!peaks||!peaksDuration?null:{peaks,duration:peaksDuration}},acquire(ee){return ee&&!this.mountedIds.includes(ee)&&this.mountedIds.push(ee),ee&&this.trackId===ee&&element?element:new Audio},claim(ee,te,ne=null){!ee||!te||(element&&element!==te&&(this.unbind(),this.mountedIds.includes(this.trackId)?element.pause():hardStop(element)),element=te,forgetPeaks(),this.trackId=ee,this.meta=ne||null,this.duration=Number.isFinite(te.duration)?te.duration:0,this.currentTime=te.currentTime||0,this.rate=te.playbackRate||1,this.bind(te))},setMeta(ee,te){this.isActive(ee)&&(this.meta=te||null)},release(ee,te){if(this.mountedIds=this.mountedIds.filter(ne=>ne!==ee),te&&te!==element){hardStop(te);return}element&&(element.paused||element.ended)&&this.clear()},bind(ee){this.unbind();const te=()=>{this.currentTime=ee.currentTime||0},ne=()=>{this.duration=Number.isFinite(ee.duration)?ee.duration:0},ae=()=>{this.isPlaying=!0},re=()=>{this.isPlaying=!1},oe=()=>{this.isPlaying=!1,this.currentTime=0,this.mountedIds.includes(this.trackId)||this.clear()},ie=()=>{this.rate=ee.playbackRate||1};ee.addEventListener("timeupdate",te),ee.addEventListener("loadedmetadata",ne),ee.addEventListener("durationchange",ne),ee.addEventListener("play",ae),ee.addEventListener("pause",re),ee.addEventListener("ended",oe),ee.addEventListener("ratechange",ie),detach=()=>{ee.removeEventListener("timeupdate",te),ee.removeEventListener("loadedmetadata",ne),ee.removeEventListener("durationchange",ne),ee.removeEventListener("play",ae),ee.removeEventListener("pause",re),ee.removeEventListener("ended",oe),ee.removeEventListener("ratechange",ie)},this.isPlaying=!ee.paused&&!ee.ended},unbind(){detach&&detach(),detach=null},toggle(){element&&(element.paused||element.ended?element.play().catch(()=>{}):element.pause())},play(){var ee;(ee=element==null?void 0:element.play)==null||ee.call(element).catch(()=>{})},pause(){var ee;(ee=element==null?void 0:element.pause)==null||ee.call(element)},seek(ee){if(!element)return;const te=Number.isFinite(element.duration)?element.duration:0;element.currentTime=Math.max(0,Math.min(ee,te||ee)),this.currentTime=element.currentTime},setRate(ee){element&&(element.playbackRate=ee,this.rate=ee)},clear(){this.unbind(),hardStop(element),element=null,forgetPeaks(),this.trackId=null,this.meta=null,this.isPlaying=!1,this.currentTime=0,this.duration=0,this.rate=1}}});function detachSharedMedia(ee,te,ne){var ae,re;if(!(!ee||!te||ee.media!==te)&&ne.activeElement()===te){try{(ae=ee.unAll)==null||ae.call(ee)}catch{}try{(re=ee.subscriptions)==null||re.forEach(oe=>oe==null?void 0:oe())}catch{}try{ee.media=new Audio}catch{}}}function attachSharedMedia(ee,te,{rate:ne=1}={}){var ae,re,oe,ie,le;if(!ee||!te)return null;try{ee.media=te,(ae=ee.initPlayerEvents)==null||ae.call(ee),(re=ee.setPlaybackRate)==null||re.call(ee,ne),te.paused||(ie=(oe=ee.timer)==null?void 0:oe.start)==null||ie.call(oe)}catch(ce){return console.error("Falha ao religar áudio em reprodução:",ce),null}return{duration:((le=ee.getDuration)==null?void 0:le.call(ee))||0,currentTime:te.currentTime||0,isPlaying:!te.paused&&!te.ended}}function resolveColor(ee,te){if(!ee||!te||!ee.includes("color-mix("))return ee;const ne=document.createElement("span");ne.style.cssText="position:absolute;inline-size:0;block-size:0;visibility:hidden",ne.style.color=ee,te.appendChild(ne);const ae=getComputedStyle(ne).color;return ne.remove(),ae||ee}function readWaveColors(ee){const te={wave:"rgba(148, 163, 184, 0.5)",progress:"#0ea5e9",cursor:"#ffffff"};if(!ee)return te;const ne=getComputedStyle(ee),ae=(re,oe)=>resolveColor(ne.getPropertyValue(re).trim(),ee)||oe;return{wave:ae("--audio-wave",te.wave),progress:ae("--audio-progress",te.progress),cursor:ae("--audio-cursor",te.cursor)}}const _hoisted_1$B=["aria-pressed","aria-label","onKeydown"],_hoisted_2$y={key:1,class:"size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},_hoisted_3$v={class:"relative flex h-10 min-w-0 flex-1 items-center"},_hoisted_4$t=["aria-label"],BAR_WIDTH=3,BAR_GAP=3,_sfc_main$G={__name:"MessageAudio",props:{audio:{type:String,required:!0},isOwner:{type:Boolean,default:!1},trackId:{type:[String,Number],default:null},trackMeta:{type:Object,default:null},height:{type:Number,default:40},barWidth:{type:Number,default:3},barRadius:{type:Number,default:3},barHeight:{type:Number,default:.85},barGap:{type:Number,default:2},fullWidth:{type:Boolean,default:!1},minWidth:{type:String,default:"200px"},prefWidth:{type:String,default:"37vw"},maxWidth:{type:String,default:"300px"},onlyOneAtATime:{type:Boolean,default:!0}},emits:["duration","currentTime"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.computed(()=>ne.fullWidth?{inlineSize:"100%",minInlineSize:ne.minWidth}:{inlineSize:`clamp(${ne.minWidth}, ${ne.prefWidth}, ${ne.maxWidth})`,minInlineSize:"0"}),oe=e$b.ref(null),ie=e$b.ref(null);let le=null,ce=null,de=null;const ue=useAudioPlaybackStore(),ve=e$b.computed(()=>ne.trackId!=null&&ne.trackId!==""),me=e$b.ref(!1),ge=e$b.ref(!0),fe=e$b.ref(0),pe=e$b.ref(0),_e=e$b.ref(1),be=/^data:(audio\/[^,;]+(?:;[^,;=]+=[^,;]+)*);base64,/,ke=je=>typeof je=="string"&&be.test(je),$e=je=>typeof je=="string"&&je.length>=16&&/^[A-Za-z0-9+/=\s]+$/.test(je)&&je.length%4===0;function ye(je,We="audio/mp3"){var yt;const Ge=(yt=je.match(be))==null?void 0:yt[1],Ke=je.includes(",")?je.slice(je.indexOf(",")+1):je,et=Uint8Array.from(atob(Ke),Et=>Et.charCodeAt(0));return new Blob([et],{type:Ge||We})}function Ee(){var je,We;detachSharedMedia(le,ce,ue);try{(je=le==null?void 0:le.unAll)==null||je.call(le)}catch{}try{(We=le==null?void 0:le.destroy)==null||We.call(le)}catch{}le=null}async function Se(){if(!ie.value)return;Ee();const je=ve.value&&ue.isActive(ne.trackId)&&!!ue.activeElement();ve.value?ce=ue.acquire(ne.trackId):ce||(ce=new Audio);const We=readWaveColors(oe.value);le=w$5.create({container:ie.value,media:je?new Audio:ce,waveColor:We.wave,progressColor:We.progress,cursorColor:We.cursor,cursorWidth:12,height:ne.height,barWidth:ne.barWidth,barRadius:ne.barRadius,barHeight:ne.barHeight,barGap:ne.barGap,hideScrollbar:!0}),le.on("ready",()=>{fe.value=le.getDuration(),ae("duration",fe.value),ge.value=!1,le.setPlaybackRate(_e.value),Ve()}),le.on("error",Ge=>{ge.value=!1,console.error("Falha ao carregar áudio:",Ge)}),le.on("play",()=>{if(me.value=!0,ne.onlyOneAtATime&&!ve.value){const Ge=window.__activeWSInstance;if(Ge&&Ge!==le)try{Ge.pause()}catch{}window.__activeWSInstance=le}}),le.on("pause",()=>{me.value=!1,window.__activeWSInstance===le&&(window.__activeWSInstance=null)}),le.on("finish",()=>{me.value=!1,window.__activeWSInstance===le&&(window.__activeWSInstance=null)}),le.on("audioprocess",()=>{pe.value=le.getCurrentTime(),ae("currentTime",pe.value)}),le.on("seek",()=>{pe.value=le.getCurrentTime(),ae("currentTime",pe.value)}),ie.value.addEventListener("pointerdown",De),je&&(_e.value=ue.rate||1),await Te(ne.audio),je&&Le()}function Le(){const je=attachSharedMedia(le,ce,{rate:_e.value});je&&(fe.value=je.duration||ue.duration,pe.value=je.currentTime,me.value=je.isPlaying)}function Ve(){if(!(!ve.value||!ue.isActive(ne.trackId)))try{ue.setPeaks(ne.trackId,le.exportPeaks(),le.getDuration())}catch{}}async function Te(je){if(le){ge.value=!0;try{ke(je)||$e(je)?await le.loadBlob(ye(je)):await le.load(je)}catch{try{await le.load(je)}catch(We){console.error("Falha ao carregar áudio:",We),ge.value=!1}}}}function ze(){le&&(ve.value&&!ue.isActive(ne.trackId)&&(ue.claim(ne.trackId,ce,ne.trackMeta),ue.setRate(_e.value),Ve()),le.playPause())}function Re(){var je;_e.value=_e.value>=2?1:+(_e.value+.5).toFixed(1),(je=le==null?void 0:le.setPlaybackRate)==null||je.call(le,_e.value),ve.value&&ue.isActive(ne.trackId)&&ue.setRate(_e.value)}let Oe=!1;function Pe(je){var et,yt;const We=(yt=(et=ie.value)==null?void 0:et.getBoundingClientRect)==null?void 0:yt.call(et);if(!We)return null;const Ke=(("touches"in je?je.touches[0].clientX:je.clientX)-We.left)/We.width;return Math.max(0,Math.min(1,Ke))}function Be(je){var Ge;const We=Pe(je);We!=null&&((Ge=le==null?void 0:le.seekTo)==null||Ge.call(le,We))}function De(je){Oe=!0,Be(je),window.addEventListener("pointermove",Ne,{passive:!0}),window.addEventListener("pointerup",Me,{passive:!0})}function Ne(je){Oe&&Be(je)}function Me(){Oe=!1,window.removeEventListener("pointermove",Ne),window.removeEventListener("pointerup",Me)}let we=null;function Ce(){var We;if(!le||!oe.value)return;const je=readWaveColors(oe.value);(We=le.setOptions)==null||We.call(le,{waveColor:je.wave,progressColor:je.progress,cursorColor:je.cursor})}const Fe=e$b.ref(null),Ie=e$b.ref(20);let Ue=null;const qe=je=>({animationDelay:`-${(1.2-je%8*.1).toFixed(2)}s`});return e$b.onMounted(async()=>{await e$b.nextTick(),await Se();const je=()=>{if(!Fe.value)return;const Ge=Fe.value.clientWidth;Ie.value=Math.floor(Ge/(BAR_WIDTH+BAR_GAP))};e$b.watch(ge,Ge=>{Ge?e$b.nextTick(()=>{Fe.value&&!Ue&&(je(),Ue=new ResizeObserver(je),Ue.observe(Fe.value))}):Ue&&(Ue.disconnect(),Ue=null)},{immediate:!0});const We=async()=>{var Ke,et;if(!le)return;const Ge=((Ke=le.getCurrentTime)==null?void 0:Ke.call(le))??0;await Se();try{(et=le.seekTo)==null||et.call(le,Ge/(fe.value||1))}catch{}};window.addEventListener("resize",We),de=We,we=new MutationObserver(Ce),we.observe(document.documentElement,{attributeFilter:["class","style"]})}),e$b.onBeforeUnmount(()=>{var je;Ue&&Ue.disconnect(),we&&we.disconnect();try{window.removeEventListener("resize",de)}catch{}try{(je=ie.value)==null||je.removeEventListener("pointerdown",De)}catch{}if(Ee(),ve.value)ue.release(ne.trackId,ce);else if(ce)try{ce.pause(),ce.removeAttribute("src"),ce.load()}catch{}ce=null}),e$b.watch(()=>ne.audio,je=>{je&&Te(je)}),e$b.watch(_e,je=>{var We;return(We=le==null?void 0:le.setPlaybackRate)==null?void 0:We.call(le,je)}),e$b.watch(()=>ve.value?ue.isPlaying:null,je=>{je===null||!ue.isActive(ne.trackId)||(me.value=je)}),e$b.watch(()=>ne.trackMeta,je=>{ve.value&&ue.setMeta(ne.trackId,je)}),(je,We)=>(e$b.openBlock(),e$b.createElementBlock("div",{ref_key:"rootEl",ref:oe,class:e$b.normalizeClass(["audio-row flex min-w-0 max-w-full select-none items-center gap-2.5",ee.isOwner?"ms-auto":"me-auto"]),style:e$b.normalizeStyle(re.value)},[e$b.createElementVNode("button",{type:"button",class:"audio-play grid size-10 shrink-0 place-items-center rounded-full transition focus:outline-none focus-visible:ring-2 focus-visible:ring-current","aria-pressed":me.value?"true":"false","aria-label":me.value?"Pausar":"Tocar",onClick:ze,onKeydown:e$b.withKeys(e$b.withModifiers(ze,["prevent"]),["space"])},[me.value?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$y,[...We[1]||(We[1]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H8Zm7 0a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-1Z","clip-rule":"evenodd"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",{key:0,class:e$b.normalizeClass(["size-5 translate-x-px",{"animate-pulse":ge.value}]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...We[0]||(We[0]=[e$b.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"},null,-1)])],2))],40,_hoisted_1$B),e$b.createElementVNode("div",_hoisted_3$v,[ge.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"loaderContainerEl",ref:Fe,class:"loading-equalizer"},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(Ie.value,Ge=>(e$b.openBlock(),e$b.createElementBlock("span",{key:Ge,style:e$b.normalizeStyle(qe(Ge))},null,4))),128))],512)):e$b.createCommentVNode("",!0),e$b.withDirectives(e$b.createElementVNode("div",{ref_key:"waveEl",ref:ie,class:"ws-surface block size-full min-w-0 cursor-pointer"},null,512),[[e$b.vShow,!ge.value]])]),e$b.withDirectives(e$b.createElementVNode("button",{type:"button",class:"audio-rate shrink-0 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-5 transition","aria-label":`Velocidade ${_e.value.toFixed(1)}x. Clique para mudar`,onClick:Re},e$b.toDisplayString(_e.value.toFixed(1))+"x ",9,_hoisted_4$t),[[e$b.vShow,me.value]])],6))}},MessageAudio=_export_sfc$1(_sfc_main$G,[["__scopeId","data-v-3befd007"]]),_hoisted_1$A={class:"relative"},_hoisted_2$x={key:0,class:"relative"},_hoisted_3$u={key:1,class:"relative h-[200px] w-full lg:w-[300px] rounded-lg bg-base-200 border border-base-300 overflow-hidden"},MAX_FILE_SIZE=7*1024*1024,_sfc_main$F={__name:"MessageFileLoading",props:{message:{type:Object,required:!0}},setup(ee){const te=ee,ne=e$b.computed(()=>{var oe;const ae=(oe=te.message)==null?void 0:oe.content;return ae!=null&&ae.data64?Math.ceil(ae.data64.length/1.33)<=MAX_FILE_SIZE:!1});return(ae,re)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$A,[ne.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$x,[e$b.createVNode(MessageFileRenderer,{message:ee.message},null,8,["message"]),re[0]||(re[0]=e$b.createStaticVNode('<div class="pointer-events-none absolute inset-0 flex flex-col items-center justify-center rounded-md bg-black/30"><div class="loader-dots relative mx-auto block h-5 w-20"><div class="absolute left-0 top-0 mt-1 size-3 animate-loader rounded-full bg-white"></div><div class="absolute left-0 top-0 mt-1 size-3 animate-loader rounded-full bg-white [animation-delay:.2s]"></div><div class="absolute left-0 top-0 mt-1 size-3 animate-loader rounded-full bg-white [animation-delay:.4s]"></div></div><p class="mt-2 text-sm font-medium text-white">Enviando...</p></div>',1))])):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_3$u,[...re[1]||(re[1]=[e$b.createStaticVNode('<div class="absolute inset-0 opacity-30 dark:opacity-20"><div class="absolute top-0 left-0 w-32 h-32 bg-primary rounded-full blur-3xl animate-pulse"></div><div class="absolute bottom-0 right-0 w-40 h-40 bg-primary rounded-full blur-3xl animate-pulse [animation-delay:.5s]"></div></div><div class="relative h-full flex flex-col items-center justify-center gap-4 p-6"><div class="rounded-full bg-base-100 p-4 ring-2 ring-primary backdrop-blur-sm"><svg class="size-10 text-primary animate-bounce" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16.88 9.1A4 4 0 0 1 16 17H5a5 5 0 0 1-1-9.9V7a3 3 0 0 1 4.52-2.59A4.98 4.98 0 0 1 17 8c0 .38-.04.74-.12 1.1zM11 11h3l-4-4-4 4h3v3h2v-3z"></path></svg></div><div class="flex flex-col items-center gap-3"><p class="text-sm font-semibold">Enviando arquivo</p><div class="flex items-center gap-1.5"><div class="size-2 rounded-full bg-primary animate-bounce"></div><div class="size-2 rounded-full bg-primary animate-bounce [animation-delay:.1s]"></div><div class="size-2 rounded-full bg-primary animate-bounce [animation-delay:.2s]"></div></div></div></div>',2)])]))]))}},_hoisted_1$z=["data-group-items"],_hoisted_2$w={class:"flex size-5 cursor-pointer items-center justify-center rounded border-2 transition-colors border-gray-400 dark:bg-gray-500/60 dark:border-gray-600 hover:border-primary"},_hoisted_3$t={key:0,class:"size-3.5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_hoisted_4$s=["id","onClick"],_hoisted_5$q=["onClick"],_hoisted_6$m={key:0,class:"size-3.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_hoisted_7$l={key:1,class:"absolute inset-0 flex items-center justify-center bg-black/60 text-xl font-semibold text-white"},_hoisted_8$h={class:"pointer-events-none absolute inset-0 bg-black/30 opacity-0 transition-opacity group-hover:opacity-100"},_hoisted_9$e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute left-2 top-2 size-6",style:{transform:"rotate(135deg)"}},_hoisted_10$d={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute right-2 top-2 size-6",style:{transform:"rotate(-135deg)"}},_hoisted_11$c={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute bottom-2 left-2 size-6",style:{transform:"rotate(45deg)"}},_hoisted_12$a={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute bottom-2 right-2 size-6",style:{transform:"rotate(-45deg)"}},_hoisted_13$7={key:0,class:"pt-1"},_sfc_main$E={__name:"MessageGroupMedia",props:{message:{type:Object,required:!0}},emits:["expand"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useMessageUiStore(),oe=e$b.computed(()=>{var ge;return(((ge=ne.message)==null?void 0:ge.items)||[]).slice(0,4)}),ie=e$b.computed(()=>{var ge,fe;return Math.max((((fe=(ge=ne.message)==null?void 0:ge.items)==null?void 0:fe.length)||0)-4,0)}),le=e$b.computed(()=>{var ge;return(((ge=ne.message)==null?void 0:ge.items)||[]).map(fe=>fe==null?void 0:fe.id).filter(fe=>fe!=null&&fe!=="")}),ce=e$b.computed(()=>le.value.join(" ")),de=e$b.ref(null);function ue(ge){var _e,be;const fe=String(((_e=ge==null?void 0:ge.detail)==null?void 0:_e.itemId)??"");if(!fe)return;const pe=(((be=ne.message)==null?void 0:be.items)||[]).findIndex(ke=>String(ke==null?void 0:ke.id)===fe);pe>=0&&ae("expand",pe)}e$b.onMounted(()=>{var ge;return(ge=de.value)==null?void 0:ge.addEventListener("open-package-item",ue)}),e$b.onBeforeUnmount(()=>{var ge;return(ge=de.value)==null?void 0:ge.removeEventListener("open-package-item",ue)});function ve(ge){return ge?re.isMessageSelected(ge):!1}function me(ge){var fe;return{id:ge==null?void 0:ge.id,type:(ge==null?void 0:ge.type)||((fe=ge==null?void 0:ge.content)==null?void 0:fe.type)||"image",content:{...ge==null?void 0:ge.content}}}return(ge,fe)=>{var pe,_e;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.createElementVNode("div",{ref_key:"rootEl",ref:de,class:"relative grid grid-cols-2 gap-[2px] text-white","data-group-items":ce.value},[e$b.unref(re).forwardMode.active?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:"absolute left-1 top-1 z-10",onClick:fe[0]||(fe[0]=e$b.withModifiers(be=>e$b.unref(re).togglePackageSelection(le.value),["stop"]))},[e$b.createElementVNode("div",_hoisted_2$w,[(ee.message.items||[]).some(be=>ve(be.id))?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$t,[...fe[1]||(fe[1]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):e$b.createCommentVNode("",!0)])])):e$b.createCommentVNode("",!0),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(oe.value,(be,ke)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:be.id||ke,id:String(be.id||ke),class:"group relative aspect-square max-h-[250px] w-full cursor-pointer overflow-hidden rounded-lg",onClick:$e=>ae("expand",ke)},[e$b.createVNode(MessageFileRenderer,{message:me(be),variant:"thumbnail","show-caption":!1,interactive:!1},null,8,["message"]),e$b.unref(re).forwardMode.active?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,"aria-label":"Selecionar mídia",class:e$b.normalizeClass(["absolute left-1 top-1 z-10 flex size-5 cursor-pointer items-center justify-center rounded border-2 bg-black/40 transition-colors",ve(be.id)?"border-primary":"border-gray-400 hover:border-primary"]),onClick:e$b.withModifiers($e=>e$b.unref(re).toggleMessageSelection(be.id),["stop"])},[ve(be.id)?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_6$m,[...fe[2]||(fe[2]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):e$b.createCommentVNode("",!0)],10,_hoisted_5$q)):e$b.createCommentVNode("",!0),ke===3&&ie.value>0?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$l," +"+e$b.toDisplayString(ie.value),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_8$h,[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_9$e,[...fe[3]||(fe[3]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_10$d,[...fe[4]||(fe[4]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_11$c,[...fe[5]||(fe[5]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_12$a,[...fe[6]||(fe[6]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])],8,_hoisted_4$s))),128))],8,_hoisted_1$z),(pe=ee.message.content)!=null&&pe.caption?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_13$7,[e$b.createVNode(MessageMarkdown,{content:(_e=ee.message.content)==null?void 0:_e.caption},null,8,["content"])])):e$b.createCommentVNode("",!0)],64)}}};var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(ee){return ee&&ee.__esModule&&Object.prototype.hasOwnProperty.call(ee,"default")?ee.default:ee}var leafletSrc={exports:{}};/* @preserve
|
|
279
279
|
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
|
280
280
|
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
|
281
281
|
*/(function(ee,te){(function(ne,ae){ae(te)})(commonjsGlobal,function(ne){var ae="1.9.4";function re(se){var he,xe,Ae,He;for(xe=1,Ae=arguments.length;xe<Ae;xe++){He=arguments[xe];for(he in He)se[he]=He[he]}return se}var oe=Object.create||function(){function se(){}return function(he){return se.prototype=he,new se}}();function ie(se,he){var xe=Array.prototype.slice;if(se.bind)return se.bind.apply(se,xe.call(arguments,1));var Ae=xe.call(arguments,2);return function(){return se.apply(he,Ae.length?Ae.concat(xe.call(arguments)):arguments)}}var le=0;function ce(se){return"_leaflet_id"in se||(se._leaflet_id=++le),se._leaflet_id}function de(se,he,xe){var Ae,He,Xe,ot;return ot=function(){Ae=!1,He&&(Xe.apply(xe,He),He=!1)},Xe=function(){Ae?He=arguments:(se.apply(xe,arguments),setTimeout(ot,he),Ae=!0)},Xe}function ue(se,he,xe){var Ae=he[1],He=he[0],Xe=Ae-He;return se===Ae&&xe?se:((se-He)%Xe+Xe)%Xe+He}function ve(){return!1}function me(se,he){if(he===!1)return se;var xe=Math.pow(10,he===void 0?6:he);return Math.round(se*xe)/xe}function ge(se){return se.trim?se.trim():se.replace(/^\s+|\s+$/g,"")}function fe(se){return ge(se).split(/\s+/)}function pe(se,he){Object.prototype.hasOwnProperty.call(se,"options")||(se.options=se.options?oe(se.options):{});for(var xe in he)se.options[xe]=he[xe];return se.options}function _e(se,he,xe){var Ae=[];for(var He in se)Ae.push(encodeURIComponent(xe?He.toUpperCase():He)+"="+encodeURIComponent(se[He]));return(!he||he.indexOf("?")===-1?"?":"&")+Ae.join("&")}var be=/\{ *([\w_ -]+) *\}/g;function ke(se,he){return se.replace(be,function(xe,Ae){var He=he[Ae];if(He===void 0)throw new Error("No value provided for variable "+xe);return typeof He=="function"&&(He=He(he)),He})}var $e=Array.isArray||function(se){return Object.prototype.toString.call(se)==="[object Array]"};function ye(se,he){for(var xe=0;xe<se.length;xe++)if(se[xe]===he)return xe;return-1}var Ee="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Se(se){return window["webkit"+se]||window["moz"+se]||window["ms"+se]}var Le=0;function Ve(se){var he=+new Date,xe=Math.max(0,16-(he-Le));return Le=he+xe,window.setTimeout(se,xe)}var Te=window.requestAnimationFrame||Se("RequestAnimationFrame")||Ve,ze=window.cancelAnimationFrame||Se("CancelAnimationFrame")||Se("CancelRequestAnimationFrame")||function(se){window.clearTimeout(se)};function Re(se,he,xe){if(xe&&Te===Ve)se.call(he);else return Te.call(window,ie(se,he))}function Oe(se){se&&ze.call(window,se)}var Pe={__proto__:null,extend:re,create:oe,bind:ie,get lastId(){return le},stamp:ce,throttle:de,wrapNum:ue,falseFn:ve,formatNum:me,trim:ge,splitWords:fe,setOptions:pe,getParamString:_e,template:ke,isArray:$e,indexOf:ye,emptyImageUrl:Ee,requestFn:Te,cancelFn:ze,requestAnimFrame:Re,cancelAnimFrame:Oe};function Be(){}Be.extend=function(se){var he=function(){pe(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},xe=he.__super__=this.prototype,Ae=oe(xe);Ae.constructor=he,he.prototype=Ae;for(var He in this)Object.prototype.hasOwnProperty.call(this,He)&&He!=="prototype"&&He!=="__super__"&&(he[He]=this[He]);return se.statics&&re(he,se.statics),se.includes&&(De(se.includes),re.apply(null,[Ae].concat(se.includes))),re(Ae,se),delete Ae.statics,delete Ae.includes,Ae.options&&(Ae.options=xe.options?oe(xe.options):{},re(Ae.options,se.options)),Ae._initHooks=[],Ae.callInitHooks=function(){if(!this._initHooksCalled){xe.callInitHooks&&xe.callInitHooks.call(this),this._initHooksCalled=!0;for(var Xe=0,ot=Ae._initHooks.length;Xe<ot;Xe++)Ae._initHooks[Xe].call(this)}},he},Be.include=function(se){var he=this.prototype.options;return re(this.prototype,se),se.options&&(this.prototype.options=he,this.mergeOptions(se.options)),this},Be.mergeOptions=function(se){return re(this.prototype.options,se),this},Be.addInitHook=function(se){var he=Array.prototype.slice.call(arguments,1),xe=typeof se=="function"?se:function(){this[se].apply(this,he)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(xe),this};function De(se){if(!(typeof L>"u"||!L||!L.Mixin)){se=$e(se)?se:[se];for(var he=0;he<se.length;he++)se[he]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Ne={on:function(se,he,xe){if(typeof se=="object")for(var Ae in se)this._on(Ae,se[Ae],he);else{se=fe(se);for(var He=0,Xe=se.length;He<Xe;He++)this._on(se[He],he,xe)}return this},off:function(se,he,xe){if(!arguments.length)delete this._events;else if(typeof se=="object")for(var Ae in se)this._off(Ae,se[Ae],he);else{se=fe(se);for(var He=arguments.length===1,Xe=0,ot=se.length;Xe<ot;Xe++)He?this._off(se[Xe]):this._off(se[Xe],he,xe)}return this},_on:function(se,he,xe,Ae){if(typeof he!="function"){console.warn("wrong listener type: "+typeof he);return}if(this._listens(se,he,xe)===!1){xe===this&&(xe=void 0);var He={fn:he,ctx:xe};Ae&&(He.once=!0),this._events=this._events||{},this._events[se]=this._events[se]||[],this._events[se].push(He)}},_off:function(se,he,xe){var Ae,He,Xe;if(this._events&&(Ae=this._events[se],!!Ae)){if(arguments.length===1){if(this._firingCount)for(He=0,Xe=Ae.length;He<Xe;He++)Ae[He].fn=ve;delete this._events[se];return}if(typeof he!="function"){console.warn("wrong listener type: "+typeof he);return}var ot=this._listens(se,he,xe);if(ot!==!1){var ft=Ae[ot];this._firingCount&&(ft.fn=ve,this._events[se]=Ae=Ae.slice()),Ae.splice(ot,1)}}},fire:function(se,he,xe){if(!this.listens(se,xe))return this;var Ae=re({},he,{type:se,target:this,sourceTarget:he&&he.sourceTarget||this});if(this._events){var He=this._events[se];if(He){this._firingCount=this._firingCount+1||1;for(var Xe=0,ot=He.length;Xe<ot;Xe++){var ft=He[Xe],gt=ft.fn;ft.once&&this.off(se,gt,ft.ctx),gt.call(ft.ctx||this,Ae)}this._firingCount--}}return xe&&this._propagateEvent(Ae),this},listens:function(se,he,xe,Ae){typeof se!="string"&&console.warn('"string" type argument expected');var He=he;typeof he!="function"&&(Ae=!!he,He=void 0,xe=void 0);var Xe=this._events&&this._events[se];if(Xe&&Xe.length&&this._listens(se,He,xe)!==!1)return!0;if(Ae){for(var ot in this._eventParents)if(this._eventParents[ot].listens(se,he,xe,Ae))return!0}return!1},_listens:function(se,he,xe){if(!this._events)return!1;var Ae=this._events[se]||[];if(!he)return!!Ae.length;xe===this&&(xe=void 0);for(var He=0,Xe=Ae.length;He<Xe;He++)if(Ae[He].fn===he&&Ae[He].ctx===xe)return He;return!1},once:function(se,he,xe){if(typeof se=="object")for(var Ae in se)this._on(Ae,se[Ae],he,!0);else{se=fe(se);for(var He=0,Xe=se.length;He<Xe;He++)this._on(se[He],he,xe,!0)}return this},addEventParent:function(se){return this._eventParents=this._eventParents||{},this._eventParents[ce(se)]=se,this},removeEventParent:function(se){return this._eventParents&&delete this._eventParents[ce(se)],this},_propagateEvent:function(se){for(var he in this._eventParents)this._eventParents[he].fire(se.type,re({layer:se.target,propagatedFrom:se.target},se),!0)}};Ne.addEventListener=Ne.on,Ne.removeEventListener=Ne.clearAllEventListeners=Ne.off,Ne.addOneTimeEventListener=Ne.once,Ne.fireEvent=Ne.fire,Ne.hasEventListeners=Ne.listens;var Me=Be.extend(Ne);function we(se,he,xe){this.x=xe?Math.round(se):se,this.y=xe?Math.round(he):he}var Ce=Math.trunc||function(se){return se>0?Math.floor(se):Math.ceil(se)};we.prototype={clone:function(){return new we(this.x,this.y)},add:function(se){return this.clone()._add(Fe(se))},_add:function(se){return this.x+=se.x,this.y+=se.y,this},subtract:function(se){return this.clone()._subtract(Fe(se))},_subtract:function(se){return this.x-=se.x,this.y-=se.y,this},divideBy:function(se){return this.clone()._divideBy(se)},_divideBy:function(se){return this.x/=se,this.y/=se,this},multiplyBy:function(se){return this.clone()._multiplyBy(se)},_multiplyBy:function(se){return this.x*=se,this.y*=se,this},scaleBy:function(se){return new we(this.x*se.x,this.y*se.y)},unscaleBy:function(se){return new we(this.x/se.x,this.y/se.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Ce(this.x),this.y=Ce(this.y),this},distanceTo:function(se){se=Fe(se);var he=se.x-this.x,xe=se.y-this.y;return Math.sqrt(he*he+xe*xe)},equals:function(se){return se=Fe(se),se.x===this.x&&se.y===this.y},contains:function(se){return se=Fe(se),Math.abs(se.x)<=Math.abs(this.x)&&Math.abs(se.y)<=Math.abs(this.y)},toString:function(){return"Point("+me(this.x)+", "+me(this.y)+")"}};function Fe(se,he,xe){return se instanceof we?se:$e(se)?new we(se[0],se[1]):se==null?se:typeof se=="object"&&"x"in se&&"y"in se?new we(se.x,se.y):new we(se,he,xe)}function Ie(se,he){if(se)for(var xe=he?[se,he]:se,Ae=0,He=xe.length;Ae<He;Ae++)this.extend(xe[Ae])}Ie.prototype={extend:function(se){var he,xe;if(!se)return this;if(se instanceof we||typeof se[0]=="number"||"x"in se)he=xe=Fe(se);else if(se=Ue(se),he=se.min,xe=se.max,!he||!xe)return this;return!this.min&&!this.max?(this.min=he.clone(),this.max=xe.clone()):(this.min.x=Math.min(he.x,this.min.x),this.max.x=Math.max(xe.x,this.max.x),this.min.y=Math.min(he.y,this.min.y),this.max.y=Math.max(xe.y,this.max.y)),this},getCenter:function(se){return Fe((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,se)},getBottomLeft:function(){return Fe(this.min.x,this.max.y)},getTopRight:function(){return Fe(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(se){var he,xe;return typeof se[0]=="number"||se instanceof we?se=Fe(se):se=Ue(se),se instanceof Ie?(he=se.min,xe=se.max):he=xe=se,he.x>=this.min.x&&xe.x<=this.max.x&&he.y>=this.min.y&&xe.y<=this.max.y},intersects:function(se){se=Ue(se);var he=this.min,xe=this.max,Ae=se.min,He=se.max,Xe=He.x>=he.x&&Ae.x<=xe.x,ot=He.y>=he.y&&Ae.y<=xe.y;return Xe&&ot},overlaps:function(se){se=Ue(se);var he=this.min,xe=this.max,Ae=se.min,He=se.max,Xe=He.x>he.x&&Ae.x<xe.x,ot=He.y>he.y&&Ae.y<xe.y;return Xe&&ot},isValid:function(){return!!(this.min&&this.max)},pad:function(se){var he=this.min,xe=this.max,Ae=Math.abs(he.x-xe.x)*se,He=Math.abs(he.y-xe.y)*se;return Ue(Fe(he.x-Ae,he.y-He),Fe(xe.x+Ae,xe.y+He))},equals:function(se){return se?(se=Ue(se),this.min.equals(se.getTopLeft())&&this.max.equals(se.getBottomRight())):!1}};function Ue(se,he){return!se||se instanceof Ie?se:new Ie(se,he)}function qe(se,he){if(se)for(var xe=he?[se,he]:se,Ae=0,He=xe.length;Ae<He;Ae++)this.extend(xe[Ae])}qe.prototype={extend:function(se){var he=this._southWest,xe=this._northEast,Ae,He;if(se instanceof We)Ae=se,He=se;else if(se instanceof qe){if(Ae=se._southWest,He=se._northEast,!Ae||!He)return this}else return se?this.extend(Ge(se)||je(se)):this;return!he&&!xe?(this._southWest=new We(Ae.lat,Ae.lng),this._northEast=new We(He.lat,He.lng)):(he.lat=Math.min(Ae.lat,he.lat),he.lng=Math.min(Ae.lng,he.lng),xe.lat=Math.max(He.lat,xe.lat),xe.lng=Math.max(He.lng,xe.lng)),this},pad:function(se){var he=this._southWest,xe=this._northEast,Ae=Math.abs(he.lat-xe.lat)*se,He=Math.abs(he.lng-xe.lng)*se;return new qe(new We(he.lat-Ae,he.lng-He),new We(xe.lat+Ae,xe.lng+He))},getCenter:function(){return new We((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new We(this.getNorth(),this.getWest())},getSouthEast:function(){return new We(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(se){typeof se[0]=="number"||se instanceof We||"lat"in se?se=Ge(se):se=je(se);var he=this._southWest,xe=this._northEast,Ae,He;return se instanceof qe?(Ae=se.getSouthWest(),He=se.getNorthEast()):Ae=He=se,Ae.lat>=he.lat&&He.lat<=xe.lat&&Ae.lng>=he.lng&&He.lng<=xe.lng},intersects:function(se){se=je(se);var he=this._southWest,xe=this._northEast,Ae=se.getSouthWest(),He=se.getNorthEast(),Xe=He.lat>=he.lat&&Ae.lat<=xe.lat,ot=He.lng>=he.lng&&Ae.lng<=xe.lng;return Xe&&ot},overlaps:function(se){se=je(se);var he=this._southWest,xe=this._northEast,Ae=se.getSouthWest(),He=se.getNorthEast(),Xe=He.lat>he.lat&&Ae.lat<xe.lat,ot=He.lng>he.lng&&Ae.lng<xe.lng;return Xe&&ot},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(se,he){return se?(se=je(se),this._southWest.equals(se.getSouthWest(),he)&&this._northEast.equals(se.getNorthEast(),he)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function je(se,he){return se instanceof qe?se:new qe(se,he)}function We(se,he,xe){if(isNaN(se)||isNaN(he))throw new Error("Invalid LatLng object: ("+se+", "+he+")");this.lat=+se,this.lng=+he,xe!==void 0&&(this.alt=+xe)}We.prototype={equals:function(se,he){if(!se)return!1;se=Ge(se);var xe=Math.max(Math.abs(this.lat-se.lat),Math.abs(this.lng-se.lng));return xe<=(he===void 0?1e-9:he)},toString:function(se){return"LatLng("+me(this.lat,se)+", "+me(this.lng,se)+")"},distanceTo:function(se){return et.distance(this,Ge(se))},wrap:function(){return et.wrapLatLng(this)},toBounds:function(se){var he=180*se/40075017,xe=he/Math.cos(Math.PI/180*this.lat);return je([this.lat-he,this.lng-xe],[this.lat+he,this.lng+xe])},clone:function(){return new We(this.lat,this.lng,this.alt)}};function Ge(se,he,xe){return se instanceof We?se:$e(se)&&typeof se[0]!="object"?se.length===3?new We(se[0],se[1],se[2]):se.length===2?new We(se[0],se[1]):null:se==null?se:typeof se=="object"&&"lat"in se?new We(se.lat,"lng"in se?se.lng:se.lon,se.alt):he===void 0?null:new We(se,he,xe)}var Ke={latLngToPoint:function(se,he){var xe=this.projection.project(se),Ae=this.scale(he);return this.transformation._transform(xe,Ae)},pointToLatLng:function(se,he){var xe=this.scale(he),Ae=this.transformation.untransform(se,xe);return this.projection.unproject(Ae)},project:function(se){return this.projection.project(se)},unproject:function(se){return this.projection.unproject(se)},scale:function(se){return 256*Math.pow(2,se)},zoom:function(se){return Math.log(se/256)/Math.LN2},getProjectedBounds:function(se){if(this.infinite)return null;var he=this.projection.bounds,xe=this.scale(se),Ae=this.transformation.transform(he.min,xe),He=this.transformation.transform(he.max,xe);return new Ie(Ae,He)},infinite:!1,wrapLatLng:function(se){var he=this.wrapLng?ue(se.lng,this.wrapLng,!0):se.lng,xe=this.wrapLat?ue(se.lat,this.wrapLat,!0):se.lat,Ae=se.alt;return new We(xe,he,Ae)},wrapLatLngBounds:function(se){var he=se.getCenter(),xe=this.wrapLatLng(he),Ae=he.lat-xe.lat,He=he.lng-xe.lng;if(Ae===0&&He===0)return se;var Xe=se.getSouthWest(),ot=se.getNorthEast(),ft=new We(Xe.lat-Ae,Xe.lng-He),gt=new We(ot.lat-Ae,ot.lng-He);return new qe(ft,gt)}},et=re({},Ke,{wrapLng:[-180,180],R:6371e3,distance:function(se,he){var xe=Math.PI/180,Ae=se.lat*xe,He=he.lat*xe,Xe=Math.sin((he.lat-se.lat)*xe/2),ot=Math.sin((he.lng-se.lng)*xe/2),ft=Xe*Xe+Math.cos(Ae)*Math.cos(He)*ot*ot,gt=2*Math.atan2(Math.sqrt(ft),Math.sqrt(1-ft));return this.R*gt}}),yt=6378137,Et={R:yt,MAX_LATITUDE:85.0511287798,project:function(se){var he=Math.PI/180,xe=this.MAX_LATITUDE,Ae=Math.max(Math.min(xe,se.lat),-xe),He=Math.sin(Ae*he);return new we(this.R*se.lng*he,this.R*Math.log((1+He)/(1-He))/2)},unproject:function(se){var he=180/Math.PI;return new We((2*Math.atan(Math.exp(se.y/this.R))-Math.PI/2)*he,se.x*he/this.R)},bounds:function(){var se=yt*Math.PI;return new Ie([-se,-se],[se,se])}()};function At(se,he,xe,Ae){if($e(se)){this._a=se[0],this._b=se[1],this._c=se[2],this._d=se[3];return}this._a=se,this._b=he,this._c=xe,this._d=Ae}At.prototype={transform:function(se,he){return this._transform(se.clone(),he)},_transform:function(se,he){return he=he||1,se.x=he*(this._a*se.x+this._b),se.y=he*(this._c*se.y+this._d),se},untransform:function(se,he){return he=he||1,new we((se.x/he-this._b)/this._a,(se.y/he-this._d)/this._c)}};function Pt(se,he,xe,Ae){return new At(se,he,xe,Ae)}var _t=re({},et,{code:"EPSG:3857",projection:Et,transformation:function(){var se=.5/(Math.PI*Et.R);return Pt(se,.5,-se,.5)}()}),Ze=re({},_t,{code:"EPSG:900913"});function at(se){return document.createElementNS("http://www.w3.org/2000/svg",se)}function dt(se,he){var xe="",Ae,He,Xe,ot,ft,gt;for(Ae=0,Xe=se.length;Ae<Xe;Ae++){for(ft=se[Ae],He=0,ot=ft.length;He<ot;He++)gt=ft[He],xe+=(He?"L":"M")+gt.x+" "+gt.y;xe+=he?Nt.svg?"z":"x":""}return xe||"M0 0"}var ct=document.documentElement.style,ht="ActiveXObject"in window,tt=ht&&!document.addEventListener,Ye="msLaunchUri"in navigator&&!("documentMode"in document),Je=Ct("webkit"),nt=Ct("android"),ut=Ct("android 2")||Ct("android 3"),it=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),st=nt&&Ct("Google")&&it<537&&!("AudioNode"in window),$t=!!window.opera,kt=!Ye&&Ct("chrome"),Mt=Ct("gecko")&&!Je&&!$t&&!ht,Dt=!kt&&Ct("safari"),Lt=Ct("phantom"),Gt="OTransition"in ct,Rt=navigator.platform.indexOf("Win")===0,Xt=ht&&"transition"in ct,It="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ut,Qe="MozPerspective"in ct,lt=!window.L_DISABLE_3D&&(Xt||It||Qe)&&!Gt&&!Lt,mt=typeof orientation<"u"||Ct("mobile"),vt=mt&&Je,wt=mt&&It,xt=!window.PointerEvent&&window.MSPointerEvent,St=!!(window.PointerEvent||xt),rt="ontouchstart"in window||!!window.TouchEvent,bt=!window.L_NO_TOUCH&&(rt||St),pt=mt&&$t,Tt=mt&&Mt,Ft=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ot=function(){var se=!1;try{var he=Object.defineProperty({},"passive",{get:function(){se=!0}});window.addEventListener("testPassiveEventSupport",ve,he),window.removeEventListener("testPassiveEventSupport",ve,he)}catch{}return se}(),Ht=function(){return!!document.createElement("canvas").getContext}(),Zt=!!(document.createElementNS&&at("svg").createSVGRect),an=!!Zt&&function(){var se=document.createElement("div");return se.innerHTML="<svg/>",(se.firstChild&&se.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),rn=!Zt&&function(){try{var se=document.createElement("div");se.innerHTML='<v:shape adj="1"/>';var he=se.firstChild;return he.style.behavior="url(#default#VML)",he&&typeof he.adj=="object"}catch{return!1}}(),on=navigator.platform.indexOf("Mac")===0,Bt=navigator.platform.indexOf("Linux")===0;function Ct(se){return navigator.userAgent.toLowerCase().indexOf(se)>=0}var Nt={ie:ht,ielt9:tt,edge:Ye,webkit:Je,android:nt,android23:ut,androidStock:st,opera:$t,chrome:kt,gecko:Mt,safari:Dt,phantom:Lt,opera12:Gt,win:Rt,ie3d:Xt,webkit3d:It,gecko3d:Qe,any3d:lt,mobile:mt,mobileWebkit:vt,mobileWebkit3d:wt,msPointer:xt,pointer:St,touch:bt,touchNative:rt,mobileOpera:pt,mobileGecko:Tt,retina:Ft,passiveEvents:Ot,canvas:Ht,svg:Zt,vml:rn,inlineSvg:an,mac:on,linux:Bt},Jt=Nt.msPointer?"MSPointerDown":"pointerdown",Yt=Nt.msPointer?"MSPointerMove":"pointermove",sn=Nt.msPointer?"MSPointerUp":"pointerup",pn=Nt.msPointer?"MSPointerCancel":"pointercancel",$n={touchstart:Jt,touchmove:Yt,touchend:sn,touchcancel:pn},Vn={touchstart:Na,touchmove:In,touchend:In,touchcancel:In},En={},Un=!1;function ca(se,he,xe){return he==="touchstart"&&Ba(),Vn[he]?(xe=Vn[he].bind(this,xe),se.addEventListener($n[he],xe,!1),xe):(console.warn("wrong event specified:",he),ve)}function Yn(se,he,xe){if(!$n[he]){console.warn("wrong event specified:",he);return}se.removeEventListener($n[he],xe,!1)}function Mn(se){En[se.pointerId]=se}function da(se){En[se.pointerId]&&(En[se.pointerId]=se)}function Xn(se){delete En[se.pointerId]}function Ba(){Un||(document.addEventListener(Jt,Mn,!0),document.addEventListener(Yt,da,!0),document.addEventListener(sn,Xn,!0),document.addEventListener(pn,Xn,!0),Un=!0)}function In(se,he){if(he.pointerType!==(he.MSPOINTER_TYPE_MOUSE||"mouse")){he.touches=[];for(var xe in En)he.touches.push(En[xe]);he.changedTouches=[he],se(he)}}function Na(se,he){he.MSPOINTER_TYPE_TOUCH&&he.pointerType===he.MSPOINTER_TYPE_TOUCH&&un(he),In(se,he)}function qr(se){var he={},xe,Ae;for(Ae in se)xe=se[Ae],he[Ae]=xe&&xe.bind?xe.bind(se):xe;return se=he,he.type="dblclick",he.detail=2,he.isTrusted=!1,he._simulated=!0,he}var Wr=200;function Ur(se,he){se.addEventListener("dblclick",he);var xe=0,Ae;function He(Xe){if(Xe.detail!==1){Ae=Xe.detail;return}if(!(Xe.pointerType==="mouse"||Xe.sourceCapabilities&&!Xe.sourceCapabilities.firesTouchEvents)){var ot=or(Xe);if(!(ot.some(function(gt){return gt instanceof HTMLLabelElement&>.attributes.for})&&!ot.some(function(gt){return gt instanceof HTMLInputElement||gt instanceof HTMLSelectElement}))){var ft=Date.now();ft-xe<=Wr?(Ae++,Ae===2&&he(qr(Xe))):Ae=1,xe=ft}}}return se.addEventListener("click",He),{dblclick:he,simDblclick:He}}function Yr(se,he){se.removeEventListener("dblclick",he.dblclick),se.removeEventListener("click",he.simDblclick)}var Va=ma(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Kn=ma(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),tr=Kn==="webkitTransition"||Kn==="OTransition"?Kn+"End":"transitionend";function nr(se){return typeof se=="string"?document.getElementById(se):se}function Jn(se,he){var xe=se.style[he]||se.currentStyle&&se.currentStyle[he];if((!xe||xe==="auto")&&document.defaultView){var Ae=document.defaultView.getComputedStyle(se,null);xe=Ae?Ae[he]:null}return xe==="auto"?null:xe}function Qt(se,he,xe){var Ae=document.createElement(se);return Ae.className=he||"",xe&&xe.appendChild(Ae),Ae}function tn(se){var he=se.parentNode;he&&he.removeChild(se)}function ua(se){for(;se.firstChild;)se.removeChild(se.firstChild)}function Rn(se){var he=se.parentNode;he&&he.lastChild!==se&&he.appendChild(se)}function On(se){var he=se.parentNode;he&&he.firstChild!==se&&he.insertBefore(se,he.firstChild)}function Ma(se,he){if(se.classList!==void 0)return se.classList.contains(he);var xe=ha(se);return xe.length>0&&new RegExp("(^|\\s)"+he+"(\\s|$)").test(xe)}function Wt(se,he){if(se.classList!==void 0)for(var xe=fe(he),Ae=0,He=xe.length;Ae<He;Ae++)se.classList.add(xe[Ae]);else if(!Ma(se,he)){var Xe=ha(se);Aa(se,(Xe?Xe+" ":"")+he)}}function nn(se,he){se.classList!==void 0?se.classList.remove(he):Aa(se,ge((" "+ha(se)+" ").replace(" "+he+" "," ")))}function Aa(se,he){se.className.baseVal===void 0?se.className=he:se.className.baseVal=he}function ha(se){return se.correspondingElement&&(se=se.correspondingElement),se.className.baseVal===void 0?se.className:se.className.baseVal}function bn(se,he){"opacity"in se.style?se.style.opacity=he:"filter"in se.style&&Xr(se,he)}function Xr(se,he){var xe=!1,Ae="DXImageTransform.Microsoft.Alpha";try{xe=se.filters.item(Ae)}catch{if(he===1)return}he=Math.round(he*100),xe?(xe.Enabled=he!==100,xe.Opacity=he):se.style.filter+=" progid:"+Ae+"(opacity="+he+")"}function ma(se){for(var he=document.documentElement.style,xe=0;xe<se.length;xe++)if(se[xe]in he)return se[xe];return!1}function Pn(se,he,xe){var Ae=he||new we(0,0);se.style[Va]=(Nt.ie3d?"translate("+Ae.x+"px,"+Ae.y+"px)":"translate3d("+Ae.x+"px,"+Ae.y+"px,0)")+(xe?" scale("+xe+")":"")}function ln(se,he){se._leaflet_pos=he,Nt.any3d?Pn(se,he):(se.style.left=he.x+"px",se.style.top=he.y+"px")}function Ln(se){return se._leaflet_pos||new we(0,0)}var Qn,ea,Ta;if("onselectstart"in document)Qn=function(){qt(window,"selectstart",un)},ea=function(){en(window,"selectstart",un)};else{var ta=ma(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Qn=function(){if(ta){var se=document.documentElement.style;Ta=se[ta],se[ta]="none"}},ea=function(){ta&&(document.documentElement.style[ta]=Ta,Ta=void 0)}}function Pa(){qt(window,"dragstart",un)}function La(){en(window,"dragstart",un)}var fa,Fa;function Da(se){for(;se.tabIndex===-1;)se=se.parentNode;se.style&&(pa(),fa=se,Fa=se.style.outlineStyle,se.style.outlineStyle="none",qt(window,"keydown",pa))}function pa(){fa&&(fa.style.outlineStyle=Fa,fa=void 0,Fa=void 0,en(window,"keydown",pa))}function ar(se){do se=se.parentNode;while((!se.offsetWidth||!se.offsetHeight)&&se!==document.body);return se}function za(se){var he=se.getBoundingClientRect();return{x:he.width/se.offsetWidth||1,y:he.height/se.offsetHeight||1,boundingClientRect:he}}var Kr={__proto__:null,TRANSFORM:Va,TRANSITION:Kn,TRANSITION_END:tr,get:nr,getStyle:Jn,create:Qt,remove:tn,empty:ua,toFront:Rn,toBack:On,hasClass:Ma,addClass:Wt,removeClass:nn,setClass:Aa,getClass:ha,setOpacity:bn,testProp:ma,setTransform:Pn,setPosition:ln,getPosition:Ln,get disableTextSelection(){return Qn},get enableTextSelection(){return ea},disableImageDrag:Pa,enableImageDrag:La,preventOutline:Da,restoreOutline:pa,getSizedParentNode:ar,getScale:za};function qt(se,he,xe,Ae){if(he&&typeof he=="object")for(var He in he)Ra(se,He,he[He],xe);else{he=fe(he);for(var Xe=0,ot=he.length;Xe<ot;Xe++)Ra(se,he[Xe],xe,Ae)}return this}var kn="_leaflet_events";function en(se,he,xe,Ae){if(arguments.length===1)rr(se),delete se[kn];else if(he&&typeof he=="object")for(var He in he)Oa(se,He,he[He],xe);else if(he=fe(he),arguments.length===2)rr(se,function(ft){return ye(he,ft)!==-1});else for(var Xe=0,ot=he.length;Xe<ot;Xe++)Oa(se,he[Xe],xe,Ae);return this}function rr(se,he){for(var xe in se[kn]){var Ae=xe.split(/\d/)[0];(!he||he(Ae))&&Oa(se,Ae,null,null,xe)}}var Ia={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ra(se,he,xe,Ae){var He=he+ce(xe)+(Ae?"_"+ce(Ae):"");if(se[kn]&&se[kn][He])return this;var Xe=function(ft){return xe.call(Ae||se,ft||window.event)},ot=Xe;!Nt.touchNative&&Nt.pointer&&he.indexOf("touch")===0?Xe=ca(se,he,Xe):Nt.touch&&he==="dblclick"?Xe=Ur(se,Xe):"addEventListener"in se?he==="touchstart"||he==="touchmove"||he==="wheel"||he==="mousewheel"?se.addEventListener(Ia[he]||he,Xe,Nt.passiveEvents?{passive:!1}:!1):he==="mouseenter"||he==="mouseleave"?(Xe=function(ft){ft=ft||window.event,ja(se,ft)&&ot(ft)},se.addEventListener(Ia[he],Xe,!1)):se.addEventListener(he,ot,!1):se.attachEvent("on"+he,Xe),se[kn]=se[kn]||{},se[kn][He]=Xe}function Oa(se,he,xe,Ae,He){He=He||he+ce(xe)+(Ae?"_"+ce(Ae):"");var Xe=se[kn]&&se[kn][He];if(!Xe)return this;!Nt.touchNative&&Nt.pointer&&he.indexOf("touch")===0?Yn(se,he,Xe):Nt.touch&&he==="dblclick"?Yr(se,Xe):"removeEventListener"in se?se.removeEventListener(Ia[he]||he,Xe,!1):se.detachEvent("on"+he,Xe),se[kn][He]=null}function Fn(se){return se.stopPropagation?se.stopPropagation():se.originalEvent?se.originalEvent._stopped=!0:se.cancelBubble=!0,this}function Ha(se){return Ra(se,"wheel",Fn),this}function na(se){return qt(se,"mousedown touchstart dblclick contextmenu",Fn),se._leaflet_disable_click=!0,this}function un(se){return se.preventDefault?se.preventDefault():se.returnValue=!1,this}function Dn(se){return un(se),Fn(se),this}function or(se){if(se.composedPath)return se.composedPath();for(var he=[],xe=se.target;xe;)he.push(xe),xe=xe.parentNode;return he}function ir(se,he){if(!he)return new we(se.clientX,se.clientY);var xe=za(he),Ae=xe.boundingClientRect;return new we((se.clientX-Ae.left)/xe.x-he.clientLeft,(se.clientY-Ae.top)/xe.y-he.clientTop)}var Jr=Nt.linux&&Nt.chrome?window.devicePixelRatio:Nt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function sr(se){return Nt.edge?se.wheelDeltaY/2:se.deltaY&&se.deltaMode===0?-se.deltaY/Jr:se.deltaY&&se.deltaMode===1?-se.deltaY*20:se.deltaY&&se.deltaMode===2?-se.deltaY*60:se.deltaX||se.deltaZ?0:se.wheelDelta?(se.wheelDeltaY||se.wheelDelta)/2:se.detail&&Math.abs(se.detail)<32765?-se.detail*20:se.detail?se.detail/-32765*60:0}function ja(se,he){var xe=he.relatedTarget;if(!xe)return!0;try{for(;xe&&xe!==se;)xe=xe.parentNode}catch{return!1}return xe!==se}var Qr={__proto__:null,on:qt,off:en,stopPropagation:Fn,disableScrollPropagation:Ha,disableClickPropagation:na,preventDefault:un,stop:Dn,getPropagationPath:or,getMousePosition:ir,getWheelDelta:sr,isExternalTarget:ja,addListener:qt,removeListener:en},lr=Me.extend({run:function(se,he,xe,Ae){this.stop(),this._el=se,this._inProgress=!0,this._duration=xe||.25,this._easeOutPower=1/Math.max(Ae||.5,.2),this._startPos=Ln(se),this._offset=he.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Re(this._animate,this),this._step()},_step:function(se){var he=+new Date-this._startTime,xe=this._duration*1e3;he<xe?this._runFrame(this._easeOut(he/xe),se):(this._runFrame(1),this._complete())},_runFrame:function(se,he){var xe=this._startPos.add(this._offset.multiplyBy(se));he&&xe._round(),ln(this._el,xe),this.fire("step")},_complete:function(){Oe(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(se){return 1-Math.pow(1-se,this._easeOutPower)}}),Kt=Me.extend({options:{crs:_t,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(se,he){he=pe(this,he),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(se),this._initLayout(),this._onResize=ie(this._onResize,this),this._initEvents(),he.maxBounds&&this.setMaxBounds(he.maxBounds),he.zoom!==void 0&&(this._zoom=this._limitZoom(he.zoom)),he.center&&he.zoom!==void 0&&this.setView(Ge(he.center),he.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Kn&&Nt.any3d&&!Nt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),qt(this._proxy,tr,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(se,he,xe){if(he=he===void 0?this._zoom:this._limitZoom(he),se=this._limitCenter(Ge(se),he,this.options.maxBounds),xe=xe||{},this._stop(),this._loaded&&!xe.reset&&xe!==!0){xe.animate!==void 0&&(xe.zoom=re({animate:xe.animate},xe.zoom),xe.pan=re({animate:xe.animate,duration:xe.duration},xe.pan));var Ae=this._zoom!==he?this._tryAnimatedZoom&&this._tryAnimatedZoom(se,he,xe.zoom):this._tryAnimatedPan(se,xe.pan);if(Ae)return clearTimeout(this._sizeTimer),this}return this._resetView(se,he,xe.pan&&xe.pan.noMoveStart),this},setZoom:function(se,he){return this._loaded?this.setView(this.getCenter(),se,{zoom:he}):(this._zoom=se,this)},zoomIn:function(se,he){return se=se||(Nt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+se,he)},zoomOut:function(se,he){return se=se||(Nt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-se,he)},setZoomAround:function(se,he,xe){var Ae=this.getZoomScale(he),He=this.getSize().divideBy(2),Xe=se instanceof we?se:this.latLngToContainerPoint(se),ot=Xe.subtract(He).multiplyBy(1-1/Ae),ft=this.containerPointToLatLng(He.add(ot));return this.setView(ft,he,{zoom:xe})},_getBoundsCenterZoom:function(se,he){he=he||{},se=se.getBounds?se.getBounds():je(se);var xe=Fe(he.paddingTopLeft||he.padding||[0,0]),Ae=Fe(he.paddingBottomRight||he.padding||[0,0]),He=this.getBoundsZoom(se,!1,xe.add(Ae));if(He=typeof he.maxZoom=="number"?Math.min(he.maxZoom,He):He,He===1/0)return{center:se.getCenter(),zoom:He};var Xe=Ae.subtract(xe).divideBy(2),ot=this.project(se.getSouthWest(),He),ft=this.project(se.getNorthEast(),He),gt=this.unproject(ot.add(ft).divideBy(2).add(Xe),He);return{center:gt,zoom:He}},fitBounds:function(se,he){if(se=je(se),!se.isValid())throw new Error("Bounds are not valid.");var xe=this._getBoundsCenterZoom(se,he);return this.setView(xe.center,xe.zoom,he)},fitWorld:function(se){return this.fitBounds([[-90,-180],[90,180]],se)},panTo:function(se,he){return this.setView(se,this._zoom,{pan:he})},panBy:function(se,he){if(se=Fe(se).round(),he=he||{},!se.x&&!se.y)return this.fire("moveend");if(he.animate!==!0&&!this.getSize().contains(se))return this._resetView(this.unproject(this.project(this.getCenter()).add(se)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new lr,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),he.noMoveStart||this.fire("movestart"),he.animate!==!1){Wt(this._mapPane,"leaflet-pan-anim");var xe=this._getMapPanePos().subtract(se).round();this._panAnim.run(this._mapPane,xe,he.duration||.25,he.easeLinearity)}else this._rawPanBy(se),this.fire("move").fire("moveend");return this},flyTo:function(se,he,xe){if(xe=xe||{},xe.animate===!1||!Nt.any3d)return this.setView(se,he,xe);this._stop();var Ae=this.project(this.getCenter()),He=this.project(se),Xe=this.getSize(),ot=this._zoom;se=Ge(se),he=he===void 0?ot:he;var ft=Math.max(Xe.x,Xe.y),gt=ft*this.getZoomScale(ot,he),Vt=He.distanceTo(Ae)||1,zt=1.42,jt=zt*zt;function Ut(cn){var Sa=cn?-1:1,Ho=cn?gt:ft,jo=gt*gt-ft*ft+Sa*jt*jt*Vt*Vt,Go=2*Ho*jt*Vt,er=jo/Go,jr=Math.sqrt(er*er+1)-er,Zo=jr<1e-9?-18:Math.log(jr);return Zo}function mn(cn){return(Math.exp(cn)-Math.exp(-cn))/2}function dn(cn){return(Math.exp(cn)+Math.exp(-cn))/2}function gn(cn){return mn(cn)/dn(cn)}var fn=Ut(0);function Wn(cn){return ft*(dn(fn)/dn(fn+zt*cn))}function zo(cn){return ft*(dn(fn)*gn(fn+zt*cn)-mn(fn))/jt}function Io(cn){return 1-Math.pow(1-cn,1.5)}var Ro=Date.now(),Or=(Ut(1)-fn)/zt,Oo=xe.duration?1e3*xe.duration:1e3*Or*.8;function Hr(){var cn=(Date.now()-Ro)/Oo,Sa=Io(cn)*Or;cn<=1?(this._flyToFrame=Re(Hr,this),this._move(this.unproject(Ae.add(He.subtract(Ae).multiplyBy(zo(Sa)/Vt)),ot),this.getScaleZoom(ft/Wn(Sa),ot),{flyTo:!0})):this._move(se,he)._moveEnd(!0)}return this._moveStart(!0,xe.noMoveStart),Hr.call(this),this},flyToBounds:function(se,he){var xe=this._getBoundsCenterZoom(se,he);return this.flyTo(xe.center,xe.zoom,he)},setMaxBounds:function(se){return se=je(se),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),se.isValid()?(this.options.maxBounds=se,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(se){var he=this.options.minZoom;return this.options.minZoom=se,this._loaded&&he!==se&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(se):this},setMaxZoom:function(se){var he=this.options.maxZoom;return this.options.maxZoom=se,this._loaded&&he!==se&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(se):this},panInsideBounds:function(se,he){this._enforcingBounds=!0;var xe=this.getCenter(),Ae=this._limitCenter(xe,this._zoom,je(se));return xe.equals(Ae)||this.panTo(Ae,he),this._enforcingBounds=!1,this},panInside:function(se,he){he=he||{};var xe=Fe(he.paddingTopLeft||he.padding||[0,0]),Ae=Fe(he.paddingBottomRight||he.padding||[0,0]),He=this.project(this.getCenter()),Xe=this.project(se),ot=this.getPixelBounds(),ft=Ue([ot.min.add(xe),ot.max.subtract(Ae)]),gt=ft.getSize();if(!ft.contains(Xe)){this._enforcingBounds=!0;var Vt=Xe.subtract(ft.getCenter()),zt=ft.extend(Xe).getSize().subtract(gt);He.x+=Vt.x<0?-zt.x:zt.x,He.y+=Vt.y<0?-zt.y:zt.y,this.panTo(this.unproject(He),he),this._enforcingBounds=!1}return this},invalidateSize:function(se){if(!this._loaded)return this;se=re({animate:!1,pan:!0},se===!0?{animate:!0}:se);var he=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var xe=this.getSize(),Ae=he.divideBy(2).round(),He=xe.divideBy(2).round(),Xe=Ae.subtract(He);return!Xe.x&&!Xe.y?this:(se.animate&&se.pan?this.panBy(Xe):(se.pan&&this._rawPanBy(Xe),this.fire("move"),se.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(ie(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:he,newSize:xe}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(se){if(se=this._locateOptions=re({timeout:1e4,watch:!1},se),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var he=ie(this._handleGeolocationResponse,this),xe=ie(this._handleGeolocationError,this);return se.watch?this._locationWatchId=navigator.geolocation.watchPosition(he,xe,se):navigator.geolocation.getCurrentPosition(he,xe,se),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(se){if(this._container._leaflet_id){var he=se.code,xe=se.message||(he===1?"permission denied":he===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:he,message:"Geolocation error: "+xe+"."})}},_handleGeolocationResponse:function(se){if(this._container._leaflet_id){var he=se.coords.latitude,xe=se.coords.longitude,Ae=new We(he,xe),He=Ae.toBounds(se.coords.accuracy*2),Xe=this._locateOptions;if(Xe.setView){var ot=this.getBoundsZoom(He);this.setView(Ae,Xe.maxZoom?Math.min(ot,Xe.maxZoom):ot)}var ft={latlng:Ae,bounds:He,timestamp:se.timestamp};for(var gt in se.coords)typeof se.coords[gt]=="number"&&(ft[gt]=se.coords[gt]);this.fire("locationfound",ft)}},addHandler:function(se,he){if(!he)return this;var xe=this[se]=new he(this);return this._handlers.push(xe),this.options[se]&&xe.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),tn(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Oe(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var se;for(se in this._layers)this._layers[se].remove();for(se in this._panes)tn(this._panes[se]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(se,he){var xe="leaflet-pane"+(se?" leaflet-"+se.replace("Pane","")+"-pane":""),Ae=Qt("div",xe,he||this._mapPane);return se&&(this._panes[se]=Ae),Ae},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var se=this.getPixelBounds(),he=this.unproject(se.getBottomLeft()),xe=this.unproject(se.getTopRight());return new qe(he,xe)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(se,he,xe){se=je(se),xe=Fe(xe||[0,0]);var Ae=this.getZoom()||0,He=this.getMinZoom(),Xe=this.getMaxZoom(),ot=se.getNorthWest(),ft=se.getSouthEast(),gt=this.getSize().subtract(xe),Vt=Ue(this.project(ft,Ae),this.project(ot,Ae)).getSize(),zt=Nt.any3d?this.options.zoomSnap:1,jt=gt.x/Vt.x,Ut=gt.y/Vt.y,mn=he?Math.max(jt,Ut):Math.min(jt,Ut);return Ae=this.getScaleZoom(mn,Ae),zt&&(Ae=Math.round(Ae/(zt/100))*(zt/100),Ae=he?Math.ceil(Ae/zt)*zt:Math.floor(Ae/zt)*zt),Math.max(He,Math.min(Xe,Ae))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new we(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(se,he){var xe=this._getTopLeftPoint(se,he);return new Ie(xe,xe.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(se){return this.options.crs.getProjectedBounds(se===void 0?this.getZoom():se)},getPane:function(se){return typeof se=="string"?this._panes[se]:se},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(se,he){var xe=this.options.crs;return he=he===void 0?this._zoom:he,xe.scale(se)/xe.scale(he)},getScaleZoom:function(se,he){var xe=this.options.crs;he=he===void 0?this._zoom:he;var Ae=xe.zoom(se*xe.scale(he));return isNaN(Ae)?1/0:Ae},project:function(se,he){return he=he===void 0?this._zoom:he,this.options.crs.latLngToPoint(Ge(se),he)},unproject:function(se,he){return he=he===void 0?this._zoom:he,this.options.crs.pointToLatLng(Fe(se),he)},layerPointToLatLng:function(se){var he=Fe(se).add(this.getPixelOrigin());return this.unproject(he)},latLngToLayerPoint:function(se){var he=this.project(Ge(se))._round();return he._subtract(this.getPixelOrigin())},wrapLatLng:function(se){return this.options.crs.wrapLatLng(Ge(se))},wrapLatLngBounds:function(se){return this.options.crs.wrapLatLngBounds(je(se))},distance:function(se,he){return this.options.crs.distance(Ge(se),Ge(he))},containerPointToLayerPoint:function(se){return Fe(se).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(se){return Fe(se).add(this._getMapPanePos())},containerPointToLatLng:function(se){var he=this.containerPointToLayerPoint(Fe(se));return this.layerPointToLatLng(he)},latLngToContainerPoint:function(se){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Ge(se)))},mouseEventToContainerPoint:function(se){return ir(se,this._container)},mouseEventToLayerPoint:function(se){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(se))},mouseEventToLatLng:function(se){return this.layerPointToLatLng(this.mouseEventToLayerPoint(se))},_initContainer:function(se){var he=this._container=nr(se);if(he){if(he._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");qt(he,"scroll",this._onScroll,this),this._containerId=ce(he)},_initLayout:function(){var se=this._container;this._fadeAnimated=this.options.fadeAnimation&&Nt.any3d,Wt(se,"leaflet-container"+(Nt.touch?" leaflet-touch":"")+(Nt.retina?" leaflet-retina":"")+(Nt.ielt9?" leaflet-oldie":"")+(Nt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var he=Jn(se,"position");he!=="absolute"&&he!=="relative"&&he!=="fixed"&&he!=="sticky"&&(se.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var se=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ln(this._mapPane,new we(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Wt(se.markerPane,"leaflet-zoom-hide"),Wt(se.shadowPane,"leaflet-zoom-hide"))},_resetView:function(se,he,xe){ln(this._mapPane,new we(0,0));var Ae=!this._loaded;this._loaded=!0,he=this._limitZoom(he),this.fire("viewprereset");var He=this._zoom!==he;this._moveStart(He,xe)._move(se,he)._moveEnd(He),this.fire("viewreset"),Ae&&this.fire("load")},_moveStart:function(se,he){return se&&this.fire("zoomstart"),he||this.fire("movestart"),this},_move:function(se,he,xe,Ae){he===void 0&&(he=this._zoom);var He=this._zoom!==he;return this._zoom=he,this._lastCenter=se,this._pixelOrigin=this._getNewPixelOrigin(se),Ae?xe&&xe.pinch&&this.fire("zoom",xe):((He||xe&&xe.pinch)&&this.fire("zoom",xe),this.fire("move",xe)),this},_moveEnd:function(se){return se&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Oe(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(se){ln(this._mapPane,this._getMapPanePos().subtract(se))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(se){this._targets={},this._targets[ce(this._container)]=this;var he=se?en:qt;he(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&he(window,"resize",this._onResize,this),Nt.any3d&&this.options.transform3DLimit&&(se?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Oe(this._resizeRequest),this._resizeRequest=Re(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var se=this._getMapPanePos();Math.max(Math.abs(se.x),Math.abs(se.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(se,he){for(var xe=[],Ae,He=he==="mouseout"||he==="mouseover",Xe=se.target||se.srcElement,ot=!1;Xe;){if(Ae=this._targets[ce(Xe)],Ae&&(he==="click"||he==="preclick")&&this._draggableMoved(Ae)){ot=!0;break}if(Ae&&Ae.listens(he,!0)&&(He&&!ja(Xe,se)||(xe.push(Ae),He))||Xe===this._container)break;Xe=Xe.parentNode}return!xe.length&&!ot&&!He&&this.listens(he,!0)&&(xe=[this]),xe},_isClickDisabled:function(se){for(;se&&se!==this._container;){if(se._leaflet_disable_click)return!0;se=se.parentNode}},_handleDOMEvent:function(se){var he=se.target||se.srcElement;if(!(!this._loaded||he._leaflet_disable_events||se.type==="click"&&this._isClickDisabled(he))){var xe=se.type;xe==="mousedown"&&Da(he),this._fireDOMEvent(se,xe)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(se,he,xe){if(se.type==="click"){var Ae=re({},se);Ae.type="preclick",this._fireDOMEvent(Ae,Ae.type,xe)}var He=this._findEventTargets(se,he);if(xe){for(var Xe=[],ot=0;ot<xe.length;ot++)xe[ot].listens(he,!0)&&Xe.push(xe[ot]);He=Xe.concat(He)}if(He.length){he==="contextmenu"&&un(se);var ft=He[0],gt={originalEvent:se};if(se.type!=="keypress"&&se.type!=="keydown"&&se.type!=="keyup"){var Vt=ft.getLatLng&&(!ft._radius||ft._radius<=10);gt.containerPoint=Vt?this.latLngToContainerPoint(ft.getLatLng()):this.mouseEventToContainerPoint(se),gt.layerPoint=this.containerPointToLayerPoint(gt.containerPoint),gt.latlng=Vt?ft.getLatLng():this.layerPointToLatLng(gt.layerPoint)}for(ot=0;ot<He.length;ot++)if(He[ot].fire(he,gt,!0),gt.originalEvent._stopped||He[ot].options.bubblingMouseEvents===!1&&ye(this._mouseEvents,he)!==-1)return}},_draggableMoved:function(se){return se=se.dragging&&se.dragging.enabled()?se:this,se.dragging&&se.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var se=0,he=this._handlers.length;se<he;se++)this._handlers[se].disable()},whenReady:function(se,he){return this._loaded?se.call(he||this,{target:this}):this.on("load",se,he),this},_getMapPanePos:function(){return Ln(this._mapPane)||new we(0,0)},_moved:function(){var se=this._getMapPanePos();return se&&!se.equals([0,0])},_getTopLeftPoint:function(se,he){var xe=se&&he!==void 0?this._getNewPixelOrigin(se,he):this.getPixelOrigin();return xe.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(se,he){var xe=this.getSize()._divideBy(2);return this.project(se,he)._subtract(xe)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(se,he,xe){var Ae=this._getNewPixelOrigin(xe,he);return this.project(se,he)._subtract(Ae)},_latLngBoundsToNewLayerBounds:function(se,he,xe){var Ae=this._getNewPixelOrigin(xe,he);return Ue([this.project(se.getSouthWest(),he)._subtract(Ae),this.project(se.getNorthWest(),he)._subtract(Ae),this.project(se.getSouthEast(),he)._subtract(Ae),this.project(se.getNorthEast(),he)._subtract(Ae)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(se){return this.latLngToLayerPoint(se).subtract(this._getCenterLayerPoint())},_limitCenter:function(se,he,xe){if(!xe)return se;var Ae=this.project(se,he),He=this.getSize().divideBy(2),Xe=new Ie(Ae.subtract(He),Ae.add(He)),ot=this._getBoundsOffset(Xe,xe,he);return Math.abs(ot.x)<=1&&Math.abs(ot.y)<=1?se:this.unproject(Ae.add(ot),he)},_limitOffset:function(se,he){if(!he)return se;var xe=this.getPixelBounds(),Ae=new Ie(xe.min.add(se),xe.max.add(se));return se.add(this._getBoundsOffset(Ae,he))},_getBoundsOffset:function(se,he,xe){var Ae=Ue(this.project(he.getNorthEast(),xe),this.project(he.getSouthWest(),xe)),He=Ae.min.subtract(se.min),Xe=Ae.max.subtract(se.max),ot=this._rebound(He.x,-Xe.x),ft=this._rebound(He.y,-Xe.y);return new we(ot,ft)},_rebound:function(se,he){return se+he>0?Math.round(se-he)/2:Math.max(0,Math.ceil(se))-Math.max(0,Math.floor(he))},_limitZoom:function(se){var he=this.getMinZoom(),xe=this.getMaxZoom(),Ae=Nt.any3d?this.options.zoomSnap:1;return Ae&&(se=Math.round(se/Ae)*Ae),Math.max(he,Math.min(xe,se))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){nn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(se,he){var xe=this._getCenterOffset(se)._trunc();return(he&&he.animate)!==!0&&!this.getSize().contains(xe)?!1:(this.panBy(xe,he),!0)},_createAnimProxy:function(){var se=this._proxy=Qt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(se),this.on("zoomanim",function(he){var xe=Va,Ae=this._proxy.style[xe];Pn(this._proxy,this.project(he.center,he.zoom),this.getZoomScale(he.zoom,1)),Ae===this._proxy.style[xe]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){tn(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var se=this.getCenter(),he=this.getZoom();Pn(this._proxy,this.project(se,he),this.getZoomScale(he,1))},_catchTransitionEnd:function(se){this._animatingZoom&&se.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(se,he,xe){if(this._animatingZoom)return!0;if(xe=xe||{},!this._zoomAnimated||xe.animate===!1||this._nothingToAnimate()||Math.abs(he-this._zoom)>this.options.zoomAnimationThreshold)return!1;var Ae=this.getZoomScale(he),He=this._getCenterOffset(se)._divideBy(1-1/Ae);return xe.animate!==!0&&!this.getSize().contains(He)?!1:(Re(function(){this._moveStart(!0,xe.noMoveStart||!1)._animateZoom(se,he,!0)},this),!0)},_animateZoom:function(se,he,xe,Ae){this._mapPane&&(xe&&(this._animatingZoom=!0,this._animateToCenter=se,this._animateToZoom=he,Wt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:se,zoom:he,noUpdate:Ae}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(ie(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&nn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function eo(se,he){return new Kt(se,he)}var yn=Be.extend({options:{position:"topright"},initialize:function(se){pe(this,se)},getPosition:function(){return this.options.position},setPosition:function(se){var he=this._map;return he&&he.removeControl(this),this.options.position=se,he&&he.addControl(this),this},getContainer:function(){return this._container},addTo:function(se){this.remove(),this._map=se;var he=this._container=this.onAdd(se),xe=this.getPosition(),Ae=se._controlCorners[xe];return Wt(he,"leaflet-control"),xe.indexOf("bottom")!==-1?Ae.insertBefore(he,Ae.firstChild):Ae.appendChild(he),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(tn(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(se){this._map&&se&&se.screenX>0&&se.screenY>0&&this._map.getContainer().focus()}}),aa=function(se){return new yn(se)};Kt.include({addControl:function(se){return se.addTo(this),this},removeControl:function(se){return se.remove(),this},_initControlPos:function(){var se=this._controlCorners={},he="leaflet-",xe=this._controlContainer=Qt("div",he+"control-container",this._container);function Ae(He,Xe){var ot=he+He+" "+he+Xe;se[He+Xe]=Qt("div",ot,xe)}Ae("top","left"),Ae("top","right"),Ae("bottom","left"),Ae("bottom","right")},_clearControlPos:function(){for(var se in this._controlCorners)tn(this._controlCorners[se]);tn(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var cr=yn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(se,he,xe,Ae){return xe<Ae?-1:Ae<xe?1:0}},initialize:function(se,he,xe){pe(this,xe),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var Ae in se)this._addLayer(se[Ae],Ae);for(Ae in he)this._addLayer(he[Ae],Ae,!0)},onAdd:function(se){this._initLayout(),this._update(),this._map=se,se.on("zoomend",this._checkDisabledLayers,this);for(var he=0;he<this._layers.length;he++)this._layers[he].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(se){return yn.prototype.addTo.call(this,se),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var se=0;se<this._layers.length;se++)this._layers[se].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(se,he){return this._addLayer(se,he),this._map?this._update():this},addOverlay:function(se,he){return this._addLayer(se,he,!0),this._map?this._update():this},removeLayer:function(se){se.off("add remove",this._onLayerChange,this);var he=this._getLayer(ce(se));return he&&this._layers.splice(this._layers.indexOf(he),1),this._map?this._update():this},expand:function(){Wt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var se=this._map.getSize().y-(this._container.offsetTop+50);return se<this._section.clientHeight?(Wt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=se+"px"):nn(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return nn(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var se="leaflet-control-layers",he=this._container=Qt("div",se),xe=this.options.collapsed;he.setAttribute("aria-haspopup",!0),na(he),Ha(he);var Ae=this._section=Qt("section",se+"-list");xe&&(this._map.on("click",this.collapse,this),qt(he,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var He=this._layersLink=Qt("a",se+"-toggle",he);He.href="#",He.title="Layers",He.setAttribute("role","button"),qt(He,{keydown:function(Xe){Xe.keyCode===13&&this._expandSafely()},click:function(Xe){un(Xe),this._expandSafely()}},this),xe||this.expand(),this._baseLayersList=Qt("div",se+"-base",Ae),this._separator=Qt("div",se+"-separator",Ae),this._overlaysList=Qt("div",se+"-overlays",Ae),he.appendChild(Ae)},_getLayer:function(se){for(var he=0;he<this._layers.length;he++)if(this._layers[he]&&ce(this._layers[he].layer)===se)return this._layers[he]},_addLayer:function(se,he,xe){this._map&&se.on("add remove",this._onLayerChange,this),this._layers.push({layer:se,name:he,overlay:xe}),this.options.sortLayers&&this._layers.sort(ie(function(Ae,He){return this.options.sortFunction(Ae.layer,He.layer,Ae.name,He.name)},this)),this.options.autoZIndex&&se.setZIndex&&(this._lastZIndex++,se.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ua(this._baseLayersList),ua(this._overlaysList),this._layerControlInputs=[];var se,he,xe,Ae,He=0;for(xe=0;xe<this._layers.length;xe++)Ae=this._layers[xe],this._addItem(Ae),he=he||Ae.overlay,se=se||!Ae.overlay,He+=Ae.overlay?0:1;return this.options.hideSingleBase&&(se=se&&He>1,this._baseLayersList.style.display=se?"":"none"),this._separator.style.display=he&&se?"":"none",this},_onLayerChange:function(se){this._handlingClick||this._update();var he=this._getLayer(ce(se.target)),xe=he.overlay?se.type==="add"?"overlayadd":"overlayremove":se.type==="add"?"baselayerchange":null;xe&&this._map.fire(xe,he)},_createRadioElement:function(se,he){var xe='<input type="radio" class="leaflet-control-layers-selector" name="'+se+'"'+(he?' checked="checked"':"")+"/>",Ae=document.createElement("div");return Ae.innerHTML=xe,Ae.firstChild},_addItem:function(se){var he=document.createElement("label"),xe=this._map.hasLayer(se.layer),Ae;se.overlay?(Ae=document.createElement("input"),Ae.type="checkbox",Ae.className="leaflet-control-layers-selector",Ae.defaultChecked=xe):Ae=this._createRadioElement("leaflet-base-layers_"+ce(this),xe),this._layerControlInputs.push(Ae),Ae.layerId=ce(se.layer),qt(Ae,"click",this._onInputClick,this);var He=document.createElement("span");He.innerHTML=" "+se.name;var Xe=document.createElement("span");he.appendChild(Xe),Xe.appendChild(Ae),Xe.appendChild(He);var ot=se.overlay?this._overlaysList:this._baseLayersList;return ot.appendChild(he),this._checkDisabledLayers(),he},_onInputClick:function(){if(!this._preventClick){var se=this._layerControlInputs,he,xe,Ae=[],He=[];this._handlingClick=!0;for(var Xe=se.length-1;Xe>=0;Xe--)he=se[Xe],xe=this._getLayer(he.layerId).layer,he.checked?Ae.push(xe):he.checked||He.push(xe);for(Xe=0;Xe<He.length;Xe++)this._map.hasLayer(He[Xe])&&this._map.removeLayer(He[Xe]);for(Xe=0;Xe<Ae.length;Xe++)this._map.hasLayer(Ae[Xe])||this._map.addLayer(Ae[Xe]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var se=this._layerControlInputs,he,xe,Ae=this._map.getZoom(),He=se.length-1;He>=0;He--)he=se[He],xe=this._getLayer(he.layerId).layer,he.disabled=xe.options.minZoom!==void 0&&Ae<xe.options.minZoom||xe.options.maxZoom!==void 0&&Ae>xe.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var se=this._section;this._preventClick=!0,qt(se,"click",un),this.expand();var he=this;setTimeout(function(){en(se,"click",un),he._preventClick=!1})}}),to=function(se,he,xe){return new cr(se,he,xe)},Ga=yn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(se){var he="leaflet-control-zoom",xe=Qt("div",he+" leaflet-bar"),Ae=this.options;return this._zoomInButton=this._createButton(Ae.zoomInText,Ae.zoomInTitle,he+"-in",xe,this._zoomIn),this._zoomOutButton=this._createButton(Ae.zoomOutText,Ae.zoomOutTitle,he+"-out",xe,this._zoomOut),this._updateDisabled(),se.on("zoomend zoomlevelschange",this._updateDisabled,this),xe},onRemove:function(se){se.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(se){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(se.shiftKey?3:1))},_zoomOut:function(se){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(se.shiftKey?3:1))},_createButton:function(se,he,xe,Ae,He){var Xe=Qt("a",xe,Ae);return Xe.innerHTML=se,Xe.href="#",Xe.title=he,Xe.setAttribute("role","button"),Xe.setAttribute("aria-label",he),na(Xe),qt(Xe,"click",Dn),qt(Xe,"click",He,this),qt(Xe,"click",this._refocusOnMap,this),Xe},_updateDisabled:function(){var se=this._map,he="leaflet-disabled";nn(this._zoomInButton,he),nn(this._zoomOutButton,he),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||se._zoom===se.getMinZoom())&&(Wt(this._zoomOutButton,he),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||se._zoom===se.getMaxZoom())&&(Wt(this._zoomInButton,he),this._zoomInButton.setAttribute("aria-disabled","true"))}});Kt.mergeOptions({zoomControl:!0}),Kt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ga,this.addControl(this.zoomControl))});var no=function(se){return new Ga(se)},dr=yn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(se){var he="leaflet-control-scale",xe=Qt("div",he),Ae=this.options;return this._addScales(Ae,he+"-line",xe),se.on(Ae.updateWhenIdle?"moveend":"move",this._update,this),se.whenReady(this._update,this),xe},onRemove:function(se){se.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(se,he,xe){se.metric&&(this._mScale=Qt("div",he,xe)),se.imperial&&(this._iScale=Qt("div",he,xe))},_update:function(){var se=this._map,he=se.getSize().y/2,xe=se.distance(se.containerPointToLatLng([0,he]),se.containerPointToLatLng([this.options.maxWidth,he]));this._updateScales(xe)},_updateScales:function(se){this.options.metric&&se&&this._updateMetric(se),this.options.imperial&&se&&this._updateImperial(se)},_updateMetric:function(se){var he=this._getRoundNum(se),xe=he<1e3?he+" m":he/1e3+" km";this._updateScale(this._mScale,xe,he/se)},_updateImperial:function(se){var he=se*3.2808399,xe,Ae,He;he>5280?(xe=he/5280,Ae=this._getRoundNum(xe),this._updateScale(this._iScale,Ae+" mi",Ae/xe)):(He=this._getRoundNum(he),this._updateScale(this._iScale,He+" ft",He/he))},_updateScale:function(se,he,xe){se.style.width=Math.round(this.options.maxWidth*xe)+"px",se.innerHTML=he},_getRoundNum:function(se){var he=Math.pow(10,(Math.floor(se)+"").length-1),xe=se/he;return xe=xe>=10?10:xe>=5?5:xe>=3?3:xe>=2?2:1,he*xe}}),ao=function(se){return new dr(se)},ro='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Za=yn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Nt.inlineSvg?ro+" ":"")+"Leaflet</a>"},initialize:function(se){pe(this,se),this._attributions={}},onAdd:function(se){se.attributionControl=this,this._container=Qt("div","leaflet-control-attribution"),na(this._container);for(var he in se._layers)se._layers[he].getAttribution&&this.addAttribution(se._layers[he].getAttribution());return this._update(),se.on("layeradd",this._addAttribution,this),this._container},onRemove:function(se){se.off("layeradd",this._addAttribution,this)},_addAttribution:function(se){se.layer.getAttribution&&(this.addAttribution(se.layer.getAttribution()),se.layer.once("remove",function(){this.removeAttribution(se.layer.getAttribution())},this))},setPrefix:function(se){return this.options.prefix=se,this._update(),this},addAttribution:function(se){return se?(this._attributions[se]||(this._attributions[se]=0),this._attributions[se]++,this._update(),this):this},removeAttribution:function(se){return se?(this._attributions[se]&&(this._attributions[se]--,this._update()),this):this},_update:function(){if(this._map){var se=[];for(var he in this._attributions)this._attributions[he]&&se.push(he);var xe=[];this.options.prefix&&xe.push(this.options.prefix),se.length&&xe.push(se.join(", ")),this._container.innerHTML=xe.join(' <span aria-hidden="true">|</span> ')}}});Kt.mergeOptions({attributionControl:!0}),Kt.addInitHook(function(){this.options.attributionControl&&new Za().addTo(this)});var oo=function(se){return new Za(se)};yn.Layers=cr,yn.Zoom=Ga,yn.Scale=dr,yn.Attribution=Za,aa.layers=to,aa.zoom=no,aa.scale=ao,aa.attribution=oo;var xn=Be.extend({initialize:function(se){this._map=se},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});xn.addTo=function(se,he){return se.addHandler(he,this),this};var io={Events:Ne},ur=Nt.touch?"touchstart mousedown":"mousedown",An=Me.extend({options:{clickTolerance:3},initialize:function(se,he,xe,Ae){pe(this,Ae),this._element=se,this._dragStartTarget=he||se,this._preventOutline=xe},enable:function(){this._enabled||(qt(this._dragStartTarget,ur,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(An._dragging===this&&this.finishDrag(!0),en(this._dragStartTarget,ur,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(se){if(this._enabled&&(this._moved=!1,!Ma(this._element,"leaflet-zoom-anim"))){if(se.touches&&se.touches.length!==1){An._dragging===this&&this.finishDrag();return}if(!(An._dragging||se.shiftKey||se.which!==1&&se.button!==1&&!se.touches)&&(An._dragging=this,this._preventOutline&&Da(this._element),Pa(),Qn(),!this._moving)){this.fire("down");var he=se.touches?se.touches[0]:se,xe=ar(this._element);this._startPoint=new we(he.clientX,he.clientY),this._startPos=Ln(this._element),this._parentScale=za(xe);var Ae=se.type==="mousedown";qt(document,Ae?"mousemove":"touchmove",this._onMove,this),qt(document,Ae?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(se){if(this._enabled){if(se.touches&&se.touches.length>1){this._moved=!0;return}var he=se.touches&&se.touches.length===1?se.touches[0]:se,xe=new we(he.clientX,he.clientY)._subtract(this._startPoint);!xe.x&&!xe.y||Math.abs(xe.x)+Math.abs(xe.y)<this.options.clickTolerance||(xe.x/=this._parentScale.x,xe.y/=this._parentScale.y,un(se),this._moved||(this.fire("dragstart"),this._moved=!0,Wt(document.body,"leaflet-dragging"),this._lastTarget=se.target||se.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Wt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(xe),this._moving=!0,this._lastEvent=se,this._updatePosition())}},_updatePosition:function(){var se={originalEvent:this._lastEvent};this.fire("predrag",se),ln(this._element,this._newPos),this.fire("drag",se)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(se){nn(document.body,"leaflet-dragging"),this._lastTarget&&(nn(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),en(document,"mousemove touchmove",this._onMove,this),en(document,"mouseup touchend touchcancel",this._onUp,this),La(),ea();var he=this._moved&&this._moving;this._moving=!1,An._dragging=!1,he&&this.fire("dragend",{noInertia:se,distance:this._newPos.distanceTo(this._startPos)})}});function hr(se,he,xe){var Ae,He=[1,4,2,8],Xe,ot,ft,gt,Vt,zt,jt,Ut;for(Xe=0,zt=se.length;Xe<zt;Xe++)se[Xe]._code=zn(se[Xe],he);for(ft=0;ft<4;ft++){for(jt=He[ft],Ae=[],Xe=0,zt=se.length,ot=zt-1;Xe<zt;ot=Xe++)gt=se[Xe],Vt=se[ot],gt._code&jt?Vt._code&jt||(Ut=ba(Vt,gt,jt,he,xe),Ut._code=zn(Ut,he),Ae.push(Ut)):(Vt._code&jt&&(Ut=ba(Vt,gt,jt,he,xe),Ut._code=zn(Ut,he),Ae.push(Ut)),Ae.push(gt));se=Ae}return se}function mr(se,he){var xe,Ae,He,Xe,ot,ft,gt,Vt,zt;if(!se||se.length===0)throw new Error("latlngs not passed");vn(se)||(console.warn("latlngs are not flat! Only the first ring will be used"),se=se[0]);var jt=Ge([0,0]),Ut=je(se),mn=Ut.getNorthWest().distanceTo(Ut.getSouthWest())*Ut.getNorthEast().distanceTo(Ut.getNorthWest());mn<1700&&(jt=qa(se));var dn=se.length,gn=[];for(xe=0;xe<dn;xe++){var fn=Ge(se[xe]);gn.push(he.project(Ge([fn.lat-jt.lat,fn.lng-jt.lng])))}for(ft=gt=Vt=0,xe=0,Ae=dn-1;xe<dn;Ae=xe++)He=gn[xe],Xe=gn[Ae],ot=He.y*Xe.x-Xe.y*He.x,gt+=(He.x+Xe.x)*ot,Vt+=(He.y+Xe.y)*ot,ft+=ot*3;ft===0?zt=gn[0]:zt=[gt/ft,Vt/ft];var Wn=he.unproject(Fe(zt));return Ge([Wn.lat+jt.lat,Wn.lng+jt.lng])}function qa(se){for(var he=0,xe=0,Ae=0,He=0;He<se.length;He++){var Xe=Ge(se[He]);he+=Xe.lat,xe+=Xe.lng,Ae++}return Ge([he/Ae,xe/Ae])}var so={__proto__:null,clipPolygon:hr,polygonCenter:mr,centroid:qa};function pr(se,he){if(!he||!se.length)return se.slice();var xe=he*he;return se=uo(se,xe),se=co(se,xe),se}function br(se,he,xe){return Math.sqrt(ra(se,he,xe,!0))}function lo(se,he,xe){return ra(se,he,xe)}function co(se,he){var xe=se.length,Ae=typeof Uint8Array<"u"?Uint8Array:Array,He=new Ae(xe);He[0]=He[xe-1]=1,Wa(se,He,he,0,xe-1);var Xe,ot=[];for(Xe=0;Xe<xe;Xe++)He[Xe]&&ot.push(se[Xe]);return ot}function Wa(se,he,xe,Ae,He){var Xe=0,ot,ft,gt;for(ft=Ae+1;ft<=He-1;ft++)gt=ra(se[ft],se[Ae],se[He],!0),gt>Xe&&(ot=ft,Xe=gt);Xe>xe&&(he[ot]=1,Wa(se,he,xe,Ae,ot),Wa(se,he,xe,ot,He))}function uo(se,he){for(var xe=[se[0]],Ae=1,He=0,Xe=se.length;Ae<Xe;Ae++)ho(se[Ae],se[He])>he&&(xe.push(se[Ae]),He=Ae);return He<Xe-1&&xe.push(se[Xe-1]),xe}var vr;function gr(se,he,xe,Ae,He){var Xe=Ae?vr:zn(se,xe),ot=zn(he,xe),ft,gt,Vt;for(vr=ot;;){if(!(Xe|ot))return[se,he];if(Xe&ot)return!1;ft=Xe||ot,gt=ba(se,he,ft,xe,He),Vt=zn(gt,xe),ft===Xe?(se=gt,Xe=Vt):(he=gt,ot=Vt)}}function ba(se,he,xe,Ae,He){var Xe=he.x-se.x,ot=he.y-se.y,ft=Ae.min,gt=Ae.max,Vt,zt;return xe&8?(Vt=se.x+Xe*(gt.y-se.y)/ot,zt=gt.y):xe&4?(Vt=se.x+Xe*(ft.y-se.y)/ot,zt=ft.y):xe&2?(Vt=gt.x,zt=se.y+ot*(gt.x-se.x)/Xe):xe&1&&(Vt=ft.x,zt=se.y+ot*(ft.x-se.x)/Xe),new we(Vt,zt,He)}function zn(se,he){var xe=0;return se.x<he.min.x?xe|=1:se.x>he.max.x&&(xe|=2),se.y<he.min.y?xe|=4:se.y>he.max.y&&(xe|=8),xe}function ho(se,he){var xe=he.x-se.x,Ae=he.y-se.y;return xe*xe+Ae*Ae}function ra(se,he,xe,Ae){var He=he.x,Xe=he.y,ot=xe.x-He,ft=xe.y-Xe,gt=ot*ot+ft*ft,Vt;return gt>0&&(Vt=((se.x-He)*ot+(se.y-Xe)*ft)/gt,Vt>1?(He=xe.x,Xe=xe.y):Vt>0&&(He+=ot*Vt,Xe+=ft*Vt)),ot=se.x-He,ft=se.y-Xe,Ae?ot*ot+ft*ft:new we(He,Xe)}function vn(se){return!$e(se[0])||typeof se[0][0]!="object"&&typeof se[0][0]<"u"}function $r(se){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),vn(se)}function yr(se,he){var xe,Ae,He,Xe,ot,ft,gt,Vt;if(!se||se.length===0)throw new Error("latlngs not passed");vn(se)||(console.warn("latlngs are not flat! Only the first ring will be used"),se=se[0]);var zt=Ge([0,0]),jt=je(se),Ut=jt.getNorthWest().distanceTo(jt.getSouthWest())*jt.getNorthEast().distanceTo(jt.getNorthWest());Ut<1700&&(zt=qa(se));var mn=se.length,dn=[];for(xe=0;xe<mn;xe++){var gn=Ge(se[xe]);dn.push(he.project(Ge([gn.lat-zt.lat,gn.lng-zt.lng])))}for(xe=0,Ae=0;xe<mn-1;xe++)Ae+=dn[xe].distanceTo(dn[xe+1])/2;if(Ae===0)Vt=dn[0];else for(xe=0,Xe=0;xe<mn-1;xe++)if(ot=dn[xe],ft=dn[xe+1],He=ot.distanceTo(ft),Xe+=He,Xe>Ae){gt=(Xe-Ae)/He,Vt=[ft.x-gt*(ft.x-ot.x),ft.y-gt*(ft.y-ot.y)];break}var fn=he.unproject(Fe(Vt));return Ge([fn.lat+zt.lat,fn.lng+zt.lng])}var mo={__proto__:null,simplify:pr,pointToSegmentDistance:br,closestPointOnSegment:lo,clipSegment:gr,_getEdgeIntersection:ba,_getBitCode:zn,_sqClosestPointOnSegment:ra,isFlat:vn,_flat:$r,polylineCenter:yr},Ua={project:function(se){return new we(se.lng,se.lat)},unproject:function(se){return new We(se.y,se.x)},bounds:new Ie([-180,-90],[180,90])},Ya={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Ie([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(se){var he=Math.PI/180,xe=this.R,Ae=se.lat*he,He=this.R_MINOR/xe,Xe=Math.sqrt(1-He*He),ot=Xe*Math.sin(Ae),ft=Math.tan(Math.PI/4-Ae/2)/Math.pow((1-ot)/(1+ot),Xe/2);return Ae=-xe*Math.log(Math.max(ft,1e-10)),new we(se.lng*he*xe,Ae)},unproject:function(se){for(var he=180/Math.PI,xe=this.R,Ae=this.R_MINOR/xe,He=Math.sqrt(1-Ae*Ae),Xe=Math.exp(-se.y/xe),ot=Math.PI/2-2*Math.atan(Xe),ft=0,gt=.1,Vt;ft<15&&Math.abs(gt)>1e-7;ft++)Vt=He*Math.sin(ot),Vt=Math.pow((1-Vt)/(1+Vt),He/2),gt=Math.PI/2-2*Math.atan(Xe*Vt)-ot,ot+=gt;return new We(ot*he,se.x*he/xe)}},fo={__proto__:null,LonLat:Ua,Mercator:Ya,SphericalMercator:Et},po=re({},et,{code:"EPSG:3395",projection:Ya,transformation:function(){var se=.5/(Math.PI*Ya.R);return Pt(se,.5,-se,.5)}()}),_r=re({},et,{code:"EPSG:4326",projection:Ua,transformation:Pt(1/180,1,-1/180,.5)}),bo=re({},Ke,{projection:Ua,transformation:Pt(1,0,-1,0),scale:function(se){return Math.pow(2,se)},zoom:function(se){return Math.log(se)/Math.LN2},distance:function(se,he){var xe=he.lng-se.lng,Ae=he.lat-se.lat;return Math.sqrt(xe*xe+Ae*Ae)},infinite:!0});Ke.Earth=et,Ke.EPSG3395=po,Ke.EPSG3857=_t,Ke.EPSG900913=Ze,Ke.EPSG4326=_r,Ke.Simple=bo;var _n=Me.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(se){return se.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(se){return se&&se.removeLayer(this),this},getPane:function(se){return this._map.getPane(se?this.options[se]||se:this.options.pane)},addInteractiveTarget:function(se){return this._map._targets[ce(se)]=this,this},removeInteractiveTarget:function(se){return delete this._map._targets[ce(se)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(se){var he=se.target;if(he.hasLayer(this)){if(this._map=he,this._zoomAnimated=he._zoomAnimated,this.getEvents){var xe=this.getEvents();he.on(xe,this),this.once("remove",function(){he.off(xe,this)},this)}this.onAdd(he),this.fire("add"),he.fire("layeradd",{layer:this})}}});Kt.include({addLayer:function(se){if(!se._layerAdd)throw new Error("The provided object is not a Layer.");var he=ce(se);return this._layers[he]?this:(this._layers[he]=se,se._mapToAdd=this,se.beforeAdd&&se.beforeAdd(this),this.whenReady(se._layerAdd,se),this)},removeLayer:function(se){var he=ce(se);return this._layers[he]?(this._loaded&&se.onRemove(this),delete this._layers[he],this._loaded&&(this.fire("layerremove",{layer:se}),se.fire("remove")),se._map=se._mapToAdd=null,this):this},hasLayer:function(se){return ce(se)in this._layers},eachLayer:function(se,he){for(var xe in this._layers)se.call(he,this._layers[xe]);return this},_addLayers:function(se){se=se?$e(se)?se:[se]:[];for(var he=0,xe=se.length;he<xe;he++)this.addLayer(se[he])},_addZoomLimit:function(se){(!isNaN(se.options.maxZoom)||!isNaN(se.options.minZoom))&&(this._zoomBoundLayers[ce(se)]=se,this._updateZoomLevels())},_removeZoomLimit:function(se){var he=ce(se);this._zoomBoundLayers[he]&&(delete this._zoomBoundLayers[he],this._updateZoomLevels())},_updateZoomLevels:function(){var se=1/0,he=-1/0,xe=this._getZoomSpan();for(var Ae in this._zoomBoundLayers){var He=this._zoomBoundLayers[Ae].options;se=He.minZoom===void 0?se:Math.min(se,He.minZoom),he=He.maxZoom===void 0?he:Math.max(he,He.maxZoom)}this._layersMaxZoom=he===-1/0?void 0:he,this._layersMinZoom=se===1/0?void 0:se,xe!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Hn=_n.extend({initialize:function(se,he){pe(this,he),this._layers={};var xe,Ae;if(se)for(xe=0,Ae=se.length;xe<Ae;xe++)this.addLayer(se[xe])},addLayer:function(se){var he=this.getLayerId(se);return this._layers[he]=se,this._map&&this._map.addLayer(se),this},removeLayer:function(se){var he=se in this._layers?se:this.getLayerId(se);return this._map&&this._layers[he]&&this._map.removeLayer(this._layers[he]),delete this._layers[he],this},hasLayer:function(se){var he=typeof se=="number"?se:this.getLayerId(se);return he in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(se){var he=Array.prototype.slice.call(arguments,1),xe,Ae;for(xe in this._layers)Ae=this._layers[xe],Ae[se]&&Ae[se].apply(Ae,he);return this},onAdd:function(se){this.eachLayer(se.addLayer,se)},onRemove:function(se){this.eachLayer(se.removeLayer,se)},eachLayer:function(se,he){for(var xe in this._layers)se.call(he,this._layers[xe]);return this},getLayer:function(se){return this._layers[se]},getLayers:function(){var se=[];return this.eachLayer(se.push,se),se},setZIndex:function(se){return this.invoke("setZIndex",se)},getLayerId:function(se){return ce(se)}}),vo=function(se,he){return new Hn(se,he)},Cn=Hn.extend({addLayer:function(se){return this.hasLayer(se)?this:(se.addEventParent(this),Hn.prototype.addLayer.call(this,se),this.fire("layeradd",{layer:se}))},removeLayer:function(se){return this.hasLayer(se)?(se in this._layers&&(se=this._layers[se]),se.removeEventParent(this),Hn.prototype.removeLayer.call(this,se),this.fire("layerremove",{layer:se})):this},setStyle:function(se){return this.invoke("setStyle",se)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var se=new qe;for(var he in this._layers){var xe=this._layers[he];se.extend(xe.getBounds?xe.getBounds():xe.getLatLng())}return se}}),go=function(se,he){return new Cn(se,he)},jn=Be.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(se){pe(this,se)},createIcon:function(se){return this._createIcon("icon",se)},createShadow:function(se){return this._createIcon("shadow",se)},_createIcon:function(se,he){var xe=this._getIconUrl(se);if(!xe){if(se==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var Ae=this._createImg(xe,he&&he.tagName==="IMG"?he:null);return this._setIconStyles(Ae,se),(this.options.crossOrigin||this.options.crossOrigin==="")&&(Ae.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),Ae},_setIconStyles:function(se,he){var xe=this.options,Ae=xe[he+"Size"];typeof Ae=="number"&&(Ae=[Ae,Ae]);var He=Fe(Ae),Xe=Fe(he==="shadow"&&xe.shadowAnchor||xe.iconAnchor||He&&He.divideBy(2,!0));se.className="leaflet-marker-"+he+" "+(xe.className||""),Xe&&(se.style.marginLeft=-Xe.x+"px",se.style.marginTop=-Xe.y+"px"),He&&(se.style.width=He.x+"px",se.style.height=He.y+"px")},_createImg:function(se,he){return he=he||document.createElement("img"),he.src=se,he},_getIconUrl:function(se){return Nt.retina&&this.options[se+"RetinaUrl"]||this.options[se+"Url"]}});function $o(se){return new jn(se)}var oa=jn.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(se){return typeof oa.imagePath!="string"&&(oa.imagePath=this._detectIconPath()),(this.options.imagePath||oa.imagePath)+jn.prototype._getIconUrl.call(this,se)},_stripUrl:function(se){var he=function(xe,Ae,He){var Xe=Ae.exec(xe);return Xe&&Xe[He]};return se=he(se,/^url\((['"])?(.+)\1\)$/,2),se&&he(se,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var se=Qt("div","leaflet-default-icon-path",document.body),he=Jn(se,"background-image")||Jn(se,"backgroundImage");if(document.body.removeChild(se),he=this._stripUrl(he),he)return he;var xe=document.querySelector('link[href$="leaflet.css"]');return xe?xe.href.substring(0,xe.href.length-11-1):""}}),kr=xn.extend({initialize:function(se){this._marker=se},addHooks:function(){var se=this._marker._icon;this._draggable||(this._draggable=new An(se,se,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Wt(se,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&nn(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(se){var he=this._marker,xe=he._map,Ae=this._marker.options.autoPanSpeed,He=this._marker.options.autoPanPadding,Xe=Ln(he._icon),ot=xe.getPixelBounds(),ft=xe.getPixelOrigin(),gt=Ue(ot.min._subtract(ft).add(He),ot.max._subtract(ft).subtract(He));if(!gt.contains(Xe)){var Vt=Fe((Math.max(gt.max.x,Xe.x)-gt.max.x)/(ot.max.x-gt.max.x)-(Math.min(gt.min.x,Xe.x)-gt.min.x)/(ot.min.x-gt.min.x),(Math.max(gt.max.y,Xe.y)-gt.max.y)/(ot.max.y-gt.max.y)-(Math.min(gt.min.y,Xe.y)-gt.min.y)/(ot.min.y-gt.min.y)).multiplyBy(Ae);xe.panBy(Vt,{animate:!1}),this._draggable._newPos._add(Vt),this._draggable._startPos._add(Vt),ln(he._icon,this._draggable._newPos),this._onDrag(se),this._panRequest=Re(this._adjustPan.bind(this,se))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(se){this._marker.options.autoPan&&(Oe(this._panRequest),this._panRequest=Re(this._adjustPan.bind(this,se)))},_onDrag:function(se){var he=this._marker,xe=he._shadow,Ae=Ln(he._icon),He=he._map.layerPointToLatLng(Ae);xe&&ln(xe,Ae),he._latlng=He,se.latlng=He,se.oldLatLng=this._oldLatLng,he.fire("move",se).fire("drag",se)},_onDragEnd:function(se){Oe(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",se)}}),va=_n.extend({options:{icon:new oa,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(se,he){pe(this,he),this._latlng=Ge(se)},onAdd:function(se){this._zoomAnimated=this._zoomAnimated&&se.options.markerZoomAnimation,this._zoomAnimated&&se.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(se){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&se.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(se){var he=this._latlng;return this._latlng=Ge(se),this.update(),this.fire("move",{oldLatLng:he,latlng:this._latlng})},setZIndexOffset:function(se){return this.options.zIndexOffset=se,this.update()},getIcon:function(){return this.options.icon},setIcon:function(se){return this.options.icon=se,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var se=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(se)}return this},_initIcon:function(){var se=this.options,he="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),xe=se.icon.createIcon(this._icon),Ae=!1;xe!==this._icon&&(this._icon&&this._removeIcon(),Ae=!0,se.title&&(xe.title=se.title),xe.tagName==="IMG"&&(xe.alt=se.alt||"")),Wt(xe,he),se.keyboard&&(xe.tabIndex="0",xe.setAttribute("role","button")),this._icon=xe,se.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&qt(xe,"focus",this._panOnFocus,this);var He=se.icon.createShadow(this._shadow),Xe=!1;He!==this._shadow&&(this._removeShadow(),Xe=!0),He&&(Wt(He,he),He.alt=""),this._shadow=He,se.opacity<1&&this._updateOpacity(),Ae&&this.getPane().appendChild(this._icon),this._initInteraction(),He&&Xe&&this.getPane(se.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&en(this._icon,"focus",this._panOnFocus,this),tn(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&tn(this._shadow),this._shadow=null},_setPos:function(se){this._icon&&ln(this._icon,se),this._shadow&&ln(this._shadow,se),this._zIndex=se.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(se){this._icon&&(this._icon.style.zIndex=this._zIndex+se)},_animateZoom:function(se){var he=this._map._latLngToNewLayerPoint(this._latlng,se.zoom,se.center).round();this._setPos(he)},_initInteraction:function(){if(this.options.interactive&&(Wt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),kr)){var se=this.options.draggable;this.dragging&&(se=this.dragging.enabled(),this.dragging.disable()),this.dragging=new kr(this),se&&this.dragging.enable()}},setOpacity:function(se){return this.options.opacity=se,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var se=this.options.opacity;this._icon&&bn(this._icon,se),this._shadow&&bn(this._shadow,se)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var se=this._map;if(se){var he=this.options.icon.options,xe=he.iconSize?Fe(he.iconSize):Fe(0,0),Ae=he.iconAnchor?Fe(he.iconAnchor):Fe(0,0);se.panInside(this._latlng,{paddingTopLeft:Ae,paddingBottomRight:xe.subtract(Ae)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function yo(se,he){return new va(se,he)}var Tn=_n.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(se){this._renderer=se.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(se){return pe(this,se),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&se&&Object.prototype.hasOwnProperty.call(se,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ga=Tn.extend({options:{fill:!0,radius:10},initialize:function(se,he){pe(this,he),this._latlng=Ge(se),this._radius=this.options.radius},setLatLng:function(se){var he=this._latlng;return this._latlng=Ge(se),this.redraw(),this.fire("move",{oldLatLng:he,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(se){return this.options.radius=this._radius=se,this.redraw()},getRadius:function(){return this._radius},setStyle:function(se){var he=se&&se.radius||this._radius;return Tn.prototype.setStyle.call(this,se),this.setRadius(he),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var se=this._radius,he=this._radiusY||se,xe=this._clickTolerance(),Ae=[se+xe,he+xe];this._pxBounds=new Ie(this._point.subtract(Ae),this._point.add(Ae))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(se){return se.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function _o(se,he){return new ga(se,he)}var Xa=ga.extend({initialize:function(se,he,xe){if(typeof he=="number"&&(he=re({},xe,{radius:he})),pe(this,he),this._latlng=Ge(se),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(se){return this._mRadius=se,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var se=[this._radius,this._radiusY||this._radius];return new qe(this._map.layerPointToLatLng(this._point.subtract(se)),this._map.layerPointToLatLng(this._point.add(se)))},setStyle:Tn.prototype.setStyle,_project:function(){var se=this._latlng.lng,he=this._latlng.lat,xe=this._map,Ae=xe.options.crs;if(Ae.distance===et.distance){var He=Math.PI/180,Xe=this._mRadius/et.R/He,ot=xe.project([he+Xe,se]),ft=xe.project([he-Xe,se]),gt=ot.add(ft).divideBy(2),Vt=xe.unproject(gt).lat,zt=Math.acos((Math.cos(Xe*He)-Math.sin(he*He)*Math.sin(Vt*He))/(Math.cos(he*He)*Math.cos(Vt*He)))/He;(isNaN(zt)||zt===0)&&(zt=Xe/Math.cos(Math.PI/180*he)),this._point=gt.subtract(xe.getPixelOrigin()),this._radius=isNaN(zt)?0:gt.x-xe.project([Vt,se-zt]).x,this._radiusY=gt.y-ot.y}else{var jt=Ae.unproject(Ae.project(this._latlng).subtract([this._mRadius,0]));this._point=xe.latLngToLayerPoint(this._latlng),this._radius=this._point.x-xe.latLngToLayerPoint(jt).x}this._updateBounds()}});function ko(se,he,xe){return new Xa(se,he,xe)}var Sn=Tn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(se,he){pe(this,he),this._setLatLngs(se)},getLatLngs:function(){return this._latlngs},setLatLngs:function(se){return this._setLatLngs(se),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(se){for(var he=1/0,xe=null,Ae=ra,He,Xe,ot=0,ft=this._parts.length;ot<ft;ot++)for(var gt=this._parts[ot],Vt=1,zt=gt.length;Vt<zt;Vt++){He=gt[Vt-1],Xe=gt[Vt];var jt=Ae(se,He,Xe,!0);jt<he&&(he=jt,xe=Ae(se,He,Xe))}return xe&&(xe.distance=Math.sqrt(he)),xe},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return yr(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(se,he){return he=he||this._defaultShape(),se=Ge(se),he.push(se),this._bounds.extend(se),this.redraw()},_setLatLngs:function(se){this._bounds=new qe,this._latlngs=this._convertLatLngs(se)},_defaultShape:function(){return vn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(se){for(var he=[],xe=vn(se),Ae=0,He=se.length;Ae<He;Ae++)xe?(he[Ae]=Ge(se[Ae]),this._bounds.extend(he[Ae])):he[Ae]=this._convertLatLngs(se[Ae]);return he},_project:function(){var se=new Ie;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,se),this._bounds.isValid()&&se.isValid()&&(this._rawPxBounds=se,this._updateBounds())},_updateBounds:function(){var se=this._clickTolerance(),he=new we(se,se);this._rawPxBounds&&(this._pxBounds=new Ie([this._rawPxBounds.min.subtract(he),this._rawPxBounds.max.add(he)]))},_projectLatlngs:function(se,he,xe){var Ae=se[0]instanceof We,He=se.length,Xe,ot;if(Ae){for(ot=[],Xe=0;Xe<He;Xe++)ot[Xe]=this._map.latLngToLayerPoint(se[Xe]),xe.extend(ot[Xe]);he.push(ot)}else for(Xe=0;Xe<He;Xe++)this._projectLatlngs(se[Xe],he,xe)},_clipPoints:function(){var se=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(se))){if(this.options.noClip){this._parts=this._rings;return}var he=this._parts,xe,Ae,He,Xe,ot,ft,gt;for(xe=0,He=0,Xe=this._rings.length;xe<Xe;xe++)for(gt=this._rings[xe],Ae=0,ot=gt.length;Ae<ot-1;Ae++)ft=gr(gt[Ae],gt[Ae+1],se,Ae,!0),ft&&(he[He]=he[He]||[],he[He].push(ft[0]),(ft[1]!==gt[Ae+1]||Ae===ot-2)&&(he[He].push(ft[1]),He++))}},_simplifyPoints:function(){for(var se=this._parts,he=this.options.smoothFactor,xe=0,Ae=se.length;xe<Ae;xe++)se[xe]=pr(se[xe],he)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(se,he){var xe,Ae,He,Xe,ot,ft,gt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(se))return!1;for(xe=0,Xe=this._parts.length;xe<Xe;xe++)for(ft=this._parts[xe],Ae=0,ot=ft.length,He=ot-1;Ae<ot;He=Ae++)if(!(!he&&Ae===0)&&br(se,ft[He],ft[Ae])<=gt)return!0;return!1}});function xo(se,he){return new Sn(se,he)}Sn._flat=$r;var Gn=Sn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return mr(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(se){var he=Sn.prototype._convertLatLngs.call(this,se),xe=he.length;return xe>=2&&he[0]instanceof We&&he[0].equals(he[xe-1])&&he.pop(),he},_setLatLngs:function(se){Sn.prototype._setLatLngs.call(this,se),vn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return vn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var se=this._renderer._bounds,he=this.options.weight,xe=new we(he,he);if(se=new Ie(se.min.subtract(xe),se.max.add(xe)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(se))){if(this.options.noClip){this._parts=this._rings;return}for(var Ae=0,He=this._rings.length,Xe;Ae<He;Ae++)Xe=hr(this._rings[Ae],se,!0),Xe.length&&this._parts.push(Xe)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(se){var he=!1,xe,Ae,He,Xe,ot,ft,gt,Vt;if(!this._pxBounds||!this._pxBounds.contains(se))return!1;for(Xe=0,gt=this._parts.length;Xe<gt;Xe++)for(xe=this._parts[Xe],ot=0,Vt=xe.length,ft=Vt-1;ot<Vt;ft=ot++)Ae=xe[ot],He=xe[ft],Ae.y>se.y!=He.y>se.y&&se.x<(He.x-Ae.x)*(se.y-Ae.y)/(He.y-Ae.y)+Ae.x&&(he=!he);return he||Sn.prototype._containsPoint.call(this,se,!0)}});function wo(se,he){return new Gn(se,he)}var Bn=Cn.extend({initialize:function(se,he){pe(this,he),this._layers={},se&&this.addData(se)},addData:function(se){var he=$e(se)?se:se.features,xe,Ae,He;if(he){for(xe=0,Ae=he.length;xe<Ae;xe++)He=he[xe],(He.geometries||He.geometry||He.features||He.coordinates)&&this.addData(He);return this}var Xe=this.options;if(Xe.filter&&!Xe.filter(se))return this;var ot=$a(se,Xe);return ot?(ot.feature=ka(se),ot.defaultOptions=ot.options,this.resetStyle(ot),Xe.onEachFeature&&Xe.onEachFeature(se,ot),this.addLayer(ot)):this},resetStyle:function(se){return se===void 0?this.eachLayer(this.resetStyle,this):(se.options=re({},se.defaultOptions),this._setLayerStyle(se,this.options.style),this)},setStyle:function(se){return this.eachLayer(function(he){this._setLayerStyle(he,se)},this)},_setLayerStyle:function(se,he){se.setStyle&&(typeof he=="function"&&(he=he(se.feature)),se.setStyle(he))}});function $a(se,he){var xe=se.type==="Feature"?se.geometry:se,Ae=xe?xe.coordinates:null,He=[],Xe=he&&he.pointToLayer,ot=he&&he.coordsToLatLng||Ka,ft,gt,Vt,zt;if(!Ae&&!xe)return null;switch(xe.type){case"Point":return ft=ot(Ae),xr(Xe,se,ft,he);case"MultiPoint":for(Vt=0,zt=Ae.length;Vt<zt;Vt++)ft=ot(Ae[Vt]),He.push(xr(Xe,se,ft,he));return new Cn(He);case"LineString":case"MultiLineString":return gt=ya(Ae,xe.type==="LineString"?0:1,ot),new Sn(gt,he);case"Polygon":case"MultiPolygon":return gt=ya(Ae,xe.type==="Polygon"?1:2,ot),new Gn(gt,he);case"GeometryCollection":for(Vt=0,zt=xe.geometries.length;Vt<zt;Vt++){var jt=$a({geometry:xe.geometries[Vt],type:"Feature",properties:se.properties},he);jt&&He.push(jt)}return new Cn(He);case"FeatureCollection":for(Vt=0,zt=xe.features.length;Vt<zt;Vt++){var Ut=$a(xe.features[Vt],he);Ut&&He.push(Ut)}return new Cn(He);default:throw new Error("Invalid GeoJSON object.")}}function xr(se,he,xe,Ae){return se?se(he,xe):new va(xe,Ae&&Ae.markersInheritOptions&&Ae)}function Ka(se){return new We(se[1],se[0],se[2])}function ya(se,he,xe){for(var Ae=[],He=0,Xe=se.length,ot;He<Xe;He++)ot=he?ya(se[He],he-1,xe):(xe||Ka)(se[He]),Ae.push(ot);return Ae}function Ja(se,he){return se=Ge(se),se.alt!==void 0?[me(se.lng,he),me(se.lat,he),me(se.alt,he)]:[me(se.lng,he),me(se.lat,he)]}function _a(se,he,xe,Ae){for(var He=[],Xe=0,ot=se.length;Xe<ot;Xe++)He.push(he?_a(se[Xe],vn(se[Xe])?0:he-1,xe,Ae):Ja(se[Xe],Ae));return!he&&xe&&He.length>0&&He.push(He[0].slice()),He}function Zn(se,he){return se.feature?re({},se.feature,{geometry:he}):ka(he)}function ka(se){return se.type==="Feature"||se.type==="FeatureCollection"?se:{type:"Feature",properties:{},geometry:se}}var Qa={toGeoJSON:function(se){return Zn(this,{type:"Point",coordinates:Ja(this.getLatLng(),se)})}};va.include(Qa),Xa.include(Qa),ga.include(Qa),Sn.include({toGeoJSON:function(se){var he=!vn(this._latlngs),xe=_a(this._latlngs,he?1:0,!1,se);return Zn(this,{type:(he?"Multi":"")+"LineString",coordinates:xe})}}),Gn.include({toGeoJSON:function(se){var he=!vn(this._latlngs),xe=he&&!vn(this._latlngs[0]),Ae=_a(this._latlngs,xe?2:he?1:0,!0,se);return he||(Ae=[Ae]),Zn(this,{type:(xe?"Multi":"")+"Polygon",coordinates:Ae})}}),Hn.include({toMultiPoint:function(se){var he=[];return this.eachLayer(function(xe){he.push(xe.toGeoJSON(se).geometry.coordinates)}),Zn(this,{type:"MultiPoint",coordinates:he})},toGeoJSON:function(se){var he=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(he==="MultiPoint")return this.toMultiPoint(se);var xe=he==="GeometryCollection",Ae=[];return this.eachLayer(function(He){if(He.toGeoJSON){var Xe=He.toGeoJSON(se);if(xe)Ae.push(Xe.geometry);else{var ot=ka(Xe);ot.type==="FeatureCollection"?Ae.push.apply(Ae,ot.features):Ae.push(ot)}}}),xe?Zn(this,{geometries:Ae,type:"GeometryCollection"}):{type:"FeatureCollection",features:Ae}}});function wr(se,he){return new Bn(se,he)}var Eo=wr,xa=_n.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(se,he,xe){this._url=se,this._bounds=je(he),pe(this,xe)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Wt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){tn(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(se){return this.options.opacity=se,this._image&&this._updateOpacity(),this},setStyle:function(se){return se.opacity&&this.setOpacity(se.opacity),this},bringToFront:function(){return this._map&&Rn(this._image),this},bringToBack:function(){return this._map&&On(this._image),this},setUrl:function(se){return this._url=se,this._image&&(this._image.src=se),this},setBounds:function(se){return this._bounds=je(se),this._map&&this._reset(),this},getEvents:function(){var se={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(se.zoomanim=this._animateZoom),se},setZIndex:function(se){return this.options.zIndex=se,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var se=this._url.tagName==="IMG",he=this._image=se?this._url:Qt("img");if(Wt(he,"leaflet-image-layer"),this._zoomAnimated&&Wt(he,"leaflet-zoom-animated"),this.options.className&&Wt(he,this.options.className),he.onselectstart=ve,he.onmousemove=ve,he.onload=ie(this.fire,this,"load"),he.onerror=ie(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(he.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),se){this._url=he.src;return}he.src=this._url,he.alt=this.options.alt},_animateZoom:function(se){var he=this._map.getZoomScale(se.zoom),xe=this._map._latLngBoundsToNewLayerBounds(this._bounds,se.zoom,se.center).min;Pn(this._image,xe,he)},_reset:function(){var se=this._image,he=new Ie(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),xe=he.getSize();ln(se,he.min),se.style.width=xe.x+"px",se.style.height=xe.y+"px"},_updateOpacity:function(){bn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var se=this.options.errorOverlayUrl;se&&this._url!==se&&(this._url=se,this._image.src=se)},getCenter:function(){return this._bounds.getCenter()}}),Co=function(se,he,xe){return new xa(se,he,xe)},Er=xa.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var se=this._url.tagName==="VIDEO",he=this._image=se?this._url:Qt("video");if(Wt(he,"leaflet-image-layer"),this._zoomAnimated&&Wt(he,"leaflet-zoom-animated"),this.options.className&&Wt(he,this.options.className),he.onselectstart=ve,he.onmousemove=ve,he.onloadeddata=ie(this.fire,this,"load"),se){for(var xe=he.getElementsByTagName("source"),Ae=[],He=0;He<xe.length;He++)Ae.push(xe[He].src);this._url=xe.length>0?Ae:[he.src];return}$e(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(he.style,"objectFit")&&(he.style.objectFit="fill"),he.autoplay=!!this.options.autoplay,he.loop=!!this.options.loop,he.muted=!!this.options.muted,he.playsInline=!!this.options.playsInline;for(var Xe=0;Xe<this._url.length;Xe++){var ot=Qt("source");ot.src=this._url[Xe],he.appendChild(ot)}}});function So(se,he,xe){return new Er(se,he,xe)}var Cr=xa.extend({_initImage:function(){var se=this._image=this._url;Wt(se,"leaflet-image-layer"),this._zoomAnimated&&Wt(se,"leaflet-zoom-animated"),this.options.className&&Wt(se,this.options.className),se.onselectstart=ve,se.onmousemove=ve}});function Bo(se,he,xe){return new Cr(se,he,xe)}var wn=_n.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(se,he){se&&(se instanceof We||$e(se))?(this._latlng=Ge(se),pe(this,he)):(pe(this,se),this._source=he),this.options.content&&(this._content=this.options.content)},openOn:function(se){return se=arguments.length?se:this._source._map,se.hasLayer(this)||se.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(se){return this._map?this.close():(arguments.length?this._source=se:se=this._source,this._prepareOpen(),this.openOn(se._map)),this},onAdd:function(se){this._zoomAnimated=se._zoomAnimated,this._container||this._initLayout(),se._fadeAnimated&&bn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),se._fadeAnimated&&bn(this._container,1),this.bringToFront(),this.options.interactive&&(Wt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(se){se._fadeAnimated?(bn(this._container,0),this._removeTimeout=setTimeout(ie(tn,void 0,this._container),200)):tn(this._container),this.options.interactive&&(nn(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(se){return this._latlng=Ge(se),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(se){return this._content=se,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var se={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(se.zoomanim=this._animateZoom),se},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Rn(this._container),this},bringToBack:function(){return this._map&&On(this._container),this},_prepareOpen:function(se){var he=this._source;if(!he._map)return!1;if(he instanceof Cn){he=null;var xe=this._source._layers;for(var Ae in xe)if(xe[Ae]._map){he=xe[Ae];break}if(!he)return!1;this._source=he}if(!se)if(he.getCenter)se=he.getCenter();else if(he.getLatLng)se=he.getLatLng();else if(he.getBounds)se=he.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(se),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var se=this._contentNode,he=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof he=="string")se.innerHTML=he;else{for(;se.hasChildNodes();)se.removeChild(se.firstChild);se.appendChild(he)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var se=this._map.latLngToLayerPoint(this._latlng),he=Fe(this.options.offset),xe=this._getAnchor();this._zoomAnimated?ln(this._container,se.add(xe)):he=he.add(se).add(xe);var Ae=this._containerBottom=-he.y,He=this._containerLeft=-Math.round(this._containerWidth/2)+he.x;this._container.style.bottom=Ae+"px",this._container.style.left=He+"px"}},_getAnchor:function(){return[0,0]}});Kt.include({_initOverlay:function(se,he,xe,Ae){var He=he;return He instanceof se||(He=new se(Ae).setContent(he)),xe&&He.setLatLng(xe),He}}),_n.include({_initOverlay:function(se,he,xe,Ae){var He=xe;return He instanceof se?(pe(He,Ae),He._source=this):(He=he&&!Ae?he:new se(Ae,this),He.setContent(xe)),He}});var wa=wn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(se){return se=arguments.length?se:this._source._map,!se.hasLayer(this)&&se._popup&&se._popup.options.autoClose&&se.removeLayer(se._popup),se._popup=this,wn.prototype.openOn.call(this,se)},onAdd:function(se){wn.prototype.onAdd.call(this,se),se.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Tn||this._source.on("preclick",Fn))},onRemove:function(se){wn.prototype.onRemove.call(this,se),se.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Tn||this._source.off("preclick",Fn))},getEvents:function(){var se=wn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(se.preclick=this.close),this.options.keepInView&&(se.moveend=this._adjustPan),se},_initLayout:function(){var se="leaflet-popup",he=this._container=Qt("div",se+" "+(this.options.className||"")+" leaflet-zoom-animated"),xe=this._wrapper=Qt("div",se+"-content-wrapper",he);if(this._contentNode=Qt("div",se+"-content",xe),na(he),Ha(this._contentNode),qt(he,"contextmenu",Fn),this._tipContainer=Qt("div",se+"-tip-container",he),this._tip=Qt("div",se+"-tip",this._tipContainer),this.options.closeButton){var Ae=this._closeButton=Qt("a",se+"-close-button",he);Ae.setAttribute("role","button"),Ae.setAttribute("aria-label","Close popup"),Ae.href="#close",Ae.innerHTML='<span aria-hidden="true">×</span>',qt(Ae,"click",function(He){un(He),this.close()},this)}},_updateLayout:function(){var se=this._contentNode,he=se.style;he.width="",he.whiteSpace="nowrap";var xe=se.offsetWidth;xe=Math.min(xe,this.options.maxWidth),xe=Math.max(xe,this.options.minWidth),he.width=xe+1+"px",he.whiteSpace="",he.height="";var Ae=se.offsetHeight,He=this.options.maxHeight,Xe="leaflet-popup-scrolled";He&&Ae>He?(he.height=He+"px",Wt(se,Xe)):nn(se,Xe),this._containerWidth=this._container.offsetWidth},_animateZoom:function(se){var he=this._map._latLngToNewLayerPoint(this._latlng,se.zoom,se.center),xe=this._getAnchor();ln(this._container,he.add(xe))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var se=this._map,he=parseInt(Jn(this._container,"marginBottom"),10)||0,xe=this._container.offsetHeight+he,Ae=this._containerWidth,He=new we(this._containerLeft,-xe-this._containerBottom);He._add(Ln(this._container));var Xe=se.layerPointToContainerPoint(He),ot=Fe(this.options.autoPanPadding),ft=Fe(this.options.autoPanPaddingTopLeft||ot),gt=Fe(this.options.autoPanPaddingBottomRight||ot),Vt=se.getSize(),zt=0,jt=0;Xe.x+Ae+gt.x>Vt.x&&(zt=Xe.x+Ae-Vt.x+gt.x),Xe.x-zt-ft.x<0&&(zt=Xe.x-ft.x),Xe.y+xe+gt.y>Vt.y&&(jt=Xe.y+xe-Vt.y+gt.y),Xe.y-jt-ft.y<0&&(jt=Xe.y-ft.y),(zt||jt)&&(this.options.keepInView&&(this._autopanning=!0),se.fire("autopanstart").panBy([zt,jt]))}},_getAnchor:function(){return Fe(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),No=function(se,he){return new wa(se,he)};Kt.mergeOptions({closePopupOnClick:!0}),Kt.include({openPopup:function(se,he,xe){return this._initOverlay(wa,se,he,xe).openOn(this),this},closePopup:function(se){return se=arguments.length?se:this._popup,se&&se.close(),this}}),_n.include({bindPopup:function(se,he){return this._popup=this._initOverlay(wa,this._popup,se,he),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(se){return this._popup&&(this instanceof Cn||(this._popup._source=this),this._popup._prepareOpen(se||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(se){return this._popup&&this._popup.setContent(se),this},getPopup:function(){return this._popup},_openPopup:function(se){if(!(!this._popup||!this._map)){Dn(se);var he=se.layer||se.target;if(this._popup._source===he&&!(he instanceof Tn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(se.latlng);return}this._popup._source=he,this.openPopup(se.latlng)}},_movePopup:function(se){this._popup.setLatLng(se.latlng)},_onKeyPress:function(se){se.originalEvent.keyCode===13&&this._openPopup(se)}});var Ea=wn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(se){wn.prototype.onAdd.call(this,se),this.setOpacity(this.options.opacity),se.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(se){wn.prototype.onRemove.call(this,se),se.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var se=wn.prototype.getEvents.call(this);return this.options.permanent||(se.preclick=this.close),se},_initLayout:function(){var se="leaflet-tooltip",he=se+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Qt("div",he),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+ce(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(se){var he,xe,Ae=this._map,He=this._container,Xe=Ae.latLngToContainerPoint(Ae.getCenter()),ot=Ae.layerPointToContainerPoint(se),ft=this.options.direction,gt=He.offsetWidth,Vt=He.offsetHeight,zt=Fe(this.options.offset),jt=this._getAnchor();ft==="top"?(he=gt/2,xe=Vt):ft==="bottom"?(he=gt/2,xe=0):ft==="center"?(he=gt/2,xe=Vt/2):ft==="right"?(he=0,xe=Vt/2):ft==="left"?(he=gt,xe=Vt/2):ot.x<Xe.x?(ft="right",he=0,xe=Vt/2):(ft="left",he=gt+(zt.x+jt.x)*2,xe=Vt/2),se=se.subtract(Fe(he,xe,!0)).add(zt).add(jt),nn(He,"leaflet-tooltip-right"),nn(He,"leaflet-tooltip-left"),nn(He,"leaflet-tooltip-top"),nn(He,"leaflet-tooltip-bottom"),Wt(He,"leaflet-tooltip-"+ft),ln(He,se)},_updatePosition:function(){var se=this._map.latLngToLayerPoint(this._latlng);this._setPosition(se)},setOpacity:function(se){this.options.opacity=se,this._container&&bn(this._container,se)},_animateZoom:function(se){var he=this._map._latLngToNewLayerPoint(this._latlng,se.zoom,se.center);this._setPosition(he)},_getAnchor:function(){return Fe(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Vo=function(se,he){return new Ea(se,he)};Kt.include({openTooltip:function(se,he,xe){return this._initOverlay(Ea,se,he,xe).openOn(this),this},closeTooltip:function(se){return se.close(),this}}),_n.include({bindTooltip:function(se,he){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ea,this._tooltip,se,he),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(se){if(!(!se&&this._tooltipHandlersAdded)){var he=se?"off":"on",xe={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?xe.add=this._openTooltip:(xe.mouseover=this._openTooltip,xe.mouseout=this.closeTooltip,xe.click=this._openTooltip,this._map?this._addFocusListeners():xe.add=this._addFocusListeners),this._tooltip.options.sticky&&(xe.mousemove=this._moveTooltip),this[he](xe),this._tooltipHandlersAdded=!se}},openTooltip:function(se){return this._tooltip&&(this instanceof Cn||(this._tooltip._source=this),this._tooltip._prepareOpen(se)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(se){return this._tooltip&&this._tooltip.setContent(se),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(se){var he=typeof se.getElement=="function"&&se.getElement();he&&(qt(he,"focus",function(){this._tooltip._source=se,this.openTooltip()},this),qt(he,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(se){var he=typeof se.getElement=="function"&&se.getElement();he&&he.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(se){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var he=this;this._map.once("moveend",function(){he._openOnceFlag=!1,he._openTooltip(se)});return}this._tooltip._source=se.layer||se.target,this.openTooltip(this._tooltip.options.sticky?se.latlng:void 0)}},_moveTooltip:function(se){var he=se.latlng,xe,Ae;this._tooltip.options.sticky&&se.originalEvent&&(xe=this._map.mouseEventToContainerPoint(se.originalEvent),Ae=this._map.containerPointToLayerPoint(xe),he=this._map.layerPointToLatLng(Ae)),this._tooltip.setLatLng(he)}});var Sr=jn.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(se){var he=se&&se.tagName==="DIV"?se:document.createElement("div"),xe=this.options;if(xe.html instanceof Element?(ua(he),he.appendChild(xe.html)):he.innerHTML=xe.html!==!1?xe.html:"",xe.bgPos){var Ae=Fe(xe.bgPos);he.style.backgroundPosition=-Ae.x+"px "+-Ae.y+"px"}return this._setIconStyles(he,"icon"),he},createShadow:function(){return null}});function Mo(se){return new Sr(se)}jn.Default=oa;var ia=_n.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Nt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(se){pe(this,se)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(se){se._addZoomLimit(this)},onRemove:function(se){this._removeAllTiles(),tn(this._container),se._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Rn(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(On(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(se){return this.options.opacity=se,this._updateOpacity(),this},setZIndex:function(se){return this.options.zIndex=se,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var se=this._clampZoom(this._map.getZoom());se!==this._tileZoom&&(this._tileZoom=se,this._updateLevels()),this._update()}return this},getEvents:function(){var se={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=de(this._onMoveEnd,this.options.updateInterval,this)),se.move=this._onMove),this._zoomAnimated&&(se.zoomanim=this._animateZoom),se},createTile:function(){return document.createElement("div")},getTileSize:function(){var se=this.options.tileSize;return se instanceof we?se:new we(se,se)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(se){for(var he=this.getPane().children,xe=-se(-1/0,1/0),Ae=0,He=he.length,Xe;Ae<He;Ae++)Xe=he[Ae].style.zIndex,he[Ae]!==this._container&&Xe&&(xe=se(xe,+Xe));isFinite(xe)&&(this.options.zIndex=xe+se(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Nt.ielt9){bn(this._container,this.options.opacity);var se=+new Date,he=!1,xe=!1;for(var Ae in this._tiles){var He=this._tiles[Ae];if(!(!He.current||!He.loaded)){var Xe=Math.min(1,(se-He.loaded)/200);bn(He.el,Xe),Xe<1?he=!0:(He.active?xe=!0:this._onOpaqueTile(He),He.active=!0)}}xe&&!this._noPrune&&this._pruneTiles(),he&&(Oe(this._fadeFrame),this._fadeFrame=Re(this._updateOpacity,this))}},_onOpaqueTile:ve,_initContainer:function(){this._container||(this._container=Qt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var se=this._tileZoom,he=this.options.maxZoom;if(se!==void 0){for(var xe in this._levels)xe=Number(xe),this._levels[xe].el.children.length||xe===se?(this._levels[xe].el.style.zIndex=he-Math.abs(se-xe),this._onUpdateLevel(xe)):(tn(this._levels[xe].el),this._removeTilesAtZoom(xe),this._onRemoveLevel(xe),delete this._levels[xe]);var Ae=this._levels[se],He=this._map;return Ae||(Ae=this._levels[se]={},Ae.el=Qt("div","leaflet-tile-container leaflet-zoom-animated",this._container),Ae.el.style.zIndex=he,Ae.origin=He.project(He.unproject(He.getPixelOrigin()),se).round(),Ae.zoom=se,this._setZoomTransform(Ae,He.getCenter(),He.getZoom()),ve(Ae.el.offsetWidth),this._onCreateLevel(Ae)),this._level=Ae,Ae}},_onUpdateLevel:ve,_onRemoveLevel:ve,_onCreateLevel:ve,_pruneTiles:function(){if(this._map){var se,he,xe=this._map.getZoom();if(xe>this.options.maxZoom||xe<this.options.minZoom){this._removeAllTiles();return}for(se in this._tiles)he=this._tiles[se],he.retain=he.current;for(se in this._tiles)if(he=this._tiles[se],he.current&&!he.active){var Ae=he.coords;this._retainParent(Ae.x,Ae.y,Ae.z,Ae.z-5)||this._retainChildren(Ae.x,Ae.y,Ae.z,Ae.z+2)}for(se in this._tiles)this._tiles[se].retain||this._removeTile(se)}},_removeTilesAtZoom:function(se){for(var he in this._tiles)this._tiles[he].coords.z===se&&this._removeTile(he)},_removeAllTiles:function(){for(var se in this._tiles)this._removeTile(se)},_invalidateAll:function(){for(var se in this._levels)tn(this._levels[se].el),this._onRemoveLevel(Number(se)),delete this._levels[se];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(se,he,xe,Ae){var He=Math.floor(se/2),Xe=Math.floor(he/2),ot=xe-1,ft=new we(+He,+Xe);ft.z=+ot;var gt=this._tileCoordsToKey(ft),Vt=this._tiles[gt];return Vt&&Vt.active?(Vt.retain=!0,!0):(Vt&&Vt.loaded&&(Vt.retain=!0),ot>Ae?this._retainParent(He,Xe,ot,Ae):!1)},_retainChildren:function(se,he,xe,Ae){for(var He=2*se;He<2*se+2;He++)for(var Xe=2*he;Xe<2*he+2;Xe++){var ot=new we(He,Xe);ot.z=xe+1;var ft=this._tileCoordsToKey(ot),gt=this._tiles[ft];if(gt&>.active){gt.retain=!0;continue}else gt&>.loaded&&(gt.retain=!0);xe+1<Ae&&this._retainChildren(He,Xe,xe+1,Ae)}},_resetView:function(se){var he=se&&(se.pinch||se.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),he,he)},_animateZoom:function(se){this._setView(se.center,se.zoom,!0,se.noUpdate)},_clampZoom:function(se){var he=this.options;return he.minNativeZoom!==void 0&&se<he.minNativeZoom?he.minNativeZoom:he.maxNativeZoom!==void 0&&he.maxNativeZoom<se?he.maxNativeZoom:se},_setView:function(se,he,xe,Ae){var He=Math.round(he);this.options.maxZoom!==void 0&&He>this.options.maxZoom||this.options.minZoom!==void 0&&He<this.options.minZoom?He=void 0:He=this._clampZoom(He);var Xe=this.options.updateWhenZooming&&He!==this._tileZoom;(!Ae||Xe)&&(this._tileZoom=He,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),He!==void 0&&this._update(se),xe||this._pruneTiles(),this._noPrune=!!xe),this._setZoomTransforms(se,he)},_setZoomTransforms:function(se,he){for(var xe in this._levels)this._setZoomTransform(this._levels[xe],se,he)},_setZoomTransform:function(se,he,xe){var Ae=this._map.getZoomScale(xe,se.zoom),He=se.origin.multiplyBy(Ae).subtract(this._map._getNewPixelOrigin(he,xe)).round();Nt.any3d?Pn(se.el,He,Ae):ln(se.el,He)},_resetGrid:function(){var se=this._map,he=se.options.crs,xe=this._tileSize=this.getTileSize(),Ae=this._tileZoom,He=this._map.getPixelWorldBounds(this._tileZoom);He&&(this._globalTileRange=this._pxBoundsToTileRange(He)),this._wrapX=he.wrapLng&&!this.options.noWrap&&[Math.floor(se.project([0,he.wrapLng[0]],Ae).x/xe.x),Math.ceil(se.project([0,he.wrapLng[1]],Ae).x/xe.y)],this._wrapY=he.wrapLat&&!this.options.noWrap&&[Math.floor(se.project([he.wrapLat[0],0],Ae).y/xe.x),Math.ceil(se.project([he.wrapLat[1],0],Ae).y/xe.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(se){var he=this._map,xe=he._animatingZoom?Math.max(he._animateToZoom,he.getZoom()):he.getZoom(),Ae=he.getZoomScale(xe,this._tileZoom),He=he.project(se,this._tileZoom).floor(),Xe=he.getSize().divideBy(Ae*2);return new Ie(He.subtract(Xe),He.add(Xe))},_update:function(se){var he=this._map;if(he){var xe=this._clampZoom(he.getZoom());if(se===void 0&&(se=he.getCenter()),this._tileZoom!==void 0){var Ae=this._getTiledPixelBounds(se),He=this._pxBoundsToTileRange(Ae),Xe=He.getCenter(),ot=[],ft=this.options.keepBuffer,gt=new Ie(He.getBottomLeft().subtract([ft,-ft]),He.getTopRight().add([ft,-ft]));if(!(isFinite(He.min.x)&&isFinite(He.min.y)&&isFinite(He.max.x)&&isFinite(He.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Vt in this._tiles){var zt=this._tiles[Vt].coords;(zt.z!==this._tileZoom||!gt.contains(new we(zt.x,zt.y)))&&(this._tiles[Vt].current=!1)}if(Math.abs(xe-this._tileZoom)>1){this._setView(se,xe);return}for(var jt=He.min.y;jt<=He.max.y;jt++)for(var Ut=He.min.x;Ut<=He.max.x;Ut++){var mn=new we(Ut,jt);if(mn.z=this._tileZoom,!!this._isValidTile(mn)){var dn=this._tiles[this._tileCoordsToKey(mn)];dn?dn.current=!0:ot.push(mn)}}if(ot.sort(function(fn,Wn){return fn.distanceTo(Xe)-Wn.distanceTo(Xe)}),ot.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var gn=document.createDocumentFragment();for(Ut=0;Ut<ot.length;Ut++)this._addTile(ot[Ut],gn);this._level.el.appendChild(gn)}}}},_isValidTile:function(se){var he=this._map.options.crs;if(!he.infinite){var xe=this._globalTileRange;if(!he.wrapLng&&(se.x<xe.min.x||se.x>xe.max.x)||!he.wrapLat&&(se.y<xe.min.y||se.y>xe.max.y))return!1}if(!this.options.bounds)return!0;var Ae=this._tileCoordsToBounds(se);return je(this.options.bounds).overlaps(Ae)},_keyToBounds:function(se){return this._tileCoordsToBounds(this._keyToTileCoords(se))},_tileCoordsToNwSe:function(se){var he=this._map,xe=this.getTileSize(),Ae=se.scaleBy(xe),He=Ae.add(xe),Xe=he.unproject(Ae,se.z),ot=he.unproject(He,se.z);return[Xe,ot]},_tileCoordsToBounds:function(se){var he=this._tileCoordsToNwSe(se),xe=new qe(he[0],he[1]);return this.options.noWrap||(xe=this._map.wrapLatLngBounds(xe)),xe},_tileCoordsToKey:function(se){return se.x+":"+se.y+":"+se.z},_keyToTileCoords:function(se){var he=se.split(":"),xe=new we(+he[0],+he[1]);return xe.z=+he[2],xe},_removeTile:function(se){var he=this._tiles[se];he&&(tn(he.el),delete this._tiles[se],this.fire("tileunload",{tile:he.el,coords:this._keyToTileCoords(se)}))},_initTile:function(se){Wt(se,"leaflet-tile");var he=this.getTileSize();se.style.width=he.x+"px",se.style.height=he.y+"px",se.onselectstart=ve,se.onmousemove=ve,Nt.ielt9&&this.options.opacity<1&&bn(se,this.options.opacity)},_addTile:function(se,he){var xe=this._getTilePos(se),Ae=this._tileCoordsToKey(se),He=this.createTile(this._wrapCoords(se),ie(this._tileReady,this,se));this._initTile(He),this.createTile.length<2&&Re(ie(this._tileReady,this,se,null,He)),ln(He,xe),this._tiles[Ae]={el:He,coords:se,current:!0},he.appendChild(He),this.fire("tileloadstart",{tile:He,coords:se})},_tileReady:function(se,he,xe){he&&this.fire("tileerror",{error:he,tile:xe,coords:se});var Ae=this._tileCoordsToKey(se);xe=this._tiles[Ae],xe&&(xe.loaded=+new Date,this._map._fadeAnimated?(bn(xe.el,0),Oe(this._fadeFrame),this._fadeFrame=Re(this._updateOpacity,this)):(xe.active=!0,this._pruneTiles()),he||(Wt(xe.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:xe.el,coords:se})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Nt.ielt9||!this._map._fadeAnimated?Re(this._pruneTiles,this):setTimeout(ie(this._pruneTiles,this),250)))},_getTilePos:function(se){return se.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(se){var he=new we(this._wrapX?ue(se.x,this._wrapX):se.x,this._wrapY?ue(se.y,this._wrapY):se.y);return he.z=se.z,he},_pxBoundsToTileRange:function(se){var he=this.getTileSize();return new Ie(se.min.unscaleBy(he).floor(),se.max.unscaleBy(he).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var se in this._tiles)if(!this._tiles[se].loaded)return!1;return!0}});function Ao(se){return new ia(se)}var qn=ia.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(se,he){this._url=se,he=pe(this,he),he.detectRetina&&Nt.retina&&he.maxZoom>0?(he.tileSize=Math.floor(he.tileSize/2),he.zoomReverse?(he.zoomOffset--,he.minZoom=Math.min(he.maxZoom,he.minZoom+1)):(he.zoomOffset++,he.maxZoom=Math.max(he.minZoom,he.maxZoom-1)),he.minZoom=Math.max(0,he.minZoom)):he.zoomReverse?he.minZoom=Math.min(he.maxZoom,he.minZoom):he.maxZoom=Math.max(he.minZoom,he.maxZoom),typeof he.subdomains=="string"&&(he.subdomains=he.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(se,he){return this._url===se&&he===void 0&&(he=!0),this._url=se,he||this.redraw(),this},createTile:function(se,he){var xe=document.createElement("img");return qt(xe,"load",ie(this._tileOnLoad,this,he,xe)),qt(xe,"error",ie(this._tileOnError,this,he,xe)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(xe.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(xe.referrerPolicy=this.options.referrerPolicy),xe.alt="",xe.src=this.getTileUrl(se),xe},getTileUrl:function(se){var he={r:Nt.retina?"@2x":"",s:this._getSubdomain(se),x:se.x,y:se.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var xe=this._globalTileRange.max.y-se.y;this.options.tms&&(he.y=xe),he["-y"]=xe}return ke(this._url,re(he,this.options))},_tileOnLoad:function(se,he){Nt.ielt9?setTimeout(ie(se,this,null,he),0):se(null,he)},_tileOnError:function(se,he,xe){var Ae=this.options.errorTileUrl;Ae&&he.getAttribute("src")!==Ae&&(he.src=Ae),se(xe,he)},_onTileRemove:function(se){se.tile.onload=null},_getZoomForUrl:function(){var se=this._tileZoom,he=this.options.maxZoom,xe=this.options.zoomReverse,Ae=this.options.zoomOffset;return xe&&(se=he-se),se+Ae},_getSubdomain:function(se){var he=Math.abs(se.x+se.y)%this.options.subdomains.length;return this.options.subdomains[he]},_abortLoading:function(){var se,he;for(se in this._tiles)if(this._tiles[se].coords.z!==this._tileZoom&&(he=this._tiles[se].el,he.onload=ve,he.onerror=ve,!he.complete)){he.src=Ee;var xe=this._tiles[se].coords;tn(he),delete this._tiles[se],this.fire("tileabort",{tile:he,coords:xe})}},_removeTile:function(se){var he=this._tiles[se];if(he)return he.el.setAttribute("src",Ee),ia.prototype._removeTile.call(this,se)},_tileReady:function(se,he,xe){if(!(!this._map||xe&&xe.getAttribute("src")===Ee))return ia.prototype._tileReady.call(this,se,he,xe)}});function Br(se,he){return new qn(se,he)}var Nr=qn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(se,he){this._url=se;var xe=re({},this.defaultWmsParams);for(var Ae in he)Ae in this.options||(xe[Ae]=he[Ae]);he=pe(this,he);var He=he.detectRetina&&Nt.retina?2:1,Xe=this.getTileSize();xe.width=Xe.x*He,xe.height=Xe.y*He,this.wmsParams=xe},onAdd:function(se){this._crs=this.options.crs||se.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var he=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[he]=this._crs.code,qn.prototype.onAdd.call(this,se)},getTileUrl:function(se){var he=this._tileCoordsToNwSe(se),xe=this._crs,Ae=Ue(xe.project(he[0]),xe.project(he[1])),He=Ae.min,Xe=Ae.max,ot=(this._wmsVersion>=1.3&&this._crs===_r?[He.y,He.x,Xe.y,Xe.x]:[He.x,He.y,Xe.x,Xe.y]).join(","),ft=qn.prototype.getTileUrl.call(this,se);return ft+_e(this.wmsParams,ft,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ot},setParams:function(se,he){return re(this.wmsParams,se),he||this.redraw(),this}});function To(se,he){return new Nr(se,he)}qn.WMS=Nr,Br.wms=To;var Nn=_n.extend({options:{padding:.1},initialize:function(se){pe(this,se),ce(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Wt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var se={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(se.zoomanim=this._onAnimZoom),se},_onAnimZoom:function(se){this._updateTransform(se.center,se.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(se,he){var xe=this._map.getZoomScale(he,this._zoom),Ae=this._map.getSize().multiplyBy(.5+this.options.padding),He=this._map.project(this._center,he),Xe=Ae.multiplyBy(-xe).add(He).subtract(this._map._getNewPixelOrigin(se,he));Nt.any3d?Pn(this._container,Xe,xe):ln(this._container,Xe)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var se in this._layers)this._layers[se]._reset()},_onZoomEnd:function(){for(var se in this._layers)this._layers[se]._project()},_updatePaths:function(){for(var se in this._layers)this._layers[se]._update()},_update:function(){var se=this.options.padding,he=this._map.getSize(),xe=this._map.containerPointToLayerPoint(he.multiplyBy(-se)).round();this._bounds=new Ie(xe,xe.add(he.multiplyBy(1+se*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Vr=Nn.extend({options:{tolerance:0},getEvents:function(){var se=Nn.prototype.getEvents.call(this);return se.viewprereset=this._onViewPreReset,se},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Nn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var se=this._container=document.createElement("canvas");qt(se,"mousemove",this._onMouseMove,this),qt(se,"click dblclick mousedown mouseup contextmenu",this._onClick,this),qt(se,"mouseout",this._handleMouseOut,this),se._leaflet_disable_events=!0,this._ctx=se.getContext("2d")},_destroyContainer:function(){Oe(this._redrawRequest),delete this._ctx,tn(this._container),en(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var se;this._redrawBounds=null;for(var he in this._layers)se=this._layers[he],se._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Nn.prototype._update.call(this);var se=this._bounds,he=this._container,xe=se.getSize(),Ae=Nt.retina?2:1;ln(he,se.min),he.width=Ae*xe.x,he.height=Ae*xe.y,he.style.width=xe.x+"px",he.style.height=xe.y+"px",Nt.retina&&this._ctx.scale(2,2),this._ctx.translate(-se.min.x,-se.min.y),this.fire("update")}},_reset:function(){Nn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(se){this._updateDashArray(se),this._layers[ce(se)]=se;var he=se._order={layer:se,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=he),this._drawLast=he,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(se){this._requestRedraw(se)},_removePath:function(se){var he=se._order,xe=he.next,Ae=he.prev;xe?xe.prev=Ae:this._drawLast=Ae,Ae?Ae.next=xe:this._drawFirst=xe,delete se._order,delete this._layers[ce(se)],this._requestRedraw(se)},_updatePath:function(se){this._extendRedrawBounds(se),se._project(),se._update(),this._requestRedraw(se)},_updateStyle:function(se){this._updateDashArray(se),this._requestRedraw(se)},_updateDashArray:function(se){if(typeof se.options.dashArray=="string"){var he=se.options.dashArray.split(/[, ]+/),xe=[],Ae,He;for(He=0;He<he.length;He++){if(Ae=Number(he[He]),isNaN(Ae))return;xe.push(Ae)}se.options._dashArray=xe}else se.options._dashArray=se.options.dashArray},_requestRedraw:function(se){this._map&&(this._extendRedrawBounds(se),this._redrawRequest=this._redrawRequest||Re(this._redraw,this))},_extendRedrawBounds:function(se){if(se._pxBounds){var he=(se.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Ie,this._redrawBounds.extend(se._pxBounds.min.subtract([he,he])),this._redrawBounds.extend(se._pxBounds.max.add([he,he]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var se=this._redrawBounds;if(se){var he=se.getSize();this._ctx.clearRect(se.min.x,se.min.y,he.x,he.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var se,he=this._redrawBounds;if(this._ctx.save(),he){var xe=he.getSize();this._ctx.beginPath(),this._ctx.rect(he.min.x,he.min.y,xe.x,xe.y),this._ctx.clip()}this._drawing=!0;for(var Ae=this._drawFirst;Ae;Ae=Ae.next)se=Ae.layer,(!he||se._pxBounds&&se._pxBounds.intersects(he))&&se._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(se,he){if(this._drawing){var xe,Ae,He,Xe,ot=se._parts,ft=ot.length,gt=this._ctx;if(ft){for(gt.beginPath(),xe=0;xe<ft;xe++){for(Ae=0,He=ot[xe].length;Ae<He;Ae++)Xe=ot[xe][Ae],gt[Ae?"lineTo":"moveTo"](Xe.x,Xe.y);he&>.closePath()}this._fillStroke(gt,se)}}},_updateCircle:function(se){if(!(!this._drawing||se._empty())){var he=se._point,xe=this._ctx,Ae=Math.max(Math.round(se._radius),1),He=(Math.max(Math.round(se._radiusY),1)||Ae)/Ae;He!==1&&(xe.save(),xe.scale(1,He)),xe.beginPath(),xe.arc(he.x,he.y/He,Ae,0,Math.PI*2,!1),He!==1&&xe.restore(),this._fillStroke(xe,se)}},_fillStroke:function(se,he){var xe=he.options;xe.fill&&(se.globalAlpha=xe.fillOpacity,se.fillStyle=xe.fillColor||xe.color,se.fill(xe.fillRule||"evenodd")),xe.stroke&&xe.weight!==0&&(se.setLineDash&&se.setLineDash(he.options&&he.options._dashArray||[]),se.globalAlpha=xe.opacity,se.lineWidth=xe.weight,se.strokeStyle=xe.color,se.lineCap=xe.lineCap,se.lineJoin=xe.lineJoin,se.stroke())},_onClick:function(se){for(var he=this._map.mouseEventToLayerPoint(se),xe,Ae,He=this._drawFirst;He;He=He.next)xe=He.layer,xe.options.interactive&&xe._containsPoint(he)&&(!(se.type==="click"||se.type==="preclick")||!this._map._draggableMoved(xe))&&(Ae=xe);this._fireEvent(Ae?[Ae]:!1,se)},_onMouseMove:function(se){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var he=this._map.mouseEventToLayerPoint(se);this._handleMouseHover(se,he)}},_handleMouseOut:function(se){var he=this._hoveredLayer;he&&(nn(this._container,"leaflet-interactive"),this._fireEvent([he],se,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(se,he){if(!this._mouseHoverThrottled){for(var xe,Ae,He=this._drawFirst;He;He=He.next)xe=He.layer,xe.options.interactive&&xe._containsPoint(he)&&(Ae=xe);Ae!==this._hoveredLayer&&(this._handleMouseOut(se),Ae&&(Wt(this._container,"leaflet-interactive"),this._fireEvent([Ae],se,"mouseover"),this._hoveredLayer=Ae)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,se),this._mouseHoverThrottled=!0,setTimeout(ie(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(se,he,xe){this._map._fireDOMEvent(he,xe||he.type,se)},_bringToFront:function(se){var he=se._order;if(he){var xe=he.next,Ae=he.prev;if(xe)xe.prev=Ae;else return;Ae?Ae.next=xe:xe&&(this._drawFirst=xe),he.prev=this._drawLast,this._drawLast.next=he,he.next=null,this._drawLast=he,this._requestRedraw(se)}},_bringToBack:function(se){var he=se._order;if(he){var xe=he.next,Ae=he.prev;if(Ae)Ae.next=xe;else return;xe?xe.prev=Ae:Ae&&(this._drawLast=Ae),he.prev=null,he.next=this._drawFirst,this._drawFirst.prev=he,this._drawFirst=he,this._requestRedraw(se)}}});function Mr(se){return Nt.canvas?new Vr(se):null}var sa=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(se){return document.createElement("<lvml:"+se+' class="lvml">')}}catch{}return function(se){return document.createElement("<"+se+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Po={_initContainer:function(){this._container=Qt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Nn.prototype._update.call(this),this.fire("update"))},_initPath:function(se){var he=se._container=sa("shape");Wt(he,"leaflet-vml-shape "+(this.options.className||"")),he.coordsize="1 1",se._path=sa("path"),he.appendChild(se._path),this._updateStyle(se),this._layers[ce(se)]=se},_addPath:function(se){var he=se._container;this._container.appendChild(he),se.options.interactive&&se.addInteractiveTarget(he)},_removePath:function(se){var he=se._container;tn(he),se.removeInteractiveTarget(he),delete this._layers[ce(se)]},_updateStyle:function(se){var he=se._stroke,xe=se._fill,Ae=se.options,He=se._container;He.stroked=!!Ae.stroke,He.filled=!!Ae.fill,Ae.stroke?(he||(he=se._stroke=sa("stroke")),He.appendChild(he),he.weight=Ae.weight+"px",he.color=Ae.color,he.opacity=Ae.opacity,Ae.dashArray?he.dashStyle=$e(Ae.dashArray)?Ae.dashArray.join(" "):Ae.dashArray.replace(/( *, *)/g," "):he.dashStyle="",he.endcap=Ae.lineCap.replace("butt","flat"),he.joinstyle=Ae.lineJoin):he&&(He.removeChild(he),se._stroke=null),Ae.fill?(xe||(xe=se._fill=sa("fill")),He.appendChild(xe),xe.color=Ae.fillColor||Ae.color,xe.opacity=Ae.fillOpacity):xe&&(He.removeChild(xe),se._fill=null)},_updateCircle:function(se){var he=se._point.round(),xe=Math.round(se._radius),Ae=Math.round(se._radiusY||xe);this._setPath(se,se._empty()?"M0 0":"AL "+he.x+","+he.y+" "+xe+","+Ae+" 0,"+65535*360)},_setPath:function(se,he){se._path.v=he},_bringToFront:function(se){Rn(se._container)},_bringToBack:function(se){On(se._container)}},Ca=Nt.vml?sa:at,la=Nn.extend({_initContainer:function(){this._container=Ca("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ca("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){tn(this._container),en(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Nn.prototype._update.call(this);var se=this._bounds,he=se.getSize(),xe=this._container;(!this._svgSize||!this._svgSize.equals(he))&&(this._svgSize=he,xe.setAttribute("width",he.x),xe.setAttribute("height",he.y)),ln(xe,se.min),xe.setAttribute("viewBox",[se.min.x,se.min.y,he.x,he.y].join(" ")),this.fire("update")}},_initPath:function(se){var he=se._path=Ca("path");se.options.className&&Wt(he,se.options.className),se.options.interactive&&Wt(he,"leaflet-interactive"),this._updateStyle(se),this._layers[ce(se)]=se},_addPath:function(se){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(se._path),se.addInteractiveTarget(se._path)},_removePath:function(se){tn(se._path),se.removeInteractiveTarget(se._path),delete this._layers[ce(se)]},_updatePath:function(se){se._project(),se._update()},_updateStyle:function(se){var he=se._path,xe=se.options;he&&(xe.stroke?(he.setAttribute("stroke",xe.color),he.setAttribute("stroke-opacity",xe.opacity),he.setAttribute("stroke-width",xe.weight),he.setAttribute("stroke-linecap",xe.lineCap),he.setAttribute("stroke-linejoin",xe.lineJoin),xe.dashArray?he.setAttribute("stroke-dasharray",xe.dashArray):he.removeAttribute("stroke-dasharray"),xe.dashOffset?he.setAttribute("stroke-dashoffset",xe.dashOffset):he.removeAttribute("stroke-dashoffset")):he.setAttribute("stroke","none"),xe.fill?(he.setAttribute("fill",xe.fillColor||xe.color),he.setAttribute("fill-opacity",xe.fillOpacity),he.setAttribute("fill-rule",xe.fillRule||"evenodd")):he.setAttribute("fill","none"))},_updatePoly:function(se,he){this._setPath(se,dt(se._parts,he))},_updateCircle:function(se){var he=se._point,xe=Math.max(Math.round(se._radius),1),Ae=Math.max(Math.round(se._radiusY),1)||xe,He="a"+xe+","+Ae+" 0 1,0 ",Xe=se._empty()?"M0 0":"M"+(he.x-xe)+","+he.y+He+xe*2+",0 "+He+-xe*2+",0 ";this._setPath(se,Xe)},_setPath:function(se,he){se._path.setAttribute("d",he)},_bringToFront:function(se){Rn(se._path)},_bringToBack:function(se){On(se._path)}});Nt.vml&&la.include(Po);function Ar(se){return Nt.svg||Nt.vml?new la(se):null}Kt.include({getRenderer:function(se){var he=se.options.renderer||this._getPaneRenderer(se.options.pane)||this.options.renderer||this._renderer;return he||(he=this._renderer=this._createRenderer()),this.hasLayer(he)||this.addLayer(he),he},_getPaneRenderer:function(se){if(se==="overlayPane"||se===void 0)return!1;var he=this._paneRenderers[se];return he===void 0&&(he=this._createRenderer({pane:se}),this._paneRenderers[se]=he),he},_createRenderer:function(se){return this.options.preferCanvas&&Mr(se)||Ar(se)}});var Tr=Gn.extend({initialize:function(se,he){Gn.prototype.initialize.call(this,this._boundsToLatLngs(se),he)},setBounds:function(se){return this.setLatLngs(this._boundsToLatLngs(se))},_boundsToLatLngs:function(se){return se=je(se),[se.getSouthWest(),se.getNorthWest(),se.getNorthEast(),se.getSouthEast()]}});function Lo(se,he){return new Tr(se,he)}la.create=Ca,la.pointsToPath=dt,Bn.geometryToLayer=$a,Bn.coordsToLatLng=Ka,Bn.coordsToLatLngs=ya,Bn.latLngToCoords=Ja,Bn.latLngsToCoords=_a,Bn.getFeature=Zn,Bn.asFeature=ka,Kt.mergeOptions({boxZoom:!0});var Pr=xn.extend({initialize:function(se){this._map=se,this._container=se._container,this._pane=se._panes.overlayPane,this._resetStateTimeout=0,se.on("unload",this._destroy,this)},addHooks:function(){qt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){en(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){tn(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(se){if(!se.shiftKey||se.which!==1&&se.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Qn(),Pa(),this._startPoint=this._map.mouseEventToContainerPoint(se),qt(document,{contextmenu:Dn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(se){this._moved||(this._moved=!0,this._box=Qt("div","leaflet-zoom-box",this._container),Wt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(se);var he=new Ie(this._point,this._startPoint),xe=he.getSize();ln(this._box,he.min),this._box.style.width=xe.x+"px",this._box.style.height=xe.y+"px"},_finish:function(){this._moved&&(tn(this._box),nn(this._container,"leaflet-crosshair")),ea(),La(),en(document,{contextmenu:Dn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(se){if(!(se.which!==1&&se.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(ie(this._resetState,this),0);var he=new qe(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(he).fire("boxzoomend",{boxZoomBounds:he})}},_onKeyDown:function(se){se.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Kt.addInitHook("addHandler","boxZoom",Pr),Kt.mergeOptions({doubleClickZoom:!0});var Lr=xn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(se){var he=this._map,xe=he.getZoom(),Ae=he.options.zoomDelta,He=se.originalEvent.shiftKey?xe-Ae:xe+Ae;he.options.doubleClickZoom==="center"?he.setZoom(He):he.setZoomAround(se.containerPoint,He)}});Kt.addInitHook("addHandler","doubleClickZoom",Lr),Kt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Fr=xn.extend({addHooks:function(){if(!this._draggable){var se=this._map;this._draggable=new An(se._mapPane,se._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),se.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),se.on("zoomend",this._onZoomEnd,this),se.whenReady(this._onZoomEnd,this))}Wt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){nn(this._map._container,"leaflet-grab"),nn(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var se=this._map;if(se._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var he=je(this._map.options.maxBounds);this._offsetLimit=Ue(this._map.latLngToContainerPoint(he.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(he.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;se.fire("movestart").fire("dragstart"),se.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(se){if(this._map.options.inertia){var he=this._lastTime=+new Date,xe=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(xe),this._times.push(he),this._prunePositions(he)}this._map.fire("move",se).fire("drag",se)},_prunePositions:function(se){for(;this._positions.length>1&&se-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var se=this._map.getSize().divideBy(2),he=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=he.subtract(se).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(se,he){return se-(se-he)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var se=this._draggable._newPos.subtract(this._draggable._startPos),he=this._offsetLimit;se.x<he.min.x&&(se.x=this._viscousLimit(se.x,he.min.x)),se.y<he.min.y&&(se.y=this._viscousLimit(se.y,he.min.y)),se.x>he.max.x&&(se.x=this._viscousLimit(se.x,he.max.x)),se.y>he.max.y&&(se.y=this._viscousLimit(se.y,he.max.y)),this._draggable._newPos=this._draggable._startPos.add(se)}},_onPreDragWrap:function(){var se=this._worldWidth,he=Math.round(se/2),xe=this._initialWorldOffset,Ae=this._draggable._newPos.x,He=(Ae-he+xe)%se+he-xe,Xe=(Ae+he+xe)%se-he-xe,ot=Math.abs(He+xe)<Math.abs(Xe+xe)?He:Xe;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ot},_onDragEnd:function(se){var he=this._map,xe=he.options,Ae=!xe.inertia||se.noInertia||this._times.length<2;if(he.fire("dragend",se),Ae)he.fire("moveend");else{this._prunePositions(+new Date);var He=this._lastPos.subtract(this._positions[0]),Xe=(this._lastTime-this._times[0])/1e3,ot=xe.easeLinearity,ft=He.multiplyBy(ot/Xe),gt=ft.distanceTo([0,0]),Vt=Math.min(xe.inertiaMaxSpeed,gt),zt=ft.multiplyBy(Vt/gt),jt=Vt/(xe.inertiaDeceleration*ot),Ut=zt.multiplyBy(-jt/2).round();!Ut.x&&!Ut.y?he.fire("moveend"):(Ut=he._limitOffset(Ut,he.options.maxBounds),Re(function(){he.panBy(Ut,{duration:jt,easeLinearity:ot,noMoveStart:!0,animate:!0})}))}}});Kt.addInitHook("addHandler","dragging",Fr),Kt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Dr=xn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(se){this._map=se,this._setPanDelta(se.options.keyboardPanDelta),this._setZoomDelta(se.options.zoomDelta)},addHooks:function(){var se=this._map._container;se.tabIndex<=0&&(se.tabIndex="0"),qt(se,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),en(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var se=document.body,he=document.documentElement,xe=se.scrollTop||he.scrollTop,Ae=se.scrollLeft||he.scrollLeft;this._map._container.focus(),window.scrollTo(Ae,xe)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(se){var he=this._panKeys={},xe=this.keyCodes,Ae,He;for(Ae=0,He=xe.left.length;Ae<He;Ae++)he[xe.left[Ae]]=[-1*se,0];for(Ae=0,He=xe.right.length;Ae<He;Ae++)he[xe.right[Ae]]=[se,0];for(Ae=0,He=xe.down.length;Ae<He;Ae++)he[xe.down[Ae]]=[0,se];for(Ae=0,He=xe.up.length;Ae<He;Ae++)he[xe.up[Ae]]=[0,-1*se]},_setZoomDelta:function(se){var he=this._zoomKeys={},xe=this.keyCodes,Ae,He;for(Ae=0,He=xe.zoomIn.length;Ae<He;Ae++)he[xe.zoomIn[Ae]]=se;for(Ae=0,He=xe.zoomOut.length;Ae<He;Ae++)he[xe.zoomOut[Ae]]=-se},_addHooks:function(){qt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){en(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(se){if(!(se.altKey||se.ctrlKey||se.metaKey)){var he=se.keyCode,xe=this._map,Ae;if(he in this._panKeys){if(!xe._panAnim||!xe._panAnim._inProgress)if(Ae=this._panKeys[he],se.shiftKey&&(Ae=Fe(Ae).multiplyBy(3)),xe.options.maxBounds&&(Ae=xe._limitOffset(Fe(Ae),xe.options.maxBounds)),xe.options.worldCopyJump){var He=xe.wrapLatLng(xe.unproject(xe.project(xe.getCenter()).add(Ae)));xe.panTo(He)}else xe.panBy(Ae)}else if(he in this._zoomKeys)xe.setZoom(xe.getZoom()+(se.shiftKey?3:1)*this._zoomKeys[he]);else if(he===27&&xe._popup&&xe._popup.options.closeOnEscapeKey)xe.closePopup();else return;Dn(se)}}});Kt.addInitHook("addHandler","keyboard",Dr),Kt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var zr=xn.extend({addHooks:function(){qt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){en(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(se){var he=sr(se),xe=this._map.options.wheelDebounceTime;this._delta+=he,this._lastMousePos=this._map.mouseEventToContainerPoint(se),this._startTime||(this._startTime=+new Date);var Ae=Math.max(xe-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(ie(this._performZoom,this),Ae),Dn(se)},_performZoom:function(){var se=this._map,he=se.getZoom(),xe=this._map.options.zoomSnap||0;se._stop();var Ae=this._delta/(this._map.options.wheelPxPerZoomLevel*4),He=4*Math.log(2/(1+Math.exp(-Math.abs(Ae))))/Math.LN2,Xe=xe?Math.ceil(He/xe)*xe:He,ot=se._limitZoom(he+(this._delta>0?Xe:-Xe))-he;this._delta=0,this._startTime=null,ot&&(se.options.scrollWheelZoom==="center"?se.setZoom(he+ot):se.setZoomAround(this._lastMousePos,he+ot))}});Kt.addInitHook("addHandler","scrollWheelZoom",zr);var Fo=600;Kt.mergeOptions({tapHold:Nt.touchNative&&Nt.safari&&Nt.mobile,tapTolerance:15});var Ir=xn.extend({addHooks:function(){qt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){en(this._map._container,"touchstart",this._onDown,this)},_onDown:function(se){if(clearTimeout(this._holdTimeout),se.touches.length===1){var he=se.touches[0];this._startPos=this._newPos=new we(he.clientX,he.clientY),this._holdTimeout=setTimeout(ie(function(){this._cancel(),this._isTapValid()&&(qt(document,"touchend",un),qt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",he))},this),Fo),qt(document,"touchend touchcancel contextmenu",this._cancel,this),qt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function se(){en(document,"touchend",un),en(document,"touchend touchcancel",se)},_cancel:function(){clearTimeout(this._holdTimeout),en(document,"touchend touchcancel contextmenu",this._cancel,this),en(document,"touchmove",this._onMove,this)},_onMove:function(se){var he=se.touches[0];this._newPos=new we(he.clientX,he.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(se,he){var xe=new MouseEvent(se,{bubbles:!0,cancelable:!0,view:window,screenX:he.screenX,screenY:he.screenY,clientX:he.clientX,clientY:he.clientY});xe._simulated=!0,he.target.dispatchEvent(xe)}});Kt.addInitHook("addHandler","tapHold",Ir),Kt.mergeOptions({touchZoom:Nt.touch,bounceAtZoomLimits:!0});var Rr=xn.extend({addHooks:function(){Wt(this._map._container,"leaflet-touch-zoom"),qt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){nn(this._map._container,"leaflet-touch-zoom"),en(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(se){var he=this._map;if(!(!se.touches||se.touches.length!==2||he._animatingZoom||this._zooming)){var xe=he.mouseEventToContainerPoint(se.touches[0]),Ae=he.mouseEventToContainerPoint(se.touches[1]);this._centerPoint=he.getSize()._divideBy(2),this._startLatLng=he.containerPointToLatLng(this._centerPoint),he.options.touchZoom!=="center"&&(this._pinchStartLatLng=he.containerPointToLatLng(xe.add(Ae)._divideBy(2))),this._startDist=xe.distanceTo(Ae),this._startZoom=he.getZoom(),this._moved=!1,this._zooming=!0,he._stop(),qt(document,"touchmove",this._onTouchMove,this),qt(document,"touchend touchcancel",this._onTouchEnd,this),un(se)}},_onTouchMove:function(se){if(!(!se.touches||se.touches.length!==2||!this._zooming)){var he=this._map,xe=he.mouseEventToContainerPoint(se.touches[0]),Ae=he.mouseEventToContainerPoint(se.touches[1]),He=xe.distanceTo(Ae)/this._startDist;if(this._zoom=he.getScaleZoom(He,this._startZoom),!he.options.bounceAtZoomLimits&&(this._zoom<he.getMinZoom()&&He<1||this._zoom>he.getMaxZoom()&&He>1)&&(this._zoom=he._limitZoom(this._zoom)),he.options.touchZoom==="center"){if(this._center=this._startLatLng,He===1)return}else{var Xe=xe._add(Ae)._divideBy(2)._subtract(this._centerPoint);if(He===1&&Xe.x===0&&Xe.y===0)return;this._center=he.unproject(he.project(this._pinchStartLatLng,this._zoom).subtract(Xe),this._zoom)}this._moved||(he._moveStart(!0,!1),this._moved=!0),Oe(this._animRequest);var ot=ie(he._move,he,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Re(ot,this,!0),un(se)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Oe(this._animRequest),en(document,"touchmove",this._onTouchMove,this),en(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Kt.addInitHook("addHandler","touchZoom",Rr),Kt.BoxZoom=Pr,Kt.DoubleClickZoom=Lr,Kt.Drag=Fr,Kt.Keyboard=Dr,Kt.ScrollWheelZoom=zr,Kt.TapHold=Ir,Kt.TouchZoom=Rr,ne.Bounds=Ie,ne.Browser=Nt,ne.CRS=Ke,ne.Canvas=Vr,ne.Circle=Xa,ne.CircleMarker=ga,ne.Class=Be,ne.Control=yn,ne.DivIcon=Sr,ne.DivOverlay=wn,ne.DomEvent=Qr,ne.DomUtil=Kr,ne.Draggable=An,ne.Evented=Me,ne.FeatureGroup=Cn,ne.GeoJSON=Bn,ne.GridLayer=ia,ne.Handler=xn,ne.Icon=jn,ne.ImageOverlay=xa,ne.LatLng=We,ne.LatLngBounds=qe,ne.Layer=_n,ne.LayerGroup=Hn,ne.LineUtil=mo,ne.Map=Kt,ne.Marker=va,ne.Mixin=io,ne.Path=Tn,ne.Point=we,ne.PolyUtil=so,ne.Polygon=Gn,ne.Polyline=Sn,ne.Popup=wa,ne.PosAnimation=lr,ne.Projection=fo,ne.Rectangle=Tr,ne.Renderer=Nn,ne.SVG=la,ne.SVGOverlay=Cr,ne.TileLayer=qn,ne.Tooltip=Ea,ne.Transformation=At,ne.Util=Pe,ne.VideoOverlay=Er,ne.bind=ie,ne.bounds=Ue,ne.canvas=Mr,ne.circle=ko,ne.circleMarker=_o,ne.control=aa,ne.divIcon=Mo,ne.extend=re,ne.featureGroup=go,ne.geoJSON=wr,ne.geoJson=Eo,ne.gridLayer=Ao,ne.icon=$o,ne.imageOverlay=Co,ne.latLng=Ge,ne.latLngBounds=je,ne.layerGroup=vo,ne.map=eo,ne.marker=yo,ne.point=Fe,ne.polygon=wo,ne.polyline=xo,ne.popup=No,ne.rectangle=Lo,ne.setOptions=pe,ne.stamp=ce,ne.svg=Ar,ne.svgOverlay=Bo,ne.tileLayer=Br,ne.tooltip=Vo,ne.transformation=Pt,ne.version=ae,ne.videoOverlay=So;var Do=window.L;ne.noConflict=function(){return window.L=Do,this},window.L=ne})})(leafletSrc,leafletSrc.exports);var leafletSrcExports=leafletSrc.exports;const L$2=getDefaultExportFromCjs(leafletSrcExports);async function copyToClipboard(ee){var ae;if(!ee||!ee.trim())return!1;if((ae=navigator==null?void 0:navigator.clipboard)!=null&&ae.writeText)try{return await navigator.clipboard.writeText(ee),!0}catch{}const te=document.createElement("textarea");te.value=ee,te.setAttribute("readonly",""),te.style.position="fixed",te.style.left="-9999px",document.body.appendChild(te),te.select();const ne=document.execCommand("copy");return document.body.removeChild(te),ne}const _hoisted_1$y={class:"sm-map"},_hoisted_2$v={class:"sm-map-surface"},_hoisted_3$s=["id"],_hoisted_4$r={key:0,class:"sm-map-empty"},_hoisted_5$p={key:1,class:"sm-map-hint"},_hoisted_6$l={key:0,class:"sm-map-zoom"},_hoisted_7$k=["disabled"],_hoisted_8$g=["disabled"],_hoisted_9$d={key:0,class:"sm-map-info"},_hoisted_10$c=["title"],_hoisted_11$b={key:0,class:"sm-map-subtitle"},_hoisted_12$9={class:"sm-map-actions"},_hoisted_13$6=["href"],_hoisted_14$6={class:"size-3.5",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_15$6={key:0,d:"M9.6 17.2 4.8 12.4l1.4-1.4 3.4 3.4 8-8 1.4 1.4-9.4 9.4Z"},_hoisted_16$5={key:1,d:"M8 3h8a2 2 0 0 1 2 2v1h-2V5H8v10h1v2H8a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm4 5h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2Zm0 2v9h7v-9h-7Z"},PREVIEW_ZOOM=15,_sfc_main$D={__name:"MessageLocationMap",props:{map:{type:Object,required:!0},mapId:{type:String,default:null},pinUrl:{type:String,default:"/image/location-pin.png"},tileTheme:{type:String,default:"auto",validator:ee=>["auto","dark","light"].includes(ee)}},setup(ee){const te=ee,ne={dark:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",light:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png"},ae=[11,19],re=e$b.ref(null),oe=e$b.ref(!1),ie=e$b.ref(PREVIEW_ZOOM),le=e$b.ref(!1);let ce=null,de=null,ue=null,ve=null,me=null,ge=null;const fe=()=>{var ze,Re,Oe;const Ve=Number((ze=te.map)==null?void 0:ze.latitude),Te=Number(((Re=te.map)==null?void 0:Re.longitude)??((Oe=te.map)==null?void 0:Oe.length));return Number.isFinite(Ve)&&Number.isFinite(Te)?[Ve,Te]:null},pe=e$b.computed(()=>{var Ve,Te;return((Ve=te.map)==null?void 0:Ve.name)||((Te=te.map)==null?void 0:Te.address)||"Localização compartilhada"}),_e=e$b.computed(()=>{var ze,Re;const Ve=fe();return Ve?((ze=te.map)!=null&&ze.name?(Re=te.map)==null?void 0:Re.address:null)||Ve.map(Oe=>Oe.toFixed(5)).join(", "):""}),be=e$b.computed(()=>{var Ve;return((Ve=fe())==null?void 0:Ve.join(", "))??""}),ke=e$b.computed(()=>`https://www.google.com/maps/dir/?api=1&destination=${be.value}`);function $e(Ve){const Te=Math.min(ae[1],Math.max(ae[0],ie.value+Ve));Te!==ie.value&&(ie.value=Te,ce==null||ce.setZoom(Te))}async function ye(){await copyToClipboard(be.value)&&(le.value=!0,clearTimeout(ge),ge=setTimeout(()=>le.value=!1,1600))}function Ee(){return te.tileTheme!=="auto"?ne[te.tileTheme]:document.documentElement.classList.contains("dark")?ne.light:ne.dark}function Se(){const Ve=fe();if(!Ve)return;const[Te,ze]=Ve;N$3.show([{src:`https://www.google.com/maps?q=${Te},${ze}&z=19&output=embed`,type:"iframe",caption:pe.value}],{Toolbar:{display:{left:["infobar"],right:["close"]}},iframe:{preload:!1,css:{width:"90%",height:"80vh",borderRadius:"12px"}}})}function Le(){const Ve=fe();!re.value||ce||!Ve||(ce=L$2.map(re.value,{zoomControl:!1,attributionControl:!0,dragging:!1,touchZoom:!1,scrollWheelZoom:!1,doubleClickZoom:!1,boxZoom:!1,keyboard:!1,tap:!1,inertia:!1}).setView(Ve,ie.value),de=L$2.tileLayer(Ee(),{maxZoom:19,detectRetina:!0}),de.addTo(ce),L$2.marker(Ve,{icon:L$2.icon({iconUrl:te.pinUrl,iconSize:[40,40],iconAnchor:[20,36]}),keyboard:!1,interactive:!1}).addTo(ce),ce.attributionControl.setPrefix(""),oe.value=!0,typeof ResizeObserver=="function"?(me=new ResizeObserver(()=>ce==null?void 0:ce.invalidateSize(!1)),me.observe(re.value)):requestAnimationFrame(()=>ce==null?void 0:ce.invalidateSize(!1)),te.tileTheme==="auto"&&(ve=new MutationObserver(()=>{de==null||de.setUrl(Ee())}),ve.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})))}return e$b.onMounted(()=>{if(typeof IntersectionObserver!="function"){Le();return}ue=new IntersectionObserver(Ve=>{Ve.some(Te=>Te.isIntersecting)&&(ue.disconnect(),ue=null,Le())},{rootMargin:"200px"}),ue.observe(re.value)}),e$b.onBeforeUnmount(()=>{clearTimeout(ge),ue==null||ue.disconnect(),ve==null||ve.disconnect(),me==null||me.disconnect(),ue=null,ve=null,me=null,ce==null||ce.remove(),ce=null,de=null}),(Ve,Te)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$y,[e$b.createElementVNode("div",_hoisted_2$v,[e$b.createElementVNode("button",{type:"button",class:"sm-map-open",title:"Abrir no Google Maps",onClick:Se},[e$b.createElementVNode("span",{id:ee.mapId||void 0,ref_key:"container",ref:re,class:"sm-map-canvas"},null,8,_hoisted_3$s),fe()?oe.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$p,[...Te[2]||(Te[2]=[e$b.createElementVNode("svg",{class:"size-3.5",viewBox:"0 0 24 24",fill:"currentColor"},[e$b.createElementVNode("path",{d:"M12 2a7 7 0 0 0-7 7c0 5.1 6.1 12.2 6.4 12.5a.8.8 0 0 0 1.2 0C13 21.2 19 14.1 19 9a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6a2.5 2.5 0 0 1 0 5.5Z"})],-1),e$b.createTextVNode(" Ver no mapa ",-1)])])):e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_4$r,"Localização indisponível"))]),oe.value&&fe()?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$l,[e$b.createElementVNode("button",{type:"button",title:"Aproximar",disabled:ie.value>=19,onClick:Te[0]||(Te[0]=ze=>$e(1))}," + ",8,_hoisted_7$k),e$b.createElementVNode("button",{type:"button",title:"Afastar",disabled:ie.value<=11,onClick:Te[1]||(Te[1]=ze=>$e(-1))}," − ",8,_hoisted_8$g)])):e$b.createCommentVNode("",!0)]),fe()?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$d,[e$b.createElementVNode("p",{class:"sm-map-title",title:pe.value},e$b.toDisplayString(pe.value),9,_hoisted_10$c),_e.value?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_11$b,e$b.toDisplayString(_e.value),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_12$9,[e$b.createElementVNode("a",{class:"sm-map-action",href:ke.value,target:"_blank",rel:"noopener noreferrer"},[...Te[3]||(Te[3]=[e$b.createElementVNode("svg",{class:"size-3.5",viewBox:"0 0 24 24",fill:"currentColor"},[e$b.createElementVNode("path",{d:"M11.3 2.3a1 1 0 0 1 1.4 0l9 9a1 1 0 0 1 0 1.4l-9 9a1 1 0 0 1-1.4 0l-9-9a1 1 0 0 1 0-1.4l9-9Zm1.2 4.4v3H9a2.5 2.5 0 0 0-2.5 2.5V15h2v-2.8c0-.3.2-.5.5-.5h3.5v3l4-3.5-4-3.5Z"})],-1),e$b.createTextVNode(" Rota ",-1)])],8,_hoisted_13$6),e$b.createElementVNode("button",{type:"button",class:"sm-map-action",onClick:ye},[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_14$6,[le.value?(e$b.openBlock(),e$b.createElementBlock("path",_hoisted_15$6)):(e$b.openBlock(),e$b.createElementBlock("path",_hoisted_16$5))])),e$b.createTextVNode(" "+e$b.toDisplayString(le.value?"Copiado":"Copiar"),1)])])])):e$b.createCommentVNode("",!0)]))}},MessageLocationMap=_export_sfc$1(_sfc_main$D,[["__scopeId","data-v-01f542ea"]]),RECENT_STORAGE_KEY="smClickEmojiRecent",SKIN_TONE_STORAGE_KEY="smClickEmojiSkinTone",MAX_RECENT=32;function readStorage(ee,te){try{const ne=window.localStorage.getItem(ee);return ne!==null?JSON.parse(ne):te}catch{return te}}function writeStorage(ee,te){try{window.localStorage.setItem(ee,JSON.stringify(te))}catch{}}const useEmojiPickerStore=pinia.defineStore("smClickEmojiPicker",{state:()=>({recent:readStorage(RECENT_STORAGE_KEY,[]),skinTone:readStorage(SKIN_TONE_STORAGE_KEY,"default")}),actions:{addRecent(ee){const te=this.recent.filter(ne=>ne!==ee);this.recent=[ee,...te].slice(0,MAX_RECENT),writeStorage(RECENT_STORAGE_KEY,this.recent)},setSkinTone(ee){this.skinTone=ee,writeStorage(SKIN_TONE_STORAGE_KEY,ee)}}}),segmenter=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter("en",{granularity:"grapheme"}):null,ZWJ="",VARIATION_SELECTOR_16="️",COMBINING_ENCLOSING_KEYCAP="⃣",REGIONAL_INDICATOR_MIN=127462,REGIONAL_INDICATOR_MAX=127487,SKIN_TONE_MIN=127995,SKIN_TONE_MAX=127999;function isRegionalIndicator(ee){return ee>=REGIONAL_INDICATOR_MIN&&ee<=REGIONAL_INDICATOR_MAX}function isSkinToneModifier(ee){return ee>=SKIN_TONE_MIN&&ee<=SKIN_TONE_MAX}function splitGraphemesFallback(ee){const te=Array.from(ee),ne=[];let ae="",re=0;function oe(){ae&&ne.push(ae),ae="",re=0}for(const ie of te){const le=ie.codePointAt(0),ce=isRegionalIndicator(le),de=ae[ae.length-1];if(!ae){ae=ie,re=ce?1:0;continue}if(ie===ZWJ||de===ZWJ||ie===VARIATION_SELECTOR_16||ie===COMBINING_ENCLOSING_KEYCAP||isSkinToneModifier(le)){ae+=ie;continue}if(ce&&re===1){ae+=ie,re=2;continue}oe(),ae=ie,re=ce?1:0}return oe(),ne}function splitGraphemes(ee){return ee?segmenter?Array.from(segmenter.segment(ee),te=>te.segment):splitGraphemesFallback(ee):[]}function countGraphemes(ee){return splitGraphemes(ee).length}const SKIN_TONES=[{id:"default",modifier:"",label:"Padrão",swatch:"#ffd225"},{id:"light",modifier:String.fromCodePoint(127995),label:"Claro",swatch:"#ffdfbd"},{id:"medium-light",modifier:String.fromCodePoint(127996),label:"Médio-claro",swatch:"#e9c197"},{id:"medium",modifier:String.fromCodePoint(127997),label:"Médio",swatch:"#c88e62"},{id:"medium-dark",modifier:String.fromCodePoint(127998),label:"Médio-escuro",swatch:"#a86637"},{id:"dark",modifier:String.fromCodePoint(127999),label:"Escuro",swatch:"#60463a"}],SKIN_TONE_BASE_CHARS=new Set(["👋","🤚","🖐️","✋","🖖","👌","🤌","🤏","✌️","🤞","🫰","🤟","🤘","👈","👉","👆","🖕","👇","☝️","👍","👎","✊","👊","🤛","🤜","👏","🙌","🫶","👐","🤲","🙏","💪","🦵","🦶","👂","👃","👶","🧒","🧑","👦","👧","👨","👩","🧓","👴","👵"]);function stripSkinTone(ee){return Array.from(ee).filter(te=>{const ne=te.codePointAt(0);return!(ne>=127995&&ne<=127999)}).join("")}function applySkinTone(ee,te){return splitGraphemes(ee).map(ne=>{const ae=stripSkinTone(ne);return SKIN_TONE_BASE_CHARS.has(ae)?ae+te:ne}).join("")}const EMOJI_CATEGORIES=[{id:"smileys",label:"Smileys e pessoas",icon:"😀",emojis:[{char:"😀",name:"rosto sorrindo"},{char:"😃",name:"rosto sorrindo boca aberta"},{char:"😄",name:"rosto sorrindo olhos fechados"},{char:"😁",name:"rosto sorrindo grande"},{char:"😆",name:"rindo"},{char:"😅",name:"sorriso amarelo"},{char:"🤣",name:"rolando de rir"},{char:"😂",name:"chorando de rir"},{char:"🙂",name:"sorriso leve"},{char:"🙃",name:"rosto de cabeça pra baixo"},{char:"😉",name:"piscando"},{char:"😊",name:"sorrindo com olhos fechados"},{char:"😇",name:"anjinho"},{char:"🥰",name:"apaixonado"},{char:"😍",name:"olhos de coração"},{char:"😘",name:"mandando beijo"},{char:"😋",name:"saboreando comida"},{char:"😜",name:"língua de fora piscando"},{char:"🤪",name:"doidão"},{char:"🤔",name:"pensando"},{char:"🤨",name:"sobrancelha levantada"},{char:"😐",name:"rosto neutro"},{char:"😴",name:"dormindo"},{char:"🥱",name:"bocejando"},{char:"😢",name:"chorando"},{char:"😭",name:"chorando muito"},{char:"😡",name:"com raiva"},{char:"🤯",name:"cabeça explodindo"},{char:"😱",name:"gritando de medo"},{char:"🥳",name:"festejando"},{char:"🤗",name:"abraço"},{char:"🤝",name:"aperto de mão",tone:!0},{char:"👍",name:"polegar pra cima",tone:!0},{char:"👎",name:"polegar pra baixo",tone:!0},{char:"👏",name:"palmas",tone:!0},{char:"🙌",name:"mãos levantadas",tone:!0},{char:"🙏",name:"mãos em oração",tone:!0},{char:"💪",name:"braço forte",tone:!0},{char:"👋",name:"acenando",tone:!0},{char:"✍️",name:"escrevendo",tone:!0},{char:"👶",name:"bebê",tone:!0},{char:"🧑",name:"pessoa",tone:!0},{char:"👨",name:"homem",tone:!0},{char:"👩",name:"mulher",tone:!0},{char:"🧑💻",name:"pessoa programando",tone:!0},{char:"👩⚕️",name:"profissional de saúde"},{char:"👨👩👧👦",name:"família"},{char:"🏳️🌈",name:"bandeira arco-íris"}]},{id:"animals",label:"Animais e natureza",icon:"🐶",emojis:[{char:"🐶",name:"cachorro"},{char:"🐱",name:"gato"},{char:"🐭",name:"camundongo"},{char:"🐹",name:"hamster"},{char:"🐰",name:"coelho"},{char:"🦊",name:"raposa"},{char:"🐻",name:"urso"},{char:"🐼",name:"panda"},{char:"🐨",name:"coala"},{char:"🐯",name:"tigre"},{char:"🦁",name:"leão"},{char:"🐮",name:"vaca"},{char:"🐷",name:"porco"},{char:"🐸",name:"sapo"},{char:"🐵",name:"macaco"},{char:"🐔",name:"galinha"},{char:"🐧",name:"pinguim"},{char:"🐦",name:"pássaro"},{char:"🦅",name:"águia"},{char:"🦉",name:"coruja"},{char:"🐺",name:"lobo"},{char:"🐴",name:"cavalo"},{char:"🦄",name:"unicórnio"},{char:"🐝",name:"abelha"},{char:"🦋",name:"borboleta"},{char:"🐢",name:"tartaruga"},{char:"🐍",name:"cobra"},{char:"🐳",name:"baleia"},{char:"🐬",name:"delfim"},{char:"🐙",name:"polvo"},{char:"🌵",name:"cacto"},{char:"🌲",name:"árvore"},{char:"🌸",name:"flor de cerejeira"},{char:"🌈",name:"arco-íris"},{char:"☀️",name:"sol"},{char:"⭐",name:"estrela"},{char:"🔥",name:"fogo"},{char:"💧",name:"gota"}]},{id:"food",label:"Comida e bebidas",icon:"🍕",emojis:[{char:"🍏",name:"maçã verde"},{char:"🍎",name:"maçã"},{char:"🍊",name:"tangerina"},{char:"🍋",name:"limão"},{char:"🍌",name:"banana"},{char:"🍉",name:"melancia"},{char:"🍇",name:"uva"},{char:"🍓",name:"morango"},{char:"🍒",name:"cereja"},{char:"🍑",name:"pêssego"},{char:"🥝",name:"kiwi"},{char:"🍅",name:"tomate"},{char:"🥑",name:"abacate"},{char:"🍕",name:"pizza"},{char:"🍔",name:"hambúrguer"},{char:"🍟",name:"batata frita"},{char:"🌮",name:"taco"},{char:"🍣",name:"sushi"},{char:"🍜",name:"macarrão"},{char:"🍦",name:"sorvete"},{char:"🍩",name:"donut"},{char:"🍰",name:"bolo"},{char:"🎂",name:"bolo de aniversário"},{char:"☕",name:"café"},{char:"🍺",name:"cerveja"},{char:"🍷",name:"vinho"},{char:"🥤",name:"bebida com canudo"}]},{id:"activities",label:"Atividades",icon:"⚽",emojis:[{char:"⚽",name:"futebol"},{char:"🏀",name:"basquete"},{char:"🏈",name:"futebol americano"},{char:"⚾",name:"baseball"},{char:"🎾",name:"tênis"},{char:"🏐",name:"vôlei"},{char:"🎱",name:"bilhar"},{char:"🏓",name:"ping pong"},{char:"🏸",name:"badminton"},{char:"🥊",name:"boxe"},{char:"🎮",name:"videogame"},{char:"🎲",name:"dado"},{char:"🎯",name:"dardo"},{char:"🎳",name:"boliche"},{char:"🎸",name:"guitarra"},{char:"🎨",name:"paleta de arte"},{char:"🎬",name:"cinema"},{char:"🎤",name:"microfone"},{char:"🎧",name:"fone de ouvido"},{char:"🏆",name:"troféu"},{char:"🥇",name:"medalha de ouro"}]},{id:"travel",label:"Viagens e lugares",icon:"✈️",emojis:[{char:"✈️",name:"avião"},{char:"🚗",name:"carro"},{char:"🚕",name:"taxi"},{char:"🚌",name:"ônibus"},{char:"🚓",name:"carro de polícia"},{char:"🚑",name:"ambulância"},{char:"🚒",name:"bombeiros"},{char:"🚲",name:"bicicleta"},{char:"🛵",name:"moto"},{char:"🚀",name:"foguete"},{char:"🚁",name:"helicóptero"},{char:"⛵",name:"veleiro"},{char:"🚢",name:"navio"},{char:"🗽",name:"estátua da liberdade"},{char:"🗼",name:"torre"},{char:"🏝️",name:"ilha"},{char:"🏔️",name:"montanha"},{char:"🌋",name:"vulcão"},{char:"🏕️",name:"acampamento"},{char:"🏠",name:"casa"},{char:"🏢",name:"prédio"}]},{id:"objects",label:"Objetos",icon:"💡",emojis:[{char:"💡",name:"lâmpada"},{char:"🔦",name:"lanterna"},{char:"📱",name:"celular"},{char:"💻",name:"notebook"},{char:"⌨️",name:"teclado"},{char:"🖥️",name:"computador"},{char:"🖨️",name:"impressora"},{char:"📷",name:"câmera"},{char:"📺",name:"televisão"},{char:"🎥",name:"câmera de filmagem"},{char:"⏰",name:"despertador"},{char:"📚",name:"livros"},{char:"✏️",name:"lápis"},{char:"📌",name:"pin"},{char:"📎",name:"clipe"},{char:"✂️",name:"tesoura"},{char:"🔒",name:"cadeado fechado"},{char:"🔑",name:"chave"},{char:"💰",name:"saco de dinheiro"},{char:"💳",name:"cartão de crédito"},{char:"🎁",name:"presente"}]},{id:"symbols",label:"Símbolos",icon:"❤️",emojis:[{char:"❤️",name:"coração vermelho"},{char:"🧡",name:"coração laranja"},{char:"💛",name:"coração amarelo"},{char:"💚",name:"coração verde"},{char:"💙",name:"coração azul"},{char:"💜",name:"coração roxo"},{char:"🖤",name:"coração preto"},{char:"🤍",name:"coração branco"},{char:"🤎",name:"coração marrom"},{char:"💔",name:"coração partido"},{char:"✨",name:"brilho"},{char:"💯",name:"cem pontos"},{char:"✅",name:"check"},{char:"❌",name:"x"},{char:"❓",name:"interrogação"},{char:"❗",name:"exclamação"},{char:"♻️",name:"reciclagem"},{char:"⚠️",name:"alerta"},{char:"🆗",name:"ok"},{char:"🆕",name:"novo"}]},{id:"flags",label:"Bandeiras",icon:"🏳️",emojis:[{char:"🇧🇷",name:"brasil"},{char:"🇺🇸",name:"estados unidos"},{char:"🇵🇹",name:"portugal"},{char:"🇪🇸",name:"espanha"},{char:"🇫🇷",name:"frança"},{char:"🇩🇪",name:"alemanha"},{char:"🇮🇹",name:"itália"},{char:"🇬🇧",name:"reino unido"},{char:"🇯🇵",name:"japão"},{char:"🇨🇳",name:"china"},{char:"🇦🇷",name:"argentina"},{char:"🇨🇦",name:"canadá"},{char:"🇲🇽",name:"méxico"},{char:"🇨🇱",name:"chile"},{char:"🇺🇾",name:"uruguai"},{char:"🇵🇾",name:"paraguai"}]}],_hoisted_1$x={key:0,class:"sm-emoji-picker__tabs",role:"tablist","aria-label":"Categorias de emoji"},_hoisted_2$u=["aria-selected","title","onClick"],_hoisted_3$r={"aria-hidden":"true"},_hoisted_4$q={class:"sm-emoji-picker__search"},_hoisted_5$o={class:"sm-emoji-picker__search-box"},_hoisted_6$k={class:"sm-emoji-picker__body"},_hoisted_7$j={class:"sm-emoji-picker__group-label"},_hoisted_8$f={key:0,class:"sm-emoji-picker__empty"},_hoisted_9$c={key:1,class:"sm-emoji-picker__grid"},_hoisted_10$b=["title","onClick"],_hoisted_11$a={class:"sm-emoji-picker__footer"},_hoisted_12$8=["aria-expanded","title"],_hoisted_13$5={class:"sm-emoji-picker__tone-swatch sm-emoji-picker__tone-swatch--current","aria-hidden":"true"},_hoisted_14$5={key:0,class:"sm-emoji-picker__tone-menu"},_hoisted_15$5=["aria-label","onClick"],TONE_PREVIEW_CHAR="👍",_sfc_main$C={__name:"EmojiPicker",props:{theme:{type:String,default:"light"},categories:{type:Array,default:()=>EMOJI_CATEGORIES}},emits:["select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useEmojiPickerStore(),oe=e$b.ref(""),ie=e$b.ref(!1),le=e$b.ref("recent"),ce={id:"recent",label:"Usados recentemente",icon:"🕘"},de=e$b.computed(()=>[ce,...ne.categories]),ue=e$b.computed(()=>le.value==="recent"?ce:ne.categories.find($e=>$e.id===le.value)),ve=e$b.computed(()=>oe.value.trim().length>0),me=e$b.computed(()=>re.skinTone),ge=e$b.computed(()=>SKIN_TONES.find($e=>$e.id===me.value)||SKIN_TONES[0]),fe=e$b.computed(()=>{const $e=oe.value.trim().toLowerCase();return $e?ne.categories.flatMap(ye=>ye.emojis).filter(ye=>ye.name.includes($e)||ye.char===$e).slice(0,60):[]}),pe=e$b.computed(()=>{var $e;return ve.value?fe.value:le.value==="recent"?re.recent.map(ye=>({char:ye,name:"recente",tone:!1})):(($e=ue.value)==null?void 0:$e.emojis)||[]});function _e($e){return $e.tone?applySkinTone($e.char,ge.value.modifier):$e.char}function be($e){const ye=_e($e);re.addRecent(ye),ae("select",ye)}function ke($e){re.setSkinTone($e),ie.value=!1}return($e,ye)=>{var Ee;return e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["sm-emoji-picker",{"sm-emoji-picker--dark":ee.theme==="dark"}])},[ve.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$x,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(de.value,Se=>(e$b.openBlock(),e$b.createElementBlock("button",{key:Se.id,type:"button",role:"tab","aria-selected":le.value===Se.id,title:Se.label,class:e$b.normalizeClass(["sm-emoji-picker__tab",{"sm-emoji-picker__tab--active":le.value===Se.id}]),onClick:Le=>le.value=Se.id},[e$b.createElementVNode("span",_hoisted_3$r,e$b.toDisplayString(Se.icon),1)],10,_hoisted_2$u))),128))])),e$b.createElementVNode("div",_hoisted_4$q,[e$b.createElementVNode("div",_hoisted_5$o,[ye[2]||(ye[2]=e$b.createElementVNode("svg",{class:"sm-emoji-picker__search-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z","clip-rule":"evenodd"})],-1)),e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":ye[0]||(ye[0]=Se=>oe.value=Se),type:"text",class:"sm-emoji-picker__search-input",placeholder:"Procure emojis","aria-label":"Buscar emoji"},null,512),[[e$b.vModelText,oe.value]])])]),e$b.createElementVNode("div",_hoisted_6$k,[e$b.createElementVNode("p",_hoisted_7$j,e$b.toDisplayString(ve.value?"Resultados":(Ee=ue.value)==null?void 0:Ee.label),1),pe.value.length?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$c,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(pe.value,Se=>(e$b.openBlock(),e$b.createElementBlock("button",{key:Se.char+Se.name,type:"button",class:"sm-emoji-picker__emoji",title:Se.name,onClick:Le=>be(Se)},e$b.toDisplayString(_e(Se)),9,_hoisted_10$b))),128))])):(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_8$f,e$b.toDisplayString(ve.value?"Nenhum emoji encontrado":"Nenhum emoji recente ainda"),1))]),e$b.createElementVNode("div",_hoisted_11$a,[e$b.createElementVNode("button",{type:"button",class:"sm-emoji-picker__tone-toggle","aria-expanded":ie.value,"aria-label":"Alterar aparência do emoji",title:ge.value.label,onClick:ye[1]||(ye[1]=Se=>ie.value=!ie.value)},[e$b.createElementVNode("span",_hoisted_13$5,e$b.toDisplayString(TONE_PREVIEW_CHAR)+e$b.toDisplayString(ge.value.modifier),1),ye[3]||(ye[3]=e$b.createElementVNode("svg",{class:"sm-emoji-picker__tone-caret","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",fill:"none"},[e$b.createElementVNode("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],8,_hoisted_12$8),ie.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_14$5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(e$b.unref(SKIN_TONES),Se=>(e$b.openBlock(),e$b.createElementBlock("button",{key:Se.id,type:"button",class:e$b.normalizeClass(["sm-emoji-picker__tone-swatch",{"sm-emoji-picker__tone-swatch--active":Se.id===me.value}]),"aria-label":Se.label,onClick:Le=>ke(Se.id)},e$b.toDisplayString(TONE_PREVIEW_CHAR)+e$b.toDisplayString(Se.modifier),11,_hoisted_15$5))),128))])):e$b.createCommentVNode("",!0)])],2)}}},EmojiPicker=_export_sfc$1(_sfc_main$C,[["__scopeId","data-v-44a5a69e"]]),PICKER_WIDTH=320,PICKER_HEIGHT=380,VIEWPORT_GAP=8,_sfc_main$B={__name:"EmojiPickerPopover",props:{show:{type:Boolean,default:!1},theme:{type:String,default:"light"},categories:{type:Array,default:()=>EMOJI_CATEGORIES},anchorEl:{type:Object,default:null}},emits:["close","select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.ref(null),oe=e$b.ref({position:"fixed",top:"-9999px",left:"-9999px"});function ie(){const ue=ne.anchorEl;if(!ue){oe.value={position:"fixed",right:`${VIEWPORT_GAP}px`,bottom:`${VIEWPORT_GAP}px`,width:`${PICKER_WIDTH}px`,height:`${PICKER_HEIGHT}px`};return}const ve=ue.getBoundingClientRect();let me=ve.top-PICKER_HEIGHT-VIEWPORT_GAP;me<VIEWPORT_GAP&&(me=ve.bottom+VIEWPORT_GAP),me=Math.min(me,window.innerHeight-PICKER_HEIGHT-VIEWPORT_GAP),me=Math.max(me,VIEWPORT_GAP);let ge=ve.left;ge=Math.min(ge,window.innerWidth-PICKER_WIDTH-VIEWPORT_GAP),ge=Math.max(ge,VIEWPORT_GAP),oe.value={position:"fixed",top:`${me}px`,left:`${ge}px`,width:`${PICKER_WIDTH}px`,height:`${PICKER_HEIGHT}px`}}function le(ue){ae("select",ue)}function ce(ue){var me,ge;if(!ne.show)return;const ve=re.value;ve&&!ve.contains(ue.target)&&ue.target!==ne.anchorEl&&!((ge=(me=ne.anchorEl)==null?void 0:me.contains)!=null&&ge.call(me,ue.target))&&ae("close")}function de(ue){ue.key==="Escape"&&ne.show&&ae("close")}return e$b.watch(()=>ne.show,ue=>{ue?(e$b.nextTick(ie),window.addEventListener("resize",ie),window.addEventListener("scroll",ie,!0)):(window.removeEventListener("resize",ie),window.removeEventListener("scroll",ie,!0))},{immediate:!0}),e$b.onMounted(()=>{document.addEventListener("mousedown",ce,!0),document.addEventListener("keydown",de)}),e$b.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ce,!0),document.removeEventListener("keydown",de),window.removeEventListener("resize",ie),window.removeEventListener("scroll",ie,!0)}),(ue,ve)=>(e$b.openBlock(),e$b.createBlock(e$b.Teleport,{to:"body"},[e$b.createVNode(e$b.Transition,{name:"sm-emoji-popover-fade"},{default:e$b.withCtx(()=>[ee.show?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"rootEl",ref:re,class:e$b.normalizeClass(["sm-emoji-popover",{"sm-emoji-popover--dark":ee.theme==="dark"}]),role:"dialog","aria-label":"Seletor de emojis",style:e$b.normalizeStyle(oe.value)},[e$b.createVNode(EmojiPicker,{theme:ee.theme,categories:ee.categories,onSelect:le},null,8,["theme","categories"])],6)):e$b.createCommentVNode("",!0)]),_:1})]))}},EmojiPickerPopover=_export_sfc$1(_sfc_main$B,[["__scopeId","data-v-813b79e0"]]),_hoisted_1$w={class:"relative flex w-full items-center justify-center gap-1"},_hoisted_2$t=["onClick"],_hoisted_3$q={class:"text-base"},_hoisted_4$p=["aria-expanded"],_hoisted_5$n=["onClick"],_hoisted_6$j={class:"whitespace-nowrap text-base leading-none"},_sfc_main$A={__name:"MessageEmojiPicker",props:["isOwner"],emits:["emoji"],setup(ee,{emit:te}){const ne=te,ae=useMessageUiStore(),re=e$b.computed(()=>{var be,ke;return((ke=(be=ae.currentChat)==null?void 0:be.instance)==null?void 0:ke.type)==="instagram"}),oe=e$b.computed(()=>{var be,ke;return((ke=(be=ae.currentChat)==null?void 0:be.instance)==null?void 0:ke.type)==="telegram"}),ie=["❤","👍","👎","🔥","🥰","👏","😁","🤔","🤯","😱","🤬","😢","🎉","🤩","🤮","💩","🙏","👌","🕊","🤡","🥱","🥴","😍","🐳","❤🔥","🌚","🌭","💯","🤣","⚡","🍌","🏆","💔","🤨","😐","🍓","🍾","💋","🖕","😈","😴","😭","🤓","👻","👨💻","👀","🎃","🙈","😇","😨","🤝","✍","🤗","🫡","🎅","🎄","☃","💅","🤪","🗿","🆒","💘","🙉","🦄","😘","💊","🙊","😎","👾","🤷♂","🤷","🤷♀","😡"],le=e$b.computed(()=>re.value?["❤️","😂","😲","😢","😡","👍","👎"]:oe.value?["👍","👎","❤","🔥","🥰","👏"]:["👍","❤️","😂","😲","😢","🙏"]),ce=e$b.ref(!1),de=e$b.ref(null),ue=e$b.ref(null);function ve(be){ne("emoji",be)}function me(be){ne("emoji",be),ce.value=!1}function ge(be){ne("emoji",be),ce.value=!1}function fe(be){if(!oe.value||!ce.value)return;const ke=de.value;ke&&!ke.contains(be.target)&&(ce.value=!1)}e$b.onMounted(()=>{document.addEventListener("mousedown",fe,!0)}),e$b.onBeforeUnmount(()=>{document.removeEventListener("mousedown",fe,!0)});function pe(be){be.stopPropagation(),ue.value=be.currentTarget,ce.value=!ce.value}function _e(){ce.value=!1}return(be,ke)=>(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_1$w,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(le.value,($e,ye)=>(e$b.openBlock(),e$b.createElementBlock("button",{key:ye,class:e$b.normalizeClass([e$b.unref(ae).themeMode?"hover:bg-white/10":"hover:bg-black/10","text-lg px-[5px] py-1 rounded-lg"]),type:"button",onClick:Ee=>ve($e)},[e$b.createElementVNode("span",_hoisted_3$q,e$b.toDisplayString($e),1)],10,_hoisted_2$t))),128)),re.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("button",{key:0,class:e$b.normalizeClass([e$b.unref(ae).themeMode?"hover:bg-white/10":"hover:bg-black/10","px-2 py-1 rounded text-lg"]),type:"button","aria-haspopup":"dialog","aria-expanded":ce.value,onClick:pe}," + ",10,_hoisted_4$p)),oe.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,ref_key:"telegramPopoverEl",ref:de,class:e$b.normalizeClass(["absolute",ee.isOwner?"right-0":"left-0"]),style:e$b.normalizeStyle({bottom:"40px",zIndex:4e3,pointerEvents:ce.value?"auto":"none"})},[e$b.withDirectives(e$b.createElementVNode("div",{class:"relative",onMouseleave:_e},[ke[1]||(ke[1]=e$b.createElementVNode("div",{"aria-hidden":"true",class:"absolute -inset-x-0 mx-auto -left-10 w-[45vh] h-[50vh] rounded-lg",style:{"pointer-events":"auto"}},null,-1)),e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[e$b.withDirectives(e$b.createElementVNode("div",{class:e$b.normalizeClass(["grid max-h-[40vh] grid-cols-8 gap-1 overflow-y-auto rounded-lg p-2 shadow-lg",e$b.unref(ae).themeMode?"bg-neutral-800":"bg-white"])},[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie,($e,ye)=>e$b.createElementVNode("button",{key:ye,class:e$b.normalizeClass([e$b.unref(ae).themeMode?"hover:bg-white/10":"hover:bg-black/10","flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-lg"]),type:"button",onClick:Ee=>ge($e)},[e$b.createElementVNode("span",_hoisted_6$j,e$b.toDisplayString($e),1)],10,_hoisted_5$n)),64))],2),[[e$b.vShow,ce.value]])]),_:1})],544),[[e$b.vShow,ce.value]])],6)):(e$b.openBlock(),e$b.createBlock(EmojiPickerPopover,{key:2,show:ce.value,theme:e$b.unref(ae).themeMode?"dark":"light","anchor-el":ue.value,onClose:ke[0]||(ke[0]=$e=>ce.value=!1),onSelect:me},null,8,["show","theme","anchor-el"]))]))}},MessageEmojiPicker=_export_sfc$1(_sfc_main$A,[["__scopeId","data-v-23288b29"]]),EDIT_WINDOW_MINUTES=15,DELETE_WINDOW_MINUTES=2880;function minutesSince(ee){const te=new Date(ee||0).getTime();return(Date.now()-te)/6e4}function normalizedStage(ee){return String((ee==null?void 0:ee.stage)||(ee==null?void 0:ee.status)||"").toLowerCase()}function isExcludedMessage(ee){const te=normalizedStage(ee);return te==="excluded"||te==="exclused"}function isProcessingMessage(ee){return normalizedStage(ee)==="processing"}function isFailedMessage(ee){return(ee==null?void 0:ee.stage)==="failed"}function hasMessagePackage(ee){return Array.isArray(ee==null?void 0:ee.items)&&ee.items.length>1}function hasSingleFileUrl(ee){if(hasMessagePackage(ee))return!1;const te=(ee==null?void 0:ee.content)||{};return["file","audio","image"].includes(ee==null?void 0:ee.type)&&!!te.url}function hasMessageText(ee){var te;return!!((te=ee==null?void 0:ee.content)!=null&&te.text)&&ee.content.text.trim().length>0}function resolveMessageActionRules(ee,te={}){var ze,Re,Oe,Pe,Be;const{chatActive:ne=!1,chatInstanceId:ae=null,attendant:re=null}=te,oe=isProcessingMessage(ee),ie=isExcludedMessage(ee),le=isFailedMessage(ee),ce=!!(ee!=null&&ee.from_me),de=!!(ee!=null&&ee.internal),ue=ee==null?void 0:ee.type,ve=((ze=ee==null?void 0:ee.instance)==null?void 0:ze.type)||"",me=["whatsapp-qrcode","telegram","webchat"].includes(ve),ge=de?((Re=ee==null?void 0:ee.sent_by)==null?void 0:Re.id)===(re==null?void 0:re.id):!0,fe=!!((Oe=re==null?void 0:re.permissions)!=null&&Oe.can_edit_message),pe=!!((Pe=re==null?void 0:re.permissions)!=null&&Pe.can_delete_message),_e=()=>{const De=[];return oe&&De.push("Ação indisponível para mensagens processando."),ie&&De.push("Mensagem excluída."),le&&De.push("A mensagem falhou no envio."),De},be=_e();me||be.push("Disponível apenas para WhatsApp QR Code, Telegram e Webchat."),fe||be.push("Você não tem permissão para editar."),ce||be.push("Só é possível editar mensagens enviadas por você."),ue!=="text"&&be.push("Apenas mensagens de texto podem ser editadas."),de&&!ge&&be.push("Mensagem interna só pode ser editada pelo mesmo autor."),ne||be.push("A conversa precisa estar ativa."),minutesSince(ee==null?void 0:ee.sent_at)>EDIT_WINDOW_MINUTES&&be.push("Janela de edição expirada (15 minutos).");const ke=_e();ie&&(ke[ke.indexOf("Mensagem excluída.")]="Mensagem já excluída."),me||ke.push("Disponível apenas para WhatsApp QR Code, Telegram e Webchat."),pe||ke.push("Você não tem permissão para excluir."),ce||ke.push("Só é possível excluir mensagens enviadas por você."),de&&!ge&&ke.push("Mensagem interna só pode ser excluída pelo mesmo autor."),ne||ke.push("A conversa precisa estar ativa."),minutesSince(ee==null?void 0:ee.sent_at)>DELETE_WINDOW_MINUTES&&ke.push("Janela de exclusão expirada (48 horas)."),ue==="sms"&&ke.push("Não é possível excluir mensagens SMS.");const $e=_e();ee!=null&&ee.items&&$e.push("Não é possível responder a pacote de mensagens."),ne||$e.push("A conversa precisa estar ativa."),ue==="call"&&$e.push("Não é possível responder a mensagens de ligação."),ue==="ciphertext"&&$e.push("Não é possível responder a mensagens aguardando sincronização."),ue==="sms"&&$e.push("Não é possível responder a mensagens SMS.");const ye=(Be=ee==null?void 0:ee.instance)==null?void 0:Be.id;ye&&ae&&ye!==ae&&$e.push("Não é possível citar mensagens de outra instância.");const Ee=[];oe&&Ee.push("Ação indisponível para mensagens processando."),ie&&Ee.push("Mensagem excluída."),hasSingleFileUrl(ee)||Ee.push("Não há arquivo único disponível para download."),le&&Ee.push("A mensagem falhou no envio.");const Se=_e();de&&Se.push("Não é possível encaminhar mensagens internas.");const Le={call:"Não é possível encaminhar mensagens de ligação.",location:"Não é possível encaminhar mensagens de localização.",ciphertext:"Não é possível encaminhar mensagens aguardando sincronização.",template:"Não é possível encaminhar mensagens de template.",list:"Não é possível encaminhar mensagens de lista.",button:"Não é possível encaminhar mensagens com botão.",sms:"Não é possível encaminhar mensagens SMS."};Le[ue]&&Se.push(Le[ue]),ve==="webchat"&&Se.push("Não é possível encaminhar mensagens do Webchat.");const Ve=hasMessageText(ee)?[]:["Mensagem sem texto para copiar."],Te=[];return oe?Te.push("Ação indisponível para mensagens processando."):le||Te.push("Essa mensagem já foi enviada com sucesso."),{edit:be,delete:ke,reply:$e,download:Ee,forward:Se,copy:Ve,resend:Te}}function canForwardMessage(ee){var te;return!ee||isExcludedMessage(ee)||isProcessingMessage(ee)||isFailedMessage(ee)||ee.internal||((te=ee==null?void 0:ee.instance)==null?void 0:te.type)==="webchat"?!1:!["call","ciphertext","template","list","button","location"].includes(ee==null?void 0:ee.type)}function failure(ee,te){var ne,ae;return{ok:!1,error:((ae=(ne=ee==null?void 0:ee.response)==null?void 0:ne.data)==null?void 0:ae.message)||te}}async function deleteMessage(ee){try{const{data:te}=await api.delete(`${messageUrl}${ee}/`);return{ok:!0,data:te}}catch(te){return failure(te,"Não foi possível excluir a mensagem.")}}async function resendMessage(ee){try{const{data:te}=await api.post(messageResend(ee));return{ok:!0,data:te}}catch(te){return failure(te,"Não foi possível reenviar a mensagem.")}}async function reactToMessage(ee,te){if(!ee)return{ok:!1,error:"Mensagem ausente."};ee.metadata||(ee.metadata={});const ne=ee.metadata.reaction;ee.metadata.reaction=te;try{const{data:ae}=await api.post(messageReaction(ee.id),{reaction:te});return{ok:!0,data:ae}}catch(ae){return ee.metadata.reaction=ne,failure(ae,"Erro ao adicionar reação.")}}async function transcriptAudio(ee){if(!ee)return{ok:!1,error:"Mensagem ausente."};ee.isTranscripting=!0;try{const{data:te}=await api.get(messageTranscript(ee.id));return ee.metadata||(ee.metadata={}),ee.metadata.transcripted_text=te.transcript_text,{ok:!0,data:te}}catch(te){return failure(te,"Erro ao transcrever o áudio.")}finally{ee.isTranscripting=!1}}const _hoisted_1$v=["disabled"],_hoisted_2$s={class:"relative flex h-6 items-center justify-center uppercase"},_hoisted_3$p={key:0},_hoisted_4$o={key:1,class:"flex items-center justify-center"},_hoisted_5$m={class:"flex items-center gap-2"},_hoisted_6$i=["disabled"],_hoisted_7$i={class:"relative flex h-5 items-center justify-center text-[12px] uppercase"},_hoisted_8$e={key:0},_hoisted_9$b={key:1,class:"flex items-center justify-center"},_sfc_main$z={__name:"MessageActionsMenu",emits:["info","download","download-package","copy-native","deleted","resent"],setup(ee,{emit:te}){const ne=te,ae=useMessageUiStore(),re=e$b.computed(()=>ae.loggedAttendant),oe=e$b.computed(()=>!ae.themeMode),ie=e$b.ref(!1),le=e$b.ref(!1),ce=e$b.ref(!1),de=e$b.ref(!1),ue=e$b.computed(()=>ae.actionsMenu.message||{}),ve=e$b.computed(()=>resolveMessageActionRules(ue.value,{chatActive:ae.chatActive,chatInstanceId:ae.chatInstanceId,attendant:re.value})),me=e$b.computed(()=>isExcludedMessage(ue.value)),ge=e$b.computed(()=>!me.value&&ae.chatActive&&ve.value.reply.length===0),fe=e$b.computed(()=>!me.value&&hasMessagePackage(ue.value)),pe=e$b.computed(()=>!me.value&&!hasMessagePackage(ue.value)&&ve.value.download.length===0);function _e(){ae.closeActions()}function be(){le.value=!1}function ke(we,Ce){if(!we)return{};const{top:Fe,left:Ie,width:Ue}=Ce(we,260,130);return{top:`${Fe}px`,left:`${Ie}px`,width:`${Ue}px`}}const $e={edit:"Não é possível editar",delete:"Não é possível excluir",download:"Não é possível baixar",saveas:"Não é possível baixar",reply:"Não é possível responder","re-send":"Não é possível reenviar mensagem"};function ye(we){(we.ctrlKey||we.metaKey)&&we.key.toLowerCase()==="c"&&(we.preventDefault(),hasMessageText(ue.value)&&Oe())}function Ee(){be(),!(ve.value.reply.length||me.value)&&(ae.setQuote(ue.value.content,ue.value.sent_by,ue.value.id),_e())}function Se(){be(),!(ve.value.edit.length||me.value)&&(ae.startEdit(ue.value),_e())}function Le(){be(),!ve.value.forward.length&&(ae.startForward(ue.value),_e())}function Ve(){ve.value.delete.length||me.value||(le.value=!le.value)}async function Te(){if(ve.value.delete.length)return;ce.value=!0;const we=await deleteMessage(ue.value.id);if(ce.value=!1,!we.ok){notiwind.notify({group:"error",title:"Erro",text:we.error},2e3);return}ne("deleted",ue.value),notiwind.notify({group:"success",title:"Sucesso",text:"Mensagem Apagada"},2e3),le.value=!1,_e()}async function ze(){var Ce;be(),ie.value=!0;const we=await resendMessage(ue.value.id);if(ie.value=!1,!we.ok){notiwind.notify({group:"error",title:"Erro",text:we.error},4e3),_e();return}ne("resent",ue.value),notiwind.notify({group:"success",title:"Sucesso",text:((Ce=we.data)==null?void 0:Ce.message)||"Mensagem reenviada com sucesso"},2e3),_e()}async function Re(we){be();const Ce=await reactToMessage(ue.value,we);if(!Ce.ok){notiwind.notify({group:"error",title:"Erro",text:Ce.error},4e3);return}_e()}async function Oe(){var Fe,Ie;be();const we=((Ie=(Fe=ue.value)==null?void 0:Fe.content)==null?void 0:Ie.text)||"";if(!ae.isWebDevice){ne("copy-native",we),_e();return}if(!await copyToClipboard(we)){notiwind.notify({group:"error",title:"Erro",text:"Não foi possível copiar o texto. Tente novamente."},2e3),_e();return}notiwind.notify({group:"success",title:"Copiado",text:"Texto copiado para a área de transferência."},2e3),de.value=!0,setTimeout(()=>{de.value=!1,_e()},900)}function Pe(){be(),ne("info",ue.value),_e()}function Be(){be(),ne("download",ue.value),_e()}function De(){be(),ne("download-package",ue.value),_e()}const Ne={reply:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path 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"/> </svg>',copy:'<svg class="size-4" viewBox="0 0 24 24" fill="currentColor"><path d="M16 1H4a2 2 0 0 0-2 2v12h2V3h12V1zm3 4H8a2 2 0 0 0-2 2v14h11a2 2 0 0 0 2-2V5z"/></svg>',check:'<svg class="size-4 text-emerald-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>',forward:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path d="M5.027 10.9a8.729 8.729 0 0 1 6.422-3.62v-1.2A2.061 2.061 0 0 1 12.61 4.2a1.986 1.986 0 0 1 2.104.23l5.491 4.308a2.11 2.11 0 0 1 .588 2.566 2.109 2.109 0 0 1-.588.734l-5.489 4.308a1.983 1.983 0 0 1-2.104.228 2.065 2.065 0 0 1-1.16-1.876v-.942c-5.33 1.284-6.212 5.251-6.25 5.441a1 1 0 0 1-.923.806h-.06a1.003 1.003 0 0 1-.955-.7A10.221 10.221 0 0 1 5.027 10.9Z"/> </svg>',trash:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="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"/> </svg>',edit:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="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"/> </svg>',info:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="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" clip-rule="evenodd"/></svg>',package:'<svg class="size-4" viewBox="0 0 24 24" fill="currentColor"><path d="M21 16V8l-9-5-9 5v8l9 5 9-5zM12 4.15 18.53 7.5 12 10.85 5.47 7.5z"/></svg>',download:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z" clip-rule="evenodd"/></svg>',resend:'<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"> <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.651 7.65a7.131 7.131 0 0 0-12.68 3.15M18.001 4v4h-4m-7.652 8.35a7.13 7.13 0 0 0 12.68-3.15M6 20v-4h4"/> </svg>'},Me=e$b.computed(()=>{const we=ve.value,Ce=[{key:"reply",label:"Responder",icon:Ne.reply,enabled:!we.reply.length,reasons:we.reply,handler:Ee},{key:"copy",label:de.value?"Copiado!":"Copiar",icon:de.value?Ne.check:Ne.copy,enabled:!we.copy.length,reasons:we.copy,handler:Oe,trailing:de.value?"":"Ctrl+C"},{key:"forward",label:"Encaminhar",icon:Ne.forward,enabled:!we.forward.length,reasons:we.forward,handler:Le},{key:"re-send",label:"Reenviar",icon:Ne.resend,enabled:!we.resend.length,reasons:we.resend,loading:ie.value,handler:ze},{key:"__divider__"},{key:"delete",label:"Apagar",icon:Ne.trash,enabled:!we.delete.length,reasons:we.delete,handler:Ve},{key:"__divider__"},{key:"edit",label:"Editar",icon:Ne.edit,enabled:!we.edit.length,reasons:we.edit,handler:Se},{key:"info",label:"Informações",icon:Ne.info,enabled:!0,reasons:[],handler:Pe}];return fe.value?Ce.push({key:"download_pkg",label:"Baixar pacote",icon:Ne.package,enabled:!0,reasons:[],handler:De}):pe.value&&Ce.push({key:"download",label:"Salvar como...",icon:Ne.download,enabled:!0,reasons:[],handler:Be}),Ce});return(we,Ce)=>(e$b.openBlock(),e$b.createBlock(ActionMenu,{items:Me.value,x:e$b.unref(ae).actionsMenu.x,y:e$b.unref(ae).actionsMenu.y,light:oe.value,"sheet-safe-area":140,"reason-titles":$e,onClose:_e,onKeydown:ye},e$b.createSlots({extra:e$b.withCtx(({anchorRect:Fe,veryNarrow:Ie,positionBeside:Ue})=>[e$b.createVNode(e$b.Transition,{name:"sheet"},{default:e$b.withCtx(()=>[le.value&&Ie?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["fixed inset-x-0 bottom-0 z-[2002] select-none rounded-t-2xl p-3 shadow-2xl",oe.value?"bg-white text-black/90 ring-1 ring-black/20":"bg-base-200 text-white/90 ring-1 ring-black/50"])},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["mx-auto mb-3 h-1.5 w-10 rounded-full opacity-40",oe.value?"bg-black/40":"bg-white/40"]),onClick:Ce[0]||(Ce[0]=qe=>be())},null,2),Ce[4]||(Ce[4]=e$b.createElementVNode("p",{class:"mb-3 text-center text-[12px] font-medium uppercase"}," Realmente deseja excluir essa mensagem? ",-1)),e$b.createElementVNode("button",{disabled:ce.value,class:"confirm-delete-btn group",onClick:Te},[Ce[3]||(Ce[3]=e$b.createElementVNode("span",{class:"confirm-delete-shine"},null,-1)),e$b.createElementVNode("span",_hoisted_2$s,[ce.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_4$o,[...Ce[2]||(Ce[2]=[e$b.createElementVNode("svg",{class:"size-5 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})],-1)])])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$p,"Excluir mensagem"))])],8,_hoisted_1$v)],2)):le.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(["fixed z-[2002] min-w-[220px] rounded-xl p-2 shadow-2xl",oe.value?"bg-white text-black/90 ring-1 ring-black/20":"bg-base-200 text-white/90 ring-1 ring-black/50"]),style:e$b.normalizeStyle(ke(Fe,Ue))},[Ce[7]||(Ce[7]=e$b.createElementVNode("p",{class:"mb-2 text-center text-[12px] font-medium uppercase"}," Realmente deseja excluir essa mensagem? ",-1)),e$b.createElementVNode("div",_hoisted_5$m,[e$b.createElementVNode("button",{type:"button",class:e$b.normalizeClass(["flex-1 rounded-xl px-3 py-2 text-[12px] uppercase",oe.value?"bg-black/10 text-black/70 hover:bg-black/15":"bg-white/10 text-white/70 hover:bg-white/15"]),onClick:Ce[1]||(Ce[1]=qe=>be())}," Cancelar ",2),e$b.createElementVNode("button",{disabled:ce.value,class:"confirm-delete-btn group flex-1",onClick:Te},[Ce[6]||(Ce[6]=e$b.createElementVNode("span",{class:"confirm-delete-shine"},null,-1)),e$b.createElementVNode("span",_hoisted_7$i,[ce.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_9$b,[...Ce[5]||(Ce[5]=[e$b.createElementVNode("svg",{class:"size-4 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})],-1)])])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_8$e,"Excluir"))])],8,_hoisted_6$i)])],6)):e$b.createCommentVNode("",!0)]),_:2},1024)]),_:2},[ge.value?{name:"footer",fn:e$b.withCtx(()=>[e$b.createVNode(MessageEmojiPicker,{onEmoji:Re})]),key:"0"}:void 0]),1032,["items","x","y","light"]))}},MessageActionsMenu=_export_sfc$1(_sfc_main$z,[["__scopeId","data-v-4beff81c"]]),_hoisted_1$u={class:"audio-player hover:bg-base-100"},_hoisted_2$r=["disabled"],_hoisted_3$o={class:"audio-player-info"},_hoisted_4$n={class:"audio-progress-container"},_hoisted_5$l=["max","value","disabled"],_hoisted_6$h={class:"audio-duration"},_hoisted_7$h={key:0,class:"align-middle"},_hoisted_8$d=["src"],_sfc_main$y={__name:"AudioPlayer",props:{src:{type:String,required:!0},label:{type:String,required:!0},type:{type:String,required:!0,validator:ee=>["client","attendant","general"].includes(ee)},activeSrc:{type:String,required:!1}},emits:["play-start","play-pause"],setup(ee,{emit:te}){const ne=te,ae=ee,re=e$b.ref(null),oe=e$b.ref(!1),ie=e$b.ref(0),le=e$b.ref(0),ce=e$b.ref(!1),de=e$b.ref(!1);function ue(){if(re.value)if(oe.value)re.value.pause(),oe.value=!1,Te();else{if(Ve(),!re.value)return;de.value=!0;const ze=re.value.play();ze&&typeof ze.then=="function"?ze.then(()=>{de.value=!1,oe.value=!0}).catch(Re=>{console.error("Audio play failed:",Re),de.value=!1,oe.value=!1}):(de.value=!1,oe.value=!0)}}function ve(ze){re.value&&(re.value.currentTime=ze.target.value)}function me(){re.value&&(le.value=re.value.duration||0)}function ge(){ce.value=!0}function fe(){ce.value=!1}function pe(){de.value=!1,oe.value=!0}function _e(){de.value=!0}function be(ze){console.error("Audio error:",ze),ce.value=!1,de.value=!1,oe.value=!1}function ke(){re.value&&(ie.value=re.value.currentTime)}function $e(){oe.value=!1,ie.value=0,Te()}function ye(){window.open(ae.src,"_blank")}function Ee(ze){if(!ze||isNaN(ze))return"0:00";const Re=Math.floor(ze/60),Oe=Math.floor(ze%60);return`${Re}:${Oe.toString().padStart(2,"0")}`}function Se(){switch(ae.type){case"client":return"#22d3ee";case"attendant":return"#14b8a6";case"general":return"#0ea5e9";default:return"#9ca3af"}}function Le(){return{backgroundColor:`${Se()}20`,color:Se()}}function Ve(){ne("play-start",ae.src)}function Te(){ne("play-pause",ae.src)}return e$b.watch(()=>ae.activeSrc,ze=>{ze&&ze!==ae.src&&oe.value&&re.value&&(re.value.pause(),oe.value=!1)}),e$b.onUnmounted(()=>{re.value&&(re.value.pause(),re.value.src="")}),(ze,Re)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$u,[e$b.createElementVNode("button",{onClick:e$b.withModifiers(ue,["stop"]),class:"audio-play-btn hover:bg-base-100",title:"Reproduzir",disabled:ce.value||de.value,style:e$b.normalizeStyle(Le())},[ce.value||de.value?(e$b.openBlock(),e$b.createElementBlock("svg",{key:0,class:"audio-play-spinner",style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...Re[0]||(Re[0]=[e$b.createElementVNode("circle",{cx:"12",cy:"12",r:"10","stroke-width":"4","stroke-opacity":"0.2"},null,-1),e$b.createElementVNode("path",{d:"M4 12a8 8 0 018-8","stroke-width":"4","stroke-linecap":"round"},null,-1)])],4)):oe.value?(e$b.openBlock(),e$b.createElementBlock("svg",{key:2,style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Re[2]||(Re[2]=[e$b.createElementVNode("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])],4)):(e$b.openBlock(),e$b.createElementBlock("svg",{key:1,style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Re[1]||(Re[1]=[e$b.createElementVNode("path",{d:"M8 5v14l11-7z"},null,-1)])],4))],12,_hoisted_2$r),e$b.createElementVNode("div",_hoisted_3$o,[e$b.createElementVNode("div",{class:"audio-player-title",style:e$b.normalizeStyle({color:Se()})},e$b.toDisplayString(ee.label),5),e$b.createElementVNode("div",_hoisted_4$n,[e$b.createElementVNode("div",{class:"audio-progress-track",style:e$b.normalizeStyle({backgroundColor:`${Se()}20`})},[e$b.createElementVNode("div",{class:"audio-progress-fill",style:e$b.normalizeStyle({width:le.value>0?`${ie.value/le.value*100}%`:"0%",backgroundColor:Se()})},null,4),e$b.createElementVNode("input",{type:"range",class:"audio-progress-input",min:"0",max:le.value,value:ie.value,onInput:e$b.withModifiers(ve,["stop"]),disabled:ce.value||de.value},null,40,_hoisted_5$l)],4)])]),e$b.createElementVNode("span",_hoisted_6$h,[ce.value||de.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_7$h,"-- : --")):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(Ee(ie.value))+" : "+e$b.toDisplayString(Ee(le.value)),1)],64))]),e$b.createElementVNode("button",{onClick:e$b.withModifiers(ye,["stop"]),class:"audio-download-btn hover:bg-base-300",title:"Baixar"},[(e$b.openBlock(),e$b.createElementBlock("svg",{style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[...Re[3]||(Re[3]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"},null,-1)])],4))]),e$b.createElementVNode("audio",{ref_key:"audioElement",ref:re,src:ee.src,onLoadstart:ge,onLoadedmetadata:me,onCanplay:fe,onPlaying:pe,onWaiting:_e,onTimeupdate:ke,onEnded:$e,onError:be,preload:"metadata"},null,40,_hoisted_8$d)]))}},AudioPlayer=_export_sfc$1(_sfc_main$y,[["__scopeId","data-v-fbc276d0"]]),_sfc_main$x={__name:"CallRecordPlayer",props:{recordMetadata:{type:Object,required:!0}},emits:["close"],setup(ee){const te=e$b.ref(null);function ne(re){te.value=re}function ae(re){te.value===re&&(te.value=null)}return(re,oe)=>{var ie,le;return e$b.openBlock(),e$b.createElementBlock("div",{onClick:e$b.withModifiers(ce=>null,["stop"]),class:"call-record-player bg-base-200"},[(le=(ie=ee.recordMetadata)==null?void 0:ie.urls)!=null&&le.general?(e$b.openBlock(),e$b.createBlock(AudioPlayer,{key:0,src:ee.recordMetadata.urls.general,label:"Conversa",type:"general","active-src":te.value,onPlayStart:ne,onPlayPause:ae},null,8,["src","active-src"])):e$b.createCommentVNode("",!0)])}}},CallRecordPlayer=_export_sfc$1(_sfc_main$x,[["__scopeId","data-v-b2bf056b"]]),_hoisted_1$t={class:"call-card-header"},_hoisted_2$q={class:"call-card-header-left"},_hoisted_3$n={class:"call-card-content"},_hoisted_4$m={class:"call-card-title"},_hoisted_5$k={key:0,class:"opacity-70"},_hoisted_6$g={key:0,class:"call-card-text"},_hoisted_7$g={class:"call-card-actions"},_hoisted_8$c={key:0,class:"call-card-expanded"},_hoisted_9$a={class:"call-events"},_hoisted_10$a={class:"call-event-left"},_hoisted_11$9={class:"call-event-time"},_sfc_main$w={__name:"CallCard",props:{call:{type:Object,required:!0},hideMessageButton:{type:Boolean,default:!1},onMessageClick:{type:Function,required:!1,default:null}},setup(ee){const te=ee,ne=e$b.ref([]),ae=e$b.ref({});function re(ye){const Ee=ne.value.indexOf(ye);Ee>-1?ne.value.splice(Ee,1):ne.value.push(ye)}function oe(ye){return ke(ye).length>0}function ie(ye){oe(ye)&&re(ye.id)}function le(ye){ae.value[ye]=!ae.value[ye]}function ce(ye){le(ye)}function de(ye){te.onMessageClick&&te.onMessageClick(ye)}function ue(ye){return ye.events&&ye.events.length>0?ye.events[0].event_type:ye.historical&&ye.historical.length>0?ye.historical[ye.historical.length-1].status:""}function ve(ye){switch(ye){case"offer":return"event-status-offer";case"answer":return"event-status-answer";case"accepted":return"event-status-accepted";case"ringing":return"event-status-ringing";case"rejected":case"error":return"event-status-rejected";case"terminated":return"event-status-terminated";case"update":return"event-status-update";default:return"event-status-unknown"}}function me(ye){switch(ye){case"offer":return"event-bg-offer";case"answer":return"event-bg-answer";case"accepted":return"event-bg-accepted";case"ringing":return"event-bg-ringing";case"rejected":case"error":return"event-bg-rejected";case"terminated":return"bg-primary";case"update":return"event-bg-update";default:return"event-bg-unknown"}}function ge(ye){switch(ye){case"offer":return"event-dot-offer";case"answer":return"event-dot-answer";case"accepted":return"event-dot-accepted";case"ringing":return"event-dot-ringing";case"rejected":case"error":return"event-dot-rejected";case"terminated":return"event-dot-terminated";case"update":return"event-dot-update";default:return"event-dot-unknown"}}function fe(ye){switch(ye){case"offer":return"Chamada recebida";case"answer":return"Chamada iniciada";case"ringing":return"Tocando...";case"accepted":return"Chamada atendida";case"rejected":return"Chamada rejeitada";case"terminated":return"Chamada terminada";case"error":return"Erro na chamada";case"update":return"Chamada atualizada";default:return"Evento desconhecido"}}function pe(ye){if(!ye)return"";const Ee=new Date(ye),Le=new Date-Ee,Ve=Math.floor(Le/(1e3*60*60*24));return Ve===0?"Hoje":Ve===1?"Ontem":Ve<7?`${Ve}d atrás`:Ee.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"})}function _e(ye){return ye?new Date(ye).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"}):""}function be(ye){var Ee,Se,Le,Ve,Te,ze;return((Se=(Ee=ye.record_metadata)==null?void 0:Ee.urls)==null?void 0:Se.client)||((Ve=(Le=ye.record_metadata)==null?void 0:Le.urls)==null?void 0:Ve.attendant)||((ze=(Te=ye.record_metadata)==null?void 0:Te.urls)==null?void 0:ze.general)}function ke(ye){return ye.events&&ye.events.length>0?[...ye.events].reverse():ye.historical&&ye.historical.length>0?ye.historical:[]}function $e(ye){return ye.event_type||ye.status}return(ye,Ee)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ee.call.id,"data-test":"call-card",onClick:Ee[4]||(Ee[4]=e$b.withModifiers(Se=>ie(ee.call),["stop"])),class:"call-card bg-base-300 border hover:bg-base-300 border-base-300"},[e$b.createElementVNode("div",_hoisted_1$t,[e$b.createElementVNode("div",_hoisted_2$q,[e$b.createElementVNode("div",{class:e$b.normalizeClass(["call-icon bg-primary",me(ue(ee.call))])},[(e$b.openBlock(),e$b.createElementBlock("svg",{style:e$b.normalizeStyle(ee.hideMessageButton?{width:"2.2rem",height:"2.2rem"}:{width:"1.3rem",height:"1.3rem"}),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Ee[5]||(Ee[5]=[e$b.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"},null,-1)])],4))],2),e$b.createElementVNode("div",_hoisted_3$n,[e$b.createElementVNode("div",_hoisted_4$m,[e$b.createTextVNode(e$b.toDisplayString(ee.call.direction==="outbound"?"Efetuada":"Recebida")+" ",1),ee.call.started_at?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$k," • "+e$b.toDisplayString(pe(ee.call.started_at)),1)):e$b.createCommentVNode("",!0)]),ee.hideMessageButton?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$g,e$b.toDisplayString(ee.call.direction==="outbound"?"Uma ligação foi efetuada":"Uma ligação foi recebida"),1)):e$b.createCommentVNode("",!0),ke(ee.call).length>0?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(["call-card-status",ve(ue(ee.call))])},e$b.toDisplayString(fe(ue(ee.call))),3)):e$b.createCommentVNode("",!0)])]),e$b.createElementVNode("div",_hoisted_7$g,[!ee.hideMessageButton&&ee.call.external_id?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,onClick:Ee[0]||(Ee[0]=e$b.withModifiers(Se=>de(ee.call),["stop"])),title:"Ver mensagem",class:"hover:bg-base-100"},[...Ee[6]||(Ee[6]=[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7l5 5m0 0l-5 5m5-5H6"})],-1)])])):e$b.createCommentVNode("",!0),be(ee.call)?(e$b.openBlock(),e$b.createElementBlock("button",{key:1,class:e$b.normalizeClass({"bg-base-100":ae.value[ee.call.id],"hover:bg-base-100":!0}),onClick:Ee[1]||(Ee[1]=e$b.withModifiers(Se=>ce(ee.call.id),["stop"])),title:"Ver gravações"},[(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(ae.value[ee.call.id]?"text-primary":"opacity-70"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[...Ee[7]||(Ee[7]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M17.316 4.052a.99.99 0 0 0-.9.14c-.262.19-.416.495-.416.82v8.566a4.573 4.573 0 0 0-2-.464c-1.99 0-4 1.342-4 3.443 0 2.1 2.01 3.443 4 3.443 1.99 0 4-1.342 4-3.443V6.801c.538.5 1 1.219 1 2.262 0 .56.448 1.013 1 1.013s1-.453 1-1.013c0-1.905-.956-3.18-1.86-3.942a6.391 6.391 0 0 0-1.636-.998 4 4 0 0 0-.166-.063l-.013-.005-.005-.002h-.002l-.002-.001ZM4 5.012c-.552 0-1 .454-1 1.013 0 .56.448 1.013 1 1.013h9c.552 0 1-.453 1-1.013 0-.559-.448-1.012-1-1.012H4Zm0 4.051c-.552 0-1 .454-1 1.013 0 .56.448 1.013 1 1.013h9c.552 0 1-.454 1-1.013 0-.56-.448-1.013-1-1.013H4Zm0 4.05c-.552 0-1 .454-1 1.014 0 .559.448 1.012 1 1.012h4c.552 0 1-.453 1-1.012 0-.56-.448-1.013-1-1.013H4Z","clip-rule":"evenodd"},null,-1)])],2))],2)):e$b.createCommentVNode("",!0),oe(ee.call)?(e$b.openBlock(),e$b.createElementBlock("button",{key:2,onClick:Ee[2]||(Ee[2]=e$b.withModifiers(Se=>ie(ee.call),["stop"])),class:e$b.normalizeClass(["call-expand-btn hover:bg-base-100",{rotated:ne.value.includes(ee.call.id)}])},[...Ee[8]||(Ee[8]=[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)])],2)):e$b.createCommentVNode("",!0)])]),e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[ne.value.includes(ee.call.id)?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$c,[ae.value[ee.call.id]&&be(ee.call)?(e$b.openBlock(),e$b.createBlock(CallRecordPlayer,{key:0,"record-metadata":ee.call.record_metadata,onClose:Ee[3]||(Ee[3]=Se=>le(ee.call.id))},null,8,["record-metadata"])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_9$a,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ke(ee.call),(Se,Le)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:Le,class:"call-event-item"},[e$b.createElementVNode("div",_hoisted_10$a,[e$b.createElementVNode("div",{class:e$b.normalizeClass(["call-event-dot",ge($e(Se))])},null,2),e$b.createElementVNode("span",{class:e$b.normalizeClass(["call-event-text",ve($e(Se))])},e$b.toDisplayString(fe($e(Se))),3)]),e$b.createElementVNode("span",_hoisted_11$9,e$b.toDisplayString(_e(Se.created_at)),1)]))),128))])])):e$b.createCommentVNode("",!0)]),_:1})]))}},CallCard=_export_sfc$1(_sfc_main$w,[["__scopeId","data-v-7de9d6c1"]]),_hoisted_1$s={class:"call-message-container"},_sfc_main$v=e$b.defineComponent({__name:"CallMessage",props:{content:{type:Object,required:!0}},setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$s,[e$b.createVNode(CallCard,{call:ee.content,"hide-message-button":!0},null,8,["call"])]))}}),CallMessage=_export_sfc$1(_sfc_main$v,[["__scopeId","data-v-f368f432"]]);function normalizeVcardContent(ee){const te=(ee==null?void 0:ee.vcard_info)??ee??{},ne=ae=>ae==null?[]:Array.isArray(ae)?ae:[ae];return{name:te.name||"Contato",title:te.title||"",org:te.org||te.organization||"",photo:te.photo||null,birthday:te.birthday||"",phones:ne(te.telephones??te.phones??te.phone??te.telephone).filter(Boolean),emails:ne(te.emails??te.email).map(ae=>typeof ae=="string"?{email:ae,type:""}:ae).filter(ae=>ae&&ae.email),urls:ne(te.urls??te.url).map(ae=>typeof ae=="string"?{url:ae,type:""}:ae).filter(ae=>ae&&ae.url),addresses:ne(te.addresses??te.address).filter(Boolean)}}const _hoisted_1$r={key:0,class:"size-3.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_hoisted_2$p={key:1},_hoisted_3$m={key:2,class:"w-12"},_hoisted_4$l=["id"],_hoisted_5$j={key:0,class:"flex select-none text-gray-400 opacity-70 dark:text-blue-800"},_hoisted_6$f={key:1,class:"mb-1.5 flex items-center gap-1.5 text-xs opacity-80"},_hoisted_7$f={key:5,class:"flex flex-col"},_hoisted_8$b={key:9},_hoisted_9$9={key:12,class:"relative flex w-full flex-col px-1"},_hoisted_10$9={key:0,class:"flex items-center justify-center space-x-1 italic"},_hoisted_11$8=["id"],_hoisted_12$7={key:0,class:"flex items-center gap-1"},_hoisted_13$4=["disabled"],_hoisted_14$4={class:"tabular-nums opacity-80"},_hoisted_15$4={class:"flex items-center gap-1"},_hoisted_16$4={class:"flex items-center space-x-1"},_hoisted_17$2={class:"flex items-center gap-1 opacity-80"},_hoisted_18$2={key:0},_hoisted_19$2={key:0},_hoisted_20$2={class:"message-reaction-emoji"},_hoisted_21$2={key:3},_hoisted_22$1={key:4,class:"w-12"},BOT_AVATAR="https://sm-click.s3.amazonaws.com/static/bot-attendance.png",_sfc_main$u={__name:"MessageBubble",props:{message:{type:Object,default:()=>({})},nextMessage:{type:Object,default:()=>({})},isInfo:{type:Boolean,default:!1},chat:{type:Object,default:null},readonly:{type:Boolean,default:!1}},emits:["go-to-message","start-chat","expand","open-native-pdf","update-proposal-status","download","download-package","copy-native","info","deleted","resent","error"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useMessageUiStore(),oe=e$b.ref(!1),ie=e$b.ref(!1),le=e$b.computed(()=>re.isActionsTarget(ne.message.id));function ce(Ge){ne.readonly||re.openActions(ne.message,Ge)}const de=e$b.computed(()=>ne.message.from_me),ue=e$b.computed(()=>{var Ge;return/https?:\/\/[^\s<]*(?:youtube\.com|youtu\.be)\/[^\s<]*/i.test(((Ge=ne.message.content)==null?void 0:Ge.text)||"")}),ve=e$b.computed(()=>["file","image","video","document"].includes(ne.message.type)||Array.isArray(ne.message.items)&&ne.message.items.length>0),me=e$b.computed(()=>ne.chat?!!ne.chat.group:re.isGroupChat),ge=e$b.computed(()=>{var Ge;return ne.chat?((Ge=ne.chat.contact)==null?void 0:Ge.photo)??"":re.contactPhoto}),fe=e$b.computed(()=>{var Ge;return ne.chat?((Ge=ne.chat.contact)==null?void 0:Ge.name)??"":re.contactName}),pe=e$b.computed(()=>{var Ge;return((Ge=re.loggedAttendant)==null?void 0:Ge.id)??null}),_e=e$b.computed(()=>!!ne.message.sent_by&&ne.message.sent_by.id!==pe.value),be=e$b.computed(()=>{var Ge,Ke,et;return{title:fe.value||"Áudio",subtitle:de.value?"Você":((Ge=ne.message.sent_by)==null?void 0:Ge.name)||fe.value||"",chatId:((Ke=ne.chat)==null?void 0:Ke.id)??((et=re.currentChat)==null?void 0:et.id)??null,messageId:ne.message.id}}),ke=e$b.computed(()=>{var Ge,Ke;return!!((Ge=ne.message.quoted)!=null&&Ge.content)||!!ne.message.isTranscripting||!!((Ke=ne.message.metadata)!=null&&Ke.transcripted_text)}),$e=e$b.computed(()=>ne.message.type==="sms"?"icon-sms":ne.message.from_me?ne.message.internal?"icon-internal":"icon-owner":"icon-received"),ye=e$b.computed(()=>ne.message.type==="sms"?"-right-[8px] message-dot-sms reflex":de.value?"-right-[8px] message-dot-owner reflex":"message-dot-received -left-[8px]"),Ee=e$b.computed(()=>{const Ge=(ne.message.items||[]).map(Ke=>Ke==null?void 0:Ke.id).filter(Boolean);return Ge.length?Ge.some(Ke=>re.isMessageSelected(Ke)):re.isMessageSelected(ne.message.id)}),Se=e$b.computed(()=>canForwardMessage(ne.message));function Le(){if(!Se.value)return;const Ge=(ne.message.items||[]).map(Ke=>Ke==null?void 0:Ke.id).filter(Boolean);Ge.length?re.togglePackageSelection(Ge):re.toggleMessageSelection(ne.message.id)}function Ve(Ge,Ke){var Et,At,Pt,_t,Ze,at,dt,ct,ht,tt,Ye,Je;if(!Ge||!Ge.sent_by&&!((Et=Ge.content)!=null&&Et.sender))return!1;if(!Ke||!Ke.sent_by&&!((At=Ke.content)!=null&&At.sender))return!0;const et=((Pt=Ge.sent_by)==null?void 0:Pt.id)||((Ze=(_t=Ge.content)==null?void 0:_t.sender)==null?void 0:Ze.id)||((dt=(at=Ge.content)==null?void 0:at.sender)==null?void 0:dt.name),yt=((ct=Ke.sent_by)==null?void 0:ct.id)||((tt=(ht=Ke.content)==null?void 0:ht.sender)==null?void 0:tt.id)||((Je=(Ye=Ke.content)==null?void 0:Ye.sender)==null?void 0:Je.name);return et&&yt?et!==yt:!1}const Te=e$b.computed(()=>Ve(ne.message,ne.nextMessage)),ze=e$b.computed(()=>isSticker(ne.message)||isTgSticker(ne.message)),Re=e$b.computed(()=>isPtv(ne.message)),Oe=e$b.computed(()=>ze.value||Re.value),Pe=e$b.computed(()=>{var Ge;return(!de.value||_e.value)&&Te.value&&!!((Ge=ne.message.content)!=null&&Ge.sender)}),Be=e$b.computed(()=>{var Ge,Ke,et;return _e.value?(Ge=ne.message.sent_by)==null?void 0:Ge.name:(et=(Ke=ne.message.content)==null?void 0:Ke.sender)==null?void 0:et.name}),De=["file","image","audio","text","sms","button","document","proposal","template","video"],Ne=e$b.computed(()=>!ne.readonly&&ne.message.stage!=="excluded"&&De.includes(ne.message.type)&&(ne.message.whatsapp_id!=="waiting to create"||ne.message.fail_reason||ne.message.stage==="processing")),Me=e$b.computed(()=>normalizeVcardContent(ne.message.content));function we(Ge){return Object.keys(Ge||{}).length!==0}function Ce(Ge){const Ke=Math.floor(Ge/60),et=(Ge%60).toFixed(0);return`${String(Ke).padStart(2,"0")}:${String(et).padStart(2,"0")}`}function Fe(Ge){ne.message.content.currentTime=Ge}let Ie;function Ue(Ge){var yt;if(ne.readonly)return;const Ke=(yt=Ge.touches)==null?void 0:yt[0],et={clientX:(Ke==null?void 0:Ke.clientX)??0,clientY:(Ke==null?void 0:Ke.clientY)??0};Ie=setTimeout(()=>{oe.value=!0,re.openActions(ne.message,et)},550)}function qe(){clearTimeout(Ie)}e$b.onBeforeUnmount(()=>clearTimeout(Ie));async function je(){const Ge=await transcriptAudio(ne.message);Ge.ok||notiwind.notify({group:"error",title:"Erro",text:Ge.error},4e3)}async function We(){const Ge=await reactToMessage(ne.message,"");Ge.ok||notiwind.notify({group:"error",title:"Erro",text:Ge.error},4e3)}return(Ge,Ke)=>{var et,yt,Et,At,Pt,_t,Ze,at,dt,ct,ht,tt,Ye,Je,nt,ut,it;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.renderSlot(Ge.$slots,"default",{class:"w-full"}),(we(ee.message.content)||ee.message.type==="ciphertext"||ee.message.type==="call")&&!ee.message.special?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["flex w-full rounded-lg transition-colors duration-200 lg:px-2",{"justify-end":de.value,"justify-start":!de.value,"z-20":oe.value,"pt-1.5":Te.value,"pt-4":ee.nextMessage&&ee.nextMessage.metadata&&ee.nextMessage.metadata.reaction,"bg-gray-400/5 py-1 dark:bg-primary/20":Ee.value}])},[e$b.unref(re).forwardMode.active&&!ee.message.internal&&Se.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,"data-test":"forward-message-checkbox",type:"button",class:"mr-2 flex items-center focus:outline-none",onClick:e$b.withModifiers(Le,["stop"])},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["flex size-5 cursor-pointer items-center justify-center rounded border-2 transition-colors",Ee.value?"bg-primary border-primary":"border-gray-400 dark:bg-gray-500/60 dark:border-gray-600 hover:border-primary"])},[Ee.value?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_1$r,[...Ke[22]||(Ke[22]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):e$b.createCommentVNode("",!0)],2)])):e$b.createCommentVNode("",!0),!de.value&&Te.value&&ee.message.content.sender?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$p,[e$b.createVNode(Avatar,{photo:me.value?(Et=(yt=(et=ee.message)==null?void 0:et.content)==null?void 0:yt.sender)==null?void 0:Et.photo:ge.value,name:me.value?(_t=(Pt=(At=ee.message)==null?void 0:At.content)==null?void 0:Pt.sender)==null?void 0:_t.name:fe.value,size:"fill",class:"mr-4 mt-1 size-8 select-none"},null,8,["photo","name"])])):ee.isInfo?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_3$m)),e$b.createElementVNode("div",{id:ee.message.id,class:e$b.normalizeClass(["bubble-rise relative rounded-[7.5px] text-sm",{"bubble-rise-owner":de.value,"min-w-[100px] p-1.5 px-2 pb-0":!Oe.value,"message-media-bubble":ve.value&&!Re.value,"internal-owner":ee.message.internal&&!Oe.value,"message-sms":ee.message.type==="sms"&&!Oe.value,"message-owner":de.value&&ee.message.type!=="sms"&&!Oe.value,"message-received":!de.value&&ee.message.type!=="sms"&&!Oe.value,"w-[320px]":ue.value,"transition duration-150 ease-in-out":ee.message.type==="text","max-w-[80%] md:max-w-[60%]":!ee.isInfo}]),onMouseenter:Ke[20]||(Ke[20]=st=>oe.value=!0),onMouseleave:Ke[21]||(Ke[21]=st=>oe.value=!1),onTouchstart:Ue,onTouchend:qe,onContextmenu:e$b.withModifiers(ce,["prevent"])},[Te.value&&!Oe.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["absolute top-[18px] z-0 h-3 w-2.5",ye.value])},[(e$b.openBlock(),e$b.createElementBlock("svg",{width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",class:e$b.normalizeClass($e.value)},[...Ke[23]||(Ke[23]=[e$b.createElementVNode("path",{d:"M2.08716 0.990608C6.96945 3.99222 14.3729 -1.53342 13.0005 3.49993C11.9288 7.43005 15.5661 14.0304 12.5 13.5001C11.2754 13.2882 7.30071 12.6987 4.10282 9.18332C1.80094 6.65292 0.995844 3.64548 0.812781 1.59225C0.755256 0.947065 1.53536 0.651363 2.08716 0.990608Z",fill:"currentColor"},null,-1)])],2))],2)):e$b.createCommentVNode("",!0),Pe.value?(e$b.openBlock(),e$b.createElementBlock("header",{key:1,class:e$b.normalizeClass(["message-sender-name text-left",Oe.value?"sticker-name":""]),style:e$b.normalizeStyle(e$b.unref(senderColorStyle)(Be.value))},e$b.toDisplayString(Be.value),7)):e$b.createCommentVNode("",!0),e$b.createElementVNode("main",{class:e$b.normalizeClass(["flex w-full",Oe.value?["items-end gap-1",de.value?"flex-row-reverse":"flex-row"]:"flex-col"])},[ee.message.stage==="excluded"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5$j,[...Ke[24]||(Ke[24]=[e$b.createElementVNode("section",{class:"flex items-center justify-center"},[e$b.createElementVNode("svg",{class:"mb-0.3 size-4",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:"100",height:"100"},[e$b.createElementVNode("path",{d:"M25,2C12.317,2,2,12.318,2,25s10.317,23,23,23s23-10.318,23-23S37.683,2,25,2z M7,25c0-4.062,1.371-7.8,3.65-10.815 L35.815,39.35C32.8,41.629,29.062,43,25,43C15.075,43,7,34.925,7,25z M39.35,35.815L14.185,10.65C17.2,8.371,20.938,7,25,7 c9.925,0,18,8.075,18,18C43,29.062,41.629,32.8,39.35,35.815z"})]),e$b.createElementVNode("p",{class:"p-1 italic"},"Mensagem apagada")],-1)])])):e$b.createCommentVNode("",!0),ee.message.is_forward?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$f,[...Ke[25]||(Ke[25]=[e$b.createElementVNode("svg",{class:"size-3.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{d:"M5.027 10.9a8.729 8.729 0 0 1 6.422-3.62v-1.2A2.061 2.061 0 0 1 12.61 4.2a1.986 1.986 0 0 1 2.104.23l5.491 4.308a2.11 2.11 0 0 1 .588 2.566 2.109 2.109 0 0 1-.588.734l-5.489 4.308a1.983 1.983 0 0 1-2.104.228 2.065 2.065 0 0 1-1.16-1.876v-.942c-5.33 1.284-6.212 5.251-6.25 5.441a1 1 0 0 1-.923.806h-.06a1.003 1.003 0 0 1-.955-.7A10.221 10.221 0 0 1 5.027 10.9Z"})],-1),e$b.createElementVNode("span",null,"Encaminhada",-1)])])):e$b.createCommentVNode("",!0),ee.message.quoted&&ee.message.quoted.content?(e$b.openBlock(),e$b.createBlock(MessageQuote,{key:2,"chat-id":ee.message.quoted.chat,attendant:ee.message.quoted.sent_by,"is-message":!0,"message-id":ee.message.quoted.id,message:ee.message.quoted.content,onGo:Ke[0]||(Ke[0]=(st,$t)=>ae("go-to-message",st,$t))},null,8,["chat-id","attendant","message-id","message"])):e$b.createCommentVNode("",!0),ee.message.content.is_ad?(e$b.openBlock(),e$b.createBlock(_sfc_main$I,{key:3,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):e$b.createCommentVNode("",!0),(Ze=ee.message.content)!=null&&Ze.post_info?(e$b.openBlock(),e$b.createBlock(_sfc_main$H,{key:4,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):e$b.createCommentVNode("",!0),ee.message.type==="sms"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$f,[Ke[26]||(Ke[26]=e$b.createElementVNode("span",{class:"inline-flex items-center gap-1 self-end rounded-full bg-violet-100/15 px-2 text-[9px] font-bold uppercase tracking-widest text-violet-100 dark:bg-violet-600/15 dark:text-violet-600"}," SMS ",-1)),e$b.createVNode(YouTubePreview,{content:ee.message.content.text},null,8,["content"]),e$b.createVNode(MessageMarkdown,{class:"text-left",content:ee.message.content.text},null,8,["content"])])):ee.message.type==="text"&&!ee.message.content.is_ad&&!((at=ee.message.content)!=null&&at.post_info)?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:6},[e$b.createVNode(YouTubePreview,{content:ee.message.content.text},null,8,["content"]),e$b.createVNode(MessageMarkdown,{class:e$b.normalizeClass(["text-left",ee.message.stage==="excluded"?"opacity-70 text-gray-400":""]),content:ee.message.content.text},null,8,["class","content"])],64)):ee.message.type==="list"?(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:7,class:"text-left",content:ee.message.content.description},null,8,["content"])):ee.message.type==="call"?(e$b.openBlock(),e$b.createBlock(CallMessage,{key:8,content:ee.message.content},null,8,["content"])):ee.message.type==="location"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$b,[e$b.createVNode(MessageLocationMap,{map:ee.message.content,"map-id":`${ee.message.id}-map`},null,8,["map","map-id"])])):ee.message.type==="ciphertext"?(e$b.openBlock(),e$b.createBlock(MessageCiphertext,{key:10})):ee.message.whatsapp_id==="waiting to create"&&ee.message.type!=="text"&&ee.message.content&&!ee.message.content.url?(e$b.openBlock(),e$b.createBlock(_sfc_main$F,{key:11,message:ee.message},null,8,["message"])):e$b.unref(isAudio)(ee.message)?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$9,[e$b.createVNode(MessageAudio,{audio:ee.message.content.data64?ee.message.content.data64:ee.message.content.url,"is-owner":de.value,"full-width":ke.value,"track-id":ee.message.id,"track-meta":be.value,onCurrentTime:Fe},null,8,["audio","is-owner","full-width","track-id","track-meta"]),ee.message.isTranscripting?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10$9,[...Ke[27]||(Ke[27]=[e$b.createElementVNode("svg",{fill:"none",class:"size-7 animate-spin",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},[e$b.createElementVNode("path",{"clip-rule":"evenodd",d:"M15.165 8.53a.5.5 0 01-.404.58A7 7 0 1023 16a.5.5 0 011 0 8 8 0 11-9.416-7.874.5.5 0 01.58.404z",fill:"currentColor","fill-rule":"evenodd"})],-1),e$b.createElementVNode("div",null,"Transcrevendo...",-1)])])):e$b.createCommentVNode("",!0),(dt=ee.message.metadata)!=null&&dt.transcripted_text&&!ee.message.isTranscripting?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,id:`transcriptedMessage${ee.message.id}`,class:"max-h-[200px] overflow-auto pb-1 pr-2 text-left opacity-90"},[e$b.createElementVNode("em",null,'"'+e$b.toDisplayString((ct=ee.message.metadata)==null?void 0:ct.transcripted_text)+'"',1)],8,_hoisted_11$8)):e$b.createCommentVNode("",!0)])):ee.message.items&&ee.message.items.length>1?(e$b.openBlock(),e$b.createBlock(_sfc_main$E,{key:13,message:ee.message,onExpand:Ke[1]||(Ke[1]=st=>ae("expand",ee.message,!0,st))},null,8,["message"])):["file","image","video","document"].includes(ee.message.type)&&!ee.message.items?(e$b.openBlock(),e$b.createBlock(MessageFileRenderer,{key:14,message:ee.message,onExpand:Ke[2]||(Ke[2]=(st,$t)=>ae("expand",st,$t)),onOpenNativePdf:Ke[3]||(Ke[3]=st=>ae("open-native-pdf",st)),onDownload:Ke[4]||(Ke[4]=()=>ae("download",ee.message)),onError:Ke[5]||(Ke[5]=st=>ae("error",st))},null,8,["message"])):ee.message.type==="proposal"?(e$b.openBlock(),e$b.createBlock(ProposalMessageCard,{key:15,message:ee.message,interactive:!ee.readonly,onUpdateStatus:Ke[6]||(Ke[6]=(st,$t)=>ae("update-proposal-status",ee.message,st,$t)),onOpenNativePdf:Ke[7]||(Ke[7]=st=>ae("open-native-pdf",st))},null,8,["message","interactive"])):ee.message.type==="vcard"?(e$b.openBlock(),e$b.createBlock(ContactMessageCard,{key:16,contact:Me.value,"show-start-chat":!0,onStartChat:Ke[8]||(Ke[8]=st=>ae("start-chat",st))},null,8,["contact"])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",{class:e$b.normalizeClass([[Oe.value?"sticker-meta":ee.message.content.duration?"justify-between":"justify-end pl-2"],"flex select-none items-center space-x-1 text-[10px]"])},[ee.message.content.duration&&!Re.value?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_12$7,[e$b.unref(isAudio)(ee.message)&&!((ht=ee.message.metadata)!=null&&ht.transcripted_text)?(e$b.openBlock(),e$b.createBlock(e$b.unref(entry_esm),{key:0,"offset-distance":"2",hover:!0,content:"Transcrever áudio",placement:"top",class:"text-[14px]"},{default:e$b.withCtx(()=>[e$b.createElementVNode("button",{disabled:ee.message.isTranscripting,class:"stage-mark mt-[6px] hover:text-primary",onClick:e$b.withModifiers(je,["stop"])},[...Ke[28]||(Ke[28]=[e$b.createElementVNode("svg",{class:"size-5.5","clip-rule":"evenodd","fill-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"2",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e$b.createElementVNode("path",{fill:"currentColor",d:"m11.239 15.533c-1.045 3.004-1.238 3.451-1.238 3.84 0 .441.385.627.627.627.272 0 1.108-.301 3.829-1.249zm.888-.888 3.22 3.22 6.408-6.401c.163-.163.245-.376.245-.591 0-.213-.082-.427-.245-.591-.58-.579-1.458-1.457-2.039-2.036-.163-.163-.377-.245-.591-.245-.213 0-.428.082-.592.245zm-3.127-.895c0-.402-.356-.75-.75-.75-2.561 0-2.939 0-5.5 0-.394 0-.75.348-.75.75s.356.75.75.75h5.5c.394 0 .75-.348.75-.75zm5-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75zm0-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75zm0-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75z","fill-rule":"nonzero"})],-1)])],8,_hoisted_13$4)]),_:1})):e$b.createCommentVNode("",!0),e$b.createElementVNode("p",_hoisted_14$4,e$b.toDisplayString(Ce(ee.message.content.currentTime||ee.message.content.duration)),1)])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_15$4,[ee.message.internal?(e$b.openBlock(),e$b.createBlock(e$b.unref(entry_esm),{key:0,arrow:!0,hover:"",placement:"top"},{content:e$b.withCtx(()=>[...Ke[29]||(Ke[29]=[e$b.createElementVNode("div",{class:"w-32 text-center"},"Mensagem visível apenas para outros atendentes",-1)])]),default:e$b.withCtx(()=>[Ke[30]||(Ke[30]=e$b.createElementVNode("svg",{class:"size-3.5 text-white/50 dark:text-black/40","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 6a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm-1.5 8a4 4 0 0 0-4 4 2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-3Zm6.82-3.096a5.51 5.51 0 0 0-2.797-6.293 3.5 3.5 0 1 1 2.796 6.292ZM19.5 18h.5a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-1.1a5.503 5.503 0 0 1-.471.762A5.998 5.998 0 0 1 19.5 18ZM4 7.5a3.5 3.5 0 0 1 5.477-2.889 5.5 5.5 0 0 0-2.796 6.293A3.501 3.501 0 0 1 4 7.5ZM7.1 12H6a4 4 0 0 0-4 4 2 2 0 0 0 2 2h.5a5.998 5.998 0 0 1 3.071-5.238A5.505 5.505 0 0 1 7.1 12Z","clip-rule":"evenodd"})],-1))]),_:1})):e$b.createCommentVNode("",!0),e$b.createElementVNode("main",_hoisted_16$4,[e$b.createElementVNode("p",_hoisted_17$2,[((Ye=(tt=ee.message.content)==null?void 0:tt.history)==null?void 0:Ye.length)>0?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_18$2,"Editada")):e$b.createCommentVNode("",!0),e$b.createTextVNode(" "+e$b.toDisplayString(((nt=(Je=ee.message)==null?void 0:Je.sent_at)==null?void 0:nt.split("T")[1].slice(0,5))||"--:--"),1)]),de.value?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_19$2,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,"failed-size":12,class:e$b.normalizeClass(ee.message.stage==="failed"?"size-4":"")},null,8,["stage","class"])])):e$b.createCommentVNode("",!0)])])],2)],2),ee.message.type==="list"?(e$b.openBlock(),e$b.createBlock(_sfc_main$U,{key:2,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):ee.message.type==="template"?(e$b.openBlock(),e$b.createBlock(_sfc_main$R,{key:3,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):ee.message.type==="button"?(e$b.openBlock(),e$b.createBlock(_sfc_main$Q,{key:4,content:ee.message.content},null,8,["content"])):e$b.createCommentVNode("",!0),e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[Ne.value?e$b.withDirectives((e$b.openBlock(),e$b.createElementBlock("button",{key:0,type:"button","aria-label":"Ações da mensagem",class:"absolute right-[1.5px] top-0 ml-3 flex items-center justify-center pr-1 pt-1",onClick:e$b.withModifiers(ce,["stop"])},[...Ke[31]||(Ke[31]=[e$b.createElementVNode("svg",{fill:"currentColor",viewBox:"0 0 20 20",class:"size-5 rounded bg-gray-800/80 text-white transition-transform duration-200 dark:bg-gray-400"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])],512)),[[e$b.vShow,oe.value]]):e$b.createCommentVNode("",!0)]),_:1}),le.value?(e$b.openBlock(),e$b.createBlock(MessageActionsMenu,{key:5,onInfo:Ke[9]||(Ke[9]=st=>ae("info",st)),onDownload:Ke[10]||(Ke[10]=st=>ae("download",st)),onDownloadPackage:Ke[11]||(Ke[11]=st=>ae("download-package",st)),onCopyNative:Ke[12]||(Ke[12]=st=>ae("copy-native",st)),onDeleted:Ke[13]||(Ke[13]=st=>ae("deleted",st)),onResent:Ke[14]||(Ke[14]=st=>ae("resent",st))})):e$b.createCommentVNode("",!0),(ut=ee.message.metadata)!=null&&ut.reaction?(e$b.openBlock(),e$b.createElementBlock("footer",{key:6,class:e$b.normalizeClass(["message-reaction",{"message-reaction-sticker":Oe.value&&de.value}]),onMouseenter:Ke[15]||(Ke[15]=st=>ie.value=!0),onMouseleave:Ke[16]||(Ke[16]=st=>ie.value=!1),onTouchstart:Ke[17]||(Ke[17]=st=>ie.value=!0),onTouchend:Ke[18]||(Ke[18]=st=>ie.value=!1),onTouchcancel:Ke[19]||(Ke[19]=st=>ie.value=!1)},[e$b.createElementVNode("button",{type:"button",class:"message-reaction-slot","aria-label":"Remover reação",onClick:e$b.withModifiers(We,["stop"])},[e$b.createElementVNode("span",_hoisted_20$2,e$b.toDisplayString((it=ee.message.metadata)==null?void 0:it.reaction),1),(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(["message-reaction-remove",{"is-visible":ie.value}]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...Ke[32]||(Ke[32]=[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M6 18 17.94 6M18 18 6.06 6"},null,-1)])],2))])],34)):e$b.createCommentVNode("",!0)],42,_hoisted_4$l),de.value&&Te.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_21$2,[ee.message.sent_by?(e$b.openBlock(),e$b.createBlock(Avatar,{key:0,attendant:ee.message.sent_by,size:"fill","show-level":!1,"effect-level":"border",class:"ml-4 mt-1 size-8 select-none"},null,8,["attendant"])):(e$b.openBlock(),e$b.createBlock(Avatar,{key:1,photo:BOT_AVATAR,size:"fill",class:"ml-4 mt-1 size-8 select-none"}))])):ee.isInfo?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_22$1))],2)):e$b.createCommentVNode("",!0)],64)}}},_hoisted_1$q={class:"flex w-full justify-center py-1.5"},_hoisted_2$o={class:"inline-flex max-w-[85%] items-center gap-2 rounded-full bg-base-200 py-1.5 pl-1.5 pr-3.5 text-xs font-semibold text-base-content/80 shadow-sm ring-1 ring-base-300/60"},_hoisted_3$l={class:"flex size-5 shrink-0 items-center justify-center rounded-full bg-base-100 text-primary shadow-sm"},_hoisted_4$k={class:"min-w-0 truncate"},_hoisted_5$i={key:0,class:"shrink-0 text-[10px] font-normal opacity-60"},_sfc_main$t={__name:"SystemMessage",props:{message:{type:Object,required:!0},time:{type:String,default:""}},setup(ee){return(te,ne)=>{var ae;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.renderSlot(te.$slots,"default"),e$b.createElementVNode("div",_hoisted_1$q,[e$b.createElementVNode("span",_hoisted_2$o,[e$b.createElementVNode("span",_hoisted_3$l,[e$b.renderSlot(te.$slots,"icon",{},()=>[ne[0]||(ne[0]=e$b.createElementVNode("svg",{class:"size-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.586 2.586A2 2 0 0 1 11 2h2a2 2 0 0 1 2 2v.089l.473.196.063-.063a2.002 2.002 0 0 1 2.828 0l1.414 1.414a2 2 0 0 1 0 2.827l-.063.064.196.473H20a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-.089l-.196.473.063.063a2.002 2.002 0 0 1 0 2.828l-1.414 1.414a2 2 0 0 1-2.828 0l-.063-.063-.473.196V20a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-.089l-.473-.196-.063.063a2.002 2.002 0 0 1-2.828 0l-1.414-1.414a2 2 0 0 1 0-2.827l.063-.064L4.089 15H4a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2h.09l.195-.473-.063-.063a2 2 0 0 1 0-2.828l1.414-1.414a2 2 0 0 1 2.827 0l.064.063L9 4.089V4a2 2 0 0 1 .586-1.414ZM8 12a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z","clip-rule":"evenodd"})],-1))])]),e$b.createElementVNode("span",_hoisted_4$k,e$b.toDisplayString((ae=ee.message.content)==null?void 0:ae.text),1),ee.time?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$i,e$b.toDisplayString(ee.time),1)):e$b.createCommentVNode("",!0)])])],64)}}},_hoisted_1$p={class:"history-shell relative min-h-0 w-full flex-1 overflow-hidden"},_hoisted_2$n={class:"history-infinite-spinner",role:"status"},_hoisted_3$k={class:"history-pixel-bar","aria-hidden":"true"},_hoisted_4$j={class:"smplay-pixel-label"},_hoisted_5$h=["aria-hidden","inert","data-history-key"],_hoisted_6$e={key:0,class:"history-separator my-4"},_hoisted_7$e={class:"history-protocol-label"},_hoisted_8$a={class:"min-w-0 truncate"},_hoisted_9$8={key:0,class:"history-separator history-separator-unread"},_hoisted_10$8={class:"history-unread-label"},_hoisted_11$7={class:"history-unread-count"},_hoisted_12$6={key:1,class:"history-separator history-separator-day"},_hoisted_13$3={class:"day-badge history-separator-chip"},_hoisted_14$3={class:"history-overlay"},_hoisted_15$3={key:0,class:"history-overlay-banner"},_hoisted_16$3={key:0,class:"history-loader-layer"},INFINITE_PRERENDER_MIN_DELAY_MS=64,INFINITE_MEDIA_WARMUP_TIMEOUT_MS=80,HISTORY_ITEM_BLEED=8,NAV_HYSTERESIS_PX=48,_sfc_main$s={__name:"ChatHistory",props:{messages:{type:Array,default:()=>[]},chat:{type:Object,default:null},chatKey:{type:[String,Number],default:null},hasMore:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreText:{type:String,default:"Carregando mais..."},unreadCount:{type:Number,default:0},readonly:{type:Boolean,default:!1},messageHandlers:{type:Object,default:()=>({})},loadMore:{type:Function,default:null},dateFormatter:{type:Function,default:null}},setup(ee,{expose:te}){const ne={},ae=ee,re=useMessageUiStore(),oe=e$b.ref(null),ie=e$b.ref(null),le=e$b.computed(()=>re.forwardMode.selectedMessages.length),ce=new Intl.DateTimeFormat("pt-BR",{timeZone:"America/Sao_Paulo",year:"numeric",month:"2-digit",day:"2-digit"});function de(Ze){if(!Ze)return null;const at=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(Ze)&&!/[zZ]|[+-]\d{2}:\d{2}$/.test(Ze),dt=new Date(at?Ze+"Z":Ze);return isNaN(dt.getTime())?null:dt}function ue(Ze){const at=de(Ze);if(!at)return"";const dt=new Date,ct=new Date(dt);return ct.setDate(ct.getDate()-1),isSameWeek(at,dt,{weekStartsOn:1})?ve(at,dt)?"Hoje":ve(at,ct)?"Ontem":format(at,"iiii",{locale:ptBR}):format(at,at.getFullYear()===dt.getFullYear()?"dd/MM":"dd/MM/yyyy",{locale:ptBR})}function ve(Ze,at){return Ze.getDate()===at.getDate()&&Ze.getMonth()===at.getMonth()&&Ze.getFullYear()===at.getFullYear()}function me(Ze){return ae.dateFormatter?ae.dateFormatter(Ze):ue(Ze)}function ge(Ze){var at;return Ze.sent_by?`internal:${Ze.sent_by.id}`:(at=Ze.content)!=null&&at.sender?`external:${Ze.content.sender.name||""}`:"unknown"}const fe=new WeakMap,pe=e$b.ref(!1),_e=e$b.ref(new Set),be=e$b.ref({});function ke(){return new Promise(Ze=>window.setTimeout(Ze,INFINITE_PRERENDER_MIN_DELAY_MS))}function $e(){var at;const Ze=(at=oe.value)==null?void 0:at.getBoundingClientRect();_e.value=new Set(ae.messages.map(Me)),be.value=Ze?{"--history-prerender-left":`${Ze.left}px`,"--history-prerender-top":`${Ze.top}px`,"--history-prerender-width":`${Ze.width}px`,"--history-prerender-height":`${Ze.height}px`}:{},pe.value=!0}function ye(){pe.value=!1,_e.value=new Set,be.value={}}function Ee(Ze){return pe.value&&!_e.value.has(Ze)}function Se(Ze){var ct,ht;const at=[((ht=(ct=ae.chat)==null?void 0:ct.contact)==null?void 0:ht.photo)||re.contactPhoto],dt=tt=>{var Je;if(!tt||tt.special)return;const Ye=tt.content||{};at.push((Je=Ye.sender)==null?void 0:Je.photo),(isImage(tt)||isGif(tt)||isSticker(tt))&&at.push(Ye.data64,Ye.url,Ye.blobUrl),Array.isArray(tt.items)&&tt.items.forEach(dt)};return Ze.forEach(dt),at}function Le(Ze){var it,st,$t,kt,Mt,Dt,Lt,Gt,Rt,Xt;const at=Ze&&typeof Ze=="object"?fe.get(Ze):null,dt=((it=Ze==null?void 0:Ze.sent_by)==null?void 0:it.id)||(($t=(st=Ze==null?void 0:Ze.content)==null?void 0:st.sender)==null?void 0:$t.id)||((Mt=(kt=Ze==null?void 0:Ze.content)==null?void 0:kt.sender)==null?void 0:Mt.name)||"",ct=(Dt=Ze==null?void 0:Ze.content)==null?void 0:Dt.caption,ht=(Lt=Ze==null?void 0:Ze.content)==null?void 0:Lt.text,tt=(Gt=Ze==null?void 0:Ze.content)==null?void 0:Gt.type,Ye=((Rt=Ze==null?void 0:Ze.content)==null?void 0:Rt.url)||((Xt=Ze==null?void 0:Ze.content)==null?void 0:Xt.data64),Je=(Ze==null?void 0:Ze.stage)||null;if(at&&at.sentAt===(Ze==null?void 0:Ze.sent_at)&&at.type===(Ze==null?void 0:Ze.type)&&at.contentType===tt&&at.caption===ct&&at.text===ht&&at.senderKey===dt&&at.stage===Je&&at.url===Ye)return at;const nt=de(Ze==null?void 0:Ze.sent_at),ut={author:ge(Ze||{}),caption:ct,contentType:tt,dayKey:nt?ce.format(nt):"",hasCaption:!!(ct||ht),internal:(Ze==null?void 0:Ze.internal)||!1,isMedia:(isVideo(Ze)||isImage(Ze))&&!isPtv(Ze),senderKey:dt,sentAt:Ze==null?void 0:Ze.sent_at,sentAtMs:nt?nt.getTime():NaN,stage:Je,text:ht,type:Ze==null?void 0:Ze.type,url:Ye};return Ze&&typeof Ze=="object"&&fe.set(Ze,ut),ut}function Ve(Ze,at,dt,ct){return ct.isMedia&&at.isMedia&&Ze.from_me===dt.from_me&&ct.sentAtMs-at.sentAtMs<=12e4&&at.internal===ct.internal&&!ct.hasCaption&&!at.hasCaption&&at.author===ct.author&&at.stage===ct.stage}let Te={messages:[],groups:[],collapsed:!1};const ze=e$b.computed(()=>{const Ze=ae.messages,at=[];let dt=!1,ct=null,ht=null;for(let Ye=0;Ye<Ze.length;Ye++){const Je=Ze[Ye],nt=Le(Je);Ye===0||!Ve(ct,ht,Je,nt)?at.push(Ye):dt=!0,ct=Je,ht=nt}if(!dt&&!Te.collapsed&&sameList(Te.messages,Ze))return Te.groups;const tt=[];for(let Ye=0;Ye<at.length;Ye++){const Je=at[Ye],nt=Ye+1<at.length?at[Ye+1]:Ze.length;tt.push(nt-Je===1?Ze[Je]:{...Ze[Je],items:Ze.slice(Je,nt)})}return Te={messages:Ze.slice(),groups:tt,collapsed:dt},tt}),Re=stableList(()=>ze.value.map(Me)),Oe=stableList(()=>{const Ze=[];let at=null;return ze.value.forEach((dt,ct)=>{const{dayKey:ht}=Le(dt),tt=ct===0||ht!==at;Ze.push(!dt.special&&tt?me(dt.sent_at):null),at=ht}),Ze});let Pe=new Map,Be=null;const De=e$b.computed(()=>{const Ze=ze.value,at=Re.value,dt=Oe.value,{chat:ct,readonly:ht}=ae;(!Be||Be.chat!==ct||Be.readonly!==ht)&&(Pe=new Map,Be={chat:ct,readonly:ht});const tt=new Map,Ye=Ze.map((Je,nt)=>{const ut=at[nt],it=dt[nt],st=Ze[nt-1],$t=Pe.get(ut);if($t&&$t.message===Je&&$t.nextMessage===st&&$t.dayLabel===it)return tt.set(ut,$t),$t.row;const kt=Je.type==="system",Mt={message:Je,nextMessage:st,dayLabel:it,row:{key:ut,dayLabel:it,message:Je,isSystem:kt,component:kt?_sfc_main$t:_sfc_main$u,props:kt?{message:Je,time:Ne(Je)}:{message:Je,nextMessage:st,chat:ct,readonly:ht}}};return tt.set(ut,Mt),Mt.row});return Pe=tt,Ye});function Ne(Ze){var at,dt;return((dt=(at=Ze==null?void 0:Ze.sent_at)==null?void 0:at.split("T")[1])==null?void 0:dt.slice(0,5))||""}function Me(Ze){var at,dt;return(Ze==null?void 0:Ze.id)!==void 0&&(Ze==null?void 0:Ze.id)!==null&&(Ze==null?void 0:Ze.id)!==""?String(Ze.id):Ze!=null&&Ze.special?`special:${Ze.content}`:`${(Ze==null?void 0:Ze.type)||"message"}:${(Ze==null?void 0:Ze.sent_at)||""}:${((at=Ze==null?void 0:Ze.content)==null?void 0:at.url)||((dt=Ze==null?void 0:Ze.content)==null?void 0:dt.text)||""}`}const we=e$b.computed(()=>{const Ze=ze.value.findIndex(at=>!at.special&&at.opened===!1&&(ae.chatKey==null||at.chat==null||at.chat===ae.chatKey));return Ze===-1?null:Re.value[Ze]});function Ce(Ze){var ct;const at=String(Ze||""),dt=at.match(/PROTOCOLO\s+(.+)$/i);return(ct=dt==null?void 0:dt[1])!=null&&ct.trim()?`Protocolo ${dt[1].trim()}`:at}const Fe=e$b.ref(!1),Ie=e$b.ref(!1);function Ue(){var dt;const Ze=(dt=ie.value)==null?void 0:dt.querySelectorAll("[data-history-key]:not([data-history-measured])");if(!(Ze!=null&&Ze.length))return;const at=Array.from(Ze,ct=>ct.offsetHeight);Ze.forEach((ct,ht)=>{const tt=at[ht];tt<=0||(ct.style.containIntrinsicSize=`auto ${Math.max(1,tt-HISTORY_ITEM_BLEED*2)}px`,ct.dataset.historyMeasured="1")})}function qe(Ze,at){let dt=null;const ct=(...ht)=>{dt&&window.clearTimeout(dt),dt=window.setTimeout(()=>{dt=null,Ze(...ht)},at)};return ct.cancel=()=>{dt&&window.clearTimeout(dt),dt=null},ct}const je=qe(async Ze=>{if(ae.loading||!ae.loadMore){Ze.loaded();return}const at=ae.chatKey,dt=new Set(ae.messages.map(Me));try{if(!ae.hasMore){Ze.complete();return}if($e(),await ae.loadMore(),at!==ae.chatKey){ye(),Ze.loaded();return}const ct=ae.messages.filter(tt=>!dt.has(Me(tt))),ht=Se(ct);await e$b.nextTick(),await Promise.all([warmImageSources(ht,INFINITE_MEDIA_WARMUP_TIMEOUT_MS),ke()]),ye(),await e$b.nextTick(()=>{oe.value&&(Ue(),yt())}),ae.hasMore?Ze.loaded():Ze.complete()}catch(ct){ye(),console.error("Erro durante o carregamento da rolagem infinita:",ct),Ze.complete()}},500);function We(){oe.value&&oe.value.scrollTo({top:0,behavior:"instant"})}function Ge(){if(!oe.value)return;const Ze=Math.max(oe.value.scrollHeight-oe.value.clientHeight,0);oe.value.scrollTo({top:-Ze,behavior:"smooth"})}let Ke={max:0,threshold:0},et=null;function yt(){if(!oe.value)return;const Ze=oe.value.clientHeight;Ke={max:Math.max(oe.value.scrollHeight-Ze,0),threshold:Math.min(Math.max(Ze*.25,96),220)}}function Et(Ze,at,dt){return Ze?at>dt-NAV_HYSTERESIS_PX:at>dt}function At(){if(!oe.value)return;const{max:Ze,threshold:at}=Ke,dt=Math.min(Math.max(-oe.value.scrollTop,0),Ze);Fe.value=Et(Fe.value,Ze-dt,at),Ie.value=Et(Ie.value,dt,at)}let Pt=null;function _t(){Pt===null&&(Pt=requestAnimationFrame(()=>{Pt=null,At()}))}return e$b.onMounted(async()=>{var Ze;await e$b.nextTick(),(Ze=oe.value)==null||Ze.addEventListener("scroll",_t,{passive:!0}),et=new ResizeObserver(()=>{yt(),At()}),oe.value&&et.observe(oe.value),ie.value&&et.observe(ie.value),requestAnimationFrame(()=>{Ue(),yt(),At()})}),e$b.onUnmounted(()=>{var Ze;ye(),(Ze=oe.value)==null||Ze.removeEventListener("scroll",_t),et==null||et.disconnect(),et=null,Pt!==null&&cancelAnimationFrame(Pt)}),e$b.watch(()=>ze.value.length,async()=>{await e$b.nextTick(),Ue(),yt(),At()}),e$b.watch(()=>ae.chatKey,async()=>{je.cancel(),ye(),Pe.clear(),re.forwardMode.active&&(re.forwardMode.active=!1,re.forwardMode.selectedMessages=[]),await e$b.nextTick(),Ue(),yt(),At()}),te({scrollToTop:Ge,scrollToBottom:We}),(Ze,at)=>(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_1$p,[e$b.createElementVNode("main",{ref_key:"chatContainer",ref:oe,class:e$b.normalizeClass([ee.loadingMore?"overflow-hidden":"overflow-y-auto","history-scroll scroll relative size-full"]),style:e$b.normalizeStyle(be.value)},[e$b.createElementVNode("div",{ref_key:"chatContent",ref:ie,class:"history-content chat-column relative flex min-h-full w-full flex-none flex-col justify-end px-[10.5px] py-3"},[e$b.withDirectives(e$b.createVNode(e$b.unref(Y$1),{top:!0,direction:"top",class:"z-50 mb-2 py-1",onInfinite:e$b.unref(je)},{complete:e$b.withCtx(()=>[...at[0]||(at[0]=[e$b.createElementVNode("span",null,null,-1)])]),spinner:e$b.withCtx(()=>[e$b.createElementVNode("div",_hoisted_2$n,[e$b.createElementVNode("span",_hoisted_3$k,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(6,dt=>e$b.createElementVNode("i",{key:dt,class:"history-pixel-cell",style:e$b.normalizeStyle({"--cell":dt-1})},null,4)),64))]),e$b.createElementVNode("span",_hoisted_4$j,e$b.toDisplayString(ee.loadingMoreText),1)])]),_:1},8,["onInfinite"]),[[e$b.vShow,!ee.loading&&ee.hasMore]]),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(De.value,dt=>{var ct;return e$b.openBlock(),e$b.createElementBlock("div",{key:dt.key,class:e$b.normalizeClass(["history-item",{"history-item-prerender":Ee(dt.key),"history-item-overflowing":!!((ct=dt.message.metadata)!=null&&ct.reaction)}]),"aria-hidden":Ee(dt.key)?"true":void 0,inert:Ee(dt.key),"data-history-key":dt.key},[(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(dt.component),e$b.mergeProps({ref_for:!0},dt.props,e$b.toHandlers(dt.isSystem?ne:ee.messageHandlers)),{default:e$b.withCtx(()=>[dt.message.special?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$e,[e$b.createElementVNode("div",_hoisted_7$e,[at[1]||(at[1]=e$b.createElementVNode("span",null,"Conversa anterior",-1)),e$b.createElementVNode("span",_hoisted_8$a,e$b.toDisplayString(Ce(dt.message.content)),1)])])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[ee.unreadCount>0&&dt.key===we.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$8,[e$b.createElementVNode("div",_hoisted_10$8,[e$b.createElementVNode("span",_hoisted_11$7,e$b.toDisplayString(ee.unreadCount),1),e$b.createElementVNode("span",null,e$b.toDisplayString(ee.unreadCount===1?"mensagem não lida":"mensagens não lidas"),1)])])):e$b.createCommentVNode("",!0),dt.dayLabel?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_12$6,[e$b.createElementVNode("div",_hoisted_13$3,e$b.toDisplayString(dt.dayLabel),1)])):e$b.createCommentVNode("",!0),at[2]||(at[2]=e$b.createElementVNode("div",{class:"message"},null,-1))],64))]),_:2},1040))],10,_hoisted_5$h)}),128))],512)],6),e$b.createElementVNode("div",_hoisted_14$3,[e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[e$b.unref(re).forwardMode.active&&Ze.$slots.banner?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_15$3,[e$b.renderSlot(Ze.$slots,"banner",{selectedCount:le.value})])):e$b.createCommentVNode("",!0)]),_:3})]),e$b.createVNode(e$b.Transition,{name:"history-loader"},{default:e$b.withCtx(()=>[ee.loading&&Ze.$slots.loading?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$3,[e$b.renderSlot(Ze.$slots,"loading")])):e$b.createCommentVNode("",!0)]),_:3}),e$b.createVNode(e$b.TransitionGroup,{name:"history-nav",tag:"div",class:"history-navigation"},{default:e$b.withCtx(()=>[Fe.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:"top",type:"button",class:"history-navigation-button","aria-label":"Ir para o início da conversa",title:"Ir para o início da conversa",onClick:Ge},[...at[3]||(at[3]=[e$b.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none"},[e$b.createElementVNode("path",{d:"m6.75 14.25 5.25-5.25 5.25 5.25"})],-1)])])):e$b.createCommentVNode("",!0),Ie.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:"bottom",type:"button",class:"history-navigation-button","aria-label":"Ir para as mensagens mais recentes",title:"Ir para as mensagens mais recentes",onClick:We},[...at[4]||(at[4]=[e$b.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none"},[e$b.createElementVNode("path",{d:"m6.75 9.75 5.25 5.25 5.25-5.25"})],-1)])])):e$b.createCommentVNode("",!0)]),_:1})]))}},_hoisted_1$o=["aria-label"],_hoisted_2$m={key:0,class:"size-4 translate-x-px","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_3$j={key:1,class:"size-4","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_4$i={class:"apb-body"},_hoisted_5$g={class:"apb-head"},_hoisted_6$d={class:"apb-title"},_hoisted_7$d={class:"apb-time"},_hoisted_8$9={class:"apb-wave-slot"},_hoisted_9$7={key:0,class:"apb-equalizer","aria-hidden":"true"},_hoisted_10$7=["aria-label"],BAR_COUNT=28,_sfc_main$r={__name:"AudioPlaybackBar",props:{variant:{type:String,default:"inline",validator:ee=>["inline","floating"].includes(ee)},waveHeight:{type:Number,default:26}},emits:["open"],setup(ee,{emit:te}){const ne=te,ae=ee,re=useAudioPlaybackStore(),oe=e$b.ref(null),ie=e$b.ref(null),le=e$b.ref(!1);let ce=null,de=null,ue=null;const ve=e$b.computed(()=>{var $e;return(($e=re.meta)==null?void 0:$e.title)||"Áudio"}),me=e$b.computed(()=>fe(re.currentTime)),ge=e$b.computed(()=>fe(re.duration));function fe($e){if(!$e||Number.isNaN($e))return"0:00";const ye=Math.floor($e/60),Ee=Math.floor($e%60);return`${ye}:${String(Ee).padStart(2,"0")}`}function pe($e){return{animationDelay:`-${(1.2-$e%8*.1).toFixed(2)}s`}}function _e(){var ye;const $e=re.rate>=2?1:+(re.rate+.5).toFixed(1);re.setRate($e),(ye=ce==null?void 0:ce.setPlaybackRate)==null||ye.call(ce,$e)}function be(){var $e,ye;detachSharedMedia(ce,de,re);try{($e=ce==null?void 0:ce.unAll)==null||$e.call(ce)}catch{}try{(ye=ce==null?void 0:ce.destroy)==null||ye.call(ce)}catch{}ce=null,de=null}async function ke(){if(be(),le.value=!1,await e$b.nextTick(),!ie.value)return;const $e=re.activeElement();if(!$e)return;const ye=readWaveColors(oe.value);ce=w$5.create({container:ie.value,media:new Audio,waveColor:ye.wave,progressColor:ye.progress,cursorColor:ye.cursor,cursorWidth:10,height:ae.waveHeight,barWidth:2,barRadius:2,barHeight:.9,barGap:2,hideScrollbar:!0});const Ee=ce,Se=re.activePeaks(),Le=re.activeSrc();try{Se?await ce.load(Le,Se.peaks,Se.duration):await ce.load(Le)}catch(Ve){console.error("Falha ao desenhar a onda do mini player:",Ve)}ce===Ee&&(de=$e,attachSharedMedia(ce,de,{rate:re.rate}),le.value=!0)}return e$b.watch(()=>re.isFloating&&re.trackId,$e=>{if(!$e){be(),le.value=!1;return}ke()},{immediate:!0}),e$b.watch(oe,$e=>{if(ue==null||ue.disconnect(),ue=null,!$e||typeof ResizeObserver>"u")return;let ye=$e.clientWidth;ue=new ResizeObserver(()=>{!ce||Math.abs($e.clientWidth-ye)<8||(ye=$e.clientWidth,ke())}),ue.observe($e)}),e$b.onBeforeUnmount(()=>{ue==null||ue.disconnect(),ue=null,be()}),($e,ye)=>(e$b.openBlock(),e$b.createBlock(e$b.Transition,{name:ee.variant==="floating"?"apb-float":"apb"},{default:e$b.withCtx(()=>[e$b.unref(re).isFloating?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"rootEl",ref:oe,class:e$b.normalizeClass(["apb-root",`apb-${ee.variant}`])},[e$b.createElementVNode("button",{type:"button",class:"apb-play","aria-label":e$b.unref(re).isPlaying?"Pausar":"Tocar",onClick:ye[0]||(ye[0]=Ee=>e$b.unref(re).toggle())},[e$b.unref(re).isPlaying?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$j,[...ye[4]||(ye[4]=[e$b.createElementVNode("path",{d:"M8 5h3v14H8V5Zm5 0h3v14h-3V5Z"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$m,[...ye[3]||(ye[3]=[e$b.createElementVNode("path",{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"},null,-1)])]))],8,_hoisted_1$o),e$b.createElementVNode("div",_hoisted_4$i,[e$b.createElementVNode("div",_hoisted_5$g,[e$b.createElementVNode("button",{type:"button",class:"apb-info",title:"Ir para a mensagem",onClick:ye[1]||(ye[1]=Ee=>ne("open",e$b.unref(re).meta))},[e$b.createElementVNode("span",_hoisted_6$d,e$b.toDisplayString(ve.value),1)]),e$b.createElementVNode("span",_hoisted_7$d,e$b.toDisplayString(me.value)+" / "+e$b.toDisplayString(ge.value),1)]),e$b.createElementVNode("div",_hoisted_8$9,[le.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$7,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(BAR_COUNT,Ee=>e$b.createElementVNode("span",{key:Ee,style:e$b.normalizeStyle(pe(Ee))},null,4)),64))])),e$b.withDirectives(e$b.createElementVNode("div",{ref_key:"waveEl",ref:ie,class:"apb-wave"},null,512),[[e$b.vShow,le.value]])])]),e$b.createElementVNode("button",{type:"button",class:"apb-rate","aria-label":`Velocidade ${e$b.unref(re).rate.toFixed(1)}x. Clique para mudar`,onClick:_e},e$b.toDisplayString(e$b.unref(re).rate.toFixed(1))+"x ",9,_hoisted_10$7),e$b.createElementVNode("button",{type:"button",class:"apb-close","aria-label":"Fechar",onClick:ye[2]||(ye[2]=Ee=>e$b.unref(re).clear())},[...ye[5]||(ye[5]=[e$b.createElementVNode("svg",{class:"size-4","aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e$b.createElementVNode("path",{"stroke-linecap":"round",d:"M6 6l12 12M18 6L6 18"})],-1)])])],2)):e$b.createCommentVNode("",!0)]),_:1},8,["name"]))}},AudioPlaybackBar=_export_sfc$1(_sfc_main$r,[["__scopeId","data-v-b40822ed"]]),_hoisted_1$n={class:"modal-head"},_hoisted_2$l={class:"modal_responsive"},_hoisted_3$i={class:"flex min-h-full items-center justify-center"},_hoisted_4$h={class:"modal-size w-full max-w-md"},_hoisted_5$f={class:"modal-background sidebar"},_hoisted_6$c={class:"modal-title items-center"},_hoisted_7$c={class:"flex items-center"},_hoisted_8$8={class:"pb-3"},_hoisted_9$6={class:"sidebar p-2 font-semibold lg:text-base"},_hoisted_10$6=["for"],_hoisted_11$6={class:"text-base"},_hoisted_12$5={class:"opacity-70"},_sfc_main$q={__name:"MessageListModal",setup(ee){const te=useMessageUiStore(),ne=e$b.computed(()=>te.list.message);return(ae,re)=>{var oe;return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$n,[re[3]||(re[3]=e$b.createElementVNode("div",{class:"modal-overlay"},null,-1)),e$b.createElementVNode("div",_hoisted_2$l,[e$b.createElementVNode("div",_hoisted_3$i,[e$b.createElementVNode("div",_hoisted_4$h,[e$b.createElementVNode("div",_hoisted_5$f,[e$b.createElementVNode("div",_hoisted_6$c,[re[2]||(re[2]=e$b.createElementVNode("div",{class:"flex items-center"},[e$b.createElementVNode("h3",{class:"text-base lg:text-xl"},"Lista")],-1)),e$b.createElementVNode("div",_hoisted_7$c,[e$b.createElementVNode("button",{type:"button","aria-label":"Fechar",class:"inline-flex items-center rounded-lg bg-transparent p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900",onClick:re[0]||(re[0]=ie=>e$b.unref(te).closeList())},[...re[1]||(re[1]=[e$b.createElementVNode("svg",{class:"size-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])])])]),e$b.createElementVNode("div",_hoisted_8$8,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(((oe=ne.value)==null?void 0:oe.sections)||[],(ie,le)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:le},[e$b.createElementVNode("p",_hoisted_9$6,e$b.toDisplayString(ie.title),1),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie.rows,ce=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ce.rowId,class:"hover:header flex items-center justify-between px-2 py-1"},[e$b.createElementVNode("label",{class:"mt-px w-full select-none",for:`${le}${ce.rowId}`},[e$b.createElementVNode("div",_hoisted_11$6,e$b.toDisplayString(ce.title),1),e$b.createElementVNode("p",_hoisted_12$5,e$b.toDisplayString(ce.description),1)],8,_hoisted_10$6)]))),128))]))),128))])])])])])])}}};var t={207:(ee,te,ne)=>{ee.exports=ne(452)},452:ee=>{var te=function(ne){var ae,re=Object.prototype,oe=re.hasOwnProperty,ie=typeof Symbol=="function"?Symbol:{},le=ie.iterator||"@@iterator",ce=ie.asyncIterator||"@@asyncIterator",de=ie.toStringTag||"@@toStringTag";function ue(Me,we,Ce){return Object.defineProperty(Me,we,{value:Ce,enumerable:!0,configurable:!0,writable:!0}),Me[we]}try{ue({},"")}catch{ue=function(we,Ce,Fe){return we[Ce]=Fe}}function ve(Me,we,Ce,Fe){var Ie=we&&we.prototype instanceof ke?we:ke,Ue=Object.create(Ie.prototype),qe=new Be(Fe||[]);return Ue._invoke=function(je,We,Ge){var Ke=ge;return function(et,yt){if(Ke===pe)throw new Error("Generator is already running");if(Ke===_e){if(et==="throw")throw yt;return Ne()}for(Ge.method=et,Ge.arg=yt;;){var Et=Ge.delegate;if(Et){var At=Re(Et,Ge);if(At){if(At===be)continue;return At}}if(Ge.method==="next")Ge.sent=Ge._sent=Ge.arg;else if(Ge.method==="throw"){if(Ke===ge)throw Ke=_e,Ge.arg;Ge.dispatchException(Ge.arg)}else Ge.method==="return"&&Ge.abrupt("return",Ge.arg);Ke=pe;var Pt=me(je,We,Ge);if(Pt.type==="normal"){if(Ke=Ge.done?_e:fe,Pt.arg===be)continue;return{value:Pt.arg,done:Ge.done}}Pt.type==="throw"&&(Ke=_e,Ge.method="throw",Ge.arg=Pt.arg)}}}(Me,Ce,qe),Ue}function me(Me,we,Ce){try{return{type:"normal",arg:Me.call(we,Ce)}}catch(Fe){return{type:"throw",arg:Fe}}}ne.wrap=ve;var ge="suspendedStart",fe="suspendedYield",pe="executing",_e="completed",be={};function ke(){}function $e(){}function ye(){}var Ee={};ue(Ee,le,function(){return this});var Se=Object.getPrototypeOf,Le=Se&&Se(Se(De([])));Le&&Le!==re&&oe.call(Le,le)&&(Ee=Le);var Ve=ye.prototype=ke.prototype=Object.create(Ee);function Te(Me){["next","throw","return"].forEach(function(we){ue(Me,we,function(Ce){return this._invoke(we,Ce)})})}function ze(Me,we){function Ce(Ie,Ue,qe,je){var We=me(Me[Ie],Me,Ue);if(We.type!=="throw"){var Ge=We.arg,Ke=Ge.value;return Ke&&typeof Ke=="object"&&oe.call(Ke,"__await")?we.resolve(Ke.__await).then(function(et){Ce("next",et,qe,je)},function(et){Ce("throw",et,qe,je)}):we.resolve(Ke).then(function(et){Ge.value=et,qe(Ge)},function(et){return Ce("throw",et,qe,je)})}je(We.arg)}var Fe;this._invoke=function(Ie,Ue){function qe(){return new we(function(je,We){Ce(Ie,Ue,je,We)})}return Fe=Fe?Fe.then(qe,qe):qe()}}function Re(Me,we){var Ce=Me.iterator[we.method];if(Ce===ae){if(we.delegate=null,we.method==="throw"){if(Me.iterator.return&&(we.method="return",we.arg=ae,Re(Me,we),we.method==="throw"))return be;we.method="throw",we.arg=new TypeError("The iterator does not provide a 'throw' method")}return be}var Fe=me(Ce,Me.iterator,we.arg);if(Fe.type==="throw")return we.method="throw",we.arg=Fe.arg,we.delegate=null,be;var Ie=Fe.arg;return Ie?Ie.done?(we[Me.resultName]=Ie.value,we.next=Me.nextLoc,we.method!=="return"&&(we.method="next",we.arg=ae),we.delegate=null,be):Ie:(we.method="throw",we.arg=new TypeError("iterator result is not an object"),we.delegate=null,be)}function Oe(Me){var we={tryLoc:Me[0]};1 in Me&&(we.catchLoc=Me[1]),2 in Me&&(we.finallyLoc=Me[2],we.afterLoc=Me[3]),this.tryEntries.push(we)}function Pe(Me){var we=Me.completion||{};we.type="normal",delete we.arg,Me.completion=we}function Be(Me){this.tryEntries=[{tryLoc:"root"}],Me.forEach(Oe,this),this.reset(!0)}function De(Me){if(Me){var we=Me[le];if(we)return we.call(Me);if(typeof Me.next=="function")return Me;if(!isNaN(Me.length)){var Ce=-1,Fe=function Ie(){for(;++Ce<Me.length;)if(oe.call(Me,Ce))return Ie.value=Me[Ce],Ie.done=!1,Ie;return Ie.value=ae,Ie.done=!0,Ie};return Fe.next=Fe}}return{next:Ne}}function Ne(){return{value:ae,done:!0}}return $e.prototype=ye,ue(Ve,"constructor",ye),ue(ye,"constructor",$e),$e.displayName=ue(ye,de,"GeneratorFunction"),ne.isGeneratorFunction=function(Me){var we=typeof Me=="function"&&Me.constructor;return!!we&&(we===$e||(we.displayName||we.name)==="GeneratorFunction")},ne.mark=function(Me){return Object.setPrototypeOf?Object.setPrototypeOf(Me,ye):(Me.__proto__=ye,ue(Me,de,"GeneratorFunction")),Me.prototype=Object.create(Ve),Me},ne.awrap=function(Me){return{__await:Me}},Te(ze.prototype),ue(ze.prototype,ce,function(){return this}),ne.AsyncIterator=ze,ne.async=function(Me,we,Ce,Fe,Ie){Ie===void 0&&(Ie=Promise);var Ue=new ze(ve(Me,we,Ce,Fe),Ie);return ne.isGeneratorFunction(we)?Ue:Ue.next().then(function(qe){return qe.done?qe.value:Ue.next()})},Te(Ve),ue(Ve,de,"Generator"),ue(Ve,le,function(){return this}),ue(Ve,"toString",function(){return"[object Generator]"}),ne.keys=function(Me){var we=[];for(var Ce in Me)we.push(Ce);return we.reverse(),function Fe(){for(;we.length;){var Ie=we.pop();if(Ie in Me)return Fe.value=Ie,Fe.done=!1,Fe}return Fe.done=!0,Fe}},ne.values=De,Be.prototype={constructor:Be,reset:function(Me){if(this.prev=0,this.next=0,this.sent=this._sent=ae,this.done=!1,this.delegate=null,this.method="next",this.arg=ae,this.tryEntries.forEach(Pe),!Me)for(var we in this)we.charAt(0)==="t"&&oe.call(this,we)&&!isNaN(+we.slice(1))&&(this[we]=ae)},stop:function(){this.done=!0;var Me=this.tryEntries[0].completion;if(Me.type==="throw")throw Me.arg;return this.rval},dispatchException:function(Me){if(this.done)throw Me;var we=this;function Ce(We,Ge){return Ue.type="throw",Ue.arg=Me,we.next=We,Ge&&(we.method="next",we.arg=ae),!!Ge}for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Ie=this.tryEntries[Fe],Ue=Ie.completion;if(Ie.tryLoc==="root")return Ce("end");if(Ie.tryLoc<=this.prev){var qe=oe.call(Ie,"catchLoc"),je=oe.call(Ie,"finallyLoc");if(qe&&je){if(this.prev<Ie.catchLoc)return Ce(Ie.catchLoc,!0);if(this.prev<Ie.finallyLoc)return Ce(Ie.finallyLoc)}else if(qe){if(this.prev<Ie.catchLoc)return Ce(Ie.catchLoc,!0)}else{if(!je)throw new Error("try statement without catch or finally");if(this.prev<Ie.finallyLoc)return Ce(Ie.finallyLoc)}}}},abrupt:function(Me,we){for(var Ce=this.tryEntries.length-1;Ce>=0;--Ce){var Fe=this.tryEntries[Ce];if(Fe.tryLoc<=this.prev&&oe.call(Fe,"finallyLoc")&&this.prev<Fe.finallyLoc){var Ie=Fe;break}}Ie&&(Me==="break"||Me==="continue")&&Ie.tryLoc<=we&&we<=Ie.finallyLoc&&(Ie=null);var Ue=Ie?Ie.completion:{};return Ue.type=Me,Ue.arg=we,Ie?(this.method="next",this.next=Ie.finallyLoc,be):this.complete(Ue)},complete:function(Me,we){if(Me.type==="throw")throw Me.arg;return Me.type==="break"||Me.type==="continue"?this.next=Me.arg:Me.type==="return"?(this.rval=this.arg=Me.arg,this.method="return",this.next="end"):Me.type==="normal"&&we&&(this.next=we),be},finish:function(Me){for(var we=this.tryEntries.length-1;we>=0;--we){var Ce=this.tryEntries[we];if(Ce.finallyLoc===Me)return this.complete(Ce.completion,Ce.afterLoc),Pe(Ce),be}},catch:function(Me){for(var we=this.tryEntries.length-1;we>=0;--we){var Ce=this.tryEntries[we];if(Ce.tryLoc===Me){var Fe=Ce.completion;if(Fe.type==="throw"){var Ie=Fe.arg;Pe(Ce)}return Ie}}throw new Error("illegal catch attempt")},delegateYield:function(Me,we,Ce){return this.delegate={iterator:De(Me),resultName:we,nextLoc:Ce},this.method==="next"&&(this.arg=ae),be}},ne}(ee.exports);try{regeneratorRuntime=te}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=te:Function("r","regeneratorRuntime = r")(te)}}},n={};function r(ee){var te=n[ee];if(te!==void 0)return te.exports;var ne=n[ee]={exports:{}};return t[ee](ne,ne.exports,r),ne.exports}r.n=ee=>{var te=ee&&ee.__esModule?()=>ee.default:()=>ee;return r.d(te,{a:te}),te},r.d=(ee,te)=>{for(var ne in te)r.o(te,ne)&&!r.o(ee,ne)&&Object.defineProperty(ee,ne,{enumerable:!0,get:te[ne]})},r.o=(ee,te)=>Object.prototype.hasOwnProperty.call(ee,te);var o={};function a(ee,te){(te==null||te>ee.length)&&(te=ee.length);for(var ne=0,ae=new Array(te);ne<te;ne++)ae[ne]=ee[ne];return ae}function i(ee,te){if(ee){if(typeof ee=="string")return a(ee,te);var ne=Object.prototype.toString.call(ee).slice(8,-1);return ne==="Object"&&ee.constructor&&(ne=ee.constructor.name),ne==="Map"||ne==="Set"?Array.from(ee):ne==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne)?a(ee,te):void 0}}function c(ee){return function(te){if(Array.isArray(te))return a(te)}(ee)||function(te){if(typeof Symbol<"u"&&te[Symbol.iterator]!=null||te["@@iterator"]!=null)return Array.from(te)}(ee)||i(ee)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
282
282
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function l(ee,te,ne){return te in ee?Object.defineProperty(ee,te,{value:ne,enumerable:!0,configurable:!0,writable:!0}):ee[te]=ne,ee}r.d(o,{A:()=>L$1});const u$1=(f$1={Fragment:()=>e__namespace.Fragment,computed:()=>e__namespace.computed,createTextVNode:()=>e__namespace.createTextVNode,createVNode:()=>e__namespace.createVNode,defineComponent:()=>e__namespace.defineComponent,nextTick:()=>e__namespace.nextTick,reactive:()=>e__namespace.reactive,ref:()=>e__namespace.ref,watch:()=>e__namespace.watch,watchEffect:()=>e__namespace.watchEffect},p={},r.d(p,f$1),p),d=(0,u$1.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var ee=this.data,te=this.onClick;return(0,u$1.createVNode)("span",{class:"vjs-tree-brackets",onClick:te},[ee])}}),s$1=(0,u$1.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(ee,te){var ne=te.emit;return{uiType:(0,u$1.computed)(function(){return ee.isMultiple?"checkbox":"radio"}),model:(0,u$1.computed)({get:function(){return ee.checked},set:function(ae){return ne("update:modelValue",ae)}})}},render:function(){var ee=this.uiType,te=this.model,ne=this.$emit;return(0,u$1.createVNode)("label",{class:["vjs-check-controller",te?"is-checked":""],onClick:function(ae){return ae.stopPropagation()}},[(0,u$1.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(ee)},null),(0,u$1.createVNode)("input",{checked:te,class:"vjs-check-controller-original is-".concat(ee),type:ee,onChange:function(){return ne("change",te)}},null)])}}),h=(0,u$1.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var ee=this.nodeType,te=this.onClick,ne=ee==="objectStart"||ee==="arrayStart";return ne||ee==="objectCollapsed"||ee==="arrayCollapsed"?(0,u$1.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(ne?"open":"close"),onClick:te},[(0,u$1.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,u$1.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var f$1,p;function v(ee){return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},v(ee)}function y(ee){return Object.prototype.toString.call(ee).slice(8,-1).toLowerCase()}function g(ee){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"root",ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,ae=(arguments.length>3?arguments[3]:void 0)||{},re=ae.key,oe=ae.index,ie=ae.type,le=ie===void 0?"content":ie,ce=ae.showComma,de=ce!==void 0&&ce,ue=ae.length,ve=ue===void 0?1:ue,me=y(ee);if(me==="array"){var ge=m(ee.map(function(_e,be,ke){return g(_e,"".concat(te,"[").concat(be,"]"),ne+1,{index:be,showComma:be!==ke.length-1,length:ve,type:le})}));return[g("[",te,ne,{showComma:!1,key:re,length:ee.length,type:"arrayStart"})[0]].concat(ge,g("]",te,ne,{showComma:de,length:ee.length,type:"arrayEnd"})[0])}if(me==="object"){var fe=Object.keys(ee),pe=m(fe.map(function(_e,be,ke){return g(ee[_e],/^[a-zA-Z_]\w*$/.test(_e)?"".concat(te,".").concat(_e):"".concat(te,'["').concat(_e,'"]'),ne+1,{key:_e,showComma:be!==ke.length-1,length:ve,type:le})}));return[g("{",te,ne,{showComma:!1,key:re,index:oe,length:fe.length,type:"objectStart"})[0]].concat(pe,g("}",te,ne,{showComma:de,length:fe.length,type:"objectEnd"})[0])}return[{content:ee,level:ne,key:re,index:oe,path:te,showComma:de,length:ve,type:le}]}function m(ee){if(typeof Array.prototype.flat=="function")return ee.flat();for(var te=c(ee),ne=[];te.length;){var ae=te.shift();Array.isArray(ae)?te.unshift.apply(te,c(ae)):ne.push(ae)}return ne}function b(ee){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(ee==null)return ee;if(ee instanceof Date)return new Date(ee);if(ee instanceof RegExp)return new RegExp(ee);if(v(ee)!=="object")return ee;if(te.get(ee))return te.get(ee);if(Array.isArray(ee)){var ne=ee.map(function(oe){return b(oe,te)});return te.set(ee,ne),ne}var ae={};for(var re in ee)ae[re]=b(ee[re],te);return te.set(ee,ae),ae}function w(ee,te,ne,ae,re,oe,ie){try{var le=ee[oe](ie),ce=le.value}catch(de){return void ne(de)}le.done?te(ce):Promise.resolve(ce).then(ae,re)}var N=r(207),k=r.n(N);function C(ee,te){var ne=Object.keys(ee);if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(ee);te&&(ae=ae.filter(function(re){return Object.getOwnPropertyDescriptor(ee,re).enumerable})),ne.push.apply(ne,ae)}return ne}function x(ee){for(var te=1;te<arguments.length;te++){var ne=arguments[te]!=null?arguments[te]:{};te%2?C(Object(ne),!0).forEach(function(ae){l(ee,ae,ne[ae])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ee,Object.getOwnPropertyDescriptors(ne)):C(Object(ne)).forEach(function(ae){Object.defineProperty(ee,ae,Object.getOwnPropertyDescriptor(ne,ae))})}return ee}var j={data:{type:[String,Number,Boolean,Array,Object],default:null},rootPath:{type:String,default:"root"},indent:{type:Number,default:2},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},renderNodeKey:Function,renderNodeValue:Function,renderNodeActions:{type:[Boolean,Function],default:void 0},selectableType:String,showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},showLineNumber:{type:Boolean,default:!1},selectOnClickNode:{type:Boolean,default:!0},nodeSelectable:{type:Function,default:function(){return!0}},highlightSelectedNode:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},theme:{type:String,default:"light"},showKeyValueSpace:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},editableTrigger:{type:String,default:"click"},onNodeClick:{type:Function},onNodeMouseover:{type:Function},onBracketsClick:{type:Function},onIconClick:{type:Function},onValueChange:{type:Function}};const S=(0,u$1.defineComponent)({name:"TreeNode",props:x(x({},j),{},{node:{type:Object,required:!0},collapsed:Boolean,checked:Boolean,style:Object,onSelectedChange:{type:Function}}),emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","valueChange"],setup:function(ee,te){var ne=te.emit,ae=(0,u$1.computed)(function(){return y(ee.node.content)}),re=(0,u$1.computed)(function(){return"vjs-value vjs-value-".concat(ae.value)}),oe=(0,u$1.computed)(function(){return ee.showDoubleQuotes?'"'.concat(ee.node.key,'"'):ee.node.key}),ie=(0,u$1.computed)(function(){return ee.selectableType==="multiple"}),le=(0,u$1.computed)(function(){return ee.selectableType==="single"}),ce=(0,u$1.computed)(function(){return ee.nodeSelectable(ee.node)&&(ie.value||le.value)}),de=(0,u$1.reactive)({editing:!1}),ue=function(Se){var Le,Ve,Te=(Ve=(Le=Se.target)===null||Le===void 0?void 0:Le.value)==="null"?null:Ve==="undefined"?void 0:Ve==="true"||Ve!=="false"&&(Ve[0]+Ve[Ve.length-1]==='""'||Ve[0]+Ve[Ve.length-1]==="''"?Ve.slice(1,-1):typeof Number(Ve)=="number"&&!isNaN(Number(Ve))||Ve==="NaN"?Number(Ve):Ve);ne("valueChange",Te,ee.node.path)},ve=(0,u$1.computed)(function(){var Se,Le=(Se=ee.node)===null||Se===void 0?void 0:Se.content;return Le===null?Le="null":Le===void 0&&(Le="undefined"),ae.value==="string"?'"'.concat(Le,'"'):Le+""}),me=function(){var Se=ee.renderNodeValue;return Se?Se({node:ee.node,defaultValue:ve.value}):ve.value},ge=function(){ne("bracketsClick",!ee.collapsed,ee.node)},fe=function(){ne("iconClick",!ee.collapsed,ee.node)},pe=function(){ne("selectedChange",ee.node)},_e=function(){ne("nodeClick",ee.node),ce.value&&ee.selectOnClickNode&&ne("selectedChange",ee.node)},be=function(){ne("nodeMouseover",ee.node)},ke=function(Se){if(ee.editable&&!de.editing){de.editing=!0;var Le=function Ve(Te){var ze;Te.target!==Se.target&&((ze=Te.target)===null||ze===void 0?void 0:ze.parentElement)!==Se.target&&(de.editing=!1,document.removeEventListener("click",Ve))};document.removeEventListener("click",Le),document.addEventListener("click",Le)}},$e=function(){var Se=(0,u$1.ref)(!1),Le=function(){var Ve,Te=(Ve=k().mark(function ze(Re){return k().wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.prev=0,Oe.next=3,navigator.clipboard.writeText(Re);case 3:Se.value=!0,setTimeout(function(){Se.value=!1},300),Oe.next=10;break;case 7:Oe.prev=7,Oe.t0=Oe.catch(0),console.error("[vue-json-pretty] Copy failed: ",Oe.t0);case 10:case"end":return Oe.stop()}},ze,null,[[0,7]])}),function(){var ze=this,Re=arguments;return new Promise(function(Oe,Pe){var Be=Ve.apply(ze,Re);function De(Me){w(Be,Oe,Pe,De,Ne,"next",Me)}function Ne(Me){w(Be,Oe,Pe,De,Ne,"throw",Me)}De(void 0)})});return function(ze){return Te.apply(this,arguments)}}();return{copy:Le}}().copy,ye=function(){var Se=ee.node,Le=Se.key,Ve=Se.path,Te=ee.rootPath,ze=new Function("data","return data".concat(Ve.slice(Te.length)))(ee.data),Re=JSON.stringify(Le?l({},Le,ze):ze,null,2);$e(Re)},Ee=function(){var Se=ee.renderNodeActions;if(!Se)return null;var Le={copy:ye};return typeof Se=="function"?Se({node:ee.node,defaultActions:Le}):(0,u$1.createVNode)("span",{onClick:ye,class:"vjs-tree-node-actions-item"},[(0,u$1.createTextVNode)("copy")])};return function(){var Se,Le=ee.node;return(0,u$1.createVNode)("div",{class:{"vjs-tree-node":!0,"has-selector":ee.showSelectController,"has-carets":ee.showIcon,"is-highlight":ee.highlightSelectedNode&&ee.checked,dark:ee.theme==="dark"},onClick:_e,onMouseover:be,style:ee.style},[ee.showLineNumber&&(0,u$1.createVNode)("span",{class:"vjs-node-index"},[Le.id+1]),ee.showSelectController&&ce.value&&Le.type!=="objectEnd"&&Le.type!=="arrayEnd"&&(0,u$1.createVNode)(s$1,{isMultiple:ie.value,checked:ee.checked,onChange:pe},null),(0,u$1.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(Le.level)).map(function(Ve,Te){return(0,u$1.createVNode)("div",{key:Te,class:{"vjs-indent-unit":!0,"has-line":ee.showLine}},[Array.from(Array(ee.indent)).map(function(){return(0,u$1.createVNode)(u$1.Fragment,null,[(0,u$1.createTextVNode)(" ")])})])}),ee.showIcon&&(0,u$1.createVNode)(h,{nodeType:Le.type,onClick:fe},null)]),Le.key&&(0,u$1.createVNode)("span",{class:"vjs-key"},[(Se=ee.renderNodeKey,Se?Se({node:ee.node,defaultKey:oe.value||""}):oe.value),(0,u$1.createVNode)("span",{class:"vjs-colon"},[":".concat(ee.showKeyValueSpace?" ":"")])]),(0,u$1.createVNode)("span",null,[Le.type!=="content"&&Le.content?(0,u$1.createVNode)(d,{data:Le.content.toString(),onClick:ge},null):(0,u$1.createVNode)("span",{class:re.value,onClick:!ee.editable||ee.editableTrigger&&ee.editableTrigger!=="click"?void 0:ke,onDblclick:ee.editable&&ee.editableTrigger==="dblclick"?ke:void 0},[ee.editable&&de.editing?(0,u$1.createVNode)("input",{value:ve.value,onChange:ue,style:{padding:"3px 8px",border:"1px solid #eee",boxShadow:"none",boxSizing:"border-box",borderRadius:5,fontFamily:"inherit"}},null):me()]),Le.showComma&&(0,u$1.createVNode)("span",null,[","]),ee.showLength&&ee.collapsed&&(0,u$1.createVNode)("span",{class:"vjs-comment"},[(0,u$1.createTextVNode)(" // "),Le.length,(0,u$1.createTextVNode)(" items ")])]),ee.renderNodeActions&&(0,u$1.createVNode)("span",{class:"vjs-tree-node-actions"},[Ee()])])}}});function O(ee,te){var ne=Object.keys(ee);if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(ee);te&&(ae=ae.filter(function(re){return Object.getOwnPropertyDescriptor(ee,re).enumerable})),ne.push.apply(ne,ae)}return ne}function V(ee){for(var te=1;te<arguments.length;te++){var ne=arguments[te]!=null?arguments[te]:{};te%2?O(Object(ne),!0).forEach(function(ae){l(ee,ae,ne[ae])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ee,Object.getOwnPropertyDescriptors(ne)):O(Object(ne)).forEach(function(ae){Object.defineProperty(ee,ae,Object.getOwnPropertyDescriptor(ne,ae))})}return ee}const L$1=(0,u$1.defineComponent)({name:"Tree",props:V(V({},j),{},{collapsedNodeLength:{type:Number,default:1/0},deep:{type:Number,default:1/0},pathCollapsible:{type:Function,default:function(){return!1}},virtual:{type:Boolean,default:!1},height:{type:Number,default:400},itemHeight:{type:Number,default:20},dynamicHeight:{type:Boolean,default:!0},selectedValue:{type:[String,Array],default:function(){return""}},collapsedOnClickBrackets:{type:Boolean,default:!0},style:Object,onSelectedChange:{type:Function},theme:{type:String,default:"light"}}),slots:["renderNodeKey","renderNodeValue","renderNodeActions"],emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","update:selectedValue","update:data"],setup:function(ee,te){var ne=te.emit,ae=te.slots,re=(0,u$1.ref)(),oe=(0,u$1.computed)(function(){return g(ee.data,ee.rootPath)}),ie=function(Pe,Be){return oe.value.reduce(function(De,Ne){var Me,we=Ne.level>=Pe||Ne.length>=Be,Ce=(Me=ee.pathCollapsible)===null||Me===void 0?void 0:Me.call(ee,Ne);return Ne.type!=="objectStart"&&Ne.type!=="arrayStart"||!we&&!Ce?De:V(V({},De),{},l({},Ne.path,1))},{})},le=(0,u$1.reactive)({translateY:0,visibleData:null,hiddenPaths:ie(ee.deep,ee.collapsedNodeLength),startIndex:0,endIndex:0}),ce=[],de=[],ue=0,ve={},me=function(Pe){ce=Array(Pe).fill(0).map(function(){return ee.itemHeight||20}),(de=new Array(Pe+1))[0]=0;for(var Be=0;Be<Pe;Be++)de[Be+1]=de[Be]+ce[Be];ue=de[Pe]||0},ge=function(Pe){var Be=ce.length;Pe<0&&(Pe=0),Pe>Be&&(Pe=Be);for(var De=Pe;De<Be;De++)de[De+1]=de[De]+ce[De];ue=de[Be]||0},fe=function(Pe,Be){for(var De=0,Ne=Pe.length-1;De<Ne;){var Me=De+Ne>>>1;Pe[Me]<Be?De=Me+1:Ne=Me}return De},pe=(0,u$1.computed)(function(){for(var Pe=null,Be=[],De=oe.value.length,Ne=0;Ne<De;Ne++){var Me=V(V({},oe.value[Ne]),{},{id:Ne}),we=le.hiddenPaths[Me.path];if(Pe&&Pe.path===Me.path){var Ce=Pe.type==="objectStart",Fe=V(V(V({},Me),Pe),{},{showComma:Me.showComma,content:Ce?"{...}":"[...]",type:Ce?"objectCollapsed":"arrayCollapsed"});Pe=null,Be.push(Fe)}else{if(we&&!Pe){Pe=Me;continue}if(Pe)continue;Be.push(Me)}}return Be}),_e=(0,u$1.computed)(function(){var Pe=ee.selectedValue;return Pe&&ee.selectableType==="multiple"&&Array.isArray(Pe)?Pe:[Pe]}),be=(0,u$1.computed)(function(){return!ee.selectableType||ee.selectOnClickNode||ee.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."}),ke=(0,u$1.computed)(function(){return ee.dynamicHeight?ue||0:pe.value.length*ee.itemHeight}),$e=function Pe(){var Be=pe.value;if(Be)if(ee.virtual){var De,Ne=((De=re.value)===null||De===void 0?void 0:De.scrollTop)||0;if(ee.dynamicHeight){ce.length!==Be.length&&me(Be.length);var Me=function(We){var Ge=fe(de,We+1e-4);return Math.max(0,Math.min(Ge-1,ce.length-1))}(Ne),we=function(We,Ge){var Ke=fe(de,We+Ge);return Math.max(0,Math.min(Ke+1,ce.length))}(Ne,ee.height),Ce=Math.max(0,Me-5),Fe=Math.min(Be.length,we+5);le.startIndex=Ce,le.endIndex=Fe,le.translateY=de[Ce]||0,le.visibleData=Be.slice(Ce,Fe),(0,u$1.nextTick)().then(function(){for(var We=!1,Ge=le.startIndex;Ge<le.endIndex;Ge++){var Ke=ve[Ge];if(Ke){var et=Ke.offsetHeight;et&&ce[Ge]!==et&&(ce[Ge]=et,de[Ge+1]=de[Ge]+ce[Ge],ge(Ge+1),We=!0)}}We&&Pe()})}else{var Ie=ee.height/ee.itemHeight,Ue=Math.floor(Ne/ee.itemHeight),qe=Ue<0?0:Ue+Ie>Be.length?Be.length-Ie:Ue;qe<0&&(qe=0);var je=qe+Ie;le.translateY=qe*ee.itemHeight,le.startIndex=qe,le.endIndex=je,le.visibleData=Be.slice(qe,je)}}else le.translateY=0,le.startIndex=0,le.endIndex=Be.length,le.visibleData=Be},ye=null,Ee=function(){ye&&cancelAnimationFrame(ye),ye=requestAnimationFrame(function(){$e()})},Se=function(Pe){var Be,De,Ne=Pe.path,Me=ee.selectableType;if(Me==="multiple"){var we=_e.value.findIndex(function(Ue){return Ue===Ne}),Ce=c(_e.value);we!==-1?Ce.splice(we,1):Ce.push(Ne),ne("update:selectedValue",Ce),ne("selectedChange",Ce,c(_e.value))}else if(Me==="single"&&_e.value[0]!==Ne){var Fe=(Be=_e.value,De=1,function(Ue){if(Array.isArray(Ue))return Ue}(Be)||function(Ue,qe){var je=Ue==null?null:typeof Symbol<"u"&&Ue[Symbol.iterator]||Ue["@@iterator"];if(je!=null){var We,Ge,Ke=[],et=!0,yt=!1;try{for(je=je.call(Ue);!(et=(We=je.next()).done)&&(Ke.push(We.value),!qe||Ke.length!==qe);et=!0);}catch(Et){yt=!0,Ge=Et}finally{try{et||je.return==null||je.return()}finally{if(yt)throw Ge}}return Ke}}(Be,De)||i(Be,De)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
283
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())[0],Ie=Ne;ne("update:selectedValue",Ie),ne("selectedChange",Ie,Fe)}},Le=function(Pe){ne("nodeClick",Pe)},Ve=function(Pe){ne("nodeMouseover",Pe)},Te=function(Pe,Be){if(Pe)le.hiddenPaths=V(V({},le.hiddenPaths),{},l({},Be,1));else{var De=V({},le.hiddenPaths);delete De[Be],le.hiddenPaths=De}},ze=function(Pe,Be){ee.collapsedOnClickBrackets&&Te(Pe,Be.path),ne("bracketsClick",Pe,Be)},Re=function(Pe,Be){Te(Pe,Be.path),ne("iconClick",Pe,Be)},Oe=function(Pe,Be){var De=b(ee.data),Ne=ee.rootPath;new Function("data","val","data".concat(Be.slice(Ne.length),"=val"))(De,Pe),ne("update:data",De)};return(0,u$1.watchEffect)(function(){be.value&&function(Pe){throw new Error("[VueJSONPretty] ".concat(Pe))}(be.value)}),(0,u$1.watchEffect)(function(){pe.value&&(ee.virtual&&ee.dynamicHeight&&ce.length!==pe.value.length&&me(pe.value.length),$e())}),(0,u$1.watch)(function(){return[ee.dynamicHeight,ee.itemHeight,oe.value.length]},function(){ee.virtual&&ee.dynamicHeight&&(me(pe.value.length),(0,u$1.nextTick)($e))}),(0,u$1.watch)(function(){return ee.deep},function(Pe){Pe&&(le.hiddenPaths=ie(Pe,ee.collapsedNodeLength))}),(0,u$1.watch)(function(){return ee.collapsedNodeLength},function(Pe){Pe&&(le.hiddenPaths=ie(ee.deep,Pe))}),function(){var Pe,Be,De,Ne,Me,we=(Pe=ee.renderNodeKey)!==null&&Pe!==void 0?Pe:ae.renderNodeKey,Ce=(Be=ee.renderNodeValue)!==null&&Be!==void 0?Be:ae.renderNodeValue,Fe=(De=(Ne=ee.renderNodeActions)!==null&&Ne!==void 0?Ne:ae.renderNodeActions)!==null&&De!==void 0&&De,Ie=(Me=le.visibleData)===null||Me===void 0?void 0:Me.map(function(Ue,qe){var je=le.startIndex+qe;return(0,u$1.createVNode)("div",{key:Ue.id,ref:function(We){return function(Ge,Ke){Ke?ve[Ge]=Ke:delete ve[Ge]}(je,We||null)}},[(0,u$1.createVNode)(S,{data:ee.data,rootPath:ee.rootPath,indent:ee.indent,node:Ue,collapsed:!!le.hiddenPaths[Ue.path],theme:ee.theme,showDoubleQuotes:ee.showDoubleQuotes,showLength:ee.showLength,checked:_e.value.includes(Ue.path),selectableType:ee.selectableType,showLine:ee.showLine,showLineNumber:ee.showLineNumber,showSelectController:ee.showSelectController,selectOnClickNode:ee.selectOnClickNode,nodeSelectable:ee.nodeSelectable,highlightSelectedNode:ee.highlightSelectedNode,editable:ee.editable,editableTrigger:ee.editableTrigger,showIcon:ee.showIcon,showKeyValueSpace:ee.showKeyValueSpace,renderNodeKey:we,renderNodeValue:Ce,renderNodeActions:Fe,onNodeClick:Le,onNodeMouseover:Ve,onBracketsClick:ze,onIconClick:Re,onSelectedChange:Se,onValueChange:Oe,class:ee.dynamicHeight?"dynamic-height":void 0,style:ee.dynamicHeight?{}:ee.itemHeight&&ee.itemHeight!==20?{lineHeight:"".concat(ee.itemHeight,"px")}:{}},null)])});return(0,u$1.createVNode)("div",{ref:re,class:{"vjs-tree":!0,"is-virtual":ee.virtual,dark:ee.theme==="dark"},onScroll:ee.virtual?Ee:void 0,style:ee.showLineNumber?V({paddingLeft:"".concat(12*Number(oe.value.length.toString().length),"px")},ee.style):ee.style},[ee.virtual?(0,u$1.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(ee.height,"px")}},[(0,u$1.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(ke.value,"px")}},[(0,u$1.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(le.translateY,"px)")}},[Ie])])]):Ie])}}});var P=o.A;const _hoisted_1$m={class:"space-y-2"},_hoisted_2$k={class:"w-full overflow-auto p-2 pb-3"},_hoisted_3$h={class:"info_form"},_hoisted_4$g={key:0,class:"p-2"},_hoisted_5$e={key:0,class:"flex items-center"},_hoisted_6$b={key:1,class:"flex items-center"},_hoisted_7$b={key:2,class:"flex items-center"},_hoisted_8$7={key:1,class:"border-t border-gray-700 dark:border-gray-300"},_hoisted_9$5={class:"p-2 px-4 opacity-80"},_hoisted_10$5={key:0},_hoisted_11$5={key:1},_hoisted_12$4={key:0,class:"info_form"},_hoisted_13$2={class:"flex max-h-[200px] flex-wrap items-center gap-2 overflow-auto p-2"},_hoisted_14$2={key:1,class:"info_form"},_hoisted_15$2={class:"flex items-center p-2"},_hoisted_16$2={key:0,class:"overflow-x-auto"},_hoisted_17$1={key:2,class:"info_form"},_hoisted_18$1={class:"p-2"},_hoisted_19$1={class:"flex items-center pl-1"},_hoisted_20$1={class:"mt-1 flex items-center pl-1"},_hoisted_21$1={key:3,class:"info_form"},_hoisted_22={class:"flex items-center p-2"},_sfc_main$p={__name:"MessageInfoPanel",props:{message:{type:Object,required:!0},now:{type:Date,default:null},brandBackground:{type:String,default:"zap"}},setup(ee){const te=ee,ne=useMessageUiStore(),ae=e$b.computed(()=>!ne.themeMode),re=e$b.computed(()=>te.now||new Date);function oe(ce){const de=new Date(Date.parse(ce)),ue=re.value;if(isSameWeek(de,ue)){const ve=new Date(ue);return ve.setDate(ve.getDate()-1),isSameDay(de,ue)?"Hoje":isSameDay(de,ve)?"Ontem":format(de,"iiii",{locale:ptBR})}return format(de,"dd/MM/yyyy",{locale:ptBR})}function ie(ce){try{return JSON.parse(String(ce).replace(/'/g,'"'))}catch{return!1}}const le=e$b.computed(()=>{var ce;return(ce=te.message)!=null&&ce.fail_reason?ie(te.message.fail_reason):!1});return(ce,de)=>{var ue,ve;return e$b.openBlock(),e$b.createElementBlock("main",_hoisted_1$m,[e$b.createElementVNode("section",{class:e$b.normalizeClass(["chat-background",`banner-${ee.brandBackground}`])},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["flex items-center justify-center",`bg-${ee.brandBackground}`])},null,2),e$b.createElementVNode("div",_hoisted_2$k,[e$b.createVNode(_sfc_main$u,{"is-info":!0,message:ee.message},null,8,["message"])])],2),e$b.createElementVNode("section",_hoisted_3$h,[e$b.createElementVNode("section",null,[ee.message.from_me?(e$b.openBlock(),e$b.createElementBlock("header",_hoisted_4$g,[ee.message.stage==="processing"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5$e,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,class:"mr-2 size-4"},null,8,["stage"]),de[0]||(de[0]=e$b.createTextVNode(" Processando ",-1))])):ee.message.stage==="received"||ee.message.stage==="sent"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$b,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,class:"mr-2"},null,8,["stage"]),de[1]||(de[1]=e$b.createTextVNode(" Recebida ",-1))])):ee.message.stage==="failed"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$b,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,"failed-size":14,class:"mr-2 size-4"},null,8,["stage"]),de[2]||(de[2]=e$b.createTextVNode(" Falhou ",-1))])):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),ee.message.from_me?(e$b.openBlock(),e$b.createElementBlock("hr",_hoisted_8$7)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_9$5,[ee.message.created_at?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10$5," Criada às "+e$b.toDisplayString(ee.message.created_at.split("T")[1].slice(0,5))+" - "+e$b.toDisplayString(oe(ee.message.created_at)),1)):e$b.createCommentVNode("",!0),ee.message.sent_at?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_11$5," Enviada às "+e$b.toDisplayString(ee.message.sent_at.split("T")[1].slice(0,5))+" - "+e$b.toDisplayString(oe(ee.message.sent_at)),1)):e$b.createCommentVNode("",!0)])])]),(ve=(ue=ee.message)==null?void 0:ue.content)!=null&&ve.history?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_12$4,[de[3]||(de[3]=e$b.createElementVNode("div",{class:"flex items-center p-2"},[e$b.createElementVNode("svg",{class:"mr-2 size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 2a2 2 0 0 0-2 2v15a3 3 0 0 0 3 3h12a1 1 0 1 0 0-2h-2v-2h2a1 1 0 0 0 1-1V4a2 2 0 0 0-2-2h-8v16h5v2H7a1 1 0 1 1 0-2h1V2H6Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Histórico de mensagem ")],-1)),de[4]||(de[4]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("div",_hoisted_13$2,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ee.message.content.history,(me,ge)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ge,class:"message-owner rounded-lg p-2 py-1"},e$b.toDisplayString(me),1))),128))])])):e$b.createCommentVNode("",!0),ee.message.fail_reason?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_14$2,[de[5]||(de[5]=e$b.createElementVNode("div",{class:"flex items-center p-2"},[e$b.createElementVNode("svg",{class:"mr-2 size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm11-4a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0V8Zm-1 7a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H12Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Motivo de falha ")],-1)),de[6]||(de[6]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("div",_hoisted_15$2,[le.value?(e$b.openBlock(),e$b.createBlock(e$b.unref(P),{key:1,"collapsed-on-click-brackets":!1,theme:ae.value?"light":"dark",data:le.value},null,8,["theme","data"])):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$2,e$b.toDisplayString(ee.message.fail_reason),1))])])):e$b.createCommentVNode("",!0),ee.message.instance?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_17$1,[de[9]||(de[9]=e$b.createElementVNode("div",{class:"flex items-center p-2"},[e$b.createElementVNode("svg",{class:"mr-2 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512"},[e$b.createElementVNode("path",{d:"M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z",fill:"currentColor"})]),e$b.createTextVNode(" Instância ")],-1)),de[10]||(de[10]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("main",_hoisted_18$1,[e$b.createElementVNode("div",_hoisted_19$1,[de[7]||(de[7]=e$b.createElementVNode("svg",{class:"mr-2 size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 20a8 8 0 0 1-5-1.8v-.6c0-1.8 1.5-3.3 3.3-3.3h3.4c1.8 0 3.3 1.5 3.3 3.3v.6a8 8 0 0 1-5 1.8ZM2 12a10 10 0 1 1 10 10A10 10 0 0 1 2 12Zm10-5a3.3 3.3 0 0 0-3.3 3.3c0 1.7 1.5 3.2 3.3 3.2 1.8 0 3.3-1.5 3.3-3.3C15.3 8.6 13.8 7 12 7Z","clip-rule":"evenodd"})],-1)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.message.instance.name),1)]),e$b.createElementVNode("div",_hoisted_20$1,[de[8]||(de[8]=e$b.createElementVNode("svg",{class:"mr-2 size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{d:"M8 4a2.6 2.6 0 0 0-2 .9 6.2 6.2 0 0 0-1.8 6 12 12 0 0 0 3.4 5.5 12 12 0 0 0 5.6 3.4 6.2 6.2 0 0 0 6.6-2.7 2.6 2.6 0 0 0-.7-3L18 12.9a2.7 2.7 0 0 0-3.8 0l-.6.6a.8.8 0 0 1-1.1 0l-1.9-1.8a.8.8 0 0 1 0-1.2l.6-.6a2.7 2.7 0 0 0 0-3.8L10 4.9A2.6 2.6 0 0 0 8 4Z"})],-1)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.message.instance.telephone),1)])])])):e$b.createCommentVNode("",!0),ee.message.sent_by?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_21$1,[de[11]||(de[11]=e$b.createElementVNode("div",{class:"flex items-center p-2 pl-3"},[e$b.createElementVNode("svg",{class:"mr-2 size-4 rotate-45","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2c.4 0 .8.3 1 .6l7 18a1 1 0 0 1-1.4 1.3L13 19.5V13a1 1 0 1 0-2 0v6.5L5.4 22A1 1 0 0 1 4 20.6l7-18a1 1 0 0 1 1-.6Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Remetente ")],-1)),de[12]||(de[12]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("div",_hoisted_22,[e$b.createVNode(Avatar,{class:"mr-4 size-10",size:"fill",photo:ee.message.sent_by.photo,name:ee.message.sent_by.name},null,8,["photo","name"]),e$b.createTextVNode(e$b.toDisplayString(ee.message.sent_by.name),1)])])):e$b.createCommentVNode("",!0)])}}},_hoisted_1$l={class:"h-full max-h-[500px] overflow-auto"},_hoisted_2$j={style:{"border-bottom-left-radius":"0px","border-bottom-right-radius":"0px"},class:"chat-background banner-zap"},_sfc_main$o={__name:"MessageQuickPreview",props:{message:{type:Array,default:()=>[]}},setup(ee){const te=ee,ne=useMessageUiStore();function ae(oe){var ue;const ie=ne.loggedAttendant,le={name:(ie==null?void 0:ie.name)||"Atendente",photo:(ie==null?void 0:ie.photo)||null},ce=new Date().toISOString(),de=(ue=oe.file_type)!=null&&ue.includes("/")?oe.file_type.split("/")[1]:oe.file_type;return{id:crypto.randomUUID(),type:oe.type||"text",stage:"sent",sent_by:{id:ie==null?void 0:ie.id,...le},content:{text:oe.message||"",is_ad:!1,sender:le,ad_info:null,url:oe.url||null,type:de||oe.type||null,title:oe.title||null,caption:oe.caption||null},whatsapp_id:null,status:!0,from_me:!0,created_at:ce,updated_at:ce,sent_at:ce,quoted:null}}const re=e$b.computed(()=>te.message.map(ae));return(oe,ie)=>(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_1$l,[e$b.createElementVNode("section",_hoisted_2$j,[ie[0]||(ie[0]=e$b.createElementVNode("div",{class:"bg-zap flex items-center justify-center"},null,-1)),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(re.value,(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:le.id,class:"pb-2"},[e$b.createVNode(_sfc_main$u,{"is-info":!0,message:le,"next-message":re.value[ce-1]},null,8,["message","next-message"])]))),128))])]))}},_hoisted_1$k={class:"sm-emoji-drawer-inline__crop"},DISMISS_RATIO=.28,DISMISS_VELOCITY=.6,DRAG_TOLERANCE=6,_sfc_main$n={__name:"EmojiPickerDrawer",props:{show:{type:Boolean,default:!1},theme:{type:String,default:"light"},categories:{type:Array,default:()=>EMOJI_CATEGORIES},inline:{type:Boolean,default:!1}},emits:["close","select"],setup(ee,{emit:te}){const ne=ee,ae=te;function re(Se){Se.key==="Escape"&&ne.show&&ae("close")}e$b.onMounted(()=>document.addEventListener("keydown",re)),e$b.onBeforeUnmount(()=>{document.removeEventListener("keydown",re),document.removeEventListener("pointerdown",oe,!0)});function oe(Se){!ne.inline||!ne.show||ie.value&&!ie.value.contains(Se.target)&&ae("close")}e$b.watch(()=>ne.show&&ne.inline,Se=>{document.removeEventListener("pointerdown",oe,!0),Se&&document.addEventListener("pointerdown",oe,!0)});const ie=e$b.ref(null),le=e$b.ref(!1),ce=e$b.ref(0);let de=null,ue=0,ve=0,me=0,ge=0,fe=0,pe=!1;function _e(Se){ie.value&&(de=Se.pointerId,ue=Se.clientY,me=Se.clientY,ge=Se.timeStamp,fe=0,pe=!1,ve=ie.value.offsetHeight,le.value=!0,Se.currentTarget.setPointerCapture(de))}function be(Se){if(!le.value||Se.pointerId!==de)return;const Le=Se.clientY-ue;Math.abs(Le)>DRAG_TOLERANCE&&(pe=!0),ce.value=Math.max(0,Le);const Ve=Se.timeStamp-ge;Ve>0&&(fe=(Se.clientY-me)/Ve),me=Se.clientY,ge=Se.timeStamp}function ke(Se){if(!le.value)return;le.value=!1;const Le=ce.value;if(ce.value=0,!Se)return;const Ve=ve>0&&Le>ve*DISMISS_RATIO,Te=fe>DISMISS_VELOCITY&&Le>12;(Ve||Te)&&ae("close")}function $e(Se){Se.pointerId===de&&ke(!0)}function ye(Se){Se.pointerId===de&&ke(!1)}function Ee(){if(pe){pe=!1;return}ae("close")}return(Se,Le)=>ee.inline?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["sm-emoji-drawer-inline",{"sm-emoji-drawer-inline--open":ee.show}])},[e$b.createElementVNode("div",_hoisted_1$k,[e$b.createElementVNode("div",{ref_key:"panelRef",ref:ie,class:e$b.normalizeClass(["sm-emoji-drawer sm-emoji-drawer--inline",{"sm-emoji-drawer--dark":ee.theme==="dark","sm-emoji-drawer--dragging":le.value}]),style:e$b.normalizeStyle(ce.value?{transform:`translateY(${ce.value}px)`}:null),role:"dialog","aria-label":"Seletor de emojis"},[e$b.createElementVNode("div",{class:"sm-emoji-drawer__handle",onPointerdown:_e,onPointermove:be,onPointerup:$e,onPointercancel:ye,onClick:Ee},[...Le[3]||(Le[3]=[e$b.createElementVNode("span",{class:"sm-emoji-drawer__handle-bar","aria-hidden":"true"},null,-1)])],32),e$b.createVNode(EmojiPicker,{theme:ee.theme,categories:ee.categories,onSelect:Le[0]||(Le[0]=Ve=>ae("select",Ve))},null,8,["theme","categories"])],6)])],2)):(e$b.openBlock(),e$b.createBlock(e$b.Teleport,{key:1,to:"body"},[e$b.createVNode(e$b.Transition,{name:"sm-emoji-drawer-fade"},{default:e$b.withCtx(()=>[ee.show?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:"sm-emoji-drawer__backdrop",onClick:Le[1]||(Le[1]=Ve=>ae("close"))})):e$b.createCommentVNode("",!0)]),_:1}),e$b.createVNode(e$b.Transition,{name:"sm-emoji-drawer-slide"},{default:e$b.withCtx(()=>[ee.show?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"panelRef",ref:ie,class:e$b.normalizeClass(["sm-emoji-drawer",{"sm-emoji-drawer--dark":ee.theme==="dark","sm-emoji-drawer--dragging":le.value}]),style:e$b.normalizeStyle(ce.value?{transform:`translateY(${ce.value}px)`}:null),role:"dialog","aria-label":"Seletor de emojis"},[e$b.createElementVNode("div",{class:"sm-emoji-drawer__handle",onPointerdown:_e,onPointermove:be,onPointerup:$e,onPointercancel:ye,onClick:Ee},[...Le[4]||(Le[4]=[e$b.createElementVNode("span",{class:"sm-emoji-drawer__handle-bar","aria-hidden":"true"},null,-1)])],32),e$b.createVNode(EmojiPicker,{theme:ee.theme,categories:ee.categories,onSelect:Le[2]||(Le[2]=Ve=>ae("select",Ve))},null,8,["theme","categories"])],6)):e$b.createCommentVNode("",!0)]),_:1})]))}},EmojiPickerDrawer=_export_sfc$1(_sfc_main$n,[["__scopeId","data-v-0bc491ca"]]),_sfc_main$m={__name:"GameProfileCard",props:{attendant:{type:Object,default:()=>({})},identity:{type:Object,default:null},editable:{type:Boolean,default:!1},embedded:{type:Boolean,default:!1},effectLevel:{type:String,default:"border",validator:ee=>["full","compact","border"].includes(ee)},progress:{type:Object,default:null}},emits:["edit"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.computed(()=>ne.identity||resolveAttendantGamification(ne.attendant));return(oe,ie)=>{var le,ce;return e$b.openBlock(),e$b.createBlock(GameIdentity,{variant:"card",name:((le=ee.attendant)==null?void 0:le.name)||"Atendente",photo:((ce=ee.attendant)==null?void 0:ce.photo)||"",level:re.value.level,frame:re.value.frame,title:re.value.title,achievement:re.value.achievement,progress:ee.progress,editable:ee.editable,embedded:ee.embedded,"effect-level":ee.effectLevel,onEdit:ie[0]||(ie[0]=de=>ae("edit"))},e$b.createSlots({_:2},[oe.$slots.footer?{name:"footer",fn:e$b.withCtx(()=>[e$b.renderSlot(oe.$slots,"footer")]),key:"0"}:void 0]),1032,["name","photo","level","frame","title","achievement","progress","editable","embedded","effect-level"])}}},_hoisted_1$j={class:"tabular-nums"},_sfc_main$l={__name:"AnimatedNumber",props:{value:{type:Number,default:0},duration:{type:Number,default:900},locale:{type:Boolean,default:!1},decimals:{type:Number,default:0}},setup(ee){const te=ee,ne=e$b.ref(0);let ae=null;function re(ie){const le=ne.value,ce=performance.now();cancelAnimationFrame(ae);const de=ue=>{const ve=Math.min(1,(ue-ce)/te.duration),me=1-Math.pow(1-ve,3);ne.value=le+(ie-le)*me,ve<1?ae=requestAnimationFrame(de):ne.value=ie};ae=requestAnimationFrame(de)}function oe(ie){const le=te.decimals?Number(ie.toFixed(te.decimals)):Math.round(ie);return te.locale?le.toLocaleString("pt-BR",{minimumFractionDigits:te.decimals,maximumFractionDigits:te.decimals}):te.decimals?le.toFixed(te.decimals):String(le)}return e$b.watch(()=>te.value,ie=>re(ie)),e$b.onMounted(()=>re(te.value)),e$b.onBeforeUnmount(()=>cancelAnimationFrame(ae)),(ie,le)=>(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_1$j,e$b.toDisplayString(oe(ne.value)),1))}},_hoisted_1$i={class:"sr-only"},_hoisted_2$i={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","aria-hidden":"true"},_hoisted_3$g={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","aria-hidden":"true"},_hoisted_4$f={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","aria-hidden":"true"},_sfc_main$k={__name:"TrendIndicator",props:{trend:{type:String,default:"flat",validator:ee=>["up","down","flat"].includes(ee)},variant:{type:String,default:"arrow",validator:ee=>["arrow","text"].includes(ee)}},setup(ee){const te=ee,ne={up:{text:"↑ Subindo",label:"Subiu de posição"},down:{text:"↓ Caindo",label:"Caiu de posição"},flat:{text:"→ Estável",label:"Posição estável"}},ae=e$b.computed(()=>ne[te.trend]||ne.flat);return(re,oe)=>ee.variant==="text"?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["trend-text",`trend--${ee.trend}`])},e$b.toDisplayString(ae.value.text),3)):(e$b.openBlock(),e$b.createElementBlock("span",{key:1,class:e$b.normalizeClass(["trend-chip",`trend--${ee.trend}`])},[e$b.createElementVNode("span",_hoisted_1$i,e$b.toDisplayString(ae.value.label),1),ee.trend==="up"?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$i,[...oe[0]||(oe[0]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6 15 6-6 6 6"},null,-1)])])):ee.trend==="down"?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$g,[...oe[1]||(oe[1]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6 9 6 6 6-6"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_4$f,[...oe[2]||(oe[2]=[e$b.createElementVNode("path",{"stroke-linecap":"round",d:"M6 12h12"},null,-1)])]))],2))}},TrendIndicator=_export_sfc$1(_sfc_main$k,[["__scopeId","data-v-4a8e687c"]]),_hoisted_1$h={class:"ranking-body"},_hoisted_2$h={class:"ranking-name"},_hoisted_3$f={key:1,class:"ranking-subtitle"},_hoisted_4$e={class:"ranking-points"},_hoisted_5$d={class:"ranking-points-value"},_sfc_main$j={__name:"RankingRow",props:{rank:{type:Number,default:null},rankSuffix:{type:String,default:""},name:{type:String,default:"Atendente"},photo:{type:String,default:""},level:{type:Number,default:null},frame:{type:Object,default:null},title:{type:Object,default:null},attendant:{type:Object,default:null},hoverPreview:{type:Boolean,default:!1},department:{type:String,default:""},showDepartment:{type:Boolean,default:!1},points:{type:Number,default:0},animate:{type:Boolean,default:!0},trend:{type:String,default:""},trendVariant:{type:String,default:"arrow",validator:ee=>["arrow","text"].includes(ee)},highlighted:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},avatarSize:{type:String,default:"sm"},effectLevel:{type:String,default:"compact",validator:ee=>["full","compact","border"].includes(ee)}},emits:["select"],setup(ee){const te=ee,ne=e$b.computed(()=>{if(te.title)return te.showDepartment&&te.department?te.department:"";const ae=[];return te.level!=null&&ae.push(`Nível ${te.level}`),te.showDepartment&&te.department&&ae.push(te.department),ae.join(" · ")});return(ae,re)=>(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.clickable?"button":"div"),{type:ee.clickable?"button":void 0,class:e$b.normalizeClass(["ranking-row",{"ranking-row--clickable":ee.clickable,"ranking-row--highlight":ee.highlighted,"smplay-hover-motion":ee.effectLevel!=="border"}]),"aria-label":ee.clickable?`Ver detalhes de ${ee.name}`:void 0,onClick:re[0]||(re[0]=oe=>ee.clickable&&ae.$emit("select"))},{default:e$b.withCtx(()=>[ee.rank!=null?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["ranking-rank",{"ranking-rank--highlight":ee.highlighted}])},e$b.toDisplayString(ee.rank)+e$b.toDisplayString(ee.rankSuffix),3)):e$b.createCommentVNode("",!0),ee.attendant?(e$b.openBlock(),e$b.createBlock(AttendantGameIdentity,{key:1,attendant:ee.attendant,variant:"list","avatar-size":ee.avatarSize,"effect-level":ee.effectLevel,frame:ee.frame??void 0,title:ee.title??void 0,"show-level":!0,"show-achievement":!1,"hover-preview":ee.hoverPreview,class:"ranking-identity"},null,8,["attendant","avatar-size","effect-level","frame","title","hover-preview"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:2},[e$b.createVNode(Avatar,{name:ee.name,photo:ee.photo,level:ee.level,frame:ee.frame,size:ee.avatarSize,"effect-level":ee.effectLevel,class:"ranking-avatar"},null,8,["name","photo","level","frame","size","effect-level"]),e$b.createElementVNode("span",_hoisted_1$h,[e$b.createElementVNode("span",_hoisted_2$h,e$b.toDisplayString(ee.name),1),ee.title?(e$b.openBlock(),e$b.createBlock(_sfc_main$28,{key:0,title:ee.title,size:"sm",class:"ranking-title"},null,8,["title"])):e$b.createCommentVNode("",!0),ne.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$f,e$b.toDisplayString(ne.value),1)):e$b.createCommentVNode("",!0)])],64)),ee.trend&&ee.trendVariant==="arrow"?(e$b.openBlock(),e$b.createBlock(TrendIndicator,{key:3,trend:ee.trend,variant:"arrow",class:"ranking-trend-chip"},null,8,["trend"])):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_4$e,[e$b.createElementVNode("strong",_hoisted_5$d,[ee.animate?(e$b.openBlock(),e$b.createBlock(_sfc_main$l,{key:0,value:ee.points,locale:""},null,8,["value"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(ee.points.toLocaleString("pt-BR")),1)],64))]),ee.trend&&ee.trendVariant==="text"?(e$b.openBlock(),e$b.createBlock(TrendIndicator,{key:0,trend:ee.trend,variant:"text"},null,8,["trend"])):e$b.createCommentVNode("",!0)])]),_:1},8,["type","class","aria-label"]))}},RankingRow=_export_sfc$1(_sfc_main$j,[["__scopeId","data-v-131d36ca"]]),_hoisted_1$g={class:"podium-empty"},_hoisted_2$g={class:"podium-empty-title"},_hoisted_3$e={class:"podium-empty-text"},_hoisted_4$d={class:"podium-cols podium-cols--ghost",style:{"--podium-cols":3},"aria-hidden":"true"},_hoisted_5$c={key:0,class:"podium-spotlight","aria-hidden":"true"},_hoisted_6$a={key:1,class:"podium-crown-slot","aria-hidden":"true"},_hoisted_7$a={key:0,class:"podium-crown",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_8$6={class:"podium-avatar-wrap"},_hoisted_9$4={key:0,class:"podium-aura","aria-hidden":"true"},_hoisted_10$4={key:3,class:"podium-dept"},_hoisted_11$4={class:"podium-points"},_hoisted_12$3=["aria-label"],_sfc_main$i={__name:"RankingPodium",props:{entries:{type:Array,default:()=>[]},showDepartment:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},animate:{type:Boolean,default:!0},effectLevel:{type:String,default:"full",validator:ee=>["full","compact","border"].includes(ee)},emptyTitle:{type:String,default:"Pódio ainda vazio"},emptyText:{type:String,default:"Os três primeiros aparecem assim que alguém pontuar."}},emits:["select"],setup(ee){const te=ee;function ne(ce,de){var ve;if(de==="border")return!1;const ue=(ve=resolveFrameVisual(ce.frame))==null?void 0:ve.ornament;return!!(ue!=null&&ue.enabled&&ue.variant==="crown")}const ae=e$b.computed(()=>{const[ce,de,ue]=te.entries;return(te.entries.length>=3?[de,ce,ue]:[ce,de]).filter(Boolean).map(me=>({...me,source:me,showCrown:me.rank===1&&!ne(me,te.effectLevel)}))}),re=e$b.computed(()=>te.effectLevel==="full"),oe=e$b.computed(()=>ae.value.length<3),ie=e$b.computed(()=>ae.value.length===0),le=[2,1,3];return(ce,de)=>(e$b.openBlock(),e$b.createElementBlock("section",{class:e$b.normalizeClass(["podium",{"podium--sparse":oe.value,"podium--empty":ie.value,"podium--lit":re.value}])},[de[5]||(de[5]=e$b.createElementVNode("div",{class:"podium-arena-glow","aria-hidden":"true"},null,-1)),ie.value?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[e$b.createElementVNode("div",_hoisted_1$g,[e$b.renderSlot(ce.$slots,"empty",{},()=>[e$b.createElementVNode("p",_hoisted_2$g,e$b.toDisplayString(ee.emptyTitle),1),e$b.createElementVNode("p",_hoisted_3$e,e$b.toDisplayString(ee.emptyText),1)],!0)]),e$b.createElementVNode("div",_hoisted_4$d,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(le,(ue,ve)=>e$b.createElementVNode("div",{key:ue,class:e$b.normalizeClass(["podium-col podium-col--ghost",`podium-col--${ue}`]),style:e$b.normalizeStyle({animationDelay:`${ve*110}ms`})},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-ghost-avatar",{"podium-ghost-avatar--first":ue===1}])},null,2),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-pedestal",`podium-pedestal--${ue}`]),style:e$b.normalizeStyle({animationDelay:`${ve*110+120}ms`})},[de[0]||(de[0]=e$b.createElementVNode("div",{class:"podium-pedestal-top"},null,-1)),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-medal",`podium-medal--${ue}`])},e$b.toDisplayString(ue),3)],6)],6)),64))])],64)):(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:"podium-cols",style:e$b.normalizeStyle({"--podium-cols":ae.value.length})},[de[4]||(de[4]=e$b.createElementVNode("div",{class:"podium-floor","aria-hidden":"true"},null,-1)),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae.value,(ue,ve)=>(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.clickable?"button":"div"),{key:ue.rank,type:ee.clickable?"button":void 0,class:e$b.normalizeClass(["podium-col",`podium-col--${ue.rank}`]),style:e$b.normalizeStyle({animationDelay:`${ve*110}ms`}),"aria-label":ee.clickable?`Ver detalhes de ${ue.name}`:void 0,onClick:me=>ee.clickable&&ce.$emit("select",ue.source)},{default:e$b.withCtx(()=>{var me;return[ue.rank===1&&re.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$c)):e$b.createCommentVNode("",!0),ue.rank===1?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6$a,[ue.showCrown?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_7$a,[...de[1]||(de[1]=[e$b.createElementVNode("path",{d:"M4.2 7.2a.7.7 0 0 1 1.1-.6l3.4 2.4a.7.7 0 0 0 1-.2l1.7-2.9a.7.7 0 0 1 1.2 0l1.7 2.9a.7.7 0 0 0 1 .2l3.4-2.4a.7.7 0 0 1 1.1.6l-1 7.1a1 1 0 0 1-1 .9H6.2a1 1 0 0 1-1-.9l-1-7.1Zm1.6 10a.8.8 0 0 1 .8-.8h10.8a.8.8 0 0 1 0 1.6H6.6a.8.8 0 0 1-.8-.8Z"},null,-1)])])):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_8$6,[ue.rank===1?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$4)):e$b.createCommentVNode("",!0),e$b.createVNode(Avatar,{name:ue.name,photo:ue.photo,level:ue.level,frame:ue.frame,scale:"app",size:ue.rank===1?"xl":"lg","effect-level":ee.effectLevel,class:"podium-avatar"},null,8,["name","photo","level","frame","size","effect-level"])]),e$b.createElementVNode("p",{class:e$b.normalizeClass(["podium-name",{"podium-name--first":ue.rank===1}])},e$b.toDisplayString(ue.name),3),ue.title?(e$b.openBlock(),e$b.createBlock(_sfc_main$28,{key:2,title:ue.title,size:"sm",class:"podium-title"},null,8,["title"])):e$b.createCommentVNode("",!0),ee.showDepartment&&((me=ue.department)!=null&&me.name)?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_10$4,e$b.toDisplayString(ue.department.name),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("p",_hoisted_11$4,[e$b.createElementVNode("span",{class:e$b.normalizeClass(["podium-points-value",`podium-points--${ue.rank}`])},[ee.animate?(e$b.openBlock(),e$b.createBlock(_sfc_main$l,{key:0,value:ue.points,locale:""},null,8,["value"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(ue.points.toLocaleString("pt-BR")),1)],64))],2),de[2]||(de[2]=e$b.createElementVNode("span",{class:"podium-points-unit"},"pts",-1)),ue.trend==="up"||ue.trend==="down"?(e$b.openBlock(),e$b.createBlock(TrendIndicator,{key:0,trend:ue.trend,class:"podium-trend"},null,8,["trend"])):e$b.createCommentVNode("",!0)]),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-pedestal",`podium-pedestal--${ue.rank}`]),style:e$b.normalizeStyle({animationDelay:`${ve*110+120}ms`})},[de[3]||(de[3]=e$b.createElementVNode("div",{class:"podium-pedestal-top","aria-hidden":"true"},null,-1)),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-medal",`podium-medal--${ue.rank}`]),"aria-label":`${ue.rank}º lugar`},e$b.toDisplayString(ue.rank),11,_hoisted_12$3)],6)]}),_:2},1032,["type","class","style","aria-label","onClick"]))),128))],4))],2))}},RankingPodium=_export_sfc$1(_sfc_main$i,[["__scopeId","data-v-5737213a"]]),_hoisted_1$f={class:"season-badge"},_hoisted_2$f={class:"season-dot-wrap"},_sfc_main$h={__name:"SeasonBadge",props:{label:{type:String,default:"Temporada"},status:{type:String,default:"live",validator:ee=>["live","paused","scheduled"].includes(ee)},daysLeft:{type:Number,default:null}},setup(ee){const te=ee,ne={live:{text:"Ao vivo"},paused:{text:"Pausada"},scheduled:{text:"Agendada"}},ae=e$b.computed(()=>ne[te.status]||ne.live);return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_1$f,[e$b.createElementVNode("span",_hoisted_2$f,[ee.status==="live"?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["season-ping",`season--${ee.status}`])},null,2)):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",{class:e$b.normalizeClass(["season-dot",`season--${ee.status}`])},null,2)]),e$b.createTextVNode(" "+e$b.toDisplayString(ee.label)+" ",1),oe[0]||(oe[0]=e$b.createElementVNode("span",{class:"season-divider","aria-hidden":"true"},null,-1)),e$b.createElementVNode("span",{class:e$b.normalizeClass(["season-status",`season--${ee.status}`])},[e$b.createTextVNode(e$b.toDisplayString(ae.value.text),1),ee.daysLeft!=null?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[e$b.createTextVNode(" · "+e$b.toDisplayString(ee.daysLeft)+" dias",1)],64)):e$b.createCommentVNode("",!0)],2)]))}},SeasonBadge=_export_sfc$1(_sfc_main$h,[["__scopeId","data-v-3fb77058"]]),_hoisted_1$e={class:"season-track-labels"},_hoisted_2$e={class:"season-track-edge"},_hoisted_3$d={class:"season-track-today"},_hoisted_4$c={class:"season-track-edge season-track-edge--end"},_hoisted_5$b={class:"track"},_hoisted_6$9={key:0,class:"today-contrail","aria-hidden":"true"},_hoisted_7$9={key:1,class:"today-runway","aria-hidden":"true"},_sfc_main$g={__name:"SeasonTrack",props:{startedLabel:{type:String,default:"—"},endsLabel:{type:String,default:"—"},todayText:{type:String,default:""},percent:{type:Number,default:0},rail:{type:String,default:"rgb(var(--primary-rgb))"},flying:{type:Boolean,default:!1}},setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:"season-track",style:e$b.normalizeStyle({"--rail":ee.rail})},[e$b.createElementVNode("div",_hoisted_1$e,[e$b.createElementVNode("span",_hoisted_2$e,[ne[0]||(ne[0]=e$b.createElementVNode("span",{class:"season-track-edge-label"},"Início",-1)),e$b.createTextVNode(e$b.toDisplayString(ee.startedLabel),1)]),e$b.createElementVNode("span",_hoisted_3$d,e$b.toDisplayString(ee.todayText),1),e$b.createElementVNode("span",_hoisted_4$c,[ne[1]||(ne[1]=e$b.createElementVNode("span",{class:"season-track-edge-label"},"Encerra",-1)),e$b.createTextVNode(e$b.toDisplayString(ee.endsLabel),1)])]),e$b.createElementVNode("div",_hoisted_5$b,[e$b.createElementVNode("div",{class:"fill",style:e$b.normalizeStyle({width:`${ee.percent}%`})},null,4),ne[3]||(ne[3]=e$b.createElementVNode("span",{class:"node start"},null,-1)),e$b.createElementVNode("span",{class:e$b.normalizeClass(["node end",{reached:ee.percent>=100}])},null,2),e$b.createElementVNode("span",{class:e$b.normalizeClass(["today",ee.flying?"flying":"landed"]),style:e$b.normalizeStyle({left:`${ee.percent}%`})},[ee.flying?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6$9)):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_7$9)),ne[2]||(ne[2]=e$b.createElementVNode("svg",{class:"today-plane",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M16 10h4a2 2 0 1 1 0 4h-4l-4 7H9l2-7H7l-2 2H2l1-4-1-4h3l2 2h4L9 3h3l4 7Z"})],-1))],6)])],4))}},SeasonTrack=_export_sfc$1(_sfc_main$g,[["__scopeId","data-v-332feaac"]]),_hoisted_1$d={class:"season-head"},_hoisted_2$d={class:"season-head-main"},_hoisted_3$c={class:"season-pill-mark"},_hoisted_4$b={key:0,class:"season-pill-plane",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},_hoisted_5$a={key:1,class:"season-pill-dot"},_hoisted_6$8={class:"season-name"},_hoisted_7$8={key:0,class:"season-description"},_hoisted_8$5={key:0,class:"season-actions"},_hoisted_9$3={key:0,class:"season-frozen"},_hoisted_10$3={class:"season-track-slot"},_hoisted_11$3={key:2,class:"season-tile-suffix"},_hoisted_12$2={class:"season-tile-label"},_sfc_main$f={__name:"SeasonCard",props:{season:{type:Object,default:null},tiles:{type:Array,default:()=>[]}},setup(ee){const te=ee,ne=e$b.computed(()=>{var pe;return((pe=te.season)==null?void 0:pe.status)??"scheduled"}),ae=e$b.computed(()=>ne.value==="active"),re=e$b.computed(()=>ne.value==="paused"),oe=e$b.computed(()=>ne.value==="scheduled"),ie={active:{label:"Ativa",rail:"var(--color-state-success, rgb(var(--success-rgb, 34 197 94)))"},paused:{label:"Pausada",rail:"var(--color-state-warning, rgb(var(--warning-rgb, 245 158 11)))"},scheduled:{label:"Agendada",rail:"rgb(var(--bg-base-100) / 0.7)"}},le=e$b.computed(()=>ie[ne.value]??ie.scheduled),ce=e$b.computed(()=>{var pe;return((pe=te.season)==null?void 0:pe.duration_days)||1}),de=e$b.computed(()=>{var pe;return Math.max(0,((pe=te.season)==null?void 0:pe.days_left)||0)}),ue=e$b.computed(()=>Math.max(0,ce.value-de.value)),ve=e$b.computed(()=>!te.season||oe.value?0:Math.min(100,Math.round(ue.value/ce.value*100))),me=e$b.computed(()=>Math.min(ce.value,Math.max(1,ue.value))),ge=e$b.computed(()=>oe.value?"Ainda não começou":`${re.value?"Pausada":"Hoje"} · dia ${me.value} de ${ce.value}`),fe=e$b.computed(()=>[{value:oe.value?ce.value:de.value,suffix:"dias",label:oe.value?"de duração":"restantes",tone:"status"},...te.tiles]);return(pe,_e)=>ee.season?(e$b.openBlock(),e$b.createElementBlock("section",{key:0,class:"season-card",style:e$b.normalizeStyle({"--rail":le.value.rail})},[e$b.createElementVNode("header",_hoisted_1$d,[e$b.createElementVNode("div",_hoisted_2$d,[e$b.createElementVNode("span",{class:e$b.normalizeClass(["season-pill",`season-pill--${ne.value}`])},[e$b.createElementVNode("span",_hoisted_3$c,[ae.value?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_4$b,[..._e[0]||(_e[0]=[e$b.createElementVNode("path",{d:"M16 10h4a2 2 0 1 1 0 4h-4l-4 7H9l2-7H7l-2 2H2l1-4-1-4h3l2 2h4L9 3h3l4 7Z"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$a))]),e$b.createTextVNode(" "+e$b.toDisplayString(le.value.label),1)],2),e$b.createElementVNode("h3",_hoisted_6$8,e$b.toDisplayString(ee.season.name),1),ee.season.description?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$8,e$b.toDisplayString(ee.season.description),1)):e$b.createCommentVNode("",!0)]),pe.$slots.actions?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$5,[e$b.renderSlot(pe.$slots,"actions",{},void 0,!0)])):e$b.createCommentVNode("",!0)]),re.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$3,[..._e[1]||(_e[1]=[e$b.createElementVNode("svg",{class:"season-frozen-icon",fill:"none",stroke:"currentColor","stroke-width":"1.8",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v18M5 8l14 8M19 8 5 16"})],-1),e$b.createElementVNode("p",{class:"season-frozen-text"},[e$b.createElementVNode("strong",null,"Pontuação congelada."),e$b.createTextVNode(" Ninguém ganha ou perde pontos enquanto pausada — o prazo de encerramento também para. ")],-1)])])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_10$3,[e$b.createVNode(SeasonTrack,{"started-label":ee.season.started_label||"—","ends-label":ee.season.ends_label||"—","today-text":ge.value,percent:ve.value,rail:le.value.rail,flying:ae.value},null,8,["started-label","ends-label","today-text","percent","rail","flying"])]),e$b.createElementVNode("div",{class:"season-tiles",style:e$b.normalizeStyle({"--tiles":fe.value.length})},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(fe.value,be=>(e$b.openBlock(),e$b.createElementBlock("div",{key:be.label,class:"season-tile"},[e$b.createElementVNode("p",{class:e$b.normalizeClass(["season-tile-value",{"season-tile-value--status":be.tone==="status"}])},[typeof be.value=="number"?(e$b.openBlock(),e$b.createBlock(_sfc_main$l,{key:0,value:be.value},null,8,["value"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(be.value),1)],64)),be.suffix?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_11$3,e$b.toDisplayString(be.suffix),1)):e$b.createCommentVNode("",!0)],2),e$b.createElementVNode("p",_hoisted_12$2,e$b.toDisplayString(be.label),1)]))),128))],4),e$b.renderSlot(pe.$slots,"default",{},void 0,!0)],4)):e$b.createCommentVNode("",!0)}},SeasonCard=_export_sfc$1(_sfc_main$f,[["__scopeId","data-v-56ca9db3"]]),MONTHS_ABBR=["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"];function seasonDayLabel(ee){const[te,ne,ae]=String(ee).slice(0,10).split("-").map(Number);return`${ae} ${MONTHS_ABBR[ne-1]} ${te}`}function normalizeSeason(ee){return!ee||typeof ee!="object"||!ee.id&&!ee.started_at&&!ee.ends_at?null:{...ee,name:ee.name??"",description:ee.description??"",duration_days:ee.duration_days??1,started_label:ee.started_at?seasonDayLabel(ee.started_at):ee.started_label??"—",ends_label:ee.ends_at?seasonDayLabel(ee.ends_at):ee.ends_label??"—",period_label:ee.started_at&&ee.ends_at?`${seasonDayLabel(ee.started_at)} – ${seasonDayLabel(ee.ends_at)}`:ee.period_label??""}}const AVATAR_TONES=["bg-blue-500/20 text-blue-200 ring-blue-400/25","bg-pink-500/20 text-pink-200 ring-pink-400/25","bg-emerald-500/20 text-emerald-200 ring-emerald-400/25","bg-amber-500/20 text-amber-200 ring-amber-400/25","bg-violet-500/20 text-violet-200 ring-violet-400/25"];function buildRanking(ee=[],{tieBreak:te="name"}={}){return ee.slice().sort((ne,ae)=>(ae.points??0)-(ne.points??0)||String(ne[te]??"").localeCompare(String(ae[te]??""))).map((ne,ae)=>{const re=ae+1;return{...ne,rank:re,tone:AVATAR_TONES[(re-1)%AVATAR_TONES.length],ref:ne}})}function podiumOrder(ee=[]){const[te,ne,ae]=ee;return[ne,te,ae].filter(Boolean)}function attendantSeasonPoints(ee){var ne;const te=(ee==null?void 0:ee.gamification)??(ee==null?void 0:ee.game_profile)??{};return Number(((ne=te.season)==null?void 0:ne.points)??te.season_points??0)}function belongsToDepartment(ee,te){return(Array.isArray(ee==null?void 0:ee.department)?ee.department:[]).some(ae=>String(ae==null?void 0:ae.id)===String(te))}function compareRankEntries(ee,te){return te.level-ee.level||te.points-ee.points||String(ee.name??"").localeCompare(String(te.name??""))}function unlockedLabel(ee,{short:te=!1}={}){const ne="Desbloqueado";if(!ee)return ne;const ae=new Date(ee);return Number.isNaN(ae.getTime())?ne:te?`Desde ${ae.toLocaleDateString("pt-BR")}`:`Desbloqueado em ${ae.toLocaleDateString("pt-BR",{day:"2-digit",month:"short",year:"numeric"})}`}const _sfc_main$e={__name:"CosmeticRequirements",props:{item:{type:Object,required:!0},kind:{type:String,default:null},mode:{type:String,default:"attendant"},attendantName:{type:String,default:""},requirement:{type:Object,default:null},unlocked:{type:Boolean,default:!1},unlockedAt:{type:[String,Number,Date],default:null},selected:{type:Boolean,default:!1},selectedLabel:{type:String,default:"Equipado"}},setup(ee){const te=ee,ne=e$b.computed(()=>te.kind||te.item.type),ae=e$b.computed(()=>ne.value==="title"),re=e$b.computed(()=>te.mode==="catalog"),oe=e$b.computed(()=>{var ue;return te.unlocked||re.value?null:((ue=te.requirement)==null?void 0:ue.progress)??null}),ie=e$b.computed(()=>re.value?"Como é obtido":te.unlocked?"Como você obteve":"Como desbloquear"),le=e$b.computed(()=>({frame:"Moldura",title:"Título",achievement:"Destaque"})[ne.value]||"Item"),ce=e$b.computed(()=>te.selected?[{label:te.selectedLabel,class:"font-black text-primary"}]:[]),de=e$b.computed(()=>re.value?null:te.unlocked?{label:unlockedLabel(te.unlockedAt),class:"text-success"}:{label:"Bloqueado"});return(ue,ve)=>{var me,ge,fe,pe;return e$b.openBlock(),e$b.createBlock(UnlockHint,{class:"cosmetic-requirements",eyebrow:le.value,name:ee.item.name||"Sem nome","block-label":ie.value,text:((me=ee.requirement)==null?void 0:me.text)||((ge=ee.requirement)==null?void 0:ge.label)||"Requisito não informado.",note:((fe=ee.requirement)==null?void 0:fe.note)||"",unit:((pe=ee.requirement)==null?void 0:pe.unit)||"",progress:oe.value,pills:ce.value,status:de.value},e$b.createSlots({piece:e$b.withCtx(()=>[ne.value==="frame"?(e$b.openBlock(),e$b.createBlock(Avatar,{key:0,name:ee.attendantName,frame:ee.item,"show-level":!1,"frame-only":"",size:"md","effect-level":"full"},null,8,["name","frame"])):ne.value==="achievement"?(e$b.openBlock(),e$b.createBlock(_sfc_main$29,{key:1,achievement:ee.item,size:"md"},null,8,["achievement"])):e$b.createCommentVNode("",!0)]),_:2},[ae.value?{name:"name",fn:e$b.withCtx(()=>[e$b.createVNode(_sfc_main$28,{title:ee.item,size:"lg",align:"start",tooltip:!1,class:"mt-1.5"},null,8,["title"])]),key:"0"}:void 0]),1032,["eyebrow","name","block-label","text","note","unit","progress","pills","status"])}}},_hoisted_1$c={class:"min-w-0 flex-1"},_hoisted_2$c={class:"truncate"},_hoisted_3$b={class:"flex shrink-0 items-center"},_hoisted_4$a=["aria-label"],_hoisted_5$9={key:1,class:"grid place-items-center rounded-full bg-base-100 p-1.5 ring-1 ring-base-200","aria-label":"Item bloqueado"},_hoisted_6$7={class:"truncate"},_hoisted_7$7={key:2,class:"absolute inset-0 grid place-items-center rounded-[inherit] bg-base-300/70 backdrop-blur-[1px]","aria-live":"polite"},_hoisted_8$4={class:"sm-hover-panel-face"},_sfc_main$d={__name:"CosmeticCard",props:{item:{type:Object,required:!0},kind:{type:String,default:null},mode:{type:String,default:"catalog"},attendantName:{type:String,default:""},density:{type:String,default:"comfortable",validator:ee=>["comfortable","compact","tight"].includes(ee)},caption:{type:String,default:""},captionTone:{type:String,default:"muted",validator:ee=>["muted","primary","success"].includes(ee)},captionDot:{type:String,default:""},locked:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},selectedLabel:{type:String,default:"Equipado"},busy:{type:Boolean,default:!1},denied:{type:Boolean,default:!1},interactive:{type:Boolean,default:!0},enterDelay:{type:Number,default:0},hoverRequirements:{type:Boolean,default:!1},requirement:{type:Object,default:null},hoverDelay:{type:Number,default:240},unlockedAt:{type:[String,Number,Date],default:null}},emits:["select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.useAttrs(),oe={comfortable:{root:"",stage:"min-h-28 p-4",badge:"size-6",footer:"p-3",name:"text-sm",caption:"mt-1 text-[11px]",avatar:"md",token:"md",plaque:"min-h-[4.5rem] bg-base-200/80 gap-3 py-3.5 pl-3.5 pr-3",plaqueTitle:"xl",plaqueCaption:"text-[11px]",plaqueLabel:!0},compact:{root:"min-h-32",stage:"min-h-24 p-3",badge:"size-5",footer:"p-2 text-center",name:"text-[12px] font-medium leading-tight",caption:"justify-center text-[10.5px]",avatar:"md",token:"md",plaque:"min-h-16 gap-2.5 py-3 pl-3 pr-2.5",plaqueTitle:"lg",plaqueCaption:"text-[10.5px]",plaqueLabel:!0},tight:{root:"",stage:"min-h-16 p-2",badge:"size-5",footer:"px-2 py-2 text-center",name:"text-[13px] font-semibold leading-tight",caption:"mt-0.5 justify-center text-[11px] leading-tight",avatar:"sm",token:"md",plaque:"min-h-14 gap-2 py-2.5 pl-2.5 pr-2",plaqueTitle:"lg",plaqueCaption:"text-[11px] leading-tight",plaqueLabel:!1}},ie=e$b.computed(()=>ne.kind||ne.item.type),le=e$b.computed(()=>ie.value==="title"),ce=e$b.computed(()=>oe[ne.density]||oe.comfortable),de=e$b.computed(()=>ne.interactive&&!ne.busy),ue=e$b.computed(()=>({primary:"text-primary",success:"text-success",muted:"text-base-content/55"})[ne.captionTone]),ve=e$b.computed(()=>["plate cosmetic-plate p-px",le.value?"":"cosmetic-plate--niche",me.value?"cosmetic-plate--lit":"",ne.selected?"is-selected":"",ne.locked?"opacity-75 brightness-[0.78] saturate-[0.5]":"",ie.value==="frame"?"smplay-hover-motion":""]),me=e$b.computed(()=>{var Re;if(ie.value!=="frame")return null;const ze=(Re=resolveFrameVisual(ne.item))==null?void 0:Re.ring.colors;return ze!=null&&ze[0]?ze:null}),ge=e$b.computed(()=>{const ze=ne.enterDelay?{animationDelay:`${ne.enterDelay}ms`}:{};if(!me.value)return ze;const[Re,Oe=Re]=me.value;return{...ze,"--frame-accent":Re,"--frame-accent-soft":Oe}}),fe=e$b.computed(()=>{var Re,Oe;if(me.value){const[Pe,Be=Pe]=me.value;return{"--panel-accent":Pe,"--panel-accent-soft":Be}}const ze=(Oe=RARITIES[(Re=ne.item)==null?void 0:Re.rarity])==null?void 0:Oe.accentRgb;return ze?{"--panel-accent":`rgb(${ze})`}:{}}),pe=e$b.computed(()=>{if(ne.hoverRequirements)return;if(re.title)return re.title;const ze=[ne.item.name,ne.caption];return ne.selected&&ne.selectedLabel&&ze.push(ne.selectedLabel),ze.filter(Boolean).join(" — ")}),_e=e$b.computed(()=>ne.hoverRequirements),be=e$b.computed(()=>ne.hoverDelay),{triggerRef:ke,open:$e,panelStyle:ye,placement:Ee,scheduleOpen:Se,scheduleClose:Le,closeNow:Ve}=useHoverPanel({enabled:_e,delay:be,width:320});function Te(){Ve(),de.value&&ae("select",ne.item)}return(ze,Re)=>(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.interactive?"button":"article"),{ref_key:"triggerRef",ref:ke,type:ee.interactive?"button":void 0,disabled:ee.interactive?ee.busy:void 0,"aria-pressed":ee.interactive?ee.selected:void 0,"aria-disabled":ee.locked||void 0,title:pe.value,style:e$b.normalizeStyle(ge.value),class:e$b.normalizeClass(["cosmetic-card relative flex flex-col text-left",ve.value,le.value?"":ce.value.root,ee.denied?"shake-denied":"",de.value&&!ee.locked?"cursor-pointer ":"",ee.locked?"is-locked cursor-not-allowed":""]),onMouseenter:e$b.unref(Se),onMouseleave:e$b.unref(Le),onClick:Te},{default:e$b.withCtx(()=>[le.value?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["flex w-full items-center",ce.value.plaque])},[e$b.createElementVNode("span",_hoisted_1$c,[e$b.createVNode(_sfc_main$28,{title:ee.item,size:ce.value.plaqueTitle,align:"start",tooltip:!1},null,8,["title","size"]),ee.caption?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["mt-1 flex min-w-0 items-center gap-1.5",[ce.value.plaqueCaption,ue.value]])},[ee.captionDot?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["size-1.5 shrink-0 rounded-full",ee.captionDot]),"aria-hidden":"true"},null,2)):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_2$c,e$b.toDisplayString(ee.caption),1)],2)):e$b.createCommentVNode("",!0),e$b.renderSlot(ze.$slots,"caption",{},void 0,!0)]),e$b.createElementVNode("span",_hoisted_3$b,[ee.selected?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["inline-flex items-center gap-1 rounded-full bg-primary/15 font-bold text-primary",ce.value.plaqueLabel?"px-2 py-1 text-[10px] uppercase tracking-wide":"p-1"]),"aria-label":ee.selectedLabel},[Re[2]||(Re[2]=e$b.createElementVNode("svg",{class:"size-3 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"3",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5 13 4 4L19 7"})],-1)),ce.value.plaqueLabel?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[e$b.createTextVNode(e$b.toDisplayString(ee.selectedLabel),1)],64)):e$b.createCommentVNode("",!0)],10,_hoisted_4$a)):ee.locked?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$9,[...Re[3]||(Re[3]=[e$b.createElementVNode("svg",{class:"size-3 text-base-content/60",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5Zm-3 8V7a3 3 0 1 1 6 0v3H9Z"})],-1)])])):e$b.renderSlot(ze.$slots,"badge",{key:2},void 0,!0)])],2)):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["plate-stage relative grid flex-1 place-items-center",[ce.value.stage,ee.locked?"opacity-55 grayscale-[25%]":""]])},[ie.value==="frame"?(e$b.openBlock(),e$b.createBlock(Avatar,{key:0,name:ee.attendantName,frame:ee.item,"show-level":!1,"frame-only":"",size:ce.value.avatar,"effect-level":"compact"},null,8,["name","frame","size"])):(e$b.openBlock(),e$b.createBlock(_sfc_main$29,{key:1,achievement:ee.item,size:ce.value.token},null,8,["achievement","size"])),ee.locked?(e$b.openBlock(),e$b.createElementBlock("span",{key:2,class:e$b.normalizeClass(["absolute right-2 top-2 grid place-items-center rounded-full bg-base-100 ring-1 ring-base-200",ce.value.badge]),"aria-label":"Item bloqueado"},[...Re[4]||(Re[4]=[e$b.createElementVNode("svg",{class:"size-3 text-base-content/60",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5Zm-3 8V7a3 3 0 1 1 6 0v3H9Z"})],-1)])],2)):ee.selected?(e$b.openBlock(),e$b.createElementBlock("span",{key:3,class:e$b.normalizeClass(["absolute right-2 top-2 grid place-items-center rounded-full bg-primary text-white ring-2 ring-base-300",ce.value.badge]),"aria-label":"Equipado"},[...Re[5]||(Re[5]=[e$b.createElementVNode("svg",{class:"size-3",fill:"none",stroke:"currentColor","stroke-width":"3",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5 13 4 4L19 7"})],-1)])],2)):e$b.renderSlot(ze.$slots,"badge",{key:4},void 0,!0)],2),e$b.createElementVNode("span",{class:e$b.normalizeClass(["plate-cut-bottom block border-t border-base-200 bg-base-200/70",ce.value.footer])},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["block truncate font-semibold",ce.value.name])},e$b.toDisplayString(ee.item.name),3),ee.selected&&ee.selectedLabel?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["flex items-center gap-1 font-semibold text-primary",ce.value.caption])},[Re[6]||(Re[6]=e$b.createElementVNode("svg",{class:"size-3 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"2.5",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5 13 4 4L19 7"})],-1)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.selectedLabel),1)],2)):ee.caption?(e$b.openBlock(),e$b.createElementBlock("span",{key:1,class:e$b.normalizeClass(["flex min-w-0 items-center gap-1.5",[ce.value.caption,ue.value]])},[ee.captionDot?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["size-1.5 shrink-0 rounded-full",ee.captionDot]),"aria-hidden":"true"},null,2)):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_6$7,e$b.toDisplayString(ee.caption),1)],2)):e$b.createCommentVNode("",!0),e$b.renderSlot(ze.$slots,"caption",{},void 0,!0)],2)],64)),ee.busy?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_7$7,[...Re[7]||(Re[7]=[e$b.createElementVNode("svg",{class:"size-6 animate-spin text-primary",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4Z"})],-1)])])):e$b.createCommentVNode("",!0),ee.hoverRequirements?(e$b.openBlock(),e$b.createBlock(e$b.Teleport,{key:3,to:"body"},[e$b.createVNode(e$b.Transition,{name:"sm-hover-panel"},{default:e$b.withCtx(()=>[e$b.unref($e)?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["sm-hover-panel",`sm-hover-panel--${e$b.unref(Ee)}`]),style:e$b.normalizeStyle([e$b.unref(ye),fe.value]),onMouseenter:Re[0]||(Re[0]=(...Oe)=>e$b.unref(Se)&&e$b.unref(Se)(...Oe)),onMouseleave:Re[1]||(Re[1]=(...Oe)=>e$b.unref(Le)&&e$b.unref(Le)(...Oe))},[e$b.createElementVNode("div",_hoisted_8$4,[e$b.createVNode(_sfc_main$e,{item:ee.item,kind:ie.value,mode:ee.mode,"attendant-name":ee.attendantName,requirement:ee.requirement,unlocked:!ee.locked,"unlocked-at":ee.unlockedAt,selected:ee.selected,"selected-label":ee.selectedLabel},null,8,["item","kind","mode","attendant-name","requirement","unlocked","unlocked-at","selected","selected-label"])])],38)):e$b.createCommentVNode("",!0)]),_:1})])):e$b.createCommentVNode("",!0)]),_:3},40,["type","disabled","aria-pressed","aria-disabled","title","style","class","onMouseenter","onMouseleave"]))}},CosmeticCard=_export_sfc$1(_sfc_main$d,[["__scopeId","data-v-d4d004b5"]]),_hoisted_1$b={class:"flex flex-col items-center gap-2 rounded-2xl border border-dashed border-base-100/20 bg-base-200/40 p-8 text-center"},_hoisted_2$b={class:"size-8 text-base-content/35",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},_hoisted_3$a=["d"],_hoisted_4$9={class:"text-sm font-bold"},_hoisted_5$8={class:"text-xs text-base-content/50"},_hoisted_6$6={key:0,class:"mt-1 text-[11px] leading-relaxed text-base-content/35"},_hoisted_7$6={key:1,class:"mt-2 flex flex-wrap items-center justify-center gap-2"},_sfc_main$c={__name:"EmptyState",props:{icon:{type:String,default:"empty"},title:{type:String,default:""},subtitle:{type:String,default:""},flavor:{type:String,default:""}},setup(ee){const te=ee,ne={empty:["M3 14h4l1.5 2.5h7L17 14h4","M5 5.5 3 14v3.5A1.5 1.5 0 0 0 4.5 19h15a1.5 1.5 0 0 0 1.5-1.5V14l-2-8.5A1.5 1.5 0 0 0 17.5 4h-11A1.5 1.5 0 0 0 5 5.5Z"],ledger:["M6 3h9l4 4v12.5a1.5 1.5 0 0 1-2.17 1.35L15 20l-1.83.85a1.5 1.5 0 0 1-1.34 0L10 20l-1.83.85A1.5 1.5 0 0 1 6 19.5Z","M14 3v4h5","M9 10h7","M9 14h5"],locked:["M6 11h12a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1Z","M8.5 11V8a3.5 3.5 0 0 1 7 0v3","M12 15v2"],sparkle:["M12 3.5l1.7 4.3 4.3 1.7-4.3 1.7L12 15.5l-1.7-4.3L6 9.5l4.3-1.7Z","M18 15.5l.85 2.15L21 18.5l-2.15.85L18 21.5l-.85-2.15L15 18.5l2.15-.85Z"]},ae=()=>ne[te.icon]||ne.empty;return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$b,[e$b.renderSlot(re.$slots,"icon",{},()=>[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$b,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae(),ie=>(e$b.openBlock(),e$b.createElementBlock("path",{key:ie,d:ie},null,8,_hoisted_3$a))),128))]))]),e$b.createElementVNode("p",_hoisted_4$9,e$b.toDisplayString(ee.title),1),e$b.createElementVNode("p",_hoisted_5$8,[e$b.renderSlot(re.$slots,"default",{},()=>[e$b.createTextVNode(e$b.toDisplayString(ee.subtitle),1)])]),ee.flavor?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_6$6,e$b.toDisplayString(ee.flavor),1)):e$b.createCommentVNode("",!0),re.$slots.actions?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$6,[e$b.renderSlot(re.$slots,"actions")])):e$b.createCommentVNode("",!0)]))}},_hoisted_1$a=["role","aria-label"],_hoisted_2$a=["role","aria-selected","aria-pressed","onClick"],_hoisted_3$9={key:0,class:"size-4 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24","aria-hidden":"true"},_hoisted_4$8=["d"],_hoisted_5$7={key:1,class:"ml-1 tabular-nums opacity-70"},_sfc_main$b={__name:"PillTabs",props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},ariaLabel:{type:String,default:""},layout:{type:String,default:"grid"},size:{type:String,default:"sm"},tone:{type:String,default:"primary",validator:ee=>["primary","neutral"].includes(ee)},role:{type:String,default:"tablist",validator:ee=>["tablist","buttons"].includes(ee)},icon:{type:Boolean,default:!1},wrap:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(ee){const te=ee,ne=e$b.computed(()=>te.role==="tablist"),ae=e$b.computed(()=>te.layout==="row"?null:{gridTemplateColumns:`repeat(${te.options.length}, minmax(0, 1fr))`});return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["pill-tabs rounded-xl bg-base-200/80 p-0.5",[ee.layout==="row"?"inline-flex gap-1":"pill-tabs--fluid grid gap-1",ee.wrap?"flex-wrap":""]]),style:e$b.normalizeStyle(ae.value),role:ne.value?"tablist":void 0,"aria-label":ee.ariaLabel||void 0},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ee.options,ie=>(e$b.openBlock(),e$b.createElementBlock("button",{key:ie.key,type:"button",role:ne.value?"tab":void 0,"aria-selected":ne.value?ee.modelValue===ie.key:void 0,"aria-pressed":ne.value?void 0:ee.modelValue===ie.key,class:e$b.normalizeClass(["min-w-0 whitespace-nowrap rounded-lg font-semibold transition-all duration-200",ee.icon?"inline-flex items-center gap-2":"",ee.size==="md"?"pill-tabs__tab--md px-3.5 py-2 text-sm active:scale-95":"px-2 py-2 text-xs",ee.modelValue===ie.key?ee.tone==="neutral"?"bg-base-100 text-base-content":"bg-primary text-white":"text-base-content/80 hover:text-base-content"]),onClick:le=>re.$emit("update:modelValue",ie.key)},[ee.icon&&ie.icon?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$9,[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:ie.icon},null,8,_hoisted_4$8)])):e$b.createCommentVNode("",!0),e$b.createTextVNode(" "+e$b.toDisplayString(ie.label)+" ",1),ie.count!=null?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$7,e$b.toDisplayString(ie.count),1)):e$b.createCommentVNode("",!0)],10,_hoisted_2$a))),128))],14,_hoisted_1$a))}},PillTabs=_export_sfc$1(_sfc_main$b,[["__scopeId","data-v-8c7af052"]]),FLAVOR={loading:["Ninguém compra moldura aqui. Só conquista.","A temporada leva os pontos. Seu nível fica.","Tudo que brilha no seu avatar foi merecido.","O placar reinicia. Sua coleção não.","Todo ponto tem origem — e ela está no extrato.","Título não se herda. Se ganha.","A disputa é dentro do seu departamento.","Você veste o que quiser — do que já é seu."],"collection-empty":["Vitrine vazia. Por enquanto.","Aqui só entra o que você arrancou.","O primeiro item é sempre o mais difícil.","Nada aqui se compra. Nada aqui se perde."],"achievements-empty":["Nenhuma no bolso. Todas ainda em jogo.","Cada card diz como cair. Escolha um alvo.","As secretas não avisam. Elas caem.","Ninguém começa com a estante cheia."],"ledger-empty":["Nada lançado ainda. O placar começa limpo.","Cada ponto vai aparecer aqui com nome e origem.","Estorno não some do extrato: vira linha nova.","O que o gestor ajusta também passa por aqui."]},cursors=new Map,FLAVOR_CONTEXTS=Object.keys(FLAVOR);function pickFlavor(ee,te){const ne=FLAVOR[ee];if(!(ne!=null&&ne.length))return"";if(Number.isFinite(te))return ne[(te%ne.length+ne.length)%ne.length];const ae=(cursors.get(ee)??-1)+1;return cursors.set(ee,ae),ne[ae%ne.length]}const _hoisted_1$9={class:"cosmetic-grid flex min-h-0 flex-col gap-3"},_hoisted_2$9={key:0,class:"flex shrink-0 flex-wrap items-center gap-2.5"},_hoisted_3$8={key:0,class:"flex h-11 min-w-48 flex-1 items-center gap-2.5 rounded-lg border border-base-200 bg-base-200 px-3 transition-colors focus-within:border-primary/60 focus-within:ring-2 focus-within:ring-primary/15"},_hoisted_4$7=["aria-label"],_hoisted_5$6={key:1,class:"flex min-h-56 flex-1 items-center justify-center py-10","aria-busy":"true"},_hoisted_6$5={key:0,class:"flex items-center gap-2"},_hoisted_7$5={class:"text-[11px] tabular-nums leading-none text-base-content/60"},_sfc_main$a={__name:"CosmeticGrid",props:{items:{type:Array,required:!0},kind:{type:String,default:null},attendantName:{type:String,default:""},density:{type:String,default:"comfortable"},layout:{type:String,default:null},loading:{type:Boolean,default:!1},selectedId:{type:[String,Number],default:null},busyId:{type:[String,Number],default:null},deniedId:{type:[String,Number],default:null},selectedLabel:{type:String,default:"Equipado"},searchable:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},groupByRarity:{type:Boolean,default:!1},cascade:{type:Boolean,default:!1},noun:{type:String,default:"item"},scroll:{type:Boolean,default:!1}},emits:["select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=[{key:"all",label:"Todos"},{key:"unlocked",label:"Desbloqueados"},{key:"locked",label:"Bloqueados"}],oe=e$b.ref("all"),ie=e$b.ref(""),le=e$b.computed(()=>(ne.layout||(ce()==="title"?"plaques":"tiles"))==="plaques"?"smplay-grid-3":"smplay-grid-tiles");function ce(){var $e;return ne.kind||(($e=ne.items[0])==null?void 0:$e.type)||null}const de=e$b.computed(()=>{const $e=ne.items.length,ye=ne.items.filter(Se=>Se.unlocked).length,Ee={all:$e,unlocked:ye,locked:$e-ye};return re.map(Se=>({...Se,count:Ee[Se.key]}))});function ue($e){return String($e||"").normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase()}const ve=e$b.computed(()=>{let $e=ne.items;if(ne.filterable&&oe.value!=="all"){const Ee=oe.value==="unlocked";$e=$e.filter(Se=>!!Se.unlocked===Ee)}const ye=ue(ie.value.trim());return!ne.searchable||!ye?$e:$e.filter(Ee=>ue(Ee.name).includes(ye)||ue(Ee.requirementLabel).includes(ye))}),me=Object.values(RARITIES).sort(($e,ye)=>$e.order-ye.order).map($e=>$e.key),ge=e$b.computed(()=>{const $e=ve.value;if(!ne.groupByRarity)return $e.length?[{key:"all",meta:null,offset:0,items:$e}]:[];const ye=[];let Ee=0;for(const Se of me){const Le=$e.filter(Ve=>Ve.rarity===Se);Le.length&&(ye.push({key:Se,meta:RARITIES[Se],offset:Ee,items:Le}),Ee+=Le.length)}return ye});function fe($e,ye){return ne.cascade?Math.min(($e.offset+ye)*30,300):0}const pe=pickFlavor("loading"),_e=pickFlavor("collection-empty"),be=e$b.computed(()=>ie.value||oe.value!=="all"?"":_e),ke=e$b.computed(()=>ie.value?`Nada encontrado para "${ie.value}".`:`Nenhum ${ne.noun} encontrado neste filtro.`);return($e,ye)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$9,[!ee.loading&&(ee.searchable||ee.filterable||$e.$slots["toolbar-end"])?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$9,[ee.searchable?(e$b.openBlock(),e$b.createElementBlock("label",_hoisted_3$8,[ye[2]||(ye[2]=e$b.createElementVNode("svg",{class:"size-4 shrink-0 text-base-content/55",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round",d:"m21 21-4.3-4.3M17 10.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0Z"})],-1)),e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":ye[0]||(ye[0]=Ee=>ie.value=Ee),type:"search",placeholder:"Buscar",class:"w-full appearance-none border-0 bg-transparent p-0 text-sm font-normal text-base-content placeholder:text-base-content/55 focus:outline-none focus:ring-0 [&::-webkit-search-cancel-button]:appearance-none","aria-label":`Buscar ${ee.noun}`},null,8,_hoisted_4$7),[[e$b.vModelText,ie.value]])])):e$b.createCommentVNode("",!0),ee.filterable?(e$b.openBlock(),e$b.createBlock(PillTabs,{key:1,modelValue:oe.value,"onUpdate:modelValue":ye[1]||(ye[1]=Ee=>oe.value=Ee),options:de.value,layout:"row",size:"sm",tone:"neutral","aria-label":`Filtro de ${ee.noun}s`},null,8,["modelValue","options","aria-label"])):e$b.createCommentVNode("",!0),e$b.renderSlot($e.$slots,"toolbar-end",{},void 0,!0)])):e$b.createCommentVNode("",!0),ee.loading?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5$6,[e$b.createVNode(PixelLoader,{size:"lg",label:"Carregando",flavor:e$b.unref(pe)},null,8,["flavor"])])):ge.value.length?(e$b.openBlock(),e$b.createElementBlock("div",{key:2,class:e$b.normalizeClass(["min-h-0 flex-1 space-y-3",ee.scroll?"overflow-y-auto":""])},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ge.value,Ee=>(e$b.openBlock(),e$b.createElementBlock("section",{key:Ee.key,class:"cosmetic-group space-y-2"},[Ee.meta?(e$b.openBlock(),e$b.createElementBlock("header",_hoisted_6$5,[e$b.createElementVNode("span",{class:e$b.normalizeClass([Ee.meta.chip,"inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-bold uppercase leading-tight tracking-wide"])},e$b.toDisplayString(Ee.meta.label),3),e$b.createElementVNode("span",_hoisted_7$5,e$b.toDisplayString(Ee.items.length),1),ye[3]||(ye[3]=e$b.createElementVNode("span",{class:"h-px flex-1 bg-base-100","aria-hidden":"true"},null,-1))])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",{class:e$b.normalizeClass(["gap-3",le.value])},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(Ee.items,(Se,Le)=>(e$b.openBlock(),e$b.createBlock(CosmeticCard,{key:Se.id,item:Se,kind:ee.kind||Se.type,"attendant-name":ee.attendantName,density:ee.density,caption:Se.requirementLabel,locked:!Se.unlocked,selected:ee.selectedId===Se.id,"selected-label":ee.selectedLabel,busy:ee.busyId===Se.id,denied:ee.deniedId===Se.id,"enter-delay":fe(Ee,Le),mode:"attendant","hover-requirements":"",requirement:Se.requirementDetail,"unlocked-at":Se.unlocked_at,onSelect:Ve=>ae("select",Se)},null,8,["item","kind","attendant-name","density","caption","locked","selected","selected-label","busy","denied","enter-delay","requirement","unlocked-at","onSelect"]))),128))],2)]))),128))],2)):(e$b.openBlock(),e$b.createBlock(_sfc_main$c,{key:3,icon:"sparkle",title:"Nada por aqui ainda",subtitle:ke.value,flavor:be.value},null,8,["subtitle","flavor"]))]))}},CosmeticGrid=_export_sfc$1(_sfc_main$a,[["__scopeId","data-v-c6a4dca5"]]),BREAKDOWN_RULES=[{id:"chat_finished",label:"Atendimentos",eventLabel:"Atendimento finalizado",kind:"points",icon:"M9 12l2 2 4-4m6 2a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",filledIcon:"M9.55 17.45 4.1 12l1.4-1.4 4.05 4.05L18.5 5.7l1.4 1.4-10.35 10.35Z"},{id:"chat_grade",label:"Boa avaliação",eventLabel:"Boa avaliação",kind:"points",icon:"M11.48 3.5l2.02 4.1 4.52.66-3.27 3.19.77 4.5-4.04-2.13-4.04 2.13.77-4.5-3.27-3.19 4.52-.66 2.02-4.1z",filledIcon:"M13.85 4.22c-.68-1.63-3.02-1.63-3.7 0L8.4 8.39l-4.55.36c-1.78.14-2.5 2.33-1.15 3.48l3.47 2.93-1.06 4.39c-.41 1.72 1.47 3.07 2.99 2.15L12 19.35l3.9 2.35c1.52.92 3.4-.43 2.99-2.15l-1.06-4.39 3.47-2.93c1.35-1.15.63-3.34-1.15-3.48l-4.55-.36-1.75-4.17Z",negative:{label:"Nota baixa",eventLabel:"Nota baixa",kind:"deduction",icon:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-3.6-5.4a4.5 4.5 0 0 1 7.2 0M9 10h.01M15 10h.01",filledIcon:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20ZM8.5 8.5a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm7 0a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm1.08 8.25a1 1 0 0 1-1.4-.17A4.03 4.03 0 0 0 12 15a4.03 4.03 0 0 0-3.18 1.58 1 1 0 1 1-1.57-1.24A6.03 6.03 0 0 1 12 13a6.03 6.03 0 0 1 4.75 2.34 1 1 0 0 1-.17 1.41Z"}},{id:"chat_attending_time",label:"Resolução rápida",eventLabel:"Resolução rápida",kind:"points",icon:"M13 2 4.5 13H11l-1 9 8.5-11H12l1-9Z",filledIcon:"M13 2 4.5 13H11l-1 9 8.5-11H12l1-9Z"},{id:"chat_waiting_time",label:"Fila",eventLabel:"Fila curta",kind:"points",icon:"M12 8v4l3 2m6-2a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",filledIcon:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1 6v3.59l2.7 2.7a1 1 0 0 1-1.4 1.42l-3-3A1 1 0 0 1 11 12V8a1 1 0 1 1 2 0Z",negative:{label:"Fila longa",eventLabel:"Fila longa",kind:"deduction",icon:"M6 3h12M6 21h12M8 3v3.5a4 4 0 0 0 1.6 3.2L12 12l-2.4 2.3A4 4 0 0 0 8 17.5V21m8-18v3.5a4 4 0 0 1-1.6 3.2L12 12l2.4 2.3a4 4 0 0 1 1.6 3.2V21",filledIcon:"M6 2a1 1 0 0 0 0 2h1v2.5a5 5 0 0 0 2 4L10.67 12 9 13.5a5 5 0 0 0-2 4V20H6a1 1 0 1 0 0 2h12a1 1 0 1 0 0-2h-1v-2.5a5 5 0 0 0-2-4L13.33 12 15 10.5a5 5 0 0 0 2-4V4h1a1 1 0 1 0 0-2H6Zm3 2h6v2.5a3 3 0 0 1-1.2 2.4L12 10.5l-1.8-1.6A3 3 0 0 1 9 6.5V4Zm3 9.5 1.8 1.6a3 3 0 0 1 1.2 2.4V20H9v-2.5a3 3 0 0 1 1.2-2.4l1.8-1.6Z"}},{id:"chat_flow",label:"Atendimento proativo",eventLabel:"Atendimento proativo",kind:"points",icon:"M3 17l6-6 4 4 8-8m0 0h-5m5 0v5",filledIcon:"M20 5h-5a1 1 0 1 0 0 2h2.59L13 11.59l-3.29-3.3a1 1 0 0 0-1.42 0l-6 6a1 1 0 1 0 1.42 1.42L9 10.41l3.29 3.3a1 1 0 0 0 1.42 0L19 8.41V11a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1Z"},{id:"daily_cap",label:"Teto diário",eventLabel:"Teto diário atingido",kind:"cap",icon:"M12 3l8 3v6c0 4-3 7-8 9-5-2-8-5-8-9V6l8-3zM12 8v4m0 3h.01",filledIcon:"M12 2.1 4 5v6.1c0 4.6 3.4 8.4 8 9.8 4.6-1.4 8-5.2 8-9.8V5l-8-2.9Zm-1 4.9h2v6.2h-2V7Zm1 8a1.2 1.2 0 0 1 0 2.4 1.2 1.2 0 0 1 0-2.4Z"},{id:"penalty",label:"Punições",eventLabel:"Punição",kind:"penalty",icon:"M12 3.2 4.6 6v2.4c0 4.9 3 8.9 7.4 10.4 4.4-1.5 7.4-5.5 7.4-10.4V6L12 3.2ZM12 8.2v3.9m0 3h.01",filledIcon:"M11.48 2.6a.75.75 0 0 1 1.04 0 12.7 12.7 0 0 0 8.1 3.55c.4.03.71.35.72.75.02.5.02 1 .02 1.45 0 5.79-3.6 10.73-8.68 12.72a1.9 1.9 0 0 1-1.36 0C6.24 19.08 2.64 14.14 2.64 8.35c0-.45 0-.95.02-1.45.01-.4.32-.72.72-.75a12.7 12.7 0 0 0 8.1-3.55Zm.52 4.65a.95.95 0 0 0-.95 1l.22 4a.73.73 0 0 0 1.46 0l.22-4a.95.95 0 0 0-.95-1Zm0 8a1.1 1.1 0 1 0 0 2.2 1.1 1.1 0 0 0 0-2.2Z"},{id:"achievement",label:"Conquistas",eventLabel:"Conquista desbloqueada",kind:"achievement",icon:"M7 4h10v4a5 5 0 0 1-10 0V4Zm0 1H4v2a4 4 0 0 0 4 4m9-6h3v2a4 4 0 0 1-4 4M9 19h6M12 13v6",filledIcon:"M18 3V2H6v1H2v3a5 5 0 0 0 4.1 4.9A6 6 0 0 0 11 14.9V18H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-3.1A6 6 0 0 0 17.9 11 5 5 0 0 0 22 6V3h-4ZM4 6V5h2v3.8A3 3 0 0 1 4 6Zm16 0a3 3 0 0 1-2 2.8V5h2v1Z"},{id:"reverse",label:"Estornos",eventLabel:"Estorno",kind:"reversal",icon:"M9 14 4 9l5-5M4 9h9a7 7 0 0 1 0 14h-3",filledIcon:"M8.7 3.3a1 1 0 0 1 0 1.4L6.41 7H13a7.5 7.5 0 0 1 0 15h-2a1 1 0 1 1 0-2h2a5.5 5.5 0 0 0 0-11H6.41l2.3 2.3a1 1 0 1 1-1.42 1.4l-4-4a1 1 0 0 1 0-1.4l4-4a1 1 0 0 1 1.42 0Z"}],BREAKDOWN_RULE=BREAKDOWN_RULES.reduce((ee,te)=>(ee[te.id]=te,ee),{}),BREAKDOWN_RULE_IDS=BREAKDOWN_RULES.map(ee=>ee.id),BREAKDOWN_RULES_WITH_NEGATIVE=BREAKDOWN_RULES.filter(ee=>ee.negative).map(ee=>ee.id);function breakdownRuleFor(ee,te){const ne=BREAKDOWN_RULE[ee];return!(ne!=null&&ne.negative)||!(Number(te)<0)?ne:{...ne,...ne.negative}}const _hoisted_1$8=["aria-label"],_hoisted_2$8={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},_hoisted_3$7=["d"],_sfc_main$9={__name:"RuleBadge",props:{rule:{type:String,required:!0},size:{type:String,default:"md"},tone:{type:String,default:"primary"},negative:{type:Boolean,default:!1}},setup(ee){const te=ee,ne=e$b.computed(()=>breakdownRuleFor(te.rule,te.negative?-1:0)),ae=e$b.computed(()=>{var oe;return((oe=ne.value)==null?void 0:oe.icon)||""}),re=e$b.computed(()=>{var oe;return((oe=ne.value)==null?void 0:oe.label)||te.rule});return(oe,ie)=>(e$b.openBlock(),e$b.createElementBlock("span",{class:e$b.normalizeClass(["rule-badge",[`rule-badge-${ee.size}`,`rule-badge-${ee.tone}`]]),role:"img","aria-label":re.value},[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$8,[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:ae.value},null,8,_hoisted_3$7)]))],10,_hoisted_1$8))}},RuleBadge=_export_sfc$1(_sfc_main$9,[["__scopeId","data-v-210e017d"]]),_hoisted_1$7={viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},_hoisted_2$7=["d"],_sfc_main$8={__name:"RuleIcon",props:{rule:{type:String,required:!0},negative:{type:Boolean,default:!1}},setup(ee){const te=ee,ne=e$b.computed(()=>breakdownRuleFor(te.rule,te.negative?-1:0));return(ae,re)=>{var oe,ie;return e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_1$7,[e$b.createElementVNode("path",{d:((oe=ne.value)==null?void 0:oe.filledIcon)||((ie=ne.value)==null?void 0:ie.icon)||""},null,8,_hoisted_2$7)])}}};function ledgerEntryDetails(ee={}){return Array.isArray(ee==null?void 0:ee.details)?ee.details.map(te=>({...te,rule:te==null?void 0:te.name,points:Number(te==null?void 0:te.point)||0})).filter(te=>!!te.rule):[]}function ledgerEntryReversed(ee={}){return!!(ee!=null&&ee.reversed)}function ledgerEntryReversal(ee={}){return!!(ee!=null&&ee.is_reversal)}function ledgerEntryKind(ee,te){var ne;return((ne=breakdownRuleFor(ee,te))==null?void 0:ne.kind)??"points"}function ledgerEntryXp(ee){const te=ledgerEntryDetails(ee);return te.length?te.reduce((ne,ae)=>ledgerEntryKind(ae.rule,ae.points)==="cap"?ne:ne+(ae.points>0?ae.points:0),0):0}function formatLedgerValue(ee,te){if(te==null)return"";switch(ee){case"chat_attending_time":return`${te} min`;case"chat_waiting_time":return`cliente esperou ${te} min`;case"chat_grade":return`nota ${te}`;case"chat_flow":return`×${Number(te).toLocaleString("pt-BR")}`;default:return""}}function rollupLedgerByRule(ee=[]){var ne;const te=new Map;for(const ae of ee)for(const re of ledgerEntryDetails(ae)){const{rule:oe,points:ie}=re;if(ledgerEntryKind(oe,ie)==="cap")continue;const le=ie<0&&!!((ne=BREAKDOWN_RULE[oe])!=null&&ne.negative),ce=le?`${oe}:negative`:oe;te.has(ce)||te.set(ce,{rule:oe,negative:le,count:0,points:0});const de=te.get(ce);de.count+=1,de.points+=ie}return[...te.values()]}const DAY_MS=864e5,dayFormatter=new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"short"});function ledgerDayKey(ee){const te=new Date(ee);return Number.isNaN(te.getTime())?0:new Date(te.getFullYear(),te.getMonth(),te.getDate()).getTime()}function ledgerDayLabel(ee,te=new Date){const ne=ledgerDayKey(te);return ee===ne?"Hoje":ee===ne-DAY_MS?"Ontem":dayFormatter.format(new Date(ee))}function ledgerRelativeTime(ee,te=new Date){const ne=new Date(ee);if(Number.isNaN(ne.getTime()))return"";const ae=Math.max(0,Math.round((new Date(te)-ne)/6e4));if(ae<1)return"agora";if(ae<60)return`há ${ae} min`;const re=Math.round(ae/60);return re<24?`há ${re} h`:`há ${Math.round(re/24)} d`}function groupLedgerByDay(ee=[],te=new Date){const ne=new Map;for(const ae of ee){const re=ledgerDayKey(ae==null?void 0:ae.created_at);ne.has(re)||ne.set(re,[]),ne.get(re).push(ae)}return[...ne.entries()].sort((ae,re)=>re[0]-ae[0]).map(([ae,re])=>({key:ae,label:ledgerDayLabel(ae,te),rows:re,points:re.reduce((oe,ie)=>oe+(Number(ie.points)||0),0)}))}function summarizeLedger(ee=[]){const te=ee.reduce((ne,ae)=>ne+(Number(ae.points)||0),0);return{points:te,xp:te}}const _hoisted_1$6={key:0,class:"sm-ledger-day"},_hoisted_2$6={class:"sm-ledger-rail"},_hoisted_3$6={class:"sm-ledger-day-head"},_hoisted_4$6={class:"sm-ledger-day-label"},_hoisted_5$5={class:"sm-ledger-rail"},_hoisted_6$4={class:"sm-ledger-main"},_hoisted_7$4=["aria-expanded","onClick"],_hoisted_8$3={class:"min-w-0 flex-1"},_hoisted_9$2={class:"sm-ledger-title"},_hoisted_10$2={class:"sm-ledger-sub"},_hoisted_11$2={key:0,class:"sm-ledger-tag"},_hoisted_12$1={key:1,class:"sm-ledger-meta"},_hoisted_13$1=["title"],_hoisted_14$1={class:"sm-ledger-side"},_hoisted_15$1={class:"sm-ledger-stamp"},_hoisted_16$1={key:0,class:"sm-ledger-actions"},_hoisted_17={key:0,class:"sm-ledger-detail"},_hoisted_18={class:"sm-ledger-detail-label"},_hoisted_19={class:"sm-ledger-more-spin"},_hoisted_20={key:0,class:"sm-ledger-more-count"},_hoisted_21={key:1},_sfc_main$7={__name:"LedgerTimeline",props:{entries:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},density:{type:String,default:"cozy",validator:ee=>["cozy","compact"].includes(ee)},hasMore:{type:Boolean,default:!1},loadMore:{type:Function,default:null},pageKey:{type:[String,Number],default:""},total:{type:Number,default:0},now:{type:[Date,Number,String],default:()=>new Date}},setup(ee){const te=ee,ne=e$b.computed(()=>new Date(te.now)),ae=e$b.computed(()=>groupLedgerByDay(te.entries,ne.value)),re=e$b.ref(new Set);function oe(fe){const pe=new Set(re.value);pe.has(fe)?pe.delete(fe):pe.add(fe),re.value=pe}const ie=fe=>re.value.has(fe);e$b.watch(()=>te.entries,()=>{re.value=new Set});function le(fe){const pe=Number(fe)||0;return`${pe>0?"+":""}${pe.toLocaleString("pt-BR")}`}function ce(fe){return ledgerRelativeTime(fe,ne.value)}function de(fe){return Array.isArray(fe.details)&&fe.details.length?fe.details:[{id:`${fe.id}:0`,rule:fe.rule,kind:fe.kind,label:fe.label||fe.title,points:fe.points}]}function ue(fe){const pe=de(fe);return pe.length>1?pe:[]}const ve=fe=>de(fe)[0],me=e$b.computed(()=>`${te.pageKey}:${te.entries.length}`);async function ge(fe){if(te.loading||!te.loadMore)return fe.loaded();if(!te.hasMore)return fe.complete();try{await te.loadMore()}catch{return fe.error()}te.hasMore?fe.loaded():fe.complete()}return(fe,pe)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["sm-ledger",`sm-ledger--${ee.density}`])},[ee.loading?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$6,[pe[1]||(pe[1]=e$b.createElementVNode("div",{class:"sm-ledger-day-head"},[e$b.createElementVNode("span",{class:"sm-ledger-day-marker"}),e$b.createElementVNode("span",{class:"sm-ledger-skeleton h-3 w-20"}),e$b.createElementVNode("span",{class:"sm-ledger-day-line"})],-1)),e$b.createElementVNode("div",_hoisted_2$6,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(4,_e=>e$b.createElementVNode("div",{key:_e,class:"sm-ledger-row"},[...pe[0]||(pe[0]=[e$b.createStaticVNode('<span class="sm-ledger-node sm-ledger-node--ghost" data-v-19d71dc8></span><div class="sm-ledger-main" data-v-19d71dc8><div class="min-w-0 flex-1 space-y-1.5" data-v-19d71dc8><span class="sm-ledger-skeleton h-3 w-2/3" data-v-19d71dc8></span><span class="sm-ledger-skeleton h-2.5 w-1/3" data-v-19d71dc8></span></div><span class="sm-ledger-skeleton h-5 w-12 shrink-0" data-v-19d71dc8></span></div>',2)])])),64))])])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae.value,_e=>(e$b.openBlock(),e$b.createElementBlock("section",{key:_e.key,class:"sm-ledger-day","aria-label":"Lançamentos do dia"},[e$b.createElementVNode("header",_hoisted_3$6,[pe[2]||(pe[2]=e$b.createElementVNode("span",{class:"sm-ledger-day-marker","aria-hidden":"true"},null,-1)),e$b.createElementVNode("h3",_hoisted_4$6,e$b.toDisplayString(_e.label),1),pe[3]||(pe[3]=e$b.createElementVNode("span",{class:"sm-ledger-day-line","aria-hidden":"true"},null,-1)),_e.points?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["sm-ledger-day-total",_e.points<0?"is-negative":""])},e$b.toDisplayString(le(_e.points))+" pts ",3)):e$b.createCommentVNode("",!0)]),e$b.createElementVNode("ol",_hoisted_5$5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(_e.rows,be=>(e$b.openBlock(),e$b.createElementBlock("li",{key:be.id,class:e$b.normalizeClass(["sm-ledger-row",[`is-${be.kind||"points"}`,be.reversed?"is-reversed":"",ie(be.id)?"is-open":""]])},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["sm-ledger-node",`is-${be.kind||"points"}`]),"aria-hidden":"true"},[e$b.createVNode(_sfc_main$8,{rule:ve(be).rule,negative:ve(be).points<0},null,8,["rule","negative"])],2),e$b.createElementVNode("div",_hoisted_6$4,[e$b.createElementVNode("button",{type:"button",class:"sm-ledger-hit","aria-expanded":ie(be.id),onClick:ke=>oe(be.id)},[e$b.createElementVNode("span",_hoisted_8$3,[e$b.createElementVNode("span",_hoisted_9$2,e$b.toDisplayString(be.title),1),e$b.createElementVNode("span",_hoisted_10$2,[be.reversed?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_11$2," estornado ")):e$b.createCommentVNode("",!0),be.subtitle?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_12$1,e$b.toDisplayString(be.subtitle),1)):e$b.createCommentVNode("",!0),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ue(be),ke=>(e$b.openBlock(),e$b.createElementBlock("span",{key:ke.id,class:e$b.normalizeClass(["sm-ledger-chip",ke.points<0?"is-negative":""]),title:ke.label},[e$b.createVNode(_sfc_main$8,{rule:ke.rule,negative:ke.points<0},null,8,["rule","negative"]),e$b.createTextVNode(" "+e$b.toDisplayString(le(ke.points)),1)],10,_hoisted_13$1))),128))])]),e$b.createElementVNode("span",_hoisted_14$1,[e$b.createElementVNode("span",{class:e$b.normalizeClass(["sm-ledger-amount",[be.points<0?"is-negative":"",be.points?"":"is-neutral"]])},[e$b.createTextVNode(e$b.toDisplayString(be.points?le(be.points):"0")+" ",1),pe[4]||(pe[4]=e$b.createElementVNode("small",null,"pts",-1))],2),e$b.createElementVNode("span",_hoisted_15$1,e$b.toDisplayString(ce(be.created_at)),1)]),pe[5]||(pe[5]=e$b.createElementVNode("svg",{class:"sm-ledger-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6 9 6 6 6-6"})],-1))],8,_hoisted_7$4),fe.$slots.actions?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$1,[e$b.renderSlot(fe.$slots,"actions",{entry:be},void 0,!0)])):e$b.createCommentVNode("",!0)]),ie(be.id)?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_17,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(de(be),ke=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ke.id,class:"sm-ledger-detail-row"},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["sm-ledger-detail-icon",ke.points<0?"is-negative":""])},[e$b.createVNode(_sfc_main$8,{rule:ke.rule,negative:ke.points<0},null,8,["rule","negative"])],2),e$b.createElementVNode("span",_hoisted_18,e$b.toDisplayString(ke.label),1),ke.points?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["sm-ledger-detail-points",ke.points<0?"is-negative":""])},e$b.toDisplayString(le(ke.points)),3)):e$b.createCommentVNode("",!0)]))),128))])):e$b.createCommentVNode("",!0)],2))),128))])]))),128)),ee.loadMore?(e$b.openBlock(),e$b.createBlock(e$b.unref(Y$1),{key:0,class:"sm-ledger-more",identifier:me.value,distance:120,onInfinite:ge},{spinner:e$b.withCtx(()=>[e$b.createElementVNode("span",_hoisted_19,[e$b.createVNode(Loader,{size:"xs",tone:"current"})])]),complete:e$b.withCtx(()=>[ee.total?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_20,e$b.toDisplayString(ee.entries.length)+" de "+e$b.toDisplayString(ee.total),1)):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_21))]),_:1},8,["identifier"])):e$b.createCommentVNode("",!0)],64))],2))}},LedgerTimeline=_export_sfc$1(_sfc_main$7,[["__scopeId","data-v-19d71dc8"]]),NON_CONFIGURABLE=new Set(["daily_cap","penalty","achievement","reverse"]),SCORING_RULE_IDS=BREAKDOWN_RULE_IDS.filter(ee=>!NON_CONFIGURABLE.has(ee)),SCORING_RULE_SHAPE={chat_finished:"flat",chat_grade:"bands",chat_attending_time:"bands",chat_waiting_time:"bands",chat_flow:"multiplier"},FLAT_FIELDS={chat_finished:{points:"base_points",threshold:null}},DEFAULT_FLAT_FIELDS={points:"points",threshold:null},BAND_ORDER={chat_grade:{valueKey:"grade",dir:"desc"},chat_attending_time:{valueKey:"limit",dir:"asc"},chat_waiting_time:{valueKey:"limit",dir:"asc"}},SCORING_NEGATIVE_RULE_IDS=SCORING_RULE_IDS.filter(ee=>{var te;return!!((te=BREAKDOWN_RULE[ee])!=null&&te.negative)});function acceptsNegativeBands(ee){var te;return!!((te=BREAKDOWN_RULE[ee])!=null&&te.negative)}function scoringBandOrder(ee,{negative:te=!1}={}){const ne=BAND_ORDER[ee];return ne?te?{valueKey:ne.valueKey,dir:ne.dir==="asc"?"desc":"asc"}:ne:null}function ruleRank(ee){const te=SCORING_RULE_IDS.indexOf(ee);return te===-1?SCORING_RULE_IDS.length:te}function resolveScoringRules(ee){return{...(ee==null?void 0:ee.rules)??{},...(ee==null?void 0:ee.overrides)??{}}}function scoringOverriddenRuleIds(ee){const te=(ee==null?void 0:ee.overrides)??{};return SCORING_RULE_IDS.filter(ne=>!!te[ne])}function ruleTiers(ee,te,ne){if(!(te!=null&&te.enabled))return[];const ae=SCORING_RULE_SHAPE[ee]??"flat";if(ae==="multiplier")return[];if(ae==="flat"){const ie=FLAT_FIELDS[ee]??DEFAULT_FLAT_FIELDS,le=Number(te[ie.points])||0;if(ne||le<0)return[];const ce=ie.threshold?Number(te[ie.threshold]):NaN;return[{value:Number.isFinite(ce)?ce:null,points:le}]}const re=scoringBandOrder(ee,{negative:ne}),oe=(Array.isArray(te.bands)?te.bands:[]).map(ie=>({value:Number(ie==null?void 0:ie[re==null?void 0:re.valueKey]),points:Number(ie==null?void 0:ie.points)||0})).filter(ie=>Number.isFinite(ie.value)&&(ne?ie.points<0:ie.points>0));return re?oe.sort((ie,le)=>re.dir==="asc"?ie.value-le.value:le.value-ie.value):oe}function scoringRuleTiers(ee,te){return ruleTiers(ee,te,!1)}function scoringRuleNegativeTiers(ee,te){return ruleTiers(ee,te,!0)}function scoringRuleBestPoints(ee,te){return scoringRuleTiers(ee,te).reduce((ne,ae)=>Math.max(ne,ae.points),0)}function scoringRuleWorstPoints(ee,te){return scoringRuleNegativeTiers(ee,te).reduce((ne,ae)=>Math.min(ne,ae.points),0)}function scoringRuleMultiplier(ee){const te=Number(ee==null?void 0:ee.multiplier);return ee!=null&&ee.enabled&&Number.isFinite(te)&&te>0?te:1}function scoringMaxPerChat(ee={}){const te=[];let ne=0;for(const re of Object.keys(ee)){if(SCORING_RULE_SHAPE[re]==="multiplier")continue;const oe=scoringRuleBestPoints(re,ee[re]);oe&&(te.push({rule:re,points:oe}),ne+=oe)}const ae=scoringRuleMultiplier(ee.chat_flow);return{base:ne,multiplier:ae,total:Math.round(ne*ae),contributions:te.map(re=>({...re,share:ne?re.points/ne:0})).sort((re,oe)=>oe.points-re.points||ruleRank(re.rule)-ruleRank(oe.rule))}}function scoringMaxDeductionPerChat(ee={}){const te=[];let ne=0;for(const ae of Object.keys(ee)){const re=scoringRuleWorstPoints(ae,ee[ae]);re&&(te.push({rule:ae,points:re}),ne+=re)}return{total:ne,contributions:te.sort((ae,re)=>ae.points-re.points||ruleRank(ae.rule)-ruleRank(re.rule))}}const _hoisted_1$5={class:"rounded-lg border border-base-100/20 bg-base-300"},_hoisted_2$5={class:"flex items-center justify-between gap-2 border-b border-base-100/15 px-3 py-2"},_hoisted_3$5={class:"text-xs font-bold uppercase tracking-wide text-base-content/50"},_hoisted_4$5={class:"divide-y divide-base-100/10"},_hoisted_5$4={class:"text-xs font-medium text-base-content/70"},_hoisted_6$3={class:"flex items-center gap-1.5 text-sm tabular-nums"},_hoisted_7$3={class:"font-bold text-base-content"},_hoisted_8$2={key:0,class:"rounded-md bg-warning/15 px-1.5 py-0.5 text-xs font-bold text-warning"},_sfc_main$6={__name:"ImpactPreview",props:{title:{type:String,required:!0},items:{type:Array,required:!0}},setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_1$5,[e$b.createElementVNode("p",_hoisted_2$5,[e$b.createElementVNode("span",_hoisted_3$5,e$b.toDisplayString(ee.title),1),e$b.renderSlot(te.$slots,"badge")]),e$b.createElementVNode("ul",_hoisted_4$5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ee.items,ae=>(e$b.openBlock(),e$b.createElementBlock("li",{key:ae.key,class:"flex items-center justify-between gap-3 px-3 py-2"},[e$b.createElementVNode("span",_hoisted_5$4,e$b.toDisplayString(ae.label),1),e$b.createElementVNode("span",_hoisted_6$3,[e$b.createElementVNode("span",{class:e$b.normalizeClass(ae.changed?"text-base-content/50 line-through":"font-bold text-base-content")},e$b.toDisplayString(ae.from),3),ae.changed?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[ne[0]||(ne[0]=e$b.createElementVNode("svg",{class:"size-3.5 shrink-0 text-warning",fill:"none",stroke:"currentColor","stroke-width":"2.5",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 12h14m0 0-5-5m5 5-5 5"})],-1)),e$b.createElementVNode("span",_hoisted_7$3,e$b.toDisplayString(ae.to),1),ae.note?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_8$2,e$b.toDisplayString(ae.note),1)):e$b.createCommentVNode("",!0)],64)):e$b.createCommentVNode("",!0)])]))),128))])]))}},_hoisted_1$4={class:"flex flex-col items-center gap-2 rounded-2xl border border-dashed border-base-100/20 bg-base-200/40 p-8 text-center",role:"alert"},_hoisted_2$4={class:"text-sm font-bold"},_hoisted_3$4={class:"text-xs text-base-content/50"},_hoisted_4$4=["disabled"],_sfc_main$5={__name:"LoadError",props:{title:{type:String,default:"Não foi possível carregar"},subtitle:{type:String,default:""},retryLabel:{type:String,default:"Tentar de novo"},retrying:{type:Boolean,default:!1}},emits:["retry"],setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$4,[e$b.renderSlot(te.$slots,"icon",{},()=>[ne[1]||(ne[1]=e$b.createElementVNode("svg",{class:"h-8 w-8 text-error",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M12 3.8a8.2 8.2 0 1 1-5.8 2.4","stroke-dasharray":"3 3.2"}),e$b.createElementVNode("path",{d:"M12 8.5v4"}),e$b.createElementVNode("path",{d:"M12 16h.01"})],-1))]),e$b.createElementVNode("p",_hoisted_2$4,e$b.toDisplayString(ee.title),1),e$b.createElementVNode("p",_hoisted_3$4,[e$b.renderSlot(te.$slots,"default",{},()=>[e$b.createTextVNode(e$b.toDisplayString(ee.subtitle),1)])]),ee.retryLabel?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,type:"button",class:"mt-1 inline-flex h-8 items-center gap-1.5 rounded-lg bg-primary px-3 text-xs font-bold text-primary-content transition hover:brightness-110 active:scale-95 disabled:pointer-events-none disabled:opacity-50",disabled:ee.retrying,onClick:ne[0]||(ne[0]=ae=>te.$emit("retry"))},[(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(["h-3.5 w-3.5",{"animate-spin":ee.retrying}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...ne[2]||(ne[2]=[e$b.createElementVNode("path",{d:"M20 11.5A8 8 0 1 0 18 17"},null,-1),e$b.createElementVNode("path",{d:"M20 5.5V12h-6"},null,-1)])],2)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.retrying?"Tentando…":ee.retryLabel),1)],8,_hoisted_4$4)):e$b.createCommentVNode("",!0)]))}},_hoisted_1$3={class:"space-y-1.5"},_hoisted_2$3={class:"flex items-baseline justify-between gap-2"},_hoisted_3$3=["for"],_hoisted_4$3={key:0,class:"text-warning"},_hoisted_5$3={class:"text-xs tabular-nums text-base-content/50"},_hoisted_6$2=["id","value","maxlength","placeholder"],_hoisted_7$2={key:0,class:"pt-0.5 text-xs leading-relaxed text-base-content/50"},_sfc_main$4={__name:"ReasonField",props:{modelValue:{type:String,default:""},id:{type:String,required:!0},label:{type:String,default:"Motivo"},maxlength:{type:Number,default:140},placeholder:{type:String,default:""},hint:{type:String,default:""},required:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$3,[e$b.createElementVNode("div",_hoisted_2$3,[e$b.createElementVNode("label",{for:ee.id,class:"text-xs font-medium text-base-content/70"},[e$b.createTextVNode(e$b.toDisplayString(ee.label)+" ",1),ee.required?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_4$3,"*")):e$b.createCommentVNode("",!0)],8,_hoisted_3$3),e$b.createElementVNode("span",_hoisted_5$3,e$b.toDisplayString(ee.modelValue.length)+"/"+e$b.toDisplayString(ee.maxlength),1)]),e$b.createElementVNode("textarea",{id:ee.id,value:ee.modelValue,rows:"2",maxlength:ee.maxlength,placeholder:ee.placeholder,class:"reason-field min-h-16 w-full resize-none rounded-lg border border-base-100/20 bg-base-300 px-3 py-2 text-sm font-medium leading-relaxed transition",onInput:ne[0]||(ne[0]=ae=>te.$emit("update:modelValue",ae.target.value))},null,40,_hoisted_6$2),ee.hint?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$2,e$b.toDisplayString(ee.hint),1)):e$b.createCommentVNode("",!0)]))}},ReasonField=_export_sfc$1(_sfc_main$4,[["__scopeId","data-v-4f5e8328"]]),_hoisted_1$2=["disabled"],_hoisted_2$2={class:"flex min-w-0 items-center gap-2"},_hoisted_3$2={class:"truncate"},_hoisted_4$2={class:"shrink-0 text-xs opacity-60"},_hoisted_5$2={key:0,class:"size-4 shrink-0 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},_hoisted_6$1={class:"relative p-2"},_hoisted_7$1={class:"scrollbar-none max-h-[224px] space-y-0.5 overflow-y-auto px-2 pb-2"},_hoisted_8$1={key:0,class:"tz-empty rounded-lg p-3 text-center text-sm opacity-60"},_hoisted_9$1=["onClick"],_hoisted_10$1={class:"truncate"},_hoisted_11$1={class:"shrink-0 text-xs opacity-60"},_sfc_main$3={__name:"TimezoneSelect",props:{modelValue:{type:String,default:"America/Sao_Paulo"},disabled:{type:Boolean,default:!1},saving:{type:Boolean,default:!1},bg:{type:String,default:"bg-base-200"},rounded:{type:String,default:"rounded-xl"},borderColor:{type:String,default:"border-transparent"}},emits:["update:modelValue","change"],setup(ee,{emit:te}){const ne=te,ae=["America/Araguaina","America/Bahia","America/Belem","America/Boa_Vista","America/Campo_Grande","America/Cuiaba","America/Eirunepe","America/Fortaleza","America/Maceio","America/Manaus","America/Noronha","America/Porto_Acre","America/Porto_Velho","America/Recife","America/Rio_Branco","America/Santarem","America/Sao_Paulo"];function re(fe){const pe=[],_e=[];return fe.forEach(be=>(ae.includes(be)?pe:_e).push(be)),pe.sort(),_e.sort(),[...pe,..._e]}const oe=re((()=>{try{return Intl.supportedValuesOf("timeZone")}catch{return ae}})());function ie(fe){try{const pe=new Date,_e=new Date(pe.toLocaleString("en-US",{timeZone:"UTC"})).getTime(),be=new Date(pe.toLocaleString("en-US",{timeZone:fe})).getTime(),ke=Math.round((be-_e)/6e4),$e=ke>=0?"+":"-",ye=Math.abs(ke),Ee=Math.floor(ye/60),Se=ye%60;return`UTC ${$e}${Ee}:${String(Se).padStart(2,"0")}`}catch{return"UTC +0:00"}}function le(fe){return String(fe).replace(/_/g," ")}function ce(fe){return String(fe).normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[/_]/g," ").toLowerCase()}const de=e$b.ref(!1),ue=e$b.ref(""),ve=e$b.ref(null),me=e$b.computed(()=>{const fe=ce(ue.value||"");return fe?oe.filter(pe=>ce(pe).includes(fe)):oe});function ge(fe){ne("update:modelValue",fe),ne("change",fe),de.value=!1,ue.value=""}return onClickOutside(ve,()=>{de.value=!1}),(fe,pe)=>(e$b.openBlock(),e$b.createElementBlock("div",{ref_key:"target",ref:ve,class:"relative w-full"},[e$b.createElementVNode("button",{type:"button",disabled:ee.disabled||ee.saving,onClick:pe[0]||(pe[0]=e$b.withModifiers(_e=>de.value=!de.value,["stop"])),class:e$b.normalizeClass([[ee.bg,ee.rounded,ee.borderColor],"tz-trigger flex w-full items-center justify-between gap-2 border px-4 text-sm outline-none transition-all disabled:cursor-not-allowed disabled:opacity-50"])},[e$b.createElementVNode("span",_hoisted_2$2,[e$b.createElementVNode("span",_hoisted_3$2,e$b.toDisplayString(le(ee.modelValue)),1),e$b.createElementVNode("span",_hoisted_4$2,"("+e$b.toDisplayString(ie(ee.modelValue))+")",1)]),ee.saving?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_5$2,[...pe[2]||(pe[2]=[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12h4Z"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",{key:1,class:e$b.normalizeClass([de.value?"rotate-180":"","size-4 shrink-0 opacity-60 transition-transform duration-200"]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...pe[3]||(pe[3]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.4 10.3A2 2 0 0 0 17 7H7a2 2 0 0 0-1.5 3.3l4.9 5.9a2 2 0 0 0 3 0l5-6Z","clip-rule":"evenodd"},null,-1)])],2))],10,_hoisted_1$2),e$b.createVNode(e$b.Transition,{name:"tz-fade"},{default:e$b.withCtx(()=>[de.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass([ee.rounded,"tz-dropdown absolute left-0 right-0 top-[calc(100%+4px)] z-30 border shadow-lg"])},[e$b.createElementVNode("div",_hoisted_6$1,[pe[4]||(pe[4]=e$b.createElementVNode("div",{class:"pointer-events-none absolute inset-y-0 left-5 flex items-center"},[e$b.createElementVNode("svg",{class:"size-4 opacity-50",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"})])],-1)),e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":pe[1]||(pe[1]=_e=>ue.value=_e),type:"search",class:"tz-search w-full rounded-lg py-2 pl-10 pr-3 text-sm outline-none",placeholder:"Pesquise seu fuso horário..."},null,512),[[e$b.vModelText,ue.value]])]),e$b.createElementVNode("div",_hoisted_7$1,[me.value.length?(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,{key:1},e$b.renderList(me.value,(_e,be)=>(e$b.openBlock(),e$b.createElementBlock("button",{key:be,onClick:ke=>ge(_e),class:e$b.normalizeClass(["tz-option flex w-full items-center justify-between gap-2 rounded-lg px-3 py-2 text-sm transition-all",_e===ee.modelValue?"tz-option--active":""])},[e$b.createElementVNode("span",_hoisted_10$1,e$b.toDisplayString(le(_e)),1),e$b.createElementVNode("span",_hoisted_11$1,"("+e$b.toDisplayString(ie(_e))+")",1)],10,_hoisted_9$1))),128)):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$1," Sem resultados "))])],2)):e$b.createCommentVNode("",!0)]),_:1})],512))}},TimezoneSelect=_export_sfc$1(_sfc_main$3,[["__scopeId","data-v-d686d01a"]]);function normalizeSmsListPayload(ee){return Array.isArray(ee==null?void 0:ee.results)?ee.results:Array.isArray(ee)?ee:[]}function getSmsPoolCredits(ee){return Number((ee==null?void 0:ee.balance)??(ee==null?void 0:ee.effective_available_credits)??(ee==null?void 0:ee.credits)??0)}function getSmsValidContacts(ee){return(ee==null?void 0:ee.valid_contacts)??(ee==null?void 0:ee.valid)??[]}function getSmsInvalidContacts(ee){return(ee==null?void 0:ee.invalid_contacts)??(ee==null?void 0:ee.invalid)??[]}function getSmsContactName(ee){var te;return(ee==null?void 0:ee.name)??((te=ee==null?void 0:ee.contact)==null?void 0:te.name)??"-"}function getSmsContactPhone(ee){var te;return(ee==null?void 0:ee.telephone)??(ee==null?void 0:ee.phone)??(ee==null?void 0:ee.number)??((te=ee==null?void 0:ee.contact)==null?void 0:te.telephone)??"-"}function getSmsCreditsToConsume(ee){return Number((ee==null?void 0:ee.credits_to_consume)??(ee==null?void 0:ee.credits)??getSmsValidContacts(ee).length)}async function listSmsPools({url:ee=smsPoolUrl}={}){const{data:te}=await api.get(ee);return normalizeSmsListPayload(te)}async function listSmsPoolsPaginated({page:ee=1,search:te="",pageSize:ne=20,url:ae=smsPoolUrl}={}){const re={page:ee,page_size:ne};te&&(re.name=te);const{data:oe}=await api.get(ae,{params:re});return oe}async function updateSmsPool(ee,te){const{data:ne}=await api.patch(`${smsPoolUrl}${ee}/`,te);return ne}const _hoisted_1$1={key:0,class:"mb-1.5 block text-xs font-semibold uppercase tracking-wide opacity-80"},_hoisted_2$1=["disabled"],_hoisted_3$1={key:0,class:"flex items-center gap-2 truncate"},_hoisted_4$1={class:"truncate font-semibold"},_hoisted_5$1={class:"shrink-0 rounded-full bg-primary/20 px-2 py-0.5 text-xs font-bold text-primary"},_hoisted_6={key:1,class:"text-current/40"},_hoisted_7={class:"ml-2 flex shrink-0 items-center gap-1"},_hoisted_8={key:0,class:"border-b border-base-100/50 px-2 py-2"},_hoisted_9={class:"max-h-52 overflow-y-auto"},_hoisted_10={key:0,class:"px-3 py-3 space-y-2"},_hoisted_11=["onClick"],_hoisted_12={class:"flex items-center gap-2 truncate"},_hoisted_13={key:0,class:"size-3.5 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},_hoisted_14={class:"truncate"},_hoisted_15={key:0,class:"py-4 text-center text-sm text-current/40"},_hoisted_16={key:1,class:"mt-1 text-xs text-red-500"},DROPDOWN_HEIGHT=260,_sfc_main$2={__name:"smsPoolSelect",props:{modelValue:{default:null},pools:{type:Array,default:null},loading:{type:Boolean,default:!1},error:{type:String,default:""},label:{type:String,default:"Carteira SMS"},placeholder:{type:String,default:"Selecione uma carteira"},disabled:{type:Boolean,default:!1},apiUrl:{type:String,default:smsPoolUrl}},emits:["update:modelValue"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.ref(!1),oe=e$b.ref(!1),ie=e$b.ref(""),le=e$b.ref([]),ce=e$b.ref(1),de=e$b.ref(0),ue=e$b.ref(!1),ve=e$b.ref(!0),me=e$b.ref(null),ge=e$b.ref(null);function fe(){if(!ge.value)return;const Te=ge.value.getBoundingClientRect(),ze=window.innerHeight-Te.bottom;oe.value=ze<DROPDOWN_HEIGHT&&Te.top>DROPDOWN_HEIGHT}const pe=e$b.computed(()=>Array.isArray(ne.pools)),_e=e$b.computed(()=>pe.value?ne.pools:le.value),be=e$b.computed(()=>pe.value?ne.loading:ue.value);async function ke(Te){if(pe.value){Te.complete();return}ue.value=!0;try{const ze=await listSmsPoolsPaginated({page:ce.value,search:ie.value,url:ne.apiUrl}),Re=Array.isArray(ze==null?void 0:ze.results)?ze.results:Array.isArray(ze)?ze:[];le.value.push(...Re),ce.value++,ze.next?(ve.value=!0,Te.loaded()):(ve.value=!1,Te.complete())}catch{Te.error()}finally{ue.value=!1}}let $e=null;function ye(){clearTimeout($e),$e=setTimeout(()=>{le.value=[],ce.value=1,ve.value=!0,de.value++},350)}e$b.watch(ie,()=>{pe.value||ye()});function Ee(Te){getSmsPoolCredits(Te)<=0||(ae("update:modelValue",Te),re.value=!1)}function Se(Te){Te.stopPropagation(),ae("update:modelValue",null)}function Le(){ne.disabled||(re.value||fe(),re.value=!re.value)}function Ve(Te){me.value&&!me.value.contains(Te.target)&&(re.value=!1)}return e$b.onMounted(()=>document.addEventListener("mousedown",Ve)),e$b.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Ve),clearTimeout($e)}),(Te,ze)=>(e$b.openBlock(),e$b.createElementBlock("div",null,[ee.label?(e$b.openBlock(),e$b.createElementBlock("label",_hoisted_1$1,e$b.toDisplayString(ee.label),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",{ref_key:"dropdownRef",ref:me,class:"relative"},[e$b.createElementVNode("button",{ref_key:"triggerRef",ref:ge,type:"button",disabled:ee.disabled,onClick:Le,class:e$b.normalizeClass(["flex w-full items-center justify-between rounded-lg bg-base-200 px-3 py-2.5 text-sm transition hover:brightness-95 disabled:cursor-not-allowed disabled:opacity-60",{"ring-2 ring-red-500/60":ee.error}])},[ee.modelValue?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$1,[e$b.createElementVNode("span",_hoisted_4$1,e$b.toDisplayString(ee.modelValue.name),1),e$b.createElementVNode("span",_hoisted_5$1,e$b.toDisplayString(e$b.unref(getSmsPoolCredits)(ee.modelValue))+" créditos ",1)])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6,e$b.toDisplayString(ee.placeholder),1)),e$b.createElementVNode("span",_hoisted_7,[ee.modelValue?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,onClick:Se,class:"flex size-4 items-center justify-center rounded-full text-current/40 transition hover:text-current/80"},[...ze[2]||(ze[2]=[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"size-3.5",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm7.707-3.707a1 1 0 0 0-1.414 1.414L10.586 12l-2.293 2.293a1 1 0 1 0 1.414 1.414L12 13.414l2.293 2.293a1 1 0 0 0 1.414-1.414L13.414 12l2.293-2.293a1 1 0 0 0-1.414-1.414L12 10.586 9.707 8.293Z","clip-rule":"evenodd"})],-1)])])):e$b.createCommentVNode("",!0),(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(["size-4 text-current/50 transition-transform",{"rotate-180":re.value}]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...ze[3]||(ze[3]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.425 10.271C19.499 8.967 18.57 7 16.88 7H7.12c-1.69 0-2.618 1.967-1.544 3.271l4.881 5.927a2 2 0 0 0 3.088 0l4.88-5.927Z","clip-rule":"evenodd"},null,-1)])],2))])],10,_hoisted_2$1),e$b.createVNode(e$b.Transition,{name:"sms-pool-fade"},{default:e$b.withCtx(()=>[re.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["absolute left-0 z-30 w-full overflow-hidden rounded-lg bg-base-300 shadow-lg shadow-black/20",oe.value?"bottom-full mb-1":"top-full mt-1"])},[pe.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8,[e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":ze[0]||(ze[0]=Re=>ie.value=Re),type:"text",placeholder:"Buscar carteira…",class:"w-full border-none focus:border-none rounded-md bg-base-200 px-3 py-1.5 text-sm outline-none placeholder:text-current/30",onClick:ze[1]||(ze[1]=e$b.withModifiers(()=>{},["stop"]))},null,512),[[e$b.vModelText,ie.value]])])),e$b.createElementVNode("div",_hoisted_9,[be.value&&_e.value.length===0?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(3,Re=>e$b.createElementVNode("div",{key:Re,class:"h-8 w-full animate-pulse rounded-md bg-base-100/60"})),64))])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(_e.value,Re=>{var Oe,Pe;return e$b.openBlock(),e$b.createElementBlock("div",{key:Re.id,onClick:Be=>Ee(Re),class:e$b.normalizeClass(["flex items-center justify-between px-3 py-2.5 text-sm transition",[e$b.unref(getSmsPoolCredits)(Re)<=0?"cursor-not-allowed opacity-40":"cursor-pointer hover:bg-base-200/60",((Oe=ee.modelValue)==null?void 0:Oe.id)===Re.id?"bg-primary/10 font-semibold":""]])},[e$b.createElementVNode("span",_hoisted_12,[((Pe=ee.modelValue)==null?void 0:Pe.id)===Re.id?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_13,[...ze[4]||(ze[4]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm13.707-1.293a1 1 0 0 0-1.414-1.414L11 12.586l-1.793-1.793a1 1 0 0 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l4-4Z","clip-rule":"evenodd"},null,-1)])])):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_14,e$b.toDisplayString(Re.name),1)]),e$b.createElementVNode("span",{class:e$b.normalizeClass(["ml-2 shrink-0 rounded-full px-2 py-0.5 text-xs font-bold",e$b.unref(getSmsPoolCredits)(Re)>0?"bg-primary/20 text-primary":"bg-base-100 text-current/40"])},e$b.toDisplayString(e$b.unref(getSmsPoolCredits)(Re))+" créditos ",3)],10,_hoisted_11)}),128)),!be.value&&_e.value.length===0?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_15," Nenhuma carteira encontrada ")):e$b.createCommentVNode("",!0),!pe.value&&ve.value?(e$b.openBlock(),e$b.createBlock(e$b.unref(Y$1),{key:de.value,onInfinite:ke},{spinner:e$b.withCtx(()=>[...ze[5]||(ze[5]=[e$b.createElementVNode("div",{class:"flex justify-center py-3"},[e$b.createElementVNode("div",{class:"size-5 animate-spin rounded-full border-4 border-t-transparent border-primary"})],-1)])]),complete:e$b.withCtx(()=>[...ze[6]||(ze[6]=[e$b.createElementVNode("span",null,null,-1)])]),_:1})):e$b.createCommentVNode("",!0)],64))])],2)):e$b.createCommentVNode("",!0)]),_:1})],512),ee.error?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_16,e$b.toDisplayString(ee.error),1)):e$b.createCommentVNode("",!0)]))}},SmsPoolSelect=_export_sfc$1(_sfc_main$2,[["__scopeId","data-v-6616f293"]]),_hoisted_1={class:"call-history-container"},_hoisted_2={key:0,class:"call-history-loading"},_hoisted_3={key:1,class:"call-history-error"},_hoisted_4={key:2,class:"call-history-empty"},_hoisted_5={key:3,class:"call-history-list"},_sfc_main$1={__name:"CallHistory",props:{chatId:{type:[String,Number],required:!0},callsApiUrl:{type:String,required:!1,default:callsUrl},onMessageClick:{type:Function,required:!1,default:null}},setup(ee){const te=ee,ne=e$b.ref(!1),ae=e$b.ref(null),re=e$b.ref([]);e$b.onMounted(()=>{oe()}),e$b.watch(()=>te.chatId,()=>{oe()});async function oe(){var le,ce;if(te.chatId){ne.value=!0,ae.value=null;try{const de=await api.get(`${te.callsApiUrl}?chat_id=${te.chatId}`);re.value=de.data.results||de.data||[]}catch(de){console.error("Erro ao buscar ligações:",de),ae.value=((ce=(le=de.response)==null?void 0:le.data)==null?void 0:ce.message)||"Erro ao carregar o histórico de ligações"}finally{ne.value=!1}}}function ie(le){te.onMessageClick&&te.onMessageClick(le)}return(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1,[ne.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2,[...ce[0]||(ce[0]=[e$b.createElementVNode("svg",{class:"call-history-loading-spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})],-1),e$b.createElementVNode("span",{class:"call-history-loading-text"},"Carregando ligações...",-1)])])):ae.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_3,e$b.toDisplayString(ae.value),1)):re.value.length===0?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_4," Nenhuma ligação registrada nesta conversa ")):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(re.value,de=>(e$b.openBlock(),e$b.createBlock(CallCard,{key:de.id,call:de,"on-message-click":ie},null,8,["call"]))),128))]))]))}},CallHistory=_export_sfc$1(_sfc_main$1,[["__scopeId","data-v-23aeed88"]]);function install(ee){ee.component("PrimarySelect",primarySelect),ee.component("DepartSelect",departSelect),ee.component("AttendantSelect",attendantSelect),ee.component("SimpleModal",simpleModal),ee.component("SimpleCard",_sfc_main$2G),ee.component("InstanceSelect",instanceSelect),ee.component("CalendarEvents",calendar),ee.component("MFA",_sfc_main$2d),ee.component("MfaQrCode",_sfc_main$2c),ee.component("ChatWindow",chatWindow),ee.component("FilterSelectLib",FilterSelectLib),ee.component("RandomAvatar",RandomAvatar),ee.component("MinModal",MinModal),ee.component("Modal",Modal),ee.component("LibPatchNotes",libPatchNotes),ee.component("BtnNewUpdates",btnNewUpdates),ee.component("LibPhotoPicker",_sfc_main$1E),ee.component("SelectMultipleDepartments",SelectMultipleDepartments),ee.component("SelectMultipleInstances",SelectMultipleInstances),ee.component("PrimaryInput",PrimaryInput),ee.component("CurrencyDisplay",CurrencyDisplay),ee.component("SimpleSelect",SimpleSelect),ee.component("FloatingDev",FloatingDev),ee.component("RatingInput",RatingInput),ee.component("TagView",_sfc_main$15),ee.component("TagChip",TagChip),ee.component("TagList",TagList),ee.component("ClientsForm",ClientsForm),ee.component("SelectMultipleTags",SelectMultipleTags),ee.component("SimpleLoader",_sfc_main$1s),ee.component("Loader",Loader),ee.component("OutcomeButton",OutcomeButton),ee.component("CallHistory",CallHistory),ee.component("CallMessage",CallMessage),ee.component("SystemMessage",_sfc_main$t),ee.component("ListProducts",ListProducts),ee.component("ContactCard",ContactCard),ee.component("ContactMessageCard",ContactMessageCard),ee.component("ProposalMessageCard",ProposalMessageCard),ee.component("WalletCard",WalletCard),ee.component("ReminderModal",ReminderModal),ee.component("SoundSelect",SoundSelect),ee.component("TimezoneSelect",TimezoneSelect),ee.component("SmsPoolSelect",SmsPoolSelect),ee.component("BaseTable",baseTable),ee.component("TemplateTable",templateTable),ee.component("CategoryBadge",_sfc_main$2L),ee.component("AchievementCard",AchievementCard),ee.component("NetworkIcon",_sfc_main$2x)}function attLibDeparts(ee,te="add"){const ne=useDepartmentStore();te==="add"?ne.addDepartments(ee):te==="delete"?ne.removeDepartments(ee):te==="update"?(ne.departments=ee,ne.loaded=!0):console.error(`Ação "${te}" não suportada em attLibDeparts.`)}function attLibAttendants(ee,te="add"){const ne=useAttendantStore();te==="add"?ne.addAttendants(ee):te==="delete"?ne.removeAttendants(ee):te==="update"?(ne.attendants=ee,ne.loaded=!0):console.error(`Ação "${te}" não suportada em attLibAttendants.`)}function attLibInstances(ee,te="add"){const ne=useInstanceStore();te==="add"?ne.addInstance(ee):te==="delete"?ne.removeInstance(ee):te==="update"?(ne.instances=ee,ne.loaded=!0):console.error(`Ação "${te}" não suportada em attLibInstances.`)}async function setupLibrary(ee,te,ne,ae=[],re=[],oe=[],ie=null){try{setPiniaInstance(ee);const le=await useAuthStore(ee);te&&await le.setToken(te),ne&&setApiBaseURL(ne),ie&&setRefreshTokenUrl(ie);const ce=useDepartmentStore(ee);re.length>0&&(ce.departments=re,ce.count=re.length);const de=useAttendantStore(ee);ae.length>0&&(de.attendants=ae,de.count=ae.length),await useInstanceStore(ee).fetchInstances()}catch(le){console.error("Erro no setupLibrary:",le)}}function getWithContrastColor(ee){return getContrastColor(ee)}function attReminderByLib(ee){return moveReminderToCompleted(ee)}const index={install,setupLibrary,attLibDeparts,attLibAttendants,attLibInstances,primarySelect,simpleModal,simpleCard:_sfc_main$2G,instanceSelect,SimpleSelect,FloatingDev,calendar,SimpleLoader:_sfc_main$1s,Loader,MFA:_sfc_main$2d,chatWindow,departSelect,attendantSelect,FilterSelectLib,RandomAvatar,MinModal,Modal,libPatchNotes,btnNewUpdates,LibPhotoPicker:_sfc_main$1E,SelectMultipleDepartments,SelectMultipleInstances,SelectMultipleTags,PrimaryInput,CurrencyDisplay,getWithContrastColor,RatingInput,TagView:_sfc_main$15,TagChip,TagList,ClientsForm,OutcomeButton,CallHistory,CallMessage,SystemMessage:_sfc_main$t,ListProducts,ContactCard,ContactMessageCard,ProposalMessageCard,NetworkIcon:_sfc_main$2x,ReminderModal,attReminderByLib,SoundSelect,TimezoneSelect,formatCurrency,getCurrencySymbol,getCurrencyLocale};function s(ee){ee.CapacitorUtils.Synapse=new Proxy({},{get(te,ne){return new Proxy({},{get(ae,re){return(oe,ie,le)=>{const ce=ee.Capacitor.Plugins[ne];if(ce===void 0){le(new Error(`Capacitor plugin ${ne} not found`));return}if(typeof ce[re]!="function"){le(new Error(`Method ${re} not found in Capacitor plugin ${ne}`));return}(async()=>{try{const de=await ce[re](oe);ie(de)}catch(de){le(de)}})()}}})}})}function u(ee){ee.CapacitorUtils.Synapse=new Proxy({},{get(te,ne){return ee.cordova.plugins[ne]}})}function f(ee=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!ee?s(window):window.cordova!==void 0&&u(window))}var Directory;(function(ee){ee.Documents="DOCUMENTS",ee.Data="DATA",ee.Library="LIBRARY",ee.Cache="CACHE",ee.External="EXTERNAL",ee.ExternalStorage="EXTERNAL_STORAGE",ee.ExternalCache="EXTERNAL_CACHE",ee.LibraryNoCloud="LIBRARY_NO_CLOUD",ee.Temporary="TEMPORARY"})(Directory||(Directory={}));var Encoding;(function(ee){ee.UTF8="utf8",ee.ASCII="ascii",ee.UTF16="utf16"})(Encoding||(Encoding={}));const Filesystem=registerPlugin("Filesystem",{web:()=>Promise.resolve().then(()=>web).then(ee=>new ee.FilesystemWeb)});f();const BlobWriter=registerPlugin("BlobWriter");function array_buffer_to_base64(ee){return window.btoa(Array.from(new Uint8Array(ee)).map(function(te){return String.fromCharCode(te)}).join(""))}function write_file_via_indexeddb({path:ee,directory:te,blob:ne,recursive:ae}){return Filesystem.writeFile({directory:te,path:ee,recursive:ae,data:""}).then(function(){return new Promise(function(re,oe){function ie(ce){oe(ce.target.error)}const le=window.indexedDB.open("Disc");le.onerror=ie,le.onsuccess=function(){const de=le.result.transaction("FileStorage","readwrite");de.onerror=ie;const ue=de.objectStore("FileStorage"),ve=`/${te}/${ee.replace(/^\//,"")}`,me=ue.get(ve);me.onsuccess=function(){me.result.size=ne.size,me.result.content=ne;const ge=ue.put(me.result);ge.onsuccess=function(){re(void 0)}}}})})}function write_file_via_bridge({path:ee,directory:te,blob:ne,recursive:ae}){return Filesystem.writeFile({directory:te,path:ee,recursive:ae,data:""}).then(function re(){if(ne.size===0)return Promise.resolve();const oe=3*128*1024,ie=ne.slice(0,oe);return ne=ne.slice(oe),new Response(ie).arrayBuffer().then(function(ce){return Filesystem.appendFile({directory:te,path:ee,data:array_buffer_to_base64(ce)})}).then(re)})}function write_blob(ee){const{path:te,directory:ne,blob:ae,fast_mode:re=!1,recursive:oe,on_fallback:ie}=ee;return!ae||!Number.isSafeInteger(ae.size)||typeof ae.type!="string"?Promise.reject(new Error("Not a Blob.")):Capacitor.getPlatform()==="web"?re?write_file_via_indexeddb(ee):write_file_via_bridge(ee):Promise.all([BlobWriter.get_config(),Filesystem.getUri({path:te,directory:ne})]).then(function([le,ce]){const de=ce.uri.replace("file://","");return(window.CapacitorWebFetch||window.fetch)(le.base_url+de+(oe?"?recursive=true":""),{headers:{authorization:le.auth_token},method:"put",body:ae}).then(function(ve){if(ve.status!==204)throw new Error("Bad HTTP status: "+ve.status);return ce.uri})}).catch(function(ce){return ie!==void 0&&ie(ce),write_file_via_bridge(ee)})}const write_blob$1=Object.freeze(write_blob);var getBlobDuration$1={};function _interopRequireDefault(ee){return ee&&ee.__esModule?ee:{default:ee}}var interopRequireDefault=_interopRequireDefault,runtime={exports:{}},hasRequiredRuntime;function requireRuntime(){return hasRequiredRuntime||(hasRequiredRuntime=1,function(ee){var te=function(ne){var ae=Object.prototype,re=ae.hasOwnProperty,oe=Object.defineProperty||function(Ce,Fe,Ie){Ce[Fe]=Ie.value},ie,le=typeof Symbol=="function"?Symbol:{},ce=le.iterator||"@@iterator",de=le.asyncIterator||"@@asyncIterator",ue=le.toStringTag||"@@toStringTag";function ve(Ce,Fe,Ie){return Object.defineProperty(Ce,Fe,{value:Ie,enumerable:!0,configurable:!0,writable:!0}),Ce[Fe]}try{ve({},"")}catch{ve=function(Fe,Ie,Ue){return Fe[Ie]=Ue}}function me(Ce,Fe,Ie,Ue){var qe=Fe&&Fe.prototype instanceof $e?Fe:$e,je=Object.create(qe.prototype),We=new Ne(Ue||[]);return oe(je,"_invoke",{value:Oe(Ce,Ie,We)}),je}ne.wrap=me;function ge(Ce,Fe,Ie){try{return{type:"normal",arg:Ce.call(Fe,Ie)}}catch(Ue){return{type:"throw",arg:Ue}}}var fe="suspendedStart",pe="suspendedYield",_e="executing",be="completed",ke={};function $e(){}function ye(){}function Ee(){}var Se={};ve(Se,ce,function(){return this});var Le=Object.getPrototypeOf,Ve=Le&&Le(Le(Me([])));Ve&&Ve!==ae&&re.call(Ve,ce)&&(Se=Ve);var Te=Ee.prototype=$e.prototype=Object.create(Se);ye.prototype=Ee,oe(Te,"constructor",{value:Ee,configurable:!0}),oe(Ee,"constructor",{value:ye,configurable:!0}),ye.displayName=ve(Ee,ue,"GeneratorFunction");function ze(Ce){["next","throw","return"].forEach(function(Fe){ve(Ce,Fe,function(Ie){return this._invoke(Fe,Ie)})})}ne.isGeneratorFunction=function(Ce){var Fe=typeof Ce=="function"&&Ce.constructor;return Fe?Fe===ye||(Fe.displayName||Fe.name)==="GeneratorFunction":!1},ne.mark=function(Ce){return Object.setPrototypeOf?Object.setPrototypeOf(Ce,Ee):(Ce.__proto__=Ee,ve(Ce,ue,"GeneratorFunction")),Ce.prototype=Object.create(Te),Ce},ne.awrap=function(Ce){return{__await:Ce}};function Re(Ce,Fe){function Ie(je,We,Ge,Ke){var et=ge(Ce[je],Ce,We);if(et.type==="throw")Ke(et.arg);else{var yt=et.arg,Et=yt.value;return Et&&typeof Et=="object"&&re.call(Et,"__await")?Fe.resolve(Et.__await).then(function(At){Ie("next",At,Ge,Ke)},function(At){Ie("throw",At,Ge,Ke)}):Fe.resolve(Et).then(function(At){yt.value=At,Ge(yt)},function(At){return Ie("throw",At,Ge,Ke)})}}var Ue;function qe(je,We){function Ge(){return new Fe(function(Ke,et){Ie(je,We,Ke,et)})}return Ue=Ue?Ue.then(Ge,Ge):Ge()}oe(this,"_invoke",{value:qe})}ze(Re.prototype),ve(Re.prototype,de,function(){return this}),ne.AsyncIterator=Re,ne.async=function(Ce,Fe,Ie,Ue,qe){qe===void 0&&(qe=Promise);var je=new Re(me(Ce,Fe,Ie,Ue),qe);return ne.isGeneratorFunction(Fe)?je:je.next().then(function(We){return We.done?We.value:je.next()})};function Oe(Ce,Fe,Ie){var Ue=fe;return function(je,We){if(Ue===_e)throw new Error("Generator is already running");if(Ue===be){if(je==="throw")throw We;return we()}for(Ie.method=je,Ie.arg=We;;){var Ge=Ie.delegate;if(Ge){var Ke=Pe(Ge,Ie);if(Ke){if(Ke===ke)continue;return Ke}}if(Ie.method==="next")Ie.sent=Ie._sent=Ie.arg;else if(Ie.method==="throw"){if(Ue===fe)throw Ue=be,Ie.arg;Ie.dispatchException(Ie.arg)}else Ie.method==="return"&&Ie.abrupt("return",Ie.arg);Ue=_e;var et=ge(Ce,Fe,Ie);if(et.type==="normal"){if(Ue=Ie.done?be:pe,et.arg===ke)continue;return{value:et.arg,done:Ie.done}}else et.type==="throw"&&(Ue=be,Ie.method="throw",Ie.arg=et.arg)}}}function Pe(Ce,Fe){var Ie=Fe.method,Ue=Ce.iterator[Ie];if(Ue===ie)return Fe.delegate=null,Ie==="throw"&&Ce.iterator.return&&(Fe.method="return",Fe.arg=ie,Pe(Ce,Fe),Fe.method==="throw")||Ie!=="return"&&(Fe.method="throw",Fe.arg=new TypeError("The iterator does not provide a '"+Ie+"' method")),ke;var qe=ge(Ue,Ce.iterator,Fe.arg);if(qe.type==="throw")return Fe.method="throw",Fe.arg=qe.arg,Fe.delegate=null,ke;var je=qe.arg;if(!je)return Fe.method="throw",Fe.arg=new TypeError("iterator result is not an object"),Fe.delegate=null,ke;if(je.done)Fe[Ce.resultName]=je.value,Fe.next=Ce.nextLoc,Fe.method!=="return"&&(Fe.method="next",Fe.arg=ie);else return je;return Fe.delegate=null,ke}ze(Te),ve(Te,ue,"Generator"),ve(Te,ce,function(){return this}),ve(Te,"toString",function(){return"[object Generator]"});function Be(Ce){var Fe={tryLoc:Ce[0]};1 in Ce&&(Fe.catchLoc=Ce[1]),2 in Ce&&(Fe.finallyLoc=Ce[2],Fe.afterLoc=Ce[3]),this.tryEntries.push(Fe)}function De(Ce){var Fe=Ce.completion||{};Fe.type="normal",delete Fe.arg,Ce.completion=Fe}function Ne(Ce){this.tryEntries=[{tryLoc:"root"}],Ce.forEach(Be,this),this.reset(!0)}ne.keys=function(Ce){var Fe=Object(Ce),Ie=[];for(var Ue in Fe)Ie.push(Ue);return Ie.reverse(),function qe(){for(;Ie.length;){var je=Ie.pop();if(je in Fe)return qe.value=je,qe.done=!1,qe}return qe.done=!0,qe}};function Me(Ce){if(Ce){var Fe=Ce[ce];if(Fe)return Fe.call(Ce);if(typeof Ce.next=="function")return Ce;if(!isNaN(Ce.length)){var Ie=-1,Ue=function qe(){for(;++Ie<Ce.length;)if(re.call(Ce,Ie))return qe.value=Ce[Ie],qe.done=!1,qe;return qe.value=ie,qe.done=!0,qe};return Ue.next=Ue}}return{next:we}}ne.values=Me;function we(){return{value:ie,done:!0}}return Ne.prototype={constructor:Ne,reset:function(Ce){if(this.prev=0,this.next=0,this.sent=this._sent=ie,this.done=!1,this.delegate=null,this.method="next",this.arg=ie,this.tryEntries.forEach(De),!Ce)for(var Fe in this)Fe.charAt(0)==="t"&&re.call(this,Fe)&&!isNaN(+Fe.slice(1))&&(this[Fe]=ie)},stop:function(){this.done=!0;var Ce=this.tryEntries[0],Fe=Ce.completion;if(Fe.type==="throw")throw Fe.arg;return this.rval},dispatchException:function(Ce){if(this.done)throw Ce;var Fe=this;function Ie(Ke,et){return je.type="throw",je.arg=Ce,Fe.next=Ke,et&&(Fe.method="next",Fe.arg=ie),!!et}for(var Ue=this.tryEntries.length-1;Ue>=0;--Ue){var qe=this.tryEntries[Ue],je=qe.completion;if(qe.tryLoc==="root")return Ie("end");if(qe.tryLoc<=this.prev){var We=re.call(qe,"catchLoc"),Ge=re.call(qe,"finallyLoc");if(We&&Ge){if(this.prev<qe.catchLoc)return Ie(qe.catchLoc,!0);if(this.prev<qe.finallyLoc)return Ie(qe.finallyLoc)}else if(We){if(this.prev<qe.catchLoc)return Ie(qe.catchLoc,!0)}else if(Ge){if(this.prev<qe.finallyLoc)return Ie(qe.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(Ce,Fe){for(var Ie=this.tryEntries.length-1;Ie>=0;--Ie){var Ue=this.tryEntries[Ie];if(Ue.tryLoc<=this.prev&&re.call(Ue,"finallyLoc")&&this.prev<Ue.finallyLoc){var qe=Ue;break}}qe&&(Ce==="break"||Ce==="continue")&&qe.tryLoc<=Fe&&Fe<=qe.finallyLoc&&(qe=null);var je=qe?qe.completion:{};return je.type=Ce,je.arg=Fe,qe?(this.method="next",this.next=qe.finallyLoc,ke):this.complete(je)},complete:function(Ce,Fe){if(Ce.type==="throw")throw Ce.arg;return Ce.type==="break"||Ce.type==="continue"?this.next=Ce.arg:Ce.type==="return"?(this.rval=this.arg=Ce.arg,this.method="return",this.next="end"):Ce.type==="normal"&&Fe&&(this.next=Fe),ke},finish:function(Ce){for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Ie=this.tryEntries[Fe];if(Ie.finallyLoc===Ce)return this.complete(Ie.completion,Ie.afterLoc),De(Ie),ke}},catch:function(Ce){for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Ie=this.tryEntries[Fe];if(Ie.tryLoc===Ce){var Ue=Ie.completion;if(Ue.type==="throw"){var qe=Ue.arg;De(Ie)}return qe}}throw new Error("illegal catch attempt")},delegateYield:function(Ce,Fe,Ie){return this.delegate={iterator:Me(Ce),resultName:Fe,nextLoc:Ie},this.method==="next"&&(this.arg=ie),ke}},ne}(ee.exports);try{regeneratorRuntime=te}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=te:Function("r","regeneratorRuntime = r")(te)}}(runtime)),runtime.exports}var regenerator,hasRequiredRegenerator;function requireRegenerator(){return hasRequiredRegenerator||(hasRequiredRegenerator=1,regenerator=requireRuntime()),regenerator}var asyncToGenerator,hasRequiredAsyncToGenerator;function requireAsyncToGenerator(){if(hasRequiredAsyncToGenerator)return asyncToGenerator;hasRequiredAsyncToGenerator=1;function ee(ne,ae,re,oe,ie,le,ce){try{var de=ne[le](ce),ue=de.value}catch(ve){re(ve);return}de.done?ae(ue):Promise.resolve(ue).then(oe,ie)}function te(ne){return function(){var ae=this,re=arguments;return new Promise(function(oe,ie){var le=ne.apply(ae,re);function ce(ue){ee(le,oe,ie,ce,de,"next",ue)}function de(ue){ee(le,oe,ie,ce,de,"throw",ue)}ce(void 0)})}}return asyncToGenerator=te,asyncToGenerator}(function(ee){var te=interopRequireDefault;Object.defineProperty(ee,"__esModule",{value:!0}),ee.default=re;var ne=te(requireRegenerator()),ae=te(requireAsyncToGenerator());function re(ie){return oe.apply(this,arguments)}function oe(){return(oe=(0,ae.default)(ne.default.mark(function ie(le){var ce,de;return ne.default.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ce=document.createElement("video"),de=new Promise(function(ve,me){ce.addEventListener("loadedmetadata",function(){ce.duration===1/0?(ce.currentTime=Number.MAX_SAFE_INTEGER,ce.ontimeupdate=function(){ce.ontimeupdate=null,ve(ce.duration),ce.currentTime=0}):ve(ce.duration)}),ce.onerror=function(ge){return me(ge.target.error)}}),ce.src=typeof le=="string"||le instanceof String?le:window.URL.createObjectURL(le),ue.abrupt("return",de);case 4:case"end":return ue.stop()}},ie)}))).apply(this,arguments)}})(getBlobDuration$1);const getBlobDuration=getDefaultExportFromCjs(getBlobDuration$1),successResponse=()=>({value:!0}),failureResponse=()=>({value:!1}),missingPermissionError=()=>new Error("MISSING_PERMISSION"),alreadyRecordingError=()=>new Error("ALREADY_RECORDING"),deviceCannotVoiceRecordError=()=>new Error("DEVICE_CANNOT_VOICE_RECORD"),failedToRecordError=()=>new Error("FAILED_TO_RECORD"),emptyRecordingError=()=>new Error("EMPTY_RECORDING"),recordingHasNotStartedError=()=>new Error("RECORDING_HAS_NOT_STARTED"),failedToFetchRecordingError=()=>new Error("FAILED_TO_FETCH_RECORDING"),couldNotQueryPermissionStatusError=()=>new Error("COULD_NOT_QUERY_PERMISSION_STATUS"),POSSIBLE_MIME_TYPES={"audio/aac":".aac","audio/mp4":".mp3","audio/webm;codecs=opus":".ogg","audio/webm":".ogg","audio/ogg;codecs=opus":".ogg"},neverResolvingPromise=()=>new Promise(()=>{});class VoiceRecorderImpl{constructor(){this.mediaRecorder=null,this.chunks=[],this.pendingResult=neverResolvingPromise()}static async canDeviceVoiceRecord(){var te;return((te=navigator==null?void 0:navigator.mediaDevices)===null||te===void 0?void 0:te.getUserMedia)==null||VoiceRecorderImpl.getSupportedMimeType()==null?failureResponse():successResponse()}async startRecording(te){if(this.mediaRecorder!=null)throw alreadyRecordingError();if(!(await VoiceRecorderImpl.canDeviceVoiceRecord()).value)throw deviceCannotVoiceRecordError();if(!(await VoiceRecorderImpl.hasAudioRecordingPermission().catch(()=>successResponse())).value)throw missingPermissionError();return navigator.mediaDevices.getUserMedia({audio:!0}).then(re=>this.onSuccessfullyStartedRecording(re,te)).catch(this.onFailedToStartRecording.bind(this))}async stopRecording(){if(this.mediaRecorder==null)throw recordingHasNotStartedError();try{return this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(te=>te.stop()),this.pendingResult}catch{throw failedToFetchRecordingError()}finally{this.prepareInstanceForNextOperation()}}static async hasAudioRecordingPermission(){return navigator.permissions.query==null?navigator.mediaDevices==null?Promise.reject(couldNotQueryPermissionStatusError()):navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>successResponse()).catch(()=>{throw couldNotQueryPermissionStatusError()}):navigator.permissions.query({name:"microphone"}).then(te=>({value:te.state==="granted"})).catch(()=>{throw couldNotQueryPermissionStatusError()})}static async requestAudioRecordingPermission(){return(await VoiceRecorderImpl.hasAudioRecordingPermission().catch(()=>failureResponse())).value?successResponse():navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>successResponse()).catch(()=>failureResponse())}pauseRecording(){if(this.mediaRecorder==null)throw recordingHasNotStartedError();return this.mediaRecorder.state==="recording"?(this.mediaRecorder.pause(),Promise.resolve(successResponse())):Promise.resolve(failureResponse())}resumeRecording(){if(this.mediaRecorder==null)throw recordingHasNotStartedError();return this.mediaRecorder.state==="paused"?(this.mediaRecorder.resume(),Promise.resolve(successResponse())):Promise.resolve(failureResponse())}getCurrentStatus(){return this.mediaRecorder==null?Promise.resolve({status:RecordingStatus.NONE}):this.mediaRecorder.state==="recording"?Promise.resolve({status:RecordingStatus.RECORDING}):this.mediaRecorder.state==="paused"?Promise.resolve({status:RecordingStatus.PAUSED}):Promise.resolve({status:RecordingStatus.NONE})}static getSupportedMimeType(){if((MediaRecorder==null?void 0:MediaRecorder.isTypeSupported)==null)return null;const te=Object.keys(POSSIBLE_MIME_TYPES).find(ne=>MediaRecorder.isTypeSupported(ne));return te??null}onSuccessfullyStartedRecording(te,ne){return this.pendingResult=new Promise((ae,re)=>{this.mediaRecorder=new MediaRecorder(te),this.mediaRecorder.onerror=()=>{this.prepareInstanceForNextOperation(),re(failedToRecordError())},this.mediaRecorder.onstop=async()=>{var oe,ie,le;const ce=VoiceRecorderImpl.getSupportedMimeType();if(ce==null){this.prepareInstanceForNextOperation(),re(failedToFetchRecordingError());return}const de=new Blob(this.chunks,{type:ce});if(de.size<=0){this.prepareInstanceForNextOperation(),re(emptyRecordingError());return}let ue,ve;ne!=null?(ue=`${(le=(ie=(oe=ne.subDirectory)===null||oe===void 0?void 0:oe.match(/^\/?(.+[^/])\/?$/))===null||ie===void 0?void 0:ie[1])!==null&&le!==void 0?le:""}/recording-${new Date().getTime()}${POSSIBLE_MIME_TYPES[ce]}`,await write_blob$1({blob:de,directory:ne.directory,fast_mode:!0,path:ue,recursive:!0})):ve=await VoiceRecorderImpl.blobToBase64(de);const me=await getBlobDuration(de);this.prepareInstanceForNextOperation(),ae({value:{recordDataBase64:ve,mimeType:ce,msDuration:me*1e3,path:ue}})},this.mediaRecorder.ondataavailable=oe=>this.chunks.push(oe.data),this.mediaRecorder.start()}),successResponse()}onFailedToStartRecording(){throw this.prepareInstanceForNextOperation(),failedToRecordError()}static blobToBase64(te){return new Promise(ne=>{const ae=new FileReader;ae.onloadend=()=>{const re=String(ae.result),oe=re.split("base64,"),ie=oe.length>1?oe[1]:re;ne(ie.trim())},ae.readAsDataURL(te)})}prepareInstanceForNextOperation(){if(this.mediaRecorder!=null&&this.mediaRecorder.state==="recording")try{this.mediaRecorder.stop()}catch(te){console.warn("While trying to stop a media recorder, an error was thrown",te)}this.pendingResult=neverResolvingPromise(),this.mediaRecorder=null,this.chunks=[]}}class VoiceRecorderWeb extends WebPlugin{constructor(){super(...arguments),this.voiceRecorderInstance=new VoiceRecorderImpl}canDeviceVoiceRecord(){return VoiceRecorderImpl.canDeviceVoiceRecord()}hasAudioRecordingPermission(){return VoiceRecorderImpl.hasAudioRecordingPermission()}requestAudioRecordingPermission(){return VoiceRecorderImpl.requestAudioRecordingPermission()}startRecording(te){return this.voiceRecorderInstance.startRecording(te)}stopRecording(){return this.voiceRecorderInstance.stopRecording()}pauseRecording(){return this.voiceRecorderInstance.pauseRecording()}resumeRecording(){return this.voiceRecorderInstance.resumeRecording()}getCurrentStatus(){return this.voiceRecorderInstance.getCurrentStatus()}}const web$1=Object.freeze(Object.defineProperty({__proto__:null,VoiceRecorderWeb},Symbol.toStringTag,{value:"Module"}));var lottie={exports:{}};(function(module,exports){typeof navigator<"u"&&function(ee,te){module.exports=te()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(te){_useWebWorker=!!te},getWebWorker=function(){return _useWebWorker},setLocationHref=function(te){locationHref=te},getLocationHref=function(){return locationHref};function createTag(ee){return document.createElement(ee)}function extendPrototype(ee,te){var ne,ae=ee.length,re;for(ne=0;ne<ae;ne+=1){re=ee[ne].prototype;for(var oe in re)Object.prototype.hasOwnProperty.call(re,oe)&&(te.prototype[oe]=re[oe])}}function getDescriptor(ee,te){return Object.getOwnPropertyDescriptor(ee,te)}function createProxyFunction(ee){function te(){}return te.prototype=ee,te}var audioControllerFactory=function(){function ee(te){this.audios=[],this.audioFactory=te,this._volume=1,this._isMuted=!1}return ee.prototype={addAudio:function(ne){this.audios.push(ne)},pause:function(){var ne,ae=this.audios.length;for(ne=0;ne<ae;ne+=1)this.audios[ne].pause()},resume:function(){var ne,ae=this.audios.length;for(ne=0;ne<ae;ne+=1)this.audios[ne].resume()},setRate:function(ne){var ae,re=this.audios.length;for(ae=0;ae<re;ae+=1)this.audios[ae].setRate(ne)},createAudio:function(ne){return this.audioFactory?this.audioFactory(ne):window.Howl?new window.Howl({src:[ne]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(ne){this.audioFactory=ne},setVolume:function(ne){this._volume=ne,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var ne,ae=this.audios.length;for(ne=0;ne<ae;ne+=1)this.audios[ne].volume(this._volume*(this._isMuted?0:1))}},function(){return new ee}}(),createTypedArray=function(){function ee(ne,ae){var re=0,oe=[],ie;switch(ne){case"int16":case"uint8c":ie=1;break;default:ie=1.1;break}for(re=0;re<ae;re+=1)oe.push(ie);return oe}function te(ne,ae){return ne==="float32"?new Float32Array(ae):ne==="int16"?new Int16Array(ae):ne==="uint8c"?new Uint8ClampedArray(ae):ee(ne,ae)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?te:ee}();function createSizedArray(ee){return Array.apply(null,{length:ee})}function _typeof$6(ee){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$6=function(ne){return typeof ne}:_typeof$6=function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},_typeof$6(ee)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var ee=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],te,ne=ee.length;for(te=0;te<ne;te+=1)BMMath[ee[te]]=Math[ee[te]]})(),BMMath.random=Math.random,BMMath.abs=function(ee){var te=_typeof$6(ee);if(te==="object"&&ee.length){var ne=createSizedArray(ee.length),ae,re=ee.length;for(ae=0;ae<re;ae+=1)ne[ae]=Math.abs(ee[ae]);return ne}return Math.abs(ee)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(ee){ee.style.position="absolute",ee.style.top=0,ee.style.left=0,ee.style.display="block",ee.style.transformOrigin="0 0",ee.style.webkitTransformOrigin="0 0",ee.style.backfaceVisibility="visible",ee.style.webkitBackfaceVisibility="visible",ee.style.transformStyle="preserve-3d",ee.style.webkitTransformStyle="preserve-3d",ee.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(ee,te,ne,ae){this.type=ee,this.currentTime=te,this.totalTime=ne,this.direction=ae<0?-1:1}function BMCompleteEvent(ee,te){this.type=ee,this.direction=te<0?-1:1}function BMCompleteLoopEvent(ee,te,ne,ae){this.type=ee,this.currentLoop=ne,this.totalLoops=te,this.direction=ae<0?-1:1}function BMSegmentStartEvent(ee,te,ne){this.type=ee,this.firstFrame=te,this.totalFrames=ne}function BMDestroyEvent(ee,te){this.type=ee,this.target=te}function BMRenderFrameErrorEvent(ee,te){this.type="renderFrameError",this.nativeError=ee,this.currentTime=te}function BMConfigErrorEvent(ee){this.type="configError",this.nativeError=ee}var createElementID=function(){var ee=0;return function(){return ee+=1,idPrefix$1+"__lottie_element_"+ee}}();function HSVtoRGB(ee,te,ne){var ae,re,oe,ie,le,ce,de,ue;switch(ie=Math.floor(ee*6),le=ee*6-ie,ce=ne*(1-te),de=ne*(1-le*te),ue=ne*(1-(1-le)*te),ie%6){case 0:ae=ne,re=ue,oe=ce;break;case 1:ae=de,re=ne,oe=ce;break;case 2:ae=ce,re=ne,oe=ue;break;case 3:ae=ce,re=de,oe=ne;break;case 4:ae=ue,re=ce,oe=ne;break;case 5:ae=ne,re=ce,oe=de;break}return[ae,re,oe]}function RGBtoHSV(ee,te,ne){var ae=Math.max(ee,te,ne),re=Math.min(ee,te,ne),oe=ae-re,ie,le=ae===0?0:oe/ae,ce=ae/255;switch(ae){case re:ie=0;break;case ee:ie=te-ne+oe*(te<ne?6:0),ie/=6*oe;break;case te:ie=ne-ee+oe*2,ie/=6*oe;break;case ne:ie=ee-te+oe*4,ie/=6*oe;break}return[ie,le,ce]}function addSaturationToRGB(ee,te){var ne=RGBtoHSV(ee[0]*255,ee[1]*255,ee[2]*255);return ne[1]+=te,ne[1]>1?ne[1]=1:ne[1]<=0&&(ne[1]=0),HSVtoRGB(ne[0],ne[1],ne[2])}function addBrightnessToRGB(ee,te){var ne=RGBtoHSV(ee[0]*255,ee[1]*255,ee[2]*255);return ne[2]+=te,ne[2]>1?ne[2]=1:ne[2]<0&&(ne[2]=0),HSVtoRGB(ne[0],ne[1],ne[2])}function addHueToRGB(ee,te){var ne=RGBtoHSV(ee[0]*255,ee[1]*255,ee[2]*255);return ne[0]+=te/360,ne[0]>1?ne[0]-=1:ne[0]<0&&(ne[0]+=1),HSVtoRGB(ne[0],ne[1],ne[2])}var rgbToHex=function(){var ee=[],te,ne;for(te=0;te<256;te+=1)ne=te.toString(16),ee[te]=ne.length===1?"0"+ne:ne;return function(ae,re,oe){return ae<0&&(ae=0),re<0&&(re=0),oe<0&&(oe=0),"#"+ee[ae]+ee[re]+ee[oe]}}(),setSubframeEnabled=function(te){subframeEnabled=!!te},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(te){expressionsPlugin=te},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(te){expressionsInterfaces=te},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(te){defaultCurveSegments=te},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(te){idPrefix$1=te};function createNS(ee){return document.createElementNS(svgNS,ee)}function _typeof$5(ee){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(ne){return typeof ne}:_typeof$5=function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},_typeof$5(ee)}var dataManager=function(){var ee=1,te=[],ne,ae,re={onmessage:function(){},postMessage:function(ge){ne({data:ge})}},oe={postMessage:function(ge){re.onmessage({data:ge})}};function ie(me){if(window.Worker&&window.Blob&&getWebWorker()){var ge=new Blob(["var _workerSelf = self; self.onmessage = ",me.toString()],{type:"text/javascript"}),fe=URL.createObjectURL(ge);return new Worker(fe)}return ne=me,re}function le(){ae||(ae=ie(function(ge){function fe(){function _e(De,Ne){var Me,we,Ce=De.length,Fe,Ie,Ue,qe;for(we=0;we<Ce;we+=1)if(Me=De[we],"ks"in Me&&!Me.completed){if(Me.completed=!0,Me.hasMask){var je=Me.masksProperties;for(Ie=je.length,Fe=0;Fe<Ie;Fe+=1)if(je[Fe].pt.k.i)Ee(je[Fe].pt.k);else for(qe=je[Fe].pt.k.length,Ue=0;Ue<qe;Ue+=1)je[Fe].pt.k[Ue].s&&Ee(je[Fe].pt.k[Ue].s[0]),je[Fe].pt.k[Ue].e&&Ee(je[Fe].pt.k[Ue].e[0])}Me.ty===0?(Me.layers=$e(Me.refId,Ne),_e(Me.layers,Ne)):Me.ty===4?ye(Me.shapes):Me.ty===5&&Pe(Me)}}function be(De,Ne){if(De){var Me=0,we=De.length;for(Me=0;Me<we;Me+=1)De[Me].t===1&&(De[Me].data.layers=$e(De[Me].data.refId,Ne),_e(De[Me].data.layers,Ne))}}function ke(De,Ne){for(var Me=0,we=Ne.length;Me<we;){if(Ne[Me].id===De)return Ne[Me];Me+=1}return null}function $e(De,Ne){var Me=ke(De,Ne);return Me?Me.layers.__used?JSON.parse(JSON.stringify(Me.layers)):(Me.layers.__used=!0,Me.layers):null}function ye(De){var Ne,Me=De.length,we,Ce;for(Ne=Me-1;Ne>=0;Ne-=1)if(De[Ne].ty==="sh")if(De[Ne].ks.k.i)Ee(De[Ne].ks.k);else for(Ce=De[Ne].ks.k.length,we=0;we<Ce;we+=1)De[Ne].ks.k[we].s&&Ee(De[Ne].ks.k[we].s[0]),De[Ne].ks.k[we].e&&Ee(De[Ne].ks.k[we].e[0]);else De[Ne].ty==="gr"&&ye(De[Ne].it)}function Ee(De){var Ne,Me=De.i.length;for(Ne=0;Ne<Me;Ne+=1)De.i[Ne][0]+=De.v[Ne][0],De.i[Ne][1]+=De.v[Ne][1],De.o[Ne][0]+=De.v[Ne][0],De.o[Ne][1]+=De.v[Ne][1]}function Se(De,Ne){var Me=Ne?Ne.split("."):[100,100,100];return De[0]>Me[0]?!0:Me[0]>De[0]?!1:De[1]>Me[1]?!0:Me[1]>De[1]?!1:De[2]>Me[2]?!0:Me[2]>De[2]?!1:null}var Le=function(){var De=[4,4,14];function Ne(we){var Ce=we.t.d;we.t.d={k:[{s:Ce,t:0}]}}function Me(we){var Ce,Fe=we.length;for(Ce=0;Ce<Fe;Ce+=1)we[Ce].ty===5&&Ne(we[Ce])}return function(we){if(Se(De,we.v)&&(Me(we.layers),we.assets)){var Ce,Fe=we.assets.length;for(Ce=0;Ce<Fe;Ce+=1)we.assets[Ce].layers&&Me(we.assets[Ce].layers)}}}(),Ve=function(){var De=[4,7,99];return function(Ne){if(Ne.chars&&!Se(De,Ne.v)){var Me,we=Ne.chars.length;for(Me=0;Me<we;Me+=1){var Ce=Ne.chars[Me];Ce.data&&Ce.data.shapes&&(ye(Ce.data.shapes),Ce.data.ip=0,Ce.data.op=99999,Ce.data.st=0,Ce.data.sr=1,Ce.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},Ne.chars[Me].t||(Ce.data.shapes.push({ty:"no"}),Ce.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),Te=function(){var De=[5,7,15];function Ne(we){var Ce=we.t.p;typeof Ce.a=="number"&&(Ce.a={a:0,k:Ce.a}),typeof Ce.p=="number"&&(Ce.p={a:0,k:Ce.p}),typeof Ce.r=="number"&&(Ce.r={a:0,k:Ce.r})}function Me(we){var Ce,Fe=we.length;for(Ce=0;Ce<Fe;Ce+=1)we[Ce].ty===5&&Ne(we[Ce])}return function(we){if(Se(De,we.v)&&(Me(we.layers),we.assets)){var Ce,Fe=we.assets.length;for(Ce=0;Ce<Fe;Ce+=1)we.assets[Ce].layers&&Me(we.assets[Ce].layers)}}}(),ze=function(){var De=[4,1,9];function Ne(we){var Ce,Fe=we.length,Ie,Ue;for(Ce=0;Ce<Fe;Ce+=1)if(we[Ce].ty==="gr")Ne(we[Ce].it);else if(we[Ce].ty==="fl"||we[Ce].ty==="st")if(we[Ce].c.k&&we[Ce].c.k[0].i)for(Ue=we[Ce].c.k.length,Ie=0;Ie<Ue;Ie+=1)we[Ce].c.k[Ie].s&&(we[Ce].c.k[Ie].s[0]/=255,we[Ce].c.k[Ie].s[1]/=255,we[Ce].c.k[Ie].s[2]/=255,we[Ce].c.k[Ie].s[3]/=255),we[Ce].c.k[Ie].e&&(we[Ce].c.k[Ie].e[0]/=255,we[Ce].c.k[Ie].e[1]/=255,we[Ce].c.k[Ie].e[2]/=255,we[Ce].c.k[Ie].e[3]/=255);else we[Ce].c.k[0]/=255,we[Ce].c.k[1]/=255,we[Ce].c.k[2]/=255,we[Ce].c.k[3]/=255}function Me(we){var Ce,Fe=we.length;for(Ce=0;Ce<Fe;Ce+=1)we[Ce].ty===4&&Ne(we[Ce].shapes)}return function(we){if(Se(De,we.v)&&(Me(we.layers),we.assets)){var Ce,Fe=we.assets.length;for(Ce=0;Ce<Fe;Ce+=1)we.assets[Ce].layers&&Me(we.assets[Ce].layers)}}}(),Re=function(){var De=[4,4,18];function Ne(we){var Ce,Fe=we.length,Ie,Ue;for(Ce=Fe-1;Ce>=0;Ce-=1)if(we[Ce].ty==="sh")if(we[Ce].ks.k.i)we[Ce].ks.k.c=we[Ce].closed;else for(Ue=we[Ce].ks.k.length,Ie=0;Ie<Ue;Ie+=1)we[Ce].ks.k[Ie].s&&(we[Ce].ks.k[Ie].s[0].c=we[Ce].closed),we[Ce].ks.k[Ie].e&&(we[Ce].ks.k[Ie].e[0].c=we[Ce].closed);else we[Ce].ty==="gr"&&Ne(we[Ce].it)}function Me(we){var Ce,Fe,Ie=we.length,Ue,qe,je,We;for(Fe=0;Fe<Ie;Fe+=1){if(Ce=we[Fe],Ce.hasMask){var Ge=Ce.masksProperties;for(qe=Ge.length,Ue=0;Ue<qe;Ue+=1)if(Ge[Ue].pt.k.i)Ge[Ue].pt.k.c=Ge[Ue].cl;else for(We=Ge[Ue].pt.k.length,je=0;je<We;je+=1)Ge[Ue].pt.k[je].s&&(Ge[Ue].pt.k[je].s[0].c=Ge[Ue].cl),Ge[Ue].pt.k[je].e&&(Ge[Ue].pt.k[je].e[0].c=Ge[Ue].cl)}Ce.ty===4&&Ne(Ce.shapes)}}return function(we){if(Se(De,we.v)&&(Me(we.layers),we.assets)){var Ce,Fe=we.assets.length;for(Ce=0;Ce<Fe;Ce+=1)we.assets[Ce].layers&&Me(we.assets[Ce].layers)}}}();function Oe(De){De.__complete||(ze(De),Le(De),Ve(De),Te(De),Re(De),_e(De.layers,De.assets),be(De.chars,De.assets),De.__complete=!0)}function Pe(De){De.t.a.length===0&&"m"in De.t.p}var Be={};return Be.completeData=Oe,Be.checkColors=ze,Be.checkChars=Ve,Be.checkPathProperties=Te,Be.checkShapes=Re,Be.completeLayers=_e,Be}if(oe.dataManager||(oe.dataManager=fe()),oe.assetLoader||(oe.assetLoader=function(){function _e(ke){var $e=ke.getResponseHeader("content-type");return $e&&ke.responseType==="json"&&$e.indexOf("json")!==-1||ke.response&&_typeof$5(ke.response)==="object"?ke.response:ke.response&&typeof ke.response=="string"?JSON.parse(ke.response):ke.responseText?JSON.parse(ke.responseText):null}function be(ke,$e,ye,Ee){var Se,Le=new XMLHttpRequest;try{Le.responseType="json"}catch{}Le.onreadystatechange=function(){if(Le.readyState===4)if(Le.status===200)Se=_e(Le),ye(Se);else try{Se=_e(Le),ye(Se)}catch(Ve){Ee&&Ee(Ve)}};try{Le.open(["G","E","T"].join(""),ke,!0)}catch{Le.open(["G","E","T"].join(""),$e+"/"+ke,!0)}Le.send()}return{load:be}}()),ge.data.type==="loadAnimation")oe.assetLoader.load(ge.data.path,ge.data.fullPath,function(_e){oe.dataManager.completeData(_e),oe.postMessage({id:ge.data.id,payload:_e,status:"success"})},function(){oe.postMessage({id:ge.data.id,status:"error"})});else if(ge.data.type==="complete"){var pe=ge.data.animation;oe.dataManager.completeData(pe),oe.postMessage({id:ge.data.id,payload:pe,status:"success"})}else ge.data.type==="loadData"&&oe.assetLoader.load(ge.data.path,ge.data.fullPath,function(_e){oe.postMessage({id:ge.data.id,payload:_e,status:"success"})},function(){oe.postMessage({id:ge.data.id,status:"error"})})}),ae.onmessage=function(me){var ge=me.data,fe=ge.id,pe=te[fe];te[fe]=null,ge.status==="success"?pe.onComplete(ge.payload):pe.onError&&pe.onError()})}function ce(me,ge){ee+=1;var fe="processId_"+ee;return te[fe]={onComplete:me,onError:ge},fe}function de(me,ge,fe){le();var pe=ce(ge,fe);ae.postMessage({type:"loadAnimation",path:me,fullPath:window.location.origin+window.location.pathname,id:pe})}function ue(me,ge,fe){le();var pe=ce(ge,fe);ae.postMessage({type:"loadData",path:me,fullPath:window.location.origin+window.location.pathname,id:pe})}function ve(me,ge,fe){le();var pe=ce(ge,fe);ae.postMessage({type:"complete",animation:me,id:pe})}return{loadAnimation:de,loadData:ue,completeAnimation:ve}}(),ImagePreloader=function(){var ee=function(){var be=createTag("canvas");be.width=1,be.height=1;var ke=be.getContext("2d");return ke.fillStyle="rgba(0,0,0,0)",ke.fillRect(0,0,1,1),be}();function te(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function ne(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function ae(be,ke,$e){var ye="";if(be.e)ye=be.p;else if(ke){var Ee=be.p;Ee.indexOf("images/")!==-1&&(Ee=Ee.split("/")[1]),ye=ke+Ee}else ye=$e,ye+=be.u?be.u:"",ye+=be.p;return ye}function re(be){var ke=0,$e=setInterval((function(){var ye=be.getBBox();(ye.width||ke>500)&&(this._imageLoaded(),clearInterval($e)),ke+=1}).bind(this),50)}function oe(be){var ke=ae(be,this.assetsPath,this.path),$e=createNS("image");isSafari?this.testImageLoaded($e):$e.addEventListener("load",this._imageLoaded,!1),$e.addEventListener("error",(function(){ye.img=ee,this._imageLoaded()}).bind(this),!1),$e.setAttributeNS("http://www.w3.org/1999/xlink","href",ke),this._elementHelper.append?this._elementHelper.append($e):this._elementHelper.appendChild($e);var ye={img:$e,assetData:be};return ye}function ie(be){var ke=ae(be,this.assetsPath,this.path),$e=createTag("img");$e.crossOrigin="anonymous",$e.addEventListener("load",this._imageLoaded,!1),$e.addEventListener("error",(function(){ye.img=ee,this._imageLoaded()}).bind(this),!1),$e.src=ke;var ye={img:$e,assetData:be};return ye}function le(be){var ke={assetData:be},$e=ae(be,this.assetsPath,this.path);return dataManager.loadData($e,(function(ye){ke.img=ye,this._footageLoaded()}).bind(this),(function(){ke.img={},this._footageLoaded()}).bind(this)),ke}function ce(be,ke){this.imagesLoadedCb=ke;var $e,ye=be.length;for($e=0;$e<ye;$e+=1)be[$e].layers||(!be[$e].t||be[$e].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(be[$e]))):be[$e].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(be[$e]))))}function de(be){this.path=be||""}function ue(be){this.assetsPath=be||""}function ve(be){for(var ke=0,$e=this.images.length;ke<$e;){if(this.images[ke].assetData===be)return this.images[ke].img;ke+=1}return null}function me(){this.imagesLoadedCb=null,this.images.length=0}function ge(){return this.totalImages===this.loadedAssets}function fe(){return this.totalFootages===this.loadedFootagesCount}function pe(be,ke){be==="svg"?(this._elementHelper=ke,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function _e(){this._imageLoaded=te.bind(this),this._footageLoaded=ne.bind(this),this.testImageLoaded=re.bind(this),this.createFootageData=le.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return _e.prototype={loadAssets:ce,setAssetsPath:ue,setPath:de,loadedImages:ge,loadedFootages:fe,destroy:me,getAsset:ve,createImgData:ie,createImageData:oe,imageLoaded:te,footageLoaded:ne,setCacheType:pe},_e}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(te,ne){if(this._cbs[te])for(var ae=this._cbs[te],re=0;re<ae.length;re+=1)ae[re](ne)},addEventListener:function(te,ne){return this._cbs[te]||(this._cbs[te]=[]),this._cbs[te].push(ne),(function(){this.removeEventListener(te,ne)}).bind(this)},removeEventListener:function(te,ne){if(!ne)this._cbs[te]=null;else if(this._cbs[te]){for(var ae=0,re=this._cbs[te].length;ae<re;)this._cbs[te][ae]===ne&&(this._cbs[te].splice(ae,1),ae-=1,re-=1),ae+=1;this._cbs[te].length||(this._cbs[te]=null)}}};var markerParser=function(){function ee(te){for(var ne=te.split(`\r
|
|
283
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())[0],Ie=Ne;ne("update:selectedValue",Ie),ne("selectedChange",Ie,Fe)}},Le=function(Pe){ne("nodeClick",Pe)},Ve=function(Pe){ne("nodeMouseover",Pe)},Te=function(Pe,Be){if(Pe)le.hiddenPaths=V(V({},le.hiddenPaths),{},l({},Be,1));else{var De=V({},le.hiddenPaths);delete De[Be],le.hiddenPaths=De}},ze=function(Pe,Be){ee.collapsedOnClickBrackets&&Te(Pe,Be.path),ne("bracketsClick",Pe,Be)},Re=function(Pe,Be){Te(Pe,Be.path),ne("iconClick",Pe,Be)},Oe=function(Pe,Be){var De=b(ee.data),Ne=ee.rootPath;new Function("data","val","data".concat(Be.slice(Ne.length),"=val"))(De,Pe),ne("update:data",De)};return(0,u$1.watchEffect)(function(){be.value&&function(Pe){throw new Error("[VueJSONPretty] ".concat(Pe))}(be.value)}),(0,u$1.watchEffect)(function(){pe.value&&(ee.virtual&&ee.dynamicHeight&&ce.length!==pe.value.length&&me(pe.value.length),$e())}),(0,u$1.watch)(function(){return[ee.dynamicHeight,ee.itemHeight,oe.value.length]},function(){ee.virtual&&ee.dynamicHeight&&(me(pe.value.length),(0,u$1.nextTick)($e))}),(0,u$1.watch)(function(){return ee.deep},function(Pe){Pe&&(le.hiddenPaths=ie(Pe,ee.collapsedNodeLength))}),(0,u$1.watch)(function(){return ee.collapsedNodeLength},function(Pe){Pe&&(le.hiddenPaths=ie(ee.deep,Pe))}),function(){var Pe,Be,De,Ne,Me,we=(Pe=ee.renderNodeKey)!==null&&Pe!==void 0?Pe:ae.renderNodeKey,Ce=(Be=ee.renderNodeValue)!==null&&Be!==void 0?Be:ae.renderNodeValue,Fe=(De=(Ne=ee.renderNodeActions)!==null&&Ne!==void 0?Ne:ae.renderNodeActions)!==null&&De!==void 0&&De,Ie=(Me=le.visibleData)===null||Me===void 0?void 0:Me.map(function(Ue,qe){var je=le.startIndex+qe;return(0,u$1.createVNode)("div",{key:Ue.id,ref:function(We){return function(Ge,Ke){Ke?ve[Ge]=Ke:delete ve[Ge]}(je,We||null)}},[(0,u$1.createVNode)(S,{data:ee.data,rootPath:ee.rootPath,indent:ee.indent,node:Ue,collapsed:!!le.hiddenPaths[Ue.path],theme:ee.theme,showDoubleQuotes:ee.showDoubleQuotes,showLength:ee.showLength,checked:_e.value.includes(Ue.path),selectableType:ee.selectableType,showLine:ee.showLine,showLineNumber:ee.showLineNumber,showSelectController:ee.showSelectController,selectOnClickNode:ee.selectOnClickNode,nodeSelectable:ee.nodeSelectable,highlightSelectedNode:ee.highlightSelectedNode,editable:ee.editable,editableTrigger:ee.editableTrigger,showIcon:ee.showIcon,showKeyValueSpace:ee.showKeyValueSpace,renderNodeKey:we,renderNodeValue:Ce,renderNodeActions:Fe,onNodeClick:Le,onNodeMouseover:Ve,onBracketsClick:ze,onIconClick:Re,onSelectedChange:Se,onValueChange:Oe,class:ee.dynamicHeight?"dynamic-height":void 0,style:ee.dynamicHeight?{}:ee.itemHeight&&ee.itemHeight!==20?{lineHeight:"".concat(ee.itemHeight,"px")}:{}},null)])});return(0,u$1.createVNode)("div",{ref:re,class:{"vjs-tree":!0,"is-virtual":ee.virtual,dark:ee.theme==="dark"},onScroll:ee.virtual?Ee:void 0,style:ee.showLineNumber?V({paddingLeft:"".concat(12*Number(oe.value.length.toString().length),"px")},ee.style):ee.style},[ee.virtual?(0,u$1.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(ee.height,"px")}},[(0,u$1.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(ke.value,"px")}},[(0,u$1.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(le.translateY,"px)")}},[Ie])])]):Ie])}}});var P=o.A;const _hoisted_1$m={class:"space-y-2"},_hoisted_2$k={class:"w-full overflow-auto p-2 pb-3"},_hoisted_3$h={class:"info_form"},_hoisted_4$g={key:0,class:"p-2"},_hoisted_5$e={key:0,class:"flex items-center"},_hoisted_6$b={key:1,class:"flex items-center"},_hoisted_7$b={key:2,class:"flex items-center"},_hoisted_8$7={key:1,class:"border-t border-gray-700 dark:border-gray-300"},_hoisted_9$5={class:"p-2 px-4 opacity-80"},_hoisted_10$5={key:0},_hoisted_11$5={key:1},_hoisted_12$4={key:0,class:"info_form"},_hoisted_13$2={class:"flex max-h-[200px] flex-wrap items-center gap-2 overflow-auto p-2"},_hoisted_14$2={key:1,class:"info_form"},_hoisted_15$2={class:"flex items-center p-2"},_hoisted_16$2={key:0,class:"overflow-x-auto"},_hoisted_17$1={key:2,class:"info_form"},_hoisted_18$1={class:"p-2"},_hoisted_19$1={class:"flex items-center pl-1"},_hoisted_20$1={class:"mt-1 flex items-center pl-1"},_hoisted_21$1={key:3,class:"info_form"},_hoisted_22={class:"flex items-center p-2"},_sfc_main$p={__name:"MessageInfoPanel",props:{message:{type:Object,required:!0},now:{type:Date,default:null},brandBackground:{type:String,default:"zap"}},setup(ee){const te=ee,ne=useMessageUiStore(),ae=e$b.computed(()=>!ne.themeMode),re=e$b.computed(()=>te.now||new Date);function oe(ce){const de=new Date(Date.parse(ce)),ue=re.value;if(isSameWeek(de,ue)){const ve=new Date(ue);return ve.setDate(ve.getDate()-1),isSameDay(de,ue)?"Hoje":isSameDay(de,ve)?"Ontem":format(de,"iiii",{locale:ptBR})}return format(de,"dd/MM/yyyy",{locale:ptBR})}function ie(ce){try{return JSON.parse(String(ce).replace(/'/g,'"'))}catch{return!1}}const le=e$b.computed(()=>{var ce;return(ce=te.message)!=null&&ce.fail_reason?ie(te.message.fail_reason):!1});return(ce,de)=>{var ue,ve;return e$b.openBlock(),e$b.createElementBlock("main",_hoisted_1$m,[e$b.createElementVNode("section",{class:e$b.normalizeClass(["chat-background",`banner-${ee.brandBackground}`])},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["flex items-center justify-center",`bg-${ee.brandBackground}`])},null,2),e$b.createElementVNode("div",_hoisted_2$k,[e$b.createVNode(_sfc_main$u,{"is-info":!0,message:ee.message},null,8,["message"])])],2),e$b.createElementVNode("section",_hoisted_3$h,[e$b.createElementVNode("section",null,[ee.message.from_me?(e$b.openBlock(),e$b.createElementBlock("header",_hoisted_4$g,[ee.message.stage==="processing"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5$e,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,class:"mr-2 size-4"},null,8,["stage"]),de[0]||(de[0]=e$b.createTextVNode(" Processando ",-1))])):ee.message.stage==="received"||ee.message.stage==="sent"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$b,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,class:"mr-2"},null,8,["stage"]),de[1]||(de[1]=e$b.createTextVNode(" Recebida ",-1))])):ee.message.stage==="failed"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$b,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,"failed-size":14,class:"mr-2 size-4"},null,8,["stage"]),de[2]||(de[2]=e$b.createTextVNode(" Falhou ",-1))])):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),ee.message.from_me?(e$b.openBlock(),e$b.createElementBlock("hr",_hoisted_8$7)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_9$5,[ee.message.created_at?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10$5," Criada às "+e$b.toDisplayString(ee.message.created_at.split("T")[1].slice(0,5))+" - "+e$b.toDisplayString(oe(ee.message.created_at)),1)):e$b.createCommentVNode("",!0),ee.message.sent_at?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_11$5," Enviada às "+e$b.toDisplayString(ee.message.sent_at.split("T")[1].slice(0,5))+" - "+e$b.toDisplayString(oe(ee.message.sent_at)),1)):e$b.createCommentVNode("",!0)])])]),(ve=(ue=ee.message)==null?void 0:ue.content)!=null&&ve.history?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_12$4,[de[3]||(de[3]=e$b.createElementVNode("div",{class:"flex items-center p-2"},[e$b.createElementVNode("svg",{class:"mr-2 size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 2a2 2 0 0 0-2 2v15a3 3 0 0 0 3 3h12a1 1 0 1 0 0-2h-2v-2h2a1 1 0 0 0 1-1V4a2 2 0 0 0-2-2h-8v16h5v2H7a1 1 0 1 1 0-2h1V2H6Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Histórico de mensagem ")],-1)),de[4]||(de[4]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("div",_hoisted_13$2,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ee.message.content.history,(me,ge)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ge,class:"message-owner rounded-lg p-2 py-1"},e$b.toDisplayString(me),1))),128))])])):e$b.createCommentVNode("",!0),ee.message.fail_reason?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_14$2,[de[5]||(de[5]=e$b.createElementVNode("div",{class:"flex items-center p-2"},[e$b.createElementVNode("svg",{class:"mr-2 size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm11-4a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0V8Zm-1 7a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H12Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Motivo de falha ")],-1)),de[6]||(de[6]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("div",_hoisted_15$2,[le.value?(e$b.openBlock(),e$b.createBlock(e$b.unref(P),{key:1,"collapsed-on-click-brackets":!1,theme:ae.value?"light":"dark",data:le.value},null,8,["theme","data"])):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$2,e$b.toDisplayString(ee.message.fail_reason),1))])])):e$b.createCommentVNode("",!0),ee.message.instance?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_17$1,[de[9]||(de[9]=e$b.createElementVNode("div",{class:"flex items-center p-2"},[e$b.createElementVNode("svg",{class:"mr-2 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512"},[e$b.createElementVNode("path",{d:"M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z",fill:"currentColor"})]),e$b.createTextVNode(" Instância ")],-1)),de[10]||(de[10]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("main",_hoisted_18$1,[e$b.createElementVNode("div",_hoisted_19$1,[de[7]||(de[7]=e$b.createElementVNode("svg",{class:"mr-2 size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 20a8 8 0 0 1-5-1.8v-.6c0-1.8 1.5-3.3 3.3-3.3h3.4c1.8 0 3.3 1.5 3.3 3.3v.6a8 8 0 0 1-5 1.8ZM2 12a10 10 0 1 1 10 10A10 10 0 0 1 2 12Zm10-5a3.3 3.3 0 0 0-3.3 3.3c0 1.7 1.5 3.2 3.3 3.2 1.8 0 3.3-1.5 3.3-3.3C15.3 8.6 13.8 7 12 7Z","clip-rule":"evenodd"})],-1)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.message.instance.name),1)]),e$b.createElementVNode("div",_hoisted_20$1,[de[8]||(de[8]=e$b.createElementVNode("svg",{class:"mr-2 size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{d:"M8 4a2.6 2.6 0 0 0-2 .9 6.2 6.2 0 0 0-1.8 6 12 12 0 0 0 3.4 5.5 12 12 0 0 0 5.6 3.4 6.2 6.2 0 0 0 6.6-2.7 2.6 2.6 0 0 0-.7-3L18 12.9a2.7 2.7 0 0 0-3.8 0l-.6.6a.8.8 0 0 1-1.1 0l-1.9-1.8a.8.8 0 0 1 0-1.2l.6-.6a2.7 2.7 0 0 0 0-3.8L10 4.9A2.6 2.6 0 0 0 8 4Z"})],-1)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.message.instance.telephone),1)])])])):e$b.createCommentVNode("",!0),ee.message.sent_by?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_21$1,[de[11]||(de[11]=e$b.createElementVNode("div",{class:"flex items-center p-2 pl-3"},[e$b.createElementVNode("svg",{class:"mr-2 size-4 rotate-45","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2c.4 0 .8.3 1 .6l7 18a1 1 0 0 1-1.4 1.3L13 19.5V13a1 1 0 1 0-2 0v6.5L5.4 22A1 1 0 0 1 4 20.6l7-18a1 1 0 0 1 1-.6Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Remetente ")],-1)),de[12]||(de[12]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("div",_hoisted_22,[e$b.createVNode(Avatar,{class:"mr-4 size-10",size:"fill",photo:ee.message.sent_by.photo,name:ee.message.sent_by.name},null,8,["photo","name"]),e$b.createTextVNode(e$b.toDisplayString(ee.message.sent_by.name),1)])])):e$b.createCommentVNode("",!0)])}}},_hoisted_1$l={class:"h-full max-h-[500px] overflow-auto"},_hoisted_2$j={style:{"border-bottom-left-radius":"0px","border-bottom-right-radius":"0px"},class:"chat-background banner-zap"},_sfc_main$o=Object.assign({inheritAttrs:!1},{__name:"MessageQuickPreview",props:{message:{type:Array,default:()=>[]}},setup(ee){const te=ee,ne=useMessageUiStore();function ae(oe){var ue;const ie=ne.loggedAttendant,le={name:(ie==null?void 0:ie.name)||"Atendente",photo:(ie==null?void 0:ie.photo)||null},ce=new Date().toISOString(),de=(ue=oe.file_type)!=null&&ue.includes("/")?oe.file_type.split("/")[1]:oe.file_type;return{id:crypto.randomUUID(),type:oe.type||"text",stage:"sent",sent_by:{id:ie==null?void 0:ie.id,...le},content:{text:oe.message||"",is_ad:!1,sender:le,ad_info:null,url:oe.url||null,type:de||oe.type||null,title:oe.title||null,caption:oe.caption||null},whatsapp_id:null,status:!0,from_me:!0,created_at:ce,updated_at:ce,sent_at:ce,quoted:null}}const re=e$b.computed(()=>te.message.map(ae));return(oe,ie)=>(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_1$l,[e$b.createElementVNode("section",_hoisted_2$j,[ie[0]||(ie[0]=e$b.createElementVNode("div",{class:"bg-zap flex items-center justify-center"},null,-1)),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(re.value,(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:le.id,class:"pb-2"},[e$b.createVNode(_sfc_main$u,e$b.mergeProps({"is-info":!0,message:le,"next-message":re.value[ce-1]},{ref_for:!0},oe.$attrs),null,16,["message","next-message"])]))),128))])]))}}),_hoisted_1$k={class:"sm-emoji-drawer-inline__crop"},DISMISS_RATIO=.28,DISMISS_VELOCITY=.6,DRAG_TOLERANCE=6,_sfc_main$n={__name:"EmojiPickerDrawer",props:{show:{type:Boolean,default:!1},theme:{type:String,default:"light"},categories:{type:Array,default:()=>EMOJI_CATEGORIES},inline:{type:Boolean,default:!1}},emits:["close","select"],setup(ee,{emit:te}){const ne=ee,ae=te;function re(Se){Se.key==="Escape"&&ne.show&&ae("close")}e$b.onMounted(()=>document.addEventListener("keydown",re)),e$b.onBeforeUnmount(()=>{document.removeEventListener("keydown",re),document.removeEventListener("pointerdown",oe,!0)});function oe(Se){!ne.inline||!ne.show||ie.value&&!ie.value.contains(Se.target)&&ae("close")}e$b.watch(()=>ne.show&&ne.inline,Se=>{document.removeEventListener("pointerdown",oe,!0),Se&&document.addEventListener("pointerdown",oe,!0)});const ie=e$b.ref(null),le=e$b.ref(!1),ce=e$b.ref(0);let de=null,ue=0,ve=0,me=0,ge=0,fe=0,pe=!1;function _e(Se){ie.value&&(de=Se.pointerId,ue=Se.clientY,me=Se.clientY,ge=Se.timeStamp,fe=0,pe=!1,ve=ie.value.offsetHeight,le.value=!0,Se.currentTarget.setPointerCapture(de))}function be(Se){if(!le.value||Se.pointerId!==de)return;const Le=Se.clientY-ue;Math.abs(Le)>DRAG_TOLERANCE&&(pe=!0),ce.value=Math.max(0,Le);const Ve=Se.timeStamp-ge;Ve>0&&(fe=(Se.clientY-me)/Ve),me=Se.clientY,ge=Se.timeStamp}function ke(Se){if(!le.value)return;le.value=!1;const Le=ce.value;if(ce.value=0,!Se)return;const Ve=ve>0&&Le>ve*DISMISS_RATIO,Te=fe>DISMISS_VELOCITY&&Le>12;(Ve||Te)&&ae("close")}function $e(Se){Se.pointerId===de&&ke(!0)}function ye(Se){Se.pointerId===de&&ke(!1)}function Ee(){if(pe){pe=!1;return}ae("close")}return(Se,Le)=>ee.inline?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["sm-emoji-drawer-inline",{"sm-emoji-drawer-inline--open":ee.show}])},[e$b.createElementVNode("div",_hoisted_1$k,[e$b.createElementVNode("div",{ref_key:"panelRef",ref:ie,class:e$b.normalizeClass(["sm-emoji-drawer sm-emoji-drawer--inline",{"sm-emoji-drawer--dark":ee.theme==="dark","sm-emoji-drawer--dragging":le.value}]),style:e$b.normalizeStyle(ce.value?{transform:`translateY(${ce.value}px)`}:null),role:"dialog","aria-label":"Seletor de emojis"},[e$b.createElementVNode("div",{class:"sm-emoji-drawer__handle",onPointerdown:_e,onPointermove:be,onPointerup:$e,onPointercancel:ye,onClick:Ee},[...Le[3]||(Le[3]=[e$b.createElementVNode("span",{class:"sm-emoji-drawer__handle-bar","aria-hidden":"true"},null,-1)])],32),e$b.createVNode(EmojiPicker,{theme:ee.theme,categories:ee.categories,onSelect:Le[0]||(Le[0]=Ve=>ae("select",Ve))},null,8,["theme","categories"])],6)])],2)):(e$b.openBlock(),e$b.createBlock(e$b.Teleport,{key:1,to:"body"},[e$b.createVNode(e$b.Transition,{name:"sm-emoji-drawer-fade"},{default:e$b.withCtx(()=>[ee.show?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:"sm-emoji-drawer__backdrop",onClick:Le[1]||(Le[1]=Ve=>ae("close"))})):e$b.createCommentVNode("",!0)]),_:1}),e$b.createVNode(e$b.Transition,{name:"sm-emoji-drawer-slide"},{default:e$b.withCtx(()=>[ee.show?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"panelRef",ref:ie,class:e$b.normalizeClass(["sm-emoji-drawer",{"sm-emoji-drawer--dark":ee.theme==="dark","sm-emoji-drawer--dragging":le.value}]),style:e$b.normalizeStyle(ce.value?{transform:`translateY(${ce.value}px)`}:null),role:"dialog","aria-label":"Seletor de emojis"},[e$b.createElementVNode("div",{class:"sm-emoji-drawer__handle",onPointerdown:_e,onPointermove:be,onPointerup:$e,onPointercancel:ye,onClick:Ee},[...Le[4]||(Le[4]=[e$b.createElementVNode("span",{class:"sm-emoji-drawer__handle-bar","aria-hidden":"true"},null,-1)])],32),e$b.createVNode(EmojiPicker,{theme:ee.theme,categories:ee.categories,onSelect:Le[2]||(Le[2]=Ve=>ae("select",Ve))},null,8,["theme","categories"])],6)):e$b.createCommentVNode("",!0)]),_:1})]))}},EmojiPickerDrawer=_export_sfc$1(_sfc_main$n,[["__scopeId","data-v-0bc491ca"]]),_sfc_main$m={__name:"GameProfileCard",props:{attendant:{type:Object,default:()=>({})},identity:{type:Object,default:null},editable:{type:Boolean,default:!1},embedded:{type:Boolean,default:!1},effectLevel:{type:String,default:"border",validator:ee=>["full","compact","border"].includes(ee)},progress:{type:Object,default:null}},emits:["edit"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.computed(()=>ne.identity||resolveAttendantGamification(ne.attendant));return(oe,ie)=>{var le,ce;return e$b.openBlock(),e$b.createBlock(GameIdentity,{variant:"card",name:((le=ee.attendant)==null?void 0:le.name)||"Atendente",photo:((ce=ee.attendant)==null?void 0:ce.photo)||"",level:re.value.level,frame:re.value.frame,title:re.value.title,achievement:re.value.achievement,progress:ee.progress,editable:ee.editable,embedded:ee.embedded,"effect-level":ee.effectLevel,onEdit:ie[0]||(ie[0]=de=>ae("edit"))},e$b.createSlots({_:2},[oe.$slots.footer?{name:"footer",fn:e$b.withCtx(()=>[e$b.renderSlot(oe.$slots,"footer")]),key:"0"}:void 0]),1032,["name","photo","level","frame","title","achievement","progress","editable","embedded","effect-level"])}}},_hoisted_1$j={class:"tabular-nums"},_sfc_main$l={__name:"AnimatedNumber",props:{value:{type:Number,default:0},duration:{type:Number,default:900},locale:{type:Boolean,default:!1},decimals:{type:Number,default:0}},setup(ee){const te=ee,ne=e$b.ref(0);let ae=null;function re(ie){const le=ne.value,ce=performance.now();cancelAnimationFrame(ae);const de=ue=>{const ve=Math.min(1,(ue-ce)/te.duration),me=1-Math.pow(1-ve,3);ne.value=le+(ie-le)*me,ve<1?ae=requestAnimationFrame(de):ne.value=ie};ae=requestAnimationFrame(de)}function oe(ie){const le=te.decimals?Number(ie.toFixed(te.decimals)):Math.round(ie);return te.locale?le.toLocaleString("pt-BR",{minimumFractionDigits:te.decimals,maximumFractionDigits:te.decimals}):te.decimals?le.toFixed(te.decimals):String(le)}return e$b.watch(()=>te.value,ie=>re(ie)),e$b.onMounted(()=>re(te.value)),e$b.onBeforeUnmount(()=>cancelAnimationFrame(ae)),(ie,le)=>(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_1$j,e$b.toDisplayString(oe(ne.value)),1))}},_hoisted_1$i={class:"sr-only"},_hoisted_2$i={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","aria-hidden":"true"},_hoisted_3$g={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","aria-hidden":"true"},_hoisted_4$f={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","aria-hidden":"true"},_sfc_main$k={__name:"TrendIndicator",props:{trend:{type:String,default:"flat",validator:ee=>["up","down","flat"].includes(ee)},variant:{type:String,default:"arrow",validator:ee=>["arrow","text"].includes(ee)}},setup(ee){const te=ee,ne={up:{text:"↑ Subindo",label:"Subiu de posição"},down:{text:"↓ Caindo",label:"Caiu de posição"},flat:{text:"→ Estável",label:"Posição estável"}},ae=e$b.computed(()=>ne[te.trend]||ne.flat);return(re,oe)=>ee.variant==="text"?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["trend-text",`trend--${ee.trend}`])},e$b.toDisplayString(ae.value.text),3)):(e$b.openBlock(),e$b.createElementBlock("span",{key:1,class:e$b.normalizeClass(["trend-chip",`trend--${ee.trend}`])},[e$b.createElementVNode("span",_hoisted_1$i,e$b.toDisplayString(ae.value.label),1),ee.trend==="up"?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$i,[...oe[0]||(oe[0]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6 15 6-6 6 6"},null,-1)])])):ee.trend==="down"?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$g,[...oe[1]||(oe[1]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6 9 6 6 6-6"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_4$f,[...oe[2]||(oe[2]=[e$b.createElementVNode("path",{"stroke-linecap":"round",d:"M6 12h12"},null,-1)])]))],2))}},TrendIndicator=_export_sfc$1(_sfc_main$k,[["__scopeId","data-v-4a8e687c"]]),_hoisted_1$h={class:"ranking-body"},_hoisted_2$h={class:"ranking-name"},_hoisted_3$f={key:1,class:"ranking-subtitle"},_hoisted_4$e={class:"ranking-points"},_hoisted_5$d={class:"ranking-points-value"},_sfc_main$j={__name:"RankingRow",props:{rank:{type:Number,default:null},rankSuffix:{type:String,default:""},name:{type:String,default:"Atendente"},photo:{type:String,default:""},level:{type:Number,default:null},frame:{type:Object,default:null},title:{type:Object,default:null},attendant:{type:Object,default:null},hoverPreview:{type:Boolean,default:!1},department:{type:String,default:""},showDepartment:{type:Boolean,default:!1},points:{type:Number,default:0},animate:{type:Boolean,default:!0},trend:{type:String,default:""},trendVariant:{type:String,default:"arrow",validator:ee=>["arrow","text"].includes(ee)},highlighted:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},avatarSize:{type:String,default:"sm"},effectLevel:{type:String,default:"compact",validator:ee=>["full","compact","border"].includes(ee)}},emits:["select"],setup(ee){const te=ee,ne=e$b.computed(()=>{if(te.title)return te.showDepartment&&te.department?te.department:"";const ae=[];return te.level!=null&&ae.push(`Nível ${te.level}`),te.showDepartment&&te.department&&ae.push(te.department),ae.join(" · ")});return(ae,re)=>(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.clickable?"button":"div"),{type:ee.clickable?"button":void 0,class:e$b.normalizeClass(["ranking-row",{"ranking-row--clickable":ee.clickable,"ranking-row--highlight":ee.highlighted,"smplay-hover-motion":ee.effectLevel!=="border"}]),"aria-label":ee.clickable?`Ver detalhes de ${ee.name}`:void 0,onClick:re[0]||(re[0]=oe=>ee.clickable&&ae.$emit("select"))},{default:e$b.withCtx(()=>[ee.rank!=null?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["ranking-rank",{"ranking-rank--highlight":ee.highlighted}])},e$b.toDisplayString(ee.rank)+e$b.toDisplayString(ee.rankSuffix),3)):e$b.createCommentVNode("",!0),ee.attendant?(e$b.openBlock(),e$b.createBlock(AttendantGameIdentity,{key:1,attendant:ee.attendant,variant:"list","avatar-size":ee.avatarSize,"effect-level":ee.effectLevel,frame:ee.frame??void 0,title:ee.title??void 0,"show-level":!0,"show-achievement":!1,"hover-preview":ee.hoverPreview,class:"ranking-identity"},null,8,["attendant","avatar-size","effect-level","frame","title","hover-preview"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:2},[e$b.createVNode(Avatar,{name:ee.name,photo:ee.photo,level:ee.level,frame:ee.frame,size:ee.avatarSize,"effect-level":ee.effectLevel,class:"ranking-avatar"},null,8,["name","photo","level","frame","size","effect-level"]),e$b.createElementVNode("span",_hoisted_1$h,[e$b.createElementVNode("span",_hoisted_2$h,e$b.toDisplayString(ee.name),1),ee.title?(e$b.openBlock(),e$b.createBlock(_sfc_main$28,{key:0,title:ee.title,size:"sm",class:"ranking-title"},null,8,["title"])):e$b.createCommentVNode("",!0),ne.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$f,e$b.toDisplayString(ne.value),1)):e$b.createCommentVNode("",!0)])],64)),ee.trend&&ee.trendVariant==="arrow"?(e$b.openBlock(),e$b.createBlock(TrendIndicator,{key:3,trend:ee.trend,variant:"arrow",class:"ranking-trend-chip"},null,8,["trend"])):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_4$e,[e$b.createElementVNode("strong",_hoisted_5$d,[ee.animate?(e$b.openBlock(),e$b.createBlock(_sfc_main$l,{key:0,value:ee.points,locale:""},null,8,["value"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(ee.points.toLocaleString("pt-BR")),1)],64))]),ee.trend&&ee.trendVariant==="text"?(e$b.openBlock(),e$b.createBlock(TrendIndicator,{key:0,trend:ee.trend,variant:"text"},null,8,["trend"])):e$b.createCommentVNode("",!0)])]),_:1},8,["type","class","aria-label"]))}},RankingRow=_export_sfc$1(_sfc_main$j,[["__scopeId","data-v-131d36ca"]]),_hoisted_1$g={class:"podium-empty"},_hoisted_2$g={class:"podium-empty-title"},_hoisted_3$e={class:"podium-empty-text"},_hoisted_4$d={class:"podium-cols podium-cols--ghost",style:{"--podium-cols":3},"aria-hidden":"true"},_hoisted_5$c={key:0,class:"podium-spotlight","aria-hidden":"true"},_hoisted_6$a={key:1,class:"podium-crown-slot","aria-hidden":"true"},_hoisted_7$a={key:0,class:"podium-crown",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_8$6={class:"podium-avatar-wrap"},_hoisted_9$4={key:0,class:"podium-aura","aria-hidden":"true"},_hoisted_10$4={key:3,class:"podium-dept"},_hoisted_11$4={class:"podium-points"},_hoisted_12$3=["aria-label"],_sfc_main$i={__name:"RankingPodium",props:{entries:{type:Array,default:()=>[]},showDepartment:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},animate:{type:Boolean,default:!0},effectLevel:{type:String,default:"full",validator:ee=>["full","compact","border"].includes(ee)},emptyTitle:{type:String,default:"Pódio ainda vazio"},emptyText:{type:String,default:"Os três primeiros aparecem assim que alguém pontuar."}},emits:["select"],setup(ee){const te=ee;function ne(ce,de){var ve;if(de==="border")return!1;const ue=(ve=resolveFrameVisual(ce.frame))==null?void 0:ve.ornament;return!!(ue!=null&&ue.enabled&&ue.variant==="crown")}const ae=e$b.computed(()=>{const[ce,de,ue]=te.entries;return(te.entries.length>=3?[de,ce,ue]:[ce,de]).filter(Boolean).map(me=>({...me,source:me,showCrown:me.rank===1&&!ne(me,te.effectLevel)}))}),re=e$b.computed(()=>te.effectLevel==="full"),oe=e$b.computed(()=>ae.value.length<3),ie=e$b.computed(()=>ae.value.length===0),le=[2,1,3];return(ce,de)=>(e$b.openBlock(),e$b.createElementBlock("section",{class:e$b.normalizeClass(["podium",{"podium--sparse":oe.value,"podium--empty":ie.value,"podium--lit":re.value}])},[de[5]||(de[5]=e$b.createElementVNode("div",{class:"podium-arena-glow","aria-hidden":"true"},null,-1)),ie.value?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[e$b.createElementVNode("div",_hoisted_1$g,[e$b.renderSlot(ce.$slots,"empty",{},()=>[e$b.createElementVNode("p",_hoisted_2$g,e$b.toDisplayString(ee.emptyTitle),1),e$b.createElementVNode("p",_hoisted_3$e,e$b.toDisplayString(ee.emptyText),1)],!0)]),e$b.createElementVNode("div",_hoisted_4$d,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(le,(ue,ve)=>e$b.createElementVNode("div",{key:ue,class:e$b.normalizeClass(["podium-col podium-col--ghost",`podium-col--${ue}`]),style:e$b.normalizeStyle({animationDelay:`${ve*110}ms`})},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-ghost-avatar",{"podium-ghost-avatar--first":ue===1}])},null,2),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-pedestal",`podium-pedestal--${ue}`]),style:e$b.normalizeStyle({animationDelay:`${ve*110+120}ms`})},[de[0]||(de[0]=e$b.createElementVNode("div",{class:"podium-pedestal-top"},null,-1)),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-medal",`podium-medal--${ue}`])},e$b.toDisplayString(ue),3)],6)],6)),64))])],64)):(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:"podium-cols",style:e$b.normalizeStyle({"--podium-cols":ae.value.length})},[de[4]||(de[4]=e$b.createElementVNode("div",{class:"podium-floor","aria-hidden":"true"},null,-1)),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae.value,(ue,ve)=>(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.clickable?"button":"div"),{key:ue.rank,type:ee.clickable?"button":void 0,class:e$b.normalizeClass(["podium-col",`podium-col--${ue.rank}`]),style:e$b.normalizeStyle({animationDelay:`${ve*110}ms`}),"aria-label":ee.clickable?`Ver detalhes de ${ue.name}`:void 0,onClick:me=>ee.clickable&&ce.$emit("select",ue.source)},{default:e$b.withCtx(()=>{var me;return[ue.rank===1&&re.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$c)):e$b.createCommentVNode("",!0),ue.rank===1?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6$a,[ue.showCrown?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_7$a,[...de[1]||(de[1]=[e$b.createElementVNode("path",{d:"M4.2 7.2a.7.7 0 0 1 1.1-.6l3.4 2.4a.7.7 0 0 0 1-.2l1.7-2.9a.7.7 0 0 1 1.2 0l1.7 2.9a.7.7 0 0 0 1 .2l3.4-2.4a.7.7 0 0 1 1.1.6l-1 7.1a1 1 0 0 1-1 .9H6.2a1 1 0 0 1-1-.9l-1-7.1Zm1.6 10a.8.8 0 0 1 .8-.8h10.8a.8.8 0 0 1 0 1.6H6.6a.8.8 0 0 1-.8-.8Z"},null,-1)])])):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_8$6,[ue.rank===1?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$4)):e$b.createCommentVNode("",!0),e$b.createVNode(Avatar,{name:ue.name,photo:ue.photo,level:ue.level,frame:ue.frame,scale:"app",size:ue.rank===1?"xl":"lg","effect-level":ee.effectLevel,class:"podium-avatar"},null,8,["name","photo","level","frame","size","effect-level"])]),e$b.createElementVNode("p",{class:e$b.normalizeClass(["podium-name",{"podium-name--first":ue.rank===1}])},e$b.toDisplayString(ue.name),3),ue.title?(e$b.openBlock(),e$b.createBlock(_sfc_main$28,{key:2,title:ue.title,size:"sm",class:"podium-title"},null,8,["title"])):e$b.createCommentVNode("",!0),ee.showDepartment&&((me=ue.department)!=null&&me.name)?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_10$4,e$b.toDisplayString(ue.department.name),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("p",_hoisted_11$4,[e$b.createElementVNode("span",{class:e$b.normalizeClass(["podium-points-value",`podium-points--${ue.rank}`])},[ee.animate?(e$b.openBlock(),e$b.createBlock(_sfc_main$l,{key:0,value:ue.points,locale:""},null,8,["value"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(ue.points.toLocaleString("pt-BR")),1)],64))],2),de[2]||(de[2]=e$b.createElementVNode("span",{class:"podium-points-unit"},"pts",-1)),ue.trend==="up"||ue.trend==="down"?(e$b.openBlock(),e$b.createBlock(TrendIndicator,{key:0,trend:ue.trend,class:"podium-trend"},null,8,["trend"])):e$b.createCommentVNode("",!0)]),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-pedestal",`podium-pedestal--${ue.rank}`]),style:e$b.normalizeStyle({animationDelay:`${ve*110+120}ms`})},[de[3]||(de[3]=e$b.createElementVNode("div",{class:"podium-pedestal-top","aria-hidden":"true"},null,-1)),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-medal",`podium-medal--${ue.rank}`]),"aria-label":`${ue.rank}º lugar`},e$b.toDisplayString(ue.rank),11,_hoisted_12$3)],6)]}),_:2},1032,["type","class","style","aria-label","onClick"]))),128))],4))],2))}},RankingPodium=_export_sfc$1(_sfc_main$i,[["__scopeId","data-v-5737213a"]]),_hoisted_1$f={class:"season-badge"},_hoisted_2$f={class:"season-dot-wrap"},_sfc_main$h={__name:"SeasonBadge",props:{label:{type:String,default:"Temporada"},status:{type:String,default:"live",validator:ee=>["live","paused","scheduled"].includes(ee)},daysLeft:{type:Number,default:null}},setup(ee){const te=ee,ne={live:{text:"Ao vivo"},paused:{text:"Pausada"},scheduled:{text:"Agendada"}},ae=e$b.computed(()=>ne[te.status]||ne.live);return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_1$f,[e$b.createElementVNode("span",_hoisted_2$f,[ee.status==="live"?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["season-ping",`season--${ee.status}`])},null,2)):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",{class:e$b.normalizeClass(["season-dot",`season--${ee.status}`])},null,2)]),e$b.createTextVNode(" "+e$b.toDisplayString(ee.label)+" ",1),oe[0]||(oe[0]=e$b.createElementVNode("span",{class:"season-divider","aria-hidden":"true"},null,-1)),e$b.createElementVNode("span",{class:e$b.normalizeClass(["season-status",`season--${ee.status}`])},[e$b.createTextVNode(e$b.toDisplayString(ae.value.text),1),ee.daysLeft!=null?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[e$b.createTextVNode(" · "+e$b.toDisplayString(ee.daysLeft)+" dias",1)],64)):e$b.createCommentVNode("",!0)],2)]))}},SeasonBadge=_export_sfc$1(_sfc_main$h,[["__scopeId","data-v-3fb77058"]]),_hoisted_1$e={class:"season-track-labels"},_hoisted_2$e={class:"season-track-edge"},_hoisted_3$d={class:"season-track-today"},_hoisted_4$c={class:"season-track-edge season-track-edge--end"},_hoisted_5$b={class:"track"},_hoisted_6$9={key:0,class:"today-contrail","aria-hidden":"true"},_hoisted_7$9={key:1,class:"today-runway","aria-hidden":"true"},_sfc_main$g={__name:"SeasonTrack",props:{startedLabel:{type:String,default:"—"},endsLabel:{type:String,default:"—"},todayText:{type:String,default:""},percent:{type:Number,default:0},rail:{type:String,default:"rgb(var(--primary-rgb))"},flying:{type:Boolean,default:!1}},setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:"season-track",style:e$b.normalizeStyle({"--rail":ee.rail})},[e$b.createElementVNode("div",_hoisted_1$e,[e$b.createElementVNode("span",_hoisted_2$e,[ne[0]||(ne[0]=e$b.createElementVNode("span",{class:"season-track-edge-label"},"Início",-1)),e$b.createTextVNode(e$b.toDisplayString(ee.startedLabel),1)]),e$b.createElementVNode("span",_hoisted_3$d,e$b.toDisplayString(ee.todayText),1),e$b.createElementVNode("span",_hoisted_4$c,[ne[1]||(ne[1]=e$b.createElementVNode("span",{class:"season-track-edge-label"},"Encerra",-1)),e$b.createTextVNode(e$b.toDisplayString(ee.endsLabel),1)])]),e$b.createElementVNode("div",_hoisted_5$b,[e$b.createElementVNode("div",{class:"fill",style:e$b.normalizeStyle({width:`${ee.percent}%`})},null,4),ne[3]||(ne[3]=e$b.createElementVNode("span",{class:"node start"},null,-1)),e$b.createElementVNode("span",{class:e$b.normalizeClass(["node end",{reached:ee.percent>=100}])},null,2),e$b.createElementVNode("span",{class:e$b.normalizeClass(["today",ee.flying?"flying":"landed"]),style:e$b.normalizeStyle({left:`${ee.percent}%`})},[ee.flying?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6$9)):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_7$9)),ne[2]||(ne[2]=e$b.createElementVNode("svg",{class:"today-plane",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M16 10h4a2 2 0 1 1 0 4h-4l-4 7H9l2-7H7l-2 2H2l1-4-1-4h3l2 2h4L9 3h3l4 7Z"})],-1))],6)])],4))}},SeasonTrack=_export_sfc$1(_sfc_main$g,[["__scopeId","data-v-332feaac"]]),_hoisted_1$d={class:"season-head"},_hoisted_2$d={class:"season-head-main"},_hoisted_3$c={class:"season-pill-mark"},_hoisted_4$b={key:0,class:"season-pill-plane",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},_hoisted_5$a={key:1,class:"season-pill-dot"},_hoisted_6$8={class:"season-name"},_hoisted_7$8={key:0,class:"season-description"},_hoisted_8$5={key:0,class:"season-actions"},_hoisted_9$3={key:0,class:"season-frozen"},_hoisted_10$3={class:"season-track-slot"},_hoisted_11$3={key:2,class:"season-tile-suffix"},_hoisted_12$2={class:"season-tile-label"},_sfc_main$f={__name:"SeasonCard",props:{season:{type:Object,default:null},tiles:{type:Array,default:()=>[]}},setup(ee){const te=ee,ne=e$b.computed(()=>{var pe;return((pe=te.season)==null?void 0:pe.status)??"scheduled"}),ae=e$b.computed(()=>ne.value==="active"),re=e$b.computed(()=>ne.value==="paused"),oe=e$b.computed(()=>ne.value==="scheduled"),ie={active:{label:"Ativa",rail:"var(--color-state-success, rgb(var(--success-rgb, 34 197 94)))"},paused:{label:"Pausada",rail:"var(--color-state-warning, rgb(var(--warning-rgb, 245 158 11)))"},scheduled:{label:"Agendada",rail:"rgb(var(--bg-base-100) / 0.7)"}},le=e$b.computed(()=>ie[ne.value]??ie.scheduled),ce=e$b.computed(()=>{var pe;return((pe=te.season)==null?void 0:pe.duration_days)||1}),de=e$b.computed(()=>{var pe;return Math.max(0,((pe=te.season)==null?void 0:pe.days_left)||0)}),ue=e$b.computed(()=>Math.max(0,ce.value-de.value)),ve=e$b.computed(()=>!te.season||oe.value?0:Math.min(100,Math.round(ue.value/ce.value*100))),me=e$b.computed(()=>Math.min(ce.value,Math.max(1,ue.value))),ge=e$b.computed(()=>oe.value?"Ainda não começou":`${re.value?"Pausada":"Hoje"} · dia ${me.value} de ${ce.value}`),fe=e$b.computed(()=>[{value:oe.value?ce.value:de.value,suffix:"dias",label:oe.value?"de duração":"restantes",tone:"status"},...te.tiles]);return(pe,_e)=>ee.season?(e$b.openBlock(),e$b.createElementBlock("section",{key:0,class:"season-card",style:e$b.normalizeStyle({"--rail":le.value.rail})},[e$b.createElementVNode("header",_hoisted_1$d,[e$b.createElementVNode("div",_hoisted_2$d,[e$b.createElementVNode("span",{class:e$b.normalizeClass(["season-pill",`season-pill--${ne.value}`])},[e$b.createElementVNode("span",_hoisted_3$c,[ae.value?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_4$b,[..._e[0]||(_e[0]=[e$b.createElementVNode("path",{d:"M16 10h4a2 2 0 1 1 0 4h-4l-4 7H9l2-7H7l-2 2H2l1-4-1-4h3l2 2h4L9 3h3l4 7Z"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$a))]),e$b.createTextVNode(" "+e$b.toDisplayString(le.value.label),1)],2),e$b.createElementVNode("h3",_hoisted_6$8,e$b.toDisplayString(ee.season.name),1),ee.season.description?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$8,e$b.toDisplayString(ee.season.description),1)):e$b.createCommentVNode("",!0)]),pe.$slots.actions?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$5,[e$b.renderSlot(pe.$slots,"actions",{},void 0,!0)])):e$b.createCommentVNode("",!0)]),re.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$3,[..._e[1]||(_e[1]=[e$b.createElementVNode("svg",{class:"season-frozen-icon",fill:"none",stroke:"currentColor","stroke-width":"1.8",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v18M5 8l14 8M19 8 5 16"})],-1),e$b.createElementVNode("p",{class:"season-frozen-text"},[e$b.createElementVNode("strong",null,"Pontuação congelada."),e$b.createTextVNode(" Ninguém ganha ou perde pontos enquanto pausada — o prazo de encerramento também para. ")],-1)])])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_10$3,[e$b.createVNode(SeasonTrack,{"started-label":ee.season.started_label||"—","ends-label":ee.season.ends_label||"—","today-text":ge.value,percent:ve.value,rail:le.value.rail,flying:ae.value},null,8,["started-label","ends-label","today-text","percent","rail","flying"])]),e$b.createElementVNode("div",{class:"season-tiles",style:e$b.normalizeStyle({"--tiles":fe.value.length})},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(fe.value,be=>(e$b.openBlock(),e$b.createElementBlock("div",{key:be.label,class:"season-tile"},[e$b.createElementVNode("p",{class:e$b.normalizeClass(["season-tile-value",{"season-tile-value--status":be.tone==="status"}])},[typeof be.value=="number"?(e$b.openBlock(),e$b.createBlock(_sfc_main$l,{key:0,value:be.value},null,8,["value"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(be.value),1)],64)),be.suffix?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_11$3,e$b.toDisplayString(be.suffix),1)):e$b.createCommentVNode("",!0)],2),e$b.createElementVNode("p",_hoisted_12$2,e$b.toDisplayString(be.label),1)]))),128))],4),e$b.renderSlot(pe.$slots,"default",{},void 0,!0)],4)):e$b.createCommentVNode("",!0)}},SeasonCard=_export_sfc$1(_sfc_main$f,[["__scopeId","data-v-56ca9db3"]]),MONTHS_ABBR=["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"];function seasonDayLabel(ee){const[te,ne,ae]=String(ee).slice(0,10).split("-").map(Number);return`${ae} ${MONTHS_ABBR[ne-1]} ${te}`}function normalizeSeason(ee){return!ee||typeof ee!="object"||!ee.id&&!ee.started_at&&!ee.ends_at?null:{...ee,name:ee.name??"",description:ee.description??"",duration_days:ee.duration_days??1,started_label:ee.started_at?seasonDayLabel(ee.started_at):ee.started_label??"—",ends_label:ee.ends_at?seasonDayLabel(ee.ends_at):ee.ends_label??"—",period_label:ee.started_at&&ee.ends_at?`${seasonDayLabel(ee.started_at)} – ${seasonDayLabel(ee.ends_at)}`:ee.period_label??""}}const AVATAR_TONES=["bg-blue-500/20 text-blue-200 ring-blue-400/25","bg-pink-500/20 text-pink-200 ring-pink-400/25","bg-emerald-500/20 text-emerald-200 ring-emerald-400/25","bg-amber-500/20 text-amber-200 ring-amber-400/25","bg-violet-500/20 text-violet-200 ring-violet-400/25"];function buildRanking(ee=[],{tieBreak:te="name"}={}){return ee.slice().sort((ne,ae)=>(ae.points??0)-(ne.points??0)||String(ne[te]??"").localeCompare(String(ae[te]??""))).map((ne,ae)=>{const re=ae+1;return{...ne,rank:re,tone:AVATAR_TONES[(re-1)%AVATAR_TONES.length],ref:ne}})}function podiumOrder(ee=[]){const[te,ne,ae]=ee;return[ne,te,ae].filter(Boolean)}function attendantSeasonPoints(ee){var ne;const te=(ee==null?void 0:ee.gamification)??(ee==null?void 0:ee.game_profile)??{};return Number(((ne=te.season)==null?void 0:ne.points)??te.season_points??0)}function belongsToDepartment(ee,te){return(Array.isArray(ee==null?void 0:ee.department)?ee.department:[]).some(ae=>String(ae==null?void 0:ae.id)===String(te))}function compareRankEntries(ee,te){return te.level-ee.level||te.points-ee.points||String(ee.name??"").localeCompare(String(te.name??""))}function unlockedLabel(ee,{short:te=!1}={}){const ne="Desbloqueado";if(!ee)return ne;const ae=new Date(ee);return Number.isNaN(ae.getTime())?ne:te?`Desde ${ae.toLocaleDateString("pt-BR")}`:`Desbloqueado em ${ae.toLocaleDateString("pt-BR",{day:"2-digit",month:"short",year:"numeric"})}`}const _sfc_main$e={__name:"CosmeticRequirements",props:{item:{type:Object,required:!0},kind:{type:String,default:null},mode:{type:String,default:"attendant"},attendantName:{type:String,default:""},requirement:{type:Object,default:null},unlocked:{type:Boolean,default:!1},unlockedAt:{type:[String,Number,Date],default:null},selected:{type:Boolean,default:!1},selectedLabel:{type:String,default:"Equipado"}},setup(ee){const te=ee,ne=e$b.computed(()=>te.kind||te.item.type),ae=e$b.computed(()=>ne.value==="title"),re=e$b.computed(()=>te.mode==="catalog"),oe=e$b.computed(()=>{var ue;return te.unlocked||re.value?null:((ue=te.requirement)==null?void 0:ue.progress)??null}),ie=e$b.computed(()=>re.value?"Como é obtido":te.unlocked?"Como você obteve":"Como desbloquear"),le=e$b.computed(()=>({frame:"Moldura",title:"Título",achievement:"Destaque"})[ne.value]||"Item"),ce=e$b.computed(()=>te.selected?[{label:te.selectedLabel,class:"font-black text-primary"}]:[]),de=e$b.computed(()=>re.value?null:te.unlocked?{label:unlockedLabel(te.unlockedAt),class:"text-success"}:{label:"Bloqueado"});return(ue,ve)=>{var me,ge,fe,pe;return e$b.openBlock(),e$b.createBlock(UnlockHint,{class:"cosmetic-requirements",eyebrow:le.value,name:ee.item.name||"Sem nome","block-label":ie.value,text:((me=ee.requirement)==null?void 0:me.text)||((ge=ee.requirement)==null?void 0:ge.label)||"Requisito não informado.",note:((fe=ee.requirement)==null?void 0:fe.note)||"",unit:((pe=ee.requirement)==null?void 0:pe.unit)||"",progress:oe.value,pills:ce.value,status:de.value},e$b.createSlots({piece:e$b.withCtx(()=>[ne.value==="frame"?(e$b.openBlock(),e$b.createBlock(Avatar,{key:0,name:ee.attendantName,frame:ee.item,"show-level":!1,"frame-only":"",size:"md","effect-level":"full"},null,8,["name","frame"])):ne.value==="achievement"?(e$b.openBlock(),e$b.createBlock(_sfc_main$29,{key:1,achievement:ee.item,size:"md"},null,8,["achievement"])):e$b.createCommentVNode("",!0)]),_:2},[ae.value?{name:"name",fn:e$b.withCtx(()=>[e$b.createVNode(_sfc_main$28,{title:ee.item,size:"lg",align:"start",tooltip:!1,class:"mt-1.5"},null,8,["title"])]),key:"0"}:void 0]),1032,["eyebrow","name","block-label","text","note","unit","progress","pills","status"])}}},_hoisted_1$c={class:"min-w-0 flex-1"},_hoisted_2$c={class:"truncate"},_hoisted_3$b={class:"flex shrink-0 items-center"},_hoisted_4$a=["aria-label"],_hoisted_5$9={key:1,class:"grid place-items-center rounded-full bg-base-100 p-1.5 ring-1 ring-base-200","aria-label":"Item bloqueado"},_hoisted_6$7={class:"truncate"},_hoisted_7$7={key:2,class:"absolute inset-0 grid place-items-center rounded-[inherit] bg-base-300/70 backdrop-blur-[1px]","aria-live":"polite"},_hoisted_8$4={class:"sm-hover-panel-face"},_sfc_main$d={__name:"CosmeticCard",props:{item:{type:Object,required:!0},kind:{type:String,default:null},mode:{type:String,default:"catalog"},attendantName:{type:String,default:""},density:{type:String,default:"comfortable",validator:ee=>["comfortable","compact","tight"].includes(ee)},caption:{type:String,default:""},captionTone:{type:String,default:"muted",validator:ee=>["muted","primary","success"].includes(ee)},captionDot:{type:String,default:""},locked:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},selectedLabel:{type:String,default:"Equipado"},busy:{type:Boolean,default:!1},denied:{type:Boolean,default:!1},interactive:{type:Boolean,default:!0},enterDelay:{type:Number,default:0},hoverRequirements:{type:Boolean,default:!1},requirement:{type:Object,default:null},hoverDelay:{type:Number,default:240},unlockedAt:{type:[String,Number,Date],default:null}},emits:["select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.useAttrs(),oe={comfortable:{root:"",stage:"min-h-28 p-4",badge:"size-6",footer:"p-3",name:"text-sm",caption:"mt-1 text-[11px]",avatar:"md",token:"md",plaque:"min-h-[4.5rem] bg-base-200/80 gap-3 py-3.5 pl-3.5 pr-3",plaqueTitle:"xl",plaqueCaption:"text-[11px]",plaqueLabel:!0},compact:{root:"min-h-32",stage:"min-h-24 p-3",badge:"size-5",footer:"p-2 text-center",name:"text-[12px] font-medium leading-tight",caption:"justify-center text-[10.5px]",avatar:"md",token:"md",plaque:"min-h-16 gap-2.5 py-3 pl-3 pr-2.5",plaqueTitle:"lg",plaqueCaption:"text-[10.5px]",plaqueLabel:!0},tight:{root:"",stage:"min-h-16 p-2",badge:"size-5",footer:"px-2 py-2 text-center",name:"text-[13px] font-semibold leading-tight",caption:"mt-0.5 justify-center text-[11px] leading-tight",avatar:"sm",token:"md",plaque:"min-h-14 gap-2 py-2.5 pl-2.5 pr-2",plaqueTitle:"lg",plaqueCaption:"text-[11px] leading-tight",plaqueLabel:!1}},ie=e$b.computed(()=>ne.kind||ne.item.type),le=e$b.computed(()=>ie.value==="title"),ce=e$b.computed(()=>oe[ne.density]||oe.comfortable),de=e$b.computed(()=>ne.interactive&&!ne.busy),ue=e$b.computed(()=>({primary:"text-primary",success:"text-success",muted:"text-base-content/55"})[ne.captionTone]),ve=e$b.computed(()=>["plate cosmetic-plate p-px",le.value?"":"cosmetic-plate--niche",me.value?"cosmetic-plate--lit":"",ne.selected?"is-selected":"",ne.locked?"opacity-75 brightness-[0.78] saturate-[0.5]":"",ie.value==="frame"?"smplay-hover-motion":""]),me=e$b.computed(()=>{var Re;if(ie.value!=="frame")return null;const ze=(Re=resolveFrameVisual(ne.item))==null?void 0:Re.ring.colors;return ze!=null&&ze[0]?ze:null}),ge=e$b.computed(()=>{const ze=ne.enterDelay?{animationDelay:`${ne.enterDelay}ms`}:{};if(!me.value)return ze;const[Re,Oe=Re]=me.value;return{...ze,"--frame-accent":Re,"--frame-accent-soft":Oe}}),fe=e$b.computed(()=>{var Re,Oe;if(me.value){const[Pe,Be=Pe]=me.value;return{"--panel-accent":Pe,"--panel-accent-soft":Be}}const ze=(Oe=RARITIES[(Re=ne.item)==null?void 0:Re.rarity])==null?void 0:Oe.accentRgb;return ze?{"--panel-accent":`rgb(${ze})`}:{}}),pe=e$b.computed(()=>{if(ne.hoverRequirements)return;if(re.title)return re.title;const ze=[ne.item.name,ne.caption];return ne.selected&&ne.selectedLabel&&ze.push(ne.selectedLabel),ze.filter(Boolean).join(" — ")}),_e=e$b.computed(()=>ne.hoverRequirements),be=e$b.computed(()=>ne.hoverDelay),{triggerRef:ke,open:$e,panelStyle:ye,placement:Ee,scheduleOpen:Se,scheduleClose:Le,closeNow:Ve}=useHoverPanel({enabled:_e,delay:be,width:320});function Te(){Ve(),de.value&&ae("select",ne.item)}return(ze,Re)=>(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.interactive?"button":"article"),{ref_key:"triggerRef",ref:ke,type:ee.interactive?"button":void 0,disabled:ee.interactive?ee.busy:void 0,"aria-pressed":ee.interactive?ee.selected:void 0,"aria-disabled":ee.locked||void 0,title:pe.value,style:e$b.normalizeStyle(ge.value),class:e$b.normalizeClass(["cosmetic-card relative flex flex-col text-left",ve.value,le.value?"":ce.value.root,ee.denied?"shake-denied":"",de.value&&!ee.locked?"cursor-pointer ":"",ee.locked?"is-locked cursor-not-allowed":""]),onMouseenter:e$b.unref(Se),onMouseleave:e$b.unref(Le),onClick:Te},{default:e$b.withCtx(()=>[le.value?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["flex w-full items-center",ce.value.plaque])},[e$b.createElementVNode("span",_hoisted_1$c,[e$b.createVNode(_sfc_main$28,{title:ee.item,size:ce.value.plaqueTitle,align:"start",tooltip:!1},null,8,["title","size"]),ee.caption?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["mt-1 flex min-w-0 items-center gap-1.5",[ce.value.plaqueCaption,ue.value]])},[ee.captionDot?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["size-1.5 shrink-0 rounded-full",ee.captionDot]),"aria-hidden":"true"},null,2)):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_2$c,e$b.toDisplayString(ee.caption),1)],2)):e$b.createCommentVNode("",!0),e$b.renderSlot(ze.$slots,"caption",{},void 0,!0)]),e$b.createElementVNode("span",_hoisted_3$b,[ee.selected?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["inline-flex items-center gap-1 rounded-full bg-primary/15 font-bold text-primary",ce.value.plaqueLabel?"px-2 py-1 text-[10px] uppercase tracking-wide":"p-1"]),"aria-label":ee.selectedLabel},[Re[2]||(Re[2]=e$b.createElementVNode("svg",{class:"size-3 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"3",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5 13 4 4L19 7"})],-1)),ce.value.plaqueLabel?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[e$b.createTextVNode(e$b.toDisplayString(ee.selectedLabel),1)],64)):e$b.createCommentVNode("",!0)],10,_hoisted_4$a)):ee.locked?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$9,[...Re[3]||(Re[3]=[e$b.createElementVNode("svg",{class:"size-3 text-base-content/60",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5Zm-3 8V7a3 3 0 1 1 6 0v3H9Z"})],-1)])])):e$b.renderSlot(ze.$slots,"badge",{key:2},void 0,!0)])],2)):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["plate-stage relative grid flex-1 place-items-center",[ce.value.stage,ee.locked?"opacity-55 grayscale-[25%]":""]])},[ie.value==="frame"?(e$b.openBlock(),e$b.createBlock(Avatar,{key:0,name:ee.attendantName,frame:ee.item,"show-level":!1,"frame-only":"",size:ce.value.avatar,"effect-level":"compact"},null,8,["name","frame","size"])):(e$b.openBlock(),e$b.createBlock(_sfc_main$29,{key:1,achievement:ee.item,size:ce.value.token},null,8,["achievement","size"])),ee.locked?(e$b.openBlock(),e$b.createElementBlock("span",{key:2,class:e$b.normalizeClass(["absolute right-2 top-2 grid place-items-center rounded-full bg-base-100 ring-1 ring-base-200",ce.value.badge]),"aria-label":"Item bloqueado"},[...Re[4]||(Re[4]=[e$b.createElementVNode("svg",{class:"size-3 text-base-content/60",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5Zm-3 8V7a3 3 0 1 1 6 0v3H9Z"})],-1)])],2)):ee.selected?(e$b.openBlock(),e$b.createElementBlock("span",{key:3,class:e$b.normalizeClass(["absolute right-2 top-2 grid place-items-center rounded-full bg-primary text-white ring-2 ring-base-300",ce.value.badge]),"aria-label":"Equipado"},[...Re[5]||(Re[5]=[e$b.createElementVNode("svg",{class:"size-3",fill:"none",stroke:"currentColor","stroke-width":"3",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5 13 4 4L19 7"})],-1)])],2)):e$b.renderSlot(ze.$slots,"badge",{key:4},void 0,!0)],2),e$b.createElementVNode("span",{class:e$b.normalizeClass(["plate-cut-bottom block border-t border-base-200 bg-base-200/70",ce.value.footer])},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["block truncate font-semibold",ce.value.name])},e$b.toDisplayString(ee.item.name),3),ee.selected&&ee.selectedLabel?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["flex items-center gap-1 font-semibold text-primary",ce.value.caption])},[Re[6]||(Re[6]=e$b.createElementVNode("svg",{class:"size-3 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"2.5",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5 13 4 4L19 7"})],-1)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.selectedLabel),1)],2)):ee.caption?(e$b.openBlock(),e$b.createElementBlock("span",{key:1,class:e$b.normalizeClass(["flex min-w-0 items-center gap-1.5",[ce.value.caption,ue.value]])},[ee.captionDot?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["size-1.5 shrink-0 rounded-full",ee.captionDot]),"aria-hidden":"true"},null,2)):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_6$7,e$b.toDisplayString(ee.caption),1)],2)):e$b.createCommentVNode("",!0),e$b.renderSlot(ze.$slots,"caption",{},void 0,!0)],2)],64)),ee.busy?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_7$7,[...Re[7]||(Re[7]=[e$b.createElementVNode("svg",{class:"size-6 animate-spin text-primary",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4Z"})],-1)])])):e$b.createCommentVNode("",!0),ee.hoverRequirements?(e$b.openBlock(),e$b.createBlock(e$b.Teleport,{key:3,to:"body"},[e$b.createVNode(e$b.Transition,{name:"sm-hover-panel"},{default:e$b.withCtx(()=>[e$b.unref($e)?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["sm-hover-panel",`sm-hover-panel--${e$b.unref(Ee)}`]),style:e$b.normalizeStyle([e$b.unref(ye),fe.value]),onMouseenter:Re[0]||(Re[0]=(...Oe)=>e$b.unref(Se)&&e$b.unref(Se)(...Oe)),onMouseleave:Re[1]||(Re[1]=(...Oe)=>e$b.unref(Le)&&e$b.unref(Le)(...Oe))},[e$b.createElementVNode("div",_hoisted_8$4,[e$b.createVNode(_sfc_main$e,{item:ee.item,kind:ie.value,mode:ee.mode,"attendant-name":ee.attendantName,requirement:ee.requirement,unlocked:!ee.locked,"unlocked-at":ee.unlockedAt,selected:ee.selected,"selected-label":ee.selectedLabel},null,8,["item","kind","mode","attendant-name","requirement","unlocked","unlocked-at","selected","selected-label"])])],38)):e$b.createCommentVNode("",!0)]),_:1})])):e$b.createCommentVNode("",!0)]),_:3},40,["type","disabled","aria-pressed","aria-disabled","title","style","class","onMouseenter","onMouseleave"]))}},CosmeticCard=_export_sfc$1(_sfc_main$d,[["__scopeId","data-v-d4d004b5"]]),_hoisted_1$b={class:"flex flex-col items-center gap-2 rounded-2xl border border-dashed border-base-100/20 bg-base-200/40 p-8 text-center"},_hoisted_2$b={class:"size-8 text-base-content/35",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},_hoisted_3$a=["d"],_hoisted_4$9={class:"text-sm font-bold"},_hoisted_5$8={class:"text-xs text-base-content/50"},_hoisted_6$6={key:0,class:"mt-1 text-[11px] leading-relaxed text-base-content/35"},_hoisted_7$6={key:1,class:"mt-2 flex flex-wrap items-center justify-center gap-2"},_sfc_main$c={__name:"EmptyState",props:{icon:{type:String,default:"empty"},title:{type:String,default:""},subtitle:{type:String,default:""},flavor:{type:String,default:""}},setup(ee){const te=ee,ne={empty:["M3 14h4l1.5 2.5h7L17 14h4","M5 5.5 3 14v3.5A1.5 1.5 0 0 0 4.5 19h15a1.5 1.5 0 0 0 1.5-1.5V14l-2-8.5A1.5 1.5 0 0 0 17.5 4h-11A1.5 1.5 0 0 0 5 5.5Z"],ledger:["M6 3h9l4 4v12.5a1.5 1.5 0 0 1-2.17 1.35L15 20l-1.83.85a1.5 1.5 0 0 1-1.34 0L10 20l-1.83.85A1.5 1.5 0 0 1 6 19.5Z","M14 3v4h5","M9 10h7","M9 14h5"],locked:["M6 11h12a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1Z","M8.5 11V8a3.5 3.5 0 0 1 7 0v3","M12 15v2"],sparkle:["M12 3.5l1.7 4.3 4.3 1.7-4.3 1.7L12 15.5l-1.7-4.3L6 9.5l4.3-1.7Z","M18 15.5l.85 2.15L21 18.5l-2.15.85L18 21.5l-.85-2.15L15 18.5l2.15-.85Z"]},ae=()=>ne[te.icon]||ne.empty;return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$b,[e$b.renderSlot(re.$slots,"icon",{},()=>[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$b,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae(),ie=>(e$b.openBlock(),e$b.createElementBlock("path",{key:ie,d:ie},null,8,_hoisted_3$a))),128))]))]),e$b.createElementVNode("p",_hoisted_4$9,e$b.toDisplayString(ee.title),1),e$b.createElementVNode("p",_hoisted_5$8,[e$b.renderSlot(re.$slots,"default",{},()=>[e$b.createTextVNode(e$b.toDisplayString(ee.subtitle),1)])]),ee.flavor?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_6$6,e$b.toDisplayString(ee.flavor),1)):e$b.createCommentVNode("",!0),re.$slots.actions?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$6,[e$b.renderSlot(re.$slots,"actions")])):e$b.createCommentVNode("",!0)]))}},_hoisted_1$a=["role","aria-label"],_hoisted_2$a=["role","aria-selected","aria-pressed","onClick"],_hoisted_3$9={key:0,class:"size-4 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24","aria-hidden":"true"},_hoisted_4$8=["d"],_hoisted_5$7={key:1,class:"ml-1 tabular-nums opacity-70"},_sfc_main$b={__name:"PillTabs",props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},ariaLabel:{type:String,default:""},layout:{type:String,default:"grid"},size:{type:String,default:"sm"},tone:{type:String,default:"primary",validator:ee=>["primary","neutral"].includes(ee)},role:{type:String,default:"tablist",validator:ee=>["tablist","buttons"].includes(ee)},icon:{type:Boolean,default:!1},wrap:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(ee){const te=ee,ne=e$b.computed(()=>te.role==="tablist"),ae=e$b.computed(()=>te.layout==="row"?null:{gridTemplateColumns:`repeat(${te.options.length}, minmax(0, 1fr))`});return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["pill-tabs rounded-xl bg-base-200/80 p-0.5",[ee.layout==="row"?"inline-flex gap-1":"pill-tabs--fluid grid gap-1",ee.wrap?"flex-wrap":""]]),style:e$b.normalizeStyle(ae.value),role:ne.value?"tablist":void 0,"aria-label":ee.ariaLabel||void 0},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ee.options,ie=>(e$b.openBlock(),e$b.createElementBlock("button",{key:ie.key,type:"button",role:ne.value?"tab":void 0,"aria-selected":ne.value?ee.modelValue===ie.key:void 0,"aria-pressed":ne.value?void 0:ee.modelValue===ie.key,class:e$b.normalizeClass(["min-w-0 whitespace-nowrap rounded-lg font-semibold transition-all duration-200",ee.icon?"inline-flex items-center gap-2":"",ee.size==="md"?"pill-tabs__tab--md px-3.5 py-2 text-sm active:scale-95":"px-2 py-2 text-xs",ee.modelValue===ie.key?ee.tone==="neutral"?"bg-base-100 text-base-content":"bg-primary text-white":"text-base-content/80 hover:text-base-content"]),onClick:le=>re.$emit("update:modelValue",ie.key)},[ee.icon&&ie.icon?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$9,[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:ie.icon},null,8,_hoisted_4$8)])):e$b.createCommentVNode("",!0),e$b.createTextVNode(" "+e$b.toDisplayString(ie.label)+" ",1),ie.count!=null?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$7,e$b.toDisplayString(ie.count),1)):e$b.createCommentVNode("",!0)],10,_hoisted_2$a))),128))],14,_hoisted_1$a))}},PillTabs=_export_sfc$1(_sfc_main$b,[["__scopeId","data-v-8c7af052"]]),FLAVOR={loading:["Ninguém compra moldura aqui. Só conquista.","A temporada leva os pontos. Seu nível fica.","Tudo que brilha no seu avatar foi merecido.","O placar reinicia. Sua coleção não.","Todo ponto tem origem — e ela está no extrato.","Título não se herda. Se ganha.","A disputa é dentro do seu departamento.","Você veste o que quiser — do que já é seu."],"collection-empty":["Vitrine vazia. Por enquanto.","Aqui só entra o que você arrancou.","O primeiro item é sempre o mais difícil.","Nada aqui se compra. Nada aqui se perde."],"achievements-empty":["Nenhuma no bolso. Todas ainda em jogo.","Cada card diz como cair. Escolha um alvo.","As secretas não avisam. Elas caem.","Ninguém começa com a estante cheia."],"ledger-empty":["Nada lançado ainda. O placar começa limpo.","Cada ponto vai aparecer aqui com nome e origem.","Estorno não some do extrato: vira linha nova.","O que o gestor ajusta também passa por aqui."]},cursors=new Map,FLAVOR_CONTEXTS=Object.keys(FLAVOR);function pickFlavor(ee,te){const ne=FLAVOR[ee];if(!(ne!=null&&ne.length))return"";if(Number.isFinite(te))return ne[(te%ne.length+ne.length)%ne.length];const ae=(cursors.get(ee)??-1)+1;return cursors.set(ee,ae),ne[ae%ne.length]}const _hoisted_1$9={class:"cosmetic-grid flex min-h-0 flex-col gap-3"},_hoisted_2$9={key:0,class:"flex shrink-0 flex-wrap items-center gap-2.5"},_hoisted_3$8={key:0,class:"flex h-11 min-w-48 flex-1 items-center gap-2.5 rounded-lg border border-base-200 bg-base-200 px-3 transition-colors focus-within:border-primary/60 focus-within:ring-2 focus-within:ring-primary/15"},_hoisted_4$7=["aria-label"],_hoisted_5$6={key:1,class:"flex min-h-56 flex-1 items-center justify-center py-10","aria-busy":"true"},_hoisted_6$5={key:0,class:"flex items-center gap-2"},_hoisted_7$5={class:"text-[11px] tabular-nums leading-none text-base-content/60"},_sfc_main$a={__name:"CosmeticGrid",props:{items:{type:Array,required:!0},kind:{type:String,default:null},attendantName:{type:String,default:""},density:{type:String,default:"comfortable"},layout:{type:String,default:null},loading:{type:Boolean,default:!1},selectedId:{type:[String,Number],default:null},busyId:{type:[String,Number],default:null},deniedId:{type:[String,Number],default:null},selectedLabel:{type:String,default:"Equipado"},searchable:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},groupByRarity:{type:Boolean,default:!1},cascade:{type:Boolean,default:!1},noun:{type:String,default:"item"},scroll:{type:Boolean,default:!1}},emits:["select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=[{key:"all",label:"Todos"},{key:"unlocked",label:"Desbloqueados"},{key:"locked",label:"Bloqueados"}],oe=e$b.ref("all"),ie=e$b.ref(""),le=e$b.computed(()=>(ne.layout||(ce()==="title"?"plaques":"tiles"))==="plaques"?"smplay-grid-3":"smplay-grid-tiles");function ce(){var $e;return ne.kind||(($e=ne.items[0])==null?void 0:$e.type)||null}const de=e$b.computed(()=>{const $e=ne.items.length,ye=ne.items.filter(Se=>Se.unlocked).length,Ee={all:$e,unlocked:ye,locked:$e-ye};return re.map(Se=>({...Se,count:Ee[Se.key]}))});function ue($e){return String($e||"").normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase()}const ve=e$b.computed(()=>{let $e=ne.items;if(ne.filterable&&oe.value!=="all"){const Ee=oe.value==="unlocked";$e=$e.filter(Se=>!!Se.unlocked===Ee)}const ye=ue(ie.value.trim());return!ne.searchable||!ye?$e:$e.filter(Ee=>ue(Ee.name).includes(ye)||ue(Ee.requirementLabel).includes(ye))}),me=Object.values(RARITIES).sort(($e,ye)=>$e.order-ye.order).map($e=>$e.key),ge=e$b.computed(()=>{const $e=ve.value;if(!ne.groupByRarity)return $e.length?[{key:"all",meta:null,offset:0,items:$e}]:[];const ye=[];let Ee=0;for(const Se of me){const Le=$e.filter(Ve=>Ve.rarity===Se);Le.length&&(ye.push({key:Se,meta:RARITIES[Se],offset:Ee,items:Le}),Ee+=Le.length)}return ye});function fe($e,ye){return ne.cascade?Math.min(($e.offset+ye)*30,300):0}const pe=pickFlavor("loading"),_e=pickFlavor("collection-empty"),be=e$b.computed(()=>ie.value||oe.value!=="all"?"":_e),ke=e$b.computed(()=>ie.value?`Nada encontrado para "${ie.value}".`:`Nenhum ${ne.noun} encontrado neste filtro.`);return($e,ye)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$9,[!ee.loading&&(ee.searchable||ee.filterable||$e.$slots["toolbar-end"])?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$9,[ee.searchable?(e$b.openBlock(),e$b.createElementBlock("label",_hoisted_3$8,[ye[2]||(ye[2]=e$b.createElementVNode("svg",{class:"size-4 shrink-0 text-base-content/55",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round",d:"m21 21-4.3-4.3M17 10.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0Z"})],-1)),e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":ye[0]||(ye[0]=Ee=>ie.value=Ee),type:"search",placeholder:"Buscar",class:"w-full appearance-none border-0 bg-transparent p-0 text-sm font-normal text-base-content placeholder:text-base-content/55 focus:outline-none focus:ring-0 [&::-webkit-search-cancel-button]:appearance-none","aria-label":`Buscar ${ee.noun}`},null,8,_hoisted_4$7),[[e$b.vModelText,ie.value]])])):e$b.createCommentVNode("",!0),ee.filterable?(e$b.openBlock(),e$b.createBlock(PillTabs,{key:1,modelValue:oe.value,"onUpdate:modelValue":ye[1]||(ye[1]=Ee=>oe.value=Ee),options:de.value,layout:"row",size:"sm",tone:"neutral","aria-label":`Filtro de ${ee.noun}s`},null,8,["modelValue","options","aria-label"])):e$b.createCommentVNode("",!0),e$b.renderSlot($e.$slots,"toolbar-end",{},void 0,!0)])):e$b.createCommentVNode("",!0),ee.loading?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5$6,[e$b.createVNode(PixelLoader,{size:"lg",label:"Carregando",flavor:e$b.unref(pe)},null,8,["flavor"])])):ge.value.length?(e$b.openBlock(),e$b.createElementBlock("div",{key:2,class:e$b.normalizeClass(["min-h-0 flex-1 space-y-3",ee.scroll?"overflow-y-auto":""])},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ge.value,Ee=>(e$b.openBlock(),e$b.createElementBlock("section",{key:Ee.key,class:"cosmetic-group space-y-2"},[Ee.meta?(e$b.openBlock(),e$b.createElementBlock("header",_hoisted_6$5,[e$b.createElementVNode("span",{class:e$b.normalizeClass([Ee.meta.chip,"inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-bold uppercase leading-tight tracking-wide"])},e$b.toDisplayString(Ee.meta.label),3),e$b.createElementVNode("span",_hoisted_7$5,e$b.toDisplayString(Ee.items.length),1),ye[3]||(ye[3]=e$b.createElementVNode("span",{class:"h-px flex-1 bg-base-100","aria-hidden":"true"},null,-1))])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",{class:e$b.normalizeClass(["gap-3",le.value])},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(Ee.items,(Se,Le)=>(e$b.openBlock(),e$b.createBlock(CosmeticCard,{key:Se.id,item:Se,kind:ee.kind||Se.type,"attendant-name":ee.attendantName,density:ee.density,caption:Se.requirementLabel,locked:!Se.unlocked,selected:ee.selectedId===Se.id,"selected-label":ee.selectedLabel,busy:ee.busyId===Se.id,denied:ee.deniedId===Se.id,"enter-delay":fe(Ee,Le),mode:"attendant","hover-requirements":"",requirement:Se.requirementDetail,"unlocked-at":Se.unlocked_at,onSelect:Ve=>ae("select",Se)},null,8,["item","kind","attendant-name","density","caption","locked","selected","selected-label","busy","denied","enter-delay","requirement","unlocked-at","onSelect"]))),128))],2)]))),128))],2)):(e$b.openBlock(),e$b.createBlock(_sfc_main$c,{key:3,icon:"sparkle",title:"Nada por aqui ainda",subtitle:ke.value,flavor:be.value},null,8,["subtitle","flavor"]))]))}},CosmeticGrid=_export_sfc$1(_sfc_main$a,[["__scopeId","data-v-c6a4dca5"]]),BREAKDOWN_RULES=[{id:"chat_finished",label:"Atendimentos",eventLabel:"Atendimento finalizado",kind:"points",icon:"M9 12l2 2 4-4m6 2a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",filledIcon:"M9.55 17.45 4.1 12l1.4-1.4 4.05 4.05L18.5 5.7l1.4 1.4-10.35 10.35Z"},{id:"chat_grade",label:"Boa avaliação",eventLabel:"Boa avaliação",kind:"points",icon:"M11.48 3.5l2.02 4.1 4.52.66-3.27 3.19.77 4.5-4.04-2.13-4.04 2.13.77-4.5-3.27-3.19 4.52-.66 2.02-4.1z",filledIcon:"M13.85 4.22c-.68-1.63-3.02-1.63-3.7 0L8.4 8.39l-4.55.36c-1.78.14-2.5 2.33-1.15 3.48l3.47 2.93-1.06 4.39c-.41 1.72 1.47 3.07 2.99 2.15L12 19.35l3.9 2.35c1.52.92 3.4-.43 2.99-2.15l-1.06-4.39 3.47-2.93c1.35-1.15.63-3.34-1.15-3.48l-4.55-.36-1.75-4.17Z",negative:{label:"Nota baixa",eventLabel:"Nota baixa",kind:"deduction",icon:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-3.6-5.4a4.5 4.5 0 0 1 7.2 0M9 10h.01M15 10h.01",filledIcon:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20ZM8.5 8.5a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm7 0a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm1.08 8.25a1 1 0 0 1-1.4-.17A4.03 4.03 0 0 0 12 15a4.03 4.03 0 0 0-3.18 1.58 1 1 0 1 1-1.57-1.24A6.03 6.03 0 0 1 12 13a6.03 6.03 0 0 1 4.75 2.34 1 1 0 0 1-.17 1.41Z"}},{id:"chat_attending_time",label:"Resolução rápida",eventLabel:"Resolução rápida",kind:"points",icon:"M13 2 4.5 13H11l-1 9 8.5-11H12l1-9Z",filledIcon:"M13 2 4.5 13H11l-1 9 8.5-11H12l1-9Z"},{id:"chat_waiting_time",label:"Fila",eventLabel:"Fila curta",kind:"points",icon:"M12 8v4l3 2m6-2a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",filledIcon:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1 6v3.59l2.7 2.7a1 1 0 0 1-1.4 1.42l-3-3A1 1 0 0 1 11 12V8a1 1 0 1 1 2 0Z",negative:{label:"Fila longa",eventLabel:"Fila longa",kind:"deduction",icon:"M6 3h12M6 21h12M8 3v3.5a4 4 0 0 0 1.6 3.2L12 12l-2.4 2.3A4 4 0 0 0 8 17.5V21m8-18v3.5a4 4 0 0 1-1.6 3.2L12 12l2.4 2.3a4 4 0 0 1 1.6 3.2V21",filledIcon:"M6 2a1 1 0 0 0 0 2h1v2.5a5 5 0 0 0 2 4L10.67 12 9 13.5a5 5 0 0 0-2 4V20H6a1 1 0 1 0 0 2h12a1 1 0 1 0 0-2h-1v-2.5a5 5 0 0 0-2-4L13.33 12 15 10.5a5 5 0 0 0 2-4V4h1a1 1 0 1 0 0-2H6Zm3 2h6v2.5a3 3 0 0 1-1.2 2.4L12 10.5l-1.8-1.6A3 3 0 0 1 9 6.5V4Zm3 9.5 1.8 1.6a3 3 0 0 1 1.2 2.4V20H9v-2.5a3 3 0 0 1 1.2-2.4l1.8-1.6Z"}},{id:"chat_flow",label:"Atendimento proativo",eventLabel:"Atendimento proativo",kind:"points",icon:"M3 17l6-6 4 4 8-8m0 0h-5m5 0v5",filledIcon:"M20 5h-5a1 1 0 1 0 0 2h2.59L13 11.59l-3.29-3.3a1 1 0 0 0-1.42 0l-6 6a1 1 0 1 0 1.42 1.42L9 10.41l3.29 3.3a1 1 0 0 0 1.42 0L19 8.41V11a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1Z"},{id:"daily_cap",label:"Teto diário",eventLabel:"Teto diário atingido",kind:"cap",icon:"M12 3l8 3v6c0 4-3 7-8 9-5-2-8-5-8-9V6l8-3zM12 8v4m0 3h.01",filledIcon:"M12 2.1 4 5v6.1c0 4.6 3.4 8.4 8 9.8 4.6-1.4 8-5.2 8-9.8V5l-8-2.9Zm-1 4.9h2v6.2h-2V7Zm1 8a1.2 1.2 0 0 1 0 2.4 1.2 1.2 0 0 1 0-2.4Z"},{id:"penalty",label:"Punições",eventLabel:"Punição",kind:"penalty",icon:"M12 3.2 4.6 6v2.4c0 4.9 3 8.9 7.4 10.4 4.4-1.5 7.4-5.5 7.4-10.4V6L12 3.2ZM12 8.2v3.9m0 3h.01",filledIcon:"M11.48 2.6a.75.75 0 0 1 1.04 0 12.7 12.7 0 0 0 8.1 3.55c.4.03.71.35.72.75.02.5.02 1 .02 1.45 0 5.79-3.6 10.73-8.68 12.72a1.9 1.9 0 0 1-1.36 0C6.24 19.08 2.64 14.14 2.64 8.35c0-.45 0-.95.02-1.45.01-.4.32-.72.72-.75a12.7 12.7 0 0 0 8.1-3.55Zm.52 4.65a.95.95 0 0 0-.95 1l.22 4a.73.73 0 0 0 1.46 0l.22-4a.95.95 0 0 0-.95-1Zm0 8a1.1 1.1 0 1 0 0 2.2 1.1 1.1 0 0 0 0-2.2Z"},{id:"achievement",label:"Conquistas",eventLabel:"Conquista desbloqueada",kind:"achievement",icon:"M7 4h10v4a5 5 0 0 1-10 0V4Zm0 1H4v2a4 4 0 0 0 4 4m9-6h3v2a4 4 0 0 1-4 4M9 19h6M12 13v6",filledIcon:"M18 3V2H6v1H2v3a5 5 0 0 0 4.1 4.9A6 6 0 0 0 11 14.9V18H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-3.1A6 6 0 0 0 17.9 11 5 5 0 0 0 22 6V3h-4ZM4 6V5h2v3.8A3 3 0 0 1 4 6Zm16 0a3 3 0 0 1-2 2.8V5h2v1Z"},{id:"reverse",label:"Estornos",eventLabel:"Estorno",kind:"reversal",icon:"M9 14 4 9l5-5M4 9h9a7 7 0 0 1 0 14h-3",filledIcon:"M8.7 3.3a1 1 0 0 1 0 1.4L6.41 7H13a7.5 7.5 0 0 1 0 15h-2a1 1 0 1 1 0-2h2a5.5 5.5 0 0 0 0-11H6.41l2.3 2.3a1 1 0 1 1-1.42 1.4l-4-4a1 1 0 0 1 0-1.4l4-4a1 1 0 0 1 1.42 0Z"}],BREAKDOWN_RULE=BREAKDOWN_RULES.reduce((ee,te)=>(ee[te.id]=te,ee),{}),BREAKDOWN_RULE_IDS=BREAKDOWN_RULES.map(ee=>ee.id),BREAKDOWN_RULES_WITH_NEGATIVE=BREAKDOWN_RULES.filter(ee=>ee.negative).map(ee=>ee.id);function breakdownRuleFor(ee,te){const ne=BREAKDOWN_RULE[ee];return!(ne!=null&&ne.negative)||!(Number(te)<0)?ne:{...ne,...ne.negative}}const _hoisted_1$8=["aria-label"],_hoisted_2$8={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},_hoisted_3$7=["d"],_sfc_main$9={__name:"RuleBadge",props:{rule:{type:String,required:!0},size:{type:String,default:"md"},tone:{type:String,default:"primary"},negative:{type:Boolean,default:!1}},setup(ee){const te=ee,ne=e$b.computed(()=>breakdownRuleFor(te.rule,te.negative?-1:0)),ae=e$b.computed(()=>{var oe;return((oe=ne.value)==null?void 0:oe.icon)||""}),re=e$b.computed(()=>{var oe;return((oe=ne.value)==null?void 0:oe.label)||te.rule});return(oe,ie)=>(e$b.openBlock(),e$b.createElementBlock("span",{class:e$b.normalizeClass(["rule-badge",[`rule-badge-${ee.size}`,`rule-badge-${ee.tone}`]]),role:"img","aria-label":re.value},[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$8,[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:ae.value},null,8,_hoisted_3$7)]))],10,_hoisted_1$8))}},RuleBadge=_export_sfc$1(_sfc_main$9,[["__scopeId","data-v-210e017d"]]),_hoisted_1$7={viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},_hoisted_2$7=["d"],_sfc_main$8={__name:"RuleIcon",props:{rule:{type:String,required:!0},negative:{type:Boolean,default:!1}},setup(ee){const te=ee,ne=e$b.computed(()=>breakdownRuleFor(te.rule,te.negative?-1:0));return(ae,re)=>{var oe,ie;return e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_1$7,[e$b.createElementVNode("path",{d:((oe=ne.value)==null?void 0:oe.filledIcon)||((ie=ne.value)==null?void 0:ie.icon)||""},null,8,_hoisted_2$7)])}}};function ledgerEntryDetails(ee={}){return Array.isArray(ee==null?void 0:ee.details)?ee.details.map(te=>({...te,rule:te==null?void 0:te.name,points:Number(te==null?void 0:te.point)||0})).filter(te=>!!te.rule):[]}function ledgerEntryReversed(ee={}){return!!(ee!=null&&ee.reversed)}function ledgerEntryReversal(ee={}){return!!(ee!=null&&ee.is_reversal)}function ledgerEntryKind(ee,te){var ne;return((ne=breakdownRuleFor(ee,te))==null?void 0:ne.kind)??"points"}function ledgerEntryXp(ee){const te=ledgerEntryDetails(ee);return te.length?te.reduce((ne,ae)=>ledgerEntryKind(ae.rule,ae.points)==="cap"?ne:ne+(ae.points>0?ae.points:0),0):0}function formatLedgerValue(ee,te){if(te==null)return"";switch(ee){case"chat_attending_time":return`${te} min`;case"chat_waiting_time":return`cliente esperou ${te} min`;case"chat_grade":return`nota ${te}`;case"chat_flow":return`×${Number(te).toLocaleString("pt-BR")}`;default:return""}}function rollupLedgerByRule(ee=[]){var ne;const te=new Map;for(const ae of ee)for(const re of ledgerEntryDetails(ae)){const{rule:oe,points:ie}=re;if(ledgerEntryKind(oe,ie)==="cap")continue;const le=ie<0&&!!((ne=BREAKDOWN_RULE[oe])!=null&&ne.negative),ce=le?`${oe}:negative`:oe;te.has(ce)||te.set(ce,{rule:oe,negative:le,count:0,points:0});const de=te.get(ce);de.count+=1,de.points+=ie}return[...te.values()]}const DAY_MS=864e5,dayFormatter=new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"short"});function ledgerDayKey(ee){const te=new Date(ee);return Number.isNaN(te.getTime())?0:new Date(te.getFullYear(),te.getMonth(),te.getDate()).getTime()}function ledgerDayLabel(ee,te=new Date){const ne=ledgerDayKey(te);return ee===ne?"Hoje":ee===ne-DAY_MS?"Ontem":dayFormatter.format(new Date(ee))}function ledgerRelativeTime(ee,te=new Date){const ne=new Date(ee);if(Number.isNaN(ne.getTime()))return"";const ae=Math.max(0,Math.round((new Date(te)-ne)/6e4));if(ae<1)return"agora";if(ae<60)return`há ${ae} min`;const re=Math.round(ae/60);return re<24?`há ${re} h`:`há ${Math.round(re/24)} d`}function groupLedgerByDay(ee=[],te=new Date){const ne=new Map;for(const ae of ee){const re=ledgerDayKey(ae==null?void 0:ae.created_at);ne.has(re)||ne.set(re,[]),ne.get(re).push(ae)}return[...ne.entries()].sort((ae,re)=>re[0]-ae[0]).map(([ae,re])=>({key:ae,label:ledgerDayLabel(ae,te),rows:re,points:re.reduce((oe,ie)=>oe+(Number(ie.points)||0),0)}))}function summarizeLedger(ee=[]){const te=ee.reduce((ne,ae)=>ne+(Number(ae.points)||0),0);return{points:te,xp:te}}const _hoisted_1$6={key:0,class:"sm-ledger-day"},_hoisted_2$6={class:"sm-ledger-rail"},_hoisted_3$6={class:"sm-ledger-day-head"},_hoisted_4$6={class:"sm-ledger-day-label"},_hoisted_5$5={class:"sm-ledger-rail"},_hoisted_6$4={class:"sm-ledger-main"},_hoisted_7$4=["aria-expanded","onClick"],_hoisted_8$3={class:"min-w-0 flex-1"},_hoisted_9$2={class:"sm-ledger-title"},_hoisted_10$2={class:"sm-ledger-sub"},_hoisted_11$2={key:0,class:"sm-ledger-tag"},_hoisted_12$1={key:1,class:"sm-ledger-meta"},_hoisted_13$1=["title"],_hoisted_14$1={class:"sm-ledger-side"},_hoisted_15$1={class:"sm-ledger-stamp"},_hoisted_16$1={key:0,class:"sm-ledger-actions"},_hoisted_17={key:0,class:"sm-ledger-detail"},_hoisted_18={class:"sm-ledger-detail-label"},_hoisted_19={class:"sm-ledger-more-spin"},_hoisted_20={key:0,class:"sm-ledger-more-count"},_hoisted_21={key:1},_sfc_main$7={__name:"LedgerTimeline",props:{entries:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},density:{type:String,default:"cozy",validator:ee=>["cozy","compact"].includes(ee)},hasMore:{type:Boolean,default:!1},loadMore:{type:Function,default:null},pageKey:{type:[String,Number],default:""},total:{type:Number,default:0},now:{type:[Date,Number,String],default:()=>new Date}},setup(ee){const te=ee,ne=e$b.computed(()=>new Date(te.now)),ae=e$b.computed(()=>groupLedgerByDay(te.entries,ne.value)),re=e$b.ref(new Set);function oe(fe){const pe=new Set(re.value);pe.has(fe)?pe.delete(fe):pe.add(fe),re.value=pe}const ie=fe=>re.value.has(fe);e$b.watch(()=>te.entries,()=>{re.value=new Set});function le(fe){const pe=Number(fe)||0;return`${pe>0?"+":""}${pe.toLocaleString("pt-BR")}`}function ce(fe){return ledgerRelativeTime(fe,ne.value)}function de(fe){return Array.isArray(fe.details)&&fe.details.length?fe.details:[{id:`${fe.id}:0`,rule:fe.rule,kind:fe.kind,label:fe.label||fe.title,points:fe.points}]}function ue(fe){const pe=de(fe);return pe.length>1?pe:[]}const ve=fe=>de(fe)[0],me=e$b.computed(()=>`${te.pageKey}:${te.entries.length}`);async function ge(fe){if(te.loading||!te.loadMore)return fe.loaded();if(!te.hasMore)return fe.complete();try{await te.loadMore()}catch{return fe.error()}te.hasMore?fe.loaded():fe.complete()}return(fe,pe)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["sm-ledger",`sm-ledger--${ee.density}`])},[ee.loading?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$6,[pe[1]||(pe[1]=e$b.createElementVNode("div",{class:"sm-ledger-day-head"},[e$b.createElementVNode("span",{class:"sm-ledger-day-marker"}),e$b.createElementVNode("span",{class:"sm-ledger-skeleton h-3 w-20"}),e$b.createElementVNode("span",{class:"sm-ledger-day-line"})],-1)),e$b.createElementVNode("div",_hoisted_2$6,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(4,_e=>e$b.createElementVNode("div",{key:_e,class:"sm-ledger-row"},[...pe[0]||(pe[0]=[e$b.createStaticVNode('<span class="sm-ledger-node sm-ledger-node--ghost" data-v-19d71dc8></span><div class="sm-ledger-main" data-v-19d71dc8><div class="min-w-0 flex-1 space-y-1.5" data-v-19d71dc8><span class="sm-ledger-skeleton h-3 w-2/3" data-v-19d71dc8></span><span class="sm-ledger-skeleton h-2.5 w-1/3" data-v-19d71dc8></span></div><span class="sm-ledger-skeleton h-5 w-12 shrink-0" data-v-19d71dc8></span></div>',2)])])),64))])])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae.value,_e=>(e$b.openBlock(),e$b.createElementBlock("section",{key:_e.key,class:"sm-ledger-day","aria-label":"Lançamentos do dia"},[e$b.createElementVNode("header",_hoisted_3$6,[pe[2]||(pe[2]=e$b.createElementVNode("span",{class:"sm-ledger-day-marker","aria-hidden":"true"},null,-1)),e$b.createElementVNode("h3",_hoisted_4$6,e$b.toDisplayString(_e.label),1),pe[3]||(pe[3]=e$b.createElementVNode("span",{class:"sm-ledger-day-line","aria-hidden":"true"},null,-1)),_e.points?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["sm-ledger-day-total",_e.points<0?"is-negative":""])},e$b.toDisplayString(le(_e.points))+" pts ",3)):e$b.createCommentVNode("",!0)]),e$b.createElementVNode("ol",_hoisted_5$5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(_e.rows,be=>(e$b.openBlock(),e$b.createElementBlock("li",{key:be.id,class:e$b.normalizeClass(["sm-ledger-row",[`is-${be.kind||"points"}`,be.reversed?"is-reversed":"",ie(be.id)?"is-open":""]])},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["sm-ledger-node",`is-${be.kind||"points"}`]),"aria-hidden":"true"},[e$b.createVNode(_sfc_main$8,{rule:ve(be).rule,negative:ve(be).points<0},null,8,["rule","negative"])],2),e$b.createElementVNode("div",_hoisted_6$4,[e$b.createElementVNode("button",{type:"button",class:"sm-ledger-hit","aria-expanded":ie(be.id),onClick:ke=>oe(be.id)},[e$b.createElementVNode("span",_hoisted_8$3,[e$b.createElementVNode("span",_hoisted_9$2,e$b.toDisplayString(be.title),1),e$b.createElementVNode("span",_hoisted_10$2,[be.reversed?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_11$2," estornado ")):e$b.createCommentVNode("",!0),be.subtitle?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_12$1,e$b.toDisplayString(be.subtitle),1)):e$b.createCommentVNode("",!0),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ue(be),ke=>(e$b.openBlock(),e$b.createElementBlock("span",{key:ke.id,class:e$b.normalizeClass(["sm-ledger-chip",ke.points<0?"is-negative":""]),title:ke.label},[e$b.createVNode(_sfc_main$8,{rule:ke.rule,negative:ke.points<0},null,8,["rule","negative"]),e$b.createTextVNode(" "+e$b.toDisplayString(le(ke.points)),1)],10,_hoisted_13$1))),128))])]),e$b.createElementVNode("span",_hoisted_14$1,[e$b.createElementVNode("span",{class:e$b.normalizeClass(["sm-ledger-amount",[be.points<0?"is-negative":"",be.points?"":"is-neutral"]])},[e$b.createTextVNode(e$b.toDisplayString(be.points?le(be.points):"0")+" ",1),pe[4]||(pe[4]=e$b.createElementVNode("small",null,"pts",-1))],2),e$b.createElementVNode("span",_hoisted_15$1,e$b.toDisplayString(ce(be.created_at)),1)]),pe[5]||(pe[5]=e$b.createElementVNode("svg",{class:"sm-ledger-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6 9 6 6 6-6"})],-1))],8,_hoisted_7$4),fe.$slots.actions?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$1,[e$b.renderSlot(fe.$slots,"actions",{entry:be},void 0,!0)])):e$b.createCommentVNode("",!0)]),ie(be.id)?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_17,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(de(be),ke=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ke.id,class:"sm-ledger-detail-row"},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["sm-ledger-detail-icon",ke.points<0?"is-negative":""])},[e$b.createVNode(_sfc_main$8,{rule:ke.rule,negative:ke.points<0},null,8,["rule","negative"])],2),e$b.createElementVNode("span",_hoisted_18,e$b.toDisplayString(ke.label),1),ke.points?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["sm-ledger-detail-points",ke.points<0?"is-negative":""])},e$b.toDisplayString(le(ke.points)),3)):e$b.createCommentVNode("",!0)]))),128))])):e$b.createCommentVNode("",!0)],2))),128))])]))),128)),ee.loadMore?(e$b.openBlock(),e$b.createBlock(e$b.unref(Y$1),{key:0,class:"sm-ledger-more",identifier:me.value,distance:120,onInfinite:ge},{spinner:e$b.withCtx(()=>[e$b.createElementVNode("span",_hoisted_19,[e$b.createVNode(Loader,{size:"xs",tone:"current"})])]),complete:e$b.withCtx(()=>[ee.total?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_20,e$b.toDisplayString(ee.entries.length)+" de "+e$b.toDisplayString(ee.total),1)):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_21))]),_:1},8,["identifier"])):e$b.createCommentVNode("",!0)],64))],2))}},LedgerTimeline=_export_sfc$1(_sfc_main$7,[["__scopeId","data-v-19d71dc8"]]),NON_CONFIGURABLE=new Set(["daily_cap","penalty","achievement","reverse"]),SCORING_RULE_IDS=BREAKDOWN_RULE_IDS.filter(ee=>!NON_CONFIGURABLE.has(ee)),SCORING_RULE_SHAPE={chat_finished:"flat",chat_grade:"bands",chat_attending_time:"bands",chat_waiting_time:"bands",chat_flow:"multiplier"},FLAT_FIELDS={chat_finished:{points:"base_points",threshold:null}},DEFAULT_FLAT_FIELDS={points:"points",threshold:null},BAND_ORDER={chat_grade:{valueKey:"grade",dir:"desc"},chat_attending_time:{valueKey:"limit",dir:"asc"},chat_waiting_time:{valueKey:"limit",dir:"asc"}},SCORING_NEGATIVE_RULE_IDS=SCORING_RULE_IDS.filter(ee=>{var te;return!!((te=BREAKDOWN_RULE[ee])!=null&&te.negative)});function acceptsNegativeBands(ee){var te;return!!((te=BREAKDOWN_RULE[ee])!=null&&te.negative)}function scoringBandOrder(ee,{negative:te=!1}={}){const ne=BAND_ORDER[ee];return ne?te?{valueKey:ne.valueKey,dir:ne.dir==="asc"?"desc":"asc"}:ne:null}function ruleRank(ee){const te=SCORING_RULE_IDS.indexOf(ee);return te===-1?SCORING_RULE_IDS.length:te}function resolveScoringRules(ee){return{...(ee==null?void 0:ee.rules)??{},...(ee==null?void 0:ee.overrides)??{}}}function scoringOverriddenRuleIds(ee){const te=(ee==null?void 0:ee.overrides)??{};return SCORING_RULE_IDS.filter(ne=>!!te[ne])}function ruleTiers(ee,te,ne){if(!(te!=null&&te.enabled))return[];const ae=SCORING_RULE_SHAPE[ee]??"flat";if(ae==="multiplier")return[];if(ae==="flat"){const ie=FLAT_FIELDS[ee]??DEFAULT_FLAT_FIELDS,le=Number(te[ie.points])||0;if(ne||le<0)return[];const ce=ie.threshold?Number(te[ie.threshold]):NaN;return[{value:Number.isFinite(ce)?ce:null,points:le}]}const re=scoringBandOrder(ee,{negative:ne}),oe=(Array.isArray(te.bands)?te.bands:[]).map(ie=>({value:Number(ie==null?void 0:ie[re==null?void 0:re.valueKey]),points:Number(ie==null?void 0:ie.points)||0})).filter(ie=>Number.isFinite(ie.value)&&(ne?ie.points<0:ie.points>0));return re?oe.sort((ie,le)=>re.dir==="asc"?ie.value-le.value:le.value-ie.value):oe}function scoringRuleTiers(ee,te){return ruleTiers(ee,te,!1)}function scoringRuleNegativeTiers(ee,te){return ruleTiers(ee,te,!0)}function scoringRuleBestPoints(ee,te){return scoringRuleTiers(ee,te).reduce((ne,ae)=>Math.max(ne,ae.points),0)}function scoringRuleWorstPoints(ee,te){return scoringRuleNegativeTiers(ee,te).reduce((ne,ae)=>Math.min(ne,ae.points),0)}function scoringRuleMultiplier(ee){const te=Number(ee==null?void 0:ee.multiplier);return ee!=null&&ee.enabled&&Number.isFinite(te)&&te>0?te:1}function scoringMaxPerChat(ee={}){const te=[];let ne=0;for(const re of Object.keys(ee)){if(SCORING_RULE_SHAPE[re]==="multiplier")continue;const oe=scoringRuleBestPoints(re,ee[re]);oe&&(te.push({rule:re,points:oe}),ne+=oe)}const ae=scoringRuleMultiplier(ee.chat_flow);return{base:ne,multiplier:ae,total:Math.round(ne*ae),contributions:te.map(re=>({...re,share:ne?re.points/ne:0})).sort((re,oe)=>oe.points-re.points||ruleRank(re.rule)-ruleRank(oe.rule))}}function scoringMaxDeductionPerChat(ee={}){const te=[];let ne=0;for(const ae of Object.keys(ee)){const re=scoringRuleWorstPoints(ae,ee[ae]);re&&(te.push({rule:ae,points:re}),ne+=re)}return{total:ne,contributions:te.sort((ae,re)=>ae.points-re.points||ruleRank(ae.rule)-ruleRank(re.rule))}}const _hoisted_1$5={class:"rounded-lg border border-base-100/20 bg-base-300"},_hoisted_2$5={class:"flex items-center justify-between gap-2 border-b border-base-100/15 px-3 py-2"},_hoisted_3$5={class:"text-xs font-bold uppercase tracking-wide text-base-content/50"},_hoisted_4$5={class:"divide-y divide-base-100/10"},_hoisted_5$4={class:"text-xs font-medium text-base-content/70"},_hoisted_6$3={class:"flex items-center gap-1.5 text-sm tabular-nums"},_hoisted_7$3={class:"font-bold text-base-content"},_hoisted_8$2={key:0,class:"rounded-md bg-warning/15 px-1.5 py-0.5 text-xs font-bold text-warning"},_sfc_main$6={__name:"ImpactPreview",props:{title:{type:String,required:!0},items:{type:Array,required:!0}},setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_1$5,[e$b.createElementVNode("p",_hoisted_2$5,[e$b.createElementVNode("span",_hoisted_3$5,e$b.toDisplayString(ee.title),1),e$b.renderSlot(te.$slots,"badge")]),e$b.createElementVNode("ul",_hoisted_4$5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ee.items,ae=>(e$b.openBlock(),e$b.createElementBlock("li",{key:ae.key,class:"flex items-center justify-between gap-3 px-3 py-2"},[e$b.createElementVNode("span",_hoisted_5$4,e$b.toDisplayString(ae.label),1),e$b.createElementVNode("span",_hoisted_6$3,[e$b.createElementVNode("span",{class:e$b.normalizeClass(ae.changed?"text-base-content/50 line-through":"font-bold text-base-content")},e$b.toDisplayString(ae.from),3),ae.changed?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[ne[0]||(ne[0]=e$b.createElementVNode("svg",{class:"size-3.5 shrink-0 text-warning",fill:"none",stroke:"currentColor","stroke-width":"2.5",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 12h14m0 0-5-5m5 5-5 5"})],-1)),e$b.createElementVNode("span",_hoisted_7$3,e$b.toDisplayString(ae.to),1),ae.note?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_8$2,e$b.toDisplayString(ae.note),1)):e$b.createCommentVNode("",!0)],64)):e$b.createCommentVNode("",!0)])]))),128))])]))}},_hoisted_1$4={class:"flex flex-col items-center gap-2 rounded-2xl border border-dashed border-base-100/20 bg-base-200/40 p-8 text-center",role:"alert"},_hoisted_2$4={class:"text-sm font-bold"},_hoisted_3$4={class:"text-xs text-base-content/50"},_hoisted_4$4=["disabled"],_sfc_main$5={__name:"LoadError",props:{title:{type:String,default:"Não foi possível carregar"},subtitle:{type:String,default:""},retryLabel:{type:String,default:"Tentar de novo"},retrying:{type:Boolean,default:!1}},emits:["retry"],setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$4,[e$b.renderSlot(te.$slots,"icon",{},()=>[ne[1]||(ne[1]=e$b.createElementVNode("svg",{class:"h-8 w-8 text-error",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M12 3.8a8.2 8.2 0 1 1-5.8 2.4","stroke-dasharray":"3 3.2"}),e$b.createElementVNode("path",{d:"M12 8.5v4"}),e$b.createElementVNode("path",{d:"M12 16h.01"})],-1))]),e$b.createElementVNode("p",_hoisted_2$4,e$b.toDisplayString(ee.title),1),e$b.createElementVNode("p",_hoisted_3$4,[e$b.renderSlot(te.$slots,"default",{},()=>[e$b.createTextVNode(e$b.toDisplayString(ee.subtitle),1)])]),ee.retryLabel?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,type:"button",class:"mt-1 inline-flex h-8 items-center gap-1.5 rounded-lg bg-primary px-3 text-xs font-bold text-primary-content transition hover:brightness-110 active:scale-95 disabled:pointer-events-none disabled:opacity-50",disabled:ee.retrying,onClick:ne[0]||(ne[0]=ae=>te.$emit("retry"))},[(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(["h-3.5 w-3.5",{"animate-spin":ee.retrying}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...ne[2]||(ne[2]=[e$b.createElementVNode("path",{d:"M20 11.5A8 8 0 1 0 18 17"},null,-1),e$b.createElementVNode("path",{d:"M20 5.5V12h-6"},null,-1)])],2)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.retrying?"Tentando…":ee.retryLabel),1)],8,_hoisted_4$4)):e$b.createCommentVNode("",!0)]))}},_hoisted_1$3={class:"space-y-1.5"},_hoisted_2$3={class:"flex items-baseline justify-between gap-2"},_hoisted_3$3=["for"],_hoisted_4$3={key:0,class:"text-warning"},_hoisted_5$3={class:"text-xs tabular-nums text-base-content/50"},_hoisted_6$2=["id","value","maxlength","placeholder"],_hoisted_7$2={key:0,class:"pt-0.5 text-xs leading-relaxed text-base-content/50"},_sfc_main$4={__name:"ReasonField",props:{modelValue:{type:String,default:""},id:{type:String,required:!0},label:{type:String,default:"Motivo"},maxlength:{type:Number,default:140},placeholder:{type:String,default:""},hint:{type:String,default:""},required:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$3,[e$b.createElementVNode("div",_hoisted_2$3,[e$b.createElementVNode("label",{for:ee.id,class:"text-xs font-medium text-base-content/70"},[e$b.createTextVNode(e$b.toDisplayString(ee.label)+" ",1),ee.required?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_4$3,"*")):e$b.createCommentVNode("",!0)],8,_hoisted_3$3),e$b.createElementVNode("span",_hoisted_5$3,e$b.toDisplayString(ee.modelValue.length)+"/"+e$b.toDisplayString(ee.maxlength),1)]),e$b.createElementVNode("textarea",{id:ee.id,value:ee.modelValue,rows:"2",maxlength:ee.maxlength,placeholder:ee.placeholder,class:"reason-field min-h-16 w-full resize-none rounded-lg border border-base-100/20 bg-base-300 px-3 py-2 text-sm font-medium leading-relaxed transition",onInput:ne[0]||(ne[0]=ae=>te.$emit("update:modelValue",ae.target.value))},null,40,_hoisted_6$2),ee.hint?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$2,e$b.toDisplayString(ee.hint),1)):e$b.createCommentVNode("",!0)]))}},ReasonField=_export_sfc$1(_sfc_main$4,[["__scopeId","data-v-4f5e8328"]]),_hoisted_1$2=["disabled"],_hoisted_2$2={class:"flex min-w-0 items-center gap-2"},_hoisted_3$2={class:"truncate"},_hoisted_4$2={class:"shrink-0 text-xs opacity-60"},_hoisted_5$2={key:0,class:"size-4 shrink-0 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},_hoisted_6$1={class:"relative p-2"},_hoisted_7$1={class:"scrollbar-none max-h-[224px] space-y-0.5 overflow-y-auto px-2 pb-2"},_hoisted_8$1={key:0,class:"tz-empty rounded-lg p-3 text-center text-sm opacity-60"},_hoisted_9$1=["onClick"],_hoisted_10$1={class:"truncate"},_hoisted_11$1={class:"shrink-0 text-xs opacity-60"},_sfc_main$3={__name:"TimezoneSelect",props:{modelValue:{type:String,default:"America/Sao_Paulo"},disabled:{type:Boolean,default:!1},saving:{type:Boolean,default:!1},bg:{type:String,default:"bg-base-200"},rounded:{type:String,default:"rounded-xl"},borderColor:{type:String,default:"border-transparent"}},emits:["update:modelValue","change"],setup(ee,{emit:te}){const ne=te,ae=["America/Araguaina","America/Bahia","America/Belem","America/Boa_Vista","America/Campo_Grande","America/Cuiaba","America/Eirunepe","America/Fortaleza","America/Maceio","America/Manaus","America/Noronha","America/Porto_Acre","America/Porto_Velho","America/Recife","America/Rio_Branco","America/Santarem","America/Sao_Paulo"];function re(fe){const pe=[],_e=[];return fe.forEach(be=>(ae.includes(be)?pe:_e).push(be)),pe.sort(),_e.sort(),[...pe,..._e]}const oe=re((()=>{try{return Intl.supportedValuesOf("timeZone")}catch{return ae}})());function ie(fe){try{const pe=new Date,_e=new Date(pe.toLocaleString("en-US",{timeZone:"UTC"})).getTime(),be=new Date(pe.toLocaleString("en-US",{timeZone:fe})).getTime(),ke=Math.round((be-_e)/6e4),$e=ke>=0?"+":"-",ye=Math.abs(ke),Ee=Math.floor(ye/60),Se=ye%60;return`UTC ${$e}${Ee}:${String(Se).padStart(2,"0")}`}catch{return"UTC +0:00"}}function le(fe){return String(fe).replace(/_/g," ")}function ce(fe){return String(fe).normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[/_]/g," ").toLowerCase()}const de=e$b.ref(!1),ue=e$b.ref(""),ve=e$b.ref(null),me=e$b.computed(()=>{const fe=ce(ue.value||"");return fe?oe.filter(pe=>ce(pe).includes(fe)):oe});function ge(fe){ne("update:modelValue",fe),ne("change",fe),de.value=!1,ue.value=""}return onClickOutside(ve,()=>{de.value=!1}),(fe,pe)=>(e$b.openBlock(),e$b.createElementBlock("div",{ref_key:"target",ref:ve,class:"relative w-full"},[e$b.createElementVNode("button",{type:"button",disabled:ee.disabled||ee.saving,onClick:pe[0]||(pe[0]=e$b.withModifiers(_e=>de.value=!de.value,["stop"])),class:e$b.normalizeClass([[ee.bg,ee.rounded,ee.borderColor],"tz-trigger flex w-full items-center justify-between gap-2 border px-4 text-sm outline-none transition-all disabled:cursor-not-allowed disabled:opacity-50"])},[e$b.createElementVNode("span",_hoisted_2$2,[e$b.createElementVNode("span",_hoisted_3$2,e$b.toDisplayString(le(ee.modelValue)),1),e$b.createElementVNode("span",_hoisted_4$2,"("+e$b.toDisplayString(ie(ee.modelValue))+")",1)]),ee.saving?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_5$2,[...pe[2]||(pe[2]=[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12h4Z"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",{key:1,class:e$b.normalizeClass([de.value?"rotate-180":"","size-4 shrink-0 opacity-60 transition-transform duration-200"]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...pe[3]||(pe[3]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.4 10.3A2 2 0 0 0 17 7H7a2 2 0 0 0-1.5 3.3l4.9 5.9a2 2 0 0 0 3 0l5-6Z","clip-rule":"evenodd"},null,-1)])],2))],10,_hoisted_1$2),e$b.createVNode(e$b.Transition,{name:"tz-fade"},{default:e$b.withCtx(()=>[de.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass([ee.rounded,"tz-dropdown absolute left-0 right-0 top-[calc(100%+4px)] z-30 border shadow-lg"])},[e$b.createElementVNode("div",_hoisted_6$1,[pe[4]||(pe[4]=e$b.createElementVNode("div",{class:"pointer-events-none absolute inset-y-0 left-5 flex items-center"},[e$b.createElementVNode("svg",{class:"size-4 opacity-50",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"})])],-1)),e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":pe[1]||(pe[1]=_e=>ue.value=_e),type:"search",class:"tz-search w-full rounded-lg py-2 pl-10 pr-3 text-sm outline-none",placeholder:"Pesquise seu fuso horário..."},null,512),[[e$b.vModelText,ue.value]])]),e$b.createElementVNode("div",_hoisted_7$1,[me.value.length?(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,{key:1},e$b.renderList(me.value,(_e,be)=>(e$b.openBlock(),e$b.createElementBlock("button",{key:be,onClick:ke=>ge(_e),class:e$b.normalizeClass(["tz-option flex w-full items-center justify-between gap-2 rounded-lg px-3 py-2 text-sm transition-all",_e===ee.modelValue?"tz-option--active":""])},[e$b.createElementVNode("span",_hoisted_10$1,e$b.toDisplayString(le(_e)),1),e$b.createElementVNode("span",_hoisted_11$1,"("+e$b.toDisplayString(ie(_e))+")",1)],10,_hoisted_9$1))),128)):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$1," Sem resultados "))])],2)):e$b.createCommentVNode("",!0)]),_:1})],512))}},TimezoneSelect=_export_sfc$1(_sfc_main$3,[["__scopeId","data-v-d686d01a"]]);function normalizeSmsListPayload(ee){return Array.isArray(ee==null?void 0:ee.results)?ee.results:Array.isArray(ee)?ee:[]}function getSmsPoolCredits(ee){return Number((ee==null?void 0:ee.balance)??(ee==null?void 0:ee.effective_available_credits)??(ee==null?void 0:ee.credits)??0)}function getSmsValidContacts(ee){return(ee==null?void 0:ee.valid_contacts)??(ee==null?void 0:ee.valid)??[]}function getSmsInvalidContacts(ee){return(ee==null?void 0:ee.invalid_contacts)??(ee==null?void 0:ee.invalid)??[]}function getSmsContactName(ee){var te;return(ee==null?void 0:ee.name)??((te=ee==null?void 0:ee.contact)==null?void 0:te.name)??"-"}function getSmsContactPhone(ee){var te;return(ee==null?void 0:ee.telephone)??(ee==null?void 0:ee.phone)??(ee==null?void 0:ee.number)??((te=ee==null?void 0:ee.contact)==null?void 0:te.telephone)??"-"}function getSmsCreditsToConsume(ee){return Number((ee==null?void 0:ee.credits_to_consume)??(ee==null?void 0:ee.credits)??getSmsValidContacts(ee).length)}async function listSmsPools({url:ee=smsPoolUrl}={}){const{data:te}=await api.get(ee);return normalizeSmsListPayload(te)}async function listSmsPoolsPaginated({page:ee=1,search:te="",pageSize:ne=20,url:ae=smsPoolUrl}={}){const re={page:ee,page_size:ne};te&&(re.name=te);const{data:oe}=await api.get(ae,{params:re});return oe}async function updateSmsPool(ee,te){const{data:ne}=await api.patch(`${smsPoolUrl}${ee}/`,te);return ne}const _hoisted_1$1={key:0,class:"mb-1.5 block text-xs font-semibold uppercase tracking-wide opacity-80"},_hoisted_2$1=["disabled"],_hoisted_3$1={key:0,class:"flex items-center gap-2 truncate"},_hoisted_4$1={class:"truncate font-semibold"},_hoisted_5$1={class:"shrink-0 rounded-full bg-primary/20 px-2 py-0.5 text-xs font-bold text-primary"},_hoisted_6={key:1,class:"text-current/40"},_hoisted_7={class:"ml-2 flex shrink-0 items-center gap-1"},_hoisted_8={key:0,class:"border-b border-base-100/50 px-2 py-2"},_hoisted_9={class:"max-h-52 overflow-y-auto"},_hoisted_10={key:0,class:"px-3 py-3 space-y-2"},_hoisted_11=["onClick"],_hoisted_12={class:"flex items-center gap-2 truncate"},_hoisted_13={key:0,class:"size-3.5 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},_hoisted_14={class:"truncate"},_hoisted_15={key:0,class:"py-4 text-center text-sm text-current/40"},_hoisted_16={key:1,class:"mt-1 text-xs text-red-500"},DROPDOWN_HEIGHT=260,_sfc_main$2={__name:"smsPoolSelect",props:{modelValue:{default:null},pools:{type:Array,default:null},loading:{type:Boolean,default:!1},error:{type:String,default:""},label:{type:String,default:"Carteira SMS"},placeholder:{type:String,default:"Selecione uma carteira"},disabled:{type:Boolean,default:!1},apiUrl:{type:String,default:smsPoolUrl}},emits:["update:modelValue"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.ref(!1),oe=e$b.ref(!1),ie=e$b.ref(""),le=e$b.ref([]),ce=e$b.ref(1),de=e$b.ref(0),ue=e$b.ref(!1),ve=e$b.ref(!0),me=e$b.ref(null),ge=e$b.ref(null);function fe(){if(!ge.value)return;const Te=ge.value.getBoundingClientRect(),ze=window.innerHeight-Te.bottom;oe.value=ze<DROPDOWN_HEIGHT&&Te.top>DROPDOWN_HEIGHT}const pe=e$b.computed(()=>Array.isArray(ne.pools)),_e=e$b.computed(()=>pe.value?ne.pools:le.value),be=e$b.computed(()=>pe.value?ne.loading:ue.value);async function ke(Te){if(pe.value){Te.complete();return}ue.value=!0;try{const ze=await listSmsPoolsPaginated({page:ce.value,search:ie.value,url:ne.apiUrl}),Re=Array.isArray(ze==null?void 0:ze.results)?ze.results:Array.isArray(ze)?ze:[];le.value.push(...Re),ce.value++,ze.next?(ve.value=!0,Te.loaded()):(ve.value=!1,Te.complete())}catch{Te.error()}finally{ue.value=!1}}let $e=null;function ye(){clearTimeout($e),$e=setTimeout(()=>{le.value=[],ce.value=1,ve.value=!0,de.value++},350)}e$b.watch(ie,()=>{pe.value||ye()});function Ee(Te){getSmsPoolCredits(Te)<=0||(ae("update:modelValue",Te),re.value=!1)}function Se(Te){Te.stopPropagation(),ae("update:modelValue",null)}function Le(){ne.disabled||(re.value||fe(),re.value=!re.value)}function Ve(Te){me.value&&!me.value.contains(Te.target)&&(re.value=!1)}return e$b.onMounted(()=>document.addEventListener("mousedown",Ve)),e$b.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Ve),clearTimeout($e)}),(Te,ze)=>(e$b.openBlock(),e$b.createElementBlock("div",null,[ee.label?(e$b.openBlock(),e$b.createElementBlock("label",_hoisted_1$1,e$b.toDisplayString(ee.label),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",{ref_key:"dropdownRef",ref:me,class:"relative"},[e$b.createElementVNode("button",{ref_key:"triggerRef",ref:ge,type:"button",disabled:ee.disabled,onClick:Le,class:e$b.normalizeClass(["flex w-full items-center justify-between rounded-lg bg-base-200 px-3 py-2.5 text-sm transition hover:brightness-95 disabled:cursor-not-allowed disabled:opacity-60",{"ring-2 ring-red-500/60":ee.error}])},[ee.modelValue?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$1,[e$b.createElementVNode("span",_hoisted_4$1,e$b.toDisplayString(ee.modelValue.name),1),e$b.createElementVNode("span",_hoisted_5$1,e$b.toDisplayString(e$b.unref(getSmsPoolCredits)(ee.modelValue))+" créditos ",1)])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6,e$b.toDisplayString(ee.placeholder),1)),e$b.createElementVNode("span",_hoisted_7,[ee.modelValue?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,onClick:Se,class:"flex size-4 items-center justify-center rounded-full text-current/40 transition hover:text-current/80"},[...ze[2]||(ze[2]=[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"size-3.5",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm7.707-3.707a1 1 0 0 0-1.414 1.414L10.586 12l-2.293 2.293a1 1 0 1 0 1.414 1.414L12 13.414l2.293 2.293a1 1 0 0 0 1.414-1.414L13.414 12l2.293-2.293a1 1 0 0 0-1.414-1.414L12 10.586 9.707 8.293Z","clip-rule":"evenodd"})],-1)])])):e$b.createCommentVNode("",!0),(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(["size-4 text-current/50 transition-transform",{"rotate-180":re.value}]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...ze[3]||(ze[3]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.425 10.271C19.499 8.967 18.57 7 16.88 7H7.12c-1.69 0-2.618 1.967-1.544 3.271l4.881 5.927a2 2 0 0 0 3.088 0l4.88-5.927Z","clip-rule":"evenodd"},null,-1)])],2))])],10,_hoisted_2$1),e$b.createVNode(e$b.Transition,{name:"sms-pool-fade"},{default:e$b.withCtx(()=>[re.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["absolute left-0 z-30 w-full overflow-hidden rounded-lg bg-base-300 shadow-lg shadow-black/20",oe.value?"bottom-full mb-1":"top-full mt-1"])},[pe.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8,[e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":ze[0]||(ze[0]=Re=>ie.value=Re),type:"text",placeholder:"Buscar carteira…",class:"w-full border-none focus:border-none rounded-md bg-base-200 px-3 py-1.5 text-sm outline-none placeholder:text-current/30",onClick:ze[1]||(ze[1]=e$b.withModifiers(()=>{},["stop"]))},null,512),[[e$b.vModelText,ie.value]])])),e$b.createElementVNode("div",_hoisted_9,[be.value&&_e.value.length===0?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(3,Re=>e$b.createElementVNode("div",{key:Re,class:"h-8 w-full animate-pulse rounded-md bg-base-100/60"})),64))])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(_e.value,Re=>{var Oe,Pe;return e$b.openBlock(),e$b.createElementBlock("div",{key:Re.id,onClick:Be=>Ee(Re),class:e$b.normalizeClass(["flex items-center justify-between px-3 py-2.5 text-sm transition",[e$b.unref(getSmsPoolCredits)(Re)<=0?"cursor-not-allowed opacity-40":"cursor-pointer hover:bg-base-200/60",((Oe=ee.modelValue)==null?void 0:Oe.id)===Re.id?"bg-primary/10 font-semibold":""]])},[e$b.createElementVNode("span",_hoisted_12,[((Pe=ee.modelValue)==null?void 0:Pe.id)===Re.id?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_13,[...ze[4]||(ze[4]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm13.707-1.293a1 1 0 0 0-1.414-1.414L11 12.586l-1.793-1.793a1 1 0 0 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l4-4Z","clip-rule":"evenodd"},null,-1)])])):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_14,e$b.toDisplayString(Re.name),1)]),e$b.createElementVNode("span",{class:e$b.normalizeClass(["ml-2 shrink-0 rounded-full px-2 py-0.5 text-xs font-bold",e$b.unref(getSmsPoolCredits)(Re)>0?"bg-primary/20 text-primary":"bg-base-100 text-current/40"])},e$b.toDisplayString(e$b.unref(getSmsPoolCredits)(Re))+" créditos ",3)],10,_hoisted_11)}),128)),!be.value&&_e.value.length===0?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_15," Nenhuma carteira encontrada ")):e$b.createCommentVNode("",!0),!pe.value&&ve.value?(e$b.openBlock(),e$b.createBlock(e$b.unref(Y$1),{key:de.value,onInfinite:ke},{spinner:e$b.withCtx(()=>[...ze[5]||(ze[5]=[e$b.createElementVNode("div",{class:"flex justify-center py-3"},[e$b.createElementVNode("div",{class:"size-5 animate-spin rounded-full border-4 border-t-transparent border-primary"})],-1)])]),complete:e$b.withCtx(()=>[...ze[6]||(ze[6]=[e$b.createElementVNode("span",null,null,-1)])]),_:1})):e$b.createCommentVNode("",!0)],64))])],2)):e$b.createCommentVNode("",!0)]),_:1})],512),ee.error?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_16,e$b.toDisplayString(ee.error),1)):e$b.createCommentVNode("",!0)]))}},SmsPoolSelect=_export_sfc$1(_sfc_main$2,[["__scopeId","data-v-6616f293"]]),_hoisted_1={class:"call-history-container"},_hoisted_2={key:0,class:"call-history-loading"},_hoisted_3={key:1,class:"call-history-error"},_hoisted_4={key:2,class:"call-history-empty"},_hoisted_5={key:3,class:"call-history-list"},_sfc_main$1={__name:"CallHistory",props:{chatId:{type:[String,Number],required:!0},callsApiUrl:{type:String,required:!1,default:callsUrl},onMessageClick:{type:Function,required:!1,default:null}},setup(ee){const te=ee,ne=e$b.ref(!1),ae=e$b.ref(null),re=e$b.ref([]);e$b.onMounted(()=>{oe()}),e$b.watch(()=>te.chatId,()=>{oe()});async function oe(){var le,ce;if(te.chatId){ne.value=!0,ae.value=null;try{const de=await api.get(`${te.callsApiUrl}?chat_id=${te.chatId}`);re.value=de.data.results||de.data||[]}catch(de){console.error("Erro ao buscar ligações:",de),ae.value=((ce=(le=de.response)==null?void 0:le.data)==null?void 0:ce.message)||"Erro ao carregar o histórico de ligações"}finally{ne.value=!1}}}function ie(le){te.onMessageClick&&te.onMessageClick(le)}return(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1,[ne.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2,[...ce[0]||(ce[0]=[e$b.createElementVNode("svg",{class:"call-history-loading-spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})],-1),e$b.createElementVNode("span",{class:"call-history-loading-text"},"Carregando ligações...",-1)])])):ae.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_3,e$b.toDisplayString(ae.value),1)):re.value.length===0?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_4," Nenhuma ligação registrada nesta conversa ")):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(re.value,de=>(e$b.openBlock(),e$b.createBlock(CallCard,{key:de.id,call:de,"on-message-click":ie},null,8,["call"]))),128))]))]))}},CallHistory=_export_sfc$1(_sfc_main$1,[["__scopeId","data-v-23aeed88"]]);function install(ee){ee.component("PrimarySelect",primarySelect),ee.component("DepartSelect",departSelect),ee.component("AttendantSelect",attendantSelect),ee.component("SimpleModal",simpleModal),ee.component("SimpleCard",_sfc_main$2G),ee.component("InstanceSelect",instanceSelect),ee.component("CalendarEvents",calendar),ee.component("MFA",_sfc_main$2d),ee.component("MfaQrCode",_sfc_main$2c),ee.component("ChatWindow",chatWindow),ee.component("FilterSelectLib",FilterSelectLib),ee.component("RandomAvatar",RandomAvatar),ee.component("MinModal",MinModal),ee.component("Modal",Modal),ee.component("LibPatchNotes",libPatchNotes),ee.component("BtnNewUpdates",btnNewUpdates),ee.component("LibPhotoPicker",_sfc_main$1E),ee.component("SelectMultipleDepartments",SelectMultipleDepartments),ee.component("SelectMultipleInstances",SelectMultipleInstances),ee.component("PrimaryInput",PrimaryInput),ee.component("CurrencyDisplay",CurrencyDisplay),ee.component("SimpleSelect",SimpleSelect),ee.component("FloatingDev",FloatingDev),ee.component("RatingInput",RatingInput),ee.component("TagView",_sfc_main$15),ee.component("TagChip",TagChip),ee.component("TagList",TagList),ee.component("ClientsForm",ClientsForm),ee.component("SelectMultipleTags",SelectMultipleTags),ee.component("SimpleLoader",_sfc_main$1s),ee.component("Loader",Loader),ee.component("OutcomeButton",OutcomeButton),ee.component("CallHistory",CallHistory),ee.component("CallMessage",CallMessage),ee.component("SystemMessage",_sfc_main$t),ee.component("ListProducts",ListProducts),ee.component("ContactCard",ContactCard),ee.component("ContactMessageCard",ContactMessageCard),ee.component("ProposalMessageCard",ProposalMessageCard),ee.component("WalletCard",WalletCard),ee.component("ReminderModal",ReminderModal),ee.component("SoundSelect",SoundSelect),ee.component("TimezoneSelect",TimezoneSelect),ee.component("SmsPoolSelect",SmsPoolSelect),ee.component("BaseTable",baseTable),ee.component("TemplateTable",templateTable),ee.component("CategoryBadge",_sfc_main$2L),ee.component("AchievementCard",AchievementCard),ee.component("NetworkIcon",_sfc_main$2x)}function attLibDeparts(ee,te="add"){const ne=useDepartmentStore();te==="add"?ne.addDepartments(ee):te==="delete"?ne.removeDepartments(ee):te==="update"?(ne.departments=ee,ne.loaded=!0):console.error(`Ação "${te}" não suportada em attLibDeparts.`)}function attLibAttendants(ee,te="add"){const ne=useAttendantStore();te==="add"?ne.addAttendants(ee):te==="delete"?ne.removeAttendants(ee):te==="update"?(ne.attendants=ee,ne.loaded=!0):console.error(`Ação "${te}" não suportada em attLibAttendants.`)}function attLibInstances(ee,te="add"){const ne=useInstanceStore();te==="add"?ne.addInstance(ee):te==="delete"?ne.removeInstance(ee):te==="update"?(ne.instances=ee,ne.loaded=!0):console.error(`Ação "${te}" não suportada em attLibInstances.`)}async function setupLibrary(ee,te,ne,ae=[],re=[],oe=[],ie=null){try{setPiniaInstance(ee);const le=await useAuthStore(ee);te&&await le.setToken(te),ne&&setApiBaseURL(ne),ie&&setRefreshTokenUrl(ie);const ce=useDepartmentStore(ee);re.length>0&&(ce.departments=re,ce.count=re.length);const de=useAttendantStore(ee);ae.length>0&&(de.attendants=ae,de.count=ae.length),await useInstanceStore(ee).fetchInstances()}catch(le){console.error("Erro no setupLibrary:",le)}}function getWithContrastColor(ee){return getContrastColor(ee)}function attReminderByLib(ee){return moveReminderToCompleted(ee)}const index={install,setupLibrary,attLibDeparts,attLibAttendants,attLibInstances,primarySelect,simpleModal,simpleCard:_sfc_main$2G,instanceSelect,SimpleSelect,FloatingDev,calendar,SimpleLoader:_sfc_main$1s,Loader,MFA:_sfc_main$2d,chatWindow,departSelect,attendantSelect,FilterSelectLib,RandomAvatar,MinModal,Modal,libPatchNotes,btnNewUpdates,LibPhotoPicker:_sfc_main$1E,SelectMultipleDepartments,SelectMultipleInstances,SelectMultipleTags,PrimaryInput,CurrencyDisplay,getWithContrastColor,RatingInput,TagView:_sfc_main$15,TagChip,TagList,ClientsForm,OutcomeButton,CallHistory,CallMessage,SystemMessage:_sfc_main$t,ListProducts,ContactCard,ContactMessageCard,ProposalMessageCard,NetworkIcon:_sfc_main$2x,ReminderModal,attReminderByLib,SoundSelect,TimezoneSelect,formatCurrency,getCurrencySymbol,getCurrencyLocale};function s(ee){ee.CapacitorUtils.Synapse=new Proxy({},{get(te,ne){return new Proxy({},{get(ae,re){return(oe,ie,le)=>{const ce=ee.Capacitor.Plugins[ne];if(ce===void 0){le(new Error(`Capacitor plugin ${ne} not found`));return}if(typeof ce[re]!="function"){le(new Error(`Method ${re} not found in Capacitor plugin ${ne}`));return}(async()=>{try{const de=await ce[re](oe);ie(de)}catch(de){le(de)}})()}}})}})}function u(ee){ee.CapacitorUtils.Synapse=new Proxy({},{get(te,ne){return ee.cordova.plugins[ne]}})}function f(ee=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!ee?s(window):window.cordova!==void 0&&u(window))}var Directory;(function(ee){ee.Documents="DOCUMENTS",ee.Data="DATA",ee.Library="LIBRARY",ee.Cache="CACHE",ee.External="EXTERNAL",ee.ExternalStorage="EXTERNAL_STORAGE",ee.ExternalCache="EXTERNAL_CACHE",ee.LibraryNoCloud="LIBRARY_NO_CLOUD",ee.Temporary="TEMPORARY"})(Directory||(Directory={}));var Encoding;(function(ee){ee.UTF8="utf8",ee.ASCII="ascii",ee.UTF16="utf16"})(Encoding||(Encoding={}));const Filesystem=registerPlugin("Filesystem",{web:()=>Promise.resolve().then(()=>web).then(ee=>new ee.FilesystemWeb)});f();const BlobWriter=registerPlugin("BlobWriter");function array_buffer_to_base64(ee){return window.btoa(Array.from(new Uint8Array(ee)).map(function(te){return String.fromCharCode(te)}).join(""))}function write_file_via_indexeddb({path:ee,directory:te,blob:ne,recursive:ae}){return Filesystem.writeFile({directory:te,path:ee,recursive:ae,data:""}).then(function(){return new Promise(function(re,oe){function ie(ce){oe(ce.target.error)}const le=window.indexedDB.open("Disc");le.onerror=ie,le.onsuccess=function(){const de=le.result.transaction("FileStorage","readwrite");de.onerror=ie;const ue=de.objectStore("FileStorage"),ve=`/${te}/${ee.replace(/^\//,"")}`,me=ue.get(ve);me.onsuccess=function(){me.result.size=ne.size,me.result.content=ne;const ge=ue.put(me.result);ge.onsuccess=function(){re(void 0)}}}})})}function write_file_via_bridge({path:ee,directory:te,blob:ne,recursive:ae}){return Filesystem.writeFile({directory:te,path:ee,recursive:ae,data:""}).then(function re(){if(ne.size===0)return Promise.resolve();const oe=3*128*1024,ie=ne.slice(0,oe);return ne=ne.slice(oe),new Response(ie).arrayBuffer().then(function(ce){return Filesystem.appendFile({directory:te,path:ee,data:array_buffer_to_base64(ce)})}).then(re)})}function write_blob(ee){const{path:te,directory:ne,blob:ae,fast_mode:re=!1,recursive:oe,on_fallback:ie}=ee;return!ae||!Number.isSafeInteger(ae.size)||typeof ae.type!="string"?Promise.reject(new Error("Not a Blob.")):Capacitor.getPlatform()==="web"?re?write_file_via_indexeddb(ee):write_file_via_bridge(ee):Promise.all([BlobWriter.get_config(),Filesystem.getUri({path:te,directory:ne})]).then(function([le,ce]){const de=ce.uri.replace("file://","");return(window.CapacitorWebFetch||window.fetch)(le.base_url+de+(oe?"?recursive=true":""),{headers:{authorization:le.auth_token},method:"put",body:ae}).then(function(ve){if(ve.status!==204)throw new Error("Bad HTTP status: "+ve.status);return ce.uri})}).catch(function(ce){return ie!==void 0&&ie(ce),write_file_via_bridge(ee)})}const write_blob$1=Object.freeze(write_blob);var getBlobDuration$1={};function _interopRequireDefault(ee){return ee&&ee.__esModule?ee:{default:ee}}var interopRequireDefault=_interopRequireDefault,runtime={exports:{}},hasRequiredRuntime;function requireRuntime(){return hasRequiredRuntime||(hasRequiredRuntime=1,function(ee){var te=function(ne){var ae=Object.prototype,re=ae.hasOwnProperty,oe=Object.defineProperty||function(Ce,Fe,Ie){Ce[Fe]=Ie.value},ie,le=typeof Symbol=="function"?Symbol:{},ce=le.iterator||"@@iterator",de=le.asyncIterator||"@@asyncIterator",ue=le.toStringTag||"@@toStringTag";function ve(Ce,Fe,Ie){return Object.defineProperty(Ce,Fe,{value:Ie,enumerable:!0,configurable:!0,writable:!0}),Ce[Fe]}try{ve({},"")}catch{ve=function(Fe,Ie,Ue){return Fe[Ie]=Ue}}function me(Ce,Fe,Ie,Ue){var qe=Fe&&Fe.prototype instanceof $e?Fe:$e,je=Object.create(qe.prototype),We=new Ne(Ue||[]);return oe(je,"_invoke",{value:Oe(Ce,Ie,We)}),je}ne.wrap=me;function ge(Ce,Fe,Ie){try{return{type:"normal",arg:Ce.call(Fe,Ie)}}catch(Ue){return{type:"throw",arg:Ue}}}var fe="suspendedStart",pe="suspendedYield",_e="executing",be="completed",ke={};function $e(){}function ye(){}function Ee(){}var Se={};ve(Se,ce,function(){return this});var Le=Object.getPrototypeOf,Ve=Le&&Le(Le(Me([])));Ve&&Ve!==ae&&re.call(Ve,ce)&&(Se=Ve);var Te=Ee.prototype=$e.prototype=Object.create(Se);ye.prototype=Ee,oe(Te,"constructor",{value:Ee,configurable:!0}),oe(Ee,"constructor",{value:ye,configurable:!0}),ye.displayName=ve(Ee,ue,"GeneratorFunction");function ze(Ce){["next","throw","return"].forEach(function(Fe){ve(Ce,Fe,function(Ie){return this._invoke(Fe,Ie)})})}ne.isGeneratorFunction=function(Ce){var Fe=typeof Ce=="function"&&Ce.constructor;return Fe?Fe===ye||(Fe.displayName||Fe.name)==="GeneratorFunction":!1},ne.mark=function(Ce){return Object.setPrototypeOf?Object.setPrototypeOf(Ce,Ee):(Ce.__proto__=Ee,ve(Ce,ue,"GeneratorFunction")),Ce.prototype=Object.create(Te),Ce},ne.awrap=function(Ce){return{__await:Ce}};function Re(Ce,Fe){function Ie(je,We,Ge,Ke){var et=ge(Ce[je],Ce,We);if(et.type==="throw")Ke(et.arg);else{var yt=et.arg,Et=yt.value;return Et&&typeof Et=="object"&&re.call(Et,"__await")?Fe.resolve(Et.__await).then(function(At){Ie("next",At,Ge,Ke)},function(At){Ie("throw",At,Ge,Ke)}):Fe.resolve(Et).then(function(At){yt.value=At,Ge(yt)},function(At){return Ie("throw",At,Ge,Ke)})}}var Ue;function qe(je,We){function Ge(){return new Fe(function(Ke,et){Ie(je,We,Ke,et)})}return Ue=Ue?Ue.then(Ge,Ge):Ge()}oe(this,"_invoke",{value:qe})}ze(Re.prototype),ve(Re.prototype,de,function(){return this}),ne.AsyncIterator=Re,ne.async=function(Ce,Fe,Ie,Ue,qe){qe===void 0&&(qe=Promise);var je=new Re(me(Ce,Fe,Ie,Ue),qe);return ne.isGeneratorFunction(Fe)?je:je.next().then(function(We){return We.done?We.value:je.next()})};function Oe(Ce,Fe,Ie){var Ue=fe;return function(je,We){if(Ue===_e)throw new Error("Generator is already running");if(Ue===be){if(je==="throw")throw We;return we()}for(Ie.method=je,Ie.arg=We;;){var Ge=Ie.delegate;if(Ge){var Ke=Pe(Ge,Ie);if(Ke){if(Ke===ke)continue;return Ke}}if(Ie.method==="next")Ie.sent=Ie._sent=Ie.arg;else if(Ie.method==="throw"){if(Ue===fe)throw Ue=be,Ie.arg;Ie.dispatchException(Ie.arg)}else Ie.method==="return"&&Ie.abrupt("return",Ie.arg);Ue=_e;var et=ge(Ce,Fe,Ie);if(et.type==="normal"){if(Ue=Ie.done?be:pe,et.arg===ke)continue;return{value:et.arg,done:Ie.done}}else et.type==="throw"&&(Ue=be,Ie.method="throw",Ie.arg=et.arg)}}}function Pe(Ce,Fe){var Ie=Fe.method,Ue=Ce.iterator[Ie];if(Ue===ie)return Fe.delegate=null,Ie==="throw"&&Ce.iterator.return&&(Fe.method="return",Fe.arg=ie,Pe(Ce,Fe),Fe.method==="throw")||Ie!=="return"&&(Fe.method="throw",Fe.arg=new TypeError("The iterator does not provide a '"+Ie+"' method")),ke;var qe=ge(Ue,Ce.iterator,Fe.arg);if(qe.type==="throw")return Fe.method="throw",Fe.arg=qe.arg,Fe.delegate=null,ke;var je=qe.arg;if(!je)return Fe.method="throw",Fe.arg=new TypeError("iterator result is not an object"),Fe.delegate=null,ke;if(je.done)Fe[Ce.resultName]=je.value,Fe.next=Ce.nextLoc,Fe.method!=="return"&&(Fe.method="next",Fe.arg=ie);else return je;return Fe.delegate=null,ke}ze(Te),ve(Te,ue,"Generator"),ve(Te,ce,function(){return this}),ve(Te,"toString",function(){return"[object Generator]"});function Be(Ce){var Fe={tryLoc:Ce[0]};1 in Ce&&(Fe.catchLoc=Ce[1]),2 in Ce&&(Fe.finallyLoc=Ce[2],Fe.afterLoc=Ce[3]),this.tryEntries.push(Fe)}function De(Ce){var Fe=Ce.completion||{};Fe.type="normal",delete Fe.arg,Ce.completion=Fe}function Ne(Ce){this.tryEntries=[{tryLoc:"root"}],Ce.forEach(Be,this),this.reset(!0)}ne.keys=function(Ce){var Fe=Object(Ce),Ie=[];for(var Ue in Fe)Ie.push(Ue);return Ie.reverse(),function qe(){for(;Ie.length;){var je=Ie.pop();if(je in Fe)return qe.value=je,qe.done=!1,qe}return qe.done=!0,qe}};function Me(Ce){if(Ce){var Fe=Ce[ce];if(Fe)return Fe.call(Ce);if(typeof Ce.next=="function")return Ce;if(!isNaN(Ce.length)){var Ie=-1,Ue=function qe(){for(;++Ie<Ce.length;)if(re.call(Ce,Ie))return qe.value=Ce[Ie],qe.done=!1,qe;return qe.value=ie,qe.done=!0,qe};return Ue.next=Ue}}return{next:we}}ne.values=Me;function we(){return{value:ie,done:!0}}return Ne.prototype={constructor:Ne,reset:function(Ce){if(this.prev=0,this.next=0,this.sent=this._sent=ie,this.done=!1,this.delegate=null,this.method="next",this.arg=ie,this.tryEntries.forEach(De),!Ce)for(var Fe in this)Fe.charAt(0)==="t"&&re.call(this,Fe)&&!isNaN(+Fe.slice(1))&&(this[Fe]=ie)},stop:function(){this.done=!0;var Ce=this.tryEntries[0],Fe=Ce.completion;if(Fe.type==="throw")throw Fe.arg;return this.rval},dispatchException:function(Ce){if(this.done)throw Ce;var Fe=this;function Ie(Ke,et){return je.type="throw",je.arg=Ce,Fe.next=Ke,et&&(Fe.method="next",Fe.arg=ie),!!et}for(var Ue=this.tryEntries.length-1;Ue>=0;--Ue){var qe=this.tryEntries[Ue],je=qe.completion;if(qe.tryLoc==="root")return Ie("end");if(qe.tryLoc<=this.prev){var We=re.call(qe,"catchLoc"),Ge=re.call(qe,"finallyLoc");if(We&&Ge){if(this.prev<qe.catchLoc)return Ie(qe.catchLoc,!0);if(this.prev<qe.finallyLoc)return Ie(qe.finallyLoc)}else if(We){if(this.prev<qe.catchLoc)return Ie(qe.catchLoc,!0)}else if(Ge){if(this.prev<qe.finallyLoc)return Ie(qe.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(Ce,Fe){for(var Ie=this.tryEntries.length-1;Ie>=0;--Ie){var Ue=this.tryEntries[Ie];if(Ue.tryLoc<=this.prev&&re.call(Ue,"finallyLoc")&&this.prev<Ue.finallyLoc){var qe=Ue;break}}qe&&(Ce==="break"||Ce==="continue")&&qe.tryLoc<=Fe&&Fe<=qe.finallyLoc&&(qe=null);var je=qe?qe.completion:{};return je.type=Ce,je.arg=Fe,qe?(this.method="next",this.next=qe.finallyLoc,ke):this.complete(je)},complete:function(Ce,Fe){if(Ce.type==="throw")throw Ce.arg;return Ce.type==="break"||Ce.type==="continue"?this.next=Ce.arg:Ce.type==="return"?(this.rval=this.arg=Ce.arg,this.method="return",this.next="end"):Ce.type==="normal"&&Fe&&(this.next=Fe),ke},finish:function(Ce){for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Ie=this.tryEntries[Fe];if(Ie.finallyLoc===Ce)return this.complete(Ie.completion,Ie.afterLoc),De(Ie),ke}},catch:function(Ce){for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Ie=this.tryEntries[Fe];if(Ie.tryLoc===Ce){var Ue=Ie.completion;if(Ue.type==="throw"){var qe=Ue.arg;De(Ie)}return qe}}throw new Error("illegal catch attempt")},delegateYield:function(Ce,Fe,Ie){return this.delegate={iterator:Me(Ce),resultName:Fe,nextLoc:Ie},this.method==="next"&&(this.arg=ie),ke}},ne}(ee.exports);try{regeneratorRuntime=te}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=te:Function("r","regeneratorRuntime = r")(te)}}(runtime)),runtime.exports}var regenerator,hasRequiredRegenerator;function requireRegenerator(){return hasRequiredRegenerator||(hasRequiredRegenerator=1,regenerator=requireRuntime()),regenerator}var asyncToGenerator,hasRequiredAsyncToGenerator;function requireAsyncToGenerator(){if(hasRequiredAsyncToGenerator)return asyncToGenerator;hasRequiredAsyncToGenerator=1;function ee(ne,ae,re,oe,ie,le,ce){try{var de=ne[le](ce),ue=de.value}catch(ve){re(ve);return}de.done?ae(ue):Promise.resolve(ue).then(oe,ie)}function te(ne){return function(){var ae=this,re=arguments;return new Promise(function(oe,ie){var le=ne.apply(ae,re);function ce(ue){ee(le,oe,ie,ce,de,"next",ue)}function de(ue){ee(le,oe,ie,ce,de,"throw",ue)}ce(void 0)})}}return asyncToGenerator=te,asyncToGenerator}(function(ee){var te=interopRequireDefault;Object.defineProperty(ee,"__esModule",{value:!0}),ee.default=re;var ne=te(requireRegenerator()),ae=te(requireAsyncToGenerator());function re(ie){return oe.apply(this,arguments)}function oe(){return(oe=(0,ae.default)(ne.default.mark(function ie(le){var ce,de;return ne.default.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ce=document.createElement("video"),de=new Promise(function(ve,me){ce.addEventListener("loadedmetadata",function(){ce.duration===1/0?(ce.currentTime=Number.MAX_SAFE_INTEGER,ce.ontimeupdate=function(){ce.ontimeupdate=null,ve(ce.duration),ce.currentTime=0}):ve(ce.duration)}),ce.onerror=function(ge){return me(ge.target.error)}}),ce.src=typeof le=="string"||le instanceof String?le:window.URL.createObjectURL(le),ue.abrupt("return",de);case 4:case"end":return ue.stop()}},ie)}))).apply(this,arguments)}})(getBlobDuration$1);const getBlobDuration=getDefaultExportFromCjs(getBlobDuration$1),successResponse=()=>({value:!0}),failureResponse=()=>({value:!1}),missingPermissionError=()=>new Error("MISSING_PERMISSION"),alreadyRecordingError=()=>new Error("ALREADY_RECORDING"),deviceCannotVoiceRecordError=()=>new Error("DEVICE_CANNOT_VOICE_RECORD"),failedToRecordError=()=>new Error("FAILED_TO_RECORD"),emptyRecordingError=()=>new Error("EMPTY_RECORDING"),recordingHasNotStartedError=()=>new Error("RECORDING_HAS_NOT_STARTED"),failedToFetchRecordingError=()=>new Error("FAILED_TO_FETCH_RECORDING"),couldNotQueryPermissionStatusError=()=>new Error("COULD_NOT_QUERY_PERMISSION_STATUS"),POSSIBLE_MIME_TYPES={"audio/aac":".aac","audio/mp4":".mp3","audio/webm;codecs=opus":".ogg","audio/webm":".ogg","audio/ogg;codecs=opus":".ogg"},neverResolvingPromise=()=>new Promise(()=>{});class VoiceRecorderImpl{constructor(){this.mediaRecorder=null,this.chunks=[],this.pendingResult=neverResolvingPromise()}static async canDeviceVoiceRecord(){var te;return((te=navigator==null?void 0:navigator.mediaDevices)===null||te===void 0?void 0:te.getUserMedia)==null||VoiceRecorderImpl.getSupportedMimeType()==null?failureResponse():successResponse()}async startRecording(te){if(this.mediaRecorder!=null)throw alreadyRecordingError();if(!(await VoiceRecorderImpl.canDeviceVoiceRecord()).value)throw deviceCannotVoiceRecordError();if(!(await VoiceRecorderImpl.hasAudioRecordingPermission().catch(()=>successResponse())).value)throw missingPermissionError();return navigator.mediaDevices.getUserMedia({audio:!0}).then(re=>this.onSuccessfullyStartedRecording(re,te)).catch(this.onFailedToStartRecording.bind(this))}async stopRecording(){if(this.mediaRecorder==null)throw recordingHasNotStartedError();try{return this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(te=>te.stop()),this.pendingResult}catch{throw failedToFetchRecordingError()}finally{this.prepareInstanceForNextOperation()}}static async hasAudioRecordingPermission(){return navigator.permissions.query==null?navigator.mediaDevices==null?Promise.reject(couldNotQueryPermissionStatusError()):navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>successResponse()).catch(()=>{throw couldNotQueryPermissionStatusError()}):navigator.permissions.query({name:"microphone"}).then(te=>({value:te.state==="granted"})).catch(()=>{throw couldNotQueryPermissionStatusError()})}static async requestAudioRecordingPermission(){return(await VoiceRecorderImpl.hasAudioRecordingPermission().catch(()=>failureResponse())).value?successResponse():navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>successResponse()).catch(()=>failureResponse())}pauseRecording(){if(this.mediaRecorder==null)throw recordingHasNotStartedError();return this.mediaRecorder.state==="recording"?(this.mediaRecorder.pause(),Promise.resolve(successResponse())):Promise.resolve(failureResponse())}resumeRecording(){if(this.mediaRecorder==null)throw recordingHasNotStartedError();return this.mediaRecorder.state==="paused"?(this.mediaRecorder.resume(),Promise.resolve(successResponse())):Promise.resolve(failureResponse())}getCurrentStatus(){return this.mediaRecorder==null?Promise.resolve({status:RecordingStatus.NONE}):this.mediaRecorder.state==="recording"?Promise.resolve({status:RecordingStatus.RECORDING}):this.mediaRecorder.state==="paused"?Promise.resolve({status:RecordingStatus.PAUSED}):Promise.resolve({status:RecordingStatus.NONE})}static getSupportedMimeType(){if((MediaRecorder==null?void 0:MediaRecorder.isTypeSupported)==null)return null;const te=Object.keys(POSSIBLE_MIME_TYPES).find(ne=>MediaRecorder.isTypeSupported(ne));return te??null}onSuccessfullyStartedRecording(te,ne){return this.pendingResult=new Promise((ae,re)=>{this.mediaRecorder=new MediaRecorder(te),this.mediaRecorder.onerror=()=>{this.prepareInstanceForNextOperation(),re(failedToRecordError())},this.mediaRecorder.onstop=async()=>{var oe,ie,le;const ce=VoiceRecorderImpl.getSupportedMimeType();if(ce==null){this.prepareInstanceForNextOperation(),re(failedToFetchRecordingError());return}const de=new Blob(this.chunks,{type:ce});if(de.size<=0){this.prepareInstanceForNextOperation(),re(emptyRecordingError());return}let ue,ve;ne!=null?(ue=`${(le=(ie=(oe=ne.subDirectory)===null||oe===void 0?void 0:oe.match(/^\/?(.+[^/])\/?$/))===null||ie===void 0?void 0:ie[1])!==null&&le!==void 0?le:""}/recording-${new Date().getTime()}${POSSIBLE_MIME_TYPES[ce]}`,await write_blob$1({blob:de,directory:ne.directory,fast_mode:!0,path:ue,recursive:!0})):ve=await VoiceRecorderImpl.blobToBase64(de);const me=await getBlobDuration(de);this.prepareInstanceForNextOperation(),ae({value:{recordDataBase64:ve,mimeType:ce,msDuration:me*1e3,path:ue}})},this.mediaRecorder.ondataavailable=oe=>this.chunks.push(oe.data),this.mediaRecorder.start()}),successResponse()}onFailedToStartRecording(){throw this.prepareInstanceForNextOperation(),failedToRecordError()}static blobToBase64(te){return new Promise(ne=>{const ae=new FileReader;ae.onloadend=()=>{const re=String(ae.result),oe=re.split("base64,"),ie=oe.length>1?oe[1]:re;ne(ie.trim())},ae.readAsDataURL(te)})}prepareInstanceForNextOperation(){if(this.mediaRecorder!=null&&this.mediaRecorder.state==="recording")try{this.mediaRecorder.stop()}catch(te){console.warn("While trying to stop a media recorder, an error was thrown",te)}this.pendingResult=neverResolvingPromise(),this.mediaRecorder=null,this.chunks=[]}}class VoiceRecorderWeb extends WebPlugin{constructor(){super(...arguments),this.voiceRecorderInstance=new VoiceRecorderImpl}canDeviceVoiceRecord(){return VoiceRecorderImpl.canDeviceVoiceRecord()}hasAudioRecordingPermission(){return VoiceRecorderImpl.hasAudioRecordingPermission()}requestAudioRecordingPermission(){return VoiceRecorderImpl.requestAudioRecordingPermission()}startRecording(te){return this.voiceRecorderInstance.startRecording(te)}stopRecording(){return this.voiceRecorderInstance.stopRecording()}pauseRecording(){return this.voiceRecorderInstance.pauseRecording()}resumeRecording(){return this.voiceRecorderInstance.resumeRecording()}getCurrentStatus(){return this.voiceRecorderInstance.getCurrentStatus()}}const web$1=Object.freeze(Object.defineProperty({__proto__:null,VoiceRecorderWeb},Symbol.toStringTag,{value:"Module"}));var lottie={exports:{}};(function(module,exports){typeof navigator<"u"&&function(ee,te){module.exports=te()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(te){_useWebWorker=!!te},getWebWorker=function(){return _useWebWorker},setLocationHref=function(te){locationHref=te},getLocationHref=function(){return locationHref};function createTag(ee){return document.createElement(ee)}function extendPrototype(ee,te){var ne,ae=ee.length,re;for(ne=0;ne<ae;ne+=1){re=ee[ne].prototype;for(var oe in re)Object.prototype.hasOwnProperty.call(re,oe)&&(te.prototype[oe]=re[oe])}}function getDescriptor(ee,te){return Object.getOwnPropertyDescriptor(ee,te)}function createProxyFunction(ee){function te(){}return te.prototype=ee,te}var audioControllerFactory=function(){function ee(te){this.audios=[],this.audioFactory=te,this._volume=1,this._isMuted=!1}return ee.prototype={addAudio:function(ne){this.audios.push(ne)},pause:function(){var ne,ae=this.audios.length;for(ne=0;ne<ae;ne+=1)this.audios[ne].pause()},resume:function(){var ne,ae=this.audios.length;for(ne=0;ne<ae;ne+=1)this.audios[ne].resume()},setRate:function(ne){var ae,re=this.audios.length;for(ae=0;ae<re;ae+=1)this.audios[ae].setRate(ne)},createAudio:function(ne){return this.audioFactory?this.audioFactory(ne):window.Howl?new window.Howl({src:[ne]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(ne){this.audioFactory=ne},setVolume:function(ne){this._volume=ne,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var ne,ae=this.audios.length;for(ne=0;ne<ae;ne+=1)this.audios[ne].volume(this._volume*(this._isMuted?0:1))}},function(){return new ee}}(),createTypedArray=function(){function ee(ne,ae){var re=0,oe=[],ie;switch(ne){case"int16":case"uint8c":ie=1;break;default:ie=1.1;break}for(re=0;re<ae;re+=1)oe.push(ie);return oe}function te(ne,ae){return ne==="float32"?new Float32Array(ae):ne==="int16"?new Int16Array(ae):ne==="uint8c"?new Uint8ClampedArray(ae):ee(ne,ae)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?te:ee}();function createSizedArray(ee){return Array.apply(null,{length:ee})}function _typeof$6(ee){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$6=function(ne){return typeof ne}:_typeof$6=function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},_typeof$6(ee)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var ee=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],te,ne=ee.length;for(te=0;te<ne;te+=1)BMMath[ee[te]]=Math[ee[te]]})(),BMMath.random=Math.random,BMMath.abs=function(ee){var te=_typeof$6(ee);if(te==="object"&&ee.length){var ne=createSizedArray(ee.length),ae,re=ee.length;for(ae=0;ae<re;ae+=1)ne[ae]=Math.abs(ee[ae]);return ne}return Math.abs(ee)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(ee){ee.style.position="absolute",ee.style.top=0,ee.style.left=0,ee.style.display="block",ee.style.transformOrigin="0 0",ee.style.webkitTransformOrigin="0 0",ee.style.backfaceVisibility="visible",ee.style.webkitBackfaceVisibility="visible",ee.style.transformStyle="preserve-3d",ee.style.webkitTransformStyle="preserve-3d",ee.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(ee,te,ne,ae){this.type=ee,this.currentTime=te,this.totalTime=ne,this.direction=ae<0?-1:1}function BMCompleteEvent(ee,te){this.type=ee,this.direction=te<0?-1:1}function BMCompleteLoopEvent(ee,te,ne,ae){this.type=ee,this.currentLoop=ne,this.totalLoops=te,this.direction=ae<0?-1:1}function BMSegmentStartEvent(ee,te,ne){this.type=ee,this.firstFrame=te,this.totalFrames=ne}function BMDestroyEvent(ee,te){this.type=ee,this.target=te}function BMRenderFrameErrorEvent(ee,te){this.type="renderFrameError",this.nativeError=ee,this.currentTime=te}function BMConfigErrorEvent(ee){this.type="configError",this.nativeError=ee}var createElementID=function(){var ee=0;return function(){return ee+=1,idPrefix$1+"__lottie_element_"+ee}}();function HSVtoRGB(ee,te,ne){var ae,re,oe,ie,le,ce,de,ue;switch(ie=Math.floor(ee*6),le=ee*6-ie,ce=ne*(1-te),de=ne*(1-le*te),ue=ne*(1-(1-le)*te),ie%6){case 0:ae=ne,re=ue,oe=ce;break;case 1:ae=de,re=ne,oe=ce;break;case 2:ae=ce,re=ne,oe=ue;break;case 3:ae=ce,re=de,oe=ne;break;case 4:ae=ue,re=ce,oe=ne;break;case 5:ae=ne,re=ce,oe=de;break}return[ae,re,oe]}function RGBtoHSV(ee,te,ne){var ae=Math.max(ee,te,ne),re=Math.min(ee,te,ne),oe=ae-re,ie,le=ae===0?0:oe/ae,ce=ae/255;switch(ae){case re:ie=0;break;case ee:ie=te-ne+oe*(te<ne?6:0),ie/=6*oe;break;case te:ie=ne-ee+oe*2,ie/=6*oe;break;case ne:ie=ee-te+oe*4,ie/=6*oe;break}return[ie,le,ce]}function addSaturationToRGB(ee,te){var ne=RGBtoHSV(ee[0]*255,ee[1]*255,ee[2]*255);return ne[1]+=te,ne[1]>1?ne[1]=1:ne[1]<=0&&(ne[1]=0),HSVtoRGB(ne[0],ne[1],ne[2])}function addBrightnessToRGB(ee,te){var ne=RGBtoHSV(ee[0]*255,ee[1]*255,ee[2]*255);return ne[2]+=te,ne[2]>1?ne[2]=1:ne[2]<0&&(ne[2]=0),HSVtoRGB(ne[0],ne[1],ne[2])}function addHueToRGB(ee,te){var ne=RGBtoHSV(ee[0]*255,ee[1]*255,ee[2]*255);return ne[0]+=te/360,ne[0]>1?ne[0]-=1:ne[0]<0&&(ne[0]+=1),HSVtoRGB(ne[0],ne[1],ne[2])}var rgbToHex=function(){var ee=[],te,ne;for(te=0;te<256;te+=1)ne=te.toString(16),ee[te]=ne.length===1?"0"+ne:ne;return function(ae,re,oe){return ae<0&&(ae=0),re<0&&(re=0),oe<0&&(oe=0),"#"+ee[ae]+ee[re]+ee[oe]}}(),setSubframeEnabled=function(te){subframeEnabled=!!te},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(te){expressionsPlugin=te},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(te){expressionsInterfaces=te},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(te){defaultCurveSegments=te},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(te){idPrefix$1=te};function createNS(ee){return document.createElementNS(svgNS,ee)}function _typeof$5(ee){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(ne){return typeof ne}:_typeof$5=function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},_typeof$5(ee)}var dataManager=function(){var ee=1,te=[],ne,ae,re={onmessage:function(){},postMessage:function(ge){ne({data:ge})}},oe={postMessage:function(ge){re.onmessage({data:ge})}};function ie(me){if(window.Worker&&window.Blob&&getWebWorker()){var ge=new Blob(["var _workerSelf = self; self.onmessage = ",me.toString()],{type:"text/javascript"}),fe=URL.createObjectURL(ge);return new Worker(fe)}return ne=me,re}function le(){ae||(ae=ie(function(ge){function fe(){function _e(De,Ne){var Me,we,Ce=De.length,Fe,Ie,Ue,qe;for(we=0;we<Ce;we+=1)if(Me=De[we],"ks"in Me&&!Me.completed){if(Me.completed=!0,Me.hasMask){var je=Me.masksProperties;for(Ie=je.length,Fe=0;Fe<Ie;Fe+=1)if(je[Fe].pt.k.i)Ee(je[Fe].pt.k);else for(qe=je[Fe].pt.k.length,Ue=0;Ue<qe;Ue+=1)je[Fe].pt.k[Ue].s&&Ee(je[Fe].pt.k[Ue].s[0]),je[Fe].pt.k[Ue].e&&Ee(je[Fe].pt.k[Ue].e[0])}Me.ty===0?(Me.layers=$e(Me.refId,Ne),_e(Me.layers,Ne)):Me.ty===4?ye(Me.shapes):Me.ty===5&&Pe(Me)}}function be(De,Ne){if(De){var Me=0,we=De.length;for(Me=0;Me<we;Me+=1)De[Me].t===1&&(De[Me].data.layers=$e(De[Me].data.refId,Ne),_e(De[Me].data.layers,Ne))}}function ke(De,Ne){for(var Me=0,we=Ne.length;Me<we;){if(Ne[Me].id===De)return Ne[Me];Me+=1}return null}function $e(De,Ne){var Me=ke(De,Ne);return Me?Me.layers.__used?JSON.parse(JSON.stringify(Me.layers)):(Me.layers.__used=!0,Me.layers):null}function ye(De){var Ne,Me=De.length,we,Ce;for(Ne=Me-1;Ne>=0;Ne-=1)if(De[Ne].ty==="sh")if(De[Ne].ks.k.i)Ee(De[Ne].ks.k);else for(Ce=De[Ne].ks.k.length,we=0;we<Ce;we+=1)De[Ne].ks.k[we].s&&Ee(De[Ne].ks.k[we].s[0]),De[Ne].ks.k[we].e&&Ee(De[Ne].ks.k[we].e[0]);else De[Ne].ty==="gr"&&ye(De[Ne].it)}function Ee(De){var Ne,Me=De.i.length;for(Ne=0;Ne<Me;Ne+=1)De.i[Ne][0]+=De.v[Ne][0],De.i[Ne][1]+=De.v[Ne][1],De.o[Ne][0]+=De.v[Ne][0],De.o[Ne][1]+=De.v[Ne][1]}function Se(De,Ne){var Me=Ne?Ne.split("."):[100,100,100];return De[0]>Me[0]?!0:Me[0]>De[0]?!1:De[1]>Me[1]?!0:Me[1]>De[1]?!1:De[2]>Me[2]?!0:Me[2]>De[2]?!1:null}var Le=function(){var De=[4,4,14];function Ne(we){var Ce=we.t.d;we.t.d={k:[{s:Ce,t:0}]}}function Me(we){var Ce,Fe=we.length;for(Ce=0;Ce<Fe;Ce+=1)we[Ce].ty===5&&Ne(we[Ce])}return function(we){if(Se(De,we.v)&&(Me(we.layers),we.assets)){var Ce,Fe=we.assets.length;for(Ce=0;Ce<Fe;Ce+=1)we.assets[Ce].layers&&Me(we.assets[Ce].layers)}}}(),Ve=function(){var De=[4,7,99];return function(Ne){if(Ne.chars&&!Se(De,Ne.v)){var Me,we=Ne.chars.length;for(Me=0;Me<we;Me+=1){var Ce=Ne.chars[Me];Ce.data&&Ce.data.shapes&&(ye(Ce.data.shapes),Ce.data.ip=0,Ce.data.op=99999,Ce.data.st=0,Ce.data.sr=1,Ce.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},Ne.chars[Me].t||(Ce.data.shapes.push({ty:"no"}),Ce.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),Te=function(){var De=[5,7,15];function Ne(we){var Ce=we.t.p;typeof Ce.a=="number"&&(Ce.a={a:0,k:Ce.a}),typeof Ce.p=="number"&&(Ce.p={a:0,k:Ce.p}),typeof Ce.r=="number"&&(Ce.r={a:0,k:Ce.r})}function Me(we){var Ce,Fe=we.length;for(Ce=0;Ce<Fe;Ce+=1)we[Ce].ty===5&&Ne(we[Ce])}return function(we){if(Se(De,we.v)&&(Me(we.layers),we.assets)){var Ce,Fe=we.assets.length;for(Ce=0;Ce<Fe;Ce+=1)we.assets[Ce].layers&&Me(we.assets[Ce].layers)}}}(),ze=function(){var De=[4,1,9];function Ne(we){var Ce,Fe=we.length,Ie,Ue;for(Ce=0;Ce<Fe;Ce+=1)if(we[Ce].ty==="gr")Ne(we[Ce].it);else if(we[Ce].ty==="fl"||we[Ce].ty==="st")if(we[Ce].c.k&&we[Ce].c.k[0].i)for(Ue=we[Ce].c.k.length,Ie=0;Ie<Ue;Ie+=1)we[Ce].c.k[Ie].s&&(we[Ce].c.k[Ie].s[0]/=255,we[Ce].c.k[Ie].s[1]/=255,we[Ce].c.k[Ie].s[2]/=255,we[Ce].c.k[Ie].s[3]/=255),we[Ce].c.k[Ie].e&&(we[Ce].c.k[Ie].e[0]/=255,we[Ce].c.k[Ie].e[1]/=255,we[Ce].c.k[Ie].e[2]/=255,we[Ce].c.k[Ie].e[3]/=255);else we[Ce].c.k[0]/=255,we[Ce].c.k[1]/=255,we[Ce].c.k[2]/=255,we[Ce].c.k[3]/=255}function Me(we){var Ce,Fe=we.length;for(Ce=0;Ce<Fe;Ce+=1)we[Ce].ty===4&&Ne(we[Ce].shapes)}return function(we){if(Se(De,we.v)&&(Me(we.layers),we.assets)){var Ce,Fe=we.assets.length;for(Ce=0;Ce<Fe;Ce+=1)we.assets[Ce].layers&&Me(we.assets[Ce].layers)}}}(),Re=function(){var De=[4,4,18];function Ne(we){var Ce,Fe=we.length,Ie,Ue;for(Ce=Fe-1;Ce>=0;Ce-=1)if(we[Ce].ty==="sh")if(we[Ce].ks.k.i)we[Ce].ks.k.c=we[Ce].closed;else for(Ue=we[Ce].ks.k.length,Ie=0;Ie<Ue;Ie+=1)we[Ce].ks.k[Ie].s&&(we[Ce].ks.k[Ie].s[0].c=we[Ce].closed),we[Ce].ks.k[Ie].e&&(we[Ce].ks.k[Ie].e[0].c=we[Ce].closed);else we[Ce].ty==="gr"&&Ne(we[Ce].it)}function Me(we){var Ce,Fe,Ie=we.length,Ue,qe,je,We;for(Fe=0;Fe<Ie;Fe+=1){if(Ce=we[Fe],Ce.hasMask){var Ge=Ce.masksProperties;for(qe=Ge.length,Ue=0;Ue<qe;Ue+=1)if(Ge[Ue].pt.k.i)Ge[Ue].pt.k.c=Ge[Ue].cl;else for(We=Ge[Ue].pt.k.length,je=0;je<We;je+=1)Ge[Ue].pt.k[je].s&&(Ge[Ue].pt.k[je].s[0].c=Ge[Ue].cl),Ge[Ue].pt.k[je].e&&(Ge[Ue].pt.k[je].e[0].c=Ge[Ue].cl)}Ce.ty===4&&Ne(Ce.shapes)}}return function(we){if(Se(De,we.v)&&(Me(we.layers),we.assets)){var Ce,Fe=we.assets.length;for(Ce=0;Ce<Fe;Ce+=1)we.assets[Ce].layers&&Me(we.assets[Ce].layers)}}}();function Oe(De){De.__complete||(ze(De),Le(De),Ve(De),Te(De),Re(De),_e(De.layers,De.assets),be(De.chars,De.assets),De.__complete=!0)}function Pe(De){De.t.a.length===0&&"m"in De.t.p}var Be={};return Be.completeData=Oe,Be.checkColors=ze,Be.checkChars=Ve,Be.checkPathProperties=Te,Be.checkShapes=Re,Be.completeLayers=_e,Be}if(oe.dataManager||(oe.dataManager=fe()),oe.assetLoader||(oe.assetLoader=function(){function _e(ke){var $e=ke.getResponseHeader("content-type");return $e&&ke.responseType==="json"&&$e.indexOf("json")!==-1||ke.response&&_typeof$5(ke.response)==="object"?ke.response:ke.response&&typeof ke.response=="string"?JSON.parse(ke.response):ke.responseText?JSON.parse(ke.responseText):null}function be(ke,$e,ye,Ee){var Se,Le=new XMLHttpRequest;try{Le.responseType="json"}catch{}Le.onreadystatechange=function(){if(Le.readyState===4)if(Le.status===200)Se=_e(Le),ye(Se);else try{Se=_e(Le),ye(Se)}catch(Ve){Ee&&Ee(Ve)}};try{Le.open(["G","E","T"].join(""),ke,!0)}catch{Le.open(["G","E","T"].join(""),$e+"/"+ke,!0)}Le.send()}return{load:be}}()),ge.data.type==="loadAnimation")oe.assetLoader.load(ge.data.path,ge.data.fullPath,function(_e){oe.dataManager.completeData(_e),oe.postMessage({id:ge.data.id,payload:_e,status:"success"})},function(){oe.postMessage({id:ge.data.id,status:"error"})});else if(ge.data.type==="complete"){var pe=ge.data.animation;oe.dataManager.completeData(pe),oe.postMessage({id:ge.data.id,payload:pe,status:"success"})}else ge.data.type==="loadData"&&oe.assetLoader.load(ge.data.path,ge.data.fullPath,function(_e){oe.postMessage({id:ge.data.id,payload:_e,status:"success"})},function(){oe.postMessage({id:ge.data.id,status:"error"})})}),ae.onmessage=function(me){var ge=me.data,fe=ge.id,pe=te[fe];te[fe]=null,ge.status==="success"?pe.onComplete(ge.payload):pe.onError&&pe.onError()})}function ce(me,ge){ee+=1;var fe="processId_"+ee;return te[fe]={onComplete:me,onError:ge},fe}function de(me,ge,fe){le();var pe=ce(ge,fe);ae.postMessage({type:"loadAnimation",path:me,fullPath:window.location.origin+window.location.pathname,id:pe})}function ue(me,ge,fe){le();var pe=ce(ge,fe);ae.postMessage({type:"loadData",path:me,fullPath:window.location.origin+window.location.pathname,id:pe})}function ve(me,ge,fe){le();var pe=ce(ge,fe);ae.postMessage({type:"complete",animation:me,id:pe})}return{loadAnimation:de,loadData:ue,completeAnimation:ve}}(),ImagePreloader=function(){var ee=function(){var be=createTag("canvas");be.width=1,be.height=1;var ke=be.getContext("2d");return ke.fillStyle="rgba(0,0,0,0)",ke.fillRect(0,0,1,1),be}();function te(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function ne(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function ae(be,ke,$e){var ye="";if(be.e)ye=be.p;else if(ke){var Ee=be.p;Ee.indexOf("images/")!==-1&&(Ee=Ee.split("/")[1]),ye=ke+Ee}else ye=$e,ye+=be.u?be.u:"",ye+=be.p;return ye}function re(be){var ke=0,$e=setInterval((function(){var ye=be.getBBox();(ye.width||ke>500)&&(this._imageLoaded(),clearInterval($e)),ke+=1}).bind(this),50)}function oe(be){var ke=ae(be,this.assetsPath,this.path),$e=createNS("image");isSafari?this.testImageLoaded($e):$e.addEventListener("load",this._imageLoaded,!1),$e.addEventListener("error",(function(){ye.img=ee,this._imageLoaded()}).bind(this),!1),$e.setAttributeNS("http://www.w3.org/1999/xlink","href",ke),this._elementHelper.append?this._elementHelper.append($e):this._elementHelper.appendChild($e);var ye={img:$e,assetData:be};return ye}function ie(be){var ke=ae(be,this.assetsPath,this.path),$e=createTag("img");$e.crossOrigin="anonymous",$e.addEventListener("load",this._imageLoaded,!1),$e.addEventListener("error",(function(){ye.img=ee,this._imageLoaded()}).bind(this),!1),$e.src=ke;var ye={img:$e,assetData:be};return ye}function le(be){var ke={assetData:be},$e=ae(be,this.assetsPath,this.path);return dataManager.loadData($e,(function(ye){ke.img=ye,this._footageLoaded()}).bind(this),(function(){ke.img={},this._footageLoaded()}).bind(this)),ke}function ce(be,ke){this.imagesLoadedCb=ke;var $e,ye=be.length;for($e=0;$e<ye;$e+=1)be[$e].layers||(!be[$e].t||be[$e].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(be[$e]))):be[$e].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(be[$e]))))}function de(be){this.path=be||""}function ue(be){this.assetsPath=be||""}function ve(be){for(var ke=0,$e=this.images.length;ke<$e;){if(this.images[ke].assetData===be)return this.images[ke].img;ke+=1}return null}function me(){this.imagesLoadedCb=null,this.images.length=0}function ge(){return this.totalImages===this.loadedAssets}function fe(){return this.totalFootages===this.loadedFootagesCount}function pe(be,ke){be==="svg"?(this._elementHelper=ke,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function _e(){this._imageLoaded=te.bind(this),this._footageLoaded=ne.bind(this),this.testImageLoaded=re.bind(this),this.createFootageData=le.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return _e.prototype={loadAssets:ce,setAssetsPath:ue,setPath:de,loadedImages:ge,loadedFootages:fe,destroy:me,getAsset:ve,createImgData:ie,createImageData:oe,imageLoaded:te,footageLoaded:ne,setCacheType:pe},_e}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(te,ne){if(this._cbs[te])for(var ae=this._cbs[te],re=0;re<ae.length;re+=1)ae[re](ne)},addEventListener:function(te,ne){return this._cbs[te]||(this._cbs[te]=[]),this._cbs[te].push(ne),(function(){this.removeEventListener(te,ne)}).bind(this)},removeEventListener:function(te,ne){if(!ne)this._cbs[te]=null;else if(this._cbs[te]){for(var ae=0,re=this._cbs[te].length;ae<re;)this._cbs[te][ae]===ne&&(this._cbs[te].splice(ae,1),ae-=1,re-=1),ae+=1;this._cbs[te].length||(this._cbs[te]=null)}}};var markerParser=function(){function ee(te){for(var ne=te.split(`\r
|
|
284
284
|
`),ae={},re,oe=0,ie=0;ie<ne.length;ie+=1)re=ne[ie].split(":"),re.length===2&&(ae[re[0]]=re[1].trim(),oe+=1);if(oe===0)throw new Error;return ae}return function(te){for(var ne=[],ae=0;ae<te.length;ae+=1){var re=te[ae],oe={time:re.tm,duration:re.dr};try{oe.payload=JSON.parse(te[ae].cm)}catch{try{oe.payload=ee(te[ae].cm)}catch{oe.payload={name:te[ae].cm}}}ne.push(oe)}return ne}}(),ProjectInterface=function(){function ee(te){this.compositions.push(te)}return function(){function te(ne){for(var ae=0,re=this.compositions.length;ae<re;){if(this.compositions[ae].data&&this.compositions[ae].data.nm===ne)return this.compositions[ae].prepareFrame&&this.compositions[ae].data.xt&&this.compositions[ae].prepareFrame(this.currentFrame),this.compositions[ae].compInterface;ae+=1}return null}return te.compositions=[],te.currentFrame=0,te.registerComposition=ee,te}}(),renderers={},registerRenderer=function(te,ne){renderers[te]=ne};function getRenderer(ee){return renderers[ee]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var ee in renderers)if(renderers[ee])return ee;return""}function _typeof$4(ee){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$4=function(ne){return typeof ne}:_typeof$4=function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},_typeof$4(ee)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(ee){(ee.wrapper||ee.container)&&(this.wrapper=ee.wrapper||ee.container);var te="svg";ee.animType?te=ee.animType:ee.renderer&&(te=ee.renderer);var ne=getRenderer(te);this.renderer=new ne(this,ee.rendererSettings),this.imagePreloader.setCacheType(te,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=te,ee.loop===""||ee.loop===null||ee.loop===void 0||ee.loop===!0?this.loop=!0:ee.loop===!1?this.loop=!1:this.loop=parseInt(ee.loop,10),this.autoplay="autoplay"in ee?ee.autoplay:!0,this.name=ee.name?ee.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(ee,"autoloadSegments")?ee.autoloadSegments:!0,this.assetsPath=ee.assetsPath,this.initialSegment=ee.initialSegment,ee.audioFactory&&this.audioController.setAudioFactory(ee.audioFactory),ee.animationData?this.setupAnimation(ee.animationData):ee.path&&(ee.path.lastIndexOf("\\")!==-1?this.path=ee.path.substr(0,ee.path.lastIndexOf("\\")+1):this.path=ee.path.substr(0,ee.path.lastIndexOf("/")+1),this.fileName=ee.path.substr(ee.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(ee.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(ee){dataManager.completeAnimation(ee,this.configAnimation)},AnimationItem.prototype.setData=function(ee,te){te&&_typeof$4(te)!=="object"&&(te=JSON.parse(te));var ne={wrapper:ee,animationData:te},ae=ee.attributes;ne.path=ae.getNamedItem("data-animation-path")?ae.getNamedItem("data-animation-path").value:ae.getNamedItem("data-bm-path")?ae.getNamedItem("data-bm-path").value:ae.getNamedItem("bm-path")?ae.getNamedItem("bm-path").value:"",ne.animType=ae.getNamedItem("data-anim-type")?ae.getNamedItem("data-anim-type").value:ae.getNamedItem("data-bm-type")?ae.getNamedItem("data-bm-type").value:ae.getNamedItem("bm-type")?ae.getNamedItem("bm-type").value:ae.getNamedItem("data-bm-renderer")?ae.getNamedItem("data-bm-renderer").value:ae.getNamedItem("bm-renderer")?ae.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var re=ae.getNamedItem("data-anim-loop")?ae.getNamedItem("data-anim-loop").value:ae.getNamedItem("data-bm-loop")?ae.getNamedItem("data-bm-loop").value:ae.getNamedItem("bm-loop")?ae.getNamedItem("bm-loop").value:"";re==="false"?ne.loop=!1:re==="true"?ne.loop=!0:re!==""&&(ne.loop=parseInt(re,10));var oe=ae.getNamedItem("data-anim-autoplay")?ae.getNamedItem("data-anim-autoplay").value:ae.getNamedItem("data-bm-autoplay")?ae.getNamedItem("data-bm-autoplay").value:ae.getNamedItem("bm-autoplay")?ae.getNamedItem("bm-autoplay").value:!0;ne.autoplay=oe!=="false",ne.name=ae.getNamedItem("data-name")?ae.getNamedItem("data-name").value:ae.getNamedItem("data-bm-name")?ae.getNamedItem("data-bm-name").value:ae.getNamedItem("bm-name")?ae.getNamedItem("bm-name").value:"";var ie=ae.getNamedItem("data-anim-prerender")?ae.getNamedItem("data-anim-prerender").value:ae.getNamedItem("data-bm-prerender")?ae.getNamedItem("data-bm-prerender").value:ae.getNamedItem("bm-prerender")?ae.getNamedItem("bm-prerender").value:"";ie==="false"&&(ne.prerender=!1),ne.path?this.setParams(ne):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(ee){ee.op>this.animationData.op&&(this.animationData.op=ee.op,this.totalFrames=Math.floor(ee.op-this.animationData.ip));var te=this.animationData.layers,ne,ae=te.length,re=ee.layers,oe,ie=re.length;for(oe=0;oe<ie;oe+=1)for(ne=0;ne<ae;){if(te[ne].id===re[oe].id){te[ne]=re[oe];break}ne+=1}if((ee.chars||ee.fonts)&&(this.renderer.globalData.fontManager.addChars(ee.chars),this.renderer.globalData.fontManager.addFonts(ee.fonts,this.renderer.globalData.defs)),ee.assets)for(ae=ee.assets.length,ne=0;ne<ae;ne+=1)this.animationData.assets.push(ee.assets[ne]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(ee){this.animationData=ee;var te=getExpressionsPlugin();te&&te.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var ee=this.animationData.segments;if(!ee||ee.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var te=ee.shift();this.timeCompleted=te.time*this.frameRate;var ne=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(ne,this.includeLayers.bind(this),(function(){this.trigger("data_failed")}).bind(this))},AnimationItem.prototype.loadSegments=function(){var ee=this.animationData.segments;ee||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(ee){if(this.renderer)try{this.animationData=ee,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(ee),ee.assets||(ee.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(ee.assets),this.markers=markerParser(ee.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(te){this.triggerConfigError(te)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var ee=getExpressionsPlugin();ee&&ee.initExpressions(this),this.renderer.initItems(),setTimeout((function(){this.trigger("DOMLoaded")}).bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(ee,te){var ne=typeof ee=="number"?ee:void 0,ae=typeof te=="number"?te:void 0;this.renderer.updateContainerSize(ne,ae)},AnimationItem.prototype.setSubframe=function(ee){this.isSubframeEnabled=!!ee},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(ee){this.triggerRenderFrameError(ee)}},AnimationItem.prototype.play=function(ee){ee&&this.name!==ee||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(ee){ee&&this.name!==ee||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(ee){ee&&this.name!==ee||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(ee){ee&&this.name!==ee||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(ee){for(var te,ne=0;ne<this.markers.length;ne+=1)if(te=this.markers[ne],te.payload&&te.payload.name===ee)return te;return null},AnimationItem.prototype.goToAndStop=function(ee,te,ne){if(!(ne&&this.name!==ne)){var ae=Number(ee);if(isNaN(ae)){var re=this.getMarkerData(ee);re&&this.goToAndStop(re.time,!0)}else te?this.setCurrentRawFrameValue(ee):this.setCurrentRawFrameValue(ee*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(ee,te,ne){if(!(ne&&this.name!==ne)){var ae=Number(ee);if(isNaN(ae)){var re=this.getMarkerData(ee);re&&(re.duration?this.playSegments([re.time,re.time+re.duration],!0):this.goToAndStop(re.time,!0))}else this.goToAndStop(ae,te,ne);this.play()}},AnimationItem.prototype.advanceTime=function(ee){if(!(this.isPaused===!0||this.isLoaded===!1)){var te=this.currentRawFrame+ee*this.frameModifier,ne=!1;te>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(te>this.totalFrames?te%this.totalFrames:0)||(ne=!0,te=this.totalFrames-1):te>=this.totalFrames?(this.playCount+=1,this.checkSegments(te%this.totalFrames)||(this.setCurrentRawFrameValue(te%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(te):te<0?this.checkSegments(te%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+te%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(ne=!0,te=0)):this.setCurrentRawFrameValue(te),ne&&(this.setCurrentRawFrameValue(te),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(ee,te){this.playCount=0,ee[1]<ee[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=ee[0]-ee[1],this.timeCompleted=this.totalFrames,this.firstFrame=ee[1],this.setCurrentRawFrameValue(this.totalFrames-.001-te)):ee[1]>ee[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=ee[1]-ee[0],this.timeCompleted=this.totalFrames,this.firstFrame=ee[0],this.setCurrentRawFrameValue(.001+te)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(ee,te){var ne=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<ee?ne=ee:this.currentRawFrame+this.firstFrame>te&&(ne=te-ee)),this.firstFrame=ee,this.totalFrames=te-ee,this.timeCompleted=this.totalFrames,ne!==-1&&this.goToAndStop(ne,!0)},AnimationItem.prototype.playSegments=function(ee,te){if(te&&(this.segments.length=0),_typeof$4(ee[0])==="object"){var ne,ae=ee.length;for(ne=0;ne<ae;ne+=1)this.segments.push(ee[ne])}else this.segments.push(ee);this.segments.length&&te&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(ee){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),ee&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(ee){return this.segments.length?(this.adjustSegment(this.segments.shift(),ee),!0):!1},AnimationItem.prototype.destroy=function(ee){ee&&this.name!==ee||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(ee){this.currentRawFrame=ee,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(ee){this.playSpeed=ee,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(ee){this.playDirection=ee<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(ee){this.loop=ee},AnimationItem.prototype.setVolume=function(ee,te){te&&this.name!==te||this.audioController.setVolume(ee)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(ee){ee&&this.name!==ee||this.audioController.mute()},AnimationItem.prototype.unmute=function(ee){ee&&this.name!==ee||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(ee){var te="";if(ee.e)te=ee.p;else if(this.assetsPath){var ne=ee.p;ne.indexOf("images/")!==-1&&(ne=ne.split("/")[1]),te=this.assetsPath+ne}else te=this.path,te+=ee.u?ee.u:"",te+=ee.p;return te},AnimationItem.prototype.getAssetData=function(ee){for(var te=0,ne=this.assets.length;te<ne;){if(ee===this.assets[te].id)return this.assets[te];te+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(ee){return ee?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(ee,te,ne){try{var ae=this.renderer.getElementByPath(ee);ae.updateDocumentData(te,ne)}catch{}},AnimationItem.prototype.trigger=function(ee){if(this._cbs&&this._cbs[ee])switch(ee){case"enterFrame":this.triggerEvent(ee,new BMEnterFrameEvent(ee,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(ee,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(ee,new BMCompleteLoopEvent(ee,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(ee,new BMCompleteEvent(ee,this.frameMult));break;case"segmentStart":this.triggerEvent(ee,new BMSegmentStartEvent(ee,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(ee,new BMDestroyEvent(ee,this));break;default:this.triggerEvent(ee)}ee==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(ee,this.currentFrame,this.totalFrames,this.frameMult)),ee==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(ee,this.loop,this.playCount,this.frameMult)),ee==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(ee,this.frameMult)),ee==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(ee,this.firstFrame,this.totalFrames)),ee==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(ee,this))},AnimationItem.prototype.triggerRenderFrameError=function(ee){var te=new BMRenderFrameErrorEvent(ee,this.currentFrame);this.triggerEvent("error",te),this.onError&&this.onError.call(this,te)},AnimationItem.prototype.triggerConfigError=function(ee){var te=new BMConfigErrorEvent(ee,this.currentFrame);this.triggerEvent("error",te),this.onError&&this.onError.call(this,te)};var animationManager=function(){var ee={},te=[],ne=0,ae=0,re=0,oe=!0,ie=!1;function le(Ne){for(var Me=0,we=Ne.target;Me<ae;)te[Me].animation===we&&(te.splice(Me,1),Me-=1,ae-=1,we.isPaused||ve()),Me+=1}function ce(Ne,Me){if(!Ne)return null;for(var we=0;we<ae;){if(te[we].elem===Ne&&te[we].elem!==null)return te[we].animation;we+=1}var Ce=new AnimationItem;return me(Ce,Ne),Ce.setData(Ne,Me),Ce}function de(){var Ne,Me=te.length,we=[];for(Ne=0;Ne<Me;Ne+=1)we.push(te[Ne].animation);return we}function ue(){re+=1,ze()}function ve(){re-=1}function me(Ne,Me){Ne.addEventListener("destroy",le),Ne.addEventListener("_active",ue),Ne.addEventListener("_idle",ve),te.push({elem:Me,animation:Ne}),ae+=1}function ge(Ne){var Me=new AnimationItem;return me(Me,null),Me.setParams(Ne),Me}function fe(Ne,Me){var we;for(we=0;we<ae;we+=1)te[we].animation.setSpeed(Ne,Me)}function pe(Ne,Me){var we;for(we=0;we<ae;we+=1)te[we].animation.setDirection(Ne,Me)}function _e(Ne){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.play(Ne)}function be(Ne){var Me=Ne-ne,we;for(we=0;we<ae;we+=1)te[we].animation.advanceTime(Me);ne=Ne,re&&!ie?window.requestAnimationFrame(be):oe=!0}function ke(Ne){ne=Ne,window.requestAnimationFrame(be)}function $e(Ne){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.pause(Ne)}function ye(Ne,Me,we){var Ce;for(Ce=0;Ce<ae;Ce+=1)te[Ce].animation.goToAndStop(Ne,Me,we)}function Ee(Ne){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.stop(Ne)}function Se(Ne){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.togglePause(Ne)}function Le(Ne){var Me;for(Me=ae-1;Me>=0;Me-=1)te[Me].animation.destroy(Ne)}function Ve(Ne,Me,we){var Ce=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),Fe,Ie=Ce.length;for(Fe=0;Fe<Ie;Fe+=1)we&&Ce[Fe].setAttribute("data-bm-type",we),ce(Ce[Fe],Ne);if(Me&&Ie===0){we||(we="svg");var Ue=document.getElementsByTagName("body")[0];Ue.innerText="";var qe=createTag("div");qe.style.width="100%",qe.style.height="100%",qe.setAttribute("data-bm-type",we),Ue.appendChild(qe),ce(qe,Ne)}}function Te(){var Ne;for(Ne=0;Ne<ae;Ne+=1)te[Ne].animation.resize()}function ze(){!ie&&re&&oe&&(window.requestAnimationFrame(ke),oe=!1)}function Re(){ie=!0}function Oe(){ie=!1,ze()}function Pe(Ne,Me){var we;for(we=0;we<ae;we+=1)te[we].animation.setVolume(Ne,Me)}function Be(Ne){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.mute(Ne)}function De(Ne){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.unmute(Ne)}return ee.registerAnimation=ce,ee.loadAnimation=ge,ee.setSpeed=fe,ee.setDirection=pe,ee.play=_e,ee.pause=$e,ee.stop=Ee,ee.togglePause=Se,ee.searchAnimations=Ve,ee.resize=Te,ee.goToAndStop=ye,ee.destroy=Le,ee.freeze=Re,ee.unfreeze=Oe,ee.setVolume=Pe,ee.mute=Be,ee.unmute=De,ee.getRegisteredAnimations=de,ee}(),BezierFactory=function(){var ee={};ee.getBezierEasing=ne;var te={};function ne(ke,$e,ye,Ee,Se){var Le=Se||("bez_"+ke+"_"+$e+"_"+ye+"_"+Ee).replace(/\./g,"p");if(te[Le])return te[Le];var Ve=new be([ke,$e,ye,Ee]);return te[Le]=Ve,Ve}var ae=4,re=.001,oe=1e-7,ie=10,le=11,ce=1/(le-1),de=typeof Float32Array=="function";function ue(ke,$e){return 1-3*$e+3*ke}function ve(ke,$e){return 3*$e-6*ke}function me(ke){return 3*ke}function ge(ke,$e,ye){return((ue($e,ye)*ke+ve($e,ye))*ke+me($e))*ke}function fe(ke,$e,ye){return 3*ue($e,ye)*ke*ke+2*ve($e,ye)*ke+me($e)}function pe(ke,$e,ye,Ee,Se){var Le,Ve,Te=0;do Ve=$e+(ye-$e)/2,Le=ge(Ve,Ee,Se)-ke,Le>0?ye=Ve:$e=Ve;while(Math.abs(Le)>oe&&++Te<ie);return Ve}function _e(ke,$e,ye,Ee){for(var Se=0;Se<ae;++Se){var Le=fe($e,ye,Ee);if(Le===0)return $e;var Ve=ge($e,ye,Ee)-ke;$e-=Ve/Le}return $e}function be(ke){this._p=ke,this._mSampleValues=de?new Float32Array(le):new Array(le),this._precomputed=!1,this.get=this.get.bind(this)}return be.prototype={get:function($e){var ye=this._p[0],Ee=this._p[1],Se=this._p[2],Le=this._p[3];return this._precomputed||this._precompute(),ye===Ee&&Se===Le?$e:$e===0?0:$e===1?1:ge(this._getTForX($e),Ee,Le)},_precompute:function(){var $e=this._p[0],ye=this._p[1],Ee=this._p[2],Se=this._p[3];this._precomputed=!0,($e!==ye||Ee!==Se)&&this._calcSampleValues()},_calcSampleValues:function(){for(var $e=this._p[0],ye=this._p[2],Ee=0;Ee<le;++Ee)this._mSampleValues[Ee]=ge(Ee*ce,$e,ye)},_getTForX:function($e){for(var ye=this._p[0],Ee=this._p[2],Se=this._mSampleValues,Le=0,Ve=1,Te=le-1;Ve!==Te&&Se[Ve]<=$e;++Ve)Le+=ce;--Ve;var ze=($e-Se[Ve])/(Se[Ve+1]-Se[Ve]),Re=Le+ze*ce,Oe=fe(Re,ye,Ee);return Oe>=re?_e($e,Re,ye,Ee):Oe===0?Re:pe($e,Le,Le+ce,ye,Ee)}},ee}(),pooling=function(){function ee(te){return te.concat(createSizedArray(te.length))}return{double:ee}}(),poolFactory=function(){return function(ee,te,ne){var ae=0,re=ee,oe=createSizedArray(re),ie={newElement:le,release:ce};function le(){var de;return ae?(ae-=1,de=oe[ae]):de=te(),de}function ce(de){ae===re&&(oe=pooling.double(oe),re*=2),ne&&ne(de),oe[ae]=de,ae+=1}return ie}}(),bezierLengthPool=function(){function ee(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,ee)}(),segmentsLengthPool=function(){function ee(){return{lengths:[],totalLength:0}}function te(ne){var ae,re=ne.lengths.length;for(ae=0;ae<re;ae+=1)bezierLengthPool.release(ne.lengths[ae]);ne.lengths.length=0}return poolFactory(8,ee,te)}();function bezFunction(){var ee=Math;function te(me,ge,fe,pe,_e,be){var ke=me*pe+ge*_e+fe*be-_e*pe-be*me-fe*ge;return ke>-.001&&ke<.001}function ne(me,ge,fe,pe,_e,be,ke,$e,ye){if(fe===0&&be===0&&ye===0)return te(me,ge,pe,_e,ke,$e);var Ee=ee.sqrt(ee.pow(pe-me,2)+ee.pow(_e-ge,2)+ee.pow(be-fe,2)),Se=ee.sqrt(ee.pow(ke-me,2)+ee.pow($e-ge,2)+ee.pow(ye-fe,2)),Le=ee.sqrt(ee.pow(ke-pe,2)+ee.pow($e-_e,2)+ee.pow(ye-be,2)),Ve;return Ee>Se?Ee>Le?Ve=Ee-Se-Le:Ve=Le-Se-Ee:Le>Se?Ve=Le-Se-Ee:Ve=Se-Ee-Le,Ve>-1e-4&&Ve<1e-4}var ae=function(){return function(me,ge,fe,pe){var _e=getDefaultCurveSegments(),be,ke,$e,ye,Ee,Se=0,Le,Ve=[],Te=[],ze=bezierLengthPool.newElement();for($e=fe.length,be=0;be<_e;be+=1){for(Ee=be/(_e-1),Le=0,ke=0;ke<$e;ke+=1)ye=bmPow(1-Ee,3)*me[ke]+3*bmPow(1-Ee,2)*Ee*fe[ke]+3*(1-Ee)*bmPow(Ee,2)*pe[ke]+bmPow(Ee,3)*ge[ke],Ve[ke]=ye,Te[ke]!==null&&(Le+=bmPow(Ve[ke]-Te[ke],2)),Te[ke]=Ve[ke];Le&&(Le=bmSqrt(Le),Se+=Le),ze.percents[be]=Ee,ze.lengths[be]=Se}return ze.addedLength=Se,ze}}();function re(me){var ge=segmentsLengthPool.newElement(),fe=me.c,pe=me.v,_e=me.o,be=me.i,ke,$e=me._length,ye=ge.lengths,Ee=0;for(ke=0;ke<$e-1;ke+=1)ye[ke]=ae(pe[ke],pe[ke+1],_e[ke],be[ke+1]),Ee+=ye[ke].addedLength;return fe&&$e&&(ye[ke]=ae(pe[ke],pe[0],_e[ke],be[0]),Ee+=ye[ke].addedLength),ge.totalLength=Ee,ge}function oe(me){this.segmentLength=0,this.points=new Array(me)}function ie(me,ge){this.partialLength=me,this.point=ge}var le=function(){var me={};return function(ge,fe,pe,_e){var be=(ge[0]+"_"+ge[1]+"_"+fe[0]+"_"+fe[1]+"_"+pe[0]+"_"+pe[1]+"_"+_e[0]+"_"+_e[1]).replace(/\./g,"p");if(!me[be]){var ke=getDefaultCurveSegments(),$e,ye,Ee,Se,Le,Ve=0,Te,ze,Re=null;ge.length===2&&(ge[0]!==fe[0]||ge[1]!==fe[1])&&te(ge[0],ge[1],fe[0],fe[1],ge[0]+pe[0],ge[1]+pe[1])&&te(ge[0],ge[1],fe[0],fe[1],fe[0]+_e[0],fe[1]+_e[1])&&(ke=2);var Oe=new oe(ke);for(Ee=pe.length,$e=0;$e<ke;$e+=1){for(ze=createSizedArray(Ee),Le=$e/(ke-1),Te=0,ye=0;ye<Ee;ye+=1)Se=bmPow(1-Le,3)*ge[ye]+3*bmPow(1-Le,2)*Le*(ge[ye]+pe[ye])+3*(1-Le)*bmPow(Le,2)*(fe[ye]+_e[ye])+bmPow(Le,3)*fe[ye],ze[ye]=Se,Re!==null&&(Te+=bmPow(ze[ye]-Re[ye],2));Te=bmSqrt(Te),Ve+=Te,Oe.points[$e]=new ie(Te,ze),Re=ze}Oe.segmentLength=Ve,me[be]=Oe}return me[be]}}();function ce(me,ge){var fe=ge.percents,pe=ge.lengths,_e=fe.length,be=bmFloor((_e-1)*me),ke=me*ge.addedLength,$e=0;if(be===_e-1||be===0||ke===pe[be])return fe[be];for(var ye=pe[be]>ke?-1:1,Ee=!0;Ee;)if(pe[be]<=ke&&pe[be+1]>ke?($e=(ke-pe[be])/(pe[be+1]-pe[be]),Ee=!1):be+=ye,be<0||be>=_e-1){if(be===_e-1)return fe[be];Ee=!1}return fe[be]+(fe[be+1]-fe[be])*$e}function de(me,ge,fe,pe,_e,be){var ke=ce(_e,be),$e=1-ke,ye=ee.round(($e*$e*$e*me[0]+(ke*$e*$e+$e*ke*$e+$e*$e*ke)*fe[0]+(ke*ke*$e+$e*ke*ke+ke*$e*ke)*pe[0]+ke*ke*ke*ge[0])*1e3)/1e3,Ee=ee.round(($e*$e*$e*me[1]+(ke*$e*$e+$e*ke*$e+$e*$e*ke)*fe[1]+(ke*ke*$e+$e*ke*ke+ke*$e*ke)*pe[1]+ke*ke*ke*ge[1])*1e3)/1e3;return[ye,Ee]}var ue=createTypedArray("float32",8);function ve(me,ge,fe,pe,_e,be,ke){_e<0?_e=0:_e>1&&(_e=1);var $e=ce(_e,ke);be=be>1?1:be;var ye=ce(be,ke),Ee,Se=me.length,Le=1-$e,Ve=1-ye,Te=Le*Le*Le,ze=$e*Le*Le*3,Re=$e*$e*Le*3,Oe=$e*$e*$e,Pe=Le*Le*Ve,Be=$e*Le*Ve+Le*$e*Ve+Le*Le*ye,De=$e*$e*Ve+Le*$e*ye+$e*Le*ye,Ne=$e*$e*ye,Me=Le*Ve*Ve,we=$e*Ve*Ve+Le*ye*Ve+Le*Ve*ye,Ce=$e*ye*Ve+Le*ye*ye+$e*Ve*ye,Fe=$e*ye*ye,Ie=Ve*Ve*Ve,Ue=ye*Ve*Ve+Ve*ye*Ve+Ve*Ve*ye,qe=ye*ye*Ve+Ve*ye*ye+ye*Ve*ye,je=ye*ye*ye;for(Ee=0;Ee<Se;Ee+=1)ue[Ee*4]=ee.round((Te*me[Ee]+ze*fe[Ee]+Re*pe[Ee]+Oe*ge[Ee])*1e3)/1e3,ue[Ee*4+1]=ee.round((Pe*me[Ee]+Be*fe[Ee]+De*pe[Ee]+Ne*ge[Ee])*1e3)/1e3,ue[Ee*4+2]=ee.round((Me*me[Ee]+we*fe[Ee]+Ce*pe[Ee]+Fe*ge[Ee])*1e3)/1e3,ue[Ee*4+3]=ee.round((Ie*me[Ee]+Ue*fe[Ee]+qe*pe[Ee]+je*ge[Ee])*1e3)/1e3;return ue}return{getSegmentsLength:re,getNewSegment:ve,getPointInSegment:de,buildBezierData:le,pointOnLine2D:te,pointOnLine3D:ne}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(ee,te){var ne=this.offsetTime,ae;this.propType==="multidimensional"&&(ae=createTypedArray("float32",this.pv.length));for(var re=te.lastIndex,oe=re,ie=this.keyframes.length-1,le=!0,ce,de,ue;le;){if(ce=this.keyframes[oe],de=this.keyframes[oe+1],oe===ie-1&&ee>=de.t-ne){ce.h&&(ce=de),re=0;break}if(de.t-ne>ee){re=oe;break}oe<ie-1?oe+=1:(re=0,le=!1)}ue=this.keyframesMetadata[oe]||{};var ve,me,ge,fe,pe,_e,be=de.t-ne,ke=ce.t-ne,$e;if(ce.to){ue.bezierData||(ue.bezierData=bez.buildBezierData(ce.s,de.s||ce.e,ce.to,ce.ti));var ye=ue.bezierData;if(ee>=be||ee<ke){var Ee=ee>=be?ye.points.length-1:0;for(me=ye.points[Ee].point.length,ve=0;ve<me;ve+=1)ae[ve]=ye.points[Ee].point[ve]}else{ue.__fnct?_e=ue.__fnct:(_e=BezierFactory.getBezierEasing(ce.o.x,ce.o.y,ce.i.x,ce.i.y,ce.n).get,ue.__fnct=_e),ge=_e((ee-ke)/(be-ke));var Se=ye.segmentLength*ge,Le,Ve=te.lastFrame<ee&&te._lastKeyframeIndex===oe?te._lastAddedLength:0;for(pe=te.lastFrame<ee&&te._lastKeyframeIndex===oe?te._lastPoint:0,le=!0,fe=ye.points.length;le;){if(Ve+=ye.points[pe].partialLength,Se===0||ge===0||pe===ye.points.length-1){for(me=ye.points[pe].point.length,ve=0;ve<me;ve+=1)ae[ve]=ye.points[pe].point[ve];break}else if(Se>=Ve&&Se<Ve+ye.points[pe+1].partialLength){for(Le=(Se-Ve)/ye.points[pe+1].partialLength,me=ye.points[pe].point.length,ve=0;ve<me;ve+=1)ae[ve]=ye.points[pe].point[ve]+(ye.points[pe+1].point[ve]-ye.points[pe].point[ve])*Le;break}pe<fe-1?pe+=1:le=!1}te._lastPoint=pe,te._lastAddedLength=Ve-ye.points[pe].partialLength,te._lastKeyframeIndex=oe}}else{var Te,ze,Re,Oe,Pe;if(ie=ce.s.length,$e=de.s||ce.e,this.sh&&ce.h!==1)if(ee>=be)ae[0]=$e[0],ae[1]=$e[1],ae[2]=$e[2];else if(ee<=ke)ae[0]=ce.s[0],ae[1]=ce.s[1],ae[2]=ce.s[2];else{var Be=createQuaternion(ce.s),De=createQuaternion($e),Ne=(ee-ke)/(be-ke);quaternionToEuler(ae,slerp(Be,De,Ne))}else for(oe=0;oe<ie;oe+=1)ce.h!==1&&(ee>=be?ge=1:ee<ke?ge=0:(ce.o.x.constructor===Array?(ue.__fnct||(ue.__fnct=[]),ue.__fnct[oe]?_e=ue.__fnct[oe]:(Te=ce.o.x[oe]===void 0?ce.o.x[0]:ce.o.x[oe],ze=ce.o.y[oe]===void 0?ce.o.y[0]:ce.o.y[oe],Re=ce.i.x[oe]===void 0?ce.i.x[0]:ce.i.x[oe],Oe=ce.i.y[oe]===void 0?ce.i.y[0]:ce.i.y[oe],_e=BezierFactory.getBezierEasing(Te,ze,Re,Oe).get,ue.__fnct[oe]=_e)):ue.__fnct?_e=ue.__fnct:(Te=ce.o.x,ze=ce.o.y,Re=ce.i.x,Oe=ce.i.y,_e=BezierFactory.getBezierEasing(Te,ze,Re,Oe).get,ce.keyframeMetadata=_e),ge=_e((ee-ke)/(be-ke)))),$e=de.s||ce.e,Pe=ce.h===1?ce.s[oe]:ce.s[oe]+($e[oe]-ce.s[oe])*ge,this.propType==="multidimensional"?ae[oe]=Pe:ae=Pe}return te.lastIndex=re,ae}function slerp(ee,te,ne){var ae=[],re=ee[0],oe=ee[1],ie=ee[2],le=ee[3],ce=te[0],de=te[1],ue=te[2],ve=te[3],me,ge,fe,pe,_e;return ge=re*ce+oe*de+ie*ue+le*ve,ge<0&&(ge=-ge,ce=-ce,de=-de,ue=-ue,ve=-ve),1-ge>1e-6?(me=Math.acos(ge),fe=Math.sin(me),pe=Math.sin((1-ne)*me)/fe,_e=Math.sin(ne*me)/fe):(pe=1-ne,_e=ne),ae[0]=pe*re+_e*ce,ae[1]=pe*oe+_e*de,ae[2]=pe*ie+_e*ue,ae[3]=pe*le+_e*ve,ae}function quaternionToEuler(ee,te){var ne=te[0],ae=te[1],re=te[2],oe=te[3],ie=Math.atan2(2*ae*oe-2*ne*re,1-2*ae*ae-2*re*re),le=Math.asin(2*ne*ae+2*re*oe),ce=Math.atan2(2*ne*oe-2*ae*re,1-2*ne*ne-2*re*re);ee[0]=ie/degToRads,ee[1]=le/degToRads,ee[2]=ce/degToRads}function createQuaternion(ee){var te=ee[0]*degToRads,ne=ee[1]*degToRads,ae=ee[2]*degToRads,re=Math.cos(te/2),oe=Math.cos(ne/2),ie=Math.cos(ae/2),le=Math.sin(te/2),ce=Math.sin(ne/2),de=Math.sin(ae/2),ue=re*oe*ie-le*ce*de,ve=le*ce*ie+re*oe*de,me=le*oe*ie+re*ce*de,ge=re*ce*ie-le*oe*de;return[ve,me,ge,ue]}function getValueAtCurrentTime(){var ee=this.comp.renderedFrame-this.offsetTime,te=this.keyframes[0].t-this.offsetTime,ne=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(ee===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=ne&&ee>=ne||this._caching.lastFrame<te&&ee<te))){this._caching.lastFrame>=ee&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var ae=this.interpolateValue(ee,this._caching);this.pv=ae}return this._caching.lastFrame=ee,this.pv}function setVValue(ee){var te;if(this.propType==="unidimensional")te=ee*this.mult,mathAbs(this.v-te)>1e-5&&(this.v=te,this._mdf=!0);else for(var ne=0,ae=this.v.length;ne<ae;)te=ee[ne]*this.mult,mathAbs(this.v[ne]-te)>1e-5&&(this.v[ne]=te,this._mdf=!0),ne+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var ee,te=this.effectsSequence.length,ne=this.kf?this.pv:this.data.k;for(ee=0;ee<te;ee+=1)ne=this.effectsSequence[ee](ne);this.setVValue(ne),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(ee){this.effectsSequence.push(ee),this.container.addDynamicProperty(this)}function ValueProperty(ee,te,ne,ae){this.propType="unidimensional",this.mult=ne||1,this.data=te,this.v=ne?te.k*ne:te.k,this.pv=te.k,this._mdf=!1,this.elem=ee,this.container=ae,this.comp=ee.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(ee,te,ne,ae){this.propType="multidimensional",this.mult=ne||1,this.data=te,this._mdf=!1,this.elem=ee,this.container=ae,this.comp=ee.comp,this.k=!1,this.kf=!1,this.frameId=-1;var re,oe=te.k.length;for(this.v=createTypedArray("float32",oe),this.pv=createTypedArray("float32",oe),this.vel=createTypedArray("float32",oe),re=0;re<oe;re+=1)this.v[re]=te.k[re]*this.mult,this.pv[re]=te.k[re];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(ee,te,ne,ae){this.propType="unidimensional",this.keyframes=te.k,this.keyframesMetadata=[],this.offsetTime=ee.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=te,this.mult=ne||1,this.elem=ee,this.container=ae,this.comp=ee.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(ee,te,ne,ae){this.propType="multidimensional";var re,oe=te.k.length,ie,le,ce,de;for(re=0;re<oe-1;re+=1)te.k[re].to&&te.k[re].s&&te.k[re+1]&&te.k[re+1].s&&(ie=te.k[re].s,le=te.k[re+1].s,ce=te.k[re].to,de=te.k[re].ti,(ie.length===2&&!(ie[0]===le[0]&&ie[1]===le[1])&&bez.pointOnLine2D(ie[0],ie[1],le[0],le[1],ie[0]+ce[0],ie[1]+ce[1])&&bez.pointOnLine2D(ie[0],ie[1],le[0],le[1],le[0]+de[0],le[1]+de[1])||ie.length===3&&!(ie[0]===le[0]&&ie[1]===le[1]&&ie[2]===le[2])&&bez.pointOnLine3D(ie[0],ie[1],ie[2],le[0],le[1],le[2],ie[0]+ce[0],ie[1]+ce[1],ie[2]+ce[2])&&bez.pointOnLine3D(ie[0],ie[1],ie[2],le[0],le[1],le[2],le[0]+de[0],le[1]+de[1],le[2]+de[2]))&&(te.k[re].to=null,te.k[re].ti=null),ie[0]===le[0]&&ie[1]===le[1]&&ce[0]===0&&ce[1]===0&&de[0]===0&&de[1]===0&&(ie.length===2||ie[2]===le[2]&&ce[2]===0&&de[2]===0)&&(te.k[re].to=null,te.k[re].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=te,this.keyframes=te.k,this.keyframesMetadata=[],this.offsetTime=ee.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=ne||1,this.elem=ee,this.container=ae,this.comp=ee.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var ue=te.k[0].s.length;for(this.v=createTypedArray("float32",ue),this.pv=createTypedArray("float32",ue),re=0;re<ue;re+=1)this.v[re]=initFrame,this.pv[re]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",ue)},this.addEffect=addEffect}var PropertyFactory=function(){function ee(ne,ae,re,oe,ie){ae.sid&&(ae=ne.globalData.slotManager.getProp(ae));var le;if(!ae.k.length)le=new ValueProperty(ne,ae,oe,ie);else if(typeof ae.k[0]=="number")le=new MultiDimensionalProperty(ne,ae,oe,ie);else switch(re){case 0:le=new KeyframedValueProperty(ne,ae,oe,ie);break;case 1:le=new KeyframedMultidimensionalProperty(ne,ae,oe,ie);break}return le.effectsSequence.length&&ie.addDynamicProperty(le),le}var te={getProp:ee};return te}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(te){this.dynamicProperties.indexOf(te)===-1&&(this.dynamicProperties.push(te),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var te,ne=this.dynamicProperties.length;for(te=0;te<ne;te+=1)this.dynamicProperties[te].getValue(),this.dynamicProperties[te]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(te){this.container=te,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=function(){function ee(){return createTypedArray("float32",2)}return poolFactory(8,ee)}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(ee,te){this.c=ee,this.setLength(te);for(var ne=0;ne<te;)this.v[ne]=pointPool.newElement(),this.o[ne]=pointPool.newElement(),this.i[ne]=pointPool.newElement(),ne+=1},ShapePath.prototype.setLength=function(ee){for(;this._maxLength<ee;)this.doubleArrayLength();this._length=ee},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(ee,te,ne,ae,re){var oe;switch(this._length=Math.max(this._length,ae+1),this._length>=this._maxLength&&this.doubleArrayLength(),ne){case"v":oe=this.v;break;case"i":oe=this.i;break;case"o":oe=this.o;break;default:oe=[];break}(!oe[ae]||oe[ae]&&!re)&&(oe[ae]=pointPool.newElement()),oe[ae][0]=ee,oe[ae][1]=te},ShapePath.prototype.setTripleAt=function(ee,te,ne,ae,re,oe,ie,le){this.setXYAt(ee,te,"v",ie,le),this.setXYAt(ne,ae,"o",ie,le),this.setXYAt(re,oe,"i",ie,le)},ShapePath.prototype.reverse=function(){var ee=new ShapePath;ee.setPathData(this.c,this._length);var te=this.v,ne=this.o,ae=this.i,re=0;this.c&&(ee.setTripleAt(te[0][0],te[0][1],ae[0][0],ae[0][1],ne[0][0],ne[0][1],0,!1),re=1);var oe=this._length-1,ie=this._length,le;for(le=re;le<ie;le+=1)ee.setTripleAt(te[oe][0],te[oe][1],ae[oe][0],ae[oe][1],ne[oe][0],ne[oe][1],le,!1),oe-=1;return ee},ShapePath.prototype.length=function(){return this._length};var shapePool=function(){function ee(){return new ShapePath}function te(re){var oe=re._length,ie;for(ie=0;ie<oe;ie+=1)pointPool.release(re.v[ie]),pointPool.release(re.i[ie]),pointPool.release(re.o[ie]),re.v[ie]=null,re.i[ie]=null,re.o[ie]=null;re._length=0,re.c=!1}function ne(re){var oe=ae.newElement(),ie,le=re._length===void 0?re.v.length:re._length;for(oe.setLength(le),oe.c=re.c,ie=0;ie<le;ie+=1)oe.setTripleAt(re.v[ie][0],re.v[ie][1],re.o[ie][0],re.o[ie][1],re.i[ie][0],re.i[ie][1],ie);return oe}var ae=poolFactory(4,ee,te);return ae.clone=ne,ae}();function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(ee){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=ee,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var ee;for(ee=0;ee<this._length;ee+=1)shapePool.release(this.shapes[ee]);this._length=0};var shapeCollectionPool=function(){var ee={newShapeCollection:re,release:oe},te=0,ne=4,ae=createSizedArray(ne);function re(){var ie;return te?(te-=1,ie=ae[te]):ie=new ShapeCollection,ie}function oe(ie){var le,ce=ie._length;for(le=0;le<ce;le+=1)shapePool.release(ie.shapes[le]);ie._length=0,te===ne&&(ae=pooling.double(ae),ne*=2),ae[te]=ie,te+=1}return ee}(),ShapePropertyFactory=function(){var ee=-999999;function te(be,ke,$e){var ye=$e.lastIndex,Ee,Se,Le,Ve,Te,ze,Re,Oe,Pe,Be=this.keyframes;if(be<Be[0].t-this.offsetTime)Ee=Be[0].s[0],Le=!0,ye=0;else if(be>=Be[Be.length-1].t-this.offsetTime)Ee=Be[Be.length-1].s?Be[Be.length-1].s[0]:Be[Be.length-2].e[0],Le=!0;else{for(var De=ye,Ne=Be.length-1,Me=!0,we,Ce,Fe;Me&&(we=Be[De],Ce=Be[De+1],!(Ce.t-this.offsetTime>be));)De<Ne-1?De+=1:Me=!1;if(Fe=this.keyframesMetadata[De]||{},Le=we.h===1,ye=De,!Le){if(be>=Ce.t-this.offsetTime)Oe=1;else if(be<we.t-this.offsetTime)Oe=0;else{var Ie;Fe.__fnct?Ie=Fe.__fnct:(Ie=BezierFactory.getBezierEasing(we.o.x,we.o.y,we.i.x,we.i.y).get,Fe.__fnct=Ie),Oe=Ie((be-(we.t-this.offsetTime))/(Ce.t-this.offsetTime-(we.t-this.offsetTime)))}Se=Ce.s?Ce.s[0]:we.e[0]}Ee=we.s[0]}for(ze=ke._length,Re=Ee.i[0].length,$e.lastIndex=ye,Ve=0;Ve<ze;Ve+=1)for(Te=0;Te<Re;Te+=1)Pe=Le?Ee.i[Ve][Te]:Ee.i[Ve][Te]+(Se.i[Ve][Te]-Ee.i[Ve][Te])*Oe,ke.i[Ve][Te]=Pe,Pe=Le?Ee.o[Ve][Te]:Ee.o[Ve][Te]+(Se.o[Ve][Te]-Ee.o[Ve][Te])*Oe,ke.o[Ve][Te]=Pe,Pe=Le?Ee.v[Ve][Te]:Ee.v[Ve][Te]+(Se.v[Ve][Te]-Ee.v[Ve][Te])*Oe,ke.v[Ve][Te]=Pe}function ne(){var be=this.comp.renderedFrame-this.offsetTime,ke=this.keyframes[0].t-this.offsetTime,$e=this.keyframes[this.keyframes.length-1].t-this.offsetTime,ye=this._caching.lastFrame;return ye!==ee&&(ye<ke&&be<ke||ye>$e&&be>$e)||(this._caching.lastIndex=ye<be?this._caching.lastIndex:0,this.interpolateShape(be,this.pv,this._caching)),this._caching.lastFrame=be,this.pv}function ae(){this.paths=this.localShapeCollection}function re(be,ke){if(be._length!==ke._length||be.c!==ke.c)return!1;var $e,ye=be._length;for($e=0;$e<ye;$e+=1)if(be.v[$e][0]!==ke.v[$e][0]||be.v[$e][1]!==ke.v[$e][1]||be.o[$e][0]!==ke.o[$e][0]||be.o[$e][1]!==ke.o[$e][1]||be.i[$e][0]!==ke.i[$e][0]||be.i[$e][1]!==ke.i[$e][1])return!1;return!0}function oe(be){re(this.v,be)||(this.v=shapePool.clone(be),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function ie(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var be;this.kf?be=this.pv:this.data.ks?be=this.data.ks.k:be=this.data.pt.k;var ke,$e=this.effectsSequence.length;for(ke=0;ke<$e;ke+=1)be=this.effectsSequence[ke](be);this.setVValue(be),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function le(be,ke,$e){this.propType="shape",this.comp=be.comp,this.container=be,this.elem=be,this.data=ke,this.k=!1,this.kf=!1,this._mdf=!1;var ye=$e===3?ke.pt.k:ke.ks.k;this.v=shapePool.clone(ye),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=ae,this.effectsSequence=[]}function ce(be){this.effectsSequence.push(be),this.container.addDynamicProperty(this)}le.prototype.interpolateShape=te,le.prototype.getValue=ie,le.prototype.setVValue=oe,le.prototype.addEffect=ce;function de(be,ke,$e){this.propType="shape",this.comp=be.comp,this.elem=be,this.container=be,this.offsetTime=be.data.st,this.keyframes=$e===3?ke.pt.k:ke.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var ye=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,ye),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=ee,this.reset=ae,this._caching={lastFrame:ee,lastIndex:0},this.effectsSequence=[ne.bind(this)]}de.prototype.getValue=ie,de.prototype.interpolateShape=te,de.prototype.setVValue=oe,de.prototype.addEffect=ce;var ue=function(){var be=roundCorner;function ke($e,ye){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=ye.d,this.elem=$e,this.comp=$e.comp,this.frameId=-1,this.initDynamicPropertyContainer($e),this.p=PropertyFactory.getProp($e,ye.p,1,0,this),this.s=PropertyFactory.getProp($e,ye.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return ke.prototype={reset:ae,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var ye=this.p.v[0],Ee=this.p.v[1],Se=this.s.v[0]/2,Le=this.s.v[1]/2,Ve=this.d!==3,Te=this.v;Te.v[0][0]=ye,Te.v[0][1]=Ee-Le,Te.v[1][0]=Ve?ye+Se:ye-Se,Te.v[1][1]=Ee,Te.v[2][0]=ye,Te.v[2][1]=Ee+Le,Te.v[3][0]=Ve?ye-Se:ye+Se,Te.v[3][1]=Ee,Te.i[0][0]=Ve?ye-Se*be:ye+Se*be,Te.i[0][1]=Ee-Le,Te.i[1][0]=Ve?ye+Se:ye-Se,Te.i[1][1]=Ee-Le*be,Te.i[2][0]=Ve?ye+Se*be:ye-Se*be,Te.i[2][1]=Ee+Le,Te.i[3][0]=Ve?ye-Se:ye+Se,Te.i[3][1]=Ee+Le*be,Te.o[0][0]=Ve?ye+Se*be:ye-Se*be,Te.o[0][1]=Ee-Le,Te.o[1][0]=Ve?ye+Se:ye-Se,Te.o[1][1]=Ee+Le*be,Te.o[2][0]=Ve?ye-Se*be:ye+Se*be,Te.o[2][1]=Ee+Le,Te.o[3][0]=Ve?ye-Se:ye+Se,Te.o[3][1]=Ee-Le*be}},extendPrototype([DynamicPropertyContainer],ke),ke}(),ve=function(){function be(ke,$e){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=ke,this.comp=ke.comp,this.data=$e,this.frameId=-1,this.d=$e.d,this.initDynamicPropertyContainer(ke),$e.sy===1?(this.ir=PropertyFactory.getProp(ke,$e.ir,0,0,this),this.is=PropertyFactory.getProp(ke,$e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(ke,$e.pt,0,0,this),this.p=PropertyFactory.getProp(ke,$e.p,1,0,this),this.r=PropertyFactory.getProp(ke,$e.r,0,degToRads,this),this.or=PropertyFactory.getProp(ke,$e.or,0,0,this),this.os=PropertyFactory.getProp(ke,$e.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return be.prototype={reset:ae,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var $e=Math.floor(this.pt.v)*2,ye=Math.PI*2/$e,Ee=!0,Se=this.or.v,Le=this.ir.v,Ve=this.os.v,Te=this.is.v,ze=2*Math.PI*Se/($e*2),Re=2*Math.PI*Le/($e*2),Oe,Pe,Be,De,Ne=-Math.PI/2;Ne+=this.r.v;var Me=this.data.d===3?-1:1;for(this.v._length=0,Oe=0;Oe<$e;Oe+=1){Pe=Ee?Se:Le,Be=Ee?Ve:Te,De=Ee?ze:Re;var we=Pe*Math.cos(Ne),Ce=Pe*Math.sin(Ne),Fe=we===0&&Ce===0?0:Ce/Math.sqrt(we*we+Ce*Ce),Ie=we===0&&Ce===0?0:-we/Math.sqrt(we*we+Ce*Ce);we+=+this.p.v[0],Ce+=+this.p.v[1],this.v.setTripleAt(we,Ce,we-Fe*De*Be*Me,Ce-Ie*De*Be*Me,we+Fe*De*Be*Me,Ce+Ie*De*Be*Me,Oe,!0),Ee=!Ee,Ne+=ye*Me}},convertPolygonToPath:function(){var $e=Math.floor(this.pt.v),ye=Math.PI*2/$e,Ee=this.or.v,Se=this.os.v,Le=2*Math.PI*Ee/($e*4),Ve,Te=-Math.PI*.5,ze=this.data.d===3?-1:1;for(Te+=this.r.v,this.v._length=0,Ve=0;Ve<$e;Ve+=1){var Re=Ee*Math.cos(Te),Oe=Ee*Math.sin(Te),Pe=Re===0&&Oe===0?0:Oe/Math.sqrt(Re*Re+Oe*Oe),Be=Re===0&&Oe===0?0:-Re/Math.sqrt(Re*Re+Oe*Oe);Re+=+this.p.v[0],Oe+=+this.p.v[1],this.v.setTripleAt(Re,Oe,Re-Pe*Le*Se*ze,Oe-Be*Le*Se*ze,Re+Pe*Le*Se*ze,Oe+Be*Le*Se*ze,Ve,!0),Te+=ye*ze}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],be),be}(),me=function(){function be(ke,$e){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=ke,this.comp=ke.comp,this.frameId=-1,this.d=$e.d,this.initDynamicPropertyContainer(ke),this.p=PropertyFactory.getProp(ke,$e.p,1,0,this),this.s=PropertyFactory.getProp(ke,$e.s,1,0,this),this.r=PropertyFactory.getProp(ke,$e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return be.prototype={convertRectToPath:function(){var $e=this.p.v[0],ye=this.p.v[1],Ee=this.s.v[0]/2,Se=this.s.v[1]/2,Le=bmMin(Ee,Se,this.r.v),Ve=Le*(1-roundCorner);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt($e+Ee,ye-Se+Le,$e+Ee,ye-Se+Le,$e+Ee,ye-Se+Ve,0,!0),this.v.setTripleAt($e+Ee,ye+Se-Le,$e+Ee,ye+Se-Ve,$e+Ee,ye+Se-Le,1,!0),Le!==0?(this.v.setTripleAt($e+Ee-Le,ye+Se,$e+Ee-Le,ye+Se,$e+Ee-Ve,ye+Se,2,!0),this.v.setTripleAt($e-Ee+Le,ye+Se,$e-Ee+Ve,ye+Se,$e-Ee+Le,ye+Se,3,!0),this.v.setTripleAt($e-Ee,ye+Se-Le,$e-Ee,ye+Se-Le,$e-Ee,ye+Se-Ve,4,!0),this.v.setTripleAt($e-Ee,ye-Se+Le,$e-Ee,ye-Se+Ve,$e-Ee,ye-Se+Le,5,!0),this.v.setTripleAt($e-Ee+Le,ye-Se,$e-Ee+Le,ye-Se,$e-Ee+Ve,ye-Se,6,!0),this.v.setTripleAt($e+Ee-Le,ye-Se,$e+Ee-Ve,ye-Se,$e+Ee-Le,ye-Se,7,!0)):(this.v.setTripleAt($e-Ee,ye+Se,$e-Ee+Ve,ye+Se,$e-Ee,ye+Se,2),this.v.setTripleAt($e-Ee,ye-Se,$e-Ee,ye-Se+Ve,$e-Ee,ye-Se,3))):(this.v.setTripleAt($e+Ee,ye-Se+Le,$e+Ee,ye-Se+Ve,$e+Ee,ye-Se+Le,0,!0),Le!==0?(this.v.setTripleAt($e+Ee-Le,ye-Se,$e+Ee-Le,ye-Se,$e+Ee-Ve,ye-Se,1,!0),this.v.setTripleAt($e-Ee+Le,ye-Se,$e-Ee+Ve,ye-Se,$e-Ee+Le,ye-Se,2,!0),this.v.setTripleAt($e-Ee,ye-Se+Le,$e-Ee,ye-Se+Le,$e-Ee,ye-Se+Ve,3,!0),this.v.setTripleAt($e-Ee,ye+Se-Le,$e-Ee,ye+Se-Ve,$e-Ee,ye+Se-Le,4,!0),this.v.setTripleAt($e-Ee+Le,ye+Se,$e-Ee+Le,ye+Se,$e-Ee+Ve,ye+Se,5,!0),this.v.setTripleAt($e+Ee-Le,ye+Se,$e+Ee-Ve,ye+Se,$e+Ee-Le,ye+Se,6,!0),this.v.setTripleAt($e+Ee,ye+Se-Le,$e+Ee,ye+Se-Le,$e+Ee,ye+Se-Ve,7,!0)):(this.v.setTripleAt($e-Ee,ye-Se,$e-Ee+Ve,ye-Se,$e-Ee,ye-Se,1,!0),this.v.setTripleAt($e-Ee,ye+Se,$e-Ee,ye+Se-Ve,$e-Ee,ye+Se,2,!0),this.v.setTripleAt($e+Ee,ye+Se,$e+Ee-Ve,ye+Se,$e+Ee,ye+Se,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:ae},extendPrototype([DynamicPropertyContainer],be),be}();function ge(be,ke,$e){var ye;if($e===3||$e===4){var Ee=$e===3?ke.pt:ke.ks,Se=Ee.k;Se.length?ye=new de(be,ke,$e):ye=new le(be,ke,$e)}else $e===5?ye=new me(be,ke):$e===6?ye=new ue(be,ke):$e===7&&(ye=new ve(be,ke));return ye.k&&be.addDynamicProperty(ye),ye}function fe(){return le}function pe(){return de}var _e={};return _e.getShapeProp=ge,_e.getConstructorFunction=fe,_e.getKeyframedConstructorFunction=pe,_e}();/*!
|
|
285
285
|
Transformation Matrix v2.0
|
|
286
286
|
(c) Epistemex 2014-2015
|