@evercam/ui 1.0.0-preview-cameraPowerSchedule-b7b58a0a7 → 1.0.0-preview-cameraPowerSchedule-83b6fbb62

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.umd.js CHANGED
@@ -239,7 +239,7 @@ m367 -176 c192 -56 348 -207 420 -405 34 -93 34 -285 0 -378 -72 -198 -228
239
239
  <div>-</div>
240
240
  <div>${t.endTime}</div>
241
241
  </div>
242
- `:`${t.startTime} - ${t.endTime}`},normalizeTime(t){return t==="24:00"?"23:59":t},getFormattedSchedule(){const t={};return this.internalDays.forEach(e=>{const r=(e.day+1).toString();t[r]=e.segments.map(n=>{const i=this.normalizeTime(n.startTime),o=this.normalizeTime(n.endTime);return`${i}-${o}`})}),t},formatDay(t){return new Intl.DateTimeFormat("en-US",{weekday:"short"}).format(new Date(0,0,t+1))},formatHour(t){return(t-1).toString().padStart(2,"0")+"h"},parseTime(t){const[e,r]=t.split(":").map(n=>parseInt(n,10));return{hours:e,minutes:r}},padTime(t){let e=Math.round(t*60);e<0&&(e=0),e>24*60&&(e=24*60);const r=Math.floor(e/60),n=e%60;return`${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},roundToFive(t){const e=t*60,r=Math.round(e/5)*5;return Math.max(0,Math.min(r,24*60))/60},calculateBarStyle(t,e,r){const{hours:n,minutes:i}=this.parseTime(e),{hours:o,minutes:s}=this.parseTime(r),c=n+i/60,l=o+s/60-c,d=c/24*100,f=l/24*100,m=t*this.rowHeightPx,b=this.rowHeightPx;return{position:"absolute",top:`${m+1}px`,left:`calc(${d}% + 1px)`,width:`calc(${f}% - 2px)`,height:`${b-3}px`}},onResize(){const t=this.$refs.table,e=Array.from(t.querySelectorAll(".segment-cell"));if(!t||!e.length)return;const r=e[0].getBoundingClientRect();this.rowHeightPx=r.height;const n=e[e.length-1].getBoundingClientRect();this.segmentsContainerRect={top:r.top,left:r.left,width:n.right-r.left,height:n.bottom-r.top}},onSegmentMouseDown(t,e,r){if(t.preventDefault(),t.stopPropagation(),!this.segmentsContainerRect)return;const i=t.currentTarget.getBoundingClientRect(),o=t.clientX-i.left,s=6;let c="move";o<s?c="resize-left":o>i.width-s&&(c="resize-right");const a=this.sortedDays[e].segments[r],{hours:l,minutes:d}=this.parseTime(a.startTime),{hours:f,minutes:m}=this.parseTime(a.endTime),b=l+d/60,x=f+m/60;this.editing={dayIndex:e,segmentIndex:r,type:c,startMouseX:t.clientX,origStartFrac:b,origEndFrac:x},document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)},onMouseMove(t){if(!this.editing||!this.segmentsContainerRect)return;t.preventDefault();const{dayIndex:e,segmentIndex:r,type:n,startMouseX:i,origStartFrac:o,origEndFrac:s}=this.editing,a=(t.clientX-i)/this.pixelsPerHour;let l=o,d=s;n==="move"?(l=o+a,d=s+a):n==="resize-left"?l=o+a:n==="resize-right"&&(d=s+a),l=Math.max(0,Math.min(l,24)),d=Math.max(0,Math.min(d,24)),d<=l+.01&&(n==="resize-left"?l=d-.01:n==="resize-right"?d=l+.01:(l=o,d=s)),l=this.roundToFive(l),d=this.roundToFive(d);const f=this.sortedDays[e].day;this.internalDays=this.internalDays.map(m=>{if(m.day!==f)return m;const b=m.segments.map((x,h)=>h!==r?x:{startTime:this.padTime(l),endTime:this.padTime(d)});return{...m,segments:b}})},onMouseUp(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp),this.editing=null,this.mergeOverlappingSegments()},onSegmentMouseMove(t){const e=t.currentTarget,r=e.getBoundingClientRect(),n=t.clientX-r.left,i=6;n<i||n>r.width-i?e.style.cursor="ew-resize":e.style.cursor="grab"},onSegmentMouseLeave(t){const e=t.currentTarget;e.style.cursor="default"},deleteSegment(t,e){const r=this.sortedDays[t].day;this.internalDays=this.internalDays.map(n=>{if(n.day!==r)return n;const i=n.segments.filter((o,s)=>s!==e);return{...n,segments:i}}),this.emitChangeEvent()},onBackgroundMouseDown(t){if(t.target.closest(".segment"))return;const n=this.$refs.table.querySelectorAll(".segment-cell"),i=n[0].getBoundingClientRect(),o=n[n.length-1].getBoundingClientRect();this.segmentsContainerRect={top:i.top,left:i.left,width:o.right-i.left,height:o.bottom-i.top},t.preventDefault();const s=t.clientY-this.segmentsContainerRect.top,c=Math.floor(s/this.rowHeightPx);if(c<0||c>=this.sortedDays.length)return;let a=(t.clientX-this.segmentsContainerRect.left)/this.pixelsPerHour;a=Math.max(0,Math.min(a,24)),this.creating={startDayIndex:c,currentDayIndex:c,startFrac:a,currentFrac:a},document.addEventListener("mousemove",this.onCreateMouseMove),document.addEventListener("mouseup",this.onCreateMouseUp)},onCreateMouseMove(t){if(!this.creating||!this.segmentsContainerRect)return;t.preventDefault();let e=(t.clientX-this.segmentsContainerRect.left)/this.pixelsPerHour;e=Math.max(0,Math.min(e,24)),this.creating.currentFrac=e;const r=t.clientY-this.segmentsContainerRect.top;let n=Math.floor(r/this.rowHeightPx);n=Math.max(0,Math.min(n,this.sortedDays.length-1)),this.creating.currentDayIndex=n},onCreateMouseUp(){if(!this.creating)return;const{startDayIndex:t,currentDayIndex:e,startFrac:r,currentFrac:n}=this.creating;let i=Math.min(r,n),o=Math.max(r,n);if(o-i<.01){this.cleanupCreate();return}const s=this.roundToFive(i),c=this.roundToFive(o),a=Math.min(t,e),l=Math.max(t,e),f=this.sortedDays.map(m=>m.day).slice(a,l+1);this.internalDays=this.internalDays.map(m=>f.includes(m.day)?{...m,segments:[...m.segments,{startTime:this.padTime(s),endTime:this.padTime(c)}]}:m),this.cleanupCreate(),this.mergeOverlappingSegments()},cleanupCreate(){document.removeEventListener("mousemove",this.onCreateMouseMove),document.removeEventListener("mouseup",this.onCreateMouseUp),this.creating=null},calculateMultiDayStyle(t,e,r,n){const i=Math.min(r,n)/24*100,o=(Math.max(r,n)-Math.min(r,n))/24*100,s=Math.min(t,e),c=Math.max(t,e),a=s*this.rowHeightPx,l=(c-s+1)*this.rowHeightPx;return{position:"absolute",top:`${a+1}px`,left:`calc(${i}% + 1px)`,width:`calc(${o}% - 2px)`,height:`${l-2}px`}},mergeOverlappingSegments(){this.internalDays=this.internalDays.map(t=>{const e=t.segments.map(i=>{const{hours:o,minutes:s}=this.parseTime(i.startTime),{hours:c,minutes:a}=this.parseTime(i.endTime);return{start:o+s/60,end:c+a/60}});e.sort((i,o)=>i.start-o.start);const r=[];for(const i of e)if(!r.length)r.push({...i});else{const o=r[r.length-1];i.start<=o.end+1e-6?o.end=Math.max(o.end,i.end):r.push({...i})}const n=r.map(i=>({startTime:this.padTime(this.roundToFive(i.start)),endTime:this.padTime(this.roundToFive(i.end))}));return{day:t.day,segments:n}})},showHour(t){return(t-1)%this.tickInterval===0||t===24},emitChangeEvent(){this.mergeOverlappingSegments(),this.$emit("change",this.getFormattedSchedule())}}}),yd="";var K4=function(){var e=this,r=e._self._c;return r("div",{ref:"mainContainer",staticClass:"schedule e-text-grey e-relative"},[r("table",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.onResize,expression:"onResize"}],ref:"table",staticClass:"e-table-fixed e-w-full e-border-separate e-border-spacing-0 e-relative"},[r("thead",[r("tr",{staticClass:"e-h-8"},[r("th",{staticClass:"e-w-16"}),e._l(24,function(n){return r("th",{key:n,staticClass:"hour-label e-p-1 e-text-center e-h-8"},[e.showHour(n)?r("span",[e._v(e._s(e.formatHour(n)))]):e._e()])})],2)]),r("tbody",e._l(e.sortedDays,function(n,i){return r("tr",{key:n.day,staticClass:"h-8"},[r("th",{staticClass:"e-p-1 e-text-center e-h-8",attrs:{scope:"row"}},[e._v(" "+e._s(e.formatDay(n.day))+" ")]),e._l(24,function(o){return r("td",{key:o,staticClass:"segment-cell e-border-b e-border-white dark:e-border-gray-700 e-h-8",class:{"e-border-l":o===1,"e-border-r":o===24,"e-border-t":i===0,"e-rounded-tl-lg":i===0&&o===1,"e-rounded-tr-lg":i===0&&o===24,"e-rounded-bl-lg":i===e.sortedDays.length-1&&o===1,"e-rounded-br-lg":i===e.sortedDays.length-1&&o===24}})})],2)}),0)]),e.segmentsContainerRect?r("div",{ref:"overlay",staticClass:"e-absolute e-inset-0 e-cursor-crosshair",style:e.segmentsContainerStyles,on:{mousedown:e.onBackgroundMouseDown}},[e._l(e.sortedDays,function(n,i){return r("div",{key:n.day},e._l(n.segments,function(o,s){return r("div",{key:o.startTime+"-"+o.endTime,staticClass:"segment e-rounded e-absolute e-bg-blue-500/80",style:e.calculateBarStyle(i,o.startTime,o.endTime),on:{mousedown:function(c){return c.stopPropagation(),e.onSegmentMouseDown(c,i,s)},mousemove:e.onSegmentMouseMove,mouseleave:e.onSegmentMouseLeave}},[r("button",{staticClass:"delete-btn e-d-flex e-justify-center e-align-center e-absolute e-top-0 e-right-0 e-text-m e-m-1 e-bg-red-600 e-rounded e-text-white e-p-1",on:{click:function(c){return c.stopPropagation(),e.deleteSegment(i,s)}}},[e._v(" x ")]),r("div",{staticClass:"e-flex e-justify-center e-items-center e-text-xs e-text-white e-h-full e-select-none",domProps:{innerHTML:e._s(e.getSegmentLabel(o))}})])}),0)}),e.creating?r("div",{staticClass:"segment e-rounded e-absolute e-bg-blue-300/50 e-border e-border-blue-400 e-flex e-justify-center e-items-center e-text-xs e-text-white",style:e.calculateMultiDayStyle(e.creating.startDayIndex,e.creating.currentDayIndex,e.creating.startFrac,e.creating.currentFrac)},[e._v(" "+e._s(e.padTime(e.roundToFive(Math.min(e.creating.startFrac,e.creating.currentFrac))))+"  -  "+e._s(e.padTime(e.roundToFive(Math.max(e.creating.startFrac,e.creating.currentFrac))))+" ")]):e._e()],2):e._e()])},J4=[],ec=H(Q4,K4,J4,!1,null,null,null,null);const ls=ec.exports,cs=F.extend({mixins:[Ge,Ue],data(){return{inactivityListeners:[],isInactivityListenerActive:!1}},beforeDestroy(){this.$removeInactivityListeners()},methods:{resetInactivityListenerTimer(t=()=>{},e=0,r=[]){this.isInactivityListenerActive&&(this.$clearTimeouts(),this.setInactivityListenerTimer(t,e,r))},setInactivityListenerTimer(t=()=>{},e=0,r=[]){t&&e&&this.$setTimeout(()=>{t(),r.length>0&&this.setInactivityListenerReminderTimers(t,r)},e*1e3)},setInactivityListenerReminderTimers(t=()=>{},e=[],r=0){const n=e[r];r<e.length?this.$setTimeout(()=>{t(),this.setInactivityListenerReminderTimers(t,e,r+1)},n*1e3):this.isInactivityListenerActive&&this.$removeInactivityListeners()},$registerInactivityListener({callback:t=()=>{},duration:e=0,reminders:r=[]}){this.isInactivityListenerActive=!0,this.resetInactivityListenerTimer(t,e,r);const n=()=>this.resetInactivityListenerTimer(t,e,r);this.$addEventListener("mousemove",n),this.inactivityListeners.push(n)},$removeInactivityListeners(){this.isInactivityListenerActive&&(this.isInactivityListenerActive=!1,this.inactivityListeners.forEach(t=>{this.$removeEventListener("mousemove",t)}),this.$clearTimeouts())}}}),us=Object.freeze(Object.defineProperty({__proto__:null,eventListeners:Ge,formField:Rt,inactivityListener:cs,selectFormField:wt,timeouts:Ue,toggleOpen:Ht},Symbol.toStringTag,{value:"Module"})),tc=F.extend({name:"EPopover",directives:{ClickOutside:tn},mixins:[Ht],props:{dark:{type:Boolean,default:!1},label:{type:String,default:"Click to open"},panelSide:{type:String,default:"center"},panelClasses:{type:[Object,String,Array],default:()=>({})}},computed:{panelThemeClasses(){return{"e-bg-gray-800":this.dark,"e-bg-white":!this.dark,"right-0 ":this.panelSide==="right","left-0":this.panelSide==="left"}}},methods:{closePopover(){this.isOpen=!1}}}),Cd="";var rc=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",e._b({directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closePopover,expression:"closePopover"}],staticClass:"e-popover__wrapper e-relative e-w-full"},"div",e.$attrs,!1),[e._t("trigger",function(){return[r("div",e._g(e._b({staticClass:"e-popover__trigger-button e-relative e-w-full e-rounded e-py-2 e-leading-5 e-cursor-pointer e-h-[40px] e-flex e-justify-center e-items-center",attrs:{role:"button"},on:{click:e.toggleOpen}},"div",e.$attrs,!1),e.$listeners),[e._t("trigger-button-content",function(){return[r("span",[e._v(" "+e._s(e.label)+" ")])]})],2)]},{toggle:e.toggleOpen,isOpen:e.isOpen}),e.isOpen?r("div",e._b({staticClass:"e-popover__menu-wrapper e-absolute e-bg-gray-800 e-z-[5] e-min-w-[160px] e-w-full e-min-h-12 e-max-h-72 e-overflow-auto e-text-sm e-rounded-md e-scrollbar-thin e-mt-1 e-scrollbar-thumb-rounded-full e-scrollbar-track-rounded-full e-scrollbar-thumb-gray-400 shadow-2xl focus:e-outline-none sm:e-text-sm",class:[e.panelThemeClasses,e.panelClasses]},"div",e.$attrs,!1),[e._t("panel",function(){return[e._t("default")]})],2):e._e()],2)},nc=[],ic=H(tc,rc,nc,!1,null,"59138e1e",null,null);const hn=ic.exports,sc=F.extend({name:"ECheckbox",components:{EIcon:We},props:{checked:{type:Boolean,default:!1}}}),bd="";var ac=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",e._g(e._b({staticClass:"e-select-checkbox e-box-border e-w-4 e-h-4 e-rounded e-flex e-items-center e-justify-center e-align-middle e-border-solid e-border-2",class:{"e-border-gray-500":!e.checked,"e-bg-[#1976d2] e-border-[#1976d2]":e.checked},staticStyle:{"border-radius":"2px"}},"div",e.$attrs,!1),e.$listeners),[e.checked?r("EIcon",{attrs:{icon:"far fa-check",color:"e-text-white",size:"xs"}}):e._e()],1)},oc=[],lc=H(sc,ac,oc,!1,null,"c5642bf0",null,null);const cc=lc.exports,uc=F.extend({name:"ESelect",components:{ECheckbox:cc,EIcon:We,EPopover:hn},directives:{ResizeObserver:Ve},mixins:[wt],props:{dark:{type:Boolean,default:!1},withSelectAll:{type:Boolean,default:!1},customSelectionLabel:{type:String,default:""},name:{type:String,default:"Items"},label:{type:String,default:"Select an option"},withCheckbox:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"Type to search..."},withSearchQueryVisible:{type:Boolean,default:!1}},data(){return{searchQuery:"",menuStyle:{}}},computed:{customLabel(){return this.multiple&&Array.isArray(this.value)&&this.value.length===0||!this.multiple&&(this.value===null||this.value===void 0)?this.label:this.multiple&&this.customSelectionLabel.length>0?this.customSelectionLabel:this.localLabel||this.label},filteredOptions(){if(!this.searchQuery)return this.options;const t=this.searchQuery.toLowerCase().trim();return this.options.filter(e=>e.label.toLowerCase().includes(t))},scrollbarClasses(){return{"e-scrollbar-track-gray-800 e-scrollbar-thumb-gray-500":this.dark,"e-scrollbar-track-white e-scrollbar-thumb-gray-400":!this.dark}},showSearchClearButton(){return(this.searchQuery.length>0||this.isAtLeastOneSelected)&&this.searchable&&!this.disabled}},methods:{handleTriggerClick(t,e){this.disabled||(e(t),this.$nextTick(()=>{const r=this.$refs.searchInput;r&&r.focus()}),this.withSearchQueryVisible&&(this.searchQuery=this.getOptionByValue(this.value).label||""))},handleMenuStyle(){const t=this.$refs.ESelectWrapper;this.menuStyle={maxWidth:`${t==null?void 0:t.clientWidth}px`,minWidth:"160px"}},clearSearch(){this.searchQuery="",this.$emit("input",this.multiple?[]:null);const t=this.$refs.searchInput;t&&t.focus()}}}),xd="";var dc=function(){var e=this,r=e._self._c;return r("EPopover",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.handleMenuStyle,expression:"handleMenuStyle"}],attrs:{dark:e.dark},scopedSlots:e._u([{key:"trigger",fn:function({isOpen:n,toggle:i}){return[e._t("activator",function(){return[r("div",{staticClass:"e-select__trigger-button e-relative e-w-full e-rounded e-border e-border-solid e-py-2 e-pl-3 e-leading-5 e-cursor-pointer e-h-[40px] e-flex e-items-center e-bg-gray-900",class:e.radioItemClasses,attrs:{id:`e-select-trigger-${Date.now()}`,"data-test-id":`select-trigger-${Date.now()}`,role:"button"},on:{click:o=>e.handleTriggerClick(o,i)}},[n&&e.searchable?r("div",{staticClass:"e-select__search-input-wrapper e-flex e-items-center e-gap-2 e-w-full e-mr-10"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.searchQuery,expression:"searchQuery"}],ref:"searchInput",staticClass:"e-select__search-input e-w-full e-h-6 e-bg-transparent placeholder:e-text-sm e-text-sm e-outline-none e-border-none",class:{"e-text-white placeholder:e-text-gray-400":e.dark,"e-text-gray-700 placeholder:e-text-gray-500":!e.dark},attrs:{placeholder:e.searchPlaceholder,type:"text"},domProps:{value:e.searchQuery},on:{click:function(o){o.stopPropagation()},input:function(o){o.target.composing||(e.searchQuery=o.target.value)}}})]):[e.multiple&&e.selectedOption.length===0||!e.selectedOption?e._t("label",function(){return[e.customLabel&&!e.searchable?r("span",{staticClass:"e-select-label e-text-sm"},[e._v(e._s(e.customLabel))]):r("span",{staticClass:"e-select-label e-text-sm e-text-gray-400"},[e._v(e._s(e.searchPlaceholder))])]}):e._t("selection",function(){return[r("span",{staticClass:"e-capitalize e-select__trigger-button-text e-truncate"},[e._v(" "+e._s(e.customLabel)+" ")])]})],e.showSearchClearButton?r("button",{staticClass:"e-select__clean-search-button e-flex e-bg-transparent e-z-[2] e-absolute e-right-10 e-cursor-pointer e-border-none e-items-center e-justify-center e-w-5 e-h-5",on:{click:function(o){return o.stopPropagation(),e.clearSearch.apply(null,arguments)}}},[r("EIcon",{attrs:{color:"e-text-gray-400 hover:e-text-[#1976d2]",icon:"far fa-xmark",size:"lg"}})],1):e._e(),e._t("pre-append-icon",function(){return[r("span",{staticClass:"e-select__trigger-button-icon e-absolute e-inset-y-0 e-right-0 e-flex e-items-center e-justify-end e-px-3 e-pr-4 e-bg-transparent e-border-transparent e-text-gray-400"},[r("EIcon",{attrs:{icon:n?"fas fa-sort-up e-mt-2.5":"fas fa-sort-down e-mb-1.5"}})],1)]})],2)]},{attrs:{class:e.radioItemClasses,isOpen:n},on:{click:i}})]}},{key:"panel",fn:function(){return[e.multiple&&e.withSelectAll?r("div",{staticClass:"e-select__menu-check-all-wrapper e-relative e-cursor-pointer e-select-none e-p-2",on:{click:e.toggleSelectAll}},[r("div",{staticClass:"e-select__menu-check-all e-flex e-justify-start e-items-center e-gap-2 e-p-1 e-w-full",class:{"e-text-[#1976d2] ":e.isAllSelected&&!e.dark,"e-text-[#61b0ff]":e.isAllSelected&&e.dark}},[r("ECheckbox",{attrs:{checked:e.isAllSelected}}),r("span",{staticClass:"e-capitalize e-select__menu-check-all-text e-text-sm e-font-medium"},[e._v(" All "+e._s(e.name||"")+" ")])],1)]):e._e(),e.multiple&&e.withSelectAll?r("hr",{staticClass:"e-border-0 e-h-px e-m-0",class:{"e-bg-gray-700":e.dark,"e-bg-gray-200":!e.dark}}):e._e(),e._l(e.filteredOptions,function(n,i){return r("div",{key:i,staticClass:"e-select__menu-item-wrapper e-relative e-select-none e-p-2",class:e.containerClasses(n),attrs:{id:`select-item-${n.value}`,"data-test-id":`select-item-${i}`},on:{click:function(o){return e.onItemClick(n.value)}}},[r("div",{staticClass:"e-select__menu-item e-flex e-justify-start e-items-center e-gap-2 e-p-1 e-w-i"},[e.withCheckbox||e.multiple?r("ECheckbox",{attrs:{checked:e.isSelected(n.value)}}):e._e(),e._t("item",function(){return[r("span",{staticClass:"e-select__menu-item-text e-block e-text-sm e-font-medium"},[e._v(" "+e._s(n.label)+" ")])]},{item:n,isSelected:e.isSelected(n.value)})],2)])}),e.filteredOptions.length===0?r("div",{staticClass:"e-select__no-values-box e-p-4 e-text-center e-text-gray-500"},[e._v(" No results found ")]):e._e()]},proxy:!0}],null,!0)})},hc=[],fc=H(uc,dc,hc,!1,null,null,null,null);const ds=fc.exports,pc=F.extend({name:"EGlobalSearch",components:{EIcon:We},mixins:[Ge],props:{dark:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},timezone:{type:String,default:"Europe/Dublin"},convertedDateFormat:{type:String,default:"YYYY-MM-DDTHH:mm:ss"},currentDateFormat:{type:String,default:"YYYY-MM-DDTHH:mm:ssZ"},isFixedPosition:{type:Boolean,default:!0},isHidden:{type:Boolean,default:!0},deep:{type:Boolean,default:!0}},data(){return{search:"",isSearching:!1}},computed:{inputClasses(){return{"e-bg-gray-900 e-text-white e-ring-gray-700 focus:e-ring-2 focus:e-ring-blue-500 e-placeholder-gray-500":this.dark,"e-bg-white e-text-[#000057] e-ring-gray-300 focus:e-ring-2 hover:e-ring-gray-400 focus:e-ring-blue-500 e-placeholder-gray-400":!this.dark}}},watch:{search(t){t?t.length>=3&&this.$emit("search-results",this.searchObjectsByQuery(this.items,t)):this.$emit("reset")}},mounted(){!this.isHidden&&this.search.length>0?this.isSearching=!0:(this.$addEventListener("keydown",this.onKeyHandler),this.$addEventListener("keyup",this.onKeyHandler))},methods:{onInput(t){this.search=t.target.value},searchObjectsByQuery(t,e){return t.reduce((r,n,i)=>{const o=this.findMatchesInObject(n,e,[]);return o.length>0&&r.push({index:i,matches:o}),r},[])},findMatchesInObject(t,e,r){return Object.entries(t).reduce((n,[i,o])=>{const s=[...r,i],c=this.matchesQuery(o,e)?[{path:s,value:o}]:[];let a=[];this.deep&&Array.isArray(o)&&(a=o.flatMap((d,f)=>this.findMatchesInObject(d,e,[...s,`${f}`])));const l=this.deep&&typeof o=="object"&&o!==null?this.findMatchesInObject(o,e,s):[];return[...n,...c,...a,...l]},[])},matchesQuery(t,e){return`${this.isValidDate(t)?this.formattedTimestamp(t):t}`.toLowerCase().indexOf(e.toLowerCase())!==-1},isValidDate(t){return ke(t,this.currentDateFormat,!0).isValid()},formattedTimestamp(t){return ke.tz(t,this.timezone).format(this.convertedDateFormat)},onKeyHandler(t){const e=t,r=e.ctrlKey&&e.type==="keydown",n=e.shiftKey&&e.type==="keydown",i=["f","F"].includes(e.key)&&e.type==="keydown",o=e.key==="Escape"&&e.type==="keydown";i&&r&&n&&(this.isSearching=!0,this.$nextTick(()=>{const s=this.$refs.searchField;s&&s.focus()})),o&&(this.isSearching=!1,this.search="")}}}),wd="";var mc=function(){var e=this,r=e._self._c;return r("div",{directives:[{name:"show",rawName:"v-show",value:!e.isFixedPosition||e.isSearching,expression:"!isFixedPosition || isSearching"}],staticClass:"global-search e-relative",class:{"global-search--fixed e-p-4 e-bg-white e-m-3":e.isFixedPosition}},[r("div",{staticClass:"e-relative"},[r("input",e._g({directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],ref:"searchField",class:["global-search__field e-shadow-sm e-ring-1 e-ring-inset e-relative e-block e-w-full e-h-full disabled:e-cursor-not-allowed disabled:e-opacity-75 focus:e-outline-none e-border-0 e-text-sm e-placeholder-gray-400 e-px-4 e-py-3 e-gap-x-1.5 e-rounded-md",e.inputClasses],attrs:{id:"global-search-input",placeholder:"Search",autocomplete:"off",type:"text"},domProps:{value:e.search},on:{input:function(n){n.target.composing||(e.search=n.target.value)}}},e.$listeners)),r("span",{staticClass:"e-absolute e-inset-y-0 e-end-0 e-flex e-items-center e-justify-center e-pointer-events-none e-px-2.5"},[r("EIcon",{attrs:{icon:"search",size:"Sm"}})],1)])])},gc=[],vc=H(pc,mc,gc,!1,null,null,null,null);const hs=vc.exports,_c=F.extend({name:"ETooltip",props:{text:{type:String,required:!0},position:{type:String,default:Oe.Top},color:{type:String,default:se.Default},dark:{type:Boolean,default:!1}},data:function(){return{isHovered:!1}},computed:{tooltipClasses(){const t=this.position,e=this.color,r={"e-bg-gray-800 e-text-white":!this.dark,"e-bg-slate-300 e-text-slate-800":this.dark};return{"tooltip e-w-max e-text-sm e-text-center e-px-2 e-py-1 e-absolute e-rounded-md e-shadow-md e-opacity-0 group-hover:e-opacity-100 e-transition-opacity e-duration-300":!0,"tooltip-left":t===Oe.Left,"tooltip-right":t===Oe.Right,"tooltip-top":t===Oe.Top,"tooltip-bottom":t===Oe.Bottom,"e-bg-orange-700 e-text-white":e===se.Warning,"e-bg-red-700 e-text-white":e===se.Error,"e-bg-green-900 e-text-white":e===se.Success,"e-bg-blue-700 e-text-white":e===se.Primary,"e-bg-sky-500 e-text-white":e===se.Info,"e-bg-brand-900 e-text-white":e===se.Brand,"e-bg-gray-200 e-text-gray-700":e===se.Gray,...r}},triangleClasses(){const t=this.position,e=this.color;return{"triangle e-absolute e-border-transparent":!0,"triangle-left":t===Oe.Left,"triangle-right":t===Oe.Right,"triangle-top":t===Oe.Top,"triangle-bottom":t===Oe.Bottom,"e-border-b-gray-800":e===se.Default,"e-border-b-orange-700":e===se.Warning,"e-border-b-red-700":e===se.Error,"e-border-b-green-900":e===se.Success,"e-border-b-blue-700":e===se.Primary,"e-border-b-sky-500":e===se.Info,"e-border-b-brand-900":e===se.Brand,"e-border-b-gray-900":e===se.Gray}}},methods:{toggleTooltip(){this.isHovered=!this.isHovered}}}),Sd="";var yc=function(){var e=this,r=e._self._c;return r("div",{staticClass:"tooltip-box e-w-max e-relative e-group",on:{mouseenter:e.toggleTooltip,mouseleave:e.toggleTooltip}},[e._t("default"),e.isHovered?r("div",{class:e.tooltipClasses},[r("span",{class:e.triangleClasses}),e._v(" "+e._s(e.text)+" ")]):e._e()],2)},Cc=[],bc=H(_c,yc,Cc,!1,null,"3ebb5ef2",null,null);const St=bc.exports,xc=F.extend({name:"EActionButton",components:{ETooltip:St,EIcon:We},props:{tooltipText:{type:String,default:null},tooltipColor:{type:String,default:"default"},tooltipPosition:{type:String,default:"top"},buttonClasses:{type:[String,Object,Array],default:null},icon:{type:String,default:null},iconSize:{type:String,default:K.Sm},iconColor:{type:String,default:se.Default},dark:{type:Boolean,default:!0}},computed:{withTooltip(){return!!this.tooltipText},buttonClassesContainsBg(){return this.buttonClasses?typeof this.buttonClasses=="string"&&this.buttonClasses.split("e-bg-").length>1||typeof this.buttonClasses=="object"&&Object.keys(this.buttonClasses).some(t=>t.split("e-bg-").length>1):!1},buttonStyle(){const t=this.dark?"e-bg-gray-900 e-text-white hover:e-bg-gray-700":"e-bg-white text-e-text-gray-900 hover:e-bg-gray-100";return this.buttonClassesContainsBg?this.buttonClasses:[this.buttonClasses,t]}}});var wc=function(){var e=this,r=e._self._c;return e.withTooltip?r("ETooltip",{attrs:{text:e.tooltipText,position:e.tooltipPosition,color:e.tooltipColor,dark:e.dark}},[r("button",e._g(e._b({staticClass:"e-action-button e-w-max e-px-3 e-py-2 e-flex e-border-none e-justify-center e-align-middle e-items-center e-cursor-pointer",class:e.buttonStyle},"button",e.$attrs,!1),e.$listeners),[r("EIcon",{attrs:{icon:e.icon,size:e.iconSize,color:e.iconColor}}),e._t("default")],2)]):r("button",e._g(e._b({staticClass:"e-action-button e-w-max e-px-3 e-py-2 e-flex e-border-none e-justify-center e-align-middle e-items-center e-cursor-pointer",class:e.buttonStyle},"button",e.$attrs,!1),e.$listeners),[r("EIcon",{attrs:{icon:e.icon,size:e.iconSize}}),e._t("default")],2)},Sc=[],Tc=H(xc,wc,Sc,!1,null,null,null,null);const ft=Tc.exports,kc=F.extend({name:"EZoomSlider",components:{EActionButton:ft},props:{dark:{type:Boolean,default:!0}}});var $c=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{staticClass:"e-zoom-slider e-flex e-flex-col e-p-5"},[r("EActionButton",{attrs:{"tooltip-text":"Zoom in","tooltip-position":"right",icon:"fas fa-plus",dark:e.dark,"icon-size":"Base","button-classes":"action-btn__first-vertical e-border-none e-rounded-none e-rounded-t-md e-shadow-xl","data-test-id":"zoomable-img-zoom-in"},on:{click:function(n){return e.$emit("zoom-in")}}}),r("EActionButton",{attrs:{"tooltip-text":"Zoom out","tooltip-position":"right",icon:"fas fa-minus",dark:e.dark,"icon-size":"Base","button-classes":"action-btn__last-vertical e-border-none e-rounded-none e-rounded-b-md","data-test-id":"zoomable-img-zoom-out"},on:{click:function(n){return e.$emit("zoom-out")}}})],1)},Ec=[],Mc=H(kc,$c,Ec,!1,null,null,null,null);const fn=Mc.exports,Lc=F.extend({name:"EFadeTransition",props:{duration:{type:Number,default:300}},computed:{durationClass(){return{100:"e-duration-100",200:"e-duration-200",300:"e-duration-300",400:"e-duration-400",500:"e-duration-500",600:"e-duration-600",700:"e-duration-700",800:"e-duration-800",900:"e-duration-900",1e3:"e-duration-1000"}[this.duration]}}});var Dc=function(){var e=this,r=e._self._c;return r("transition",{attrs:{"enter-active-class":`e-transition e-ease-out ${e.durationClass}`,"leave-active-class":`e-transition e-ease-in ${e.durationClass}`,"enter-class":"e-opacity-0","enter-to-class":"e-opacity-100","leave-class":"e-opacity-100","leave-to-class":"e-opacity-0"}},[e._t("default")],2)},Pc=[],Oc=H(Lc,Dc,Pc,!1,null,null,null,null);const Nt=Oc.exports,zc=F.extend({name:"EZoomableImg",components:{EZoomSlider:fn,EFadeTransition:Nt},directives:{ResizeObserver:Ve},mixins:[Ue,Ge],props:{src:{type:String,default:""},alt:{type:String,default:""},allowZoom:{type:Boolean,default:!0},imgProps:{type:Object,default:()=>({})},slider:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},hideContentOnBlur:{type:Boolean,default:!0},initialParams:{type:Object,default:()=>({})},embedded:{type:Boolean,default:!1},overlayStyle:{type:Object,default:()=>({})},foregroundStyle:{type:Object,default:()=>({})},pan:{type:Boolean,default:!0},slotTransition:{type:Boolean,default:!0},height:{type:[String,Number],default:void 0},isCalendarActive:{type:Boolean,default:!1},blurBackground:{type:Boolean,default:!1},cover:{type:Boolean,default:!1},isWidget:{type:Boolean,default:!1},isAnnotationActive:{type:Boolean,default:!1},isMobile:{type:Boolean,default:!1},placeholderImage:{type:String,default:""},showMiniature:{type:Boolean,default:!1},miniatureWidth:{type:Number,default:150}},data(){const t={x:0,y:0};return{image:null,frame:null,imageLoaded:!1,zoomLevel:1,previousZoomLevel:1,imageMouse:t,zoomOrigin:t,frameMouse:t,frameMousePanStart:t,frameMousePreviousPan:t,translation:t,isPanning:!1,isPinching:!1,zoomStarted:!1,firstLoad:!0,isSliderActive:!1,imgStyle:{},contentStyle:{},isFocused:!0,forceHideContent:!1,imageAspectRatio:1,frameAspectRatio:1,wrapperExtraStyle:{},preventDefaultScroll:!0,mouseLeft:!1,pointers:{},pinchDistance:0,lastTapTime:0,minZoomLevel:1,maxZoomLevel:20,backgroundSnapshotSrc:null,miniatureOverlayStyle:{}}},computed:{frameStyle(){return this.height?{height:`${this.height}px`}:{}},wrapperStyle(){if(!this.imageLoaded)return{display:"none"};let t,e;return this.isPanning&&!this.isAnnotationActive?(t=this.frameMouse.x-this.frameMousePanStart.x+this.frameMousePreviousPan.x,e=this.frameMouse.y-this.frameMousePanStart.y+this.frameMousePreviousPan.y):(t=this.frameMousePreviousPan.x,e=this.frameMousePreviousPan.y),{transform:Math.abs(t)<.5&&Math.abs(e)<.5?"none":`translate(${t}px,${e}px)`}},imageCenter(){var e;const t=(e=this.image)==null?void 0:e.getBoundingClientRect();return{x:((t==null?void 0:t.width)||0)/2,y:((t==null?void 0:t.height)||0)/2}},sliderModel:{get(){return this.zoomLevel*100},set(t){this.previousZoomLevel=this.zoomLevel,this.zoomLevel=t/100,this.updateImageStyle(),this.savePreviousPan()}},showContent(){return this.hideContentOnBlur?this.forceHideContent?!1:this.isFocused&&this.touches<2:!0},miniatureContainerStyle(){if(!this.image)return{};const t=this.image.naturalWidth/this.image.naturalHeight,e=this.miniatureWidth/t;return{width:`${this.miniatureWidth}px`,height:`${e}px`}},miniatureOverlayComputedStyle(){return{...this.miniatureOverlayStyle,...this.miniatureOverlayBaseStyle}},miniatureOverlayBaseStyle(){return{boxShadow:`0 0 0 ${this.miniatureWidth}px #0006`}},currentState(){var t,e;return{image:this.image,zoomLevel:this.zoomLevel,translation:this.translation,previousZoomLevel:this.previousZoomLevel,imageMouse:this.imageMouse,zoomOrigin:this.zoomOrigin,frameMouse:this.frameMouse,frameMousePanStart:this.frameMousePanStart,frameMousePreviousPan:this.frameMousePreviousPan,isPanning:this.isPanning,zoomStarted:this.zoomStarted,firstLoad:this.firstLoad,isSliderActive:this.isSliderActive,imgStyle:this.imgStyle,contentStyle:this.contentStyle,isFocused:this.isFocused,forceHideContent:this.forceHideContent,imageAspectRatio:this.imageAspectRatio,frameAspectRatio:this.frameAspectRatio,wrapperExtraStyle:this.wrapperExtraStyle,offsetWidth:(t=this.image)==null?void 0:t.offsetWidth,offsetHeight:(e=this.image)==null?void 0:e.offsetHeight}}},watch:{isCalendarActive(){this.$setTimeout(this.onResize,100)},initialParams:{immediate:!0,handler(t){if(typeof t=="object")for(let e in t)this[e]=t[e]}},image:{immediate:!0,deep:!0,handler(){var t;(t=this.image)!=null&&t.offsetWidth&&this.emitChange()}},wrapperStyle(){this.$nextTick(this.updateMiniatureOverlayStyle)},imageStyle(){this.$nextTick(this.updateMiniatureOverlayStyle)}},mounted(){this.$addEventListener("orientationchange",this.handleOrientationChange),this.$root.$on("resize-snapshot-player",()=>{this.$setTimeout(this.setAspectRatio,200)})},methods:{onResize(){this.updateContentStyle(),this.$setTimeout(this.setAspectRatio,500)},handleOrientationChange(){this.$setTimeout(this.setAspectRatio,1e3)},setAspectRatio(){var r,n;this.frame=this.$refs.frame,this.image=this.$refs.image;const t=(r=this.frame)==null?void 0:r.getBoundingClientRect(),e=(n=this.image)==null?void 0:n.getBoundingClientRect();if(this.$setTimeout(this.emitChange,50),!t||this.isMobile&&!this.isWidget&&(!e||(e==null?void 0:e.width)<=1||(e==null?void 0:e.height)<=1)){this.$setTimeout(this.setAspectRatio,50);return}this.frameAspectRatio=t.width/t.height,this.imageAspectRatio=e.width/e.height},updateImageStyle(){this.translation={x:this.zoomOrigin.x*(this.zoomLevel-this.previousZoomLevel)+this.translation.x,y:this.zoomOrigin.y*(this.zoomLevel-this.previousZoomLevel)+this.translation.y},this.imgStyle={...this.imgStyle,transform:`translate(${-this.translation.x}px, ${-this.translation.y}px) scale(${this.zoomLevel})`},this.emitChange()},updateMiniatureOverlayStyle(){if(!this.showMiniature||!this.image||!this.frame||!this.$refs.miniatureImage||this.zoomLevel===1){this.miniatureOverlayStyle={};return}const t=this.image.getBoundingClientRect(),e=this.frame.getBoundingClientRect(),r=(e.left-t.left)/t.width*100,n=(e.top-t.top)/t.height*100,i=e.width/t.width*100,o=e.height/t.height*100;this.miniatureOverlayStyle={left:`${r}%`,top:`${n}%`,width:`${i}%`,height:`${o}%`}},onImageLoaded(t){var n,i;if(this.imageLoaded=!0,this.wrapperExtraStyle={...this.wrapperExtraStyle,alignContent:"flex-start !important"},this.$setTimeout(()=>{this.wrapperExtraStyle={justifyContent:"center",alignContent:"center !important"}}),this.blurBackground&&(this.backgroundSnapshotSrc=this.getSnapshotSrc()),!this.firstLoad)return;this.updateContentStyle(),this.imageMouse=this.imageCenter,this.zoomOrigin=this.imageCenter;const e=(n=this.image)==null?void 0:n.getBoundingClientRect(),r=(i=this.frame)==null?void 0:i.getBoundingClientRect();!e||!r||(this.isMobile&&!this.isWidget?this.setAspectRatio():this.$nextTick(()=>{this.setAspectRatio(),this.firstLoad=!1}),this.updateImageStyle(),this.$emit("load",t))},onError(t){this.$emit("error",t)},onMouseEnter(){this.mouseLeft=!1,this.isFocused=!0},onMouseLeave(){this.isSliderActive||(this.isFocused=!1),this.mouseLeft=!0;const t={which:1,preventDefault:()=>{}};this.onMouseUp(t)},onMouseMove(t){var e;if(!(this.disabled||!this.imageLoaded||this.mouseLeft)&&this.frame){const r=this.frame.getBoundingClientRect(),n=(e=this.image)==null?void 0:e.getBoundingClientRect();this.frameMouse={x:(t==null?void 0:t.clientX)-r.left,y:(t==null?void 0:t.clientY)-r.top},this.imageMouse={x:((t==null?void 0:t.clientX)-(n==null?void 0:n.left))/this.zoomLevel,y:((t==null?void 0:t.clientY)-(n==null?void 0:n.top))/this.zoomLevel},this.zoomStarted&&(this.zoomStarted=!1),this.$nextTick(this.emitChange)}},onMousedown(t){if(!(!this.pan||this.disabled||!this.imageLoaded||(t==null?void 0:t.which)!==1||this.isSliderActive)){if(this.isAnnotationActive){this.frameMousePanStart={x:this.frameMouse.x,y:this.frameMouse.y},this.isPanning=!0,this.$nextTick(this.emitChange);return}t.preventDefault(),this.frameMousePanStart=this.frameMouse,this.isPanning=!0}},onMouseUp(t){if(!(!this.pan||this.disabled||!this.imageLoaded||!this.isPanning||(t==null?void 0:t.which)!==1||this.isSliderActive)){if(this.isAnnotationActive){this.isPanning=!1,this.$nextTick(this.emitChange);return}t.preventDefault(),this.savePreviousPan({x:this.frameMousePreviousPan.x+this.frameMouse.x-this.frameMousePanStart.x,y:this.frameMousePreviousPan.y+this.frameMouse.y-this.frameMousePanStart.y}),this.isPanning=!1,this.isPinching=!1,this.$nextTick(this.emitChange)}},onMouseWheel(t){this.disabled||!this.imageLoaded||!this.allowZoom||(this.zoom(t.deltaY),this.preventDefaultScroll&&t.preventDefault())},updateZoomLevel(t){let e=1;this.isMobile?e=this.zoomLevel*t:t<0?e=this.zoomLevel*1.2:this.zoomLevel>=1.25&&(e=this.zoomLevel*.8),e<this.minZoomLevel?this.zoomLevel=this.minZoomLevel:e>this.maxZoomLevel?this.zoomLevel=this.maxZoomLevel:this.zoomLevel=e},zoom(t){this.isPanning=!1,this.previousZoomLevel=this.zoomLevel,this.updateZoomLevel(t),this.preventDefaultScroll=this.previousZoomLevel!==this.zoomLevel,this.zoomStarted||(this.zoomOrigin=this.imageMouse,this.zoomStarted=!0),this.updateImageStyle(),this.$nextTick(()=>{this.savePreviousPan(),this.emitChange()})},getBounds(){var a,l;const t=(a=this.frame)==null?void 0:a.getBoundingClientRect(),e=(l=this.image)==null?void 0:l.getBoundingClientRect(),r=t.width/this.imageAspectRatio,n=t.height*this.imageAspectRatio;let{top:i,right:o,bottom:s,left:c}=t;return e.width<t.width?(c=t.left+(t.width-n)/2,o=c+n):e.height<t.height&&(i=t.top+(t.height-r)/2,s=i+r),{top:i,right:o,bottom:s,left:c}},savePreviousPan({x:t,y:e}={}){var r;if(this.image){const n=(r=this.image)==null?void 0:r.getBoundingClientRect(),i=this.getBounds(),[o,s,c,a]=[n.right-i.right,i.top-n.top,n.bottom-i.bottom,i.left-n.left].map(l=>l<0?l:0);this.frameMousePreviousPan={x:(t||this.frameMousePreviousPan.x)+a-o,y:(e||this.frameMousePreviousPan.y)+s-c}}},onSliderMouseDown(){var r,n;const t=(r=this.frame)==null?void 0:r.getBoundingClientRect(),e=(n=this.image)==null?void 0:n.getBoundingClientRect();this.zoomOrigin={x:((t==null?void 0:t.left)+(t==null?void 0:t.width)/2-(e==null?void 0:e.left))/this.zoomLevel,y:((t==null?void 0:t.top)+(t==null?void 0:t.height)/2-(e==null?void 0:e.top))/this.zoomLevel},this.isSliderActive=!0},onSliderMouseUp(){this.isSliderActive=!1},updateContentStyle(){var t,e,r;this.contentStyle={maxWidth:`${window.innerWidth-(((r=(e=(t=this.$refs)==null?void 0:t.frame)==null?void 0:e.getBoundingClientRect())==null?void 0:r.left)||0)}px`}},emitChange(){this.$emit("change",this.currentState)},getPointersMidPoint(t,e){return{x:t.clientX+(e.clientX-t.clientX)/2,y:t.clientY+(e.clientY-t.clientY)/2}},getPointersDistance(t,e){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)},updatePointerEvent(t){this.pointers[t.pointerId]=t},clearPointerEvent(t){this.$delete(this.pointers,t.pointerId)},updatePinchZoomOrigin(){const t=Object.values(this.pointers);if(t.length!==2)return;const e=this.getPointersMidPoint(...t);this.zoomOrigin={x:e.x/this.zoomLevel,y:e.y/this.zoomLevel}},updatePinchDistance(){const t=Object.values(this.pointers);t.length===2&&(this.pinchDistance=this.getPointersDistance(...t))},onPointerDown(t){if(!(!this.isMobile||this.foregroundStyle.zIndex==2)){if(this.updatePointerEvent(t),this.isPinching=Object.values(this.pointers).length===2,this.isPinching){this.isPanning=!1,this.updatePinchZoomOrigin(),this.updatePinchDistance();return}this.onMouseMove(t),this.onMousedown(t)}},onPointerMove(t){if(!(!this.isMobile||this.foregroundStyle.zIndex==2)){if(this.updatePointerEvent(t),this.isPinching){const e=this.pinchDistance;this.updatePinchDistance();const r=this.pinchDistance/e;r%1>.008&&this.zoom(r);return}this.onMouseMove(t)}},onPointerUp(t){if(!this.isMobile||this.foregroundStyle.zIndex==2)return;this.clearPointerEvent(t),this.onMouseUp(t);const e=new Date().getTime(),r=e-this.lastTapTime;r>100&&r<200&&this.zoom(this.zoomLevel>1?0:3),this.lastTapTime=e},getSnapshotSrc(){const t=this.$refs.image;return t==null?void 0:t.src}}}),Td="";var Bc=function(){var n;var e=this,r=e._self._c;return r("div",e._b({directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.onResize,expression:"onResize"}],ref:"frame",staticClass:"zoomable-img e-flex e-justify-center e-items-center e-relative",class:{"zoomable-img--loading":!e.imageLoaded,"zoomable-img--zoomed":e.zoomLevel>1,"zoomable-img--panning":e.isPanning,"zoomable-img--disabled":e.disabled,"zoomable-img--portrait-frame":e.frameAspectRatio<e.imageAspectRatio,"zoomable-img--landscape-frame":e.frameAspectRatio>=e.imageAspectRatio,"zoomable-img--embedded":e.embedded,"zoomable-img--cover":e.cover},style:e.frameStyle,attrs:{"data-test-id":"zoomable-img-frame"},on:{wheel:e.onMouseWheel,mouseup:e.onMouseUp,mousedown:e.onMousedown,mousemove:e.onMouseMove,mouseenter:e.onMouseEnter,mouseleave:e.onMouseLeave,pointerdown:e.onPointerDown,pointermove:e.onPointerMove,pointerup:e.onPointerUp,pointercancel:e.onPointerUp,pointerout:e.onPointerUp,pointerleave:e.onPointerUp}},"div",e.$attrs,!1),[r("div",{staticClass:"zoomable-img__wrapper e-flex e-justify-center e-items-center",style:{...e.wrapperStyle,...e.wrapperExtraStyle},attrs:{"data-test-id":"zoomable-img-wrapper"}},[e.blurBackground&&e.imageLoaded&&e.backgroundSnapshotSrc?r("img",{class:e.isMobile?"zoomable-img__img-background-mobile":"zoomable-img__img-background",style:e.imgStyle,attrs:{src:e.backgroundSnapshotSrc,alt:e.alt}}):e._e(),r("img",e._g(e._b({directives:[{name:"show",rawName:"v-show",value:e.imageLoaded||!!e.placeholderImage,expression:"imageLoaded || !!placeholderImage"}],ref:"image",staticClass:"zoomable-img__img e-absolute",style:e.imgStyle,attrs:{src:(n=e.src)!=null?n:e.placeholderImage,alt:e.alt,crossorigin:"anonymous","data-test-id":"zoomable-img-image"},on:{load:e.onImageLoaded,error:e.onError}},"img",e.$props.imgProps,!1),e.$listeners))]),r("div",{staticClass:"zoomable-img__wrapper zoomable-img__wrapper--overlay e-flex e-justify-center e-items-center",style:{...e.wrapperStyle,...e.wrapperExtraStyle,...e.overlayStyle}},[r("div",{staticClass:"zoomable-img__img e-relative",style:{width:`${e.image?e.image.offsetWidth:0}px`,height:`${e.image?e.image.offsetHeight:0}px`,...e.imgStyle}},[e._t("imageOverlay",null,{state:e.currentState})],2)]),r("div",{ref:"foreground",staticClass:"zoomable-img__content e-flex e-justify-center e-items-center e-p-0",class:{"e-h-full":!e.embedded,"e-w-full":!e.embedded},style:{...e.contentStyle,...e.foregroundStyle},attrs:{id:"img-foreground","data-test-id":"zoomable-img-foreground"}},[e.imageLoaded?e._e():e._t("placeholder",null,{dataTestId:"zoomable-img-placeholder"}),e.showContent&&e.slotTransition?r("EFadeTransition",[e.showContent?e._t("default",null,{dataTestId:"zoomable-img-content"}):e._e()],2):e.showContent?e._t("default",null,{dataTestId:"zoomable-img-content"}):e._e(),r("EFadeTransition",[e.showContent&&e.slider&&e.allowZoom?r("div",{staticClass:"zoomable-img__slider-container",attrs:{"data-test-id":"zoomable-img-zoom-slider"}},[e._t("extraWidgets"),r("EZoomSlider",{attrs:{vertical:""},on:{mouseup:e.onSliderMouseUp,mousedown:e.onSliderMouseDown,"zoom-in":function(i){return e.zoom(-1)},"zoom-out":function(i){return e.zoom(1)}},model:{value:e.sliderModel,callback:function(i){e.sliderModel=i},expression:"sliderModel"}})],2):e._e()]),r("EFadeTransition",[e.showMiniature&&e.imageLoaded&&e.zoomLevel>1?r("div",{staticClass:"zoomable-img__miniature-container e-shadow",style:e.miniatureContainerStyle},[r("img",{ref:"miniatureImage",staticClass:"zoomable-img__miniature",attrs:{src:e.src,alt:e.alt}}),r("div",{staticClass:"zoomable-img__miniature-overlay",style:e.miniatureOverlayComputedStyle})]):e._e()])],2)])},Ic=[],Fc=H(zc,Bc,Ic,!1,null,null,null,null);const pn=Fc.exports,Ac=F.extend({name:"EImagePlayer",components:{EZoomableImg:pn},directives:{ResizeObserver:Ve},mixins:[Ue,Ge],model:{prop:"frameIndex",event:"update-frame-index"},props:{frames:{type:Array,required:!0},timePerFrame:{type:Number,default:500},isPlaying:{type:Boolean,default:!1},frameIndex:{type:Number,default:0},height:{type:[String,Number],default:0},initialQuality:{type:[String,Number],default:"auto"},preload:{type:Boolean,default:!0},preloadSize:{type:Number,default:10},resetIndexOnFramesChange:{type:Boolean,default:!1},preloadWhilePlaying:{type:Boolean,default:!0},withControls:{type:Boolean,default:!0},playOnClick:{type:Boolean,default:!0},disablePlayPauseAnimation:{type:Boolean,default:!1},disablePlayButton:{type:Boolean,default:!1},isLive:{type:Boolean,default:!1},selectedSnapshotQuality:{type:[String,Number],default:"auto"},placeholderImage:{type:String,default:""},isMobile:{type:Boolean,default:!1},isZoomable:{type:Boolean,default:!0},isAnnotationActive:{type:Boolean,default:!1},aspectRatio:{type:Number,default:null},preloadingQueueId:{type:Number,default:0}},data(){return{src:this.placeholderImage,imageLoaded:!1,playing:!1,playerStyle:{},image:null,previousSrc:"",resolveImageLoadingPromise:()=>({}),preloadedFrames:[],preloadingFramesImgs:[],frameError:!1,animationId:-1,imgStyle:{},previousFrameIndex:0,isFullscreen:!1,mouseDownTime:0,playPauseAnimation:!1,latestValidSnapshotTimestamp:"",progressBar:null,isDraggingCursor:!1,hovered:!1,mousePosition:{x:0,y:0},screenHeight:screen.height}},computed:{imgProps(){return{id:"zoomable-img__img",ref:"image",crossorigin:"anonymous",class:"zoomable-img__img e-absolute e-w-full e-h-full e-object-contain e-z-10 d-block",dataTestId:"zoomable-img-image"}},playerDimensions(){return{width:"100%",height:this.height}},isLastFrame(){return this.frameIndex===this.frames.length-1},altText(){var t,e;return`${((t=this.frames[this.frameIndex])==null?void 0:t.label)||""} ${((e=this.frames[this.frameIndex])==null?void 0:e.timestamp)||""}`},playedPercentage(){return this.isLastFrame?100:Math.abs(this.frameIndex/this.frames.length*100)},mouseToWidthRatio(){var t,e,r;return this.mousePosition.x/((r=(e=(t=this.progressBar)==null?void 0:t.getBoundingClientRect())==null?void 0:e.width)!=null?r:1)},hoverBarStyle(){return{width:`${100*this.mouseToWidthRatio}%`}},hoveredFrameIndex(){return Math.round(this.mouseToWidthRatio*(this.frames.length-1))},progressStyle(){return{width:`${100*((this.isDraggingCursor?this.hoveredFrameIndex:this.frameIndex)/(this.frames.length-1))}%`}},preloadedChunks(){const t=[...this.preloadedFrames];return t.sort((e,r)=>e>r?1:-1),t.reduce((e,r)=>{if(!e.length)return[[r,r]];const[n,i]=e.slice(-1)[0]||[0,0];return r-i>1?[...e,[r,r]]:[...e.slice(0,-1),[n,r]]},[])}},watch:{frames:{handler(){var t;this.src=((t=this.frames[this.frameIndex])==null?void 0:t.src)||"",this.resetIndexOnFramesChange&&this.$emit("update-frame-index",0),this.imageLoaded=!0,this.preloadedFrames=[],this.flushPreloadingQueue(),this.$setTimeout(async()=>{this.updateRefs(),await this.loadTargetFrame(),this.handleBuffering()})},immediate:!0,deep:!0},isLastFrame(t){t&&this.$emit("frames-ended")},frameIndex:{immediate:!0,async handler(){this.frameIndex&&this.frameIndex===this.previousFrameIndex||(Number.isNaN(this.frameIndex)&&this.$emit("update-frame-index",0),this.frameIndex===0&&(this.previousFrameIndex=this.frameIndex),this.isLastFrame&&!this.isLive&&(this.playing=!1),this.playing||(this.cancelDelay(),await this.loadTargetFrame(),this.handleBuffering()))}},playing:{immediate:!0,async handler(t){t?this.play():this.pause(),this.animatePlayPauseOverlay()}},preloadedFrames:{handler(t,e){this.$emit("preloaded-frames-change",t)}},isPlaying:{immediate:!0,async handler(){this.playing=this.isPlaying}},selectedSnapshotQuality(){var t;this.src=(t=this.getFrameSrc(this.frames[this.frameIndex]))!=null?t:this.frames[this.frameIndex].src},isLive:{immediate:!0,handler(t){var e;t||(this.src=(e=this.frames[this.frameIndex])==null?void 0:e.src)}},imageLoaded(t){this.$emit("loading",!t)}},mounted(){this.$setTimeout(()=>{this.initializeFullscreenListeners(),this.progressBar=this.$refs.progressBar,this.$addEventListener("keydown",this.handleKeyDown)})},beforeDestroy(){this.cancelDelay(),this.flushPreloadingQueue(),this.removeFullscreenListeners()},methods:{getProgressBarMousePosition(t){var r;if(!this.progressBar)return{x:0,y:0};const e=(r=this.progressBar)==null?void 0:r.getBoundingClientRect();return{x:t.clientX-e.x,y:t.clientY-e.y}},onProgressBarMouseEnter(){this.hovered=!0},onProgressBarMouseMove(t){this.mousePosition=this.getProgressBarMousePosition(t)},onProgressBarMouseLeave(){this.hovered=!1,this.isDraggingCursor=!1},onProgressBarClick(){this.$emit("update-frame-index",this.hoveredFrameIndex),this.$emit("seek",this.hoveredFrameIndex)},getProgressBarChunkStyle(t,e){const[r,n]=[100*t/(this.frames.length-1),100*e/(this.frames.length-1)];return{left:`${r}%`,width:`${n-r}%`}},animatePlayPauseOverlay(){this.disablePlayPauseAnimation||(this.playPauseAnimation=!0,this.$setTimeout(()=>this.playPauseAnimation=!1,500))},isImageClick(t){const e=t==null?void 0:t.target;return e?e&&(e.id==="img-foreground"||typeof e.className=="string"&&e.className.indexOf("zoomable-img__img")!==-1):!1},onFrameMouseDown(t){!this.isImageClick(t)||!this.playOnClick||(this.mouseDownTime=new Date().getTime())},onFrameMouseUp(t){this.isLastFrame||this.disablePlayButton||!this.playOnClick||this.isAnnotationActive||!this.isImageClick(t)||new Date().getTime()-this.mouseDownTime>200||(this.playing=!this.playing)},removeFullscreenListeners(){const t=document;t.fullscreenEnabled||t.webkitFullscreenEnabled||t.mozFullScreenEnabled||t.msFullscreenEnabled?(t.removeEventListener("fullscreenchange",this.handleFullscreenChange),t.removeEventListener("webkitfullscreenchange",this.handleFullscreenChange),t.removeEventListener("mozfullscreenchange",this.handleFullscreenChange),t.removeEventListener("MSFullscreenChange",this.handleFullscreenChange)):console.log("Fullscreen API is not supported in this browser.")},initializeFullscreenListeners(){const t=document;t.fullscreenEnabled||t.webkitFullscreenEnabled||t.mozFullScreenEnabled||t.msFullscreenEnabled?(t.addEventListener("fullscreenchange",this.handleFullscreenChange),t.addEventListener("webkitfullscreenchange",this.handleFullscreenChange),t.addEventListener("mozfullscreenchange",this.handleFullscreenChange),t.addEventListener("MSFullscreenChange",this.handleFullscreenChange)):console.log("Fullscreen API is not supported in this browser.")},handleFullscreenChange(){const t=document;this.isFullscreen=!!t.fullscreenElement||!!t.mozFullScreenElement||!!t.webkitFullscreenElement||!!t.msFullscreenElement||window.innerWidth==screen.width&&window.innerHeight==screen.height},closeFullscreenMode(){document.fullscreenElement&&(Yr().then(()=>{this.isFullscreen=!1}),this.isFullscreen=!1)},openFullscreenMode(){const t=document.querySelector("#imagePlayer");t&&(Zr(t).then(()=>{this.isFullscreen=!0}),this.isFullscreen=!0)},toggleFullscreenMode(){this.isFullscreen?this.closeFullscreenMode():this.openFullscreenMode()},updateRefs(){var t,e,r;this.image=(r=(e=(t=this.$refs)==null?void 0:t.zoomableImage)==null?void 0:e.$refs)==null?void 0:r.image},incrementCurrentFrameIndex(){const t=this.frameIndex+1;this.frames[t]&&this.$emit("update-frame-index",t)},getFrameSrc(t){if(t)return t.srcSet?t.srcSet[this.selectedSnapshotQuality]:t.src},loadTargetFrame(){if(!(this.frameIndex&&this.frameIndex===this.previousFrameIndex))return new Promise(t=>{this.updateRefs(),this.previousSrc=this.src,this.previousFrameIndex=this.frameIndex,this.resolveImageLoadingPromise=t,this.src=this.getFrameSrc(this.frames[this.frameIndex])})},async handleBuffering(){this.preload&&await this.buffer()},async buffer(){let t=this.frameIndex+this.preloadSize;this.preloadSize===1/0&&(t=this.frames.length-1),await this.preloadFrames({start:this.frameIndex,end:t})},async preloadFrames({start:t,end:e}){const[r,n]=[Math.min(this.frames.length-1,t),Math.min(this.frames.length-1,e)],i=new Array(n-r+1).fill(0).map((s,c)=>s+r+c),o=this.preloadingQueueId;for(const s of i){if(o!==this.preloadingQueueId||this.playing&&!this.preloadWhilePlaying)return;this.preloadedFrames.includes(s)||await new Promise(a=>{const l=new Image;l.onload=()=>{this.preloadedFrames=[...this.preloadedFrames,s],a()},l.onerror=()=>{a()},this.preloadingFramesImgs=[...this.preloadingFramesImgs,l];const d=this.getFrameSrc(this.frames[s]);s||a(),l.src=d})}},async delay(){return this.frameError?(this.frameError=!1,Promise.resolve()):new Promise(t=>{const e=performance.now(),r=n=>{n-e<this.timePerFrame?this.animationId=window.requestAnimationFrame(r):t()};this.animationId=window.requestAnimationFrame(r)})},cancelDelay(){window.cancelAnimationFrame(this.animationId)},async play(){var r,n;const t=performance.now();if(this.isLastFrame&&!this.isLive){this.$emit("update-frame-index",0);return}this.$emit("update-playback",!0),this.playing=!0,this.cancelDelay(),this.incrementCurrentFrameIndex(),await this.$nextTick(),await this.loadTargetFrame(),this.handleBuffering(),await this.delay(),this.playing&&this.play();const e=performance.now();this.$emit("performance-intervals-changed",{id:(r=this.frames[this.frameIndex])==null?void 0:r.timestamp,frame:(n=this.frames[this.frameIndex])==null?void 0:n.label,duration:e-t})},flushPreloadingQueue(){this.$emit("cancel-previous-preloading"),this.preloadingFramesImgs.forEach(t=>{t.src=""}),this.preloadingFramesImgs=[]},async pause(){this.playing=!1,this.imageLoaded=!0,this.src=this.previousSrc,this.cancelDelay(),this.handleBuffering(),this.$emit("update-playback",!1)},onLoad(){var e,r,n,i;this.$emit("on-image-load",this.image),this.$emit("snapshot-changed",{data:(e=this.frames[this.frameIndex])==null?void 0:e.src,createdAt:(r=this.frames[this.frameIndex])==null?void 0:r.timestamp});const t=(i=(n=this.frames)==null?void 0:n[this.frameIndex])==null?void 0:i.timestamp;t&&this.$emit("timestamp-change",t),this.imageLoaded=!0,this.previousSrc=this.src,this.resolveImageLoadingPromise()},onError(t){if(this.frameIndex>1)return this.$emit("update-frame-index",this.frameIndex-1);this.frameError=!0,this.src=this.previousSrc,this.resolveImageLoadingPromise(),this.$emit("error",t)},onChange(t){this.$emit("change",t)},onBeforeUpdate(t){this.$emit("hook:beforeUpdate",t)},onBeforeDestroy(t){this.$emit("hook:beforeDestroy",t)},togglePlay(){this.playing=!this.playing},handleKeyDown(t){var r;const e=(r=document.activeElement)==null?void 0:r.tagName.toLowerCase();if(!(e==="input"||this.isAnnotationActive))switch(t.key.toLowerCase()){case" ":if(e==="button")return;this.disablePlayButton||this.togglePlay();break;case"escape":t.preventDefault(),this.closeFullscreenMode(),this.isFullscreen=!1;break}}}}),kd="";var Rc=function(){var n,i;var e=this,r=e._self._c;return r("div",{staticClass:"e-image-player player e-h-full e-w-full",style:e.playerDimensions,attrs:{id:"imagePlayer"}},[r("div",{staticClass:"player__frames player-container",style:e.playerDimensions,attrs:{id:"img-container"},on:{pointerdown:e.onFrameMouseDown,pointerup:e.onFrameMouseUp}},[r("div",{staticClass:"e-h-full e-w-full e-shrink-0 e-relative"},[r("img",{staticClass:"e-absolute e-block e-w-full e-h-full background-fade",attrs:{src:e.src||((n=e.frames[e.frameIndex])==null?void 0:n.src)||"",alt:"background-image"}}),r("EZoomableImg",e._g(e._b({directives:[{name:"show",rawName:"v-show",value:e.imageLoaded&&e.src||e.placeholderImage,expression:"(imageLoaded && src) || placeholderImage"}],ref:"zoomableImage",attrs:{"img-props":{imgProps:e.imgProps},"overlay-style":{zIndex:1},src:e.src||((i=e.frames[e.frameIndex])==null?void 0:i.src)||e.placeholderImage||"",alt:e.altText,"hide-content-on-blur":!1,height:e.height.split("px")[0],"placeholder-image":e.placeholderImage,slider:!1,"is-mobile":e.isMobile,disabled:!e.isZoomable,"is-annotation-active":e.isAnnotationActive,"blur-background":""},on:{load:e.onLoad,error:e.onError,change:e.onChange,"hook:beforeUpdate":e.onBeforeUpdate,"hook:beforeDestroy":e.onBeforeDestroy},scopedSlots:e._u([{key:"imageOverlay",fn:function(){return[e._t("default"),e._t("imageOverlay",null,{image:e.image})]},proxy:!0}],null,!0)},"EZoomableImg",e.$attrs,!1),e.$listeners),[e._t("player-container-overlay")],2),e.playPauseAnimation?r("div",{staticClass:"image-player-overlay e-flex e-items-center e-justify-center"},[r("div",{staticClass:"image-player-overlay__wrapper"},[e.playing?r("svg",{attrs:{height:"100%",viewBox:"-1 0 36 36",width:"100%"}},[r("path",{attrs:{d:"M 12,26 18.5,22 18.5,14 12,10 z M 18.5,22 25,18 25,18 18.5,14 z"}})]):r("svg",{attrs:{height:"100%",viewBox:"0.5 0 36 36",width:"100%"}},[r("path",{attrs:{d:"M 12,26 16,26 16,10 12,10 z M 21,26 25,26 25,10 21,10 z"}})])])]):e._e(),e._t("imagePlayerOverlay")],2)]),e._t("controls",function(){return[e.withControls?r("div",{staticClass:"e-absolute e-bottom-0 e-w-[97%] e-p-4 e-pt-8 e-z-50 e-space-y-4 e-bg-gradient-to-t e-from-[#363434] e-to-transparent"},[r("div",{staticClass:"e-font-semibold e-text-white"},[e._v(" "+e._s(e.frames[e.frameIndex].label)+" - "+e._s(e.frameIndex)+" / "+e._s(e.frames.length-1)+" ")]),r("div",{staticClass:"e-flex e-justify-start e-gap-2 e-items-center"},[r("button",{staticClass:"e-text-white e-bg-transparent e-border-none e-cursor-pointer action-btn__first-vertical e-rounded-md",on:{click:e.togglePlay}},[r("i",{staticClass:"fas fa-2x",class:{"fa-play":!e.playing,"fa-pause":e.playing}})]),r("div",{ref:"progressBar",staticClass:"e-w-full e-h-3 e-relative e-bg-gray-200 e-rounded-md",on:{click:e.onProgressBarClick,mouseenter:e.onProgressBarMouseEnter,mousemove:e.onProgressBarMouseMove,mouseleave:e.onProgressBarMouseLeave}},[r("div",{staticClass:"e-bg-blue-500 e-w-full e-h-full e-absolute e-rounded-md e-z-[1]",style:{width:`${e.playedPercentage}%`}}),e._l(e.preloadedChunks,function([o,s]){return r("div",{key:s,staticClass:"e-bg-blue-300 e-h-full e-absolute e-rounded-md",style:e.getProgressBarChunkStyle(o,s)})})],2),r("button",{ref:"fullScreenBtn",staticClass:"e-text-white e-bg-transparent e-border-none e-cursor-pointer action-btn__second-vertical e-rounded-md",on:{click:e.toggleFullscreenMode}},[r("i",{staticClass:"fas fa-2x",class:{"fa-expand":!e.isFullscreen,"fa-compress":e.isFullscreen}})])])]):e._e()]},{playing:e.playing,togglePlay:e.togglePlay,play:e.play,pause:e.pause,toggleFullscreen:e.toggleFullscreenMode,preloadedFrames:e.preloadedFrames,isLastFrame:e.isLastFrame})],2)},Hc=[],Nc=H(Ac,Rc,Hc,!1,null,null,null,null);const fs=Nc.exports,jc=F.extend({name:"ELayout",directives:{ResizeObserver:Ve},mixins:[Ue],props:{height:{type:[String,Number],default:null},withOverlay:{type:Boolean,default:!1}},data(){return{footerHeight:0,overlayFooterHeight:0,wrapperStyle:{width:"100%",height:"100%"},mainStyle:{width:"100%",height:"100%"},mainHeight:"100%"}},computed:{bottomStyle(){return{bottom:`${this.overlayFooterHeight}px`}}},watch:{mainHeight(){this.onResize()},height:{immediate:!0,handler(){this.onResize()}}},mounted(){this.setOverlayFooterHeight(),this.setFooterHeight()},methods:{onResize(){this.setFooterHeight(),this.setOverlayFooterHeight()},onOverlayClick(t){this.$emit("overlay-click",t)},setOverlayFooterHeight(){const t=this.$refs.overlayFooter;t||this.$setTimeout(()=>{this.setOverlayFooterHeight()}),this.overlayFooterHeight=t==null?void 0:t.clientHeight},setFooterHeight(){const t=this.$refs.footer;t||this.$setTimeout(()=>{this.setFooterHeight()}),this.footerHeight=t==null?void 0:t.clientHeight,this.$attrs.isFullscreen?this.mainHeight=`${screen.height}px`:this.mainHeight=`${this.height?this.height.split("px")[0]-this.footerHeight:"100"}px`,this.mainStyle={width:"100%",height:this.mainHeight}}}});var Gc=function(){var e=this,r=e._self._c;return r("div",e._b({directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.onResize,expression:"onResize"}],ref:"globalLayout",staticClass:"e-layout e-w-full e-h-full e-relative",style:{width:"100%",height:e.mainHeight},attrs:{id:"globalLayout"}},"div",e.$attrs,!1),[r("div",{staticClass:"e-layout__container e-relative",style:e.mainStyle},[r("div",{staticClass:"e-layout__main e-w-full e-h-full e-absolute e-inset-0 e-z-0",style:e.mainStyle},[e._t("main",null,{size:{...e.mainStyle}})],2),e.withOverlay?r("div",{staticClass:"e-layout__overlay e-w-full e-h-full e-absolute e-inset-0 e-z-[1]",style:e.mainStyle,on:{click:e.onOverlayClick}},[e._t("overlay",null,{size:{...e.mainStyle}})],2):e._e(),r("div",{staticClass:"e-layout__top-left e-absolute e-left-0 e-top-0 e-z-[2]"},[e._t("top-left")],2),r("div",{staticClass:"e-absolute e-right-0 e-top-0 e-layout__top-right e-z-[2]"},[e._t("top-right")],2),r("div",{staticClass:"e-absolute e-right-0 e-bottom-10 e-layout__bottom-right e-z-[2]",style:e.bottomStyle},[e._t("bottom-right")],2),r("div",{staticClass:"e-absolute e-left-0 e-bottom-10 e-layout__bottom-left e-z-[2]",style:e.bottomStyle},[e._t("bottom-left")],2),r("div",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.setOverlayFooterHeight,expression:"setOverlayFooterHeight"}],ref:"overlayFooter",staticClass:"e-absolute e-bottom-0 e-left-0 e-right-0 e-layout__overlay-footer e-z-[2]"},[e._t("overlay-footer")],2)]),r("div",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.setFooterHeight,expression:"setFooterHeight"}],ref:"footer",staticClass:"e-layout__footer e-relative e-z-[2]"},[e._t("footer")],2)])},qc=[],Wc=H(jc,Gc,qc,!1,null,null,null,null);const ps=Wc.exports;var Uc=H({name:"EContextProvider",provide(){return{...this.$props.context}},props:{context:{type:Object,required:!0}},render(){return this.$scopedSlots.default()}},null,null,!1,null,null,null,null);const Zc=Uc.exports,Yc=F.extend({name:"EChatWrapper",props:{dark:{type:Boolean,default:!1},embedded:{type:Boolean,default:!1}},computed:{borderClasses(){return this.embedded?{}:{"e-border-[1px] e-border-solid e-rounded-lg e-overflow-hidden":!0,"e-border-gray-300":!this.dark,"e-border-gray-600":this.dark}},wrapperClasses(){return{"e-bg-gray-800 e-text-white":this.dark,"e-bg-white e-text-gray-800":!this.dark,...this.borderClasses}}}}),Ld="";var Xc=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{staticClass:"e-chat-wrapper e-h-full",class:e.wrapperClasses},[e._t("default")],2)},Vc=[],Qc=H(Yc,Xc,Vc,!1,null,null,null,null);const Kc=Qc.exports,Jc=F.extend({name:"EChatHeader",components:{EAvatar:Mt},props:{size:{type:String,default:"xs"},backgroundClasses:{type:String,default:""}}}),Dd="";var eu=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("EAvatar",{staticClass:"e-evercam-logo",attrs:{image:"https://dash.evercam.io/evercam-logo.svg",size:e.size,"background-classes":e.backgroundClasses}})},tu=[],ru=H(Jc,eu,tu,!1,null,null,null,null);const ms=ru.exports,nu=F.extend({name:"EChatHeader",components:{EEvercamLogo:ms},props:{title:{type:String,default:"Evercam Copilot"},hidden:{type:Boolean,default:!1},dark:{type:Boolean,default:!1}},computed:{backgroundClasses(){return{"e-bg-gray-700":this.dark,"e-bg-gray-50":!this.dark}},headerClasses(){return{"e-hidden":this.hidden,...this.backgroundClasses}}}});var iu=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{staticClass:"e-chat-header e-flex e-items-center e-justify-between",class:e.headerClasses},[r("div",{staticClass:"e-chat-logo e-flex e-w-full e-items-center e-justify-start e-gap-2 e-px-5 e-py-4"},[e._t("logo",function(){return[r("div",{},[r("EEvercamLogo",{attrs:{size:"xs","background-classes":"e-bg-white e-p-[2px] e-rounded-full !e-pr-[2.5px] !e-pt-[3.5px]"}})],1)]}),r("div",{staticClass:"e-font-semibold e-h-min e-text-base"},[e._v(e._s(e.title))]),e._t("chip")],2),e._t("append")],2)},su=[],au=H(nu,iu,su,!1,null,null,null,null);const ou=au.exports,lu=F.extend({name:"EChatBody",directives:{ResizeObserver:Ve},props:{dark:{type:Boolean,default:!1}},data(){return{autoScroll:!0,previousChildCount:0,showGoToBottomButton:!1}},computed:{bodyClasses(){return{"e-custom-scrollbar--light":!this.dark,"e-custom-scrollbar--dark":this.dark}},goToBottomButtonClasses(){return{"e-text-gray-500":!this.dark,"e-text-gray-300":this.dark,"e-bg-gray-600":this.dark,"e-bg-gray-200":!this.dark}}},watch:{autoScroll(t){t&&this.scrollToBottom()}},mounted(){this.scrollToBottom()},methods:{onContentResized(){const e=this.$refs.contentWrapper.childElementCount;e!==this.previousChildCount&&(this.autoScroll=!0),this.autoScroll&&this.scrollToBottom(),this.previousChildCount=e},scrollToBottom(){const t=this.$refs.anchor;this.$nextTick(()=>{t.scrollIntoView({behavior:"smooth"})})},disableAutoScroll(){this.autoScroll=!1},onScroll(){const t=this.$refs.chatBody;t.scrollHeight-t.scrollTop<=t.clientHeight+1&&(this.autoScroll=!0),this.showGoToBottomButton=t.scrollHeight-t.scrollTop>t.clientHeight+100},onWheel(t){t.deltaY<0&&this.disableAutoScroll()},onKeyUp(t){["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)&&this.disableAutoScroll()},onTouch(){this.disableAutoScroll()},onTouchMove(){this.disableAutoScroll()}}}),Pd="";var cu=function(){var e=this,r=e._self._c;return r("div",e._b({ref:"chatBody",staticClass:"e-chat-body e-space-y-2 e-py-3 e-px-5 e-leading-6",class:e.bodyClasses,attrs:{tabindex:"0"},on:{scroll:e.onScroll,wheel:e.onWheel,keyup:function(n){return n.stopPropagation(),e.onKeyUp.apply(null,arguments)},touchstart:e.onTouch,touchmove:e.onTouchMove}},"div",e.$attrs,!1),[r("div",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.onContentResized,expression:"onContentResized"}],ref:"contentWrapper",staticClass:"e-chat-body__content"},[e._t("default")],2),r("div",{ref:"anchor",staticClass:"e-chat-body__anchor"}),e.showGoToBottomButton?r("div",{staticClass:"e-chat-body__go-to-bottom e-sticky e-bottom-1 e-flex e-justify-center"},[r("button",{staticClass:"e-animate-bounce e-inline-flex e-items-center e-justify-center e-cursor-pointer e-h-8 e-w-8 e-border-none focus:e-outline-none e-rounded-full",class:e.goToBottomButtonClasses,on:{click:e.scrollToBottom}},[r("EIcon",{attrs:{icon:"arrow-down",size:"Base"}})],1)]):e._e()])},uu=[],du=H(lu,cu,uu,!1,null,null,null,null);const hu=du.exports,fu=F.extend({props:{size:{type:Number,default:12},color:{type:String,default:"#c5393d"},withDot:{type:Boolean,default:!0}},computed:{computedSize(){return`${this.size}px`},computedMargin(){return`${this.size/2}px`},computedShadowSize(){return`${this.size*2}px`},computedSecondaryColor(){return ht(this.color,0)||"#fff"},dotContainerStyle(){return{margin:`${this.computedMargin} auto`,width:this.computedSize,height:this.computedSize,position:"relative"}},shadowStyle(){return{width:this.computedSize,height:this.computedSize,"--boxShadowColor":ht(this.color,.7),"--backgroundColor":ht(this.color,.7),"--secondaryColor":this.computedSecondaryColor,"--shadowSize":this.computedShadowSize}},secondShadowStyle(){return{...this.shadowStyle,animationDelay:".33s",animationDuration:"2.3s"}},dotStyle(){return{width:this.computedSize,height:this.computedSize,backgroundColor:this.withDot?ht(this.color,1):void 0}}},methods:{toRgba:ht}}),Od="";var pu=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{staticClass:"e-pulsating-dot",style:e.dotContainerStyle},[r("span",{staticClass:"e-pulsating-dot__shadow",style:e.shadowStyle}),r("span",{staticClass:"e-pulsating-dot__shadow",style:e.secondShadowStyle}),r("div",{staticClass:"e-pulsating-dot__dot",style:e.dotStyle},[e._t("icon")],2)])},mu=[],gu=H(fu,pu,mu,!1,null,"cf575c64",null,null);const vu=gu.exports;var gs={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(typeof self!="undefined"?self:ot,()=>(()=>{var r={75:function(s){(function(){var c,a,l,d,f,m;typeof performance!="undefined"&&performance!==null&&performance.now?s.exports=function(){return performance.now()}:typeof process!="undefined"&&process!==null&&process.hrtime?(s.exports=function(){return(c()-f)/1e6},a=process.hrtime,d=(c=function(){var b;return 1e9*(b=a())[0]+b[1]})(),m=1e9*process.uptime(),f=d-m):Date.now?(s.exports=function(){return Date.now()-l},l=Date.now()):(s.exports=function(){return new Date().getTime()-l},l=new Date().getTime())}).call(this)},4087:(s,c,a)=>{for(var l=a(75),d=typeof window=="undefined"?a.g:window,f=["moz","webkit"],m="AnimationFrame",b=d["request"+m],x=d["cancel"+m]||d["cancelRequest"+m],h=0;!b&&h<f.length;h++)b=d[f[h]+"Request"+m],x=d[f[h]+"Cancel"+m]||d[f[h]+"CancelRequest"+m];if(!b||!x){var y=0,$=0,D=[];b=function(S){if(D.length===0){var R=l(),E=Math.max(0,16.666666666666668-(R-y));y=E+R,setTimeout(function(){var j=D.slice(0);D.length=0;for(var Q=0;Q<j.length;Q++)if(!j[Q].cancelled)try{j[Q].callback(y)}catch(U){setTimeout(function(){throw U},0)}},Math.round(E))}return D.push({handle:++$,callback:S,cancelled:!1}),$},x=function(S){for(var R=0;R<D.length;R++)D[R].handle===S&&(D[R].cancelled=!0)}}s.exports=function(S){return b.call(d,S)},s.exports.cancel=function(){x.apply(d,arguments)},s.exports.polyfill=function(S){S||(S=d),S.requestAnimationFrame=b,S.cancelAnimationFrame=x}}},n={};function i(s){var c=n[s];if(c!==void 0)return c.exports;var a=n[s]={exports:{}};return r[s].call(a.exports,a,a.exports,i),a.exports}i.n=s=>{var c=s&&s.__esModule?()=>s.default:()=>s;return i.d(c,{a:c}),c},i.d=(s,c)=>{for(var a in c)i.o(c,a)&&!i.o(s,a)&&Object.defineProperty(s,a,{enumerable:!0,get:c[a]})},i.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),i.o=(s,c)=>Object.prototype.hasOwnProperty.call(s,c);var o={};return(()=>{i.d(o,{default:()=>X});var s=i(4087),c=i.n(s);const a=function(I){return new RegExp(/<[a-z][\s\S]*>/i).test(I)},l=function(I,T){return Math.floor(Math.random()*(T-I+1))+I};var d="TYPE_CHARACTER",f="REMOVE_CHARACTER",m="REMOVE_ALL",b="REMOVE_LAST_VISIBLE_NODE",x="PAUSE_FOR",h="CALL_FUNCTION",y="ADD_HTML_TAG_ELEMENT",$="CHANGE_DELETE_SPEED",D="CHANGE_DELAY",S="CHANGE_CURSOR",R="PASTE_STRING",E="HTML_TAG";function j(I){return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(T){return typeof T}:function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},j(I)}function Q(I,T){var P=Object.keys(I);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(I);T&&(N=N.filter(function(ne){return Object.getOwnPropertyDescriptor(I,ne).enumerable})),P.push.apply(P,N)}return P}function U(I){for(var T=1;T<arguments.length;T++){var P=arguments[T]!=null?arguments[T]:{};T%2?Q(Object(P),!0).forEach(function(N){L(I,N,P[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(P)):Q(Object(P)).forEach(function(N){Object.defineProperty(I,N,Object.getOwnPropertyDescriptor(P,N))})}return I}function C(I){return function(T){if(Array.isArray(T))return z(T)}(I)||function(T){if(typeof Symbol!="undefined"&&T[Symbol.iterator]!=null||T["@@iterator"]!=null)return Array.from(T)}(I)||function(T,P){if(T){if(typeof T=="string")return z(T,P);var N=Object.prototype.toString.call(T).slice(8,-1);return N==="Object"&&T.constructor&&(N=T.constructor.name),N==="Map"||N==="Set"?Array.from(T):N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N)?z(T,P):void 0}}(I)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
242
+ `:`${t.startTime} - ${t.endTime}`},normalizeTime(t){return t==="24:00"?"23:59":t},getFormattedSchedule(){const t={};return this.internalDays.forEach(e=>{const r=(e.day+1).toString();t[r]=e.segments.map(n=>{const i=this.normalizeTime(n.startTime),o=this.normalizeTime(n.endTime);return`${i}-${o}`})}),t},formatDay(t){return new Intl.DateTimeFormat("en-US",{weekday:"short"}).format(new Date(0,0,t+1))},formatHour(t){return(t-1).toString().padStart(2,"0")+"h"},parseTime(t){const[e,r]=t.split(":").map(n=>parseInt(n,10));return{hours:e,minutes:r}},padTime(t){let e=Math.round(t*60);e<0&&(e=0),e>24*60&&(e=24*60);const r=Math.floor(e/60),n=e%60;return`${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},roundToFive(t){const e=t*60,r=Math.round(e/5)*5;return Math.max(0,Math.min(r,24*60))/60},calculateBarStyle(t,e,r){const{hours:n,minutes:i}=this.parseTime(e),{hours:o,minutes:s}=this.parseTime(r),c=n+i/60,l=o+s/60-c,d=c/24*100,f=l/24*100,m=t*this.rowHeightPx,b=this.rowHeightPx;return{position:"absolute",top:`${m+1}px`,left:`calc(${d}% + 1px)`,width:`calc(${f}% - 2px)`,height:`${b-3}px`}},onResize(){const t=this.$refs.table,e=Array.from(t.querySelectorAll(".segment-cell"));if(!t||!e.length)return;const r=e[0].getBoundingClientRect();this.rowHeightPx=r.height;const n=e[e.length-1].getBoundingClientRect();this.segmentsContainerRect={top:r.top,left:r.left,width:n.right-r.left,height:n.bottom-r.top}},onSegmentMouseDown(t,e,r){if(t.preventDefault(),t.stopPropagation(),!this.segmentsContainerRect)return;const i=t.currentTarget.getBoundingClientRect(),o=t.clientX-i.left,s=6;let c="move";o<s?c="resize-left":o>i.width-s&&(c="resize-right");const a=this.sortedDays[e].segments[r],{hours:l,minutes:d}=this.parseTime(a.startTime),{hours:f,minutes:m}=this.parseTime(a.endTime),b=l+d/60,x=f+m/60;this.editing={dayIndex:e,segmentIndex:r,type:c,startMouseX:t.clientX,origStartFrac:b,origEndFrac:x},document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)},onMouseMove(t){if(!this.editing||!this.segmentsContainerRect)return;t.preventDefault();const{dayIndex:e,segmentIndex:r,type:n,startMouseX:i,origStartFrac:o,origEndFrac:s}=this.editing,a=(t.clientX-i)/this.pixelsPerHour;let l=o,d=s;n==="move"?(l=o+a,d=s+a):n==="resize-left"?l=o+a:n==="resize-right"&&(d=s+a),n==="resize-left"&&d-l<1&&(l=d-1),n==="resize-right"&&d-l<1&&(d=l+1),l=this.roundToFive(Math.max(0,Math.min(l,24))),d=this.roundToFive(Math.max(0,Math.min(d,24)));const f=this.sortedDays[e].day;this.internalDays=this.internalDays.map(m=>{if(m.day!==f)return m;const b=m.segments.map((x,h)=>h!==r?x:{startTime:this.padTime(l),endTime:this.padTime(d)});return{...m,segments:b}})},onMouseUp(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp),this.editing=null,this.mergeOverlappingSegments()},onSegmentMouseMove(t){const e=t.currentTarget,r=e.getBoundingClientRect(),n=t.clientX-r.left,i=6;n<i||n>r.width-i?e.style.cursor="ew-resize":e.style.cursor="grab"},onSegmentMouseLeave(t){const e=t.currentTarget;e.style.cursor="default"},deleteSegment(t,e){const r=this.sortedDays[t].day;this.internalDays=this.internalDays.map(n=>{if(n.day!==r)return n;const i=n.segments.filter((o,s)=>s!==e);return{...n,segments:i}}),this.emitChangeEvent()},onBackgroundMouseDown(t){if(t.target.closest(".segment"))return;const n=this.$refs.table.querySelectorAll(".segment-cell"),i=n[0].getBoundingClientRect(),o=n[n.length-1].getBoundingClientRect();this.segmentsContainerRect={top:i.top,left:i.left,width:o.right-i.left,height:o.bottom-i.top},t.preventDefault();const s=t.clientY-this.segmentsContainerRect.top,c=Math.floor(s/this.rowHeightPx);if(c<0||c>=this.sortedDays.length)return;let a=(t.clientX-this.segmentsContainerRect.left)/this.pixelsPerHour;a=Math.max(0,Math.min(a,24)),this.creating={startDayIndex:c,currentDayIndex:c,startFrac:a,currentFrac:a},document.addEventListener("mousemove",this.onCreateMouseMove),document.addEventListener("mouseup",this.onCreateMouseUp)},onCreateMouseMove(t){if(!this.creating||!this.segmentsContainerRect)return;t.preventDefault();let e=(t.clientX-this.segmentsContainerRect.left)/this.pixelsPerHour;e=Math.max(0,Math.min(e,24)),this.creating.currentFrac=e;const r=t.clientY-this.segmentsContainerRect.top;let n=Math.floor(r/this.rowHeightPx);n=Math.max(0,Math.min(n,this.sortedDays.length-1)),this.creating.currentDayIndex=n},onCreateMouseUp(){if(!this.creating)return;const{startDayIndex:t,currentDayIndex:e,startFrac:r,currentFrac:n}=this.creating;let i=Math.min(r,n),o=Math.max(r,n);if(o-i<1){this.cleanupCreate();return}const s=this.roundToFive(i),c=this.roundToFive(o),a=Math.min(t,e),l=Math.max(t,e),f=this.sortedDays.map(m=>m.day).slice(a,l+1);this.internalDays=this.internalDays.map(m=>f.includes(m.day)?{...m,segments:[...m.segments,{startTime:this.padTime(s),endTime:this.padTime(c)}]}:m),this.cleanupCreate(),this.mergeOverlappingSegments()},cleanupCreate(){document.removeEventListener("mousemove",this.onCreateMouseMove),document.removeEventListener("mouseup",this.onCreateMouseUp),this.creating=null},calculateMultiDayStyle(t,e,r,n){const i=Math.min(r,n)/24*100,o=(Math.max(r,n)-Math.min(r,n))/24*100,s=Math.min(t,e),c=Math.max(t,e),a=s*this.rowHeightPx,l=(c-s+1)*this.rowHeightPx;return{position:"absolute",top:`${a+1}px`,left:`calc(${i}% + 1px)`,width:`calc(${o}% - 2px)`,height:`${l-2}px`}},mergeOverlappingSegments(){this.internalDays=this.internalDays.map(t=>{const e=t.segments.map(i=>{const{hours:o,minutes:s}=this.parseTime(i.startTime),{hours:c,minutes:a}=this.parseTime(i.endTime);return{start:o+s/60,end:c+a/60}});e.sort((i,o)=>i.start-o.start);const r=[];for(const i of e)if(!r.length)r.push({...i});else{const o=r[r.length-1];i.start<=o.end+1e-6?o.end=Math.max(o.end,i.end):r.push({...i})}const n=r.map(i=>({startTime:this.padTime(this.roundToFive(i.start)),endTime:this.padTime(this.roundToFive(i.end))}));return{day:t.day,segments:n}})},showHour(t){return(t-1)%this.tickInterval===0||t===24},emitChangeEvent(){this.mergeOverlappingSegments(),this.$emit("change",this.getFormattedSchedule())}}}),yd="";var K4=function(){var e=this,r=e._self._c;return r("div",{ref:"mainContainer",staticClass:"schedule e-text-grey e-relative"},[r("table",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.onResize,expression:"onResize"}],ref:"table",staticClass:"e-table-fixed e-w-full e-border-separate e-border-spacing-0 e-relative"},[r("thead",[r("tr",{staticClass:"e-h-8"},[r("th",{staticClass:"e-w-16"}),e._l(24,function(n){return r("th",{key:n,staticClass:"hour-label e-p-1 e-text-center e-h-8"},[e.showHour(n)?r("span",[e._v(e._s(e.formatHour(n)))]):e._e()])})],2)]),r("tbody",e._l(e.sortedDays,function(n,i){return r("tr",{key:n.day,staticClass:"h-8"},[r("th",{staticClass:"e-p-1 e-text-center e-h-8",attrs:{scope:"row"}},[e._v(" "+e._s(e.formatDay(n.day))+" ")]),e._l(24,function(o){return r("td",{key:o,staticClass:"segment-cell e-border-b e-border-white dark:e-border-gray-700 e-h-8",class:{"e-border-l":o===1,"e-border-r":o===24,"e-border-t":i===0,"e-rounded-tl-lg":i===0&&o===1,"e-rounded-tr-lg":i===0&&o===24,"e-rounded-bl-lg":i===e.sortedDays.length-1&&o===1,"e-rounded-br-lg":i===e.sortedDays.length-1&&o===24}})})],2)}),0)]),e.segmentsContainerRect?r("div",{ref:"overlay",staticClass:"e-absolute e-inset-0 e-cursor-crosshair",style:e.segmentsContainerStyles,on:{mousedown:e.onBackgroundMouseDown}},[e._l(e.sortedDays,function(n,i){return r("div",{key:n.day},e._l(n.segments,function(o,s){return r("div",{key:o.startTime+"-"+o.endTime,staticClass:"segment e-rounded e-absolute e-bg-blue-500/80",style:e.calculateBarStyle(i,o.startTime,o.endTime),on:{mousedown:function(c){return c.stopPropagation(),e.onSegmentMouseDown(c,i,s)},mousemove:e.onSegmentMouseMove,mouseleave:e.onSegmentMouseLeave}},[r("button",{staticClass:"delete-btn e-absolute e-top-0 e-right-0 e-m-1 e-text-white e-p-1",on:{click:function(c){return c.stopPropagation(),e.deleteSegment(i,s)}}},[e._v(" + ")]),r("div",{staticClass:"e-flex e-justify-center e-items-center e-text-xs e-text-white e-h-full e-select-none",domProps:{innerHTML:e._s(e.getSegmentLabel(o))}})])}),0)}),e.creating?r("div",{staticClass:"segment e-rounded e-absolute e-bg-blue-300/50 e-border e-border-blue-400 e-flex e-justify-center e-items-center e-text-xs e-text-white",style:e.calculateMultiDayStyle(e.creating.startDayIndex,e.creating.currentDayIndex,e.creating.startFrac,e.creating.currentFrac)},[e._v(" "+e._s(e.padTime(e.roundToFive(Math.min(e.creating.startFrac,e.creating.currentFrac))))+"  -  "+e._s(e.padTime(e.roundToFive(Math.max(e.creating.startFrac,e.creating.currentFrac))))+" ")]):e._e()],2):e._e()])},J4=[],ec=H(Q4,K4,J4,!1,null,null,null,null);const ls=ec.exports,cs=F.extend({mixins:[Ge,Ue],data(){return{inactivityListeners:[],isInactivityListenerActive:!1}},beforeDestroy(){this.$removeInactivityListeners()},methods:{resetInactivityListenerTimer(t=()=>{},e=0,r=[]){this.isInactivityListenerActive&&(this.$clearTimeouts(),this.setInactivityListenerTimer(t,e,r))},setInactivityListenerTimer(t=()=>{},e=0,r=[]){t&&e&&this.$setTimeout(()=>{t(),r.length>0&&this.setInactivityListenerReminderTimers(t,r)},e*1e3)},setInactivityListenerReminderTimers(t=()=>{},e=[],r=0){const n=e[r];r<e.length?this.$setTimeout(()=>{t(),this.setInactivityListenerReminderTimers(t,e,r+1)},n*1e3):this.isInactivityListenerActive&&this.$removeInactivityListeners()},$registerInactivityListener({callback:t=()=>{},duration:e=0,reminders:r=[]}){this.isInactivityListenerActive=!0,this.resetInactivityListenerTimer(t,e,r);const n=()=>this.resetInactivityListenerTimer(t,e,r);this.$addEventListener("mousemove",n),this.inactivityListeners.push(n)},$removeInactivityListeners(){this.isInactivityListenerActive&&(this.isInactivityListenerActive=!1,this.inactivityListeners.forEach(t=>{this.$removeEventListener("mousemove",t)}),this.$clearTimeouts())}}}),us=Object.freeze(Object.defineProperty({__proto__:null,eventListeners:Ge,formField:Rt,inactivityListener:cs,selectFormField:wt,timeouts:Ue,toggleOpen:Ht},Symbol.toStringTag,{value:"Module"})),tc=F.extend({name:"EPopover",directives:{ClickOutside:tn},mixins:[Ht],props:{dark:{type:Boolean,default:!1},label:{type:String,default:"Click to open"},panelSide:{type:String,default:"center"},panelClasses:{type:[Object,String,Array],default:()=>({})}},computed:{panelThemeClasses(){return{"e-bg-gray-800":this.dark,"e-bg-white":!this.dark,"right-0 ":this.panelSide==="right","left-0":this.panelSide==="left"}}},methods:{closePopover(){this.isOpen=!1}}}),Cd="";var rc=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",e._b({directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closePopover,expression:"closePopover"}],staticClass:"e-popover__wrapper e-relative e-w-full"},"div",e.$attrs,!1),[e._t("trigger",function(){return[r("div",e._g(e._b({staticClass:"e-popover__trigger-button e-relative e-w-full e-rounded e-py-2 e-leading-5 e-cursor-pointer e-h-[40px] e-flex e-justify-center e-items-center",attrs:{role:"button"},on:{click:e.toggleOpen}},"div",e.$attrs,!1),e.$listeners),[e._t("trigger-button-content",function(){return[r("span",[e._v(" "+e._s(e.label)+" ")])]})],2)]},{toggle:e.toggleOpen,isOpen:e.isOpen}),e.isOpen?r("div",e._b({staticClass:"e-popover__menu-wrapper e-absolute e-bg-gray-800 e-z-[5] e-min-w-[160px] e-w-full e-min-h-12 e-max-h-72 e-overflow-auto e-text-sm e-rounded-md e-scrollbar-thin e-mt-1 e-scrollbar-thumb-rounded-full e-scrollbar-track-rounded-full e-scrollbar-thumb-gray-400 shadow-2xl focus:e-outline-none sm:e-text-sm",class:[e.panelThemeClasses,e.panelClasses]},"div",e.$attrs,!1),[e._t("panel",function(){return[e._t("default")]})],2):e._e()],2)},nc=[],ic=H(tc,rc,nc,!1,null,"59138e1e",null,null);const hn=ic.exports,sc=F.extend({name:"ECheckbox",components:{EIcon:We},props:{checked:{type:Boolean,default:!1}}}),bd="";var ac=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",e._g(e._b({staticClass:"e-select-checkbox e-box-border e-w-4 e-h-4 e-rounded e-flex e-items-center e-justify-center e-align-middle e-border-solid e-border-2",class:{"e-border-gray-500":!e.checked,"e-bg-[#1976d2] e-border-[#1976d2]":e.checked},staticStyle:{"border-radius":"2px"}},"div",e.$attrs,!1),e.$listeners),[e.checked?r("EIcon",{attrs:{icon:"far fa-check",color:"e-text-white",size:"xs"}}):e._e()],1)},oc=[],lc=H(sc,ac,oc,!1,null,"c5642bf0",null,null);const cc=lc.exports,uc=F.extend({name:"ESelect",components:{ECheckbox:cc,EIcon:We,EPopover:hn},directives:{ResizeObserver:Ve},mixins:[wt],props:{dark:{type:Boolean,default:!1},withSelectAll:{type:Boolean,default:!1},customSelectionLabel:{type:String,default:""},name:{type:String,default:"Items"},label:{type:String,default:"Select an option"},withCheckbox:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"Type to search..."},withSearchQueryVisible:{type:Boolean,default:!1}},data(){return{searchQuery:"",menuStyle:{}}},computed:{customLabel(){return this.multiple&&Array.isArray(this.value)&&this.value.length===0||!this.multiple&&(this.value===null||this.value===void 0)?this.label:this.multiple&&this.customSelectionLabel.length>0?this.customSelectionLabel:this.localLabel||this.label},filteredOptions(){if(!this.searchQuery)return this.options;const t=this.searchQuery.toLowerCase().trim();return this.options.filter(e=>e.label.toLowerCase().includes(t))},scrollbarClasses(){return{"e-scrollbar-track-gray-800 e-scrollbar-thumb-gray-500":this.dark,"e-scrollbar-track-white e-scrollbar-thumb-gray-400":!this.dark}},showSearchClearButton(){return(this.searchQuery.length>0||this.isAtLeastOneSelected)&&this.searchable&&!this.disabled}},methods:{handleTriggerClick(t,e){this.disabled||(e(t),this.$nextTick(()=>{const r=this.$refs.searchInput;r&&r.focus()}),this.withSearchQueryVisible&&(this.searchQuery=this.getOptionByValue(this.value).label||""))},handleMenuStyle(){const t=this.$refs.ESelectWrapper;this.menuStyle={maxWidth:`${t==null?void 0:t.clientWidth}px`,minWidth:"160px"}},clearSearch(){this.searchQuery="",this.$emit("input",this.multiple?[]:null);const t=this.$refs.searchInput;t&&t.focus()}}}),xd="";var dc=function(){var e=this,r=e._self._c;return r("EPopover",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.handleMenuStyle,expression:"handleMenuStyle"}],attrs:{dark:e.dark},scopedSlots:e._u([{key:"trigger",fn:function({isOpen:n,toggle:i}){return[e._t("activator",function(){return[r("div",{staticClass:"e-select__trigger-button e-relative e-w-full e-rounded e-border e-border-solid e-py-2 e-pl-3 e-leading-5 e-cursor-pointer e-h-[40px] e-flex e-items-center e-bg-gray-900",class:e.radioItemClasses,attrs:{id:`e-select-trigger-${Date.now()}`,"data-test-id":`select-trigger-${Date.now()}`,role:"button"},on:{click:o=>e.handleTriggerClick(o,i)}},[n&&e.searchable?r("div",{staticClass:"e-select__search-input-wrapper e-flex e-items-center e-gap-2 e-w-full e-mr-10"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.searchQuery,expression:"searchQuery"}],ref:"searchInput",staticClass:"e-select__search-input e-w-full e-h-6 e-bg-transparent placeholder:e-text-sm e-text-sm e-outline-none e-border-none",class:{"e-text-white placeholder:e-text-gray-400":e.dark,"e-text-gray-700 placeholder:e-text-gray-500":!e.dark},attrs:{placeholder:e.searchPlaceholder,type:"text"},domProps:{value:e.searchQuery},on:{click:function(o){o.stopPropagation()},input:function(o){o.target.composing||(e.searchQuery=o.target.value)}}})]):[e.multiple&&e.selectedOption.length===0||!e.selectedOption?e._t("label",function(){return[e.customLabel&&!e.searchable?r("span",{staticClass:"e-select-label e-text-sm"},[e._v(e._s(e.customLabel))]):r("span",{staticClass:"e-select-label e-text-sm e-text-gray-400"},[e._v(e._s(e.searchPlaceholder))])]}):e._t("selection",function(){return[r("span",{staticClass:"e-capitalize e-select__trigger-button-text e-truncate"},[e._v(" "+e._s(e.customLabel)+" ")])]})],e.showSearchClearButton?r("button",{staticClass:"e-select__clean-search-button e-flex e-bg-transparent e-z-[2] e-absolute e-right-10 e-cursor-pointer e-border-none e-items-center e-justify-center e-w-5 e-h-5",on:{click:function(o){return o.stopPropagation(),e.clearSearch.apply(null,arguments)}}},[r("EIcon",{attrs:{color:"e-text-gray-400 hover:e-text-[#1976d2]",icon:"far fa-xmark",size:"lg"}})],1):e._e(),e._t("pre-append-icon",function(){return[r("span",{staticClass:"e-select__trigger-button-icon e-absolute e-inset-y-0 e-right-0 e-flex e-items-center e-justify-end e-px-3 e-pr-4 e-bg-transparent e-border-transparent e-text-gray-400"},[r("EIcon",{attrs:{icon:n?"fas fa-sort-up e-mt-2.5":"fas fa-sort-down e-mb-1.5"}})],1)]})],2)]},{attrs:{class:e.radioItemClasses,isOpen:n},on:{click:i}})]}},{key:"panel",fn:function(){return[e.multiple&&e.withSelectAll?r("div",{staticClass:"e-select__menu-check-all-wrapper e-relative e-cursor-pointer e-select-none e-p-2",on:{click:e.toggleSelectAll}},[r("div",{staticClass:"e-select__menu-check-all e-flex e-justify-start e-items-center e-gap-2 e-p-1 e-w-full",class:{"e-text-[#1976d2] ":e.isAllSelected&&!e.dark,"e-text-[#61b0ff]":e.isAllSelected&&e.dark}},[r("ECheckbox",{attrs:{checked:e.isAllSelected}}),r("span",{staticClass:"e-capitalize e-select__menu-check-all-text e-text-sm e-font-medium"},[e._v(" All "+e._s(e.name||"")+" ")])],1)]):e._e(),e.multiple&&e.withSelectAll?r("hr",{staticClass:"e-border-0 e-h-px e-m-0",class:{"e-bg-gray-700":e.dark,"e-bg-gray-200":!e.dark}}):e._e(),e._l(e.filteredOptions,function(n,i){return r("div",{key:i,staticClass:"e-select__menu-item-wrapper e-relative e-select-none e-p-2",class:e.containerClasses(n),attrs:{id:`select-item-${n.value}`,"data-test-id":`select-item-${i}`},on:{click:function(o){return e.onItemClick(n.value)}}},[r("div",{staticClass:"e-select__menu-item e-flex e-justify-start e-items-center e-gap-2 e-p-1 e-w-i"},[e.withCheckbox||e.multiple?r("ECheckbox",{attrs:{checked:e.isSelected(n.value)}}):e._e(),e._t("item",function(){return[r("span",{staticClass:"e-select__menu-item-text e-block e-text-sm e-font-medium"},[e._v(" "+e._s(n.label)+" ")])]},{item:n,isSelected:e.isSelected(n.value)})],2)])}),e.filteredOptions.length===0?r("div",{staticClass:"e-select__no-values-box e-p-4 e-text-center e-text-gray-500"},[e._v(" No results found ")]):e._e()]},proxy:!0}],null,!0)})},hc=[],fc=H(uc,dc,hc,!1,null,null,null,null);const ds=fc.exports,pc=F.extend({name:"EGlobalSearch",components:{EIcon:We},mixins:[Ge],props:{dark:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},timezone:{type:String,default:"Europe/Dublin"},convertedDateFormat:{type:String,default:"YYYY-MM-DDTHH:mm:ss"},currentDateFormat:{type:String,default:"YYYY-MM-DDTHH:mm:ssZ"},isFixedPosition:{type:Boolean,default:!0},isHidden:{type:Boolean,default:!0},deep:{type:Boolean,default:!0}},data(){return{search:"",isSearching:!1}},computed:{inputClasses(){return{"e-bg-gray-900 e-text-white e-ring-gray-700 focus:e-ring-2 focus:e-ring-blue-500 e-placeholder-gray-500":this.dark,"e-bg-white e-text-[#000057] e-ring-gray-300 focus:e-ring-2 hover:e-ring-gray-400 focus:e-ring-blue-500 e-placeholder-gray-400":!this.dark}}},watch:{search(t){t?t.length>=3&&this.$emit("search-results",this.searchObjectsByQuery(this.items,t)):this.$emit("reset")}},mounted(){!this.isHidden&&this.search.length>0?this.isSearching=!0:(this.$addEventListener("keydown",this.onKeyHandler),this.$addEventListener("keyup",this.onKeyHandler))},methods:{onInput(t){this.search=t.target.value},searchObjectsByQuery(t,e){return t.reduce((r,n,i)=>{const o=this.findMatchesInObject(n,e,[]);return o.length>0&&r.push({index:i,matches:o}),r},[])},findMatchesInObject(t,e,r){return Object.entries(t).reduce((n,[i,o])=>{const s=[...r,i],c=this.matchesQuery(o,e)?[{path:s,value:o}]:[];let a=[];this.deep&&Array.isArray(o)&&(a=o.flatMap((d,f)=>this.findMatchesInObject(d,e,[...s,`${f}`])));const l=this.deep&&typeof o=="object"&&o!==null?this.findMatchesInObject(o,e,s):[];return[...n,...c,...a,...l]},[])},matchesQuery(t,e){return`${this.isValidDate(t)?this.formattedTimestamp(t):t}`.toLowerCase().indexOf(e.toLowerCase())!==-1},isValidDate(t){return ke(t,this.currentDateFormat,!0).isValid()},formattedTimestamp(t){return ke.tz(t,this.timezone).format(this.convertedDateFormat)},onKeyHandler(t){const e=t,r=e.ctrlKey&&e.type==="keydown",n=e.shiftKey&&e.type==="keydown",i=["f","F"].includes(e.key)&&e.type==="keydown",o=e.key==="Escape"&&e.type==="keydown";i&&r&&n&&(this.isSearching=!0,this.$nextTick(()=>{const s=this.$refs.searchField;s&&s.focus()})),o&&(this.isSearching=!1,this.search="")}}}),wd="";var mc=function(){var e=this,r=e._self._c;return r("div",{directives:[{name:"show",rawName:"v-show",value:!e.isFixedPosition||e.isSearching,expression:"!isFixedPosition || isSearching"}],staticClass:"global-search e-relative",class:{"global-search--fixed e-p-4 e-bg-white e-m-3":e.isFixedPosition}},[r("div",{staticClass:"e-relative"},[r("input",e._g({directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],ref:"searchField",class:["global-search__field e-shadow-sm e-ring-1 e-ring-inset e-relative e-block e-w-full e-h-full disabled:e-cursor-not-allowed disabled:e-opacity-75 focus:e-outline-none e-border-0 e-text-sm e-placeholder-gray-400 e-px-4 e-py-3 e-gap-x-1.5 e-rounded-md",e.inputClasses],attrs:{id:"global-search-input",placeholder:"Search",autocomplete:"off",type:"text"},domProps:{value:e.search},on:{input:function(n){n.target.composing||(e.search=n.target.value)}}},e.$listeners)),r("span",{staticClass:"e-absolute e-inset-y-0 e-end-0 e-flex e-items-center e-justify-center e-pointer-events-none e-px-2.5"},[r("EIcon",{attrs:{icon:"search",size:"Sm"}})],1)])])},gc=[],vc=H(pc,mc,gc,!1,null,null,null,null);const hs=vc.exports,_c=F.extend({name:"ETooltip",props:{text:{type:String,required:!0},position:{type:String,default:Oe.Top},color:{type:String,default:se.Default},dark:{type:Boolean,default:!1}},data:function(){return{isHovered:!1}},computed:{tooltipClasses(){const t=this.position,e=this.color,r={"e-bg-gray-800 e-text-white":!this.dark,"e-bg-slate-300 e-text-slate-800":this.dark};return{"tooltip e-w-max e-text-sm e-text-center e-px-2 e-py-1 e-absolute e-rounded-md e-shadow-md e-opacity-0 group-hover:e-opacity-100 e-transition-opacity e-duration-300":!0,"tooltip-left":t===Oe.Left,"tooltip-right":t===Oe.Right,"tooltip-top":t===Oe.Top,"tooltip-bottom":t===Oe.Bottom,"e-bg-orange-700 e-text-white":e===se.Warning,"e-bg-red-700 e-text-white":e===se.Error,"e-bg-green-900 e-text-white":e===se.Success,"e-bg-blue-700 e-text-white":e===se.Primary,"e-bg-sky-500 e-text-white":e===se.Info,"e-bg-brand-900 e-text-white":e===se.Brand,"e-bg-gray-200 e-text-gray-700":e===se.Gray,...r}},triangleClasses(){const t=this.position,e=this.color;return{"triangle e-absolute e-border-transparent":!0,"triangle-left":t===Oe.Left,"triangle-right":t===Oe.Right,"triangle-top":t===Oe.Top,"triangle-bottom":t===Oe.Bottom,"e-border-b-gray-800":e===se.Default,"e-border-b-orange-700":e===se.Warning,"e-border-b-red-700":e===se.Error,"e-border-b-green-900":e===se.Success,"e-border-b-blue-700":e===se.Primary,"e-border-b-sky-500":e===se.Info,"e-border-b-brand-900":e===se.Brand,"e-border-b-gray-900":e===se.Gray}}},methods:{toggleTooltip(){this.isHovered=!this.isHovered}}}),Sd="";var yc=function(){var e=this,r=e._self._c;return r("div",{staticClass:"tooltip-box e-w-max e-relative e-group",on:{mouseenter:e.toggleTooltip,mouseleave:e.toggleTooltip}},[e._t("default"),e.isHovered?r("div",{class:e.tooltipClasses},[r("span",{class:e.triangleClasses}),e._v(" "+e._s(e.text)+" ")]):e._e()],2)},Cc=[],bc=H(_c,yc,Cc,!1,null,"3ebb5ef2",null,null);const St=bc.exports,xc=F.extend({name:"EActionButton",components:{ETooltip:St,EIcon:We},props:{tooltipText:{type:String,default:null},tooltipColor:{type:String,default:"default"},tooltipPosition:{type:String,default:"top"},buttonClasses:{type:[String,Object,Array],default:null},icon:{type:String,default:null},iconSize:{type:String,default:K.Sm},iconColor:{type:String,default:se.Default},dark:{type:Boolean,default:!0}},computed:{withTooltip(){return!!this.tooltipText},buttonClassesContainsBg(){return this.buttonClasses?typeof this.buttonClasses=="string"&&this.buttonClasses.split("e-bg-").length>1||typeof this.buttonClasses=="object"&&Object.keys(this.buttonClasses).some(t=>t.split("e-bg-").length>1):!1},buttonStyle(){const t=this.dark?"e-bg-gray-900 e-text-white hover:e-bg-gray-700":"e-bg-white text-e-text-gray-900 hover:e-bg-gray-100";return this.buttonClassesContainsBg?this.buttonClasses:[this.buttonClasses,t]}}});var wc=function(){var e=this,r=e._self._c;return e.withTooltip?r("ETooltip",{attrs:{text:e.tooltipText,position:e.tooltipPosition,color:e.tooltipColor,dark:e.dark}},[r("button",e._g(e._b({staticClass:"e-action-button e-w-max e-px-3 e-py-2 e-flex e-border-none e-justify-center e-align-middle e-items-center e-cursor-pointer",class:e.buttonStyle},"button",e.$attrs,!1),e.$listeners),[r("EIcon",{attrs:{icon:e.icon,size:e.iconSize,color:e.iconColor}}),e._t("default")],2)]):r("button",e._g(e._b({staticClass:"e-action-button e-w-max e-px-3 e-py-2 e-flex e-border-none e-justify-center e-align-middle e-items-center e-cursor-pointer",class:e.buttonStyle},"button",e.$attrs,!1),e.$listeners),[r("EIcon",{attrs:{icon:e.icon,size:e.iconSize}}),e._t("default")],2)},Sc=[],Tc=H(xc,wc,Sc,!1,null,null,null,null);const ft=Tc.exports,kc=F.extend({name:"EZoomSlider",components:{EActionButton:ft},props:{dark:{type:Boolean,default:!0}}});var $c=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{staticClass:"e-zoom-slider e-flex e-flex-col e-p-5"},[r("EActionButton",{attrs:{"tooltip-text":"Zoom in","tooltip-position":"right",icon:"fas fa-plus",dark:e.dark,"icon-size":"Base","button-classes":"action-btn__first-vertical e-border-none e-rounded-none e-rounded-t-md e-shadow-xl","data-test-id":"zoomable-img-zoom-in"},on:{click:function(n){return e.$emit("zoom-in")}}}),r("EActionButton",{attrs:{"tooltip-text":"Zoom out","tooltip-position":"right",icon:"fas fa-minus",dark:e.dark,"icon-size":"Base","button-classes":"action-btn__last-vertical e-border-none e-rounded-none e-rounded-b-md","data-test-id":"zoomable-img-zoom-out"},on:{click:function(n){return e.$emit("zoom-out")}}})],1)},Ec=[],Mc=H(kc,$c,Ec,!1,null,null,null,null);const fn=Mc.exports,Lc=F.extend({name:"EFadeTransition",props:{duration:{type:Number,default:300}},computed:{durationClass(){return{100:"e-duration-100",200:"e-duration-200",300:"e-duration-300",400:"e-duration-400",500:"e-duration-500",600:"e-duration-600",700:"e-duration-700",800:"e-duration-800",900:"e-duration-900",1e3:"e-duration-1000"}[this.duration]}}});var Dc=function(){var e=this,r=e._self._c;return r("transition",{attrs:{"enter-active-class":`e-transition e-ease-out ${e.durationClass}`,"leave-active-class":`e-transition e-ease-in ${e.durationClass}`,"enter-class":"e-opacity-0","enter-to-class":"e-opacity-100","leave-class":"e-opacity-100","leave-to-class":"e-opacity-0"}},[e._t("default")],2)},Pc=[],Oc=H(Lc,Dc,Pc,!1,null,null,null,null);const Nt=Oc.exports,zc=F.extend({name:"EZoomableImg",components:{EZoomSlider:fn,EFadeTransition:Nt},directives:{ResizeObserver:Ve},mixins:[Ue,Ge],props:{src:{type:String,default:""},alt:{type:String,default:""},allowZoom:{type:Boolean,default:!0},imgProps:{type:Object,default:()=>({})},slider:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},hideContentOnBlur:{type:Boolean,default:!0},initialParams:{type:Object,default:()=>({})},embedded:{type:Boolean,default:!1},overlayStyle:{type:Object,default:()=>({})},foregroundStyle:{type:Object,default:()=>({})},pan:{type:Boolean,default:!0},slotTransition:{type:Boolean,default:!0},height:{type:[String,Number],default:void 0},isCalendarActive:{type:Boolean,default:!1},blurBackground:{type:Boolean,default:!1},cover:{type:Boolean,default:!1},isWidget:{type:Boolean,default:!1},isAnnotationActive:{type:Boolean,default:!1},isMobile:{type:Boolean,default:!1},placeholderImage:{type:String,default:""},showMiniature:{type:Boolean,default:!1},miniatureWidth:{type:Number,default:150}},data(){const t={x:0,y:0};return{image:null,frame:null,imageLoaded:!1,zoomLevel:1,previousZoomLevel:1,imageMouse:t,zoomOrigin:t,frameMouse:t,frameMousePanStart:t,frameMousePreviousPan:t,translation:t,isPanning:!1,isPinching:!1,zoomStarted:!1,firstLoad:!0,isSliderActive:!1,imgStyle:{},contentStyle:{},isFocused:!0,forceHideContent:!1,imageAspectRatio:1,frameAspectRatio:1,wrapperExtraStyle:{},preventDefaultScroll:!0,mouseLeft:!1,pointers:{},pinchDistance:0,lastTapTime:0,minZoomLevel:1,maxZoomLevel:20,backgroundSnapshotSrc:null,miniatureOverlayStyle:{}}},computed:{frameStyle(){return this.height?{height:`${this.height}px`}:{}},wrapperStyle(){if(!this.imageLoaded)return{display:"none"};let t,e;return this.isPanning&&!this.isAnnotationActive?(t=this.frameMouse.x-this.frameMousePanStart.x+this.frameMousePreviousPan.x,e=this.frameMouse.y-this.frameMousePanStart.y+this.frameMousePreviousPan.y):(t=this.frameMousePreviousPan.x,e=this.frameMousePreviousPan.y),{transform:Math.abs(t)<.5&&Math.abs(e)<.5?"none":`translate(${t}px,${e}px)`}},imageCenter(){var e;const t=(e=this.image)==null?void 0:e.getBoundingClientRect();return{x:((t==null?void 0:t.width)||0)/2,y:((t==null?void 0:t.height)||0)/2}},sliderModel:{get(){return this.zoomLevel*100},set(t){this.previousZoomLevel=this.zoomLevel,this.zoomLevel=t/100,this.updateImageStyle(),this.savePreviousPan()}},showContent(){return this.hideContentOnBlur?this.forceHideContent?!1:this.isFocused&&this.touches<2:!0},miniatureContainerStyle(){if(!this.image)return{};const t=this.image.naturalWidth/this.image.naturalHeight,e=this.miniatureWidth/t;return{width:`${this.miniatureWidth}px`,height:`${e}px`}},miniatureOverlayComputedStyle(){return{...this.miniatureOverlayStyle,...this.miniatureOverlayBaseStyle}},miniatureOverlayBaseStyle(){return{boxShadow:`0 0 0 ${this.miniatureWidth}px #0006`}},currentState(){var t,e;return{image:this.image,zoomLevel:this.zoomLevel,translation:this.translation,previousZoomLevel:this.previousZoomLevel,imageMouse:this.imageMouse,zoomOrigin:this.zoomOrigin,frameMouse:this.frameMouse,frameMousePanStart:this.frameMousePanStart,frameMousePreviousPan:this.frameMousePreviousPan,isPanning:this.isPanning,zoomStarted:this.zoomStarted,firstLoad:this.firstLoad,isSliderActive:this.isSliderActive,imgStyle:this.imgStyle,contentStyle:this.contentStyle,isFocused:this.isFocused,forceHideContent:this.forceHideContent,imageAspectRatio:this.imageAspectRatio,frameAspectRatio:this.frameAspectRatio,wrapperExtraStyle:this.wrapperExtraStyle,offsetWidth:(t=this.image)==null?void 0:t.offsetWidth,offsetHeight:(e=this.image)==null?void 0:e.offsetHeight}}},watch:{isCalendarActive(){this.$setTimeout(this.onResize,100)},initialParams:{immediate:!0,handler(t){if(typeof t=="object")for(let e in t)this[e]=t[e]}},image:{immediate:!0,deep:!0,handler(){var t;(t=this.image)!=null&&t.offsetWidth&&this.emitChange()}},wrapperStyle(){this.$nextTick(this.updateMiniatureOverlayStyle)},imageStyle(){this.$nextTick(this.updateMiniatureOverlayStyle)}},mounted(){this.$addEventListener("orientationchange",this.handleOrientationChange),this.$root.$on("resize-snapshot-player",()=>{this.$setTimeout(this.setAspectRatio,200)})},methods:{onResize(){this.updateContentStyle(),this.$setTimeout(this.setAspectRatio,500)},handleOrientationChange(){this.$setTimeout(this.setAspectRatio,1e3)},setAspectRatio(){var r,n;this.frame=this.$refs.frame,this.image=this.$refs.image;const t=(r=this.frame)==null?void 0:r.getBoundingClientRect(),e=(n=this.image)==null?void 0:n.getBoundingClientRect();if(this.$setTimeout(this.emitChange,50),!t||this.isMobile&&!this.isWidget&&(!e||(e==null?void 0:e.width)<=1||(e==null?void 0:e.height)<=1)){this.$setTimeout(this.setAspectRatio,50);return}this.frameAspectRatio=t.width/t.height,this.imageAspectRatio=e.width/e.height},updateImageStyle(){this.translation={x:this.zoomOrigin.x*(this.zoomLevel-this.previousZoomLevel)+this.translation.x,y:this.zoomOrigin.y*(this.zoomLevel-this.previousZoomLevel)+this.translation.y},this.imgStyle={...this.imgStyle,transform:`translate(${-this.translation.x}px, ${-this.translation.y}px) scale(${this.zoomLevel})`},this.emitChange()},updateMiniatureOverlayStyle(){if(!this.showMiniature||!this.image||!this.frame||!this.$refs.miniatureImage||this.zoomLevel===1){this.miniatureOverlayStyle={};return}const t=this.image.getBoundingClientRect(),e=this.frame.getBoundingClientRect(),r=(e.left-t.left)/t.width*100,n=(e.top-t.top)/t.height*100,i=e.width/t.width*100,o=e.height/t.height*100;this.miniatureOverlayStyle={left:`${r}%`,top:`${n}%`,width:`${i}%`,height:`${o}%`}},onImageLoaded(t){var n,i;if(this.imageLoaded=!0,this.wrapperExtraStyle={...this.wrapperExtraStyle,alignContent:"flex-start !important"},this.$setTimeout(()=>{this.wrapperExtraStyle={justifyContent:"center",alignContent:"center !important"}}),this.blurBackground&&(this.backgroundSnapshotSrc=this.getSnapshotSrc()),!this.firstLoad)return;this.updateContentStyle(),this.imageMouse=this.imageCenter,this.zoomOrigin=this.imageCenter;const e=(n=this.image)==null?void 0:n.getBoundingClientRect(),r=(i=this.frame)==null?void 0:i.getBoundingClientRect();!e||!r||(this.isMobile&&!this.isWidget?this.setAspectRatio():this.$nextTick(()=>{this.setAspectRatio(),this.firstLoad=!1}),this.updateImageStyle(),this.$emit("load",t))},onError(t){this.$emit("error",t)},onMouseEnter(){this.mouseLeft=!1,this.isFocused=!0},onMouseLeave(){this.isSliderActive||(this.isFocused=!1),this.mouseLeft=!0;const t={which:1,preventDefault:()=>{}};this.onMouseUp(t)},onMouseMove(t){var e;if(!(this.disabled||!this.imageLoaded||this.mouseLeft)&&this.frame){const r=this.frame.getBoundingClientRect(),n=(e=this.image)==null?void 0:e.getBoundingClientRect();this.frameMouse={x:(t==null?void 0:t.clientX)-r.left,y:(t==null?void 0:t.clientY)-r.top},this.imageMouse={x:((t==null?void 0:t.clientX)-(n==null?void 0:n.left))/this.zoomLevel,y:((t==null?void 0:t.clientY)-(n==null?void 0:n.top))/this.zoomLevel},this.zoomStarted&&(this.zoomStarted=!1),this.$nextTick(this.emitChange)}},onMousedown(t){if(!(!this.pan||this.disabled||!this.imageLoaded||(t==null?void 0:t.which)!==1||this.isSliderActive)){if(this.isAnnotationActive){this.frameMousePanStart={x:this.frameMouse.x,y:this.frameMouse.y},this.isPanning=!0,this.$nextTick(this.emitChange);return}t.preventDefault(),this.frameMousePanStart=this.frameMouse,this.isPanning=!0}},onMouseUp(t){if(!(!this.pan||this.disabled||!this.imageLoaded||!this.isPanning||(t==null?void 0:t.which)!==1||this.isSliderActive)){if(this.isAnnotationActive){this.isPanning=!1,this.$nextTick(this.emitChange);return}t.preventDefault(),this.savePreviousPan({x:this.frameMousePreviousPan.x+this.frameMouse.x-this.frameMousePanStart.x,y:this.frameMousePreviousPan.y+this.frameMouse.y-this.frameMousePanStart.y}),this.isPanning=!1,this.isPinching=!1,this.$nextTick(this.emitChange)}},onMouseWheel(t){this.disabled||!this.imageLoaded||!this.allowZoom||(this.zoom(t.deltaY),this.preventDefaultScroll&&t.preventDefault())},updateZoomLevel(t){let e=1;this.isMobile?e=this.zoomLevel*t:t<0?e=this.zoomLevel*1.2:this.zoomLevel>=1.25&&(e=this.zoomLevel*.8),e<this.minZoomLevel?this.zoomLevel=this.minZoomLevel:e>this.maxZoomLevel?this.zoomLevel=this.maxZoomLevel:this.zoomLevel=e},zoom(t){this.isPanning=!1,this.previousZoomLevel=this.zoomLevel,this.updateZoomLevel(t),this.preventDefaultScroll=this.previousZoomLevel!==this.zoomLevel,this.zoomStarted||(this.zoomOrigin=this.imageMouse,this.zoomStarted=!0),this.updateImageStyle(),this.$nextTick(()=>{this.savePreviousPan(),this.emitChange()})},getBounds(){var a,l;const t=(a=this.frame)==null?void 0:a.getBoundingClientRect(),e=(l=this.image)==null?void 0:l.getBoundingClientRect(),r=t.width/this.imageAspectRatio,n=t.height*this.imageAspectRatio;let{top:i,right:o,bottom:s,left:c}=t;return e.width<t.width?(c=t.left+(t.width-n)/2,o=c+n):e.height<t.height&&(i=t.top+(t.height-r)/2,s=i+r),{top:i,right:o,bottom:s,left:c}},savePreviousPan({x:t,y:e}={}){var r;if(this.image){const n=(r=this.image)==null?void 0:r.getBoundingClientRect(),i=this.getBounds(),[o,s,c,a]=[n.right-i.right,i.top-n.top,n.bottom-i.bottom,i.left-n.left].map(l=>l<0?l:0);this.frameMousePreviousPan={x:(t||this.frameMousePreviousPan.x)+a-o,y:(e||this.frameMousePreviousPan.y)+s-c}}},onSliderMouseDown(){var r,n;const t=(r=this.frame)==null?void 0:r.getBoundingClientRect(),e=(n=this.image)==null?void 0:n.getBoundingClientRect();this.zoomOrigin={x:((t==null?void 0:t.left)+(t==null?void 0:t.width)/2-(e==null?void 0:e.left))/this.zoomLevel,y:((t==null?void 0:t.top)+(t==null?void 0:t.height)/2-(e==null?void 0:e.top))/this.zoomLevel},this.isSliderActive=!0},onSliderMouseUp(){this.isSliderActive=!1},updateContentStyle(){var t,e,r;this.contentStyle={maxWidth:`${window.innerWidth-(((r=(e=(t=this.$refs)==null?void 0:t.frame)==null?void 0:e.getBoundingClientRect())==null?void 0:r.left)||0)}px`}},emitChange(){this.$emit("change",this.currentState)},getPointersMidPoint(t,e){return{x:t.clientX+(e.clientX-t.clientX)/2,y:t.clientY+(e.clientY-t.clientY)/2}},getPointersDistance(t,e){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)},updatePointerEvent(t){this.pointers[t.pointerId]=t},clearPointerEvent(t){this.$delete(this.pointers,t.pointerId)},updatePinchZoomOrigin(){const t=Object.values(this.pointers);if(t.length!==2)return;const e=this.getPointersMidPoint(...t);this.zoomOrigin={x:e.x/this.zoomLevel,y:e.y/this.zoomLevel}},updatePinchDistance(){const t=Object.values(this.pointers);t.length===2&&(this.pinchDistance=this.getPointersDistance(...t))},onPointerDown(t){if(!(!this.isMobile||this.foregroundStyle.zIndex==2)){if(this.updatePointerEvent(t),this.isPinching=Object.values(this.pointers).length===2,this.isPinching){this.isPanning=!1,this.updatePinchZoomOrigin(),this.updatePinchDistance();return}this.onMouseMove(t),this.onMousedown(t)}},onPointerMove(t){if(!(!this.isMobile||this.foregroundStyle.zIndex==2)){if(this.updatePointerEvent(t),this.isPinching){const e=this.pinchDistance;this.updatePinchDistance();const r=this.pinchDistance/e;r%1>.008&&this.zoom(r);return}this.onMouseMove(t)}},onPointerUp(t){if(!this.isMobile||this.foregroundStyle.zIndex==2)return;this.clearPointerEvent(t),this.onMouseUp(t);const e=new Date().getTime(),r=e-this.lastTapTime;r>100&&r<200&&this.zoom(this.zoomLevel>1?0:3),this.lastTapTime=e},getSnapshotSrc(){const t=this.$refs.image;return t==null?void 0:t.src}}}),Td="";var Bc=function(){var n;var e=this,r=e._self._c;return r("div",e._b({directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.onResize,expression:"onResize"}],ref:"frame",staticClass:"zoomable-img e-flex e-justify-center e-items-center e-relative",class:{"zoomable-img--loading":!e.imageLoaded,"zoomable-img--zoomed":e.zoomLevel>1,"zoomable-img--panning":e.isPanning,"zoomable-img--disabled":e.disabled,"zoomable-img--portrait-frame":e.frameAspectRatio<e.imageAspectRatio,"zoomable-img--landscape-frame":e.frameAspectRatio>=e.imageAspectRatio,"zoomable-img--embedded":e.embedded,"zoomable-img--cover":e.cover},style:e.frameStyle,attrs:{"data-test-id":"zoomable-img-frame"},on:{wheel:e.onMouseWheel,mouseup:e.onMouseUp,mousedown:e.onMousedown,mousemove:e.onMouseMove,mouseenter:e.onMouseEnter,mouseleave:e.onMouseLeave,pointerdown:e.onPointerDown,pointermove:e.onPointerMove,pointerup:e.onPointerUp,pointercancel:e.onPointerUp,pointerout:e.onPointerUp,pointerleave:e.onPointerUp}},"div",e.$attrs,!1),[r("div",{staticClass:"zoomable-img__wrapper e-flex e-justify-center e-items-center",style:{...e.wrapperStyle,...e.wrapperExtraStyle},attrs:{"data-test-id":"zoomable-img-wrapper"}},[e.blurBackground&&e.imageLoaded&&e.backgroundSnapshotSrc?r("img",{class:e.isMobile?"zoomable-img__img-background-mobile":"zoomable-img__img-background",style:e.imgStyle,attrs:{src:e.backgroundSnapshotSrc,alt:e.alt}}):e._e(),r("img",e._g(e._b({directives:[{name:"show",rawName:"v-show",value:e.imageLoaded||!!e.placeholderImage,expression:"imageLoaded || !!placeholderImage"}],ref:"image",staticClass:"zoomable-img__img e-absolute",style:e.imgStyle,attrs:{src:(n=e.src)!=null?n:e.placeholderImage,alt:e.alt,crossorigin:"anonymous","data-test-id":"zoomable-img-image"},on:{load:e.onImageLoaded,error:e.onError}},"img",e.$props.imgProps,!1),e.$listeners))]),r("div",{staticClass:"zoomable-img__wrapper zoomable-img__wrapper--overlay e-flex e-justify-center e-items-center",style:{...e.wrapperStyle,...e.wrapperExtraStyle,...e.overlayStyle}},[r("div",{staticClass:"zoomable-img__img e-relative",style:{width:`${e.image?e.image.offsetWidth:0}px`,height:`${e.image?e.image.offsetHeight:0}px`,...e.imgStyle}},[e._t("imageOverlay",null,{state:e.currentState})],2)]),r("div",{ref:"foreground",staticClass:"zoomable-img__content e-flex e-justify-center e-items-center e-p-0",class:{"e-h-full":!e.embedded,"e-w-full":!e.embedded},style:{...e.contentStyle,...e.foregroundStyle},attrs:{id:"img-foreground","data-test-id":"zoomable-img-foreground"}},[e.imageLoaded?e._e():e._t("placeholder",null,{dataTestId:"zoomable-img-placeholder"}),e.showContent&&e.slotTransition?r("EFadeTransition",[e.showContent?e._t("default",null,{dataTestId:"zoomable-img-content"}):e._e()],2):e.showContent?e._t("default",null,{dataTestId:"zoomable-img-content"}):e._e(),r("EFadeTransition",[e.showContent&&e.slider&&e.allowZoom?r("div",{staticClass:"zoomable-img__slider-container",attrs:{"data-test-id":"zoomable-img-zoom-slider"}},[e._t("extraWidgets"),r("EZoomSlider",{attrs:{vertical:""},on:{mouseup:e.onSliderMouseUp,mousedown:e.onSliderMouseDown,"zoom-in":function(i){return e.zoom(-1)},"zoom-out":function(i){return e.zoom(1)}},model:{value:e.sliderModel,callback:function(i){e.sliderModel=i},expression:"sliderModel"}})],2):e._e()]),r("EFadeTransition",[e.showMiniature&&e.imageLoaded&&e.zoomLevel>1?r("div",{staticClass:"zoomable-img__miniature-container e-shadow",style:e.miniatureContainerStyle},[r("img",{ref:"miniatureImage",staticClass:"zoomable-img__miniature",attrs:{src:e.src,alt:e.alt}}),r("div",{staticClass:"zoomable-img__miniature-overlay",style:e.miniatureOverlayComputedStyle})]):e._e()])],2)])},Ic=[],Fc=H(zc,Bc,Ic,!1,null,null,null,null);const pn=Fc.exports,Ac=F.extend({name:"EImagePlayer",components:{EZoomableImg:pn},directives:{ResizeObserver:Ve},mixins:[Ue,Ge],model:{prop:"frameIndex",event:"update-frame-index"},props:{frames:{type:Array,required:!0},timePerFrame:{type:Number,default:500},isPlaying:{type:Boolean,default:!1},frameIndex:{type:Number,default:0},height:{type:[String,Number],default:0},initialQuality:{type:[String,Number],default:"auto"},preload:{type:Boolean,default:!0},preloadSize:{type:Number,default:10},resetIndexOnFramesChange:{type:Boolean,default:!1},preloadWhilePlaying:{type:Boolean,default:!0},withControls:{type:Boolean,default:!0},playOnClick:{type:Boolean,default:!0},disablePlayPauseAnimation:{type:Boolean,default:!1},disablePlayButton:{type:Boolean,default:!1},isLive:{type:Boolean,default:!1},selectedSnapshotQuality:{type:[String,Number],default:"auto"},placeholderImage:{type:String,default:""},isMobile:{type:Boolean,default:!1},isZoomable:{type:Boolean,default:!0},isAnnotationActive:{type:Boolean,default:!1},aspectRatio:{type:Number,default:null},preloadingQueueId:{type:Number,default:0}},data(){return{src:this.placeholderImage,imageLoaded:!1,playing:!1,playerStyle:{},image:null,previousSrc:"",resolveImageLoadingPromise:()=>({}),preloadedFrames:[],preloadingFramesImgs:[],frameError:!1,animationId:-1,imgStyle:{},previousFrameIndex:0,isFullscreen:!1,mouseDownTime:0,playPauseAnimation:!1,latestValidSnapshotTimestamp:"",progressBar:null,isDraggingCursor:!1,hovered:!1,mousePosition:{x:0,y:0},screenHeight:screen.height}},computed:{imgProps(){return{id:"zoomable-img__img",ref:"image",crossorigin:"anonymous",class:"zoomable-img__img e-absolute e-w-full e-h-full e-object-contain e-z-10 d-block",dataTestId:"zoomable-img-image"}},playerDimensions(){return{width:"100%",height:this.height}},isLastFrame(){return this.frameIndex===this.frames.length-1},altText(){var t,e;return`${((t=this.frames[this.frameIndex])==null?void 0:t.label)||""} ${((e=this.frames[this.frameIndex])==null?void 0:e.timestamp)||""}`},playedPercentage(){return this.isLastFrame?100:Math.abs(this.frameIndex/this.frames.length*100)},mouseToWidthRatio(){var t,e,r;return this.mousePosition.x/((r=(e=(t=this.progressBar)==null?void 0:t.getBoundingClientRect())==null?void 0:e.width)!=null?r:1)},hoverBarStyle(){return{width:`${100*this.mouseToWidthRatio}%`}},hoveredFrameIndex(){return Math.round(this.mouseToWidthRatio*(this.frames.length-1))},progressStyle(){return{width:`${100*((this.isDraggingCursor?this.hoveredFrameIndex:this.frameIndex)/(this.frames.length-1))}%`}},preloadedChunks(){const t=[...this.preloadedFrames];return t.sort((e,r)=>e>r?1:-1),t.reduce((e,r)=>{if(!e.length)return[[r,r]];const[n,i]=e.slice(-1)[0]||[0,0];return r-i>1?[...e,[r,r]]:[...e.slice(0,-1),[n,r]]},[])}},watch:{frames:{handler(){var t;this.src=((t=this.frames[this.frameIndex])==null?void 0:t.src)||"",this.resetIndexOnFramesChange&&this.$emit("update-frame-index",0),this.imageLoaded=!0,this.preloadedFrames=[],this.flushPreloadingQueue(),this.$setTimeout(async()=>{this.updateRefs(),await this.loadTargetFrame(),this.handleBuffering()})},immediate:!0,deep:!0},isLastFrame(t){t&&this.$emit("frames-ended")},frameIndex:{immediate:!0,async handler(){this.frameIndex&&this.frameIndex===this.previousFrameIndex||(Number.isNaN(this.frameIndex)&&this.$emit("update-frame-index",0),this.frameIndex===0&&(this.previousFrameIndex=this.frameIndex),this.isLastFrame&&!this.isLive&&(this.playing=!1),this.playing||(this.cancelDelay(),await this.loadTargetFrame(),this.handleBuffering()))}},playing:{immediate:!0,async handler(t){t?this.play():this.pause(),this.animatePlayPauseOverlay()}},preloadedFrames:{handler(t,e){this.$emit("preloaded-frames-change",t)}},isPlaying:{immediate:!0,async handler(){this.playing=this.isPlaying}},selectedSnapshotQuality(){var t;this.src=(t=this.getFrameSrc(this.frames[this.frameIndex]))!=null?t:this.frames[this.frameIndex].src},isLive:{immediate:!0,handler(t){var e;t||(this.src=(e=this.frames[this.frameIndex])==null?void 0:e.src)}},imageLoaded(t){this.$emit("loading",!t)}},mounted(){this.$setTimeout(()=>{this.initializeFullscreenListeners(),this.progressBar=this.$refs.progressBar,this.$addEventListener("keydown",this.handleKeyDown)})},beforeDestroy(){this.cancelDelay(),this.flushPreloadingQueue(),this.removeFullscreenListeners()},methods:{getProgressBarMousePosition(t){var r;if(!this.progressBar)return{x:0,y:0};const e=(r=this.progressBar)==null?void 0:r.getBoundingClientRect();return{x:t.clientX-e.x,y:t.clientY-e.y}},onProgressBarMouseEnter(){this.hovered=!0},onProgressBarMouseMove(t){this.mousePosition=this.getProgressBarMousePosition(t)},onProgressBarMouseLeave(){this.hovered=!1,this.isDraggingCursor=!1},onProgressBarClick(){this.$emit("update-frame-index",this.hoveredFrameIndex),this.$emit("seek",this.hoveredFrameIndex)},getProgressBarChunkStyle(t,e){const[r,n]=[100*t/(this.frames.length-1),100*e/(this.frames.length-1)];return{left:`${r}%`,width:`${n-r}%`}},animatePlayPauseOverlay(){this.disablePlayPauseAnimation||(this.playPauseAnimation=!0,this.$setTimeout(()=>this.playPauseAnimation=!1,500))},isImageClick(t){const e=t==null?void 0:t.target;return e?e&&(e.id==="img-foreground"||typeof e.className=="string"&&e.className.indexOf("zoomable-img__img")!==-1):!1},onFrameMouseDown(t){!this.isImageClick(t)||!this.playOnClick||(this.mouseDownTime=new Date().getTime())},onFrameMouseUp(t){this.isLastFrame||this.disablePlayButton||!this.playOnClick||this.isAnnotationActive||!this.isImageClick(t)||new Date().getTime()-this.mouseDownTime>200||(this.playing=!this.playing)},removeFullscreenListeners(){const t=document;t.fullscreenEnabled||t.webkitFullscreenEnabled||t.mozFullScreenEnabled||t.msFullscreenEnabled?(t.removeEventListener("fullscreenchange",this.handleFullscreenChange),t.removeEventListener("webkitfullscreenchange",this.handleFullscreenChange),t.removeEventListener("mozfullscreenchange",this.handleFullscreenChange),t.removeEventListener("MSFullscreenChange",this.handleFullscreenChange)):console.log("Fullscreen API is not supported in this browser.")},initializeFullscreenListeners(){const t=document;t.fullscreenEnabled||t.webkitFullscreenEnabled||t.mozFullScreenEnabled||t.msFullscreenEnabled?(t.addEventListener("fullscreenchange",this.handleFullscreenChange),t.addEventListener("webkitfullscreenchange",this.handleFullscreenChange),t.addEventListener("mozfullscreenchange",this.handleFullscreenChange),t.addEventListener("MSFullscreenChange",this.handleFullscreenChange)):console.log("Fullscreen API is not supported in this browser.")},handleFullscreenChange(){const t=document;this.isFullscreen=!!t.fullscreenElement||!!t.mozFullScreenElement||!!t.webkitFullscreenElement||!!t.msFullscreenElement||window.innerWidth==screen.width&&window.innerHeight==screen.height},closeFullscreenMode(){document.fullscreenElement&&(Yr().then(()=>{this.isFullscreen=!1}),this.isFullscreen=!1)},openFullscreenMode(){const t=document.querySelector("#imagePlayer");t&&(Zr(t).then(()=>{this.isFullscreen=!0}),this.isFullscreen=!0)},toggleFullscreenMode(){this.isFullscreen?this.closeFullscreenMode():this.openFullscreenMode()},updateRefs(){var t,e,r;this.image=(r=(e=(t=this.$refs)==null?void 0:t.zoomableImage)==null?void 0:e.$refs)==null?void 0:r.image},incrementCurrentFrameIndex(){const t=this.frameIndex+1;this.frames[t]&&this.$emit("update-frame-index",t)},getFrameSrc(t){if(t)return t.srcSet?t.srcSet[this.selectedSnapshotQuality]:t.src},loadTargetFrame(){if(!(this.frameIndex&&this.frameIndex===this.previousFrameIndex))return new Promise(t=>{this.updateRefs(),this.previousSrc=this.src,this.previousFrameIndex=this.frameIndex,this.resolveImageLoadingPromise=t,this.src=this.getFrameSrc(this.frames[this.frameIndex])})},async handleBuffering(){this.preload&&await this.buffer()},async buffer(){let t=this.frameIndex+this.preloadSize;this.preloadSize===1/0&&(t=this.frames.length-1),await this.preloadFrames({start:this.frameIndex,end:t})},async preloadFrames({start:t,end:e}){const[r,n]=[Math.min(this.frames.length-1,t),Math.min(this.frames.length-1,e)],i=new Array(n-r+1).fill(0).map((s,c)=>s+r+c),o=this.preloadingQueueId;for(const s of i){if(o!==this.preloadingQueueId||this.playing&&!this.preloadWhilePlaying)return;this.preloadedFrames.includes(s)||await new Promise(a=>{const l=new Image;l.onload=()=>{this.preloadedFrames=[...this.preloadedFrames,s],a()},l.onerror=()=>{a()},this.preloadingFramesImgs=[...this.preloadingFramesImgs,l];const d=this.getFrameSrc(this.frames[s]);s||a(),l.src=d})}},async delay(){return this.frameError?(this.frameError=!1,Promise.resolve()):new Promise(t=>{const e=performance.now(),r=n=>{n-e<this.timePerFrame?this.animationId=window.requestAnimationFrame(r):t()};this.animationId=window.requestAnimationFrame(r)})},cancelDelay(){window.cancelAnimationFrame(this.animationId)},async play(){var r,n;const t=performance.now();if(this.isLastFrame&&!this.isLive){this.$emit("update-frame-index",0);return}this.$emit("update-playback",!0),this.playing=!0,this.cancelDelay(),this.incrementCurrentFrameIndex(),await this.$nextTick(),await this.loadTargetFrame(),this.handleBuffering(),await this.delay(),this.playing&&this.play();const e=performance.now();this.$emit("performance-intervals-changed",{id:(r=this.frames[this.frameIndex])==null?void 0:r.timestamp,frame:(n=this.frames[this.frameIndex])==null?void 0:n.label,duration:e-t})},flushPreloadingQueue(){this.$emit("cancel-previous-preloading"),this.preloadingFramesImgs.forEach(t=>{t.src=""}),this.preloadingFramesImgs=[]},async pause(){this.playing=!1,this.imageLoaded=!0,this.src=this.previousSrc,this.cancelDelay(),this.handleBuffering(),this.$emit("update-playback",!1)},onLoad(){var e,r,n,i;this.$emit("on-image-load",this.image),this.$emit("snapshot-changed",{data:(e=this.frames[this.frameIndex])==null?void 0:e.src,createdAt:(r=this.frames[this.frameIndex])==null?void 0:r.timestamp});const t=(i=(n=this.frames)==null?void 0:n[this.frameIndex])==null?void 0:i.timestamp;t&&this.$emit("timestamp-change",t),this.imageLoaded=!0,this.previousSrc=this.src,this.resolveImageLoadingPromise()},onError(t){if(this.frameIndex>1)return this.$emit("update-frame-index",this.frameIndex-1);this.frameError=!0,this.src=this.previousSrc,this.resolveImageLoadingPromise(),this.$emit("error",t)},onChange(t){this.$emit("change",t)},onBeforeUpdate(t){this.$emit("hook:beforeUpdate",t)},onBeforeDestroy(t){this.$emit("hook:beforeDestroy",t)},togglePlay(){this.playing=!this.playing},handleKeyDown(t){var r;const e=(r=document.activeElement)==null?void 0:r.tagName.toLowerCase();if(!(e==="input"||this.isAnnotationActive))switch(t.key.toLowerCase()){case" ":if(e==="button")return;this.disablePlayButton||this.togglePlay();break;case"escape":t.preventDefault(),this.closeFullscreenMode(),this.isFullscreen=!1;break}}}}),kd="";var Rc=function(){var n,i;var e=this,r=e._self._c;return r("div",{staticClass:"e-image-player player e-h-full e-w-full",style:e.playerDimensions,attrs:{id:"imagePlayer"}},[r("div",{staticClass:"player__frames player-container",style:e.playerDimensions,attrs:{id:"img-container"},on:{pointerdown:e.onFrameMouseDown,pointerup:e.onFrameMouseUp}},[r("div",{staticClass:"e-h-full e-w-full e-shrink-0 e-relative"},[r("img",{staticClass:"e-absolute e-block e-w-full e-h-full background-fade",attrs:{src:e.src||((n=e.frames[e.frameIndex])==null?void 0:n.src)||"",alt:"background-image"}}),r("EZoomableImg",e._g(e._b({directives:[{name:"show",rawName:"v-show",value:e.imageLoaded&&e.src||e.placeholderImage,expression:"(imageLoaded && src) || placeholderImage"}],ref:"zoomableImage",attrs:{"img-props":{imgProps:e.imgProps},"overlay-style":{zIndex:1},src:e.src||((i=e.frames[e.frameIndex])==null?void 0:i.src)||e.placeholderImage||"",alt:e.altText,"hide-content-on-blur":!1,height:e.height.split("px")[0],"placeholder-image":e.placeholderImage,slider:!1,"is-mobile":e.isMobile,disabled:!e.isZoomable,"is-annotation-active":e.isAnnotationActive,"blur-background":""},on:{load:e.onLoad,error:e.onError,change:e.onChange,"hook:beforeUpdate":e.onBeforeUpdate,"hook:beforeDestroy":e.onBeforeDestroy},scopedSlots:e._u([{key:"imageOverlay",fn:function(){return[e._t("default"),e._t("imageOverlay",null,{image:e.image})]},proxy:!0}],null,!0)},"EZoomableImg",e.$attrs,!1),e.$listeners),[e._t("player-container-overlay")],2),e.playPauseAnimation?r("div",{staticClass:"image-player-overlay e-flex e-items-center e-justify-center"},[r("div",{staticClass:"image-player-overlay__wrapper"},[e.playing?r("svg",{attrs:{height:"100%",viewBox:"-1 0 36 36",width:"100%"}},[r("path",{attrs:{d:"M 12,26 18.5,22 18.5,14 12,10 z M 18.5,22 25,18 25,18 18.5,14 z"}})]):r("svg",{attrs:{height:"100%",viewBox:"0.5 0 36 36",width:"100%"}},[r("path",{attrs:{d:"M 12,26 16,26 16,10 12,10 z M 21,26 25,26 25,10 21,10 z"}})])])]):e._e(),e._t("imagePlayerOverlay")],2)]),e._t("controls",function(){return[e.withControls?r("div",{staticClass:"e-absolute e-bottom-0 e-w-[97%] e-p-4 e-pt-8 e-z-50 e-space-y-4 e-bg-gradient-to-t e-from-[#363434] e-to-transparent"},[r("div",{staticClass:"e-font-semibold e-text-white"},[e._v(" "+e._s(e.frames[e.frameIndex].label)+" - "+e._s(e.frameIndex)+" / "+e._s(e.frames.length-1)+" ")]),r("div",{staticClass:"e-flex e-justify-start e-gap-2 e-items-center"},[r("button",{staticClass:"e-text-white e-bg-transparent e-border-none e-cursor-pointer action-btn__first-vertical e-rounded-md",on:{click:e.togglePlay}},[r("i",{staticClass:"fas fa-2x",class:{"fa-play":!e.playing,"fa-pause":e.playing}})]),r("div",{ref:"progressBar",staticClass:"e-w-full e-h-3 e-relative e-bg-gray-200 e-rounded-md",on:{click:e.onProgressBarClick,mouseenter:e.onProgressBarMouseEnter,mousemove:e.onProgressBarMouseMove,mouseleave:e.onProgressBarMouseLeave}},[r("div",{staticClass:"e-bg-blue-500 e-w-full e-h-full e-absolute e-rounded-md e-z-[1]",style:{width:`${e.playedPercentage}%`}}),e._l(e.preloadedChunks,function([o,s]){return r("div",{key:s,staticClass:"e-bg-blue-300 e-h-full e-absolute e-rounded-md",style:e.getProgressBarChunkStyle(o,s)})})],2),r("button",{ref:"fullScreenBtn",staticClass:"e-text-white e-bg-transparent e-border-none e-cursor-pointer action-btn__second-vertical e-rounded-md",on:{click:e.toggleFullscreenMode}},[r("i",{staticClass:"fas fa-2x",class:{"fa-expand":!e.isFullscreen,"fa-compress":e.isFullscreen}})])])]):e._e()]},{playing:e.playing,togglePlay:e.togglePlay,play:e.play,pause:e.pause,toggleFullscreen:e.toggleFullscreenMode,preloadedFrames:e.preloadedFrames,isLastFrame:e.isLastFrame})],2)},Hc=[],Nc=H(Ac,Rc,Hc,!1,null,null,null,null);const fs=Nc.exports,jc=F.extend({name:"ELayout",directives:{ResizeObserver:Ve},mixins:[Ue],props:{height:{type:[String,Number],default:null},withOverlay:{type:Boolean,default:!1}},data(){return{footerHeight:0,overlayFooterHeight:0,wrapperStyle:{width:"100%",height:"100%"},mainStyle:{width:"100%",height:"100%"},mainHeight:"100%"}},computed:{bottomStyle(){return{bottom:`${this.overlayFooterHeight}px`}}},watch:{mainHeight(){this.onResize()},height:{immediate:!0,handler(){this.onResize()}}},mounted(){this.setOverlayFooterHeight(),this.setFooterHeight()},methods:{onResize(){this.setFooterHeight(),this.setOverlayFooterHeight()},onOverlayClick(t){this.$emit("overlay-click",t)},setOverlayFooterHeight(){const t=this.$refs.overlayFooter;t||this.$setTimeout(()=>{this.setOverlayFooterHeight()}),this.overlayFooterHeight=t==null?void 0:t.clientHeight},setFooterHeight(){const t=this.$refs.footer;t||this.$setTimeout(()=>{this.setFooterHeight()}),this.footerHeight=t==null?void 0:t.clientHeight,this.$attrs.isFullscreen?this.mainHeight=`${screen.height}px`:this.mainHeight=`${this.height?this.height.split("px")[0]-this.footerHeight:"100"}px`,this.mainStyle={width:"100%",height:this.mainHeight}}}});var Gc=function(){var e=this,r=e._self._c;return r("div",e._b({directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.onResize,expression:"onResize"}],ref:"globalLayout",staticClass:"e-layout e-w-full e-h-full e-relative",style:{width:"100%",height:e.mainHeight},attrs:{id:"globalLayout"}},"div",e.$attrs,!1),[r("div",{staticClass:"e-layout__container e-relative",style:e.mainStyle},[r("div",{staticClass:"e-layout__main e-w-full e-h-full e-absolute e-inset-0 e-z-0",style:e.mainStyle},[e._t("main",null,{size:{...e.mainStyle}})],2),e.withOverlay?r("div",{staticClass:"e-layout__overlay e-w-full e-h-full e-absolute e-inset-0 e-z-[1]",style:e.mainStyle,on:{click:e.onOverlayClick}},[e._t("overlay",null,{size:{...e.mainStyle}})],2):e._e(),r("div",{staticClass:"e-layout__top-left e-absolute e-left-0 e-top-0 e-z-[2]"},[e._t("top-left")],2),r("div",{staticClass:"e-absolute e-right-0 e-top-0 e-layout__top-right e-z-[2]"},[e._t("top-right")],2),r("div",{staticClass:"e-absolute e-right-0 e-bottom-10 e-layout__bottom-right e-z-[2]",style:e.bottomStyle},[e._t("bottom-right")],2),r("div",{staticClass:"e-absolute e-left-0 e-bottom-10 e-layout__bottom-left e-z-[2]",style:e.bottomStyle},[e._t("bottom-left")],2),r("div",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.setOverlayFooterHeight,expression:"setOverlayFooterHeight"}],ref:"overlayFooter",staticClass:"e-absolute e-bottom-0 e-left-0 e-right-0 e-layout__overlay-footer e-z-[2]"},[e._t("overlay-footer")],2)]),r("div",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.setFooterHeight,expression:"setFooterHeight"}],ref:"footer",staticClass:"e-layout__footer e-relative e-z-[2]"},[e._t("footer")],2)])},qc=[],Wc=H(jc,Gc,qc,!1,null,null,null,null);const ps=Wc.exports;var Uc=H({name:"EContextProvider",provide(){return{...this.$props.context}},props:{context:{type:Object,required:!0}},render(){return this.$scopedSlots.default()}},null,null,!1,null,null,null,null);const Zc=Uc.exports,Yc=F.extend({name:"EChatWrapper",props:{dark:{type:Boolean,default:!1},embedded:{type:Boolean,default:!1}},computed:{borderClasses(){return this.embedded?{}:{"e-border-[1px] e-border-solid e-rounded-lg e-overflow-hidden":!0,"e-border-gray-300":!this.dark,"e-border-gray-600":this.dark}},wrapperClasses(){return{"e-bg-gray-800 e-text-white":this.dark,"e-bg-white e-text-gray-800":!this.dark,...this.borderClasses}}}}),Ld="";var Xc=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{staticClass:"e-chat-wrapper e-h-full",class:e.wrapperClasses},[e._t("default")],2)},Vc=[],Qc=H(Yc,Xc,Vc,!1,null,null,null,null);const Kc=Qc.exports,Jc=F.extend({name:"EChatHeader",components:{EAvatar:Mt},props:{size:{type:String,default:"xs"},backgroundClasses:{type:String,default:""}}}),Dd="";var eu=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("EAvatar",{staticClass:"e-evercam-logo",attrs:{image:"https://dash.evercam.io/evercam-logo.svg",size:e.size,"background-classes":e.backgroundClasses}})},tu=[],ru=H(Jc,eu,tu,!1,null,null,null,null);const ms=ru.exports,nu=F.extend({name:"EChatHeader",components:{EEvercamLogo:ms},props:{title:{type:String,default:"Evercam Copilot"},hidden:{type:Boolean,default:!1},dark:{type:Boolean,default:!1}},computed:{backgroundClasses(){return{"e-bg-gray-700":this.dark,"e-bg-gray-50":!this.dark}},headerClasses(){return{"e-hidden":this.hidden,...this.backgroundClasses}}}});var iu=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{staticClass:"e-chat-header e-flex e-items-center e-justify-between",class:e.headerClasses},[r("div",{staticClass:"e-chat-logo e-flex e-w-full e-items-center e-justify-start e-gap-2 e-px-5 e-py-4"},[e._t("logo",function(){return[r("div",{},[r("EEvercamLogo",{attrs:{size:"xs","background-classes":"e-bg-white e-p-[2px] e-rounded-full !e-pr-[2.5px] !e-pt-[3.5px]"}})],1)]}),r("div",{staticClass:"e-font-semibold e-h-min e-text-base"},[e._v(e._s(e.title))]),e._t("chip")],2),e._t("append")],2)},su=[],au=H(nu,iu,su,!1,null,null,null,null);const ou=au.exports,lu=F.extend({name:"EChatBody",directives:{ResizeObserver:Ve},props:{dark:{type:Boolean,default:!1}},data(){return{autoScroll:!0,previousChildCount:0,showGoToBottomButton:!1}},computed:{bodyClasses(){return{"e-custom-scrollbar--light":!this.dark,"e-custom-scrollbar--dark":this.dark}},goToBottomButtonClasses(){return{"e-text-gray-500":!this.dark,"e-text-gray-300":this.dark,"e-bg-gray-600":this.dark,"e-bg-gray-200":!this.dark}}},watch:{autoScroll(t){t&&this.scrollToBottom()}},mounted(){this.scrollToBottom()},methods:{onContentResized(){const e=this.$refs.contentWrapper.childElementCount;e!==this.previousChildCount&&(this.autoScroll=!0),this.autoScroll&&this.scrollToBottom(),this.previousChildCount=e},scrollToBottom(){const t=this.$refs.anchor;this.$nextTick(()=>{t.scrollIntoView({behavior:"smooth"})})},disableAutoScroll(){this.autoScroll=!1},onScroll(){const t=this.$refs.chatBody;t.scrollHeight-t.scrollTop<=t.clientHeight+1&&(this.autoScroll=!0),this.showGoToBottomButton=t.scrollHeight-t.scrollTop>t.clientHeight+100},onWheel(t){t.deltaY<0&&this.disableAutoScroll()},onKeyUp(t){["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)&&this.disableAutoScroll()},onTouch(){this.disableAutoScroll()},onTouchMove(){this.disableAutoScroll()}}}),Pd="";var cu=function(){var e=this,r=e._self._c;return r("div",e._b({ref:"chatBody",staticClass:"e-chat-body e-space-y-2 e-py-3 e-px-5 e-leading-6",class:e.bodyClasses,attrs:{tabindex:"0"},on:{scroll:e.onScroll,wheel:e.onWheel,keyup:function(n){return n.stopPropagation(),e.onKeyUp.apply(null,arguments)},touchstart:e.onTouch,touchmove:e.onTouchMove}},"div",e.$attrs,!1),[r("div",{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:e.onContentResized,expression:"onContentResized"}],ref:"contentWrapper",staticClass:"e-chat-body__content"},[e._t("default")],2),r("div",{ref:"anchor",staticClass:"e-chat-body__anchor"}),e.showGoToBottomButton?r("div",{staticClass:"e-chat-body__go-to-bottom e-sticky e-bottom-1 e-flex e-justify-center"},[r("button",{staticClass:"e-animate-bounce e-inline-flex e-items-center e-justify-center e-cursor-pointer e-h-8 e-w-8 e-border-none focus:e-outline-none e-rounded-full",class:e.goToBottomButtonClasses,on:{click:e.scrollToBottom}},[r("EIcon",{attrs:{icon:"arrow-down",size:"Base"}})],1)]):e._e()])},uu=[],du=H(lu,cu,uu,!1,null,null,null,null);const hu=du.exports,fu=F.extend({props:{size:{type:Number,default:12},color:{type:String,default:"#c5393d"},withDot:{type:Boolean,default:!0}},computed:{computedSize(){return`${this.size}px`},computedMargin(){return`${this.size/2}px`},computedShadowSize(){return`${this.size*2}px`},computedSecondaryColor(){return ht(this.color,0)||"#fff"},dotContainerStyle(){return{margin:`${this.computedMargin} auto`,width:this.computedSize,height:this.computedSize,position:"relative"}},shadowStyle(){return{width:this.computedSize,height:this.computedSize,"--boxShadowColor":ht(this.color,.7),"--backgroundColor":ht(this.color,.7),"--secondaryColor":this.computedSecondaryColor,"--shadowSize":this.computedShadowSize}},secondShadowStyle(){return{...this.shadowStyle,animationDelay:".33s",animationDuration:"2.3s"}},dotStyle(){return{width:this.computedSize,height:this.computedSize,backgroundColor:this.withDot?ht(this.color,1):void 0}}},methods:{toRgba:ht}}),Od="";var pu=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{staticClass:"e-pulsating-dot",style:e.dotContainerStyle},[r("span",{staticClass:"e-pulsating-dot__shadow",style:e.shadowStyle}),r("span",{staticClass:"e-pulsating-dot__shadow",style:e.secondShadowStyle}),r("div",{staticClass:"e-pulsating-dot__dot",style:e.dotStyle},[e._t("icon")],2)])},mu=[],gu=H(fu,pu,mu,!1,null,"cf575c64",null,null);const vu=gu.exports;var gs={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(typeof self!="undefined"?self:ot,()=>(()=>{var r={75:function(s){(function(){var c,a,l,d,f,m;typeof performance!="undefined"&&performance!==null&&performance.now?s.exports=function(){return performance.now()}:typeof process!="undefined"&&process!==null&&process.hrtime?(s.exports=function(){return(c()-f)/1e6},a=process.hrtime,d=(c=function(){var b;return 1e9*(b=a())[0]+b[1]})(),m=1e9*process.uptime(),f=d-m):Date.now?(s.exports=function(){return Date.now()-l},l=Date.now()):(s.exports=function(){return new Date().getTime()-l},l=new Date().getTime())}).call(this)},4087:(s,c,a)=>{for(var l=a(75),d=typeof window=="undefined"?a.g:window,f=["moz","webkit"],m="AnimationFrame",b=d["request"+m],x=d["cancel"+m]||d["cancelRequest"+m],h=0;!b&&h<f.length;h++)b=d[f[h]+"Request"+m],x=d[f[h]+"Cancel"+m]||d[f[h]+"CancelRequest"+m];if(!b||!x){var y=0,$=0,D=[];b=function(S){if(D.length===0){var R=l(),E=Math.max(0,16.666666666666668-(R-y));y=E+R,setTimeout(function(){var j=D.slice(0);D.length=0;for(var Q=0;Q<j.length;Q++)if(!j[Q].cancelled)try{j[Q].callback(y)}catch(U){setTimeout(function(){throw U},0)}},Math.round(E))}return D.push({handle:++$,callback:S,cancelled:!1}),$},x=function(S){for(var R=0;R<D.length;R++)D[R].handle===S&&(D[R].cancelled=!0)}}s.exports=function(S){return b.call(d,S)},s.exports.cancel=function(){x.apply(d,arguments)},s.exports.polyfill=function(S){S||(S=d),S.requestAnimationFrame=b,S.cancelAnimationFrame=x}}},n={};function i(s){var c=n[s];if(c!==void 0)return c.exports;var a=n[s]={exports:{}};return r[s].call(a.exports,a,a.exports,i),a.exports}i.n=s=>{var c=s&&s.__esModule?()=>s.default:()=>s;return i.d(c,{a:c}),c},i.d=(s,c)=>{for(var a in c)i.o(c,a)&&!i.o(s,a)&&Object.defineProperty(s,a,{enumerable:!0,get:c[a]})},i.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),i.o=(s,c)=>Object.prototype.hasOwnProperty.call(s,c);var o={};return(()=>{i.d(o,{default:()=>X});var s=i(4087),c=i.n(s);const a=function(I){return new RegExp(/<[a-z][\s\S]*>/i).test(I)},l=function(I,T){return Math.floor(Math.random()*(T-I+1))+I};var d="TYPE_CHARACTER",f="REMOVE_CHARACTER",m="REMOVE_ALL",b="REMOVE_LAST_VISIBLE_NODE",x="PAUSE_FOR",h="CALL_FUNCTION",y="ADD_HTML_TAG_ELEMENT",$="CHANGE_DELETE_SPEED",D="CHANGE_DELAY",S="CHANGE_CURSOR",R="PASTE_STRING",E="HTML_TAG";function j(I){return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(T){return typeof T}:function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},j(I)}function Q(I,T){var P=Object.keys(I);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(I);T&&(N=N.filter(function(ne){return Object.getOwnPropertyDescriptor(I,ne).enumerable})),P.push.apply(P,N)}return P}function U(I){for(var T=1;T<arguments.length;T++){var P=arguments[T]!=null?arguments[T]:{};T%2?Q(Object(P),!0).forEach(function(N){L(I,N,P[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(P)):Q(Object(P)).forEach(function(N){Object.defineProperty(I,N,Object.getOwnPropertyDescriptor(P,N))})}return I}function C(I){return function(T){if(Array.isArray(T))return z(T)}(I)||function(T){if(typeof Symbol!="undefined"&&T[Symbol.iterator]!=null||T["@@iterator"]!=null)return Array.from(T)}(I)||function(T,P){if(T){if(typeof T=="string")return z(T,P);var N=Object.prototype.toString.call(T).slice(8,-1);return N==="Object"&&T.constructor&&(N=T.constructor.name),N==="Map"||N==="Set"?Array.from(T):N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N)?z(T,P):void 0}}(I)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
243
243
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function z(I,T){(T==null||T>I.length)&&(T=I.length);for(var P=0,N=new Array(T);P<T;P++)N[P]=I[P];return N}function W(I,T){for(var P=0;P<T.length;P++){var N=T[P];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(I,Y(N.key),N)}}function L(I,T,P){return(T=Y(T))in I?Object.defineProperty(I,T,{value:P,enumerable:!0,configurable:!0,writable:!0}):I[T]=P,I}function Y(I){var T=function(P,N){if(j(P)!=="object"||P===null)return P;var ne=P[Symbol.toPrimitive];if(ne!==void 0){var _=ne.call(P,"string");if(j(_)!=="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(P)}(I);return j(T)==="symbol"?T:String(T)}const X=function(){function I(N,ne){var _=this;if(function(A,B){if(!(A instanceof B))throw new TypeError("Cannot call a class as a function")}(this,I),L(this,"state",{cursorAnimation:null,lastFrameTime:null,pauseUntil:null,eventQueue:[],eventLoop:null,eventLoopPaused:!1,reverseCalledEvents:[],calledEvents:[],visibleNodes:[],initialOptions:null,elements:{container:null,wrapper:document.createElement("span"),cursor:document.createElement("span")}}),L(this,"options",{strings:null,cursor:"|",delay:"natural",pauseFor:1500,deleteSpeed:"natural",loop:!1,autoStart:!1,devMode:!1,skipAddStyles:!1,wrapperClassName:"Typewriter__wrapper",cursorClassName:"Typewriter__cursor",stringSplitter:null,onCreateTextNode:null,onRemoveNode:null}),L(this,"setupWrapperElement",function(){_.state.elements.container&&(_.state.elements.wrapper.className=_.options.wrapperClassName,_.state.elements.cursor.className=_.options.cursorClassName,_.state.elements.cursor.innerHTML=_.options.cursor,_.state.elements.container.innerHTML="",_.state.elements.container.appendChild(_.state.elements.wrapper),_.state.elements.container.appendChild(_.state.elements.cursor))}),L(this,"start",function(){return _.state.eventLoopPaused=!1,_.runEventLoop(),_}),L(this,"pause",function(){return _.state.eventLoopPaused=!0,_}),L(this,"stop",function(){return _.state.eventLoop&&((0,s.cancel)(_.state.eventLoop),_.state.eventLoop=null),_}),L(this,"pauseFor",function(A){return _.addEventToQueue(x,{ms:A}),_}),L(this,"typeOutAllStrings",function(){return typeof _.options.strings=="string"?(_.typeString(_.options.strings).pauseFor(_.options.pauseFor),_):(_.options.strings.forEach(function(A){_.typeString(A).pauseFor(_.options.pauseFor).deleteAll(_.options.deleteSpeed)}),_)}),L(this,"typeString",function(A){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(a(A))return _.typeOutHTMLString(A,B);if(A){var w=(_.options||{}).stringSplitter,q=typeof w=="function"?w(A):A.split("");_.typeCharacters(q,B)}return _}),L(this,"pasteString",function(A){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a(A)?_.typeOutHTMLString(A,B,!0):(A&&_.addEventToQueue(R,{character:A,node:B}),_)}),L(this,"typeOutHTMLString",function(A){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,w=arguments.length>2?arguments[2]:void 0,q=function(ce){var le=document.createElement("div");return le.innerHTML=ce,le.childNodes}(A);if(q.length>0)for(var V=0;V<q.length;V++){var M=q[V],re=M.innerHTML;M&&M.nodeType!==3?(M.innerHTML="",_.addEventToQueue(y,{node:M,parentNode:B}),w?_.pasteString(re,M):_.typeString(re,M)):M.textContent&&(w?_.pasteString(M.textContent,B):_.typeString(M.textContent,B))}return _}),L(this,"deleteAll",function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"natural";return _.addEventToQueue(m,{speed:A}),_}),L(this,"changeDeleteSpeed",function(A){if(!A)throw new Error("Must provide new delete speed");return _.addEventToQueue($,{speed:A}),_}),L(this,"changeDelay",function(A){if(!A)throw new Error("Must provide new delay");return _.addEventToQueue(D,{delay:A}),_}),L(this,"changeCursor",function(A){if(!A)throw new Error("Must provide new cursor");return _.addEventToQueue(S,{cursor:A}),_}),L(this,"deleteChars",function(A){if(!A)throw new Error("Must provide amount of characters to delete");for(var B=0;B<A;B++)_.addEventToQueue(f);return _}),L(this,"callFunction",function(A,B){if(!A||typeof A!="function")throw new Error("Callback must be a function");return _.addEventToQueue(h,{cb:A,thisArg:B}),_}),L(this,"typeCharacters",function(A){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!A||!Array.isArray(A))throw new Error("Characters must be an array");return A.forEach(function(w){_.addEventToQueue(d,{character:w,node:B})}),_}),L(this,"removeCharacters",function(A){if(!A||!Array.isArray(A))throw new Error("Characters must be an array");return A.forEach(function(){_.addEventToQueue(f)}),_}),L(this,"addEventToQueue",function(A,B){var w=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return _.addEventToStateProperty(A,B,w,"eventQueue")}),L(this,"addReverseCalledEvent",function(A,B){var w=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return _.options.loop?_.addEventToStateProperty(A,B,w,"reverseCalledEvents"):_}),L(this,"addEventToStateProperty",function(A,B){var w=arguments.length>2&&arguments[2]!==void 0&&arguments[2],q=arguments.length>3?arguments[3]:void 0,V={eventName:A,eventArgs:B||{}};return _.state[q]=w?[V].concat(C(_.state[q])):[].concat(C(_.state[q]),[V]),_}),L(this,"runEventLoop",function(){_.state.lastFrameTime||(_.state.lastFrameTime=Date.now());var A=Date.now(),B=A-_.state.lastFrameTime;if(!_.state.eventQueue.length){if(!_.options.loop)return;_.state.eventQueue=C(_.state.calledEvents),_.state.calledEvents=[],_.options=U({},_.state.initialOptions)}if(_.state.eventLoop=c()(_.runEventLoop),!_.state.eventLoopPaused){if(_.state.pauseUntil){if(A<_.state.pauseUntil)return;_.state.pauseUntil=null}var w,q=C(_.state.eventQueue),V=q.shift();if(!(B<=(w=V.eventName===b||V.eventName===f?_.options.deleteSpeed==="natural"?l(40,80):_.options.deleteSpeed:_.options.delay==="natural"?l(120,160):_.options.delay))){var M=V.eventName,re=V.eventArgs;switch(_.logInDevMode({currentEvent:V,state:_.state,delay:w}),M){case R:case d:var ce=re.character,le=re.node,ie=document.createTextNode(ce),he=ie;_.options.onCreateTextNode&&typeof _.options.onCreateTextNode=="function"&&(he=_.options.onCreateTextNode(ce,ie)),he&&(le?le.appendChild(he):_.state.elements.wrapper.appendChild(he)),_.state.visibleNodes=[].concat(C(_.state.visibleNodes),[{type:"TEXT_NODE",character:ce,node:he}]);break;case f:q.unshift({eventName:b,eventArgs:{removingCharacterNode:!0}});break;case x:var Se=V.eventArgs.ms;_.state.pauseUntil=Date.now()+parseInt(Se);break;case h:var oe=V.eventArgs,ye=oe.cb,Ae=oe.thisArg;ye.call(Ae,{elements:_.state.elements});break;case y:var Be=V.eventArgs,$e=Be.node,Te=Be.parentNode;Te?Te.appendChild($e):_.state.elements.wrapper.appendChild($e),_.state.visibleNodes=[].concat(C(_.state.visibleNodes),[{type:E,node:$e,parentNode:Te||_.state.elements.wrapper}]);break;case m:var Me=_.state.visibleNodes,Ee=re.speed,Le=[];Ee&&Le.push({eventName:$,eventArgs:{speed:Ee,temp:!0}});for(var De=0,et=Me.length;De<et;De++)Le.push({eventName:b,eventArgs:{removingCharacterNode:!1}});Ee&&Le.push({eventName:$,eventArgs:{speed:_.options.deleteSpeed,temp:!0}}),q.unshift.apply(q,Le);break;case b:var Ke=V.eventArgs.removingCharacterNode;if(_.state.visibleNodes.length){var lt=_.state.visibleNodes.pop(),Tt=lt.type,Ze=lt.node,pt=lt.character;_.options.onRemoveNode&&typeof _.options.onRemoveNode=="function"&&_.options.onRemoveNode({node:Ze,character:pt}),Ze&&Ze.parentNode.removeChild(Ze),Tt===E&&Ke&&q.unshift({eventName:b,eventArgs:{}})}break;case $:_.options.deleteSpeed=V.eventArgs.speed;break;case D:_.options.delay=V.eventArgs.delay;break;case S:_.options.cursor=V.eventArgs.cursor,_.state.elements.cursor.innerHTML=V.eventArgs.cursor}_.options.loop&&(V.eventName===b||V.eventArgs&&V.eventArgs.temp||(_.state.calledEvents=[].concat(C(_.state.calledEvents),[V]))),_.state.eventQueue=q,_.state.lastFrameTime=A}}}),N)if(typeof N=="string"){var Z=document.querySelector(N);if(!Z)throw new Error("Could not find container element");this.state.elements.container=Z}else this.state.elements.container=N;ne&&(this.options=U(U({},this.options),ne)),this.state.initialOptions=U({},this.options),this.init()}var T,P;return T=I,(P=[{key:"init",value:function(){var N,ne;this.setupWrapperElement(),this.addEventToQueue(S,{cursor:this.options.cursor},!0),this.addEventToQueue(m,null,!0),!window||window.___TYPEWRITER_JS_STYLES_ADDED___||this.options.skipAddStyles||(N=".Typewriter__cursor{-webkit-animation:Typewriter-cursor 1s infinite;animation:Typewriter-cursor 1s infinite;margin-left:1px}@-webkit-keyframes Typewriter-cursor{0%{opacity:0}50%{opacity:1}100%{opacity:0}}@keyframes Typewriter-cursor{0%{opacity:0}50%{opacity:1}100%{opacity:0}}",(ne=document.createElement("style")).appendChild(document.createTextNode(N)),document.head.appendChild(ne),window.___TYPEWRITER_JS_STYLES_ADDED___=!0),this.options.autoStart===!0&&this.options.strings&&this.typeOutAllStrings().start()}},{key:"logInDevMode",value:function(N){this.options.devMode&&console.log(N)}}])&&W(T.prototype,P),Object.defineProperty(T,"prototype",{writable:!1}),I}()})(),o.default})())})(gs);var _u=gs.exports;const yu=yt(_u);class Cu{constructor(e,r){this.processor=null,this.accumulator="",this.totalMarkdown="",this.lastProcessedLength=0,this.regexRenderTargetsById={},this.isRenderingTable=!1,this.isFirstTableRender=!1,this.mdTableHeaderString="",this.isIncompleteTableRow=!1,this.pendingRowString="",this.tableId=0,this.rowId=0,this.typewriter=null,this.container=e,this.htmlRenderingTarget=e,this.exposedRegexes=r.exposedRegexes||[],this.useTableProcessor=!!r.useTableProcessor,this.initProcessor(),this.animated=!!r.animated,this.animated&&(this.typewriter=this.initTypewriter()),this.onAnimationStart=r.onAnimationStart||(()=>{}),this.onAnimationEnd=r.onAnimationEnd||(()=>{})}initProcessor(){this.processor=Zs.unified().use(Gs).use(this.remarkCheckIncompleteTableRows.bind(this)).use(En).use(En).use(js).use(qs,{allowDangerousHtml:!0}).use(Ws,{allowDangerousHtml:!0})}remarkCheckIncompleteTableRows(){return e=>{Us.visit(e,void 0,(r,n,i)=>{var c,a;const o=i,s=r.type;if(s==="text"&&this.exposedRegexes.forEach(({regex:l,type:d})=>{this.processTextNode(r,n,o,l,d)}),!!this.useTableProcessor&&(s==="table"&&!r.data&&(r.data={hProperties:{id:`t-${this.tableId}`}},this.mdTableHeaderString=this.extractTableHeaderString(r),this.setIsRenderingTable(!0)),s==="tableRow"&&!r.data&&(r.data={hProperties:{id:`r-${this.rowId++}`}}),s==="tableRow")){const l=o.children[0].children.length,d=r.children.length,f=this.accumulator.slice((c=r.position)==null?void 0:c.start.offset,(a=r.position)==null?void 0:a.end.offset);d<l?this.isIncompleteTableRow=!0:f.endsWith("|")?(this.isIncompleteTableRow=!1,this.pendingRowString=""):(this.pendingRowString=f,this.isIncompleteTableRow=!0)}})}}setIsRenderingTable(e){e&&!this.isRenderingTable&&(this.isFirstTableRender=!0),!e&&this.isRenderingTable&&this.startNewRenderingCycle(),this.isRenderingTable=e}startNewRenderingCycle(){const e=document.createElement("div");this.container.appendChild(e),this.htmlRenderingTarget=e,this.accumulator="",this.isRenderingTable&&(this.tableId++,this.mdTableHeaderString="",this.isIncompleteTableRow=!1,this.isRenderingTable=!1)}extractTableHeaderString(e){const r=e,n=r.children[0],i=r.align,o=n.children.map(c=>` ${c.children.map(l=>l.value).join("")} `).join("|"),s=i.map(c=>c==="left"?":---":c==="right"?"---:":c==="center"?":---:":"---").join("|");return`|${o}|
244
244
  |${s}|
245
245
  `}async processMarkdown(e){if(!this.processor)throw new Error("Processor not initialized");const r=await this.handleNewMarkdown(e);if(this.accumulator+=r,this.totalMarkdown+=r,this.isRenderingTable&&this.accumulator.length<30)return!1;const n=await this.processor.process(this.accumulator);if(this.isIncompleteTableRow)return this.isIncompleteTableRow=!1,!1;const i=n.toString();return i?(await this.render(i),this.lastProcessedLength=this.accumulator.length,!0):!1}async handleNewMarkdown(e){if(!e.includes(`